diff --git a/.github/build.in.yml b/.github/build.in.yml index bc21050c8b39e6..e5d846fc2ef234 100644 --- a/.github/build.in.yml +++ b/.github/build.in.yml @@ -38,7 +38,7 @@ jobs: lint-outcome: ${{ steps.lint.outcome }} mk_all-outcome: ${{ steps.mk_all.outcome }} noisy-outcome: ${{ steps.noisy.outcome }} - shake-outcome: ${{ steps.shake.outcome }} + # shake-outcome: ${{ steps.shake.outcome }} test-outcome: ${{ steps.test.outcome }} defaults: # On Hoskinson runners, landrun is already installed. run: # note that .pr-branch/.lake must be created in a step below before we use this @@ -238,6 +238,51 @@ jobs: echo "✅ All inputRevs in lake-manifest.json are valid" fi + - name: verify ProofWidgets lean-toolchain matches on versioned releases + # Only enforce this on the main mathlib4 repository, not on nightly-testing + if: github.repository == 'leanprover-community/mathlib4' + shell: bash + run: | + cd pr-branch + + # Read the lean-toolchain file + TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]') + echo "Lean toolchain: $TOOLCHAIN" + + # Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1) + if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then + echo "✓ Detected versioned Lean release: $TOOLCHAIN" + echo "Verifying ProofWidgets lean-toolchain matches..." + + # Check if ProofWidgets lean-toolchain exists + if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then + echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist" + echo "This file should be created by 'lake env' during dependency download." + exit 1 + fi + + # Read ProofWidgets lean-toolchain + PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]') + echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN" + + # Compare the two + if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then + echo "❌ Error: Lean toolchain mismatch!" + echo " Main lean-toolchain: $TOOLCHAIN" + echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN" + echo "" + echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z)," + echo "the ProofWidgets dependency must use the same toolchain." + echo "Please update the ProofWidgets dependency to use $TOOLCHAIN" + exit 1 + else + echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN" + fi + else + echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)" + echo "Skipping ProofWidgets toolchain verification." + fi + - name: get cache (1/3 - setup and initial fetch) id: get_cache_part1_setup shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun @@ -412,7 +457,7 @@ jobs: MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }} - name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean - if: always() + if: ${{ always() && steps.mk_all.outcome != 'skipped' }} run: | if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then echo "Please run 'lake exe mk_all' to regenerate the import all files" @@ -443,11 +488,13 @@ jobs: action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after. linters: gcc - - name: check for unused imports - id: shake - run: | - cd pr-branch - env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style + # With the arrival of the module system, the old `shake` is no longer functional. + # This will be replaced soon. + # - name: check for unused imports + # id: shake + # run: | + # cd pr-branch + # env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style - name: lint mathlib if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }} diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml index 3dac6efe2c2c31..f7c6f38592c0eb 100644 --- a/.github/workflows/bors.yml +++ b/.github/workflows/bors.yml @@ -48,7 +48,7 @@ jobs: lint-outcome: ${{ steps.lint.outcome }} mk_all-outcome: ${{ steps.mk_all.outcome }} noisy-outcome: ${{ steps.noisy.outcome }} - shake-outcome: ${{ steps.shake.outcome }} + # shake-outcome: ${{ steps.shake.outcome }} test-outcome: ${{ steps.test.outcome }} defaults: # On Hoskinson runners, landrun is already installed. run: # note that .pr-branch/.lake must be created in a step below before we use this @@ -248,6 +248,51 @@ jobs: echo "✅ All inputRevs in lake-manifest.json are valid" fi + - name: verify ProofWidgets lean-toolchain matches on versioned releases + # Only enforce this on the main mathlib4 repository, not on nightly-testing + if: github.repository == 'leanprover-community/mathlib4' + shell: bash + run: | + cd pr-branch + + # Read the lean-toolchain file + TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]') + echo "Lean toolchain: $TOOLCHAIN" + + # Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1) + if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then + echo "✓ Detected versioned Lean release: $TOOLCHAIN" + echo "Verifying ProofWidgets lean-toolchain matches..." + + # Check if ProofWidgets lean-toolchain exists + if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then + echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist" + echo "This file should be created by 'lake env' during dependency download." + exit 1 + fi + + # Read ProofWidgets lean-toolchain + PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]') + echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN" + + # Compare the two + if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then + echo "❌ Error: Lean toolchain mismatch!" + echo " Main lean-toolchain: $TOOLCHAIN" + echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN" + echo "" + echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z)," + echo "the ProofWidgets dependency must use the same toolchain." + echo "Please update the ProofWidgets dependency to use $TOOLCHAIN" + exit 1 + else + echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN" + fi + else + echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)" + echo "Skipping ProofWidgets toolchain verification." + fi + - name: get cache (1/3 - setup and initial fetch) id: get_cache_part1_setup shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun @@ -422,7 +467,7 @@ jobs: MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }} - name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean - if: always() + if: ${{ always() && steps.mk_all.outcome != 'skipped' }} run: | if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then echo "Please run 'lake exe mk_all' to regenerate the import all files" @@ -453,11 +498,13 @@ jobs: action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after. linters: gcc - - name: check for unused imports - id: shake - run: | - cd pr-branch - env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style + # With the arrival of the module system, the old `shake` is no longer functional. + # This will be replaced soon. + # - name: check for unused imports + # id: shake + # run: | + # cd pr-branch + # env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style - name: lint mathlib if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fc92258a1333b..a360361c98d47a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: lint-outcome: ${{ steps.lint.outcome }} mk_all-outcome: ${{ steps.mk_all.outcome }} noisy-outcome: ${{ steps.noisy.outcome }} - shake-outcome: ${{ steps.shake.outcome }} + # shake-outcome: ${{ steps.shake.outcome }} test-outcome: ${{ steps.test.outcome }} defaults: # On Hoskinson runners, landrun is already installed. run: # note that .pr-branch/.lake must be created in a step below before we use this @@ -255,6 +255,51 @@ jobs: echo "✅ All inputRevs in lake-manifest.json are valid" fi + - name: verify ProofWidgets lean-toolchain matches on versioned releases + # Only enforce this on the main mathlib4 repository, not on nightly-testing + if: github.repository == 'leanprover-community/mathlib4' + shell: bash + run: | + cd pr-branch + + # Read the lean-toolchain file + TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]') + echo "Lean toolchain: $TOOLCHAIN" + + # Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1) + if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then + echo "✓ Detected versioned Lean release: $TOOLCHAIN" + echo "Verifying ProofWidgets lean-toolchain matches..." + + # Check if ProofWidgets lean-toolchain exists + if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then + echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist" + echo "This file should be created by 'lake env' during dependency download." + exit 1 + fi + + # Read ProofWidgets lean-toolchain + PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]') + echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN" + + # Compare the two + if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then + echo "❌ Error: Lean toolchain mismatch!" + echo " Main lean-toolchain: $TOOLCHAIN" + echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN" + echo "" + echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z)," + echo "the ProofWidgets dependency must use the same toolchain." + echo "Please update the ProofWidgets dependency to use $TOOLCHAIN" + exit 1 + else + echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN" + fi + else + echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)" + echo "Skipping ProofWidgets toolchain verification." + fi + - name: get cache (1/3 - setup and initial fetch) id: get_cache_part1_setup shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun @@ -429,7 +474,7 @@ jobs: MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }} - name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean - if: always() + if: ${{ always() && steps.mk_all.outcome != 'skipped' }} run: | if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then echo "Please run 'lake exe mk_all' to regenerate the import all files" @@ -460,11 +505,13 @@ jobs: action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after. linters: gcc - - name: check for unused imports - id: shake - run: | - cd pr-branch - env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style + # With the arrival of the module system, the old `shake` is no longer functional. + # This will be replaced soon. + # - name: check for unused imports + # id: shake + # run: | + # cd pr-branch + # env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style - name: lint mathlib if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }} diff --git a/.github/workflows/build_fork.yml b/.github/workflows/build_fork.yml index 3a42c9fa9517bd..d83c8f05a8a1fc 100644 --- a/.github/workflows/build_fork.yml +++ b/.github/workflows/build_fork.yml @@ -52,7 +52,7 @@ jobs: lint-outcome: ${{ steps.lint.outcome }} mk_all-outcome: ${{ steps.mk_all.outcome }} noisy-outcome: ${{ steps.noisy.outcome }} - shake-outcome: ${{ steps.shake.outcome }} + # shake-outcome: ${{ steps.shake.outcome }} test-outcome: ${{ steps.test.outcome }} defaults: # On Hoskinson runners, landrun is already installed. run: # note that .pr-branch/.lake must be created in a step below before we use this @@ -252,6 +252,51 @@ jobs: echo "✅ All inputRevs in lake-manifest.json are valid" fi + - name: verify ProofWidgets lean-toolchain matches on versioned releases + # Only enforce this on the main mathlib4 repository, not on nightly-testing + if: github.repository == 'leanprover-community/mathlib4' + shell: bash + run: | + cd pr-branch + + # Read the lean-toolchain file + TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]') + echo "Lean toolchain: $TOOLCHAIN" + + # Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1) + if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then + echo "✓ Detected versioned Lean release: $TOOLCHAIN" + echo "Verifying ProofWidgets lean-toolchain matches..." + + # Check if ProofWidgets lean-toolchain exists + if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then + echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist" + echo "This file should be created by 'lake env' during dependency download." + exit 1 + fi + + # Read ProofWidgets lean-toolchain + PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]') + echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN" + + # Compare the two + if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then + echo "❌ Error: Lean toolchain mismatch!" + echo " Main lean-toolchain: $TOOLCHAIN" + echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN" + echo "" + echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z)," + echo "the ProofWidgets dependency must use the same toolchain." + echo "Please update the ProofWidgets dependency to use $TOOLCHAIN" + exit 1 + else + echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN" + fi + else + echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)" + echo "Skipping ProofWidgets toolchain verification." + fi + - name: get cache (1/3 - setup and initial fetch) id: get_cache_part1_setup shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun @@ -426,7 +471,7 @@ jobs: MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }} - name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean - if: always() + if: ${{ always() && steps.mk_all.outcome != 'skipped' }} run: | if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then echo "Please run 'lake exe mk_all' to regenerate the import all files" @@ -457,11 +502,13 @@ jobs: action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after. linters: gcc - - name: check for unused imports - id: shake - run: | - cd pr-branch - env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style + # With the arrival of the module system, the old `shake` is no longer functional. + # This will be replaced soon. + # - name: check for unused imports + # id: shake + # run: | + # cd pr-branch + # env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style - name: lint mathlib if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }} diff --git a/.github/workflows/check_pr_titles.yaml b/.github/workflows/check_pr_titles.yaml new file mode 100644 index 00000000000000..1c229556b4e8de --- /dev/null +++ b/.github/workflows/check_pr_titles.yaml @@ -0,0 +1,130 @@ +name: Check PR titles + +on: + pull_request_target: + types: + - opened + - edited + +# Limit permissions for GITHUB_TOKEN for the entire workflow +permissions: + contents: read + pull-requests: write # Only allow PR comments/labels + # All other permissions are implicitly 'none' + +jobs: + check_title: + if: github.repository == 'leanprover-community/mathlib4' && (github.event.action == 'opened' || (github.event.action == 'edited' && github.event.changes.title)) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: master + - name: Configure Lean + uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0 + with: + auto-config: false + use-github-cache: false + use-mathlib-cache: false + + - name: check the PR title format + id: pr-title-check + if: github.event.pull_request.draft == false && github.event.pull_request.base.ref == 'master' + env: + TITLE: ${{ github.event.pull_request.title }} + PR_LABELS: ${{ toJson(github.event.pull_request.labels) }} + run: | + set -o pipefail + echo "$TITLE" + + # Skip check if title starts with "[Merged by Bors] - " + if [[ "$TITLE" == "[Merged by Bors] - "* ]]; then + echo "Skipping check for Bors-merged PR" + exit 0 + fi + + label_names=$(echo "$PR_LABELS" | jq -r '.[].name') + echo "$label_names" + + # build command so build lines don't pollute `output` below + lake build check_title_labels + + set +e + # Capture output and exit code + output=$(lake exe check_title_labels --labels "$label_names" "$TITLE" 2>&1) + exit_code=$? + set -e + + if [ $exit_code -eq 0 ]; then + echo "Check passed" + else + # Set the output for use in subsequent steps + { + echo "errors< + Details on the required title format + + The title should fit the following format: + ``` + (): + ``` + `` is: + + - `feat` (feature) + - `fix` (bug fix) + - `doc` (documentation) + - `style` (formatting, missing semicolons, ...) + - `refactor` + - `test` (when adding missing tests) + - `chore` (maintain) + - `perf` (performance improvement, optimization, ...) + - `ci` (changes to continuous integration, repo automation, ...) + + `` is a name of module or a directory which contains changed modules. + This is not necessary to include, but may be useful if the `` is insufficient. + The `Mathlib` directory prefix is always omitted. + For instance, it could be + + - Data/Nat/Basic + - Algebra/Group/Defs + - Topology/Constructions + + `` has the following constraints: + + - do not capitalize the first letter + - no dot(.) at the end + - use imperative, present tense: "change" not "changed" nor "changes" + + + - name: Add comment that PR title is fixed + if: steps.pr-title-check.outcome == 'success' + uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4 + with: + header: 'PR Title Check' + # should do nothing if a 'PR Title Check' comment does not exist + only_update: true + message: | + ### ✅ PR Title Formatted Correctly + The title of this PR has been updated to match our [commit style conventions](https://leanprover-community.github.io/contribute/commit.html). + Thank you! diff --git a/.github/workflows/remove_deprecated_decls.yml b/.github/workflows/remove_deprecated_decls.yml index 088f5597f93811..fa235a485fdd77 100644 --- a/.github/workflows/remove_deprecated_decls.yml +++ b/.github/workflows/remove_deprecated_decls.yml @@ -168,13 +168,13 @@ jobs: id: get-branch-sha run: | # Check if the branch exists remotely - if git fetch origin "$BRANCH_NAME"; then - SHA=$(git rev-parse "origin/$BRANCH_NAME") + SHA=$(git ls-remote --heads origin "$BRANCH_NAME" | awk '{print $1}') + if [ -n "$SHA" ]; then echo "Branch '$BRANCH_NAME' exists with SHA: $SHA" echo "sha=$SHA" >> "${GITHUB_OUTPUT}" else echo "Branch '$BRANCH_NAME' does not exist" - echo "sha=" >>" ${GITHUB_OUTPUT}" + echo "sha=" >> "${GITHUB_OUTPUT}" fi - name: Get PR diff --git a/.github/workflows/update_dependencies.yml b/.github/workflows/update_dependencies.yml index 022b7f6c7a225d..7eec27a8dfcd5b 100644 --- a/.github/workflows/update_dependencies.yml +++ b/.github/workflows/update_dependencies.yml @@ -29,13 +29,13 @@ jobs: id: get-branch-sha run: | # Check if the branch exists remotely - if git fetch origin "$BRANCH_NAME"; then - SHA=$(git rev-parse "origin/$BRANCH_NAME") + SHA=$(git ls-remote --heads origin "$BRANCH_NAME" | awk '{print $1}') + if [ -n "$SHA" ]; then echo "Branch '$BRANCH_NAME' exists with SHA: $SHA" echo "sha=$SHA" >> "${GITHUB_OUTPUT}" else echo "Branch '$BRANCH_NAME' does not exist" - echo "sha=" >>" ${GITHUB_OUTPUT}" + echo "sha=" >> "${GITHUB_OUTPUT}" fi - name: Get PR and labels diff --git a/Archive/Hairer.lean b/Archive/Hairer.lean index 55e709d1705360..df0b497ee3f2a6 100644 --- a/Archive/Hairer.lean +++ b/Archive/Hairer.lean @@ -38,7 +38,7 @@ variable (𝕜 E F) in /-- The set of `C^n` functions supported in a set `s`, as a submodule of the space of functions. -/ def ContDiffSupportedOn (n : ℕ∞) (s : Set E) : Submodule 𝕜 (E → F) where carrier := { f : E → F | tsupport f ⊆ s ∧ ContDiff 𝕜 n f } - add_mem' hf hg := ⟨tsupport_add.trans <| union_subset hf.1 hg.1, hf.2.add hg.2⟩ + add_mem' hf hg := ⟨(tsupport_add _ _).trans <| union_subset hf.1 hg.1, hf.2.add hg.2⟩ zero_mem' := ⟨(tsupport_eq_empty_iff.mpr rfl).subset.trans (empty_subset _), contDiff_const (c := 0)⟩ smul_mem' r f hf := diff --git a/Archive/Imo/Imo1975Q1.lean b/Archive/Imo/Imo1975Q1.lean index 707bf67e4d745a..97d4e167168936 100644 --- a/Archive/Imo/Imo1975Q1.lean +++ b/Archive/Imo/Imo1975Q1.lean @@ -15,7 +15,7 @@ Let `x₁, x₂, ... , xₙ` and `y₁, y₂, ... , yₙ` be two sequences of re `x₁ ≥ x₂ ≥ ... ≥ xₙ` and `y₁ ≥ y₂ ≥ ... ≥ yₙ`. Prove that if `z₁, z₂, ... , zₙ` is any permutation of `y₁, y₂, ... , yₙ`, then `∑ (xᵢ - yᵢ)^2 ≤ ∑ (xᵢ - zᵢ)^2` -# Solution +## Solution Firstly, we expand the squares within both sums and distribute into separate finite sums. Then, noting that `∑ yᵢ ^ 2 = ∑ zᵢ ^ 2`, it remains to prove that `∑ xᵢ * zᵢ ≤ ∑ xᵢ * yᵢ`, which is true diff --git a/Archive/Imo/Imo1985Q2.lean b/Archive/Imo/Imo1985Q2.lean index c37f7450d9805e..7447bc36fc63f2 100644 --- a/Archive/Imo/Imo1985Q2.lean +++ b/Archive/Imo/Imo1985Q2.lean @@ -20,7 +20,7 @@ so that: Prove that all numbers in $N$ must receive the same color. -# Solution +## Solution Let $a \sim b$ denote that $a$ and $b$ have the same color. Because $j$ is coprime to $n$, every number in $N$ is of the form $kj\bmod n$ for a unique diff --git a/Archive/Imo/Imo1994Q1.lean b/Archive/Imo/Imo1994Q1.lean index 0ac63984ef4261..48cc8dcdd68271 100644 --- a/Archive/Imo/Imo1994Q1.lean +++ b/Archive/Imo/Imo1994Q1.lean @@ -18,7 +18,7 @@ such that for any two indices `i` and `j` with `1 ≤ i ≤ j ≤ m` and `aᵢ + there exists an index `k` such that `aᵢ + aⱼ = aₖ`. Show that `(a₁+a₂+...+aₘ)/m ≥ (n+1)/2` -# Sketch of solution +## Sketch of solution We can order the numbers so that `a₁ ≤ a₂ ≤ ... ≤ aₘ`. The key idea is to pair the numbers in the sum and show that `aᵢ + aₘ₊₁₋ᵢ ≥ n+1`. diff --git a/Archive/Imo/Imo1997Q3.lean b/Archive/Imo/Imo1997Q3.lean index 056aa82384ed5e..629add00cd6566 100644 --- a/Archive/Imo/Imo1997Q3.lean +++ b/Archive/Imo/Imo1997Q3.lean @@ -18,7 +18,7 @@ $|x_1 + x_2 + \cdots + x_n| = 1$ and $|x_i| ≤ \frac{n+1}2$ for $i = 1, 2, \dot Show that there exists a permutation $y_1, y_2, \dots, y_n$ of $x_1, x_2, \dots, x_n$ such that $|y_1 + 2y_2 + \cdots + ny_n| ≤ \frac{n+1}2$. -# Solution +## Solution For a permutation $π$ let $S(π) = \sum_{i=1}^n i x_{π(i)}$. We wish to show that there exists $π$ with $|S(π)| ≤ \frac{n+1}2$. diff --git a/Archive/Imo/Imo2001Q3.lean b/Archive/Imo/Imo2001Q3.lean index 71873313fdf84a..6221c3ba7db200 100644 --- a/Archive/Imo/Imo2001Q3.lean +++ b/Archive/Imo/Imo2001Q3.lean @@ -20,7 +20,7 @@ both the girl and the boy. Show that there is a problem that was solved by at least three girls and at least three boys. -# Solution +## Solution Note that not all of the problems a girl $g$ solves can be "hard" for boys, in the sense that at most two boys solved it. If that was true, by condition 1 at most $6 × 2 = 12$ boys solved diff --git a/Archive/Imo/Imo2001Q4.lean b/Archive/Imo/Imo2001Q4.lean index ad8c50dc739e6e..cb739746b60bf3 100644 --- a/Archive/Imo/Imo2001Q4.lean +++ b/Archive/Imo/Imo2001Q4.lean @@ -15,7 +15,7 @@ $a = (a_1, a_2, \dots, a_n)$ of $\{1, 2, \dots, n\}$, define $S(a) = \sum_{i=1}^ Prove that there exist two permutations $a ≠ b$ of $\{1, 2, \dots, n\}$ such that $n!$ is a divisor of $S(a) - S(b)$. -# Solution +## Solution Suppose for contradiction that all the $S(a)$ have distinct residues modulo $n!$, then $$\sum_{i=0}^{n!-1} i ≡ \sum_a S(a) = \sum_i c_i \sum_a a_i = (n-1)! \frac{n(n+1)}2 \sum_i c_i$$ diff --git a/Archive/Imo/Imo2001Q5.lean b/Archive/Imo/Imo2001Q5.lean index 13cc44a3c2112b..00ea647e1aa560 100644 --- a/Archive/Imo/Imo2001Q5.lean +++ b/Archive/Imo/Imo2001Q5.lean @@ -11,7 +11,7 @@ import Mathlib.Geometry.Euclidean.Triangle Let `ABC` be a triangle. Let `AP` bisect `∠BAC` and let `BQ` bisect `∠ABC`, with `P` on `BC` and `Q` on `AC`. If `AB + BP = AQ + QB` and `∠BAC = 60°`, what are the angles of the triangle? -# Solution +## Solution We follow the solution from https://web.evanchen.cc/exams/IMO-2001-notes.pdf. diff --git a/Archive/Imo/Imo2005Q3.lean b/Archive/Imo/Imo2005Q3.lean index 49c4a8a06a989a..77b6a7806f437d 100644 --- a/Archive/Imo/Imo2005Q3.lean +++ b/Archive/Imo/Imo2005Q3.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Ring Let `x`, `y` and `z` be positive real numbers such that `xyz ≥ 1`. Prove that: `(x^5 - x^2)/(x^5 + y^2 + z^2) + (y^5 - y^2)/(y^5 + z^2 + x^2) + (z^5 - z^2)/(z^5 + x^2 + y^2) ≥ 0` -# Solution +## Solution The solution by Iurie Boreico from Moldova is presented, which won a special prize during the exam. The key insight is that `(x^5-x^2)/(x^5+y^2+z^2) ≥ (x^2-y*z)/(x^2+y^2+z^2)`, which is proven by factoring `(x^5-x^2)/(x^5+y^2+z^2) - (x^5-x^2)/(x^3*(x^2+y^2+z^2))` into a non-negative expression diff --git a/Archive/Imo/Imo2008Q2.lean b/Archive/Imo/Imo2008Q2.lean index 5f1f7a15dd6bf0..d7208fc57ad7dc 100644 --- a/Archive/Imo/Imo2008Q2.lean +++ b/Archive/Imo/Imo2008Q2.lean @@ -21,7 +21,7 @@ for all real numbers `x`,`y`, `z`, each different from 1, and satisfying `xyz = (b) Prove that equality holds above for infinitely many triples of rational numbers `x`, `y`, `z`, each different from 1, and satisfying `xyz = 1`. -# Solution +## Solution (a) Since `xyz = 1`, we can apply the substitution `x = a/b`, `y = b/c`, `z = c/a`. Then we define `m = c-b`, `n = b-a` and rewrite the inequality as `LHS - 1 ≥ 0` using `c`, `m` and `n`. We factor `LHS - 1` as a square, which finishes the proof. diff --git a/Archive/Imo/Imo2008Q3.lean b/Archive/Imo/Imo2008Q3.lean index e62a2783199e66..8afbb996aeff0a 100644 --- a/Archive/Imo/Imo2008Q3.lean +++ b/Archive/Imo/Imo2008Q3.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.LinearCombination Prove that there exist infinitely many positive integers `n` such that `n^2 + 1` has a prime divisor which is greater than `2n + √(2n)`. -# Solution +## Solution We first prove the following lemma: for every prime `p > 20`, satisfying `p ≡ 1 [MOD 4]`, there exists `n ∈ ℕ` such that `p ∣ n^2 + 1` and `p > 2n + √(2n)`. Then the statement of the problem follows from the fact that there exist infinitely many primes `p ≡ 1 [MOD 4]`. diff --git a/Archive/Imo/Imo2008Q4.lean b/Archive/Imo/Imo2008Q4.lean index e981f2ab4d49ae..1ee8d93066f196 100644 --- a/Archive/Imo/Imo2008Q4.lean +++ b/Archive/Imo/Imo2008Q4.lean @@ -17,7 +17,7 @@ numbers to the positive real numbers) such that ``` for all positive real numbers `w`, `x`, `y`, `z`, satisfying `wx = yz`. -# Solution +## Solution The desired theorem is that either `f = fun x => x` or `f = fun x => 1/x` -/ diff --git a/Archive/Imo/Imo2011Q3.lean b/Archive/Imo/Imo2011Q3.lean index 907961bfc95b26..faa7f07801db9b 100644 --- a/Archive/Imo/Imo2011Q3.lean +++ b/Archive/Imo/Imo2011Q3.lean @@ -15,7 +15,7 @@ Let f : ℝ → ℝ be a function that satisfies for all x and y. Prove that f(x) = 0 for all x ≤ 0. -# Solution +## Solution Direct translation of the solution found in https://www.imo-official.org/problems/IMO2011SL.pdf -/ diff --git a/Archive/Imo/Imo2013Q1.lean b/Archive/Imo/Imo2013Q1.lean index 31bdcc1e955db8..1b6bce7cc75d7a 100644 --- a/Archive/Imo/Imo2013Q1.lean +++ b/Archive/Imo/Imo2013Q1.lean @@ -17,7 +17,7 @@ m₁, m₂, ..., mₖ (not necessarily different) such that 1 + (2ᵏ - 1)/ n = (1 + 1/m₁) * (1 + 1/m₂) * ... * (1 + 1/mₖ). -# Solution +## Solution Adaptation of the solution found in https://www.imo-official.org/problems/IMO2013SL.pdf diff --git a/Archive/Imo/Imo2013Q5.lean b/Archive/Imo/Imo2013Q5.lean index 3d9486c24d5011..70476cbad71975 100644 --- a/Archive/Imo/Imo2013Q5.lean +++ b/Archive/Imo/Imo2013Q5.lean @@ -22,7 +22,7 @@ the conditions for all `x, y ∈ ℚ>₀`. Given that `f(a) = a` for some rational `a > 1`, prove that `f(x) = x` for all `x ∈ ℚ>₀`. -# Solution +## Solution We provide a direct translation of the solution found in https://www.imo-official.org/problems/IMO2013SL.pdf diff --git a/Archive/Imo/Imo2015Q6.lean b/Archive/Imo/Imo2015Q6.lean index 2d46749bfe2a60..f09dcc5e8bb8a3 100644 --- a/Archive/Imo/Imo2015Q6.lean +++ b/Archive/Imo/Imo2015Q6.lean @@ -20,7 +20,7 @@ Prove that there exist two positive integers $b$ and $N$ for which $$\left|\sum_{j=m+1}^n (a_j-b)\right| ≤ 1007^2$$ for all integers $m,n$ such that $N ≤ m < n$. -# Solution +## Solution We follow solution 2 ("juggling") from https://web.evanchen.cc/exams/IMO-2015-notes.pdf. diff --git a/Archive/Imo/Imo2021Q1.lean b/Archive/Imo/Imo2021Q1.lean index 9fa870550c1f6a..59cb8b36141c25 100644 --- a/Archive/Imo/Imo2021Q1.lean +++ b/Archive/Imo/Imo2021Q1.lean @@ -14,7 +14,7 @@ Let `n ≥ 100` be an integer. Ivan writes the numbers `n, n+1, ..., 2*n` each o He then shuffles these `n+1` cards, and divides them into two piles. Prove that at least one of the piles contains two cards such that the sum of their numbers is a perfect square. -# Solution +## Solution We show there exists a triplet `a, b, c ∈ [n , 2n]` with `a < b < c` and each of the sums `(a + b)`, `(b + c)`, `(a + c)` being a perfect square. Specifically, we consider the linear system of diff --git a/Archive/Sensitivity.lean b/Archive/Sensitivity.lean index 9c00b052a3e671..85f065d0867aeb 100644 --- a/Archive/Sensitivity.lean +++ b/Archive/Sensitivity.lean @@ -248,7 +248,7 @@ theorem dim_V : Module.rank ℝ (V n) = 2 ^ n := by open Classical in instance : FiniteDimensional ℝ (V n) := - FiniteDimensional.of_fintype_basis (dualBases_e_ε _).basis + (dualBases_e_ε _).basis.finiteDimensional_of_finite theorem finrank_V : finrank ℝ (V n) = 2 ^ n := by have := @dim_V n diff --git a/Archive/Wiedijk100Theorems/BuffonsNeedle.lean b/Archive/Wiedijk100Theorems/BuffonsNeedle.lean index 2f243600ac912e..61794a515eacc9 100644 --- a/Archive/Wiedijk100Theorems/BuffonsNeedle.lean +++ b/Archive/Wiedijk100Theorems/BuffonsNeedle.lean @@ -130,7 +130,7 @@ lemma volume_needleSpace : ℙ (needleSpace d) = ENNReal.ofReal (d * π) := by lemma measurable_needleCrossesIndicator : Measurable (needleCrossesIndicator l) := by unfold needleCrossesIndicator - refine Measurable.indicator measurable_const (IsClosed.measurableSet (IsClosed.inter ?l ?r)) + refine Measurable.indicator measurable_const (IsClosed.measurableSet (IsClosed.and ?l ?r)) all_goals simp only [tsub_le_iff_right, zero_add, ← neg_le_iff_add_nonneg'] case' l => refine isClosed_le continuous_fst ?_ case' r => refine isClosed_le (Continuous.neg continuous_fst) ?_ diff --git a/Archive/Wiedijk100Theorems/Partition.lean b/Archive/Wiedijk100Theorems/Partition.lean index 4bae4310be6f40..9eead1f8f4364a 100644 --- a/Archive/Wiedijk100Theorems/Partition.lean +++ b/Archive/Wiedijk100Theorems/Partition.lean @@ -5,7 +5,7 @@ Authors: Bhavik Mehta, Aaron Anderson -/ import Mathlib.Algebra.Order.Antidiag.Finsupp import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Combinatorics.Enumerative.Partition +import Mathlib.Combinatorics.Enumerative.Partition.Basic import Mathlib.Data.Finset.NatAntidiagonal import Mathlib.Data.Fin.Tuple.NatAntidiagonal import Mathlib.RingTheory.PowerSeries.Inverse diff --git a/Cache/IO.lean b/Cache/IO.lean index d222b4176951a6..1884e6b1635992 100644 --- a/Cache/IO.lean +++ b/Cache/IO.lean @@ -142,7 +142,7 @@ private def CacheM.mathlibDepPath (sp : SearchPath) : IO FilePath := do def _root_.Lean.SearchPath.relativize (sp : SearchPath) : IO SearchPath := do let pwd ← IO.FS.realPath "." let pwd' := pwd.toString ++ System.FilePath.pathSeparator.toString - return sp.map fun x => ⟨if x = pwd then "." else x.toString.stripPrefix pwd'⟩ + return sp.map fun x => ⟨if x = pwd then "." else x.toString.dropPrefix pwd' |>.copy⟩ private def CacheM.getContext : IO CacheM.Context := do let sp ← (← getSrcSearchPath).relativize @@ -208,8 +208,8 @@ def validateCurl : IO Bool := do let _ := @leOfOrd if version >= (7, 81) then return true -- TODO: support more platforms if the need arises - let arch ← (·.trim) <$> runCmd "uname" #["-m"] false - let kernel ← (·.trim) <$> runCmd "uname" #["-s"] false + let arch ← (·.trimAscii.copy) <$> runCmd "uname" #["-m"] false + let kernel ← (·.trimAscii.copy) <$> runCmd "uname" #["-s"] false if kernel == "Linux" && arch ∈ ["x86_64", "aarch64"] then IO.println s!"curl is too old; downloading more recent version" IO.FS.createDirAll IO.CACHEDIR @@ -249,7 +249,7 @@ def validateLeanTar : IO Unit := do let target ← if win then pure "x86_64-pc-windows-msvc" else - let mut arch ← (·.trim) <$> runCmd "uname" #["-m"] false + let mut arch ← (·.trimAscii.copy) <$> runCmd "uname" #["-m"] false if arch = "arm64" then arch := "aarch64" unless arch ∈ ["x86_64", "aarch64"] do throw <| IO.userError s!"unsupported architecture {arch}" diff --git a/Cache/Requests.lean b/Cache/Requests.lean index 4d249e7c108c69..934e86e5a58dfb 100644 --- a/Cache/Requests.lean +++ b/Cache/Requests.lean @@ -28,10 +28,10 @@ structure RepoInfo where Helper function to extract repository name from a git remote URL -/ def extractRepoFromUrl (url : String) : Option String := do - let url := url.stripSuffix ".git" - let pos ← url.revFind (· == '/') - let pos ← url.revFindAux (fun c => c == '/' || c == ':') pos - return (String.Pos.Raw.extract url) (String.Pos.Raw.next url pos) url.rawEndPos + let url := url.dropSuffix ".git" + let pos ← url.revFind? (· == '/') + let pos ← (url.replaceEnd pos).revFind? (fun c => c == '/' || c == ':') + return url.replaceStart (String.Slice.Pos.ofReplaceEnd pos).next! |>.copy /-- Spot check if a URL is valid for a git remote -/ def isRemoteURL (url : String) : Bool := @@ -50,14 +50,14 @@ def getRepoFromRemote (mathlibDepPath : FilePath) (remoteName : String) (errorCo let out ← IO.Process.output {cmd := "git", args := #["remote", "get-url", remoteName], cwd := mathlibDepPath} -- If `git remote get-url` fails then bail out with an error to help debug - let output := out.stdout.trim + let output := out.stdout.trimAscii unless out.exitCode == 0 do throw <| IO.userError s!"\ Failed to run Git to determine Mathlib's repository from {remoteName} remote (exit code: {out.exitCode}).\n\ {errorContext}\n\ - Stdout:\n{output}\nStderr:\n{out.stderr.trim}\n" + Stdout:\n{output}\nStderr:\n{out.stderr.trimAscii}\n" -- Finally attempt to extract the repository from the remote URL returned by `git remote get-url` - repoFromURL output + repoFromURL output.copy where repoFromURL (url : String) : IO String := do if let some repo := extractRepoFromUrl url then return repo @@ -79,17 +79,17 @@ def findMathlibRemote (mathlibDepPath : FilePath) : IO String := do throw <| IO.userError s!"\ Failed to run Git to list remotes (exit code: {remotesInfo.exitCode}).\n\ Ensure Git is installed.\n\ - Stdout:\n{remotesInfo.stdout.trim}\nStderr:\n{remotesInfo.stderr.trim}\n" + Stdout:\n{remotesInfo.stdout.trimAscii}\nStderr:\n{remotesInfo.stderr.trimAscii}\n" let remoteLines := remotesInfo.stdout.splitToList (· == '\n') let mut mathlibRemote : Option String := none let mut originPointsToMathlib : Bool := false for line in remoteLines do - let parts := line.trim.splitToList (· == '\t') + let parts := line.trimAscii.copy.splitToList (· == '\t') if parts.length >= 2 then let remoteName := parts[0]! - let remoteUrl := parts[1]!.takeWhile (· != ' ') -- Remove (fetch) or (push) suffix + let remoteUrl := parts[1]!.takeWhile (· != ' ') |>.copy -- Remove (fetch) or (push) suffix -- Check if this remote points to leanprover-community/mathlib4 let isMathlibRepo := remoteUrl.containsSubstr "leanprover-community/mathlib4" @@ -128,11 +128,11 @@ def isDetachedAtNightlyTesting (mathlibDepPath : FilePath) : IO Bool := do let currentCommit ← IO.Process.output {cmd := "git", args := #["rev-parse", "HEAD"], cwd := mathlibDepPath} if currentCommit.exitCode == 0 then - let commitHash := currentCommit.stdout.trim + let commitHash := currentCommit.stdout.trimAscii.copy let tagInfo ← IO.Process.output {cmd := "git", args := #["name-rev", "--tags", commitHash], cwd := mathlibDepPath} if tagInfo.exitCode == 0 then - let parts := tagInfo.stdout.trim.splitOn " " + let parts := tagInfo.stdout.trimAscii.copy.splitOn " " -- git name-rev returns "commit_hash tags/tag_name" or just "commit_hash undefined" if no tag if parts.length >= 2 && parts[1]!.startsWith "tags/" then let tagName := parts[1]!.drop 5 -- Remove "tags/" prefix @@ -159,17 +159,17 @@ def getRemoteRepo (mathlibDepPath : FilePath) : IO RepoInfo := do {cmd := "git", args := #["rev-parse", "--abbrev-ref", "HEAD"], cwd := mathlibDepPath} if currentBranch.exitCode == 0 then - let branchName := currentBranch.stdout.trim.stripPrefix "heads/" + let branchName := currentBranch.stdout.trimAscii.dropPrefix "heads/" IO.println s!"Current branch: {branchName}" -- Check if we're in a detached HEAD state at a nightly-testing tag - let isDetachedAtNightlyTesting ← if branchName == "HEAD" then + let isDetachedAtNightlyTesting ← if branchName == "HEAD".toSlice then isDetachedAtNightlyTesting mathlibDepPath else pure false -- Check if we're on a branch that should use nightly-testing remote - let shouldUseNightlyTesting := branchName == "nightly-testing" || + let shouldUseNightlyTesting := branchName == "nightly-testing".toSlice || branchName.startsWith "lean-pr-testing-" || branchName.startsWith "batteries-pr-testing-" || branchName.startsWith "bump/" || @@ -229,10 +229,10 @@ def getRemoteRepo (mathlibDepPath : FilePath) : IO RepoInfo := do -- Fall back to using the remote that the current branch is tracking let trackingRemote ← IO.Process.output - {cmd := "git", args := #["config", "--get", s!"branch.{currentBranch.stdout.trim}.remote"], cwd := mathlibDepPath} + {cmd := "git", args := #["config", "--get", s!"branch.{currentBranch.stdout.trimAscii}.remote"], cwd := mathlibDepPath} let remoteName := if trackingRemote.exitCode == 0 then - trackingRemote.stdout.trim + trackingRemote.stdout.trimAscii.copy else -- If no tracking remote is configured, fall back to origin "origin" @@ -329,15 +329,15 @@ def monitorCurl (args : Array String) (size : Nat) let s@{success, failed, done, speed, ..} ← IO.runCurlStreaming args init fun a line => do let mut {last, success, failed, done, speed} := a -- output errors other than 404 and remove corresponding partial downloads - let line := line.trim + let line := line.trimAscii if !line.isEmpty then - match Lean.Json.parse line with + match Lean.Json.parse line.copy with | .ok result => match result.getObjValAs? Nat "http_code" with | .ok 200 => if let .ok fn := result.getObjValAs? String "filename_effective" then if (← System.FilePath.pathExists fn) && fn.endsWith ".part" then - IO.FS.rename fn (fn.dropRight 5) + IO.FS.rename fn (fn.dropEnd 5).copy success := success + 1 | .ok 404 => pure () | code? => @@ -415,10 +415,10 @@ def checkForToolchainMismatch : IO.CacheM Unit := do let mathlibToolchainFile := (← read).mathlibDepPath / "lean-toolchain" let downstreamToolchain ← IO.FS.readFile "lean-toolchain" let mathlibToolchain ← IO.FS.readFile mathlibToolchainFile - if !(mathlibToolchain.trim = downstreamToolchain.trim) then + if !(mathlibToolchain.trimAscii == downstreamToolchain.trimAscii) then IO.println "Dependency Mathlib uses a different lean-toolchain" - IO.println s!" Project uses {downstreamToolchain.trim}" - IO.println s!" Mathlib uses {mathlibToolchain.trim}" + IO.println s!" Project uses {downstreamToolchain.trimAscii}" + IO.println s!" Mathlib uses {mathlibToolchain.trimAscii}" IO.println "\nThe cache will not work unless your project's toolchain matches Mathlib's toolchain" IO.println s!"This can be achieved by copying the contents of the file `{mathlibToolchainFile}` into the `lean-toolchain` file at the root directory of your project" @@ -554,7 +554,8 @@ section Commit def isGitStatusClean : IO Bool := return (← IO.runCmd "git" #["status", "--porcelain"]).isEmpty -def getGitCommitHash : IO String := return (← IO.runCmd "git" #["rev-parse", "HEAD"]).trimRight +def getGitCommitHash : IO String := + return (← IO.runCmd "git" #["rev-parse", "HEAD"]).trimAsciiEnd.copy /-- Sends a commit file to the server, containing the hashes of the respective committed files. diff --git a/Counterexamples/Phillips.lean b/Counterexamples/Phillips.lean index 3c99671c4bc0fb..2384d6e0671010 100644 --- a/Counterexamples/Phillips.lean +++ b/Counterexamples/Phillips.lean @@ -397,7 +397,7 @@ def _root_.ContinuousLinearMap.toBoundedAdditiveMeasure [TopologicalSpace α] [D ofNormedAddCommGroupDiscrete (indicator s 1) 1 (norm_indicator_le_one s) + ofNormedAddCommGroupDiscrete (indicator t 1) 1 (norm_indicator_le_one t) := by ext x; simp [indicator_union_of_disjoint hst] - rw [this, f.map_add] + grind exists_bound := ⟨‖f‖, fun s => by have I : diff --git a/Mathlib.lean b/Mathlib.lean index 4190919a0210a8..740188104f3884 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1,7157 +1,7213 @@ -import Std -import Batteries -import Mathlib.Algebra.AddConstMap.Basic -import Mathlib.Algebra.AddConstMap.Equiv -import Mathlib.Algebra.AddTorsor.Basic -import Mathlib.Algebra.AddTorsor.Defs -import Mathlib.Algebra.Algebra.Basic -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Algebra.Field -import Mathlib.Algebra.Algebra.Hom -import Mathlib.Algebra.Algebra.Hom.Rat -import Mathlib.Algebra.Algebra.IsSimpleRing -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.Algebra.Algebra.NonUnitalSubalgebra -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Algebra.Opposite -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.Algebra.Algebra.Shrink -import Mathlib.Algebra.Algebra.Spectrum.Basic -import Mathlib.Algebra.Algebra.Spectrum.Pi -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Algebra.Algebra.StrictPositivity -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.Algebra.Subalgebra.Centralizer -import Mathlib.Algebra.Algebra.Subalgebra.Directed -import Mathlib.Algebra.Algebra.Subalgebra.IsSimpleOrder -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Algebra.Subalgebra.Matrix -import Mathlib.Algebra.Algebra.Subalgebra.MulOpposite -import Mathlib.Algebra.Algebra.Subalgebra.Operations -import Mathlib.Algebra.Algebra.Subalgebra.Order -import Mathlib.Algebra.Algebra.Subalgebra.Pi -import Mathlib.Algebra.Algebra.Subalgebra.Pointwise -import Mathlib.Algebra.Algebra.Subalgebra.Prod -import Mathlib.Algebra.Algebra.Subalgebra.Rank -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Algebra.Algebra.Subalgebra.Unitization -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Algebra.TransferInstance -import Mathlib.Algebra.Algebra.Unitization -import Mathlib.Algebra.Algebra.ZMod -import Mathlib.Algebra.AlgebraicCard -import Mathlib.Algebra.ArithmeticGeometric -import Mathlib.Algebra.Azumaya.Basic -import Mathlib.Algebra.Azumaya.Defs -import Mathlib.Algebra.Azumaya.Matrix -import Mathlib.Algebra.BigOperators.Associated -import Mathlib.Algebra.BigOperators.Balance -import Mathlib.Algebra.BigOperators.Expect -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Algebra.BigOperators.Finsupp.Fin -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Defs -import Mathlib.Algebra.BigOperators.Group.Finset.Indicator -import Mathlib.Algebra.BigOperators.Group.Finset.Interval -import Mathlib.Algebra.BigOperators.Group.Finset.Lemmas -import Mathlib.Algebra.BigOperators.Group.Finset.Pi -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.BigOperators.Group.Finset.Powerset -import Mathlib.Algebra.BigOperators.Group.Finset.Preimage -import Mathlib.Algebra.BigOperators.Group.Finset.Sigma -import Mathlib.Algebra.BigOperators.Group.List.Basic -import Mathlib.Algebra.BigOperators.Group.List.Defs -import Mathlib.Algebra.BigOperators.Group.List.Lemmas -import Mathlib.Algebra.BigOperators.Group.Multiset.Basic -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.BigOperators.GroupWithZero.Finset -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Algebra.BigOperators.Module -import Mathlib.Algebra.BigOperators.NatAntidiagonal -import Mathlib.Algebra.BigOperators.Option -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.BigOperators.Ring.List -import Mathlib.Algebra.BigOperators.Ring.Multiset -import Mathlib.Algebra.BigOperators.Ring.Nat -import Mathlib.Algebra.BigOperators.RingEquiv -import Mathlib.Algebra.BigOperators.Sym -import Mathlib.Algebra.BigOperators.WithTop -import Mathlib.Algebra.BrauerGroup.Defs -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.Algebra.Category.AlgCat.Limits -import Mathlib.Algebra.Category.AlgCat.Monoidal -import Mathlib.Algebra.Category.AlgCat.Symmetric -import Mathlib.Algebra.Category.AlgebraCat.Symmetric -import Mathlib.Algebra.Category.BialgCat.Basic -import Mathlib.Algebra.Category.BialgCat.Monoidal -import Mathlib.Algebra.Category.BoolRing -import Mathlib.Algebra.Category.CoalgCat.Basic -import Mathlib.Algebra.Category.CoalgCat.ComonEquivalence -import Mathlib.Algebra.Category.CoalgCat.Monoidal -import Mathlib.Algebra.Category.CommAlgCat.Basic -import Mathlib.Algebra.Category.CommAlgCat.FiniteType -import Mathlib.Algebra.Category.CommAlgCat.Monoidal -import Mathlib.Algebra.Category.CommBialgCat -import Mathlib.Algebra.Category.ContinuousCohomology.Basic -import Mathlib.Algebra.Category.FGModuleCat.Abelian -import Mathlib.Algebra.Category.FGModuleCat.Basic -import Mathlib.Algebra.Category.FGModuleCat.Colimits -import Mathlib.Algebra.Category.FGModuleCat.EssentiallySmall -import Mathlib.Algebra.Category.FGModuleCat.Limits -import Mathlib.Algebra.Category.Grp.AB -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.Algebra.Category.Grp.Adjunctions -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.Algebra.Category.Grp.Biproducts -import Mathlib.Algebra.Category.Grp.CartesianMonoidal -import Mathlib.Algebra.Category.Grp.ChosenFiniteProducts -import Mathlib.Algebra.Category.Grp.Colimits -import Mathlib.Algebra.Category.Grp.EnoughInjectives -import Mathlib.Algebra.Category.Grp.EpiMono -import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup -import Mathlib.Algebra.Category.Grp.FilteredColimits -import Mathlib.Algebra.Category.Grp.FiniteGrp -import Mathlib.Algebra.Category.Grp.ForgetCorepresentable -import Mathlib.Algebra.Category.Grp.Images -import Mathlib.Algebra.Category.Grp.Injective -import Mathlib.Algebra.Category.Grp.IsFinite -import Mathlib.Algebra.Category.Grp.Kernels -import Mathlib.Algebra.Category.Grp.LargeColimits -import Mathlib.Algebra.Category.Grp.LeftExactFunctor -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.Algebra.Category.Grp.Subobject -import Mathlib.Algebra.Category.Grp.Ulift -import Mathlib.Algebra.Category.Grp.Yoneda -import Mathlib.Algebra.Category.Grp.ZModuleEquivalence -import Mathlib.Algebra.Category.Grp.Zero -import Mathlib.Algebra.Category.GrpWithZero -import Mathlib.Algebra.Category.HopfAlgCat.Basic -import Mathlib.Algebra.Category.HopfAlgCat.Monoidal -import Mathlib.Algebra.Category.ModuleCat.AB -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.Algebra.Category.ModuleCat.Adjunctions -import Mathlib.Algebra.Category.ModuleCat.Algebra -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Biproducts -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic -import Mathlib.Algebra.Category.ModuleCat.Differentials.Presheaf -import Mathlib.Algebra.Category.ModuleCat.EnoughInjectives -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Category.ModuleCat.ExteriorPower -import Mathlib.Algebra.Category.ModuleCat.FilteredColimits -import Mathlib.Algebra.Category.ModuleCat.Free -import Mathlib.Algebra.Category.ModuleCat.Images -import Mathlib.Algebra.Category.ModuleCat.Injective -import Mathlib.Algebra.Category.ModuleCat.Kernels -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian -import Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits -import Mathlib.Algebra.Category.ModuleCat.Presheaf.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Free -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Generator -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Monoidal -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafify -import Mathlib.Algebra.Category.ModuleCat.Products -import Mathlib.Algebra.Category.ModuleCat.Projective -import Mathlib.Algebra.Category.ModuleCat.Pseudofunctor -import Mathlib.Algebra.Category.ModuleCat.Semi -import Mathlib.Algebra.Category.ModuleCat.Sheaf -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Abelian -import Mathlib.Algebra.Category.ModuleCat.Sheaf.ChangeOfRings -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Colimits -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Free -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Generators -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Limits -import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous -import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackFree -import Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Quasicoherent -import Mathlib.Algebra.Category.ModuleCat.Simple -import Mathlib.Algebra.Category.ModuleCat.Subobject -import Mathlib.Algebra.Category.ModuleCat.Tannaka -import Mathlib.Algebra.Category.ModuleCat.Topology.Basic -import Mathlib.Algebra.Category.ModuleCat.Topology.Homology -import Mathlib.Algebra.Category.MonCat.Adjunctions -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Category.MonCat.Colimits -import Mathlib.Algebra.Category.MonCat.FilteredColimits -import Mathlib.Algebra.Category.MonCat.ForgetCorepresentable -import Mathlib.Algebra.Category.MonCat.Limits -import Mathlib.Algebra.Category.MonCat.Yoneda -import Mathlib.Algebra.Category.Ring.Adjunctions -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.Category.Ring.Constructions -import Mathlib.Algebra.Category.Ring.Epi -import Mathlib.Algebra.Category.Ring.FilteredColimits -import Mathlib.Algebra.Category.Ring.FinitePresentation -import Mathlib.Algebra.Category.Ring.Instances -import Mathlib.Algebra.Category.Ring.Limits -import Mathlib.Algebra.Category.Ring.LinearAlgebra -import Mathlib.Algebra.Category.Ring.Topology -import Mathlib.Algebra.Category.Ring.Under.Basic -import Mathlib.Algebra.Category.Ring.Under.Limits -import Mathlib.Algebra.Category.Semigrp.Basic -import Mathlib.Algebra.Central.Basic -import Mathlib.Algebra.Central.Defs -import Mathlib.Algebra.Central.Matrix -import Mathlib.Algebra.Central.TensorProduct -import Mathlib.Algebra.CharP.Algebra -import Mathlib.Algebra.CharP.Basic -import Mathlib.Algebra.CharP.CharAndCard -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.CharP.Frobenius -import Mathlib.Algebra.CharP.IntermediateField -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.Algebra.CharP.LinearMaps -import Mathlib.Algebra.CharP.LocalRing -import Mathlib.Algebra.CharP.MixedCharZero -import Mathlib.Algebra.CharP.Pi -import Mathlib.Algebra.CharP.Quotient -import Mathlib.Algebra.CharP.Reduced -import Mathlib.Algebra.CharP.Subring -import Mathlib.Algebra.CharP.Two -import Mathlib.Algebra.CharZero.AddMonoidHom -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.CharZero.Infinite -import Mathlib.Algebra.CharZero.Quotient -import Mathlib.Algebra.Colimit.DirectLimit -import Mathlib.Algebra.Colimit.Finiteness -import Mathlib.Algebra.Colimit.Module -import Mathlib.Algebra.Colimit.Ring -import Mathlib.Algebra.Colimit.TensorProduct -import Mathlib.Algebra.ContinuedFractions.Basic -import Mathlib.Algebra.ContinuedFractions.Computation.ApproximationCorollaries -import Mathlib.Algebra.ContinuedFractions.Computation.Approximations -import Mathlib.Algebra.ContinuedFractions.Computation.Basic -import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating -import Mathlib.Algebra.ContinuedFractions.Computation.TerminatesIffRat -import Mathlib.Algebra.ContinuedFractions.Computation.Translations -import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence -import Mathlib.Algebra.ContinuedFractions.ConvergentsEquiv -import Mathlib.Algebra.ContinuedFractions.Determinant -import Mathlib.Algebra.ContinuedFractions.TerminatedStable -import Mathlib.Algebra.ContinuedFractions.Translations -import Mathlib.Algebra.CubicDiscriminant -import Mathlib.Algebra.DirectSum.AddChar -import Mathlib.Algebra.DirectSum.Algebra -import Mathlib.Algebra.DirectSum.Basic -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.Algebra.DirectSum.Finsupp -import Mathlib.Algebra.DirectSum.Idempotents -import Mathlib.Algebra.DirectSum.Internal -import Mathlib.Algebra.DirectSum.LinearMap -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.DirectSum.Ring -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Divisibility.Finite -import Mathlib.Algebra.Divisibility.Hom -import Mathlib.Algebra.Divisibility.Prod -import Mathlib.Algebra.Divisibility.Units -import Mathlib.Algebra.DualNumber -import Mathlib.Algebra.DualQuaternion -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.EuclideanDomain.Defs -import Mathlib.Algebra.EuclideanDomain.Field -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.Exact -import Mathlib.Algebra.Expr -import Mathlib.Algebra.Field.Action.ConjAct -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Field.Equiv -import Mathlib.Algebra.Field.GeomSum -import Mathlib.Algebra.Field.IsField -import Mathlib.Algebra.Field.MinimalAxioms -import Mathlib.Algebra.Field.NegOnePow -import Mathlib.Algebra.Field.Opposite -import Mathlib.Algebra.Field.Periodic -import Mathlib.Algebra.Field.Power -import Mathlib.Algebra.Field.Rat -import Mathlib.Algebra.Field.Shrink -import Mathlib.Algebra.Field.Subfield.Basic -import Mathlib.Algebra.Field.Subfield.Defs -import Mathlib.Algebra.Field.TransferInstance -import Mathlib.Algebra.Field.ULift -import Mathlib.Algebra.Field.ZMod -import Mathlib.Algebra.FiveLemma -import Mathlib.Algebra.Free -import Mathlib.Algebra.FreeAbelianGroup.Finsupp -import Mathlib.Algebra.FreeAbelianGroup.UniqueSums -import Mathlib.Algebra.FreeAlgebra -import Mathlib.Algebra.FreeAlgebra.Cardinality -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Algebra.FreeMonoid.Count -import Mathlib.Algebra.FreeMonoid.Symbols -import Mathlib.Algebra.FreeMonoid.UniqueProds -import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Algebra.GCDMonoid.Finset -import Mathlib.Algebra.GCDMonoid.IntegrallyClosed -import Mathlib.Algebra.GCDMonoid.Multiset -import Mathlib.Algebra.GCDMonoid.Nat -import Mathlib.Algebra.GCDMonoid.PUnit -import Mathlib.Algebra.GeomSum -import Mathlib.Algebra.GradedMonoid -import Mathlib.Algebra.GradedMulAction -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.Action.End -import Mathlib.Algebra.Group.Action.Equidecomp -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Group.Action.Hom -import Mathlib.Algebra.Group.Action.Opposite -import Mathlib.Algebra.Group.Action.Option -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Action.Pointwise.Set.Finite -import Mathlib.Algebra.Group.Action.Pretransitive -import Mathlib.Algebra.Group.Action.Prod -import Mathlib.Algebra.Group.Action.Sigma -import Mathlib.Algebra.Group.Action.Sum -import Mathlib.Algebra.Group.Action.TransferInstance -import Mathlib.Algebra.Group.Action.TypeTags -import Mathlib.Algebra.Group.Action.Units -import Mathlib.Algebra.Group.AddChar -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Center -import Mathlib.Algebra.Group.Commutator -import Mathlib.Algebra.Group.Commute.Basic -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Commute.Hom -import Mathlib.Algebra.Group.Commute.Units -import Mathlib.Algebra.Group.Conj -import Mathlib.Algebra.Group.ConjFinite -import Mathlib.Algebra.Group.Defs -import Mathlib.Algebra.Group.Embedding -import Mathlib.Algebra.Group.End -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Equiv.Finite -import Mathlib.Algebra.Group.Equiv.Opposite -import Mathlib.Algebra.Group.Equiv.TypeTags -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.EvenFunction -import Mathlib.Algebra.Group.Ext -import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.Algebra.Group.Fin.Tuple -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Algebra.Group.ForwardDiff -import Mathlib.Algebra.Group.Graph -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Group.Hom.CompTypeclasses -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Hom.End -import Mathlib.Algebra.Group.Hom.Instances -import Mathlib.Algebra.Group.Idempotent -import Mathlib.Algebra.Group.Indicator -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Group.Int.Even -import Mathlib.Algebra.Group.Int.TypeTags -import Mathlib.Algebra.Group.Int.Units -import Mathlib.Algebra.Group.Invertible.Basic -import Mathlib.Algebra.Group.Invertible.Defs -import Mathlib.Algebra.Group.Irreducible.Defs -import Mathlib.Algebra.Group.Irreducible.Lemmas -import Mathlib.Algebra.Group.MinimalAxioms -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.Nat.Even -import Mathlib.Algebra.Group.Nat.Hom -import Mathlib.Algebra.Group.Nat.Range -import Mathlib.Algebra.Group.Nat.TypeTags -import Mathlib.Algebra.Group.Nat.Units -import Mathlib.Algebra.Group.NatPowAssoc -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Group.PNatPowAssoc -import Mathlib.Algebra.Group.PUnit -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Group.Pi.Units -import Mathlib.Algebra.Group.Pointwise.Finset.Basic -import Mathlib.Algebra.Group.Pointwise.Finset.BigOperators -import Mathlib.Algebra.Group.Pointwise.Finset.Density -import Mathlib.Algebra.Group.Pointwise.Finset.Interval -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.Algebra.Group.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Pointwise.Set.BigOperators -import Mathlib.Algebra.Group.Pointwise.Set.Card -import Mathlib.Algebra.Group.Pointwise.Set.Finite -import Mathlib.Algebra.Group.Pointwise.Set.Lattice -import Mathlib.Algebra.Group.Pointwise.Set.ListOfFn -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Group.Pointwise.Set.Small -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Group.Semiconj.Basic -import Mathlib.Algebra.Group.Semiconj.Defs -import Mathlib.Algebra.Group.Semiconj.Units -import Mathlib.Algebra.Group.Shrink -import Mathlib.Algebra.Group.Subgroup.Actions -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Group.Subgroup.Even -import Mathlib.Algebra.Group.Subgroup.Finite -import Mathlib.Algebra.Group.Subgroup.Finsupp -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.Algebra.Group.Subgroup.Map -import Mathlib.Algebra.Group.Subgroup.MulOpposite -import Mathlib.Algebra.Group.Subgroup.MulOppositeLemmas -import Mathlib.Algebra.Group.Subgroup.Order -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic -import Mathlib.Algebra.Group.Subgroup.ZPowers.Lemmas -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Group.Submonoid.DistribMulAction -import Mathlib.Algebra.Group.Submonoid.Finite -import Mathlib.Algebra.Group.Submonoid.Finsupp -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Algebra.Group.Submonoid.MulAction -import Mathlib.Algebra.Group.Submonoid.MulOpposite -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Group.Submonoid.Pointwise -import Mathlib.Algebra.Group.Submonoid.Units -import Mathlib.Algebra.Group.Subsemigroup.Basic -import Mathlib.Algebra.Group.Subsemigroup.Defs -import Mathlib.Algebra.Group.Subsemigroup.Membership -import Mathlib.Algebra.Group.Subsemigroup.Operations -import Mathlib.Algebra.Group.Support -import Mathlib.Algebra.Group.Torsion -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Algebra.Group.Translate -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.Algebra.Group.TypeTags.Hom -import Mathlib.Algebra.Group.ULift -import Mathlib.Algebra.Group.UniqueProds.Basic -import Mathlib.Algebra.Group.UniqueProds.VectorSpace -import Mathlib.Algebra.Group.Units.Basic -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.Group.Units.Hom -import Mathlib.Algebra.Group.Units.Opposite -import Mathlib.Algebra.Group.WithOne.Basic -import Mathlib.Algebra.Group.WithOne.Defs -import Mathlib.Algebra.Group.WithOne.Map -import Mathlib.Algebra.GroupWithZero.Action.Basic -import Mathlib.Algebra.GroupWithZero.Action.Center -import Mathlib.Algebra.GroupWithZero.Action.ConjAct -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.Action.End -import Mathlib.Algebra.GroupWithZero.Action.Faithful -import Mathlib.Algebra.GroupWithZero.Action.Hom -import Mathlib.Algebra.GroupWithZero.Action.Opposite -import Mathlib.Algebra.GroupWithZero.Action.Pi -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Finset -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set -import Mathlib.Algebra.GroupWithZero.Action.Prod -import Mathlib.Algebra.GroupWithZero.Action.TransferInstance -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Algebra.GroupWithZero.Center -import Mathlib.Algebra.GroupWithZero.Commute -import Mathlib.Algebra.GroupWithZero.Conj -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.GroupWithZero.Equiv -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.GroupWithZero.Idempotent -import Mathlib.Algebra.GroupWithZero.Indicator -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.GroupWithZero.Int -import Mathlib.Algebra.GroupWithZero.Invertible -import Mathlib.Algebra.GroupWithZero.Nat -import Mathlib.Algebra.GroupWithZero.NeZero -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.GroupWithZero.Opposite -import Mathlib.Algebra.GroupWithZero.Pi -import Mathlib.Algebra.GroupWithZero.Pointwise.Finset -import Mathlib.Algebra.GroupWithZero.Pointwise.Set.Basic -import Mathlib.Algebra.GroupWithZero.Pointwise.Set.Card -import Mathlib.Algebra.GroupWithZero.Prod -import Mathlib.Algebra.GroupWithZero.ProdHom -import Mathlib.Algebra.GroupWithZero.Range -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.GroupWithZero.Semiconj -import Mathlib.Algebra.GroupWithZero.Shrink -import Mathlib.Algebra.GroupWithZero.Subgroup -import Mathlib.Algebra.GroupWithZero.Submonoid.CancelMulZero -import Mathlib.Algebra.GroupWithZero.Submonoid.Instances -import Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise -import Mathlib.Algebra.GroupWithZero.Submonoid.Primal -import Mathlib.Algebra.GroupWithZero.Torsion -import Mathlib.Algebra.GroupWithZero.TransferInstance -import Mathlib.Algebra.GroupWithZero.ULift -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.GroupWithZero.Units.Equiv -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.GroupWithZero.WithZero -import Mathlib.Algebra.HierarchyDesign -import Mathlib.Algebra.Homology.Additive -import Mathlib.Algebra.Homology.AlternatingConst -import Mathlib.Algebra.Homology.Augment -import Mathlib.Algebra.Homology.Bifunctor -import Mathlib.Algebra.Homology.BifunctorAssociator -import Mathlib.Algebra.Homology.BifunctorFlip -import Mathlib.Algebra.Homology.BifunctorHomotopy -import Mathlib.Algebra.Homology.BifunctorShift -import Mathlib.Algebra.Homology.CommSq -import Mathlib.Algebra.Homology.ComplexShape -import Mathlib.Algebra.Homology.ComplexShapeSigns -import Mathlib.Algebra.Homology.ConcreteCategory -import Mathlib.Algebra.Homology.DerivedCategory.Basic -import Mathlib.Algebra.Homology.DerivedCategory.ExactFunctor -import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic -import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughInjectives -import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives -import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences -import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExtClass -import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear -import Mathlib.Algebra.Homology.DerivedCategory.Fractions -import Mathlib.Algebra.Homology.DerivedCategory.FullyFaithful -import Mathlib.Algebra.Homology.DerivedCategory.HomologySequence -import Mathlib.Algebra.Homology.DerivedCategory.Linear -import Mathlib.Algebra.Homology.DerivedCategory.ShortExact -import Mathlib.Algebra.Homology.DerivedCategory.SingleTriangle -import Mathlib.Algebra.Homology.DerivedCategory.TStructure -import Mathlib.Algebra.Homology.DifferentialObject -import Mathlib.Algebra.Homology.Double -import Mathlib.Algebra.Homology.Embedding.AreComplementary -import Mathlib.Algebra.Homology.Embedding.Basic -import Mathlib.Algebra.Homology.Embedding.Boundary -import Mathlib.Algebra.Homology.Embedding.CochainComplex -import Mathlib.Algebra.Homology.Embedding.Connect -import Mathlib.Algebra.Homology.Embedding.Extend -import Mathlib.Algebra.Homology.Embedding.ExtendHomology -import Mathlib.Algebra.Homology.Embedding.HomEquiv -import Mathlib.Algebra.Homology.Embedding.IsSupported -import Mathlib.Algebra.Homology.Embedding.Restriction -import Mathlib.Algebra.Homology.Embedding.RestrictionHomology -import Mathlib.Algebra.Homology.Embedding.StupidTrunc -import Mathlib.Algebra.Homology.Embedding.TruncGE -import Mathlib.Algebra.Homology.Embedding.TruncGEHomology -import Mathlib.Algebra.Homology.Embedding.TruncLE -import Mathlib.Algebra.Homology.Embedding.TruncLEHomology -import Mathlib.Algebra.Homology.ExactSequence -import Mathlib.Algebra.Homology.Factorizations.Basic -import Mathlib.Algebra.Homology.Functor -import Mathlib.Algebra.Homology.GrothendieckAbelian -import Mathlib.Algebra.Homology.HasNoLoop -import Mathlib.Algebra.Homology.HomologicalBicomplex -import Mathlib.Algebra.Homology.HomologicalComplex -import Mathlib.Algebra.Homology.HomologicalComplexAbelian -import Mathlib.Algebra.Homology.HomologicalComplexBiprod -import Mathlib.Algebra.Homology.HomologicalComplexLimits -import Mathlib.Algebra.Homology.HomologySequence -import Mathlib.Algebra.Homology.HomologySequenceLemmas -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.Algebra.Homology.HomotopyCategory -import Mathlib.Algebra.Homology.HomotopyCategory.DegreewiseSplit -import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex -import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexShift -import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor -import Mathlib.Algebra.Homology.HomotopyCategory.MappingCone -import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated -import Mathlib.Algebra.Homology.HomotopyCategory.Shift -import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence -import Mathlib.Algebra.Homology.HomotopyCategory.ShortExact -import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors -import Mathlib.Algebra.Homology.HomotopyCategory.Triangulated -import Mathlib.Algebra.Homology.HomotopyCofiber -import Mathlib.Algebra.Homology.ImageToKernel -import Mathlib.Algebra.Homology.LeftResolution.Basic -import Mathlib.Algebra.Homology.Linear -import Mathlib.Algebra.Homology.LocalCohomology -import Mathlib.Algebra.Homology.Localization -import Mathlib.Algebra.Homology.Monoidal -import Mathlib.Algebra.Homology.Opposite -import Mathlib.Algebra.Homology.QuasiIso -import Mathlib.Algebra.Homology.Refinements -import Mathlib.Algebra.Homology.ShortComplex.Ab -import Mathlib.Algebra.Homology.ShortComplex.Abelian -import Mathlib.Algebra.Homology.ShortComplex.Basic -import Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor -import Mathlib.Algebra.Homology.ShortComplex.FunctorEquivalence -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Algebra.Homology.ShortComplex.Homology -import Mathlib.Algebra.Homology.ShortComplex.LeftHomology -import Mathlib.Algebra.Homology.ShortComplex.Limits -import Mathlib.Algebra.Homology.ShortComplex.Linear -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.Algebra.Homology.ShortComplex.Preadditive -import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology -import Mathlib.Algebra.Homology.ShortComplex.QuasiIso -import Mathlib.Algebra.Homology.ShortComplex.Retract -import Mathlib.Algebra.Homology.ShortComplex.RightHomology -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma -import Mathlib.Algebra.Homology.Single -import Mathlib.Algebra.Homology.SingleHomology -import Mathlib.Algebra.Homology.Square -import Mathlib.Algebra.Homology.TotalComplex -import Mathlib.Algebra.Homology.TotalComplexShift -import Mathlib.Algebra.Homology.TotalComplexSymmetry -import Mathlib.Algebra.IsPrimePow -import Mathlib.Algebra.Jordan.Basic -import Mathlib.Algebra.Lie.Abelian -import Mathlib.Algebra.Lie.BaseChange -import Mathlib.Algebra.Lie.Basic -import Mathlib.Algebra.Lie.CartanExists -import Mathlib.Algebra.Lie.CartanMatrix -import Mathlib.Algebra.Lie.CartanSubalgebra -import Mathlib.Algebra.Lie.Character -import Mathlib.Algebra.Lie.Classical -import Mathlib.Algebra.Lie.Cochain -import Mathlib.Algebra.Lie.Derivation.AdjointAction -import Mathlib.Algebra.Lie.Derivation.Basic -import Mathlib.Algebra.Lie.Derivation.Killing -import Mathlib.Algebra.Lie.DirectSum -import Mathlib.Algebra.Lie.Engel -import Mathlib.Algebra.Lie.EngelSubalgebra -import Mathlib.Algebra.Lie.Extension -import Mathlib.Algebra.Lie.Free -import Mathlib.Algebra.Lie.Ideal -import Mathlib.Algebra.Lie.IdealOperations -import Mathlib.Algebra.Lie.InvariantForm -import Mathlib.Algebra.Lie.Killing -import Mathlib.Algebra.Lie.LieTheorem -import Mathlib.Algebra.Lie.Matrix -import Mathlib.Algebra.Lie.Nilpotent -import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra -import Mathlib.Algebra.Lie.Normalizer -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Lie.Quotient -import Mathlib.Algebra.Lie.Rank -import Mathlib.Algebra.Lie.Semisimple.Basic -import Mathlib.Algebra.Lie.Semisimple.Defs -import Mathlib.Algebra.Lie.Semisimple.Lemmas -import Mathlib.Algebra.Lie.SkewAdjoint -import Mathlib.Algebra.Lie.Sl2 -import Mathlib.Algebra.Lie.Solvable -import Mathlib.Algebra.Lie.Subalgebra -import Mathlib.Algebra.Lie.Submodule -import Mathlib.Algebra.Lie.TensorProduct -import Mathlib.Algebra.Lie.TraceForm -import Mathlib.Algebra.Lie.UniversalEnveloping -import Mathlib.Algebra.Lie.Weights.Basic -import Mathlib.Algebra.Lie.Weights.Cartan -import Mathlib.Algebra.Lie.Weights.Chain -import Mathlib.Algebra.Lie.Weights.IsSimple -import Mathlib.Algebra.Lie.Weights.Killing -import Mathlib.Algebra.Lie.Weights.Linear -import Mathlib.Algebra.Lie.Weights.RootSystem -import Mathlib.Algebra.LinearRecurrence -import Mathlib.Algebra.ModEq -import Mathlib.Algebra.Module.Basic -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Algebra.Module.Bimodule -import Mathlib.Algebra.Module.Card -import Mathlib.Algebra.Module.CharacterModule -import Mathlib.Algebra.Module.Congruence.Defs -import Mathlib.Algebra.Module.DedekindDomain -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Module.End -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Equiv.Opposite -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.Algebra.Module.GradedModule -import Mathlib.Algebra.Module.Hom -import Mathlib.Algebra.Module.Injective -import Mathlib.Algebra.Module.Lattice -import Mathlib.Algebra.Module.LinearMap.Basic -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Algebra.Module.LinearMap.DivisionRing -import Mathlib.Algebra.Module.LinearMap.End -import Mathlib.Algebra.Module.LinearMap.Polynomial -import Mathlib.Algebra.Module.LinearMap.Prod -import Mathlib.Algebra.Module.LinearMap.Rat -import Mathlib.Algebra.Module.LinearMap.Star -import Mathlib.Algebra.Module.LocalizedModule.AtPrime -import Mathlib.Algebra.Module.LocalizedModule.Away -import Mathlib.Algebra.Module.LocalizedModule.Basic -import Mathlib.Algebra.Module.LocalizedModule.Exact -import Mathlib.Algebra.Module.LocalizedModule.Int -import Mathlib.Algebra.Module.LocalizedModule.IsLocalization -import Mathlib.Algebra.Module.LocalizedModule.Submodule -import Mathlib.Algebra.Module.MinimalAxioms -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.Module.Opposite -import Mathlib.Algebra.Module.PID -import Mathlib.Algebra.Module.PUnit -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Module.PointwisePi -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.Algebra.Module.Presentation.Cokernel -import Mathlib.Algebra.Module.Presentation.Differentials -import Mathlib.Algebra.Module.Presentation.DirectSum -import Mathlib.Algebra.Module.Presentation.Finite -import Mathlib.Algebra.Module.Presentation.Free -import Mathlib.Algebra.Module.Presentation.RestrictScalars -import Mathlib.Algebra.Module.Presentation.Tautological -import Mathlib.Algebra.Module.Presentation.Tensor -import Mathlib.Algebra.Module.Prod -import Mathlib.Algebra.Module.Projective -import Mathlib.Algebra.Module.Rat -import Mathlib.Algebra.Module.RingHom -import Mathlib.Algebra.Module.Shrink -import Mathlib.Algebra.Module.SnakeLemma -import Mathlib.Algebra.Module.SpanRank -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.Algebra.Module.Submodule.Bilinear -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.Algebra.Module.Submodule.EqLocus -import Mathlib.Algebra.Module.Submodule.Equiv -import Mathlib.Algebra.Module.Submodule.Invariant -import Mathlib.Algebra.Module.Submodule.IterateMapComap -import Mathlib.Algebra.Module.Submodule.Ker -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.Algebra.Module.Submodule.LinearMap -import Mathlib.Algebra.Module.Submodule.Map -import Mathlib.Algebra.Module.Submodule.Order -import Mathlib.Algebra.Module.Submodule.Pointwise -import Mathlib.Algebra.Module.Submodule.Range -import Mathlib.Algebra.Module.Submodule.RestrictScalars -import Mathlib.Algebra.Module.Submodule.Union -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.Algebra.Module.Torsion.Field -import Mathlib.Algebra.Module.Torsion.Free -import Mathlib.Algebra.Module.Torsion.Pi -import Mathlib.Algebra.Module.Torsion.Prod -import Mathlib.Algebra.Module.TransferInstance -import Mathlib.Algebra.Module.ULift -import Mathlib.Algebra.Module.ZLattice.Basic -import Mathlib.Algebra.Module.ZLattice.Covolume -import Mathlib.Algebra.Module.ZLattice.Summable -import Mathlib.Algebra.Module.ZMod -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Algebra.MonoidAlgebra.Defs -import Mathlib.Algebra.MonoidAlgebra.Degree -import Mathlib.Algebra.MonoidAlgebra.Division -import Mathlib.Algebra.MonoidAlgebra.Grading -import Mathlib.Algebra.MonoidAlgebra.Ideal -import Mathlib.Algebra.MonoidAlgebra.Lift -import Mathlib.Algebra.MonoidAlgebra.MapDomain -import Mathlib.Algebra.MonoidAlgebra.Module -import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors -import Mathlib.Algebra.MonoidAlgebra.Opposite -import Mathlib.Algebra.MonoidAlgebra.Support -import Mathlib.Algebra.MonoidAlgebra.ToDirectSum -import Mathlib.Algebra.MvPolynomial.Basic -import Mathlib.Algebra.MvPolynomial.Cardinal -import Mathlib.Algebra.MvPolynomial.Comap -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.MvPolynomial.Counit -import Mathlib.Algebra.MvPolynomial.Degrees -import Mathlib.Algebra.MvPolynomial.Derivation -import Mathlib.Algebra.MvPolynomial.Division -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Algebra.MvPolynomial.Eval -import Mathlib.Algebra.MvPolynomial.Expand -import Mathlib.Algebra.MvPolynomial.Funext -import Mathlib.Algebra.MvPolynomial.Invertible -import Mathlib.Algebra.MvPolynomial.Monad -import Mathlib.Algebra.MvPolynomial.Nilpotent -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.Algebra.MvPolynomial.Polynomial -import Mathlib.Algebra.MvPolynomial.Rename -import Mathlib.Algebra.MvPolynomial.SchwartzZippel -import Mathlib.Algebra.MvPolynomial.Supported -import Mathlib.Algebra.MvPolynomial.Variables -import Mathlib.Algebra.NeZero -import Mathlib.Algebra.NoZeroSMulDivisors.Basic -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Algebra.NoZeroSMulDivisors.Pi -import Mathlib.Algebra.NoZeroSMulDivisors.Prod -import Mathlib.Algebra.NonAssoc.LieAdmissible.Defs -import Mathlib.Algebra.NonAssoc.PreLie.Basic -import Mathlib.Algebra.Notation -import Mathlib.Algebra.Notation.Defs -import Mathlib.Algebra.Notation.FiniteSupport -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Algebra.Notation.Lemmas -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Notation.Prod -import Mathlib.Algebra.Notation.Support -import Mathlib.Algebra.Opposites -import Mathlib.Algebra.Order.AbsoluteValue.Basic -import Mathlib.Algebra.Order.AbsoluteValue.Euclidean -import Mathlib.Algebra.Order.AddGroupWithTop -import Mathlib.Algebra.Order.AddTorsor -import Mathlib.Algebra.Order.Algebra -import Mathlib.Algebra.Order.Antidiag.Finsupp -import Mathlib.Algebra.Order.Antidiag.Nat -import Mathlib.Algebra.Order.Antidiag.Pi -import Mathlib.Algebra.Order.Antidiag.Prod -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Order.Archimedean.Class -import Mathlib.Algebra.Order.Archimedean.Hom -import Mathlib.Algebra.Order.Archimedean.IndicatorCard -import Mathlib.Algebra.Order.Archimedean.Submonoid -import Mathlib.Algebra.Order.BigOperators.Expect -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.BigOperators.Group.List -import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite -import Mathlib.Algebra.Order.BigOperators.Group.Multiset -import Mathlib.Algebra.Order.BigOperators.GroupWithZero.List -import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Multiset -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.BigOperators.Ring.List -import Mathlib.Algebra.Order.BigOperators.Ring.Multiset -import Mathlib.Algebra.Order.CauSeq.Basic -import Mathlib.Algebra.Order.CauSeq.BigOperators -import Mathlib.Algebra.Order.CauSeq.Completion -import Mathlib.Algebra.Order.Chebyshev -import Mathlib.Algebra.Order.CompleteField -import Mathlib.Algebra.Order.Disjointed -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Algebra.Order.Field.Canonical -import Mathlib.Algebra.Order.Field.Defs -import Mathlib.Algebra.Order.Field.GeomSum -import Mathlib.Algebra.Order.Field.InjSurj -import Mathlib.Algebra.Order.Field.Pi -import Mathlib.Algebra.Order.Field.Pointwise -import Mathlib.Algebra.Order.Field.Power -import Mathlib.Algebra.Order.Field.Rat -import Mathlib.Algebra.Order.Field.Subfield -import Mathlib.Algebra.Order.Floor -import Mathlib.Algebra.Order.Floor.Defs -import Mathlib.Algebra.Order.Floor.Div -import Mathlib.Algebra.Order.Floor.Ring -import Mathlib.Algebra.Order.Floor.Semifield -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Order.Group.Action -import Mathlib.Algebra.Order.Group.Action.End -import Mathlib.Algebra.Order.Group.Action.Flag -import Mathlib.Algebra.Order.Group.Action.Synonym -import Mathlib.Algebra.Order.Group.Basic -import Mathlib.Algebra.Order.Group.Bounds -import Mathlib.Algebra.Order.Group.CompleteLattice -import Mathlib.Algebra.Order.Group.Cone -import Mathlib.Algebra.Order.Group.Cyclic -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Group.DenselyOrdered -import Mathlib.Algebra.Order.Group.End -import Mathlib.Algebra.Order.Group.Equiv -import Mathlib.Algebra.Order.Group.Finset -import Mathlib.Algebra.Order.Group.Indicator -import Mathlib.Algebra.Order.Group.InjSurj -import Mathlib.Algebra.Order.Group.Instances -import Mathlib.Algebra.Order.Group.Int -import Mathlib.Algebra.Order.Group.Int.Sum -import Mathlib.Algebra.Order.Group.Lattice -import Mathlib.Algebra.Order.Group.MinMax -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Group.Opposite -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Algebra.Order.Group.PartialSups -import Mathlib.Algebra.Order.Group.PiLex -import Mathlib.Algebra.Order.Group.Pointwise.Bounds -import Mathlib.Algebra.Order.Group.Pointwise.CompleteLattice -import Mathlib.Algebra.Order.Group.Pointwise.Interval -import Mathlib.Algebra.Order.Group.PosPart -import Mathlib.Algebra.Order.Group.Prod -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Order.Group.TypeTags -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Order.Group.Units -import Mathlib.Algebra.Order.GroupWithZero.Action.Synonym -import Mathlib.Algebra.Order.GroupWithZero.Bounds -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.GroupWithZero.Finset -import Mathlib.Algebra.Order.GroupWithZero.Lex -import Mathlib.Algebra.Order.GroupWithZero.Submonoid -import Mathlib.Algebra.Order.GroupWithZero.Synonym -import Mathlib.Algebra.Order.GroupWithZero.Unbundled -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Lemmas -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso -import Mathlib.Algebra.Order.GroupWithZero.WithZero -import Mathlib.Algebra.Order.Hom.Basic -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Algebra.Order.Hom.MonoidWithZero -import Mathlib.Algebra.Order.Hom.Ring -import Mathlib.Algebra.Order.Hom.Submonoid -import Mathlib.Algebra.Order.Hom.TypeTags -import Mathlib.Algebra.Order.Hom.Units -import Mathlib.Algebra.Order.Interval.Basic -import Mathlib.Algebra.Order.Interval.Finset.Basic -import Mathlib.Algebra.Order.Interval.Finset.SuccPred -import Mathlib.Algebra.Order.Interval.Multiset -import Mathlib.Algebra.Order.Interval.Set.Group -import Mathlib.Algebra.Order.Interval.Set.Instances -import Mathlib.Algebra.Order.Interval.Set.Monoid -import Mathlib.Algebra.Order.Interval.Set.SuccPred -import Mathlib.Algebra.Order.Invertible -import Mathlib.Algebra.Order.Kleene -import Mathlib.Algebra.Order.Module.Algebra -import Mathlib.Algebra.Order.Module.Archimedean -import Mathlib.Algebra.Order.Module.Basic -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Module.Equiv -import Mathlib.Algebra.Order.Module.Field -import Mathlib.Algebra.Order.Module.HahnEmbedding -import Mathlib.Algebra.Order.Module.OrderedSMul -import Mathlib.Algebra.Order.Module.Pointwise -import Mathlib.Algebra.Order.Module.PositiveLinearMap -import Mathlib.Algebra.Order.Module.Rat -import Mathlib.Algebra.Order.Module.Synonym -import Mathlib.Algebra.Order.Monoid.Associated -import Mathlib.Algebra.Order.Monoid.Basic -import Mathlib.Algebra.Order.Monoid.Canonical.Basic -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Lex -import Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder -import Mathlib.Algebra.Order.Monoid.NatCast -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Algebra.Order.Monoid.PNat -import Mathlib.Algebra.Order.Monoid.Prod -import Mathlib.Algebra.Order.Monoid.Submonoid -import Mathlib.Algebra.Order.Monoid.ToMulBot -import Mathlib.Algebra.Order.Monoid.TypeTags -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags -import Mathlib.Algebra.Order.Monoid.Unbundled.Units -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Algebra.Order.Monoid.Units -import Mathlib.Algebra.Order.Monoid.WithTop -import Mathlib.Algebra.Order.Monovary -import Mathlib.Algebra.Order.Nonneg.Basic -import Mathlib.Algebra.Order.Nonneg.Field -import Mathlib.Algebra.Order.Nonneg.Floor -import Mathlib.Algebra.Order.Nonneg.Lattice -import Mathlib.Algebra.Order.Nonneg.Module -import Mathlib.Algebra.Order.Nonneg.Ring -import Mathlib.Algebra.Order.PUnit -import Mathlib.Algebra.Order.PartialSups -import Mathlib.Algebra.Order.Pi -import Mathlib.Algebra.Order.Positive.Field -import Mathlib.Algebra.Order.Positive.Ring -import Mathlib.Algebra.Order.Quantale -import Mathlib.Algebra.Order.Rearrangement -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Algebra.Order.Ring.Archimedean -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Algebra.Order.Ring.Cast -import Mathlib.Algebra.Order.Ring.Cone -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Order.Ring.Finset -import Mathlib.Algebra.Order.Ring.GeomSum -import Mathlib.Algebra.Order.Ring.Idempotent -import Mathlib.Algebra.Order.Ring.InjSurj -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Algebra.Order.Ring.IsNonarchimedean -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Algebra.Order.Ring.Opposite -import Mathlib.Algebra.Order.Ring.Ordering.Basic -import Mathlib.Algebra.Order.Ring.Ordering.Defs -import Mathlib.Algebra.Order.Ring.Pow -import Mathlib.Algebra.Order.Ring.Prod -import Mathlib.Algebra.Order.Ring.Rat -import Mathlib.Algebra.Order.Ring.Star -import Mathlib.Algebra.Order.Ring.Synonym -import Mathlib.Algebra.Order.Ring.Unbundled.Basic -import Mathlib.Algebra.Order.Ring.Unbundled.Rat -import Mathlib.Algebra.Order.Ring.Units -import Mathlib.Algebra.Order.Ring.WithTop -import Mathlib.Algebra.Order.Round -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Algebra.Order.Star.Conjneg -import Mathlib.Algebra.Order.Star.Pi -import Mathlib.Algebra.Order.Star.Prod -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Algebra.Order.Sub.Prod -import Mathlib.Algebra.Order.Sub.Unbundled.Basic -import Mathlib.Algebra.Order.Sub.Unbundled.Hom -import Mathlib.Algebra.Order.Sub.WithTop -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Algebra.Order.SuccPred.PartialSups -import Mathlib.Algebra.Order.SuccPred.TypeTags -import Mathlib.Algebra.Order.SuccPred.WithBot -import Mathlib.Algebra.Order.Sum -import Mathlib.Algebra.Order.ToIntervalMod -import Mathlib.Algebra.Order.UpperLower -import Mathlib.Algebra.Order.WithTop.Untop0 -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Algebra.PEmptyInstances -import Mathlib.Algebra.Pointwise.Stabilizer -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Algebra.Polynomial.Basis -import Mathlib.Algebra.Polynomial.BigOperators -import Mathlib.Algebra.Polynomial.Bivariate -import Mathlib.Algebra.Polynomial.CancelLeads -import Mathlib.Algebra.Polynomial.Cardinal -import Mathlib.Algebra.Polynomial.Coeff -import Mathlib.Algebra.Polynomial.CoeffList -import Mathlib.Algebra.Polynomial.CoeffMem -import Mathlib.Algebra.Polynomial.Degree.CardPowDegree -import Mathlib.Algebra.Polynomial.Degree.Definitions -import Mathlib.Algebra.Polynomial.Degree.Domain -import Mathlib.Algebra.Polynomial.Degree.IsMonicOfDegree -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Algebra.Polynomial.Degree.Monomial -import Mathlib.Algebra.Polynomial.Degree.Operations -import Mathlib.Algebra.Polynomial.Degree.SmallDegree -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Algebra.Polynomial.Degree.TrailingDegree -import Mathlib.Algebra.Polynomial.Degree.Units -import Mathlib.Algebra.Polynomial.DenomsClearable -import Mathlib.Algebra.Polynomial.Derivation -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Polynomial.Div -import Mathlib.Algebra.Polynomial.EraseLead -import Mathlib.Algebra.Polynomial.Eval.Algebra -import Mathlib.Algebra.Polynomial.Eval.Coeff -import Mathlib.Algebra.Polynomial.Eval.Defs -import Mathlib.Algebra.Polynomial.Eval.Degree -import Mathlib.Algebra.Polynomial.Eval.Irreducible -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.Algebra.Polynomial.Eval.Subring -import Mathlib.Algebra.Polynomial.Expand -import Mathlib.Algebra.Polynomial.Factors -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.Algebra.Polynomial.GroupRingAction -import Mathlib.Algebra.Polynomial.HasseDeriv -import Mathlib.Algebra.Polynomial.Homogenize -import Mathlib.Algebra.Polynomial.Identities -import Mathlib.Algebra.Polynomial.Inductions -import Mathlib.Algebra.Polynomial.Laurent -import Mathlib.Algebra.Polynomial.Lifts -import Mathlib.Algebra.Polynomial.Mirror -import Mathlib.Algebra.Polynomial.Module.AEval -import Mathlib.Algebra.Polynomial.Module.Basic -import Mathlib.Algebra.Polynomial.Module.FiniteDimensional -import Mathlib.Algebra.Polynomial.Module.TensorProduct -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.Algebra.Polynomial.Monomial -import Mathlib.Algebra.Polynomial.OfFn -import Mathlib.Algebra.Polynomial.PartialFractions -import Mathlib.Algebra.Polynomial.Reverse -import Mathlib.Algebra.Polynomial.RingDivision -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Algebra.Polynomial.RuleOfSigns -import Mathlib.Algebra.Polynomial.Sequence -import Mathlib.Algebra.Polynomial.Smeval -import Mathlib.Algebra.Polynomial.SpecificDegree -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.Algebra.Polynomial.SumIteratedDerivative -import Mathlib.Algebra.Polynomial.Taylor -import Mathlib.Algebra.Polynomial.UnitTrinomial -import Mathlib.Algebra.PresentedMonoid.Basic -import Mathlib.Algebra.Prime.Defs -import Mathlib.Algebra.Prime.Lemmas -import Mathlib.Algebra.QuadraticAlgebra -import Mathlib.Algebra.QuadraticAlgebra.Basic -import Mathlib.Algebra.QuadraticDiscriminant -import Mathlib.Algebra.Quandle -import Mathlib.Algebra.Quaternion -import Mathlib.Algebra.QuaternionBasis -import Mathlib.Algebra.Quotient -import Mathlib.Algebra.Regular.Basic -import Mathlib.Algebra.Regular.Defs -import Mathlib.Algebra.Regular.Opposite -import Mathlib.Algebra.Regular.Pi -import Mathlib.Algebra.Regular.Pow -import Mathlib.Algebra.Regular.Prod -import Mathlib.Algebra.Regular.SMul -import Mathlib.Algebra.Regular.ULift -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.Algebra.Ring.Action.ConjAct -import Mathlib.Algebra.Ring.Action.End -import Mathlib.Algebra.Ring.Action.Field -import Mathlib.Algebra.Ring.Action.Group -import Mathlib.Algebra.Ring.Action.Invariant -import Mathlib.Algebra.Ring.Action.Pointwise.Finset -import Mathlib.Algebra.Ring.Action.Pointwise.Set -import Mathlib.Algebra.Ring.Action.Rat -import Mathlib.Algebra.Ring.Action.Submonoid -import Mathlib.Algebra.Ring.Action.Subobjects -import Mathlib.Algebra.Ring.AddAut -import Mathlib.Algebra.Ring.Associated -import Mathlib.Algebra.Ring.Associator -import Mathlib.Algebra.Ring.Aut -import Mathlib.Algebra.Ring.Basic -import Mathlib.Algebra.Ring.BooleanRing -import Mathlib.Algebra.Ring.Center -import Mathlib.Algebra.Ring.Centralizer -import Mathlib.Algebra.Ring.CentroidHom -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Algebra.Ring.Commute -import Mathlib.Algebra.Ring.CompTypeclasses -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Divisibility.Lemmas -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.Ext -import Mathlib.Algebra.Ring.Fin -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.Algebra.Ring.GrindInstances -import Mathlib.Algebra.Ring.Hom.Basic -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Algebra.Ring.Hom.InjSurj -import Mathlib.Algebra.Ring.Idempotent -import Mathlib.Algebra.Ring.Identities -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Ring.Int.Parity -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.Algebra.Ring.Invertible -import Mathlib.Algebra.Ring.MinimalAxioms -import Mathlib.Algebra.Ring.Nat -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.Algebra.Ring.NonZeroDivisors -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Algebra.Ring.PUnit -import Mathlib.Algebra.Ring.Parity -import Mathlib.Algebra.Ring.Periodic -import Mathlib.Algebra.Ring.Pi -import Mathlib.Algebra.Ring.Pointwise.Finset -import Mathlib.Algebra.Ring.Pointwise.Set -import Mathlib.Algebra.Ring.Prod -import Mathlib.Algebra.Ring.Rat -import Mathlib.Algebra.Ring.Regular -import Mathlib.Algebra.Ring.Semiconj -import Mathlib.Algebra.Ring.Semireal.Defs -import Mathlib.Algebra.Ring.Shrink -import Mathlib.Algebra.Ring.Subgroup -import Mathlib.Algebra.Ring.Submonoid -import Mathlib.Algebra.Ring.Submonoid.Basic -import Mathlib.Algebra.Ring.Submonoid.Pointwise -import Mathlib.Algebra.Ring.Subring.Basic -import Mathlib.Algebra.Ring.Subring.Defs -import Mathlib.Algebra.Ring.Subring.IntPolynomial -import Mathlib.Algebra.Ring.Subring.MulOpposite -import Mathlib.Algebra.Ring.Subring.Order -import Mathlib.Algebra.Ring.Subring.Pointwise -import Mathlib.Algebra.Ring.Subring.Units -import Mathlib.Algebra.Ring.Subsemiring.Basic -import Mathlib.Algebra.Ring.Subsemiring.Defs -import Mathlib.Algebra.Ring.Subsemiring.MulOpposite -import Mathlib.Algebra.Ring.Subsemiring.Order -import Mathlib.Algebra.Ring.Subsemiring.Pointwise -import Mathlib.Algebra.Ring.SumsOfSquares -import Mathlib.Algebra.Ring.Torsion -import Mathlib.Algebra.Ring.TransferInstance -import Mathlib.Algebra.Ring.ULift -import Mathlib.Algebra.Ring.Units -import Mathlib.Algebra.Ring.WithZero -import Mathlib.Algebra.RingQuot -import Mathlib.Algebra.SkewMonoidAlgebra.Basic -import Mathlib.Algebra.SkewMonoidAlgebra.Lift -import Mathlib.Algebra.SkewMonoidAlgebra.Single -import Mathlib.Algebra.SkewMonoidAlgebra.Support -import Mathlib.Algebra.SkewPolynomial.Basic -import Mathlib.Algebra.Squarefree.Basic -import Mathlib.Algebra.Star.Basic -import Mathlib.Algebra.Star.BigOperators -import Mathlib.Algebra.Star.CHSH -import Mathlib.Algebra.Star.Center -import Mathlib.Algebra.Star.CentroidHom -import Mathlib.Algebra.Star.Conjneg -import Mathlib.Algebra.Star.Free -import Mathlib.Algebra.Star.LinearMap -import Mathlib.Algebra.Star.Module -import Mathlib.Algebra.Star.MonoidHom -import Mathlib.Algebra.Star.NonUnitalSubalgebra -import Mathlib.Algebra.Star.NonUnitalSubsemiring -import Mathlib.Algebra.Star.Pi -import Mathlib.Algebra.Star.Pointwise -import Mathlib.Algebra.Star.Prod -import Mathlib.Algebra.Star.Rat -import Mathlib.Algebra.Star.RingQuot -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Star.StarAlgHom -import Mathlib.Algebra.Star.StarProjection -import Mathlib.Algebra.Star.StarRingHom -import Mathlib.Algebra.Star.Subalgebra -import Mathlib.Algebra.Star.Subsemiring -import Mathlib.Algebra.Star.TensorProduct -import Mathlib.Algebra.Star.Unitary -import Mathlib.Algebra.Star.UnitaryStarAlgAut -import Mathlib.Algebra.Symmetrized -import Mathlib.Algebra.TrivSqZeroExt -import Mathlib.Algebra.Tropical.Basic -import Mathlib.Algebra.Tropical.BigOperators -import Mathlib.Algebra.Tropical.Lattice -import Mathlib.Algebra.Vertex.HVertexOperator -import Mathlib.Algebra.Vertex.VertexOperator -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.AlgebraicGeometry.AffineSpace -import Mathlib.AlgebraicGeometry.AffineTransitionLimit -import Mathlib.AlgebraicGeometry.Cover.Directed -import Mathlib.AlgebraicGeometry.Cover.MorphismProperty -import Mathlib.AlgebraicGeometry.Cover.Open -import Mathlib.AlgebraicGeometry.Cover.Over -import Mathlib.AlgebraicGeometry.Cover.Sigma -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point -import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Basic -import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Degree -import Mathlib.AlgebraicGeometry.EllipticCurve.Group -import Mathlib.AlgebraicGeometry.EllipticCurve.IsomOfJ -import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Basic -import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Formula -import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Point -import Mathlib.AlgebraicGeometry.EllipticCurve.ModelsWithJ -import Mathlib.AlgebraicGeometry.EllipticCurve.NormalForms -import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Basic -import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Formula -import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Point -import Mathlib.AlgebraicGeometry.EllipticCurve.Reduction -import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange -import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass -import Mathlib.AlgebraicGeometry.Fiber -import Mathlib.AlgebraicGeometry.FunctionField -import Mathlib.AlgebraicGeometry.GammaSpecAdjunction -import Mathlib.AlgebraicGeometry.Gluing -import Mathlib.AlgebraicGeometry.GluingOneHypercover -import Mathlib.AlgebraicGeometry.IdealSheaf -import Mathlib.AlgebraicGeometry.IdealSheaf.Basic -import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial -import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme -import Mathlib.AlgebraicGeometry.Limits -import Mathlib.AlgebraicGeometry.Modules.Presheaf -import Mathlib.AlgebraicGeometry.Modules.Sheaf -import Mathlib.AlgebraicGeometry.Modules.Tilde -import Mathlib.AlgebraicGeometry.Morphisms.Affine -import Mathlib.AlgebraicGeometry.Morphisms.AffineAnd -import Mathlib.AlgebraicGeometry.Morphisms.Basic -import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion -import Mathlib.AlgebraicGeometry.Morphisms.Constructors -import Mathlib.AlgebraicGeometry.Morphisms.Descent -import Mathlib.AlgebraicGeometry.Morphisms.Etale -import Mathlib.AlgebraicGeometry.Morphisms.Finite -import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation -import Mathlib.AlgebraicGeometry.Morphisms.FiniteType -import Mathlib.AlgebraicGeometry.Morphisms.Flat -import Mathlib.AlgebraicGeometry.Morphisms.FormallyUnramified -import Mathlib.AlgebraicGeometry.Morphisms.Immersion -import Mathlib.AlgebraicGeometry.Morphisms.Integral -import Mathlib.AlgebraicGeometry.Morphisms.IsIso -import Mathlib.AlgebraicGeometry.Morphisms.LocalClosure -import Mathlib.AlgebraicGeometry.Morphisms.LocalIso -import Mathlib.AlgebraicGeometry.Morphisms.OpenImmersion -import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion -import Mathlib.AlgebraicGeometry.Morphisms.Proper -import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact -import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated -import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties -import Mathlib.AlgebraicGeometry.Morphisms.Separated -import Mathlib.AlgebraicGeometry.Morphisms.Smooth -import Mathlib.AlgebraicGeometry.Morphisms.SurjectiveOnStalks -import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap -import Mathlib.AlgebraicGeometry.Morphisms.UniversallyClosed -import Mathlib.AlgebraicGeometry.Morphisms.UniversallyInjective -import Mathlib.AlgebraicGeometry.Morphisms.UniversallyOpen -import Mathlib.AlgebraicGeometry.Noetherian -import Mathlib.AlgebraicGeometry.OpenImmersion -import Mathlib.AlgebraicGeometry.Over -import Mathlib.AlgebraicGeometry.PointsPi -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Basic -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Proper -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Topology -import Mathlib.AlgebraicGeometry.Properties -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.AlgebraicGeometry.Pullbacks -import Mathlib.AlgebraicGeometry.QuasiAffine -import Mathlib.AlgebraicGeometry.RationalMap -import Mathlib.AlgebraicGeometry.ResidueField -import Mathlib.AlgebraicGeometry.Restrict -import Mathlib.AlgebraicGeometry.Scheme -import Mathlib.AlgebraicGeometry.Sites.BigZariski -import Mathlib.AlgebraicGeometry.Sites.Etale -import Mathlib.AlgebraicGeometry.Sites.MorphismProperty -import Mathlib.AlgebraicGeometry.Sites.Pretopology -import Mathlib.AlgebraicGeometry.Sites.Representability -import Mathlib.AlgebraicGeometry.Sites.Small -import Mathlib.AlgebraicGeometry.Sites.SmallAffineZariski -import Mathlib.AlgebraicGeometry.Spec -import Mathlib.AlgebraicGeometry.SpreadingOut -import Mathlib.AlgebraicGeometry.Stalk -import Mathlib.AlgebraicGeometry.StructureSheaf -import Mathlib.AlgebraicGeometry.ValuativeCriterion -import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex -import Mathlib.AlgebraicTopology.CechNerve -import Mathlib.AlgebraicTopology.DoldKan.Compatibility -import Mathlib.AlgebraicTopology.DoldKan.Decomposition -import Mathlib.AlgebraicTopology.DoldKan.Degeneracies -import Mathlib.AlgebraicTopology.DoldKan.Equivalence -import Mathlib.AlgebraicTopology.DoldKan.EquivalenceAdditive -import Mathlib.AlgebraicTopology.DoldKan.EquivalencePseudoabelian -import Mathlib.AlgebraicTopology.DoldKan.Faces -import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma -import Mathlib.AlgebraicTopology.DoldKan.FunctorN -import Mathlib.AlgebraicTopology.DoldKan.GammaCompN -import Mathlib.AlgebraicTopology.DoldKan.Homotopies -import Mathlib.AlgebraicTopology.DoldKan.HomotopyEquivalence -import Mathlib.AlgebraicTopology.DoldKan.NCompGamma -import Mathlib.AlgebraicTopology.DoldKan.NReflectsIso -import Mathlib.AlgebraicTopology.DoldKan.Normalized -import Mathlib.AlgebraicTopology.DoldKan.Notations -import Mathlib.AlgebraicTopology.DoldKan.PInfty -import Mathlib.AlgebraicTopology.DoldKan.Projections -import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject -import Mathlib.AlgebraicTopology.ExtraDegeneracy -import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic -import Mathlib.AlgebraicTopology.FundamentalGroupoid.FundamentalGroup -import Mathlib.AlgebraicTopology.FundamentalGroupoid.InducedMaps -import Mathlib.AlgebraicTopology.FundamentalGroupoid.PUnit -import Mathlib.AlgebraicTopology.FundamentalGroupoid.Product -import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected -import Mathlib.AlgebraicTopology.ModelCategory.Basic -import Mathlib.AlgebraicTopology.ModelCategory.BrownLemma -import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations -import Mathlib.AlgebraicTopology.ModelCategory.Cylinder -import Mathlib.AlgebraicTopology.ModelCategory.Homotopy -import Mathlib.AlgebraicTopology.ModelCategory.Instances -import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant -import Mathlib.AlgebraicTopology.ModelCategory.JoyalTrick -import Mathlib.AlgebraicTopology.ModelCategory.LeftHomotopy -import Mathlib.AlgebraicTopology.ModelCategory.Opposite -import Mathlib.AlgebraicTopology.ModelCategory.PathObject -import Mathlib.AlgebraicTopology.ModelCategory.RightHomotopy -import Mathlib.AlgebraicTopology.MooreComplex -import Mathlib.AlgebraicTopology.Quasicategory.Basic -import Mathlib.AlgebraicTopology.Quasicategory.Nerve -import Mathlib.AlgebraicTopology.Quasicategory.StrictSegal -import Mathlib.AlgebraicTopology.Quasicategory.TwoTruncated -import Mathlib.AlgebraicTopology.RelativeCellComplex.AttachCells -import Mathlib.AlgebraicTopology.RelativeCellComplex.Basic -import Mathlib.AlgebraicTopology.SimplexCategory.Augmented -import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Basic -import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Monoidal -import Mathlib.AlgebraicTopology.SimplexCategory.Basic -import Mathlib.AlgebraicTopology.SimplexCategory.Defs -import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.Basic -import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.EpiMono -import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.NormalForms -import Mathlib.AlgebraicTopology.SimplexCategory.MorphismProperty -import Mathlib.AlgebraicTopology.SimplexCategory.Rev -import Mathlib.AlgebraicTopology.SimplexCategory.Truncated -import Mathlib.AlgebraicTopology.SimplicialCategory.Basic -import Mathlib.AlgebraicTopology.SimplicialCategory.SimplicialObject -import Mathlib.AlgebraicTopology.SimplicialNerve -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.AlgebraicTopology.SimplicialObject.Coskeletal -import Mathlib.AlgebraicTopology.SimplicialObject.II -import Mathlib.AlgebraicTopology.SimplicialObject.Op -import Mathlib.AlgebraicTopology.SimplicialObject.Split -import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.IsUniquelyCodimOneFace -import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.Pairing -import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.PairingCore -import Mathlib.AlgebraicTopology.SimplicialSet.Basic -import Mathlib.AlgebraicTopology.SimplicialSet.Boundary -import Mathlib.AlgebraicTopology.SimplicialSet.CategoryWithFibrations -import Mathlib.AlgebraicTopology.SimplicialSet.CompStructTruncated -import Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal -import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate -import Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat -import Mathlib.AlgebraicTopology.SimplicialSet.Horn -import Mathlib.AlgebraicTopology.SimplicialSet.KanComplex -import Mathlib.AlgebraicTopology.SimplicialSet.Monoidal -import Mathlib.AlgebraicTopology.SimplicialSet.Nerve -import Mathlib.AlgebraicTopology.SimplicialSet.NerveAdjunction -import Mathlib.AlgebraicTopology.SimplicialSet.NerveNondegenerate -import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplices -import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplicesSubcomplex -import Mathlib.AlgebraicTopology.SimplicialSet.Op -import Mathlib.AlgebraicTopology.SimplicialSet.Path -import Mathlib.AlgebraicTopology.SimplicialSet.Simplices -import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex -import Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal -import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex -import Mathlib.AlgebraicTopology.SingularHomology.Basic -import Mathlib.AlgebraicTopology.SingularSet -import Mathlib.AlgebraicTopology.TopologicalSimplex -import Mathlib.Analysis.AbsoluteValue.Equivalence -import Mathlib.Analysis.Analytic.Basic -import Mathlib.Analysis.Analytic.Binomial -import Mathlib.Analysis.Analytic.CPolynomial -import Mathlib.Analysis.Analytic.CPolynomialDef -import Mathlib.Analysis.Analytic.ChangeOrigin -import Mathlib.Analysis.Analytic.Composition -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Analytic.ConvergenceRadius -import Mathlib.Analysis.Analytic.Inverse -import Mathlib.Analysis.Analytic.IsolatedZeros -import Mathlib.Analysis.Analytic.IteratedFDeriv -import Mathlib.Analysis.Analytic.Linear -import Mathlib.Analysis.Analytic.OfScalars -import Mathlib.Analysis.Analytic.Order -import Mathlib.Analysis.Analytic.Polynomial -import Mathlib.Analysis.Analytic.RadiusLiminf -import Mathlib.Analysis.Analytic.Uniqueness -import Mathlib.Analysis.Analytic.WithLp -import Mathlib.Analysis.Analytic.Within -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.Asymptotics.Completion -import Mathlib.Analysis.Asymptotics.Defs -import Mathlib.Analysis.Asymptotics.ExpGrowth -import Mathlib.Analysis.Asymptotics.Lemmas -import Mathlib.Analysis.Asymptotics.LinearGrowth -import Mathlib.Analysis.Asymptotics.SpecificAsymptotics -import Mathlib.Analysis.Asymptotics.SuperpolynomialDecay -import Mathlib.Analysis.Asymptotics.TVS -import Mathlib.Analysis.Asymptotics.Theta -import Mathlib.Analysis.BoundedVariation -import Mathlib.Analysis.BoxIntegral.Basic -import Mathlib.Analysis.BoxIntegral.Box.Basic -import Mathlib.Analysis.BoxIntegral.Box.SubboxInduction -import Mathlib.Analysis.BoxIntegral.DivergenceTheorem -import Mathlib.Analysis.BoxIntegral.Integrability -import Mathlib.Analysis.BoxIntegral.Partition.Additive -import Mathlib.Analysis.BoxIntegral.Partition.Basic -import Mathlib.Analysis.BoxIntegral.Partition.Filter -import Mathlib.Analysis.BoxIntegral.Partition.Measure -import Mathlib.Analysis.BoxIntegral.Partition.Split -import Mathlib.Analysis.BoxIntegral.Partition.SubboxInduction -import Mathlib.Analysis.BoxIntegral.Partition.Tagged -import Mathlib.Analysis.BoxIntegral.UnitPartition -import Mathlib.Analysis.CStarAlgebra.ApproximateUnit -import Mathlib.Analysis.CStarAlgebra.Basic -import Mathlib.Analysis.CStarAlgebra.CStarMatrix -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.CStarAlgebra.CompletelyPositiveMap -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Commute -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Continuity -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Integral -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Note -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Pi -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Range -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unital -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unitary -import Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap -import Mathlib.Analysis.CStarAlgebra.ContinuousMap -import Mathlib.Analysis.CStarAlgebra.Exponential -import Mathlib.Analysis.CStarAlgebra.GelfandDuality -import Mathlib.Analysis.CStarAlgebra.Hom -import Mathlib.Analysis.CStarAlgebra.Matrix -import Mathlib.Analysis.CStarAlgebra.Module.Constructions -import Mathlib.Analysis.CStarAlgebra.Module.Defs -import Mathlib.Analysis.CStarAlgebra.Module.Synonym -import Mathlib.Analysis.CStarAlgebra.Multiplier -import Mathlib.Analysis.CStarAlgebra.PositiveLinearMap -import Mathlib.Analysis.CStarAlgebra.Projection -import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart -import Mathlib.Analysis.CStarAlgebra.Spectrum -import Mathlib.Analysis.CStarAlgebra.Unitary.Connected -import Mathlib.Analysis.CStarAlgebra.Unitary.Span -import Mathlib.Analysis.CStarAlgebra.Unitization -import Mathlib.Analysis.CStarAlgebra.lpSpace -import Mathlib.Analysis.Calculus.AddTorsor.AffineMap -import Mathlib.Analysis.Calculus.AddTorsor.Coord -import Mathlib.Analysis.Calculus.BumpFunction.Basic -import Mathlib.Analysis.Calculus.BumpFunction.Convolution -import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension -import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct -import Mathlib.Analysis.Calculus.BumpFunction.Normed -import Mathlib.Analysis.Calculus.BumpFunction.SmoothApprox -import Mathlib.Analysis.Calculus.Conformal.InnerProduct -import Mathlib.Analysis.Calculus.Conformal.NormedSpace -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.ContDiff.Bounds -import Mathlib.Analysis.Calculus.ContDiff.CPolynomial -import Mathlib.Analysis.Calculus.ContDiff.Defs -import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries -import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno -import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.ContDiff.RCLike -import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars -import Mathlib.Analysis.Calculus.ContDiff.WithLp -import Mathlib.Analysis.Calculus.DSlope -import Mathlib.Analysis.Calculus.Darboux -import Mathlib.Analysis.Calculus.Deriv.Abs -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.AffineMap -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.Deriv.CompMul -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.Calculus.Deriv.Inverse -import Mathlib.Analysis.Calculus.Deriv.Linear -import Mathlib.Analysis.Calculus.Deriv.MeanValue -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Pi -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Analysis.Calculus.Deriv.Pow -import Mathlib.Analysis.Calculus.Deriv.Prod -import Mathlib.Analysis.Calculus.Deriv.Shift -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.Analysis.Calculus.Deriv.Star -import Mathlib.Analysis.Calculus.Deriv.Support -import Mathlib.Analysis.Calculus.Deriv.ZPow -import Mathlib.Analysis.Calculus.DerivativeTest -import Mathlib.Analysis.Calculus.DiffContOnCl -import Mathlib.Analysis.Calculus.DifferentialForm.Basic -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.FDeriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Bilinear -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.CompCLM -import Mathlib.Analysis.Calculus.FDeriv.Congr -import Mathlib.Analysis.Calculus.FDeriv.Const -import Mathlib.Analysis.Calculus.FDeriv.ContinuousMultilinearMap -import Mathlib.Analysis.Calculus.FDeriv.Defs -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Calculus.FDeriv.Extend -import Mathlib.Analysis.Calculus.FDeriv.Linear -import Mathlib.Analysis.Calculus.FDeriv.Measurable -import Mathlib.Analysis.Calculus.FDeriv.Mul -import Mathlib.Analysis.Calculus.FDeriv.Norm -import Mathlib.Analysis.Calculus.FDeriv.Pi -import Mathlib.Analysis.Calculus.FDeriv.Pow -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars -import Mathlib.Analysis.Calculus.FDeriv.Star -import Mathlib.Analysis.Calculus.FDeriv.Symmetric -import Mathlib.Analysis.Calculus.FDeriv.WithLp -import Mathlib.Analysis.Calculus.FormalMultilinearSeries -import Mathlib.Analysis.Calculus.Gradient.Basic -import Mathlib.Analysis.Calculus.Implicit -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FiniteDimensional -import Mathlib.Analysis.Calculus.IteratedDeriv.ConvergenceOnBall -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs -import Mathlib.Analysis.Calculus.IteratedDeriv.FaaDiBruno -import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas -import Mathlib.Analysis.Calculus.IteratedDeriv.WithinZpow -import Mathlib.Analysis.Calculus.LHopital -import Mathlib.Analysis.Calculus.LagrangeMultipliers -import Mathlib.Analysis.Calculus.LineDeriv.Basic -import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts -import Mathlib.Analysis.Calculus.LineDeriv.Measurable -import Mathlib.Analysis.Calculus.LineDeriv.QuadraticMap -import Mathlib.Analysis.Calculus.LocalExtr.Basic -import Mathlib.Analysis.Calculus.LocalExtr.LineDeriv -import Mathlib.Analysis.Calculus.LocalExtr.Polynomial -import Mathlib.Analysis.Calculus.LocalExtr.Rolle -import Mathlib.Analysis.Calculus.LogDeriv -import Mathlib.Analysis.Calculus.LogDerivUniformlyOn -import Mathlib.Analysis.Calculus.MeanValue -import Mathlib.Analysis.Calculus.Monotone -import Mathlib.Analysis.Calculus.ParametricIntegral -import Mathlib.Analysis.Calculus.ParametricIntervalIntegral -import Mathlib.Analysis.Calculus.Rademacher -import Mathlib.Analysis.Calculus.SmoothSeries -import Mathlib.Analysis.Calculus.TangentCone -import Mathlib.Analysis.Calculus.TangentCone.Basic -import Mathlib.Analysis.Calculus.TangentCone.Defs -import Mathlib.Analysis.Calculus.TangentCone.DimOne -import Mathlib.Analysis.Calculus.TangentCone.Pi -import Mathlib.Analysis.Calculus.TangentCone.Prod -import Mathlib.Analysis.Calculus.TangentCone.ProperSpace -import Mathlib.Analysis.Calculus.TangentCone.Real -import Mathlib.Analysis.Calculus.Taylor -import Mathlib.Analysis.Calculus.UniformLimitsDeriv -import Mathlib.Analysis.Calculus.VectorField -import Mathlib.Analysis.Complex.AbelLimit -import Mathlib.Analysis.Complex.AbsMax -import Mathlib.Analysis.Complex.Angle -import Mathlib.Analysis.Complex.Arg -import Mathlib.Analysis.Complex.Asymptotics -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.Complex.Cardinality -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.Complex.Circle -import Mathlib.Analysis.Complex.Conformal -import Mathlib.Analysis.Complex.Convex -import Mathlib.Analysis.Complex.Exponential -import Mathlib.Analysis.Complex.ExponentialBounds -import Mathlib.Analysis.Complex.Hadamard -import Mathlib.Analysis.Complex.HalfPlane -import Mathlib.Analysis.Complex.Harmonic.Analytic -import Mathlib.Analysis.Complex.Harmonic.MeanValue -import Mathlib.Analysis.Complex.HasPrimitives -import Mathlib.Analysis.Complex.IntegerCompl -import Mathlib.Analysis.Complex.IsIntegral -import Mathlib.Analysis.Complex.Isometry -import Mathlib.Analysis.Complex.JensenFormula -import Mathlib.Analysis.Complex.Liouville -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.Analysis.Complex.MeanValue -import Mathlib.Analysis.Complex.Norm -import Mathlib.Analysis.Complex.OpenMapping -import Mathlib.Analysis.Complex.OperatorNorm -import Mathlib.Analysis.Complex.Order -import Mathlib.Analysis.Complex.Periodic -import Mathlib.Analysis.Complex.PhragmenLindelof -import Mathlib.Analysis.Complex.Polynomial.Basic -import Mathlib.Analysis.Complex.Polynomial.GaussLucas -import Mathlib.Analysis.Complex.Polynomial.UnitTrinomial -import Mathlib.Analysis.Complex.Positivity -import Mathlib.Analysis.Complex.ReImTopology -import Mathlib.Analysis.Complex.RealDeriv -import Mathlib.Analysis.Complex.RemovableSingularity -import Mathlib.Analysis.Complex.Schwarz -import Mathlib.Analysis.Complex.Spectrum -import Mathlib.Analysis.Complex.SummableUniformlyOn -import Mathlib.Analysis.Complex.TaylorSeries -import Mathlib.Analysis.Complex.Tietze -import Mathlib.Analysis.Complex.Trigonometric -import Mathlib.Analysis.Complex.UnitDisc.Basic -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.Complex.UpperHalfPlane.Exp -import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty -import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold -import Mathlib.Analysis.Complex.UpperHalfPlane.Metric -import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction -import Mathlib.Analysis.Complex.UpperHalfPlane.Topology -import Mathlib.Analysis.Complex.ValueDistribution.CharacteristicFunction -import Mathlib.Analysis.Complex.ValueDistribution.CountingFunction -import Mathlib.Analysis.Complex.ValueDistribution.FirstMainTheorem -import Mathlib.Analysis.Complex.ValueDistribution.ProximityFunction -import Mathlib.Analysis.ConstantSpeed -import Mathlib.Analysis.Convex.AmpleSet -import Mathlib.Analysis.Convex.Basic -import Mathlib.Analysis.Convex.Between -import Mathlib.Analysis.Convex.BetweenList -import Mathlib.Analysis.Convex.Birkhoff -import Mathlib.Analysis.Convex.Body -import Mathlib.Analysis.Convex.Caratheodory -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.Cone.Basic -import Mathlib.Analysis.Convex.Cone.Closure -import Mathlib.Analysis.Convex.Cone.Dual -import Mathlib.Analysis.Convex.Cone.Extension -import Mathlib.Analysis.Convex.Cone.InnerDual -import Mathlib.Analysis.Convex.Continuous -import Mathlib.Analysis.Convex.ContinuousLinearEquiv -import Mathlib.Analysis.Convex.Contractible -import Mathlib.Analysis.Convex.Deriv -import Mathlib.Analysis.Convex.DoublyStochasticMatrix -import Mathlib.Analysis.Convex.EGauge -import Mathlib.Analysis.Convex.Exposed -import Mathlib.Analysis.Convex.Extrema -import Mathlib.Analysis.Convex.Extreme -import Mathlib.Analysis.Convex.Function -import Mathlib.Analysis.Convex.Gauge -import Mathlib.Analysis.Convex.GaugeRescale -import Mathlib.Analysis.Convex.Hull -import Mathlib.Analysis.Convex.Independent -import Mathlib.Analysis.Convex.Integral -import Mathlib.Analysis.Convex.Intrinsic -import Mathlib.Analysis.Convex.Jensen -import Mathlib.Analysis.Convex.Join -import Mathlib.Analysis.Convex.KreinMilman -import Mathlib.Analysis.Convex.LinearIsometry -import Mathlib.Analysis.Convex.Measure -import Mathlib.Analysis.Convex.Mul -import Mathlib.Analysis.Convex.PartitionOfUnity -import Mathlib.Analysis.Convex.PathConnected -import Mathlib.Analysis.Convex.Piecewise -import Mathlib.Analysis.Convex.Quasiconvex -import Mathlib.Analysis.Convex.Radon -import Mathlib.Analysis.Convex.Segment -import Mathlib.Analysis.Convex.Side -import Mathlib.Analysis.Convex.SimplicialComplex.Basic -import Mathlib.Analysis.Convex.Slope -import Mathlib.Analysis.Convex.SpecificFunctions.Basic -import Mathlib.Analysis.Convex.SpecificFunctions.Deriv -import Mathlib.Analysis.Convex.SpecificFunctions.Pow -import Mathlib.Analysis.Convex.Star -import Mathlib.Analysis.Convex.StdSimplex -import Mathlib.Analysis.Convex.StoneSeparation -import Mathlib.Analysis.Convex.Strict -import Mathlib.Analysis.Convex.StrictConvexBetween -import Mathlib.Analysis.Convex.StrictConvexSpace -import Mathlib.Analysis.Convex.Strong -import Mathlib.Analysis.Convex.Topology -import Mathlib.Analysis.Convex.TotallyBounded -import Mathlib.Analysis.Convex.Uniform -import Mathlib.Analysis.Convex.Visible -import Mathlib.Analysis.Convolution -import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff -import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn -import Mathlib.Analysis.Distribution.FourierSchwartz -import Mathlib.Analysis.Distribution.SchwartzSpace -import Mathlib.Analysis.Distribution.TemperateGrowth -import Mathlib.Analysis.Fourier.AddCircle -import Mathlib.Analysis.Fourier.AddCircleMulti -import Mathlib.Analysis.Fourier.BoundedContinuousFunctionChar -import Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality -import Mathlib.Analysis.Fourier.FiniteAbelian.PontryaginDuality -import Mathlib.Analysis.Fourier.FourierTransform -import Mathlib.Analysis.Fourier.FourierTransformDeriv -import Mathlib.Analysis.Fourier.Inversion -import Mathlib.Analysis.Fourier.Notation -import Mathlib.Analysis.Fourier.PoissonSummation -import Mathlib.Analysis.Fourier.RiemannLebesgueLemma -import Mathlib.Analysis.Fourier.ZMod -import Mathlib.Analysis.FunctionalSpaces.SobolevInequality -import Mathlib.Analysis.Hofer -import Mathlib.Analysis.InnerProductSpace.Adjoint -import Mathlib.Analysis.InnerProductSpace.Affine -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.InnerProductSpace.CanonicalTensor -import Mathlib.Analysis.InnerProductSpace.Completion -import Mathlib.Analysis.InnerProductSpace.ConformalLinearMap -import Mathlib.Analysis.InnerProductSpace.Continuous -import Mathlib.Analysis.InnerProductSpace.Convex -import Mathlib.Analysis.InnerProductSpace.Defs -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.InnerProductSpace.EuclideanDist -import Mathlib.Analysis.InnerProductSpace.GramMatrix -import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho -import Mathlib.Analysis.InnerProductSpace.Harmonic.Analytic -import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic -import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions -import Mathlib.Analysis.InnerProductSpace.JointEigenspace -import Mathlib.Analysis.InnerProductSpace.Laplacian -import Mathlib.Analysis.InnerProductSpace.LaxMilgram -import Mathlib.Analysis.InnerProductSpace.LinearMap -import Mathlib.Analysis.InnerProductSpace.LinearPMap -import Mathlib.Analysis.InnerProductSpace.MeanErgodic -import Mathlib.Analysis.InnerProductSpace.MulOpposite -import Mathlib.Analysis.InnerProductSpace.NormPow -import Mathlib.Analysis.InnerProductSpace.OfNorm -import Mathlib.Analysis.InnerProductSpace.Orientation -import Mathlib.Analysis.InnerProductSpace.Orthogonal -import Mathlib.Analysis.InnerProductSpace.Orthonormal -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Analysis.InnerProductSpace.Positive -import Mathlib.Analysis.InnerProductSpace.ProdL2 -import Mathlib.Analysis.InnerProductSpace.Projection -import Mathlib.Analysis.InnerProductSpace.Projection.Basic -import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional -import Mathlib.Analysis.InnerProductSpace.Projection.Minimal -import Mathlib.Analysis.InnerProductSpace.Projection.Reflection -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule -import Mathlib.Analysis.InnerProductSpace.Rayleigh -import Mathlib.Analysis.InnerProductSpace.Semisimple -import Mathlib.Analysis.InnerProductSpace.Spectrum -import Mathlib.Analysis.InnerProductSpace.StarOrder -import Mathlib.Analysis.InnerProductSpace.Subspace -import Mathlib.Analysis.InnerProductSpace.Symmetric -import Mathlib.Analysis.InnerProductSpace.TensorProduct -import Mathlib.Analysis.InnerProductSpace.Trace -import Mathlib.Analysis.InnerProductSpace.TwoDim -import Mathlib.Analysis.InnerProductSpace.WeakOperatorTopology -import Mathlib.Analysis.InnerProductSpace.l2Space -import Mathlib.Analysis.LConvolution -import Mathlib.Analysis.LocallyConvex.AbsConvex -import Mathlib.Analysis.LocallyConvex.AbsConvexOpen -import Mathlib.Analysis.LocallyConvex.BalancedCoreHull -import Mathlib.Analysis.LocallyConvex.Barrelled -import Mathlib.Analysis.LocallyConvex.Basic -import Mathlib.Analysis.LocallyConvex.Bounded -import Mathlib.Analysis.LocallyConvex.ContinuousOfBounded -import Mathlib.Analysis.LocallyConvex.Polar -import Mathlib.Analysis.LocallyConvex.SeparatingDual -import Mathlib.Analysis.LocallyConvex.Separation -import Mathlib.Analysis.LocallyConvex.StrongTopology -import Mathlib.Analysis.LocallyConvex.WeakDual -import Mathlib.Analysis.LocallyConvex.WeakOperatorTopology -import Mathlib.Analysis.LocallyConvex.WeakSpace -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.Matrix -import Mathlib.Analysis.Matrix.Normed -import Mathlib.Analysis.Matrix.Order -import Mathlib.Analysis.Matrix.PosDef -import Mathlib.Analysis.Matrix.Spectrum -import Mathlib.Analysis.MeanInequalities -import Mathlib.Analysis.MeanInequalitiesPow -import Mathlib.Analysis.MellinInversion -import Mathlib.Analysis.MellinTransform -import Mathlib.Analysis.Meromorphic.Basic -import Mathlib.Analysis.Meromorphic.Complex -import Mathlib.Analysis.Meromorphic.Divisor -import Mathlib.Analysis.Meromorphic.FactorizedRational -import Mathlib.Analysis.Meromorphic.IsolatedZeros -import Mathlib.Analysis.Meromorphic.NormalForm -import Mathlib.Analysis.Meromorphic.Order -import Mathlib.Analysis.Meromorphic.TrailingCoefficient -import Mathlib.Analysis.Normed.Affine.AddTorsor -import Mathlib.Analysis.Normed.Affine.AddTorsorBases -import Mathlib.Analysis.Normed.Affine.AsymptoticCone -import Mathlib.Analysis.Normed.Affine.ContinuousAffineMap -import Mathlib.Analysis.Normed.Affine.Convex -import Mathlib.Analysis.Normed.Affine.Isometry -import Mathlib.Analysis.Normed.Affine.MazurUlam -import Mathlib.Analysis.Normed.Affine.Simplex -import Mathlib.Analysis.Normed.Algebra.Basic -import Mathlib.Analysis.Normed.Algebra.DualNumber -import Mathlib.Analysis.Normed.Algebra.Exponential -import Mathlib.Analysis.Normed.Algebra.GelfandFormula -import Mathlib.Analysis.Normed.Algebra.GelfandMazur -import Mathlib.Analysis.Normed.Algebra.MatrixExponential -import Mathlib.Analysis.Normed.Algebra.QuaternionExponential -import Mathlib.Analysis.Normed.Algebra.Spectrum -import Mathlib.Analysis.Normed.Algebra.TrivSqZeroExt -import Mathlib.Analysis.Normed.Algebra.Ultra -import Mathlib.Analysis.Normed.Algebra.Unitization -import Mathlib.Analysis.Normed.Algebra.UnitizationL1 -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.Analysis.Normed.Field.Instances -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Analysis.Normed.Field.ProperSpace -import Mathlib.Analysis.Normed.Field.Ultra -import Mathlib.Analysis.Normed.Field.UnitBall -import Mathlib.Analysis.Normed.Field.WithAbs -import Mathlib.Analysis.Normed.Group.AddCircle -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Analysis.Normed.Group.BallSphere -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Analysis.Normed.Group.Bounded -import Mathlib.Analysis.Normed.Group.CocompactMap -import Mathlib.Analysis.Normed.Group.Completeness -import Mathlib.Analysis.Normed.Group.Completion -import Mathlib.Analysis.Normed.Group.Constructions -import Mathlib.Analysis.Normed.Group.Continuity -import Mathlib.Analysis.Normed.Group.ControlledClosure -import Mathlib.Analysis.Normed.Group.FunctionSeries -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.Analysis.Normed.Group.HomCompletion -import Mathlib.Analysis.Normed.Group.Indicator -import Mathlib.Analysis.Normed.Group.InfiniteSum -import Mathlib.Analysis.Normed.Group.Int -import Mathlib.Analysis.Normed.Group.Lemmas -import Mathlib.Analysis.Normed.Group.NullSubmodule -import Mathlib.Analysis.Normed.Group.Pointwise -import Mathlib.Analysis.Normed.Group.Quotient -import Mathlib.Analysis.Normed.Group.Rat -import Mathlib.Analysis.Normed.Group.SemiNormedGrp -import Mathlib.Analysis.Normed.Group.SemiNormedGrp.Completion -import Mathlib.Analysis.Normed.Group.SemiNormedGrp.Kernels -import Mathlib.Analysis.Normed.Group.Seminorm -import Mathlib.Analysis.Normed.Group.SeparationQuotient -import Mathlib.Analysis.Normed.Group.Subgroup -import Mathlib.Analysis.Normed.Group.Submodule -import Mathlib.Analysis.Normed.Group.Tannery -import Mathlib.Analysis.Normed.Group.Ultra -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Analysis.Normed.Group.ZeroAtInfty -import Mathlib.Analysis.Normed.Lp.LpEquiv -import Mathlib.Analysis.Normed.Lp.MeasurableSpace -import Mathlib.Analysis.Normed.Lp.PiLp -import Mathlib.Analysis.Normed.Lp.ProdLp -import Mathlib.Analysis.Normed.Lp.WithLp -import Mathlib.Analysis.Normed.Lp.lpSpace -import Mathlib.Analysis.Normed.Module.Ball.Action -import Mathlib.Analysis.Normed.Module.Ball.Homeomorph -import Mathlib.Analysis.Normed.Module.Ball.Pointwise -import Mathlib.Analysis.Normed.Module.Ball.RadialEquiv -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Module.Complemented -import Mathlib.Analysis.Normed.Module.Completion -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Analysis.Normed.Module.Dual -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Analysis.Normed.Module.HahnBanach -import Mathlib.Analysis.Normed.Module.RCLike.Basic -import Mathlib.Analysis.Normed.Module.RCLike.Extend -import Mathlib.Analysis.Normed.Module.RCLike.Real -import Mathlib.Analysis.Normed.Module.Ray -import Mathlib.Analysis.Normed.Module.Span -import Mathlib.Analysis.Normed.Module.WeakDual -import Mathlib.Analysis.Normed.MulAction -import Mathlib.Analysis.Normed.Operator.Asymptotics -import Mathlib.Analysis.Normed.Operator.Banach -import Mathlib.Analysis.Normed.Operator.BanachSteinhaus -import Mathlib.Analysis.Normed.Operator.Basic -import Mathlib.Analysis.Normed.Operator.Bilinear -import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps -import Mathlib.Analysis.Normed.Operator.Compact -import Mathlib.Analysis.Normed.Operator.CompleteCodomain -import Mathlib.Analysis.Normed.Operator.Completeness -import Mathlib.Analysis.Normed.Operator.Conformal -import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap -import Mathlib.Analysis.Normed.Operator.Extend -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.Analysis.Normed.Operator.Mul -import Mathlib.Analysis.Normed.Operator.NNNorm -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Analysis.Normed.Operator.Prod -import Mathlib.Analysis.Normed.Order.Basic -import Mathlib.Analysis.Normed.Order.Hom.Basic -import Mathlib.Analysis.Normed.Order.Hom.Ultra -import Mathlib.Analysis.Normed.Order.Lattice -import Mathlib.Analysis.Normed.Order.UpperLower -import Mathlib.Analysis.Normed.Ring.Basic -import Mathlib.Analysis.Normed.Ring.Finite -import Mathlib.Analysis.Normed.Ring.InfiniteSum -import Mathlib.Analysis.Normed.Ring.Int -import Mathlib.Analysis.Normed.Ring.Lemmas -import Mathlib.Analysis.Normed.Ring.Ultra -import Mathlib.Analysis.Normed.Ring.Units -import Mathlib.Analysis.Normed.Ring.WithAbs -import Mathlib.Analysis.Normed.Unbundled.AlgebraNorm -import Mathlib.Analysis.Normed.Unbundled.FiniteExtension -import Mathlib.Analysis.Normed.Unbundled.InvariantExtension -import Mathlib.Analysis.Normed.Unbundled.IsPowMulFaithful -import Mathlib.Analysis.Normed.Unbundled.RingSeminorm -import Mathlib.Analysis.Normed.Unbundled.SeminormFromBounded -import Mathlib.Analysis.Normed.Unbundled.SeminormFromConst -import Mathlib.Analysis.Normed.Unbundled.SmoothingSeminorm -import Mathlib.Analysis.Normed.Unbundled.SpectralNorm -import Mathlib.Analysis.NormedSpace.Alternating.Basic -import Mathlib.Analysis.NormedSpace.Alternating.Curry -import Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin -import Mathlib.Analysis.NormedSpace.BallAction -import Mathlib.Analysis.NormedSpace.ConformalLinearMap -import Mathlib.Analysis.NormedSpace.Connected -import Mathlib.Analysis.NormedSpace.DualNumber -import Mathlib.Analysis.NormedSpace.ENormedSpace -import Mathlib.Analysis.NormedSpace.Extend -import Mathlib.Analysis.NormedSpace.Extr -import Mathlib.Analysis.NormedSpace.FunctionSeries -import Mathlib.Analysis.NormedSpace.HomeomorphBall -import Mathlib.Analysis.NormedSpace.IndicatorFunction -import Mathlib.Analysis.NormedSpace.Int -import Mathlib.Analysis.NormedSpace.MStructure -import Mathlib.Analysis.NormedSpace.Multilinear.Basic -import Mathlib.Analysis.NormedSpace.Multilinear.Curry -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn -import Mathlib.Analysis.NormedSpace.Normalize -import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics -import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear -import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness -import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul -import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm -import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace -import Mathlib.Analysis.NormedSpace.OperatorNorm.Prod -import Mathlib.Analysis.NormedSpace.PiTensorProduct.InjectiveSeminorm -import Mathlib.Analysis.NormedSpace.PiTensorProduct.ProjectiveSeminorm -import Mathlib.Analysis.NormedSpace.Pointwise -import Mathlib.Analysis.NormedSpace.RCLike -import Mathlib.Analysis.NormedSpace.Real -import Mathlib.Analysis.NormedSpace.RieszLemma -import Mathlib.Analysis.NormedSpace.SphereNormEquiv -import Mathlib.Analysis.ODE.Gronwall -import Mathlib.Analysis.ODE.PicardLindelof -import Mathlib.Analysis.Oscillation -import Mathlib.Analysis.PSeries -import Mathlib.Analysis.PSeriesComplex -import Mathlib.Analysis.Polynomial.Basic -import Mathlib.Analysis.Polynomial.CauchyBound -import Mathlib.Analysis.Polynomial.Factorization -import Mathlib.Analysis.Polynomial.MahlerMeasure -import Mathlib.Analysis.Quaternion -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Analysis.RCLike.BoundedContinuous -import Mathlib.Analysis.RCLike.Extend -import Mathlib.Analysis.RCLike.Inner -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.Analysis.RCLike.TangentCone -import Mathlib.Analysis.Real.Cardinality -import Mathlib.Analysis.Real.Hyperreal -import Mathlib.Analysis.Real.OfDigits -import Mathlib.Analysis.Real.Pi.Bounds -import Mathlib.Analysis.Real.Pi.Chudnovsky -import Mathlib.Analysis.Real.Pi.Irrational -import Mathlib.Analysis.Real.Pi.Leibniz -import Mathlib.Analysis.Real.Pi.Wallis -import Mathlib.Analysis.Real.Spectrum -import Mathlib.Analysis.Seminorm -import Mathlib.Analysis.SpecialFunctions.Arsinh -import Mathlib.Analysis.SpecialFunctions.Bernstein -import Mathlib.Analysis.SpecialFunctions.BinaryEntropy -import Mathlib.Analysis.SpecialFunctions.Choose -import Mathlib.Analysis.SpecialFunctions.CompareExp -import Mathlib.Analysis.SpecialFunctions.Complex.Analytic -import Mathlib.Analysis.SpecialFunctions.Complex.Arctan -import Mathlib.Analysis.SpecialFunctions.Complex.Arg -import Mathlib.Analysis.SpecialFunctions.Complex.Circle -import Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar -import Mathlib.Analysis.SpecialFunctions.Complex.CircleMap -import Mathlib.Analysis.SpecialFunctions.Complex.Log -import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds -import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Abs -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Isometric -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.IntegralRepresentation -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Isometric -import Mathlib.Analysis.SpecialFunctions.Exp -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Exponential -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Beta -import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup -import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne -import Mathlib.Analysis.SpecialFunctions.Gamma.Deriv -import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform -import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral -import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation -import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals -import Mathlib.Analysis.SpecialFunctions.Integrability.Basic -import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Analysis.SpecialFunctions.Integrals.LogTrigonometric -import Mathlib.Analysis.SpecialFunctions.Integrals.PosLogEqCircleAverage -import Mathlib.Analysis.SpecialFunctions.JapaneseBracket -import Mathlib.Analysis.SpecialFunctions.Log.Base -import Mathlib.Analysis.SpecialFunctions.Log.Basic -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog -import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLogExp -import Mathlib.Analysis.SpecialFunctions.Log.ERealExp -import Mathlib.Analysis.SpecialFunctions.Log.Monotone -import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog -import Mathlib.Analysis.SpecialFunctions.Log.PosLog -import Mathlib.Analysis.SpecialFunctions.Log.Summable -import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSq -import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSqIntegral -import Mathlib.Analysis.SpecialFunctions.NonIntegrable -import Mathlib.Analysis.SpecialFunctions.OrdinaryHypergeometric -import Mathlib.Analysis.SpecialFunctions.Pochhammer -import Mathlib.Analysis.SpecialFunctions.PolarCoord -import Mathlib.Analysis.SpecialFunctions.PolynomialExp -import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics -import Mathlib.Analysis.SpecialFunctions.Pow.Complex -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv -import Mathlib.Analysis.SpecialFunctions.Pow.Integral -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.Analysis.SpecialFunctions.Pow.NthRootLemmas -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Analysis.SpecialFunctions.Sigmoid -import Mathlib.Analysis.SpecialFunctions.SmoothTransition -import Mathlib.Analysis.SpecialFunctions.Sqrt -import Mathlib.Analysis.SpecialFunctions.Stirling -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan -import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Chebyshev -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex -import Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse -import Mathlib.Analysis.SpecialFunctions.Trigonometric.InverseDeriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Series -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Sinc -import Mathlib.Analysis.SpecificLimits.ArithmeticGeometric -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Analysis.SpecificLimits.Fibonacci -import Mathlib.Analysis.SpecificLimits.FloorPow -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.Analysis.SpecificLimits.RCLike -import Mathlib.Analysis.Subadditive -import Mathlib.Analysis.SumIntegralComparisons -import Mathlib.Analysis.SumOverResidueClass -import Mathlib.Analysis.VonNeumannAlgebra.Basic -import Mathlib.CategoryTheory.Abelian.Basic -import Mathlib.CategoryTheory.Abelian.CommSq -import Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four -import Mathlib.CategoryTheory.Abelian.DiagramLemmas.KernelCokernelComp -import Mathlib.CategoryTheory.Abelian.EpiWithInjectiveKernel -import Mathlib.CategoryTheory.Abelian.Exact -import Mathlib.CategoryTheory.Abelian.Ext -import Mathlib.CategoryTheory.Abelian.FreydMitchell -import Mathlib.CategoryTheory.Abelian.FunctorCategory -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Colim -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Connected -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Indization -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Types -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ColimCoyoneda -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Coseparator -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.EnoughInjectives -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.GabrielPopescu -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.Opposite -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Monomorphisms -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Subobject -import Mathlib.CategoryTheory.Abelian.Images -import Mathlib.CategoryTheory.Abelian.Indization -import Mathlib.CategoryTheory.Abelian.Injective.Basic -import Mathlib.CategoryTheory.Abelian.Injective.Dimension -import Mathlib.CategoryTheory.Abelian.Injective.Resolution -import Mathlib.CategoryTheory.Abelian.LeftDerived -import Mathlib.CategoryTheory.Abelian.Monomorphisms -import Mathlib.CategoryTheory.Abelian.NonPreadditive -import Mathlib.CategoryTheory.Abelian.Opposite -import Mathlib.CategoryTheory.Abelian.Projective.Basic -import Mathlib.CategoryTheory.Abelian.Projective.Dimension -import Mathlib.CategoryTheory.Abelian.Projective.Resolution -import Mathlib.CategoryTheory.Abelian.Pseudoelements -import Mathlib.CategoryTheory.Abelian.Refinements -import Mathlib.CategoryTheory.Abelian.RightDerived -import Mathlib.CategoryTheory.Abelian.SerreClass.Basic -import Mathlib.CategoryTheory.Abelian.SerreClass.Bousfield -import Mathlib.CategoryTheory.Abelian.SerreClass.MorphismProperty -import Mathlib.CategoryTheory.Abelian.Subobject -import Mathlib.CategoryTheory.Abelian.Transfer -import Mathlib.CategoryTheory.Abelian.Yoneda -import Mathlib.CategoryTheory.Action -import Mathlib.CategoryTheory.Action.Basic -import Mathlib.CategoryTheory.Action.Concrete -import Mathlib.CategoryTheory.Action.Continuous -import Mathlib.CategoryTheory.Action.Limits -import Mathlib.CategoryTheory.Action.Monoidal -import Mathlib.CategoryTheory.Adhesive -import Mathlib.CategoryTheory.Adjunction.Additive -import Mathlib.CategoryTheory.Adjunction.AdjointFunctorTheorems -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Adjunction.Comma -import Mathlib.CategoryTheory.Adjunction.CompositionIso -import Mathlib.CategoryTheory.Adjunction.Evaluation -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Adjunction.Lifting.Left -import Mathlib.CategoryTheory.Adjunction.Lifting.Right -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Adjunction.Mates -import Mathlib.CategoryTheory.Adjunction.Opposites -import Mathlib.CategoryTheory.Adjunction.Parametrized -import Mathlib.CategoryTheory.Adjunction.PartialAdjoint -import Mathlib.CategoryTheory.Adjunction.Quadruple -import Mathlib.CategoryTheory.Adjunction.Reflective -import Mathlib.CategoryTheory.Adjunction.Restrict -import Mathlib.CategoryTheory.Adjunction.Triple -import Mathlib.CategoryTheory.Adjunction.Unique -import Mathlib.CategoryTheory.Adjunction.Whiskering -import Mathlib.CategoryTheory.Balanced -import Mathlib.CategoryTheory.Bicategory.Adjunction.Adj -import Mathlib.CategoryTheory.Bicategory.Adjunction.Basic -import Mathlib.CategoryTheory.Bicategory.Adjunction.Mate -import Mathlib.CategoryTheory.Bicategory.Basic -import Mathlib.CategoryTheory.Bicategory.CatEnriched -import Mathlib.CategoryTheory.Bicategory.Coherence -import Mathlib.CategoryTheory.Bicategory.End -import Mathlib.CategoryTheory.Bicategory.EqToHom -import Mathlib.CategoryTheory.Bicategory.Extension -import Mathlib.CategoryTheory.Bicategory.Free -import Mathlib.CategoryTheory.Bicategory.Functor.Cat -import Mathlib.CategoryTheory.Bicategory.Functor.Lax -import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete -import Mathlib.CategoryTheory.Bicategory.Functor.Oplax -import Mathlib.CategoryTheory.Bicategory.Functor.Prelax -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor -import Mathlib.CategoryTheory.Bicategory.Functor.Strict -import Mathlib.CategoryTheory.Bicategory.Functor.StrictlyUnitary -import Mathlib.CategoryTheory.Bicategory.FunctorBicategory.Oplax -import Mathlib.CategoryTheory.Bicategory.Grothendieck -import Mathlib.CategoryTheory.Bicategory.Kan.Adjunction -import Mathlib.CategoryTheory.Bicategory.Kan.HasKan -import Mathlib.CategoryTheory.Bicategory.Kan.IsKan -import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete -import Mathlib.CategoryTheory.Bicategory.Modification.Oplax -import Mathlib.CategoryTheory.Bicategory.Monad.Basic -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Pseudo -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Strong -import Mathlib.CategoryTheory.Bicategory.Opposites -import Mathlib.CategoryTheory.Bicategory.SingleObj -import Mathlib.CategoryTheory.Bicategory.Strict -import Mathlib.CategoryTheory.Bicategory.Strict.Basic -import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor -import Mathlib.CategoryTheory.CatCommSq -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.CategoryTheory.Category.Bipointed -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Category.Cat.Adjunction -import Mathlib.CategoryTheory.Category.Cat.AsSmall -import Mathlib.CategoryTheory.Category.Cat.CartesianClosed -import Mathlib.CategoryTheory.Category.Cat.Colimit -import Mathlib.CategoryTheory.Category.Cat.Limit -import Mathlib.CategoryTheory.Category.Cat.Op -import Mathlib.CategoryTheory.Category.Cat.Terminal -import Mathlib.CategoryTheory.Category.Factorisation -import Mathlib.CategoryTheory.Category.GaloisConnection -import Mathlib.CategoryTheory.Category.Grpd -import Mathlib.CategoryTheory.Category.Init -import Mathlib.CategoryTheory.Category.KleisliCat -import Mathlib.CategoryTheory.Category.Pairwise -import Mathlib.CategoryTheory.Category.PartialFun -import Mathlib.CategoryTheory.Category.Pointed -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Category.Quiv -import Mathlib.CategoryTheory.Category.ReflQuiv -import Mathlib.CategoryTheory.Category.RelCat -import Mathlib.CategoryTheory.Category.TwoP -import Mathlib.CategoryTheory.Category.ULift -import Mathlib.CategoryTheory.Center.Basic -import Mathlib.CategoryTheory.Center.Linear -import Mathlib.CategoryTheory.Center.Localization -import Mathlib.CategoryTheory.ChosenFiniteProducts -import Mathlib.CategoryTheory.ChosenFiniteProducts.Cat -import Mathlib.CategoryTheory.ChosenFiniteProducts.FunctorCategory -import Mathlib.CategoryTheory.ChosenFiniteProducts.InfSemilattice -import Mathlib.CategoryTheory.ChosenFiniteProducts.Over -import Mathlib.CategoryTheory.Closed.Cartesian -import Mathlib.CategoryTheory.Closed.Enrichment -import Mathlib.CategoryTheory.Closed.Functor -import Mathlib.CategoryTheory.Closed.FunctorCategory.Basic -import Mathlib.CategoryTheory.Closed.FunctorCategory.Complete -import Mathlib.CategoryTheory.Closed.FunctorCategory.Groupoid -import Mathlib.CategoryTheory.Closed.FunctorToTypes -import Mathlib.CategoryTheory.Closed.Ideal -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Closed.Types -import Mathlib.CategoryTheory.Closed.Zero -import Mathlib.CategoryTheory.CodiscreteCategory -import Mathlib.CategoryTheory.CofilteredSystem -import Mathlib.CategoryTheory.CommSq -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.Comma.Basic -import Mathlib.CategoryTheory.Comma.CardinalArrow -import Mathlib.CategoryTheory.Comma.Final -import Mathlib.CategoryTheory.Comma.LocallySmall -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Comma.Over.OverClass -import Mathlib.CategoryTheory.Comma.Over.Pullback -import Mathlib.CategoryTheory.Comma.Presheaf.Basic -import Mathlib.CategoryTheory.Comma.Presheaf.Colimit -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.Comma.StructuredArrow.CommaMap -import Mathlib.CategoryTheory.Comma.StructuredArrow.Final -import Mathlib.CategoryTheory.Comma.StructuredArrow.Functor -import Mathlib.CategoryTheory.Comma.StructuredArrow.Small -import Mathlib.CategoryTheory.ComposableArrows -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.ConcreteCategory.Bundled -import Mathlib.CategoryTheory.ConcreteCategory.BundledHom -import Mathlib.CategoryTheory.ConcreteCategory.Elementwise -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono -import Mathlib.CategoryTheory.ConcreteCategory.ReflectsIso -import Mathlib.CategoryTheory.ConcreteCategory.UnbundledHom -import Mathlib.CategoryTheory.Conj -import Mathlib.CategoryTheory.ConnectedComponents -import Mathlib.CategoryTheory.CopyDiscardCategory.Basic -import Mathlib.CategoryTheory.CopyDiscardCategory.Cartesian -import Mathlib.CategoryTheory.CopyDiscardCategory.Deterministic -import Mathlib.CategoryTheory.Core -import Mathlib.CategoryTheory.Countable -import Mathlib.CategoryTheory.Dialectica.Basic -import Mathlib.CategoryTheory.Dialectica.Monoidal -import Mathlib.CategoryTheory.DifferentialObject -import Mathlib.CategoryTheory.DinatTrans -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Discrete.StructuredArrow -import Mathlib.CategoryTheory.Discrete.SumsProducts -import Mathlib.CategoryTheory.Distributive.Cartesian -import Mathlib.CategoryTheory.Distributive.Monoidal -import Mathlib.CategoryTheory.EffectiveEpi.Basic -import Mathlib.CategoryTheory.EffectiveEpi.Comp -import Mathlib.CategoryTheory.EffectiveEpi.Coproduct -import Mathlib.CategoryTheory.EffectiveEpi.Enough -import Mathlib.CategoryTheory.EffectiveEpi.Extensive -import Mathlib.CategoryTheory.EffectiveEpi.Preserves -import Mathlib.CategoryTheory.EffectiveEpi.RegularEpi -import Mathlib.CategoryTheory.Elements -import Mathlib.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Endofunctor.Algebra -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.CategoryTheory.Enriched.Basic -import Mathlib.CategoryTheory.Enriched.EnrichedCat -import Mathlib.CategoryTheory.Enriched.FunctorCategory -import Mathlib.CategoryTheory.Enriched.HomCongr -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalProducts -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalPullbacks -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalTerminal -import Mathlib.CategoryTheory.Enriched.Opposite -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic -import Mathlib.CategoryTheory.EpiMono -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Equivalence -import Mathlib.CategoryTheory.Equivalence.Symmetry -import Mathlib.CategoryTheory.EssentialImage -import Mathlib.CategoryTheory.EssentiallySmall -import Mathlib.CategoryTheory.Extensive -import Mathlib.CategoryTheory.ExtremalEpi -import Mathlib.CategoryTheory.FiberedCategory.BasedCategory -import Mathlib.CategoryTheory.FiberedCategory.Cartesian -import Mathlib.CategoryTheory.FiberedCategory.Cocartesian -import Mathlib.CategoryTheory.FiberedCategory.Fiber -import Mathlib.CategoryTheory.FiberedCategory.Fibered -import Mathlib.CategoryTheory.FiberedCategory.Grothendieck -import Mathlib.CategoryTheory.FiberedCategory.HasFibers -import Mathlib.CategoryTheory.FiberedCategory.HomLift -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Filtered.Connected -import Mathlib.CategoryTheory.Filtered.CostructuredArrow -import Mathlib.CategoryTheory.Filtered.Final -import Mathlib.CategoryTheory.Filtered.Flat -import Mathlib.CategoryTheory.Filtered.Grothendieck -import Mathlib.CategoryTheory.Filtered.OfColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Filtered.Small -import Mathlib.CategoryTheory.FinCategory.AsType -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.CategoryTheory.FintypeCat -import Mathlib.CategoryTheory.FullSubcategory -import Mathlib.CategoryTheory.Functor.Basic -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Functor.Const -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Functor.CurryingThree -import Mathlib.CategoryTheory.Functor.Derived.Adjunction -import Mathlib.CategoryTheory.Functor.Derived.LeftDerived -import Mathlib.CategoryTheory.Functor.Derived.PointwiseRightDerived -import Mathlib.CategoryTheory.Functor.Derived.RightDerived -import Mathlib.CategoryTheory.Functor.EpiMono -import Mathlib.CategoryTheory.Functor.Flat -import Mathlib.CategoryTheory.Functor.FullyFaithful -import Mathlib.CategoryTheory.Functor.FunctorHom -import Mathlib.CategoryTheory.Functor.Functorial -import Mathlib.CategoryTheory.Functor.Hom -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Functor.KanExtension.Basic -import Mathlib.CategoryTheory.Functor.KanExtension.DenseAt -import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise -import Mathlib.CategoryTheory.Functor.KanExtension.Preserves -import Mathlib.CategoryTheory.Functor.OfSequence -import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic -import Mathlib.CategoryTheory.Functor.Trifunctor -import Mathlib.CategoryTheory.Functor.TwoSquare -import Mathlib.CategoryTheory.Galois.Action -import Mathlib.CategoryTheory.Galois.Basic -import Mathlib.CategoryTheory.Galois.Decomposition -import Mathlib.CategoryTheory.Galois.Equivalence -import Mathlib.CategoryTheory.Galois.EssSurj -import Mathlib.CategoryTheory.Galois.Examples -import Mathlib.CategoryTheory.Galois.Full -import Mathlib.CategoryTheory.Galois.GaloisObjects -import Mathlib.CategoryTheory.Galois.IsFundamentalgroup -import Mathlib.CategoryTheory.Galois.Prorepresentability -import Mathlib.CategoryTheory.Galois.Topology -import Mathlib.CategoryTheory.Generator.Abelian -import Mathlib.CategoryTheory.Generator.Basic -import Mathlib.CategoryTheory.Generator.HomologicalComplex -import Mathlib.CategoryTheory.Generator.Indization -import Mathlib.CategoryTheory.Generator.Preadditive -import Mathlib.CategoryTheory.Generator.Presheaf -import Mathlib.CategoryTheory.Generator.Sheaf -import Mathlib.CategoryTheory.Generator.StrongGenerator -import Mathlib.CategoryTheory.GlueData -import Mathlib.CategoryTheory.GradedObject -import Mathlib.CategoryTheory.GradedObject.Associator -import Mathlib.CategoryTheory.GradedObject.Bifunctor -import Mathlib.CategoryTheory.GradedObject.Braiding -import Mathlib.CategoryTheory.GradedObject.Monoidal -import Mathlib.CategoryTheory.GradedObject.Single -import Mathlib.CategoryTheory.GradedObject.Trifunctor -import Mathlib.CategoryTheory.GradedObject.Unitor -import Mathlib.CategoryTheory.Grothendieck -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.Groupoid.Basic -import Mathlib.CategoryTheory.Groupoid.Discrete -import Mathlib.CategoryTheory.Groupoid.FreeGroupoid -import Mathlib.CategoryTheory.Groupoid.Subgroupoid -import Mathlib.CategoryTheory.Groupoid.VertexGroup -import Mathlib.CategoryTheory.GuitartExact.Basic -import Mathlib.CategoryTheory.GuitartExact.KanExtension -import Mathlib.CategoryTheory.GuitartExact.Opposite -import Mathlib.CategoryTheory.GuitartExact.Over -import Mathlib.CategoryTheory.GuitartExact.VerticalComposition -import Mathlib.CategoryTheory.HomCongr -import Mathlib.CategoryTheory.Idempotents.Basic -import Mathlib.CategoryTheory.Idempotents.Biproducts -import Mathlib.CategoryTheory.Idempotents.FunctorCategories -import Mathlib.CategoryTheory.Idempotents.FunctorExtension -import Mathlib.CategoryTheory.Idempotents.HomologicalComplex -import Mathlib.CategoryTheory.Idempotents.Karoubi -import Mathlib.CategoryTheory.Idempotents.KaroubiKaroubi -import Mathlib.CategoryTheory.Idempotents.SimplicialObject -import Mathlib.CategoryTheory.InducedCategory -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Iso -import Mathlib.CategoryTheory.IsomorphismClasses -import Mathlib.CategoryTheory.Join.Basic -import Mathlib.CategoryTheory.Join.Final -import Mathlib.CategoryTheory.Join.Opposites -import Mathlib.CategoryTheory.Join.Pseudofunctor -import Mathlib.CategoryTheory.Join.Sum -import Mathlib.CategoryTheory.LiftingProperties.Adjunction -import Mathlib.CategoryTheory.LiftingProperties.Basic -import Mathlib.CategoryTheory.LiftingProperties.Limits -import Mathlib.CategoryTheory.LiftingProperties.ParametrizedAdjunction -import Mathlib.CategoryTheory.Limits.Bicones -import Mathlib.CategoryTheory.Limits.ColimitLimit -import Mathlib.CategoryTheory.Limits.Comma -import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Limits.ConcreteCategory.WithAlgebraicStructures -import Mathlib.CategoryTheory.Limits.ConeCategory -import Mathlib.CategoryTheory.Limits.Cones -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Limits.Constructions.BinaryProducts -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.Constructions.Equalizers -import Mathlib.CategoryTheory.Limits.Constructions.EventuallyConstant -import Mathlib.CategoryTheory.Limits.Constructions.Filtered -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic -import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected -import Mathlib.CategoryTheory.Limits.Constructions.Over.Products -import Mathlib.CategoryTheory.Limits.Constructions.Pullbacks -import Mathlib.CategoryTheory.Limits.Constructions.WeaklyInitial -import Mathlib.CategoryTheory.Limits.Constructions.ZeroObjects -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Elements -import Mathlib.CategoryTheory.Limits.EpiMono -import Mathlib.CategoryTheory.Limits.EssentiallySmall -import Mathlib.CategoryTheory.Limits.ExactFunctor -import Mathlib.CategoryTheory.Limits.Filtered -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesProduct -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Limits.Final.Connected -import Mathlib.CategoryTheory.Limits.Final.ParallelPair -import Mathlib.CategoryTheory.Limits.Final.Type -import Mathlib.CategoryTheory.Limits.FinallySmall -import Mathlib.CategoryTheory.Limits.FintypeCat -import Mathlib.CategoryTheory.Limits.FormalCoproducts -import Mathlib.CategoryTheory.Limits.Fubini -import Mathlib.CategoryTheory.Limits.FullSubcategory -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono -import Mathlib.CategoryTheory.Limits.FunctorCategory.Filtered -import Mathlib.CategoryTheory.Limits.FunctorCategory.Finite -import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Products -import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Pullbacks -import Mathlib.CategoryTheory.Limits.FunctorToTypes -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.IndYoneda -import Mathlib.CategoryTheory.Limits.Indization.Category -import Mathlib.CategoryTheory.Limits.Indization.Equalizers -import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits -import Mathlib.CategoryTheory.Limits.Indization.IndObject -import Mathlib.CategoryTheory.Limits.Indization.LocallySmall -import Mathlib.CategoryTheory.Limits.Indization.ParallelPair -import Mathlib.CategoryTheory.Limits.Indization.Products -import Mathlib.CategoryTheory.Limits.IsConnected -import Mathlib.CategoryTheory.Limits.IsLimit -import Mathlib.CategoryTheory.Limits.Lattice -import Mathlib.CategoryTheory.Limits.MonoCoprod -import Mathlib.CategoryTheory.Limits.MorphismProperty -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Over -import Mathlib.CategoryTheory.Limits.Pi -import Mathlib.CategoryTheory.Limits.Preorder -import Mathlib.CategoryTheory.Limits.Presentation -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Bifunctor -import Mathlib.CategoryTheory.Limits.Preserves.Creates.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Creates.Pullbacks -import Mathlib.CategoryTheory.Limits.Preserves.Filtered -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Limits.Preserves.Grothendieck -import Mathlib.CategoryTheory.Limits.Preserves.Limits -import Mathlib.CategoryTheory.Limits.Preserves.Opposites -import Mathlib.CategoryTheory.Limits.Preserves.Over -import Mathlib.CategoryTheory.Limits.Preserves.Presheaf -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Biproducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Images -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Over -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Preorder -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Square -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Limits.Preserves.Yoneda -import Mathlib.CategoryTheory.Limits.Presheaf -import Mathlib.CategoryTheory.Limits.Set -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Biproducts -import Mathlib.CategoryTheory.Limits.Shapes.CombinedProducts -import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory -import Mathlib.CategoryTheory.Limits.Shapes.Connected -import Mathlib.CategoryTheory.Limits.Shapes.Countable -import Mathlib.CategoryTheory.Limits.Shapes.Diagonal -import Mathlib.CategoryTheory.Limits.Shapes.DisjointCoproduct -import Mathlib.CategoryTheory.Limits.Shapes.End -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Equivalence -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Shapes.FiniteMultiequalizer -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts -import Mathlib.CategoryTheory.Limits.Shapes.FunctorToTypes -import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal -import Mathlib.CategoryTheory.Limits.Shapes.KernelPair -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Shapes.MultiequalizerPullback -import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Basic -import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Filtered -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Kernels -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Pullbacks -import Mathlib.CategoryTheory.Limits.Shapes.PiProd -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.Fin -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.HasIterationOfShape -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.PrincipalSeg -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.TransfiniteCompositionOfShape -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Assoc -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Categorical.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Categorical.CatCospanTransform -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Connected -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Cospan -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Equalizer -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Pasting -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.PullbackCone -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Square -import Mathlib.CategoryTheory.Limits.Shapes.Reflexive -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.CategoryTheory.Limits.Shapes.SequentialProduct -import Mathlib.CategoryTheory.Limits.Shapes.SingleObj -import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer -import Mathlib.CategoryTheory.Limits.Shapes.SplitEqualizer -import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial -import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms -import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects -import Mathlib.CategoryTheory.Limits.Sifted -import Mathlib.CategoryTheory.Limits.Skeleton -import Mathlib.CategoryTheory.Limits.SmallComplete -import Mathlib.CategoryTheory.Limits.Types.ColimitType -import Mathlib.CategoryTheory.Limits.Types.ColimitTypeFiltered -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.Limits.Types.Images -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Limits.Types.Multicoequalizer -import Mathlib.CategoryTheory.Limits.Types.Pullbacks -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.CategoryTheory.Limits.Types.Yoneda -import Mathlib.CategoryTheory.Limits.Unit -import Mathlib.CategoryTheory.Limits.VanKampen -import Mathlib.CategoryTheory.Limits.Yoneda -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.CategoryTheory.Linear.FunctorCategory -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.CategoryTheory.Linear.Yoneda -import Mathlib.CategoryTheory.Localization.Adjunction -import Mathlib.CategoryTheory.Localization.Bifunctor -import Mathlib.CategoryTheory.Localization.Bousfield -import Mathlib.CategoryTheory.Localization.BousfieldTransfiniteComposition -import Mathlib.CategoryTheory.Localization.CalculusOfFractions -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.ComposableArrows -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Fractions -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.OfAdjunction -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Preadditive -import Mathlib.CategoryTheory.Localization.Composition -import Mathlib.CategoryTheory.Localization.Construction -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Basic -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Constructor -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.OfFunctorialResolutions -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.PointwiseRightDerived -import Mathlib.CategoryTheory.Localization.Equivalence -import Mathlib.CategoryTheory.Localization.FiniteProducts -import Mathlib.CategoryTheory.Localization.HasLocalization -import Mathlib.CategoryTheory.Localization.HomEquiv -import Mathlib.CategoryTheory.Localization.Linear -import Mathlib.CategoryTheory.Localization.LocalizerMorphism -import Mathlib.CategoryTheory.Localization.LocallySmall -import Mathlib.CategoryTheory.Localization.Monoidal -import Mathlib.CategoryTheory.Localization.Monoidal.Basic -import Mathlib.CategoryTheory.Localization.Monoidal.Braided -import Mathlib.CategoryTheory.Localization.Opposite -import Mathlib.CategoryTheory.Localization.Pi -import Mathlib.CategoryTheory.Localization.Preadditive -import Mathlib.CategoryTheory.Localization.Predicate -import Mathlib.CategoryTheory.Localization.Prod -import Mathlib.CategoryTheory.Localization.Quotient -import Mathlib.CategoryTheory.Localization.Resolution -import Mathlib.CategoryTheory.Localization.SmallHom -import Mathlib.CategoryTheory.Localization.SmallShiftedHom -import Mathlib.CategoryTheory.Localization.StructuredArrow -import Mathlib.CategoryTheory.Localization.Triangulated -import Mathlib.CategoryTheory.Localization.Trifunctor -import Mathlib.CategoryTheory.LocallyCartesianClosed.ChosenPullbacksAlong -import Mathlib.CategoryTheory.LocallyDirected -import Mathlib.CategoryTheory.MarkovCategory.Basic -import Mathlib.CategoryTheory.Monad.Adjunction -import Mathlib.CategoryTheory.Monad.Algebra -import Mathlib.CategoryTheory.Monad.Basic -import Mathlib.CategoryTheory.Monad.Coequalizer -import Mathlib.CategoryTheory.Monad.Comonadicity -import Mathlib.CategoryTheory.Monad.Equalizer -import Mathlib.CategoryTheory.Monad.EquivMon -import Mathlib.CategoryTheory.Monad.Kleisli -import Mathlib.CategoryTheory.Monad.Limits -import Mathlib.CategoryTheory.Monad.Monadicity -import Mathlib.CategoryTheory.Monad.Products -import Mathlib.CategoryTheory.Monad.Types -import Mathlib.CategoryTheory.Monoidal.Action.Basic -import Mathlib.CategoryTheory.Monoidal.Action.End -import Mathlib.CategoryTheory.Monoidal.Action.LinearFunctor -import Mathlib.CategoryTheory.Monoidal.Action.Opposites -import Mathlib.CategoryTheory.Monoidal.Bimod -import Mathlib.CategoryTheory.Monoidal.Bimon_ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.Braided.Multifunctor -import Mathlib.CategoryTheory.Monoidal.Braided.Opposite -import Mathlib.CategoryTheory.Monoidal.Braided.Reflection -import Mathlib.CategoryTheory.Monoidal.Braided.Transport -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat -import Mathlib.CategoryTheory.Monoidal.Cartesian.CommGrp_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.CommMon_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Comon_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Cartesian.Grp_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.InfSemilattice -import Mathlib.CategoryTheory.Monoidal.Cartesian.Mod_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Over -import Mathlib.CategoryTheory.Monoidal.Category -import Mathlib.CategoryTheory.Monoidal.Center -import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas -import Mathlib.CategoryTheory.Monoidal.CommComon_ -import Mathlib.CategoryTheory.Monoidal.CommGrp_ -import Mathlib.CategoryTheory.Monoidal.CommMon_ -import Mathlib.CategoryTheory.Monoidal.Comon_ -import Mathlib.CategoryTheory.Monoidal.Conv -import Mathlib.CategoryTheory.Monoidal.DayConvolution -import Mathlib.CategoryTheory.Monoidal.DayConvolution.Braided -import Mathlib.CategoryTheory.Monoidal.DayConvolution.Closed -import Mathlib.CategoryTheory.Monoidal.DayConvolution.DayFunctor -import Mathlib.CategoryTheory.Monoidal.Discrete -import Mathlib.CategoryTheory.Monoidal.End -import Mathlib.CategoryTheory.Monoidal.ExternalProduct -import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic -import Mathlib.CategoryTheory.Monoidal.ExternalProduct.KanExtension -import Mathlib.CategoryTheory.Monoidal.Free.Basic -import Mathlib.CategoryTheory.Monoidal.Free.Coherence -import Mathlib.CategoryTheory.Monoidal.Functor -import Mathlib.CategoryTheory.Monoidal.Functor.Types -import Mathlib.CategoryTheory.Monoidal.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Grp_ -import Mathlib.CategoryTheory.Monoidal.Hopf_ -import Mathlib.CategoryTheory.Monoidal.Internal.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Internal.Limits -import Mathlib.CategoryTheory.Monoidal.Internal.Module -import Mathlib.CategoryTheory.Monoidal.Internal.Types.Basic -import Mathlib.CategoryTheory.Monoidal.Internal.Types.CommGrp_ -import Mathlib.CategoryTheory.Monoidal.Internal.Types.Grp_ -import Mathlib.CategoryTheory.Monoidal.Limits -import Mathlib.CategoryTheory.Monoidal.Limits.Basic -import Mathlib.CategoryTheory.Monoidal.Limits.Preserves -import Mathlib.CategoryTheory.Monoidal.Linear -import Mathlib.CategoryTheory.Monoidal.Mod_ -import Mathlib.CategoryTheory.Monoidal.Mon_ -import Mathlib.CategoryTheory.Monoidal.Multifunctor -import Mathlib.CategoryTheory.Monoidal.NaturalTransformation -import Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Basic -import Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Symmetric -import Mathlib.CategoryTheory.Monoidal.OfHasFiniteProducts -import Mathlib.CategoryTheory.Monoidal.Opposite -import Mathlib.CategoryTheory.Monoidal.Opposite.Mon_ -import Mathlib.CategoryTheory.Monoidal.Preadditive -import Mathlib.CategoryTheory.Monoidal.Rigid.Basic -import Mathlib.CategoryTheory.Monoidal.Rigid.Braided -import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence -import Mathlib.CategoryTheory.Monoidal.Skeleton -import Mathlib.CategoryTheory.Monoidal.Subcategory -import Mathlib.CategoryTheory.Monoidal.Tor -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.CategoryTheory.Monoidal.Types.Basic -import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda -import Mathlib.CategoryTheory.Monoidal.Yoneda -import Mathlib.CategoryTheory.MorphismProperty.Basic -import Mathlib.CategoryTheory.MorphismProperty.Comma -import Mathlib.CategoryTheory.MorphismProperty.Composition -import Mathlib.CategoryTheory.MorphismProperty.Concrete -import Mathlib.CategoryTheory.MorphismProperty.Descent -import Mathlib.CategoryTheory.MorphismProperty.Factorization -import Mathlib.CategoryTheory.MorphismProperty.FunctorCategory -import Mathlib.CategoryTheory.MorphismProperty.Ind -import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy -import Mathlib.CategoryTheory.MorphismProperty.IsSmall -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.MorphismProperty.Local -import Mathlib.CategoryTheory.MorphismProperty.OverAdjunction -import Mathlib.CategoryTheory.MorphismProperty.Representable -import Mathlib.CategoryTheory.MorphismProperty.Retract -import Mathlib.CategoryTheory.MorphismProperty.RetractArgument -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition -import Mathlib.CategoryTheory.MorphismProperty.WeakFactorizationSystem -import Mathlib.CategoryTheory.NatIso -import Mathlib.CategoryTheory.NatTrans -import Mathlib.CategoryTheory.Noetherian -import Mathlib.CategoryTheory.ObjectProperty.Basic -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.ObjectProperty.ColimitsClosure -import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape -import Mathlib.CategoryTheory.ObjectProperty.CompleteLattice -import Mathlib.CategoryTheory.ObjectProperty.ContainsZero -import Mathlib.CategoryTheory.ObjectProperty.EpiMono -import Mathlib.CategoryTheory.ObjectProperty.Extensions -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory -import Mathlib.CategoryTheory.ObjectProperty.Ind -import Mathlib.CategoryTheory.ObjectProperty.LimitsClosure -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape -import Mathlib.CategoryTheory.ObjectProperty.Local -import Mathlib.CategoryTheory.ObjectProperty.Opposite -import Mathlib.CategoryTheory.ObjectProperty.Retract -import Mathlib.CategoryTheory.ObjectProperty.Shift -import Mathlib.CategoryTheory.ObjectProperty.Small -import Mathlib.CategoryTheory.Opposites -import Mathlib.CategoryTheory.PEmpty -import Mathlib.CategoryTheory.PUnit -import Mathlib.CategoryTheory.PathCategory.Basic -import Mathlib.CategoryTheory.PathCategory.MorphismProperty -import Mathlib.CategoryTheory.Pi.Basic -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.CategoryTheory.Preadditive.Biproducts -import Mathlib.CategoryTheory.Preadditive.CommGrp_ -import Mathlib.CategoryTheory.Preadditive.EilenbergMoore -import Mathlib.CategoryTheory.Preadditive.EndoFunctor -import Mathlib.CategoryTheory.Preadditive.FunctorCategory -import Mathlib.CategoryTheory.Preadditive.HomOrthogonal -import Mathlib.CategoryTheory.Preadditive.Indization -import Mathlib.CategoryTheory.Preadditive.Injective.Basic -import Mathlib.CategoryTheory.Preadditive.Injective.LiftingProperties -import Mathlib.CategoryTheory.Preadditive.Injective.Preserves -import Mathlib.CategoryTheory.Preadditive.Injective.Resolution -import Mathlib.CategoryTheory.Preadditive.LeftExact -import Mathlib.CategoryTheory.Preadditive.LiftToFinset -import Mathlib.CategoryTheory.Preadditive.Mat -import Mathlib.CategoryTheory.Preadditive.OfBiproducts -import Mathlib.CategoryTheory.Preadditive.Opposite -import Mathlib.CategoryTheory.Preadditive.Projective.Basic -import Mathlib.CategoryTheory.Preadditive.Projective.Internal -import Mathlib.CategoryTheory.Preadditive.Projective.LiftingProperties -import Mathlib.CategoryTheory.Preadditive.Projective.Preserves -import Mathlib.CategoryTheory.Preadditive.Projective.Resolution -import Mathlib.CategoryTheory.Preadditive.Schur -import Mathlib.CategoryTheory.Preadditive.SingleObj -import Mathlib.CategoryTheory.Preadditive.Transfer -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic -import Mathlib.CategoryTheory.Preadditive.Yoneda.Injective -import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits -import Mathlib.CategoryTheory.Preadditive.Yoneda.Projective -import Mathlib.CategoryTheory.Presentable.Basic -import Mathlib.CategoryTheory.Presentable.CardinalFilteredPresentation -import Mathlib.CategoryTheory.Presentable.ColimitPresentation -import Mathlib.CategoryTheory.Presentable.Finite -import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered -import Mathlib.CategoryTheory.Presentable.Limits -import Mathlib.CategoryTheory.Presentable.LocallyPresentable -import Mathlib.CategoryTheory.Presentable.OrthogonalReflection -import Mathlib.CategoryTheory.Products.Associator -import Mathlib.CategoryTheory.Products.Basic -import Mathlib.CategoryTheory.Products.Bifunctor -import Mathlib.CategoryTheory.Products.Unitor -import Mathlib.CategoryTheory.Quotient -import Mathlib.CategoryTheory.Quotient.Linear -import Mathlib.CategoryTheory.Quotient.Preadditive -import Mathlib.CategoryTheory.Retract -import Mathlib.CategoryTheory.Shift.Adjunction -import Mathlib.CategoryTheory.Shift.Basic -import Mathlib.CategoryTheory.Shift.CommShift -import Mathlib.CategoryTheory.Shift.Induced -import Mathlib.CategoryTheory.Shift.InducedShiftSequence -import Mathlib.CategoryTheory.Shift.Linear -import Mathlib.CategoryTheory.Shift.Localization -import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Pullback -import Mathlib.CategoryTheory.Shift.Quotient -import Mathlib.CategoryTheory.Shift.ShiftSequence -import Mathlib.CategoryTheory.Shift.ShiftedHom -import Mathlib.CategoryTheory.Shift.ShiftedHomOpposite -import Mathlib.CategoryTheory.Shift.SingleFunctors -import Mathlib.CategoryTheory.Sigma.Basic -import Mathlib.CategoryTheory.Simple -import Mathlib.CategoryTheory.SingleObj -import Mathlib.CategoryTheory.Sites.Abelian -import Mathlib.CategoryTheory.Sites.Adjunction -import Mathlib.CategoryTheory.Sites.Canonical -import Mathlib.CategoryTheory.Sites.CartesianClosed -import Mathlib.CategoryTheory.Sites.CartesianMonoidal -import Mathlib.CategoryTheory.Sites.ChosenFiniteProducts -import Mathlib.CategoryTheory.Sites.Closed -import Mathlib.CategoryTheory.Sites.Coherent.Basic -import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves -import Mathlib.CategoryTheory.Sites.Coherent.CoherentTopology -import Mathlib.CategoryTheory.Sites.Coherent.Comparison -import Mathlib.CategoryTheory.Sites.Coherent.Equivalence -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveColimits -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveSheaves -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveTopology -import Mathlib.CategoryTheory.Sites.Coherent.LocallySurjective -import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPrecoherent -import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular -import Mathlib.CategoryTheory.Sites.Coherent.RegularSheaves -import Mathlib.CategoryTheory.Sites.Coherent.RegularTopology -import Mathlib.CategoryTheory.Sites.Coherent.SequentialLimit -import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison -import Mathlib.CategoryTheory.Sites.CompatiblePlus -import Mathlib.CategoryTheory.Sites.CompatibleSheafification -import Mathlib.CategoryTheory.Sites.ConcreteSheafification -import Mathlib.CategoryTheory.Sites.ConstantSheaf -import Mathlib.CategoryTheory.Sites.Continuous -import Mathlib.CategoryTheory.Sites.CoverLifting -import Mathlib.CategoryTheory.Sites.CoverPreserving -import Mathlib.CategoryTheory.Sites.Coverage -import Mathlib.CategoryTheory.Sites.CoversTop -import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic -import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology -import Mathlib.CategoryTheory.Sites.DenseSubsite.SheafEquiv -import Mathlib.CategoryTheory.Sites.Descent.IsPrestack -import Mathlib.CategoryTheory.Sites.EffectiveEpimorphic -import Mathlib.CategoryTheory.Sites.EpiMono -import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition -import Mathlib.CategoryTheory.Sites.Equivalence -import Mathlib.CategoryTheory.Sites.Finite -import Mathlib.CategoryTheory.Sites.GlobalSections -import Mathlib.CategoryTheory.Sites.Grothendieck -import Mathlib.CategoryTheory.Sites.Hypercover.Homotopy -import Mathlib.CategoryTheory.Sites.Hypercover.IsSheaf -import Mathlib.CategoryTheory.Sites.Hypercover.One -import Mathlib.CategoryTheory.Sites.Hypercover.Zero -import Mathlib.CategoryTheory.Sites.Hypercover.ZeroFamily -import Mathlib.CategoryTheory.Sites.IsSheafFor -import Mathlib.CategoryTheory.Sites.JointlySurjective -import Mathlib.CategoryTheory.Sites.LeftExact -import Mathlib.CategoryTheory.Sites.Limits -import Mathlib.CategoryTheory.Sites.Localization -import Mathlib.CategoryTheory.Sites.LocallyBijective -import Mathlib.CategoryTheory.Sites.LocallyFullyFaithful -import Mathlib.CategoryTheory.Sites.LocallyInjective -import Mathlib.CategoryTheory.Sites.LocallySurjective -import Mathlib.CategoryTheory.Sites.MayerVietorisSquare -import Mathlib.CategoryTheory.Sites.Monoidal -import Mathlib.CategoryTheory.Sites.MorphismProperty -import Mathlib.CategoryTheory.Sites.NonabelianCohomology.H1 -import Mathlib.CategoryTheory.Sites.Over -import Mathlib.CategoryTheory.Sites.Plus -import Mathlib.CategoryTheory.Sites.Precoverage -import Mathlib.CategoryTheory.Sites.Preserves -import Mathlib.CategoryTheory.Sites.PreservesLocallyBijective -import Mathlib.CategoryTheory.Sites.PreservesSheafification -import Mathlib.CategoryTheory.Sites.Pretopology -import Mathlib.CategoryTheory.Sites.Pullback -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.CategoryTheory.Sites.SheafCohomology.Basic -import Mathlib.CategoryTheory.Sites.SheafHom -import Mathlib.CategoryTheory.Sites.SheafOfTypes -import Mathlib.CategoryTheory.Sites.Sheafification -import Mathlib.CategoryTheory.Sites.Sieves -import Mathlib.CategoryTheory.Sites.Spaces -import Mathlib.CategoryTheory.Sites.Subcanonical -import Mathlib.CategoryTheory.Sites.Subsheaf -import Mathlib.CategoryTheory.Sites.Types -import Mathlib.CategoryTheory.Sites.Whiskering -import Mathlib.CategoryTheory.Skeletal -import Mathlib.CategoryTheory.SmallObject.Basic -import Mathlib.CategoryTheory.SmallObject.Construction -import Mathlib.CategoryTheory.SmallObject.IsCardinalForSmallObjectArgument -import Mathlib.CategoryTheory.SmallObject.Iteration.Basic -import Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc -import Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone -import Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty -import Mathlib.CategoryTheory.SmallObject.TransfiniteCompositionLifting -import Mathlib.CategoryTheory.SmallObject.TransfiniteIteration -import Mathlib.CategoryTheory.SmallObject.WellOrderInductionData -import Mathlib.CategoryTheory.SmallRepresentatives -import Mathlib.CategoryTheory.Square -import Mathlib.CategoryTheory.Subobject.ArtinianObject -import Mathlib.CategoryTheory.Subobject.Basic -import Mathlib.CategoryTheory.Subobject.Comma -import Mathlib.CategoryTheory.Subobject.FactorThru -import Mathlib.CategoryTheory.Subobject.HasCardinalLT -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.CategoryTheory.Subobject.Limits -import Mathlib.CategoryTheory.Subobject.MonoOver -import Mathlib.CategoryTheory.Subobject.NoetherianObject -import Mathlib.CategoryTheory.Subobject.Presheaf -import Mathlib.CategoryTheory.Subobject.Types -import Mathlib.CategoryTheory.Subobject.WellPowered -import Mathlib.CategoryTheory.Subpresheaf.Basic -import Mathlib.CategoryTheory.Subpresheaf.Equalizer -import Mathlib.CategoryTheory.Subpresheaf.Finite -import Mathlib.CategoryTheory.Subpresheaf.Image -import Mathlib.CategoryTheory.Subpresheaf.OfSection -import Mathlib.CategoryTheory.Subpresheaf.Sieves -import Mathlib.CategoryTheory.Subpresheaf.Subobject -import Mathlib.CategoryTheory.Subterminal -import Mathlib.CategoryTheory.Sums.Associator -import Mathlib.CategoryTheory.Sums.Basic -import Mathlib.CategoryTheory.Sums.Products -import Mathlib.CategoryTheory.Thin -import Mathlib.CategoryTheory.Topos.Classifier -import Mathlib.CategoryTheory.Triangulated.Adjunction -import Mathlib.CategoryTheory.Triangulated.Basic -import Mathlib.CategoryTheory.Triangulated.Functor -import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor -import Mathlib.CategoryTheory.Triangulated.Opposite.Basic -import Mathlib.CategoryTheory.Triangulated.Opposite.Functor -import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated -import Mathlib.CategoryTheory.Triangulated.Opposite.Triangle -import Mathlib.CategoryTheory.Triangulated.Pretriangulated -import Mathlib.CategoryTheory.Triangulated.Rotate -import Mathlib.CategoryTheory.Triangulated.Subcategory -import Mathlib.CategoryTheory.Triangulated.TStructure.Basic -import Mathlib.CategoryTheory.Triangulated.TriangleShift -import Mathlib.CategoryTheory.Triangulated.Triangulated -import Mathlib.CategoryTheory.Triangulated.Yoneda -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.CategoryTheory.Types.Monomorphisms -import Mathlib.CategoryTheory.Types.Set -import Mathlib.CategoryTheory.UnivLE -import Mathlib.CategoryTheory.Whiskering -import Mathlib.CategoryTheory.Widesubcategory -import Mathlib.CategoryTheory.WithTerminal -import Mathlib.CategoryTheory.WithTerminal.Basic -import Mathlib.CategoryTheory.WithTerminal.Cone -import Mathlib.CategoryTheory.WithTerminal.FinCategory -import Mathlib.CategoryTheory.WithTerminal.Lemmas -import Mathlib.CategoryTheory.Yoneda -import Mathlib.Combinatorics.Additive.AP.Three.Behrend -import Mathlib.Combinatorics.Additive.AP.Three.Defs -import Mathlib.Combinatorics.Additive.ApproximateSubgroup -import Mathlib.Combinatorics.Additive.CauchyDavenport -import Mathlib.Combinatorics.Additive.Convolution -import Mathlib.Combinatorics.Additive.Corner.Defs -import Mathlib.Combinatorics.Additive.Corner.Roth -import Mathlib.Combinatorics.Additive.CovBySMul -import Mathlib.Combinatorics.Additive.Dissociation -import Mathlib.Combinatorics.Additive.DoublingConst -import Mathlib.Combinatorics.Additive.ETransform -import Mathlib.Combinatorics.Additive.Energy -import Mathlib.Combinatorics.Additive.ErdosGinzburgZiv -import Mathlib.Combinatorics.Additive.FreimanHom -import Mathlib.Combinatorics.Additive.PluenneckeRuzsa -import Mathlib.Combinatorics.Additive.Randomisation -import Mathlib.Combinatorics.Additive.RuzsaCovering -import Mathlib.Combinatorics.Additive.SmallTripling -import Mathlib.Combinatorics.Additive.VerySmallDoubling -import Mathlib.Combinatorics.Colex -import Mathlib.Combinatorics.Configuration -import Mathlib.Combinatorics.Derangements.Basic -import Mathlib.Combinatorics.Derangements.Exponential -import Mathlib.Combinatorics.Derangements.Finite -import Mathlib.Combinatorics.Digraph.Basic -import Mathlib.Combinatorics.Digraph.Orientation -import Mathlib.Combinatorics.Enumerative.Bell -import Mathlib.Combinatorics.Enumerative.Catalan -import Mathlib.Combinatorics.Enumerative.Composition -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Combinatorics.Enumerative.DyckWord -import Mathlib.Combinatorics.Enumerative.IncidenceAlgebra -import Mathlib.Combinatorics.Enumerative.InclusionExclusion -import Mathlib.Combinatorics.Enumerative.Partition -import Mathlib.Combinatorics.Enumerative.Stirling -import Mathlib.Combinatorics.Extremal.RuzsaSzemeredi -import Mathlib.Combinatorics.Graph.Basic -import Mathlib.Combinatorics.HalesJewett -import Mathlib.Combinatorics.Hall.Basic -import Mathlib.Combinatorics.Hall.Finite -import Mathlib.Combinatorics.Hindman -import Mathlib.Combinatorics.Matroid.Basic -import Mathlib.Combinatorics.Matroid.Circuit -import Mathlib.Combinatorics.Matroid.Closure -import Mathlib.Combinatorics.Matroid.Constructions -import Mathlib.Combinatorics.Matroid.Dual -import Mathlib.Combinatorics.Matroid.IndepAxioms -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Combinatorics.Matroid.Loop -import Mathlib.Combinatorics.Matroid.Map -import Mathlib.Combinatorics.Matroid.Minor.Contract -import Mathlib.Combinatorics.Matroid.Minor.Delete -import Mathlib.Combinatorics.Matroid.Minor.Order -import Mathlib.Combinatorics.Matroid.Minor.Restrict -import Mathlib.Combinatorics.Matroid.Rank.Cardinal -import Mathlib.Combinatorics.Matroid.Rank.ENat -import Mathlib.Combinatorics.Matroid.Rank.Finite -import Mathlib.Combinatorics.Matroid.Sum -import Mathlib.Combinatorics.Nullstellensatz -import Mathlib.Combinatorics.Optimization.ValuedCSP -import Mathlib.Combinatorics.Pigeonhole -import Mathlib.Combinatorics.Quiver.Arborescence -import Mathlib.Combinatorics.Quiver.Basic -import Mathlib.Combinatorics.Quiver.Cast -import Mathlib.Combinatorics.Quiver.ConnectedComponent -import Mathlib.Combinatorics.Quiver.Covering -import Mathlib.Combinatorics.Quiver.Path -import Mathlib.Combinatorics.Quiver.Path.Decomposition -import Mathlib.Combinatorics.Quiver.Path.Vertices -import Mathlib.Combinatorics.Quiver.Path.Weight -import Mathlib.Combinatorics.Quiver.Prefunctor -import Mathlib.Combinatorics.Quiver.Push -import Mathlib.Combinatorics.Quiver.ReflQuiver -import Mathlib.Combinatorics.Quiver.SingleObj -import Mathlib.Combinatorics.Quiver.Subquiver -import Mathlib.Combinatorics.Quiver.Symmetric -import Mathlib.Combinatorics.Schnirelmann -import Mathlib.Combinatorics.SetFamily.AhlswedeZhang -import Mathlib.Combinatorics.SetFamily.Compression.Down -import Mathlib.Combinatorics.SetFamily.Compression.UV -import Mathlib.Combinatorics.SetFamily.FourFunctions -import Mathlib.Combinatorics.SetFamily.HarrisKleitman -import Mathlib.Combinatorics.SetFamily.Intersecting -import Mathlib.Combinatorics.SetFamily.Kleitman -import Mathlib.Combinatorics.SetFamily.KruskalKatona -import Mathlib.Combinatorics.SetFamily.LYM -import Mathlib.Combinatorics.SetFamily.Shadow -import Mathlib.Combinatorics.SetFamily.Shatter -import Mathlib.Combinatorics.SimpleGraph.Acyclic -import Mathlib.Combinatorics.SimpleGraph.AdjMatrix -import Mathlib.Combinatorics.SimpleGraph.Basic -import Mathlib.Combinatorics.SimpleGraph.Bipartite -import Mathlib.Combinatorics.SimpleGraph.Circulant -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Combinatorics.SimpleGraph.Coloring -import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite -import Mathlib.Combinatorics.SimpleGraph.ConcreteColorings -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph -import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting -import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkDecomp -import Mathlib.Combinatorics.SimpleGraph.Copy -import Mathlib.Combinatorics.SimpleGraph.Dart -import Mathlib.Combinatorics.SimpleGraph.DegreeSum -import Mathlib.Combinatorics.SimpleGraph.DeleteEdges -import Mathlib.Combinatorics.SimpleGraph.Density -import Mathlib.Combinatorics.SimpleGraph.Diam -import Mathlib.Combinatorics.SimpleGraph.Ends.Defs -import Mathlib.Combinatorics.SimpleGraph.Ends.Properties -import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic -import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan -import Mathlib.Combinatorics.SimpleGraph.Extremal.TuranDensity -import Mathlib.Combinatorics.SimpleGraph.Finite -import Mathlib.Combinatorics.SimpleGraph.Finsubgraph -import Mathlib.Combinatorics.SimpleGraph.FiveWheelLike -import Mathlib.Combinatorics.SimpleGraph.Girth -import Mathlib.Combinatorics.SimpleGraph.Hall -import Mathlib.Combinatorics.SimpleGraph.Hamiltonian -import Mathlib.Combinatorics.SimpleGraph.Hasse -import Mathlib.Combinatorics.SimpleGraph.IncMatrix -import Mathlib.Combinatorics.SimpleGraph.Init -import Mathlib.Combinatorics.SimpleGraph.LapMatrix -import Mathlib.Combinatorics.SimpleGraph.LineGraph -import Mathlib.Combinatorics.SimpleGraph.Maps -import Mathlib.Combinatorics.SimpleGraph.Matching -import Mathlib.Combinatorics.SimpleGraph.Metric -import Mathlib.Combinatorics.SimpleGraph.Operations -import Mathlib.Combinatorics.SimpleGraph.Partition -import Mathlib.Combinatorics.SimpleGraph.Path -import Mathlib.Combinatorics.SimpleGraph.Paths -import Mathlib.Combinatorics.SimpleGraph.Prod -import Mathlib.Combinatorics.SimpleGraph.Regularity.Bound -import Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk -import Mathlib.Combinatorics.SimpleGraph.Regularity.Energy -import Mathlib.Combinatorics.SimpleGraph.Regularity.Equitabilise -import Mathlib.Combinatorics.SimpleGraph.Regularity.Increment -import Mathlib.Combinatorics.SimpleGraph.Regularity.Lemma -import Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform -import Mathlib.Combinatorics.SimpleGraph.StronglyRegular -import Mathlib.Combinatorics.SimpleGraph.Subgraph -import Mathlib.Combinatorics.SimpleGraph.Sum -import Mathlib.Combinatorics.SimpleGraph.Trails -import Mathlib.Combinatorics.SimpleGraph.Triangle.Basic -import Mathlib.Combinatorics.SimpleGraph.Triangle.Counting -import Mathlib.Combinatorics.SimpleGraph.Triangle.Removal -import Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite -import Mathlib.Combinatorics.SimpleGraph.Turan -import Mathlib.Combinatorics.SimpleGraph.Tutte -import Mathlib.Combinatorics.SimpleGraph.UniversalVerts -import Mathlib.Combinatorics.SimpleGraph.Walk -import Mathlib.Combinatorics.Young.SemistandardTableau -import Mathlib.Combinatorics.Young.YoungDiagram -import Mathlib.Computability.Ackermann -import Mathlib.Computability.AkraBazzi.AkraBazzi -import Mathlib.Computability.AkraBazzi.GrowsPolynomially -import Mathlib.Computability.AkraBazzi.SumTransform -import Mathlib.Computability.ContextFreeGrammar -import Mathlib.Computability.DFA -import Mathlib.Computability.Encoding -import Mathlib.Computability.EpsilonNFA -import Mathlib.Computability.Halting -import Mathlib.Computability.Language -import Mathlib.Computability.MyhillNerode -import Mathlib.Computability.NFA -import Mathlib.Computability.Partrec -import Mathlib.Computability.PartrecCode -import Mathlib.Computability.PostTuringMachine -import Mathlib.Computability.Primrec -import Mathlib.Computability.Reduce -import Mathlib.Computability.RegularExpressions -import Mathlib.Computability.TMComputable -import Mathlib.Computability.TMConfig -import Mathlib.Computability.TMToPartrec -import Mathlib.Computability.Tape -import Mathlib.Computability.TuringDegree -import Mathlib.Computability.TuringMachine -import Mathlib.Condensed.AB -import Mathlib.Condensed.Basic -import Mathlib.Condensed.CartesianClosed -import Mathlib.Condensed.Discrete.Basic -import Mathlib.Condensed.Discrete.Characterization -import Mathlib.Condensed.Discrete.Colimit -import Mathlib.Condensed.Discrete.LocallyConstant -import Mathlib.Condensed.Discrete.Module -import Mathlib.Condensed.Epi -import Mathlib.Condensed.Equivalence -import Mathlib.Condensed.Explicit -import Mathlib.Condensed.Functors -import Mathlib.Condensed.Light.AB -import Mathlib.Condensed.Light.Basic -import Mathlib.Condensed.Light.CartesianClosed -import Mathlib.Condensed.Light.Epi -import Mathlib.Condensed.Light.Explicit -import Mathlib.Condensed.Light.Functors -import Mathlib.Condensed.Light.Instances -import Mathlib.Condensed.Light.Limits -import Mathlib.Condensed.Light.Module -import Mathlib.Condensed.Light.Small -import Mathlib.Condensed.Light.TopCatAdjunction -import Mathlib.Condensed.Light.TopComparison -import Mathlib.Condensed.Limits -import Mathlib.Condensed.Module -import Mathlib.Condensed.Solid -import Mathlib.Condensed.TopCatAdjunction -import Mathlib.Condensed.TopComparison -import Mathlib.Control.Applicative -import Mathlib.Control.Basic -import Mathlib.Control.Bifunctor -import Mathlib.Control.Bitraversable.Basic -import Mathlib.Control.Bitraversable.Instances -import Mathlib.Control.Bitraversable.Lemmas -import Mathlib.Control.Combinators -import Mathlib.Control.EquivFunctor -import Mathlib.Control.EquivFunctor.Instances -import Mathlib.Control.Fix -import Mathlib.Control.Fold -import Mathlib.Control.Functor -import Mathlib.Control.Functor.Multivariate -import Mathlib.Control.Lawful -import Mathlib.Control.LawfulFix -import Mathlib.Control.Monad.Basic -import Mathlib.Control.Monad.Cont -import Mathlib.Control.Monad.Writer -import Mathlib.Control.Random -import Mathlib.Control.Traversable.Basic -import Mathlib.Control.Traversable.Equiv -import Mathlib.Control.Traversable.Instances -import Mathlib.Control.Traversable.Lemmas -import Mathlib.Control.ULift -import Mathlib.Control.ULiftable -import Mathlib.Data.Analysis.Filter -import Mathlib.Data.Analysis.Topology -import Mathlib.Data.Array.Defs -import Mathlib.Data.Array.Extract -import Mathlib.Data.BitVec -import Mathlib.Data.Bool.AllAny -import Mathlib.Data.Bool.Basic -import Mathlib.Data.Bool.Count -import Mathlib.Data.Bool.Set -import Mathlib.Data.Bracket -import Mathlib.Data.Bundle -import Mathlib.Data.Char -import Mathlib.Data.Complex.Basic -import Mathlib.Data.Complex.BigOperators -import Mathlib.Data.Complex.Cardinality -import Mathlib.Data.Complex.Exponential -import Mathlib.Data.Complex.ExponentialBounds -import Mathlib.Data.Complex.FiniteDimensional -import Mathlib.Data.Complex.Norm -import Mathlib.Data.Complex.Order -import Mathlib.Data.Complex.Trigonometric -import Mathlib.Data.Countable.Basic -import Mathlib.Data.Countable.Defs -import Mathlib.Data.Countable.Small -import Mathlib.Data.DFinsupp.BigOperators -import Mathlib.Data.DFinsupp.Defs -import Mathlib.Data.DFinsupp.Encodable -import Mathlib.Data.DFinsupp.Ext -import Mathlib.Data.DFinsupp.FiniteInfinite -import Mathlib.Data.DFinsupp.Interval -import Mathlib.Data.DFinsupp.Lex -import Mathlib.Data.DFinsupp.Module -import Mathlib.Data.DFinsupp.Multiset -import Mathlib.Data.DFinsupp.NeLocus -import Mathlib.Data.DFinsupp.Notation -import Mathlib.Data.DFinsupp.Order -import Mathlib.Data.DFinsupp.Sigma -import Mathlib.Data.DFinsupp.Small -import Mathlib.Data.DFinsupp.Submonoid -import Mathlib.Data.DFinsupp.WellFounded -import Mathlib.Data.DList.Instances -import Mathlib.Data.ENNReal.Action -import Mathlib.Data.ENNReal.Basic -import Mathlib.Data.ENNReal.BigOperators -import Mathlib.Data.ENNReal.Holder -import Mathlib.Data.ENNReal.Inv -import Mathlib.Data.ENNReal.Lemmas -import Mathlib.Data.ENNReal.Operations -import Mathlib.Data.ENNReal.Order -import Mathlib.Data.ENNReal.Real -import Mathlib.Data.ENat.Basic -import Mathlib.Data.ENat.BigOperators -import Mathlib.Data.ENat.Defs -import Mathlib.Data.ENat.Lattice -import Mathlib.Data.ENat.Pow -import Mathlib.Data.EReal.Basic -import Mathlib.Data.EReal.Inv -import Mathlib.Data.EReal.Operations -import Mathlib.Data.Erased -import Mathlib.Data.FP.Basic -import Mathlib.Data.Fin.Basic -import Mathlib.Data.Fin.Embedding -import Mathlib.Data.Fin.Fin2 -import Mathlib.Data.Fin.FlagRange -import Mathlib.Data.Fin.Parity -import Mathlib.Data.Fin.Pigeonhole -import Mathlib.Data.Fin.Rev -import Mathlib.Data.Fin.SuccPred -import Mathlib.Data.Fin.SuccPredOrder -import Mathlib.Data.Fin.Tuple.Basic -import Mathlib.Data.Fin.Tuple.BubbleSortInduction -import Mathlib.Data.Fin.Tuple.Curry -import Mathlib.Data.Fin.Tuple.Embedding -import Mathlib.Data.Fin.Tuple.Finset -import Mathlib.Data.Fin.Tuple.NatAntidiagonal -import Mathlib.Data.Fin.Tuple.Reflection -import Mathlib.Data.Fin.Tuple.Sort -import Mathlib.Data.Fin.Tuple.Take -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.FinEnum -import Mathlib.Data.FinEnum.Option -import Mathlib.Data.Finite.Card -import Mathlib.Data.Finite.Defs -import Mathlib.Data.Finite.Perm -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Finite.Set -import Mathlib.Data.Finite.Sigma -import Mathlib.Data.Finite.Sum -import Mathlib.Data.Finite.Vector -import Mathlib.Data.Finmap -import Mathlib.Data.Finset.Attach -import Mathlib.Data.Finset.Attr -import Mathlib.Data.Finset.Basic -import Mathlib.Data.Finset.BooleanAlgebra -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.CastCard -import Mathlib.Data.Finset.Dedup -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Finset.Density -import Mathlib.Data.Finset.Disjoint -import Mathlib.Data.Finset.Empty -import Mathlib.Data.Finset.Erase -import Mathlib.Data.Finset.Filter -import Mathlib.Data.Finset.Fin -import Mathlib.Data.Finset.Finsupp -import Mathlib.Data.Finset.Fold -import Mathlib.Data.Finset.Functor -import Mathlib.Data.Finset.Grade -import Mathlib.Data.Finset.Image -import Mathlib.Data.Finset.Insert -import Mathlib.Data.Finset.Interval -import Mathlib.Data.Finset.Lattice.Basic -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Finset.Lattice.Lemmas -import Mathlib.Data.Finset.Lattice.Pi -import Mathlib.Data.Finset.Lattice.Prod -import Mathlib.Data.Finset.Lattice.Union -import Mathlib.Data.Finset.Max -import Mathlib.Data.Finset.MulAntidiagonal -import Mathlib.Data.Finset.NAry -import Mathlib.Data.Finset.NatAntidiagonal -import Mathlib.Data.Finset.NatDivisors -import Mathlib.Data.Finset.NoncommProd -import Mathlib.Data.Finset.Option -import Mathlib.Data.Finset.Order -import Mathlib.Data.Finset.PImage -import Mathlib.Data.Finset.Pairwise -import Mathlib.Data.Finset.Pi -import Mathlib.Data.Finset.PiInduction -import Mathlib.Data.Finset.Piecewise -import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Finset.Preimage -import Mathlib.Data.Finset.Prod -import Mathlib.Data.Finset.Range -import Mathlib.Data.Finset.SDiff -import Mathlib.Data.Finset.SMulAntidiagonal -import Mathlib.Data.Finset.Sigma -import Mathlib.Data.Finset.Slice -import Mathlib.Data.Finset.Sort -import Mathlib.Data.Finset.Sum -import Mathlib.Data.Finset.Sups -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Finset.SymmDiff -import Mathlib.Data.Finset.Union -import Mathlib.Data.Finset.Update -import Mathlib.Data.Finsupp.AList -import Mathlib.Data.Finsupp.Antidiagonal -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Finsupp.BigOperators -import Mathlib.Data.Finsupp.Defs -import Mathlib.Data.Finsupp.Encodable -import Mathlib.Data.Finsupp.Ext -import Mathlib.Data.Finsupp.Fin -import Mathlib.Data.Finsupp.Fintype -import Mathlib.Data.Finsupp.Indicator -import Mathlib.Data.Finsupp.Interval -import Mathlib.Data.Finsupp.Lex -import Mathlib.Data.Finsupp.MonomialOrder -import Mathlib.Data.Finsupp.MonomialOrder.DegLex -import Mathlib.Data.Finsupp.Multiset -import Mathlib.Data.Finsupp.NeLocus -import Mathlib.Data.Finsupp.Notation -import Mathlib.Data.Finsupp.Option -import Mathlib.Data.Finsupp.Order -import Mathlib.Data.Finsupp.PWO -import Mathlib.Data.Finsupp.Pointwise -import Mathlib.Data.Finsupp.PointwiseSMul -import Mathlib.Data.Finsupp.SMul -import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.Data.Finsupp.Single -import Mathlib.Data.Finsupp.ToDFinsupp -import Mathlib.Data.Finsupp.Weight -import Mathlib.Data.Finsupp.WellFounded -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Fintype.Card -import Mathlib.Data.Fintype.CardEmbedding -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Fintype.Fin -import Mathlib.Data.Fintype.Inv -import Mathlib.Data.Fintype.Lattice -import Mathlib.Data.Fintype.List -import Mathlib.Data.Fintype.OfMap -import Mathlib.Data.Fintype.Option -import Mathlib.Data.Fintype.Order -import Mathlib.Data.Fintype.Parity -import Mathlib.Data.Fintype.Perm -import Mathlib.Data.Fintype.Pi -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Data.Fintype.Powerset -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Quotient -import Mathlib.Data.Fintype.Sets -import Mathlib.Data.Fintype.Shrink -import Mathlib.Data.Fintype.Sigma -import Mathlib.Data.Fintype.Sort -import Mathlib.Data.Fintype.Sum -import Mathlib.Data.Fintype.Units -import Mathlib.Data.Fintype.Vector -import Mathlib.Data.Fintype.WithTopBot -import Mathlib.Data.FunLike.Basic -import Mathlib.Data.FunLike.Embedding -import Mathlib.Data.FunLike.Equiv -import Mathlib.Data.FunLike.Fintype -import Mathlib.Data.Holor -import Mathlib.Data.Ineq -import Mathlib.Data.Int.AbsoluteValue -import Mathlib.Data.Int.Associated -import Mathlib.Data.Int.Basic -import Mathlib.Data.Int.Bitwise -import Mathlib.Data.Int.CardIntervalMod -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Data.Int.Cast.Defs -import Mathlib.Data.Int.Cast.Field -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.Data.Int.Cast.Pi -import Mathlib.Data.Int.Cast.Prod -import Mathlib.Data.Int.CharZero -import Mathlib.Data.Int.ConditionallyCompleteOrder -import Mathlib.Data.Int.DivMod -import Mathlib.Data.Int.GCD -import Mathlib.Data.Int.Init -import Mathlib.Data.Int.Interval -import Mathlib.Data.Int.LeastGreatest -import Mathlib.Data.Int.Lemmas -import Mathlib.Data.Int.Log -import Mathlib.Data.Int.ModEq -import Mathlib.Data.Int.NatAbs -import Mathlib.Data.Int.NatPrime -import Mathlib.Data.Int.Notation -import Mathlib.Data.Int.Order.Basic -import Mathlib.Data.Int.Order.Lemmas -import Mathlib.Data.Int.Order.Units -import Mathlib.Data.Int.Range -import Mathlib.Data.Int.Sqrt -import Mathlib.Data.Int.Star -import Mathlib.Data.Int.SuccPred -import Mathlib.Data.Int.WithZero -import Mathlib.Data.List.AList -import Mathlib.Data.List.Basic -import Mathlib.Data.List.Chain -import Mathlib.Data.List.ChainOfFn -import Mathlib.Data.List.Count -import Mathlib.Data.List.Cycle -import Mathlib.Data.List.Dedup -import Mathlib.Data.List.Defs -import Mathlib.Data.List.Destutter -import Mathlib.Data.List.DropRight -import Mathlib.Data.List.Duplicate -import Mathlib.Data.List.Enum -import Mathlib.Data.List.FinRange -import Mathlib.Data.List.Flatten -import Mathlib.Data.List.Forall2 -import Mathlib.Data.List.GetD -import Mathlib.Data.List.Indexes -import Mathlib.Data.List.Induction -import Mathlib.Data.List.Infix -import Mathlib.Data.List.InsertIdx -import Mathlib.Data.List.InsertNth -import Mathlib.Data.List.Intervals -import Mathlib.Data.List.Iterate -import Mathlib.Data.List.Lattice -import Mathlib.Data.List.Lemmas -import Mathlib.Data.List.Lex -import Mathlib.Data.List.Lookmap -import Mathlib.Data.List.Map2 -import Mathlib.Data.List.MinMax -import Mathlib.Data.List.ModifyLast -import Mathlib.Data.List.Monad -import Mathlib.Data.List.NatAntidiagonal -import Mathlib.Data.List.Nodup -import Mathlib.Data.List.NodupEquivFin -import Mathlib.Data.List.OfFn -import Mathlib.Data.List.Pairwise -import Mathlib.Data.List.Palindrome -import Mathlib.Data.List.Perm.Basic -import Mathlib.Data.List.Perm.Lattice -import Mathlib.Data.List.Perm.Subperm -import Mathlib.Data.List.Permutation -import Mathlib.Data.List.Pi -import Mathlib.Data.List.Prime -import Mathlib.Data.List.ProdSigma -import Mathlib.Data.List.Range -import Mathlib.Data.List.ReduceOption -import Mathlib.Data.List.Rotate -import Mathlib.Data.List.Sections -import Mathlib.Data.List.Shortlex -import Mathlib.Data.List.Sigma -import Mathlib.Data.List.Sort -import Mathlib.Data.List.SplitBy -import Mathlib.Data.List.SplitLengths -import Mathlib.Data.List.SplitOn -import Mathlib.Data.List.Sublists -import Mathlib.Data.List.Sym -import Mathlib.Data.List.TFAE -import Mathlib.Data.List.TakeDrop -import Mathlib.Data.List.TakeWhile -import Mathlib.Data.List.ToFinsupp -import Mathlib.Data.List.Triplewise -import Mathlib.Data.List.Zip -import Mathlib.Data.Matrix.Action -import Mathlib.Data.Matrix.Auto -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.Bilinear -import Mathlib.Data.Matrix.Block -import Mathlib.Data.Matrix.ColumnRowPartitioned -import Mathlib.Data.Matrix.Composition -import Mathlib.Data.Matrix.DMatrix -import Mathlib.Data.Matrix.Diagonal -import Mathlib.Data.Matrix.DualNumber -import Mathlib.Data.Matrix.Invertible -import Mathlib.Data.Matrix.Mul -import Mathlib.Data.Matrix.PEquiv -import Mathlib.Data.Matrix.Reflection -import Mathlib.Data.Multiset.AddSub -import Mathlib.Data.Multiset.Antidiagonal -import Mathlib.Data.Multiset.Basic -import Mathlib.Data.Multiset.Bind -import Mathlib.Data.Multiset.Count -import Mathlib.Data.Multiset.Dedup -import Mathlib.Data.Multiset.Defs -import Mathlib.Data.Multiset.DershowitzManna -import Mathlib.Data.Multiset.Filter -import Mathlib.Data.Multiset.FinsetOps -import Mathlib.Data.Multiset.Fintype -import Mathlib.Data.Multiset.Fold -import Mathlib.Data.Multiset.Functor -import Mathlib.Data.Multiset.Interval -import Mathlib.Data.Multiset.Lattice -import Mathlib.Data.Multiset.MapFold -import Mathlib.Data.Multiset.NatAntidiagonal -import Mathlib.Data.Multiset.OrderedMonoid -import Mathlib.Data.Multiset.Pairwise -import Mathlib.Data.Multiset.Pi -import Mathlib.Data.Multiset.Powerset -import Mathlib.Data.Multiset.Range -import Mathlib.Data.Multiset.Replicate -import Mathlib.Data.Multiset.Sections -import Mathlib.Data.Multiset.Sort -import Mathlib.Data.Multiset.Sum -import Mathlib.Data.Multiset.Sym -import Mathlib.Data.Multiset.UnionInter -import Mathlib.Data.Multiset.ZeroCons -import Mathlib.Data.NNRat.BigOperators -import Mathlib.Data.NNRat.Defs -import Mathlib.Data.NNRat.Floor -import Mathlib.Data.NNRat.Lemmas -import Mathlib.Data.NNRat.Order -import Mathlib.Data.NNReal.Basic -import Mathlib.Data.NNReal.Defs -import Mathlib.Data.NNReal.Star -import Mathlib.Data.Nat.Basic -import Mathlib.Data.Nat.BinaryRec -import Mathlib.Data.Nat.BitIndices -import Mathlib.Data.Nat.Bits -import Mathlib.Data.Nat.Bitwise -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Data.Nat.Cast.Commute -import Mathlib.Data.Nat.Cast.Defs -import Mathlib.Data.Nat.Cast.Field -import Mathlib.Data.Nat.Cast.NeZero -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Data.Nat.Cast.Order.Field -import Mathlib.Data.Nat.Cast.Order.Ring -import Mathlib.Data.Nat.Cast.Prod -import Mathlib.Data.Nat.Cast.SetInterval -import Mathlib.Data.Nat.Cast.Synonym -import Mathlib.Data.Nat.Cast.WithTop -import Mathlib.Data.Nat.ChineseRemainder -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Data.Nat.Choose.Bounds -import Mathlib.Data.Nat.Choose.Cast -import Mathlib.Data.Nat.Choose.Central -import Mathlib.Data.Nat.Choose.Dvd -import Mathlib.Data.Nat.Choose.Factorization -import Mathlib.Data.Nat.Choose.Lucas -import Mathlib.Data.Nat.Choose.Mul -import Mathlib.Data.Nat.Choose.Multinomial -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Data.Nat.Choose.Vandermonde -import Mathlib.Data.Nat.Count -import Mathlib.Data.Nat.Digits.Defs -import Mathlib.Data.Nat.Digits.Div -import Mathlib.Data.Nat.Digits.Lemmas -import Mathlib.Data.Nat.Dist -import Mathlib.Data.Nat.EvenOddRec -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Data.Nat.Factorial.BigOperators -import Mathlib.Data.Nat.Factorial.Cast -import Mathlib.Data.Nat.Factorial.DoubleFactorial -import Mathlib.Data.Nat.Factorial.NatCast -import Mathlib.Data.Nat.Factorial.SuperFactorial -import Mathlib.Data.Nat.Factorization.Basic -import Mathlib.Data.Nat.Factorization.Defs -import Mathlib.Data.Nat.Factorization.Induction -import Mathlib.Data.Nat.Factorization.LCM -import Mathlib.Data.Nat.Factorization.PrimePow -import Mathlib.Data.Nat.Factorization.Root -import Mathlib.Data.Nat.Factors -import Mathlib.Data.Nat.Fib.Basic -import Mathlib.Data.Nat.Fib.Zeckendorf -import Mathlib.Data.Nat.Find -import Mathlib.Data.Nat.GCD.Basic -import Mathlib.Data.Nat.GCD.BigOperators -import Mathlib.Data.Nat.GCD.Prime -import Mathlib.Data.Nat.Hyperoperation -import Mathlib.Data.Nat.Init -import Mathlib.Data.Nat.Lattice -import Mathlib.Data.Nat.Log -import Mathlib.Data.Nat.MaxPowDiv -import Mathlib.Data.Nat.ModEq -import Mathlib.Data.Nat.Multiplicity -import Mathlib.Data.Nat.Notation -import Mathlib.Data.Nat.Nth -import Mathlib.Data.Nat.NthRoot.Defs -import Mathlib.Data.Nat.Order.Lemmas -import Mathlib.Data.Nat.PSub -import Mathlib.Data.Nat.Pairing -import Mathlib.Data.Nat.PartENat -import Mathlib.Data.Nat.Periodic -import Mathlib.Data.Nat.PowModTotient -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.Nat.Prime.Factorial -import Mathlib.Data.Nat.Prime.Infinite -import Mathlib.Data.Nat.Prime.Int -import Mathlib.Data.Nat.Prime.Nth -import Mathlib.Data.Nat.Prime.Pow -import Mathlib.Data.Nat.PrimeFin -import Mathlib.Data.Nat.Set -import Mathlib.Data.Nat.Size -import Mathlib.Data.Nat.Sqrt -import Mathlib.Data.Nat.Squarefree -import Mathlib.Data.Nat.SuccPred -import Mathlib.Data.Nat.Totient -import Mathlib.Data.Nat.Upto -import Mathlib.Data.Nat.WithBot -import Mathlib.Data.Num.Basic -import Mathlib.Data.Num.Bitwise -import Mathlib.Data.Num.Lemmas -import Mathlib.Data.Num.Prime -import Mathlib.Data.Num.ZNum -import Mathlib.Data.Opposite -import Mathlib.Data.Option.Basic -import Mathlib.Data.Option.Defs -import Mathlib.Data.Option.NAry -import Mathlib.Data.Ordering.Basic -import Mathlib.Data.Ordering.Lemmas -import Mathlib.Data.Ordmap.Invariants -import Mathlib.Data.Ordmap.Ordnode -import Mathlib.Data.Ordmap.Ordset -import Mathlib.Data.PEquiv -import Mathlib.Data.PFun -import Mathlib.Data.PFunctor.Multivariate.Basic -import Mathlib.Data.PFunctor.Multivariate.M -import Mathlib.Data.PFunctor.Multivariate.W -import Mathlib.Data.PFunctor.Univariate.Basic -import Mathlib.Data.PFunctor.Univariate.M -import Mathlib.Data.PNat.Basic -import Mathlib.Data.PNat.Defs -import Mathlib.Data.PNat.Equiv -import Mathlib.Data.PNat.Factors -import Mathlib.Data.PNat.Find -import Mathlib.Data.PNat.Interval -import Mathlib.Data.PNat.Notation -import Mathlib.Data.PNat.Order -import Mathlib.Data.PNat.Prime -import Mathlib.Data.PNat.Xgcd -import Mathlib.Data.PSigma.Order -import Mathlib.Data.Part -import Mathlib.Data.Pi.Interval -import Mathlib.Data.Prod.Basic -import Mathlib.Data.Prod.Lex -import Mathlib.Data.Prod.PProd -import Mathlib.Data.Prod.TProd -import Mathlib.Data.QPF.Multivariate.Basic -import Mathlib.Data.QPF.Multivariate.Constructions.Cofix -import Mathlib.Data.QPF.Multivariate.Constructions.Comp -import Mathlib.Data.QPF.Multivariate.Constructions.Const -import Mathlib.Data.QPF.Multivariate.Constructions.Fix -import Mathlib.Data.QPF.Multivariate.Constructions.Prj -import Mathlib.Data.QPF.Multivariate.Constructions.Quot -import Mathlib.Data.QPF.Multivariate.Constructions.Sigma -import Mathlib.Data.QPF.Univariate.Basic -import Mathlib.Data.Quot -import Mathlib.Data.Rat.BigOperators -import Mathlib.Data.Rat.Cardinal -import Mathlib.Data.Rat.Cast.CharZero -import Mathlib.Data.Rat.Cast.Defs -import Mathlib.Data.Rat.Cast.Lemmas -import Mathlib.Data.Rat.Cast.OfScientific -import Mathlib.Data.Rat.Cast.Order -import Mathlib.Data.Rat.Defs -import Mathlib.Data.Rat.Denumerable -import Mathlib.Data.Rat.Encodable -import Mathlib.Data.Rat.Floor -import Mathlib.Data.Rat.Init -import Mathlib.Data.Rat.Lemmas -import Mathlib.Data.Rat.NatSqrt.Defs -import Mathlib.Data.Rat.NatSqrt.Real -import Mathlib.Data.Rat.Sqrt -import Mathlib.Data.Rat.Star -import Mathlib.Data.Real.Archimedean -import Mathlib.Data.Real.Basic -import Mathlib.Data.Real.Cardinality -import Mathlib.Data.Real.CompleteField -import Mathlib.Data.Real.ConjExponents -import Mathlib.Data.Real.ENatENNReal -import Mathlib.Data.Real.EReal -import Mathlib.Data.Real.Embedding -import Mathlib.Data.Real.Hyperreal -import Mathlib.Data.Real.Irrational -import Mathlib.Data.Real.Pi.Bounds -import Mathlib.Data.Real.Pi.Irrational -import Mathlib.Data.Real.Pi.Leibniz -import Mathlib.Data.Real.Pi.Wallis -import Mathlib.Data.Real.Pointwise -import Mathlib.Data.Real.Sign -import Mathlib.Data.Real.Sqrt -import Mathlib.Data.Real.Star -import Mathlib.Data.Real.StarOrdered -import Mathlib.Data.Rel -import Mathlib.Data.Rel.Cover -import Mathlib.Data.Rel.Separated -import Mathlib.Data.SProd -import Mathlib.Data.Semiquot -import Mathlib.Data.Seq.Basic -import Mathlib.Data.Seq.Computation -import Mathlib.Data.Seq.Defs -import Mathlib.Data.Seq.Parallel -import Mathlib.Data.Seq.Seq -import Mathlib.Data.Seq.WSeq -import Mathlib.Data.Set.Accumulate -import Mathlib.Data.Set.Basic -import Mathlib.Data.Set.BoolIndicator -import Mathlib.Data.Set.BooleanAlgebra -import Mathlib.Data.Set.Card -import Mathlib.Data.Set.Card.Arithmetic -import Mathlib.Data.Set.CoeSort -import Mathlib.Data.Set.Constructions -import Mathlib.Data.Set.Countable -import Mathlib.Data.Set.Defs -import Mathlib.Data.Set.Disjoint -import Mathlib.Data.Set.Enumerate -import Mathlib.Data.Set.Equitable -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.Data.Set.Finite.List -import Mathlib.Data.Set.Finite.Monad -import Mathlib.Data.Set.Finite.Powerset -import Mathlib.Data.Set.Finite.Range -import Mathlib.Data.Set.Function -import Mathlib.Data.Set.Functor -import Mathlib.Data.Set.Image -import Mathlib.Data.Set.Inclusion -import Mathlib.Data.Set.Insert -import Mathlib.Data.Set.Lattice -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Data.Set.List -import Mathlib.Data.Set.MemPartition -import Mathlib.Data.Set.Monotone -import Mathlib.Data.Set.MulAntidiagonal -import Mathlib.Data.Set.NAry -import Mathlib.Data.Set.Notation -import Mathlib.Data.Set.Operations -import Mathlib.Data.Set.Opposite -import Mathlib.Data.Set.Order -import Mathlib.Data.Set.Pairwise.Basic -import Mathlib.Data.Set.Pairwise.Chain -import Mathlib.Data.Set.Pairwise.Lattice -import Mathlib.Data.Set.Pairwise.List -import Mathlib.Data.Set.Piecewise -import Mathlib.Data.Set.Pointwise.Support -import Mathlib.Data.Set.Prod -import Mathlib.Data.Set.Restrict -import Mathlib.Data.Set.SMulAntidiagonal -import Mathlib.Data.Set.Semiring -import Mathlib.Data.Set.Sigma -import Mathlib.Data.Set.Subset -import Mathlib.Data.Set.Subsingleton -import Mathlib.Data.Set.Sups -import Mathlib.Data.Set.SymmDiff -import Mathlib.Data.Set.UnionLift -import Mathlib.Data.SetLike.Basic -import Mathlib.Data.SetLike.Fintype -import Mathlib.Data.Setoid.Basic -import Mathlib.Data.Setoid.Partition -import Mathlib.Data.Setoid.Partition.Card -import Mathlib.Data.Sigma.Basic -import Mathlib.Data.Sigma.Interval -import Mathlib.Data.Sigma.Lex -import Mathlib.Data.Sigma.Order -import Mathlib.Data.Sign -import Mathlib.Data.Sign.Basic -import Mathlib.Data.Sign.Defs -import Mathlib.Data.Stream.Defs -import Mathlib.Data.Stream.Init -import Mathlib.Data.String.Basic -import Mathlib.Data.String.Defs -import Mathlib.Data.String.Lemmas -import Mathlib.Data.Subtype -import Mathlib.Data.Sum.Basic -import Mathlib.Data.Sum.Interval -import Mathlib.Data.Sum.Lattice -import Mathlib.Data.Sum.Order -import Mathlib.Data.Sym.Basic -import Mathlib.Data.Sym.Card -import Mathlib.Data.Sym.Sym2 -import Mathlib.Data.Sym.Sym2.Finsupp -import Mathlib.Data.Sym.Sym2.Init -import Mathlib.Data.Sym.Sym2.Order -import Mathlib.Data.Tree.Basic -import Mathlib.Data.Tree.Get -import Mathlib.Data.Tree.RBMap -import Mathlib.Data.Tree.Traversable -import Mathlib.Data.TwoPointing -import Mathlib.Data.TypeVec -import Mathlib.Data.UInt -import Mathlib.Data.ULift -import Mathlib.Data.Vector.Basic -import Mathlib.Data.Vector.Defs -import Mathlib.Data.Vector.MapLemmas -import Mathlib.Data.Vector.Mem -import Mathlib.Data.Vector.Snoc -import Mathlib.Data.Vector.Zip -import Mathlib.Data.Vector3 -import Mathlib.Data.W.Basic -import Mathlib.Data.W.Cardinal -import Mathlib.Data.W.Constructions -import Mathlib.Data.WSeq.Basic -import Mathlib.Data.WSeq.Defs -import Mathlib.Data.WSeq.Productive -import Mathlib.Data.WSeq.Relation -import Mathlib.Data.ZMod.Aut -import Mathlib.Data.ZMod.Basic -import Mathlib.Data.ZMod.Coprime -import Mathlib.Data.ZMod.Defs -import Mathlib.Data.ZMod.Factorial -import Mathlib.Data.ZMod.IntUnitsPower -import Mathlib.Data.ZMod.QuotientGroup -import Mathlib.Data.ZMod.QuotientRing -import Mathlib.Data.ZMod.Units -import Mathlib.Data.ZMod.ValMinAbs -import Mathlib.Deprecated.Aliases -import Mathlib.Deprecated.Estimator -import Mathlib.Deprecated.MLList.BestFirst -import Mathlib.Deprecated.Order -import Mathlib.Deprecated.RingHom -import Mathlib.Dynamics.BirkhoffSum.Average -import Mathlib.Dynamics.BirkhoffSum.Basic -import Mathlib.Dynamics.BirkhoffSum.NormedSpace -import Mathlib.Dynamics.BirkhoffSum.QuasiMeasurePreserving -import Mathlib.Dynamics.Circle.RotationNumber.TranslationNumber -import Mathlib.Dynamics.Ergodic.Action.Basic -import Mathlib.Dynamics.Ergodic.Action.OfMinimal -import Mathlib.Dynamics.Ergodic.Action.Regular -import Mathlib.Dynamics.Ergodic.AddCircle -import Mathlib.Dynamics.Ergodic.AddCircleAdd -import Mathlib.Dynamics.Ergodic.Conservative -import Mathlib.Dynamics.Ergodic.Ergodic -import Mathlib.Dynamics.Ergodic.Extreme -import Mathlib.Dynamics.Ergodic.Function -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.Dynamics.Ergodic.RadonNikodym -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.Dynamics.FixedPoints.Prufer -import Mathlib.Dynamics.FixedPoints.Topology -import Mathlib.Dynamics.Flow -import Mathlib.Dynamics.Minimal -import Mathlib.Dynamics.Newton -import Mathlib.Dynamics.OmegaLimit -import Mathlib.Dynamics.PeriodicPts.Defs -import Mathlib.Dynamics.PeriodicPts.Lemmas -import Mathlib.Dynamics.TopologicalEntropy.CoverEntropy -import Mathlib.Dynamics.TopologicalEntropy.DynamicalEntourage -import Mathlib.Dynamics.TopologicalEntropy.NetEntropy -import Mathlib.Dynamics.TopologicalEntropy.Semiconj -import Mathlib.Dynamics.TopologicalEntropy.Subset -import Mathlib.Dynamics.Transitive -import Mathlib.FieldTheory.AbelRuffini -import Mathlib.FieldTheory.AbsoluteGaloisGroup -import Mathlib.FieldTheory.AlgebraicClosure -import Mathlib.FieldTheory.AxGrothendieck -import Mathlib.FieldTheory.CardinalEmb -import Mathlib.FieldTheory.Cardinality -import Mathlib.FieldTheory.ChevalleyWarning -import Mathlib.FieldTheory.Differential.Basic -import Mathlib.FieldTheory.Differential.Liouville -import Mathlib.FieldTheory.Extension -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.FieldTheory.Finite.Extension -import Mathlib.FieldTheory.Finite.GaloisField -import Mathlib.FieldTheory.Finite.Polynomial -import Mathlib.FieldTheory.Finite.Trace -import Mathlib.FieldTheory.Finiteness -import Mathlib.FieldTheory.Fixed -import Mathlib.FieldTheory.Galois.Abelian -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.FieldTheory.Galois.GaloisClosure -import Mathlib.FieldTheory.Galois.Infinite -import Mathlib.FieldTheory.Galois.IsGaloisGroup -import Mathlib.FieldTheory.Galois.NormalBasis -import Mathlib.FieldTheory.Galois.Notation -import Mathlib.FieldTheory.Galois.Profinite -import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra -import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic -import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs -import Mathlib.FieldTheory.IntermediateField.Algebraic -import Mathlib.FieldTheory.IntermediateField.Basic -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.FieldTheory.IsAlgClosed.Classification -import Mathlib.FieldTheory.IsAlgClosed.Spectrum -import Mathlib.FieldTheory.IsPerfectClosure -import Mathlib.FieldTheory.IsSepClosed -import Mathlib.FieldTheory.Isaacs -import Mathlib.FieldTheory.JacobsonNoether -import Mathlib.FieldTheory.KrullTopology -import Mathlib.FieldTheory.KummerExtension -import Mathlib.FieldTheory.KummerPolynomial -import Mathlib.FieldTheory.Laurent -import Mathlib.FieldTheory.LinearDisjoint -import Mathlib.FieldTheory.Minpoly.Basic -import Mathlib.FieldTheory.Minpoly.ConjRootClass -import Mathlib.FieldTheory.Minpoly.Field -import Mathlib.FieldTheory.Minpoly.IsConjRoot -import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed -import Mathlib.FieldTheory.Minpoly.MinpolyDiv -import Mathlib.FieldTheory.MvRatFunc.Rank -import Mathlib.FieldTheory.Normal.Basic -import Mathlib.FieldTheory.Normal.Closure -import Mathlib.FieldTheory.Normal.Defs -import Mathlib.FieldTheory.NormalizedTrace -import Mathlib.FieldTheory.Perfect -import Mathlib.FieldTheory.PerfectClosure -import Mathlib.FieldTheory.PolynomialGaloisGroup -import Mathlib.FieldTheory.PrimitiveElement -import Mathlib.FieldTheory.PurelyInseparable.Basic -import Mathlib.FieldTheory.PurelyInseparable.Exponent -import Mathlib.FieldTheory.PurelyInseparable.PerfectClosure -import Mathlib.FieldTheory.PurelyInseparable.Tower -import Mathlib.FieldTheory.RatFunc.AsPolynomial -import Mathlib.FieldTheory.RatFunc.Basic -import Mathlib.FieldTheory.RatFunc.Defs -import Mathlib.FieldTheory.RatFunc.Degree -import Mathlib.FieldTheory.Relrank -import Mathlib.FieldTheory.Separable -import Mathlib.FieldTheory.SeparableClosure -import Mathlib.FieldTheory.SeparableDegree -import Mathlib.FieldTheory.SplittingField.Construction -import Mathlib.FieldTheory.SplittingField.IsSplittingField -import Mathlib.FieldTheory.Tower -import Mathlib.Geometry.Convex.Cone.Basic -import Mathlib.Geometry.Convex.Cone.Dual -import Mathlib.Geometry.Convex.Cone.Pointed -import Mathlib.Geometry.Euclidean.Altitude -import Mathlib.Geometry.Euclidean.Angle.Bisector -import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine -import Mathlib.Geometry.Euclidean.Angle.Oriented.Basic -import Mathlib.Geometry.Euclidean.Angle.Oriented.Projection -import Mathlib.Geometry.Euclidean.Angle.Oriented.RightAngle -import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation -import Mathlib.Geometry.Euclidean.Angle.Sphere -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Conformal -import Mathlib.Geometry.Euclidean.Angle.Unoriented.CrossProduct -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection -import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle -import Mathlib.Geometry.Euclidean.Basic -import Mathlib.Geometry.Euclidean.Circumcenter -import Mathlib.Geometry.Euclidean.Congruence -import Mathlib.Geometry.Euclidean.Incenter -import Mathlib.Geometry.Euclidean.Inversion.Basic -import Mathlib.Geometry.Euclidean.Inversion.Calculus -import Mathlib.Geometry.Euclidean.Inversion.ImageHyperplane -import Mathlib.Geometry.Euclidean.MongePoint -import Mathlib.Geometry.Euclidean.PerpBisector -import Mathlib.Geometry.Euclidean.Projection -import Mathlib.Geometry.Euclidean.SignedDist -import Mathlib.Geometry.Euclidean.Simplex -import Mathlib.Geometry.Euclidean.Sphere.Basic -import Mathlib.Geometry.Euclidean.Sphere.Power -import Mathlib.Geometry.Euclidean.Sphere.Ptolemy -import Mathlib.Geometry.Euclidean.Sphere.SecondInter -import Mathlib.Geometry.Euclidean.Sphere.Tangent -import Mathlib.Geometry.Euclidean.Triangle -import Mathlib.Geometry.Group.Growth.LinearLowerBound -import Mathlib.Geometry.Group.Growth.QuotientInter -import Mathlib.Geometry.Manifold.Algebra.LeftInvariantDerivation -import Mathlib.Geometry.Manifold.Algebra.LieGroup -import Mathlib.Geometry.Manifold.Algebra.Monoid -import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions -import Mathlib.Geometry.Manifold.Algebra.Structures -import Mathlib.Geometry.Manifold.Bordism -import Mathlib.Geometry.Manifold.BumpFunction -import Mathlib.Geometry.Manifold.ChartedSpace -import Mathlib.Geometry.Manifold.Complex -import Mathlib.Geometry.Manifold.ConformalGroupoid -import Mathlib.Geometry.Manifold.ContMDiff.Atlas -import Mathlib.Geometry.Manifold.ContMDiff.Basic -import Mathlib.Geometry.Manifold.ContMDiff.Constructions -import Mathlib.Geometry.Manifold.ContMDiff.Defs -import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace -import Mathlib.Geometry.Manifold.ContMDiffMFDeriv -import Mathlib.Geometry.Manifold.ContMDiffMap -import Mathlib.Geometry.Manifold.DerivationBundle -import Mathlib.Geometry.Manifold.Diffeomorph -import Mathlib.Geometry.Manifold.GroupLieAlgebra -import Mathlib.Geometry.Manifold.Instances.Icc -import Mathlib.Geometry.Manifold.Instances.Real -import Mathlib.Geometry.Manifold.Instances.Sphere -import Mathlib.Geometry.Manifold.Instances.UnitsOfNormedAlgebra -import Mathlib.Geometry.Manifold.IntegralCurve.Basic -import Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique -import Mathlib.Geometry.Manifold.IntegralCurve.Transform -import Mathlib.Geometry.Manifold.IntegralCurve.UniformTime -import Mathlib.Geometry.Manifold.IsManifold.Basic -import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt -import Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary -import Mathlib.Geometry.Manifold.LocalDiffeomorph -import Mathlib.Geometry.Manifold.LocalInvariantProperties -import Mathlib.Geometry.Manifold.MFDeriv.Atlas -import Mathlib.Geometry.Manifold.MFDeriv.Basic -import Mathlib.Geometry.Manifold.MFDeriv.Defs -import Mathlib.Geometry.Manifold.MFDeriv.FDeriv -import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace -import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions -import Mathlib.Geometry.Manifold.MFDeriv.Tangent -import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential -import Mathlib.Geometry.Manifold.Metrizable -import Mathlib.Geometry.Manifold.Notation -import Mathlib.Geometry.Manifold.PartitionOfUnity -import Mathlib.Geometry.Manifold.PoincareConjecture -import Mathlib.Geometry.Manifold.Riemannian.Basic -import Mathlib.Geometry.Manifold.Riemannian.PathELength -import Mathlib.Geometry.Manifold.Sheaf.Basic -import Mathlib.Geometry.Manifold.Sheaf.LocallyRingedSpace -import Mathlib.Geometry.Manifold.Sheaf.Smooth -import Mathlib.Geometry.Manifold.VectorBundle.Basic -import Mathlib.Geometry.Manifold.VectorBundle.FiberwiseLinear -import Mathlib.Geometry.Manifold.VectorBundle.Hom -import Mathlib.Geometry.Manifold.VectorBundle.LocalFrame -import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable -import Mathlib.Geometry.Manifold.VectorBundle.Pullback -import Mathlib.Geometry.Manifold.VectorBundle.Riemannian -import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection -import Mathlib.Geometry.Manifold.VectorBundle.Tangent -import Mathlib.Geometry.Manifold.VectorField.LieBracket -import Mathlib.Geometry.Manifold.VectorField.Pullback -import Mathlib.Geometry.Manifold.WhitneyEmbedding -import Mathlib.Geometry.RingedSpace.Basic -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace.HasColimits -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace.ResidueField -import Mathlib.Geometry.RingedSpace.OpenImmersion -import Mathlib.Geometry.RingedSpace.PresheafedSpace -import Mathlib.Geometry.RingedSpace.PresheafedSpace.Gluing -import Mathlib.Geometry.RingedSpace.PresheafedSpace.HasColimits -import Mathlib.Geometry.RingedSpace.SheafedSpace -import Mathlib.Geometry.RingedSpace.Stalks -import Mathlib.GroupTheory.Abelianization.Defs -import Mathlib.GroupTheory.Abelianization.Finite -import Mathlib.GroupTheory.Archimedean -import Mathlib.GroupTheory.ArchimedeanDensely -import Mathlib.GroupTheory.ClassEquation -import Mathlib.GroupTheory.Commensurable -import Mathlib.GroupTheory.Commutator.Basic -import Mathlib.GroupTheory.Commutator.Finite -import Mathlib.GroupTheory.CommutingProbability -import Mathlib.GroupTheory.Complement -import Mathlib.GroupTheory.Congruence.Basic -import Mathlib.GroupTheory.Congruence.BigOperators -import Mathlib.GroupTheory.Congruence.Defs -import Mathlib.GroupTheory.Congruence.Hom -import Mathlib.GroupTheory.Congruence.Opposite -import Mathlib.GroupTheory.Coprod.Basic -import Mathlib.GroupTheory.CoprodI -import Mathlib.GroupTheory.Coset.Basic -import Mathlib.GroupTheory.Coset.Card -import Mathlib.GroupTheory.Coset.Defs -import Mathlib.GroupTheory.CosetCover -import Mathlib.GroupTheory.Coxeter.Basic -import Mathlib.GroupTheory.Coxeter.Inversion -import Mathlib.GroupTheory.Coxeter.Length -import Mathlib.GroupTheory.Coxeter.Matrix -import Mathlib.GroupTheory.Divisible -import Mathlib.GroupTheory.DivisibleHull -import Mathlib.GroupTheory.DoubleCoset -import Mathlib.GroupTheory.EckmannHilton -import Mathlib.GroupTheory.Exponent -import Mathlib.GroupTheory.FiniteAbelian.Basic -import Mathlib.GroupTheory.FiniteAbelian.Duality -import Mathlib.GroupTheory.Finiteness -import Mathlib.GroupTheory.FixedPointFree -import Mathlib.GroupTheory.Frattini -import Mathlib.GroupTheory.FreeAbelianGroup -import Mathlib.GroupTheory.FreeGroup.Basic -import Mathlib.GroupTheory.FreeGroup.CyclicallyReduced -import Mathlib.GroupTheory.FreeGroup.GeneratorEquiv -import Mathlib.GroupTheory.FreeGroup.IsFreeGroup -import Mathlib.GroupTheory.FreeGroup.NielsenSchreier -import Mathlib.GroupTheory.FreeGroup.Orbit -import Mathlib.GroupTheory.FreeGroup.Reduce -import Mathlib.GroupTheory.Goursat -import Mathlib.GroupTheory.GroupAction.Basic -import Mathlib.GroupTheory.GroupAction.Blocks -import Mathlib.GroupTheory.GroupAction.CardCommute -import Mathlib.GroupTheory.GroupAction.ConjAct -import Mathlib.GroupTheory.GroupAction.Defs -import Mathlib.GroupTheory.GroupAction.DomAct.ActionHom -import Mathlib.GroupTheory.GroupAction.DomAct.Basic -import Mathlib.GroupTheory.GroupAction.Embedding -import Mathlib.GroupTheory.GroupAction.FixedPoints -import Mathlib.GroupTheory.GroupAction.FixingSubgroup -import Mathlib.GroupTheory.GroupAction.Hom -import Mathlib.GroupTheory.GroupAction.IterateAct -import Mathlib.GroupTheory.GroupAction.Iwasawa -import Mathlib.GroupTheory.GroupAction.Jordan -import Mathlib.GroupTheory.GroupAction.MultiplePrimitivity -import Mathlib.GroupTheory.GroupAction.MultipleTransitivity -import Mathlib.GroupTheory.GroupAction.Period -import Mathlib.GroupTheory.GroupAction.Pointwise -import Mathlib.GroupTheory.GroupAction.Primitive -import Mathlib.GroupTheory.GroupAction.Quotient -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.GroupTheory.GroupAction.SubMulAction.Closure -import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup -import Mathlib.GroupTheory.GroupAction.SubMulAction.OfStabilizer -import Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise -import Mathlib.GroupTheory.GroupAction.Support -import Mathlib.GroupTheory.GroupAction.Transitive -import Mathlib.GroupTheory.GroupExtension.Basic -import Mathlib.GroupTheory.GroupExtension.Defs -import Mathlib.GroupTheory.HNNExtension -import Mathlib.GroupTheory.Index -import Mathlib.GroupTheory.IndexNormal -import Mathlib.GroupTheory.MonoidLocalization.Away -import Mathlib.GroupTheory.MonoidLocalization.Basic -import Mathlib.GroupTheory.MonoidLocalization.Cardinality -import Mathlib.GroupTheory.MonoidLocalization.DivPairs -import Mathlib.GroupTheory.MonoidLocalization.Finite -import Mathlib.GroupTheory.MonoidLocalization.GrothendieckGroup -import Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero -import Mathlib.GroupTheory.MonoidLocalization.Order -import Mathlib.GroupTheory.Nilpotent -import Mathlib.GroupTheory.NoncommCoprod -import Mathlib.GroupTheory.NoncommPiCoprod -import Mathlib.GroupTheory.Order.Min -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.GroupTheory.OreLocalization.Basic -import Mathlib.GroupTheory.OreLocalization.Cardinality -import Mathlib.GroupTheory.OreLocalization.OreSet -import Mathlib.GroupTheory.PGroup -import Mathlib.GroupTheory.Perm.Basic -import Mathlib.GroupTheory.Perm.Centralizer -import Mathlib.GroupTheory.Perm.Closure -import Mathlib.GroupTheory.Perm.ClosureSwap -import Mathlib.GroupTheory.Perm.ConjAct -import Mathlib.GroupTheory.Perm.Cycle.Basic -import Mathlib.GroupTheory.Perm.Cycle.Concrete -import Mathlib.GroupTheory.Perm.Cycle.Factors -import Mathlib.GroupTheory.Perm.Cycle.PossibleTypes -import Mathlib.GroupTheory.Perm.Cycle.Type -import Mathlib.GroupTheory.Perm.DomMulAct -import Mathlib.GroupTheory.Perm.Fin -import Mathlib.GroupTheory.Perm.Finite -import Mathlib.GroupTheory.Perm.List -import Mathlib.GroupTheory.Perm.MaximalSubgroups -import Mathlib.GroupTheory.Perm.Option -import Mathlib.GroupTheory.Perm.Sign -import Mathlib.GroupTheory.Perm.Subgroup -import Mathlib.GroupTheory.Perm.Support -import Mathlib.GroupTheory.Perm.ViaEmbedding -import Mathlib.GroupTheory.PresentedGroup -import Mathlib.GroupTheory.PushoutI -import Mathlib.GroupTheory.QuotientGroup.Basic -import Mathlib.GroupTheory.QuotientGroup.Defs -import Mathlib.GroupTheory.QuotientGroup.Finite -import Mathlib.GroupTheory.Rank -import Mathlib.GroupTheory.RegularWreathProduct -import Mathlib.GroupTheory.Schreier -import Mathlib.GroupTheory.SchurZassenhaus -import Mathlib.GroupTheory.SemidirectProduct -import Mathlib.GroupTheory.Solvable -import Mathlib.GroupTheory.SpecificGroups.Alternating -import Mathlib.GroupTheory.SpecificGroups.Alternating.Centralizer -import Mathlib.GroupTheory.SpecificGroups.Alternating.KleinFour -import Mathlib.GroupTheory.SpecificGroups.Cyclic -import Mathlib.GroupTheory.SpecificGroups.Dihedral -import Mathlib.GroupTheory.SpecificGroups.KleinFour -import Mathlib.GroupTheory.SpecificGroups.Quaternion -import Mathlib.GroupTheory.SpecificGroups.ZGroup -import Mathlib.GroupTheory.Subgroup.Center -import Mathlib.GroupTheory.Subgroup.Centralizer -import Mathlib.GroupTheory.Subgroup.Saturated -import Mathlib.GroupTheory.Subgroup.Simple -import Mathlib.GroupTheory.Submonoid.Center -import Mathlib.GroupTheory.Submonoid.Centralizer -import Mathlib.GroupTheory.Submonoid.Inverses -import Mathlib.GroupTheory.Subsemigroup.Center -import Mathlib.GroupTheory.Subsemigroup.Centralizer -import Mathlib.GroupTheory.Sylow -import Mathlib.GroupTheory.Torsion -import Mathlib.GroupTheory.Transfer -import Mathlib.InformationTheory.Hamming -import Mathlib.InformationTheory.KullbackLeibler.Basic -import Mathlib.InformationTheory.KullbackLeibler.KLFun -import Mathlib.Init -import Mathlib.Lean.ContextInfo -import Mathlib.Lean.CoreM -import Mathlib.Lean.Elab.InfoTree -import Mathlib.Lean.Elab.Tactic.Basic -import Mathlib.Lean.Elab.Tactic.Meta -import Mathlib.Lean.Elab.Term -import Mathlib.Lean.EnvExtension -import Mathlib.Lean.Exception -import Mathlib.Lean.Expr -import Mathlib.Lean.Expr.Basic -import Mathlib.Lean.Expr.ExtraRecognizers -import Mathlib.Lean.Expr.Rat -import Mathlib.Lean.Expr.ReplaceRec -import Mathlib.Lean.GoalsLocation -import Mathlib.Lean.Json -import Mathlib.Lean.LocalContext -import Mathlib.Lean.Message -import Mathlib.Lean.Meta -import Mathlib.Lean.Meta.Basic -import Mathlib.Lean.Meta.CongrTheorems -import Mathlib.Lean.Meta.DiscrTree -import Mathlib.Lean.Meta.KAbstractPositions -import Mathlib.Lean.Meta.RefinedDiscrTree -import Mathlib.Lean.Meta.RefinedDiscrTree.Basic -import Mathlib.Lean.Meta.RefinedDiscrTree.Encode -import Mathlib.Lean.Meta.RefinedDiscrTree.Initialize -import Mathlib.Lean.Meta.RefinedDiscrTree.Lookup -import Mathlib.Lean.Meta.Simp -import Mathlib.Lean.Meta.Tactic.Rewrite -import Mathlib.Lean.Name -import Mathlib.Lean.PrettyPrinter.Delaborator -import Mathlib.Lean.Thunk -import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv -import Mathlib.LinearAlgebra.AffineSpace.AffineMap -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs -import Mathlib.LinearAlgebra.AffineSpace.Basis -import Mathlib.LinearAlgebra.AffineSpace.Centroid -import Mathlib.LinearAlgebra.AffineSpace.Combination -import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv -import Mathlib.LinearAlgebra.AffineSpace.Defs -import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional -import Mathlib.LinearAlgebra.AffineSpace.Independent -import Mathlib.LinearAlgebra.AffineSpace.Matrix -import Mathlib.LinearAlgebra.AffineSpace.Midpoint -import Mathlib.LinearAlgebra.AffineSpace.MidpointZero -import Mathlib.LinearAlgebra.AffineSpace.Ordered -import Mathlib.LinearAlgebra.AffineSpace.Pointwise -import Mathlib.LinearAlgebra.AffineSpace.Restrict -import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic -import Mathlib.LinearAlgebra.AffineSpace.Simplex.Centroid -import Mathlib.LinearAlgebra.AffineSpace.Slope -import Mathlib.LinearAlgebra.Alternating.Basic -import Mathlib.LinearAlgebra.Alternating.Curry -import Mathlib.LinearAlgebra.Alternating.DomCoprod -import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin -import Mathlib.LinearAlgebra.AnnihilatingPolynomial -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Basis.Bilinear -import Mathlib.LinearAlgebra.Basis.Cardinality -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.Basis.Exact -import Mathlib.LinearAlgebra.Basis.Fin -import Mathlib.LinearAlgebra.Basis.Flag -import Mathlib.LinearAlgebra.Basis.MulOpposite -import Mathlib.LinearAlgebra.Basis.Prod -import Mathlib.LinearAlgebra.Basis.SMul -import Mathlib.LinearAlgebra.Basis.Submodule -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.BilinearForm.Basic -import Mathlib.LinearAlgebra.BilinearForm.DualLattice -import Mathlib.LinearAlgebra.BilinearForm.Hom -import Mathlib.LinearAlgebra.BilinearForm.Orthogonal -import Mathlib.LinearAlgebra.BilinearForm.Properties -import Mathlib.LinearAlgebra.BilinearForm.TensorProduct -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.Charpoly.BaseChange -import Mathlib.LinearAlgebra.Charpoly.Basic -import Mathlib.LinearAlgebra.Charpoly.ToMatrix -import Mathlib.LinearAlgebra.CliffordAlgebra.BaseChange -import Mathlib.LinearAlgebra.CliffordAlgebra.Basic -import Mathlib.LinearAlgebra.CliffordAlgebra.CategoryTheory -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation -import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction -import Mathlib.LinearAlgebra.CliffordAlgebra.Equivs -import Mathlib.LinearAlgebra.CliffordAlgebra.Even -import Mathlib.LinearAlgebra.CliffordAlgebra.EvenEquiv -import Mathlib.LinearAlgebra.CliffordAlgebra.Fold -import Mathlib.LinearAlgebra.CliffordAlgebra.Grading -import Mathlib.LinearAlgebra.CliffordAlgebra.Inversion -import Mathlib.LinearAlgebra.CliffordAlgebra.Prod -import Mathlib.LinearAlgebra.CliffordAlgebra.SpinGroup -import Mathlib.LinearAlgebra.CliffordAlgebra.Star -import Mathlib.LinearAlgebra.Coevaluation -import Mathlib.LinearAlgebra.Complex.Determinant -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.LinearAlgebra.Complex.Orientation -import Mathlib.LinearAlgebra.Contraction -import Mathlib.LinearAlgebra.Countable -import Mathlib.LinearAlgebra.CrossProduct -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Dimension.Basic -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.LinearAlgebra.Dimension.ErdosKaplansky -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.LinearAlgebra.Dimension.Finrank -import Mathlib.LinearAlgebra.Dimension.Free -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition -import Mathlib.LinearAlgebra.Dimension.LinearMap -import Mathlib.LinearAlgebra.Dimension.Localization -import Mathlib.LinearAlgebra.Dimension.RankNullity -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.Dimension.Subsingleton -import Mathlib.LinearAlgebra.Dimension.Torsion.Basic -import Mathlib.LinearAlgebra.Dimension.Torsion.Finite -import Mathlib.LinearAlgebra.DirectSum.Basis -import Mathlib.LinearAlgebra.DirectSum.Finite -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.LinearAlgebra.DirectSum.TensorProduct -import Mathlib.LinearAlgebra.Dual.Basis -import Mathlib.LinearAlgebra.Dual.Defs -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.LinearAlgebra.Eigenspace.Charpoly -import Mathlib.LinearAlgebra.Eigenspace.Matrix -import Mathlib.LinearAlgebra.Eigenspace.Minpoly -import Mathlib.LinearAlgebra.Eigenspace.Pi -import Mathlib.LinearAlgebra.Eigenspace.Semisimple -import Mathlib.LinearAlgebra.Eigenspace.Triangularizable -import Mathlib.LinearAlgebra.Eigenspace.Zero -import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic -import Mathlib.LinearAlgebra.ExteriorAlgebra.Grading -import Mathlib.LinearAlgebra.ExteriorAlgebra.OfAlternating -import Mathlib.LinearAlgebra.ExteriorPower.Basic -import Mathlib.LinearAlgebra.ExteriorPower.Pairing -import Mathlib.LinearAlgebra.FiniteDimensional.Basic -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.FiniteSpan -import Mathlib.LinearAlgebra.Finsupp.Defs -import Mathlib.LinearAlgebra.Finsupp.LSum -import Mathlib.LinearAlgebra.Finsupp.LinearCombination -import Mathlib.LinearAlgebra.Finsupp.Pi -import Mathlib.LinearAlgebra.Finsupp.Span -import Mathlib.LinearAlgebra.Finsupp.SumProd -import Mathlib.LinearAlgebra.Finsupp.Supported -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.FreeAlgebra -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.FreeModule.Determinant -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.LinearAlgebra.FreeModule.Finite.CardQuotient -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix -import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient -import Mathlib.LinearAlgebra.FreeModule.IdealQuotient -import Mathlib.LinearAlgebra.FreeModule.Int -import Mathlib.LinearAlgebra.FreeModule.ModN -import Mathlib.LinearAlgebra.FreeModule.Norm -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.FreeProduct.Basic -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.LinearAlgebra.Goursat -import Mathlib.LinearAlgebra.InvariantBasisNumber -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.LinearAlgebra.JordanChevalley -import Mathlib.LinearAlgebra.Lagrange -import Mathlib.LinearAlgebra.LinearDisjoint -import Mathlib.LinearAlgebra.LinearIndependent.Basic -import Mathlib.LinearAlgebra.LinearIndependent.Defs -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas -import Mathlib.LinearAlgebra.LinearPMap -import Mathlib.LinearAlgebra.Matrix.AbsoluteValue -import Mathlib.LinearAlgebra.Matrix.Adjugate -import Mathlib.LinearAlgebra.Matrix.BaseChange -import Mathlib.LinearAlgebra.Matrix.Basis -import Mathlib.LinearAlgebra.Matrix.BilinearForm -import Mathlib.LinearAlgebra.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.CharP -import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.LinearAlgebra.Matrix.Charpoly.Disc -import Mathlib.LinearAlgebra.Matrix.Charpoly.Eigs -import Mathlib.LinearAlgebra.Matrix.Charpoly.FiniteField -import Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap -import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly -import Mathlib.LinearAlgebra.Matrix.Charpoly.Univ -import Mathlib.LinearAlgebra.Matrix.Circulant -import Mathlib.LinearAlgebra.Matrix.ConjTranspose -import Mathlib.LinearAlgebra.Matrix.Defs -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.Determinant.Misc -import Mathlib.LinearAlgebra.Matrix.Determinant.TotallyUnimodular -import Mathlib.LinearAlgebra.Matrix.Diagonal -import Mathlib.LinearAlgebra.Matrix.DotProduct -import Mathlib.LinearAlgebra.Matrix.Dual -import Mathlib.LinearAlgebra.Matrix.FiniteDimensional -import Mathlib.LinearAlgebra.Matrix.FixedDetMatrices -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Basic -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Card -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.FinTwo -import Mathlib.LinearAlgebra.Matrix.Gershgorin -import Mathlib.LinearAlgebra.Matrix.Hadamard -import Mathlib.LinearAlgebra.Matrix.Hermitian -import Mathlib.LinearAlgebra.Matrix.HermitianFunctionalCalculus -import Mathlib.LinearAlgebra.Matrix.Ideal -import Mathlib.LinearAlgebra.Matrix.Integer -import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber -import Mathlib.LinearAlgebra.Matrix.Irreducible.Defs -import Mathlib.LinearAlgebra.Matrix.IsDiag -import Mathlib.LinearAlgebra.Matrix.Kronecker -import Mathlib.LinearAlgebra.Matrix.LDL -import Mathlib.LinearAlgebra.Matrix.MvPolynomial -import Mathlib.LinearAlgebra.Matrix.Nondegenerate -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.LinearAlgebra.Matrix.Notation -import Mathlib.LinearAlgebra.Matrix.Orthogonal -import Mathlib.LinearAlgebra.Matrix.Permanent -import Mathlib.LinearAlgebra.Matrix.Permutation -import Mathlib.LinearAlgebra.Matrix.Polynomial -import Mathlib.LinearAlgebra.Matrix.PosDef -import Mathlib.LinearAlgebra.Matrix.ProjectiveSpecialLinearGroup -import Mathlib.LinearAlgebra.Matrix.Rank -import Mathlib.LinearAlgebra.Matrix.Reindex -import Mathlib.LinearAlgebra.Matrix.RowCol -import Mathlib.LinearAlgebra.Matrix.SchurComplement -import Mathlib.LinearAlgebra.Matrix.SemiringInverse -import Mathlib.LinearAlgebra.Matrix.SesquilinearForm -import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup -import Mathlib.LinearAlgebra.Matrix.StdBasis -import Mathlib.LinearAlgebra.Matrix.Swap -import Mathlib.LinearAlgebra.Matrix.Symmetric -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv -import Mathlib.LinearAlgebra.Matrix.Trace -import Mathlib.LinearAlgebra.Matrix.Transvection -import Mathlib.LinearAlgebra.Matrix.Unique -import Mathlib.LinearAlgebra.Matrix.Vec -import Mathlib.LinearAlgebra.Matrix.ZPow -import Mathlib.LinearAlgebra.Multilinear.Basic -import Mathlib.LinearAlgebra.Multilinear.Basis -import Mathlib.LinearAlgebra.Multilinear.Curry -import Mathlib.LinearAlgebra.Multilinear.DFinsupp -import Mathlib.LinearAlgebra.Multilinear.FiniteDimensional -import Mathlib.LinearAlgebra.Multilinear.Pi -import Mathlib.LinearAlgebra.Multilinear.TensorProduct -import Mathlib.LinearAlgebra.Orientation -import Mathlib.LinearAlgebra.PID -import Mathlib.LinearAlgebra.PerfectPairing.Basic -import Mathlib.LinearAlgebra.PerfectPairing.Matrix -import Mathlib.LinearAlgebra.PerfectPairing.Restrict -import Mathlib.LinearAlgebra.Pi -import Mathlib.LinearAlgebra.PiTensorProduct -import Mathlib.LinearAlgebra.Prod -import Mathlib.LinearAlgebra.Projection -import Mathlib.LinearAlgebra.Projectivization.Action -import Mathlib.LinearAlgebra.Projectivization.Basic -import Mathlib.LinearAlgebra.Projectivization.Cardinality -import Mathlib.LinearAlgebra.Projectivization.Constructions -import Mathlib.LinearAlgebra.Projectivization.Independence -import Mathlib.LinearAlgebra.Projectivization.Subspace -import Mathlib.LinearAlgebra.QuadraticForm.Basic -import Mathlib.LinearAlgebra.QuadraticForm.Basis -import Mathlib.LinearAlgebra.QuadraticForm.Complex -import Mathlib.LinearAlgebra.QuadraticForm.Dual -import Mathlib.LinearAlgebra.QuadraticForm.Isometry -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv -import Mathlib.LinearAlgebra.QuadraticForm.Prod -import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat -import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Monoidal -import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Symmetric -import Mathlib.LinearAlgebra.QuadraticForm.Real -import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct -import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct.Isometries -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.LinearAlgebra.Quotient.Card -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.LinearAlgebra.Quotient.Pi -import Mathlib.LinearAlgebra.Ray -import Mathlib.LinearAlgebra.Reflection -import Mathlib.LinearAlgebra.RootSystem.Base -import Mathlib.LinearAlgebra.RootSystem.BaseChange -import Mathlib.LinearAlgebra.RootSystem.Basic -import Mathlib.LinearAlgebra.RootSystem.CartanMatrix -import Mathlib.LinearAlgebra.RootSystem.Chain -import Mathlib.LinearAlgebra.RootSystem.Defs -import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear -import Mathlib.LinearAlgebra.RootSystem.Finite.G2 -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas -import Mathlib.LinearAlgebra.RootSystem.Finite.Nondegenerate -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Basic -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Lemmas -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple -import Mathlib.LinearAlgebra.RootSystem.Hom -import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn -import Mathlib.LinearAlgebra.RootSystem.OfBilinear -import Mathlib.LinearAlgebra.RootSystem.Reduced -import Mathlib.LinearAlgebra.RootSystem.RootPairingCat -import Mathlib.LinearAlgebra.RootSystem.RootPositive -import Mathlib.LinearAlgebra.RootSystem.WeylGroup -import Mathlib.LinearAlgebra.SModEq -import Mathlib.LinearAlgebra.SModEq.Basic -import Mathlib.LinearAlgebra.Semisimple -import Mathlib.LinearAlgebra.SesquilinearForm -import Mathlib.LinearAlgebra.SesquilinearForm.Basic -import Mathlib.LinearAlgebra.SesquilinearForm.Star -import Mathlib.LinearAlgebra.Span.Basic -import Mathlib.LinearAlgebra.Span.Defs -import Mathlib.LinearAlgebra.StdBasis -import Mathlib.LinearAlgebra.SymmetricAlgebra.Basic -import Mathlib.LinearAlgebra.SymmetricAlgebra.Basis -import Mathlib.LinearAlgebra.SymplecticGroup -import Mathlib.LinearAlgebra.TensorAlgebra.Basic -import Mathlib.LinearAlgebra.TensorAlgebra.Basis -import Mathlib.LinearAlgebra.TensorAlgebra.Grading -import Mathlib.LinearAlgebra.TensorAlgebra.ToTensorPower -import Mathlib.LinearAlgebra.TensorPower.Basic -import Mathlib.LinearAlgebra.TensorPower.Pairing -import Mathlib.LinearAlgebra.TensorPower.Symmetric -import Mathlib.LinearAlgebra.TensorProduct.Associator -import Mathlib.LinearAlgebra.TensorProduct.Basic -import Mathlib.LinearAlgebra.TensorProduct.Basis -import Mathlib.LinearAlgebra.TensorProduct.DirectLimit -import Mathlib.LinearAlgebra.TensorProduct.Finiteness -import Mathlib.LinearAlgebra.TensorProduct.Graded.External -import Mathlib.LinearAlgebra.TensorProduct.Graded.Internal -import Mathlib.LinearAlgebra.TensorProduct.Matrix -import Mathlib.LinearAlgebra.TensorProduct.Opposite -import Mathlib.LinearAlgebra.TensorProduct.Pi -import Mathlib.LinearAlgebra.TensorProduct.Prod -import Mathlib.LinearAlgebra.TensorProduct.Quotient -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.LinearAlgebra.TensorProduct.Subalgebra -import Mathlib.LinearAlgebra.TensorProduct.Submodule -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.LinearAlgebra.TensorProduct.Vanishing -import Mathlib.LinearAlgebra.Trace -import Mathlib.LinearAlgebra.Transvection -import Mathlib.LinearAlgebra.UnitaryGroup -import Mathlib.LinearAlgebra.Vandermonde -import Mathlib.Logic.Basic -import Mathlib.Logic.Denumerable -import Mathlib.Logic.Embedding.Basic -import Mathlib.Logic.Embedding.Set -import Mathlib.Logic.Encodable.Basic -import Mathlib.Logic.Encodable.Lattice -import Mathlib.Logic.Encodable.Pi -import Mathlib.Logic.Equiv.Array -import Mathlib.Logic.Equiv.Basic -import Mathlib.Logic.Equiv.Bool -import Mathlib.Logic.Equiv.Defs -import Mathlib.Logic.Equiv.Embedding -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.Logic.Equiv.Fin.Rotate -import Mathlib.Logic.Equiv.Finset -import Mathlib.Logic.Equiv.Fintype -import Mathlib.Logic.Equiv.Functor -import Mathlib.Logic.Equiv.List -import Mathlib.Logic.Equiv.Multiset -import Mathlib.Logic.Equiv.Nat -import Mathlib.Logic.Equiv.Option -import Mathlib.Logic.Equiv.Pairwise -import Mathlib.Logic.Equiv.PartialEquiv -import Mathlib.Logic.Equiv.Prod -import Mathlib.Logic.Equiv.Set -import Mathlib.Logic.Equiv.Sum -import Mathlib.Logic.ExistsUnique -import Mathlib.Logic.Function.Basic -import Mathlib.Logic.Function.Coequalizer -import Mathlib.Logic.Function.CompTypeclasses -import Mathlib.Logic.Function.Conjugate -import Mathlib.Logic.Function.Defs -import Mathlib.Logic.Function.DependsOn -import Mathlib.Logic.Function.FiberPartition -import Mathlib.Logic.Function.FromTypes -import Mathlib.Logic.Function.Iterate -import Mathlib.Logic.Function.OfArity -import Mathlib.Logic.Function.ULift -import Mathlib.Logic.Godel.GodelBetaFunction -import Mathlib.Logic.Hydra -import Mathlib.Logic.IsEmpty -import Mathlib.Logic.Lemmas -import Mathlib.Logic.Nonempty -import Mathlib.Logic.Nontrivial.Basic -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Logic.OpClass -import Mathlib.Logic.Pairwise -import Mathlib.Logic.Relation -import Mathlib.Logic.Relator -import Mathlib.Logic.Small.Basic -import Mathlib.Logic.Small.Defs -import Mathlib.Logic.Small.List -import Mathlib.Logic.Small.Set -import Mathlib.Logic.Unique -import Mathlib.Logic.UnivLE -import Mathlib.MeasureTheory.Category.MeasCat -import Mathlib.MeasureTheory.Constructions.AddChar -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex -import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order -import Mathlib.MeasureTheory.Constructions.BorelSpace.Real -import Mathlib.MeasureTheory.Constructions.BorelSpace.WithTop -import Mathlib.MeasureTheory.Constructions.ClosedCompactCylinders -import Mathlib.MeasureTheory.Constructions.Cylinders -import Mathlib.MeasureTheory.Constructions.HaarToSphere -import Mathlib.MeasureTheory.Constructions.Pi -import Mathlib.MeasureTheory.Constructions.Polish.Basic -import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal -import Mathlib.MeasureTheory.Constructions.Polish.StronglyMeasurable -import Mathlib.MeasureTheory.Constructions.Projective -import Mathlib.MeasureTheory.Constructions.ProjectiveFamilyContent -import Mathlib.MeasureTheory.Constructions.SubmoduleQuotient -import Mathlib.MeasureTheory.Constructions.UnitInterval -import Mathlib.MeasureTheory.Covering.Besicovitch -import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace -import Mathlib.MeasureTheory.Covering.DensityTheorem -import Mathlib.MeasureTheory.Covering.Differentiation -import Mathlib.MeasureTheory.Covering.LiminfLimsup -import Mathlib.MeasureTheory.Covering.OneDim -import Mathlib.MeasureTheory.Covering.Vitali -import Mathlib.MeasureTheory.Covering.VitaliFamily -import Mathlib.MeasureTheory.Function.AEEqFun -import Mathlib.MeasureTheory.Function.AEEqFun.DomAct -import Mathlib.MeasureTheory.Function.AEEqOfIntegral -import Mathlib.MeasureTheory.Function.AEEqOfLIntegral -import Mathlib.MeasureTheory.Function.AEMeasurableOrder -import Mathlib.MeasureTheory.Function.AEMeasurableSequence -import Mathlib.MeasureTheory.Function.AbsolutelyContinuous -import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic -import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 -import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique -import Mathlib.MeasureTheory.Function.ContinuousMapDense -import Mathlib.MeasureTheory.Function.ConvergenceInDistribution -import Mathlib.MeasureTheory.Function.ConvergenceInMeasure -import Mathlib.MeasureTheory.Function.Egorov -import Mathlib.MeasureTheory.Function.EssSup -import Mathlib.MeasureTheory.Function.FactorsThrough -import Mathlib.MeasureTheory.Function.Floor -import Mathlib.MeasureTheory.Function.Holder -import Mathlib.MeasureTheory.Function.Intersectivity -import Mathlib.MeasureTheory.Function.Jacobian -import Mathlib.MeasureTheory.Function.JacobianOneDim -import Mathlib.MeasureTheory.Function.L1Space.AEEqFun -import Mathlib.MeasureTheory.Function.L1Space.HasFiniteIntegral -import Mathlib.MeasureTheory.Function.L1Space.Integrable -import Mathlib.MeasureTheory.Function.L2Space -import Mathlib.MeasureTheory.Function.LocallyIntegrable -import Mathlib.MeasureTheory.Function.LpOrder -import Mathlib.MeasureTheory.Function.LpSeminorm.Basic -import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov -import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp -import Mathlib.MeasureTheory.Function.LpSeminorm.Defs -import Mathlib.MeasureTheory.Function.LpSeminorm.Prod -import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality -import Mathlib.MeasureTheory.Function.LpSeminorm.Trim -import Mathlib.MeasureTheory.Function.LpSpace.Basic -import Mathlib.MeasureTheory.Function.LpSpace.Complete -import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving -import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions -import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic -import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Continuous -import Mathlib.MeasureTheory.Function.LpSpace.Indicator -import Mathlib.MeasureTheory.Function.SimpleFunc -import Mathlib.MeasureTheory.Function.SimpleFuncDense -import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp -import Mathlib.MeasureTheory.Function.SpecialFunctions.Arctan -import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic -import Mathlib.MeasureTheory.Function.SpecialFunctions.Inner -import Mathlib.MeasureTheory.Function.SpecialFunctions.RCLike -import Mathlib.MeasureTheory.Function.SpecialFunctions.Sinc -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic -import Mathlib.MeasureTheory.Function.StronglyMeasurable.ENNReal -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp -import Mathlib.MeasureTheory.Function.UnifTight -import Mathlib.MeasureTheory.Function.UniformIntegrable -import Mathlib.MeasureTheory.Group.AEStabilizer -import Mathlib.MeasureTheory.Group.Action -import Mathlib.MeasureTheory.Group.AddCircle -import Mathlib.MeasureTheory.Group.Arithmetic -import Mathlib.MeasureTheory.Group.Convolution -import Mathlib.MeasureTheory.Group.Defs -import Mathlib.MeasureTheory.Group.FundamentalDomain -import Mathlib.MeasureTheory.Group.GeometryOfNumbers -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Group.IntegralConvolution -import Mathlib.MeasureTheory.Group.LIntegral -import Mathlib.MeasureTheory.Group.MeasurableEquiv -import Mathlib.MeasureTheory.Group.Measure -import Mathlib.MeasureTheory.Group.ModularCharacter -import Mathlib.MeasureTheory.Group.Pointwise -import Mathlib.MeasureTheory.Group.Prod -import Mathlib.MeasureTheory.Integral.Asymptotics -import Mathlib.MeasureTheory.Integral.Average -import Mathlib.MeasureTheory.Integral.Bochner -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.MeasureTheory.Integral.Bochner.FundThmCalculus -import Mathlib.MeasureTheory.Integral.Bochner.L1 -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory -import Mathlib.MeasureTheory.Integral.BochnerL1 -import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction -import Mathlib.MeasureTheory.Integral.CircleAverage -import Mathlib.MeasureTheory.Integral.CircleIntegral -import Mathlib.MeasureTheory.Integral.CircleTransform -import Mathlib.MeasureTheory.Integral.CompactlySupported -import Mathlib.MeasureTheory.Integral.CurveIntegral.Basic -import Mathlib.MeasureTheory.Integral.DivergenceTheorem -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.MeasureTheory.Integral.ExpDecay -import Mathlib.MeasureTheory.Integral.FinMeasAdditive -import Mathlib.MeasureTheory.Integral.FundThmCalculus -import Mathlib.MeasureTheory.Integral.Gamma -import Mathlib.MeasureTheory.Integral.Indicator -import Mathlib.MeasureTheory.Integral.IntegrableOn -import Mathlib.MeasureTheory.Integral.IntegralEqImproper -import Mathlib.MeasureTheory.Integral.IntegrationByParts -import Mathlib.MeasureTheory.Integral.IntervalAverage -import Mathlib.MeasureTheory.Integral.IntervalIntegral -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.MeasureTheory.Integral.IntervalIntegral.ContDiff -import Mathlib.MeasureTheory.Integral.IntervalIntegral.DerivIntegrable -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus -import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts -import Mathlib.MeasureTheory.Integral.IntervalIntegral.LebesgueDifferentiationThm -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Slope -import Mathlib.MeasureTheory.Integral.IntervalIntegral.TrapezoidalRule -import Mathlib.MeasureTheory.Integral.Layercake -import Mathlib.MeasureTheory.Integral.Lebesgue -import Mathlib.MeasureTheory.Integral.Lebesgue.Add -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic -import Mathlib.MeasureTheory.Integral.Lebesgue.Countable -import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence -import Mathlib.MeasureTheory.Integral.Lebesgue.Map -import Mathlib.MeasureTheory.Integral.Lebesgue.Markov -import Mathlib.MeasureTheory.Integral.Lebesgue.MeasurePreserving -import Mathlib.MeasureTheory.Integral.Lebesgue.Norm -import Mathlib.MeasureTheory.Integral.Lebesgue.Sub -import Mathlib.MeasureTheory.Integral.LebesgueNormedSpace -import Mathlib.MeasureTheory.Integral.Marginal -import Mathlib.MeasureTheory.Integral.MeanInequalities -import Mathlib.MeasureTheory.Integral.PeakFunction -import Mathlib.MeasureTheory.Integral.Periodic -import Mathlib.MeasureTheory.Integral.Pi -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic -import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.NNReal -import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real -import Mathlib.MeasureTheory.Integral.SetIntegral -import Mathlib.MeasureTheory.Integral.SetToL1 -import Mathlib.MeasureTheory.Integral.TorusIntegral -import Mathlib.MeasureTheory.Integral.VitaliCaratheodory -import Mathlib.MeasureTheory.MeasurableSpace.Basic -import Mathlib.MeasureTheory.MeasurableSpace.Card -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated -import Mathlib.MeasureTheory.MeasurableSpace.Defs -import Mathlib.MeasureTheory.MeasurableSpace.Embedding -import Mathlib.MeasureTheory.MeasurableSpace.EventuallyMeasurable -import Mathlib.MeasureTheory.MeasurableSpace.Instances -import Mathlib.MeasureTheory.MeasurableSpace.Invariants -import Mathlib.MeasureTheory.MeasurableSpace.MeasurablyGenerated -import Mathlib.MeasureTheory.MeasurableSpace.NCard -import Mathlib.MeasureTheory.MeasurableSpace.Pi -import Mathlib.MeasureTheory.MeasurableSpace.PreorderRestrict -import Mathlib.MeasureTheory.MeasurableSpace.Prod -import Mathlib.MeasureTheory.Measure.AEDisjoint -import Mathlib.MeasureTheory.Measure.AEMeasurable -import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous -import Mathlib.MeasureTheory.Measure.AddContent -import Mathlib.MeasureTheory.Measure.CharacteristicFunction -import Mathlib.MeasureTheory.Measure.Comap -import Mathlib.MeasureTheory.Measure.Complex -import Mathlib.MeasureTheory.Measure.Content -import Mathlib.MeasureTheory.Measure.ContinuousPreimage -import Mathlib.MeasureTheory.Measure.Count -import Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion -import Mathlib.MeasureTheory.Measure.Decomposition.Hahn -import Mathlib.MeasureTheory.Measure.Decomposition.IntegralRNDeriv -import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -import Mathlib.MeasureTheory.Measure.Dirac -import Mathlib.MeasureTheory.Measure.DiracProba -import Mathlib.MeasureTheory.Measure.Doubling -import Mathlib.MeasureTheory.Measure.EverywherePos -import Mathlib.MeasureTheory.Measure.FiniteMeasure -import Mathlib.MeasureTheory.Measure.FiniteMeasureExt -import Mathlib.MeasureTheory.Measure.FiniteMeasurePi -import Mathlib.MeasureTheory.Measure.FiniteMeasureProd -import Mathlib.MeasureTheory.Measure.GiryMonad -import Mathlib.MeasureTheory.Measure.Haar.Basic -import Mathlib.MeasureTheory.Measure.Haar.Disintegration -import Mathlib.MeasureTheory.Measure.Haar.DistribChar -import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace -import Mathlib.MeasureTheory.Measure.Haar.MulEquivHaarChar -import Mathlib.MeasureTheory.Measure.Haar.NormedSpace -import Mathlib.MeasureTheory.Measure.Haar.OfBasis -import Mathlib.MeasureTheory.Measure.Haar.Quotient -import Mathlib.MeasureTheory.Measure.Haar.Unique -import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed -import Mathlib.MeasureTheory.Measure.HasOuterApproxClosedProd -import Mathlib.MeasureTheory.Measure.Hausdorff -import Mathlib.MeasureTheory.Measure.IntegralCharFun -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic -import Mathlib.MeasureTheory.Measure.Lebesgue.Complex -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.MeasureTheory.Measure.Lebesgue.Integral -import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls -import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric -import Mathlib.MeasureTheory.Measure.LogLikelihoodRatio -import Mathlib.MeasureTheory.Measure.Map -import Mathlib.MeasureTheory.Measure.MeasureSpace -import Mathlib.MeasureTheory.Measure.MeasureSpaceDef -import Mathlib.MeasureTheory.Measure.MutuallySingular -import Mathlib.MeasureTheory.Measure.NullMeasurable -import Mathlib.MeasureTheory.Measure.OpenPos -import Mathlib.MeasureTheory.Measure.Portmanteau -import Mathlib.MeasureTheory.Measure.ProbabilityMeasure -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving -import Mathlib.MeasureTheory.Measure.Real -import Mathlib.MeasureTheory.Measure.Regular -import Mathlib.MeasureTheory.Measure.RegularityCompacts -import Mathlib.MeasureTheory.Measure.Restrict -import Mathlib.MeasureTheory.Measure.SeparableMeasure -import Mathlib.MeasureTheory.Measure.Stieltjes -import Mathlib.MeasureTheory.Measure.Sub -import Mathlib.MeasureTheory.Measure.Support -import Mathlib.MeasureTheory.Measure.Tight -import Mathlib.MeasureTheory.Measure.TightNormed -import Mathlib.MeasureTheory.Measure.Tilted -import Mathlib.MeasureTheory.Measure.Trim -import Mathlib.MeasureTheory.Measure.Typeclasses -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite -import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability -import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite -import Mathlib.MeasureTheory.Measure.WithDensity -import Mathlib.MeasureTheory.Measure.WithDensityFinite -import Mathlib.MeasureTheory.Order.Group.Lattice -import Mathlib.MeasureTheory.Order.Lattice -import Mathlib.MeasureTheory.Order.UpperLower -import Mathlib.MeasureTheory.OuterMeasure.AE -import Mathlib.MeasureTheory.OuterMeasure.Basic -import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli -import Mathlib.MeasureTheory.OuterMeasure.Caratheodory -import Mathlib.MeasureTheory.OuterMeasure.Defs -import Mathlib.MeasureTheory.OuterMeasure.Induced -import Mathlib.MeasureTheory.OuterMeasure.OfAddContent -import Mathlib.MeasureTheory.OuterMeasure.OfFunction -import Mathlib.MeasureTheory.OuterMeasure.Operations -import Mathlib.MeasureTheory.PiSystem -import Mathlib.MeasureTheory.SetAlgebra -import Mathlib.MeasureTheory.SetSemiring -import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMap -import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMapZero -import Mathlib.MeasureTheory.SpecificCodomains.Pi -import Mathlib.MeasureTheory.SpecificCodomains.WithLp -import Mathlib.MeasureTheory.Topology -import Mathlib.MeasureTheory.VectorMeasure.Basic -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Hahn -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.JordanSub -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Lebesgue -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym -import Mathlib.MeasureTheory.VectorMeasure.WithDensity -import Mathlib.ModelTheory.Algebra.Field.Basic -import Mathlib.ModelTheory.Algebra.Field.CharP -import Mathlib.ModelTheory.Algebra.Field.IsAlgClosed -import Mathlib.ModelTheory.Algebra.Ring.Basic -import Mathlib.ModelTheory.Algebra.Ring.Definability -import Mathlib.ModelTheory.Algebra.Ring.FreeCommRing -import Mathlib.ModelTheory.Arithmetic.Presburger.Basic -import Mathlib.ModelTheory.Arithmetic.Presburger.Semilinear.Defs -import Mathlib.ModelTheory.Basic -import Mathlib.ModelTheory.Bundled -import Mathlib.ModelTheory.Complexity -import Mathlib.ModelTheory.Definability -import Mathlib.ModelTheory.DirectLimit -import Mathlib.ModelTheory.ElementaryMaps -import Mathlib.ModelTheory.ElementarySubstructures -import Mathlib.ModelTheory.Encoding -import Mathlib.ModelTheory.Equivalence -import Mathlib.ModelTheory.FinitelyGenerated -import Mathlib.ModelTheory.Fraisse -import Mathlib.ModelTheory.Graph -import Mathlib.ModelTheory.LanguageMap -import Mathlib.ModelTheory.Order -import Mathlib.ModelTheory.PartialEquiv -import Mathlib.ModelTheory.Quotients -import Mathlib.ModelTheory.Satisfiability -import Mathlib.ModelTheory.Semantics -import Mathlib.ModelTheory.Skolem -import Mathlib.ModelTheory.Substructures -import Mathlib.ModelTheory.Syntax -import Mathlib.ModelTheory.Types -import Mathlib.ModelTheory.Ultraproducts -import Mathlib.NumberTheory.ADEInequality -import Mathlib.NumberTheory.AbelSummation -import Mathlib.NumberTheory.ArithmeticFunction -import Mathlib.NumberTheory.Basic -import Mathlib.NumberTheory.Bernoulli -import Mathlib.NumberTheory.BernoulliPolynomials -import Mathlib.NumberTheory.Bertrand -import Mathlib.NumberTheory.ClassNumber.AdmissibleAbs -import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue -import Mathlib.NumberTheory.ClassNumber.AdmissibleCardPowDegree -import Mathlib.NumberTheory.ClassNumber.Finite -import Mathlib.NumberTheory.ClassNumber.FunctionField -import Mathlib.NumberTheory.Cyclotomic.Basic -import Mathlib.NumberTheory.Cyclotomic.CyclotomicCharacter -import Mathlib.NumberTheory.Cyclotomic.Discriminant -import Mathlib.NumberTheory.Cyclotomic.Embeddings -import Mathlib.NumberTheory.Cyclotomic.Gal -import Mathlib.NumberTheory.Cyclotomic.PID -import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots -import Mathlib.NumberTheory.Cyclotomic.Rat -import Mathlib.NumberTheory.Cyclotomic.Three -import Mathlib.NumberTheory.Dioph -import Mathlib.NumberTheory.DiophantineApproximation.Basic -import Mathlib.NumberTheory.DiophantineApproximation.ContinuedFractions -import Mathlib.NumberTheory.DirichletCharacter.Basic -import Mathlib.NumberTheory.DirichletCharacter.Bounds -import Mathlib.NumberTheory.DirichletCharacter.GaussSum -import Mathlib.NumberTheory.DirichletCharacter.Orthogonality -import Mathlib.NumberTheory.Divisors -import Mathlib.NumberTheory.EllipticDivisibilitySequence -import Mathlib.NumberTheory.EulerProduct.Basic -import Mathlib.NumberTheory.EulerProduct.DirichletLSeries -import Mathlib.NumberTheory.EulerProduct.ExpLog -import Mathlib.NumberTheory.FLT.Basic -import Mathlib.NumberTheory.FLT.Four -import Mathlib.NumberTheory.FLT.MasonStothers -import Mathlib.NumberTheory.FLT.Polynomial -import Mathlib.NumberTheory.FLT.Three -import Mathlib.NumberTheory.FactorisationProperties -import Mathlib.NumberTheory.Fermat -import Mathlib.NumberTheory.FermatPsp -import Mathlib.NumberTheory.FrobeniusNumber -import Mathlib.NumberTheory.FunctionField -import Mathlib.NumberTheory.GaussSum -import Mathlib.NumberTheory.Harmonic.Bounds -import Mathlib.NumberTheory.Harmonic.Defs -import Mathlib.NumberTheory.Harmonic.EulerMascheroni -import Mathlib.NumberTheory.Harmonic.GammaDeriv -import Mathlib.NumberTheory.Harmonic.Int -import Mathlib.NumberTheory.Harmonic.ZetaAsymp -import Mathlib.NumberTheory.JacobiSum.Basic -import Mathlib.NumberTheory.KummerDedekind -import Mathlib.NumberTheory.LSeries.AbstractFuncEq -import Mathlib.NumberTheory.LSeries.Basic -import Mathlib.NumberTheory.LSeries.Convergence -import Mathlib.NumberTheory.LSeries.Convolution -import Mathlib.NumberTheory.LSeries.Deriv -import Mathlib.NumberTheory.LSeries.Dirichlet -import Mathlib.NumberTheory.LSeries.DirichletContinuation -import Mathlib.NumberTheory.LSeries.HurwitzZeta -import Mathlib.NumberTheory.LSeries.HurwitzZetaEven -import Mathlib.NumberTheory.LSeries.HurwitzZetaOdd -import Mathlib.NumberTheory.LSeries.HurwitzZetaValues -import Mathlib.NumberTheory.LSeries.Injectivity -import Mathlib.NumberTheory.LSeries.Linearity -import Mathlib.NumberTheory.LSeries.MellinEqDirichlet -import Mathlib.NumberTheory.LSeries.Nonvanishing -import Mathlib.NumberTheory.LSeries.Positivity -import Mathlib.NumberTheory.LSeries.PrimesInAP -import Mathlib.NumberTheory.LSeries.RiemannZeta -import Mathlib.NumberTheory.LSeries.SumCoeff -import Mathlib.NumberTheory.LSeries.ZMod -import Mathlib.NumberTheory.LegendreSymbol.AddCharacter -import Mathlib.NumberTheory.LegendreSymbol.Basic -import Mathlib.NumberTheory.LegendreSymbol.GaussEisensteinLemmas -import Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol -import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic -import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum -import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity -import Mathlib.NumberTheory.LegendreSymbol.ZModChar -import Mathlib.NumberTheory.LocalField.Basic -import Mathlib.NumberTheory.LucasLehmer -import Mathlib.NumberTheory.LucasPrimality -import Mathlib.NumberTheory.MaricaSchoenheim -import Mathlib.NumberTheory.Modular -import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups -import Mathlib.NumberTheory.ModularForms.Basic -import Mathlib.NumberTheory.ModularForms.BoundedAtCusp -import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups -import Mathlib.NumberTheory.ModularForms.Cusps -import Mathlib.NumberTheory.ModularForms.DedekindEta -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Basic -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.IsBoundedAtImInfty -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.MDifferentiable -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.QExpansion -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.UniformConvergence -import Mathlib.NumberTheory.ModularForms.Identities -import Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds -import Mathlib.NumberTheory.ModularForms.JacobiTheta.Manifold -import Mathlib.NumberTheory.ModularForms.JacobiTheta.OneVariable -import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable -import Mathlib.NumberTheory.ModularForms.LevelOne -import Mathlib.NumberTheory.ModularForms.Petersson -import Mathlib.NumberTheory.ModularForms.QExpansion -import Mathlib.NumberTheory.ModularForms.SlashActions -import Mathlib.NumberTheory.ModularForms.SlashInvariantForms -import Mathlib.NumberTheory.MulChar.Basic -import Mathlib.NumberTheory.MulChar.Duality -import Mathlib.NumberTheory.MulChar.Lemmas -import Mathlib.NumberTheory.Multiplicity -import Mathlib.NumberTheory.Niven -import Mathlib.NumberTheory.NumberField.AdeleRing -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.NumberTheory.NumberField.CMField -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCone -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.PolarCoord -import Mathlib.NumberTheory.NumberField.ClassNumber -import Mathlib.NumberTheory.NumberField.Completion -import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic -import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings -import Mathlib.NumberTheory.NumberField.Cyclotomic.Ideal -import Mathlib.NumberTheory.NumberField.Cyclotomic.PID -import Mathlib.NumberTheory.NumberField.Cyclotomic.Three -import Mathlib.NumberTheory.NumberField.DedekindZeta -import Mathlib.NumberTheory.NumberField.Discriminant.Basic -import Mathlib.NumberTheory.NumberField.Discriminant.Defs -import Mathlib.NumberTheory.NumberField.Discriminant.Different -import Mathlib.NumberTheory.NumberField.Embeddings -import Mathlib.NumberTheory.NumberField.EquivReindex -import Mathlib.NumberTheory.NumberField.FinitePlaces -import Mathlib.NumberTheory.NumberField.FractionalIdeal -import Mathlib.NumberTheory.NumberField.House -import Mathlib.NumberTheory.NumberField.Ideal -import Mathlib.NumberTheory.NumberField.Ideal.Asymptotics -import Mathlib.NumberTheory.NumberField.Ideal.Basic -import Mathlib.NumberTheory.NumberField.Ideal.KummerDedekind -import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic -import Mathlib.NumberTheory.NumberField.InfinitePlace.Completion -import Mathlib.NumberTheory.NumberField.InfinitePlace.Embeddings -import Mathlib.NumberTheory.NumberField.InfinitePlace.Ramification -import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex -import Mathlib.NumberTheory.NumberField.Norm -import Mathlib.NumberTheory.NumberField.ProductFormula -import Mathlib.NumberTheory.NumberField.Units.Basic -import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem -import Mathlib.NumberTheory.NumberField.Units.Regulator -import Mathlib.NumberTheory.Ostrowski -import Mathlib.NumberTheory.Padics.AddChar -import Mathlib.NumberTheory.Padics.Complex -import Mathlib.NumberTheory.Padics.Hensel -import Mathlib.NumberTheory.Padics.MahlerBasis -import Mathlib.NumberTheory.Padics.PadicIntegers -import Mathlib.NumberTheory.Padics.PadicNorm -import Mathlib.NumberTheory.Padics.PadicNumbers -import Mathlib.NumberTheory.Padics.PadicVal.Basic -import Mathlib.NumberTheory.Padics.PadicVal.Defs -import Mathlib.NumberTheory.Padics.ProperSpace -import Mathlib.NumberTheory.Padics.RingHoms -import Mathlib.NumberTheory.Padics.ValuativeRel -import Mathlib.NumberTheory.Padics.WithVal -import Mathlib.NumberTheory.Pell -import Mathlib.NumberTheory.PellMatiyasevic -import Mathlib.NumberTheory.PowModTotient -import Mathlib.NumberTheory.PrimeCounting -import Mathlib.NumberTheory.PrimesCongruentOne -import Mathlib.NumberTheory.Primorial -import Mathlib.NumberTheory.PythagoreanTriples -import Mathlib.NumberTheory.RamificationInertia.Basic -import Mathlib.NumberTheory.RamificationInertia.Galois -import Mathlib.NumberTheory.RamificationInertia.Unramified -import Mathlib.NumberTheory.Rayleigh -import Mathlib.NumberTheory.Real.GoldenRatio -import Mathlib.NumberTheory.Real.Irrational -import Mathlib.NumberTheory.SelbergSieve -import Mathlib.NumberTheory.SiegelsLemma -import Mathlib.NumberTheory.SmoothNumbers -import Mathlib.NumberTheory.SumFourSquares -import Mathlib.NumberTheory.SumPrimeReciprocals -import Mathlib.NumberTheory.SumTwoSquares -import Mathlib.NumberTheory.Transcendental.Lindemann.AnalyticalPart -import Mathlib.NumberTheory.Transcendental.Liouville.Basic -import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleNumber -import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleWith -import Mathlib.NumberTheory.Transcendental.Liouville.Measure -import Mathlib.NumberTheory.Transcendental.Liouville.Residual -import Mathlib.NumberTheory.TsumDivsorsAntidiagonal -import Mathlib.NumberTheory.VonMangoldt -import Mathlib.NumberTheory.WellApproximable -import Mathlib.NumberTheory.Wilson -import Mathlib.NumberTheory.ZetaValues -import Mathlib.NumberTheory.Zsqrtd.Basic -import Mathlib.NumberTheory.Zsqrtd.GaussianInt -import Mathlib.NumberTheory.Zsqrtd.QuadraticReciprocity -import Mathlib.NumberTheory.Zsqrtd.ToReal -import Mathlib.Order.Antichain -import Mathlib.Order.Antisymmetrization -import Mathlib.Order.Atoms -import Mathlib.Order.Atoms.Finite -import Mathlib.Order.Basic -import Mathlib.Order.Birkhoff -import Mathlib.Order.BooleanAlgebra -import Mathlib.Order.BooleanAlgebra.Basic -import Mathlib.Order.BooleanAlgebra.Defs -import Mathlib.Order.BooleanAlgebra.Set -import Mathlib.Order.BooleanGenerators -import Mathlib.Order.BooleanSubalgebra -import Mathlib.Order.Booleanisation -import Mathlib.Order.Bounded -import Mathlib.Order.BoundedOrder.Basic -import Mathlib.Order.BoundedOrder.Lattice -import Mathlib.Order.BoundedOrder.Monotone -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.Bounds.Defs -import Mathlib.Order.Bounds.Image -import Mathlib.Order.Bounds.Lattice -import Mathlib.Order.Bounds.OrderIso -import Mathlib.Order.BourbakiWitt -import Mathlib.Order.Category.BddDistLat -import Mathlib.Order.Category.BddLat -import Mathlib.Order.Category.BddOrd -import Mathlib.Order.Category.BoolAlg -import Mathlib.Order.Category.CompleteLat -import Mathlib.Order.Category.DistLat -import Mathlib.Order.Category.FinBddDistLat -import Mathlib.Order.Category.FinBoolAlg -import Mathlib.Order.Category.FinPartOrd -import Mathlib.Order.Category.Frm -import Mathlib.Order.Category.HeytAlg -import Mathlib.Order.Category.Lat -import Mathlib.Order.Category.LinOrd -import Mathlib.Order.Category.NonemptyFinLinOrd -import Mathlib.Order.Category.OmegaCompletePartialOrder -import Mathlib.Order.Category.PartOrd -import Mathlib.Order.Category.PartOrdEmb -import Mathlib.Order.Category.Preord -import Mathlib.Order.Category.Semilat -import Mathlib.Order.Chain -import Mathlib.Order.Circular -import Mathlib.Order.Circular.ZMod -import Mathlib.Order.Closure -import Mathlib.Order.Cofinal -import Mathlib.Order.CompactlyGenerated.Basic -import Mathlib.Order.CompactlyGenerated.Intervals -import Mathlib.Order.Comparable -import Mathlib.Order.Compare -import Mathlib.Order.CompleteBooleanAlgebra -import Mathlib.Order.CompleteLattice.Basic -import Mathlib.Order.CompleteLattice.Chain -import Mathlib.Order.CompleteLattice.Defs -import Mathlib.Order.CompleteLattice.Finset -import Mathlib.Order.CompleteLattice.Group -import Mathlib.Order.CompleteLattice.Lemmas -import Mathlib.Order.CompleteLattice.MulticoequalizerDiagram -import Mathlib.Order.CompleteLattice.SetLike -import Mathlib.Order.CompleteLatticeIntervals -import Mathlib.Order.CompletePartialOrder -import Mathlib.Order.CompleteSublattice -import Mathlib.Order.Concept -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.ConditionallyCompleteLattice.Defs -import Mathlib.Order.ConditionallyCompleteLattice.Finset -import Mathlib.Order.ConditionallyCompleteLattice.Group -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Order.Copy -import Mathlib.Order.CountableDenseLinearOrder -import Mathlib.Order.Cover -import Mathlib.Order.Defs.LinearOrder -import Mathlib.Order.Defs.PartialOrder -import Mathlib.Order.Defs.Unbundled -import Mathlib.Order.Directed -import Mathlib.Order.DirectedInverseSystem -import Mathlib.Order.Disjoint -import Mathlib.Order.Disjointed -import Mathlib.Order.Extension.Linear -import Mathlib.Order.Extension.Well -import Mathlib.Order.Filter.AtTopBot.Archimedean -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.AtTopBot.BigOperators -import Mathlib.Order.Filter.AtTopBot.CompleteLattice -import Mathlib.Order.Filter.AtTopBot.CountablyGenerated -import Mathlib.Order.Filter.AtTopBot.Defs -import Mathlib.Order.Filter.AtTopBot.Disjoint -import Mathlib.Order.Filter.AtTopBot.Field -import Mathlib.Order.Filter.AtTopBot.Finite -import Mathlib.Order.Filter.AtTopBot.Finset -import Mathlib.Order.Filter.AtTopBot.Floor -import Mathlib.Order.Filter.AtTopBot.Group -import Mathlib.Order.Filter.AtTopBot.Interval -import Mathlib.Order.Filter.AtTopBot.Map -import Mathlib.Order.Filter.AtTopBot.ModEq -import Mathlib.Order.Filter.AtTopBot.Monoid -import Mathlib.Order.Filter.AtTopBot.Prod -import Mathlib.Order.Filter.AtTopBot.Ring -import Mathlib.Order.Filter.AtTopBot.Tendsto -import Mathlib.Order.Filter.Bases.Basic -import Mathlib.Order.Filter.Bases.Finite -import Mathlib.Order.Filter.Basic -import Mathlib.Order.Filter.CardinalInter -import Mathlib.Order.Filter.Cocardinal -import Mathlib.Order.Filter.Cofinite -import Mathlib.Order.Filter.CountableInter -import Mathlib.Order.Filter.CountableSeparatingOn -import Mathlib.Order.Filter.CountablyGenerated -import Mathlib.Order.Filter.Curry -import Mathlib.Order.Filter.Defs -import Mathlib.Order.Filter.ENNReal -import Mathlib.Order.Filter.EventuallyConst -import Mathlib.Order.Filter.Extr -import Mathlib.Order.Filter.FilterProduct -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Filter.Germ.Basic -import Mathlib.Order.Filter.Germ.OrderedMonoid -import Mathlib.Order.Filter.IndicatorFunction -import Mathlib.Order.Filter.Interval -import Mathlib.Order.Filter.IsBounded -import Mathlib.Order.Filter.Ker -import Mathlib.Order.Filter.Lift -import Mathlib.Order.Filter.ListTraverse -import Mathlib.Order.Filter.Map -import Mathlib.Order.Filter.NAry -import Mathlib.Order.Filter.Partial -import Mathlib.Order.Filter.Pi -import Mathlib.Order.Filter.Pointwise -import Mathlib.Order.Filter.Prod -import Mathlib.Order.Filter.Ring -import Mathlib.Order.Filter.SmallSets -import Mathlib.Order.Filter.Subsingleton -import Mathlib.Order.Filter.Tendsto -import Mathlib.Order.Filter.Ultrafilter.Basic -import Mathlib.Order.Filter.Ultrafilter.Defs -import Mathlib.Order.Filter.ZeroAndBoundedAtFilter -import Mathlib.Order.Fin.Basic -import Mathlib.Order.Fin.Finset -import Mathlib.Order.Fin.SuccAboveOrderIso -import Mathlib.Order.Fin.Tuple -import Mathlib.Order.FixedPoints -import Mathlib.Order.GaloisConnection.Basic -import Mathlib.Order.GaloisConnection.Defs -import Mathlib.Order.GameAdd -import Mathlib.Order.Grade -import Mathlib.Order.Height -import Mathlib.Order.Heyting.Basic -import Mathlib.Order.Heyting.Boundary -import Mathlib.Order.Heyting.Hom -import Mathlib.Order.Heyting.Regular -import Mathlib.Order.Hom.Basic -import Mathlib.Order.Hom.Bounded -import Mathlib.Order.Hom.BoundedLattice -import Mathlib.Order.Hom.CompleteLattice -import Mathlib.Order.Hom.Lattice -import Mathlib.Order.Hom.Lex -import Mathlib.Order.Hom.Order -import Mathlib.Order.Hom.Set -import Mathlib.Order.Hom.WithTopBot -import Mathlib.Order.Ideal -import Mathlib.Order.InitialSeg -import Mathlib.Order.Interval.Basic -import Mathlib.Order.Interval.Finset.Basic -import Mathlib.Order.Interval.Finset.Box -import Mathlib.Order.Interval.Finset.Defs -import Mathlib.Order.Interval.Finset.DenselyOrdered -import Mathlib.Order.Interval.Finset.Fin -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Order.Interval.Finset.SuccPred -import Mathlib.Order.Interval.Lex -import Mathlib.Order.Interval.Multiset -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Order.Interval.Set.Disjoint -import Mathlib.Order.Interval.Set.Fin -import Mathlib.Order.Interval.Set.Final -import Mathlib.Order.Interval.Set.Image -import Mathlib.Order.Interval.Set.Infinite -import Mathlib.Order.Interval.Set.InitialSeg -import Mathlib.Order.Interval.Set.IsoIoo -import Mathlib.Order.Interval.Set.Limit -import Mathlib.Order.Interval.Set.LinearOrder -import Mathlib.Order.Interval.Set.Monotone -import Mathlib.Order.Interval.Set.OrdConnected -import Mathlib.Order.Interval.Set.OrdConnectedComponent -import Mathlib.Order.Interval.Set.OrdConnectedLinear -import Mathlib.Order.Interval.Set.OrderEmbedding -import Mathlib.Order.Interval.Set.OrderIso -import Mathlib.Order.Interval.Set.Pi -import Mathlib.Order.Interval.Set.ProjIcc -import Mathlib.Order.Interval.Set.SuccOrder -import Mathlib.Order.Interval.Set.SuccPred -import Mathlib.Order.Interval.Set.SurjOn -import Mathlib.Order.Interval.Set.Union -import Mathlib.Order.Interval.Set.UnorderedInterval -import Mathlib.Order.Interval.Set.WithBotTop -import Mathlib.Order.Irreducible -import Mathlib.Order.IsNormal -import Mathlib.Order.Iterate -import Mathlib.Order.JordanHolder -import Mathlib.Order.KonigLemma -import Mathlib.Order.KrullDimension -import Mathlib.Order.Lattice -import Mathlib.Order.Lattice.Congruence -import Mathlib.Order.LatticeIntervals -import Mathlib.Order.LiminfLimsup -import Mathlib.Order.Max -import Mathlib.Order.MinMax -import Mathlib.Order.Minimal -import Mathlib.Order.ModularLattice -import Mathlib.Order.Monotone.Basic -import Mathlib.Order.Monotone.Defs -import Mathlib.Order.Monotone.Extension -import Mathlib.Order.Monotone.Monovary -import Mathlib.Order.Monotone.MonovaryOrder -import Mathlib.Order.Monotone.Odd -import Mathlib.Order.Monotone.Union -import Mathlib.Order.Nat -import Mathlib.Order.Notation -import Mathlib.Order.Nucleus -import Mathlib.Order.OmegaCompletePartialOrder -import Mathlib.Order.OrdContinuous -import Mathlib.Order.OrderIsoNat -import Mathlib.Order.PFilter -import Mathlib.Order.Part -import Mathlib.Order.PartialSups -import Mathlib.Order.Partition.Basic -import Mathlib.Order.Partition.Equipartition -import Mathlib.Order.Partition.Finpartition -import Mathlib.Order.PiLex -import Mathlib.Order.Preorder.Chain -import Mathlib.Order.Preorder.Finite -import Mathlib.Order.Preorder.Finsupp -import Mathlib.Order.PrimeIdeal -import Mathlib.Order.PrimeSeparator -import Mathlib.Order.Prod.Lex.Hom -import Mathlib.Order.PropInstances -import Mathlib.Order.Radical -import Mathlib.Order.Rel.GaloisConnection -import Mathlib.Order.RelClasses -import Mathlib.Order.RelIso.Basic -import Mathlib.Order.RelIso.Set -import Mathlib.Order.RelSeries -import Mathlib.Order.Restriction -import Mathlib.Order.ScottContinuity -import Mathlib.Order.ScottContinuity.Complete -import Mathlib.Order.ScottContinuity.Prod -import Mathlib.Order.SemiconjSup -import Mathlib.Order.Set -import Mathlib.Order.SetIsMax -import Mathlib.Order.SetNotation -import Mathlib.Order.Shrink -import Mathlib.Order.Sublattice -import Mathlib.Order.Sublocale -import Mathlib.Order.SuccPred.Archimedean -import Mathlib.Order.SuccPred.Basic -import Mathlib.Order.SuccPred.CompleteLinearOrder -import Mathlib.Order.SuccPred.InitialSeg -import Mathlib.Order.SuccPred.IntervalSucc -import Mathlib.Order.SuccPred.Limit -import Mathlib.Order.SuccPred.LinearLocallyFinite -import Mathlib.Order.SuccPred.Relation -import Mathlib.Order.SuccPred.Tree -import Mathlib.Order.SuccPred.WithBot -import Mathlib.Order.SupClosed -import Mathlib.Order.SupIndep -import Mathlib.Order.SymmDiff -import Mathlib.Order.Synonym -import Mathlib.Order.TeichmullerTukey -import Mathlib.Order.TransfiniteIteration -import Mathlib.Order.TypeTags -import Mathlib.Order.ULift -import Mathlib.Order.UpperLower.Basic -import Mathlib.Order.UpperLower.Closure -import Mathlib.Order.UpperLower.CompleteLattice -import Mathlib.Order.UpperLower.Fibration -import Mathlib.Order.UpperLower.Hom -import Mathlib.Order.UpperLower.LocallyFinite -import Mathlib.Order.UpperLower.Principal -import Mathlib.Order.UpperLower.Prod -import Mathlib.Order.UpperLower.Relative -import Mathlib.Order.WellFounded -import Mathlib.Order.WellFoundedSet -import Mathlib.Order.WellQuasiOrder -import Mathlib.Order.WithBot -import Mathlib.Order.Zorn -import Mathlib.Order.ZornAtoms -import Mathlib.Probability.BorelCantelli -import Mathlib.Probability.CDF -import Mathlib.Probability.CondVar -import Mathlib.Probability.ConditionalExpectation -import Mathlib.Probability.ConditionalProbability -import Mathlib.Probability.Decision.Risk.Basic -import Mathlib.Probability.Decision.Risk.Defs -import Mathlib.Probability.Density -import Mathlib.Probability.Distributions.Beta -import Mathlib.Probability.Distributions.Exponential -import Mathlib.Probability.Distributions.Fernique -import Mathlib.Probability.Distributions.Gamma -import Mathlib.Probability.Distributions.Gaussian -import Mathlib.Probability.Distributions.Gaussian.Basic -import Mathlib.Probability.Distributions.Gaussian.Fernique -import Mathlib.Probability.Distributions.Gaussian.Real -import Mathlib.Probability.Distributions.Geometric -import Mathlib.Probability.Distributions.Pareto -import Mathlib.Probability.Distributions.Poisson -import Mathlib.Probability.Distributions.Uniform -import Mathlib.Probability.HasLaw -import Mathlib.Probability.HasLawExists -import Mathlib.Probability.IdentDistrib -import Mathlib.Probability.Independence.Basic -import Mathlib.Probability.Independence.BoundedContinuousFunction -import Mathlib.Probability.Independence.CharacteristicFunction -import Mathlib.Probability.Independence.Conditional -import Mathlib.Probability.Independence.InfinitePi -import Mathlib.Probability.Independence.Integrable -import Mathlib.Probability.Independence.Integration -import Mathlib.Probability.Independence.Kernel -import Mathlib.Probability.Independence.Process -import Mathlib.Probability.Independence.ZeroOne -import Mathlib.Probability.Integration -import Mathlib.Probability.Kernel.Basic -import Mathlib.Probability.Kernel.CompProdEqIff -import Mathlib.Probability.Kernel.Composition.AbsolutelyContinuous -import Mathlib.Probability.Kernel.Composition.Comp -import Mathlib.Probability.Kernel.Composition.CompMap -import Mathlib.Probability.Kernel.Composition.CompNotation -import Mathlib.Probability.Kernel.Composition.CompProd -import Mathlib.Probability.Kernel.Composition.IntegralCompProd -import Mathlib.Probability.Kernel.Composition.KernelLemmas -import Mathlib.Probability.Kernel.Composition.Lemmas -import Mathlib.Probability.Kernel.Composition.MapComap -import Mathlib.Probability.Kernel.Composition.MeasureComp -import Mathlib.Probability.Kernel.Composition.MeasureCompProd -import Mathlib.Probability.Kernel.Composition.ParallelComp -import Mathlib.Probability.Kernel.Composition.Prod -import Mathlib.Probability.Kernel.CondDistrib -import Mathlib.Probability.Kernel.Condexp -import Mathlib.Probability.Kernel.Defs -import Mathlib.Probability.Kernel.Disintegration.Basic -import Mathlib.Probability.Kernel.Disintegration.CDFToKernel -import Mathlib.Probability.Kernel.Disintegration.CondCDF -import Mathlib.Probability.Kernel.Disintegration.Density -import Mathlib.Probability.Kernel.Disintegration.Integral -import Mathlib.Probability.Kernel.Disintegration.MeasurableStieltjes -import Mathlib.Probability.Kernel.Disintegration.StandardBorel -import Mathlib.Probability.Kernel.Disintegration.Unique -import Mathlib.Probability.Kernel.Integral -import Mathlib.Probability.Kernel.Invariance -import Mathlib.Probability.Kernel.IonescuTulcea.Maps -import Mathlib.Probability.Kernel.IonescuTulcea.PartialTraj -import Mathlib.Probability.Kernel.IonescuTulcea.Traj -import Mathlib.Probability.Kernel.MeasurableIntegral -import Mathlib.Probability.Kernel.MeasurableLIntegral -import Mathlib.Probability.Kernel.Posterior -import Mathlib.Probability.Kernel.Proper -import Mathlib.Probability.Kernel.RadonNikodym -import Mathlib.Probability.Kernel.SetIntegral -import Mathlib.Probability.Kernel.WithDensity -import Mathlib.Probability.Martingale.Basic -import Mathlib.Probability.Martingale.BorelCantelli -import Mathlib.Probability.Martingale.Centering -import Mathlib.Probability.Martingale.Convergence -import Mathlib.Probability.Martingale.OptionalSampling -import Mathlib.Probability.Martingale.OptionalStopping -import Mathlib.Probability.Martingale.Upcrossing -import Mathlib.Probability.Moments.Basic -import Mathlib.Probability.Moments.ComplexMGF -import Mathlib.Probability.Moments.Covariance -import Mathlib.Probability.Moments.CovarianceBilin -import Mathlib.Probability.Moments.CovarianceBilinDual -import Mathlib.Probability.Moments.IntegrableExpMul -import Mathlib.Probability.Moments.MGFAnalytic -import Mathlib.Probability.Moments.SubGaussian -import Mathlib.Probability.Moments.Tilted -import Mathlib.Probability.Moments.Variance -import Mathlib.Probability.Notation -import Mathlib.Probability.ProbabilityMassFunction.Basic -import Mathlib.Probability.ProbabilityMassFunction.Binomial -import Mathlib.Probability.ProbabilityMassFunction.Constructions -import Mathlib.Probability.ProbabilityMassFunction.Integrals -import Mathlib.Probability.ProbabilityMassFunction.Monad -import Mathlib.Probability.Process.Adapted -import Mathlib.Probability.Process.Filtration -import Mathlib.Probability.Process.FiniteDimensionalLaws -import Mathlib.Probability.Process.HittingTime -import Mathlib.Probability.Process.Kolmogorov -import Mathlib.Probability.Process.PartitionFiltration -import Mathlib.Probability.Process.Predictable -import Mathlib.Probability.Process.Stopping -import Mathlib.Probability.ProductMeasure -import Mathlib.Probability.StrongLaw -import Mathlib.Probability.UniformOn -import Mathlib.Probability.Variance -import Mathlib.RepresentationTheory.Basic -import Mathlib.RepresentationTheory.Character -import Mathlib.RepresentationTheory.Coinduced -import Mathlib.RepresentationTheory.Coinvariants -import Mathlib.RepresentationTheory.FDRep -import Mathlib.RepresentationTheory.FinGroupCharZero -import Mathlib.RepresentationTheory.FiniteIndex -import Mathlib.RepresentationTheory.GroupCohomology.Basic -import Mathlib.RepresentationTheory.GroupCohomology.Functoriality -import Mathlib.RepresentationTheory.GroupCohomology.Hilbert90 -import Mathlib.RepresentationTheory.GroupCohomology.LowDegree -import Mathlib.RepresentationTheory.GroupCohomology.Resolution -import Mathlib.RepresentationTheory.Homological.FiniteCyclic -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Functoriality -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Hilbert90 -import Mathlib.RepresentationTheory.Homological.GroupCohomology.LongExactSequence -import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Shapiro -import Mathlib.RepresentationTheory.Homological.GroupHomology.Basic -import Mathlib.RepresentationTheory.Homological.GroupHomology.FiniteCyclic -import Mathlib.RepresentationTheory.Homological.GroupHomology.Functoriality -import Mathlib.RepresentationTheory.Homological.GroupHomology.LongExactSequence -import Mathlib.RepresentationTheory.Homological.GroupHomology.LowDegree -import Mathlib.RepresentationTheory.Homological.GroupHomology.Shapiro -import Mathlib.RepresentationTheory.Homological.Resolution -import Mathlib.RepresentationTheory.Induced -import Mathlib.RepresentationTheory.Invariants -import Mathlib.RepresentationTheory.Maschke -import Mathlib.RepresentationTheory.Rep -import Mathlib.RepresentationTheory.Submodule -import Mathlib.RepresentationTheory.Tannaka -import Mathlib.RingTheory.AdicCompletion.Algebra -import Mathlib.RingTheory.AdicCompletion.AsTensorProduct -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.RingTheory.AdicCompletion.Exactness -import Mathlib.RingTheory.AdicCompletion.Functoriality -import Mathlib.RingTheory.AdicCompletion.LocalRing -import Mathlib.RingTheory.AdicCompletion.Noetherian -import Mathlib.RingTheory.AdicCompletion.Topology -import Mathlib.RingTheory.Adjoin.Basic -import Mathlib.RingTheory.Adjoin.Dimension -import Mathlib.RingTheory.Adjoin.FG -import Mathlib.RingTheory.Adjoin.Field -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Adjoin.PowerBasis -import Mathlib.RingTheory.Adjoin.Tower -import Mathlib.RingTheory.AdjoinRoot -import Mathlib.RingTheory.AlgebraTower -import Mathlib.RingTheory.Algebraic.Basic -import Mathlib.RingTheory.Algebraic.Cardinality -import Mathlib.RingTheory.Algebraic.Defs -import Mathlib.RingTheory.Algebraic.Integral -import Mathlib.RingTheory.Algebraic.LinearIndependent -import Mathlib.RingTheory.Algebraic.MvPolynomial -import Mathlib.RingTheory.Algebraic.Pi -import Mathlib.RingTheory.AlgebraicIndependent.Adjoin -import Mathlib.RingTheory.AlgebraicIndependent.AlgebraicClosure -import Mathlib.RingTheory.AlgebraicIndependent.Basic -import Mathlib.RingTheory.AlgebraicIndependent.Defs -import Mathlib.RingTheory.AlgebraicIndependent.RankAndCardinality -import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis -import Mathlib.RingTheory.AlgebraicIndependent.Transcendental -import Mathlib.RingTheory.Artinian.Algebra -import Mathlib.RingTheory.Artinian.Instances -import Mathlib.RingTheory.Artinian.Module -import Mathlib.RingTheory.Artinian.Ring -import Mathlib.RingTheory.Bezout -import Mathlib.RingTheory.Bialgebra.Basic -import Mathlib.RingTheory.Bialgebra.Equiv -import Mathlib.RingTheory.Bialgebra.Hom -import Mathlib.RingTheory.Bialgebra.MonoidAlgebra -import Mathlib.RingTheory.Bialgebra.TensorProduct -import Mathlib.RingTheory.Binomial -import Mathlib.RingTheory.ChainOfDivisors -import Mathlib.RingTheory.ClassGroup -import Mathlib.RingTheory.Coalgebra.Basic -import Mathlib.RingTheory.Coalgebra.Convolution -import Mathlib.RingTheory.Coalgebra.Equiv -import Mathlib.RingTheory.Coalgebra.Hom -import Mathlib.RingTheory.Coalgebra.MonoidAlgebra -import Mathlib.RingTheory.Coalgebra.MulOpposite -import Mathlib.RingTheory.Coalgebra.TensorProduct -import Mathlib.RingTheory.Complex -import Mathlib.RingTheory.Conductor -import Mathlib.RingTheory.Congruence.Basic -import Mathlib.RingTheory.Congruence.BigOperators -import Mathlib.RingTheory.Congruence.Defs -import Mathlib.RingTheory.Congruence.Opposite -import Mathlib.RingTheory.Coprime.Basic -import Mathlib.RingTheory.Coprime.Ideal -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.CotangentLocalizationAway -import Mathlib.RingTheory.DedekindDomain.AdicValuation -import Mathlib.RingTheory.DedekindDomain.Basic -import Mathlib.RingTheory.DedekindDomain.Different -import Mathlib.RingTheory.DedekindDomain.Dvr -import Mathlib.RingTheory.DedekindDomain.Factorization -import Mathlib.RingTheory.DedekindDomain.FiniteAdeleRing -import Mathlib.RingTheory.DedekindDomain.Ideal.Basic -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas -import Mathlib.RingTheory.DedekindDomain.Instances -import Mathlib.RingTheory.DedekindDomain.IntegralClosure -import Mathlib.RingTheory.DedekindDomain.LinearDisjoint -import Mathlib.RingTheory.DedekindDomain.PID -import Mathlib.RingTheory.DedekindDomain.SInteger -import Mathlib.RingTheory.DedekindDomain.SelmerGroup -import Mathlib.RingTheory.Derivation.Basic -import Mathlib.RingTheory.Derivation.DifferentialRing -import Mathlib.RingTheory.Derivation.Lie -import Mathlib.RingTheory.Derivation.MapCoeffs -import Mathlib.RingTheory.Derivation.ToSquareZero -import Mathlib.RingTheory.DiscreteValuationRing.Basic -import Mathlib.RingTheory.DiscreteValuationRing.TFAE -import Mathlib.RingTheory.Discriminant -import Mathlib.RingTheory.DividedPowers.Basic -import Mathlib.RingTheory.DividedPowers.DPMorphism -import Mathlib.RingTheory.DividedPowers.Padic -import Mathlib.RingTheory.DividedPowers.RatAlgebra -import Mathlib.RingTheory.DividedPowers.SubDPIdeal -import Mathlib.RingTheory.DualNumber -import Mathlib.RingTheory.EisensteinCriterion -import Mathlib.RingTheory.EssentialFiniteness -import Mathlib.RingTheory.Etale.Basic -import Mathlib.RingTheory.Etale.Field -import Mathlib.RingTheory.Etale.Kaehler -import Mathlib.RingTheory.Etale.Pi -import Mathlib.RingTheory.EuclideanDomain -import Mathlib.RingTheory.Extension -import Mathlib.RingTheory.Extension.Basic -import Mathlib.RingTheory.Extension.Cotangent.Basic -import Mathlib.RingTheory.Extension.Cotangent.Free -import Mathlib.RingTheory.Extension.Cotangent.LocalizationAway -import Mathlib.RingTheory.Extension.Generators -import Mathlib.RingTheory.Extension.Presentation.Basic -import Mathlib.RingTheory.Extension.Presentation.Core -import Mathlib.RingTheory.Extension.Presentation.Submersive -import Mathlib.RingTheory.FilteredAlgebra.Basic -import Mathlib.RingTheory.Filtration -import Mathlib.RingTheory.FiniteLength -import Mathlib.RingTheory.FinitePresentation -import Mathlib.RingTheory.FiniteStability -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Finiteness.Bilinear -import Mathlib.RingTheory.Finiteness.Cardinality -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.RingTheory.Finiteness.Finsupp -import Mathlib.RingTheory.Finiteness.Ideal -import Mathlib.RingTheory.Finiteness.Lattice -import Mathlib.RingTheory.Finiteness.ModuleFinitePresentation -import Mathlib.RingTheory.Finiteness.Nakayama -import Mathlib.RingTheory.Finiteness.Nilpotent -import Mathlib.RingTheory.Finiteness.Prod -import Mathlib.RingTheory.Finiteness.Projective -import Mathlib.RingTheory.Finiteness.Quotient -import Mathlib.RingTheory.Finiteness.Small -import Mathlib.RingTheory.Finiteness.Subalgebra -import Mathlib.RingTheory.Fintype -import Mathlib.RingTheory.Flat.Basic -import Mathlib.RingTheory.Flat.CategoryTheory -import Mathlib.RingTheory.Flat.Domain -import Mathlib.RingTheory.Flat.Equalizer -import Mathlib.RingTheory.Flat.EquationalCriterion -import Mathlib.RingTheory.Flat.FaithfullyFlat.Algebra -import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic -import Mathlib.RingTheory.Flat.FaithfullyFlat.Descent -import Mathlib.RingTheory.Flat.Localization -import Mathlib.RingTheory.Flat.Stability -import Mathlib.RingTheory.Flat.Tensor -import Mathlib.RingTheory.Flat.TorsionFree -import Mathlib.RingTheory.FractionalIdeal.Basic -import Mathlib.RingTheory.FractionalIdeal.Extended -import Mathlib.RingTheory.FractionalIdeal.Inverse -import Mathlib.RingTheory.FractionalIdeal.Norm -import Mathlib.RingTheory.FractionalIdeal.Operations -import Mathlib.RingTheory.FreeCommRing -import Mathlib.RingTheory.FreeRing -import Mathlib.RingTheory.Frobenius -import Mathlib.RingTheory.Generators -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.RingTheory.GradedAlgebra.FiniteType -import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal -import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Submodule -import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Subsemiring -import Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization -import Mathlib.RingTheory.GradedAlgebra.Noetherian -import Mathlib.RingTheory.GradedAlgebra.Radical -import Mathlib.RingTheory.Grassmannian -import Mathlib.RingTheory.HahnSeries.Addition -import Mathlib.RingTheory.HahnSeries.Basic -import Mathlib.RingTheory.HahnSeries.HEval -import Mathlib.RingTheory.HahnSeries.HahnEmbedding -import Mathlib.RingTheory.HahnSeries.Lex -import Mathlib.RingTheory.HahnSeries.Multiplication -import Mathlib.RingTheory.HahnSeries.PowerSeries -import Mathlib.RingTheory.HahnSeries.Summable -import Mathlib.RingTheory.HahnSeries.Valuation -import Mathlib.RingTheory.Henselian -import Mathlib.RingTheory.HopfAlgebra.Basic -import Mathlib.RingTheory.HopfAlgebra.MonoidAlgebra -import Mathlib.RingTheory.HopfAlgebra.TensorProduct -import Mathlib.RingTheory.HopkinsLevitzki -import Mathlib.RingTheory.Ideal.AssociatedPrime -import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic -import Mathlib.RingTheory.Ideal.AssociatedPrime.Finiteness -import Mathlib.RingTheory.Ideal.AssociatedPrime.Localization -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Ideal.Basis -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.Ideal.Colon -import Mathlib.RingTheory.Ideal.Cotangent -import Mathlib.RingTheory.Ideal.Defs -import Mathlib.RingTheory.Ideal.GoingDown -import Mathlib.RingTheory.Ideal.GoingUp -import Mathlib.RingTheory.Ideal.Height -import Mathlib.RingTheory.Ideal.IdempotentFG -import Mathlib.RingTheory.Ideal.Int -import Mathlib.RingTheory.Ideal.IsPrimary -import Mathlib.RingTheory.Ideal.IsPrincipal -import Mathlib.RingTheory.Ideal.IsPrincipalPowQuotient -import Mathlib.RingTheory.Ideal.KrullsHeightTheorem -import Mathlib.RingTheory.Ideal.Lattice -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Maximal -import Mathlib.RingTheory.Ideal.MinimalPrime.Basic -import Mathlib.RingTheory.Ideal.MinimalPrime.Localization -import Mathlib.RingTheory.Ideal.NatInt -import Mathlib.RingTheory.Ideal.Nonunits -import Mathlib.RingTheory.Ideal.Norm.AbsNorm -import Mathlib.RingTheory.Ideal.Norm.RelNorm -import Mathlib.RingTheory.Ideal.Oka -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.RingTheory.Ideal.Over -import Mathlib.RingTheory.Ideal.Pointwise -import Mathlib.RingTheory.Ideal.Prime -import Mathlib.RingTheory.Ideal.Prod -import Mathlib.RingTheory.Ideal.Quotient.Basic -import Mathlib.RingTheory.Ideal.Quotient.ChineseRemainder -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.Ideal.Quotient.Index -import Mathlib.RingTheory.Ideal.Quotient.Nilpotent -import Mathlib.RingTheory.Ideal.Quotient.Noetherian -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Ideal.Quotient.PowTransition -import Mathlib.RingTheory.Ideal.Span -import Mathlib.RingTheory.Idempotents -import Mathlib.RingTheory.Int.Basic -import Mathlib.RingTheory.IntegralClosure.Algebra.Basic -import Mathlib.RingTheory.IntegralClosure.Algebra.Defs -import Mathlib.RingTheory.IntegralClosure.IntegralRestrict -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs -import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic -import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Defs -import Mathlib.RingTheory.IntegralDomain -import Mathlib.RingTheory.Invariant -import Mathlib.RingTheory.Invariant.Basic -import Mathlib.RingTheory.Invariant.Defs -import Mathlib.RingTheory.Invariant.Profinite -import Mathlib.RingTheory.IsAdjoinRoot -import Mathlib.RingTheory.IsPrimary -import Mathlib.RingTheory.IsTensorProduct -import Mathlib.RingTheory.Jacobson.Artinian -import Mathlib.RingTheory.Jacobson.Ideal -import Mathlib.RingTheory.Jacobson.Polynomial -import Mathlib.RingTheory.Jacobson.Radical -import Mathlib.RingTheory.Jacobson.Ring -import Mathlib.RingTheory.Jacobson.Semiprimary -import Mathlib.RingTheory.Kaehler.Basic -import Mathlib.RingTheory.Kaehler.CotangentComplex -import Mathlib.RingTheory.Kaehler.JacobiZariski -import Mathlib.RingTheory.Kaehler.Polynomial -import Mathlib.RingTheory.Kaehler.TensorProduct -import Mathlib.RingTheory.KrullDimension.Basic -import Mathlib.RingTheory.KrullDimension.Field -import Mathlib.RingTheory.KrullDimension.LocalRing -import Mathlib.RingTheory.KrullDimension.Module -import Mathlib.RingTheory.KrullDimension.NonZeroDivisors -import Mathlib.RingTheory.KrullDimension.PID -import Mathlib.RingTheory.KrullDimension.Polynomial -import Mathlib.RingTheory.KrullDimension.Regular -import Mathlib.RingTheory.KrullDimension.Zero -import Mathlib.RingTheory.Lasker -import Mathlib.RingTheory.LaurentSeries -import Mathlib.RingTheory.Length -import Mathlib.RingTheory.LinearDisjoint -import Mathlib.RingTheory.LittleWedderburn -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.LocalProperties.Exactness -import Mathlib.RingTheory.LocalProperties.IntegrallyClosed -import Mathlib.RingTheory.LocalProperties.Projective -import Mathlib.RingTheory.LocalProperties.Reduced -import Mathlib.RingTheory.LocalProperties.Semilocal -import Mathlib.RingTheory.LocalProperties.Submodule -import Mathlib.RingTheory.LocalRing.Basic -import Mathlib.RingTheory.LocalRing.Defs -import Mathlib.RingTheory.LocalRing.LocalSubring -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Defs -import Mathlib.RingTheory.LocalRing.Module -import Mathlib.RingTheory.LocalRing.NonLocalRing -import Mathlib.RingTheory.LocalRing.Quotient -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.LocalRing.ResidueField.Defs -import Mathlib.RingTheory.LocalRing.ResidueField.Fiber -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.LocalRing.ResidueField.Instances -import Mathlib.RingTheory.LocalRing.RingHom.Basic -import Mathlib.RingTheory.LocalRing.Subring -import Mathlib.RingTheory.Localization.Algebra -import Mathlib.RingTheory.Localization.AsSubring -import Mathlib.RingTheory.Localization.AtPrime -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.AtPrime.Extension -import Mathlib.RingTheory.Localization.Away.AdjoinRoot -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.Localization.Away.Lemmas -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Localization.Basic -import Mathlib.RingTheory.Localization.Cardinality -import Mathlib.RingTheory.Localization.Defs -import Mathlib.RingTheory.Localization.Finiteness -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Free -import Mathlib.RingTheory.Localization.Ideal -import Mathlib.RingTheory.Localization.Integer -import Mathlib.RingTheory.Localization.Integral -import Mathlib.RingTheory.Localization.InvSubmonoid -import Mathlib.RingTheory.Localization.LocalizationLocalization -import Mathlib.RingTheory.Localization.Module -import Mathlib.RingTheory.Localization.NormTrace -import Mathlib.RingTheory.Localization.NumDen -import Mathlib.RingTheory.Localization.Pi -import Mathlib.RingTheory.Localization.Submodule -import Mathlib.RingTheory.MatrixAlgebra -import Mathlib.RingTheory.MatrixPolynomialAlgebra -import Mathlib.RingTheory.Morita.Basic -import Mathlib.RingTheory.Multiplicity -import Mathlib.RingTheory.MvPolynomial -import Mathlib.RingTheory.MvPolynomial.Basic -import Mathlib.RingTheory.MvPolynomial.EulerIdentity -import Mathlib.RingTheory.MvPolynomial.FreeCommRing -import Mathlib.RingTheory.MvPolynomial.Groebner -import Mathlib.RingTheory.MvPolynomial.Homogeneous -import Mathlib.RingTheory.MvPolynomial.Ideal -import Mathlib.RingTheory.MvPolynomial.Localization -import Mathlib.RingTheory.MvPolynomial.MonomialOrder -import Mathlib.RingTheory.MvPolynomial.MonomialOrder.DegLex -import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs -import Mathlib.RingTheory.MvPolynomial.Symmetric.FundamentalTheorem -import Mathlib.RingTheory.MvPolynomial.Symmetric.NewtonIdentities -import Mathlib.RingTheory.MvPolynomial.Tower -import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous -import Mathlib.RingTheory.MvPowerSeries.Basic -import Mathlib.RingTheory.MvPowerSeries.Evaluation -import Mathlib.RingTheory.MvPowerSeries.Inverse -import Mathlib.RingTheory.MvPowerSeries.LexOrder -import Mathlib.RingTheory.MvPowerSeries.LinearTopology -import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors -import Mathlib.RingTheory.MvPowerSeries.Order -import Mathlib.RingTheory.MvPowerSeries.PiTopology -import Mathlib.RingTheory.MvPowerSeries.Substitution -import Mathlib.RingTheory.MvPowerSeries.Trunc -import Mathlib.RingTheory.Nakayama -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.RingTheory.Nilpotent.Defs -import Mathlib.RingTheory.Nilpotent.Exp -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.RingTheory.NoetherNormalization -import Mathlib.RingTheory.Noetherian.Basic -import Mathlib.RingTheory.Noetherian.Defs -import Mathlib.RingTheory.Noetherian.Filter -import Mathlib.RingTheory.Noetherian.Nilpotent -import Mathlib.RingTheory.Noetherian.OfPrime -import Mathlib.RingTheory.Noetherian.Orzech -import Mathlib.RingTheory.Noetherian.UniqueFactorizationDomain -import Mathlib.RingTheory.NonUnitalSubring.Basic -import Mathlib.RingTheory.NonUnitalSubring.Defs -import Mathlib.RingTheory.NonUnitalSubsemiring.Basic -import Mathlib.RingTheory.NonUnitalSubsemiring.Defs -import Mathlib.RingTheory.Norm.Basic -import Mathlib.RingTheory.Norm.Defs -import Mathlib.RingTheory.Norm.Transitivity -import Mathlib.RingTheory.NormTrace -import Mathlib.RingTheory.NormalClosure -import Mathlib.RingTheory.Nullstellensatz -import Mathlib.RingTheory.OrderOfVanishing -import Mathlib.RingTheory.OreLocalization.Basic -import Mathlib.RingTheory.OreLocalization.Cardinality -import Mathlib.RingTheory.OreLocalization.NonZeroDivisors -import Mathlib.RingTheory.OreLocalization.OreSet -import Mathlib.RingTheory.OreLocalization.Ring -import Mathlib.RingTheory.OrzechProperty -import Mathlib.RingTheory.Perfection -import Mathlib.RingTheory.Perfectoid.Untilt -import Mathlib.RingTheory.PiTensorProduct -import Mathlib.RingTheory.PicardGroup -import Mathlib.RingTheory.Polynomial.Basic -import Mathlib.RingTheory.Polynomial.Bernstein -import Mathlib.RingTheory.Polynomial.Chebyshev -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.Polynomial.ContentIdeal -import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic -import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval -import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand -import Mathlib.RingTheory.Polynomial.Cyclotomic.Factorization -import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots -import Mathlib.RingTheory.Polynomial.DegreeLT -import Mathlib.RingTheory.Polynomial.Dickson -import Mathlib.RingTheory.Polynomial.Eisenstein.Basic -import Mathlib.RingTheory.Polynomial.Eisenstein.Criterion -import Mathlib.RingTheory.Polynomial.Eisenstein.Distinguished -import Mathlib.RingTheory.Polynomial.Eisenstein.Generalized -import Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral -import Mathlib.RingTheory.Polynomial.GaussLemma -import Mathlib.RingTheory.Polynomial.GaussNorm -import Mathlib.RingTheory.Polynomial.Hermite.Basic -import Mathlib.RingTheory.Polynomial.Hermite.Gaussian -import Mathlib.RingTheory.Polynomial.HilbertPoly -import Mathlib.RingTheory.Polynomial.Ideal -import Mathlib.RingTheory.Polynomial.IntegralNormalization -import Mathlib.RingTheory.Polynomial.IrreducibleRing -import Mathlib.RingTheory.Polynomial.Nilpotent -import Mathlib.RingTheory.Polynomial.Opposites -import Mathlib.RingTheory.Polynomial.Pochhammer -import Mathlib.RingTheory.Polynomial.Quotient -import Mathlib.RingTheory.Polynomial.Radical -import Mathlib.RingTheory.Polynomial.RationalRoot -import Mathlib.RingTheory.Polynomial.Resultant.Basic -import Mathlib.RingTheory.Polynomial.ScaleRoots -import Mathlib.RingTheory.Polynomial.Selmer -import Mathlib.RingTheory.Polynomial.SeparableDegree -import Mathlib.RingTheory.Polynomial.ShiftedLegendre -import Mathlib.RingTheory.Polynomial.SmallDegreeVieta -import Mathlib.RingTheory.Polynomial.Tower -import Mathlib.RingTheory.Polynomial.UniqueFactorization -import Mathlib.RingTheory.Polynomial.Vieta -import Mathlib.RingTheory.Polynomial.Wronskian -import Mathlib.RingTheory.PolynomialAlgebra -import Mathlib.RingTheory.PolynomialLaw.Basic -import Mathlib.RingTheory.PowerBasis -import Mathlib.RingTheory.PowerSeries.Basic -import Mathlib.RingTheory.PowerSeries.Binomial -import Mathlib.RingTheory.PowerSeries.CoeffMulMem -import Mathlib.RingTheory.PowerSeries.Derivative -import Mathlib.RingTheory.PowerSeries.Evaluation -import Mathlib.RingTheory.PowerSeries.GaussNorm -import Mathlib.RingTheory.PowerSeries.Inverse -import Mathlib.RingTheory.PowerSeries.NoZeroDivisors -import Mathlib.RingTheory.PowerSeries.Order -import Mathlib.RingTheory.PowerSeries.PiTopology -import Mathlib.RingTheory.PowerSeries.Restricted -import Mathlib.RingTheory.PowerSeries.Substitution -import Mathlib.RingTheory.PowerSeries.Trunc -import Mathlib.RingTheory.PowerSeries.WeierstrassPreparation -import Mathlib.RingTheory.PowerSeries.WellKnown -import Mathlib.RingTheory.Presentation -import Mathlib.RingTheory.Prime -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.RingTheory.PrincipalIdealDomainOfPrime -import Mathlib.RingTheory.QuotSMulTop -import Mathlib.RingTheory.Radical -import Mathlib.RingTheory.ReesAlgebra -import Mathlib.RingTheory.Regular.Category -import Mathlib.RingTheory.Regular.Depth -import Mathlib.RingTheory.Regular.Flat -import Mathlib.RingTheory.Regular.IsSMulRegular -import Mathlib.RingTheory.Regular.RegularSequence -import Mathlib.RingTheory.RingHom.Bijective -import Mathlib.RingTheory.RingHom.Etale -import Mathlib.RingTheory.RingHom.FaithfullyFlat -import Mathlib.RingTheory.RingHom.Finite -import Mathlib.RingTheory.RingHom.FinitePresentation -import Mathlib.RingTheory.RingHom.FiniteType -import Mathlib.RingTheory.RingHom.Flat -import Mathlib.RingTheory.RingHom.Injective -import Mathlib.RingTheory.RingHom.Integral -import Mathlib.RingTheory.RingHom.Locally -import Mathlib.RingTheory.RingHom.OpenImmersion -import Mathlib.RingTheory.RingHom.Smooth -import Mathlib.RingTheory.RingHom.StandardSmooth -import Mathlib.RingTheory.RingHom.Surjective -import Mathlib.RingTheory.RingHom.Unramified -import Mathlib.RingTheory.RingHomProperties -import Mathlib.RingTheory.RingInvo -import Mathlib.RingTheory.RootsOfUnity.AlgebraicallyClosed -import Mathlib.RingTheory.RootsOfUnity.Basic -import Mathlib.RingTheory.RootsOfUnity.Complex -import Mathlib.RingTheory.RootsOfUnity.CyclotomicUnits -import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity -import Mathlib.RingTheory.RootsOfUnity.Lemmas -import Mathlib.RingTheory.RootsOfUnity.Minpoly -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots -import Mathlib.RingTheory.SimpleModule.Basic -import Mathlib.RingTheory.SimpleModule.InjectiveProjective -import Mathlib.RingTheory.SimpleModule.IsAlgClosed -import Mathlib.RingTheory.SimpleModule.Isotypic -import Mathlib.RingTheory.SimpleModule.Rank -import Mathlib.RingTheory.SimpleModule.WedderburnArtin -import Mathlib.RingTheory.SimpleRing.Basic -import Mathlib.RingTheory.SimpleRing.Congr -import Mathlib.RingTheory.SimpleRing.Defs -import Mathlib.RingTheory.SimpleRing.Field -import Mathlib.RingTheory.SimpleRing.Matrix -import Mathlib.RingTheory.SimpleRing.Principal -import Mathlib.RingTheory.Smooth.Basic -import Mathlib.RingTheory.Smooth.Kaehler -import Mathlib.RingTheory.Smooth.Local -import Mathlib.RingTheory.Smooth.Locus -import Mathlib.RingTheory.Smooth.Pi -import Mathlib.RingTheory.Smooth.StandardSmooth -import Mathlib.RingTheory.Smooth.StandardSmoothCotangent -import Mathlib.RingTheory.Spectrum.Maximal.Basic -import Mathlib.RingTheory.Spectrum.Maximal.Defs -import Mathlib.RingTheory.Spectrum.Maximal.Localization -import Mathlib.RingTheory.Spectrum.Maximal.Topology -import Mathlib.RingTheory.Spectrum.Prime.Basic -import Mathlib.RingTheory.Spectrum.Prime.Chevalley -import Mathlib.RingTheory.Spectrum.Prime.ChevalleyComplexity -import Mathlib.RingTheory.Spectrum.Prime.ConstructibleSet -import Mathlib.RingTheory.Spectrum.Prime.Defs -import Mathlib.RingTheory.Spectrum.Prime.FreeLocus -import Mathlib.RingTheory.Spectrum.Prime.Homeomorph -import Mathlib.RingTheory.Spectrum.Prime.IsOpenComapC -import Mathlib.RingTheory.Spectrum.Prime.Jacobson -import Mathlib.RingTheory.Spectrum.Prime.LTSeries -import Mathlib.RingTheory.Spectrum.Prime.Module -import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.RingTheory.Spectrum.Prime.Polynomial -import Mathlib.RingTheory.Spectrum.Prime.RingHom -import Mathlib.RingTheory.Spectrum.Prime.TensorProduct -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.RingTheory.Support -import Mathlib.RingTheory.SurjectiveOnStalks -import Mathlib.RingTheory.TensorProduct.Basic -import Mathlib.RingTheory.TensorProduct.DirectLimitFG -import Mathlib.RingTheory.TensorProduct.Finite -import Mathlib.RingTheory.TensorProduct.Free -import Mathlib.RingTheory.TensorProduct.IsBaseChangePi -import Mathlib.RingTheory.TensorProduct.Maps -import Mathlib.RingTheory.TensorProduct.MvPolynomial -import Mathlib.RingTheory.TensorProduct.Nontrivial -import Mathlib.RingTheory.TensorProduct.Pi -import Mathlib.RingTheory.TensorProduct.Quotient -import Mathlib.RingTheory.Trace.Basic -import Mathlib.RingTheory.Trace.Defs -import Mathlib.RingTheory.Trace.Quotient -import Mathlib.RingTheory.TwoSidedIdeal.Basic -import Mathlib.RingTheory.TwoSidedIdeal.BigOperators -import Mathlib.RingTheory.TwoSidedIdeal.Instances -import Mathlib.RingTheory.TwoSidedIdeal.Kernel -import Mathlib.RingTheory.TwoSidedIdeal.Lattice -import Mathlib.RingTheory.TwoSidedIdeal.Operations -import Mathlib.RingTheory.UniqueFactorizationDomain.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.Defs -import Mathlib.RingTheory.UniqueFactorizationDomain.FactorSet -import Mathlib.RingTheory.UniqueFactorizationDomain.Finite -import Mathlib.RingTheory.UniqueFactorizationDomain.Finsupp -import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid -import Mathlib.RingTheory.UniqueFactorizationDomain.Ideal -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity -import Mathlib.RingTheory.UniqueFactorizationDomain.Nat -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors -import Mathlib.RingTheory.Unramified.Basic -import Mathlib.RingTheory.Unramified.Field -import Mathlib.RingTheory.Unramified.Finite -import Mathlib.RingTheory.Unramified.LocalRing -import Mathlib.RingTheory.Unramified.Locus -import Mathlib.RingTheory.Unramified.Pi -import Mathlib.RingTheory.Valuation.AlgebraInstances -import Mathlib.RingTheory.Valuation.Archimedean -import Mathlib.RingTheory.Valuation.Basic -import Mathlib.RingTheory.Valuation.Discrete.Basic -import Mathlib.RingTheory.Valuation.DiscreteValuativeRel -import Mathlib.RingTheory.Valuation.ExtendToLocalization -import Mathlib.RingTheory.Valuation.Extension -import Mathlib.RingTheory.Valuation.Integers -import Mathlib.RingTheory.Valuation.Integral -import Mathlib.RingTheory.Valuation.IntegrallyClosed -import Mathlib.RingTheory.Valuation.LocalSubring -import Mathlib.RingTheory.Valuation.Minpoly -import Mathlib.RingTheory.Valuation.PrimeMultiplicity -import Mathlib.RingTheory.Valuation.Quotient -import Mathlib.RingTheory.Valuation.RamificationGroup -import Mathlib.RingTheory.Valuation.RankOne -import Mathlib.RingTheory.Valuation.ValExtension -import Mathlib.RingTheory.Valuation.ValuationRing -import Mathlib.RingTheory.Valuation.ValuationSubring -import Mathlib.RingTheory.Valuation.ValuativeRel -import Mathlib.RingTheory.Valuation.ValuativeRel.Basic -import Mathlib.RingTheory.Valuation.ValuativeRel.Trivial -import Mathlib.RingTheory.WittVector.Basic -import Mathlib.RingTheory.WittVector.Compare -import Mathlib.RingTheory.WittVector.Complete -import Mathlib.RingTheory.WittVector.Defs -import Mathlib.RingTheory.WittVector.DiscreteValuationRing -import Mathlib.RingTheory.WittVector.Domain -import Mathlib.RingTheory.WittVector.Frobenius -import Mathlib.RingTheory.WittVector.FrobeniusFractionField -import Mathlib.RingTheory.WittVector.Identities -import Mathlib.RingTheory.WittVector.InitTail -import Mathlib.RingTheory.WittVector.IsPoly -import Mathlib.RingTheory.WittVector.Isocrystal -import Mathlib.RingTheory.WittVector.MulCoeff -import Mathlib.RingTheory.WittVector.MulP -import Mathlib.RingTheory.WittVector.StructurePolynomial -import Mathlib.RingTheory.WittVector.Teichmuller -import Mathlib.RingTheory.WittVector.TeichmullerSeries -import Mathlib.RingTheory.WittVector.Truncated -import Mathlib.RingTheory.WittVector.Verschiebung -import Mathlib.RingTheory.WittVector.WittPolynomial -import Mathlib.RingTheory.ZMod -import Mathlib.RingTheory.ZMod.Torsion -import Mathlib.RingTheory.ZMod.UnitsCyclic -import Mathlib.SetTheory.Cardinal.Aleph -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.SetTheory.Cardinal.Basic -import Mathlib.SetTheory.Cardinal.Cofinality -import Mathlib.SetTheory.Cardinal.Continuum -import Mathlib.SetTheory.Cardinal.CountableCover -import Mathlib.SetTheory.Cardinal.Defs -import Mathlib.SetTheory.Cardinal.Divisibility -import Mathlib.SetTheory.Cardinal.ENat -import Mathlib.SetTheory.Cardinal.Embedding -import Mathlib.SetTheory.Cardinal.Finite -import Mathlib.SetTheory.Cardinal.Finsupp -import Mathlib.SetTheory.Cardinal.Free -import Mathlib.SetTheory.Cardinal.HasCardinalLT -import Mathlib.SetTheory.Cardinal.NatCount -import Mathlib.SetTheory.Cardinal.Order -import Mathlib.SetTheory.Cardinal.Ordinal -import Mathlib.SetTheory.Cardinal.Pigeonhole -import Mathlib.SetTheory.Cardinal.Regular -import Mathlib.SetTheory.Cardinal.SchroederBernstein -import Mathlib.SetTheory.Cardinal.Subfield -import Mathlib.SetTheory.Cardinal.ToNat -import Mathlib.SetTheory.Cardinal.UnivLE -import Mathlib.SetTheory.Descriptive.Tree -import Mathlib.SetTheory.Game.Basic -import Mathlib.SetTheory.Game.Birthday -import Mathlib.SetTheory.Game.Domineering -import Mathlib.SetTheory.Game.Impartial -import Mathlib.SetTheory.Game.Nim -import Mathlib.SetTheory.Game.Ordinal -import Mathlib.SetTheory.Game.Short -import Mathlib.SetTheory.Game.State -import Mathlib.SetTheory.Lists -import Mathlib.SetTheory.Nimber.Basic -import Mathlib.SetTheory.Nimber.Field -import Mathlib.SetTheory.Ordinal.Arithmetic -import Mathlib.SetTheory.Ordinal.Basic -import Mathlib.SetTheory.Ordinal.CantorNormalForm -import Mathlib.SetTheory.Ordinal.Enum -import Mathlib.SetTheory.Ordinal.Exponential -import Mathlib.SetTheory.Ordinal.Family -import Mathlib.SetTheory.Ordinal.FixedPoint -import Mathlib.SetTheory.Ordinal.FixedPointApproximants -import Mathlib.SetTheory.Ordinal.NaturalOps -import Mathlib.SetTheory.Ordinal.Notation -import Mathlib.SetTheory.Ordinal.Principal -import Mathlib.SetTheory.Ordinal.Rank -import Mathlib.SetTheory.Ordinal.Topology -import Mathlib.SetTheory.Ordinal.Veblen -import Mathlib.SetTheory.PGame.Algebra -import Mathlib.SetTheory.PGame.Basic -import Mathlib.SetTheory.PGame.Order -import Mathlib.SetTheory.Surreal.Basic -import Mathlib.SetTheory.Surreal.Dyadic -import Mathlib.SetTheory.Surreal.Multiplication -import Mathlib.SetTheory.ZFC.Basic -import Mathlib.SetTheory.ZFC.Class -import Mathlib.SetTheory.ZFC.Ordinal -import Mathlib.SetTheory.ZFC.PSet -import Mathlib.SetTheory.ZFC.Rank -import Mathlib.SetTheory.ZFC.VonNeumann -import Mathlib.Std.Data.HashMap -import Mathlib.Tactic -import Mathlib.Tactic.Abel -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.Algebraize -import Mathlib.Tactic.ApplyAt -import Mathlib.Tactic.ApplyCongr -import Mathlib.Tactic.ApplyFun -import Mathlib.Tactic.ApplyWith -import Mathlib.Tactic.ArithMult -import Mathlib.Tactic.ArithMult.Init -import Mathlib.Tactic.Attr.Core -import Mathlib.Tactic.Attr.Register -import Mathlib.Tactic.Basic -import Mathlib.Tactic.Bound -import Mathlib.Tactic.Bound.Attribute -import Mathlib.Tactic.Bound.Init -import Mathlib.Tactic.ByCases -import Mathlib.Tactic.ByContra -import Mathlib.Tactic.CC -import Mathlib.Tactic.CC.Addition -import Mathlib.Tactic.CC.Datatypes -import Mathlib.Tactic.CC.Lemmas -import Mathlib.Tactic.CC.MkProof -import Mathlib.Tactic.CancelDenoms -import Mathlib.Tactic.CancelDenoms.Core -import Mathlib.Tactic.Cases -import Mathlib.Tactic.CasesM -import Mathlib.Tactic.CategoryTheory.BicategoricalComp -import Mathlib.Tactic.CategoryTheory.Bicategory.Basic -import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes -import Mathlib.Tactic.CategoryTheory.Bicategory.Normalize -import Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence -import Mathlib.Tactic.CategoryTheory.BicategoryCoherence -import Mathlib.Tactic.CategoryTheory.CheckCompositions -import Mathlib.Tactic.CategoryTheory.Coherence -import Mathlib.Tactic.CategoryTheory.Coherence.Basic -import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes -import Mathlib.Tactic.CategoryTheory.Coherence.Normalize -import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence -import Mathlib.Tactic.CategoryTheory.Elementwise -import Mathlib.Tactic.CategoryTheory.IsoReassoc -import Mathlib.Tactic.CategoryTheory.Monoidal.Basic -import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes -import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize -import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence -import Mathlib.Tactic.CategoryTheory.MonoidalComp -import Mathlib.Tactic.CategoryTheory.Reassoc -import Mathlib.Tactic.CategoryTheory.Slice -import Mathlib.Tactic.CategoryTheory.ToApp -import Mathlib.Tactic.Change -import Mathlib.Tactic.Check -import Mathlib.Tactic.Choose -import Mathlib.Tactic.Clean -import Mathlib.Tactic.ClearExcept -import Mathlib.Tactic.ClearExclamation -import Mathlib.Tactic.Clear_ -import Mathlib.Tactic.Coe -import Mathlib.Tactic.Common -import Mathlib.Tactic.ComputeDegree -import Mathlib.Tactic.CongrExclamation -import Mathlib.Tactic.CongrM -import Mathlib.Tactic.Constructor -import Mathlib.Tactic.Continuity -import Mathlib.Tactic.Continuity.Init -import Mathlib.Tactic.ContinuousFunctionalCalculus -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Conv -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Core -import Mathlib.Tactic.DeclarationNames -import Mathlib.Tactic.DefEqTransformations -import Mathlib.Tactic.DepRewrite -import Mathlib.Tactic.DeprecateTo -import Mathlib.Tactic.DeriveCountable -import Mathlib.Tactic.DeriveEncodable -import Mathlib.Tactic.DeriveFintype -import Mathlib.Tactic.DeriveTraversable -import Mathlib.Tactic.ENatToNat -import Mathlib.Tactic.Eqns -import Mathlib.Tactic.ErwQuestion -import Mathlib.Tactic.Eval -import Mathlib.Tactic.ExistsI -import Mathlib.Tactic.Explode -import Mathlib.Tactic.Explode.Datatypes -import Mathlib.Tactic.Explode.Pretty -import Mathlib.Tactic.ExtendDoc -import Mathlib.Tactic.ExtractGoal -import Mathlib.Tactic.ExtractLets -import Mathlib.Tactic.FBinop -import Mathlib.Tactic.FailIfNoProgress -import Mathlib.Tactic.FastInstance -import Mathlib.Tactic.Field -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.FieldSimp.Attr -import Mathlib.Tactic.FieldSimp.Discharger -import Mathlib.Tactic.FieldSimp.Lemmas -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.Find -import Mathlib.Tactic.FindSyntax -import Mathlib.Tactic.Finiteness -import Mathlib.Tactic.Finiteness.Attr -import Mathlib.Tactic.FunProp -import Mathlib.Tactic.FunProp.Attr -import Mathlib.Tactic.FunProp.ContDiff -import Mathlib.Tactic.FunProp.Core -import Mathlib.Tactic.FunProp.Decl -import Mathlib.Tactic.FunProp.Differentiable -import Mathlib.Tactic.FunProp.Elab -import Mathlib.Tactic.FunProp.FunctionData -import Mathlib.Tactic.FunProp.Mor -import Mathlib.Tactic.FunProp.Theorems -import Mathlib.Tactic.FunProp.ToBatteries -import Mathlib.Tactic.FunProp.Types -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.GCongr.Core -import Mathlib.Tactic.GCongr.CoreAttrs -import Mathlib.Tactic.GCongr.ForwardAttr -import Mathlib.Tactic.GRewrite -import Mathlib.Tactic.GRewrite.Core -import Mathlib.Tactic.GRewrite.Elab -import Mathlib.Tactic.Generalize -import Mathlib.Tactic.GeneralizeProofs -import Mathlib.Tactic.Group -import Mathlib.Tactic.GuardGoalNums -import Mathlib.Tactic.GuardHypNums -import Mathlib.Tactic.Have -import Mathlib.Tactic.HaveI -import Mathlib.Tactic.HigherOrder -import Mathlib.Tactic.Hint -import Mathlib.Tactic.ITauto -import Mathlib.Tactic.InferParam -import Mathlib.Tactic.Inhabit -import Mathlib.Tactic.IntervalCases -import Mathlib.Tactic.IrreducibleDef -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.Lift -import Mathlib.Tactic.LiftLets -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Linarith.Datatypes -import Mathlib.Tactic.Linarith.Frontend -import Mathlib.Tactic.Linarith.Lemmas -import Mathlib.Tactic.Linarith.Oracle.FourierMotzkin -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Gauss -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.SimplexAlgorithm -import Mathlib.Tactic.Linarith.Parsing -import Mathlib.Tactic.Linarith.Preprocessing -import Mathlib.Tactic.Linarith.Verification -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.LinearCombination' -import Mathlib.Tactic.LinearCombination.Lemmas -import Mathlib.Tactic.Linter -import Mathlib.Tactic.Linter.CommandRanges -import Mathlib.Tactic.Linter.CommandStart -import Mathlib.Tactic.Linter.DeprecatedModule -import Mathlib.Tactic.Linter.DeprecatedSyntaxLinter -import Mathlib.Tactic.Linter.DirectoryDependency -import Mathlib.Tactic.Linter.DocPrime -import Mathlib.Tactic.Linter.DocString -import Mathlib.Tactic.Linter.FindDeprecations -import Mathlib.Tactic.Linter.FlexibleLinter -import Mathlib.Tactic.Linter.GlobalAttributeIn -import Mathlib.Tactic.Linter.HashCommandLinter -import Mathlib.Tactic.Linter.HaveLetLinter -import Mathlib.Tactic.Linter.Header -import Mathlib.Tactic.Linter.Lint -import Mathlib.Tactic.Linter.MinImports -import Mathlib.Tactic.Linter.Multigoal -import Mathlib.Tactic.Linter.OldObtain -import Mathlib.Tactic.Linter.PPRoundtrip -import Mathlib.Tactic.Linter.Style -import Mathlib.Tactic.Linter.TextBased -import Mathlib.Tactic.Linter.UnusedTactic -import Mathlib.Tactic.Linter.UnusedTacticExtension -import Mathlib.Tactic.Linter.UpstreamableDecl -import Mathlib.Tactic.Measurability -import Mathlib.Tactic.Measurability.Init -import Mathlib.Tactic.MinImports -import Mathlib.Tactic.MkIffOfInductiveProp -import Mathlib.Tactic.ModCases -import Mathlib.Tactic.Module -import Mathlib.Tactic.Monotonicity -import Mathlib.Tactic.Monotonicity.Attr -import Mathlib.Tactic.Monotonicity.Basic -import Mathlib.Tactic.Monotonicity.Lemmas -import Mathlib.Tactic.MoveAdd -import Mathlib.Tactic.NoncommRing -import Mathlib.Tactic.Nontriviality -import Mathlib.Tactic.Nontriviality.Core -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.NormNum.Abs -import Mathlib.Tactic.NormNum.Basic -import Mathlib.Tactic.NormNum.BigOperators -import Mathlib.Tactic.NormNum.Core -import Mathlib.Tactic.NormNum.DivMod -import Mathlib.Tactic.NormNum.Eq -import Mathlib.Tactic.NormNum.GCD -import Mathlib.Tactic.NormNum.Ineq -import Mathlib.Tactic.NormNum.Inv -import Mathlib.Tactic.NormNum.Irrational -import Mathlib.Tactic.NormNum.IsCoprime -import Mathlib.Tactic.NormNum.LegendreSymbol -import Mathlib.Tactic.NormNum.ModEq -import Mathlib.Tactic.NormNum.NatFactorial -import Mathlib.Tactic.NormNum.NatFib -import Mathlib.Tactic.NormNum.NatLog -import Mathlib.Tactic.NormNum.NatSqrt -import Mathlib.Tactic.NormNum.OfScientific -import Mathlib.Tactic.NormNum.Ordinal -import Mathlib.Tactic.NormNum.Parity -import Mathlib.Tactic.NormNum.Pow -import Mathlib.Tactic.NormNum.PowMod -import Mathlib.Tactic.NormNum.Prime -import Mathlib.Tactic.NormNum.RealSqrt -import Mathlib.Tactic.NormNum.Result -import Mathlib.Tactic.NthRewrite -import Mathlib.Tactic.Observe -import Mathlib.Tactic.OfNat -import Mathlib.Tactic.Order -import Mathlib.Tactic.Order.CollectFacts -import Mathlib.Tactic.Order.Graph.Basic -import Mathlib.Tactic.Order.Graph.Tarjan -import Mathlib.Tactic.Order.Preprocessing -import Mathlib.Tactic.PNatToNat -import Mathlib.Tactic.PPWithUniv -import Mathlib.Tactic.Peel -import Mathlib.Tactic.Polyrith -import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Positivity.Basic -import Mathlib.Tactic.Positivity.Core -import Mathlib.Tactic.Positivity.Finset -import Mathlib.Tactic.ProdAssoc -import Mathlib.Tactic.Propose -import Mathlib.Tactic.ProxyType -import Mathlib.Tactic.Push -import Mathlib.Tactic.Push.Attr -import Mathlib.Tactic.Qify -import Mathlib.Tactic.RSuffices -import Mathlib.Tactic.Recall -import Mathlib.Tactic.Recover -import Mathlib.Tactic.ReduceModChar -import Mathlib.Tactic.ReduceModChar.Ext -import Mathlib.Tactic.Relation.Rfl -import Mathlib.Tactic.Relation.Symm -import Mathlib.Tactic.Rename -import Mathlib.Tactic.RenameBVar -import Mathlib.Tactic.Replace -import Mathlib.Tactic.RewriteSearch -import Mathlib.Tactic.Rify -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Ring.Basic -import Mathlib.Tactic.Ring.Compare -import Mathlib.Tactic.Ring.NamePolyVars -import Mathlib.Tactic.Ring.PNat -import Mathlib.Tactic.Ring.RingNF -import Mathlib.Tactic.Sat.FromLRAT -import Mathlib.Tactic.Says -import Mathlib.Tactic.ScopedNS -import Mathlib.Tactic.Set -import Mathlib.Tactic.SetLike -import Mathlib.Tactic.SimpIntro -import Mathlib.Tactic.SimpRw -import Mathlib.Tactic.Simproc.Divisors -import Mathlib.Tactic.Simproc.ExistsAndEq -import Mathlib.Tactic.Simproc.Factors -import Mathlib.Tactic.Simproc.FinsetInterval -import Mathlib.Tactic.Simps.Basic -import Mathlib.Tactic.Simps.NotationClass -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.Spread -import Mathlib.Tactic.StacksAttribute -import Mathlib.Tactic.Subsingleton -import Mathlib.Tactic.Substs -import Mathlib.Tactic.SuccessIfFailWithMsg -import Mathlib.Tactic.SudoSetOption -import Mathlib.Tactic.SuppressCompilation -import Mathlib.Tactic.SwapVar -import Mathlib.Tactic.TFAE -import Mathlib.Tactic.TacticAnalysis -import Mathlib.Tactic.TacticAnalysis.Declarations -import Mathlib.Tactic.Tauto -import Mathlib.Tactic.TautoSet -import Mathlib.Tactic.TermCongr -import Mathlib.Tactic.ToAdditive -import Mathlib.Tactic.ToAdditive.Frontend -import Mathlib.Tactic.ToAdditive.GuessName -import Mathlib.Tactic.ToExpr -import Mathlib.Tactic.ToLevel -import Mathlib.Tactic.Trace -import Mathlib.Tactic.TryThis -import Mathlib.Tactic.TypeCheck -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.UnsetOption -import Mathlib.Tactic.Use -import Mathlib.Tactic.Variable -import Mathlib.Tactic.WLOG -import Mathlib.Tactic.Widget.Calc -import Mathlib.Tactic.Widget.CommDiag -import Mathlib.Tactic.Widget.CongrM -import Mathlib.Tactic.Widget.Conv -import Mathlib.Tactic.Widget.GCongr -import Mathlib.Tactic.Widget.InteractiveUnfold -import Mathlib.Tactic.Widget.LibraryRewrite -import Mathlib.Tactic.Widget.SelectInsertParamsClass -import Mathlib.Tactic.Widget.SelectPanelUtils -import Mathlib.Tactic.Widget.StringDiagram -import Mathlib.Tactic.WithoutCDot -import Mathlib.Tactic.Zify -import Mathlib.Testing.Plausible.Functions -import Mathlib.Testing.Plausible.Sampleable -import Mathlib.Testing.Plausible.Testable -import Mathlib.Topology.AlexandrovDiscrete -import Mathlib.Topology.Algebra.Affine -import Mathlib.Topology.Algebra.AffineSubspace -import Mathlib.Topology.Algebra.Algebra -import Mathlib.Topology.Algebra.Algebra.Equiv -import Mathlib.Topology.Algebra.Algebra.Rat -import Mathlib.Topology.Algebra.AsymptoticCone -import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Basic -import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Limits -import Mathlib.Topology.Algebra.ClopenNhdofOne -import Mathlib.Topology.Algebra.ClosedSubgroup -import Mathlib.Topology.Algebra.ConstMulAction -import Mathlib.Topology.Algebra.Constructions -import Mathlib.Topology.Algebra.Constructions.DomMulAct -import Mathlib.Topology.Algebra.ContinuousAffineEquiv -import Mathlib.Topology.Algebra.ContinuousAffineMap -import Mathlib.Topology.Algebra.ContinuousMonoidHom -import Mathlib.Topology.Algebra.Equicontinuity -import Mathlib.Topology.Algebra.Field -import Mathlib.Topology.Algebra.FilterBasis -import Mathlib.Topology.Algebra.Group.AddTorsor -import Mathlib.Topology.Algebra.Group.Basic -import Mathlib.Topology.Algebra.Group.ClosedSubgroup -import Mathlib.Topology.Algebra.Group.Compact -import Mathlib.Topology.Algebra.Group.CompactOpen -import Mathlib.Topology.Algebra.Group.Defs -import Mathlib.Topology.Algebra.Group.GroupTopology -import Mathlib.Topology.Algebra.Group.OpenMapping -import Mathlib.Topology.Algebra.Group.Pointwise -import Mathlib.Topology.Algebra.Group.Quotient -import Mathlib.Topology.Algebra.Group.SubmonoidClosure -import Mathlib.Topology.Algebra.Group.TopologicalAbelianization -import Mathlib.Topology.Algebra.Group.Units -import Mathlib.Topology.Algebra.GroupCompletion -import Mathlib.Topology.Algebra.GroupWithZero -import Mathlib.Topology.Algebra.Indicator -import Mathlib.Topology.Algebra.InfiniteSum.Basic -import Mathlib.Topology.Algebra.InfiniteSum.ConditionalInt -import Mathlib.Topology.Algebra.InfiniteSum.Constructions -import Mathlib.Topology.Algebra.InfiniteSum.Defs -import Mathlib.Topology.Algebra.InfiniteSum.ENNReal -import Mathlib.Topology.Algebra.InfiniteSum.Field -import Mathlib.Topology.Algebra.InfiniteSum.Group -import Mathlib.Topology.Algebra.InfiniteSum.GroupCompletion -import Mathlib.Topology.Algebra.InfiniteSum.Module -import Mathlib.Topology.Algebra.InfiniteSum.NatInt -import Mathlib.Topology.Algebra.InfiniteSum.Nonarchimedean -import Mathlib.Topology.Algebra.InfiniteSum.Order -import Mathlib.Topology.Algebra.InfiniteSum.Real -import Mathlib.Topology.Algebra.InfiniteSum.Ring -import Mathlib.Topology.Algebra.InfiniteSum.SummationFilter -import Mathlib.Topology.Algebra.InfiniteSum.TsumUniformlyOn -import Mathlib.Topology.Algebra.InfiniteSum.UniformOn -import Mathlib.Topology.Algebra.IntermediateField -import Mathlib.Topology.Algebra.IsOpenUnits -import Mathlib.Topology.Algebra.IsUniformGroup.Basic -import Mathlib.Topology.Algebra.IsUniformGroup.Constructions -import Mathlib.Topology.Algebra.IsUniformGroup.Defs -import Mathlib.Topology.Algebra.IsUniformGroup.DiscreteSubgroup -import Mathlib.Topology.Algebra.IsUniformGroup.Order -import Mathlib.Topology.Algebra.LinearTopology -import Mathlib.Topology.Algebra.Localization -import Mathlib.Topology.Algebra.MetricSpace.Lipschitz -import Mathlib.Topology.Algebra.Module.Alternating.Basic -import Mathlib.Topology.Algebra.Module.Alternating.Topology -import Mathlib.Topology.Algebra.Module.Basic -import Mathlib.Topology.Algebra.Module.Cardinality -import Mathlib.Topology.Algebra.Module.CharacterSpace -import Mathlib.Topology.Algebra.Module.ClosedSubmodule -import Mathlib.Topology.Algebra.Module.Compact -import Mathlib.Topology.Algebra.Module.Determinant -import Mathlib.Topology.Algebra.Module.Equiv -import Mathlib.Topology.Algebra.Module.FiniteDimension -import Mathlib.Topology.Algebra.Module.LinearMap -import Mathlib.Topology.Algebra.Module.LinearMapPiProd -import Mathlib.Topology.Algebra.Module.LinearPMap -import Mathlib.Topology.Algebra.Module.LocallyConvex -import Mathlib.Topology.Algebra.Module.ModuleTopology -import Mathlib.Topology.Algebra.Module.Multilinear.Basic -import Mathlib.Topology.Algebra.Module.Multilinear.Bounded -import Mathlib.Topology.Algebra.Module.Multilinear.Topology -import Mathlib.Topology.Algebra.Module.PerfectPairing -import Mathlib.Topology.Algebra.Module.PerfectSpace -import Mathlib.Topology.Algebra.Module.PointwiseConvergence -import Mathlib.Topology.Algebra.Module.Simple -import Mathlib.Topology.Algebra.Module.Star -import Mathlib.Topology.Algebra.Module.StrongDual -import Mathlib.Topology.Algebra.Module.StrongTopology -import Mathlib.Topology.Algebra.Module.UniformConvergence -import Mathlib.Topology.Algebra.Module.WeakBilin -import Mathlib.Topology.Algebra.Module.WeakDual -import Mathlib.Topology.Algebra.Monoid -import Mathlib.Topology.Algebra.Monoid.AddChar -import Mathlib.Topology.Algebra.Monoid.Defs -import Mathlib.Topology.Algebra.Monoid.FunOnFinite -import Mathlib.Topology.Algebra.MulAction -import Mathlib.Topology.Algebra.MvPolynomial -import Mathlib.Topology.Algebra.NonUnitalAlgebra -import Mathlib.Topology.Algebra.NonUnitalStarAlgebra -import Mathlib.Topology.Algebra.Nonarchimedean.AdicTopology -import Mathlib.Topology.Algebra.Nonarchimedean.Bases -import Mathlib.Topology.Algebra.Nonarchimedean.Basic -import Mathlib.Topology.Algebra.Nonarchimedean.Completion -import Mathlib.Topology.Algebra.Nonarchimedean.TotallyDisconnected -import Mathlib.Topology.Algebra.OpenSubgroup -import Mathlib.Topology.Algebra.Order.Archimedean -import Mathlib.Topology.Algebra.Order.ArchimedeanDiscrete -import Mathlib.Topology.Algebra.Order.Field -import Mathlib.Topology.Algebra.Order.Floor -import Mathlib.Topology.Algebra.Order.Group -import Mathlib.Topology.Algebra.Order.LiminfLimsup -import Mathlib.Topology.Algebra.Order.Module -import Mathlib.Topology.Algebra.Order.Support -import Mathlib.Topology.Algebra.Order.UpperLower -import Mathlib.Topology.Algebra.Polynomial -import Mathlib.Topology.Algebra.PontryaginDual -import Mathlib.Topology.Algebra.ProperAction.AddTorsor -import Mathlib.Topology.Algebra.ProperAction.Basic -import Mathlib.Topology.Algebra.ProperAction.ProperlyDiscontinuous -import Mathlib.Topology.Algebra.ProperConstSMul -import Mathlib.Topology.Algebra.RestrictedProduct -import Mathlib.Topology.Algebra.RestrictedProduct.Basic -import Mathlib.Topology.Algebra.RestrictedProduct.TopologicalSpace -import Mathlib.Topology.Algebra.Ring.Basic -import Mathlib.Topology.Algebra.Ring.Compact -import Mathlib.Topology.Algebra.Ring.Ideal -import Mathlib.Topology.Algebra.Ring.Real -import Mathlib.Topology.Algebra.Semigroup -import Mathlib.Topology.Algebra.SeparationQuotient.Basic -import Mathlib.Topology.Algebra.SeparationQuotient.FiniteDimensional -import Mathlib.Topology.Algebra.SeparationQuotient.Hom -import Mathlib.Topology.Algebra.SeparationQuotient.Section -import Mathlib.Topology.Algebra.Star -import Mathlib.Topology.Algebra.Star.Real -import Mathlib.Topology.Algebra.Star.Unitary -import Mathlib.Topology.Algebra.StarSubalgebra -import Mathlib.Topology.Algebra.Support -import Mathlib.Topology.Algebra.TopologicallyNilpotent -import Mathlib.Topology.Algebra.UniformConvergence -import Mathlib.Topology.Algebra.UniformField -import Mathlib.Topology.Algebra.UniformFilterBasis -import Mathlib.Topology.Algebra.UniformMulAction -import Mathlib.Topology.Algebra.UniformRing -import Mathlib.Topology.Algebra.Valued.LocallyCompact -import Mathlib.Topology.Algebra.Valued.NormedValued -import Mathlib.Topology.Algebra.Valued.ValuationTopology -import Mathlib.Topology.Algebra.Valued.ValuativeRel -import Mathlib.Topology.Algebra.Valued.ValuedField -import Mathlib.Topology.Algebra.Valued.WithVal -import Mathlib.Topology.Algebra.Valued.WithZeroMulInt -import Mathlib.Topology.Algebra.WithZeroTopology -import Mathlib.Topology.ApproximateUnit -import Mathlib.Topology.Baire.BaireMeasurable -import Mathlib.Topology.Baire.CompleteMetrizable -import Mathlib.Topology.Baire.Lemmas -import Mathlib.Topology.Baire.LocallyCompactRegular -import Mathlib.Topology.Bases -import Mathlib.Topology.Basic -import Mathlib.Topology.Bornology.Absorbs -import Mathlib.Topology.Bornology.Basic -import Mathlib.Topology.Bornology.BoundedOperation -import Mathlib.Topology.Bornology.Constructions -import Mathlib.Topology.Bornology.Hom -import Mathlib.Topology.Bornology.Real -import Mathlib.Topology.CWComplex.Abstract.Basic -import Mathlib.Topology.CWComplex.Classical.Basic -import Mathlib.Topology.CWComplex.Classical.Finite -import Mathlib.Topology.CWComplex.Classical.Subcomplex -import Mathlib.Topology.Category.Born -import Mathlib.Topology.Category.CompHaus.Basic -import Mathlib.Topology.Category.CompHaus.EffectiveEpi -import Mathlib.Topology.Category.CompHaus.Frm -import Mathlib.Topology.Category.CompHaus.Limits -import Mathlib.Topology.Category.CompHaus.Projective -import Mathlib.Topology.Category.CompHausLike.Basic -import Mathlib.Topology.Category.CompHausLike.EffectiveEpi -import Mathlib.Topology.Category.CompHausLike.Limits -import Mathlib.Topology.Category.CompHausLike.SigmaComparison -import Mathlib.Topology.Category.CompactlyGenerated -import Mathlib.Topology.Category.Compactum -import Mathlib.Topology.Category.DeltaGenerated -import Mathlib.Topology.Category.FinTopCat -import Mathlib.Topology.Category.LightProfinite.AsLimit -import Mathlib.Topology.Category.LightProfinite.Basic -import Mathlib.Topology.Category.LightProfinite.EffectiveEpi -import Mathlib.Topology.Category.LightProfinite.Extend -import Mathlib.Topology.Category.LightProfinite.Limits -import Mathlib.Topology.Category.LightProfinite.Sequence -import Mathlib.Topology.Category.Locale -import Mathlib.Topology.Category.Profinite.AsLimit -import Mathlib.Topology.Category.Profinite.Basic -import Mathlib.Topology.Category.Profinite.CofilteredLimit -import Mathlib.Topology.Category.Profinite.EffectiveEpi -import Mathlib.Topology.Category.Profinite.Extend -import Mathlib.Topology.Category.Profinite.Limits -import Mathlib.Topology.Category.Profinite.Nobeling -import Mathlib.Topology.Category.Profinite.Nobeling.Basic -import Mathlib.Topology.Category.Profinite.Nobeling.Induction -import Mathlib.Topology.Category.Profinite.Nobeling.Span -import Mathlib.Topology.Category.Profinite.Nobeling.Successor -import Mathlib.Topology.Category.Profinite.Nobeling.ZeroLimit -import Mathlib.Topology.Category.Profinite.Product -import Mathlib.Topology.Category.Profinite.Projective -import Mathlib.Topology.Category.Sequential -import Mathlib.Topology.Category.Stonean.Adjunctions -import Mathlib.Topology.Category.Stonean.Basic -import Mathlib.Topology.Category.Stonean.EffectiveEpi -import Mathlib.Topology.Category.Stonean.Limits -import Mathlib.Topology.Category.TopCat.Adjunctions -import Mathlib.Topology.Category.TopCat.Basic -import Mathlib.Topology.Category.TopCat.EffectiveEpi -import Mathlib.Topology.Category.TopCat.EpiMono -import Mathlib.Topology.Category.TopCat.Limits.Basic -import Mathlib.Topology.Category.TopCat.Limits.Cofiltered -import Mathlib.Topology.Category.TopCat.Limits.Konig -import Mathlib.Topology.Category.TopCat.Limits.Products -import Mathlib.Topology.Category.TopCat.Limits.Pullbacks -import Mathlib.Topology.Category.TopCat.OpenNhds -import Mathlib.Topology.Category.TopCat.Opens -import Mathlib.Topology.Category.TopCat.Sphere -import Mathlib.Topology.Category.TopCat.ULift -import Mathlib.Topology.Category.TopCat.Yoneda -import Mathlib.Topology.Category.TopCommRingCat -import Mathlib.Topology.Category.UniformSpace -import Mathlib.Topology.Clopen -import Mathlib.Topology.ClopenBox -import Mathlib.Topology.Closure -import Mathlib.Topology.ClusterPt -import Mathlib.Topology.Coherent -import Mathlib.Topology.CompactOpen -import Mathlib.Topology.Compactification.OnePoint -import Mathlib.Topology.Compactification.OnePoint.Basic -import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine -import Mathlib.Topology.Compactification.OnePoint.Sphere -import Mathlib.Topology.Compactification.OnePointEquiv -import Mathlib.Topology.Compactification.StoneCech -import Mathlib.Topology.Compactness.Bases -import Mathlib.Topology.Compactness.Compact -import Mathlib.Topology.Compactness.CompactlyCoherentSpace -import Mathlib.Topology.Compactness.CompactlyGeneratedSpace -import Mathlib.Topology.Compactness.DeltaGeneratedSpace -import Mathlib.Topology.Compactness.Exterior -import Mathlib.Topology.Compactness.HilbertCubeEmbedding -import Mathlib.Topology.Compactness.Lindelof -import Mathlib.Topology.Compactness.LocallyCompact -import Mathlib.Topology.Compactness.LocallyFinite -import Mathlib.Topology.Compactness.NhdsKer -import Mathlib.Topology.Compactness.Paracompact -import Mathlib.Topology.Compactness.PseudometrizableLindelof -import Mathlib.Topology.Compactness.SigmaCompact -import Mathlib.Topology.Connected.Basic -import Mathlib.Topology.Connected.Clopen -import Mathlib.Topology.Connected.LocPathConnected -import Mathlib.Topology.Connected.LocallyConnected -import Mathlib.Topology.Connected.PathComponentOne -import Mathlib.Topology.Connected.PathConnected -import Mathlib.Topology.Connected.Separation -import Mathlib.Topology.Connected.TotallyDisconnected -import Mathlib.Topology.Constructible -import Mathlib.Topology.Constructions -import Mathlib.Topology.Constructions.SumProd -import Mathlib.Topology.Continuous -import Mathlib.Topology.ContinuousMap.Algebra -import Mathlib.Topology.ContinuousMap.Basic -import Mathlib.Topology.ContinuousMap.Bounded.ArzelaAscoli -import Mathlib.Topology.ContinuousMap.Bounded.Basic -import Mathlib.Topology.ContinuousMap.Bounded.Normed -import Mathlib.Topology.ContinuousMap.Bounded.Star -import Mathlib.Topology.ContinuousMap.BoundedCompactlySupported -import Mathlib.Topology.ContinuousMap.CocompactMap -import Mathlib.Topology.ContinuousMap.Compact -import Mathlib.Topology.ContinuousMap.CompactlySupported -import Mathlib.Topology.ContinuousMap.ContinuousMapZero -import Mathlib.Topology.ContinuousMap.ContinuousSqrt -import Mathlib.Topology.ContinuousMap.Defs -import Mathlib.Topology.ContinuousMap.Ideals -import Mathlib.Topology.ContinuousMap.Interval -import Mathlib.Topology.ContinuousMap.Lattice -import Mathlib.Topology.ContinuousMap.LocallyConstant -import Mathlib.Topology.ContinuousMap.LocallyConvex -import Mathlib.Topology.ContinuousMap.Ordered -import Mathlib.Topology.ContinuousMap.Periodic -import Mathlib.Topology.ContinuousMap.Polynomial -import Mathlib.Topology.ContinuousMap.SecondCountableSpace -import Mathlib.Topology.ContinuousMap.Sigma -import Mathlib.Topology.ContinuousMap.Star -import Mathlib.Topology.ContinuousMap.StarOrdered -import Mathlib.Topology.ContinuousMap.StoneWeierstrass -import Mathlib.Topology.ContinuousMap.T0Sierpinski -import Mathlib.Topology.ContinuousMap.Units -import Mathlib.Topology.ContinuousMap.Weierstrass -import Mathlib.Topology.ContinuousMap.ZeroAtInfty -import Mathlib.Topology.ContinuousOn -import Mathlib.Topology.Convenient.GeneratedBy -import Mathlib.Topology.Covering -import Mathlib.Topology.Defs.Basic -import Mathlib.Topology.Defs.Filter -import Mathlib.Topology.Defs.Induced -import Mathlib.Topology.Defs.Sequences -import Mathlib.Topology.Defs.Ultrafilter -import Mathlib.Topology.DenseEmbedding -import Mathlib.Topology.DerivedSet -import Mathlib.Topology.DiscreteQuotient -import Mathlib.Topology.DiscreteSubset -import Mathlib.Topology.EMetricSpace.Basic -import Mathlib.Topology.EMetricSpace.BoundedVariation -import Mathlib.Topology.EMetricSpace.Defs -import Mathlib.Topology.EMetricSpace.Diam -import Mathlib.Topology.EMetricSpace.Lipschitz -import Mathlib.Topology.EMetricSpace.PairReduction -import Mathlib.Topology.EMetricSpace.Paracompact -import Mathlib.Topology.EMetricSpace.Pi -import Mathlib.Topology.ExtendFrom -import Mathlib.Topology.Exterior -import Mathlib.Topology.ExtremallyDisconnected -import Mathlib.Topology.FiberBundle.Basic -import Mathlib.Topology.FiberBundle.Constructions -import Mathlib.Topology.FiberBundle.IsHomeomorphicTrivialBundle -import Mathlib.Topology.FiberBundle.Trivialization -import Mathlib.Topology.FiberPartition -import Mathlib.Topology.Filter -import Mathlib.Topology.GDelta.Basic -import Mathlib.Topology.GDelta.MetrizableSpace -import Mathlib.Topology.GDelta.UniformSpace -import Mathlib.Topology.Germ -import Mathlib.Topology.Gluing -import Mathlib.Topology.Hom.ContinuousEval -import Mathlib.Topology.Hom.ContinuousEvalConst -import Mathlib.Topology.Hom.Open -import Mathlib.Topology.Homeomorph.Defs -import Mathlib.Topology.Homeomorph.Lemmas -import Mathlib.Topology.Homotopy.Affine -import Mathlib.Topology.Homotopy.Basic -import Mathlib.Topology.Homotopy.Contractible -import Mathlib.Topology.Homotopy.Equiv -import Mathlib.Topology.Homotopy.HSpaces -import Mathlib.Topology.Homotopy.HomotopyGroup -import Mathlib.Topology.Homotopy.Lifting -import Mathlib.Topology.Homotopy.Path -import Mathlib.Topology.Homotopy.Product -import Mathlib.Topology.IndicatorConstPointwise -import Mathlib.Topology.Inseparable -import Mathlib.Topology.Instances.AddCircle.Defs -import Mathlib.Topology.Instances.AddCircle.DenseSubgroup -import Mathlib.Topology.Instances.AddCircle.Real -import Mathlib.Topology.Instances.CantorSet -import Mathlib.Topology.Instances.Complex -import Mathlib.Topology.Instances.Discrete -import Mathlib.Topology.Instances.ENNReal.Lemmas -import Mathlib.Topology.Instances.ENat -import Mathlib.Topology.Instances.EReal.Lemmas -import Mathlib.Topology.Instances.Int -import Mathlib.Topology.Instances.Irrational -import Mathlib.Topology.Instances.Matrix -import Mathlib.Topology.Instances.NNReal.Lemmas -import Mathlib.Topology.Instances.Nat -import Mathlib.Topology.Instances.PNat -import Mathlib.Topology.Instances.Rat -import Mathlib.Topology.Instances.RatLemmas -import Mathlib.Topology.Instances.Real.Lemmas -import Mathlib.Topology.Instances.RealVectorSpace -import Mathlib.Topology.Instances.Shrink -import Mathlib.Topology.Instances.Sign -import Mathlib.Topology.Instances.TrivSqZeroExt -import Mathlib.Topology.Instances.ZMod -import Mathlib.Topology.Instances.ZMultiples -import Mathlib.Topology.Irreducible -import Mathlib.Topology.IsClosedRestrict -import Mathlib.Topology.IsLocalHomeomorph -import Mathlib.Topology.JacobsonSpace -import Mathlib.Topology.KrullDimension -import Mathlib.Topology.List -import Mathlib.Topology.LocalAtTarget -import Mathlib.Topology.LocallyClosed -import Mathlib.Topology.LocallyConstant.Algebra -import Mathlib.Topology.LocallyConstant.Basic -import Mathlib.Topology.LocallyFinite -import Mathlib.Topology.LocallyFinsupp -import Mathlib.Topology.Maps.Basic -import Mathlib.Topology.Maps.OpenQuotient -import Mathlib.Topology.Maps.Proper.Basic -import Mathlib.Topology.Maps.Proper.CompactlyGenerated -import Mathlib.Topology.Maps.Proper.UniversallyClosed -import Mathlib.Topology.MetricSpace.Algebra -import Mathlib.Topology.MetricSpace.Antilipschitz -import Mathlib.Topology.MetricSpace.Basic -import Mathlib.Topology.MetricSpace.Bilipschitz -import Mathlib.Topology.MetricSpace.Bounded -import Mathlib.Topology.MetricSpace.BundledFun -import Mathlib.Topology.MetricSpace.CantorScheme -import Mathlib.Topology.MetricSpace.CauSeqFilter -import Mathlib.Topology.MetricSpace.Cauchy -import Mathlib.Topology.MetricSpace.Closeds -import Mathlib.Topology.MetricSpace.Completion -import Mathlib.Topology.MetricSpace.Congruence -import Mathlib.Topology.MetricSpace.Contracting -import Mathlib.Topology.MetricSpace.Cover -import Mathlib.Topology.MetricSpace.Defs -import Mathlib.Topology.MetricSpace.Dilation -import Mathlib.Topology.MetricSpace.DilationEquiv -import Mathlib.Topology.MetricSpace.Equicontinuity -import Mathlib.Topology.MetricSpace.Gluing -import Mathlib.Topology.MetricSpace.GromovHausdorff -import Mathlib.Topology.MetricSpace.GromovHausdorffRealized -import Mathlib.Topology.MetricSpace.HausdorffDimension -import Mathlib.Topology.MetricSpace.HausdorffDistance -import Mathlib.Topology.MetricSpace.Holder -import Mathlib.Topology.MetricSpace.HolderNorm -import Mathlib.Topology.MetricSpace.Infsep -import Mathlib.Topology.MetricSpace.IsometricSMul -import Mathlib.Topology.MetricSpace.Isometry -import Mathlib.Topology.MetricSpace.Kuratowski -import Mathlib.Topology.MetricSpace.Lipschitz -import Mathlib.Topology.MetricSpace.MetricSeparated -import Mathlib.Topology.MetricSpace.PartitionOfUnity -import Mathlib.Topology.MetricSpace.Perfect -import Mathlib.Topology.MetricSpace.PiNat -import Mathlib.Topology.MetricSpace.Polish -import Mathlib.Topology.MetricSpace.ProperSpace -import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas -import Mathlib.Topology.MetricSpace.ProperSpace.Real -import Mathlib.Topology.MetricSpace.Pseudo.Basic -import Mathlib.Topology.MetricSpace.Pseudo.Constructions -import Mathlib.Topology.MetricSpace.Pseudo.Defs -import Mathlib.Topology.MetricSpace.Pseudo.Lemmas -import Mathlib.Topology.MetricSpace.Pseudo.Pi -import Mathlib.Topology.MetricSpace.Pseudo.Real -import Mathlib.Topology.MetricSpace.Sequences -import Mathlib.Topology.MetricSpace.ShrinkingLemma -import Mathlib.Topology.MetricSpace.Similarity -import Mathlib.Topology.MetricSpace.ThickenedIndicator -import Mathlib.Topology.MetricSpace.Thickening -import Mathlib.Topology.MetricSpace.Ultra.Basic -import Mathlib.Topology.MetricSpace.Ultra.ContinuousMaps -import Mathlib.Topology.MetricSpace.Ultra.Pi -import Mathlib.Topology.MetricSpace.Ultra.TotallySeparated -import Mathlib.Topology.MetricSpace.UniformConvergence -import Mathlib.Topology.Metrizable.Basic -import Mathlib.Topology.Metrizable.CompletelyMetrizable -import Mathlib.Topology.Metrizable.ContinuousMap -import Mathlib.Topology.Metrizable.Real -import Mathlib.Topology.Metrizable.Uniformity -import Mathlib.Topology.Metrizable.Urysohn -import Mathlib.Topology.NatEmbedding -import Mathlib.Topology.Neighborhoods -import Mathlib.Topology.NhdsKer -import Mathlib.Topology.NhdsSet -import Mathlib.Topology.NhdsWithin -import Mathlib.Topology.NoetherianSpace -import Mathlib.Topology.OmegaCompletePartialOrder -import Mathlib.Topology.OpenPartialHomeomorph -import Mathlib.Topology.Order -import Mathlib.Topology.Order.Basic -import Mathlib.Topology.Order.Bornology -import Mathlib.Topology.Order.Category.AlexDisc -import Mathlib.Topology.Order.Category.FrameAdjunction -import Mathlib.Topology.Order.Compact -import Mathlib.Topology.Order.CountableSeparating -import Mathlib.Topology.Order.DenselyOrdered -import Mathlib.Topology.Order.ExtendFrom -import Mathlib.Topology.Order.ExtrClosure -import Mathlib.Topology.Order.Filter -import Mathlib.Topology.Order.Hom.Basic -import Mathlib.Topology.Order.Hom.Esakia -import Mathlib.Topology.Order.HullKernel -import Mathlib.Topology.Order.IntermediateValue -import Mathlib.Topology.Order.IsLUB -import Mathlib.Topology.Order.IsLocallyClosed -import Mathlib.Topology.Order.IsNormal -import Mathlib.Topology.Order.Lattice -import Mathlib.Topology.Order.LawsonTopology -import Mathlib.Topology.Order.LeftRight -import Mathlib.Topology.Order.LeftRightLim -import Mathlib.Topology.Order.LeftRightNhds -import Mathlib.Topology.Order.LiminfLimsup -import Mathlib.Topology.Order.LocalExtr -import Mathlib.Topology.Order.LowerUpperTopology -import Mathlib.Topology.Order.Monotone -import Mathlib.Topology.Order.MonotoneContinuity -import Mathlib.Topology.Order.MonotoneConvergence -import Mathlib.Topology.Order.NhdsSet -import Mathlib.Topology.Order.OrderClosed -import Mathlib.Topology.Order.OrderClosedExtr -import Mathlib.Topology.Order.PartialSups -import Mathlib.Topology.Order.Priestley -import Mathlib.Topology.Order.ProjIcc -import Mathlib.Topology.Order.Real -import Mathlib.Topology.Order.Rolle -import Mathlib.Topology.Order.ScottTopology -import Mathlib.Topology.Order.T5 -import Mathlib.Topology.Order.UpperLowerSetTopology -import Mathlib.Topology.Order.WithTop -import Mathlib.Topology.Partial -import Mathlib.Topology.PartialHomeomorph -import Mathlib.Topology.PartitionOfUnity -import Mathlib.Topology.Path -import Mathlib.Topology.Perfect -import Mathlib.Topology.Piecewise -import Mathlib.Topology.PreorderRestrict -import Mathlib.Topology.QuasiSeparated -import Mathlib.Topology.Semicontinuous -import Mathlib.Topology.SeparatedMap -import Mathlib.Topology.Separation.AlexandrovDiscrete -import Mathlib.Topology.Separation.Basic -import Mathlib.Topology.Separation.CompletelyRegular -import Mathlib.Topology.Separation.Connected -import Mathlib.Topology.Separation.CountableSeparatingOn -import Mathlib.Topology.Separation.DisjointCover -import Mathlib.Topology.Separation.GDelta -import Mathlib.Topology.Separation.Hausdorff -import Mathlib.Topology.Separation.Lemmas -import Mathlib.Topology.Separation.LinearUpperLowerSetTopology -import Mathlib.Topology.Separation.NotNormal -import Mathlib.Topology.Separation.Profinite -import Mathlib.Topology.Separation.Regular -import Mathlib.Topology.Separation.SeparatedNhds -import Mathlib.Topology.Sequences -import Mathlib.Topology.Sets.Closeds -import Mathlib.Topology.Sets.CompactOpenCovered -import Mathlib.Topology.Sets.Compacts -import Mathlib.Topology.Sets.OpenCover -import Mathlib.Topology.Sets.Opens -import Mathlib.Topology.Sets.Order -import Mathlib.Topology.Sheaves.Alexandrov -import Mathlib.Topology.Sheaves.CommRingCat -import Mathlib.Topology.Sheaves.Forget -import Mathlib.Topology.Sheaves.Functors -import Mathlib.Topology.Sheaves.Init -import Mathlib.Topology.Sheaves.Limits -import Mathlib.Topology.Sheaves.LocalPredicate -import Mathlib.Topology.Sheaves.LocallySurjective -import Mathlib.Topology.Sheaves.MayerVietoris -import Mathlib.Topology.Sheaves.Over -import Mathlib.Topology.Sheaves.PUnit -import Mathlib.Topology.Sheaves.Presheaf -import Mathlib.Topology.Sheaves.PresheafOfFunctions -import Mathlib.Topology.Sheaves.Sheaf -import Mathlib.Topology.Sheaves.SheafCondition.EqualizerProducts -import Mathlib.Topology.Sheaves.SheafCondition.OpensLeCover -import Mathlib.Topology.Sheaves.SheafCondition.PairwiseIntersections -import Mathlib.Topology.Sheaves.SheafCondition.Sites -import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing -import Mathlib.Topology.Sheaves.SheafOfFunctions -import Mathlib.Topology.Sheaves.Sheafify -import Mathlib.Topology.Sheaves.Skyscraper -import Mathlib.Topology.Sheaves.Stalks -import Mathlib.Topology.ShrinkingLemma -import Mathlib.Topology.Sober -import Mathlib.Topology.Specialization -import Mathlib.Topology.Spectral.Basic -import Mathlib.Topology.Spectral.Hom -import Mathlib.Topology.Spectral.Prespectral -import Mathlib.Topology.StoneCech -import Mathlib.Topology.TietzeExtension -import Mathlib.Topology.Ultrafilter -import Mathlib.Topology.UniformSpace.AbsoluteValue -import Mathlib.Topology.UniformSpace.AbstractCompletion -import Mathlib.Topology.UniformSpace.Ascoli -import Mathlib.Topology.UniformSpace.Basic -import Mathlib.Topology.UniformSpace.Cauchy -import Mathlib.Topology.UniformSpace.Compact -import Mathlib.Topology.UniformSpace.CompactConvergence -import Mathlib.Topology.UniformSpace.CompareReals -import Mathlib.Topology.UniformSpace.CompleteSeparated -import Mathlib.Topology.UniformSpace.Completion -import Mathlib.Topology.UniformSpace.Defs -import Mathlib.Topology.UniformSpace.Dini -import Mathlib.Topology.UniformSpace.DiscreteUniformity -import Mathlib.Topology.UniformSpace.Equicontinuity -import Mathlib.Topology.UniformSpace.Equiv -import Mathlib.Topology.UniformSpace.HeineCantor -import Mathlib.Topology.UniformSpace.LocallyUniformConvergence -import Mathlib.Topology.UniformSpace.Matrix -import Mathlib.Topology.UniformSpace.OfCompactT2 -import Mathlib.Topology.UniformSpace.OfFun -import Mathlib.Topology.UniformSpace.Path -import Mathlib.Topology.UniformSpace.Pi -import Mathlib.Topology.UniformSpace.ProdApproximation -import Mathlib.Topology.UniformSpace.Real -import Mathlib.Topology.UniformSpace.Separation -import Mathlib.Topology.UniformSpace.Ultra.Basic -import Mathlib.Topology.UniformSpace.Ultra.Completion -import Mathlib.Topology.UniformSpace.Ultra.Constructions -import Mathlib.Topology.UniformSpace.UniformApproximation -import Mathlib.Topology.UniformSpace.UniformConvergence -import Mathlib.Topology.UniformSpace.UniformConvergenceTopology -import Mathlib.Topology.UniformSpace.UniformEmbedding -import Mathlib.Topology.UnitInterval -import Mathlib.Topology.UrysohnsBounded -import Mathlib.Topology.UrysohnsLemma -import Mathlib.Topology.VectorBundle.Basic -import Mathlib.Topology.VectorBundle.Constructions -import Mathlib.Topology.VectorBundle.Hom -import Mathlib.Topology.VectorBundle.Riemannian -import Mathlib.Util.AddRelatedDecl -import Mathlib.Util.AssertExists -import Mathlib.Util.AssertExistsExt -import Mathlib.Util.AssertNoSorry -import Mathlib.Util.AtLocation -import Mathlib.Util.AtomM -import Mathlib.Util.AtomM.Recurse -import Mathlib.Util.CompileInductive -import Mathlib.Util.CountHeartbeats -import Mathlib.Util.Delaborators -import Mathlib.Util.DischargerAsTactic -import Mathlib.Util.ElabWithoutMVars -import Mathlib.Util.Export -import Mathlib.Util.FormatTable -import Mathlib.Util.GetAllModules -import Mathlib.Util.LongNames -import Mathlib.Util.MemoFix -import Mathlib.Util.Notation3 -import Mathlib.Util.PPOptions -import Mathlib.Util.ParseCommand -import Mathlib.Util.PrintSorries -import Mathlib.Util.Qq -import Mathlib.Util.Simp -import Mathlib.Util.SleepHeartbeats -import Mathlib.Util.Superscript -import Mathlib.Util.SynthesizeUsing -import Mathlib.Util.Tactic -import Mathlib.Util.TermReduce -import Mathlib.Util.TransImports -import Mathlib.Util.WhatsNew -import Mathlib.Util.WithWeakNamespace +module + +public import Std +public import Batteries +public import Mathlib.Algebra.AddConstMap.Basic +public import Mathlib.Algebra.AddConstMap.Equiv +public import Mathlib.Algebra.AddTorsor.Basic +public import Mathlib.Algebra.AddTorsor.Defs +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Algebra.Field +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.Algebra.Algebra.Hom.Rat +public import Mathlib.Algebra.Algebra.IsSimpleRing +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.Algebra.Algebra.NonUnitalSubalgebra +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Algebra.Opposite +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.Algebra.Algebra.Shrink +public import Mathlib.Algebra.Algebra.Spectrum.Basic +public import Mathlib.Algebra.Algebra.Spectrum.Pi +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Algebra.Algebra.StrictPositivity +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.Algebra.Subalgebra.Centralizer +public import Mathlib.Algebra.Algebra.Subalgebra.Directed +public import Mathlib.Algebra.Algebra.Subalgebra.IsSimpleOrder +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Algebra.Subalgebra.Matrix +public import Mathlib.Algebra.Algebra.Subalgebra.MulOpposite +public import Mathlib.Algebra.Algebra.Subalgebra.Operations +public import Mathlib.Algebra.Algebra.Subalgebra.Order +public import Mathlib.Algebra.Algebra.Subalgebra.Pi +public import Mathlib.Algebra.Algebra.Subalgebra.Pointwise +public import Mathlib.Algebra.Algebra.Subalgebra.Prod +public import Mathlib.Algebra.Algebra.Subalgebra.Rank +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Algebra.Algebra.Subalgebra.Unitization +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Algebra.TransferInstance +public import Mathlib.Algebra.Algebra.Unitization +public import Mathlib.Algebra.Algebra.ZMod +public import Mathlib.Algebra.AlgebraicCard +public import Mathlib.Algebra.ArithmeticGeometric +public import Mathlib.Algebra.Azumaya.Basic +public import Mathlib.Algebra.Azumaya.Defs +public import Mathlib.Algebra.Azumaya.Matrix +public import Mathlib.Algebra.BigOperators.Associated +public import Mathlib.Algebra.BigOperators.Balance +public import Mathlib.Algebra.BigOperators.Expect +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Algebra.BigOperators.Finsupp.Fin +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Algebra.BigOperators.Group.Finset.Indicator +public import Mathlib.Algebra.BigOperators.Group.Finset.Interval +public import Mathlib.Algebra.BigOperators.Group.Finset.Lemmas +public import Mathlib.Algebra.BigOperators.Group.Finset.Pi +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.BigOperators.Group.Finset.Powerset +public import Mathlib.Algebra.BigOperators.Group.Finset.Preimage +public import Mathlib.Algebra.BigOperators.Group.Finset.Sigma +public import Mathlib.Algebra.BigOperators.Group.List.Basic +public import Mathlib.Algebra.BigOperators.Group.List.Defs +public import Mathlib.Algebra.BigOperators.Group.List.Lemmas +public import Mathlib.Algebra.BigOperators.Group.Multiset.Basic +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.BigOperators.GroupWithZero.Finset +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Algebra.BigOperators.Module +public import Mathlib.Algebra.BigOperators.NatAntidiagonal +public import Mathlib.Algebra.BigOperators.Option +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.BigOperators.Ring.List +public import Mathlib.Algebra.BigOperators.Ring.Multiset +public import Mathlib.Algebra.BigOperators.Ring.Nat +public import Mathlib.Algebra.BigOperators.RingEquiv +public import Mathlib.Algebra.BigOperators.Sym +public import Mathlib.Algebra.BigOperators.WithTop +public import Mathlib.Algebra.BrauerGroup.Defs +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.Algebra.Category.AlgCat.Limits +public import Mathlib.Algebra.Category.AlgCat.Monoidal +public import Mathlib.Algebra.Category.AlgCat.Symmetric +public import Mathlib.Algebra.Category.AlgebraCat.Symmetric +public import Mathlib.Algebra.Category.BialgCat.Basic +public import Mathlib.Algebra.Category.BialgCat.Monoidal +public import Mathlib.Algebra.Category.BoolRing +public import Mathlib.Algebra.Category.CoalgCat.Basic +public import Mathlib.Algebra.Category.CoalgCat.ComonEquivalence +public import Mathlib.Algebra.Category.CoalgCat.Monoidal +public import Mathlib.Algebra.Category.CommAlgCat.Basic +public import Mathlib.Algebra.Category.CommAlgCat.FiniteType +public import Mathlib.Algebra.Category.CommAlgCat.Monoidal +public import Mathlib.Algebra.Category.CommBialgCat +public import Mathlib.Algebra.Category.ContinuousCohomology.Basic +public import Mathlib.Algebra.Category.FGModuleCat.Abelian +public import Mathlib.Algebra.Category.FGModuleCat.Basic +public import Mathlib.Algebra.Category.FGModuleCat.Colimits +public import Mathlib.Algebra.Category.FGModuleCat.EssentiallySmall +public import Mathlib.Algebra.Category.FGModuleCat.Limits +public import Mathlib.Algebra.Category.Grp.AB +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.Algebra.Category.Grp.Adjunctions +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.Algebra.Category.Grp.Biproducts +public import Mathlib.Algebra.Category.Grp.CartesianMonoidal +public import Mathlib.Algebra.Category.Grp.ChosenFiniteProducts +public import Mathlib.Algebra.Category.Grp.Colimits +public import Mathlib.Algebra.Category.Grp.EnoughInjectives +public import Mathlib.Algebra.Category.Grp.EpiMono +public import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup +public import Mathlib.Algebra.Category.Grp.FilteredColimits +public import Mathlib.Algebra.Category.Grp.FiniteGrp +public import Mathlib.Algebra.Category.Grp.ForgetCorepresentable +public import Mathlib.Algebra.Category.Grp.Images +public import Mathlib.Algebra.Category.Grp.Injective +public import Mathlib.Algebra.Category.Grp.IsFinite +public import Mathlib.Algebra.Category.Grp.Kernels +public import Mathlib.Algebra.Category.Grp.LargeColimits +public import Mathlib.Algebra.Category.Grp.LeftExactFunctor +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.Algebra.Category.Grp.Subobject +public import Mathlib.Algebra.Category.Grp.Ulift +public import Mathlib.Algebra.Category.Grp.Yoneda +public import Mathlib.Algebra.Category.Grp.ZModuleEquivalence +public import Mathlib.Algebra.Category.Grp.Zero +public import Mathlib.Algebra.Category.GrpWithZero +public import Mathlib.Algebra.Category.HopfAlgCat.Basic +public import Mathlib.Algebra.Category.HopfAlgCat.Monoidal +public import Mathlib.Algebra.Category.ModuleCat.AB +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Adjunctions +public import Mathlib.Algebra.Category.ModuleCat.Algebra +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Biproducts +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic +public import Mathlib.Algebra.Category.ModuleCat.Differentials.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.EnoughInjectives +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.ExteriorPower +public import Mathlib.Algebra.Category.ModuleCat.FilteredColimits +public import Mathlib.Algebra.Category.ModuleCat.Free +public import Mathlib.Algebra.Category.ModuleCat.Images +public import Mathlib.Algebra.Category.ModuleCat.Injective +public import Mathlib.Algebra.Category.ModuleCat.Kernels +public import Mathlib.Algebra.Category.ModuleCat.LeftResolution +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Free +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Generator +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Monoidal +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafify +public import Mathlib.Algebra.Category.ModuleCat.Products +public import Mathlib.Algebra.Category.ModuleCat.Projective +public import Mathlib.Algebra.Category.ModuleCat.Pseudofunctor +public import Mathlib.Algebra.Category.ModuleCat.Semi +public import Mathlib.Algebra.Category.ModuleCat.Sheaf +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.ChangeOfRings +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Free +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Generators +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Limits +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackFree +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Quasicoherent +public import Mathlib.Algebra.Category.ModuleCat.Simple +public import Mathlib.Algebra.Category.ModuleCat.Subobject +public import Mathlib.Algebra.Category.ModuleCat.Tannaka +public import Mathlib.Algebra.Category.ModuleCat.Topology.Basic +public import Mathlib.Algebra.Category.ModuleCat.Topology.Homology +public import Mathlib.Algebra.Category.MonCat.Adjunctions +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Category.MonCat.Colimits +public import Mathlib.Algebra.Category.MonCat.FilteredColimits +public import Mathlib.Algebra.Category.MonCat.ForgetCorepresentable +public import Mathlib.Algebra.Category.MonCat.Limits +public import Mathlib.Algebra.Category.MonCat.Yoneda +public import Mathlib.Algebra.Category.Ring.Adjunctions +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.Category.Ring.Constructions +public import Mathlib.Algebra.Category.Ring.Epi +public import Mathlib.Algebra.Category.Ring.FilteredColimits +public import Mathlib.Algebra.Category.Ring.FinitePresentation +public import Mathlib.Algebra.Category.Ring.Instances +public import Mathlib.Algebra.Category.Ring.Limits +public import Mathlib.Algebra.Category.Ring.LinearAlgebra +public import Mathlib.Algebra.Category.Ring.Topology +public import Mathlib.Algebra.Category.Ring.Under.Basic +public import Mathlib.Algebra.Category.Ring.Under.Limits +public import Mathlib.Algebra.Category.Semigrp.Basic +public import Mathlib.Algebra.Central.Basic +public import Mathlib.Algebra.Central.Defs +public import Mathlib.Algebra.Central.Matrix +public import Mathlib.Algebra.Central.TensorProduct +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.Algebra.CharP.CharAndCard +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.CharP.Frobenius +public import Mathlib.Algebra.CharP.IntermediateField +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.Algebra.CharP.LinearMaps +public import Mathlib.Algebra.CharP.LocalRing +public import Mathlib.Algebra.CharP.MixedCharZero +public import Mathlib.Algebra.CharP.Pi +public import Mathlib.Algebra.CharP.Quotient +public import Mathlib.Algebra.CharP.Reduced +public import Mathlib.Algebra.CharP.Subring +public import Mathlib.Algebra.CharP.Two +public import Mathlib.Algebra.CharZero.AddMonoidHom +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.CharZero.Infinite +public import Mathlib.Algebra.CharZero.Quotient +public import Mathlib.Algebra.Colimit.DirectLimit +public import Mathlib.Algebra.Colimit.Finiteness +public import Mathlib.Algebra.Colimit.Module +public import Mathlib.Algebra.Colimit.Ring +public import Mathlib.Algebra.Colimit.TensorProduct +public import Mathlib.Algebra.ContinuedFractions.Basic +public import Mathlib.Algebra.ContinuedFractions.Computation.ApproximationCorollaries +public import Mathlib.Algebra.ContinuedFractions.Computation.Approximations +public import Mathlib.Algebra.ContinuedFractions.Computation.Basic +public import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating +public import Mathlib.Algebra.ContinuedFractions.Computation.TerminatesIffRat +public import Mathlib.Algebra.ContinuedFractions.Computation.Translations +public import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence +public import Mathlib.Algebra.ContinuedFractions.ConvergentsEquiv +public import Mathlib.Algebra.ContinuedFractions.Determinant +public import Mathlib.Algebra.ContinuedFractions.TerminatedStable +public import Mathlib.Algebra.ContinuedFractions.Translations +public import Mathlib.Algebra.CubicDiscriminant +public import Mathlib.Algebra.DirectSum.AddChar +public import Mathlib.Algebra.DirectSum.Algebra +public import Mathlib.Algebra.DirectSum.Basic +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.Algebra.DirectSum.Finsupp +public import Mathlib.Algebra.DirectSum.Idempotents +public import Mathlib.Algebra.DirectSum.Internal +public import Mathlib.Algebra.DirectSum.LinearMap +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.DirectSum.Ring +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Divisibility.Finite +public import Mathlib.Algebra.Divisibility.Hom +public import Mathlib.Algebra.Divisibility.Prod +public import Mathlib.Algebra.Divisibility.Units +public import Mathlib.Algebra.DualNumber +public import Mathlib.Algebra.DualQuaternion +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.EuclideanDomain.Defs +public import Mathlib.Algebra.EuclideanDomain.Field +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.Exact +public import Mathlib.Algebra.Expr +public import Mathlib.Algebra.Field.Action.ConjAct +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Field.Equiv +public import Mathlib.Algebra.Field.GeomSum +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Algebra.Field.MinimalAxioms +public import Mathlib.Algebra.Field.NegOnePow +public import Mathlib.Algebra.Field.Opposite +public import Mathlib.Algebra.Field.Periodic +public import Mathlib.Algebra.Field.Power +public import Mathlib.Algebra.Field.Rat +public import Mathlib.Algebra.Field.Shrink +public import Mathlib.Algebra.Field.Subfield.Basic +public import Mathlib.Algebra.Field.Subfield.Defs +public import Mathlib.Algebra.Field.TransferInstance +public import Mathlib.Algebra.Field.ULift +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.Algebra.FiveLemma +public import Mathlib.Algebra.Free +public import Mathlib.Algebra.FreeAbelianGroup.Finsupp +public import Mathlib.Algebra.FreeAbelianGroup.UniqueSums +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.Algebra.FreeAlgebra.Cardinality +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Algebra.FreeMonoid.Count +public import Mathlib.Algebra.FreeMonoid.Symbols +public import Mathlib.Algebra.FreeMonoid.UniqueProds +public import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Algebra.GCDMonoid.Finset +public import Mathlib.Algebra.GCDMonoid.IntegrallyClosed +public import Mathlib.Algebra.GCDMonoid.Multiset +public import Mathlib.Algebra.GCDMonoid.Nat +public import Mathlib.Algebra.GCDMonoid.PUnit +public import Mathlib.Algebra.GeomSum +public import Mathlib.Algebra.GradedMonoid +public import Mathlib.Algebra.GradedMulAction +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Algebra.Group.Action.Equidecomp +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Group.Action.Hom +public import Mathlib.Algebra.Group.Action.Opposite +public import Mathlib.Algebra.Group.Action.Option +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Finite +public import Mathlib.Algebra.Group.Action.Pretransitive +public import Mathlib.Algebra.Group.Action.Prod +public import Mathlib.Algebra.Group.Action.Sigma +public import Mathlib.Algebra.Group.Action.Sum +public import Mathlib.Algebra.Group.Action.TransferInstance +public import Mathlib.Algebra.Group.Action.TypeTags +public import Mathlib.Algebra.Group.Action.Units +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Center +public import Mathlib.Algebra.Group.Commutator +public import Mathlib.Algebra.Group.Commute.Basic +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Commute.Hom +public import Mathlib.Algebra.Group.Commute.Units +public import Mathlib.Algebra.Group.Conj +public import Mathlib.Algebra.Group.ConjFinite +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Algebra.Group.End +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Equiv.Finite +public import Mathlib.Algebra.Group.Equiv.Opposite +public import Mathlib.Algebra.Group.Equiv.TypeTags +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.EvenFunction +public import Mathlib.Algebra.Group.Ext +public import Mathlib.Algebra.Group.Fin.Basic +public import Mathlib.Algebra.Group.Fin.Tuple +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Algebra.Group.ForwardDiff +public import Mathlib.Algebra.Group.Graph +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.Group.Hom.CompTypeclasses +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Hom.End +public import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.Group.Ideal +public import Mathlib.Algebra.Group.Idempotent +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Group.Int.Even +public import Mathlib.Algebra.Group.Int.TypeTags +public import Mathlib.Algebra.Group.Int.Units +public import Mathlib.Algebra.Group.Invertible.Basic +public import Mathlib.Algebra.Group.Invertible.Defs +public import Mathlib.Algebra.Group.Irreducible.Defs +public import Mathlib.Algebra.Group.Irreducible.Lemmas +public import Mathlib.Algebra.Group.MinimalAxioms +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.Nat.Even +public import Mathlib.Algebra.Group.Nat.Hom +public import Mathlib.Algebra.Group.Nat.Range +public import Mathlib.Algebra.Group.Nat.TypeTags +public import Mathlib.Algebra.Group.Nat.Units +public import Mathlib.Algebra.Group.NatPowAssoc +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Group.PNatPowAssoc +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Group.Pi.Units +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic +public import Mathlib.Algebra.Group.Pointwise.Finset.BigOperators +public import Mathlib.Algebra.Group.Pointwise.Finset.Density +public import Mathlib.Algebra.Group.Pointwise.Finset.Interval +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.BigOperators +public import Mathlib.Algebra.Group.Pointwise.Set.Card +public import Mathlib.Algebra.Group.Pointwise.Set.Finite +public import Mathlib.Algebra.Group.Pointwise.Set.Lattice +public import Mathlib.Algebra.Group.Pointwise.Set.ListOfFn +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Group.Pointwise.Set.Small +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Group.Semiconj.Basic +public import Mathlib.Algebra.Group.Semiconj.Defs +public import Mathlib.Algebra.Group.Semiconj.Units +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.Algebra.Group.Subgroup.Actions +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Group.Subgroup.Even +public import Mathlib.Algebra.Group.Subgroup.Finite +public import Mathlib.Algebra.Group.Subgroup.Finsupp +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.Algebra.Group.Subgroup.Map +public import Mathlib.Algebra.Group.Subgroup.MulOpposite +public import Mathlib.Algebra.Group.Subgroup.MulOppositeLemmas +public import Mathlib.Algebra.Group.Subgroup.Order +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Lemmas +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Group.Submonoid.DistribMulAction +public import Mathlib.Algebra.Group.Submonoid.Finite +public import Mathlib.Algebra.Group.Submonoid.Finsupp +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Algebra.Group.Submonoid.MulAction +public import Mathlib.Algebra.Group.Submonoid.MulOpposite +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Group.Submonoid.Pointwise +public import Mathlib.Algebra.Group.Submonoid.Units +public import Mathlib.Algebra.Group.Subsemigroup.Basic +public import Mathlib.Algebra.Group.Subsemigroup.Defs +public import Mathlib.Algebra.Group.Subsemigroup.Membership +public import Mathlib.Algebra.Group.Subsemigroup.Operations +public import Mathlib.Algebra.Group.Support +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Algebra.Group.Translate +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.Algebra.Group.TypeTags.Hom +public import Mathlib.Algebra.Group.ULift +public import Mathlib.Algebra.Group.UniqueProds.Basic +public import Mathlib.Algebra.Group.UniqueProds.VectorSpace +public import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.Group.Units.Hom +public import Mathlib.Algebra.Group.Units.Opposite +public import Mathlib.Algebra.Group.WithOne.Basic +public import Mathlib.Algebra.Group.WithOne.Defs +public import Mathlib.Algebra.Group.WithOne.Map +public import Mathlib.Algebra.GroupWithZero.Action.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Center +public import Mathlib.Algebra.GroupWithZero.Action.ConjAct +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.Action.End +public import Mathlib.Algebra.GroupWithZero.Action.Faithful +public import Mathlib.Algebra.GroupWithZero.Action.Hom +public import Mathlib.Algebra.GroupWithZero.Action.Opposite +public import Mathlib.Algebra.GroupWithZero.Action.Pi +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Finset +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set +public import Mathlib.Algebra.GroupWithZero.Action.Prod +public import Mathlib.Algebra.GroupWithZero.Action.TransferInstance +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Algebra.GroupWithZero.Center +public import Mathlib.Algebra.GroupWithZero.Commute +public import Mathlib.Algebra.GroupWithZero.Conj +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.GroupWithZero.Equiv +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.GroupWithZero.Idempotent +public import Mathlib.Algebra.GroupWithZero.Indicator +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.GroupWithZero.Int +public import Mathlib.Algebra.GroupWithZero.Invertible +public import Mathlib.Algebra.GroupWithZero.Nat +public import Mathlib.Algebra.GroupWithZero.NeZero +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Algebra.GroupWithZero.Opposite +public import Mathlib.Algebra.GroupWithZero.Pi +public import Mathlib.Algebra.GroupWithZero.Pointwise.Finset +public import Mathlib.Algebra.GroupWithZero.Pointwise.Set.Basic +public import Mathlib.Algebra.GroupWithZero.Pointwise.Set.Card +public import Mathlib.Algebra.GroupWithZero.Prod +public import Mathlib.Algebra.GroupWithZero.ProdHom +public import Mathlib.Algebra.GroupWithZero.Range +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.GroupWithZero.Semiconj +public import Mathlib.Algebra.GroupWithZero.Shrink +public import Mathlib.Algebra.GroupWithZero.Subgroup +public import Mathlib.Algebra.GroupWithZero.Submonoid.CancelMulZero +public import Mathlib.Algebra.GroupWithZero.Submonoid.Instances +public import Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise +public import Mathlib.Algebra.GroupWithZero.Submonoid.Primal +public import Mathlib.Algebra.GroupWithZero.Torsion +public import Mathlib.Algebra.GroupWithZero.TransferInstance +public import Mathlib.Algebra.GroupWithZero.ULift +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Equiv +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.GroupWithZero.WithZero +public import Mathlib.Algebra.HierarchyDesign +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.Algebra.Homology.AlternatingConst +public import Mathlib.Algebra.Homology.Augment +public import Mathlib.Algebra.Homology.Bifunctor +public import Mathlib.Algebra.Homology.BifunctorAssociator +public import Mathlib.Algebra.Homology.BifunctorFlip +public import Mathlib.Algebra.Homology.BifunctorHomotopy +public import Mathlib.Algebra.Homology.BifunctorShift +public import Mathlib.Algebra.Homology.CommSq +public import Mathlib.Algebra.Homology.ComplexShape +public import Mathlib.Algebra.Homology.ComplexShapeSigns +public import Mathlib.Algebra.Homology.ConcreteCategory +public import Mathlib.Algebra.Homology.DerivedCategory.Basic +public import Mathlib.Algebra.Homology.DerivedCategory.ExactFunctor +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughInjectives +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExtClass +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear +public import Mathlib.Algebra.Homology.DerivedCategory.Fractions +public import Mathlib.Algebra.Homology.DerivedCategory.FullyFaithful +public import Mathlib.Algebra.Homology.DerivedCategory.HomologySequence +public import Mathlib.Algebra.Homology.DerivedCategory.Linear +public import Mathlib.Algebra.Homology.DerivedCategory.ShortExact +public import Mathlib.Algebra.Homology.DerivedCategory.SingleTriangle +public import Mathlib.Algebra.Homology.DerivedCategory.TStructure +public import Mathlib.Algebra.Homology.DifferentialObject +public import Mathlib.Algebra.Homology.Double +public import Mathlib.Algebra.Homology.Embedding.AreComplementary +public import Mathlib.Algebra.Homology.Embedding.Basic +public import Mathlib.Algebra.Homology.Embedding.Boundary +public import Mathlib.Algebra.Homology.Embedding.CochainComplex +public import Mathlib.Algebra.Homology.Embedding.Connect +public import Mathlib.Algebra.Homology.Embedding.Extend +public import Mathlib.Algebra.Homology.Embedding.ExtendHomology +public import Mathlib.Algebra.Homology.Embedding.HomEquiv +public import Mathlib.Algebra.Homology.Embedding.IsSupported +public import Mathlib.Algebra.Homology.Embedding.Restriction +public import Mathlib.Algebra.Homology.Embedding.RestrictionHomology +public import Mathlib.Algebra.Homology.Embedding.StupidTrunc +public import Mathlib.Algebra.Homology.Embedding.TruncGE +public import Mathlib.Algebra.Homology.Embedding.TruncGEHomology +public import Mathlib.Algebra.Homology.Embedding.TruncLE +public import Mathlib.Algebra.Homology.Embedding.TruncLEHomology +public import Mathlib.Algebra.Homology.ExactSequence +public import Mathlib.Algebra.Homology.Factorizations.Basic +public import Mathlib.Algebra.Homology.Functor +public import Mathlib.Algebra.Homology.GrothendieckAbelian +public import Mathlib.Algebra.Homology.HasNoLoop +public import Mathlib.Algebra.Homology.HomologicalBicomplex +public import Mathlib.Algebra.Homology.HomologicalComplex +public import Mathlib.Algebra.Homology.HomologicalComplexAbelian +public import Mathlib.Algebra.Homology.HomologicalComplexBiprod +public import Mathlib.Algebra.Homology.HomologicalComplexLimits +public import Mathlib.Algebra.Homology.HomologySequence +public import Mathlib.Algebra.Homology.HomologySequenceLemmas +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.Algebra.Homology.HomotopyCategory +public import Mathlib.Algebra.Homology.HomotopyCategory.DegreewiseSplit +public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex +public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexShift +public import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor +public import Mathlib.Algebra.Homology.HomotopyCategory.MappingCone +public import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated +public import Mathlib.Algebra.Homology.HomotopyCategory.Shift +public import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence +public import Mathlib.Algebra.Homology.HomotopyCategory.ShortExact +public import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors +public import Mathlib.Algebra.Homology.HomotopyCategory.Triangulated +public import Mathlib.Algebra.Homology.HomotopyCofiber +public import Mathlib.Algebra.Homology.ImageToKernel +public import Mathlib.Algebra.Homology.LeftResolution.Basic +public import Mathlib.Algebra.Homology.LeftResolution.Reduced +public import Mathlib.Algebra.Homology.LeftResolution.Transport +public import Mathlib.Algebra.Homology.Linear +public import Mathlib.Algebra.Homology.LocalCohomology +public import Mathlib.Algebra.Homology.Localization +public import Mathlib.Algebra.Homology.Monoidal +public import Mathlib.Algebra.Homology.Opposite +public import Mathlib.Algebra.Homology.QuasiIso +public import Mathlib.Algebra.Homology.Refinements +public import Mathlib.Algebra.Homology.ShortComplex.Ab +public import Mathlib.Algebra.Homology.ShortComplex.Abelian +public import Mathlib.Algebra.Homology.ShortComplex.Basic +public import Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor +public import Mathlib.Algebra.Homology.ShortComplex.FunctorEquivalence +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Algebra.Homology.ShortComplex.Homology +public import Mathlib.Algebra.Homology.ShortComplex.LeftHomology +public import Mathlib.Algebra.Homology.ShortComplex.Limits +public import Mathlib.Algebra.Homology.ShortComplex.Linear +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.Algebra.Homology.ShortComplex.Preadditive +public import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology +public import Mathlib.Algebra.Homology.ShortComplex.QuasiIso +public import Mathlib.Algebra.Homology.ShortComplex.Retract +public import Mathlib.Algebra.Homology.ShortComplex.RightHomology +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma +public import Mathlib.Algebra.Homology.Single +public import Mathlib.Algebra.Homology.SingleHomology +public import Mathlib.Algebra.Homology.Square +public import Mathlib.Algebra.Homology.TotalComplex +public import Mathlib.Algebra.Homology.TotalComplexShift +public import Mathlib.Algebra.Homology.TotalComplexSymmetry +public import Mathlib.Algebra.IsPrimePow +public import Mathlib.Algebra.Jordan.Basic +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.Algebra.Lie.BaseChange +public import Mathlib.Algebra.Lie.Basic +public import Mathlib.Algebra.Lie.CartanExists +public import Mathlib.Algebra.Lie.CartanMatrix +public import Mathlib.Algebra.Lie.CartanSubalgebra +public import Mathlib.Algebra.Lie.Character +public import Mathlib.Algebra.Lie.Classical +public import Mathlib.Algebra.Lie.Cochain +public import Mathlib.Algebra.Lie.Derivation.AdjointAction +public import Mathlib.Algebra.Lie.Derivation.Basic +public import Mathlib.Algebra.Lie.Derivation.Killing +public import Mathlib.Algebra.Lie.DirectSum +public import Mathlib.Algebra.Lie.Engel +public import Mathlib.Algebra.Lie.EngelSubalgebra +public import Mathlib.Algebra.Lie.Extension +public import Mathlib.Algebra.Lie.Free +public import Mathlib.Algebra.Lie.Ideal +public import Mathlib.Algebra.Lie.IdealOperations +public import Mathlib.Algebra.Lie.InvariantForm +public import Mathlib.Algebra.Lie.Killing +public import Mathlib.Algebra.Lie.LieTheorem +public import Mathlib.Algebra.Lie.Matrix +public import Mathlib.Algebra.Lie.Nilpotent +public import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra +public import Mathlib.Algebra.Lie.Normalizer +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.Quotient +public import Mathlib.Algebra.Lie.Rank +public import Mathlib.Algebra.Lie.Semisimple.Basic +public import Mathlib.Algebra.Lie.Semisimple.Defs +public import Mathlib.Algebra.Lie.Semisimple.Lemmas +public import Mathlib.Algebra.Lie.SkewAdjoint +public import Mathlib.Algebra.Lie.Sl2 +public import Mathlib.Algebra.Lie.Solvable +public import Mathlib.Algebra.Lie.Subalgebra +public import Mathlib.Algebra.Lie.Submodule +public import Mathlib.Algebra.Lie.TensorProduct +public import Mathlib.Algebra.Lie.TraceForm +public import Mathlib.Algebra.Lie.UniversalEnveloping +public import Mathlib.Algebra.Lie.Weights.Basic +public import Mathlib.Algebra.Lie.Weights.Cartan +public import Mathlib.Algebra.Lie.Weights.Chain +public import Mathlib.Algebra.Lie.Weights.IsSimple +public import Mathlib.Algebra.Lie.Weights.Killing +public import Mathlib.Algebra.Lie.Weights.Linear +public import Mathlib.Algebra.Lie.Weights.RootSystem +public import Mathlib.Algebra.LinearRecurrence +public import Mathlib.Algebra.ModEq +public import Mathlib.Algebra.Module.Basic +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Algebra.Module.Bimodule +public import Mathlib.Algebra.Module.Card +public import Mathlib.Algebra.Module.CharacterModule +public import Mathlib.Algebra.Module.Congruence.Defs +public import Mathlib.Algebra.Module.DedekindDomain +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Module.End +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.Equiv.Opposite +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.Algebra.Module.GradedModule +public import Mathlib.Algebra.Module.Hom +public import Mathlib.Algebra.Module.Injective +public import Mathlib.Algebra.Module.Lattice +public import Mathlib.Algebra.Module.LinearMap.Basic +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Algebra.Module.LinearMap.DivisionRing +public import Mathlib.Algebra.Module.LinearMap.End +public import Mathlib.Algebra.Module.LinearMap.Polynomial +public import Mathlib.Algebra.Module.LinearMap.Prod +public import Mathlib.Algebra.Module.LinearMap.Rat +public import Mathlib.Algebra.Module.LinearMap.Star +public import Mathlib.Algebra.Module.LocalizedModule.AtPrime +public import Mathlib.Algebra.Module.LocalizedModule.Away +public import Mathlib.Algebra.Module.LocalizedModule.Basic +public import Mathlib.Algebra.Module.LocalizedModule.Exact +public import Mathlib.Algebra.Module.LocalizedModule.Int +public import Mathlib.Algebra.Module.LocalizedModule.IsLocalization +public import Mathlib.Algebra.Module.LocalizedModule.Submodule +public import Mathlib.Algebra.Module.MinimalAxioms +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.Algebra.Module.PID +public import Mathlib.Algebra.Module.PUnit +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Module.PointwisePi +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.Algebra.Module.Presentation.Cokernel +public import Mathlib.Algebra.Module.Presentation.Differentials +public import Mathlib.Algebra.Module.Presentation.DirectSum +public import Mathlib.Algebra.Module.Presentation.Finite +public import Mathlib.Algebra.Module.Presentation.Free +public import Mathlib.Algebra.Module.Presentation.RestrictScalars +public import Mathlib.Algebra.Module.Presentation.Tautological +public import Mathlib.Algebra.Module.Presentation.Tensor +public import Mathlib.Algebra.Module.Prod +public import Mathlib.Algebra.Module.Projective +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Algebra.Module.RingHom +public import Mathlib.Algebra.Module.Shrink +public import Mathlib.Algebra.Module.SnakeLemma +public import Mathlib.Algebra.Module.SpanRank +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.Algebra.Module.Submodule.Bilinear +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.Algebra.Module.Submodule.EqLocus +public import Mathlib.Algebra.Module.Submodule.Equiv +public import Mathlib.Algebra.Module.Submodule.Invariant +public import Mathlib.Algebra.Module.Submodule.IterateMapComap +public import Mathlib.Algebra.Module.Submodule.Ker +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.Algebra.Module.Submodule.LinearMap +public import Mathlib.Algebra.Module.Submodule.Map +public import Mathlib.Algebra.Module.Submodule.Order +public import Mathlib.Algebra.Module.Submodule.Pointwise +public import Mathlib.Algebra.Module.Submodule.Range +public import Mathlib.Algebra.Module.Submodule.RestrictScalars +public import Mathlib.Algebra.Module.Submodule.Union +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.Algebra.Module.Torsion.Field +public import Mathlib.Algebra.Module.Torsion.Free +public import Mathlib.Algebra.Module.Torsion.Pi +public import Mathlib.Algebra.Module.Torsion.Prod +public import Mathlib.Algebra.Module.TransferInstance +public import Mathlib.Algebra.Module.ULift +public import Mathlib.Algebra.Module.ZLattice.Basic +public import Mathlib.Algebra.Module.ZLattice.Covolume +public import Mathlib.Algebra.Module.ZLattice.Summable +public import Mathlib.Algebra.Module.ZMod +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Algebra.MonoidAlgebra.Defs +public import Mathlib.Algebra.MonoidAlgebra.Degree +public import Mathlib.Algebra.MonoidAlgebra.Division +public import Mathlib.Algebra.MonoidAlgebra.Grading +public import Mathlib.Algebra.MonoidAlgebra.Ideal +public import Mathlib.Algebra.MonoidAlgebra.Lift +public import Mathlib.Algebra.MonoidAlgebra.MapDomain +public import Mathlib.Algebra.MonoidAlgebra.Module +public import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors +public import Mathlib.Algebra.MonoidAlgebra.Opposite +public import Mathlib.Algebra.MonoidAlgebra.Support +public import Mathlib.Algebra.MonoidAlgebra.ToDirectSum +public import Mathlib.Algebra.MvPolynomial.Basic +public import Mathlib.Algebra.MvPolynomial.Cardinal +public import Mathlib.Algebra.MvPolynomial.Comap +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.MvPolynomial.Counit +public import Mathlib.Algebra.MvPolynomial.Degrees +public import Mathlib.Algebra.MvPolynomial.Derivation +public import Mathlib.Algebra.MvPolynomial.Division +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.Algebra.MvPolynomial.Expand +public import Mathlib.Algebra.MvPolynomial.Funext +public import Mathlib.Algebra.MvPolynomial.Invertible +public import Mathlib.Algebra.MvPolynomial.Monad +public import Mathlib.Algebra.MvPolynomial.Nilpotent +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.Algebra.MvPolynomial.Polynomial +public import Mathlib.Algebra.MvPolynomial.Rename +public import Mathlib.Algebra.MvPolynomial.SchwartzZippel +public import Mathlib.Algebra.MvPolynomial.Supported +public import Mathlib.Algebra.MvPolynomial.Variables +public import Mathlib.Algebra.NeZero +public import Mathlib.Algebra.NoZeroSMulDivisors.Basic +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Algebra.NoZeroSMulDivisors.Pi +public import Mathlib.Algebra.NoZeroSMulDivisors.Prod +public import Mathlib.Algebra.NonAssoc.LieAdmissible.Defs +public import Mathlib.Algebra.NonAssoc.PreLie.Basic +public import Mathlib.Algebra.Notation +public import Mathlib.Algebra.Notation.Defs +public import Mathlib.Algebra.Notation.FiniteSupport +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Algebra.Notation.Lemmas +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Algebra.Opposites +public import Mathlib.Algebra.Order.AbsoluteValue.Basic +public import Mathlib.Algebra.Order.AbsoluteValue.Euclidean +public import Mathlib.Algebra.Order.AddGroupWithTop +public import Mathlib.Algebra.Order.AddTorsor +public import Mathlib.Algebra.Order.Algebra +public import Mathlib.Algebra.Order.Antidiag.Finsupp +public import Mathlib.Algebra.Order.Antidiag.Nat +public import Mathlib.Algebra.Order.Antidiag.Pi +public import Mathlib.Algebra.Order.Antidiag.Prod +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Order.Archimedean.Class +public import Mathlib.Algebra.Order.Archimedean.Hom +public import Mathlib.Algebra.Order.Archimedean.IndicatorCard +public import Mathlib.Algebra.Order.Archimedean.Submonoid +public import Mathlib.Algebra.Order.BigOperators.Expect +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.BigOperators.Group.List +public import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite +public import Mathlib.Algebra.Order.BigOperators.Group.Multiset +public import Mathlib.Algebra.Order.BigOperators.GroupWithZero.List +public import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Multiset +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.BigOperators.Ring.List +public import Mathlib.Algebra.Order.BigOperators.Ring.Multiset +public import Mathlib.Algebra.Order.CauSeq.Basic +public import Mathlib.Algebra.Order.CauSeq.BigOperators +public import Mathlib.Algebra.Order.CauSeq.Completion +public import Mathlib.Algebra.Order.Chebyshev +public import Mathlib.Algebra.Order.CompleteField +public import Mathlib.Algebra.Order.Disjointed +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Algebra.Order.Field.Canonical +public import Mathlib.Algebra.Order.Field.Defs +public import Mathlib.Algebra.Order.Field.GeomSum +public import Mathlib.Algebra.Order.Field.InjSurj +public import Mathlib.Algebra.Order.Field.Pi +public import Mathlib.Algebra.Order.Field.Pointwise +public import Mathlib.Algebra.Order.Field.Power +public import Mathlib.Algebra.Order.Field.Rat +public import Mathlib.Algebra.Order.Field.Subfield +public import Mathlib.Algebra.Order.Floor +public import Mathlib.Algebra.Order.Floor.Defs +public import Mathlib.Algebra.Order.Floor.Div +public import Mathlib.Algebra.Order.Floor.Ring +public import Mathlib.Algebra.Order.Floor.Semifield +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Order.Group.Action +public import Mathlib.Algebra.Order.Group.Action.End +public import Mathlib.Algebra.Order.Group.Action.Flag +public import Mathlib.Algebra.Order.Group.Action.Synonym +public import Mathlib.Algebra.Order.Group.Basic +public import Mathlib.Algebra.Order.Group.Bounds +public import Mathlib.Algebra.Order.Group.CompleteLattice +public import Mathlib.Algebra.Order.Group.Cone +public import Mathlib.Algebra.Order.Group.Cyclic +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Group.DenselyOrdered +public import Mathlib.Algebra.Order.Group.End +public import Mathlib.Algebra.Order.Group.Equiv +public import Mathlib.Algebra.Order.Group.Finset +public import Mathlib.Algebra.Order.Group.Ideal +public import Mathlib.Algebra.Order.Group.Indicator +public import Mathlib.Algebra.Order.Group.InjSurj +public import Mathlib.Algebra.Order.Group.Instances +public import Mathlib.Algebra.Order.Group.Int +public import Mathlib.Algebra.Order.Group.Int.Sum +public import Mathlib.Algebra.Order.Group.Lattice +public import Mathlib.Algebra.Order.Group.MinMax +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Group.Opposite +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Algebra.Order.Group.PartialSups +public import Mathlib.Algebra.Order.Group.PiLex +public import Mathlib.Algebra.Order.Group.Pointwise.Bounds +public import Mathlib.Algebra.Order.Group.Pointwise.CompleteLattice +public import Mathlib.Algebra.Order.Group.Pointwise.Interval +public import Mathlib.Algebra.Order.Group.PosPart +public import Mathlib.Algebra.Order.Group.Prod +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Order.Group.TypeTags +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Order.Group.Units +public import Mathlib.Algebra.Order.GroupWithZero.Action.Synonym +public import Mathlib.Algebra.Order.GroupWithZero.Bounds +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.GroupWithZero.Finset +public import Mathlib.Algebra.Order.GroupWithZero.Lex +public import Mathlib.Algebra.Order.GroupWithZero.Submonoid +public import Mathlib.Algebra.Order.GroupWithZero.Synonym +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Lemmas +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso +public import Mathlib.Algebra.Order.GroupWithZero.WithZero +public import Mathlib.Algebra.Order.Hom.Basic +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Algebra.Order.Hom.MonoidWithZero +public import Mathlib.Algebra.Order.Hom.Ring +public import Mathlib.Algebra.Order.Hom.Submonoid +public import Mathlib.Algebra.Order.Hom.TypeTags +public import Mathlib.Algebra.Order.Hom.Units +public import Mathlib.Algebra.Order.Interval.Basic +public import Mathlib.Algebra.Order.Interval.Finset.Basic +public import Mathlib.Algebra.Order.Interval.Finset.SuccPred +public import Mathlib.Algebra.Order.Interval.Multiset +public import Mathlib.Algebra.Order.Interval.Set.Group +public import Mathlib.Algebra.Order.Interval.Set.Instances +public import Mathlib.Algebra.Order.Interval.Set.Monoid +public import Mathlib.Algebra.Order.Interval.Set.SuccPred +public import Mathlib.Algebra.Order.Invertible +public import Mathlib.Algebra.Order.Kleene +public import Mathlib.Algebra.Order.Module.Algebra +public import Mathlib.Algebra.Order.Module.Archimedean +public import Mathlib.Algebra.Order.Module.Basic +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Module.Equiv +public import Mathlib.Algebra.Order.Module.Field +public import Mathlib.Algebra.Order.Module.HahnEmbedding +public import Mathlib.Algebra.Order.Module.OrderedSMul +public import Mathlib.Algebra.Order.Module.Pointwise +public import Mathlib.Algebra.Order.Module.PositiveLinearMap +public import Mathlib.Algebra.Order.Module.Rat +public import Mathlib.Algebra.Order.Module.Synonym +public import Mathlib.Algebra.Order.Monoid.Associated +public import Mathlib.Algebra.Order.Monoid.Basic +public import Mathlib.Algebra.Order.Monoid.Canonical.Basic +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Lex +public import Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder +public import Mathlib.Algebra.Order.Monoid.NatCast +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Algebra.Order.Monoid.PNat +public import Mathlib.Algebra.Order.Monoid.Prod +public import Mathlib.Algebra.Order.Monoid.Submonoid +public import Mathlib.Algebra.Order.Monoid.ToMulBot +public import Mathlib.Algebra.Order.Monoid.TypeTags +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags +public import Mathlib.Algebra.Order.Monoid.Unbundled.Units +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Algebra.Order.Monoid.Units +public import Mathlib.Algebra.Order.Monoid.WithTop +public import Mathlib.Algebra.Order.Monovary +public import Mathlib.Algebra.Order.Nonneg.Basic +public import Mathlib.Algebra.Order.Nonneg.Field +public import Mathlib.Algebra.Order.Nonneg.Floor +public import Mathlib.Algebra.Order.Nonneg.Lattice +public import Mathlib.Algebra.Order.Nonneg.Module +public import Mathlib.Algebra.Order.Nonneg.Ring +public import Mathlib.Algebra.Order.PUnit +public import Mathlib.Algebra.Order.PartialSups +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Algebra.Order.Positive.Field +public import Mathlib.Algebra.Order.Positive.Ring +public import Mathlib.Algebra.Order.Quantale +public import Mathlib.Algebra.Order.Rearrangement +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Algebra.Order.Ring.Archimedean +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Algebra.Order.Ring.Cast +public import Mathlib.Algebra.Order.Ring.Cone +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Order.Ring.Finset +public import Mathlib.Algebra.Order.Ring.GeomSum +public import Mathlib.Algebra.Order.Ring.Idempotent +public import Mathlib.Algebra.Order.Ring.InjSurj +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Algebra.Order.Ring.IsNonarchimedean +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Algebra.Order.Ring.Opposite +public import Mathlib.Algebra.Order.Ring.Ordering.Basic +public import Mathlib.Algebra.Order.Ring.Ordering.Defs +public import Mathlib.Algebra.Order.Ring.Pow +public import Mathlib.Algebra.Order.Ring.Prod +public import Mathlib.Algebra.Order.Ring.Rat +public import Mathlib.Algebra.Order.Ring.Star +public import Mathlib.Algebra.Order.Ring.Synonym +public import Mathlib.Algebra.Order.Ring.Unbundled.Basic +public import Mathlib.Algebra.Order.Ring.Unbundled.Rat +public import Mathlib.Algebra.Order.Ring.Units +public import Mathlib.Algebra.Order.Ring.WithTop +public import Mathlib.Algebra.Order.Round +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Algebra.Order.Star.Conjneg +public import Mathlib.Algebra.Order.Star.Pi +public import Mathlib.Algebra.Order.Star.Prod +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Algebra.Order.Sub.Prod +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic +public import Mathlib.Algebra.Order.Sub.Unbundled.Hom +public import Mathlib.Algebra.Order.Sub.WithTop +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Algebra.Order.SuccPred.PartialSups +public import Mathlib.Algebra.Order.SuccPred.TypeTags +public import Mathlib.Algebra.Order.SuccPred.WithBot +public import Mathlib.Algebra.Order.Sum +public import Mathlib.Algebra.Order.ToIntervalMod +public import Mathlib.Algebra.Order.UpperLower +public import Mathlib.Algebra.Order.WithTop.Untop0 +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Algebra.PEmptyInstances +public import Mathlib.Algebra.Pointwise.Stabilizer +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.Algebra.Polynomial.Basis +public import Mathlib.Algebra.Polynomial.BigOperators +public import Mathlib.Algebra.Polynomial.Bivariate +public import Mathlib.Algebra.Polynomial.CancelLeads +public import Mathlib.Algebra.Polynomial.Cardinal +public import Mathlib.Algebra.Polynomial.Coeff +public import Mathlib.Algebra.Polynomial.CoeffList +public import Mathlib.Algebra.Polynomial.CoeffMem +public import Mathlib.Algebra.Polynomial.Degree.CardPowDegree +public import Mathlib.Algebra.Polynomial.Degree.Definitions +public import Mathlib.Algebra.Polynomial.Degree.Domain +public import Mathlib.Algebra.Polynomial.Degree.IsMonicOfDegree +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Algebra.Polynomial.Degree.Monomial +public import Mathlib.Algebra.Polynomial.Degree.Operations +public import Mathlib.Algebra.Polynomial.Degree.SmallDegree +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Algebra.Polynomial.Degree.TrailingDegree +public import Mathlib.Algebra.Polynomial.Degree.Units +public import Mathlib.Algebra.Polynomial.DenomsClearable +public import Mathlib.Algebra.Polynomial.Derivation +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.Algebra.Polynomial.EraseLead +public import Mathlib.Algebra.Polynomial.Eval.Algebra +public import Mathlib.Algebra.Polynomial.Eval.Coeff +public import Mathlib.Algebra.Polynomial.Eval.Defs +public import Mathlib.Algebra.Polynomial.Eval.Degree +public import Mathlib.Algebra.Polynomial.Eval.Irreducible +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.Algebra.Polynomial.Eval.Subring +public import Mathlib.Algebra.Polynomial.Expand +public import Mathlib.Algebra.Polynomial.Factors +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.Algebra.Polynomial.GroupRingAction +public import Mathlib.Algebra.Polynomial.HasseDeriv +public import Mathlib.Algebra.Polynomial.Homogenize +public import Mathlib.Algebra.Polynomial.Identities +public import Mathlib.Algebra.Polynomial.Inductions +public import Mathlib.Algebra.Polynomial.Laurent +public import Mathlib.Algebra.Polynomial.Lifts +public import Mathlib.Algebra.Polynomial.Mirror +public import Mathlib.Algebra.Polynomial.Module.AEval +public import Mathlib.Algebra.Polynomial.Module.Basic +public import Mathlib.Algebra.Polynomial.Module.FiniteDimensional +public import Mathlib.Algebra.Polynomial.Module.TensorProduct +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.Algebra.Polynomial.Monomial +public import Mathlib.Algebra.Polynomial.OfFn +public import Mathlib.Algebra.Polynomial.PartialFractions +public import Mathlib.Algebra.Polynomial.Reverse +public import Mathlib.Algebra.Polynomial.RingDivision +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Algebra.Polynomial.RuleOfSigns +public import Mathlib.Algebra.Polynomial.Sequence +public import Mathlib.Algebra.Polynomial.Smeval +public import Mathlib.Algebra.Polynomial.SpecificDegree +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.Algebra.Polynomial.SumIteratedDerivative +public import Mathlib.Algebra.Polynomial.Taylor +public import Mathlib.Algebra.Polynomial.UnitTrinomial +public import Mathlib.Algebra.PresentedMonoid.Basic +public import Mathlib.Algebra.Prime.Defs +public import Mathlib.Algebra.Prime.Lemmas +public import Mathlib.Algebra.QuadraticAlgebra +public import Mathlib.Algebra.QuadraticAlgebra.Basic +public import Mathlib.Algebra.QuadraticAlgebra.Defs +public import Mathlib.Algebra.QuadraticAlgebra.NormDeterminant +public import Mathlib.Algebra.QuadraticDiscriminant +public import Mathlib.Algebra.Quandle +public import Mathlib.Algebra.Quaternion +public import Mathlib.Algebra.QuaternionBasis +public import Mathlib.Algebra.Quotient +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.Algebra.Regular.Defs +public import Mathlib.Algebra.Regular.Opposite +public import Mathlib.Algebra.Regular.Pi +public import Mathlib.Algebra.Regular.Pow +public import Mathlib.Algebra.Regular.Prod +public import Mathlib.Algebra.Regular.SMul +public import Mathlib.Algebra.Regular.ULift +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.Algebra.Ring.Action.ConjAct +public import Mathlib.Algebra.Ring.Action.End +public import Mathlib.Algebra.Ring.Action.Field +public import Mathlib.Algebra.Ring.Action.Group +public import Mathlib.Algebra.Ring.Action.Invariant +public import Mathlib.Algebra.Ring.Action.Pointwise.Finset +public import Mathlib.Algebra.Ring.Action.Pointwise.Set +public import Mathlib.Algebra.Ring.Action.Rat +public import Mathlib.Algebra.Ring.Action.Submonoid +public import Mathlib.Algebra.Ring.Action.Subobjects +public import Mathlib.Algebra.Ring.AddAut +public import Mathlib.Algebra.Ring.Associated +public import Mathlib.Algebra.Ring.Associator +public import Mathlib.Algebra.Ring.Aut +public import Mathlib.Algebra.Ring.Basic +public import Mathlib.Algebra.Ring.BooleanRing +public import Mathlib.Algebra.Ring.Center +public import Mathlib.Algebra.Ring.Centralizer +public import Mathlib.Algebra.Ring.CentroidHom +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Algebra.Ring.Commute +public import Mathlib.Algebra.Ring.CompTypeclasses +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Divisibility.Lemmas +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.Ext +public import Mathlib.Algebra.Ring.Fin +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.Algebra.Ring.GrindInstances +public import Mathlib.Algebra.Ring.Hom.Basic +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Algebra.Ring.Hom.InjSurj +public import Mathlib.Algebra.Ring.Idempotent +public import Mathlib.Algebra.Ring.Identities +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Ring.Int.Parity +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.Algebra.Ring.Invertible +public import Mathlib.Algebra.Ring.MinimalAxioms +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.Algebra.Ring.NonZeroDivisors +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Algebra.Ring.PUnit +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Algebra.Ring.Periodic +public import Mathlib.Algebra.Ring.Pi +public import Mathlib.Algebra.Ring.Pointwise.Finset +public import Mathlib.Algebra.Ring.Pointwise.Set +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Algebra.Ring.Rat +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.Algebra.Ring.Semiconj +public import Mathlib.Algebra.Ring.Semireal.Defs +public import Mathlib.Algebra.Ring.Shrink +public import Mathlib.Algebra.Ring.Subgroup +public import Mathlib.Algebra.Ring.Submonoid +public import Mathlib.Algebra.Ring.Submonoid.Basic +public import Mathlib.Algebra.Ring.Submonoid.Pointwise +public import Mathlib.Algebra.Ring.Subring.Basic +public import Mathlib.Algebra.Ring.Subring.Defs +public import Mathlib.Algebra.Ring.Subring.IntPolynomial +public import Mathlib.Algebra.Ring.Subring.MulOpposite +public import Mathlib.Algebra.Ring.Subring.Order +public import Mathlib.Algebra.Ring.Subring.Pointwise +public import Mathlib.Algebra.Ring.Subring.Units +public import Mathlib.Algebra.Ring.Subsemiring.Basic +public import Mathlib.Algebra.Ring.Subsemiring.Defs +public import Mathlib.Algebra.Ring.Subsemiring.MulOpposite +public import Mathlib.Algebra.Ring.Subsemiring.Order +public import Mathlib.Algebra.Ring.Subsemiring.Pointwise +public import Mathlib.Algebra.Ring.SumsOfSquares +public import Mathlib.Algebra.Ring.Torsion +public import Mathlib.Algebra.Ring.TransferInstance +public import Mathlib.Algebra.Ring.ULift +public import Mathlib.Algebra.Ring.Units +public import Mathlib.Algebra.Ring.WithZero +public import Mathlib.Algebra.RingQuot +public import Mathlib.Algebra.SkewMonoidAlgebra.Basic +public import Mathlib.Algebra.SkewMonoidAlgebra.Lift +public import Mathlib.Algebra.SkewMonoidAlgebra.Single +public import Mathlib.Algebra.SkewMonoidAlgebra.Support +public import Mathlib.Algebra.SkewPolynomial.Basic +public import Mathlib.Algebra.Squarefree.Basic +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Algebra.Star.BigOperators +public import Mathlib.Algebra.Star.CHSH +public import Mathlib.Algebra.Star.Center +public import Mathlib.Algebra.Star.CentroidHom +public import Mathlib.Algebra.Star.Conjneg +public import Mathlib.Algebra.Star.Free +public import Mathlib.Algebra.Star.LinearMap +public import Mathlib.Algebra.Star.Module +public import Mathlib.Algebra.Star.MonoidHom +public import Mathlib.Algebra.Star.NonUnitalSubalgebra +public import Mathlib.Algebra.Star.NonUnitalSubsemiring +public import Mathlib.Algebra.Star.Pi +public import Mathlib.Algebra.Star.Pointwise +public import Mathlib.Algebra.Star.Prod +public import Mathlib.Algebra.Star.Rat +public import Mathlib.Algebra.Star.RingQuot +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Star.StarAlgHom +public import Mathlib.Algebra.Star.StarProjection +public import Mathlib.Algebra.Star.StarRingHom +public import Mathlib.Algebra.Star.Subalgebra +public import Mathlib.Algebra.Star.Subsemiring +public import Mathlib.Algebra.Star.TensorProduct +public import Mathlib.Algebra.Star.Unitary +public import Mathlib.Algebra.Star.UnitaryStarAlgAut +public import Mathlib.Algebra.Symmetrized +public import Mathlib.Algebra.TrivSqZeroExt +public import Mathlib.Algebra.Tropical.Basic +public import Mathlib.Algebra.Tropical.BigOperators +public import Mathlib.Algebra.Tropical.Lattice +public import Mathlib.Algebra.Vertex.HVertexOperator +public import Mathlib.Algebra.Vertex.VertexOperator +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.AlgebraicGeometry.AffineSpace +public import Mathlib.AlgebraicGeometry.AffineTransitionLimit +public import Mathlib.AlgebraicGeometry.Cover.Directed +public import Mathlib.AlgebraicGeometry.Cover.MorphismProperty +public import Mathlib.AlgebraicGeometry.Cover.Open +public import Mathlib.AlgebraicGeometry.Cover.Over +public import Mathlib.AlgebraicGeometry.Cover.Sigma +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Basic +public import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Degree +public import Mathlib.AlgebraicGeometry.EllipticCurve.Group +public import Mathlib.AlgebraicGeometry.EllipticCurve.IsomOfJ +public import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Basic +public import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Formula +public import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.ModelsWithJ +public import Mathlib.AlgebraicGeometry.EllipticCurve.NormalForms +public import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Basic +public import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Formula +public import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.Reduction +public import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange +public import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass +public import Mathlib.AlgebraicGeometry.Fiber +public import Mathlib.AlgebraicGeometry.FunctionField +public import Mathlib.AlgebraicGeometry.GammaSpecAdjunction +public import Mathlib.AlgebraicGeometry.Gluing +public import Mathlib.AlgebraicGeometry.GluingOneHypercover +public import Mathlib.AlgebraicGeometry.IdealSheaf +public import Mathlib.AlgebraicGeometry.IdealSheaf.Basic +public import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial +public import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme +public import Mathlib.AlgebraicGeometry.Limits +public import Mathlib.AlgebraicGeometry.Modules.Presheaf +public import Mathlib.AlgebraicGeometry.Modules.Sheaf +public import Mathlib.AlgebraicGeometry.Modules.Tilde +public import Mathlib.AlgebraicGeometry.Morphisms.Affine +public import Mathlib.AlgebraicGeometry.Morphisms.AffineAnd +public import Mathlib.AlgebraicGeometry.Morphisms.Basic +public import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion +public import Mathlib.AlgebraicGeometry.Morphisms.Constructors +public import Mathlib.AlgebraicGeometry.Morphisms.Descent +public import Mathlib.AlgebraicGeometry.Morphisms.Etale +public import Mathlib.AlgebraicGeometry.Morphisms.Finite +public import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation +public import Mathlib.AlgebraicGeometry.Morphisms.FiniteType +public import Mathlib.AlgebraicGeometry.Morphisms.Flat +public import Mathlib.AlgebraicGeometry.Morphisms.FormallyUnramified +public import Mathlib.AlgebraicGeometry.Morphisms.Immersion +public import Mathlib.AlgebraicGeometry.Morphisms.Integral +public import Mathlib.AlgebraicGeometry.Morphisms.IsIso +public import Mathlib.AlgebraicGeometry.Morphisms.LocalClosure +public import Mathlib.AlgebraicGeometry.Morphisms.LocalIso +public import Mathlib.AlgebraicGeometry.Morphisms.OpenImmersion +public import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion +public import Mathlib.AlgebraicGeometry.Morphisms.Proper +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated +public import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties +public import Mathlib.AlgebraicGeometry.Morphisms.Separated +public import Mathlib.AlgebraicGeometry.Morphisms.Smooth +public import Mathlib.AlgebraicGeometry.Morphisms.SurjectiveOnStalks +public import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap +public import Mathlib.AlgebraicGeometry.Morphisms.UniversallyClosed +public import Mathlib.AlgebraicGeometry.Morphisms.UniversallyInjective +public import Mathlib.AlgebraicGeometry.Morphisms.UniversallyOpen +public import Mathlib.AlgebraicGeometry.Noetherian +public import Mathlib.AlgebraicGeometry.OpenImmersion +public import Mathlib.AlgebraicGeometry.Over +public import Mathlib.AlgebraicGeometry.PointsPi +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Basic +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Proper +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Topology +public import Mathlib.AlgebraicGeometry.Properties +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.AlgebraicGeometry.Pullbacks +public import Mathlib.AlgebraicGeometry.QuasiAffine +public import Mathlib.AlgebraicGeometry.RationalMap +public import Mathlib.AlgebraicGeometry.ResidueField +public import Mathlib.AlgebraicGeometry.Restrict +public import Mathlib.AlgebraicGeometry.Scheme +public import Mathlib.AlgebraicGeometry.Sites.BigZariski +public import Mathlib.AlgebraicGeometry.Sites.Etale +public import Mathlib.AlgebraicGeometry.Sites.MorphismProperty +public import Mathlib.AlgebraicGeometry.Sites.Pretopology +public import Mathlib.AlgebraicGeometry.Sites.Representability +public import Mathlib.AlgebraicGeometry.Sites.Small +public import Mathlib.AlgebraicGeometry.Sites.SmallAffineZariski +public import Mathlib.AlgebraicGeometry.Spec +public import Mathlib.AlgebraicGeometry.SpreadingOut +public import Mathlib.AlgebraicGeometry.Stalk +public import Mathlib.AlgebraicGeometry.StructureSheaf +public import Mathlib.AlgebraicGeometry.ValuativeCriterion +public import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex +public import Mathlib.AlgebraicTopology.CechNerve +public import Mathlib.AlgebraicTopology.DoldKan.Compatibility +public import Mathlib.AlgebraicTopology.DoldKan.Decomposition +public import Mathlib.AlgebraicTopology.DoldKan.Degeneracies +public import Mathlib.AlgebraicTopology.DoldKan.Equivalence +public import Mathlib.AlgebraicTopology.DoldKan.EquivalenceAdditive +public import Mathlib.AlgebraicTopology.DoldKan.EquivalencePseudoabelian +public import Mathlib.AlgebraicTopology.DoldKan.Faces +public import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma +public import Mathlib.AlgebraicTopology.DoldKan.FunctorN +public import Mathlib.AlgebraicTopology.DoldKan.GammaCompN +public import Mathlib.AlgebraicTopology.DoldKan.Homotopies +public import Mathlib.AlgebraicTopology.DoldKan.HomotopyEquivalence +public import Mathlib.AlgebraicTopology.DoldKan.NCompGamma +public import Mathlib.AlgebraicTopology.DoldKan.NReflectsIso +public import Mathlib.AlgebraicTopology.DoldKan.Normalized +public import Mathlib.AlgebraicTopology.DoldKan.Notations +public import Mathlib.AlgebraicTopology.DoldKan.PInfty +public import Mathlib.AlgebraicTopology.DoldKan.Projections +public import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject +public import Mathlib.AlgebraicTopology.ExtraDegeneracy +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.FundamentalGroup +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.InducedMaps +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.PUnit +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.Product +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected +public import Mathlib.AlgebraicTopology.ModelCategory.Basic +public import Mathlib.AlgebraicTopology.ModelCategory.BrownLemma +public import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations +public import Mathlib.AlgebraicTopology.ModelCategory.Cylinder +public import Mathlib.AlgebraicTopology.ModelCategory.Homotopy +public import Mathlib.AlgebraicTopology.ModelCategory.Instances +public import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant +public import Mathlib.AlgebraicTopology.ModelCategory.JoyalTrick +public import Mathlib.AlgebraicTopology.ModelCategory.LeftHomotopy +public import Mathlib.AlgebraicTopology.ModelCategory.Opposite +public import Mathlib.AlgebraicTopology.ModelCategory.Over +public import Mathlib.AlgebraicTopology.ModelCategory.PathObject +public import Mathlib.AlgebraicTopology.ModelCategory.RightHomotopy +public import Mathlib.AlgebraicTopology.MooreComplex +public import Mathlib.AlgebraicTopology.Quasicategory.Basic +public import Mathlib.AlgebraicTopology.Quasicategory.Nerve +public import Mathlib.AlgebraicTopology.Quasicategory.StrictSegal +public import Mathlib.AlgebraicTopology.Quasicategory.TwoTruncated +public import Mathlib.AlgebraicTopology.RelativeCellComplex.AttachCells +public import Mathlib.AlgebraicTopology.RelativeCellComplex.Basic +public import Mathlib.AlgebraicTopology.SimplexCategory.Augmented +public import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Basic +public import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Monoidal +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic +public import Mathlib.AlgebraicTopology.SimplexCategory.Defs +public import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.Basic +public import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.EpiMono +public import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.NormalForms +public import Mathlib.AlgebraicTopology.SimplexCategory.MorphismProperty +public import Mathlib.AlgebraicTopology.SimplexCategory.Rev +public import Mathlib.AlgebraicTopology.SimplexCategory.Truncated +public import Mathlib.AlgebraicTopology.SimplicialCategory.Basic +public import Mathlib.AlgebraicTopology.SimplicialCategory.SimplicialObject +public import Mathlib.AlgebraicTopology.SimplicialNerve +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.AlgebraicTopology.SimplicialObject.Coskeletal +public import Mathlib.AlgebraicTopology.SimplicialObject.II +public import Mathlib.AlgebraicTopology.SimplicialObject.Op +public import Mathlib.AlgebraicTopology.SimplicialObject.Split +public import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.IsUniquelyCodimOneFace +public import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.Pairing +public import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.PairingCore +public import Mathlib.AlgebraicTopology.SimplicialSet.Basic +public import Mathlib.AlgebraicTopology.SimplicialSet.Boundary +public import Mathlib.AlgebraicTopology.SimplicialSet.CategoryWithFibrations +public import Mathlib.AlgebraicTopology.SimplicialSet.CompStruct +public import Mathlib.AlgebraicTopology.SimplicialSet.CompStructTruncated +public import Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal +public import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate +public import Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat +public import Mathlib.AlgebraicTopology.SimplicialSet.Horn +public import Mathlib.AlgebraicTopology.SimplicialSet.KanComplex +public import Mathlib.AlgebraicTopology.SimplicialSet.Monoidal +public import Mathlib.AlgebraicTopology.SimplicialSet.Nerve +public import Mathlib.AlgebraicTopology.SimplicialSet.NerveAdjunction +public import Mathlib.AlgebraicTopology.SimplicialSet.NerveNondegenerate +public import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplices +public import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplicesSubcomplex +public import Mathlib.AlgebraicTopology.SimplicialSet.Op +public import Mathlib.AlgebraicTopology.SimplicialSet.Path +public import Mathlib.AlgebraicTopology.SimplicialSet.Simplices +public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex +public import Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal +public import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex +public import Mathlib.AlgebraicTopology.SingularHomology.Basic +public import Mathlib.AlgebraicTopology.SingularSet +public import Mathlib.AlgebraicTopology.TopologicalSimplex +public import Mathlib.Analysis.AbsoluteValue.Equivalence +public import Mathlib.Analysis.Analytic.Basic +public import Mathlib.Analysis.Analytic.Binomial +public import Mathlib.Analysis.Analytic.CPolynomial +public import Mathlib.Analysis.Analytic.CPolynomialDef +public import Mathlib.Analysis.Analytic.ChangeOrigin +public import Mathlib.Analysis.Analytic.Composition +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Analytic.ConvergenceRadius +public import Mathlib.Analysis.Analytic.Inverse +public import Mathlib.Analysis.Analytic.IsolatedZeros +public import Mathlib.Analysis.Analytic.IteratedFDeriv +public import Mathlib.Analysis.Analytic.Linear +public import Mathlib.Analysis.Analytic.OfScalars +public import Mathlib.Analysis.Analytic.Order +public import Mathlib.Analysis.Analytic.Polynomial +public import Mathlib.Analysis.Analytic.RadiusLiminf +public import Mathlib.Analysis.Analytic.Uniqueness +public import Mathlib.Analysis.Analytic.WithLp +public import Mathlib.Analysis.Analytic.Within +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.Asymptotics.Completion +public import Mathlib.Analysis.Asymptotics.Defs +public import Mathlib.Analysis.Asymptotics.ExpGrowth +public import Mathlib.Analysis.Asymptotics.Lemmas +public import Mathlib.Analysis.Asymptotics.LinearGrowth +public import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +public import Mathlib.Analysis.Asymptotics.SuperpolynomialDecay +public import Mathlib.Analysis.Asymptotics.TVS +public import Mathlib.Analysis.Asymptotics.Theta +public import Mathlib.Analysis.BoundedVariation +public import Mathlib.Analysis.BoxIntegral.Basic +public import Mathlib.Analysis.BoxIntegral.Box.Basic +public import Mathlib.Analysis.BoxIntegral.Box.SubboxInduction +public import Mathlib.Analysis.BoxIntegral.DivergenceTheorem +public import Mathlib.Analysis.BoxIntegral.Integrability +public import Mathlib.Analysis.BoxIntegral.Partition.Additive +public import Mathlib.Analysis.BoxIntegral.Partition.Basic +public import Mathlib.Analysis.BoxIntegral.Partition.Filter +public import Mathlib.Analysis.BoxIntegral.Partition.Measure +public import Mathlib.Analysis.BoxIntegral.Partition.Split +public import Mathlib.Analysis.BoxIntegral.Partition.SubboxInduction +public import Mathlib.Analysis.BoxIntegral.Partition.Tagged +public import Mathlib.Analysis.BoxIntegral.UnitPartition +public import Mathlib.Analysis.CStarAlgebra.ApproximateUnit +public import Mathlib.Analysis.CStarAlgebra.Basic +public import Mathlib.Analysis.CStarAlgebra.CStarMatrix +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.CStarAlgebra.CompletelyPositiveMap +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Commute +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Continuity +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Integral +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Note +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Pi +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Range +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unital +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unitary +public import Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap +public import Mathlib.Analysis.CStarAlgebra.ContinuousMap +public import Mathlib.Analysis.CStarAlgebra.Exponential +public import Mathlib.Analysis.CStarAlgebra.GelfandDuality +public import Mathlib.Analysis.CStarAlgebra.Hom +public import Mathlib.Analysis.CStarAlgebra.Matrix +public import Mathlib.Analysis.CStarAlgebra.Module.Constructions +public import Mathlib.Analysis.CStarAlgebra.Module.Defs +public import Mathlib.Analysis.CStarAlgebra.Module.Synonym +public import Mathlib.Analysis.CStarAlgebra.Multiplier +public import Mathlib.Analysis.CStarAlgebra.PositiveLinearMap +public import Mathlib.Analysis.CStarAlgebra.Projection +public import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart +public import Mathlib.Analysis.CStarAlgebra.Spectrum +public import Mathlib.Analysis.CStarAlgebra.Unitary.Connected +public import Mathlib.Analysis.CStarAlgebra.Unitary.Span +public import Mathlib.Analysis.CStarAlgebra.Unitization +public import Mathlib.Analysis.CStarAlgebra.lpSpace +public import Mathlib.Analysis.Calculus.AddTorsor.AffineMap +public import Mathlib.Analysis.Calculus.AddTorsor.Coord +public import Mathlib.Analysis.Calculus.BumpFunction.Basic +public import Mathlib.Analysis.Calculus.BumpFunction.Convolution +public import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension +public import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct +public import Mathlib.Analysis.Calculus.BumpFunction.Normed +public import Mathlib.Analysis.Calculus.BumpFunction.SmoothApprox +public import Mathlib.Analysis.Calculus.Conformal.InnerProduct +public import Mathlib.Analysis.Calculus.Conformal.NormedSpace +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.ContDiff.Bounds +public import Mathlib.Analysis.Calculus.ContDiff.CPolynomial +public import Mathlib.Analysis.Calculus.ContDiff.Defs +public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries +public import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno +public import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.ContDiff.RCLike +public import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars +public import Mathlib.Analysis.Calculus.ContDiff.WithLp +public import Mathlib.Analysis.Calculus.DSlope +public import Mathlib.Analysis.Calculus.Darboux +public import Mathlib.Analysis.Calculus.Deriv.Abs +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.AffineMap +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.Deriv.CompMul +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.Calculus.Deriv.Inverse +public import Mathlib.Analysis.Calculus.Deriv.Linear +public import Mathlib.Analysis.Calculus.Deriv.MeanValue +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Pi +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Analysis.Calculus.Deriv.Pow +public import Mathlib.Analysis.Calculus.Deriv.Prod +public import Mathlib.Analysis.Calculus.Deriv.Shift +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.Analysis.Calculus.Deriv.Star +public import Mathlib.Analysis.Calculus.Deriv.Support +public import Mathlib.Analysis.Calculus.Deriv.ZPow +public import Mathlib.Analysis.Calculus.DerivativeTest +public import Mathlib.Analysis.Calculus.DiffContOnCl +public import Mathlib.Analysis.Calculus.DifferentialForm.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.FDeriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Bilinear +public import Mathlib.Analysis.Calculus.FDeriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.CompCLM +public import Mathlib.Analysis.Calculus.FDeriv.Congr +public import Mathlib.Analysis.Calculus.FDeriv.Const +public import Mathlib.Analysis.Calculus.FDeriv.ContinuousMultilinearMap +public import Mathlib.Analysis.Calculus.FDeriv.Defs +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Calculus.FDeriv.Extend +public import Mathlib.Analysis.Calculus.FDeriv.Linear +public import Mathlib.Analysis.Calculus.FDeriv.Measurable +public import Mathlib.Analysis.Calculus.FDeriv.Mul +public import Mathlib.Analysis.Calculus.FDeriv.Norm +public import Mathlib.Analysis.Calculus.FDeriv.Pi +public import Mathlib.Analysis.Calculus.FDeriv.Pow +public import Mathlib.Analysis.Calculus.FDeriv.Prod +public import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars +public import Mathlib.Analysis.Calculus.FDeriv.Star +public import Mathlib.Analysis.Calculus.FDeriv.Symmetric +public import Mathlib.Analysis.Calculus.FDeriv.WithLp +public import Mathlib.Analysis.Calculus.FormalMultilinearSeries +public import Mathlib.Analysis.Calculus.Gradient.Basic +public import Mathlib.Analysis.Calculus.Implicit +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FiniteDimensional +public import Mathlib.Analysis.Calculus.IteratedDeriv.ConvergenceOnBall +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +public import Mathlib.Analysis.Calculus.IteratedDeriv.FaaDiBruno +public import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas +public import Mathlib.Analysis.Calculus.IteratedDeriv.WithinZpow +public import Mathlib.Analysis.Calculus.LHopital +public import Mathlib.Analysis.Calculus.LagrangeMultipliers +public import Mathlib.Analysis.Calculus.LineDeriv.Basic +public import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts +public import Mathlib.Analysis.Calculus.LineDeriv.Measurable +public import Mathlib.Analysis.Calculus.LineDeriv.QuadraticMap +public import Mathlib.Analysis.Calculus.LocalExtr.Basic +public import Mathlib.Analysis.Calculus.LocalExtr.LineDeriv +public import Mathlib.Analysis.Calculus.LocalExtr.Polynomial +public import Mathlib.Analysis.Calculus.LocalExtr.Rolle +public import Mathlib.Analysis.Calculus.LogDeriv +public import Mathlib.Analysis.Calculus.LogDerivUniformlyOn +public import Mathlib.Analysis.Calculus.MeanValue +public import Mathlib.Analysis.Calculus.Monotone +public import Mathlib.Analysis.Calculus.ParametricIntegral +public import Mathlib.Analysis.Calculus.ParametricIntervalIntegral +public import Mathlib.Analysis.Calculus.Rademacher +public import Mathlib.Analysis.Calculus.SmoothSeries +public import Mathlib.Analysis.Calculus.TangentCone +public import Mathlib.Analysis.Calculus.TangentCone.Basic +public import Mathlib.Analysis.Calculus.TangentCone.Defs +public import Mathlib.Analysis.Calculus.TangentCone.DimOne +public import Mathlib.Analysis.Calculus.TangentCone.Pi +public import Mathlib.Analysis.Calculus.TangentCone.Prod +public import Mathlib.Analysis.Calculus.TangentCone.ProperSpace +public import Mathlib.Analysis.Calculus.TangentCone.Real +public import Mathlib.Analysis.Calculus.Taylor +public import Mathlib.Analysis.Calculus.UniformLimitsDeriv +public import Mathlib.Analysis.Calculus.VectorField +public import Mathlib.Analysis.Complex.AbelLimit +public import Mathlib.Analysis.Complex.AbsMax +public import Mathlib.Analysis.Complex.Angle +public import Mathlib.Analysis.Complex.Arg +public import Mathlib.Analysis.Complex.Asymptotics +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.Complex.Cardinality +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.Analysis.Complex.Conformal +public import Mathlib.Analysis.Complex.Convex +public import Mathlib.Analysis.Complex.Exponential +public import Mathlib.Analysis.Complex.ExponentialBounds +public import Mathlib.Analysis.Complex.Hadamard +public import Mathlib.Analysis.Complex.HalfPlane +public import Mathlib.Analysis.Complex.Harmonic.Analytic +public import Mathlib.Analysis.Complex.Harmonic.MeanValue +public import Mathlib.Analysis.Complex.HasPrimitives +public import Mathlib.Analysis.Complex.IntegerCompl +public import Mathlib.Analysis.Complex.IsIntegral +public import Mathlib.Analysis.Complex.Isometry +public import Mathlib.Analysis.Complex.JensenFormula +public import Mathlib.Analysis.Complex.Liouville +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.Analysis.Complex.MeanValue +public import Mathlib.Analysis.Complex.Norm +public import Mathlib.Analysis.Complex.OpenMapping +public import Mathlib.Analysis.Complex.OperatorNorm +public import Mathlib.Analysis.Complex.Order +public import Mathlib.Analysis.Complex.Periodic +public import Mathlib.Analysis.Complex.PhragmenLindelof +public import Mathlib.Analysis.Complex.Polynomial.Basic +public import Mathlib.Analysis.Complex.Polynomial.GaussLucas +public import Mathlib.Analysis.Complex.Polynomial.UnitTrinomial +public import Mathlib.Analysis.Complex.Positivity +public import Mathlib.Analysis.Complex.ReImTopology +public import Mathlib.Analysis.Complex.RealDeriv +public import Mathlib.Analysis.Complex.RemovableSingularity +public import Mathlib.Analysis.Complex.Schwarz +public import Mathlib.Analysis.Complex.Spectrum +public import Mathlib.Analysis.Complex.SummableUniformlyOn +public import Mathlib.Analysis.Complex.TaylorSeries +public import Mathlib.Analysis.Complex.Tietze +public import Mathlib.Analysis.Complex.Trigonometric +public import Mathlib.Analysis.Complex.UnitDisc.Basic +public import Mathlib.Analysis.Complex.UpperHalfPlane.Basic +public import Mathlib.Analysis.Complex.UpperHalfPlane.Exp +public import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty +public import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold +public import Mathlib.Analysis.Complex.UpperHalfPlane.Metric +public import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction +public import Mathlib.Analysis.Complex.UpperHalfPlane.Topology +public import Mathlib.Analysis.Complex.ValueDistribution.CharacteristicFunction +public import Mathlib.Analysis.Complex.ValueDistribution.CountingFunction +public import Mathlib.Analysis.Complex.ValueDistribution.FirstMainTheorem +public import Mathlib.Analysis.Complex.ValueDistribution.ProximityFunction +public import Mathlib.Analysis.ConstantSpeed +public import Mathlib.Analysis.Convex.AmpleSet +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Analysis.Convex.BetweenList +public import Mathlib.Analysis.Convex.Birkhoff +public import Mathlib.Analysis.Convex.Body +public import Mathlib.Analysis.Convex.Caratheodory +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.Cone.Basic +public import Mathlib.Analysis.Convex.Cone.Closure +public import Mathlib.Analysis.Convex.Cone.Dual +public import Mathlib.Analysis.Convex.Cone.Extension +public import Mathlib.Analysis.Convex.Cone.InnerDual +public import Mathlib.Analysis.Convex.Continuous +public import Mathlib.Analysis.Convex.ContinuousLinearEquiv +public import Mathlib.Analysis.Convex.Contractible +public import Mathlib.Analysis.Convex.Deriv +public import Mathlib.Analysis.Convex.DoublyStochasticMatrix +public import Mathlib.Analysis.Convex.EGauge +public import Mathlib.Analysis.Convex.Exposed +public import Mathlib.Analysis.Convex.Extrema +public import Mathlib.Analysis.Convex.Extreme +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Analysis.Convex.Gauge +public import Mathlib.Analysis.Convex.GaugeRescale +public import Mathlib.Analysis.Convex.Hull +public import Mathlib.Analysis.Convex.Independent +public import Mathlib.Analysis.Convex.Integral +public import Mathlib.Analysis.Convex.Intrinsic +public import Mathlib.Analysis.Convex.Jensen +public import Mathlib.Analysis.Convex.Join +public import Mathlib.Analysis.Convex.KreinMilman +public import Mathlib.Analysis.Convex.LinearIsometry +public import Mathlib.Analysis.Convex.Measure +public import Mathlib.Analysis.Convex.Mul +public import Mathlib.Analysis.Convex.PartitionOfUnity +public import Mathlib.Analysis.Convex.PathConnected +public import Mathlib.Analysis.Convex.Piecewise +public import Mathlib.Analysis.Convex.Quasiconvex +public import Mathlib.Analysis.Convex.Radon +public import Mathlib.Analysis.Convex.Segment +public import Mathlib.Analysis.Convex.Side +public import Mathlib.Analysis.Convex.SimplicialComplex.Basic +public import Mathlib.Analysis.Convex.Slope +public import Mathlib.Analysis.Convex.SpecificFunctions.Basic +public import Mathlib.Analysis.Convex.SpecificFunctions.Deriv +public import Mathlib.Analysis.Convex.SpecificFunctions.Pow +public import Mathlib.Analysis.Convex.Star +public import Mathlib.Analysis.Convex.StdSimplex +public import Mathlib.Analysis.Convex.StoneSeparation +public import Mathlib.Analysis.Convex.Strict +public import Mathlib.Analysis.Convex.StrictConvexBetween +public import Mathlib.Analysis.Convex.StrictConvexSpace +public import Mathlib.Analysis.Convex.Strong +public import Mathlib.Analysis.Convex.Topology +public import Mathlib.Analysis.Convex.TotallyBounded +public import Mathlib.Analysis.Convex.Uniform +public import Mathlib.Analysis.Convex.Visible +public import Mathlib.Analysis.Convolution +public import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff +public import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn +public import Mathlib.Analysis.Distribution.FourierSchwartz +public import Mathlib.Analysis.Distribution.SchwartzSpace +public import Mathlib.Analysis.Distribution.TemperateGrowth +public import Mathlib.Analysis.Distribution.TestFunction +public import Mathlib.Analysis.Fourier.AddCircle +public import Mathlib.Analysis.Fourier.AddCircleMulti +public import Mathlib.Analysis.Fourier.BoundedContinuousFunctionChar +public import Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality +public import Mathlib.Analysis.Fourier.FiniteAbelian.PontryaginDuality +public import Mathlib.Analysis.Fourier.FourierTransform +public import Mathlib.Analysis.Fourier.FourierTransformDeriv +public import Mathlib.Analysis.Fourier.Inversion +public import Mathlib.Analysis.Fourier.Notation +public import Mathlib.Analysis.Fourier.PoissonSummation +public import Mathlib.Analysis.Fourier.RiemannLebesgueLemma +public import Mathlib.Analysis.Fourier.ZMod +public import Mathlib.Analysis.FunctionalSpaces.SobolevInequality +public import Mathlib.Analysis.Hofer +public import Mathlib.Analysis.InnerProductSpace.Adjoint +public import Mathlib.Analysis.InnerProductSpace.Affine +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.InnerProductSpace.CanonicalTensor +public import Mathlib.Analysis.InnerProductSpace.Completion +public import Mathlib.Analysis.InnerProductSpace.ConformalLinearMap +public import Mathlib.Analysis.InnerProductSpace.Continuous +public import Mathlib.Analysis.InnerProductSpace.Convex +public import Mathlib.Analysis.InnerProductSpace.Defs +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.InnerProductSpace.EuclideanDist +public import Mathlib.Analysis.InnerProductSpace.GramMatrix +public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Analytic +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions +public import Mathlib.Analysis.InnerProductSpace.JointEigenspace +public import Mathlib.Analysis.InnerProductSpace.Laplacian +public import Mathlib.Analysis.InnerProductSpace.LaxMilgram +public import Mathlib.Analysis.InnerProductSpace.LinearMap +public import Mathlib.Analysis.InnerProductSpace.LinearPMap +public import Mathlib.Analysis.InnerProductSpace.MeanErgodic +public import Mathlib.Analysis.InnerProductSpace.MulOpposite +public import Mathlib.Analysis.InnerProductSpace.NormPow +public import Mathlib.Analysis.InnerProductSpace.OfNorm +public import Mathlib.Analysis.InnerProductSpace.Orientation +public import Mathlib.Analysis.InnerProductSpace.Orthogonal +public import Mathlib.Analysis.InnerProductSpace.Orthonormal +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Analysis.InnerProductSpace.Positive +public import Mathlib.Analysis.InnerProductSpace.ProdL2 +public import Mathlib.Analysis.InnerProductSpace.Projection +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic +public import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional +public import Mathlib.Analysis.InnerProductSpace.Projection.Minimal +public import Mathlib.Analysis.InnerProductSpace.Projection.Reflection +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +public import Mathlib.Analysis.InnerProductSpace.Rayleigh +public import Mathlib.Analysis.InnerProductSpace.Semisimple +public import Mathlib.Analysis.InnerProductSpace.Spectrum +public import Mathlib.Analysis.InnerProductSpace.StarOrder +public import Mathlib.Analysis.InnerProductSpace.Subspace +public import Mathlib.Analysis.InnerProductSpace.Symmetric +public import Mathlib.Analysis.InnerProductSpace.TensorProduct +public import Mathlib.Analysis.InnerProductSpace.Trace +public import Mathlib.Analysis.InnerProductSpace.TwoDim +public import Mathlib.Analysis.InnerProductSpace.WeakOperatorTopology +public import Mathlib.Analysis.InnerProductSpace.l2Space +public import Mathlib.Analysis.LConvolution +public import Mathlib.Analysis.LocallyConvex.AbsConvex +public import Mathlib.Analysis.LocallyConvex.AbsConvexOpen +public import Mathlib.Analysis.LocallyConvex.BalancedCoreHull +public import Mathlib.Analysis.LocallyConvex.Barrelled +public import Mathlib.Analysis.LocallyConvex.Basic +public import Mathlib.Analysis.LocallyConvex.Bounded +public import Mathlib.Analysis.LocallyConvex.ContinuousOfBounded +public import Mathlib.Analysis.LocallyConvex.Montel +public import Mathlib.Analysis.LocallyConvex.PointwiseConvergence +public import Mathlib.Analysis.LocallyConvex.Polar +public import Mathlib.Analysis.LocallyConvex.SeparatingDual +public import Mathlib.Analysis.LocallyConvex.Separation +public import Mathlib.Analysis.LocallyConvex.StrongTopology +public import Mathlib.Analysis.LocallyConvex.WeakDual +public import Mathlib.Analysis.LocallyConvex.WeakOperatorTopology +public import Mathlib.Analysis.LocallyConvex.WeakSpace +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.Matrix +public import Mathlib.Analysis.Matrix.Hermitian +public import Mathlib.Analysis.Matrix.HermitianFunctionalCalculus +public import Mathlib.Analysis.Matrix.LDL +public import Mathlib.Analysis.Matrix.Normed +public import Mathlib.Analysis.Matrix.Order +public import Mathlib.Analysis.Matrix.PosDef +public import Mathlib.Analysis.Matrix.Spectrum +public import Mathlib.Analysis.MeanInequalities +public import Mathlib.Analysis.MeanInequalitiesPow +public import Mathlib.Analysis.MellinInversion +public import Mathlib.Analysis.MellinTransform +public import Mathlib.Analysis.Meromorphic.Basic +public import Mathlib.Analysis.Meromorphic.Complex +public import Mathlib.Analysis.Meromorphic.Divisor +public import Mathlib.Analysis.Meromorphic.FactorizedRational +public import Mathlib.Analysis.Meromorphic.IsolatedZeros +public import Mathlib.Analysis.Meromorphic.NormalForm +public import Mathlib.Analysis.Meromorphic.Order +public import Mathlib.Analysis.Meromorphic.TrailingCoefficient +public import Mathlib.Analysis.Normed.Affine.AddTorsor +public import Mathlib.Analysis.Normed.Affine.AddTorsorBases +public import Mathlib.Analysis.Normed.Affine.AsymptoticCone +public import Mathlib.Analysis.Normed.Affine.ContinuousAffineMap +public import Mathlib.Analysis.Normed.Affine.Convex +public import Mathlib.Analysis.Normed.Affine.Isometry +public import Mathlib.Analysis.Normed.Affine.MazurUlam +public import Mathlib.Analysis.Normed.Affine.Simplex +public import Mathlib.Analysis.Normed.Algebra.Basic +public import Mathlib.Analysis.Normed.Algebra.DualNumber +public import Mathlib.Analysis.Normed.Algebra.Exponential +public import Mathlib.Analysis.Normed.Algebra.GelfandFormula +public import Mathlib.Analysis.Normed.Algebra.GelfandMazur +public import Mathlib.Analysis.Normed.Algebra.MatrixExponential +public import Mathlib.Analysis.Normed.Algebra.QuaternionExponential +public import Mathlib.Analysis.Normed.Algebra.Spectrum +public import Mathlib.Analysis.Normed.Algebra.TrivSqZeroExt +public import Mathlib.Analysis.Normed.Algebra.Ultra +public import Mathlib.Analysis.Normed.Algebra.Unitization +public import Mathlib.Analysis.Normed.Algebra.UnitizationL1 +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.Analysis.Normed.Field.Instances +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Analysis.Normed.Field.ProperSpace +public import Mathlib.Analysis.Normed.Field.Ultra +public import Mathlib.Analysis.Normed.Field.UnitBall +public import Mathlib.Analysis.Normed.Field.WithAbs +public import Mathlib.Analysis.Normed.Group.AddCircle +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Analysis.Normed.Group.BallSphere +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Analysis.Normed.Group.Bounded +public import Mathlib.Analysis.Normed.Group.CocompactMap +public import Mathlib.Analysis.Normed.Group.Completeness +public import Mathlib.Analysis.Normed.Group.Completion +public import Mathlib.Analysis.Normed.Group.Constructions +public import Mathlib.Analysis.Normed.Group.Continuity +public import Mathlib.Analysis.Normed.Group.ControlledClosure +public import Mathlib.Analysis.Normed.Group.FunctionSeries +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.Analysis.Normed.Group.HomCompletion +public import Mathlib.Analysis.Normed.Group.Indicator +public import Mathlib.Analysis.Normed.Group.InfiniteSum +public import Mathlib.Analysis.Normed.Group.Int +public import Mathlib.Analysis.Normed.Group.Lemmas +public import Mathlib.Analysis.Normed.Group.NullSubmodule +public import Mathlib.Analysis.Normed.Group.Pointwise +public import Mathlib.Analysis.Normed.Group.Quotient +public import Mathlib.Analysis.Normed.Group.Rat +public import Mathlib.Analysis.Normed.Group.SemiNormedGrp +public import Mathlib.Analysis.Normed.Group.SemiNormedGrp.Completion +public import Mathlib.Analysis.Normed.Group.SemiNormedGrp.Kernels +public import Mathlib.Analysis.Normed.Group.Seminorm +public import Mathlib.Analysis.Normed.Group.SeparationQuotient +public import Mathlib.Analysis.Normed.Group.Subgroup +public import Mathlib.Analysis.Normed.Group.Submodule +public import Mathlib.Analysis.Normed.Group.Tannery +public import Mathlib.Analysis.Normed.Group.Ultra +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Analysis.Normed.Group.ZeroAtInfty +public import Mathlib.Analysis.Normed.Lp.LpEquiv +public import Mathlib.Analysis.Normed.Lp.MeasurableSpace +public import Mathlib.Analysis.Normed.Lp.PiLp +public import Mathlib.Analysis.Normed.Lp.ProdLp +public import Mathlib.Analysis.Normed.Lp.WithLp +public import Mathlib.Analysis.Normed.Lp.lpSpace +public import Mathlib.Analysis.Normed.Module.Ball.Action +public import Mathlib.Analysis.Normed.Module.Ball.Homeomorph +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise +public import Mathlib.Analysis.Normed.Module.Ball.RadialEquiv +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Module.Complemented +public import Mathlib.Analysis.Normed.Module.Completion +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Analysis.Normed.Module.Dual +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Analysis.Normed.Module.HahnBanach +public import Mathlib.Analysis.Normed.Module.RCLike.Basic +public import Mathlib.Analysis.Normed.Module.RCLike.Extend +public import Mathlib.Analysis.Normed.Module.RCLike.Real +public import Mathlib.Analysis.Normed.Module.Ray +public import Mathlib.Analysis.Normed.Module.Span +public import Mathlib.Analysis.Normed.Module.WeakDual +public import Mathlib.Analysis.Normed.MulAction +public import Mathlib.Analysis.Normed.Operator.Asymptotics +public import Mathlib.Analysis.Normed.Operator.Banach +public import Mathlib.Analysis.Normed.Operator.BanachSteinhaus +public import Mathlib.Analysis.Normed.Operator.Basic +public import Mathlib.Analysis.Normed.Operator.Bilinear +public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +public import Mathlib.Analysis.Normed.Operator.Compact +public import Mathlib.Analysis.Normed.Operator.CompleteCodomain +public import Mathlib.Analysis.Normed.Operator.Completeness +public import Mathlib.Analysis.Normed.Operator.Conformal +public import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap +public import Mathlib.Analysis.Normed.Operator.Extend +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.Analysis.Normed.Operator.Mul +public import Mathlib.Analysis.Normed.Operator.NNNorm +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.Normed.Operator.Prod +public import Mathlib.Analysis.Normed.Order.Basic +public import Mathlib.Analysis.Normed.Order.Hom.Basic +public import Mathlib.Analysis.Normed.Order.Hom.Ultra +public import Mathlib.Analysis.Normed.Order.Lattice +public import Mathlib.Analysis.Normed.Order.UpperLower +public import Mathlib.Analysis.Normed.Ring.Basic +public import Mathlib.Analysis.Normed.Ring.Finite +public import Mathlib.Analysis.Normed.Ring.InfiniteSum +public import Mathlib.Analysis.Normed.Ring.Int +public import Mathlib.Analysis.Normed.Ring.Lemmas +public import Mathlib.Analysis.Normed.Ring.Ultra +public import Mathlib.Analysis.Normed.Ring.Units +public import Mathlib.Analysis.Normed.Ring.WithAbs +public import Mathlib.Analysis.Normed.Unbundled.AlgebraNorm +public import Mathlib.Analysis.Normed.Unbundled.FiniteExtension +public import Mathlib.Analysis.Normed.Unbundled.InvariantExtension +public import Mathlib.Analysis.Normed.Unbundled.IsPowMulFaithful +public import Mathlib.Analysis.Normed.Unbundled.RingSeminorm +public import Mathlib.Analysis.Normed.Unbundled.SeminormFromBounded +public import Mathlib.Analysis.Normed.Unbundled.SeminormFromConst +public import Mathlib.Analysis.Normed.Unbundled.SmoothingSeminorm +public import Mathlib.Analysis.Normed.Unbundled.SpectralNorm +public import Mathlib.Analysis.NormedSpace.Alternating.Basic +public import Mathlib.Analysis.NormedSpace.Alternating.Curry +public import Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin +public import Mathlib.Analysis.NormedSpace.BallAction +public import Mathlib.Analysis.NormedSpace.ConformalLinearMap +public import Mathlib.Analysis.NormedSpace.Connected +public import Mathlib.Analysis.NormedSpace.DualNumber +public import Mathlib.Analysis.NormedSpace.ENormedSpace +public import Mathlib.Analysis.NormedSpace.Extend +public import Mathlib.Analysis.NormedSpace.Extr +public import Mathlib.Analysis.NormedSpace.FunctionSeries +public import Mathlib.Analysis.NormedSpace.HomeomorphBall +public import Mathlib.Analysis.NormedSpace.IndicatorFunction +public import Mathlib.Analysis.NormedSpace.Int +public import Mathlib.Analysis.NormedSpace.MStructure +public import Mathlib.Analysis.NormedSpace.Multilinear.Basic +public import Mathlib.Analysis.NormedSpace.Multilinear.Curry +public import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +public import Mathlib.Analysis.NormedSpace.Normalize +public import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics +public import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic +public import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear +public import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness +public import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul +public import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm +public import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace +public import Mathlib.Analysis.NormedSpace.OperatorNorm.Prod +public import Mathlib.Analysis.NormedSpace.PiTensorProduct.InjectiveSeminorm +public import Mathlib.Analysis.NormedSpace.PiTensorProduct.ProjectiveSeminorm +public import Mathlib.Analysis.NormedSpace.Pointwise +public import Mathlib.Analysis.NormedSpace.RCLike +public import Mathlib.Analysis.NormedSpace.Real +public import Mathlib.Analysis.NormedSpace.RieszLemma +public import Mathlib.Analysis.NormedSpace.SphereNormEquiv +public import Mathlib.Analysis.ODE.Gronwall +public import Mathlib.Analysis.ODE.PicardLindelof +public import Mathlib.Analysis.Oscillation +public import Mathlib.Analysis.PSeries +public import Mathlib.Analysis.PSeriesComplex +public import Mathlib.Analysis.Polynomial.Basic +public import Mathlib.Analysis.Polynomial.CauchyBound +public import Mathlib.Analysis.Polynomial.Factorization +public import Mathlib.Analysis.Polynomial.MahlerMeasure +public import Mathlib.Analysis.Quaternion +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Analysis.RCLike.BoundedContinuous +public import Mathlib.Analysis.RCLike.Extend +public import Mathlib.Analysis.RCLike.Inner +public import Mathlib.Analysis.RCLike.Lemmas +public import Mathlib.Analysis.RCLike.TangentCone +public import Mathlib.Analysis.Real.Cardinality +public import Mathlib.Analysis.Real.Hyperreal +public import Mathlib.Analysis.Real.OfDigits +public import Mathlib.Analysis.Real.Pi.Bounds +public import Mathlib.Analysis.Real.Pi.Chudnovsky +public import Mathlib.Analysis.Real.Pi.Irrational +public import Mathlib.Analysis.Real.Pi.Leibniz +public import Mathlib.Analysis.Real.Pi.Wallis +public import Mathlib.Analysis.Real.Spectrum +public import Mathlib.Analysis.Seminorm +public import Mathlib.Analysis.SpecialFunctions.Arsinh +public import Mathlib.Analysis.SpecialFunctions.Bernstein +public import Mathlib.Analysis.SpecialFunctions.BinaryEntropy +public import Mathlib.Analysis.SpecialFunctions.Choose +public import Mathlib.Analysis.SpecialFunctions.CompareExp +public import Mathlib.Analysis.SpecialFunctions.Complex.Analytic +public import Mathlib.Analysis.SpecialFunctions.Complex.Arctan +public import Mathlib.Analysis.SpecialFunctions.Complex.Arg +public import Mathlib.Analysis.SpecialFunctions.Complex.Circle +public import Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar +public import Mathlib.Analysis.SpecialFunctions.Complex.CircleMap +public import Mathlib.Analysis.SpecialFunctions.Complex.Log +public import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds +public import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Abs +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog.Basic +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Isometric +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.IntegralRepresentation +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Isometric +public import Mathlib.Analysis.SpecialFunctions.Exp +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.SpecialFunctions.Exponential +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +public import Mathlib.Analysis.SpecialFunctions.Gamma.Beta +public import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup +public import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne +public import Mathlib.Analysis.SpecialFunctions.Gamma.Deriv +public import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform +public import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral +public import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +public import Mathlib.Analysis.SpecialFunctions.Integrability.Basic +public import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Analysis.SpecialFunctions.Integrals.LogTrigonometric +public import Mathlib.Analysis.SpecialFunctions.Integrals.PosLogEqCircleAverage +public import Mathlib.Analysis.SpecialFunctions.JapaneseBracket +public import Mathlib.Analysis.SpecialFunctions.Log.Base +public import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog +public import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLogExp +public import Mathlib.Analysis.SpecialFunctions.Log.ERealExp +public import Mathlib.Analysis.SpecialFunctions.Log.Monotone +public import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +public import Mathlib.Analysis.SpecialFunctions.Log.PosLog +public import Mathlib.Analysis.SpecialFunctions.Log.Summable +public import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSq +public import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSqIntegral +public import Mathlib.Analysis.SpecialFunctions.NonIntegrable +public import Mathlib.Analysis.SpecialFunctions.OrdinaryHypergeometric +public import Mathlib.Analysis.SpecialFunctions.Pochhammer +public import Mathlib.Analysis.SpecialFunctions.PolarCoord +public import Mathlib.Analysis.SpecialFunctions.PolynomialExp +public import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +public import Mathlib.Analysis.SpecialFunctions.Pow.Complex +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.Analysis.SpecialFunctions.Pow.Integral +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.Analysis.SpecialFunctions.Pow.NthRootLemmas +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Analysis.SpecialFunctions.Sigmoid +public import Mathlib.Analysis.SpecialFunctions.SmoothTransition +public import Mathlib.Analysis.SpecialFunctions.Sqrt +public import Mathlib.Analysis.SpecialFunctions.Stirling +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Chebyshev +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.InverseDeriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Series +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Sinc +public import Mathlib.Analysis.SpecificLimits.ArithmeticGeometric +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.SpecificLimits.Fibonacci +public import Mathlib.Analysis.SpecificLimits.FloorPow +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.Analysis.SpecificLimits.RCLike +public import Mathlib.Analysis.Subadditive +public import Mathlib.Analysis.SumIntegralComparisons +public import Mathlib.Analysis.SumOverResidueClass +public import Mathlib.Analysis.VonNeumannAlgebra.Basic +public import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.CategoryTheory.Abelian.CommSq +public import Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four +public import Mathlib.CategoryTheory.Abelian.DiagramLemmas.KernelCokernelComp +public import Mathlib.CategoryTheory.Abelian.EpiWithInjectiveKernel +public import Mathlib.CategoryTheory.Abelian.Exact +public import Mathlib.CategoryTheory.Abelian.Ext +public import Mathlib.CategoryTheory.Abelian.FreydMitchell +public import Mathlib.CategoryTheory.Abelian.FunctorCategory +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Colim +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Connected +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Indization +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Types +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ColimCoyoneda +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Coseparator +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.EnoughInjectives +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.GabrielPopescu +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.Opposite +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Monomorphisms +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Subobject +public import Mathlib.CategoryTheory.Abelian.Images +public import Mathlib.CategoryTheory.Abelian.Indization +public import Mathlib.CategoryTheory.Abelian.Injective.Basic +public import Mathlib.CategoryTheory.Abelian.Injective.Dimension +public import Mathlib.CategoryTheory.Abelian.Injective.Resolution +public import Mathlib.CategoryTheory.Abelian.LeftDerived +public import Mathlib.CategoryTheory.Abelian.Monomorphisms +public import Mathlib.CategoryTheory.Abelian.NonPreadditive +public import Mathlib.CategoryTheory.Abelian.Opposite +public import Mathlib.CategoryTheory.Abelian.Projective.Basic +public import Mathlib.CategoryTheory.Abelian.Projective.Dimension +public import Mathlib.CategoryTheory.Abelian.Projective.Resolution +public import Mathlib.CategoryTheory.Abelian.Pseudoelements +public import Mathlib.CategoryTheory.Abelian.Refinements +public import Mathlib.CategoryTheory.Abelian.RightDerived +public import Mathlib.CategoryTheory.Abelian.SerreClass.Basic +public import Mathlib.CategoryTheory.Abelian.SerreClass.Bousfield +public import Mathlib.CategoryTheory.Abelian.SerreClass.MorphismProperty +public import Mathlib.CategoryTheory.Abelian.Subobject +public import Mathlib.CategoryTheory.Abelian.Transfer +public import Mathlib.CategoryTheory.Abelian.Yoneda +public import Mathlib.CategoryTheory.Action +public import Mathlib.CategoryTheory.Action.Basic +public import Mathlib.CategoryTheory.Action.Concrete +public import Mathlib.CategoryTheory.Action.Continuous +public import Mathlib.CategoryTheory.Action.Limits +public import Mathlib.CategoryTheory.Action.Monoidal +public import Mathlib.CategoryTheory.Adhesive +public import Mathlib.CategoryTheory.Adjunction.Additive +public import Mathlib.CategoryTheory.Adjunction.AdjointFunctorTheorems +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Adjunction.Comma +public import Mathlib.CategoryTheory.Adjunction.CompositionIso +public import Mathlib.CategoryTheory.Adjunction.Evaluation +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Adjunction.Lifting.Left +public import Mathlib.CategoryTheory.Adjunction.Lifting.Right +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Adjunction.Mates +public import Mathlib.CategoryTheory.Adjunction.Opposites +public import Mathlib.CategoryTheory.Adjunction.Parametrized +public import Mathlib.CategoryTheory.Adjunction.PartialAdjoint +public import Mathlib.CategoryTheory.Adjunction.Quadruple +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Adjunction.Restrict +public import Mathlib.CategoryTheory.Adjunction.Triple +public import Mathlib.CategoryTheory.Adjunction.Unique +public import Mathlib.CategoryTheory.Adjunction.Whiskering +public import Mathlib.CategoryTheory.Balanced +public import Mathlib.CategoryTheory.Bicategory.Adjunction.Adj +public import Mathlib.CategoryTheory.Bicategory.Adjunction.Basic +public import Mathlib.CategoryTheory.Bicategory.Adjunction.Mate +public import Mathlib.CategoryTheory.Bicategory.Basic +public import Mathlib.CategoryTheory.Bicategory.CatEnriched +public import Mathlib.CategoryTheory.Bicategory.Coherence +public import Mathlib.CategoryTheory.Bicategory.End +public import Mathlib.CategoryTheory.Bicategory.EqToHom +public import Mathlib.CategoryTheory.Bicategory.Extension +public import Mathlib.CategoryTheory.Bicategory.Free +public import Mathlib.CategoryTheory.Bicategory.Functor.Cat +public import Mathlib.CategoryTheory.Bicategory.Functor.Lax +public import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete +public import Mathlib.CategoryTheory.Bicategory.Functor.Oplax +public import Mathlib.CategoryTheory.Bicategory.Functor.Prelax +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +public import Mathlib.CategoryTheory.Bicategory.Functor.Strict +public import Mathlib.CategoryTheory.Bicategory.Functor.StrictlyUnitary +public import Mathlib.CategoryTheory.Bicategory.FunctorBicategory.Oplax +public import Mathlib.CategoryTheory.Bicategory.Grothendieck +public import Mathlib.CategoryTheory.Bicategory.Kan.Adjunction +public import Mathlib.CategoryTheory.Bicategory.Kan.HasKan +public import Mathlib.CategoryTheory.Bicategory.Kan.IsKan +public import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete +public import Mathlib.CategoryTheory.Bicategory.Modification.Oplax +public import Mathlib.CategoryTheory.Bicategory.Monad.Basic +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Lax +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Pseudo +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Strong +public import Mathlib.CategoryTheory.Bicategory.Opposites +public import Mathlib.CategoryTheory.Bicategory.SingleObj +public import Mathlib.CategoryTheory.Bicategory.Strict +public import Mathlib.CategoryTheory.Bicategory.Strict.Basic +public import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor +public import Mathlib.CategoryTheory.CatCommSq +public import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.CategoryTheory.Category.Bipointed +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Category.Cat.Adjunction +public import Mathlib.CategoryTheory.Category.Cat.AsSmall +public import Mathlib.CategoryTheory.Category.Cat.CartesianClosed +public import Mathlib.CategoryTheory.Category.Cat.Colimit +public import Mathlib.CategoryTheory.Category.Cat.Limit +public import Mathlib.CategoryTheory.Category.Cat.Op +public import Mathlib.CategoryTheory.Category.Cat.Terminal +public import Mathlib.CategoryTheory.Category.Factorisation +public import Mathlib.CategoryTheory.Category.GaloisConnection +public import Mathlib.CategoryTheory.Category.Grpd +public import Mathlib.CategoryTheory.Category.Init +public import Mathlib.CategoryTheory.Category.KleisliCat +public import Mathlib.CategoryTheory.Category.Pairwise +public import Mathlib.CategoryTheory.Category.PartialFun +public import Mathlib.CategoryTheory.Category.Pointed +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Category.Quiv +public import Mathlib.CategoryTheory.Category.ReflQuiv +public import Mathlib.CategoryTheory.Category.RelCat +public import Mathlib.CategoryTheory.Category.TwoP +public import Mathlib.CategoryTheory.Category.ULift +public import Mathlib.CategoryTheory.Center.Basic +public import Mathlib.CategoryTheory.Center.Linear +public import Mathlib.CategoryTheory.Center.Localization +public import Mathlib.CategoryTheory.ChosenFiniteProducts +public import Mathlib.CategoryTheory.ChosenFiniteProducts.Cat +public import Mathlib.CategoryTheory.ChosenFiniteProducts.FunctorCategory +public import Mathlib.CategoryTheory.ChosenFiniteProducts.InfSemilattice +public import Mathlib.CategoryTheory.ChosenFiniteProducts.Over +public import Mathlib.CategoryTheory.Closed.Cartesian +public import Mathlib.CategoryTheory.Closed.Enrichment +public import Mathlib.CategoryTheory.Closed.Functor +public import Mathlib.CategoryTheory.Closed.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Closed.FunctorCategory.Complete +public import Mathlib.CategoryTheory.Closed.FunctorCategory.Groupoid +public import Mathlib.CategoryTheory.Closed.FunctorToTypes +public import Mathlib.CategoryTheory.Closed.Ideal +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Closed.Types +public import Mathlib.CategoryTheory.Closed.Zero +public import Mathlib.CategoryTheory.CodiscreteCategory +public import Mathlib.CategoryTheory.CofilteredSystem +public import Mathlib.CategoryTheory.CommSq +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.Comma.Basic +public import Mathlib.CategoryTheory.Comma.CardinalArrow +public import Mathlib.CategoryTheory.Comma.Final +public import Mathlib.CategoryTheory.Comma.LocallySmall +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Comma.Over.OverClass +public import Mathlib.CategoryTheory.Comma.Over.Pullback +public import Mathlib.CategoryTheory.Comma.Presheaf.Basic +public import Mathlib.CategoryTheory.Comma.Presheaf.Colimit +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.Comma.StructuredArrow.CommaMap +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Final +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Functor +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Small +public import Mathlib.CategoryTheory.ComposableArrows.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.Bundled +public import Mathlib.CategoryTheory.ConcreteCategory.BundledHom +public import Mathlib.CategoryTheory.ConcreteCategory.Elementwise +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +public import Mathlib.CategoryTheory.ConcreteCategory.ReflectsIso +public import Mathlib.CategoryTheory.ConcreteCategory.UnbundledHom +public import Mathlib.CategoryTheory.Conj +public import Mathlib.CategoryTheory.ConnectedComponents +public import Mathlib.CategoryTheory.CopyDiscardCategory.Basic +public import Mathlib.CategoryTheory.CopyDiscardCategory.Cartesian +public import Mathlib.CategoryTheory.CopyDiscardCategory.Deterministic +public import Mathlib.CategoryTheory.Core +public import Mathlib.CategoryTheory.Countable +public import Mathlib.CategoryTheory.Dialectica.Basic +public import Mathlib.CategoryTheory.Dialectica.Monoidal +public import Mathlib.CategoryTheory.DifferentialObject +public import Mathlib.CategoryTheory.DinatTrans +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Discrete.StructuredArrow +public import Mathlib.CategoryTheory.Discrete.SumsProducts +public import Mathlib.CategoryTheory.Distributive.Cartesian +public import Mathlib.CategoryTheory.Distributive.Monoidal +public import Mathlib.CategoryTheory.EffectiveEpi.Basic +public import Mathlib.CategoryTheory.EffectiveEpi.Comp +public import Mathlib.CategoryTheory.EffectiveEpi.Coproduct +public import Mathlib.CategoryTheory.EffectiveEpi.Enough +public import Mathlib.CategoryTheory.EffectiveEpi.Extensive +public import Mathlib.CategoryTheory.EffectiveEpi.Preserves +public import Mathlib.CategoryTheory.EffectiveEpi.RegularEpi +public import Mathlib.CategoryTheory.Elements +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Endofunctor.Algebra +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.CategoryTheory.Enriched.Basic +public import Mathlib.CategoryTheory.Enriched.EnrichedCat +public import Mathlib.CategoryTheory.Enriched.FunctorCategory +public import Mathlib.CategoryTheory.Enriched.HomCongr +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalProducts +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalPullbacks +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalTerminal +public import Mathlib.CategoryTheory.Enriched.Opposite +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.CategoryTheory.Equivalence.Symmetry +public import Mathlib.CategoryTheory.EssentialImage +public import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.Extensive +public import Mathlib.CategoryTheory.ExtremalEpi +public import Mathlib.CategoryTheory.FiberedCategory.BasedCategory +public import Mathlib.CategoryTheory.FiberedCategory.Cartesian +public import Mathlib.CategoryTheory.FiberedCategory.Cocartesian +public import Mathlib.CategoryTheory.FiberedCategory.Fiber +public import Mathlib.CategoryTheory.FiberedCategory.Fibered +public import Mathlib.CategoryTheory.FiberedCategory.Grothendieck +public import Mathlib.CategoryTheory.FiberedCategory.HasFibers +public import Mathlib.CategoryTheory.FiberedCategory.HomLift +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Filtered.Connected +public import Mathlib.CategoryTheory.Filtered.CostructuredArrow +public import Mathlib.CategoryTheory.Filtered.Final +public import Mathlib.CategoryTheory.Filtered.Flat +public import Mathlib.CategoryTheory.Filtered.Grothendieck +public import Mathlib.CategoryTheory.Filtered.OfColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Filtered.Small +public import Mathlib.CategoryTheory.FinCategory.AsType +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.CategoryTheory.FintypeCat +public import Mathlib.CategoryTheory.FullSubcategory +public import Mathlib.CategoryTheory.Functor.Basic +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Functor.Const +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Functor.CurryingThree +public import Mathlib.CategoryTheory.Functor.Derived.Adjunction +public import Mathlib.CategoryTheory.Functor.Derived.LeftDerived +public import Mathlib.CategoryTheory.Functor.Derived.PointwiseRightDerived +public import Mathlib.CategoryTheory.Functor.Derived.RightDerived +public import Mathlib.CategoryTheory.Functor.EpiMono +public import Mathlib.CategoryTheory.Functor.Flat +public import Mathlib.CategoryTheory.Functor.FullyFaithful +public import Mathlib.CategoryTheory.Functor.FunctorHom +public import Mathlib.CategoryTheory.Functor.Functorial +public import Mathlib.CategoryTheory.Functor.Hom +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Functor.KanExtension.Basic +public import Mathlib.CategoryTheory.Functor.KanExtension.Dense +public import Mathlib.CategoryTheory.Functor.KanExtension.DenseAt +public import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise +public import Mathlib.CategoryTheory.Functor.KanExtension.Preserves +public import Mathlib.CategoryTheory.Functor.OfSequence +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.Functor.Trifunctor +public import Mathlib.CategoryTheory.Functor.TwoSquare +public import Mathlib.CategoryTheory.Galois.Action +public import Mathlib.CategoryTheory.Galois.Basic +public import Mathlib.CategoryTheory.Galois.Decomposition +public import Mathlib.CategoryTheory.Galois.Equivalence +public import Mathlib.CategoryTheory.Galois.EssSurj +public import Mathlib.CategoryTheory.Galois.Examples +public import Mathlib.CategoryTheory.Galois.Full +public import Mathlib.CategoryTheory.Galois.GaloisObjects +public import Mathlib.CategoryTheory.Galois.IsFundamentalgroup +public import Mathlib.CategoryTheory.Galois.Prorepresentability +public import Mathlib.CategoryTheory.Galois.Topology +public import Mathlib.CategoryTheory.Generator.Abelian +public import Mathlib.CategoryTheory.Generator.Basic +public import Mathlib.CategoryTheory.Generator.HomologicalComplex +public import Mathlib.CategoryTheory.Generator.Indization +public import Mathlib.CategoryTheory.Generator.Preadditive +public import Mathlib.CategoryTheory.Generator.Presheaf +public import Mathlib.CategoryTheory.Generator.Sheaf +public import Mathlib.CategoryTheory.Generator.StrongGenerator +public import Mathlib.CategoryTheory.GlueData +public import Mathlib.CategoryTheory.GradedObject +public import Mathlib.CategoryTheory.GradedObject.Associator +public import Mathlib.CategoryTheory.GradedObject.Bifunctor +public import Mathlib.CategoryTheory.GradedObject.Braiding +public import Mathlib.CategoryTheory.GradedObject.Monoidal +public import Mathlib.CategoryTheory.GradedObject.Single +public import Mathlib.CategoryTheory.GradedObject.Trifunctor +public import Mathlib.CategoryTheory.GradedObject.Unitor +public import Mathlib.CategoryTheory.Grothendieck +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.Groupoid.Basic +public import Mathlib.CategoryTheory.Groupoid.Discrete +public import Mathlib.CategoryTheory.Groupoid.FreeGroupoid +public import Mathlib.CategoryTheory.Groupoid.FreeGroupoidOfCategory +public import Mathlib.CategoryTheory.Groupoid.Subgroupoid +public import Mathlib.CategoryTheory.Groupoid.VertexGroup +public import Mathlib.CategoryTheory.GuitartExact.Basic +public import Mathlib.CategoryTheory.GuitartExact.KanExtension +public import Mathlib.CategoryTheory.GuitartExact.Opposite +public import Mathlib.CategoryTheory.GuitartExact.Over +public import Mathlib.CategoryTheory.GuitartExact.VerticalComposition +public import Mathlib.CategoryTheory.HomCongr +public import Mathlib.CategoryTheory.Idempotents.Basic +public import Mathlib.CategoryTheory.Idempotents.Biproducts +public import Mathlib.CategoryTheory.Idempotents.FunctorCategories +public import Mathlib.CategoryTheory.Idempotents.FunctorExtension +public import Mathlib.CategoryTheory.Idempotents.HomologicalComplex +public import Mathlib.CategoryTheory.Idempotents.Karoubi +public import Mathlib.CategoryTheory.Idempotents.KaroubiKaroubi +public import Mathlib.CategoryTheory.Idempotents.SimplicialObject +public import Mathlib.CategoryTheory.InducedCategory +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Iso +public import Mathlib.CategoryTheory.IsomorphismClasses +public import Mathlib.CategoryTheory.Join.Basic +public import Mathlib.CategoryTheory.Join.Final +public import Mathlib.CategoryTheory.Join.Opposites +public import Mathlib.CategoryTheory.Join.Pseudofunctor +public import Mathlib.CategoryTheory.Join.Sum +public import Mathlib.CategoryTheory.LiftingProperties.Adjunction +public import Mathlib.CategoryTheory.LiftingProperties.Basic +public import Mathlib.CategoryTheory.LiftingProperties.Limits +public import Mathlib.CategoryTheory.LiftingProperties.Over +public import Mathlib.CategoryTheory.LiftingProperties.ParametrizedAdjunction +public import Mathlib.CategoryTheory.Limits.Bicones +public import Mathlib.CategoryTheory.Limits.ColimitLimit +public import Mathlib.CategoryTheory.Limits.Comma +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.WithAlgebraicStructures +public import Mathlib.CategoryTheory.Limits.ConeCategory +public import Mathlib.CategoryTheory.Limits.Cones +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Limits.Constructions.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Constructions.Equalizers +public import Mathlib.CategoryTheory.Limits.Constructions.EventuallyConstant +public import Mathlib.CategoryTheory.Limits.Constructions.Filtered +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Products +public import Mathlib.CategoryTheory.Limits.Constructions.Pullbacks +public import Mathlib.CategoryTheory.Limits.Constructions.WeaklyInitial +public import Mathlib.CategoryTheory.Limits.Constructions.ZeroObjects +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Elements +public import Mathlib.CategoryTheory.Limits.EpiMono +public import Mathlib.CategoryTheory.Limits.EssentiallySmall +public import Mathlib.CategoryTheory.Limits.ExactFunctor +public import Mathlib.CategoryTheory.Limits.Filtered +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesProduct +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Limits.Final.Connected +public import Mathlib.CategoryTheory.Limits.Final.ParallelPair +public import Mathlib.CategoryTheory.Limits.Final.Type +public import Mathlib.CategoryTheory.Limits.FinallySmall +public import Mathlib.CategoryTheory.Limits.FintypeCat +public import Mathlib.CategoryTheory.Limits.FormalCoproducts +public import Mathlib.CategoryTheory.Limits.Fubini +public import Mathlib.CategoryTheory.Limits.FullSubcategory +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Filtered +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Finite +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Products +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Pullbacks +public import Mathlib.CategoryTheory.Limits.FunctorToTypes +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.IndYoneda +public import Mathlib.CategoryTheory.Limits.Indization.Category +public import Mathlib.CategoryTheory.Limits.Indization.Equalizers +public import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits +public import Mathlib.CategoryTheory.Limits.Indization.IndObject +public import Mathlib.CategoryTheory.Limits.Indization.LocallySmall +public import Mathlib.CategoryTheory.Limits.Indization.ParallelPair +public import Mathlib.CategoryTheory.Limits.Indization.Products +public import Mathlib.CategoryTheory.Limits.IsConnected +public import Mathlib.CategoryTheory.Limits.IsLimit +public import Mathlib.CategoryTheory.Limits.Lattice +public import Mathlib.CategoryTheory.Limits.MonoCoprod +public import Mathlib.CategoryTheory.Limits.MorphismProperty +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Over +public import Mathlib.CategoryTheory.Limits.Pi +public import Mathlib.CategoryTheory.Limits.Preorder +public import Mathlib.CategoryTheory.Limits.Presentation +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Bifunctor +public import Mathlib.CategoryTheory.Limits.Preserves.Creates.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Creates.Pullbacks +public import Mathlib.CategoryTheory.Limits.Preserves.Filtered +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Limits.Preserves.Grothendieck +public import Mathlib.CategoryTheory.Limits.Preserves.Limits +public import Mathlib.CategoryTheory.Limits.Preserves.Opposites +public import Mathlib.CategoryTheory.Limits.Preserves.Over +public import Mathlib.CategoryTheory.Limits.Preserves.Presheaf +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Biproducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Images +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Over +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Preorder +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Square +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Limits.Preserves.Yoneda +public import Mathlib.CategoryTheory.Limits.Presheaf +public import Mathlib.CategoryTheory.Limits.Set +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Biproducts +public import Mathlib.CategoryTheory.Limits.Shapes.CombinedProducts +public import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory +public import Mathlib.CategoryTheory.Limits.Shapes.Connected +public import Mathlib.CategoryTheory.Limits.Shapes.Countable +public import Mathlib.CategoryTheory.Limits.Shapes.Diagonal +public import Mathlib.CategoryTheory.Limits.Shapes.DisjointCoproduct +public import Mathlib.CategoryTheory.Limits.Shapes.End +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Equivalence +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteMultiequalizer +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +public import Mathlib.CategoryTheory.Limits.Shapes.FunctorToTypes +public import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +public import Mathlib.CategoryTheory.Limits.Shapes.KernelPair +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Shapes.MultiequalizerPullback +public import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Filtered +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Kernels +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Pullbacks +public import Mathlib.CategoryTheory.Limits.Shapes.PiProd +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.Fin +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.HasIterationOfShape +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.PrincipalSeg +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.TransfiniteCompositionOfShape +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Assoc +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Categorical.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Categorical.CatCospanTransform +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Connected +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Cospan +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Equalizer +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Pasting +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.PullbackCone +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Square +public import Mathlib.CategoryTheory.Limits.Shapes.Reflexive +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.CategoryTheory.Limits.Shapes.SequentialProduct +public import Mathlib.CategoryTheory.Limits.Shapes.SingleObj +public import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer +public import Mathlib.CategoryTheory.Limits.Shapes.SplitEqualizer +public import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial +public import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects +public import Mathlib.CategoryTheory.Limits.Sifted +public import Mathlib.CategoryTheory.Limits.Skeleton +public import Mathlib.CategoryTheory.Limits.SmallComplete +public import Mathlib.CategoryTheory.Limits.Types.Coequalizers +public import Mathlib.CategoryTheory.Limits.Types.ColimitType +public import Mathlib.CategoryTheory.Limits.Types.ColimitTypeFiltered +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Limits.Types.Coproducts +public import Mathlib.CategoryTheory.Limits.Types.Equalizers +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Limits.Types.Images +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Types.Multicoequalizer +public import Mathlib.CategoryTheory.Limits.Types.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.CategoryTheory.Limits.Types.Pullbacks +public import Mathlib.CategoryTheory.Limits.Types.Pushouts +public import Mathlib.CategoryTheory.Limits.Types.Shapes +public import Mathlib.CategoryTheory.Limits.Types.Yoneda +public import Mathlib.CategoryTheory.Limits.Unit +public import Mathlib.CategoryTheory.Limits.VanKampen +public import Mathlib.CategoryTheory.Limits.Yoneda +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.CategoryTheory.Linear.FunctorCategory +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.CategoryTheory.Linear.Yoneda +public import Mathlib.CategoryTheory.Localization.Adjunction +public import Mathlib.CategoryTheory.Localization.Bifunctor +public import Mathlib.CategoryTheory.Localization.Bousfield +public import Mathlib.CategoryTheory.Localization.BousfieldTransfiniteComposition +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.ComposableArrows +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Fractions +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.OfAdjunction +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Preadditive +public import Mathlib.CategoryTheory.Localization.Composition +public import Mathlib.CategoryTheory.Localization.Construction +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Basic +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Constructor +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Derives +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.OfFunctorialResolutions +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.PointwiseRightDerived +public import Mathlib.CategoryTheory.Localization.Equivalence +public import Mathlib.CategoryTheory.Localization.FiniteProducts +public import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.CategoryTheory.Localization.HomEquiv +public import Mathlib.CategoryTheory.Localization.Linear +public import Mathlib.CategoryTheory.Localization.LocalizerMorphism +public import Mathlib.CategoryTheory.Localization.LocallySmall +public import Mathlib.CategoryTheory.Localization.Monoidal +public import Mathlib.CategoryTheory.Localization.Monoidal.Basic +public import Mathlib.CategoryTheory.Localization.Monoidal.Braided +public import Mathlib.CategoryTheory.Localization.Monoidal.Functor +public import Mathlib.CategoryTheory.Localization.Opposite +public import Mathlib.CategoryTheory.Localization.Pi +public import Mathlib.CategoryTheory.Localization.Preadditive +public import Mathlib.CategoryTheory.Localization.Predicate +public import Mathlib.CategoryTheory.Localization.Prod +public import Mathlib.CategoryTheory.Localization.Quotient +public import Mathlib.CategoryTheory.Localization.Resolution +public import Mathlib.CategoryTheory.Localization.SmallHom +public import Mathlib.CategoryTheory.Localization.SmallShiftedHom +public import Mathlib.CategoryTheory.Localization.StructuredArrow +public import Mathlib.CategoryTheory.Localization.Triangulated +public import Mathlib.CategoryTheory.Localization.Trifunctor +public import Mathlib.CategoryTheory.LocallyCartesianClosed.ChosenPullbacksAlong +public import Mathlib.CategoryTheory.LocallyDirected +public import Mathlib.CategoryTheory.MarkovCategory.Basic +public import Mathlib.CategoryTheory.Monad.Adjunction +public import Mathlib.CategoryTheory.Monad.Algebra +public import Mathlib.CategoryTheory.Monad.Basic +public import Mathlib.CategoryTheory.Monad.Coequalizer +public import Mathlib.CategoryTheory.Monad.Comonadicity +public import Mathlib.CategoryTheory.Monad.Equalizer +public import Mathlib.CategoryTheory.Monad.EquivMon +public import Mathlib.CategoryTheory.Monad.Kleisli +public import Mathlib.CategoryTheory.Monad.Limits +public import Mathlib.CategoryTheory.Monad.Monadicity +public import Mathlib.CategoryTheory.Monad.Products +public import Mathlib.CategoryTheory.Monad.Types +public import Mathlib.CategoryTheory.Monoidal.Action.Basic +public import Mathlib.CategoryTheory.Monoidal.Action.End +public import Mathlib.CategoryTheory.Monoidal.Action.LinearFunctor +public import Mathlib.CategoryTheory.Monoidal.Action.Opposites +public import Mathlib.CategoryTheory.Monoidal.Bimod +public import Mathlib.CategoryTheory.Monoidal.Bimon_ +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.Braided.Multifunctor +public import Mathlib.CategoryTheory.Monoidal.Braided.Opposite +public import Mathlib.CategoryTheory.Monoidal.Braided.Reflection +public import Mathlib.CategoryTheory.Monoidal.Braided.Transport +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat +public import Mathlib.CategoryTheory.Monoidal.Cartesian.CommGrp_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.CommMon_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Comon_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Grp_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.InfSemilattice +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Mod_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Over +public import Mathlib.CategoryTheory.Monoidal.Category +public import Mathlib.CategoryTheory.Monoidal.Center +public import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas +public import Mathlib.CategoryTheory.Monoidal.CommComon_ +public import Mathlib.CategoryTheory.Monoidal.CommGrp_ +public import Mathlib.CategoryTheory.Monoidal.CommMon_ +public import Mathlib.CategoryTheory.Monoidal.Comon_ +public import Mathlib.CategoryTheory.Monoidal.Conv +public import Mathlib.CategoryTheory.Monoidal.DayConvolution +public import Mathlib.CategoryTheory.Monoidal.DayConvolution.Braided +public import Mathlib.CategoryTheory.Monoidal.DayConvolution.Closed +public import Mathlib.CategoryTheory.Monoidal.DayConvolution.DayFunctor +public import Mathlib.CategoryTheory.Monoidal.Discrete +public import Mathlib.CategoryTheory.Monoidal.End +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct.KanExtension +public import Mathlib.CategoryTheory.Monoidal.Free.Basic +public import Mathlib.CategoryTheory.Monoidal.Free.Coherence +public import Mathlib.CategoryTheory.Monoidal.Functor +public import Mathlib.CategoryTheory.Monoidal.Functor.Types +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Grp_ +public import Mathlib.CategoryTheory.Monoidal.Hopf_ +public import Mathlib.CategoryTheory.Monoidal.Internal.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Internal.Limits +public import Mathlib.CategoryTheory.Monoidal.Internal.Module +public import Mathlib.CategoryTheory.Monoidal.Internal.Types.Basic +public import Mathlib.CategoryTheory.Monoidal.Internal.Types.CommGrp_ +public import Mathlib.CategoryTheory.Monoidal.Internal.Types.Grp_ +public import Mathlib.CategoryTheory.Monoidal.Limits +public import Mathlib.CategoryTheory.Monoidal.Limits.Basic +public import Mathlib.CategoryTheory.Monoidal.Limits.Preserves +public import Mathlib.CategoryTheory.Monoidal.Linear +public import Mathlib.CategoryTheory.Monoidal.Mod_ +public import Mathlib.CategoryTheory.Monoidal.Mon_ +public import Mathlib.CategoryTheory.Monoidal.Multifunctor +public import Mathlib.CategoryTheory.Monoidal.NaturalTransformation +public import Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Basic +public import Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Symmetric +public import Mathlib.CategoryTheory.Monoidal.OfHasFiniteProducts +public import Mathlib.CategoryTheory.Monoidal.Opposite +public import Mathlib.CategoryTheory.Monoidal.Opposite.Mon_ +public import Mathlib.CategoryTheory.Monoidal.Preadditive +public import Mathlib.CategoryTheory.Monoidal.Rigid.Basic +public import Mathlib.CategoryTheory.Monoidal.Rigid.Braided +public import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence +public import Mathlib.CategoryTheory.Monoidal.Skeleton +public import Mathlib.CategoryTheory.Monoidal.Subcategory +public import Mathlib.CategoryTheory.Monoidal.Tor +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.CategoryTheory.Monoidal.Types.Basic +public import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda +public import Mathlib.CategoryTheory.Monoidal.Yoneda +public import Mathlib.CategoryTheory.MorphismProperty.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.MorphismProperty.Concrete +public import Mathlib.CategoryTheory.MorphismProperty.Descent +public import Mathlib.CategoryTheory.MorphismProperty.Factorization +public import Mathlib.CategoryTheory.MorphismProperty.FunctorCategory +public import Mathlib.CategoryTheory.MorphismProperty.Ind +public import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy +public import Mathlib.CategoryTheory.MorphismProperty.IsSmall +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.MorphismProperty.Local +public import Mathlib.CategoryTheory.MorphismProperty.OverAdjunction +public import Mathlib.CategoryTheory.MorphismProperty.Representable +public import Mathlib.CategoryTheory.MorphismProperty.Retract +public import Mathlib.CategoryTheory.MorphismProperty.RetractArgument +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +public import Mathlib.CategoryTheory.MorphismProperty.WeakFactorizationSystem +public import Mathlib.CategoryTheory.NatIso +public import Mathlib.CategoryTheory.NatTrans +public import Mathlib.CategoryTheory.Noetherian +public import Mathlib.CategoryTheory.ObjectProperty.Basic +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.ObjectProperty.ColimitsClosure +public import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape +public import Mathlib.CategoryTheory.ObjectProperty.CompleteLattice +public import Mathlib.CategoryTheory.ObjectProperty.ContainsZero +public import Mathlib.CategoryTheory.ObjectProperty.EpiMono +public import Mathlib.CategoryTheory.ObjectProperty.Extensions +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +public import Mathlib.CategoryTheory.ObjectProperty.Ind +public import Mathlib.CategoryTheory.ObjectProperty.LimitsClosure +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +public import Mathlib.CategoryTheory.ObjectProperty.Local +public import Mathlib.CategoryTheory.ObjectProperty.Opposite +public import Mathlib.CategoryTheory.ObjectProperty.Retract +public import Mathlib.CategoryTheory.ObjectProperty.Shift +public import Mathlib.CategoryTheory.ObjectProperty.Small +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.CategoryTheory.PEmpty +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.CategoryTheory.PathCategory.Basic +public import Mathlib.CategoryTheory.PathCategory.MorphismProperty +public import Mathlib.CategoryTheory.Pi.Basic +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.CategoryTheory.Preadditive.Biproducts +public import Mathlib.CategoryTheory.Preadditive.CommGrp_ +public import Mathlib.CategoryTheory.Preadditive.EilenbergMoore +public import Mathlib.CategoryTheory.Preadditive.EndoFunctor +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory +public import Mathlib.CategoryTheory.Preadditive.HomOrthogonal +public import Mathlib.CategoryTheory.Preadditive.Indization +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic +public import Mathlib.CategoryTheory.Preadditive.Injective.LiftingProperties +public import Mathlib.CategoryTheory.Preadditive.Injective.Preserves +public import Mathlib.CategoryTheory.Preadditive.Injective.Resolution +public import Mathlib.CategoryTheory.Preadditive.LeftExact +public import Mathlib.CategoryTheory.Preadditive.LiftToFinset +public import Mathlib.CategoryTheory.Preadditive.Mat +public import Mathlib.CategoryTheory.Preadditive.OfBiproducts +public import Mathlib.CategoryTheory.Preadditive.Opposite +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic +public import Mathlib.CategoryTheory.Preadditive.Projective.Internal +public import Mathlib.CategoryTheory.Preadditive.Projective.LiftingProperties +public import Mathlib.CategoryTheory.Preadditive.Projective.Preserves +public import Mathlib.CategoryTheory.Preadditive.Projective.Resolution +public import Mathlib.CategoryTheory.Preadditive.Schur +public import Mathlib.CategoryTheory.Preadditive.SingleObj +public import Mathlib.CategoryTheory.Preadditive.Transfer +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Injective +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Projective +public import Mathlib.CategoryTheory.Presentable.Basic +public import Mathlib.CategoryTheory.Presentable.CardinalFilteredPresentation +public import Mathlib.CategoryTheory.Presentable.ColimitPresentation +public import Mathlib.CategoryTheory.Presentable.Finite +public import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered +public import Mathlib.CategoryTheory.Presentable.Limits +public import Mathlib.CategoryTheory.Presentable.LocallyPresentable +public import Mathlib.CategoryTheory.Presentable.OrthogonalReflection +public import Mathlib.CategoryTheory.Presentable.Type +public import Mathlib.CategoryTheory.Products.Associator +public import Mathlib.CategoryTheory.Products.Basic +public import Mathlib.CategoryTheory.Products.Bifunctor +public import Mathlib.CategoryTheory.Products.Unitor +public import Mathlib.CategoryTheory.Quotient +public import Mathlib.CategoryTheory.Quotient.Linear +public import Mathlib.CategoryTheory.Quotient.Preadditive +public import Mathlib.CategoryTheory.Retract +public import Mathlib.CategoryTheory.Shift.Adjunction +public import Mathlib.CategoryTheory.Shift.Basic +public import Mathlib.CategoryTheory.Shift.CommShift +public import Mathlib.CategoryTheory.Shift.Induced +public import Mathlib.CategoryTheory.Shift.InducedShiftSequence +public import Mathlib.CategoryTheory.Shift.Linear +public import Mathlib.CategoryTheory.Shift.Localization +public import Mathlib.CategoryTheory.Shift.Opposite +public import Mathlib.CategoryTheory.Shift.Pullback +public import Mathlib.CategoryTheory.Shift.Quotient +public import Mathlib.CategoryTheory.Shift.ShiftSequence +public import Mathlib.CategoryTheory.Shift.ShiftedHom +public import Mathlib.CategoryTheory.Shift.ShiftedHomOpposite +public import Mathlib.CategoryTheory.Shift.SingleFunctors +public import Mathlib.CategoryTheory.Sigma.Basic +public import Mathlib.CategoryTheory.Simple +public import Mathlib.CategoryTheory.SingleObj +public import Mathlib.CategoryTheory.Sites.Abelian +public import Mathlib.CategoryTheory.Sites.Adjunction +public import Mathlib.CategoryTheory.Sites.Canonical +public import Mathlib.CategoryTheory.Sites.CartesianClosed +public import Mathlib.CategoryTheory.Sites.CartesianMonoidal +public import Mathlib.CategoryTheory.Sites.ChosenFiniteProducts +public import Mathlib.CategoryTheory.Sites.Closed +public import Mathlib.CategoryTheory.Sites.Coherent.Basic +public import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves +public import Mathlib.CategoryTheory.Sites.Coherent.CoherentTopology +public import Mathlib.CategoryTheory.Sites.Coherent.Comparison +public import Mathlib.CategoryTheory.Sites.Coherent.Equivalence +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveColimits +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveSheaves +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveTopology +public import Mathlib.CategoryTheory.Sites.Coherent.LocallySurjective +public import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPrecoherent +public import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular +public import Mathlib.CategoryTheory.Sites.Coherent.RegularSheaves +public import Mathlib.CategoryTheory.Sites.Coherent.RegularTopology +public import Mathlib.CategoryTheory.Sites.Coherent.SequentialLimit +public import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison +public import Mathlib.CategoryTheory.Sites.CompatiblePlus +public import Mathlib.CategoryTheory.Sites.CompatibleSheafification +public import Mathlib.CategoryTheory.Sites.ConcreteSheafification +public import Mathlib.CategoryTheory.Sites.ConstantSheaf +public import Mathlib.CategoryTheory.Sites.Continuous +public import Mathlib.CategoryTheory.Sites.CoverLifting +public import Mathlib.CategoryTheory.Sites.CoverPreserving +public import Mathlib.CategoryTheory.Sites.Coverage +public import Mathlib.CategoryTheory.Sites.CoversTop +public import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic +public import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology +public import Mathlib.CategoryTheory.Sites.DenseSubsite.SheafEquiv +public import Mathlib.CategoryTheory.Sites.Descent.IsPrestack +public import Mathlib.CategoryTheory.Sites.EffectiveEpimorphic +public import Mathlib.CategoryTheory.Sites.EpiMono +public import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition +public import Mathlib.CategoryTheory.Sites.Equivalence +public import Mathlib.CategoryTheory.Sites.Finite +public import Mathlib.CategoryTheory.Sites.GlobalSections +public import Mathlib.CategoryTheory.Sites.Grothendieck +public import Mathlib.CategoryTheory.Sites.Hypercover.Homotopy +public import Mathlib.CategoryTheory.Sites.Hypercover.IsSheaf +public import Mathlib.CategoryTheory.Sites.Hypercover.One +public import Mathlib.CategoryTheory.Sites.Hypercover.Zero +public import Mathlib.CategoryTheory.Sites.Hypercover.ZeroFamily +public import Mathlib.CategoryTheory.Sites.IsSheafFor +public import Mathlib.CategoryTheory.Sites.JointlySurjective +public import Mathlib.CategoryTheory.Sites.LeftExact +public import Mathlib.CategoryTheory.Sites.Limits +public import Mathlib.CategoryTheory.Sites.Localization +public import Mathlib.CategoryTheory.Sites.LocallyBijective +public import Mathlib.CategoryTheory.Sites.LocallyFullyFaithful +public import Mathlib.CategoryTheory.Sites.LocallyInjective +public import Mathlib.CategoryTheory.Sites.LocallySurjective +public import Mathlib.CategoryTheory.Sites.MayerVietorisSquare +public import Mathlib.CategoryTheory.Sites.Monoidal +public import Mathlib.CategoryTheory.Sites.MorphismProperty +public import Mathlib.CategoryTheory.Sites.NonabelianCohomology.H1 +public import Mathlib.CategoryTheory.Sites.Over +public import Mathlib.CategoryTheory.Sites.Plus +public import Mathlib.CategoryTheory.Sites.Precoverage +public import Mathlib.CategoryTheory.Sites.Preserves +public import Mathlib.CategoryTheory.Sites.PreservesLocallyBijective +public import Mathlib.CategoryTheory.Sites.PreservesSheafification +public import Mathlib.CategoryTheory.Sites.Pretopology +public import Mathlib.CategoryTheory.Sites.PseudofunctorSheafOver +public import Mathlib.CategoryTheory.Sites.Pullback +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.CategoryTheory.Sites.SheafCohomology.Basic +public import Mathlib.CategoryTheory.Sites.SheafHom +public import Mathlib.CategoryTheory.Sites.SheafOfTypes +public import Mathlib.CategoryTheory.Sites.Sheafification +public import Mathlib.CategoryTheory.Sites.Sieves +public import Mathlib.CategoryTheory.Sites.Spaces +public import Mathlib.CategoryTheory.Sites.Subcanonical +public import Mathlib.CategoryTheory.Sites.Subsheaf +public import Mathlib.CategoryTheory.Sites.Types +public import Mathlib.CategoryTheory.Sites.Whiskering +public import Mathlib.CategoryTheory.Skeletal +public import Mathlib.CategoryTheory.SmallObject.Basic +public import Mathlib.CategoryTheory.SmallObject.Construction +public import Mathlib.CategoryTheory.SmallObject.IsCardinalForSmallObjectArgument +public import Mathlib.CategoryTheory.SmallObject.Iteration.Basic +public import Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc +public import Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone +public import Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty +public import Mathlib.CategoryTheory.SmallObject.TransfiniteCompositionLifting +public import Mathlib.CategoryTheory.SmallObject.TransfiniteIteration +public import Mathlib.CategoryTheory.SmallObject.WellOrderInductionData +public import Mathlib.CategoryTheory.SmallRepresentatives +public import Mathlib.CategoryTheory.Square +public import Mathlib.CategoryTheory.Subobject.ArtinianObject +public import Mathlib.CategoryTheory.Subobject.Basic +public import Mathlib.CategoryTheory.Subobject.Comma +public import Mathlib.CategoryTheory.Subobject.FactorThru +public import Mathlib.CategoryTheory.Subobject.HasCardinalLT +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.CategoryTheory.Subobject.Limits +public import Mathlib.CategoryTheory.Subobject.MonoOver +public import Mathlib.CategoryTheory.Subobject.NoetherianObject +public import Mathlib.CategoryTheory.Subobject.Presheaf +public import Mathlib.CategoryTheory.Subobject.Types +public import Mathlib.CategoryTheory.Subobject.WellPowered +public import Mathlib.CategoryTheory.Subpresheaf.Basic +public import Mathlib.CategoryTheory.Subpresheaf.Equalizer +public import Mathlib.CategoryTheory.Subpresheaf.Finite +public import Mathlib.CategoryTheory.Subpresheaf.Image +public import Mathlib.CategoryTheory.Subpresheaf.OfSection +public import Mathlib.CategoryTheory.Subpresheaf.Sieves +public import Mathlib.CategoryTheory.Subpresheaf.Subobject +public import Mathlib.CategoryTheory.Subterminal +public import Mathlib.CategoryTheory.Sums.Associator +public import Mathlib.CategoryTheory.Sums.Basic +public import Mathlib.CategoryTheory.Sums.Products +public import Mathlib.CategoryTheory.Thin +public import Mathlib.CategoryTheory.Topos.Classifier +public import Mathlib.CategoryTheory.Triangulated.Adjunction +public import Mathlib.CategoryTheory.Triangulated.Basic +public import Mathlib.CategoryTheory.Triangulated.Functor +public import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor +public import Mathlib.CategoryTheory.Triangulated.Opposite.Basic +public import Mathlib.CategoryTheory.Triangulated.Opposite.Functor +public import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated +public import Mathlib.CategoryTheory.Triangulated.Opposite.Triangle +public import Mathlib.CategoryTheory.Triangulated.Pretriangulated +public import Mathlib.CategoryTheory.Triangulated.Rotate +public import Mathlib.CategoryTheory.Triangulated.Subcategory +public import Mathlib.CategoryTheory.Triangulated.TStructure.Basic +public import Mathlib.CategoryTheory.Triangulated.TriangleShift +public import Mathlib.CategoryTheory.Triangulated.Triangulated +public import Mathlib.CategoryTheory.Triangulated.Yoneda +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.CategoryTheory.Types.Monomorphisms +public import Mathlib.CategoryTheory.Types.Set +public import Mathlib.CategoryTheory.UnivLE +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.CategoryTheory.Widesubcategory +public import Mathlib.CategoryTheory.WithTerminal +public import Mathlib.CategoryTheory.WithTerminal.Basic +public import Mathlib.CategoryTheory.WithTerminal.Cone +public import Mathlib.CategoryTheory.WithTerminal.FinCategory +public import Mathlib.CategoryTheory.WithTerminal.Lemmas +public import Mathlib.CategoryTheory.Yoneda +public import Mathlib.Combinatorics.Additive.AP.Three.Behrend +public import Mathlib.Combinatorics.Additive.AP.Three.Defs +public import Mathlib.Combinatorics.Additive.ApproximateSubgroup +public import Mathlib.Combinatorics.Additive.CauchyDavenport +public import Mathlib.Combinatorics.Additive.Convolution +public import Mathlib.Combinatorics.Additive.Corner.Defs +public import Mathlib.Combinatorics.Additive.Corner.Roth +public import Mathlib.Combinatorics.Additive.CovBySMul +public import Mathlib.Combinatorics.Additive.Dissociation +public import Mathlib.Combinatorics.Additive.DoublingConst +public import Mathlib.Combinatorics.Additive.ETransform +public import Mathlib.Combinatorics.Additive.Energy +public import Mathlib.Combinatorics.Additive.ErdosGinzburgZiv +public import Mathlib.Combinatorics.Additive.FreimanHom +public import Mathlib.Combinatorics.Additive.PluenneckeRuzsa +public import Mathlib.Combinatorics.Additive.Randomisation +public import Mathlib.Combinatorics.Additive.RuzsaCovering +public import Mathlib.Combinatorics.Additive.SmallTripling +public import Mathlib.Combinatorics.Additive.VerySmallDoubling +public import Mathlib.Combinatorics.Colex +public import Mathlib.Combinatorics.Configuration +public import Mathlib.Combinatorics.Derangements.Basic +public import Mathlib.Combinatorics.Derangements.Exponential +public import Mathlib.Combinatorics.Derangements.Finite +public import Mathlib.Combinatorics.Digraph.Basic +public import Mathlib.Combinatorics.Digraph.Orientation +public import Mathlib.Combinatorics.Enumerative.Bell +public import Mathlib.Combinatorics.Enumerative.Catalan +public import Mathlib.Combinatorics.Enumerative.Composition +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.Enumerative.DyckWord +public import Mathlib.Combinatorics.Enumerative.IncidenceAlgebra +public import Mathlib.Combinatorics.Enumerative.InclusionExclusion +public import Mathlib.Combinatorics.Enumerative.Partition +public import Mathlib.Combinatorics.Enumerative.Partition.Basic +public import Mathlib.Combinatorics.Enumerative.Partition.GenFun +public import Mathlib.Combinatorics.Enumerative.Stirling +public import Mathlib.Combinatorics.Extremal.RuzsaSzemeredi +public import Mathlib.Combinatorics.Graph.Basic +public import Mathlib.Combinatorics.HalesJewett +public import Mathlib.Combinatorics.Hall.Basic +public import Mathlib.Combinatorics.Hall.Finite +public import Mathlib.Combinatorics.Hindman +public import Mathlib.Combinatorics.Matroid.Basic +public import Mathlib.Combinatorics.Matroid.Circuit +public import Mathlib.Combinatorics.Matroid.Closure +public import Mathlib.Combinatorics.Matroid.Constructions +public import Mathlib.Combinatorics.Matroid.Dual +public import Mathlib.Combinatorics.Matroid.IndepAxioms +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.Combinatorics.Matroid.Loop +public import Mathlib.Combinatorics.Matroid.Map +public import Mathlib.Combinatorics.Matroid.Minor.Contract +public import Mathlib.Combinatorics.Matroid.Minor.Delete +public import Mathlib.Combinatorics.Matroid.Minor.Order +public import Mathlib.Combinatorics.Matroid.Minor.Restrict +public import Mathlib.Combinatorics.Matroid.Rank.Cardinal +public import Mathlib.Combinatorics.Matroid.Rank.ENat +public import Mathlib.Combinatorics.Matroid.Rank.Finite +public import Mathlib.Combinatorics.Matroid.Sum +public import Mathlib.Combinatorics.Nullstellensatz +public import Mathlib.Combinatorics.Optimization.ValuedCSP +public import Mathlib.Combinatorics.Pigeonhole +public import Mathlib.Combinatorics.Quiver.Arborescence +public import Mathlib.Combinatorics.Quiver.Basic +public import Mathlib.Combinatorics.Quiver.Cast +public import Mathlib.Combinatorics.Quiver.ConnectedComponent +public import Mathlib.Combinatorics.Quiver.Covering +public import Mathlib.Combinatorics.Quiver.Path +public import Mathlib.Combinatorics.Quiver.Path.Decomposition +public import Mathlib.Combinatorics.Quiver.Path.Vertices +public import Mathlib.Combinatorics.Quiver.Path.Weight +public import Mathlib.Combinatorics.Quiver.Prefunctor +public import Mathlib.Combinatorics.Quiver.Push +public import Mathlib.Combinatorics.Quiver.ReflQuiver +public import Mathlib.Combinatorics.Quiver.SingleObj +public import Mathlib.Combinatorics.Quiver.Subquiver +public import Mathlib.Combinatorics.Quiver.Symmetric +public import Mathlib.Combinatorics.Schnirelmann +public import Mathlib.Combinatorics.SetFamily.AhlswedeZhang +public import Mathlib.Combinatorics.SetFamily.Compression.Down +public import Mathlib.Combinatorics.SetFamily.Compression.UV +public import Mathlib.Combinatorics.SetFamily.FourFunctions +public import Mathlib.Combinatorics.SetFamily.HarrisKleitman +public import Mathlib.Combinatorics.SetFamily.Intersecting +public import Mathlib.Combinatorics.SetFamily.Kleitman +public import Mathlib.Combinatorics.SetFamily.KruskalKatona +public import Mathlib.Combinatorics.SetFamily.LYM +public import Mathlib.Combinatorics.SetFamily.Shadow +public import Mathlib.Combinatorics.SetFamily.Shatter +public import Mathlib.Combinatorics.SimpleGraph.Acyclic +public import Mathlib.Combinatorics.SimpleGraph.AdjMatrix +public import Mathlib.Combinatorics.SimpleGraph.Basic +public import Mathlib.Combinatorics.SimpleGraph.Bipartite +public import Mathlib.Combinatorics.SimpleGraph.Circulant +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.Coloring +public import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite +public import Mathlib.Combinatorics.SimpleGraph.ConcreteColorings +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkDecomp +public import Mathlib.Combinatorics.SimpleGraph.Copy +public import Mathlib.Combinatorics.SimpleGraph.Dart +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum +public import Mathlib.Combinatorics.SimpleGraph.DeleteEdges +public import Mathlib.Combinatorics.SimpleGraph.Density +public import Mathlib.Combinatorics.SimpleGraph.Diam +public import Mathlib.Combinatorics.SimpleGraph.Ends.Defs +public import Mathlib.Combinatorics.SimpleGraph.Ends.Properties +public import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic +public import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan +public import Mathlib.Combinatorics.SimpleGraph.Extremal.TuranDensity +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Combinatorics.SimpleGraph.Finsubgraph +public import Mathlib.Combinatorics.SimpleGraph.FiveWheelLike +public import Mathlib.Combinatorics.SimpleGraph.Girth +public import Mathlib.Combinatorics.SimpleGraph.Hall +public import Mathlib.Combinatorics.SimpleGraph.Hamiltonian +public import Mathlib.Combinatorics.SimpleGraph.Hasse +public import Mathlib.Combinatorics.SimpleGraph.IncMatrix +public import Mathlib.Combinatorics.SimpleGraph.Init +public import Mathlib.Combinatorics.SimpleGraph.LapMatrix +public import Mathlib.Combinatorics.SimpleGraph.LineGraph +public import Mathlib.Combinatorics.SimpleGraph.Maps +public import Mathlib.Combinatorics.SimpleGraph.Matching +public import Mathlib.Combinatorics.SimpleGraph.Metric +public import Mathlib.Combinatorics.SimpleGraph.Operations +public import Mathlib.Combinatorics.SimpleGraph.Partition +public import Mathlib.Combinatorics.SimpleGraph.Path +public import Mathlib.Combinatorics.SimpleGraph.Paths +public import Mathlib.Combinatorics.SimpleGraph.Prod +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Bound +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Energy +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Equitabilise +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Increment +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Lemma +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform +public import Mathlib.Combinatorics.SimpleGraph.StronglyRegular +public import Mathlib.Combinatorics.SimpleGraph.Subgraph +public import Mathlib.Combinatorics.SimpleGraph.Sum +public import Mathlib.Combinatorics.SimpleGraph.Trails +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Basic +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Counting +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Removal +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite +public import Mathlib.Combinatorics.SimpleGraph.Turan +public import Mathlib.Combinatorics.SimpleGraph.Tutte +public import Mathlib.Combinatorics.SimpleGraph.UniversalVerts +public import Mathlib.Combinatorics.SimpleGraph.Walk +public import Mathlib.Combinatorics.Young.SemistandardTableau +public import Mathlib.Combinatorics.Young.YoungDiagram +public import Mathlib.Computability.Ackermann +public import Mathlib.Computability.AkraBazzi.AkraBazzi +public import Mathlib.Computability.AkraBazzi.GrowsPolynomially +public import Mathlib.Computability.AkraBazzi.SumTransform +public import Mathlib.Computability.ContextFreeGrammar +public import Mathlib.Computability.DFA +public import Mathlib.Computability.Encoding +public import Mathlib.Computability.EpsilonNFA +public import Mathlib.Computability.Halting +public import Mathlib.Computability.Language +public import Mathlib.Computability.MyhillNerode +public import Mathlib.Computability.NFA +public import Mathlib.Computability.Partrec +public import Mathlib.Computability.PartrecCode +public import Mathlib.Computability.PostTuringMachine +public import Mathlib.Computability.Primrec +public import Mathlib.Computability.Reduce +public import Mathlib.Computability.RegularExpressions +public import Mathlib.Computability.TMComputable +public import Mathlib.Computability.TMConfig +public import Mathlib.Computability.TMToPartrec +public import Mathlib.Computability.Tape +public import Mathlib.Computability.TuringDegree +public import Mathlib.Computability.TuringMachine +public import Mathlib.Condensed.AB +public import Mathlib.Condensed.Basic +public import Mathlib.Condensed.CartesianClosed +public import Mathlib.Condensed.Discrete.Basic +public import Mathlib.Condensed.Discrete.Characterization +public import Mathlib.Condensed.Discrete.Colimit +public import Mathlib.Condensed.Discrete.LocallyConstant +public import Mathlib.Condensed.Discrete.Module +public import Mathlib.Condensed.Epi +public import Mathlib.Condensed.Equivalence +public import Mathlib.Condensed.Explicit +public import Mathlib.Condensed.Functors +public import Mathlib.Condensed.Light.AB +public import Mathlib.Condensed.Light.Basic +public import Mathlib.Condensed.Light.CartesianClosed +public import Mathlib.Condensed.Light.Epi +public import Mathlib.Condensed.Light.Explicit +public import Mathlib.Condensed.Light.Functors +public import Mathlib.Condensed.Light.Instances +public import Mathlib.Condensed.Light.Limits +public import Mathlib.Condensed.Light.Module +public import Mathlib.Condensed.Light.Small +public import Mathlib.Condensed.Light.TopCatAdjunction +public import Mathlib.Condensed.Light.TopComparison +public import Mathlib.Condensed.Limits +public import Mathlib.Condensed.Module +public import Mathlib.Condensed.Solid +public import Mathlib.Condensed.TopCatAdjunction +public import Mathlib.Condensed.TopComparison +public import Mathlib.Control.Applicative +public import Mathlib.Control.Basic +public import Mathlib.Control.Bifunctor +public import Mathlib.Control.Bitraversable.Basic +public import Mathlib.Control.Bitraversable.Instances +public import Mathlib.Control.Bitraversable.Lemmas +public import Mathlib.Control.Combinators +public import Mathlib.Control.EquivFunctor +public import Mathlib.Control.EquivFunctor.Instances +public import Mathlib.Control.Fix +public import Mathlib.Control.Fold +public import Mathlib.Control.Functor +public import Mathlib.Control.Functor.Multivariate +public import Mathlib.Control.Lawful +public import Mathlib.Control.LawfulFix +public import Mathlib.Control.Monad.Basic +public import Mathlib.Control.Monad.Cont +public import Mathlib.Control.Monad.Writer +public import Mathlib.Control.Random +public import Mathlib.Control.Traversable.Basic +public import Mathlib.Control.Traversable.Equiv +public import Mathlib.Control.Traversable.Instances +public import Mathlib.Control.Traversable.Lemmas +public import Mathlib.Control.ULift +public import Mathlib.Control.ULiftable +public import Mathlib.Data.Analysis.Filter +public import Mathlib.Data.Analysis.Topology +public import Mathlib.Data.Array.Defs +public import Mathlib.Data.Array.Extract +public import Mathlib.Data.BitVec +public import Mathlib.Data.Bool.AllAny +public import Mathlib.Data.Bool.Basic +public import Mathlib.Data.Bool.Count +public import Mathlib.Data.Bool.Set +public import Mathlib.Data.Bracket +public import Mathlib.Data.Bundle +public import Mathlib.Data.Char +public import Mathlib.Data.Complex.Basic +public import Mathlib.Data.Complex.BigOperators +public import Mathlib.Data.Complex.Cardinality +public import Mathlib.Data.Complex.Exponential +public import Mathlib.Data.Complex.ExponentialBounds +public import Mathlib.Data.Complex.FiniteDimensional +public import Mathlib.Data.Complex.Norm +public import Mathlib.Data.Complex.Order +public import Mathlib.Data.Complex.Trigonometric +public import Mathlib.Data.Countable.Basic +public import Mathlib.Data.Countable.Defs +public import Mathlib.Data.Countable.Small +public import Mathlib.Data.DFinsupp.BigOperators +public import Mathlib.Data.DFinsupp.Defs +public import Mathlib.Data.DFinsupp.Encodable +public import Mathlib.Data.DFinsupp.Ext +public import Mathlib.Data.DFinsupp.FiniteInfinite +public import Mathlib.Data.DFinsupp.Interval +public import Mathlib.Data.DFinsupp.Lex +public import Mathlib.Data.DFinsupp.Module +public import Mathlib.Data.DFinsupp.Multiset +public import Mathlib.Data.DFinsupp.NeLocus +public import Mathlib.Data.DFinsupp.Notation +public import Mathlib.Data.DFinsupp.Order +public import Mathlib.Data.DFinsupp.Sigma +public import Mathlib.Data.DFinsupp.Small +public import Mathlib.Data.DFinsupp.Submonoid +public import Mathlib.Data.DFinsupp.WellFounded +public import Mathlib.Data.DList.Instances +public import Mathlib.Data.ENNReal.Action +public import Mathlib.Data.ENNReal.Basic +public import Mathlib.Data.ENNReal.BigOperators +public import Mathlib.Data.ENNReal.Holder +public import Mathlib.Data.ENNReal.Inv +public import Mathlib.Data.ENNReal.Lemmas +public import Mathlib.Data.ENNReal.Operations +public import Mathlib.Data.ENNReal.Order +public import Mathlib.Data.ENNReal.Real +public import Mathlib.Data.ENat.Basic +public import Mathlib.Data.ENat.BigOperators +public import Mathlib.Data.ENat.Defs +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Data.ENat.Pow +public import Mathlib.Data.EReal.Basic +public import Mathlib.Data.EReal.Inv +public import Mathlib.Data.EReal.Operations +public import Mathlib.Data.Erased +public import Mathlib.Data.FP.Basic +public import Mathlib.Data.Fin.Basic +public import Mathlib.Data.Fin.Embedding +public import Mathlib.Data.Fin.Fin2 +public import Mathlib.Data.Fin.FlagRange +public import Mathlib.Data.Fin.Parity +public import Mathlib.Data.Fin.Pigeonhole +public import Mathlib.Data.Fin.Rev +public import Mathlib.Data.Fin.SuccPred +public import Mathlib.Data.Fin.SuccPredOrder +public import Mathlib.Data.Fin.Tuple.Basic +public import Mathlib.Data.Fin.Tuple.BubbleSortInduction +public import Mathlib.Data.Fin.Tuple.Curry +public import Mathlib.Data.Fin.Tuple.Embedding +public import Mathlib.Data.Fin.Tuple.Finset +public import Mathlib.Data.Fin.Tuple.NatAntidiagonal +public import Mathlib.Data.Fin.Tuple.Reflection +public import Mathlib.Data.Fin.Tuple.Sort +public import Mathlib.Data.Fin.Tuple.Take +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.FinEnum +public import Mathlib.Data.FinEnum.Option +public import Mathlib.Data.Finite.Card +public import Mathlib.Data.Finite.Defs +public import Mathlib.Data.Finite.Perm +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Finite.Set +public import Mathlib.Data.Finite.Sigma +public import Mathlib.Data.Finite.Sum +public import Mathlib.Data.Finite.Vector +public import Mathlib.Data.Finmap +public import Mathlib.Data.Finset.Attach +public import Mathlib.Data.Finset.Attr +public import Mathlib.Data.Finset.Basic +public import Mathlib.Data.Finset.BooleanAlgebra +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.CastCard +public import Mathlib.Data.Finset.Dedup +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Finset.Density +public import Mathlib.Data.Finset.Disjoint +public import Mathlib.Data.Finset.Empty +public import Mathlib.Data.Finset.Erase +public import Mathlib.Data.Finset.Filter +public import Mathlib.Data.Finset.Fin +public import Mathlib.Data.Finset.Finsupp +public import Mathlib.Data.Finset.Fold +public import Mathlib.Data.Finset.Functor +public import Mathlib.Data.Finset.Grade +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Finset.Insert +public import Mathlib.Data.Finset.Interval +public import Mathlib.Data.Finset.Lattice.Basic +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Finset.Lattice.Lemmas +public import Mathlib.Data.Finset.Lattice.Pi +public import Mathlib.Data.Finset.Lattice.Prod +public import Mathlib.Data.Finset.Lattice.Union +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Finset.MulAntidiagonal +public import Mathlib.Data.Finset.NAry +public import Mathlib.Data.Finset.NatAntidiagonal +public import Mathlib.Data.Finset.NatDivisors +public import Mathlib.Data.Finset.NoncommProd +public import Mathlib.Data.Finset.Option +public import Mathlib.Data.Finset.Order +public import Mathlib.Data.Finset.PImage +public import Mathlib.Data.Finset.Pairwise +public import Mathlib.Data.Finset.Pi +public import Mathlib.Data.Finset.PiInduction +public import Mathlib.Data.Finset.Piecewise +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Finset.Preimage +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.Finset.Range +public import Mathlib.Data.Finset.SDiff +public import Mathlib.Data.Finset.SMulAntidiagonal +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Data.Finset.Slice +public import Mathlib.Data.Finset.Sort +public import Mathlib.Data.Finset.Sum +public import Mathlib.Data.Finset.Sups +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Finset.SymmDiff +public import Mathlib.Data.Finset.Union +public import Mathlib.Data.Finset.Update +public import Mathlib.Data.Finsupp.AList +public import Mathlib.Data.Finsupp.Antidiagonal +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Finsupp.BigOperators +public import Mathlib.Data.Finsupp.Defs +public import Mathlib.Data.Finsupp.Encodable +public import Mathlib.Data.Finsupp.Ext +public import Mathlib.Data.Finsupp.Fin +public import Mathlib.Data.Finsupp.Fintype +public import Mathlib.Data.Finsupp.Indicator +public import Mathlib.Data.Finsupp.Interval +public import Mathlib.Data.Finsupp.Lex +public import Mathlib.Data.Finsupp.MonomialOrder +public import Mathlib.Data.Finsupp.MonomialOrder.DegLex +public import Mathlib.Data.Finsupp.Multiset +public import Mathlib.Data.Finsupp.NeLocus +public import Mathlib.Data.Finsupp.Notation +public import Mathlib.Data.Finsupp.Option +public import Mathlib.Data.Finsupp.Order +public import Mathlib.Data.Finsupp.PWO +public import Mathlib.Data.Finsupp.Pointwise +public import Mathlib.Data.Finsupp.PointwiseSMul +public import Mathlib.Data.Finsupp.SMul +public import Mathlib.Data.Finsupp.SMulWithZero +public import Mathlib.Data.Finsupp.Single +public import Mathlib.Data.Finsupp.ToDFinsupp +public import Mathlib.Data.Finsupp.Weight +public import Mathlib.Data.Finsupp.WellFounded +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Fintype.Card +public import Mathlib.Data.Fintype.CardEmbedding +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Fintype.Fin +public import Mathlib.Data.Fintype.Inv +public import Mathlib.Data.Fintype.Lattice +public import Mathlib.Data.Fintype.List +public import Mathlib.Data.Fintype.OfMap +public import Mathlib.Data.Fintype.Option +public import Mathlib.Data.Fintype.Order +public import Mathlib.Data.Fintype.Parity +public import Mathlib.Data.Fintype.Perm +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Quotient +public import Mathlib.Data.Fintype.Sets +public import Mathlib.Data.Fintype.Shrink +public import Mathlib.Data.Fintype.Sigma +public import Mathlib.Data.Fintype.Sort +public import Mathlib.Data.Fintype.Sum +public import Mathlib.Data.Fintype.Units +public import Mathlib.Data.Fintype.Vector +public import Mathlib.Data.Fintype.WithTopBot +public import Mathlib.Data.FunLike.Basic +public import Mathlib.Data.FunLike.Embedding +public import Mathlib.Data.FunLike.Equiv +public import Mathlib.Data.FunLike.Fintype +public import Mathlib.Data.Holor +public import Mathlib.Data.Ineq +public import Mathlib.Data.Int.AbsoluteValue +public import Mathlib.Data.Int.Associated +public import Mathlib.Data.Int.Basic +public import Mathlib.Data.Int.Bitwise +public import Mathlib.Data.Int.CardIntervalMod +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Data.Int.Cast.Defs +public import Mathlib.Data.Int.Cast.Field +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.Data.Int.Cast.Pi +public import Mathlib.Data.Int.Cast.Prod +public import Mathlib.Data.Int.CharZero +public import Mathlib.Data.Int.ConditionallyCompleteOrder +public import Mathlib.Data.Int.DivMod +public import Mathlib.Data.Int.GCD +public import Mathlib.Data.Int.Init +public import Mathlib.Data.Int.Interval +public import Mathlib.Data.Int.LeastGreatest +public import Mathlib.Data.Int.Lemmas +public import Mathlib.Data.Int.Log +public import Mathlib.Data.Int.ModEq +public import Mathlib.Data.Int.NatAbs +public import Mathlib.Data.Int.NatPrime +public import Mathlib.Data.Int.Notation +public import Mathlib.Data.Int.Order.Basic +public import Mathlib.Data.Int.Order.Lemmas +public import Mathlib.Data.Int.Order.Units +public import Mathlib.Data.Int.Range +public import Mathlib.Data.Int.Sqrt +public import Mathlib.Data.Int.Star +public import Mathlib.Data.Int.SuccPred +public import Mathlib.Data.Int.WithZero +public import Mathlib.Data.List.AList +public import Mathlib.Data.List.Basic +public import Mathlib.Data.List.Chain +public import Mathlib.Data.List.ChainOfFn +public import Mathlib.Data.List.Count +public import Mathlib.Data.List.Cycle +public import Mathlib.Data.List.Dedup +public import Mathlib.Data.List.Defs +public import Mathlib.Data.List.Destutter +public import Mathlib.Data.List.DropRight +public import Mathlib.Data.List.Duplicate +public import Mathlib.Data.List.Enum +public import Mathlib.Data.List.FinRange +public import Mathlib.Data.List.Flatten +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.List.GetD +public import Mathlib.Data.List.Indexes +public import Mathlib.Data.List.Induction +public import Mathlib.Data.List.Infix +public import Mathlib.Data.List.InsertIdx +public import Mathlib.Data.List.InsertNth +public import Mathlib.Data.List.Intervals +public import Mathlib.Data.List.Iterate +public import Mathlib.Data.List.Lattice +public import Mathlib.Data.List.Lemmas +public import Mathlib.Data.List.Lex +public import Mathlib.Data.List.Lookmap +public import Mathlib.Data.List.Map2 +public import Mathlib.Data.List.MinMax +public import Mathlib.Data.List.ModifyLast +public import Mathlib.Data.List.Monad +public import Mathlib.Data.List.NatAntidiagonal +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.List.NodupEquivFin +public import Mathlib.Data.List.OfFn +public import Mathlib.Data.List.Pairwise +public import Mathlib.Data.List.Palindrome +public import Mathlib.Data.List.Perm.Basic +public import Mathlib.Data.List.Perm.Lattice +public import Mathlib.Data.List.Perm.Subperm +public import Mathlib.Data.List.Permutation +public import Mathlib.Data.List.Pi +public import Mathlib.Data.List.Prime +public import Mathlib.Data.List.ProdSigma +public import Mathlib.Data.List.Range +public import Mathlib.Data.List.ReduceOption +public import Mathlib.Data.List.Rotate +public import Mathlib.Data.List.Sections +public import Mathlib.Data.List.Shortlex +public import Mathlib.Data.List.Sigma +public import Mathlib.Data.List.Sort +public import Mathlib.Data.List.SplitBy +public import Mathlib.Data.List.SplitLengths +public import Mathlib.Data.List.SplitOn +public import Mathlib.Data.List.Sublists +public import Mathlib.Data.List.Sym +public import Mathlib.Data.List.TFAE +public import Mathlib.Data.List.TakeDrop +public import Mathlib.Data.List.TakeWhile +public import Mathlib.Data.List.ToFinsupp +public import Mathlib.Data.List.Triplewise +public import Mathlib.Data.List.Zip +public import Mathlib.Data.Matrix.Action +public import Mathlib.Data.Matrix.Auto +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.Bilinear +public import Mathlib.Data.Matrix.Block +public import Mathlib.Data.Matrix.ColumnRowPartitioned +public import Mathlib.Data.Matrix.Composition +public import Mathlib.Data.Matrix.DMatrix +public import Mathlib.Data.Matrix.Diagonal +public import Mathlib.Data.Matrix.DualNumber +public import Mathlib.Data.Matrix.Invertible +public import Mathlib.Data.Matrix.Mul +public import Mathlib.Data.Matrix.PEquiv +public import Mathlib.Data.Matrix.Reflection +public import Mathlib.Data.Multiset.AddSub +public import Mathlib.Data.Multiset.Antidiagonal +public import Mathlib.Data.Multiset.Basic +public import Mathlib.Data.Multiset.Bind +public import Mathlib.Data.Multiset.Count +public import Mathlib.Data.Multiset.Dedup +public import Mathlib.Data.Multiset.Defs +public import Mathlib.Data.Multiset.DershowitzManna +public import Mathlib.Data.Multiset.Filter +public import Mathlib.Data.Multiset.FinsetOps +public import Mathlib.Data.Multiset.Fintype +public import Mathlib.Data.Multiset.Fold +public import Mathlib.Data.Multiset.Functor +public import Mathlib.Data.Multiset.Interval +public import Mathlib.Data.Multiset.Lattice +public import Mathlib.Data.Multiset.MapFold +public import Mathlib.Data.Multiset.NatAntidiagonal +public import Mathlib.Data.Multiset.OrderedMonoid +public import Mathlib.Data.Multiset.Pairwise +public import Mathlib.Data.Multiset.Pi +public import Mathlib.Data.Multiset.Powerset +public import Mathlib.Data.Multiset.Range +public import Mathlib.Data.Multiset.Replicate +public import Mathlib.Data.Multiset.Sections +public import Mathlib.Data.Multiset.Sort +public import Mathlib.Data.Multiset.Sum +public import Mathlib.Data.Multiset.Sym +public import Mathlib.Data.Multiset.UnionInter +public import Mathlib.Data.Multiset.ZeroCons +public import Mathlib.Data.NNRat.BigOperators +public import Mathlib.Data.NNRat.Defs +public import Mathlib.Data.NNRat.Floor +public import Mathlib.Data.NNRat.Lemmas +public import Mathlib.Data.NNRat.Order +public import Mathlib.Data.NNReal.Basic +public import Mathlib.Data.NNReal.Defs +public import Mathlib.Data.NNReal.Star +public import Mathlib.Data.Nat.Basic +public import Mathlib.Data.Nat.BinaryRec +public import Mathlib.Data.Nat.BitIndices +public import Mathlib.Data.Nat.Bits +public import Mathlib.Data.Nat.Bitwise +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Data.Nat.Cast.Commute +public import Mathlib.Data.Nat.Cast.Defs +public import Mathlib.Data.Nat.Cast.Field +public import Mathlib.Data.Nat.Cast.NeZero +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Data.Nat.Cast.Order.Field +public import Mathlib.Data.Nat.Cast.Order.Ring +public import Mathlib.Data.Nat.Cast.Prod +public import Mathlib.Data.Nat.Cast.SetInterval +public import Mathlib.Data.Nat.Cast.Synonym +public import Mathlib.Data.Nat.Cast.WithTop +public import Mathlib.Data.Nat.ChineseRemainder +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Data.Nat.Choose.Bounds +public import Mathlib.Data.Nat.Choose.Cast +public import Mathlib.Data.Nat.Choose.Central +public import Mathlib.Data.Nat.Choose.Dvd +public import Mathlib.Data.Nat.Choose.Factorization +public import Mathlib.Data.Nat.Choose.Lucas +public import Mathlib.Data.Nat.Choose.Mul +public import Mathlib.Data.Nat.Choose.Multinomial +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Data.Nat.Choose.Vandermonde +public import Mathlib.Data.Nat.Count +public import Mathlib.Data.Nat.Digits.Defs +public import Mathlib.Data.Nat.Digits.Div +public import Mathlib.Data.Nat.Digits.Lemmas +public import Mathlib.Data.Nat.Dist +public import Mathlib.Data.Nat.EvenOddRec +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.Nat.Factorial.BigOperators +public import Mathlib.Data.Nat.Factorial.Cast +public import Mathlib.Data.Nat.Factorial.DoubleFactorial +public import Mathlib.Data.Nat.Factorial.NatCast +public import Mathlib.Data.Nat.Factorial.SuperFactorial +public import Mathlib.Data.Nat.Factorization.Basic +public import Mathlib.Data.Nat.Factorization.Defs +public import Mathlib.Data.Nat.Factorization.Induction +public import Mathlib.Data.Nat.Factorization.LCM +public import Mathlib.Data.Nat.Factorization.PrimePow +public import Mathlib.Data.Nat.Factorization.Root +public import Mathlib.Data.Nat.Factors +public import Mathlib.Data.Nat.Fib.Basic +public import Mathlib.Data.Nat.Fib.Zeckendorf +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.Nat.GCD.Basic +public import Mathlib.Data.Nat.GCD.BigOperators +public import Mathlib.Data.Nat.GCD.Prime +public import Mathlib.Data.Nat.Hyperoperation +public import Mathlib.Data.Nat.Init +public import Mathlib.Data.Nat.Lattice +public import Mathlib.Data.Nat.Log +public import Mathlib.Data.Nat.MaxPowDiv +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Nat.Multiplicity +public import Mathlib.Data.Nat.Notation +public import Mathlib.Data.Nat.Nth +public import Mathlib.Data.Nat.NthRoot.Defs +public import Mathlib.Data.Nat.Order.Lemmas +public import Mathlib.Data.Nat.PSub +public import Mathlib.Data.Nat.Pairing +public import Mathlib.Data.Nat.PartENat +public import Mathlib.Data.Nat.Periodic +public import Mathlib.Data.Nat.PowModTotient +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.Nat.Prime.Factorial +public import Mathlib.Data.Nat.Prime.Infinite +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.Data.Nat.Prime.Nth +public import Mathlib.Data.Nat.Prime.Pow +public import Mathlib.Data.Nat.PrimeFin +public import Mathlib.Data.Nat.Set +public import Mathlib.Data.Nat.Size +public import Mathlib.Data.Nat.Sqrt +public import Mathlib.Data.Nat.Squarefree +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Data.Nat.Totient +public import Mathlib.Data.Nat.Upto +public import Mathlib.Data.Nat.WithBot +public import Mathlib.Data.Num.Basic +public import Mathlib.Data.Num.Bitwise +public import Mathlib.Data.Num.Lemmas +public import Mathlib.Data.Num.Prime +public import Mathlib.Data.Num.ZNum +public import Mathlib.Data.Opposite +public import Mathlib.Data.Option.Basic +public import Mathlib.Data.Option.Defs +public import Mathlib.Data.Option.NAry +public import Mathlib.Data.Ordering.Basic +public import Mathlib.Data.Ordering.Lemmas +public import Mathlib.Data.Ordmap.Invariants +public import Mathlib.Data.Ordmap.Ordnode +public import Mathlib.Data.Ordmap.Ordset +public import Mathlib.Data.PEquiv +public import Mathlib.Data.PFun +public import Mathlib.Data.PFunctor.Multivariate.Basic +public import Mathlib.Data.PFunctor.Multivariate.M +public import Mathlib.Data.PFunctor.Multivariate.W +public import Mathlib.Data.PFunctor.Univariate.Basic +public import Mathlib.Data.PFunctor.Univariate.M +public import Mathlib.Data.PNat.Basic +public import Mathlib.Data.PNat.Defs +public import Mathlib.Data.PNat.Equiv +public import Mathlib.Data.PNat.Factors +public import Mathlib.Data.PNat.Find +public import Mathlib.Data.PNat.Interval +public import Mathlib.Data.PNat.Notation +public import Mathlib.Data.PNat.Order +public import Mathlib.Data.PNat.Prime +public import Mathlib.Data.PNat.Xgcd +public import Mathlib.Data.PSigma.Order +public import Mathlib.Data.Part +public import Mathlib.Data.Pi.Interval +public import Mathlib.Data.Prod.Basic +public import Mathlib.Data.Prod.Lex +public import Mathlib.Data.Prod.PProd +public import Mathlib.Data.Prod.TProd +public import Mathlib.Data.QPF.Multivariate.Basic +public import Mathlib.Data.QPF.Multivariate.Constructions.Cofix +public import Mathlib.Data.QPF.Multivariate.Constructions.Comp +public import Mathlib.Data.QPF.Multivariate.Constructions.Const +public import Mathlib.Data.QPF.Multivariate.Constructions.Fix +public import Mathlib.Data.QPF.Multivariate.Constructions.Prj +public import Mathlib.Data.QPF.Multivariate.Constructions.Quot +public import Mathlib.Data.QPF.Multivariate.Constructions.Sigma +public import Mathlib.Data.QPF.Univariate.Basic +public import Mathlib.Data.Quot +public import Mathlib.Data.Rat.BigOperators +public import Mathlib.Data.Rat.Cardinal +public import Mathlib.Data.Rat.Cast.CharZero +public import Mathlib.Data.Rat.Cast.Defs +public import Mathlib.Data.Rat.Cast.Lemmas +public import Mathlib.Data.Rat.Cast.OfScientific +public import Mathlib.Data.Rat.Cast.Order +public import Mathlib.Data.Rat.Defs +public import Mathlib.Data.Rat.Denumerable +public import Mathlib.Data.Rat.Encodable +public import Mathlib.Data.Rat.Floor +public import Mathlib.Data.Rat.Init +public import Mathlib.Data.Rat.Lemmas +public import Mathlib.Data.Rat.NatSqrt.Defs +public import Mathlib.Data.Rat.NatSqrt.Real +public import Mathlib.Data.Rat.Sqrt +public import Mathlib.Data.Rat.Star +public import Mathlib.Data.Real.Archimedean +public import Mathlib.Data.Real.Basic +public import Mathlib.Data.Real.Cardinality +public import Mathlib.Data.Real.CompleteField +public import Mathlib.Data.Real.ConjExponents +public import Mathlib.Data.Real.ENatENNReal +public import Mathlib.Data.Real.EReal +public import Mathlib.Data.Real.Embedding +public import Mathlib.Data.Real.Hyperreal +public import Mathlib.Data.Real.Irrational +public import Mathlib.Data.Real.Pi.Bounds +public import Mathlib.Data.Real.Pi.Irrational +public import Mathlib.Data.Real.Pi.Leibniz +public import Mathlib.Data.Real.Pi.Wallis +public import Mathlib.Data.Real.Pointwise +public import Mathlib.Data.Real.Sign +public import Mathlib.Data.Real.Sqrt +public import Mathlib.Data.Real.Star +public import Mathlib.Data.Real.StarOrdered +public import Mathlib.Data.Rel +public import Mathlib.Data.Rel.Cover +public import Mathlib.Data.Rel.Separated +public import Mathlib.Data.SProd +public import Mathlib.Data.Semiquot +public import Mathlib.Data.Seq.Basic +public import Mathlib.Data.Seq.Computation +public import Mathlib.Data.Seq.Defs +public import Mathlib.Data.Seq.Parallel +public import Mathlib.Data.Seq.Seq +public import Mathlib.Data.Seq.WSeq +public import Mathlib.Data.Set.Accumulate +public import Mathlib.Data.Set.Basic +public import Mathlib.Data.Set.BoolIndicator +public import Mathlib.Data.Set.BooleanAlgebra +public import Mathlib.Data.Set.Card +public import Mathlib.Data.Set.Card.Arithmetic +public import Mathlib.Data.Set.CoeSort +public import Mathlib.Data.Set.Constructions +public import Mathlib.Data.Set.Countable +public import Mathlib.Data.Set.Defs +public import Mathlib.Data.Set.Disjoint +public import Mathlib.Data.Set.Enumerate +public import Mathlib.Data.Set.Equitable +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.Data.Set.Finite.List +public import Mathlib.Data.Set.Finite.Monad +public import Mathlib.Data.Set.Finite.Powerset +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Data.Set.Function +public import Mathlib.Data.Set.Functor +public import Mathlib.Data.Set.Image +public import Mathlib.Data.Set.Inclusion +public import Mathlib.Data.Set.Insert +public import Mathlib.Data.Set.Lattice +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Data.Set.List +public import Mathlib.Data.Set.MemPartition +public import Mathlib.Data.Set.Monotone +public import Mathlib.Data.Set.MulAntidiagonal +public import Mathlib.Data.Set.NAry +public import Mathlib.Data.Set.Notation +public import Mathlib.Data.Set.Operations +public import Mathlib.Data.Set.Opposite +public import Mathlib.Data.Set.Order +public import Mathlib.Data.Set.Pairwise.Basic +public import Mathlib.Data.Set.Pairwise.Chain +public import Mathlib.Data.Set.Pairwise.Lattice +public import Mathlib.Data.Set.Pairwise.List +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Data.Set.Pointwise.Support +public import Mathlib.Data.Set.Prod +public import Mathlib.Data.Set.Restrict +public import Mathlib.Data.Set.SMulAntidiagonal +public import Mathlib.Data.Set.Semiring +public import Mathlib.Data.Set.Sigma +public import Mathlib.Data.Set.Subset +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Data.Set.Sups +public import Mathlib.Data.Set.SymmDiff +public import Mathlib.Data.Set.UnionLift +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Data.SetLike.Fintype +public import Mathlib.Data.Setoid.Basic +public import Mathlib.Data.Setoid.Partition +public import Mathlib.Data.Setoid.Partition.Card +public import Mathlib.Data.Sigma.Basic +public import Mathlib.Data.Sigma.Interval +public import Mathlib.Data.Sigma.Lex +public import Mathlib.Data.Sigma.Order +public import Mathlib.Data.Sign +public import Mathlib.Data.Sign.Basic +public import Mathlib.Data.Sign.Defs +public import Mathlib.Data.Stream.Defs +public import Mathlib.Data.Stream.Init +public import Mathlib.Data.String.Basic +public import Mathlib.Data.String.Defs +public import Mathlib.Data.String.Lemmas +public import Mathlib.Data.Subtype +public import Mathlib.Data.Sum.Basic +public import Mathlib.Data.Sum.Interval +public import Mathlib.Data.Sum.Lattice +public import Mathlib.Data.Sum.Order +public import Mathlib.Data.Sym.Basic +public import Mathlib.Data.Sym.Card +public import Mathlib.Data.Sym.Sym2 +public import Mathlib.Data.Sym.Sym2.Finsupp +public import Mathlib.Data.Sym.Sym2.Init +public import Mathlib.Data.Sym.Sym2.Order +public import Mathlib.Data.Tree.Basic +public import Mathlib.Data.Tree.Get +public import Mathlib.Data.Tree.RBMap +public import Mathlib.Data.Tree.Traversable +public import Mathlib.Data.TwoPointing +public import Mathlib.Data.TypeVec +public import Mathlib.Data.UInt +public import Mathlib.Data.ULift +public import Mathlib.Data.Vector.Basic +public import Mathlib.Data.Vector.Defs +public import Mathlib.Data.Vector.MapLemmas +public import Mathlib.Data.Vector.Mem +public import Mathlib.Data.Vector.Snoc +public import Mathlib.Data.Vector.Zip +public import Mathlib.Data.Vector3 +public import Mathlib.Data.W.Basic +public import Mathlib.Data.W.Cardinal +public import Mathlib.Data.W.Constructions +public import Mathlib.Data.WSeq.Basic +public import Mathlib.Data.WSeq.Defs +public import Mathlib.Data.WSeq.Productive +public import Mathlib.Data.WSeq.Relation +public import Mathlib.Data.ZMod.Aut +public import Mathlib.Data.ZMod.Basic +public import Mathlib.Data.ZMod.Coprime +public import Mathlib.Data.ZMod.Defs +public import Mathlib.Data.ZMod.Factorial +public import Mathlib.Data.ZMod.IntUnitsPower +public import Mathlib.Data.ZMod.QuotientGroup +public import Mathlib.Data.ZMod.QuotientRing +public import Mathlib.Data.ZMod.Units +public import Mathlib.Data.ZMod.ValMinAbs +public import Mathlib.Deprecated.Aliases +public import Mathlib.Deprecated.Estimator +public import Mathlib.Deprecated.MLList.BestFirst +public import Mathlib.Deprecated.Order +public import Mathlib.Deprecated.RingHom +public import Mathlib.Dynamics.BirkhoffSum.Average +public import Mathlib.Dynamics.BirkhoffSum.Basic +public import Mathlib.Dynamics.BirkhoffSum.NormedSpace +public import Mathlib.Dynamics.BirkhoffSum.QuasiMeasurePreserving +public import Mathlib.Dynamics.Circle.RotationNumber.TranslationNumber +public import Mathlib.Dynamics.Ergodic.Action.Basic +public import Mathlib.Dynamics.Ergodic.Action.OfMinimal +public import Mathlib.Dynamics.Ergodic.Action.Regular +public import Mathlib.Dynamics.Ergodic.AddCircle +public import Mathlib.Dynamics.Ergodic.AddCircleAdd +public import Mathlib.Dynamics.Ergodic.Conservative +public import Mathlib.Dynamics.Ergodic.Ergodic +public import Mathlib.Dynamics.Ergodic.Extreme +public import Mathlib.Dynamics.Ergodic.Function +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.Dynamics.Ergodic.RadonNikodym +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.Dynamics.FixedPoints.Prufer +public import Mathlib.Dynamics.FixedPoints.Topology +public import Mathlib.Dynamics.Flow +public import Mathlib.Dynamics.Minimal +public import Mathlib.Dynamics.Newton +public import Mathlib.Dynamics.OmegaLimit +public import Mathlib.Dynamics.PeriodicPts.Defs +public import Mathlib.Dynamics.PeriodicPts.Lemmas +public import Mathlib.Dynamics.TopologicalEntropy.CoverEntropy +public import Mathlib.Dynamics.TopologicalEntropy.DynamicalEntourage +public import Mathlib.Dynamics.TopologicalEntropy.NetEntropy +public import Mathlib.Dynamics.TopologicalEntropy.Semiconj +public import Mathlib.Dynamics.TopologicalEntropy.Subset +public import Mathlib.Dynamics.Transitive +public import Mathlib.FieldTheory.AbelRuffini +public import Mathlib.FieldTheory.AbsoluteGaloisGroup +public import Mathlib.FieldTheory.AlgebraicClosure +public import Mathlib.FieldTheory.AxGrothendieck +public import Mathlib.FieldTheory.CardinalEmb +public import Mathlib.FieldTheory.Cardinality +public import Mathlib.FieldTheory.ChevalleyWarning +public import Mathlib.FieldTheory.Differential.Basic +public import Mathlib.FieldTheory.Differential.Liouville +public import Mathlib.FieldTheory.Extension +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.FieldTheory.Finite.Extension +public import Mathlib.FieldTheory.Finite.GaloisField +public import Mathlib.FieldTheory.Finite.Polynomial +public import Mathlib.FieldTheory.Finite.Trace +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.FieldTheory.Fixed +public import Mathlib.FieldTheory.Galois.Abelian +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.FieldTheory.Galois.GaloisClosure +public import Mathlib.FieldTheory.Galois.Infinite +public import Mathlib.FieldTheory.Galois.IsGaloisGroup +public import Mathlib.FieldTheory.Galois.NormalBasis +public import Mathlib.FieldTheory.Galois.Notation +public import Mathlib.FieldTheory.Galois.Profinite +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs +public import Mathlib.FieldTheory.IntermediateField.Algebraic +public import Mathlib.FieldTheory.IntermediateField.Basic +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.FieldTheory.IsAlgClosed.Classification +public import Mathlib.FieldTheory.IsAlgClosed.Spectrum +public import Mathlib.FieldTheory.IsPerfectClosure +public import Mathlib.FieldTheory.IsSepClosed +public import Mathlib.FieldTheory.Isaacs +public import Mathlib.FieldTheory.JacobsonNoether +public import Mathlib.FieldTheory.KrullTopology +public import Mathlib.FieldTheory.KummerExtension +public import Mathlib.FieldTheory.KummerPolynomial +public import Mathlib.FieldTheory.Laurent +public import Mathlib.FieldTheory.LinearDisjoint +public import Mathlib.FieldTheory.Minpoly.Basic +public import Mathlib.FieldTheory.Minpoly.ConjRootClass +public import Mathlib.FieldTheory.Minpoly.Field +public import Mathlib.FieldTheory.Minpoly.IsConjRoot +public import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed +public import Mathlib.FieldTheory.Minpoly.MinpolyDiv +public import Mathlib.FieldTheory.MvRatFunc.Rank +public import Mathlib.FieldTheory.Normal.Basic +public import Mathlib.FieldTheory.Normal.Closure +public import Mathlib.FieldTheory.Normal.Defs +public import Mathlib.FieldTheory.NormalizedTrace +public import Mathlib.FieldTheory.Perfect +public import Mathlib.FieldTheory.PerfectClosure +public import Mathlib.FieldTheory.PolynomialGaloisGroup +public import Mathlib.FieldTheory.PrimeField +public import Mathlib.FieldTheory.PrimitiveElement +public import Mathlib.FieldTheory.PurelyInseparable.Basic +public import Mathlib.FieldTheory.PurelyInseparable.Exponent +public import Mathlib.FieldTheory.PurelyInseparable.PerfectClosure +public import Mathlib.FieldTheory.PurelyInseparable.Tower +public import Mathlib.FieldTheory.RatFunc.AsPolynomial +public import Mathlib.FieldTheory.RatFunc.Basic +public import Mathlib.FieldTheory.RatFunc.Defs +public import Mathlib.FieldTheory.RatFunc.Degree +public import Mathlib.FieldTheory.Relrank +public import Mathlib.FieldTheory.Separable +public import Mathlib.FieldTheory.SeparableClosure +public import Mathlib.FieldTheory.SeparableDegree +public import Mathlib.FieldTheory.SplittingField.Construction +public import Mathlib.FieldTheory.SplittingField.IsSplittingField +public import Mathlib.FieldTheory.Tower +public import Mathlib.Geometry.Convex.Cone.Basic +public import Mathlib.Geometry.Convex.Cone.Dual +public import Mathlib.Geometry.Convex.Cone.Pointed +public import Mathlib.Geometry.Convex.Cone.TensorProduct +public import Mathlib.Geometry.Euclidean.Altitude +public import Mathlib.Geometry.Euclidean.Angle.Bisector +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Basic +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Projection +public import Mathlib.Geometry.Euclidean.Angle.Oriented.RightAngle +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation +public import Mathlib.Geometry.Euclidean.Angle.Sphere +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Conformal +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.CrossProduct +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle +public import Mathlib.Geometry.Euclidean.Basic +public import Mathlib.Geometry.Euclidean.Circumcenter +public import Mathlib.Geometry.Euclidean.Congruence +public import Mathlib.Geometry.Euclidean.Incenter +public import Mathlib.Geometry.Euclidean.Inversion.Basic +public import Mathlib.Geometry.Euclidean.Inversion.Calculus +public import Mathlib.Geometry.Euclidean.Inversion.ImageHyperplane +public import Mathlib.Geometry.Euclidean.MongePoint +public import Mathlib.Geometry.Euclidean.PerpBisector +public import Mathlib.Geometry.Euclidean.Projection +public import Mathlib.Geometry.Euclidean.SignedDist +public import Mathlib.Geometry.Euclidean.Simplex +public import Mathlib.Geometry.Euclidean.Sphere.Basic +public import Mathlib.Geometry.Euclidean.Sphere.Power +public import Mathlib.Geometry.Euclidean.Sphere.Ptolemy +public import Mathlib.Geometry.Euclidean.Sphere.SecondInter +public import Mathlib.Geometry.Euclidean.Sphere.Tangent +public import Mathlib.Geometry.Euclidean.Triangle +public import Mathlib.Geometry.Group.Growth.LinearLowerBound +public import Mathlib.Geometry.Group.Growth.QuotientInter +public import Mathlib.Geometry.Manifold.Algebra.LeftInvariantDerivation +public import Mathlib.Geometry.Manifold.Algebra.LieGroup +public import Mathlib.Geometry.Manifold.Algebra.Monoid +public import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions +public import Mathlib.Geometry.Manifold.Algebra.Structures +public import Mathlib.Geometry.Manifold.Bordism +public import Mathlib.Geometry.Manifold.BumpFunction +public import Mathlib.Geometry.Manifold.ChartedSpace +public import Mathlib.Geometry.Manifold.Complex +public import Mathlib.Geometry.Manifold.ConformalGroupoid +public import Mathlib.Geometry.Manifold.ContMDiff.Atlas +public import Mathlib.Geometry.Manifold.ContMDiff.Basic +public import Mathlib.Geometry.Manifold.ContMDiff.Constructions +public import Mathlib.Geometry.Manifold.ContMDiff.Defs +public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace +public import Mathlib.Geometry.Manifold.ContMDiffMFDeriv +public import Mathlib.Geometry.Manifold.ContMDiffMap +public import Mathlib.Geometry.Manifold.DerivationBundle +public import Mathlib.Geometry.Manifold.Diffeomorph +public import Mathlib.Geometry.Manifold.GroupLieAlgebra +public import Mathlib.Geometry.Manifold.Instances.Icc +public import Mathlib.Geometry.Manifold.Instances.Real +public import Mathlib.Geometry.Manifold.Instances.Sphere +public import Mathlib.Geometry.Manifold.Instances.UnitsOfNormedAlgebra +public import Mathlib.Geometry.Manifold.IntegralCurve.Basic +public import Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique +public import Mathlib.Geometry.Manifold.IntegralCurve.Transform +public import Mathlib.Geometry.Manifold.IntegralCurve.UniformTime +public import Mathlib.Geometry.Manifold.IsManifold.Basic +public import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt +public import Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary +public import Mathlib.Geometry.Manifold.LocalDiffeomorph +public import Mathlib.Geometry.Manifold.LocalInvariantProperties +public import Mathlib.Geometry.Manifold.MFDeriv.Atlas +public import Mathlib.Geometry.Manifold.MFDeriv.Basic +public import Mathlib.Geometry.Manifold.MFDeriv.Defs +public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv +public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace +public import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions +public import Mathlib.Geometry.Manifold.MFDeriv.Tangent +public import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential +public import Mathlib.Geometry.Manifold.Metrizable +public import Mathlib.Geometry.Manifold.Notation +public import Mathlib.Geometry.Manifold.PartitionOfUnity +public import Mathlib.Geometry.Manifold.PoincareConjecture +public import Mathlib.Geometry.Manifold.Riemannian.Basic +public import Mathlib.Geometry.Manifold.Riemannian.PathELength +public import Mathlib.Geometry.Manifold.Sheaf.Basic +public import Mathlib.Geometry.Manifold.Sheaf.LocallyRingedSpace +public import Mathlib.Geometry.Manifold.Sheaf.Smooth +public import Mathlib.Geometry.Manifold.SmoothApprox +public import Mathlib.Geometry.Manifold.VectorBundle.Basic +public import Mathlib.Geometry.Manifold.VectorBundle.FiberwiseLinear +public import Mathlib.Geometry.Manifold.VectorBundle.Hom +public import Mathlib.Geometry.Manifold.VectorBundle.LocalFrame +public import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable +public import Mathlib.Geometry.Manifold.VectorBundle.Pullback +public import Mathlib.Geometry.Manifold.VectorBundle.Riemannian +public import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection +public import Mathlib.Geometry.Manifold.VectorBundle.Tangent +public import Mathlib.Geometry.Manifold.VectorField.LieBracket +public import Mathlib.Geometry.Manifold.VectorField.Pullback +public import Mathlib.Geometry.Manifold.WhitneyEmbedding +public import Mathlib.Geometry.RingedSpace.Basic +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace.HasColimits +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace.ResidueField +public import Mathlib.Geometry.RingedSpace.OpenImmersion +public import Mathlib.Geometry.RingedSpace.PresheafedSpace +public import Mathlib.Geometry.RingedSpace.PresheafedSpace.Gluing +public import Mathlib.Geometry.RingedSpace.PresheafedSpace.HasColimits +public import Mathlib.Geometry.RingedSpace.SheafedSpace +public import Mathlib.Geometry.RingedSpace.Stalks +public import Mathlib.GroupTheory.Abelianization.Defs +public import Mathlib.GroupTheory.Abelianization.Finite +public import Mathlib.GroupTheory.Archimedean +public import Mathlib.GroupTheory.ArchimedeanDensely +public import Mathlib.GroupTheory.ClassEquation +public import Mathlib.GroupTheory.Commensurable +public import Mathlib.GroupTheory.Commutator.Basic +public import Mathlib.GroupTheory.Commutator.Finite +public import Mathlib.GroupTheory.CommutingProbability +public import Mathlib.GroupTheory.Complement +public import Mathlib.GroupTheory.Congruence.Basic +public import Mathlib.GroupTheory.Congruence.BigOperators +public import Mathlib.GroupTheory.Congruence.Defs +public import Mathlib.GroupTheory.Congruence.Hom +public import Mathlib.GroupTheory.Congruence.Opposite +public import Mathlib.GroupTheory.Coprod.Basic +public import Mathlib.GroupTheory.CoprodI +public import Mathlib.GroupTheory.Coset.Basic +public import Mathlib.GroupTheory.Coset.Card +public import Mathlib.GroupTheory.Coset.Defs +public import Mathlib.GroupTheory.CosetCover +public import Mathlib.GroupTheory.Coxeter.Basic +public import Mathlib.GroupTheory.Coxeter.Inversion +public import Mathlib.GroupTheory.Coxeter.Length +public import Mathlib.GroupTheory.Coxeter.Matrix +public import Mathlib.GroupTheory.Divisible +public import Mathlib.GroupTheory.DivisibleHull +public import Mathlib.GroupTheory.DoubleCoset +public import Mathlib.GroupTheory.EckmannHilton +public import Mathlib.GroupTheory.Exponent +public import Mathlib.GroupTheory.FiniteAbelian.Basic +public import Mathlib.GroupTheory.FiniteAbelian.Duality +public import Mathlib.GroupTheory.Finiteness +public import Mathlib.GroupTheory.FixedPointFree +public import Mathlib.GroupTheory.Frattini +public import Mathlib.GroupTheory.FreeAbelianGroup +public import Mathlib.GroupTheory.FreeGroup.Basic +public import Mathlib.GroupTheory.FreeGroup.CyclicallyReduced +public import Mathlib.GroupTheory.FreeGroup.GeneratorEquiv +public import Mathlib.GroupTheory.FreeGroup.IsFreeGroup +public import Mathlib.GroupTheory.FreeGroup.NielsenSchreier +public import Mathlib.GroupTheory.FreeGroup.Orbit +public import Mathlib.GroupTheory.FreeGroup.Reduce +public import Mathlib.GroupTheory.Goursat +public import Mathlib.GroupTheory.GroupAction.Basic +public import Mathlib.GroupTheory.GroupAction.Blocks +public import Mathlib.GroupTheory.GroupAction.CardCommute +public import Mathlib.GroupTheory.GroupAction.ConjAct +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.GroupTheory.GroupAction.DomAct.ActionHom +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic +public import Mathlib.GroupTheory.GroupAction.Embedding +public import Mathlib.GroupTheory.GroupAction.FixedPoints +public import Mathlib.GroupTheory.GroupAction.FixingSubgroup +public import Mathlib.GroupTheory.GroupAction.Hom +public import Mathlib.GroupTheory.GroupAction.IterateAct +public import Mathlib.GroupTheory.GroupAction.Iwasawa +public import Mathlib.GroupTheory.GroupAction.Jordan +public import Mathlib.GroupTheory.GroupAction.MultiplePrimitivity +public import Mathlib.GroupTheory.GroupAction.MultipleTransitivity +public import Mathlib.GroupTheory.GroupAction.Period +public import Mathlib.GroupTheory.GroupAction.Pointwise +public import Mathlib.GroupTheory.GroupAction.Primitive +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.GroupTheory.GroupAction.SubMulAction.Closure +public import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup +public import Mathlib.GroupTheory.GroupAction.SubMulAction.OfStabilizer +public import Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise +public import Mathlib.GroupTheory.GroupAction.Support +public import Mathlib.GroupTheory.GroupAction.Transitive +public import Mathlib.GroupTheory.GroupExtension.Basic +public import Mathlib.GroupTheory.GroupExtension.Defs +public import Mathlib.GroupTheory.HNNExtension +public import Mathlib.GroupTheory.Index +public import Mathlib.GroupTheory.IndexNormal +public import Mathlib.GroupTheory.MonoidLocalization.Away +public import Mathlib.GroupTheory.MonoidLocalization.Basic +public import Mathlib.GroupTheory.MonoidLocalization.Cardinality +public import Mathlib.GroupTheory.MonoidLocalization.DivPairs +public import Mathlib.GroupTheory.MonoidLocalization.Finite +public import Mathlib.GroupTheory.MonoidLocalization.GrothendieckGroup +public import Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero +public import Mathlib.GroupTheory.MonoidLocalization.Order +public import Mathlib.GroupTheory.Nilpotent +public import Mathlib.GroupTheory.NoncommCoprod +public import Mathlib.GroupTheory.NoncommPiCoprod +public import Mathlib.GroupTheory.Order.Min +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.GroupTheory.OreLocalization.Basic +public import Mathlib.GroupTheory.OreLocalization.Cardinality +public import Mathlib.GroupTheory.OreLocalization.OreSet +public import Mathlib.GroupTheory.PGroup +public import Mathlib.GroupTheory.Perm.Basic +public import Mathlib.GroupTheory.Perm.Centralizer +public import Mathlib.GroupTheory.Perm.Closure +public import Mathlib.GroupTheory.Perm.ClosureSwap +public import Mathlib.GroupTheory.Perm.ConjAct +public import Mathlib.GroupTheory.Perm.Cycle.Basic +public import Mathlib.GroupTheory.Perm.Cycle.Concrete +public import Mathlib.GroupTheory.Perm.Cycle.Factors +public import Mathlib.GroupTheory.Perm.Cycle.PossibleTypes +public import Mathlib.GroupTheory.Perm.Cycle.Type +public import Mathlib.GroupTheory.Perm.DomMulAct +public import Mathlib.GroupTheory.Perm.Fin +public import Mathlib.GroupTheory.Perm.Finite +public import Mathlib.GroupTheory.Perm.List +public import Mathlib.GroupTheory.Perm.MaximalSubgroups +public import Mathlib.GroupTheory.Perm.Option +public import Mathlib.GroupTheory.Perm.Sign +public import Mathlib.GroupTheory.Perm.Subgroup +public import Mathlib.GroupTheory.Perm.Support +public import Mathlib.GroupTheory.Perm.ViaEmbedding +public import Mathlib.GroupTheory.PresentedGroup +public import Mathlib.GroupTheory.PushoutI +public import Mathlib.GroupTheory.QuotientGroup.Basic +public import Mathlib.GroupTheory.QuotientGroup.Defs +public import Mathlib.GroupTheory.QuotientGroup.Finite +public import Mathlib.GroupTheory.Rank +public import Mathlib.GroupTheory.RegularWreathProduct +public import Mathlib.GroupTheory.Schreier +public import Mathlib.GroupTheory.SchurZassenhaus +public import Mathlib.GroupTheory.SemidirectProduct +public import Mathlib.GroupTheory.Solvable +public import Mathlib.GroupTheory.SpecificGroups.Alternating +public import Mathlib.GroupTheory.SpecificGroups.Alternating.Centralizer +public import Mathlib.GroupTheory.SpecificGroups.Alternating.KleinFour +public import Mathlib.GroupTheory.SpecificGroups.Cyclic +public import Mathlib.GroupTheory.SpecificGroups.Dihedral +public import Mathlib.GroupTheory.SpecificGroups.KleinFour +public import Mathlib.GroupTheory.SpecificGroups.Quaternion +public import Mathlib.GroupTheory.SpecificGroups.ZGroup +public import Mathlib.GroupTheory.Subgroup.Center +public import Mathlib.GroupTheory.Subgroup.Centralizer +public import Mathlib.GroupTheory.Subgroup.Saturated +public import Mathlib.GroupTheory.Subgroup.Simple +public import Mathlib.GroupTheory.Submonoid.Center +public import Mathlib.GroupTheory.Submonoid.Centralizer +public import Mathlib.GroupTheory.Submonoid.Inverses +public import Mathlib.GroupTheory.Subsemigroup.Center +public import Mathlib.GroupTheory.Subsemigroup.Centralizer +public import Mathlib.GroupTheory.Sylow +public import Mathlib.GroupTheory.Torsion +public import Mathlib.GroupTheory.Transfer +public import Mathlib.InformationTheory.Hamming +public import Mathlib.InformationTheory.KullbackLeibler.Basic +public import Mathlib.InformationTheory.KullbackLeibler.KLFun +public import Mathlib.Init +public import Mathlib.Lean.ContextInfo +public import Mathlib.Lean.CoreM +public import Mathlib.Lean.Elab.InfoTree +public import Mathlib.Lean.Elab.Tactic.Basic +public import Mathlib.Lean.Elab.Tactic.Meta +public import Mathlib.Lean.Elab.Term +public import Mathlib.Lean.EnvExtension +public import Mathlib.Lean.Exception +public import Mathlib.Lean.Expr +public import Mathlib.Lean.Expr.Basic +public import Mathlib.Lean.Expr.ExtraRecognizers +public import Mathlib.Lean.Expr.Rat +public import Mathlib.Lean.Expr.ReplaceRec +public import Mathlib.Lean.GoalsLocation +public import Mathlib.Lean.Json +public import Mathlib.Lean.LocalContext +public import Mathlib.Lean.Message +public import Mathlib.Lean.Meta +public import Mathlib.Lean.Meta.Basic +public import Mathlib.Lean.Meta.CongrTheorems +public import Mathlib.Lean.Meta.DiscrTree +public import Mathlib.Lean.Meta.KAbstractPositions +public import Mathlib.Lean.Meta.RefinedDiscrTree +public import Mathlib.Lean.Meta.RefinedDiscrTree.Basic +public import Mathlib.Lean.Meta.RefinedDiscrTree.Encode +public import Mathlib.Lean.Meta.RefinedDiscrTree.Initialize +public import Mathlib.Lean.Meta.RefinedDiscrTree.Lookup +public import Mathlib.Lean.Meta.Simp +public import Mathlib.Lean.Meta.Tactic.Rewrite +public import Mathlib.Lean.Name +public import Mathlib.Lean.PrettyPrinter.Delaborator +public import Mathlib.Lean.Thunk +public import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv +public import Mathlib.LinearAlgebra.AffineSpace.AffineMap +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs +public import Mathlib.LinearAlgebra.AffineSpace.Basis +public import Mathlib.LinearAlgebra.AffineSpace.Centroid +public import Mathlib.LinearAlgebra.AffineSpace.Combination +public import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv +public import Mathlib.LinearAlgebra.AffineSpace.Defs +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.LinearAlgebra.AffineSpace.Independent +public import Mathlib.LinearAlgebra.AffineSpace.Matrix +public import Mathlib.LinearAlgebra.AffineSpace.Midpoint +public import Mathlib.LinearAlgebra.AffineSpace.MidpointZero +public import Mathlib.LinearAlgebra.AffineSpace.Ordered +public import Mathlib.LinearAlgebra.AffineSpace.Pointwise +public import Mathlib.LinearAlgebra.AffineSpace.Restrict +public import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Simplex.Centroid +public import Mathlib.LinearAlgebra.AffineSpace.Slope +public import Mathlib.LinearAlgebra.Alternating.Basic +public import Mathlib.LinearAlgebra.Alternating.Curry +public import Mathlib.LinearAlgebra.Alternating.DomCoprod +public import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin +public import Mathlib.LinearAlgebra.AnnihilatingPolynomial +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Basis.Bilinear +public import Mathlib.LinearAlgebra.Basis.Cardinality +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.Basis.Exact +public import Mathlib.LinearAlgebra.Basis.Fin +public import Mathlib.LinearAlgebra.Basis.Flag +public import Mathlib.LinearAlgebra.Basis.MulOpposite +public import Mathlib.LinearAlgebra.Basis.Prod +public import Mathlib.LinearAlgebra.Basis.SMul +public import Mathlib.LinearAlgebra.Basis.Submodule +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.BilinearForm.Basic +public import Mathlib.LinearAlgebra.BilinearForm.DualLattice +public import Mathlib.LinearAlgebra.BilinearForm.Hom +public import Mathlib.LinearAlgebra.BilinearForm.Orthogonal +public import Mathlib.LinearAlgebra.BilinearForm.Properties +public import Mathlib.LinearAlgebra.BilinearForm.TensorProduct +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.Charpoly.BaseChange +public import Mathlib.LinearAlgebra.Charpoly.Basic +public import Mathlib.LinearAlgebra.Charpoly.ToMatrix +public import Mathlib.LinearAlgebra.CliffordAlgebra.BaseChange +public import Mathlib.LinearAlgebra.CliffordAlgebra.Basic +public import Mathlib.LinearAlgebra.CliffordAlgebra.CategoryTheory +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +public import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction +public import Mathlib.LinearAlgebra.CliffordAlgebra.Equivs +public import Mathlib.LinearAlgebra.CliffordAlgebra.Even +public import Mathlib.LinearAlgebra.CliffordAlgebra.EvenEquiv +public import Mathlib.LinearAlgebra.CliffordAlgebra.Fold +public import Mathlib.LinearAlgebra.CliffordAlgebra.Grading +public import Mathlib.LinearAlgebra.CliffordAlgebra.Inversion +public import Mathlib.LinearAlgebra.CliffordAlgebra.Prod +public import Mathlib.LinearAlgebra.CliffordAlgebra.SpinGroup +public import Mathlib.LinearAlgebra.CliffordAlgebra.Star +public import Mathlib.LinearAlgebra.Coevaluation +public import Mathlib.LinearAlgebra.Complex.Determinant +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.LinearAlgebra.Complex.Orientation +public import Mathlib.LinearAlgebra.Contraction +public import Mathlib.LinearAlgebra.Countable +public import Mathlib.LinearAlgebra.CrossProduct +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Dimension.Basic +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.LinearAlgebra.Dimension.ErdosKaplansky +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.LinearAlgebra.Dimension.Finrank +public import Mathlib.LinearAlgebra.Dimension.Free +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +public import Mathlib.LinearAlgebra.Dimension.LinearMap +public import Mathlib.LinearAlgebra.Dimension.Localization +public import Mathlib.LinearAlgebra.Dimension.RankNullity +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.Dimension.Subsingleton +public import Mathlib.LinearAlgebra.Dimension.Torsion.Basic +public import Mathlib.LinearAlgebra.Dimension.Torsion.Finite +public import Mathlib.LinearAlgebra.DirectSum.Basis +public import Mathlib.LinearAlgebra.DirectSum.Finite +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.LinearAlgebra.DirectSum.TensorProduct +public import Mathlib.LinearAlgebra.Dual.Basis +public import Mathlib.LinearAlgebra.Dual.Defs +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.LinearAlgebra.Eigenspace.Charpoly +public import Mathlib.LinearAlgebra.Eigenspace.Matrix +public import Mathlib.LinearAlgebra.Eigenspace.Minpoly +public import Mathlib.LinearAlgebra.Eigenspace.Pi +public import Mathlib.LinearAlgebra.Eigenspace.Semisimple +public import Mathlib.LinearAlgebra.Eigenspace.Triangularizable +public import Mathlib.LinearAlgebra.Eigenspace.Zero +public import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic +public import Mathlib.LinearAlgebra.ExteriorAlgebra.Grading +public import Mathlib.LinearAlgebra.ExteriorAlgebra.OfAlternating +public import Mathlib.LinearAlgebra.ExteriorPower.Basic +public import Mathlib.LinearAlgebra.ExteriorPower.Pairing +public import Mathlib.LinearAlgebra.FiniteDimensional.Basic +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.FiniteSpan +public import Mathlib.LinearAlgebra.Finsupp.Defs +public import Mathlib.LinearAlgebra.Finsupp.LSum +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination +public import Mathlib.LinearAlgebra.Finsupp.Pi +public import Mathlib.LinearAlgebra.Finsupp.Span +public import Mathlib.LinearAlgebra.Finsupp.SumProd +public import Mathlib.LinearAlgebra.Finsupp.Supported +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.FreeAlgebra +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.FreeModule.Determinant +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.LinearAlgebra.FreeModule.Finite.CardQuotient +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +public import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient +public import Mathlib.LinearAlgebra.FreeModule.IdealQuotient +public import Mathlib.LinearAlgebra.FreeModule.Int +public import Mathlib.LinearAlgebra.FreeModule.ModN +public import Mathlib.LinearAlgebra.FreeModule.Norm +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.FreeProduct.Basic +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.LinearAlgebra.Goursat +public import Mathlib.LinearAlgebra.InvariantBasisNumber +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.LinearAlgebra.JordanChevalley +public import Mathlib.LinearAlgebra.Lagrange +public import Mathlib.LinearAlgebra.LeftExact +public import Mathlib.LinearAlgebra.LinearDisjoint +public import Mathlib.LinearAlgebra.LinearIndependent.Basic +public import Mathlib.LinearAlgebra.LinearIndependent.Defs +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +public import Mathlib.LinearAlgebra.LinearPMap +public import Mathlib.LinearAlgebra.Matrix.AbsoluteValue +public import Mathlib.LinearAlgebra.Matrix.Adjugate +public import Mathlib.LinearAlgebra.Matrix.BaseChange +public import Mathlib.LinearAlgebra.Matrix.Basis +public import Mathlib.LinearAlgebra.Matrix.BilinearForm +public import Mathlib.LinearAlgebra.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.CharP +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Disc +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Eigs +public import Mathlib.LinearAlgebra.Matrix.Charpoly.FiniteField +public import Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Univ +public import Mathlib.LinearAlgebra.Matrix.Circulant +public import Mathlib.LinearAlgebra.Matrix.ConjTranspose +public import Mathlib.LinearAlgebra.Matrix.Defs +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.Determinant.Misc +public import Mathlib.LinearAlgebra.Matrix.Determinant.TotallyUnimodular +public import Mathlib.LinearAlgebra.Matrix.Diagonal +public import Mathlib.LinearAlgebra.Matrix.DotProduct +public import Mathlib.LinearAlgebra.Matrix.Dual +public import Mathlib.LinearAlgebra.Matrix.FiniteDimensional +public import Mathlib.LinearAlgebra.Matrix.FixedDetMatrices +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Basic +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Card +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.FinTwo +public import Mathlib.LinearAlgebra.Matrix.Gershgorin +public import Mathlib.LinearAlgebra.Matrix.Hadamard +public import Mathlib.LinearAlgebra.Matrix.Hermitian +public import Mathlib.LinearAlgebra.Matrix.HermitianFunctionalCalculus +public import Mathlib.LinearAlgebra.Matrix.Ideal +public import Mathlib.LinearAlgebra.Matrix.Integer +public import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber +public import Mathlib.LinearAlgebra.Matrix.Irreducible.Defs +public import Mathlib.LinearAlgebra.Matrix.IsDiag +public import Mathlib.LinearAlgebra.Matrix.Kronecker +public import Mathlib.LinearAlgebra.Matrix.MvPolynomial +public import Mathlib.LinearAlgebra.Matrix.Nondegenerate +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.LinearAlgebra.Matrix.Notation +public import Mathlib.LinearAlgebra.Matrix.Orthogonal +public import Mathlib.LinearAlgebra.Matrix.Permanent +public import Mathlib.LinearAlgebra.Matrix.Permutation +public import Mathlib.LinearAlgebra.Matrix.Polynomial +public import Mathlib.LinearAlgebra.Matrix.PosDef +public import Mathlib.LinearAlgebra.Matrix.ProjectiveSpecialLinearGroup +public import Mathlib.LinearAlgebra.Matrix.Rank +public import Mathlib.LinearAlgebra.Matrix.Reindex +public import Mathlib.LinearAlgebra.Matrix.RowCol +public import Mathlib.LinearAlgebra.Matrix.SchurComplement +public import Mathlib.LinearAlgebra.Matrix.SemiringInverse +public import Mathlib.LinearAlgebra.Matrix.SesquilinearForm +public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup +public import Mathlib.LinearAlgebra.Matrix.StdBasis +public import Mathlib.LinearAlgebra.Matrix.Swap +public import Mathlib.LinearAlgebra.Matrix.Symmetric +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv +public import Mathlib.LinearAlgebra.Matrix.Trace +public import Mathlib.LinearAlgebra.Matrix.Transvection +public import Mathlib.LinearAlgebra.Matrix.Unique +public import Mathlib.LinearAlgebra.Matrix.Vec +public import Mathlib.LinearAlgebra.Matrix.ZPow +public import Mathlib.LinearAlgebra.Multilinear.Basic +public import Mathlib.LinearAlgebra.Multilinear.Basis +public import Mathlib.LinearAlgebra.Multilinear.Curry +public import Mathlib.LinearAlgebra.Multilinear.DFinsupp +public import Mathlib.LinearAlgebra.Multilinear.FiniteDimensional +public import Mathlib.LinearAlgebra.Multilinear.Pi +public import Mathlib.LinearAlgebra.Multilinear.TensorProduct +public import Mathlib.LinearAlgebra.Orientation +public import Mathlib.LinearAlgebra.PID +public import Mathlib.LinearAlgebra.PerfectPairing.Basic +public import Mathlib.LinearAlgebra.PerfectPairing.Matrix +public import Mathlib.LinearAlgebra.PerfectPairing.Restrict +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.LinearAlgebra.PiTensorProduct +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.LinearAlgebra.Projection +public import Mathlib.LinearAlgebra.Projectivization.Action +public import Mathlib.LinearAlgebra.Projectivization.Basic +public import Mathlib.LinearAlgebra.Projectivization.Cardinality +public import Mathlib.LinearAlgebra.Projectivization.Constructions +public import Mathlib.LinearAlgebra.Projectivization.Independence +public import Mathlib.LinearAlgebra.Projectivization.Subspace +public import Mathlib.LinearAlgebra.QuadraticForm.Basic +public import Mathlib.LinearAlgebra.QuadraticForm.Basis +public import Mathlib.LinearAlgebra.QuadraticForm.Complex +public import Mathlib.LinearAlgebra.QuadraticForm.Dual +public import Mathlib.LinearAlgebra.QuadraticForm.Isometry +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +public import Mathlib.LinearAlgebra.QuadraticForm.Prod +public import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat +public import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Monoidal +public import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Symmetric +public import Mathlib.LinearAlgebra.QuadraticForm.Real +public import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct +public import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct.Isometries +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.LinearAlgebra.Quotient.Card +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.LinearAlgebra.Quotient.Pi +public import Mathlib.LinearAlgebra.Ray +public import Mathlib.LinearAlgebra.Reflection +public import Mathlib.LinearAlgebra.RootSystem.Base +public import Mathlib.LinearAlgebra.RootSystem.BaseChange +public import Mathlib.LinearAlgebra.RootSystem.Basic +public import Mathlib.LinearAlgebra.RootSystem.CartanMatrix +public import Mathlib.LinearAlgebra.RootSystem.Chain +public import Mathlib.LinearAlgebra.RootSystem.Defs +public import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear +public import Mathlib.LinearAlgebra.RootSystem.Finite.G2 +public import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +public import Mathlib.LinearAlgebra.RootSystem.Finite.Nondegenerate +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Basic +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Lemmas +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple +public import Mathlib.LinearAlgebra.RootSystem.Hom +public import Mathlib.LinearAlgebra.RootSystem.Irreducible +public import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +public import Mathlib.LinearAlgebra.RootSystem.OfBilinear +public import Mathlib.LinearAlgebra.RootSystem.Reduced +public import Mathlib.LinearAlgebra.RootSystem.RootPairingCat +public import Mathlib.LinearAlgebra.RootSystem.RootPositive +public import Mathlib.LinearAlgebra.RootSystem.WeylGroup +public import Mathlib.LinearAlgebra.SModEq +public import Mathlib.LinearAlgebra.SModEq.Basic +public import Mathlib.LinearAlgebra.Semisimple +public import Mathlib.LinearAlgebra.SesquilinearForm +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic +public import Mathlib.LinearAlgebra.SesquilinearForm.Star +public import Mathlib.LinearAlgebra.Span.Basic +public import Mathlib.LinearAlgebra.Span.Defs +public import Mathlib.LinearAlgebra.SpecialLinearGroup +public import Mathlib.LinearAlgebra.StdBasis +public import Mathlib.LinearAlgebra.SymmetricAlgebra.Basic +public import Mathlib.LinearAlgebra.SymmetricAlgebra.Basis +public import Mathlib.LinearAlgebra.SymplecticGroup +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic +public import Mathlib.LinearAlgebra.TensorAlgebra.Basis +public import Mathlib.LinearAlgebra.TensorAlgebra.Grading +public import Mathlib.LinearAlgebra.TensorAlgebra.ToTensorPower +public import Mathlib.LinearAlgebra.TensorPower.Basic +public import Mathlib.LinearAlgebra.TensorPower.Pairing +public import Mathlib.LinearAlgebra.TensorPower.Symmetric +public import Mathlib.LinearAlgebra.TensorProduct.Associator +public import Mathlib.LinearAlgebra.TensorProduct.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Basis +public import Mathlib.LinearAlgebra.TensorProduct.DirectLimit +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.LinearAlgebra.TensorProduct.Graded.External +public import Mathlib.LinearAlgebra.TensorProduct.Graded.Internal +public import Mathlib.LinearAlgebra.TensorProduct.Matrix +public import Mathlib.LinearAlgebra.TensorProduct.Opposite +public import Mathlib.LinearAlgebra.TensorProduct.Pi +public import Mathlib.LinearAlgebra.TensorProduct.Prod +public import Mathlib.LinearAlgebra.TensorProduct.Quotient +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.LinearAlgebra.TensorProduct.Subalgebra +public import Mathlib.LinearAlgebra.TensorProduct.Submodule +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.LinearAlgebra.TensorProduct.Vanishing +public import Mathlib.LinearAlgebra.Trace +public import Mathlib.LinearAlgebra.Transvection +public import Mathlib.LinearAlgebra.UnitaryGroup +public import Mathlib.LinearAlgebra.Vandermonde +public import Mathlib.Logic.Basic +public import Mathlib.Logic.Denumerable +public import Mathlib.Logic.Embedding.Basic +public import Mathlib.Logic.Embedding.Set +public import Mathlib.Logic.Encodable.Basic +public import Mathlib.Logic.Encodable.Lattice +public import Mathlib.Logic.Encodable.Pi +public import Mathlib.Logic.Equiv.Array +public import Mathlib.Logic.Equiv.Basic +public import Mathlib.Logic.Equiv.Bool +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Logic.Equiv.Embedding +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.Logic.Equiv.Fin.Rotate +public import Mathlib.Logic.Equiv.Finset +public import Mathlib.Logic.Equiv.Fintype +public import Mathlib.Logic.Equiv.Functor +public import Mathlib.Logic.Equiv.List +public import Mathlib.Logic.Equiv.Multiset +public import Mathlib.Logic.Equiv.Nat +public import Mathlib.Logic.Equiv.Option +public import Mathlib.Logic.Equiv.Pairwise +public import Mathlib.Logic.Equiv.PartialEquiv +public import Mathlib.Logic.Equiv.Prod +public import Mathlib.Logic.Equiv.Set +public import Mathlib.Logic.Equiv.Sum +public import Mathlib.Logic.ExistsUnique +public import Mathlib.Logic.Function.Basic +public import Mathlib.Logic.Function.Coequalizer +public import Mathlib.Logic.Function.CompTypeclasses +public import Mathlib.Logic.Function.Conjugate +public import Mathlib.Logic.Function.Defs +public import Mathlib.Logic.Function.DependsOn +public import Mathlib.Logic.Function.FiberPartition +public import Mathlib.Logic.Function.FromTypes +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Logic.Function.OfArity +public import Mathlib.Logic.Function.ULift +public import Mathlib.Logic.Godel.GodelBetaFunction +public import Mathlib.Logic.Hydra +public import Mathlib.Logic.IsEmpty +public import Mathlib.Logic.Lemmas +public import Mathlib.Logic.Nonempty +public import Mathlib.Logic.Nontrivial.Basic +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Logic.OpClass +public import Mathlib.Logic.Pairwise +public import Mathlib.Logic.Relation +public import Mathlib.Logic.Relator +public import Mathlib.Logic.Small.Basic +public import Mathlib.Logic.Small.Defs +public import Mathlib.Logic.Small.List +public import Mathlib.Logic.Small.Set +public import Mathlib.Logic.Unique +public import Mathlib.Logic.UnivLE +public import Mathlib.MeasureTheory.Category.MeasCat +public import Mathlib.MeasureTheory.Constructions.AddChar +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex +public import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Real +public import Mathlib.MeasureTheory.Constructions.BorelSpace.WithTop +public import Mathlib.MeasureTheory.Constructions.ClosedCompactCylinders +public import Mathlib.MeasureTheory.Constructions.Cylinders +public import Mathlib.MeasureTheory.Constructions.HaarToSphere +public import Mathlib.MeasureTheory.Constructions.Pi +public import Mathlib.MeasureTheory.Constructions.Polish.Basic +public import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal +public import Mathlib.MeasureTheory.Constructions.Polish.StronglyMeasurable +public import Mathlib.MeasureTheory.Constructions.Projective +public import Mathlib.MeasureTheory.Constructions.ProjectiveFamilyContent +public import Mathlib.MeasureTheory.Constructions.SubmoduleQuotient +public import Mathlib.MeasureTheory.Constructions.UnitInterval +public import Mathlib.MeasureTheory.Covering.Besicovitch +public import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace +public import Mathlib.MeasureTheory.Covering.DensityTheorem +public import Mathlib.MeasureTheory.Covering.Differentiation +public import Mathlib.MeasureTheory.Covering.LiminfLimsup +public import Mathlib.MeasureTheory.Covering.OneDim +public import Mathlib.MeasureTheory.Covering.Vitali +public import Mathlib.MeasureTheory.Covering.VitaliFamily +public import Mathlib.MeasureTheory.Function.AEEqFun +public import Mathlib.MeasureTheory.Function.AEEqFun.DomAct +public import Mathlib.MeasureTheory.Function.AEEqOfIntegral +public import Mathlib.MeasureTheory.Function.AEEqOfLIntegral +public import Mathlib.MeasureTheory.Function.AEMeasurableOrder +public import Mathlib.MeasureTheory.Function.AEMeasurableSequence +public import Mathlib.MeasureTheory.Function.AbsolutelyContinuous +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique +public import Mathlib.MeasureTheory.Function.ContinuousMapDense +public import Mathlib.MeasureTheory.Function.ConvergenceInDistribution +public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure +public import Mathlib.MeasureTheory.Function.Egorov +public import Mathlib.MeasureTheory.Function.EssSup +public import Mathlib.MeasureTheory.Function.FactorsThrough +public import Mathlib.MeasureTheory.Function.Floor +public import Mathlib.MeasureTheory.Function.Holder +public import Mathlib.MeasureTheory.Function.Intersectivity +public import Mathlib.MeasureTheory.Function.Jacobian +public import Mathlib.MeasureTheory.Function.JacobianOneDim +public import Mathlib.MeasureTheory.Function.L1Space.AEEqFun +public import Mathlib.MeasureTheory.Function.L1Space.HasFiniteIntegral +public import Mathlib.MeasureTheory.Function.L1Space.Integrable +public import Mathlib.MeasureTheory.Function.L2Space +public import Mathlib.MeasureTheory.Function.LocallyIntegrable +public import Mathlib.MeasureTheory.Function.LpOrder +public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +public import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov +public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp +public import Mathlib.MeasureTheory.Function.LpSeminorm.Defs +public import Mathlib.MeasureTheory.Function.LpSeminorm.Prod +public import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality +public import Mathlib.MeasureTheory.Function.LpSeminorm.Trim +public import Mathlib.MeasureTheory.Function.LpSpace.Basic +public import Mathlib.MeasureTheory.Function.LpSpace.Complete +public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving +public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions +public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic +public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Continuous +public import Mathlib.MeasureTheory.Function.LpSpace.Indicator +public import Mathlib.MeasureTheory.Function.SimpleFunc +public import Mathlib.MeasureTheory.Function.SimpleFuncDense +public import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Arctan +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Inner +public import Mathlib.MeasureTheory.Function.SpecialFunctions.RCLike +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Sinc +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.ENNReal +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp +public import Mathlib.MeasureTheory.Function.UnifTight +public import Mathlib.MeasureTheory.Function.UniformIntegrable +public import Mathlib.MeasureTheory.Group.AEStabilizer +public import Mathlib.MeasureTheory.Group.Action +public import Mathlib.MeasureTheory.Group.AddCircle +public import Mathlib.MeasureTheory.Group.Arithmetic +public import Mathlib.MeasureTheory.Group.Convolution +public import Mathlib.MeasureTheory.Group.Defs +public import Mathlib.MeasureTheory.Group.FundamentalDomain +public import Mathlib.MeasureTheory.Group.GeometryOfNumbers +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Group.IntegralConvolution +public import Mathlib.MeasureTheory.Group.LIntegral +public import Mathlib.MeasureTheory.Group.MeasurableEquiv +public import Mathlib.MeasureTheory.Group.Measure +public import Mathlib.MeasureTheory.Group.ModularCharacter +public import Mathlib.MeasureTheory.Group.Pointwise +public import Mathlib.MeasureTheory.Group.Prod +public import Mathlib.MeasureTheory.Integral.Asymptotics +public import Mathlib.MeasureTheory.Integral.Average +public import Mathlib.MeasureTheory.Integral.Bochner +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.MeasureTheory.Integral.Bochner.FundThmCalculus +public import Mathlib.MeasureTheory.Integral.Bochner.L1 +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory +public import Mathlib.MeasureTheory.Integral.BochnerL1 +public import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction +public import Mathlib.MeasureTheory.Integral.CircleAverage +public import Mathlib.MeasureTheory.Integral.CircleIntegral +public import Mathlib.MeasureTheory.Integral.CircleTransform +public import Mathlib.MeasureTheory.Integral.CompactlySupported +public import Mathlib.MeasureTheory.Integral.CurveIntegral.Basic +public import Mathlib.MeasureTheory.Integral.DivergenceTheorem +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.ExpDecay +public import Mathlib.MeasureTheory.Integral.FinMeasAdditive +public import Mathlib.MeasureTheory.Integral.FundThmCalculus +public import Mathlib.MeasureTheory.Integral.Gamma +public import Mathlib.MeasureTheory.Integral.Indicator +public import Mathlib.MeasureTheory.Integral.IntegrableOn +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper +public import Mathlib.MeasureTheory.Integral.IntegrationByParts +public import Mathlib.MeasureTheory.Integral.IntervalAverage +public import Mathlib.MeasureTheory.Integral.IntervalIntegral +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.ContDiff +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.DerivIntegrable +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.LebesgueDifferentiationThm +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Slope +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.TrapezoidalRule +public import Mathlib.MeasureTheory.Integral.Layercake +public import Mathlib.MeasureTheory.Integral.Lebesgue +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +public import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +public import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.Lebesgue.Map +public import Mathlib.MeasureTheory.Integral.Lebesgue.Markov +public import Mathlib.MeasureTheory.Integral.Lebesgue.MeasurePreserving +public import Mathlib.MeasureTheory.Integral.Lebesgue.Norm +public import Mathlib.MeasureTheory.Integral.Lebesgue.Sub +public import Mathlib.MeasureTheory.Integral.LebesgueNormedSpace +public import Mathlib.MeasureTheory.Integral.Marginal +public import Mathlib.MeasureTheory.Integral.MeanInequalities +public import Mathlib.MeasureTheory.Integral.PeakFunction +public import Mathlib.MeasureTheory.Integral.Periodic +public import Mathlib.MeasureTheory.Integral.Pi +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic +public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.NNReal +public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real +public import Mathlib.MeasureTheory.Integral.SetIntegral +public import Mathlib.MeasureTheory.Integral.SetToL1 +public import Mathlib.MeasureTheory.Integral.TorusIntegral +public import Mathlib.MeasureTheory.Integral.VitaliCaratheodory +public import Mathlib.MeasureTheory.MeasurableSpace.Basic +public import Mathlib.MeasureTheory.MeasurableSpace.Card +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated +public import Mathlib.MeasureTheory.MeasurableSpace.Defs +public import Mathlib.MeasureTheory.MeasurableSpace.Embedding +public import Mathlib.MeasureTheory.MeasurableSpace.EventuallyMeasurable +public import Mathlib.MeasureTheory.MeasurableSpace.Instances +public import Mathlib.MeasureTheory.MeasurableSpace.Invariants +public import Mathlib.MeasureTheory.MeasurableSpace.MeasurablyGenerated +public import Mathlib.MeasureTheory.MeasurableSpace.NCard +public import Mathlib.MeasureTheory.MeasurableSpace.Pi +public import Mathlib.MeasureTheory.MeasurableSpace.PreorderRestrict +public import Mathlib.MeasureTheory.MeasurableSpace.Prod +public import Mathlib.MeasureTheory.Measure.AEDisjoint +public import Mathlib.MeasureTheory.Measure.AEMeasurable +public import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous +public import Mathlib.MeasureTheory.Measure.AddContent +public import Mathlib.MeasureTheory.Measure.CharacteristicFunction +public import Mathlib.MeasureTheory.Measure.Comap +public import Mathlib.MeasureTheory.Measure.Complex +public import Mathlib.MeasureTheory.Measure.Content +public import Mathlib.MeasureTheory.Measure.ContinuousPreimage +public import Mathlib.MeasureTheory.Measure.Count +public import Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion +public import Mathlib.MeasureTheory.Measure.Decomposition.Hahn +public import Mathlib.MeasureTheory.Measure.Decomposition.IntegralRNDeriv +public import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +public import Mathlib.MeasureTheory.Measure.Dirac +public import Mathlib.MeasureTheory.Measure.DiracProba +public import Mathlib.MeasureTheory.Measure.Doubling +public import Mathlib.MeasureTheory.Measure.EverywherePos +public import Mathlib.MeasureTheory.Measure.FiniteMeasure +public import Mathlib.MeasureTheory.Measure.FiniteMeasureExt +public import Mathlib.MeasureTheory.Measure.FiniteMeasurePi +public import Mathlib.MeasureTheory.Measure.FiniteMeasureProd +public import Mathlib.MeasureTheory.Measure.GiryMonad +public import Mathlib.MeasureTheory.Measure.Haar.Basic +public import Mathlib.MeasureTheory.Measure.Haar.Disintegration +public import Mathlib.MeasureTheory.Measure.Haar.DistribChar +public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace +public import Mathlib.MeasureTheory.Measure.Haar.MulEquivHaarChar +public import Mathlib.MeasureTheory.Measure.Haar.NormedSpace +public import Mathlib.MeasureTheory.Measure.Haar.OfBasis +public import Mathlib.MeasureTheory.Measure.Haar.Quotient +public import Mathlib.MeasureTheory.Measure.Haar.Unique +public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed +public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosedProd +public import Mathlib.MeasureTheory.Measure.Hausdorff +public import Mathlib.MeasureTheory.Measure.IntegralCharFun +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +public import Mathlib.MeasureTheory.Measure.Lebesgue.Complex +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.MeasureTheory.Measure.Lebesgue.Integral +public import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls +public import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric +public import Mathlib.MeasureTheory.Measure.LogLikelihoodRatio +public import Mathlib.MeasureTheory.Measure.Map +public import Mathlib.MeasureTheory.Measure.MeasureSpace +public import Mathlib.MeasureTheory.Measure.MeasureSpaceDef +public import Mathlib.MeasureTheory.Measure.MutuallySingular +public import Mathlib.MeasureTheory.Measure.NullMeasurable +public import Mathlib.MeasureTheory.Measure.OpenPos +public import Mathlib.MeasureTheory.Measure.Portmanteau +public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving +public import Mathlib.MeasureTheory.Measure.Real +public import Mathlib.MeasureTheory.Measure.Regular +public import Mathlib.MeasureTheory.Measure.RegularityCompacts +public import Mathlib.MeasureTheory.Measure.Restrict +public import Mathlib.MeasureTheory.Measure.SeparableMeasure +public import Mathlib.MeasureTheory.Measure.Stieltjes +public import Mathlib.MeasureTheory.Measure.Sub +public import Mathlib.MeasureTheory.Measure.Support +public import Mathlib.MeasureTheory.Measure.Tight +public import Mathlib.MeasureTheory.Measure.TightNormed +public import Mathlib.MeasureTheory.Measure.Tilted +public import Mathlib.MeasureTheory.Measure.Trim +public import Mathlib.MeasureTheory.Measure.Typeclasses +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +public import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +public import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite +public import Mathlib.MeasureTheory.Measure.WithDensity +public import Mathlib.MeasureTheory.Measure.WithDensityFinite +public import Mathlib.MeasureTheory.Order.Group.Lattice +public import Mathlib.MeasureTheory.Order.Lattice +public import Mathlib.MeasureTheory.Order.UpperLower +public import Mathlib.MeasureTheory.OuterMeasure.AE +public import Mathlib.MeasureTheory.OuterMeasure.Basic +public import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli +public import Mathlib.MeasureTheory.OuterMeasure.Caratheodory +public import Mathlib.MeasureTheory.OuterMeasure.Defs +public import Mathlib.MeasureTheory.OuterMeasure.Induced +public import Mathlib.MeasureTheory.OuterMeasure.OfAddContent +public import Mathlib.MeasureTheory.OuterMeasure.OfFunction +public import Mathlib.MeasureTheory.OuterMeasure.Operations +public import Mathlib.MeasureTheory.PiSystem +public import Mathlib.MeasureTheory.SetAlgebra +public import Mathlib.MeasureTheory.SetSemiring +public import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMap +public import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMapZero +public import Mathlib.MeasureTheory.SpecificCodomains.Pi +public import Mathlib.MeasureTheory.SpecificCodomains.WithLp +public import Mathlib.MeasureTheory.Topology +public import Mathlib.MeasureTheory.VectorMeasure.Basic +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Hahn +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.JordanSub +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Lebesgue +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym +public import Mathlib.MeasureTheory.VectorMeasure.WithDensity +public import Mathlib.ModelTheory.Algebra.Field.Basic +public import Mathlib.ModelTheory.Algebra.Field.CharP +public import Mathlib.ModelTheory.Algebra.Field.IsAlgClosed +public import Mathlib.ModelTheory.Algebra.Ring.Basic +public import Mathlib.ModelTheory.Algebra.Ring.Definability +public import Mathlib.ModelTheory.Algebra.Ring.FreeCommRing +public import Mathlib.ModelTheory.Arithmetic.Presburger.Basic +public import Mathlib.ModelTheory.Arithmetic.Presburger.Semilinear.Defs +public import Mathlib.ModelTheory.Basic +public import Mathlib.ModelTheory.Bundled +public import Mathlib.ModelTheory.Complexity +public import Mathlib.ModelTheory.Definability +public import Mathlib.ModelTheory.DirectLimit +public import Mathlib.ModelTheory.ElementaryMaps +public import Mathlib.ModelTheory.ElementarySubstructures +public import Mathlib.ModelTheory.Encoding +public import Mathlib.ModelTheory.Equivalence +public import Mathlib.ModelTheory.FinitelyGenerated +public import Mathlib.ModelTheory.Fraisse +public import Mathlib.ModelTheory.Graph +public import Mathlib.ModelTheory.LanguageMap +public import Mathlib.ModelTheory.Order +public import Mathlib.ModelTheory.PartialEquiv +public import Mathlib.ModelTheory.Quotients +public import Mathlib.ModelTheory.Satisfiability +public import Mathlib.ModelTheory.Semantics +public import Mathlib.ModelTheory.Skolem +public import Mathlib.ModelTheory.Substructures +public import Mathlib.ModelTheory.Syntax +public import Mathlib.ModelTheory.Types +public import Mathlib.ModelTheory.Ultraproducts +public import Mathlib.NumberTheory.ADEInequality +public import Mathlib.NumberTheory.AbelSummation +public import Mathlib.NumberTheory.ArithmeticFunction +public import Mathlib.NumberTheory.Basic +public import Mathlib.NumberTheory.Bernoulli +public import Mathlib.NumberTheory.BernoulliPolynomials +public import Mathlib.NumberTheory.Bertrand +public import Mathlib.NumberTheory.ClassNumber.AdmissibleAbs +public import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue +public import Mathlib.NumberTheory.ClassNumber.AdmissibleCardPowDegree +public import Mathlib.NumberTheory.ClassNumber.Finite +public import Mathlib.NumberTheory.ClassNumber.FunctionField +public import Mathlib.NumberTheory.Cyclotomic.Basic +public import Mathlib.NumberTheory.Cyclotomic.CyclotomicCharacter +public import Mathlib.NumberTheory.Cyclotomic.Discriminant +public import Mathlib.NumberTheory.Cyclotomic.Embeddings +public import Mathlib.NumberTheory.Cyclotomic.Gal +public import Mathlib.NumberTheory.Cyclotomic.PID +public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots +public import Mathlib.NumberTheory.Cyclotomic.Rat +public import Mathlib.NumberTheory.Cyclotomic.Three +public import Mathlib.NumberTheory.Dioph +public import Mathlib.NumberTheory.DiophantineApproximation.Basic +public import Mathlib.NumberTheory.DiophantineApproximation.ContinuedFractions +public import Mathlib.NumberTheory.DirichletCharacter.Basic +public import Mathlib.NumberTheory.DirichletCharacter.Bounds +public import Mathlib.NumberTheory.DirichletCharacter.GaussSum +public import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +public import Mathlib.NumberTheory.Divisors +public import Mathlib.NumberTheory.EllipticDivisibilitySequence +public import Mathlib.NumberTheory.EulerProduct.Basic +public import Mathlib.NumberTheory.EulerProduct.DirichletLSeries +public import Mathlib.NumberTheory.EulerProduct.ExpLog +public import Mathlib.NumberTheory.FLT.Basic +public import Mathlib.NumberTheory.FLT.Four +public import Mathlib.NumberTheory.FLT.MasonStothers +public import Mathlib.NumberTheory.FLT.Polynomial +public import Mathlib.NumberTheory.FLT.Three +public import Mathlib.NumberTheory.FactorisationProperties +public import Mathlib.NumberTheory.Fermat +public import Mathlib.NumberTheory.FermatPsp +public import Mathlib.NumberTheory.FrobeniusNumber +public import Mathlib.NumberTheory.FunctionField +public import Mathlib.NumberTheory.GaussSum +public import Mathlib.NumberTheory.Harmonic.Bounds +public import Mathlib.NumberTheory.Harmonic.Defs +public import Mathlib.NumberTheory.Harmonic.EulerMascheroni +public import Mathlib.NumberTheory.Harmonic.GammaDeriv +public import Mathlib.NumberTheory.Harmonic.Int +public import Mathlib.NumberTheory.Harmonic.ZetaAsymp +public import Mathlib.NumberTheory.JacobiSum.Basic +public import Mathlib.NumberTheory.KummerDedekind +public import Mathlib.NumberTheory.LSeries.AbstractFuncEq +public import Mathlib.NumberTheory.LSeries.Basic +public import Mathlib.NumberTheory.LSeries.Convergence +public import Mathlib.NumberTheory.LSeries.Convolution +public import Mathlib.NumberTheory.LSeries.Deriv +public import Mathlib.NumberTheory.LSeries.Dirichlet +public import Mathlib.NumberTheory.LSeries.DirichletContinuation +public import Mathlib.NumberTheory.LSeries.HurwitzZeta +public import Mathlib.NumberTheory.LSeries.HurwitzZetaEven +public import Mathlib.NumberTheory.LSeries.HurwitzZetaOdd +public import Mathlib.NumberTheory.LSeries.HurwitzZetaValues +public import Mathlib.NumberTheory.LSeries.Injectivity +public import Mathlib.NumberTheory.LSeries.Linearity +public import Mathlib.NumberTheory.LSeries.MellinEqDirichlet +public import Mathlib.NumberTheory.LSeries.Nonvanishing +public import Mathlib.NumberTheory.LSeries.Positivity +public import Mathlib.NumberTheory.LSeries.PrimesInAP +public import Mathlib.NumberTheory.LSeries.RiemannZeta +public import Mathlib.NumberTheory.LSeries.SumCoeff +public import Mathlib.NumberTheory.LSeries.ZMod +public import Mathlib.NumberTheory.LegendreSymbol.AddCharacter +public import Mathlib.NumberTheory.LegendreSymbol.Basic +public import Mathlib.NumberTheory.LegendreSymbol.GaussEisensteinLemmas +public import Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity +public import Mathlib.NumberTheory.LegendreSymbol.ZModChar +public import Mathlib.NumberTheory.LocalField.Basic +public import Mathlib.NumberTheory.LucasLehmer +public import Mathlib.NumberTheory.LucasPrimality +public import Mathlib.NumberTheory.MaricaSchoenheim +public import Mathlib.NumberTheory.Modular +public import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups +public import Mathlib.NumberTheory.ModularForms.Basic +public import Mathlib.NumberTheory.ModularForms.BoundedAtCusp +public import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups +public import Mathlib.NumberTheory.ModularForms.Cusps +public import Mathlib.NumberTheory.ModularForms.DedekindEta +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Basic +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.IsBoundedAtImInfty +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.MDifferentiable +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.QExpansion +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.UniformConvergence +public import Mathlib.NumberTheory.ModularForms.Identities +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.Manifold +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.OneVariable +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable +public import Mathlib.NumberTheory.ModularForms.LevelOne +public import Mathlib.NumberTheory.ModularForms.Petersson +public import Mathlib.NumberTheory.ModularForms.QExpansion +public import Mathlib.NumberTheory.ModularForms.SlashActions +public import Mathlib.NumberTheory.ModularForms.SlashInvariantForms +public import Mathlib.NumberTheory.MulChar.Basic +public import Mathlib.NumberTheory.MulChar.Duality +public import Mathlib.NumberTheory.MulChar.Lemmas +public import Mathlib.NumberTheory.Multiplicity +public import Mathlib.NumberTheory.Niven +public import Mathlib.NumberTheory.NumberField.AdeleRing +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.NumberTheory.NumberField.CMField +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCone +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.PolarCoord +public import Mathlib.NumberTheory.NumberField.ClassNumber +public import Mathlib.NumberTheory.NumberField.Completion +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Ideal +public import Mathlib.NumberTheory.NumberField.Cyclotomic.PID +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Three +public import Mathlib.NumberTheory.NumberField.DedekindZeta +public import Mathlib.NumberTheory.NumberField.Discriminant.Basic +public import Mathlib.NumberTheory.NumberField.Discriminant.Defs +public import Mathlib.NumberTheory.NumberField.Discriminant.Different +public import Mathlib.NumberTheory.NumberField.Embeddings +public import Mathlib.NumberTheory.NumberField.EquivReindex +public import Mathlib.NumberTheory.NumberField.FinitePlaces +public import Mathlib.NumberTheory.NumberField.FractionalIdeal +public import Mathlib.NumberTheory.NumberField.House +public import Mathlib.NumberTheory.NumberField.Ideal +public import Mathlib.NumberTheory.NumberField.Ideal.Asymptotics +public import Mathlib.NumberTheory.NumberField.Ideal.Basic +public import Mathlib.NumberTheory.NumberField.Ideal.KummerDedekind +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Completion +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Embeddings +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Ramification +public import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex +public import Mathlib.NumberTheory.NumberField.Norm +public import Mathlib.NumberTheory.NumberField.ProductFormula +public import Mathlib.NumberTheory.NumberField.Units.Basic +public import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem +public import Mathlib.NumberTheory.NumberField.Units.Regulator +public import Mathlib.NumberTheory.Ostrowski +public import Mathlib.NumberTheory.Padics.AddChar +public import Mathlib.NumberTheory.Padics.Complex +public import Mathlib.NumberTheory.Padics.Hensel +public import Mathlib.NumberTheory.Padics.MahlerBasis +public import Mathlib.NumberTheory.Padics.PadicIntegers +public import Mathlib.NumberTheory.Padics.PadicNorm +public import Mathlib.NumberTheory.Padics.PadicNumbers +public import Mathlib.NumberTheory.Padics.PadicVal.Basic +public import Mathlib.NumberTheory.Padics.PadicVal.Defs +public import Mathlib.NumberTheory.Padics.ProperSpace +public import Mathlib.NumberTheory.Padics.RingHoms +public import Mathlib.NumberTheory.Padics.ValuativeRel +public import Mathlib.NumberTheory.Padics.WithVal +public import Mathlib.NumberTheory.Pell +public import Mathlib.NumberTheory.PellMatiyasevic +public import Mathlib.NumberTheory.PowModTotient +public import Mathlib.NumberTheory.PrimeCounting +public import Mathlib.NumberTheory.PrimesCongruentOne +public import Mathlib.NumberTheory.Primorial +public import Mathlib.NumberTheory.PythagoreanTriples +public import Mathlib.NumberTheory.RamificationInertia.Basic +public import Mathlib.NumberTheory.RamificationInertia.Galois +public import Mathlib.NumberTheory.RamificationInertia.Unramified +public import Mathlib.NumberTheory.Rayleigh +public import Mathlib.NumberTheory.Real.GoldenRatio +public import Mathlib.NumberTheory.Real.Irrational +public import Mathlib.NumberTheory.SelbergSieve +public import Mathlib.NumberTheory.SiegelsLemma +public import Mathlib.NumberTheory.SmoothNumbers +public import Mathlib.NumberTheory.SumFourSquares +public import Mathlib.NumberTheory.SumPrimeReciprocals +public import Mathlib.NumberTheory.SumTwoSquares +public import Mathlib.NumberTheory.Transcendental.Lindemann.AnalyticalPart +public import Mathlib.NumberTheory.Transcendental.Liouville.Basic +public import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleNumber +public import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleWith +public import Mathlib.NumberTheory.Transcendental.Liouville.Measure +public import Mathlib.NumberTheory.Transcendental.Liouville.Residual +public import Mathlib.NumberTheory.TsumDivsorsAntidiagonal +public import Mathlib.NumberTheory.VonMangoldt +public import Mathlib.NumberTheory.WellApproximable +public import Mathlib.NumberTheory.Wilson +public import Mathlib.NumberTheory.ZetaValues +public import Mathlib.NumberTheory.Zsqrtd.Basic +public import Mathlib.NumberTheory.Zsqrtd.GaussianInt +public import Mathlib.NumberTheory.Zsqrtd.QuadraticReciprocity +public import Mathlib.NumberTheory.Zsqrtd.ToReal +public import Mathlib.Order.Antichain +public import Mathlib.Order.Antisymmetrization +public import Mathlib.Order.Atoms +public import Mathlib.Order.Atoms.Finite +public import Mathlib.Order.Basic +public import Mathlib.Order.Birkhoff +public import Mathlib.Order.BooleanAlgebra +public import Mathlib.Order.BooleanAlgebra.Basic +public import Mathlib.Order.BooleanAlgebra.Defs +public import Mathlib.Order.BooleanAlgebra.Set +public import Mathlib.Order.BooleanGenerators +public import Mathlib.Order.BooleanSubalgebra +public import Mathlib.Order.Booleanisation +public import Mathlib.Order.Bounded +public import Mathlib.Order.BoundedOrder.Basic +public import Mathlib.Order.BoundedOrder.Lattice +public import Mathlib.Order.BoundedOrder.Monotone +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.Bounds.Defs +public import Mathlib.Order.Bounds.Image +public import Mathlib.Order.Bounds.Lattice +public import Mathlib.Order.Bounds.OrderIso +public import Mathlib.Order.BourbakiWitt +public import Mathlib.Order.Category.BddDistLat +public import Mathlib.Order.Category.BddLat +public import Mathlib.Order.Category.BddOrd +public import Mathlib.Order.Category.BoolAlg +public import Mathlib.Order.Category.CompleteLat +public import Mathlib.Order.Category.DistLat +public import Mathlib.Order.Category.FinBddDistLat +public import Mathlib.Order.Category.FinBoolAlg +public import Mathlib.Order.Category.FinPartOrd +public import Mathlib.Order.Category.Frm +public import Mathlib.Order.Category.HeytAlg +public import Mathlib.Order.Category.Lat +public import Mathlib.Order.Category.LinOrd +public import Mathlib.Order.Category.NonemptyFinLinOrd +public import Mathlib.Order.Category.OmegaCompletePartialOrder +public import Mathlib.Order.Category.PartOrd +public import Mathlib.Order.Category.PartOrdEmb +public import Mathlib.Order.Category.Preord +public import Mathlib.Order.Category.Semilat +public import Mathlib.Order.Chain +public import Mathlib.Order.Circular +public import Mathlib.Order.Circular.ZMod +public import Mathlib.Order.Closure +public import Mathlib.Order.Cofinal +public import Mathlib.Order.CompactlyGenerated.Basic +public import Mathlib.Order.CompactlyGenerated.Intervals +public import Mathlib.Order.Comparable +public import Mathlib.Order.Compare +public import Mathlib.Order.CompleteBooleanAlgebra +public import Mathlib.Order.CompleteLattice.Basic +public import Mathlib.Order.CompleteLattice.Chain +public import Mathlib.Order.CompleteLattice.Defs +public import Mathlib.Order.CompleteLattice.Finset +public import Mathlib.Order.CompleteLattice.Group +public import Mathlib.Order.CompleteLattice.Lemmas +public import Mathlib.Order.CompleteLattice.MulticoequalizerDiagram +public import Mathlib.Order.CompleteLattice.SetLike +public import Mathlib.Order.CompleteLatticeIntervals +public import Mathlib.Order.CompletePartialOrder +public import Mathlib.Order.CompleteSublattice +public import Mathlib.Order.Concept +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.ConditionallyCompleteLattice.Defs +public import Mathlib.Order.ConditionallyCompleteLattice.Finset +public import Mathlib.Order.ConditionallyCompleteLattice.Group +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Order.Copy +public import Mathlib.Order.CountableDenseLinearOrder +public import Mathlib.Order.Cover +public import Mathlib.Order.Defs.LinearOrder +public import Mathlib.Order.Defs.PartialOrder +public import Mathlib.Order.Defs.Unbundled +public import Mathlib.Order.Directed +public import Mathlib.Order.DirectedInverseSystem +public import Mathlib.Order.Disjoint +public import Mathlib.Order.Disjointed +public import Mathlib.Order.Extension.Linear +public import Mathlib.Order.Extension.Well +public import Mathlib.Order.Filter.AtTopBot.Archimedean +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.AtTopBot.BigOperators +public import Mathlib.Order.Filter.AtTopBot.CompleteLattice +public import Mathlib.Order.Filter.AtTopBot.CountablyGenerated +public import Mathlib.Order.Filter.AtTopBot.Defs +public import Mathlib.Order.Filter.AtTopBot.Disjoint +public import Mathlib.Order.Filter.AtTopBot.Field +public import Mathlib.Order.Filter.AtTopBot.Finite +public import Mathlib.Order.Filter.AtTopBot.Finset +public import Mathlib.Order.Filter.AtTopBot.Floor +public import Mathlib.Order.Filter.AtTopBot.Group +public import Mathlib.Order.Filter.AtTopBot.Interval +public import Mathlib.Order.Filter.AtTopBot.Map +public import Mathlib.Order.Filter.AtTopBot.ModEq +public import Mathlib.Order.Filter.AtTopBot.Monoid +public import Mathlib.Order.Filter.AtTopBot.Prod +public import Mathlib.Order.Filter.AtTopBot.Ring +public import Mathlib.Order.Filter.AtTopBot.Tendsto +public import Mathlib.Order.Filter.Bases.Basic +public import Mathlib.Order.Filter.Bases.Finite +public import Mathlib.Order.Filter.Basic +public import Mathlib.Order.Filter.CardinalInter +public import Mathlib.Order.Filter.Cocardinal +public import Mathlib.Order.Filter.Cofinite +public import Mathlib.Order.Filter.CountableInter +public import Mathlib.Order.Filter.CountableSeparatingOn +public import Mathlib.Order.Filter.CountablyGenerated +public import Mathlib.Order.Filter.Curry +public import Mathlib.Order.Filter.Defs +public import Mathlib.Order.Filter.ENNReal +public import Mathlib.Order.Filter.EventuallyConst +public import Mathlib.Order.Filter.Extr +public import Mathlib.Order.Filter.FilterProduct +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Filter.Germ.Basic +public import Mathlib.Order.Filter.Germ.OrderedMonoid +public import Mathlib.Order.Filter.IndicatorFunction +public import Mathlib.Order.Filter.Interval +public import Mathlib.Order.Filter.IsBounded +public import Mathlib.Order.Filter.Ker +public import Mathlib.Order.Filter.Lift +public import Mathlib.Order.Filter.ListTraverse +public import Mathlib.Order.Filter.Map +public import Mathlib.Order.Filter.NAry +public import Mathlib.Order.Filter.Partial +public import Mathlib.Order.Filter.Pi +public import Mathlib.Order.Filter.Pointwise +public import Mathlib.Order.Filter.Prod +public import Mathlib.Order.Filter.Ring +public import Mathlib.Order.Filter.SmallSets +public import Mathlib.Order.Filter.Subsingleton +public import Mathlib.Order.Filter.Tendsto +public import Mathlib.Order.Filter.Ultrafilter.Basic +public import Mathlib.Order.Filter.Ultrafilter.Defs +public import Mathlib.Order.Filter.ZeroAndBoundedAtFilter +public import Mathlib.Order.Fin.Basic +public import Mathlib.Order.Fin.Finset +public import Mathlib.Order.Fin.SuccAboveOrderIso +public import Mathlib.Order.Fin.Tuple +public import Mathlib.Order.FixedPoints +public import Mathlib.Order.GaloisConnection.Basic +public import Mathlib.Order.GaloisConnection.Defs +public import Mathlib.Order.GameAdd +public import Mathlib.Order.Grade +public import Mathlib.Order.Height +public import Mathlib.Order.Heyting.Basic +public import Mathlib.Order.Heyting.Boundary +public import Mathlib.Order.Heyting.Hom +public import Mathlib.Order.Heyting.Regular +public import Mathlib.Order.Hom.Basic +public import Mathlib.Order.Hom.Bounded +public import Mathlib.Order.Hom.BoundedLattice +public import Mathlib.Order.Hom.CompleteLattice +public import Mathlib.Order.Hom.Lattice +public import Mathlib.Order.Hom.Lex +public import Mathlib.Order.Hom.Order +public import Mathlib.Order.Hom.Set +public import Mathlib.Order.Hom.WithTopBot +public import Mathlib.Order.Ideal +public import Mathlib.Order.InitialSeg +public import Mathlib.Order.Interval.Basic +public import Mathlib.Order.Interval.Finset.Basic +public import Mathlib.Order.Interval.Finset.Box +public import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Order.Interval.Finset.DenselyOrdered +public import Mathlib.Order.Interval.Finset.Fin +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Order.Interval.Finset.SuccPred +public import Mathlib.Order.Interval.Lex +public import Mathlib.Order.Interval.Multiset +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Order.Interval.Set.Disjoint +public import Mathlib.Order.Interval.Set.Fin +public import Mathlib.Order.Interval.Set.Final +public import Mathlib.Order.Interval.Set.Image +public import Mathlib.Order.Interval.Set.Infinite +public import Mathlib.Order.Interval.Set.InitialSeg +public import Mathlib.Order.Interval.Set.IsoIoo +public import Mathlib.Order.Interval.Set.Limit +public import Mathlib.Order.Interval.Set.LinearOrder +public import Mathlib.Order.Interval.Set.Monotone +public import Mathlib.Order.Interval.Set.OrdConnected +public import Mathlib.Order.Interval.Set.OrdConnectedComponent +public import Mathlib.Order.Interval.Set.OrdConnectedLinear +public import Mathlib.Order.Interval.Set.OrderEmbedding +public import Mathlib.Order.Interval.Set.OrderIso +public import Mathlib.Order.Interval.Set.Pi +public import Mathlib.Order.Interval.Set.ProjIcc +public import Mathlib.Order.Interval.Set.SuccOrder +public import Mathlib.Order.Interval.Set.SuccPred +public import Mathlib.Order.Interval.Set.SurjOn +public import Mathlib.Order.Interval.Set.Union +public import Mathlib.Order.Interval.Set.UnorderedInterval +public import Mathlib.Order.Interval.Set.WithBotTop +public import Mathlib.Order.Irreducible +public import Mathlib.Order.IsNormal +public import Mathlib.Order.Iterate +public import Mathlib.Order.JordanHolder +public import Mathlib.Order.KonigLemma +public import Mathlib.Order.KrullDimension +public import Mathlib.Order.Lattice +public import Mathlib.Order.Lattice.Congruence +public import Mathlib.Order.LatticeIntervals +public import Mathlib.Order.LiminfLimsup +public import Mathlib.Order.Max +public import Mathlib.Order.MinMax +public import Mathlib.Order.Minimal +public import Mathlib.Order.ModularLattice +public import Mathlib.Order.Monotone.Basic +public import Mathlib.Order.Monotone.Defs +public import Mathlib.Order.Monotone.Extension +public import Mathlib.Order.Monotone.Monovary +public import Mathlib.Order.Monotone.MonovaryOrder +public import Mathlib.Order.Monotone.Odd +public import Mathlib.Order.Monotone.Union +public import Mathlib.Order.Nat +public import Mathlib.Order.Notation +public import Mathlib.Order.Nucleus +public import Mathlib.Order.OmegaCompletePartialOrder +public import Mathlib.Order.OrdContinuous +public import Mathlib.Order.OrderIsoNat +public import Mathlib.Order.PFilter +public import Mathlib.Order.Part +public import Mathlib.Order.PartialSups +public import Mathlib.Order.Partition.Basic +public import Mathlib.Order.Partition.Equipartition +public import Mathlib.Order.Partition.Finpartition +public import Mathlib.Order.PiLex +public import Mathlib.Order.Preorder.Chain +public import Mathlib.Order.Preorder.Finite +public import Mathlib.Order.Preorder.Finsupp +public import Mathlib.Order.PrimeIdeal +public import Mathlib.Order.PrimeSeparator +public import Mathlib.Order.Prod.Lex.Hom +public import Mathlib.Order.PropInstances +public import Mathlib.Order.Radical +public import Mathlib.Order.Rel.GaloisConnection +public import Mathlib.Order.RelClasses +public import Mathlib.Order.RelIso.Basic +public import Mathlib.Order.RelIso.Set +public import Mathlib.Order.RelSeries +public import Mathlib.Order.Restriction +public import Mathlib.Order.ScottContinuity +public import Mathlib.Order.ScottContinuity.Complete +public import Mathlib.Order.ScottContinuity.Prod +public import Mathlib.Order.SemiconjSup +public import Mathlib.Order.Set +public import Mathlib.Order.SetIsMax +public import Mathlib.Order.SetNotation +public import Mathlib.Order.Shrink +public import Mathlib.Order.Sublattice +public import Mathlib.Order.Sublocale +public import Mathlib.Order.SuccPred.Archimedean +public import Mathlib.Order.SuccPred.Basic +public import Mathlib.Order.SuccPred.CompleteLinearOrder +public import Mathlib.Order.SuccPred.InitialSeg +public import Mathlib.Order.SuccPred.IntervalSucc +public import Mathlib.Order.SuccPred.Limit +public import Mathlib.Order.SuccPred.LinearLocallyFinite +public import Mathlib.Order.SuccPred.Relation +public import Mathlib.Order.SuccPred.Tree +public import Mathlib.Order.SuccPred.WithBot +public import Mathlib.Order.SupClosed +public import Mathlib.Order.SupIndep +public import Mathlib.Order.SymmDiff +public import Mathlib.Order.Synonym +public import Mathlib.Order.TeichmullerTukey +public import Mathlib.Order.TransfiniteIteration +public import Mathlib.Order.TypeTags +public import Mathlib.Order.ULift +public import Mathlib.Order.UpperLower.Basic +public import Mathlib.Order.UpperLower.Closure +public import Mathlib.Order.UpperLower.CompleteLattice +public import Mathlib.Order.UpperLower.Fibration +public import Mathlib.Order.UpperLower.Hom +public import Mathlib.Order.UpperLower.LocallyFinite +public import Mathlib.Order.UpperLower.Principal +public import Mathlib.Order.UpperLower.Prod +public import Mathlib.Order.UpperLower.Relative +public import Mathlib.Order.WellFounded +public import Mathlib.Order.WellFoundedSet +public import Mathlib.Order.WellQuasiOrder +public import Mathlib.Order.WithBot +public import Mathlib.Order.Zorn +public import Mathlib.Order.ZornAtoms +public import Mathlib.Probability.BorelCantelli +public import Mathlib.Probability.CDF +public import Mathlib.Probability.CondVar +public import Mathlib.Probability.ConditionalExpectation +public import Mathlib.Probability.ConditionalProbability +public import Mathlib.Probability.Decision.Risk.Basic +public import Mathlib.Probability.Decision.Risk.Defs +public import Mathlib.Probability.Density +public import Mathlib.Probability.Distributions.Beta +public import Mathlib.Probability.Distributions.Exponential +public import Mathlib.Probability.Distributions.Fernique +public import Mathlib.Probability.Distributions.Gamma +public import Mathlib.Probability.Distributions.Gaussian +public import Mathlib.Probability.Distributions.Gaussian.Basic +public import Mathlib.Probability.Distributions.Gaussian.Fernique +public import Mathlib.Probability.Distributions.Gaussian.Real +public import Mathlib.Probability.Distributions.Geometric +public import Mathlib.Probability.Distributions.Pareto +public import Mathlib.Probability.Distributions.Poisson +public import Mathlib.Probability.Distributions.Uniform +public import Mathlib.Probability.HasLaw +public import Mathlib.Probability.HasLawExists +public import Mathlib.Probability.IdentDistrib +public import Mathlib.Probability.Independence.Basic +public import Mathlib.Probability.Independence.BoundedContinuousFunction +public import Mathlib.Probability.Independence.CharacteristicFunction +public import Mathlib.Probability.Independence.Conditional +public import Mathlib.Probability.Independence.InfinitePi +public import Mathlib.Probability.Independence.Integrable +public import Mathlib.Probability.Independence.Integration +public import Mathlib.Probability.Independence.Kernel +public import Mathlib.Probability.Independence.Process +public import Mathlib.Probability.Independence.ZeroOne +public import Mathlib.Probability.Integration +public import Mathlib.Probability.Kernel.Basic +public import Mathlib.Probability.Kernel.CompProdEqIff +public import Mathlib.Probability.Kernel.Composition.AbsolutelyContinuous +public import Mathlib.Probability.Kernel.Composition.Comp +public import Mathlib.Probability.Kernel.Composition.CompMap +public import Mathlib.Probability.Kernel.Composition.CompNotation +public import Mathlib.Probability.Kernel.Composition.CompProd +public import Mathlib.Probability.Kernel.Composition.IntegralCompProd +public import Mathlib.Probability.Kernel.Composition.KernelLemmas +public import Mathlib.Probability.Kernel.Composition.Lemmas +public import Mathlib.Probability.Kernel.Composition.MapComap +public import Mathlib.Probability.Kernel.Composition.MeasureComp +public import Mathlib.Probability.Kernel.Composition.MeasureCompProd +public import Mathlib.Probability.Kernel.Composition.ParallelComp +public import Mathlib.Probability.Kernel.Composition.Prod +public import Mathlib.Probability.Kernel.CondDistrib +public import Mathlib.Probability.Kernel.Condexp +public import Mathlib.Probability.Kernel.Defs +public import Mathlib.Probability.Kernel.Disintegration.Basic +public import Mathlib.Probability.Kernel.Disintegration.CDFToKernel +public import Mathlib.Probability.Kernel.Disintegration.CondCDF +public import Mathlib.Probability.Kernel.Disintegration.Density +public import Mathlib.Probability.Kernel.Disintegration.Integral +public import Mathlib.Probability.Kernel.Disintegration.MeasurableStieltjes +public import Mathlib.Probability.Kernel.Disintegration.StandardBorel +public import Mathlib.Probability.Kernel.Disintegration.Unique +public import Mathlib.Probability.Kernel.Integral +public import Mathlib.Probability.Kernel.Invariance +public import Mathlib.Probability.Kernel.IonescuTulcea.Maps +public import Mathlib.Probability.Kernel.IonescuTulcea.PartialTraj +public import Mathlib.Probability.Kernel.IonescuTulcea.Traj +public import Mathlib.Probability.Kernel.MeasurableIntegral +public import Mathlib.Probability.Kernel.MeasurableLIntegral +public import Mathlib.Probability.Kernel.Posterior +public import Mathlib.Probability.Kernel.Proper +public import Mathlib.Probability.Kernel.RadonNikodym +public import Mathlib.Probability.Kernel.SetIntegral +public import Mathlib.Probability.Kernel.WithDensity +public import Mathlib.Probability.Martingale.Basic +public import Mathlib.Probability.Martingale.BorelCantelli +public import Mathlib.Probability.Martingale.Centering +public import Mathlib.Probability.Martingale.Convergence +public import Mathlib.Probability.Martingale.OptionalSampling +public import Mathlib.Probability.Martingale.OptionalStopping +public import Mathlib.Probability.Martingale.Upcrossing +public import Mathlib.Probability.Moments.Basic +public import Mathlib.Probability.Moments.ComplexMGF +public import Mathlib.Probability.Moments.Covariance +public import Mathlib.Probability.Moments.CovarianceBilin +public import Mathlib.Probability.Moments.CovarianceBilinDual +public import Mathlib.Probability.Moments.IntegrableExpMul +public import Mathlib.Probability.Moments.MGFAnalytic +public import Mathlib.Probability.Moments.SubGaussian +public import Mathlib.Probability.Moments.Tilted +public import Mathlib.Probability.Moments.Variance +public import Mathlib.Probability.Notation +public import Mathlib.Probability.ProbabilityMassFunction.Basic +public import Mathlib.Probability.ProbabilityMassFunction.Binomial +public import Mathlib.Probability.ProbabilityMassFunction.Constructions +public import Mathlib.Probability.ProbabilityMassFunction.Integrals +public import Mathlib.Probability.ProbabilityMassFunction.Monad +public import Mathlib.Probability.Process.Adapted +public import Mathlib.Probability.Process.Filtration +public import Mathlib.Probability.Process.FiniteDimensionalLaws +public import Mathlib.Probability.Process.HittingTime +public import Mathlib.Probability.Process.Kolmogorov +public import Mathlib.Probability.Process.PartitionFiltration +public import Mathlib.Probability.Process.Predictable +public import Mathlib.Probability.Process.Stopping +public import Mathlib.Probability.ProductMeasure +public import Mathlib.Probability.StrongLaw +public import Mathlib.Probability.UniformOn +public import Mathlib.Probability.Variance +public import Mathlib.RepresentationTheory.Basic +public import Mathlib.RepresentationTheory.Character +public import Mathlib.RepresentationTheory.Coinduced +public import Mathlib.RepresentationTheory.Coinvariants +public import Mathlib.RepresentationTheory.FDRep +public import Mathlib.RepresentationTheory.FinGroupCharZero +public import Mathlib.RepresentationTheory.FiniteIndex +public import Mathlib.RepresentationTheory.GroupCohomology.Basic +public import Mathlib.RepresentationTheory.GroupCohomology.Functoriality +public import Mathlib.RepresentationTheory.GroupCohomology.Hilbert90 +public import Mathlib.RepresentationTheory.GroupCohomology.LowDegree +public import Mathlib.RepresentationTheory.GroupCohomology.Resolution +public import Mathlib.RepresentationTheory.Homological.FiniteCyclic +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Functoriality +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Hilbert90 +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LongExactSequence +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Shapiro +public import Mathlib.RepresentationTheory.Homological.GroupHomology.Basic +public import Mathlib.RepresentationTheory.Homological.GroupHomology.FiniteCyclic +public import Mathlib.RepresentationTheory.Homological.GroupHomology.Functoriality +public import Mathlib.RepresentationTheory.Homological.GroupHomology.LongExactSequence +public import Mathlib.RepresentationTheory.Homological.GroupHomology.LowDegree +public import Mathlib.RepresentationTheory.Homological.GroupHomology.Shapiro +public import Mathlib.RepresentationTheory.Homological.Resolution +public import Mathlib.RepresentationTheory.Induced +public import Mathlib.RepresentationTheory.Invariants +public import Mathlib.RepresentationTheory.Maschke +public import Mathlib.RepresentationTheory.Rep +public import Mathlib.RepresentationTheory.Submodule +public import Mathlib.RepresentationTheory.Tannaka +public import Mathlib.RingTheory.AdicCompletion.Algebra +public import Mathlib.RingTheory.AdicCompletion.AsTensorProduct +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.RingTheory.AdicCompletion.Exactness +public import Mathlib.RingTheory.AdicCompletion.Functoriality +public import Mathlib.RingTheory.AdicCompletion.LocalRing +public import Mathlib.RingTheory.AdicCompletion.Noetherian +public import Mathlib.RingTheory.AdicCompletion.RingHom +public import Mathlib.RingTheory.AdicCompletion.Topology +public import Mathlib.RingTheory.Adjoin.Basic +public import Mathlib.RingTheory.Adjoin.Dimension +public import Mathlib.RingTheory.Adjoin.FG +public import Mathlib.RingTheory.Adjoin.FGBaseChange +public import Mathlib.RingTheory.Adjoin.Field +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Adjoin.PowerBasis +public import Mathlib.RingTheory.Adjoin.Tower +public import Mathlib.RingTheory.AdjoinRoot +public import Mathlib.RingTheory.AlgebraTower +public import Mathlib.RingTheory.Algebraic.Basic +public import Mathlib.RingTheory.Algebraic.Cardinality +public import Mathlib.RingTheory.Algebraic.Defs +public import Mathlib.RingTheory.Algebraic.Integral +public import Mathlib.RingTheory.Algebraic.LinearIndependent +public import Mathlib.RingTheory.Algebraic.MvPolynomial +public import Mathlib.RingTheory.Algebraic.Pi +public import Mathlib.RingTheory.AlgebraicIndependent.Adjoin +public import Mathlib.RingTheory.AlgebraicIndependent.AlgebraicClosure +public import Mathlib.RingTheory.AlgebraicIndependent.Basic +public import Mathlib.RingTheory.AlgebraicIndependent.Defs +public import Mathlib.RingTheory.AlgebraicIndependent.RankAndCardinality +public import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis +public import Mathlib.RingTheory.AlgebraicIndependent.Transcendental +public import Mathlib.RingTheory.Artinian.Algebra +public import Mathlib.RingTheory.Artinian.Instances +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.RingTheory.Artinian.Ring +public import Mathlib.RingTheory.Bezout +public import Mathlib.RingTheory.Bialgebra.Basic +public import Mathlib.RingTheory.Bialgebra.Equiv +public import Mathlib.RingTheory.Bialgebra.GroupLike +public import Mathlib.RingTheory.Bialgebra.Hom +public import Mathlib.RingTheory.Bialgebra.MonoidAlgebra +public import Mathlib.RingTheory.Bialgebra.TensorProduct +public import Mathlib.RingTheory.Binomial +public import Mathlib.RingTheory.ChainOfDivisors +public import Mathlib.RingTheory.ClassGroup +public import Mathlib.RingTheory.Coalgebra.Basic +public import Mathlib.RingTheory.Coalgebra.Convolution +public import Mathlib.RingTheory.Coalgebra.Equiv +public import Mathlib.RingTheory.Coalgebra.GroupLike +public import Mathlib.RingTheory.Coalgebra.Hom +public import Mathlib.RingTheory.Coalgebra.MonoidAlgebra +public import Mathlib.RingTheory.Coalgebra.MulOpposite +public import Mathlib.RingTheory.Coalgebra.TensorProduct +public import Mathlib.RingTheory.Complex +public import Mathlib.RingTheory.Conductor +public import Mathlib.RingTheory.Congruence.Basic +public import Mathlib.RingTheory.Congruence.BigOperators +public import Mathlib.RingTheory.Congruence.Defs +public import Mathlib.RingTheory.Congruence.Opposite +public import Mathlib.RingTheory.Coprime.Basic +public import Mathlib.RingTheory.Coprime.Ideal +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.CotangentLocalizationAway +public import Mathlib.RingTheory.DedekindDomain.AdicValuation +public import Mathlib.RingTheory.DedekindDomain.Basic +public import Mathlib.RingTheory.DedekindDomain.Different +public import Mathlib.RingTheory.DedekindDomain.Dvr +public import Mathlib.RingTheory.DedekindDomain.Factorization +public import Mathlib.RingTheory.DedekindDomain.FiniteAdeleRing +public import Mathlib.RingTheory.DedekindDomain.Ideal.Basic +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +public import Mathlib.RingTheory.DedekindDomain.Instances +public import Mathlib.RingTheory.DedekindDomain.IntegralClosure +public import Mathlib.RingTheory.DedekindDomain.LinearDisjoint +public import Mathlib.RingTheory.DedekindDomain.PID +public import Mathlib.RingTheory.DedekindDomain.SInteger +public import Mathlib.RingTheory.DedekindDomain.SelmerGroup +public import Mathlib.RingTheory.Derivation.Basic +public import Mathlib.RingTheory.Derivation.DifferentialRing +public import Mathlib.RingTheory.Derivation.Lie +public import Mathlib.RingTheory.Derivation.MapCoeffs +public import Mathlib.RingTheory.Derivation.ToSquareZero +public import Mathlib.RingTheory.DiscreteValuationRing.Basic +public import Mathlib.RingTheory.DiscreteValuationRing.TFAE +public import Mathlib.RingTheory.Discriminant +public import Mathlib.RingTheory.DividedPowers.Basic +public import Mathlib.RingTheory.DividedPowers.DPMorphism +public import Mathlib.RingTheory.DividedPowers.Padic +public import Mathlib.RingTheory.DividedPowers.RatAlgebra +public import Mathlib.RingTheory.DividedPowers.SubDPIdeal +public import Mathlib.RingTheory.DualNumber +public import Mathlib.RingTheory.EisensteinCriterion +public import Mathlib.RingTheory.EssentialFiniteness +public import Mathlib.RingTheory.Etale.Basic +public import Mathlib.RingTheory.Etale.Field +public import Mathlib.RingTheory.Etale.Kaehler +public import Mathlib.RingTheory.Etale.Pi +public import Mathlib.RingTheory.EuclideanDomain +public import Mathlib.RingTheory.Extension +public import Mathlib.RingTheory.Extension.Basic +public import Mathlib.RingTheory.Extension.Cotangent.Basic +public import Mathlib.RingTheory.Extension.Cotangent.Free +public import Mathlib.RingTheory.Extension.Cotangent.LocalizationAway +public import Mathlib.RingTheory.Extension.Generators +public import Mathlib.RingTheory.Extension.Presentation.Basic +public import Mathlib.RingTheory.Extension.Presentation.Core +public import Mathlib.RingTheory.Extension.Presentation.Submersive +public import Mathlib.RingTheory.FilteredAlgebra.Basic +public import Mathlib.RingTheory.Filtration +public import Mathlib.RingTheory.FiniteLength +public import Mathlib.RingTheory.FinitePresentation +public import Mathlib.RingTheory.FiniteStability +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Finiteness.Bilinear +public import Mathlib.RingTheory.Finiteness.Cardinality +public import Mathlib.RingTheory.Finiteness.Defs +public import Mathlib.RingTheory.Finiteness.Finsupp +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Finiteness.Lattice +public import Mathlib.RingTheory.Finiteness.ModuleFinitePresentation +public import Mathlib.RingTheory.Finiteness.Nakayama +public import Mathlib.RingTheory.Finiteness.Nilpotent +public import Mathlib.RingTheory.Finiteness.Prod +public import Mathlib.RingTheory.Finiteness.Projective +public import Mathlib.RingTheory.Finiteness.Quotient +public import Mathlib.RingTheory.Finiteness.Small +public import Mathlib.RingTheory.Finiteness.Subalgebra +public import Mathlib.RingTheory.Fintype +public import Mathlib.RingTheory.Flat.Basic +public import Mathlib.RingTheory.Flat.CategoryTheory +public import Mathlib.RingTheory.Flat.Domain +public import Mathlib.RingTheory.Flat.Equalizer +public import Mathlib.RingTheory.Flat.EquationalCriterion +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Algebra +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Descent +public import Mathlib.RingTheory.Flat.Localization +public import Mathlib.RingTheory.Flat.Stability +public import Mathlib.RingTheory.Flat.Tensor +public import Mathlib.RingTheory.Flat.TorsionFree +public import Mathlib.RingTheory.FractionalIdeal.Basic +public import Mathlib.RingTheory.FractionalIdeal.Extended +public import Mathlib.RingTheory.FractionalIdeal.Inverse +public import Mathlib.RingTheory.FractionalIdeal.Norm +public import Mathlib.RingTheory.FractionalIdeal.Operations +public import Mathlib.RingTheory.FreeCommRing +public import Mathlib.RingTheory.FreeRing +public import Mathlib.RingTheory.Frobenius +public import Mathlib.RingTheory.Generators +public import Mathlib.RingTheory.GradedAlgebra.Basic +public import Mathlib.RingTheory.GradedAlgebra.FiniteType +public import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal +public import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Submodule +public import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Subsemiring +public import Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization +public import Mathlib.RingTheory.GradedAlgebra.Noetherian +public import Mathlib.RingTheory.GradedAlgebra.Radical +public import Mathlib.RingTheory.Grassmannian +public import Mathlib.RingTheory.HahnSeries.Addition +public import Mathlib.RingTheory.HahnSeries.Basic +public import Mathlib.RingTheory.HahnSeries.HEval +public import Mathlib.RingTheory.HahnSeries.HahnEmbedding +public import Mathlib.RingTheory.HahnSeries.Lex +public import Mathlib.RingTheory.HahnSeries.Multiplication +public import Mathlib.RingTheory.HahnSeries.PowerSeries +public import Mathlib.RingTheory.HahnSeries.Summable +public import Mathlib.RingTheory.HahnSeries.Valuation +public import Mathlib.RingTheory.Henselian +public import Mathlib.RingTheory.HopfAlgebra.Basic +public import Mathlib.RingTheory.HopfAlgebra.GroupLike +public import Mathlib.RingTheory.HopfAlgebra.MonoidAlgebra +public import Mathlib.RingTheory.HopfAlgebra.TensorProduct +public import Mathlib.RingTheory.HopkinsLevitzki +public import Mathlib.RingTheory.Ideal.AssociatedPrime +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Finiteness +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Localization +public import Mathlib.RingTheory.Ideal.Basic +public import Mathlib.RingTheory.Ideal.Basis +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.Ideal.Colon +public import Mathlib.RingTheory.Ideal.Cotangent +public import Mathlib.RingTheory.Ideal.Defs +public import Mathlib.RingTheory.Ideal.GoingDown +public import Mathlib.RingTheory.Ideal.GoingUp +public import Mathlib.RingTheory.Ideal.Height +public import Mathlib.RingTheory.Ideal.IdempotentFG +public import Mathlib.RingTheory.Ideal.Int +public import Mathlib.RingTheory.Ideal.IsPrimary +public import Mathlib.RingTheory.Ideal.IsPrincipal +public import Mathlib.RingTheory.Ideal.IsPrincipalPowQuotient +public import Mathlib.RingTheory.Ideal.KrullsHeightTheorem +public import Mathlib.RingTheory.Ideal.Lattice +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Maximal +public import Mathlib.RingTheory.Ideal.MinimalPrime.Basic +public import Mathlib.RingTheory.Ideal.MinimalPrime.Localization +public import Mathlib.RingTheory.Ideal.NatInt +public import Mathlib.RingTheory.Ideal.Nonunits +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm +public import Mathlib.RingTheory.Ideal.Norm.RelNorm +public import Mathlib.RingTheory.Ideal.Oka +public import Mathlib.RingTheory.Ideal.Operations +public import Mathlib.RingTheory.Ideal.Over +public import Mathlib.RingTheory.Ideal.Pointwise +public import Mathlib.RingTheory.Ideal.Prime +public import Mathlib.RingTheory.Ideal.Prod +public import Mathlib.RingTheory.Ideal.Quotient.Basic +public import Mathlib.RingTheory.Ideal.Quotient.ChineseRemainder +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Ideal.Quotient.Index +public import Mathlib.RingTheory.Ideal.Quotient.Nilpotent +public import Mathlib.RingTheory.Ideal.Quotient.Noetherian +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Ideal.Quotient.PowTransition +public import Mathlib.RingTheory.Ideal.Span +public import Mathlib.RingTheory.Idempotents +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.RingTheory.IntegralClosure.Algebra.Basic +public import Mathlib.RingTheory.IntegralClosure.Algebra.Defs +public import Mathlib.RingTheory.IntegralClosure.IntegralRestrict +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs +public import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic +public import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Defs +public import Mathlib.RingTheory.IntegralDomain +public import Mathlib.RingTheory.Invariant +public import Mathlib.RingTheory.Invariant.Basic +public import Mathlib.RingTheory.Invariant.Defs +public import Mathlib.RingTheory.Invariant.Profinite +public import Mathlib.RingTheory.IsAdjoinRoot +public import Mathlib.RingTheory.IsPrimary +public import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.RingTheory.Jacobson.Artinian +public import Mathlib.RingTheory.Jacobson.Ideal +public import Mathlib.RingTheory.Jacobson.Polynomial +public import Mathlib.RingTheory.Jacobson.Radical +public import Mathlib.RingTheory.Jacobson.Ring +public import Mathlib.RingTheory.Jacobson.Semiprimary +public import Mathlib.RingTheory.Kaehler.Basic +public import Mathlib.RingTheory.Kaehler.CotangentComplex +public import Mathlib.RingTheory.Kaehler.JacobiZariski +public import Mathlib.RingTheory.Kaehler.Polynomial +public import Mathlib.RingTheory.Kaehler.TensorProduct +public import Mathlib.RingTheory.KrullDimension.Basic +public import Mathlib.RingTheory.KrullDimension.Field +public import Mathlib.RingTheory.KrullDimension.LocalRing +public import Mathlib.RingTheory.KrullDimension.Module +public import Mathlib.RingTheory.KrullDimension.NonZeroDivisors +public import Mathlib.RingTheory.KrullDimension.PID +public import Mathlib.RingTheory.KrullDimension.Polynomial +public import Mathlib.RingTheory.KrullDimension.Regular +public import Mathlib.RingTheory.KrullDimension.Zero +public import Mathlib.RingTheory.Lasker +public import Mathlib.RingTheory.LaurentSeries +public import Mathlib.RingTheory.Length +public import Mathlib.RingTheory.LinearDisjoint +public import Mathlib.RingTheory.LittleWedderburn +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.LocalProperties.Exactness +public import Mathlib.RingTheory.LocalProperties.IntegrallyClosed +public import Mathlib.RingTheory.LocalProperties.Projective +public import Mathlib.RingTheory.LocalProperties.Reduced +public import Mathlib.RingTheory.LocalProperties.Semilocal +public import Mathlib.RingTheory.LocalProperties.Submodule +public import Mathlib.RingTheory.LocalRing.Basic +public import Mathlib.RingTheory.LocalRing.Defs +public import Mathlib.RingTheory.LocalRing.LocalSubring +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Defs +public import Mathlib.RingTheory.LocalRing.Module +public import Mathlib.RingTheory.LocalRing.NonLocalRing +public import Mathlib.RingTheory.LocalRing.Quotient +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.LocalRing.ResidueField.Defs +public import Mathlib.RingTheory.LocalRing.ResidueField.Fiber +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.LocalRing.ResidueField.Instances +public import Mathlib.RingTheory.LocalRing.RingHom.Basic +public import Mathlib.RingTheory.LocalRing.Subring +public import Mathlib.RingTheory.Localization.Algebra +public import Mathlib.RingTheory.Localization.AsSubring +public import Mathlib.RingTheory.Localization.AtPrime +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.AtPrime.Extension +public import Mathlib.RingTheory.Localization.Away.AdjoinRoot +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.Localization.Away.Lemmas +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.RingTheory.Localization.Cardinality +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.RingTheory.Localization.Finiteness +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Free +public import Mathlib.RingTheory.Localization.Ideal +public import Mathlib.RingTheory.Localization.Integer +public import Mathlib.RingTheory.Localization.Integral +public import Mathlib.RingTheory.Localization.InvSubmonoid +public import Mathlib.RingTheory.Localization.LocalizationLocalization +public import Mathlib.RingTheory.Localization.Module +public import Mathlib.RingTheory.Localization.NormTrace +public import Mathlib.RingTheory.Localization.NumDen +public import Mathlib.RingTheory.Localization.Pi +public import Mathlib.RingTheory.Localization.Submodule +public import Mathlib.RingTheory.MatrixAlgebra +public import Mathlib.RingTheory.MatrixPolynomialAlgebra +public import Mathlib.RingTheory.Morita.Basic +public import Mathlib.RingTheory.Multiplicity +public import Mathlib.RingTheory.MvPolynomial +public import Mathlib.RingTheory.MvPolynomial.Basic +public import Mathlib.RingTheory.MvPolynomial.EulerIdentity +public import Mathlib.RingTheory.MvPolynomial.FreeCommRing +public import Mathlib.RingTheory.MvPolynomial.Groebner +public import Mathlib.RingTheory.MvPolynomial.Homogeneous +public import Mathlib.RingTheory.MvPolynomial.Ideal +public import Mathlib.RingTheory.MvPolynomial.Localization +public import Mathlib.RingTheory.MvPolynomial.MonomialOrder +public import Mathlib.RingTheory.MvPolynomial.MonomialOrder.DegLex +public import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs +public import Mathlib.RingTheory.MvPolynomial.Symmetric.FundamentalTheorem +public import Mathlib.RingTheory.MvPolynomial.Symmetric.NewtonIdentities +public import Mathlib.RingTheory.MvPolynomial.Tower +public import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous +public import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.RingTheory.MvPowerSeries.Evaluation +public import Mathlib.RingTheory.MvPowerSeries.Inverse +public import Mathlib.RingTheory.MvPowerSeries.LexOrder +public import Mathlib.RingTheory.MvPowerSeries.LinearTopology +public import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors +public import Mathlib.RingTheory.MvPowerSeries.Order +public import Mathlib.RingTheory.MvPowerSeries.PiTopology +public import Mathlib.RingTheory.MvPowerSeries.Substitution +public import Mathlib.RingTheory.MvPowerSeries.Trunc +public import Mathlib.RingTheory.Nakayama +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.RingTheory.Nilpotent.Exp +public import Mathlib.RingTheory.Nilpotent.GeometricallyReduced +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.RingTheory.NoetherNormalization +public import Mathlib.RingTheory.Noetherian.Basic +public import Mathlib.RingTheory.Noetherian.Defs +public import Mathlib.RingTheory.Noetherian.Filter +public import Mathlib.RingTheory.Noetherian.Nilpotent +public import Mathlib.RingTheory.Noetherian.OfPrime +public import Mathlib.RingTheory.Noetherian.Orzech +public import Mathlib.RingTheory.Noetherian.UniqueFactorizationDomain +public import Mathlib.RingTheory.NonUnitalSubring.Basic +public import Mathlib.RingTheory.NonUnitalSubring.Defs +public import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +public import Mathlib.RingTheory.NonUnitalSubsemiring.Defs +public import Mathlib.RingTheory.Norm.Basic +public import Mathlib.RingTheory.Norm.Defs +public import Mathlib.RingTheory.Norm.Transitivity +public import Mathlib.RingTheory.NormTrace +public import Mathlib.RingTheory.NormalClosure +public import Mathlib.RingTheory.Nullstellensatz +public import Mathlib.RingTheory.OrderOfVanishing +public import Mathlib.RingTheory.OreLocalization.Basic +public import Mathlib.RingTheory.OreLocalization.Cardinality +public import Mathlib.RingTheory.OreLocalization.NonZeroDivisors +public import Mathlib.RingTheory.OreLocalization.OreSet +public import Mathlib.RingTheory.OreLocalization.Ring +public import Mathlib.RingTheory.OrzechProperty +public import Mathlib.RingTheory.Perfection +public import Mathlib.RingTheory.Perfectoid.Untilt +public import Mathlib.RingTheory.PiTensorProduct +public import Mathlib.RingTheory.PicardGroup +public import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.RingTheory.Polynomial.Bernstein +public import Mathlib.RingTheory.Polynomial.Chebyshev +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.Polynomial.ContentIdeal +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Factorization +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots +public import Mathlib.RingTheory.Polynomial.DegreeLT +public import Mathlib.RingTheory.Polynomial.Dickson +public import Mathlib.RingTheory.Polynomial.Eisenstein.Basic +public import Mathlib.RingTheory.Polynomial.Eisenstein.Criterion +public import Mathlib.RingTheory.Polynomial.Eisenstein.Distinguished +public import Mathlib.RingTheory.Polynomial.Eisenstein.Generalized +public import Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral +public import Mathlib.RingTheory.Polynomial.GaussLemma +public import Mathlib.RingTheory.Polynomial.GaussNorm +public import Mathlib.RingTheory.Polynomial.Hermite.Basic +public import Mathlib.RingTheory.Polynomial.Hermite.Gaussian +public import Mathlib.RingTheory.Polynomial.HilbertPoly +public import Mathlib.RingTheory.Polynomial.Ideal +public import Mathlib.RingTheory.Polynomial.IntegralNormalization +public import Mathlib.RingTheory.Polynomial.IrreducibleRing +public import Mathlib.RingTheory.Polynomial.IsIntegral +public import Mathlib.RingTheory.Polynomial.Nilpotent +public import Mathlib.RingTheory.Polynomial.Opposites +public import Mathlib.RingTheory.Polynomial.Pochhammer +public import Mathlib.RingTheory.Polynomial.Quotient +public import Mathlib.RingTheory.Polynomial.Radical +public import Mathlib.RingTheory.Polynomial.RationalRoot +public import Mathlib.RingTheory.Polynomial.Resultant.Basic +public import Mathlib.RingTheory.Polynomial.ScaleRoots +public import Mathlib.RingTheory.Polynomial.Selmer +public import Mathlib.RingTheory.Polynomial.SeparableDegree +public import Mathlib.RingTheory.Polynomial.ShiftedLegendre +public import Mathlib.RingTheory.Polynomial.SmallDegreeVieta +public import Mathlib.RingTheory.Polynomial.Tower +public import Mathlib.RingTheory.Polynomial.UniqueFactorization +public import Mathlib.RingTheory.Polynomial.Vieta +public import Mathlib.RingTheory.Polynomial.Wronskian +public import Mathlib.RingTheory.PolynomialAlgebra +public import Mathlib.RingTheory.PolynomialLaw.Basic +public import Mathlib.RingTheory.PowerBasis +public import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.RingTheory.PowerSeries.Binomial +public import Mathlib.RingTheory.PowerSeries.CoeffMulMem +public import Mathlib.RingTheory.PowerSeries.Derivative +public import Mathlib.RingTheory.PowerSeries.Evaluation +public import Mathlib.RingTheory.PowerSeries.GaussNorm +public import Mathlib.RingTheory.PowerSeries.Ideal +public import Mathlib.RingTheory.PowerSeries.Inverse +public import Mathlib.RingTheory.PowerSeries.NoZeroDivisors +public import Mathlib.RingTheory.PowerSeries.Order +public import Mathlib.RingTheory.PowerSeries.PiTopology +public import Mathlib.RingTheory.PowerSeries.Restricted +public import Mathlib.RingTheory.PowerSeries.Substitution +public import Mathlib.RingTheory.PowerSeries.Trunc +public import Mathlib.RingTheory.PowerSeries.WeierstrassPreparation +public import Mathlib.RingTheory.PowerSeries.WellKnown +public import Mathlib.RingTheory.Presentation +public import Mathlib.RingTheory.Prime +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.RingTheory.PrincipalIdealDomainOfPrime +public import Mathlib.RingTheory.QuotSMulTop +public import Mathlib.RingTheory.Radical +public import Mathlib.RingTheory.ReesAlgebra +public import Mathlib.RingTheory.Regular.Category +public import Mathlib.RingTheory.Regular.Depth +public import Mathlib.RingTheory.Regular.Flat +public import Mathlib.RingTheory.Regular.IsSMulRegular +public import Mathlib.RingTheory.Regular.RegularSequence +public import Mathlib.RingTheory.RingHom.Bijective +public import Mathlib.RingTheory.RingHom.Etale +public import Mathlib.RingTheory.RingHom.FaithfullyFlat +public import Mathlib.RingTheory.RingHom.Finite +public import Mathlib.RingTheory.RingHom.FinitePresentation +public import Mathlib.RingTheory.RingHom.FiniteType +public import Mathlib.RingTheory.RingHom.Flat +public import Mathlib.RingTheory.RingHom.Injective +public import Mathlib.RingTheory.RingHom.Integral +public import Mathlib.RingTheory.RingHom.Locally +public import Mathlib.RingTheory.RingHom.OpenImmersion +public import Mathlib.RingTheory.RingHom.Smooth +public import Mathlib.RingTheory.RingHom.StandardSmooth +public import Mathlib.RingTheory.RingHom.Surjective +public import Mathlib.RingTheory.RingHom.Unramified +public import Mathlib.RingTheory.RingHomProperties +public import Mathlib.RingTheory.RingInvo +public import Mathlib.RingTheory.RootsOfUnity.AlgebraicallyClosed +public import Mathlib.RingTheory.RootsOfUnity.Basic +public import Mathlib.RingTheory.RootsOfUnity.Complex +public import Mathlib.RingTheory.RootsOfUnity.CyclotomicUnits +public import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity +public import Mathlib.RingTheory.RootsOfUnity.Lemmas +public import Mathlib.RingTheory.RootsOfUnity.Minpoly +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +public import Mathlib.RingTheory.SimpleModule.Basic +public import Mathlib.RingTheory.SimpleModule.InjectiveProjective +public import Mathlib.RingTheory.SimpleModule.IsAlgClosed +public import Mathlib.RingTheory.SimpleModule.Isotypic +public import Mathlib.RingTheory.SimpleModule.Rank +public import Mathlib.RingTheory.SimpleModule.WedderburnArtin +public import Mathlib.RingTheory.SimpleRing.Basic +public import Mathlib.RingTheory.SimpleRing.Congr +public import Mathlib.RingTheory.SimpleRing.Defs +public import Mathlib.RingTheory.SimpleRing.Field +public import Mathlib.RingTheory.SimpleRing.Matrix +public import Mathlib.RingTheory.SimpleRing.Principal +public import Mathlib.RingTheory.Smooth.Basic +public import Mathlib.RingTheory.Smooth.Kaehler +public import Mathlib.RingTheory.Smooth.Local +public import Mathlib.RingTheory.Smooth.Locus +public import Mathlib.RingTheory.Smooth.Pi +public import Mathlib.RingTheory.Smooth.StandardSmooth +public import Mathlib.RingTheory.Smooth.StandardSmoothCotangent +public import Mathlib.RingTheory.Spectrum.Maximal.Basic +public import Mathlib.RingTheory.Spectrum.Maximal.Defs +public import Mathlib.RingTheory.Spectrum.Maximal.Localization +public import Mathlib.RingTheory.Spectrum.Maximal.Topology +public import Mathlib.RingTheory.Spectrum.Prime.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Chevalley +public import Mathlib.RingTheory.Spectrum.Prime.ChevalleyComplexity +public import Mathlib.RingTheory.Spectrum.Prime.ConstructibleSet +public import Mathlib.RingTheory.Spectrum.Prime.Defs +public import Mathlib.RingTheory.Spectrum.Prime.FreeLocus +public import Mathlib.RingTheory.Spectrum.Prime.Homeomorph +public import Mathlib.RingTheory.Spectrum.Prime.IsOpenComapC +public import Mathlib.RingTheory.Spectrum.Prime.Jacobson +public import Mathlib.RingTheory.Spectrum.Prime.LTSeries +public import Mathlib.RingTheory.Spectrum.Prime.Module +public import Mathlib.RingTheory.Spectrum.Prime.Noetherian +public import Mathlib.RingTheory.Spectrum.Prime.Polynomial +public import Mathlib.RingTheory.Spectrum.Prime.RingHom +public import Mathlib.RingTheory.Spectrum.Prime.TensorProduct +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.RingTheory.Support +public import Mathlib.RingTheory.SurjectiveOnStalks +public import Mathlib.RingTheory.TensorProduct.Basic +public import Mathlib.RingTheory.TensorProduct.DirectLimitFG +public import Mathlib.RingTheory.TensorProduct.Finite +public import Mathlib.RingTheory.TensorProduct.Free +public import Mathlib.RingTheory.TensorProduct.IsBaseChangePi +public import Mathlib.RingTheory.TensorProduct.Maps +public import Mathlib.RingTheory.TensorProduct.MonoidAlgebra +public import Mathlib.RingTheory.TensorProduct.MvPolynomial +public import Mathlib.RingTheory.TensorProduct.Nontrivial +public import Mathlib.RingTheory.TensorProduct.Pi +public import Mathlib.RingTheory.TensorProduct.Quotient +public import Mathlib.RingTheory.Trace.Basic +public import Mathlib.RingTheory.Trace.Defs +public import Mathlib.RingTheory.Trace.Quotient +public import Mathlib.RingTheory.TwoSidedIdeal.Basic +public import Mathlib.RingTheory.TwoSidedIdeal.BigOperators +public import Mathlib.RingTheory.TwoSidedIdeal.Instances +public import Mathlib.RingTheory.TwoSidedIdeal.Kernel +public import Mathlib.RingTheory.TwoSidedIdeal.Lattice +public import Mathlib.RingTheory.TwoSidedIdeal.Operations +public import Mathlib.RingTheory.UniqueFactorizationDomain.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.Defs +public import Mathlib.RingTheory.UniqueFactorizationDomain.FactorSet +public import Mathlib.RingTheory.UniqueFactorizationDomain.Finite +public import Mathlib.RingTheory.UniqueFactorizationDomain.Finsupp +public import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid +public import Mathlib.RingTheory.UniqueFactorizationDomain.Ideal +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity +public import Mathlib.RingTheory.UniqueFactorizationDomain.Nat +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +public import Mathlib.RingTheory.Unramified.Basic +public import Mathlib.RingTheory.Unramified.Field +public import Mathlib.RingTheory.Unramified.Finite +public import Mathlib.RingTheory.Unramified.LocalRing +public import Mathlib.RingTheory.Unramified.Locus +public import Mathlib.RingTheory.Unramified.Pi +public import Mathlib.RingTheory.Valuation.AlgebraInstances +public import Mathlib.RingTheory.Valuation.Archimedean +public import Mathlib.RingTheory.Valuation.Basic +public import Mathlib.RingTheory.Valuation.Discrete.Basic +public import Mathlib.RingTheory.Valuation.DiscreteValuativeRel +public import Mathlib.RingTheory.Valuation.ExtendToLocalization +public import Mathlib.RingTheory.Valuation.Extension +public import Mathlib.RingTheory.Valuation.Integers +public import Mathlib.RingTheory.Valuation.Integral +public import Mathlib.RingTheory.Valuation.IntegrallyClosed +public import Mathlib.RingTheory.Valuation.LocalSubring +public import Mathlib.RingTheory.Valuation.Minpoly +public import Mathlib.RingTheory.Valuation.PrimeMultiplicity +public import Mathlib.RingTheory.Valuation.Quotient +public import Mathlib.RingTheory.Valuation.RamificationGroup +public import Mathlib.RingTheory.Valuation.RankOne +public import Mathlib.RingTheory.Valuation.ValExtension +public import Mathlib.RingTheory.Valuation.ValuationRing +public import Mathlib.RingTheory.Valuation.ValuationSubring +public import Mathlib.RingTheory.Valuation.ValuativeRel +public import Mathlib.RingTheory.Valuation.ValuativeRel.Basic +public import Mathlib.RingTheory.Valuation.ValuativeRel.Trivial +public import Mathlib.RingTheory.WittVector.Basic +public import Mathlib.RingTheory.WittVector.Compare +public import Mathlib.RingTheory.WittVector.Complete +public import Mathlib.RingTheory.WittVector.Defs +public import Mathlib.RingTheory.WittVector.DiscreteValuationRing +public import Mathlib.RingTheory.WittVector.Domain +public import Mathlib.RingTheory.WittVector.Frobenius +public import Mathlib.RingTheory.WittVector.FrobeniusFractionField +public import Mathlib.RingTheory.WittVector.Identities +public import Mathlib.RingTheory.WittVector.InitTail +public import Mathlib.RingTheory.WittVector.IsPoly +public import Mathlib.RingTheory.WittVector.Isocrystal +public import Mathlib.RingTheory.WittVector.MulCoeff +public import Mathlib.RingTheory.WittVector.MulP +public import Mathlib.RingTheory.WittVector.StructurePolynomial +public import Mathlib.RingTheory.WittVector.Teichmuller +public import Mathlib.RingTheory.WittVector.TeichmullerSeries +public import Mathlib.RingTheory.WittVector.Truncated +public import Mathlib.RingTheory.WittVector.Verschiebung +public import Mathlib.RingTheory.WittVector.WittPolynomial +public import Mathlib.RingTheory.ZMod +public import Mathlib.RingTheory.ZMod.Torsion +public import Mathlib.RingTheory.ZMod.UnitsCyclic +public import Mathlib.SetTheory.Cardinal.Aleph +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.SetTheory.Cardinal.Basic +public import Mathlib.SetTheory.Cardinal.Cofinality +public import Mathlib.SetTheory.Cardinal.Continuum +public import Mathlib.SetTheory.Cardinal.CountableCover +public import Mathlib.SetTheory.Cardinal.Defs +public import Mathlib.SetTheory.Cardinal.Divisibility +public import Mathlib.SetTheory.Cardinal.ENat +public import Mathlib.SetTheory.Cardinal.Embedding +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.SetTheory.Cardinal.Finsupp +public import Mathlib.SetTheory.Cardinal.Free +public import Mathlib.SetTheory.Cardinal.HasCardinalLT +public import Mathlib.SetTheory.Cardinal.NatCount +public import Mathlib.SetTheory.Cardinal.Order +public import Mathlib.SetTheory.Cardinal.Ordinal +public import Mathlib.SetTheory.Cardinal.Pigeonhole +public import Mathlib.SetTheory.Cardinal.Regular +public import Mathlib.SetTheory.Cardinal.SchroederBernstein +public import Mathlib.SetTheory.Cardinal.Subfield +public import Mathlib.SetTheory.Cardinal.ToNat +public import Mathlib.SetTheory.Cardinal.UnivLE +public import Mathlib.SetTheory.Descriptive.Tree +public import Mathlib.SetTheory.Game.Basic +public import Mathlib.SetTheory.Game.Birthday +public import Mathlib.SetTheory.Game.Domineering +public import Mathlib.SetTheory.Game.Impartial +public import Mathlib.SetTheory.Game.Nim +public import Mathlib.SetTheory.Game.Ordinal +public import Mathlib.SetTheory.Game.Short +public import Mathlib.SetTheory.Game.State +public import Mathlib.SetTheory.Lists +public import Mathlib.SetTheory.Nimber.Basic +public import Mathlib.SetTheory.Nimber.Field +public import Mathlib.SetTheory.Ordinal.Arithmetic +public import Mathlib.SetTheory.Ordinal.Basic +public import Mathlib.SetTheory.Ordinal.CantorNormalForm +public import Mathlib.SetTheory.Ordinal.Enum +public import Mathlib.SetTheory.Ordinal.Exponential +public import Mathlib.SetTheory.Ordinal.Family +public import Mathlib.SetTheory.Ordinal.FixedPoint +public import Mathlib.SetTheory.Ordinal.FixedPointApproximants +public import Mathlib.SetTheory.Ordinal.NaturalOps +public import Mathlib.SetTheory.Ordinal.Notation +public import Mathlib.SetTheory.Ordinal.Principal +public import Mathlib.SetTheory.Ordinal.Rank +public import Mathlib.SetTheory.Ordinal.Topology +public import Mathlib.SetTheory.Ordinal.Veblen +public import Mathlib.SetTheory.PGame.Algebra +public import Mathlib.SetTheory.PGame.Basic +public import Mathlib.SetTheory.PGame.Order +public import Mathlib.SetTheory.Surreal.Basic +public import Mathlib.SetTheory.Surreal.Dyadic +public import Mathlib.SetTheory.Surreal.Multiplication +public import Mathlib.SetTheory.ZFC.Basic +public import Mathlib.SetTheory.ZFC.Class +public import Mathlib.SetTheory.ZFC.Ordinal +public import Mathlib.SetTheory.ZFC.PSet +public import Mathlib.SetTheory.ZFC.Rank +public import Mathlib.SetTheory.ZFC.VonNeumann +public import Mathlib.Std.Data.HashMap +public import Mathlib.Tactic +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.Algebraize +public import Mathlib.Tactic.ApplyAt +public import Mathlib.Tactic.ApplyCongr +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Tactic.ApplyWith +public import Mathlib.Tactic.ArithMult +public import Mathlib.Tactic.ArithMult.Init +public import Mathlib.Tactic.Attr.Core +public import Mathlib.Tactic.Attr.Register +public import Mathlib.Tactic.Basic +public import Mathlib.Tactic.Bound +public import Mathlib.Tactic.Bound.Attribute +public import Mathlib.Tactic.Bound.Init +public import Mathlib.Tactic.ByCases +public import Mathlib.Tactic.ByContra +public import Mathlib.Tactic.CC +public import Mathlib.Tactic.CC.Addition +public import Mathlib.Tactic.CC.Datatypes +public import Mathlib.Tactic.CC.Lemmas +public import Mathlib.Tactic.CC.MkProof +public import Mathlib.Tactic.CancelDenoms +public import Mathlib.Tactic.CancelDenoms.Core +public import Mathlib.Tactic.Cases +public import Mathlib.Tactic.CasesM +public import Mathlib.Tactic.CategoryTheory.BicategoricalComp +public import Mathlib.Tactic.CategoryTheory.Bicategory.Basic +public import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes +public import Mathlib.Tactic.CategoryTheory.Bicategory.Normalize +public import Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence +public import Mathlib.Tactic.CategoryTheory.BicategoryCoherence +public import Mathlib.Tactic.CategoryTheory.CheckCompositions +public import Mathlib.Tactic.CategoryTheory.Coherence +public import Mathlib.Tactic.CategoryTheory.Coherence.Basic +public import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes +public import Mathlib.Tactic.CategoryTheory.Coherence.Normalize +public import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence +public import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.Tactic.CategoryTheory.IsoReassoc +public import Mathlib.Tactic.CategoryTheory.Monoidal.Basic +public import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +public import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize +public import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence +public import Mathlib.Tactic.CategoryTheory.MonoidalComp +public import Mathlib.Tactic.CategoryTheory.Reassoc +public import Mathlib.Tactic.CategoryTheory.Slice +public import Mathlib.Tactic.CategoryTheory.ToApp +public import Mathlib.Tactic.Change +public import Mathlib.Tactic.Check +public import Mathlib.Tactic.Choose +public import Mathlib.Tactic.Clean +public import Mathlib.Tactic.ClearExcept +public import Mathlib.Tactic.ClearExclamation +public import Mathlib.Tactic.Clear_ +public import Mathlib.Tactic.Coe +public import Mathlib.Tactic.Common +public import Mathlib.Tactic.ComputeDegree +public import Mathlib.Tactic.CongrExclamation +public import Mathlib.Tactic.CongrM +public import Mathlib.Tactic.Constructor +public import Mathlib.Tactic.Continuity +public import Mathlib.Tactic.Continuity.Init +public import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Tactic.Contrapose +public import Mathlib.Tactic.Conv +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Core +public import Mathlib.Tactic.DeclarationNames +public import Mathlib.Tactic.DefEqTransformations +public import Mathlib.Tactic.DepRewrite +public import Mathlib.Tactic.DeprecateTo +public import Mathlib.Tactic.DeriveCountable +public import Mathlib.Tactic.DeriveEncodable +public import Mathlib.Tactic.DeriveFintype +public import Mathlib.Tactic.DeriveTraversable +public import Mathlib.Tactic.ENatToNat +public import Mathlib.Tactic.Eqns +public import Mathlib.Tactic.ErwQuestion +public import Mathlib.Tactic.Eval +public import Mathlib.Tactic.ExistsI +public import Mathlib.Tactic.Explode +public import Mathlib.Tactic.Explode.Datatypes +public import Mathlib.Tactic.Explode.Pretty +public import Mathlib.Tactic.ExtendDoc +public import Mathlib.Tactic.ExtractGoal +public import Mathlib.Tactic.ExtractLets +public import Mathlib.Tactic.FBinop +public import Mathlib.Tactic.FailIfNoProgress +public import Mathlib.Tactic.FastInstance +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.FieldSimp.Attr +public import Mathlib.Tactic.FieldSimp.Discharger +public import Mathlib.Tactic.FieldSimp.Lemmas +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.Find +public import Mathlib.Tactic.FindSyntax +public import Mathlib.Tactic.Finiteness +public import Mathlib.Tactic.Finiteness.Attr +public import Mathlib.Tactic.FunProp +public import Mathlib.Tactic.FunProp.Attr +public import Mathlib.Tactic.FunProp.ContDiff +public import Mathlib.Tactic.FunProp.Core +public import Mathlib.Tactic.FunProp.Decl +public import Mathlib.Tactic.FunProp.Differentiable +public import Mathlib.Tactic.FunProp.Elab +public import Mathlib.Tactic.FunProp.FunctionData +public import Mathlib.Tactic.FunProp.Mor +public import Mathlib.Tactic.FunProp.Theorems +public import Mathlib.Tactic.FunProp.ToBatteries +public import Mathlib.Tactic.FunProp.Types +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.GCongr.Core +public import Mathlib.Tactic.GCongr.CoreAttrs +public import Mathlib.Tactic.GCongr.ForwardAttr +public import Mathlib.Tactic.GRewrite +public import Mathlib.Tactic.GRewrite.Core +public import Mathlib.Tactic.GRewrite.Elab +public import Mathlib.Tactic.Generalize +public import Mathlib.Tactic.GeneralizeProofs +public import Mathlib.Tactic.Group +public import Mathlib.Tactic.GuardGoalNums +public import Mathlib.Tactic.GuardHypNums +public import Mathlib.Tactic.Have +public import Mathlib.Tactic.HaveI +public import Mathlib.Tactic.HigherOrder +public import Mathlib.Tactic.Hint +public import Mathlib.Tactic.ITauto +public import Mathlib.Tactic.InferParam +public import Mathlib.Tactic.Inhabit +public import Mathlib.Tactic.IntervalCases +public import Mathlib.Tactic.IrreducibleDef +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.Lift +public import Mathlib.Tactic.LiftLets +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Linarith.Datatypes +public import Mathlib.Tactic.Linarith.Frontend +public import Mathlib.Tactic.Linarith.Lemmas +public import Mathlib.Tactic.Linarith.Oracle.FourierMotzkin +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Gauss +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.SimplexAlgorithm +public import Mathlib.Tactic.Linarith.Parsing +public import Mathlib.Tactic.Linarith.Preprocessing +public import Mathlib.Tactic.Linarith.Verification +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.LinearCombination' +public import Mathlib.Tactic.LinearCombination.Lemmas +public import Mathlib.Tactic.Linter +public import Mathlib.Tactic.Linter.CommandRanges +public import Mathlib.Tactic.Linter.CommandStart +public import Mathlib.Tactic.Linter.DeprecatedModule +public import Mathlib.Tactic.Linter.DeprecatedSyntaxLinter +public import Mathlib.Tactic.Linter.DirectoryDependency +public import Mathlib.Tactic.Linter.DocPrime +public import Mathlib.Tactic.Linter.DocString +public import Mathlib.Tactic.Linter.FindDeprecations +public import Mathlib.Tactic.Linter.FlexibleLinter +public import Mathlib.Tactic.Linter.GlobalAttributeIn +public import Mathlib.Tactic.Linter.HashCommandLinter +public import Mathlib.Tactic.Linter.HaveLetLinter +public import Mathlib.Tactic.Linter.Header +public import Mathlib.Tactic.Linter.Lint +public import Mathlib.Tactic.Linter.MinImports +public import Mathlib.Tactic.Linter.Multigoal +public import Mathlib.Tactic.Linter.OldObtain +public import Mathlib.Tactic.Linter.PPRoundtrip +public import Mathlib.Tactic.Linter.Style +public import Mathlib.Tactic.Linter.TextBased +public import Mathlib.Tactic.Linter.UnusedTactic +public import Mathlib.Tactic.Linter.UnusedTacticExtension +public import Mathlib.Tactic.Linter.UpstreamableDecl +public import Mathlib.Tactic.Linter.ValidatePRTitle +public import Mathlib.Tactic.Measurability +public import Mathlib.Tactic.Measurability.Init +public import Mathlib.Tactic.MinImports +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Mathlib.Tactic.ModCases +public import Mathlib.Tactic.Module +public import Mathlib.Tactic.Monotonicity +public import Mathlib.Tactic.Monotonicity.Attr +public import Mathlib.Tactic.Monotonicity.Basic +public import Mathlib.Tactic.Monotonicity.Lemmas +public import Mathlib.Tactic.MoveAdd +public import Mathlib.Tactic.NoncommRing +public import Mathlib.Tactic.Nontriviality +public import Mathlib.Tactic.Nontriviality.Core +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.NormNum.Abs +public import Mathlib.Tactic.NormNum.Basic +public import Mathlib.Tactic.NormNum.BigOperators +public import Mathlib.Tactic.NormNum.Core +public import Mathlib.Tactic.NormNum.DivMod +public import Mathlib.Tactic.NormNum.Eq +public import Mathlib.Tactic.NormNum.GCD +public import Mathlib.Tactic.NormNum.Ineq +public import Mathlib.Tactic.NormNum.Inv +public import Mathlib.Tactic.NormNum.Irrational +public import Mathlib.Tactic.NormNum.IsCoprime +public import Mathlib.Tactic.NormNum.LegendreSymbol +public import Mathlib.Tactic.NormNum.ModEq +public import Mathlib.Tactic.NormNum.NatFactorial +public import Mathlib.Tactic.NormNum.NatFib +public import Mathlib.Tactic.NormNum.NatLog +public import Mathlib.Tactic.NormNum.NatSqrt +public import Mathlib.Tactic.NormNum.OfScientific +public import Mathlib.Tactic.NormNum.Ordinal +public import Mathlib.Tactic.NormNum.Parity +public import Mathlib.Tactic.NormNum.Pow +public import Mathlib.Tactic.NormNum.PowMod +public import Mathlib.Tactic.NormNum.Prime +public import Mathlib.Tactic.NormNum.RealSqrt +public import Mathlib.Tactic.NormNum.Result +public import Mathlib.Tactic.NthRewrite +public import Mathlib.Tactic.Observe +public import Mathlib.Tactic.OfNat +public import Mathlib.Tactic.Order +public import Mathlib.Tactic.Order.CollectFacts +public import Mathlib.Tactic.Order.Graph.Basic +public import Mathlib.Tactic.Order.Graph.Tarjan +public import Mathlib.Tactic.Order.Preprocessing +public import Mathlib.Tactic.Order.ToInt +public import Mathlib.Tactic.PNatToNat +public import Mathlib.Tactic.PPWithUniv +public import Mathlib.Tactic.Peel +public import Mathlib.Tactic.Polyrith +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Positivity.Basic +public import Mathlib.Tactic.Positivity.Core +public import Mathlib.Tactic.Positivity.Finset +public import Mathlib.Tactic.ProdAssoc +public import Mathlib.Tactic.Propose +public import Mathlib.Tactic.ProxyType +public import Mathlib.Tactic.Push +public import Mathlib.Tactic.Push.Attr +public import Mathlib.Tactic.Qify +public import Mathlib.Tactic.RSuffices +public import Mathlib.Tactic.Recall +public import Mathlib.Tactic.Recover +public import Mathlib.Tactic.ReduceModChar +public import Mathlib.Tactic.ReduceModChar.Ext +public import Mathlib.Tactic.Relation.Rfl +public import Mathlib.Tactic.Relation.Symm +public import Mathlib.Tactic.Rename +public import Mathlib.Tactic.RenameBVar +public import Mathlib.Tactic.Replace +public import Mathlib.Tactic.RewriteSearch +public import Mathlib.Tactic.Rify +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Ring.Basic +public import Mathlib.Tactic.Ring.Compare +public import Mathlib.Tactic.Ring.NamePolyVars +public import Mathlib.Tactic.Ring.PNat +public import Mathlib.Tactic.Ring.RingNF +public import Mathlib.Tactic.Sat.FromLRAT +public import Mathlib.Tactic.Says +public import Mathlib.Tactic.ScopedNS +public import Mathlib.Tactic.Set +public import Mathlib.Tactic.SetLike +public import Mathlib.Tactic.SimpIntro +public import Mathlib.Tactic.SimpRw +public import Mathlib.Tactic.Simproc.Divisors +public import Mathlib.Tactic.Simproc.ExistsAndEq +public import Mathlib.Tactic.Simproc.Factors +public import Mathlib.Tactic.Simproc.FinsetInterval +public import Mathlib.Tactic.Simps.Basic +public import Mathlib.Tactic.Simps.NotationClass +public import Mathlib.Tactic.SplitIfs +public import Mathlib.Tactic.Spread +public import Mathlib.Tactic.StacksAttribute +public import Mathlib.Tactic.Subsingleton +public import Mathlib.Tactic.Substs +public import Mathlib.Tactic.SuccessIfFailWithMsg +public import Mathlib.Tactic.SudoSetOption +public import Mathlib.Tactic.SuppressCompilation +public import Mathlib.Tactic.SwapVar +public import Mathlib.Tactic.TFAE +public import Mathlib.Tactic.TacticAnalysis +public import Mathlib.Tactic.TacticAnalysis.Declarations +public import Mathlib.Tactic.Tauto +public import Mathlib.Tactic.TautoSet +public import Mathlib.Tactic.TermCongr +public import Mathlib.Tactic.ToAdditive +public import Mathlib.Tactic.ToDual +public import Mathlib.Tactic.ToExpr +public import Mathlib.Tactic.ToLevel +public import Mathlib.Tactic.Trace +public import Mathlib.Tactic.Translate.Core +public import Mathlib.Tactic.Translate.GuessName +public import Mathlib.Tactic.Translate.ToAdditive +public import Mathlib.Tactic.Translate.ToDual +public import Mathlib.Tactic.TryThis +public import Mathlib.Tactic.TypeCheck +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.UnsetOption +public import Mathlib.Tactic.Use +public import Mathlib.Tactic.Variable +public import Mathlib.Tactic.WLOG +public import Mathlib.Tactic.Widget.Calc +public import Mathlib.Tactic.Widget.CommDiag +public import Mathlib.Tactic.Widget.CongrM +public import Mathlib.Tactic.Widget.Conv +public import Mathlib.Tactic.Widget.GCongr +public import Mathlib.Tactic.Widget.InteractiveUnfold +public import Mathlib.Tactic.Widget.LibraryRewrite +public import Mathlib.Tactic.Widget.SelectInsertParamsClass +public import Mathlib.Tactic.Widget.SelectPanelUtils +public import Mathlib.Tactic.Widget.StringDiagram +public import Mathlib.Tactic.WithoutCDot +public import Mathlib.Tactic.Zify +public import Mathlib.Testing.Plausible.Functions +public import Mathlib.Testing.Plausible.Sampleable +public import Mathlib.Testing.Plausible.Testable +public import Mathlib.Topology.AlexandrovDiscrete +public import Mathlib.Topology.Algebra.Affine +public import Mathlib.Topology.Algebra.AffineSubspace +public import Mathlib.Topology.Algebra.Algebra +public import Mathlib.Topology.Algebra.Algebra.Equiv +public import Mathlib.Topology.Algebra.Algebra.Rat +public import Mathlib.Topology.Algebra.AsymptoticCone +public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Basic +public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Limits +public import Mathlib.Topology.Algebra.ClopenNhdofOne +public import Mathlib.Topology.Algebra.ClosedSubgroup +public import Mathlib.Topology.Algebra.ConstMulAction +public import Mathlib.Topology.Algebra.Constructions +public import Mathlib.Topology.Algebra.Constructions.DomMulAct +public import Mathlib.Topology.Algebra.ContinuousAffineEquiv +public import Mathlib.Topology.Algebra.ContinuousAffineMap +public import Mathlib.Topology.Algebra.ContinuousMonoidHom +public import Mathlib.Topology.Algebra.Equicontinuity +public import Mathlib.Topology.Algebra.Field +public import Mathlib.Topology.Algebra.FilterBasis +public import Mathlib.Topology.Algebra.Group.AddTorsor +public import Mathlib.Topology.Algebra.Group.Basic +public import Mathlib.Topology.Algebra.Group.ClosedSubgroup +public import Mathlib.Topology.Algebra.Group.Compact +public import Mathlib.Topology.Algebra.Group.CompactOpen +public import Mathlib.Topology.Algebra.Group.Defs +public import Mathlib.Topology.Algebra.Group.GroupTopology +public import Mathlib.Topology.Algebra.Group.OpenMapping +public import Mathlib.Topology.Algebra.Group.Pointwise +public import Mathlib.Topology.Algebra.Group.Quotient +public import Mathlib.Topology.Algebra.Group.SubmonoidClosure +public import Mathlib.Topology.Algebra.Group.TopologicalAbelianization +public import Mathlib.Topology.Algebra.Group.Units +public import Mathlib.Topology.Algebra.GroupCompletion +public import Mathlib.Topology.Algebra.GroupWithZero +public import Mathlib.Topology.Algebra.Indicator +public import Mathlib.Topology.Algebra.InfiniteSum.Basic +public import Mathlib.Topology.Algebra.InfiniteSum.ConditionalInt +public import Mathlib.Topology.Algebra.InfiniteSum.Constructions +public import Mathlib.Topology.Algebra.InfiniteSum.Defs +public import Mathlib.Topology.Algebra.InfiniteSum.ENNReal +public import Mathlib.Topology.Algebra.InfiniteSum.Field +public import Mathlib.Topology.Algebra.InfiniteSum.Group +public import Mathlib.Topology.Algebra.InfiniteSum.GroupCompletion +public import Mathlib.Topology.Algebra.InfiniteSum.Module +public import Mathlib.Topology.Algebra.InfiniteSum.NatInt +public import Mathlib.Topology.Algebra.InfiniteSum.Nonarchimedean +public import Mathlib.Topology.Algebra.InfiniteSum.Order +public import Mathlib.Topology.Algebra.InfiniteSum.Real +public import Mathlib.Topology.Algebra.InfiniteSum.Ring +public import Mathlib.Topology.Algebra.InfiniteSum.SummationFilter +public import Mathlib.Topology.Algebra.InfiniteSum.TsumUniformlyOn +public import Mathlib.Topology.Algebra.InfiniteSum.UniformOn +public import Mathlib.Topology.Algebra.IntermediateField +public import Mathlib.Topology.Algebra.IsOpenUnits +public import Mathlib.Topology.Algebra.IsUniformGroup.Basic +public import Mathlib.Topology.Algebra.IsUniformGroup.Constructions +public import Mathlib.Topology.Algebra.IsUniformGroup.Defs +public import Mathlib.Topology.Algebra.IsUniformGroup.DiscreteSubgroup +public import Mathlib.Topology.Algebra.IsUniformGroup.Order +public import Mathlib.Topology.Algebra.LinearTopology +public import Mathlib.Topology.Algebra.Localization +public import Mathlib.Topology.Algebra.MetricSpace.Lipschitz +public import Mathlib.Topology.Algebra.Module.Alternating.Basic +public import Mathlib.Topology.Algebra.Module.Alternating.Topology +public import Mathlib.Topology.Algebra.Module.Basic +public import Mathlib.Topology.Algebra.Module.Cardinality +public import Mathlib.Topology.Algebra.Module.CharacterSpace +public import Mathlib.Topology.Algebra.Module.ClosedSubmodule +public import Mathlib.Topology.Algebra.Module.Compact +public import Mathlib.Topology.Algebra.Module.Determinant +public import Mathlib.Topology.Algebra.Module.Equiv +public import Mathlib.Topology.Algebra.Module.FiniteDimension +public import Mathlib.Topology.Algebra.Module.LinearMap +public import Mathlib.Topology.Algebra.Module.LinearMapPiProd +public import Mathlib.Topology.Algebra.Module.LinearPMap +public import Mathlib.Topology.Algebra.Module.LocallyConvex +public import Mathlib.Topology.Algebra.Module.ModuleTopology +public import Mathlib.Topology.Algebra.Module.Multilinear.Basic +public import Mathlib.Topology.Algebra.Module.Multilinear.Bounded +public import Mathlib.Topology.Algebra.Module.Multilinear.Topology +public import Mathlib.Topology.Algebra.Module.PerfectPairing +public import Mathlib.Topology.Algebra.Module.PerfectSpace +public import Mathlib.Topology.Algebra.Module.PointwiseConvergence +public import Mathlib.Topology.Algebra.Module.Simple +public import Mathlib.Topology.Algebra.Module.Star +public import Mathlib.Topology.Algebra.Module.StrongDual +public import Mathlib.Topology.Algebra.Module.StrongTopology +public import Mathlib.Topology.Algebra.Module.UniformConvergence +public import Mathlib.Topology.Algebra.Module.WeakBilin +public import Mathlib.Topology.Algebra.Module.WeakDual +public import Mathlib.Topology.Algebra.Monoid +public import Mathlib.Topology.Algebra.Monoid.AddChar +public import Mathlib.Topology.Algebra.Monoid.Defs +public import Mathlib.Topology.Algebra.Monoid.FunOnFinite +public import Mathlib.Topology.Algebra.MulAction +public import Mathlib.Topology.Algebra.MvPolynomial +public import Mathlib.Topology.Algebra.NonUnitalAlgebra +public import Mathlib.Topology.Algebra.NonUnitalStarAlgebra +public import Mathlib.Topology.Algebra.Nonarchimedean.AdicTopology +public import Mathlib.Topology.Algebra.Nonarchimedean.Bases +public import Mathlib.Topology.Algebra.Nonarchimedean.Basic +public import Mathlib.Topology.Algebra.Nonarchimedean.Completion +public import Mathlib.Topology.Algebra.Nonarchimedean.TotallyDisconnected +public import Mathlib.Topology.Algebra.OpenSubgroup +public import Mathlib.Topology.Algebra.Order.Archimedean +public import Mathlib.Topology.Algebra.Order.ArchimedeanDiscrete +public import Mathlib.Topology.Algebra.Order.Field +public import Mathlib.Topology.Algebra.Order.Floor +public import Mathlib.Topology.Algebra.Order.Group +public import Mathlib.Topology.Algebra.Order.LiminfLimsup +public import Mathlib.Topology.Algebra.Order.Module +public import Mathlib.Topology.Algebra.Order.Support +public import Mathlib.Topology.Algebra.Order.UpperLower +public import Mathlib.Topology.Algebra.Polynomial +public import Mathlib.Topology.Algebra.PontryaginDual +public import Mathlib.Topology.Algebra.ProperAction.AddTorsor +public import Mathlib.Topology.Algebra.ProperAction.Basic +public import Mathlib.Topology.Algebra.ProperAction.ProperlyDiscontinuous +public import Mathlib.Topology.Algebra.ProperConstSMul +public import Mathlib.Topology.Algebra.RestrictedProduct +public import Mathlib.Topology.Algebra.RestrictedProduct.Basic +public import Mathlib.Topology.Algebra.RestrictedProduct.TopologicalSpace +public import Mathlib.Topology.Algebra.Ring.Basic +public import Mathlib.Topology.Algebra.Ring.Compact +public import Mathlib.Topology.Algebra.Ring.Ideal +public import Mathlib.Topology.Algebra.Ring.Real +public import Mathlib.Topology.Algebra.Semigroup +public import Mathlib.Topology.Algebra.SeparationQuotient.Basic +public import Mathlib.Topology.Algebra.SeparationQuotient.FiniteDimensional +public import Mathlib.Topology.Algebra.SeparationQuotient.Hom +public import Mathlib.Topology.Algebra.SeparationQuotient.Section +public import Mathlib.Topology.Algebra.Star +public import Mathlib.Topology.Algebra.Star.Real +public import Mathlib.Topology.Algebra.Star.Unitary +public import Mathlib.Topology.Algebra.StarSubalgebra +public import Mathlib.Topology.Algebra.Support +public import Mathlib.Topology.Algebra.TopologicallyNilpotent +public import Mathlib.Topology.Algebra.UniformConvergence +public import Mathlib.Topology.Algebra.UniformField +public import Mathlib.Topology.Algebra.UniformFilterBasis +public import Mathlib.Topology.Algebra.UniformMulAction +public import Mathlib.Topology.Algebra.UniformRing +public import Mathlib.Topology.Algebra.Valued.LocallyCompact +public import Mathlib.Topology.Algebra.Valued.NormedValued +public import Mathlib.Topology.Algebra.Valued.ValuationTopology +public import Mathlib.Topology.Algebra.Valued.ValuativeRel +public import Mathlib.Topology.Algebra.Valued.ValuedField +public import Mathlib.Topology.Algebra.Valued.WithVal +public import Mathlib.Topology.Algebra.Valued.WithZeroMulInt +public import Mathlib.Topology.Algebra.WithZeroTopology +public import Mathlib.Topology.ApproximateUnit +public import Mathlib.Topology.Baire.BaireMeasurable +public import Mathlib.Topology.Baire.CompleteMetrizable +public import Mathlib.Topology.Baire.Lemmas +public import Mathlib.Topology.Baire.LocallyCompactRegular +public import Mathlib.Topology.Bases +public import Mathlib.Topology.Basic +public import Mathlib.Topology.Bornology.Absorbs +public import Mathlib.Topology.Bornology.Basic +public import Mathlib.Topology.Bornology.BoundedOperation +public import Mathlib.Topology.Bornology.Constructions +public import Mathlib.Topology.Bornology.Hom +public import Mathlib.Topology.Bornology.Real +public import Mathlib.Topology.CWComplex.Abstract.Basic +public import Mathlib.Topology.CWComplex.Classical.Basic +public import Mathlib.Topology.CWComplex.Classical.Finite +public import Mathlib.Topology.CWComplex.Classical.Subcomplex +public import Mathlib.Topology.Category.Born +public import Mathlib.Topology.Category.CompHaus.Basic +public import Mathlib.Topology.Category.CompHaus.EffectiveEpi +public import Mathlib.Topology.Category.CompHaus.Frm +public import Mathlib.Topology.Category.CompHaus.Limits +public import Mathlib.Topology.Category.CompHaus.Projective +public import Mathlib.Topology.Category.CompHausLike.Basic +public import Mathlib.Topology.Category.CompHausLike.EffectiveEpi +public import Mathlib.Topology.Category.CompHausLike.Limits +public import Mathlib.Topology.Category.CompHausLike.SigmaComparison +public import Mathlib.Topology.Category.CompactlyGenerated +public import Mathlib.Topology.Category.Compactum +public import Mathlib.Topology.Category.DeltaGenerated +public import Mathlib.Topology.Category.FinTopCat +public import Mathlib.Topology.Category.LightProfinite.AsLimit +public import Mathlib.Topology.Category.LightProfinite.Basic +public import Mathlib.Topology.Category.LightProfinite.EffectiveEpi +public import Mathlib.Topology.Category.LightProfinite.Extend +public import Mathlib.Topology.Category.LightProfinite.Limits +public import Mathlib.Topology.Category.LightProfinite.Sequence +public import Mathlib.Topology.Category.Locale +public import Mathlib.Topology.Category.Profinite.AsLimit +public import Mathlib.Topology.Category.Profinite.Basic +public import Mathlib.Topology.Category.Profinite.CofilteredLimit +public import Mathlib.Topology.Category.Profinite.EffectiveEpi +public import Mathlib.Topology.Category.Profinite.Extend +public import Mathlib.Topology.Category.Profinite.Limits +public import Mathlib.Topology.Category.Profinite.Nobeling +public import Mathlib.Topology.Category.Profinite.Nobeling.Basic +public import Mathlib.Topology.Category.Profinite.Nobeling.Induction +public import Mathlib.Topology.Category.Profinite.Nobeling.Span +public import Mathlib.Topology.Category.Profinite.Nobeling.Successor +public import Mathlib.Topology.Category.Profinite.Nobeling.ZeroLimit +public import Mathlib.Topology.Category.Profinite.Product +public import Mathlib.Topology.Category.Profinite.Projective +public import Mathlib.Topology.Category.Sequential +public import Mathlib.Topology.Category.Stonean.Adjunctions +public import Mathlib.Topology.Category.Stonean.Basic +public import Mathlib.Topology.Category.Stonean.EffectiveEpi +public import Mathlib.Topology.Category.Stonean.Limits +public import Mathlib.Topology.Category.TopCat.Adjunctions +public import Mathlib.Topology.Category.TopCat.Basic +public import Mathlib.Topology.Category.TopCat.EffectiveEpi +public import Mathlib.Topology.Category.TopCat.EpiMono +public import Mathlib.Topology.Category.TopCat.Limits.Basic +public import Mathlib.Topology.Category.TopCat.Limits.Cofiltered +public import Mathlib.Topology.Category.TopCat.Limits.Konig +public import Mathlib.Topology.Category.TopCat.Limits.Products +public import Mathlib.Topology.Category.TopCat.Limits.Pullbacks +public import Mathlib.Topology.Category.TopCat.OpenNhds +public import Mathlib.Topology.Category.TopCat.Opens +public import Mathlib.Topology.Category.TopCat.Sphere +public import Mathlib.Topology.Category.TopCat.ULift +public import Mathlib.Topology.Category.TopCat.Yoneda +public import Mathlib.Topology.Category.TopCommRingCat +public import Mathlib.Topology.Category.UniformSpace +public import Mathlib.Topology.Clopen +public import Mathlib.Topology.ClopenBox +public import Mathlib.Topology.Closure +public import Mathlib.Topology.ClusterPt +public import Mathlib.Topology.Coherent +public import Mathlib.Topology.CompactOpen +public import Mathlib.Topology.Compactification.OnePoint +public import Mathlib.Topology.Compactification.OnePoint.Basic +public import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine +public import Mathlib.Topology.Compactification.OnePoint.Sphere +public import Mathlib.Topology.Compactification.OnePointEquiv +public import Mathlib.Topology.Compactification.StoneCech +public import Mathlib.Topology.Compactness.Bases +public import Mathlib.Topology.Compactness.Compact +public import Mathlib.Topology.Compactness.CompactlyCoherentSpace +public import Mathlib.Topology.Compactness.CompactlyGeneratedSpace +public import Mathlib.Topology.Compactness.DeltaGeneratedSpace +public import Mathlib.Topology.Compactness.Exterior +public import Mathlib.Topology.Compactness.HilbertCubeEmbedding +public import Mathlib.Topology.Compactness.Lindelof +public import Mathlib.Topology.Compactness.LocallyCompact +public import Mathlib.Topology.Compactness.LocallyFinite +public import Mathlib.Topology.Compactness.NhdsKer +public import Mathlib.Topology.Compactness.Paracompact +public import Mathlib.Topology.Compactness.PseudometrizableLindelof +public import Mathlib.Topology.Compactness.SigmaCompact +public import Mathlib.Topology.Connected.Basic +public import Mathlib.Topology.Connected.Clopen +public import Mathlib.Topology.Connected.LocPathConnected +public import Mathlib.Topology.Connected.LocallyConnected +public import Mathlib.Topology.Connected.PathComponentOne +public import Mathlib.Topology.Connected.PathConnected +public import Mathlib.Topology.Connected.Separation +public import Mathlib.Topology.Connected.TotallyDisconnected +public import Mathlib.Topology.Constructible +public import Mathlib.Topology.Constructions +public import Mathlib.Topology.Constructions.SumProd +public import Mathlib.Topology.Continuous +public import Mathlib.Topology.ContinuousMap.Algebra +public import Mathlib.Topology.ContinuousMap.Basic +public import Mathlib.Topology.ContinuousMap.Bounded.ArzelaAscoli +public import Mathlib.Topology.ContinuousMap.Bounded.Basic +public import Mathlib.Topology.ContinuousMap.Bounded.Normed +public import Mathlib.Topology.ContinuousMap.Bounded.Star +public import Mathlib.Topology.ContinuousMap.BoundedCompactlySupported +public import Mathlib.Topology.ContinuousMap.CocompactMap +public import Mathlib.Topology.ContinuousMap.Compact +public import Mathlib.Topology.ContinuousMap.CompactlySupported +public import Mathlib.Topology.ContinuousMap.ContinuousMapZero +public import Mathlib.Topology.ContinuousMap.ContinuousSqrt +public import Mathlib.Topology.ContinuousMap.Defs +public import Mathlib.Topology.ContinuousMap.Ideals +public import Mathlib.Topology.ContinuousMap.Interval +public import Mathlib.Topology.ContinuousMap.Lattice +public import Mathlib.Topology.ContinuousMap.LocallyConstant +public import Mathlib.Topology.ContinuousMap.LocallyConvex +public import Mathlib.Topology.ContinuousMap.Ordered +public import Mathlib.Topology.ContinuousMap.Periodic +public import Mathlib.Topology.ContinuousMap.Polynomial +public import Mathlib.Topology.ContinuousMap.SecondCountableSpace +public import Mathlib.Topology.ContinuousMap.Sigma +public import Mathlib.Topology.ContinuousMap.Star +public import Mathlib.Topology.ContinuousMap.StarOrdered +public import Mathlib.Topology.ContinuousMap.StoneWeierstrass +public import Mathlib.Topology.ContinuousMap.T0Sierpinski +public import Mathlib.Topology.ContinuousMap.Units +public import Mathlib.Topology.ContinuousMap.Weierstrass +public import Mathlib.Topology.ContinuousMap.ZeroAtInfty +public import Mathlib.Topology.ContinuousOn +public import Mathlib.Topology.Convenient.GeneratedBy +public import Mathlib.Topology.Covering +public import Mathlib.Topology.Defs.Basic +public import Mathlib.Topology.Defs.Filter +public import Mathlib.Topology.Defs.Induced +public import Mathlib.Topology.Defs.Sequences +public import Mathlib.Topology.Defs.Ultrafilter +public import Mathlib.Topology.DenseEmbedding +public import Mathlib.Topology.DerivedSet +public import Mathlib.Topology.DiscreteQuotient +public import Mathlib.Topology.DiscreteSubset +public import Mathlib.Topology.EMetricSpace.Basic +public import Mathlib.Topology.EMetricSpace.BoundedVariation +public import Mathlib.Topology.EMetricSpace.Defs +public import Mathlib.Topology.EMetricSpace.Diam +public import Mathlib.Topology.EMetricSpace.Lipschitz +public import Mathlib.Topology.EMetricSpace.PairReduction +public import Mathlib.Topology.EMetricSpace.Paracompact +public import Mathlib.Topology.EMetricSpace.Pi +public import Mathlib.Topology.ExtendFrom +public import Mathlib.Topology.Exterior +public import Mathlib.Topology.ExtremallyDisconnected +public import Mathlib.Topology.FiberBundle.Basic +public import Mathlib.Topology.FiberBundle.Constructions +public import Mathlib.Topology.FiberBundle.IsHomeomorphicTrivialBundle +public import Mathlib.Topology.FiberBundle.Trivialization +public import Mathlib.Topology.FiberPartition +public import Mathlib.Topology.Filter +public import Mathlib.Topology.GDelta.Basic +public import Mathlib.Topology.GDelta.MetrizableSpace +public import Mathlib.Topology.GDelta.UniformSpace +public import Mathlib.Topology.Germ +public import Mathlib.Topology.Gluing +public import Mathlib.Topology.Hom.ContinuousEval +public import Mathlib.Topology.Hom.ContinuousEvalConst +public import Mathlib.Topology.Hom.Open +public import Mathlib.Topology.Homeomorph.Defs +public import Mathlib.Topology.Homeomorph.Lemmas +public import Mathlib.Topology.Homotopy.Affine +public import Mathlib.Topology.Homotopy.Basic +public import Mathlib.Topology.Homotopy.Contractible +public import Mathlib.Topology.Homotopy.Equiv +public import Mathlib.Topology.Homotopy.HSpaces +public import Mathlib.Topology.Homotopy.HomotopyGroup +public import Mathlib.Topology.Homotopy.Lifting +public import Mathlib.Topology.Homotopy.LocallyContractible +public import Mathlib.Topology.Homotopy.Path +public import Mathlib.Topology.Homotopy.Product +public import Mathlib.Topology.IndicatorConstPointwise +public import Mathlib.Topology.Inseparable +public import Mathlib.Topology.Instances.AddCircle.Defs +public import Mathlib.Topology.Instances.AddCircle.DenseSubgroup +public import Mathlib.Topology.Instances.AddCircle.Real +public import Mathlib.Topology.Instances.CantorSet +public import Mathlib.Topology.Instances.Complex +public import Mathlib.Topology.Instances.Discrete +public import Mathlib.Topology.Instances.ENNReal.Lemmas +public import Mathlib.Topology.Instances.ENat +public import Mathlib.Topology.Instances.EReal.Lemmas +public import Mathlib.Topology.Instances.Int +public import Mathlib.Topology.Instances.Irrational +public import Mathlib.Topology.Instances.Matrix +public import Mathlib.Topology.Instances.NNReal.Lemmas +public import Mathlib.Topology.Instances.Nat +public import Mathlib.Topology.Instances.PNat +public import Mathlib.Topology.Instances.Rat +public import Mathlib.Topology.Instances.RatLemmas +public import Mathlib.Topology.Instances.Real.Lemmas +public import Mathlib.Topology.Instances.RealVectorSpace +public import Mathlib.Topology.Instances.Shrink +public import Mathlib.Topology.Instances.Sign +public import Mathlib.Topology.Instances.TrivSqZeroExt +public import Mathlib.Topology.Instances.ZMod +public import Mathlib.Topology.Instances.ZMultiples +public import Mathlib.Topology.Irreducible +public import Mathlib.Topology.IsClosedRestrict +public import Mathlib.Topology.IsLocalHomeomorph +public import Mathlib.Topology.JacobsonSpace +public import Mathlib.Topology.KrullDimension +public import Mathlib.Topology.List +public import Mathlib.Topology.LocalAtTarget +public import Mathlib.Topology.LocallyClosed +public import Mathlib.Topology.LocallyConstant.Algebra +public import Mathlib.Topology.LocallyConstant.Basic +public import Mathlib.Topology.LocallyFinite +public import Mathlib.Topology.LocallyFinsupp +public import Mathlib.Topology.Maps.Basic +public import Mathlib.Topology.Maps.OpenQuotient +public import Mathlib.Topology.Maps.Proper.Basic +public import Mathlib.Topology.Maps.Proper.CompactlyGenerated +public import Mathlib.Topology.Maps.Proper.UniversallyClosed +public import Mathlib.Topology.MetricSpace.Algebra +public import Mathlib.Topology.MetricSpace.Antilipschitz +public import Mathlib.Topology.MetricSpace.Basic +public import Mathlib.Topology.MetricSpace.Bilipschitz +public import Mathlib.Topology.MetricSpace.Bounded +public import Mathlib.Topology.MetricSpace.BundledFun +public import Mathlib.Topology.MetricSpace.CantorScheme +public import Mathlib.Topology.MetricSpace.CauSeqFilter +public import Mathlib.Topology.MetricSpace.Cauchy +public import Mathlib.Topology.MetricSpace.Closeds +public import Mathlib.Topology.MetricSpace.Completion +public import Mathlib.Topology.MetricSpace.Congruence +public import Mathlib.Topology.MetricSpace.Contracting +public import Mathlib.Topology.MetricSpace.Cover +public import Mathlib.Topology.MetricSpace.Defs +public import Mathlib.Topology.MetricSpace.Dilation +public import Mathlib.Topology.MetricSpace.DilationEquiv +public import Mathlib.Topology.MetricSpace.Equicontinuity +public import Mathlib.Topology.MetricSpace.Gluing +public import Mathlib.Topology.MetricSpace.GromovHausdorff +public import Mathlib.Topology.MetricSpace.GromovHausdorffRealized +public import Mathlib.Topology.MetricSpace.HausdorffAlexandroff +public import Mathlib.Topology.MetricSpace.HausdorffDimension +public import Mathlib.Topology.MetricSpace.HausdorffDistance +public import Mathlib.Topology.MetricSpace.Holder +public import Mathlib.Topology.MetricSpace.HolderNorm +public import Mathlib.Topology.MetricSpace.Infsep +public import Mathlib.Topology.MetricSpace.IsometricSMul +public import Mathlib.Topology.MetricSpace.Isometry +public import Mathlib.Topology.MetricSpace.Kuratowski +public import Mathlib.Topology.MetricSpace.Lipschitz +public import Mathlib.Topology.MetricSpace.MetricSeparated +public import Mathlib.Topology.MetricSpace.PartitionOfUnity +public import Mathlib.Topology.MetricSpace.Perfect +public import Mathlib.Topology.MetricSpace.PiNat +public import Mathlib.Topology.MetricSpace.Polish +public import Mathlib.Topology.MetricSpace.ProperSpace +public import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas +public import Mathlib.Topology.MetricSpace.ProperSpace.Real +public import Mathlib.Topology.MetricSpace.Pseudo.Basic +public import Mathlib.Topology.MetricSpace.Pseudo.Constructions +public import Mathlib.Topology.MetricSpace.Pseudo.Defs +public import Mathlib.Topology.MetricSpace.Pseudo.Lemmas +public import Mathlib.Topology.MetricSpace.Pseudo.Pi +public import Mathlib.Topology.MetricSpace.Pseudo.Real +public import Mathlib.Topology.MetricSpace.Sequences +public import Mathlib.Topology.MetricSpace.ShrinkingLemma +public import Mathlib.Topology.MetricSpace.Similarity +public import Mathlib.Topology.MetricSpace.ThickenedIndicator +public import Mathlib.Topology.MetricSpace.Thickening +public import Mathlib.Topology.MetricSpace.Ultra.Basic +public import Mathlib.Topology.MetricSpace.Ultra.ContinuousMaps +public import Mathlib.Topology.MetricSpace.Ultra.Pi +public import Mathlib.Topology.MetricSpace.Ultra.TotallySeparated +public import Mathlib.Topology.MetricSpace.UniformConvergence +public import Mathlib.Topology.Metrizable.Basic +public import Mathlib.Topology.Metrizable.CompletelyMetrizable +public import Mathlib.Topology.Metrizable.ContinuousMap +public import Mathlib.Topology.Metrizable.Real +public import Mathlib.Topology.Metrizable.Uniformity +public import Mathlib.Topology.Metrizable.Urysohn +public import Mathlib.Topology.NatEmbedding +public import Mathlib.Topology.Neighborhoods +public import Mathlib.Topology.NhdsKer +public import Mathlib.Topology.NhdsSet +public import Mathlib.Topology.NhdsWithin +public import Mathlib.Topology.NoetherianSpace +public import Mathlib.Topology.OmegaCompletePartialOrder +public import Mathlib.Topology.OpenPartialHomeomorph +public import Mathlib.Topology.Order +public import Mathlib.Topology.Order.Basic +public import Mathlib.Topology.Order.Bornology +public import Mathlib.Topology.Order.Category.AlexDisc +public import Mathlib.Topology.Order.Category.FrameAdjunction +public import Mathlib.Topology.Order.Compact +public import Mathlib.Topology.Order.CountableSeparating +public import Mathlib.Topology.Order.DenselyOrdered +public import Mathlib.Topology.Order.ExtendFrom +public import Mathlib.Topology.Order.ExtrClosure +public import Mathlib.Topology.Order.Filter +public import Mathlib.Topology.Order.Hom.Basic +public import Mathlib.Topology.Order.Hom.Esakia +public import Mathlib.Topology.Order.HullKernel +public import Mathlib.Topology.Order.IntermediateValue +public import Mathlib.Topology.Order.IsLUB +public import Mathlib.Topology.Order.IsLocallyClosed +public import Mathlib.Topology.Order.IsNormal +public import Mathlib.Topology.Order.Lattice +public import Mathlib.Topology.Order.LawsonTopology +public import Mathlib.Topology.Order.LeftRight +public import Mathlib.Topology.Order.LeftRightLim +public import Mathlib.Topology.Order.LeftRightNhds +public import Mathlib.Topology.Order.LiminfLimsup +public import Mathlib.Topology.Order.LocalExtr +public import Mathlib.Topology.Order.LowerUpperTopology +public import Mathlib.Topology.Order.Monotone +public import Mathlib.Topology.Order.MonotoneContinuity +public import Mathlib.Topology.Order.MonotoneConvergence +public import Mathlib.Topology.Order.NhdsSet +public import Mathlib.Topology.Order.OrderClosed +public import Mathlib.Topology.Order.OrderClosedExtr +public import Mathlib.Topology.Order.PartialSups +public import Mathlib.Topology.Order.Priestley +public import Mathlib.Topology.Order.ProjIcc +public import Mathlib.Topology.Order.Real +public import Mathlib.Topology.Order.Rolle +public import Mathlib.Topology.Order.ScottTopology +public import Mathlib.Topology.Order.T5 +public import Mathlib.Topology.Order.UpperLowerSetTopology +public import Mathlib.Topology.Order.WithTop +public import Mathlib.Topology.Partial +public import Mathlib.Topology.PartialHomeomorph +public import Mathlib.Topology.PartitionOfUnity +public import Mathlib.Topology.Path +public import Mathlib.Topology.Perfect +public import Mathlib.Topology.Piecewise +public import Mathlib.Topology.PreorderRestrict +public import Mathlib.Topology.QuasiSeparated +public import Mathlib.Topology.Semicontinuous +public import Mathlib.Topology.SeparatedMap +public import Mathlib.Topology.Separation.AlexandrovDiscrete +public import Mathlib.Topology.Separation.Basic +public import Mathlib.Topology.Separation.CompletelyRegular +public import Mathlib.Topology.Separation.Connected +public import Mathlib.Topology.Separation.CountableSeparatingOn +public import Mathlib.Topology.Separation.DisjointCover +public import Mathlib.Topology.Separation.GDelta +public import Mathlib.Topology.Separation.Hausdorff +public import Mathlib.Topology.Separation.Lemmas +public import Mathlib.Topology.Separation.LinearUpperLowerSetTopology +public import Mathlib.Topology.Separation.NotNormal +public import Mathlib.Topology.Separation.Profinite +public import Mathlib.Topology.Separation.Regular +public import Mathlib.Topology.Separation.SeparatedNhds +public import Mathlib.Topology.Sequences +public import Mathlib.Topology.Sets.Closeds +public import Mathlib.Topology.Sets.CompactOpenCovered +public import Mathlib.Topology.Sets.Compacts +public import Mathlib.Topology.Sets.OpenCover +public import Mathlib.Topology.Sets.Opens +public import Mathlib.Topology.Sets.Order +public import Mathlib.Topology.Sheaves.Alexandrov +public import Mathlib.Topology.Sheaves.CommRingCat +public import Mathlib.Topology.Sheaves.Forget +public import Mathlib.Topology.Sheaves.Functors +public import Mathlib.Topology.Sheaves.Init +public import Mathlib.Topology.Sheaves.Limits +public import Mathlib.Topology.Sheaves.LocalPredicate +public import Mathlib.Topology.Sheaves.LocallySurjective +public import Mathlib.Topology.Sheaves.MayerVietoris +public import Mathlib.Topology.Sheaves.Over +public import Mathlib.Topology.Sheaves.PUnit +public import Mathlib.Topology.Sheaves.Presheaf +public import Mathlib.Topology.Sheaves.PresheafOfFunctions +public import Mathlib.Topology.Sheaves.Sheaf +public import Mathlib.Topology.Sheaves.SheafCondition.EqualizerProducts +public import Mathlib.Topology.Sheaves.SheafCondition.OpensLeCover +public import Mathlib.Topology.Sheaves.SheafCondition.PairwiseIntersections +public import Mathlib.Topology.Sheaves.SheafCondition.Sites +public import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing +public import Mathlib.Topology.Sheaves.SheafOfFunctions +public import Mathlib.Topology.Sheaves.Sheafify +public import Mathlib.Topology.Sheaves.Skyscraper +public import Mathlib.Topology.Sheaves.Stalks +public import Mathlib.Topology.ShrinkingLemma +public import Mathlib.Topology.Sober +public import Mathlib.Topology.Specialization +public import Mathlib.Topology.Spectral.Basic +public import Mathlib.Topology.Spectral.Hom +public import Mathlib.Topology.Spectral.Prespectral +public import Mathlib.Topology.StoneCech +public import Mathlib.Topology.TietzeExtension +public import Mathlib.Topology.Ultrafilter +public import Mathlib.Topology.UniformSpace.AbsoluteValue +public import Mathlib.Topology.UniformSpace.AbstractCompletion +public import Mathlib.Topology.UniformSpace.Ascoli +public import Mathlib.Topology.UniformSpace.Basic +public import Mathlib.Topology.UniformSpace.Cauchy +public import Mathlib.Topology.UniformSpace.Compact +public import Mathlib.Topology.UniformSpace.CompactConvergence +public import Mathlib.Topology.UniformSpace.CompareReals +public import Mathlib.Topology.UniformSpace.CompleteSeparated +public import Mathlib.Topology.UniformSpace.Completion +public import Mathlib.Topology.UniformSpace.Defs +public import Mathlib.Topology.UniformSpace.Dini +public import Mathlib.Topology.UniformSpace.DiscreteUniformity +public import Mathlib.Topology.UniformSpace.Equicontinuity +public import Mathlib.Topology.UniformSpace.Equiv +public import Mathlib.Topology.UniformSpace.HeineCantor +public import Mathlib.Topology.UniformSpace.LocallyUniformConvergence +public import Mathlib.Topology.UniformSpace.Matrix +public import Mathlib.Topology.UniformSpace.OfCompactT2 +public import Mathlib.Topology.UniformSpace.OfFun +public import Mathlib.Topology.UniformSpace.Path +public import Mathlib.Topology.UniformSpace.Pi +public import Mathlib.Topology.UniformSpace.ProdApproximation +public import Mathlib.Topology.UniformSpace.Real +public import Mathlib.Topology.UniformSpace.Separation +public import Mathlib.Topology.UniformSpace.Ultra.Basic +public import Mathlib.Topology.UniformSpace.Ultra.Completion +public import Mathlib.Topology.UniformSpace.Ultra.Constructions +public import Mathlib.Topology.UniformSpace.UniformApproximation +public import Mathlib.Topology.UniformSpace.UniformConvergence +public import Mathlib.Topology.UniformSpace.UniformConvergenceTopology +public import Mathlib.Topology.UniformSpace.UniformEmbedding +public import Mathlib.Topology.UnitInterval +public import Mathlib.Topology.UrysohnsBounded +public import Mathlib.Topology.UrysohnsLemma +public import Mathlib.Topology.VectorBundle.Basic +public import Mathlib.Topology.VectorBundle.Constructions +public import Mathlib.Topology.VectorBundle.Hom +public import Mathlib.Topology.VectorBundle.Riemannian +public import Mathlib.Util.AddRelatedDecl +public import Mathlib.Util.AssertExists +public import Mathlib.Util.AssertExistsExt +public import Mathlib.Util.AssertNoSorry +public import Mathlib.Util.AtLocation +public import Mathlib.Util.AtomM +public import Mathlib.Util.AtomM.Recurse +public import Mathlib.Util.CompileInductive +public import Mathlib.Util.CountHeartbeats +public import Mathlib.Util.Delaborators +public import Mathlib.Util.DischargerAsTactic +public import Mathlib.Util.ElabWithoutMVars +public import Mathlib.Util.Export +public import Mathlib.Util.FormatTable +public import Mathlib.Util.GetAllModules +public import Mathlib.Util.LongNames +public import Mathlib.Util.MemoFix +public import Mathlib.Util.Notation3 +public import Mathlib.Util.PPOptions +public import Mathlib.Util.ParseCommand +public import Mathlib.Util.PrintSorries +public import Mathlib.Util.Qq +public import Mathlib.Util.Simp +public import Mathlib.Util.SleepHeartbeats +public import Mathlib.Util.Superscript +public import Mathlib.Util.SynthesizeUsing +public import Mathlib.Util.Tactic +public import Mathlib.Util.TermReduce +public import Mathlib.Util.TransImports +public import Mathlib.Util.WhatsNew +public import Mathlib.Util.WithWeakNamespace + +set_option linter.style.longLine false diff --git a/Mathlib/Algebra/AddConstMap/Basic.lean b/Mathlib/Algebra/AddConstMap/Basic.lean index fd36de4afd65ba..1fb869ed88e9b8 100644 --- a/Mathlib/Algebra/AddConstMap/Basic.lean +++ b/Mathlib/Algebra/AddConstMap/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Group.End -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.Order.Archimedean.Basic +module + +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Group.End +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.Order.Archimedean.Basic /-! # Maps (semi)conjugating a shift to a shift @@ -26,6 +28,8 @@ We use parameters `a` and `b` instead of `1` to accommodate for two use cases: including orientation-reversing maps. -/ +@[expose] public section + assert_not_exists Finset open Function Set diff --git a/Mathlib/Algebra/AddConstMap/Equiv.lean b/Mathlib/Algebra/AddConstMap/Equiv.lean index 98c8d192cd6d12..cb710dcb956f05 100644 --- a/Mathlib/Algebra/AddConstMap/Equiv.lean +++ b/Mathlib/Algebra/AddConstMap/Equiv.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.AddConstMap.Basic +module + +public import Mathlib.Algebra.AddConstMap.Basic /-! # Equivalences conjugating `(· + a)` to `(· + b)` @@ -14,6 +16,8 @@ to be the type of equivalences such that `∀ x, f (x + a) = f x + b`. We also define the corresponding typeclass and prove some basic properties. -/ +@[expose] public section + assert_not_exists Finset open Function diff --git a/Mathlib/Algebra/AddTorsor/Basic.lean b/Mathlib/Algebra/AddTorsor/Basic.lean index e0f82122ba9445..877cc7784d0645 100644 --- a/Mathlib/Algebra/AddTorsor/Basic.lean +++ b/Mathlib/Algebra/AddTorsor/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Yury Kudryashov -/ -import Mathlib.Algebra.AddTorsor.Defs -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Group.End -import Mathlib.Algebra.Group.Pointwise.Set.Scalar +module + +public import Mathlib.Algebra.AddTorsor.Defs +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Group.End +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar /-! # Torsors of additive group actions @@ -16,6 +18,8 @@ Further results for torsors, that are not in `Mathlib/Algebra/AddTorsor/Defs.lea increasing imports there. -/ +@[expose] public section + open scoped Pointwise diff --git a/Mathlib/Algebra/AddTorsor/Defs.lean b/Mathlib/Algebra/AddTorsor/Defs.lean index 08d2b005a90d92..c086e0aa0324a5 100644 --- a/Mathlib/Algebra/AddTorsor/Defs.lean +++ b/Mathlib/Algebra/AddTorsor/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs +module + +public import Mathlib.Algebra.Group.Action.Defs /-! # Torsors of additive group actions @@ -37,6 +39,8 @@ multiplicative group actions). -/ +@[expose] public section + assert_not_exists MonoidWithZero /-- An `AddTorsor G P` gives a structure to the nonempty type `P`, diff --git a/Mathlib/Algebra/Algebra/Basic.lean b/Mathlib/Algebra/Algebra/Basic.lean index 7339a193fc8c72..01bb5ea7de76ce 100644 --- a/Mathlib/Algebra/Algebra/Basic.lean +++ b/Mathlib/Algebra/Algebra/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.Submodule.Ker -import Mathlib.Algebra.Module.Submodule.RestrictScalars -import Mathlib.Algebra.Module.ULift -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Algebra.Ring.Subring.Basic -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Data.Int.CharZero +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.Submodule.Ker +public import Mathlib.Algebra.Module.Submodule.RestrictScalars +public import Mathlib.Algebra.Module.ULift +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Algebra.Ring.Subring.Basic +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Data.Int.CharZero /-! # Further basic results about `Algebra`. @@ -19,6 +21,8 @@ import Mathlib.Data.Int.CharZero This file could usefully be split further. -/ +@[expose] public section + universe u v w u₁ v₁ open Function diff --git a/Mathlib/Algebra/Algebra/Bilinear.lean b/Mathlib/Algebra/Algebra/Bilinear.lean index 2b9c9a5c6ec11d..a21d163361e7d3 100644 --- a/Mathlib/Algebra/Algebra/Bilinear.lean +++ b/Mathlib/Algebra/Algebra/Bilinear.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.LinearAlgebra.TensorProduct.Basic +module + +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.LinearAlgebra.TensorProduct.Basic /-! # Facts about algebras involving bilinear maps and tensor products @@ -14,6 +16,8 @@ in order to avoid importing `LinearAlgebra.BilinearMap` and `LinearAlgebra.TensorProduct` unnecessarily. -/ +@[expose] public section + open TensorProduct Module variable {R A B : Type*} diff --git a/Mathlib/Algebra/Algebra/Defs.lean b/Mathlib/Algebra/Algebra/Defs.lean index 4ee247374396fe..4bfc37f2b05122 100644 --- a/Mathlib/Algebra/Algebra/Defs.lean +++ b/Mathlib/Algebra/Algebra/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Module.LinearMap.Defs +module + +public import Mathlib.Algebra.Module.LinearMap.Defs /-! # Algebras over commutative semirings @@ -80,6 +82,8 @@ the second approach only when you need to weaken a condition on either `R` or `A -/ +@[expose] public section + assert_not_exists Field Finset Module.End universe u v w u₁ v₁ diff --git a/Mathlib/Algebra/Algebra/Equiv.lean b/Mathlib/Algebra/Algebra/Equiv.lean index c6e0e8535a8c90..7208ef6ae8bd4e 100644 --- a/Mathlib/Algebra/Algebra/Equiv.lean +++ b/Mathlib/Algebra/Algebra/Equiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Hom -import Mathlib.Algebra.Ring.Action.Group +module + +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.Algebra.Ring.Action.Group /-! # Isomorphisms of `R`-algebras @@ -20,6 +22,8 @@ This file defines bundled isomorphisms of `R`-algebras. * `A ≃ₐ[R] B` : `R`-algebra equivalence from `A` to `B`. -/ +@[expose] public section + universe u v w u₁ v₁ /-- An equivalence of algebras (denoted as `A ≃ₐ[R] B`) @@ -641,6 +645,8 @@ theorem mul_apply (e₁ e₂ : A₁ ≃ₐ[R] A₁) (x : A₁) : (e₁ * e₂) x lemma aut_inv (ϕ : A₁ ≃ₐ[R] A₁) : ϕ⁻¹ = ϕ.symm := rfl +@[simp] lemma coe_inv (ϕ : A₁ ≃ₐ[R] A₁) : ⇑ϕ⁻¹ = ⇑ϕ.symm := rfl + @[simp] theorem coe_pow (e : A₁ ≃ₐ[R] A₁) (n : ℕ) : ⇑(e ^ n) = e^[n] := n.rec (by ext; simp) fun _ ih ↦ by ext; simp [pow_succ, ih] diff --git a/Mathlib/Algebra/Algebra/Field.lean b/Mathlib/Algebra/Algebra/Field.lean index 1c540cb5d3cc8f..e9805af928ac14 100644 --- a/Mathlib/Algebra/Algebra/Field.lean +++ b/Mathlib/Algebra/Algebra/Field.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Data.Rat.Cast.Defs +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Data.Rat.Cast.Defs /-! # Facts about `algebraMap` when the coefficient ring is a field. -/ +@[expose] public section + namespace algebraMap universe u v w u₁ v₁ diff --git a/Mathlib/Algebra/Algebra/Hom.lean b/Mathlib/Algebra/Algebra/Hom.lean index 532d6790ae1a06..d33539624746df 100644 --- a/Mathlib/Algebra/Algebra/Hom.lean +++ b/Mathlib/Algebra/Algebra/Hom.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Basic +module + +public import Mathlib.Algebra.Algebra.Basic /-! # Homomorphisms of `R`-algebras @@ -20,6 +22,8 @@ This file defines bundled homomorphisms of `R`-algebras. * `A →ₐ[R] B` : `R`-algebra homomorphism from `A` to `B`. -/ +@[expose] public section + universe u v w u₁ v₁ /-- Defining the homomorphism in the category R-Alg, denoted `A →ₐ[R] B`. -/ diff --git a/Mathlib/Algebra/Algebra/Hom/Rat.lean b/Mathlib/Algebra/Algebra/Hom/Rat.lean index 75dc61c255c91f..1c9f1a564452cf 100644 --- a/Mathlib/Algebra/Algebra/Hom/Rat.lean +++ b/Mathlib/Algebra/Algebra/Hom/Rat.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Hom -import Mathlib.Algebra.Algebra.Rat +module + +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.Algebra.Algebra.Rat /-! # Homomorphisms of `ℚ`-algebras -/ +@[expose] public section + namespace RingHom diff --git a/Mathlib/Algebra/Algebra/IsSimpleRing.lean b/Mathlib/Algebra/Algebra/IsSimpleRing.lean index ad9ff3fc0b001a..a94c5954c95a43 100644 --- a/Mathlib/Algebra/Algebra/IsSimpleRing.lean +++ b/Mathlib/Algebra/Algebra/IsSimpleRing.lean @@ -3,14 +3,17 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Eric Wieser -/ +module -import Mathlib.Algebra.Algebra.Basic -import Mathlib.RingTheory.SimpleRing.Basic +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Facts about algebras when the coefficient ring is a simple ring -/ +@[expose] public section + variable (R A : Type*) [CommRing R] [Semiring A] [Algebra R A] [IsSimpleRing R] [Nontrivial A] instance : FaithfulSMul R A := diff --git a/Mathlib/Algebra/Algebra/NonUnitalHom.lean b/Mathlib/Algebra/Algebra/NonUnitalHom.lean index 37642fa7d8255d..d3986be73bd13b 100644 --- a/Mathlib/Algebra/Algebra/NonUnitalHom.lean +++ b/Mathlib/Algebra/Algebra/NonUnitalHom.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Algebra.Hom -import Mathlib.Algebra.GroupWithZero.Action.Prod +module + +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.Algebra.GroupWithZero.Action.Prod /-! # Morphisms of non-unital algebras @@ -42,6 +44,8 @@ TODO: add `NonUnitalAlgEquiv` when needed. non-unital, algebra, morphism -/ +@[expose] public section + universe u u₁ v w w₁ w₂ w₃ variable {R : Type u} {S : Type u₁} diff --git a/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean b/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean index 9cb4bcbd2cffc8..74555f5f445ac7 100644 --- a/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean +++ b/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.Data.Set.UnionLift -import Mathlib.LinearAlgebra.Span.Basic -import Mathlib.RingTheory.NonUnitalSubring.Basic +module + +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.Data.Set.UnionLift +public import Mathlib.LinearAlgebra.Span.Basic +public import Mathlib.RingTheory.NonUnitalSubring.Basic /-! # Non-unital Subalgebras over Commutative Semirings @@ -19,6 +21,8 @@ In this file we define `NonUnitalSubalgebra`s and the usual operations on them ( non-unital subalgebra on the larger algebra. -/ +@[expose] public section + universe u u' v v' w w' section NonUnitalSubalgebraClass diff --git a/Mathlib/Algebra/Algebra/Operations.lean b/Mathlib/Algebra/Algebra/Operations.lean index 40be3beb5efa9c..0b41545549fc4b 100644 --- a/Mathlib/Algebra/Algebra/Operations.lean +++ b/Mathlib/Algebra/Algebra/Operations.lean @@ -3,15 +3,17 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Algebra.Algebra.Opposite -import Mathlib.Algebra.Group.Pointwise.Finset.Basic -import Mathlib.Algebra.Group.Pointwise.Set.BigOperators -import Mathlib.Algebra.Module.Submodule.Pointwise -import Mathlib.Algebra.Ring.NonZeroDivisors -import Mathlib.Algebra.Ring.Submonoid.Pointwise -import Mathlib.Data.Set.Semiring -import Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Algebra.Algebra.Opposite +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.BigOperators +public import Mathlib.Algebra.Module.Submodule.Pointwise +public import Mathlib.Algebra.Ring.NonZeroDivisors +public import Mathlib.Algebra.Ring.Submonoid.Pointwise +public import Mathlib.Data.Set.Semiring +public import Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise /-! # Multiplication and division of submodules of an algebra. @@ -43,6 +45,8 @@ by `ringHomEquivModuleIsScalarTower`), we can still define `1 : Submodule R A` a multiplication of submodules, division of submodules, submodule semiring -/ +@[expose] public section + universe uι u v diff --git a/Mathlib/Algebra/Algebra/Opposite.lean b/Mathlib/Algebra/Algebra/Opposite.lean index 982992dccc517a..d9099b935aeaef 100644 --- a/Mathlib/Algebra/Algebra/Opposite.lean +++ b/Mathlib/Algebra/Algebra/Opposite.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Module.Opposite -import Mathlib.Algebra.Ring.Opposite +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.Algebra.Ring.Opposite /-! # Algebra structures on the multiplicative opposite @@ -24,6 +26,8 @@ import Mathlib.Algebra.Ring.Opposite * `AlgEquiv.opComm`: swap which side of an isomorphism lies in the opposite algebra. -/ +@[expose] public section + variable {R S A B : Type*} diff --git a/Mathlib/Algebra/Algebra/Pi.lean b/Mathlib/Algebra/Algebra/Pi.lean index df383bbefd1d39..e8657e7c1d860e 100644 --- a/Mathlib/Algebra/Algebra/Pi.lean +++ b/Mathlib/Algebra/Algebra/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Algebra.Opposite -import Mathlib.Algebra.Algebra.Prod +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Algebra.Opposite +public import Mathlib.Algebra.Algebra.Prod /-! # The R-algebra structure on families of R-algebras @@ -19,6 +21,8 @@ The R-algebra structure on `Π i : I, A i` when each `A i` is an R-algebra. * `Pi.constAlgHom` -/ +@[expose] public section + namespace Pi -- The indexing type diff --git a/Mathlib/Algebra/Algebra/Prod.lean b/Mathlib/Algebra/Algebra/Prod.lean index 0dbd736a0f0cf4..46058dff5af82d 100644 --- a/Mathlib/Algebra/Algebra/Prod.lean +++ b/Mathlib/Algebra/Algebra/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Algebra.Hom -import Mathlib.Algebra.Module.Prod +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.Algebra.Module.Prod /-! # The R-algebra structure on products of R-algebras @@ -21,6 +23,8 @@ The R-algebra structure on `(i : I) → A i` when each `A i` is an R-algebra. * `AlgEquiv.prodUnique` and `AlgEquiv.uniqueProd` -/ +@[expose] public section + variable {R A B C : Type*} variable [CommSemiring R] diff --git a/Mathlib/Algebra/Algebra/Rat.lean b/Mathlib/Algebra/Algebra/Rat.lean index 49509e7226a8a3..6d8d574fcb5e01 100644 --- a/Mathlib/Algebra/Algebra/Rat.lean +++ b/Mathlib/Algebra/Algebra/Rat.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Data.Rat.Cast.CharZero +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Data.Rat.Cast.CharZero /-! # Further basic results about `Algebra`'s over `ℚ`. @@ -13,6 +15,8 @@ import Mathlib.Data.Rat.Cast.CharZero This file could usefully be split further. -/ +@[expose] public section + assert_not_exists Subgroup variable {F R S : Type*} diff --git a/Mathlib/Algebra/Algebra/RestrictScalars.lean b/Mathlib/Algebra/Algebra/RestrictScalars.lean index 6d8d77b354eaf9..7594d7da0a0677 100644 --- a/Mathlib/Algebra/Algebra/RestrictScalars.lean +++ b/Mathlib/Algebra/Algebra/RestrictScalars.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Tower +module + +public import Mathlib.Algebra.Algebra.Tower /-! @@ -38,6 +40,8 @@ refer to restricting the scalar type in a bundled type, such as from `A →ₗ[R * `Subalgebra.restrictScalars` -/ +@[expose] public section + variable (R S M A : Type*) diff --git a/Mathlib/Algebra/Algebra/Shrink.lean b/Mathlib/Algebra/Algebra/Shrink.lean index c3a00fcec8f393..d9fa2e7bd84a67 100644 --- a/Mathlib/Algebra/Algebra/Shrink.lean +++ b/Mathlib/Algebra/Algebra/Shrink.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.TransferInstance -import Mathlib.Algebra.Ring.Shrink +module + +public import Mathlib.Algebra.Algebra.TransferInstance +public import Mathlib.Algebra.Ring.Shrink /-! # Transfer module and algebra structures from `α` to `Shrink α` -/ +@[expose] public section + noncomputable section universe v diff --git a/Mathlib/Algebra/Algebra/Spectrum/Basic.lean b/Mathlib/Algebra/Algebra/Spectrum/Basic.lean index 549614e7cbcace..b07f38ee1e9611 100644 --- a/Mathlib/Algebra/Algebra/Spectrum/Basic.lean +++ b/Mathlib/Algebra/Algebra/Spectrum/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.Star.Pointwise -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Nonunits -import Mathlib.Tactic.NoncommRing +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.Star.Pointwise +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Nonunits +public import Mathlib.Tactic.NoncommRing /-! # Spectrum of an element in an algebra @@ -38,6 +40,8 @@ This theory will serve as the foundation for spectral theory in Banach algebras. * `σ a` : `spectrum R a` of `a : A` -/ +@[expose] public section + open Set diff --git a/Mathlib/Algebra/Algebra/Spectrum/Pi.lean b/Mathlib/Algebra/Algebra/Spectrum/Pi.lean index aa626aca013722..1d02f55cde2992 100644 --- a/Mathlib/Algebra/Algebra/Spectrum/Pi.lean +++ b/Mathlib/Algebra/Algebra/Spectrum/Pi.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Group.Pi.Units +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Group.Pi.Units /-! # Spectrum and quasispectrum of products @@ -29,6 +30,8 @@ union of the (quasi)spectra. -/ +@[expose] public section + variable {ι A B R : Type*} {κ : ι → Type*} section quasiregular diff --git a/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean b/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean index ba8b106dae0195..397e5c74ba7c44 100644 --- a/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean +++ b/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Basic -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Algebra.Unitization +module + +public import Mathlib.Algebra.Algebra.Spectrum.Basic +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Algebra.Unitization /-! # Quasiregularity and quasispectrum @@ -59,6 +61,8 @@ In Mathlib, the quasispectrum is the domain of the continuous functions associat `A` is precisely the spectrum of `a` in `Unitization R A` (via the coercion `Unitization.inr`). -/ +@[expose] public section + /-- A type synonym for non-unital rings where an alternative monoid structure is introduced. If `R` is a non-unital semiring, then `PreQuasiregular R` is equipped with the monoid structure with binary operation `fun x y ↦ y + x + x * y` and identity `0`. Elements of `R` which are diff --git a/Mathlib/Algebra/Algebra/StrictPositivity.lean b/Mathlib/Algebra/Algebra/StrictPositivity.lean index cad1aae3bcab09..fa8be79323c2a1 100644 --- a/Mathlib/Algebra/Algebra/StrictPositivity.lean +++ b/Mathlib/Algebra/Algebra/StrictPositivity.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Tactic.ContinuousFunctionalCalculus /-! # Strictly positive elements of an algebra @@ -28,6 +29,8 @@ Thus, it is best to avoid unfolding the definition and only use the API provided + Generalize the definition to non-unital algebras. -/ +@[expose] public section + /-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible. NOTE: This definition will be generalized to the non-unital case in the future; do not unfold diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean b/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean index 11ebbd1a2b6845..47a8102591c017 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Algebra.NonUnitalSubalgebra -import Mathlib.RingTheory.SimpleRing.Basic +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Algebra.NonUnitalSubalgebra +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Subalgebras over Commutative Semiring @@ -16,6 +18,8 @@ The `Algebra.adjoin` operation and complete lattice structure can be found in `Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean`. -/ +@[expose] public section + universe u u' v w w' /-- A subalgebra is a sub(semi)ring that includes the range of `algebraMap`. -/ diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Centralizer.lean b/Mathlib/Algebra/Algebra/Subalgebra/Centralizer.lean index dd9bd56520cd3f..6b054d53ceb553 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Centralizer.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Centralizer.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.LinearAlgebra.TensorProduct.Basis -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.LinearAlgebra.TensorProduct.Basis +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Properties of centers and centralizers @@ -22,6 +24,8 @@ Let `R` be a commutative ring and `A` and `B` two `R`-algebras. then the centralizer of `1 ⊗ B` in `A ⊗ B` is `A ⊗ C(B)` where `C(B)` is the center of `B`. -/ +@[expose] public section + namespace Subalgebra open Algebra.TensorProduct diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean b/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean index bc750cc73b0c58..0378da85794a22 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean @@ -3,9 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Data.Set.UnionLift +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Data.Set.UnionLift /-! # Subalgebras and directed Unions of sets @@ -17,6 +18,8 @@ import Mathlib.Data.Set.UnionLift defining it on each subalgebra, and proving that it agrees on the intersection of subalgebras. -/ +@[expose] public section + namespace Subalgebra open Algebra diff --git a/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean b/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean index 6b4e1753aac23c..af99097ea7fc79 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.LinearAlgebra.FiniteDimensional.Basic -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +module + +public import Mathlib.LinearAlgebra.FiniteDimensional.Basic +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition /-! If `A` is a domain, and a finite-dimensional algebra over a field `F`, with prime dimension, then there are no non-trivial `F`-subalgebras. -/ +@[expose] public section + open Module Submodule theorem Subalgebra.isSimpleOrder_of_finrank_prime (F A) [Field F] [Ring A] [IsDomain A] diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean b/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean index 2379de8c101932..0e43c28af0e901 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Algebra.Subalgebra.Basic +module + +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Algebra.Subalgebra.Basic /-! # Complete lattice structure of subalgebras @@ -14,6 +16,8 @@ In this file we define `Algebra.adjoin` and the complete lattice structure on su More lemmas about `adjoin` can be found in `Mathlib/RingTheory/Adjoin/Basic.lean`. -/ +@[expose] public section + assert_not_exists Polynomial universe u u' v w w' diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Matrix.lean b/Mathlib/Algebra/Algebra/Subalgebra/Matrix.lean index c8d0ba15f94c6d..026750942f3d54 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Matrix.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Matrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Bryan Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bryan Wang -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Diagonal -import Mathlib.Algebra.Algebra.Subalgebra.Basic +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Diagonal +public import Mathlib.Algebra.Algebra.Subalgebra.Basic /-! # Matrix subalgebras @@ -17,6 +19,8 @@ In this file we define the subalgebra of square matrices with entries in some su * `Subalgebra.matrix`: the subalgebra of square matrices with entries in some subalgebra. -/ +@[expose] public section + open Matrix open Algebra diff --git a/Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean b/Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean index 55fb65b0bf6875..81af25fb03a6d0 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Ring.Subring.MulOpposite +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Ring.Subring.MulOpposite /-! @@ -15,6 +17,8 @@ subalgebras of `A / R` and that of `Aᵐᵒᵖ / R`. -/ +@[expose] public section + namespace Subalgebra section Semiring diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Operations.lean b/Mathlib/Algebra/Algebra/Subalgebra/Operations.lean index 4d79b5812bdde7..f7c9efb18e9177 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Operations.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Operations.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Antoine Chambert-Loir -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.Algebra.Ring.Action.Submonoid +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.Algebra.Ring.Action.Submonoid /-! # More operations on subalgebras @@ -16,6 +18,8 @@ The contents of this file are somewhat random since both somewhat of a grab-bag of definitions, and this is whatever ends up in the intersection. -/ +@[expose] public section + assert_not_exists Cardinal namespace AlgHom diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Order.lean b/Mathlib/Algebra/Algebra/Subalgebra/Order.lean index b0002a14b9cf39..3a1cedf014533e 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Order.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Order.lean @@ -3,15 +3,18 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.Module.Submodule.Order -import Mathlib.Algebra.Ring.Subsemiring.Order +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.Module.Submodule.Order +public import Mathlib.Algebra.Ring.Subsemiring.Order /-! # Order instances on subalgebras -/ +@[expose] public section + namespace Subalgebra variable {R A : Type*} diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Pi.lean b/Mathlib/Algebra/Algebra/Subalgebra/Pi.lean index 1f6fa66fd31865..b8e33329534963 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Pi.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.LinearAlgebra.Pi +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.LinearAlgebra.Pi /-! # Products of subalgebras @@ -17,6 +19,8 @@ In this file we define the product of subalgebras as a subalgebra of the product * `Subalgebra.pi`: the product of subalgebras. -/ +@[expose] public section + open Algebra namespace Subalgebra diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean b/Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean index 91efda06f8674e..38b998cec76a8e 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Weiser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Ring.Subring.Pointwise +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Ring.Subring.Pointwise /-! # Pointwise actions on subalgebras. @@ -13,6 +15,8 @@ If `R'` acts on an `R`-algebra `A` (so that `R'` and `R` actions commute) then we get an `R'` action on the collection of `R`-subalgebras. -/ +@[expose] public section + namespace Subalgebra diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Prod.lean b/Mathlib/Algebra/Algebra/Subalgebra/Prod.lean index 5d1a273144a9c3..78e639602686b7 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Prod.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Algebra.Subalgebra.Lattice +module + +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice /-! # Products of subalgebras @@ -16,6 +18,8 @@ In this file we define the product of two subalgebras as a subalgebra of the pro * `Subalgebra.prod`: the product of two subalgebras. -/ +@[expose] public section + namespace Subalgebra diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean b/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean index fc4388bdd8a465..2b44e89c38d4e6 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.LinearAlgebra.Dimension.Free -import Mathlib.LinearAlgebra.Dimension.Subsingleton -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +module + +public import Mathlib.LinearAlgebra.Dimension.Free +public import Mathlib.LinearAlgebra.Dimension.Subsingleton +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition /-! @@ -18,6 +20,8 @@ satisfies the strong rank condition, we put them into a separate file. -/ +@[expose] public section + open Module namespace Subalgebra diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Tower.lean b/Mathlib/Algebra/Algebra/Subalgebra/Tower.lean index f4db0a6623677b..0a551eaec5beaa 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Tower.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Tower.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Anne Baanen -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Algebra.Tower +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Algebra.Tower /-! # Subalgebras in towers of algebras @@ -26,6 +28,8 @@ compatibility condition `(r • s) • a = r • (s • a)`. -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Unitization.lean b/Mathlib/Algebra/Algebra/Subalgebra/Unitization.lean index 240e1a3ef544ab..218f6555b58deb 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Unitization.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Unitization.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Unitization -import Mathlib.Algebra.Star.Subalgebra -import Mathlib.GroupTheory.GroupAction.Ring +module + +public import Mathlib.Algebra.Algebra.Unitization +public import Mathlib.Algebra.Star.Subalgebra +public import Mathlib.GroupTheory.GroupAction.Ring /-! # Relating unital and non-unital substructures @@ -43,6 +45,8 @@ this map to be injective it suffices that the range omits `1`. In this setting w a version of `NonUnitalSubalgebra.unitizationAlgEquiv` for star algebras. -/ +@[expose] public section + /-! ## Subalgebras -/ namespace Unitization diff --git a/Mathlib/Algebra/Algebra/Tower.lean b/Mathlib/Algebra/Algebra/Tower.lean index 0414a5f1b11d61..44948e05598dd7 100644 --- a/Mathlib/Algebra/Algebra/Tower.lean +++ b/Mathlib/Algebra/Algebra/Tower.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Anne Baanen -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.LinearAlgebra.Span.Basic /-! # Towers of algebras @@ -19,6 +21,8 @@ An important definition is `toAlgHom R S A`, the canonical `R`-algebra homomorph -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/Algebra/Algebra/TransferInstance.lean b/Mathlib/Algebra/Algebra/TransferInstance.lean index 59408dc0ce31ab..adf5cbca9a0082 100644 --- a/Mathlib/Algebra/Algebra/TransferInstance.lean +++ b/Mathlib/Algebra/Algebra/TransferInstance.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Ring.TransferInstance +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Ring.TransferInstance /-! # Transfer algebraic structures across `Equiv`s @@ -12,6 +14,8 @@ import Mathlib.Algebra.Ring.TransferInstance This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + universe v variable {R α β : Type*} [CommSemiring R] diff --git a/Mathlib/Algebra/Algebra/Unitization.lean b/Mathlib/Algebra/Algebra/Unitization.lean index 57906585249ab6..0ae3b69d024017 100644 --- a/Mathlib/Algebra/Algebra/Unitization.lean +++ b/Mathlib/Algebra/Algebra/Unitization.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.Algebra.Star.Module -import Mathlib.Algebra.Star.NonUnitalSubalgebra -import Mathlib.LinearAlgebra.Prod -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.Algebra.Star.Module +public import Mathlib.Algebra.Star.NonUnitalSubalgebra +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.Tactic.Abel /-! # Unitization of a non-unital algebra @@ -54,6 +56,8 @@ extension to a (unital) algebra homomorphism from `Unitization R A` to `B`. * prove the image of the coercion is an essential ideal, maximal if scalars are a field. -/ +@[expose] public section + /-- The minimal unitization of a non-unital `R`-algebra `A`. This is just a type synonym for `R × A`. -/ diff --git a/Mathlib/Algebra/Algebra/ZMod.lean b/Mathlib/Algebra/Algebra/ZMod.lean index 73260df1d9b9da..e5fb7af3200263 100644 --- a/Mathlib/Algebra/Algebra/ZMod.lean +++ b/Mathlib/Algebra/Algebra/ZMod.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Data.ZMod.Basic /-! # The `ZMod n`-algebra structure on rings whose characteristic divides `n` -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace ZMod diff --git a/Mathlib/Algebra/AlgebraicCard.lean b/Mathlib/Algebra/AlgebraicCard.lean index e3281aeda2b1a9..5b27c9c205c9a8 100644 --- a/Mathlib/Algebra/AlgebraicCard.lean +++ b/Mathlib/Algebra/AlgebraicCard.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Algebra.Polynomial.Cardinal -import Mathlib.RingTheory.Algebraic.Basic +module + +public import Mathlib.Algebra.Polynomial.Cardinal +public import Mathlib.RingTheory.Algebraic.Basic /-! ### Cardinality of algebraic numbers @@ -16,6 +18,8 @@ Although this can be used to prove that real or complex transcendental numbers e proof is given by `Liouville.transcendental`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/ArithmeticGeometric.lean b/Mathlib/Algebra/ArithmeticGeometric.lean index 798f19e0ef2396..ab552e89bebe34 100644 --- a/Mathlib/Algebra/ArithmeticGeometric.lean +++ b/Mathlib/Algebra/ArithmeticGeometric.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.SpecificLimits.ArithmeticGeometric +module + +public import Mathlib.Analysis.SpecificLimits.ArithmeticGeometric deprecated_module (since := "2025-09-17") diff --git a/Mathlib/Algebra/Azumaya/Basic.lean b/Mathlib/Algebra/Azumaya/Basic.lean index cb5817d72fb775..d5d9a5be5eea69 100644 --- a/Mathlib/Algebra/Azumaya/Basic.lean +++ b/Mathlib/Algebra/Azumaya/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yunzhou Xie, Jujian Zhang -/ -import Mathlib.Algebra.Azumaya.Defs -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.GroupTheory.GroupAction.Hom -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.Algebra.Azumaya.Defs +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.GroupTheory.GroupAction.Hom +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Basic properties of Azumaya algebras @@ -27,6 +29,8 @@ Noncommutative algebra, Azumaya algebra, Brauer Group -/ +@[expose] public section + open scoped TensorProduct open MulOpposite diff --git a/Mathlib/Algebra/Azumaya/Defs.lean b/Mathlib/Algebra/Azumaya/Defs.lean index 53d70cdd3f7986..6fa2c8454eab4d 100644 --- a/Mathlib/Algebra/Azumaya/Defs.lean +++ b/Mathlib/Algebra/Azumaya/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yunzhou Xie, Jujian Zhang -/ -import Mathlib.Algebra.Module.Projective -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.Algebra.Module.Projective +public import Mathlib.RingTheory.Finiteness.Defs +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Azumaya Algebras @@ -27,6 +29,8 @@ TODO : Add the three more definitions and prove they are equivalent: Azumaya algebra, central simple algebra, noncommutative algebra -/ +@[expose] public section + variable (R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A] open TensorProduct MulOpposite diff --git a/Mathlib/Algebra/Azumaya/Matrix.lean b/Mathlib/Algebra/Azumaya/Matrix.lean index c52e3c07329afa..37d95486cbaa02 100644 --- a/Mathlib/Algebra/Azumaya/Matrix.lean +++ b/Mathlib/Algebra/Azumaya/Matrix.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yunzhou Xie, Jujian Zhang -/ -import Mathlib.Algebra.Azumaya.Defs -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +module + +public import Mathlib.Algebra.Azumaya.Defs +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic /-! # Matrix algebra is an Azumaya algebra over R @@ -17,6 +19,8 @@ is an Azumaya algebra where `R` is a commutative ring. - `IsAzumaya.Matrix`: Finite-dimensional matrix algebra over `R` is Azumaya. -/ + +@[expose] public section open scoped TensorProduct variable (R n : Type*) [CommSemiring R] [Fintype n] [DecidableEq n] diff --git a/Mathlib/Algebra/BigOperators/Associated.lean b/Mathlib/Algebra/BigOperators/Associated.lean index 24890c058fb2f6..05eaab767a5a51 100644 --- a/Mathlib/Algebra/BigOperators/Associated.lean +++ b/Mathlib/Algebra/BigOperators/Associated.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Anne Baanen -/ -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Algebra.GroupWithZero.Associated +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Algebra.GroupWithZero.Associated /-! # Products of associated, prime, and irreducible elements. @@ -15,6 +17,8 @@ and products of multisets, finsets, and finsupps. -/ +@[expose] public section + assert_not_exists Field variable {ι M M₀ : Type*} @@ -62,7 +66,6 @@ theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) | insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~ᵤ (∏ i ∈ insert j s, g i) - rw [Finset.prod_insert hjs, Finset.prod_insert hjs] grind [Associated.mul_mul] theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero M₀] {p : M₀} (hp : Prime p) diff --git a/Mathlib/Algebra/BigOperators/Balance.lean b/Mathlib/Algebra/BigOperators/Balance.lean index 1b2b2ca767a64a..d224cc7c0c647c 100644 --- a/Mathlib/Algebra/BigOperators/Balance.lean +++ b/Mathlib/Algebra/BigOperators/Balance.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.BigOperators.Expect +module + +public import Mathlib.Algebra.BigOperators.Expect /-! # Balancing a function @@ -15,6 +17,8 @@ This is the unique function `g` such that `f a - f b = g a - g b` for all `a` an Fourier transform, except in the `0`-th frequency where the Fourier transform of `g` vanishes. -/ +@[expose] public section + open Finset Function open scoped BigOperators diff --git a/Mathlib/Algebra/BigOperators/Expect.lean b/Mathlib/Algebra/BigOperators/Expect.lean index 465a0b44b454b0..250e899d9823b6 100644 --- a/Mathlib/Algebra/BigOperators/Expect.lean +++ b/Mathlib/Algebra/BigOperators/Expect.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Module.Pi -import Mathlib.Data.Finset.Density -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Data.Finset.Density +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Average over a finset @@ -43,6 +45,8 @@ combination operator. * Give a formulation of Jensen's inequality in this language. -/ +@[expose] public section + open Finset Function open Fintype (card) open scoped Pointwise @@ -85,7 +89,7 @@ open Batteries.ExtendedBinder /-- Delaborator for `Finset.expect`. The `pp.funBinderTypes` option controls whether to show the domain type when the expect is over `Finset.univ`. -/ -@[scoped app_delab Finset.expect] def delabFinsetExpect : Delab := +@[scoped app_delab Finset.expect] meta def delabFinsetExpect : Delab := whenPPOption getPPNotation <| withOverApp 6 <| do let #[_, _, _, _, s, f] := (← getExpr).getAppArgs | failure guard <| f.isLambda diff --git a/Mathlib/Algebra/BigOperators/Field.lean b/Mathlib/Algebra/BigOperators/Field.lean index 04c4773cbde572..900ec71b3a735e 100644 --- a/Mathlib/Algebra/BigOperators/Field.lean +++ b/Mathlib/Algebra/BigOperators/Field.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Daniel Weber -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Field.Defs -import Mathlib.Data.Finset.Density +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Data.Finset.Density /-! # Results about big operators with values in a field -/ +@[expose] public section + open Fintype variable {ι K : Type*} [DivisionSemiring K] diff --git a/Mathlib/Algebra/BigOperators/Fin.lean b/Mathlib/Algebra/BigOperators/Fin.lean index e571ff73c96732..413af1fcf81909 100644 --- a/Mathlib/Algebra/BigOperators/Fin.lean +++ b/Mathlib/Algebra/BigOperators/Fin.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov, Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Anne Baanen -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Fintype.Fin -import Mathlib.Logic.Equiv.Fin.Basic +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Fintype.Fin +public import Mathlib.Logic.Equiv.Fin.Basic /-! # Big operators and `Fin` @@ -23,6 +25,8 @@ constant function. These results have variants for sums instead of products. * `finFunctionFinEquiv`: An explicit equivalence between `Fin n → Fin m` and `Fin (m ^ n)`. -/ +@[expose] public section + assert_not_exists Field open Finset diff --git a/Mathlib/Algebra/BigOperators/Finprod.lean b/Mathlib/Algebra/BigOperators/Finprod.lean index 1acad05d24e67b..6c352293f4eb05 100644 --- a/Mathlib/Algebra/BigOperators/Finprod.lean +++ b/Mathlib/Algebra/BigOperators/Finprod.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Kexing Ying and Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Group.Indicator -import Mathlib.Algebra.Group.Support -import Mathlib.Algebra.NoZeroSMulDivisors.Basic -import Mathlib.Algebra.Notation.FiniteSupport -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Data.Set.Finite.Lattice +module + +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Algebra.Group.Support +public import Mathlib.Algebra.NoZeroSMulDivisors.Basic +public import Mathlib.Algebra.Notation.FiniteSupport +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Data.Set.Finite.Lattice /-! # Finite products and sums over types and sets @@ -73,6 +75,8 @@ We did not add `IsFinite (X : Type) : Prop`, because it is simply `Nonempty (Fin finsum, finprod, finite sum, finite product -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Algebra/BigOperators/Finsupp/Basic.lean b/Mathlib/Algebra/BigOperators/Finsupp/Basic.lean index 57b892cf55e734..59b513e418f5df 100644 --- a/Mathlib/Algebra/BigOperators/Finsupp/Basic.lean +++ b/Mathlib/Algebra/BigOperators/Finsupp/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Sigma -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Data.Finsupp.Ext -import Mathlib.Data.Finsupp.Indicator +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Sigma +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Data.Finsupp.Ext +public import Mathlib.Data.Finsupp.Indicator /-! # Big operators for finsupps @@ -16,6 +18,8 @@ import Mathlib.Data.Finsupp.Indicator This file contains theorems relevant to big operators in finitely supported functions. -/ +@[expose] public section + assert_not_exists Field noncomputable section diff --git a/Mathlib/Algebra/BigOperators/Finsupp/Fin.lean b/Mathlib/Algebra/BigOperators/Finsupp/Fin.lean index 66cbbd3c577f0f..9b7f52418291c8 100644 --- a/Mathlib/Algebra/BigOperators/Finsupp/Fin.lean +++ b/Mathlib/Algebra/BigOperators/Finsupp/Fin.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Data.Finsupp.Fin +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Data.Finsupp.Fin /-! # `Finsupp.sum` and `Finsupp.prod` over `Fin` @@ -13,6 +15,8 @@ import Mathlib.Data.Finsupp.Fin This file contains theorems relevant to big operators on finitely supported functions over `Fin`. -/ +@[expose] public section + variable {M N : Type*} namespace Finsupp diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean index 6617cbb0213e7c..ba682817921263 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Defs -import Mathlib.Data.Finset.Prod -import Mathlib.Data.Finset.Sum +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.Finset.Sum /-! # Big operators @@ -13,6 +15,8 @@ import Mathlib.Data.Finset.Sum In this file we prove theorems about products and sums indexed by a `Finset`. -/ +@[expose] public section + -- TODO: assert_not_exists AddCommMonoidWithOne assert_not_exists MonoidWithZero MulAction IsOrderedMonoid assert_not_exists Finset.preimage Finset.sigma Fintype.piFinset diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean index c81b0ac13ff295..1ad954d4f7f13a 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.Equiv.Opposite -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Data.Fintype.Sets -import Mathlib.Data.Multiset.Bind +module + +public import Mathlib.Algebra.Group.Equiv.Opposite +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Data.Fintype.Sets +public import Mathlib.Data.Multiset.Bind /-! # Big operators @@ -40,6 +42,8 @@ See the documentation of `to_additive.attr` for more information. -/ +@[expose] public section + -- TODO -- assert_not_exists AddCommMonoidWithOne assert_not_exists MonoidWithZero @@ -113,7 +117,7 @@ syntax bigOpBinders := bigOpBinderCollection <|> (ppSpace bigOpBinder) /-- Collects additional binder/Finset pairs for the given `bigOpBinder`. Note: this is not extensible at the moment, unlike the usual `bigOpBinder` expansions. -/ -def processBigOpBinder (processed : (Array (Term × Term))) (binder : TSyntax ``bigOpBinder) : +meta def processBigOpBinder (processed : (Array (Term × Term))) (binder : TSyntax ``bigOpBinder) : MacroM (Array (Term × Term)) := set_option hygiene false in withRef binder do @@ -134,7 +138,7 @@ def processBigOpBinder (processed : (Array (Term × Term))) (binder : TSyntax `` | _ => Macro.throwUnsupported /-- Collects the binder/Finset pairs for the given `bigOpBinders`. -/ -def processBigOpBinders (binders : TSyntax ``bigOpBinders) : +meta def processBigOpBinders (binders : TSyntax ``bigOpBinders) : MacroM (Array (Term × Term)) := match binders with | `(bigOpBinders| $b:bigOpBinder) => processBigOpBinder #[] b @@ -142,7 +146,7 @@ def processBigOpBinders (binders : TSyntax ``bigOpBinders) : | _ => Macro.throwUnsupported /-- Collects the binderIdents into a `⟨...⟩` expression. -/ -def bigOpBindersPattern (processed : Array (Term × Term)) : MacroM Term := do +meta def bigOpBindersPattern (processed : Array (Term × Term)) : MacroM Term := do let ts := processed.map Prod.fst if h : ts.size = 1 then return ts[0] @@ -150,7 +154,7 @@ def bigOpBindersPattern (processed : Array (Term × Term)) : MacroM Term := do `(⟨$ts,*⟩) /-- Collects the terms into a product of sets. -/ -def bigOpBindersProd (processed : Array (Term × Term)) : MacroM Term := do +meta def bigOpBindersProd (processed : Array (Term × Term)) : MacroM Term := do if h₀ : processed.size = 0 then `((Finset.univ : Finset Unit)) else if h₁ : processed.size = 1 then @@ -233,7 +237,7 @@ private inductive FinsetResult where /-- Delaborates a finset indexing a big operator. In case it is a `Finset.filter`, `i` is used for the binder name. -/ -private def delabFinsetArg (i : Ident) : DelabM FinsetResult := do +private meta def delabFinsetArg (i : Ident) : DelabM FinsetResult := do let s ← getExpr if s.isAppOfArity ``Finset.univ 2 then return .univ @@ -257,8 +261,8 @@ private def delabFinsetArg (i : Ident) : DelabM FinsetResult := do /-- Delaborator for `Finset.prod`. The `pp.funBinderTypes` option controls whether to show the domain type when the product is over `Finset.univ`. -/ -@[app_delab Finset.prod] def delabFinsetProd : Delab := - whenPPOption getPPNotation <| withOverApp 5 <| do +@[app_delab Finset.prod] meta def delabFinsetProd : Delab := + whenPPOption getPPNotation <| withOverApp 5 do let #[_, _, _, _, f] := (← getExpr).getAppArgs | failure guard f.isLambda let ppDomain ← getPPOption getPPFunBinderTypes @@ -288,8 +292,8 @@ to show the domain type when the product is over `Finset.univ`. -/ /-- Delaborator for `Finset.sum`. The `pp.funBinderTypes` option controls whether to show the domain type when the sum is over `Finset.univ`. -/ -@[app_delab Finset.sum] def delabFinsetSum : Delab := - whenPPOption getPPNotation <| withOverApp 5 <| do +@[app_delab Finset.sum] meta def delabFinsetSum : Delab := + whenPPOption getPPNotation <| withOverApp 5 do let #[_, _, _, _, f] := (← getExpr).getAppArgs | failure guard f.isLambda let ppDomain ← getPPOption getPPFunBinderTypes @@ -508,7 +512,7 @@ lemma prod_nbij' (i : ι → κ) (j : κ → ι) (hi : ∀ a ∈ s, i a ∈ t) ( /-- Specialization of `Finset.prod_nbij'` that automatically fills in most arguments. See `Fintype.prod_equiv` for the version where `s` and `t` are `univ`. -/ -@[to_additive /-- `Specialization of `Finset.sum_nbij'` that automatically fills in most arguments. +@[to_additive /-- Specialization of `Finset.sum_nbij'` that automatically fills in most arguments. See `Fintype.sum_equiv` for the version where `s` and `t` are `univ`. -/] lemma prod_equiv (e : ι ≃ κ) (hst : ∀ i, i ∈ s ↔ e i ∈ t) (hfg : ∀ i ∈ s, f i = g (e i)) : @@ -517,7 +521,7 @@ lemma prod_equiv (e : ι ≃ κ) (hst : ∀ i, i ∈ s ↔ e i ∈ t) (hfg : ∀ /-- Specialization of `Finset.prod_bij` that automatically fills in most arguments. See `Fintype.prod_bijective` for the version where `s` and `t` are `univ`. -/ -@[to_additive /-- `Specialization of `Finset.sum_bij` that automatically fills in most arguments. +@[to_additive /-- Specialization of `Finset.sum_bij` that automatically fills in most arguments. See `Fintype.sum_bijective` for the version where `s` and `t` are `univ`. -/] lemma prod_bijective (e : ι → κ) (he : e.Bijective) (hst : ∀ i, i ∈ s ↔ e i ∈ t) diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Indicator.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Indicator.lean index 19687afb38c90e..9f3af393c86fe6 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Indicator.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Indicator.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Indicator -import Mathlib.Order.CompleteLattice.Finset +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Order.CompleteLattice.Finset /-! # Interaction of big operators with indicator functions -/ +@[expose] public section + namespace Finset variable {ι κ α β : Type*} [CommMonoid β] diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Interval.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Interval.lean index 03ee6ef17793b9..0480a826d7ccb9 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Interval.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Interval.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Group.EvenFunction -import Mathlib.Data.Int.Interval -import Mathlib.Tactic.Zify +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Group.EvenFunction +public import Mathlib.Data.Int.Interval +public import Mathlib.Tactic.Zify /-! # Sums/products over integer intervals @@ -16,6 +17,8 @@ This file contains some lemmas about sums and products over integer intervals `I -/ +@[expose] public section + namespace Finset @[to_additive] diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Lemmas.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Lemmas.lean index d82058ae12837b..336bc7a63744b5 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Lemmas.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Notation.Support +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Notation.Support /-! # Miscellaneous lemmas on big operators @@ -15,6 +17,8 @@ The lemmas in this file have been moved out of `Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean` to reduce its imports. -/ +@[expose] public section + variable {ι κ M N β : Type*} @[to_additive] diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Pi.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Pi.lean index 9d15f2f44066bc..82dca747993d7e 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Pi.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Fintype.Pi -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +module + +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! @@ -12,6 +14,8 @@ import Mathlib.Algebra.BigOperators.Group.Finset.Defs -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction IsOrderedMonoid variable {ι β : Type*} diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean index a32891c72d29d3..c42860ea91af65 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Data.Finset.Piecewise +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Data.Finset.Piecewise /-! # Interaction of big operators with piecewise functions @@ -12,6 +14,8 @@ import Mathlib.Data.Finset.Piecewise This file proves lemmas on the sum and product of piecewise functions, including `ite` and `dite`. -/ +@[expose] public section + variable {ι κ M β γ : Type*} {s : Finset ι} namespace Finset diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean index aa70fe7b824d49..3f2d2f3fecede4 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Data.Finset.Powerset +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Data.Finset.Powerset /-! # Big operators @@ -13,6 +15,8 @@ In this file we prove theorems about products and sums over a `Finset.powerset`. -/ +@[expose] public section + variable {α β γ : Type*} variable {s : Finset α} {a : α} diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Preimage.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Preimage.lean index 9d2a631b8f4e60..41138483bcd3ea 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Preimage.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Preimage.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Finset.Preimage -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.Preimage +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Sums and products over preimages of finite sets. -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction IsOrderedMonoid variable {ι κ β : Type*} diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Sigma.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Sigma.lean index fb82f7ed478158..6b9352f42b09be 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Sigma.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Sigma.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Finset.Sigma -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Product and sums indexed by finite sets in sigma types. -/ +@[expose] public section + variable {ι κ α β γ : Type*} open Fin Function diff --git a/Mathlib/Algebra/BigOperators/Group/List/Basic.lean b/Mathlib/Algebra/BigOperators/Group/List/Basic.lean index c2bbfa7b79e095..9ef302b6f5ec5c 100644 --- a/Mathlib/Algebra/BigOperators/Group/List/Basic.lean +++ b/Mathlib/Algebra/BigOperators/Group/List/Basic.lean @@ -3,17 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Floris van Doorn, Sébastien Gouëzel, Alex J. Best -/ -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.BigOperators.Group.List.Defs -import Mathlib.Order.RelClasses -import Mathlib.Data.List.TakeDrop -import Mathlib.Data.List.Forall2 -import Mathlib.Data.List.Perm.Basic -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.Int.Defs +module + +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.BigOperators.Group.List.Defs +public import Mathlib.Order.RelClasses +public import Mathlib.Data.List.TakeDrop +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.List.Perm.Basic +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.Int.Defs /-! # Sums and products from lists @@ -22,6 +24,8 @@ This file provides basic results about `List.prod`, `List.sum`, which calculate of elements of a list and `List.alternatingProd`, `List.alternatingSum`, their alternating counterparts. -/ + +@[expose] public section assert_not_imported Mathlib.Algebra.Order.Group.Nat variable {ι α β M N P G : Type*} @@ -32,29 +36,6 @@ section Monoid variable [Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M} -@[to_additive] -theorem prod_eq_foldl : ∀ {l : List M}, l.prod = foldl (· * ·) 1 l - | [] => rfl - | cons a l => by - rw [prod_cons, prod_eq_foldl, ← foldl_assoc (α := M) (op := (· * ·))] - simp - -@[to_additive (attr := simp)] -theorem prod_append : (l₁ ++ l₂).prod = l₁.prod * l₂.prod := - calc - (l₁ ++ l₂).prod = foldr (· * ·) (1 * foldr (· * ·) 1 l₂) l₁ := by simp [List.prod] - _ = l₁.prod * l₂.prod := foldr_assoc - -@[to_additive] -theorem prod_concat : (l.concat a).prod = l.prod * a := by - rw [concat_eq_append, prod_append, prod_singleton] - -@[to_additive (attr := simp)] -theorem prod_flatten {l : List (List M)} : l.flatten.prod = (l.map List.prod).prod := by - induction l with - | nil => simp - | cons head tail ih => simp only [*, List.flatten_cons, map, prod_append, prod_cons] - open scoped Relator in @[to_additive] theorem rel_prod {R : M → N → Prop} (h : R 1 1) (hf : (R ⇒ R ⇒ R) (· * ·) (· * ·)) : @@ -82,8 +63,8 @@ theorem prod_hom₂_nonempty {l : List ι} (f : M → N → P) theorem prod_hom₂ (l : List ι) (f : M → N → P) (hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d) (hf' : f 1 1 = 1) (f₁ : ι → M) (f₂ : ι → N) : (l.map fun i => f (f₁ i) (f₂ i)).prod = f (l.map f₁).prod (l.map f₂).prod := by - rw [prod, prod, prod, foldr_map, foldr_map, foldr_map, - ← l.foldr_hom₂ f _ _ (fun x y => f (f₁ x) (f₂ x) * y) _ _ (by simp [hf]), hf'] + simp only [prod_eq_foldr, foldr_map] + rw [← foldr_hom₂ l f _ _ ((fun x y => f (f₁ x) (f₂ x) * y) ) _ _ (by simp [hf]), hf'] @[to_additive (attr := simp)] theorem prod_map_mul {M : Type*} [CommMonoid M] {l : List ι} {f g : ι → M} : @@ -302,7 +283,7 @@ variable [Group G] @[to_additive /-- This is the `List.sum` version of `add_neg_rev` -/] theorem prod_inv_reverse : ∀ L : List G, L.prod⁻¹ = (L.map fun x => x⁻¹).reverse.prod | [] => by simp - | x :: xs => by simp [prod_inv_reverse xs] + | x :: xs => by simp [prod_append, prod_inv_reverse xs] /-- A non-commutative variant of `List.prod_reverse` -/ @[to_additive /-- A non-commutative variant of `List.sum_reverse` -/] @@ -324,8 +305,7 @@ theorem prod_range_div' (n : ℕ) (f : ℕ → G) : ((range n).map fun k ↦ f k / f (k + 1)).prod = f 0 / f n := by induction n with | zero => exact (div_self' (f 0)).symm - | succ n h => - rw [range_succ, map_append, map_singleton, prod_append, prod_singleton, h, div_mul_div_cancel] + | succ n h => simp [range_succ, prod_append, map_append, h] end Group diff --git a/Mathlib/Algebra/BigOperators/Group/List/Defs.lean b/Mathlib/Algebra/BigOperators/Group/List/Defs.lean index df87c26475c392..d16387b9ef202f 100644 --- a/Mathlib/Algebra/BigOperators/Group/List/Defs.lean +++ b/Mathlib/Algebra/BigOperators/Group/List/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Floris van Doorn, Sébastien Gouëzel, Alex J. Best -/ -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Algebra.Group.Defs /-! # Sums and products from lists @@ -13,17 +15,16 @@ which calculate the product and sum of elements of a list and `List.alternatingProd`, `List.alternatingSum`, their alternating counterparts. -/ +@[expose] public section + variable {ι M N : Type*} namespace List section Defs -/-- Product of a list. - -`List.prod [a, b, c] = a * (b * (c * 1))` -/ -@[to_additive existing] -def prod {α} [Mul α] [One α] : List α → α := - foldr (· * ·) 1 +set_option linter.existingAttributeWarning false in +attribute [to_additive existing] prod prod_nil prod_cons prod_one_cons prod_append prod_concat + prod_flatten prod_eq_foldl /-- The alternating sum of a list. -/ def alternatingSum {G : Type*} [Zero G] [Add G] [Neg G] : List G → G @@ -44,13 +45,6 @@ section Mul variable [Mul M] [One M] {a : M} {l : List M} -@[to_additive existing, simp] -theorem prod_nil : ([] : List M).prod = 1 := - rfl - -@[to_additive existing, simp] -theorem prod_cons : (a :: l).prod = a * l.prod := rfl - @[to_additive] lemma prod_induction (p : M → Prop) (hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ l, p x) : @@ -68,20 +62,10 @@ section MulOneClass variable [MulOneClass M] {l : List M} {a : M} -@[to_additive] -theorem prod_singleton : [a].prod = a := - mul_one a - -@[to_additive] -theorem prod_one_cons : (1 :: l).prod = l.prod := by - rw [prod, foldr, one_mul] - @[to_additive] theorem prod_map_one {l : List ι} : (l.map fun _ => (1 : M)).prod = 1 := by - induction l with - | nil => rfl - | cons hd tl ih => rw [map_cons, prod_one_cons, ih] + induction l with simp [*] @[to_additive] lemma prod_induction_nonempty @@ -102,9 +86,6 @@ section Monoid variable [Monoid M] [Monoid N] -@[to_additive] -theorem prod_eq_foldr {l : List M} : l.prod = foldr (· * ·) 1 l := rfl - @[to_additive (attr := simp)] theorem prod_replicate (n : ℕ) (a : M) : (replicate n a).prod = a ^ n := by induction n with diff --git a/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean b/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean index a0222087e0c230..b35bc5dbd08367 100644 --- a/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean +++ b/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean @@ -3,17 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Floris van Doorn, Sébastien Gouëzel, Alex J. Best -/ -import Mathlib.Algebra.BigOperators.Group.List.Basic -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Int.Units -import Mathlib.Data.List.Dedup -import Mathlib.Data.List.Flatten -import Mathlib.Data.List.Pairwise -import Mathlib.Data.List.Perm.Basic -import Mathlib.Data.List.Range -import Mathlib.Data.List.Rotate -import Mathlib.Data.List.ProdSigma -import Mathlib.Algebra.Group.Opposite +module + +public import Mathlib.Algebra.BigOperators.Group.List.Basic +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Int.Units +public import Mathlib.Data.List.Dedup +public import Mathlib.Data.List.Flatten +public import Mathlib.Data.List.Pairwise +public import Mathlib.Data.List.Perm.Basic +public import Mathlib.Data.List.Range +public import Mathlib.Data.List.Rotate +public import Mathlib.Data.List.ProdSigma +public import Mathlib.Algebra.Group.Opposite /-! # Sums and products from lists @@ -22,6 +24,8 @@ This file provides further results about `List.prod`, `List.sum`, which calculate the product and sum of elements of a list and `List.alternatingProd`, `List.alternatingSum`, their alternating counterparts. -/ + +@[expose] public section assert_not_imported Mathlib.Algebra.Order.Group.Nat variable {ι α β M N P G : Type*} diff --git a/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean b/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean index e7dba074fb494c..c90841397d546a 100644 --- a/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean +++ b/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Group.List.Lemmas -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Algebra.Order.Sub.Unbundled.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.List.Lemmas +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic /-! # Sums and products over multisets @@ -22,6 +24,8 @@ and sums indexed by finite sets. * `Multiset.sum`: `s.sum f` is the sum of `f i` over all `i ∈ s`. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {F ι κ G M N O : Type*} @@ -44,7 +48,7 @@ theorem prod_map_erase [DecidableEq ι] {a : ι} (h : a ∈ m) : @[to_additive (attr := simp, grind =)] theorem prod_add (s t : Multiset M) : prod (s + t) = prod s * prod t := - Quotient.inductionOn₂ s t fun l₁ l₂ => by simp + Quotient.inductionOn₂ s t fun l₁ l₂ => by simp [List.prod_append] @[to_additive] theorem prod_nsmul (m : Multiset M) : ∀ n : ℕ, (n • m).prod = m.prod ^ n diff --git a/Mathlib/Algebra/BigOperators/Group/Multiset/Defs.lean b/Mathlib/Algebra/BigOperators/Group/Multiset/Defs.lean index 38310197b6233f..a4fcf58355ffb1 100644 --- a/Mathlib/Algebra/BigOperators/Group/Multiset/Defs.lean +++ b/Mathlib/Algebra/BigOperators/Group/Multiset/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Group.List.Defs -import Mathlib.Algebra.Group.Basic -import Mathlib.Data.Multiset.Basic -import Mathlib.Data.Multiset.Filter +module + +public import Mathlib.Algebra.BigOperators.Group.List.Defs +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Data.Multiset.Basic +public import Mathlib.Data.Multiset.Filter /-! # Sums and products over multisets @@ -21,6 +23,8 @@ and sums indexed by finite sets. * `Multiset.sum`: `s.sum f` is the sum of `f i` over all `i ∈ s`. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {F ι M N : Type*} diff --git a/Mathlib/Algebra/BigOperators/GroupWithZero/Action.lean b/Mathlib/Algebra/BigOperators/GroupWithZero/Action.lean index da921c2231416d..29855c58647fc3 100644 --- a/Mathlib/Algebra/BigOperators/GroupWithZero/Action.lean +++ b/Mathlib/Algebra/BigOperators/GroupWithZero/Action.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Data.Finset.Basic -import Mathlib.Algebra.Group.Action.Basic +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Data.Finset.Basic +public import Mathlib.Algebra.Group.Action.Basic /-! # Lemmas about group actions on big operators @@ -22,6 +24,8 @@ This file contains results about two kinds of actions: Note that analogous lemmas for `Module`s like `Finset.sum_smul` appear in other files. -/ +@[expose] public section + variable {M N γ : Type*} diff --git a/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean b/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean index 3c821ebb9f6845..a09648f1bfc3b2 100644 --- a/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean +++ b/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Data.Set.Lattice /-! # Big operators on a finset in groups with zero @@ -15,6 +17,8 @@ This file contains the results concerning the interaction of finset big operator zero. -/ +@[expose] public section + open Function variable {ι κ G₀ M₀ : Type*} {α : ι → Type*} diff --git a/Mathlib/Algebra/BigOperators/Intervals.lean b/Mathlib/Algebra/BigOperators/Intervals.lean index 47b9db41ce5adb..a260eaff52eb41 100644 --- a/Mathlib/Algebra/BigOperators/Intervals.lean +++ b/Mathlib/Algebra/BigOperators/Intervals.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite -import Mathlib.Algebra.Order.Interval.Finset.Basic -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.Nat.Factorial.Basic +module + +public import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite +public import Mathlib.Algebra.Order.Interval.Finset.Basic +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.Nat.Factorial.Basic /-! # Results about big operators over intervals @@ -14,6 +16,8 @@ import Mathlib.Data.Nat.Factorial.Basic We prove results about big operators over intervals. -/ +@[expose] public section + open Nat variable {α G M : Type*} diff --git a/Mathlib/Algebra/BigOperators/Module.lean b/Mathlib/Algebra/BigOperators/Module.lean index 8e39063e9f1f99..7df8e22290456c 100644 --- a/Mathlib/Algebra/BigOperators/Module.lean +++ b/Mathlib/Algebra/BigOperators/Module.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Dylan MacKenzie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dylan MacKenzie -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Algebra.Module.Defs -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Tactic.Abel /-! # Summation by parts -/ +@[expose] public section + namespace Finset variable {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] (f : ℕ → R) (g : ℕ → M) {m n : ℕ} diff --git a/Mathlib/Algebra/BigOperators/NatAntidiagonal.lean b/Mathlib/Algebra/BigOperators/NatAntidiagonal.lean index 1b544c3c386a22..3385cf90c61382 100644 --- a/Mathlib/Algebra/BigOperators/NatAntidiagonal.lean +++ b/Mathlib/Algebra/BigOperators/NatAntidiagonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Finset.NatAntidiagonal -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.NatAntidiagonal +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Big operators for `NatAntidiagonal` @@ -12,6 +14,8 @@ import Mathlib.Algebra.BigOperators.Group.Finset.Basic This file contains theorems relevant to big operators over `Finset.NatAntidiagonal`. -/ +@[expose] public section + variable {M N : Type*} [CommMonoid M] [AddCommMonoid N] namespace Finset diff --git a/Mathlib/Algebra/BigOperators/Option.lean b/Mathlib/Algebra/BigOperators/Option.lean index c3461eaf0d18b3..82b4acd8fbef9f 100644 --- a/Mathlib/Algebra/BigOperators/Option.lean +++ b/Mathlib/Algebra/BigOperators/Option.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Finset.Option -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.Option +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Lemmas about products and sums over finite sets in `Option α` @@ -13,6 +15,8 @@ In this file we prove formulas for products and sums over `Finset.insertNone s` `Finset.eraseNone s`. -/ +@[expose] public section + open Function namespace Finset diff --git a/Mathlib/Algebra/BigOperators/Pi.lean b/Mathlib/Algebra/BigOperators/Pi.lean index 25ef72e2e88fc5..4482ce9b21f1f0 100644 --- a/Mathlib/Algebra/BigOperators/Pi.lean +++ b/Mathlib/Algebra/BigOperators/Pi.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Lemmas -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.BigOperators.GroupWithZero.Finset -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Algebra.Ring.Pi -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Lemmas +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.BigOperators.GroupWithZero.Finset +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Algebra.Ring.Pi +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Fintype.Basic /-! # Big operators for Pi Types @@ -19,6 +21,8 @@ This file contains theorems relevant to big operators in binary and arbitrary pr of monoids and groups -/ +@[expose] public section + open scoped Finset variable {ι κ M N R α : Type*} diff --git a/Mathlib/Algebra/BigOperators/Ring/Finset.lean b/Mathlib/Algebra/BigOperators/Ring/Finset.lean index d522cdaa22e7de..4e360c27c51e0a 100644 --- a/Mathlib/Algebra/BigOperators/Ring/Finset.lean +++ b/Mathlib/Algebra/BigOperators/Ring/Finset.lean @@ -3,13 +3,15 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Pi -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.BigOperators.GroupWithZero.Finset -import Mathlib.Algebra.BigOperators.Ring.Multiset -import Mathlib.Data.Finset.Max -import Mathlib.Data.Fintype.Powerset -import Mathlib.Data.Int.Cast.Lemmas +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Pi +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.BigOperators.GroupWithZero.Finset +public import Mathlib.Algebra.BigOperators.Ring.Multiset +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Data.Int.Cast.Lemmas /-! # Results about big operators with values in a (semi)ring @@ -18,6 +20,8 @@ We prove results about big operators that involve some interaction between multiplicative and additive structures on the values being combined. -/ +@[expose] public section + assert_not_exists Field open Fintype diff --git a/Mathlib/Algebra/BigOperators/Ring/List.lean b/Mathlib/Algebra/BigOperators/Ring/List.lean index 5c4e5849045fe9..0db9e082850fe2 100644 --- a/Mathlib/Algebra/BigOperators/Ring/List.lean +++ b/Mathlib/Algebra/BigOperators/Ring/List.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Floris van Doorn, Sébastien Gouëzel, Alex J. Best -/ -import Mathlib.Algebra.GroupWithZero.Commute -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.Ring.Basic -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Commute -import Mathlib.Algebra.BigOperators.Group.List.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Commute +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.Ring.Basic +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Commute +public import Mathlib.Algebra.BigOperators.Group.List.Basic /-! # Big operators on a list in rings @@ -16,6 +18,8 @@ import Mathlib.Algebra.BigOperators.Group.List.Basic This file contains the results concerning the interaction of list big operators with rings. -/ +@[expose] public section + open MulOpposite List variable {ι κ M M₀ R : Type*} diff --git a/Mathlib/Algebra/BigOperators/Ring/Multiset.lean b/Mathlib/Algebra/BigOperators/Ring/Multiset.lean index f3f3c3dfb73550..abd6c08f9775c4 100644 --- a/Mathlib/Algebra/BigOperators/Ring/Multiset.lean +++ b/Mathlib/Algebra/BigOperators/Ring/Multiset.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Bhavik Mehta, Eric Wieser -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Basic -import Mathlib.Algebra.BigOperators.Ring.List -import Mathlib.Data.Multiset.Antidiagonal -import Mathlib.Data.Multiset.Sections +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Basic +public import Mathlib.Algebra.BigOperators.Ring.List +public import Mathlib.Data.Multiset.Antidiagonal +public import Mathlib.Data.Multiset.Sections /-! # Lemmas about `Multiset.sum` and `Multiset.prod` requiring extra algebra imports -/ +@[expose] public section + variable {ι M M₀ R : Type*} diff --git a/Mathlib/Algebra/BigOperators/Ring/Nat.lean b/Mathlib/Algebra/BigOperators/Ring/Nat.lean index 6139f06c6ed911..5070177a92850d 100644 --- a/Mathlib/Algebra/BigOperators/Ring/Nat.lean +++ b/Mathlib/Algebra/BigOperators/Ring/Nat.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Otte -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Lemmas -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.SetTheory.Cardinal.Finite +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Lemmas +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.SetTheory.Cardinal.Finite /-! # Big operators on a finset in the natural numbers @@ -14,6 +16,8 @@ This file contains the results concerning the interaction of finset big operator numbers. -/ +@[expose] public section + variable {ι : Type*} namespace Finset diff --git a/Mathlib/Algebra/BigOperators/RingEquiv.lean b/Mathlib/Algebra/BigOperators/RingEquiv.lean index 4d6a7c1922e052..1d4be6a25e1483 100644 --- a/Mathlib/Algebra/BigOperators/RingEquiv.lean +++ b/Mathlib/Algebra/BigOperators/RingEquiv.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +module + +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! # Results about mapping big operators across ring equivalences -/ +@[expose] public section + namespace RingEquiv diff --git a/Mathlib/Algebra/BigOperators/Sym.lean b/Mathlib/Algebra/BigOperators/Sym.lean index 215d6df545864f..5ee798c5789a87 100644 --- a/Mathlib/Algebra/BigOperators/Sym.lean +++ b/Mathlib/Algebra/BigOperators/Sym.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Sym.Sym2.Order -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Sym.Sym2.Order +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Lemmas on `Finset.sum` and `Finset.prod` involving `Finset.sym2` or `Finset.sym`. -/ +@[expose] public section + namespace Finset open Multiset diff --git a/Mathlib/Algebra/BigOperators/WithTop.lean b/Mathlib/Algebra/BigOperators/WithTop.lean index 0fff0274c48e5a..5aeeac42bb94f0 100644 --- a/Mathlib/Algebra/BigOperators/WithTop.lean +++ b/Mathlib/Algebra/BigOperators/WithTop.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yaël Dillies -/ -import Mathlib.Algebra.Order.Ring.WithTop -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Finset +public import Mathlib.Algebra.Order.Ring.WithTop /-! # Sums in `WithTop` @@ -12,6 +14,8 @@ import Mathlib.Algebra.BigOperators.Group.Finset.Basic This file proves results about finite sums over monoids extended by a bottom or top element. -/ +@[expose] public section + open Finset variable {ι M M₀ : Type*} @@ -40,7 +44,7 @@ end AddCommMonoid section CommMonoidWithZero variable [CommMonoidWithZero M₀] [NoZeroDivisors M₀] [Nontrivial M₀] [DecidableEq M₀] - {s : Finset ι} {f : ι → WithTop M₀} + {s : Finset ι} {f : ι → WithTop M₀} {i : ι} /-- A product of finite terms is finite. -/ lemma prod_ne_top (h : ∀ i ∈ s, f i ≠ ⊤) : ∏ i ∈ s, f i ≠ ⊤ := @@ -50,6 +54,31 @@ lemma prod_ne_top (h : ∀ i ∈ s, f i ≠ ⊤) : ∏ i ∈ s, f i ≠ ⊤ := lemma prod_lt_top [LT M₀] (h : ∀ i ∈ s, f i < ⊤) : ∏ i ∈ s, f i < ⊤ := prod_induction f (· < ⊤) (fun _ _ ↦ mul_lt_top) (coe_lt_top _) h +lemma prod_eq_top (hi : i ∈ s) (hi' : f i = ⊤) (h : ∀ j ∈ s, f j ≠ 0) : + ∏ j ∈ s, f j = ⊤ := by + classical rw [← prod_erase_mul _ _ hi] + refine WithTop.mul_eq_top_iff.mpr (Or.inl ⟨?_, hi'⟩) + refine prod_ne_zero_iff.mpr ?_ + intros + simp_all only [ne_eq, mem_erase, not_false_eq_true] + +lemma prod_eq_top_ne_zero (hi : i ∈ s) (h : ∏ j ∈ s, f j = ⊤) : f i ≠ 0 := by + by_contra! h0 + apply WithTop.top_ne_zero (α := M₀) + calc + ⊤ = ∏ j ∈ s, f j := Eq.symm h + _ = 0 := prod_eq_zero hi h0 + +lemma prod_eq_top_ex_top (h : ∏ j ∈ s, f j = ⊤) : ∃ i ∈ s, f i = ⊤ := by + contrapose! h + exact WithTop.prod_ne_top h + +/-- A product is infinite iff each factor is nonzero and some factor is infinite -/ +lemma prod_eq_top_iff : ∏ j ∈ s, f j = ⊤ ↔ (∃ i ∈ s, f i = ⊤) ∧ (∀ i ∈ s, f i ≠ 0) := by + constructor + · exact fun h ↦ ⟨prod_eq_top_ex_top h, fun _ ih ↦ prod_eq_top_ne_zero ih h⟩ + · exact fun ⟨h, h'⟩ ↦ prod_eq_top (Exists.choose_spec h).1 (Exists.choose_spec h).2 h' + end CommMonoidWithZero end WithTop diff --git a/Mathlib/Algebra/BrauerGroup/Defs.lean b/Mathlib/Algebra/BrauerGroup/Defs.lean index 88a8df5c158111..75f21329674f0e 100644 --- a/Mathlib/Algebra/BrauerGroup/Defs.lean +++ b/Mathlib/Algebra/BrauerGroup/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yunzhou Xie, Jujian Zhang -/ -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.Algebra.Central.Defs -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.LinearAlgebra.Matrix.Reindex +module + +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.Algebra.Central.Defs +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.LinearAlgebra.Matrix.Reindex /-! # Definition of Brauer group of a field K @@ -16,19 +18,21 @@ all finite-dimensional central simple algebras over K modulo the Brauer Equivale central simple algebras `A` and `B` are Brauer Equivalent if there exist `n, m ∈ ℕ+` such that `Mₙ(A) ≃ₐ[K] Mₘ(B)`. -# TODOs +## TODOs 1. Prove that the Brauer group is an abelian group where multiplication is defined as tensor product. 2. Prove that the Brauer group is a functor from the category of fields to the category of groups. 3. Prove that over a field, being Brauer equivalent is the same as being Morita equivalent. -# References +## References * [Algebraic Number Theory, *J.W.S Cassels*][cassels1967algebraic] ## Tags Brauer group, Central simple algebra, Galois Cohomology -/ +@[expose] public section + universe u v /-- `CSA` is the set of all finite-dimensional central simple algebras over a field `K`. For the diff --git a/Mathlib/Algebra/Category/AlgCat/Basic.lean b/Mathlib/Algebra/Category/AlgCat/Basic.lean index a136b0ec87a984..08e5f6fa97bf70 100644 --- a/Mathlib/Algebra/Category/AlgCat/Basic.lean +++ b/Mathlib/Algebra/Category/AlgCat/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.FreeAlgebra -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.Algebra.Category.ModuleCat.Basic +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.Algebra.Category.ModuleCat.Basic /-! # Category instance for algebras over a commutative ring @@ -16,6 +18,8 @@ with the forgetful functors to `RingCat` and `ModuleCat`. We furthermore show th associating to a type the free `R`-algebra on that type is left adjoint to the forgetful functor. -/ +@[expose] public section + open CategoryTheory Limits universe v u diff --git a/Mathlib/Algebra/Category/AlgCat/Limits.lean b/Mathlib/Algebra/Category/AlgCat/Limits.lean index 417cdd0a1e59e1..2fe478bf531f23 100644 --- a/Mathlib/Algebra/Category/AlgCat/Limits.lean +++ b/Mathlib/Algebra/Category/AlgCat/Limits.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Algebra.Shrink -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.Algebra.Category.Ring.Limits +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Algebra.Shrink +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.Algebra.Category.Ring.Limits /-! # The category of R-algebras has all limits @@ -17,6 +19,8 @@ Further, these limits are preserved by the forgetful functor --- that is, the underlying types are just the limits in the category of types. -/ +@[expose] public section + open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/AlgCat/Monoidal.lean b/Mathlib/Algebra/Category/AlgCat/Monoidal.lean index 7a027f394ea742..e2b40f3b548134 100644 --- a/Mathlib/Algebra/Category/AlgCat/Monoidal.lean +++ b/Mathlib/Algebra/Category/AlgCat/Monoidal.lean @@ -3,15 +3,19 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +public import Mathlib.RingTheory.TensorProduct.Maps /-! # The monoidal category structure on R-algebras -/ +@[expose] public section + open CategoryTheory open scoped MonoidalCategory diff --git a/Mathlib/Algebra/Category/AlgCat/Symmetric.lean b/Mathlib/Algebra/Category/AlgCat/Symmetric.lean index c3ced92825be1b..5dcdac625256e8 100644 --- a/Mathlib/Algebra/Category/AlgCat/Symmetric.lean +++ b/Mathlib/Algebra/Category/AlgCat/Symmetric.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Category.AlgCat.Monoidal -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +module + +public import Mathlib.Algebra.Category.AlgCat.Monoidal +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric /-! # The monoidal structure on `AlgCat` is symmetric. @@ -13,6 +15,8 @@ In this file we show: * `AlgCat.instSymmetricCategory : SymmetricCategory (AlgCat.{u} R)` -/ + +@[expose] public section open CategoryTheory diff --git a/Mathlib/Algebra/Category/AlgebraCat/Symmetric.lean b/Mathlib/Algebra/Category/AlgebraCat/Symmetric.lean index 3beacaab34998f..e7ce4b07c554bd 100644 --- a/Mathlib/Algebra/Category/AlgebraCat/Symmetric.lean +++ b/Mathlib/Algebra/Category/AlgebraCat/Symmetric.lean @@ -1,4 +1,6 @@ -import Mathlib.Algebra.Category.AlgCat.Monoidal -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +module + +public import Mathlib.Algebra.Category.AlgCat.Monoidal +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric deprecated_module (since := "2025-05-11") diff --git a/Mathlib/Algebra/Category/BialgCat/Basic.lean b/Mathlib/Algebra/Category/BialgCat/Basic.lean index 1b1d17c51df853..d6e8318026c021 100644 --- a/Mathlib/Algebra/Category/BialgCat/Basic.lean +++ b/Mathlib/Algebra/Category/BialgCat/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.CoalgCat.Basic -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.RingTheory.Bialgebra.Equiv +module + +public import Mathlib.Algebra.Category.CoalgCat.Basic +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.RingTheory.Bialgebra.Equiv /-! # The category of bialgebras over a commutative ring @@ -17,6 +19,8 @@ This file mimics `Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean`. -/ +@[expose] public section + open CategoryTheory universe v u diff --git a/Mathlib/Algebra/Category/BialgCat/Monoidal.lean b/Mathlib/Algebra/Category/BialgCat/Monoidal.lean index c2c03e5895dadd..07a699bbf06753 100644 --- a/Mathlib/Algebra/Category/BialgCat/Monoidal.lean +++ b/Mathlib/Algebra/Category/BialgCat/Monoidal.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.AlgCat.Monoidal -import Mathlib.Algebra.Category.BialgCat.Basic -import Mathlib.Algebra.Category.CoalgCat.Monoidal -import Mathlib.RingTheory.Bialgebra.TensorProduct +module + +public import Mathlib.Algebra.Category.AlgCat.Monoidal +public import Mathlib.Algebra.Category.BialgCat.Basic +public import Mathlib.Algebra.Category.CoalgCat.Monoidal +public import Mathlib.RingTheory.Bialgebra.TensorProduct /-! # The monoidal structure on the category of bialgebras @@ -21,6 +23,8 @@ using `Monoidal.induced`. -/ +@[expose] public section + universe u namespace BialgCat diff --git a/Mathlib/Algebra/Category/BoolRing.lean b/Mathlib/Algebra/Category/BoolRing.lean index 78332223b25f71..b337d96adf8044 100644 --- a/Mathlib/Algebra/Category/BoolRing.lean +++ b/Mathlib/Algebra/Category/BoolRing.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.Algebra.Ring.BooleanRing -import Mathlib.Order.Category.BoolAlg +module + +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.Algebra.Ring.BooleanRing +public import Mathlib.Order.Category.BoolAlg /-! # The category of Boolean rings @@ -17,6 +19,8 @@ This file defines `BoolRing`, the category of Boolean rings. Finish the equivalence with `BoolAlg`. -/ +@[expose] public section + universe u @@ -24,7 +28,8 @@ open CategoryTheory Order /-- The category of Boolean rings. -/ structure BoolRing where - private mk :: + /-- Construct a bundled `BoolRing` from a `BooleanRing`. -/ + of :: /-- The underlying type. -/ carrier : Type u [booleanRing : BooleanRing carrier] @@ -40,10 +45,6 @@ attribute [coe] carrier attribute [instance] booleanRing -/-- Construct a bundled `BoolRing` from a `BooleanRing`. -/ -abbrev of (α : Type*) [BooleanRing α] : BoolRing := - ⟨α⟩ - theorem coe_of (α : Type*) [BooleanRing α] : ↥(of α) = α := rfl diff --git a/Mathlib/Algebra/Category/CoalgCat/Basic.lean b/Mathlib/Algebra/Category/CoalgCat/Basic.lean index 4585d6e73d92f1..35bd44291d249f 100644 --- a/Mathlib/Algebra/Category/CoalgCat/Basic.lean +++ b/Mathlib/Algebra/Category/CoalgCat/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.RingTheory.Coalgebra.Equiv +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.RingTheory.Coalgebra.Equiv /-! # The category of coalgebras over a commutative ring @@ -16,6 +18,8 @@ This file mimics `Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean`. -/ +@[expose] public section + open CategoryTheory universe v u diff --git a/Mathlib/Algebra/Category/CoalgCat/ComonEquivalence.lean b/Mathlib/Algebra/Category/CoalgCat/ComonEquivalence.lean index ee8ef3d77aa0df..4808dde40af116 100644 --- a/Mathlib/Algebra/Category/CoalgCat/ComonEquivalence.lean +++ b/Mathlib/Algebra/Category/CoalgCat/ComonEquivalence.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.CoalgCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric -import Mathlib.CategoryTheory.Monoidal.Braided.Opposite -import Mathlib.CategoryTheory.Monoidal.Comon_ -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Coalgebra.TensorProduct +module + +public import Mathlib.Algebra.Category.CoalgCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +public import Mathlib.CategoryTheory.Monoidal.Braided.Opposite +public import Mathlib.CategoryTheory.Monoidal.Comon_ +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Coalgebra.TensorProduct /-! # The category equivalence between `R`-coalgebras and comonoid objects in `R-Mod` @@ -30,6 +32,8 @@ definitional equalities. -/ +@[expose] public section + suppress_compilation universe v u diff --git a/Mathlib/Algebra/Category/CoalgCat/Monoidal.lean b/Mathlib/Algebra/Category/CoalgCat/Monoidal.lean index ff095d05b4594f..5de663767ebe38 100644 --- a/Mathlib/Algebra/Category/CoalgCat/Monoidal.lean +++ b/Mathlib/Algebra/Category/CoalgCat/Monoidal.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ +module -import Mathlib.Algebra.Category.CoalgCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.RingTheory.Coalgebra.TensorProduct +public import Mathlib.Algebra.Category.CoalgCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.RingTheory.Coalgebra.TensorProduct /-! # The monoidal category structure on `R`-coalgebras @@ -23,6 +24,8 @@ using `Monoidal.induced`. -/ +@[expose] public section + universe v u namespace CoalgCat diff --git a/Mathlib/Algebra/Category/CommAlgCat/Basic.lean b/Mathlib/Algebra/Category/CommAlgCat/Basic.lean index 1104c8640a3644..81762399f8a8b6 100644 --- a/Mathlib/Algebra/Category/CommAlgCat/Basic.lean +++ b/Mathlib/Algebra/Category/CommAlgCat/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yaël Dillies, Christian Merten, Michał Mrugała, Andrew Yan Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Christian Merten, Michał Mrugała, Andrew Yang -/ -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.Algebra.Category.Ring.Under.Basic -import Mathlib.CategoryTheory.Limits.Over -import Mathlib.CategoryTheory.WithTerminal.Cone +module + +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.Algebra.Category.Ring.Under.Basic +public import Mathlib.CategoryTheory.Limits.Over +public import Mathlib.CategoryTheory.WithTerminal.Cone /-! # The category of commutative algebras over a commutative ring @@ -15,6 +17,8 @@ This file defines the bundled category `CommAlgCat` of commutative algebras over ring `R` along with the forgetful functors to `CommRingCat` and `AlgCat`. -/ +@[expose] public section + open CategoryTheory Limits universe w v u diff --git a/Mathlib/Algebra/Category/CommAlgCat/FiniteType.lean b/Mathlib/Algebra/Category/CommAlgCat/FiniteType.lean index 3e79390adae875..4b1d98b511a4ff 100644 --- a/Mathlib/Algebra/Category/CommAlgCat/FiniteType.lean +++ b/Mathlib/Algebra/Category/CommAlgCat/FiniteType.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Christian Merten, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Andrew Yang -/ -import Mathlib.Algebra.Category.CommAlgCat.Basic -import Mathlib.CategoryTheory.MorphismProperty.Comma -import Mathlib.RingTheory.FinitePresentation -import Mathlib.RingTheory.RingHomProperties +module + +public import Mathlib.Algebra.Category.CommAlgCat.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.RingTheory.FinitePresentation +public import Mathlib.RingTheory.RingHomProperties /-! # The category of finitely generated `R`-algebras @@ -14,6 +16,8 @@ import Mathlib.RingTheory.RingHomProperties We define the category of finitely generated `R`-algebras and show it is essentially small. -/ +@[expose] public section + universe w v u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/CommAlgCat/Monoidal.lean b/Mathlib/Algebra/Category/CommAlgCat/Monoidal.lean index a056640bd4d877..45d635326ac7df 100644 --- a/Mathlib/Algebra/Category/CommAlgCat/Monoidal.lean +++ b/Mathlib/Algebra/Category/CommAlgCat/Monoidal.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies, Christian Merten, Michał Mrugała, Andrew Yan Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Christian Merten, Michał Mrugała, Andrew Yang -/ -import Mathlib.Algebra.Category.CommAlgCat.Basic -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.Algebra.Category.CommAlgCat.Basic +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic /-! # The co-Cartesian monoidal category structure on commutative `R`-algebras @@ -13,6 +15,8 @@ This file provides the co-Cartesian-monoidal category structure on `CommAlgCat R explicitly using the tensor product. -/ +@[expose] public section + open CategoryTheory MonoidalCategory CartesianMonoidalCategory Limits TensorProduct Opposite open Algebra.TensorProduct open Algebra.TensorProduct (lid rid assoc comm) diff --git a/Mathlib/Algebra/Category/CommBialgCat.lean b/Mathlib/Algebra/Category/CommBialgCat.lean index 7579d7fc22093e..f645d3bcf6e593 100644 --- a/Mathlib/Algebra/Category/CommBialgCat.lean +++ b/Mathlib/Algebra/Category/CommBialgCat.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yaël Dillies, Michał Mrugała, Andrew Yang. All rights rese Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Michał Mrugała, Andrew Yang -/ -import Mathlib.Algebra.Category.CommAlgCat.Monoidal -import Mathlib.CategoryTheory.Monoidal.Mon_ -import Mathlib.RingTheory.Bialgebra.Equiv +module + +public import Mathlib.Algebra.Category.CommAlgCat.Monoidal +public import Mathlib.CategoryTheory.Monoidal.Mon_ +public import Mathlib.RingTheory.Bialgebra.Equiv /-! # The category of commutative bialgebras over a commutative ring @@ -14,6 +16,8 @@ This file defines the bundled category `CommBialgCat R` of commutative bialgebra commutative ring `R` along with the forgetful functor to `CommAlgCat`. -/ +@[expose] public section + noncomputable section open Bialgebra Coalgebra Opposite CategoryTheory Limits MonObj diff --git a/Mathlib/Algebra/Category/ContinuousCohomology/Basic.lean b/Mathlib/Algebra/Category/ContinuousCohomology/Basic.lean index bfba6521d9b1f5..165e48245c0dd2 100644 --- a/Mathlib/Algebra/Category/ContinuousCohomology/Basic.lean +++ b/Mathlib/Algebra/Category/ContinuousCohomology/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Richard Hill. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Richard Hill, Andrew Yang -/ -import Mathlib.Algebra.Category.ModuleCat.Topology.Homology -import Mathlib.Algebra.Homology.Embedding.Restriction -import Mathlib.Algebra.Homology.Functor -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.CategoryTheory.Action.Limits -import Mathlib.Topology.ContinuousMap.Algebra +module + +public import Mathlib.Algebra.Category.ModuleCat.Topology.Homology +public import Mathlib.Algebra.Homology.Embedding.Restriction +public import Mathlib.Algebra.Homology.Functor +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.CategoryTheory.Action.Limits +public import Mathlib.Topology.ContinuousMap.Algebra /-! @@ -41,6 +43,8 @@ See `ContinuousCohomology.MultiInd.d`. - Show that short exact sequences induce long exact sequences in certain scenarios. -/ +@[expose] public section + open CategoryTheory Functor ContinuousMap variable (R G : Type*) [CommRing R] [Group G] [TopologicalSpace R] diff --git a/Mathlib/Algebra/Category/FGModuleCat/Abelian.lean b/Mathlib/Algebra/Category/FGModuleCat/Abelian.lean index ba165636381d03..305f9fc50ff4b3 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Abelian.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Abelian.lean @@ -3,16 +3,20 @@ Copyright (c) 2025 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.Category.FGModuleCat.Colimits -import Mathlib.Algebra.Category.FGModuleCat.Limits -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages +module + +public import Mathlib.Algebra.Category.FGModuleCat.Colimits +public import Mathlib.Algebra.Category.FGModuleCat.Limits +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages /-! # `FGModuleCat K` is an abelian category. -/ +@[expose] public section + noncomputable section universe v u diff --git a/Mathlib/Algebra/Category/FGModuleCat/Basic.lean b/Mathlib/Algebra/Category/FGModuleCat/Basic.lean index 8d77585e482959..21f73a5ab3517f 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Basic.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed -import Mathlib.CategoryTheory.Monoidal.Rigid.Basic -import Mathlib.CategoryTheory.Monoidal.Subcategory -import Mathlib.LinearAlgebra.Coevaluation -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed +public import Mathlib.CategoryTheory.Monoidal.Rigid.Basic +public import Mathlib.CategoryTheory.Monoidal.Subcategory +public import Mathlib.LinearAlgebra.Coevaluation +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +public import Mathlib.RingTheory.TensorProduct.Finite /-! # The category of finitely generated modules over a ring @@ -30,6 +32,8 @@ and then as a right-rigid monoidal category. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean b/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean index daa5a9459c4409..52646a5d0f3344 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.Category.FGModuleCat.Basic -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Products -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.LinearAlgebra.DirectSum.Finite +module + +public import Mathlib.Algebra.Category.FGModuleCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Products +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.LinearAlgebra.DirectSum.Finite /-! # `forget₂ (FGModuleCat K) (ModuleCat K)` creates all finite colimits. @@ -17,6 +19,8 @@ And hence `FGModuleCat K` has all finite colimits. -/ +@[expose] public section + noncomputable section universe v u diff --git a/Mathlib/Algebra/Category/FGModuleCat/EssentiallySmall.lean b/Mathlib/Algebra/Category/FGModuleCat/EssentiallySmall.lean index d5f2a8524b72eb..56d21c78748b3c 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/EssentiallySmall.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/EssentiallySmall.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ +module -import Mathlib.Algebra.Category.FGModuleCat.Basic -import Mathlib.RingTheory.Finiteness.Cardinality +public import Mathlib.Algebra.Category.FGModuleCat.Basic +public import Mathlib.RingTheory.Finiteness.Cardinality /-! # The category of finitely generated modules over a ring is essentially small @@ -16,6 +17,8 @@ recommended to use the standard `CategoryTheory.SmallModel (FGModuleCat R)` inst -/ +@[expose] public section + universe v w u variable (R : Type u) [CommRing R] diff --git a/Mathlib/Algebra/Category/FGModuleCat/Limits.lean b/Mathlib/Algebra/Category/FGModuleCat/Limits.lean index d57fed4a81b44b..057edb52c39d3b 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Limits.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Limits.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.FGModuleCat.Basic -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.Algebra.Category.ModuleCat.Products -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +module + +public import Mathlib.Algebra.Category.FGModuleCat.Basic +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.Algebra.Category.ModuleCat.Products +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers /-! # `forget₂ (FGModuleCat K) (ModuleCat K)` creates all finite limits. @@ -22,6 +24,8 @@ as is done for the other algebraic categories. Analogous constructions for Noetherian modules. -/ +@[expose] public section + noncomputable section universe v u diff --git a/Mathlib/Algebra/Category/Grp/AB.lean b/Mathlib/Algebra/Category/Grp/AB.lean index aaa134ae71b9b7..5b8514dbd1cd36 100644 --- a/Mathlib/Algebra/Category/Grp/AB.lean +++ b/Mathlib/Algebra/Category/Grp/AB.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata, Moritz Firsching, Nikolas Kuhn, Amelia Livingston -/ -import Mathlib.Algebra.Category.Grp.Biproducts -import Mathlib.Algebra.Category.Grp.FilteredColimits -import Mathlib.Algebra.Homology.ShortComplex.Ab -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +module + +public import Mathlib.Algebra.Category.Grp.Biproducts +public import Mathlib.Algebra.Category.Grp.FilteredColimits +public import Mathlib.Algebra.Homology.ShortComplex.Ab +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono /-! # AB axioms for the category of abelian groups @@ -15,6 +17,8 @@ This file proves that the category of abelian groups satisfies Grothendieck's ax AB4*. -/ +@[expose] public section + universe u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/Grp/Abelian.lean b/Mathlib/Algebra/Category/Grp/Abelian.lean index b72a6a633be132..f7f4596c8f3512 100644 --- a/Mathlib/Algebra/Category/Grp/Abelian.lean +++ b/Mathlib/Algebra/Category/Grp/Abelian.lean @@ -3,17 +3,21 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.Grp.Colimits -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.Algebra.Category.Grp.ZModuleEquivalence -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic +module + +public import Mathlib.Algebra.Category.Grp.Colimits +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.Algebra.Category.Grp.ZModuleEquivalence +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic /-! # The category of abelian groups is abelian -/ +@[expose] public section + open CategoryTheory Limits universe u diff --git a/Mathlib/Algebra/Category/Grp/Adjunctions.lean b/Mathlib/Algebra/Category/Grp/Adjunctions.lean index 02987e658745ce..9e7cf819da1650 100644 --- a/Mathlib/Algebra/Category/Grp/Adjunctions.lean +++ b/Mathlib/Algebra/Category/Grp/Adjunctions.lean @@ -3,9 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johannes Hölzl -/ -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.GroupTheory.FreeAbelianGroup -import Mathlib.CategoryTheory.Limits.Types.Shapes +module + +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.GroupTheory.FreeAbelianGroup +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Types.Coproducts /-! # Adjunctions regarding the category of (abelian) groups @@ -31,6 +34,8 @@ category of abelian groups. abelian groups to groups. -/ +@[expose] public section + assert_not_exists Cardinal noncomputable section diff --git a/Mathlib/Algebra/Category/Grp/Basic.lean b/Mathlib/Algebra/Category/Grp/Basic.lean index c0c1f4674821f0..cf0ac2b27e0bf0 100644 --- a/Mathlib/Algebra/Category/Grp/Basic.lean +++ b/Mathlib/Algebra/Category/Grp/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Group.End -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.Data.Int.Cast.Lemmas +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Group.End +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.Data.Int.Cast.Lemmas /-! # Category instances for Group, AddGroup, CommGroup, and AddCommGroup. @@ -20,6 +22,8 @@ We introduce the bundled categories: along with the relevant forgetful functors between them, and to the bundled monoid categories. -/ +@[expose] public section + universe u v open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/Biproducts.lean b/Mathlib/Algebra/Category/Grp/Biproducts.lean index e98adcaea7edf6..d4fe3ca775ee33 100644 --- a/Mathlib/Algebra/Category/Grp/Biproducts.lean +++ b/Mathlib/Algebra/Category/Grp/Biproducts.lean @@ -3,16 +3,20 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.CategoryTheory.Preadditive.Biproducts -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.Tactic.CategoryTheory.Elementwise +module + +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.CategoryTheory.Preadditive.Biproducts +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.Tactic.CategoryTheory.Elementwise /-! # The category of abelian groups has finite biproducts -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/CartesianMonoidal.lean b/Mathlib/Algebra/Category/Grp/CartesianMonoidal.lean index 55f03cc6ca42e2..5f306ef3b98657 100644 --- a/Mathlib/Algebra/Category/Grp/CartesianMonoidal.lean +++ b/Mathlib/Algebra/Category/Grp/CartesianMonoidal.lean @@ -3,15 +3,19 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.Grp.Biproducts -import Mathlib.Algebra.Category.Grp.Zero -import Mathlib.Algebra.Ring.PUnit -import Mathlib.CategoryTheory.Monoidal.Types.Basic +module + +public import Mathlib.Algebra.Category.Grp.Biproducts +public import Mathlib.Algebra.Category.Grp.Zero +public import Mathlib.Algebra.Ring.PUnit +public import Mathlib.CategoryTheory.Monoidal.Types.Basic /-! # Chosen finite products in `GrpCat` and friends -/ +@[expose] public section + open CategoryTheory Limits MonoidalCategory universe u diff --git a/Mathlib/Algebra/Category/Grp/ChosenFiniteProducts.lean b/Mathlib/Algebra/Category/Grp/ChosenFiniteProducts.lean index f450e1ea57b6ec..825020c9933271 100644 --- a/Mathlib/Algebra/Category/Grp/ChosenFiniteProducts.lean +++ b/Mathlib/Algebra/Category/Grp/ChosenFiniteProducts.lean @@ -1,3 +1,5 @@ -import Mathlib.Algebra.Category.Grp.CartesianMonoidal +module + +public import Mathlib.Algebra.Category.Grp.CartesianMonoidal deprecated_module (since := "2025-05-15") diff --git a/Mathlib/Algebra/Category/Grp/Colimits.lean b/Mathlib/Algebra/Category/Grp/Colimits.lean index 7892ddc35682de..b29bb1d2c33635 100644 --- a/Mathlib/Algebra/Category/Grp/Colimits.lean +++ b/Mathlib/Algebra/Category/Grp/Colimits.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Sophie Morel -/ -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.Algebra.Group.Shrink -import Mathlib.CategoryTheory.ConcreteCategory.Elementwise -import Mathlib.Data.DFinsupp.BigOperators -import Mathlib.Data.DFinsupp.Small -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.CategoryTheory.ConcreteCategory.Elementwise +public import Mathlib.Data.DFinsupp.BigOperators +public import Mathlib.Data.DFinsupp.Small +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # The category of additive commutative groups has all colimits. @@ -17,6 +19,8 @@ quotients of finitely supported functions. -/ +@[expose] public section + universe u' w u v open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/Grp/EnoughInjectives.lean b/Mathlib/Algebra/Category/Grp/EnoughInjectives.lean index 7127838c27bc92..bc6e16a852e7ae 100644 --- a/Mathlib/Algebra/Category/Grp/EnoughInjectives.lean +++ b/Mathlib/Algebra/Category/Grp/EnoughInjectives.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Junyan Xu -/ +module -import Mathlib.Algebra.Module.CharacterModule -import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup -import Mathlib.Algebra.Category.Grp.EpiMono -import Mathlib.Algebra.Category.Grp.Injective +public import Mathlib.Algebra.Module.CharacterModule +public import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup +public import Mathlib.Algebra.Category.Grp.EpiMono +public import Mathlib.Algebra.Category.Grp.Injective /-! @@ -28,6 +29,8 @@ injective presentation for `A`, hence category of abelian groups has enough inje This file is split from `Mathlib/Algebra/Category/GrpCat/Injective.lean` to prevent import loops. -/ +@[expose] public section + open CategoryTheory universe u diff --git a/Mathlib/Algebra/Category/Grp/EpiMono.lean b/Mathlib/Algebra/Category/Grp/EpiMono.lean index a0a2eb961710cc..988aef9d8d6f4d 100644 --- a/Mathlib/Algebra/Category/Grp/EpiMono.lean +++ b/Mathlib/Algebra/Category/Grp/EpiMono.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.GroupTheory.Coset.Basic -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.GroupTheory.Coset.Basic +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # Monomorphisms and epimorphisms in `Group` @@ -15,6 +17,8 @@ In this file, we prove monomorphisms in the category of groups are injective hom epimorphisms are surjective homomorphisms. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Category/Grp/EquivalenceGroupAddGroup.lean b/Mathlib/Algebra/Category/Grp/EquivalenceGroupAddGroup.lean index 1132a634dc5127..44d8d10eadc758 100644 --- a/Mathlib/Algebra/Category/Grp/EquivalenceGroupAddGroup.lean +++ b/Mathlib/Algebra/Category/Grp/EquivalenceGroupAddGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Category.Grp.Basic +module + +public import Mathlib.Algebra.Category.Grp.Basic /-! # Equivalence between `Group` and `AddGroup` @@ -15,6 +17,8 @@ This file contains two equivalences: by sending `X : CommGrpCat` to `Additive X` and `Y : AddCommGrpCat` to `Multiplicative Y`. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/FilteredColimits.lean b/Mathlib/Algebra/Category/Grp/FilteredColimits.lean index a4c06f4a773d89..2a40dc749f86d8 100644 --- a/Mathlib/Algebra/Category/Grp/FilteredColimits.lean +++ b/Mathlib/Algebra/Category/Grp/FilteredColimits.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Justus Springer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Justus Springer -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.Algebra.Category.MonCat.FilteredColimits +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.Algebra.Category.MonCat.FilteredColimits /-! # The forgetful functor from (commutative) (additive) groups preserves filtered colimits. @@ -21,6 +23,8 @@ Similarly for `AddGrpCat`, `CommGrpCat` and `AddCommGrpCat`. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Category/Grp/FiniteGrp.lean b/Mathlib/Algebra/Category/Grp/FiniteGrp.lean index 0aa9c6c28c2ae3..9577779364eebe 100644 --- a/Mathlib/Algebra/Category/Grp/FiniteGrp.lean +++ b/Mathlib/Algebra/Category/Grp/FiniteGrp.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Nailin Guan, Yuyang Zhao -/ -import Mathlib.Data.Finite.Defs -import Mathlib.Algebra.Category.Grp.Basic +module + +public import Mathlib.Data.Finite.Defs +public import Mathlib.Algebra.Category.Grp.Basic /-! @@ -14,6 +16,8 @@ import Mathlib.Algebra.Category.Grp.Basic -/ +@[expose] public section + universe u v open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/ForgetCorepresentable.lean b/Mathlib/Algebra/Category/Grp/ForgetCorepresentable.lean index 48bba3325197f7..256fe8ba3afc42 100644 --- a/Mathlib/Algebra/Category/Grp/ForgetCorepresentable.lean +++ b/Mathlib/Algebra/Category/Grp/ForgetCorepresentable.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.CategoryTheory.Yoneda /-! # The forget functor is corepresentable @@ -15,6 +17,8 @@ and `GrpCat`. -/ +@[expose] public section + universe u open CategoryTheory Opposite diff --git a/Mathlib/Algebra/Category/Grp/Images.lean b/Mathlib/Algebra/Category/Grp/Images.lean index ce0db02bc2810c..84b5d244342071 100644 --- a/Mathlib/Algebra/Category/Grp/Images.lean +++ b/Mathlib/Algebra/Category/Grp/Images.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.CategoryTheory.Limits.Shapes.Images +module + +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.CategoryTheory.Limits.Shapes.Images /-! # The category of commutative additive groups has images. @@ -13,6 +15,8 @@ Note that we don't need to register any of the constructions here as instances, from the fact that `AddCommGrpCat` is an abelian category. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/Injective.lean b/Mathlib/Algebra/Category/Grp/Injective.lean index d45ca7abd45731..5cbe55918f928e 100644 --- a/Mathlib/Algebra/Category/Grp/Injective.lean +++ b/Mathlib/Algebra/Category/Grp/Injective.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Category.Grp.ZModuleEquivalence -import Mathlib.Algebra.Category.ModuleCat.Injective -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.GroupTheory.Divisible -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.Category.Grp.ZModuleEquivalence +public import Mathlib.Algebra.Category.ModuleCat.Injective +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.GroupTheory.Divisible +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Injective objects in the category of abelian groups @@ -22,6 +24,8 @@ in `Mathlib/Algebra/Category/GrpCat/EnoughInjectives.lean`. -/ +@[expose] public section + open CategoryTheory open Pointwise diff --git a/Mathlib/Algebra/Category/Grp/IsFinite.lean b/Mathlib/Algebra/Category/Grp/IsFinite.lean index 38149b99234081..89ec8e5a2f8ed6 100644 --- a/Mathlib/Algebra/Category/Grp/IsFinite.lean +++ b/Mathlib/Algebra/Category/Grp/IsFinite.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.Algebra.Category.Grp.EpiMono -import Mathlib.Algebra.Category.Grp.Zero -import Mathlib.Algebra.Homology.ShortComplex.Ab -import Mathlib.CategoryTheory.Abelian.SerreClass.Basic -import Mathlib.Data.Finite.Prod +module + +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.Algebra.Category.Grp.EpiMono +public import Mathlib.Algebra.Category.Grp.Zero +public import Mathlib.Algebra.Homology.ShortComplex.Ab +public import Mathlib.CategoryTheory.Abelian.SerreClass.Basic +public import Mathlib.Data.Finite.Prod /-! # The Serre class of finite abelian groups @@ -18,6 +20,8 @@ that it is a Serre class. -/ +@[expose] public section + universe u open CategoryTheory Limits ZeroObject diff --git a/Mathlib/Algebra/Category/Grp/Kernels.lean b/Mathlib/Algebra/Category/Grp/Kernels.lean index d26db40873eaa5..a37dcdbb77d284 100644 --- a/Mathlib/Algebra/Category/Grp/Kernels.lean +++ b/Mathlib/Algebra/Category/Grp/Kernels.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata, Moritz Firsching, Nikolas Kuhn -/ -import Mathlib.Algebra.Category.Grp.EpiMono -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.CategoryTheory.Limits.Shapes.Kernels +module + +public import Mathlib.Algebra.Category.Grp.EpiMono +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! # The concrete (co)kernels in the category of abelian groups are categorical (co)kernels. -/ +@[expose] public section + namespace AddCommGrpCat open AddMonoidHom CategoryTheory Limits QuotientAddGroup diff --git a/Mathlib/Algebra/Category/Grp/LargeColimits.lean b/Mathlib/Algebra/Category/Grp/LargeColimits.lean index 70533e5076d273..a343a5c0fefe06 100644 --- a/Mathlib/Algebra/Category/Grp/LargeColimits.lean +++ b/Mathlib/Algebra/Category/Grp/LargeColimits.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.Category.Grp.Colimits -import Mathlib.Algebra.Module.CharacterModule -import Mathlib.Algebra.Group.Equiv.Basic +module + +public import Mathlib.Algebra.Category.Grp.Colimits +public import Mathlib.Algebra.Module.CharacterModule +public import Mathlib.Algebra.Group.Equiv.Basic /-! # Existence of "big" colimits in the category of additive commutative groups @@ -16,6 +18,8 @@ by the relations given by the morphisms in the diagram) is `w`-small. -/ +@[expose] public section + universe w u v open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/Grp/LeftExactFunctor.lean b/Mathlib/Algebra/Category/Grp/LeftExactFunctor.lean index aca44f7e41b0b7..eee1d4aff905fd 100644 --- a/Mathlib/Algebra/Category/Grp/LeftExactFunctor.lean +++ b/Mathlib/Algebra/Category/Grp/LeftExactFunctor.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.Grp.CartesianMonoidal -import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup -import Mathlib.CategoryTheory.Monoidal.Internal.Types.CommGrp_ -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Preadditive.CommGrp_ +module + +public import Mathlib.Algebra.Category.Grp.CartesianMonoidal +public import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup +public import Mathlib.CategoryTheory.Monoidal.Internal.Types.CommGrp_ +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Preadditive.CommGrp_ /-! # The forgetful functor `(C ⥤ₗ AddCommGroup) ⥤ (C ⥤ₗ Type v)` is an equivalence @@ -26,6 +28,8 @@ can be shown that this construction gives a quasi-inverse to the whiskering oper `(C ⥤ₗ AddCommGrpCat.{v}) ⥤ (C ⥤ₗ Type v)`. -/ +@[expose] public section + open CategoryTheory MonoidalCategory Limits diff --git a/Mathlib/Algebra/Category/Grp/Limits.lean b/Mathlib/Algebra/Category/Grp/Limits.lean index 33406f7250c4e3..951e458f4c574a 100644 --- a/Mathlib/Algebra/Category/Grp/Limits.lean +++ b/Mathlib/Algebra/Category/Grp/Limits.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.Grp.ForgetCorepresentable -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.Algebra.Category.MonCat.ForgetCorepresentable -import Mathlib.Algebra.Category.MonCat.Limits -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.CategoryTheory.ConcreteCategory.ReflectsIso -import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic +module + +public import Mathlib.Algebra.Category.Grp.ForgetCorepresentable +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.Algebra.Category.MonCat.ForgetCorepresentable +public import Mathlib.Algebra.Category.MonCat.Limits +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.CategoryTheory.ConcreteCategory.ReflectsIso +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic /-! # The category of (commutative) (additive) groups has all limits @@ -19,6 +21,8 @@ the underlying types are just the limits in the category of types. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits universe v u w @@ -143,7 +147,7 @@ instance hasLimitsOfShape [Small.{u} J] : HasLimitsOfShape J GrpCat.{u} where has_limit _ := inferInstance /-- The category of groups has all limits. -/ -@[to_additive (relevant_arg := 100) /-- The category of additive groups has all limits. -/] +@[to_additive (relevant_arg := _) /-- The category of additive groups has all limits. -/] instance hasLimitsOfSize [UnivLE.{v, u}] : HasLimitsOfSize.{w, v} GrpCat.{u} where has_limits_of_shape J _ := { } @@ -155,7 +159,7 @@ instance hasLimits : HasLimits GrpCat.{u} := This means the underlying monoid of a limit can be computed as a limit in the category of monoids. -/ -@[to_additive (relevant_arg := 100) AddGrpCat.forget₂AddMonPreservesLimitsOfSize +@[to_additive (relevant_arg := _) AddGrpCat.forget₂AddMonPreservesLimitsOfSize /-- The forgetful functor from additive groups to additive monoids preserves all limits. This means the underlying additive monoid of a limit can be computed as a limit in the category of @@ -179,7 +183,7 @@ instance forget_preservesLimitsOfShape [Small.{u} J] : /-- The forgetful functor from groups to types preserves all limits. This means the underlying type of a limit can be computed as a limit in the category of types. -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The forgetful functor from additive groups to types preserves all limits. This means the underlying type of a limit can be computed as a limit in the category of types. -/] @@ -203,7 +207,7 @@ noncomputable instance forget_createsLimitsOfShape : /-- The forgetful functor from groups to types creates all limits. -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The forgetful functor from additive groups to types creates all limits. -/] noncomputable instance forget_createsLimitsOfSize : CreatesLimitsOfSize.{w, v} (forget GrpCat.{u}) where @@ -311,7 +315,7 @@ instance hasLimitsOfShape [Small.{u} J] : HasLimitsOfShape J CommGrpCat.{u} wher has_limit _ := inferInstance /-- The category of commutative groups has all limits. -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The category of additive commutative groups has all limits. -/] instance hasLimitsOfSize [UnivLE.{v, u}] : HasLimitsOfSize.{w, v} CommGrpCat.{u} where has_limits_of_shape _ _ := { } @@ -339,7 +343,7 @@ instance forget₂Group_preservesLimitsOfShape : (That is, the underlying group could have been computed instead as limits in the category of groups.) -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The forgetful functor from additive commutative groups to additive groups preserves all limits. (That is, the underlying group could have been computed instead as limits in the category of additive groups.) -/] @@ -423,7 +427,7 @@ noncomputable instance forget_createsLimitsOfShape (J : Type v) [Category.{w} J] /-- The forgetful functor from commutative groups to types creates all limits. -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The forgetful functor from additive commutative groups to types creates all limits. -/] noncomputable instance forget_createsLimitsOfSize : CreatesLimitsOfSize.{w, v} (forget CommGrpCat.{u}) where diff --git a/Mathlib/Algebra/Category/Grp/Preadditive.lean b/Mathlib/Algebra/Category/Grp/Preadditive.lean index 5d75805a9873e8..a387bde9581f22 100644 --- a/Mathlib/Algebra/Category/Grp/Preadditive.lean +++ b/Mathlib/Algebra/Category/Grp/Preadditive.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.CategoryTheory.Preadditive.Basic +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.CategoryTheory.Preadditive.Basic /-! # The category of additive commutative groups is preadditive. -/ +@[expose] public section + assert_not_exists Subgroup open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/Subobject.lean b/Mathlib/Algebra/Category/Grp/Subobject.lean index 623d8b2092a446..c551352ad4749c 100644 --- a/Mathlib/Algebra/Category/Grp/Subobject.lean +++ b/Mathlib/Algebra/Category/Grp/Subobject.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.Grp.ZModuleEquivalence -import Mathlib.Algebra.Category.ModuleCat.Subobject +module + +public import Mathlib.Algebra.Category.Grp.ZModuleEquivalence +public import Mathlib.Algebra.Category.ModuleCat.Subobject /-! # The category of abelian groups is well-powered -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/Ulift.lean b/Mathlib/Algebra/Category/Grp/Ulift.lean index 43d93f816bfe5f..9005b11467b0f4 100644 --- a/Mathlib/Algebra/Category/Grp/Ulift.lean +++ b/Mathlib/Algebra/Category/Grp/Ulift.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.Category.Grp.LargeColimits -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.Algebra.Module.CharacterModule -import Mathlib.CategoryTheory.Limits.Preserves.Ulift +module + +public import Mathlib.Algebra.Category.Grp.LargeColimits +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.Algebra.Module.CharacterModule +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift /-! # Properties of the universe lift functor for groups @@ -67,6 +69,8 @@ of `K ⋙ GrpCat.uliftFunctor.{u + 1}` is nontrivial (it is the "union" of all t too big to be in `GrpCat.{u}`). -/ +@[expose] public section + universe v w w' u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/Grp/Yoneda.lean b/Mathlib/Algebra/Category/Grp/Yoneda.lean index 673c1e6a64b660..f284e6513b28b6 100644 --- a/Mathlib/Algebra/Category/Grp/Yoneda.lean +++ b/Mathlib/Algebra/Category/Grp/Yoneda.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.CategoryTheory.Yoneda /-! # Yoneda embeddings @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Yoneda This file defines a few Yoneda embeddings for the category of commutative groups. -/ +@[expose] public section + open CategoryTheory universe u diff --git a/Mathlib/Algebra/Category/Grp/ZModuleEquivalence.lean b/Mathlib/Algebra/Category/Grp/ZModuleEquivalence.lean index 5b797c765eaf95..ad35312ca7d1da 100644 --- a/Mathlib/Algebra/Category/Grp/ZModuleEquivalence.lean +++ b/Mathlib/Algebra/Category/Grp/ZModuleEquivalence.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic /-! The forgetful functor from ℤ-modules to additive commutative groups is @@ -14,6 +16,8 @@ either use this equivalence to transport the monoidal structure from `Module ℤ or, having constructed that monoidal structure directly, show this functor is monoidal. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/Grp/Zero.lean b/Mathlib/Algebra/Category/Grp/Zero.lean index e468ed4058ef9f..7248c553f904c5 100644 --- a/Mathlib/Algebra/Category/Grp/Zero.lean +++ b/Mathlib/Algebra/Category/Grp/Zero.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects /-! # The category of (commutative) (additive) groups has a zero object. @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects rather than from the existence of a zero object. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/GrpWithZero.lean b/Mathlib/Algebra/Category/GrpWithZero.lean index f32c2909f86477..c8e3a456932af2 100644 --- a/Mathlib/Algebra/Category/GrpWithZero.lean +++ b/Mathlib/Algebra/Category/GrpWithZero.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.GroupWithZero.WithZero -import Mathlib.CategoryTheory.Category.Bipointed +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.GroupWithZero.WithZero +public import Mathlib.CategoryTheory.Category.Bipointed /-! # The category of groups with zero @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Category.Bipointed This file defines `GrpWithZero`, the category of groups with zero. -/ +@[expose] public section + assert_not_exists Ring universe u @@ -21,6 +25,8 @@ open CategoryTheory /-- The category of groups with zero. -/ structure GrpWithZero where + /-- Construct a bundled `GrpWithZero` from a `GroupWithZero`. -/ + of :: /-- The underlying group with zero. -/ carrier : Type* [str : GroupWithZero carrier] @@ -32,10 +38,6 @@ namespace GrpWithZero instance : CoeSort GrpWithZero Type* := ⟨carrier⟩ -/-- Construct a bundled `GrpWithZero` from a `GroupWithZero`. -/ -abbrev of (α : Type*) [GroupWithZero α] : GrpWithZero where - carrier := α - instance : Inhabited GrpWithZero := ⟨of (WithZero PUnit)⟩ diff --git a/Mathlib/Algebra/Category/HopfAlgCat/Basic.lean b/Mathlib/Algebra/Category/HopfAlgCat/Basic.lean index b852ea6d11bf00..ae53159b446e2c 100644 --- a/Mathlib/Algebra/Category/HopfAlgCat/Basic.lean +++ b/Mathlib/Algebra/Category/HopfAlgCat/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.BialgCat.Basic -import Mathlib.RingTheory.HopfAlgebra.Basic +module + +public import Mathlib.Algebra.Category.BialgCat.Basic +public import Mathlib.RingTheory.HopfAlgebra.Basic /-! # The category of Hopf algebras over a commutative ring @@ -16,6 +18,8 @@ This file mimics `Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean`. -/ +@[expose] public section + open CategoryTheory universe v u @@ -24,6 +28,7 @@ variable (R : Type u) [CommRing R] /-- The category of `R`-Hopf algebras. -/ structure HopfAlgCat where + private mk :: /-- The underlying type. -/ carrier : Type v [instRing : Ring carrier] diff --git a/Mathlib/Algebra/Category/HopfAlgCat/Monoidal.lean b/Mathlib/Algebra/Category/HopfAlgCat/Monoidal.lean index 64bbf329c76bcf..b5b11a1288ca73 100644 --- a/Mathlib/Algebra/Category/HopfAlgCat/Monoidal.lean +++ b/Mathlib/Algebra/Category/HopfAlgCat/Monoidal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.BialgCat.Monoidal -import Mathlib.Algebra.Category.HopfAlgCat.Basic -import Mathlib.RingTheory.HopfAlgebra.TensorProduct +module + +public import Mathlib.Algebra.Category.BialgCat.Monoidal +public import Mathlib.Algebra.Category.HopfAlgCat.Basic +public import Mathlib.RingTheory.HopfAlgebra.TensorProduct /-! # The monoidal structure on the category of Hopf algebras @@ -17,6 +19,8 @@ Here, we use this to declare a `MonoidalCategory` instance on the category of Ho the existing monoidal structure on `BialgCat`. -/ +@[expose] public section + universe u namespace HopfAlgCat diff --git a/Mathlib/Algebra/Category/ModuleCat/AB.lean b/Mathlib/Algebra/Category/ModuleCat/AB.lean index 599e1c7d296600..ccff92713f56e8 100644 --- a/Mathlib/Algebra/Category/ModuleCat/AB.lean +++ b/Mathlib/Algebra/Category/ModuleCat/AB.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Algebra.Category.Grp.AB -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Module.Shrink -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +module + +public import Mathlib.Algebra.Category.Grp.AB +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Module.Shrink +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic /-! # AB axioms in module categories @@ -16,6 +18,8 @@ and AB4*. Further, it proves that `R` is a separator in the category of modules concludes that this category is Grothendieck abelian. -/ +@[expose] public section + universe u v open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Abelian.lean b/Mathlib/Algebra/Category/ModuleCat/Abelian.lean index d41a39b3633f01..a876d7e09d433a 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Abelian.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Abelian.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.Algebra.Category.ModuleCat.Kernels -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.CategoryTheory.Abelian.Basic +module + +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.Algebra.Category.ModuleCat.Kernels +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.CategoryTheory.Abelian.Basic /-! # The category of left R-modules is abelian. @@ -14,6 +16,8 @@ import Mathlib.CategoryTheory.Abelian.Basic Additionally, two linear maps are exact in the categorical sense iff `range f = ker g`. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean b/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean index 1b4ca8874b19bc..a5e8609a48faec 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin -/ -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic -import Mathlib.CategoryTheory.Monoidal.Types.Basic -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.CategoryTheory.Linear.LinearFunctor +module + +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +public import Mathlib.CategoryTheory.Monoidal.Types.Basic +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.CategoryTheory.Linear.LinearFunctor /-! The functor of forming finitely supported functions on a type with values in a `[Ring R]` @@ -14,6 +16,8 @@ is the left adjoint of the forgetful functor from `R`-modules to types. -/ +@[expose] public section + assert_not_exists Cardinal diff --git a/Mathlib/Algebra/Category/ModuleCat/Algebra.lean b/Mathlib/Algebra/Category/ModuleCat/Algebra.lean index 275ae2fa12b4ff..40cd138b3b401b 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Algebra.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.Algebra.Category.ModuleCat.Basic +module + +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.Algebra.Category.ModuleCat.Basic /-! # Additional typeclass for modules over an algebra @@ -29,6 +31,8 @@ that carries these typeclasses, this seems hard to achieve. requiring users to write `ModuleCat' ℤ A` when `A` is merely a ring.) -/ +@[expose] public section + universe v u w diff --git a/Mathlib/Algebra/Category/ModuleCat/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Basic.lean index 82ea02742e94f4..72efe1368091d5 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Robert A. Spencer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert A. Spencer, Markus Himmel -/ -import Mathlib.Algebra.Category.ModuleCat.Semi -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.Algebra.Category.ModuleCat.Semi +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # The category of `R`-modules @@ -31,6 +33,8 @@ Similarly, given an isomorphism `f : M ≅ N` use `f.toLinearEquiv` and given a `f : M ≃ₗ[R] N`, use `f.toModuleIso`. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Biproducts.lean b/Mathlib/Algebra/Category/ModuleCat/Biproducts.lean index 105b270f5efd24..ebaed602ebee67 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Biproducts.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Biproducts.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +module + +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat /-! # The category of `R`-modules has finite biproducts -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean b/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean index f2c79cacff1c8a..0b60a8febf9930 100644 --- a/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean +++ b/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.CategoryTheory.Adjunction.Mates -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.LinearAlgebra.TensorProduct.Tower +module + +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.CategoryTheory.Adjunction.Mates +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.LinearAlgebra.TensorProduct.Tower /-! # Change Of Rings @@ -43,6 +45,8 @@ Let `R, S` be rings and `f : R →+* S` `s ⊗ m : S ⊗[R, f] M`. -/ +@[expose] public section + suppress_compilation @@ -325,7 +329,7 @@ theorem map'_comp {M₁ M₂ M₃ : ModuleCat.{v} R} (l₁₂ : M₁ ⟶ M₂) ( induction x using TensorProduct.induction_on with | zero => rfl | tmul => rfl - | add _ _ ihx ihy => rw [map_add, map_add, ihx, ihy] + | add _ _ ihx ihy => grind end ExtendScalars diff --git a/Mathlib/Algebra/Category/ModuleCat/Colimits.lean b/Mathlib/Algebra/Category/ModuleCat/Colimits.lean index a0364c9f7bad9a..e982cbe31b5d5e 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Colimits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Colimits.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.CategoryTheory.ConcreteCategory.Elementwise -import Mathlib.Algebra.Category.Grp.Colimits +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.Elementwise +public import Mathlib.Algebra.Category.Grp.Colimits /-! # The category of R-modules has all colimits. @@ -21,6 +23,8 @@ In fact, in `ModuleCat R` there is a much nicer model of colimits as quotients of finitely supported functions, and we really should implement this as well. -/ +@[expose] public section + universe w' w u v open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean index 4019891ec410b5..13a0c2bd109c6a 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.RingTheory.Kaehler.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.RingTheory.Kaehler.Basic /-! # The differentials of a morphism in the category of commutative rings @@ -18,6 +20,8 @@ We also construct the module of differentials -/ +@[expose] public section + universe v u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean b/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean index b97ea71e836873..bae7cf8db5072e 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic /-! # The presheaf of differentials of a presheaf of modules @@ -35,6 +37,8 @@ to show that the two vanishing conditions `d_app` are equivalent). -/ +@[expose] public section + universe v u v₁ v₂ u₁ u₂ open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/EnoughInjectives.lean b/Mathlib/Algebra/Category/ModuleCat/EnoughInjectives.lean index 7bd654eb0c8c61..d4027d6b06fead 100644 --- a/Mathlib/Algebra/Category/ModuleCat/EnoughInjectives.lean +++ b/Mathlib/Algebra/Category/ModuleCat/EnoughInjectives.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Category.Grp.EnoughInjectives -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.Algebra.Ring.Shrink +module + +public import Mathlib.Algebra.Category.Grp.EnoughInjectives +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.Algebra.Ring.Shrink /-! # Category of $R$-modules has enough injectives @@ -14,6 +16,8 @@ We lift enough injectives of abelian groups to arbitrary $R$-modules by adjoint `restrictScalars ⊣ coextendScalars` -/ +@[expose] public section + open CategoryTheory universe v u diff --git a/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean b/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean index b1967a8ea1eb06..32f557e5d25a62 100644 --- a/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean +++ b/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono /-! # Monomorphisms in `Module R` @@ -14,6 +16,8 @@ This file shows that an `R`-linear map is a monomorphism in the category of `R`- if and only if it is injective, and similarly an epimorphism if and only if it is surjective. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Category/ModuleCat/ExteriorPower.lean b/Mathlib/Algebra/Category/ModuleCat/ExteriorPower.lean index e264e0042aec06..c1bf6b14d57304 100644 --- a/Mathlib/Algebra/Category/ModuleCat/ExteriorPower.lean +++ b/Mathlib/Algebra/Category/ModuleCat/ExteriorPower.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.LinearAlgebra.ExteriorPower.Basic -import Mathlib.Algebra.Category.ModuleCat.Basic +module + +public import Mathlib.LinearAlgebra.ExteriorPower.Basic +public import Mathlib.Algebra.Category.ModuleCat.Basic /-! # The exterior powers as functors on the category of modules @@ -14,6 +16,8 @@ and this extends to a functor `ModuleCat.exteriorPower.functor : ModuleCat R ⥤ -/ +@[expose] public section + universe v u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean b/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean index dd49339fefd500..64cf870b3ee45b 100644 --- a/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Justus Springer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Justus Springer -/ -import Mathlib.Algebra.Category.Grp.FilteredColimits -import Mathlib.Algebra.Category.ModuleCat.Colimits +module + +public import Mathlib.Algebra.Category.Grp.FilteredColimits +public import Mathlib.Algebra.Category.ModuleCat.Colimits /-! # The forgetful functor from `R`-modules preserves filtered colimits. @@ -20,6 +22,8 @@ implies that `forget (ModuleCat R)` preserves filtered colimits. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Category/ModuleCat/Free.lean b/Mathlib/Algebra/Category/ModuleCat/Free.lean index 6cca42e75a6fda..e2c55be05625c6 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Free.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Free.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.LinearAlgebra.Dimension.Free -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +module + +public import Mathlib.LinearAlgebra.Dimension.Free +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat /-! # Exact sequences with free modules @@ -26,6 +28,8 @@ linear algebra, module, free -/ +@[expose] public section + open CategoryTheory Module namespace ModuleCat diff --git a/Mathlib/Algebra/Category/ModuleCat/Images.lean b/Mathlib/Algebra/Category/ModuleCat/Images.lean index 186f5be8cdd48e..9b8403e83faf32 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Images.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Images.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.CategoryTheory.Limits.Shapes.Images +module + +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.CategoryTheory.Limits.Shapes.Images /-! # The category of R-modules has images. @@ -13,6 +15,8 @@ Note that we don't need to register any of the constructions here as instances, from the fact that `ModuleCat R` is an abelian category. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Injective.lean b/Mathlib/Algebra/Category/ModuleCat/Injective.lean index a0e3547845f395..cc0540901251e0 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Injective.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Injective.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Module.Injective -import Mathlib.CategoryTheory.Preadditive.Injective.Basic -import Mathlib.Algebra.Category.ModuleCat.EpiMono +module + +public import Mathlib.Algebra.Module.Injective +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic +public import Mathlib.Algebra.Category.ModuleCat.EpiMono /-! # Injective objects in the category of $R$-modules -/ +@[expose] public section + open CategoryTheory universe u v diff --git a/Mathlib/Algebra/Category/ModuleCat/Kernels.lean b/Mathlib/Algebra/Category/ModuleCat/Kernels.lean index 4735438d07853e..6a4c4daed4d98c 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Kernels.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Kernels.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.CategoryTheory.ConcreteCategory.Elementwise +module + +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.CategoryTheory.ConcreteCategory.Elementwise /-! # The concrete (co)kernels in the category of modules are (co)kernels in the categorical sense. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits @@ -33,11 +37,7 @@ def kernelIsLimit : IsLimit (kernelCone f) := (fun s => ofHom <| -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11036): broken dot notation on LinearMap.ker LinearMap.codRestrict (LinearMap.ker f.hom) (Fork.ι s).hom fun c => - LinearMap.mem_ker.2 <| by - -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 - erw [← ConcreteCategory.comp_apply] - rw [Fork.condition, HasZeroMorphisms.comp_zero (Fork.ι s) N] - rfl) + LinearMap.mem_ker.2 <| by simp [← ConcreteCategory.comp_apply]) (fun _ => hom_ext <| LinearMap.subtype_comp_codRestrict _ _ _) fun s m h => hom_ext <| LinearMap.ext fun x => Subtype.ext_iff.2 (by simp [← h]; rfl) diff --git a/Mathlib/Algebra/Category/ModuleCat/LeftResolution.lean b/Mathlib/Algebra/Category/ModuleCat/LeftResolution.lean new file mode 100644 index 00000000000000..af3d8922d7d143 --- /dev/null +++ b/Mathlib/Algebra/Category/ModuleCat/LeftResolution.lean @@ -0,0 +1,46 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.Algebra.Category.ModuleCat.Adjunctions +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Homology.LeftResolution.Basic + +/-! +# Functorial projective resolutions of modules + +The fact that a `R`-module `M` can be functorially written as a quotient of a +projective `R`-module is expressed as the definition `ModuleCat.projectiveResolution`. +Using the construction in the file `Algebra.Homology.LeftResolution.Basic`, +we may obtain a functor `(projectiveResolution R).chainComplexFunctor` which +sends `M : ModuleCat R` to a projective resolution. + +-/ + +@[expose] public section + +universe u + +variable (R : Type u) [Ring R] + +namespace ModuleCat + +open CategoryTheory Abelian + +instance (X : Type u) : Projective ((free R).obj X) where + factors {M N} f p hp := by + rw [epi_iff_surjective] at hp + obtain ⟨s, hs⟩ := hp.hasRightInverse + exact ⟨freeDesc (fun x ↦ s (f (freeMk x))), by cat_disch⟩ + +/-- A `R`-module `M` can be functorially written as a quotient of a +projective `R`-module. -/ +noncomputable def projectiveResolution : + LeftResolution (ObjectProperty.ι (isProjective (ModuleCat.{u} R))) where + F := ObjectProperty.lift _ (forget _ ⋙ free R) (by dsimp; infer_instance) + π := (adj R).counit + +end ModuleCat diff --git a/Mathlib/Algebra/Category/ModuleCat/Limits.lean b/Mathlib/Algebra/Category/ModuleCat/Limits.lean index 9835da03c19797..dc60072185722c 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Limits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Limits.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.Algebra.Colimit.Module -import Mathlib.Algebra.Module.Shrink +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.Algebra.Colimit.Module +public import Mathlib.Algebra.Module.Shrink /-! # The category of R-modules has all limits @@ -15,6 +17,8 @@ Further, these limits are preserved by the forgetful functor --- that is, the underlying types are just the limits in the category of types. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean index 5ac9ac40c5bf7a..32b1646407da83 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Kim Morrison, Jakob von Raumer -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.LinearAlgebra.TensorProduct.Associator -import Mathlib.CategoryTheory.Monoidal.Linear -import Mathlib.CategoryTheory.Monoidal.Transport +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Associator +public import Mathlib.CategoryTheory.Monoidal.Linear +public import Mathlib.CategoryTheory.Monoidal.Transport /-! # The monoidal category structure on R-modules @@ -28,6 +30,8 @@ If you're happy using the bundled `ModuleCat R`, it may be possible to mostly use this as an interface and not need to interact much with the implementation details. -/ +@[expose] public section + universe v w x u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Closed.lean b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Closed.lean index a6384d6f9ba487..1ad9765bc54346 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Closed.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Closed.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Kim Morrison, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Linear.Yoneda -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +module + +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Linear.Yoneda +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric /-! # The monoidal closed structure on `Module R`. -/ +@[expose] public section + universe v w x u open CategoryTheory Opposite diff --git a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean index 05af370bad7deb..25b426ccad1f58 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Kim Morrison, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic /-! # The symmetric monoidal structure on `Module R`. -/ +@[expose] public section + universe v w x u open CategoryTheory MonoidalCategory diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean index 81f341bba61bed..c937687f8ec090 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.Algebra.Category.Ring.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.Algebra.Category.Ring.Basic /-! # Presheaves of modules over a presheaf of rings. @@ -25,6 +27,8 @@ of scalars of `M.obj Y` via `R.map f`. * Pushforward and pullback. -/ +@[expose] public section + universe v v₁ u₁ u open CategoryTheory LinearMap Opposite diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Abelian.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Abelian.lean index cb0173d0796288..df11fbc7763267 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Abelian.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Abelian.lean @@ -3,16 +3,20 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.CategoryTheory.Abelian.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.CategoryTheory.Abelian.Basic /-! # The category of presheaves of modules is abelian -/ +@[expose] public section + universe v v₁ u₁ u open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/ChangeOfRings.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/ChangeOfRings.lean index 57574ede2b8004..3c86c9755e6ae6 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/ChangeOfRings.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/ChangeOfRings.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.Algebra.Category.ModuleCat.Presheaf +module + +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.Algebra.Category.ModuleCat.Presheaf /-! # Change of presheaf of rings @@ -15,6 +17,8 @@ attached to a morphism of presheaves of rings `α : R ⟶ R'`. -/ +@[expose] public section + universe v v' u u' open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Colimits.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Colimits.lean index 54c19f7aea1af3..c48d4ff08b24b2 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Colimits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Colimits.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.Colimits +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Colimits /-! # Colimits in categories of presheaves of modules @@ -13,6 +15,8 @@ colimits exist in the category `PresheafOfModules R`. -/ +@[expose] public section + universe v v₁ v₂ u₁ u₂ u u' open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/EpiMono.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/EpiMono.lean index 2bdcf0998ad7c7..95e1f0379fce9d 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/EpiMono.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/EpiMono.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits /-! # Epimorphisms and monomorphisms in the category of presheaves of modules @@ -15,6 +16,8 @@ in the category of presheaves of modules. -/ +@[expose] public section + universe v v₁ u₁ u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean index 9893653037ec2e..b63bbcbca176af 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Joel Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.Adjunctions +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Adjunctions /-! # The free presheaf of modules on a presheaf of sets @@ -23,6 +25,8 @@ This contribution was created as part of the AIM workshop -/ +@[expose] public section + universe u v₁ u₁ open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean index 85e2df00afe01e..6b439dbf54e20f 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian -import Mathlib.Algebra.Category.ModuleCat.Presheaf.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Free -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.CategoryTheory.Elements -import Mathlib.CategoryTheory.Generator.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Free +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.CategoryTheory.Elements +public import Mathlib.CategoryTheory.Generator.Basic /-! # Generators for the category of presheaves of modules @@ -41,6 +43,8 @@ of a morphism between coproducts of objects in `freeYoneda R`. -/ +@[expose] public section + universe v v₁ u u₁ open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Limits.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Limits.lean index 6a19fb1dfefbd8..088bc1a7e2d9a6 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Limits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Limits.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.CategoryTheory.Limits.Preserves.Limits -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.CategoryTheory.Limits.Preserves.Limits +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic /-! # Limits in categories of presheaves of modules @@ -15,6 +17,8 @@ limits exist in the category `PresheafOfModules R`. -/ +@[expose] public section + universe v v₁ v₂ u₁ u₂ u u' open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Monoidal.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Monoidal.lean index e61dfa99e73b93..ed44194f96afcb 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Monoidal.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Monoidal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Jack McKoen, Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic /-! # The monoidal category structure on presheaves of modules @@ -21,6 +23,8 @@ This contribution was created as part of the AIM workshop -/ +@[expose] public section + open CategoryTheory MonoidalCategory Category universe v u v₁ u₁ diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pullback.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pullback.lean index 3bcaf5882fb896..5eafd50ef48afa 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pullback.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pullback.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Generator -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward -import Mathlib.CategoryTheory.Adjunction.PartialAdjoint +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Generator +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward +public import Mathlib.CategoryTheory.Adjunction.PartialAdjoint +public import Mathlib.CategoryTheory.Adjunction.CompositionIso /-! # Pullback of presheaves of modules @@ -16,11 +19,16 @@ we introduce the pullback functor `pullback : PresheafOfModules S ⥤ PresheafOf as the left adjoint of `pushforward : PresheafOfModules R ⥤ PresheafOfModules S`. The existence of this left adjoint functor is obtained under suitable universe assumptions. +From the compatibility of `pushforward` with respect to composition, we deduce +similar pseudofunctor-like properties of the `pullback` functors. + -/ -universe v v₁ v₂ u₁ u₂ u +@[expose] public section + +universe v v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ u -open CategoryTheory Limits Opposite +open CategoryTheory Limits Opposite Functor namespace PresheafOfModules @@ -79,17 +87,77 @@ lemma pullbackObjIsDefined_eq_top : pullbackObjIsDefined.{u} φ = ⊤ := by ext M simp only [Pi.top_apply, Prop.top_eq_true, iff_true] - apply Functor.leftAdjointObjIsDefined_of_isColimit + apply leftAdjointObjIsDefined_of_isColimit M.isColimitFreeYonedaCoproductsCokernelCofork rintro (_ | _) all_goals - apply Functor.leftAdjointObjIsDefined_colimit _ + apply leftAdjointObjIsDefined_colimit _ (fun _ ↦ pullbackObjIsDefined_free_yoneda _ _) instance : (pushforward.{u} φ).IsRightAdjoint := - Functor.isRightAdjoint_of_leftAdjointObjIsDefined_eq_top + isRightAdjoint_of_leftAdjointObjIsDefined_eq_top (pullbackObjIsDefined_eq_top φ) end +section + +variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] + {E : Type u₃} [Category.{v₃} E] {E' : Type u₄} [Category.{v₄} E'] + +variable {F : C ⥤ D} {R : Dᵒᵖ ⥤ RingCat.{u}} {S : Cᵒᵖ ⥤ RingCat.{u}} (φ : S ⟶ F.op ⋙ R) + {G : D ⥤ E} {T : Eᵒᵖ ⥤ RingCat.{u}} (ψ : R ⟶ G.op ⋙ T) + +instance : (pushforward.{v} (F := 𝟭 C) (𝟙 S)).IsRightAdjoint := + isRightAdjoint_of_iso (pushforwardId.{v} S).symm + +variable (S) in +/-- The pullback by the identity morphism identifies to the identity functor of the +category of presheaves of modules. -/ +noncomputable def pullbackId : pullback.{v} (F := 𝟭 C) (𝟙 S) ≅ 𝟭 _ := + ((pullbackPushforwardAdjunction.{v} (F := 𝟭 C) (𝟙 S))).leftAdjointIdIso (pushforwardId S) + +variable [(pushforward.{v} φ).IsRightAdjoint] + +section + +variable [(pushforward.{v} ψ).IsRightAdjoint] + +instance : (pushforward.{v} (F := F ⋙ G) (φ ≫ whiskerLeft F.op ψ)).IsRightAdjoint := + isRightAdjoint_of_iso (pushforwardComp.{v} φ ψ) + +/-- The composition of two pullback functors on presheaves of modules identifies +to the pullback for the composition. -/ +noncomputable def pullbackComp : + pullback.{v} φ ⋙ pullback.{v} ψ ≅ + pullback.{v} (F := F ⋙ G) (φ ≫ whiskerLeft F.op ψ) := + Adjunction.leftAdjointCompIso + (pullbackPushforwardAdjunction.{v} φ) (pullbackPushforwardAdjunction.{v} ψ) + (pullbackPushforwardAdjunction.{v} (F := F ⋙ G) (φ ≫ whiskerLeft F.op ψ)) + (pushforwardComp φ ψ) + +variable {T' : E'ᵒᵖ ⥤ RingCat.{u}} {G' : E ⥤ E'} (ψ' : T ⟶ G'.op ⋙ T') + [(pushforward.{v} ψ').IsRightAdjoint] + +lemma pullback_assoc : + isoWhiskerLeft _ (pullbackComp.{v} ψ ψ') ≪≫ + pullbackComp.{v} (G := G ⋙ G') φ (ψ ≫ whiskerLeft G.op ψ') = + (associator _ _ _).symm ≪≫ isoWhiskerRight (pullbackComp.{v} φ ψ) _ ≪≫ + pullbackComp.{v} (F := F ⋙ G) (φ ≫ whiskerLeft F.op ψ) ψ' := + Adjunction.leftAdjointCompIso_assoc _ _ _ _ _ _ _ _ _ _ (pushforward_assoc φ ψ ψ') + +end + +lemma pullback_id_comp : + pullbackComp.{v} (F := 𝟭 C) (𝟙 S) φ = + isoWhiskerRight (pullbackId S) (pullback φ) ≪≫ Functor.leftUnitor _ := + Adjunction.leftAdjointCompIso_id_comp _ _ _ _ (pushforward_comp_id φ) + +lemma pullback_comp_id : + pullbackComp.{v} (G := 𝟭 _) φ (𝟙 R) = + isoWhiskerLeft _ (pullbackId R) ≪≫ Functor.rightUnitor _ := + Adjunction.leftAdjointCompIso_comp_id _ _ _ _ (pushforward_id_comp φ) + +end + end PresheafOfModules diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean index 4f048fa4db8710..358ca09404e1bf 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings /-! # Pushforward of presheaves of modules @@ -14,15 +16,19 @@ induced functor `pushforward₀ : PresheafOfModules.{v} R ⥤ PresheafOfModules. on presheaves of modules. In case we have a morphism of presheaves of rings `S ⟶ F.op ⋙ R`, we also construct -a functor `pushforward : PresheafOfModules.{v} R ⥤ PresheafOfModules.{v} S`. +a functor `pushforward : PresheafOfModules.{v} R ⥤ PresheafOfModules.{v} S`, and +we show that they interact with the composition of morphisms similarly as pseudofunctors. -/ -universe v v₁ v₂ u₁ u₂ u +@[expose] public section + +universe v v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ u -open CategoryTheory +open CategoryTheory Functor variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] + {E : Type u₃} [Category.{v₃} E] {E' : Type u₄} [Category.{v₄} E'] namespace PresheafOfModules @@ -56,7 +62,7 @@ def pushforward₀ (R : Dᵒᵖ ⥤ RingCat.{u}) : /-- The pushforward of presheaves of modules commutes with the forgetful functor to presheaves of abelian groups. -/ noncomputable def pushforward₀CompToPresheaf (R : Dᵒᵖ ⥤ RingCat.{u}) : - pushforward₀.{v} F R ⋙ toPresheaf _ ≅ toPresheaf _ ⋙ (Functor.whiskeringLeft _ _ _).obj F.op := + pushforward₀.{v} F R ⋙ toPresheaf _ ≅ toPresheaf _ ⋙ (whiskeringLeft _ _ _).obj F.op := Iso.refl _ variable {F} @@ -72,7 +78,7 @@ noncomputable def pushforward : PresheafOfModules.{v} R ⥤ PresheafOfModules.{v /-- The pushforward of presheaves of modules commutes with the forgetful functor to presheaves of abelian groups. -/ noncomputable def pushforwardCompToPresheaf : - pushforward.{v} φ ⋙ toPresheaf _ ≅ toPresheaf _ ⋙ (Functor.whiskeringLeft _ _ _).obj F.op := + pushforward.{v} φ ⋙ toPresheaf _ ≅ toPresheaf _ ⋙ (whiskeringLeft _ _ _).obj F.op := Iso.refl _ lemma pushforward_obj_map_apply (M : PresheafOfModules.{v} R) {X Y : Cᵒᵖ} (f : X ⟶ Y) @@ -100,4 +106,45 @@ lemma pushforward_map_app_apply' {M N : PresheafOfModules.{v} R} (α : M ⟶ N) (F := ↑((ModuleCat.restrictScalars _).obj _) →ₗ[_] ↑((ModuleCat.restrictScalars _).obj _)) (((pushforward φ).map α).app X).hom m = α.app (Opposite.op (F.obj X.unop)) m := rfl +section + +variable (R) in +/-- The pushforward functor by the identity morphism identifies to +the identify functor of the category of presheaves of modules. -/ +noncomputable def pushforwardId : + pushforward.{v} (S := R) (F := 𝟭 _) (𝟙 R) ≅ 𝟭 _ := + Iso.refl _ + +section + +variable {T : Eᵒᵖ ⥤ RingCat.{u}} {G : D ⥤ E} (ψ : R ⟶ G.op ⋙ T) + +/-- The composition of two pushforward functors on categories of presheaves of modules +identify to the pushforward for the composition. -/ +noncomputable def pushforwardComp : + pushforward.{v} ψ ⋙ pushforward.{v} φ ≅ + pushforward.{v} (F := F ⋙ G) (φ ≫ whiskerLeft F.op ψ) := + Iso.refl _ + +variable {T' : E'ᵒᵖ ⥤ RingCat.{u}} {G' : E ⥤ E'} (ψ' : T ⟶ G'.op ⋙ T') + +lemma pushforward_assoc : + (pushforward ψ').isoWhiskerLeft (pushforwardComp φ ψ) ≪≫ + pushforwardComp (F := F ⋙ G) (φ ≫ F.op.whiskerLeft ψ) ψ' = + ((pushforward ψ').associator (pushforward ψ) (pushforward φ)).symm ≪≫ + isoWhiskerRight (pushforwardComp ψ ψ') (pushforward φ) ≪≫ + pushforwardComp (G := G ⋙ G') φ (ψ ≫ G.op.whiskerLeft ψ') := by ext; rfl + +end + +lemma pushforward_comp_id : + pushforwardComp.{v} (F := 𝟭 C) (𝟙 S) φ = + isoWhiskerLeft (pushforward.{v} φ) (pushforwardId S) ≪≫ rightUnitor _ := by ext; rfl + +lemma pushforward_id_comp : + pushforwardComp.{v} (G := 𝟭 _) φ (𝟙 R) = + isoWhiskerRight (pushforwardId R) (pushforward.{v} φ) ≪≫ leftUnitor _ := by ext; rfl + +end + end PresheafOfModules diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean index cbb4687de2ae64..ce813977af36a4 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafify -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Limits -import Mathlib.CategoryTheory.Sites.LocallyBijective -import Mathlib.CategoryTheory.Sites.Sheafification -import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafify +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Limits +public import Mathlib.CategoryTheory.Sites.LocallyBijective +public import Mathlib.CategoryTheory.Sites.Sheafification +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced /-! # The sheafification functor for presheaves of modules @@ -23,6 +25,8 @@ sheafification functor `PresheafOfModules R.val ⥤ SheafOfModules R`. -/ +@[expose] public section + universe v v' u u' open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean index 778bf74dfa38ab..f3f5f1fd2e370f 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Sheaf.ChangeOfRings -import Mathlib.CategoryTheory.Sites.LocallySurjective +module + +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.ChangeOfRings +public import Mathlib.CategoryTheory.Sites.LocallySurjective /-! # The associated sheaf of a presheaf of modules @@ -22,6 +24,8 @@ and the presheaf of modules. -/ +@[expose] public section + universe w v v₁ u₁ u open CategoryTheory Functor diff --git a/Mathlib/Algebra/Category/ModuleCat/Products.lean b/Mathlib/Algebra/Category/ModuleCat/Products.lean index 5f54e822c1cf39..70e915806825df 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Products.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Products.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.LinearAlgebra.Pi -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Tactic.CategoryTheory.Elementwise +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Tactic.CategoryTheory.Elementwise /-! # The concrete products in the category of modules are products in the categorical sense. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Projective.lean b/Mathlib/Algebra/Category/ModuleCat/Projective.lean index c3d4ce770248af..02de13405902b1 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Projective.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Projective.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Group.Shrink -import Mathlib.Algebra.Module.Projective -import Mathlib.CategoryTheory.Preadditive.Projective.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.Algebra.Module.Projective +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic /-! # The category of `R`-modules has enough projectives. -/ +@[expose] public section + universe v u w open CategoryTheory Module ModuleCat diff --git a/Mathlib/Algebra/Category/ModuleCat/Pseudofunctor.lean b/Mathlib/Algebra/Category/ModuleCat/Pseudofunctor.lean index 4bc837231e4983..8fcbac094c1c36 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Pseudofunctor.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Pseudofunctor.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete -import Mathlib.CategoryTheory.Adjunction.Mates +module + +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete +public import Mathlib.CategoryTheory.Adjunction.Mates /-! # The pseudofunctors which send a commutative ring to its category of modules @@ -23,6 +25,8 @@ is given by the extension of scalars functors. -/ +@[expose] public section + universe v u open CategoryTheory ModuleCat diff --git a/Mathlib/Algebra/Category/ModuleCat/Semi.lean b/Mathlib/Algebra/Category/ModuleCat/Semi.lean index 5307905a252709..0bfe44d6eb94da 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Semi.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Semi.lean @@ -3,13 +3,15 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert A. Spencer, Junyan Xu -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.BigOperators.Group.Finset.Defs -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.PUnit -import Mathlib.CategoryTheory.Conj -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.PUnit +public import Mathlib.CategoryTheory.Conj +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms /-! # The category of `R`-modules @@ -34,6 +36,8 @@ Similarly, given an isomorphism `f : M ≅ N` use `f.toLinearEquiv` and given a `f : M ≃ₗ[R] N`, use `f.toModuleIso`. -/ +@[expose] public section + open CategoryTheory Limits WalkingParallelPair diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf.lean index ec940988810a1e..6f25dae7b9b7ec 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.CategoryTheory.Sites.LocallyBijective -import Mathlib.CategoryTheory.Sites.Whiskering +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.CategoryTheory.Sites.LocallyBijective +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # Sheaves of modules over a sheaf of rings @@ -17,6 +18,8 @@ is a sheaf of rings on a category `C` equipped with a Grothendieck topology `J`. -/ +@[expose] public section + universe v v₁ u₁ u w open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Abelian.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Abelian.lean index 21b666f3991da0..dfa33872278309 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Abelian.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Abelian.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification -import Mathlib.CategoryTheory.Abelian.Transfer +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification +public import Mathlib.CategoryTheory.Abelian.Transfer /-! # The category of sheaves of modules is abelian @@ -22,6 +24,8 @@ are imported. -/ +@[expose] public section + universe v v' u u' open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean index 119362781770b8..8e6dee6928b059 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Sheaf -import Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings -import Mathlib.CategoryTheory.Sites.LocallySurjective +module + +public import Mathlib.Algebra.Category.ModuleCat.Sheaf +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings +public import Mathlib.CategoryTheory.Sites.LocallySurjective /-! # Change of sheaf of rings @@ -16,6 +18,8 @@ attached to a morphism of sheaves of rings `α : R ⟶ R'`. -/ +@[expose] public section + universe v v' u u' open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Colimits.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Colimits.lean index 084626d49a1655..da187c899bcdab 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Colimits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Colimits.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification /-! # Colimits in categories of sheaves of modules @@ -14,6 +16,8 @@ of presheaves of modules. -/ +@[expose] public section + universe w' w v v' u' u namespace SheafOfModules diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean index 689bbd14b3eee5..5dcd832fdca3f0 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Colimits +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Colimits /-! # Free sheaves of modules @@ -22,6 +24,8 @@ a type `I` to the coproduct of copies indexed by `I` of `unit R`. -/ +@[expose] public section + universe u v' u' open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Generators.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Generators.lean index da23af6d6bbedb..1e2461873bfffb 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Generators.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Generators.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Free -import Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous -import Mathlib.CategoryTheory.Sites.CoversTop +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Free +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous +public import Mathlib.CategoryTheory.Sites.CoversTop /-! # Generating sections of sheaves of modules @@ -26,6 +27,8 @@ define sheaves of modules of finite type. -/ +@[expose] public section + universe u v' u' open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Limits.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Limits.lean index 355f39e454ce9f..990820cb99bb43 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Limits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits -import Mathlib.Algebra.Category.ModuleCat.Sheaf -import Mathlib.CategoryTheory.Sites.Limits +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits +public import Mathlib.Algebra.Category.ModuleCat.Sheaf +public import Mathlib.CategoryTheory.Sites.Limits /-! # Limits in categories of sheaves of modules @@ -17,6 +19,8 @@ limits exist in the category `SheafOfModules R`. -/ +@[expose] public section + universe v v₁ v₂ u₁ u₂ u open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackContinuous.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackContinuous.lean index e5084c32c671b1..90641af53aefee 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackContinuous.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackContinuous.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification -import Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous /-! # Pullback of sheaves of modules @@ -23,6 +25,8 @@ modules commutes with the sheafification. -/ +@[expose] public section + universe v v₁ v₂ u₁ u₂ u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackFree.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackFree.lean index 4092c775ac0f0a..8bd144c3272554 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackFree.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PullbackFree.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Free -import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Final.Type +module + +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Free +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Final.Type /-! # Pullbacks of free sheaves of modules @@ -26,6 +28,8 @@ of modules `free I` to `free I`, see `pullbackObjFreeIso` and `freeFunctorCompPullbackIso`. -/ +@[expose] public section + universe v v₁ v₂ u₁ u₂ u open CategoryTheory Limits @@ -57,7 +61,7 @@ variable [J.HasSheafCompose (forget₂ RingCat.{u} AddCommGrpCat.{u})] /-- The canonical morphism `unit S ⟶ (pushforward.{u} φ).obj (unit R)` of sheaves of modules corresponding to a continuous map between ringed sites. -/ -def unitToPushforwardObjUnit : unit S ⟶ (pushforward.{u} φ).obj (unit R) where +noncomputable def unitToPushforwardObjUnit : unit S ⟶ (pushforward.{u} φ).obj (unit R) where val.app X := ModuleCat.homMk ((forget₂ RingCat AddCommGrpCat).map (φ.val.app X)) (fun r ↦ by ext m exact ((φ.val.app X).hom.map_mul _ _).symm) diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean index 7c206e4ee078d2..5620e76b459127 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward -import Mathlib.Algebra.Category.ModuleCat.Sheaf -import Mathlib.CategoryTheory.Sites.Over +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward +public import Mathlib.Algebra.Category.ModuleCat.Sheaf +public import Mathlib.CategoryTheory.Sites.Over /-! # Pushforward of sheaves of modules @@ -18,6 +20,8 @@ a morphism of sheaves of rings, we construct the pushforward functor -/ +@[expose] public section + universe v v₁ v₂ u₁ u₂ u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean index 86173dee97b6a4..b6ae9dc9d20a4a 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Generators +module + +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Generators /-! # Quasicoherent sheaves @@ -18,6 +20,8 @@ When these coproducts are finite, we say that the sheaf is of finite presentatio -/ +@[expose] public section + universe u v' u' open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/ModuleCat/Simple.lean b/Mathlib/Algebra/Category/ModuleCat/Simple.lean index 39a3c7a0a5ce39..af73b99148ab10 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Simple.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Simple.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pierre-Alexandre Bazin, Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Algebra -import Mathlib.Algebra.Category.ModuleCat.Subobject -import Mathlib.CategoryTheory.Simple -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Algebra +public import Mathlib.Algebra.Category.ModuleCat.Subobject +public import Mathlib.CategoryTheory.Simple +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Simple objects in the category of `R`-modules @@ -15,6 +17,8 @@ import Mathlib.RingTheory.SimpleModule.Basic We prove simple modules are exactly simple objects in the category of `R`-modules. -/ +@[expose] public section + variable {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/Algebra/Category/ModuleCat/Subobject.lean b/Mathlib/Algebra/Category/ModuleCat/Subobject.lean index 323cad5f04566f..1b4e333f8250f1 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Subobject.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Subobject.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Kernels -import Mathlib.CategoryTheory.Subobject.WellPowered -import Mathlib.CategoryTheory.Subobject.Limits +module + +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Kernels +public import Mathlib.CategoryTheory.Subobject.WellPowered +public import Mathlib.CategoryTheory.Subobject.Limits /-! # Subobjects in the category of `R`-modules @@ -16,6 +18,8 @@ and its submodules. This immediately implies that the category of `R`-modules is -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Tannaka.lean b/Mathlib/Algebra/Category/ModuleCat/Tannaka.lean index c826db62f55412..eb187c8342d418 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Tannaka.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Tannaka.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.LinearAlgebra.Span.Basic /-! # Tannaka duality for rings @@ -14,6 +16,8 @@ the endomorphisms of the additive forgetful functor `Module R ⥤ AddCommGroup`. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean index 75d4d37e9041c6..309be660819d37 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Richard Hill, Andrew Yang -/ -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.Topology.Algebra.Module.ModuleTopology -import Mathlib.Topology.Category.TopCat.Limits.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.Topology.Algebra.Module.ModuleTopology +public import Mathlib.Topology.Category.TopCat.Limits.Basic /-! # The category `TopModuleCat R` of topological modules @@ -26,6 +28,8 @@ We also provide various adjunctions: Show that the forgetful functor to `TopCat` preserves filtered colimits. -/ +@[expose] public section + universe v u variable (R : Type u) [Ring R] [TopologicalSpace R] diff --git a/Mathlib/Algebra/Category/ModuleCat/Topology/Homology.lean b/Mathlib/Algebra/Category/ModuleCat/Topology/Homology.lean index 1c76a05c141f68..2b84da70866395 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Topology/Homology.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Topology/Homology.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Richard Hill, Andrew Yang -/ -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.Algebra.Category.ModuleCat.Topology.Basic -import Mathlib.Algebra.Homology.ShortComplex.Abelian -import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology +module + +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Topology.Basic +public import Mathlib.Algebra.Homology.ShortComplex.Abelian +public import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology /-! @@ -18,6 +20,8 @@ category. See the `CategoryWithHomology (TopModuleCat R)` instance in this file. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Category/MonCat/Adjunctions.lean b/Mathlib/Algebra/Category/MonCat/Adjunctions.lean index b1e6ae7b285858..5d23b4c372cd46 100644 --- a/Mathlib/Algebra/Category/MonCat/Adjunctions.lean +++ b/Mathlib/Algebra/Category/MonCat/Adjunctions.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Category.Semigrp.Basic -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Algebra.Group.WithOne.Basic -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Category.Semigrp.Basic +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Algebra.Group.WithOne.Basic +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Finsupp.SMulWithZero +public import Mathlib.CategoryTheory.Adjunction.Basic /-! # Adjunctions regarding the category of monoids @@ -23,6 +25,8 @@ from monoids to semigroups. * adjunctions related to commutative monoids -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Category/MonCat/Basic.lean b/Mathlib/Algebra/Category/MonCat/Basic.lean index b3dc54717257d2..dde927a88569ea 100644 --- a/Mathlib/Algebra/Category/MonCat/Basic.lean +++ b/Mathlib/Algebra/Category/MonCat/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.PUnit -import Mathlib.Algebra.Group.TypeTags.Hom -import Mathlib.Algebra.Group.ULift -import Mathlib.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.Algebra.Group.TypeTags.Hom +public import Mathlib.Algebra.Group.ULift +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # Category instances for `Monoid`, `AddMonoid`, `CommMonoid`, and `AddCommMonoid`. @@ -21,6 +23,8 @@ We introduce the bundled categories: along with the relevant forgetful functors between them. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u v diff --git a/Mathlib/Algebra/Category/MonCat/Colimits.lean b/Mathlib/Algebra/Category/MonCat/Colimits.lean index 80d0e06c7d3259..f22ace6e4a5cef 100644 --- a/Mathlib/Algebra/Category/MonCat/Colimits.lean +++ b/Mathlib/Algebra/Category/MonCat/Colimits.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.ConcreteCategory.Elementwise +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.ConcreteCategory.Elementwise /-! # The category of monoids has all colimits. @@ -46,6 +48,8 @@ Monoid.mk : {M : Type u} → ``` -/ +@[expose] public section + assert_not_exists MonoidWithZero universe v u diff --git a/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean b/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean index 67bdbf2c40121f..37c4c3553385c2 100644 --- a/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean +++ b/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Justus Springer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Justus Springer -/ -import Mathlib.CategoryTheory.Limits.Preserves.Filtered -import Mathlib.CategoryTheory.ConcreteCategory.Elementwise -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.Algebra.Category.MonCat.Basic +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Filtered +public import Mathlib.CategoryTheory.ConcreteCategory.Elementwise +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.Algebra.Category.MonCat.Basic /-! # The forgetful functor from (commutative) (additive) monoids preserves filtered colimits. @@ -21,6 +23,8 @@ showing that the forgetful functor `forget MonCat` preserves filtered colimits. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Category/MonCat/ForgetCorepresentable.lean b/Mathlib/Algebra/Category/MonCat/ForgetCorepresentable.lean index 47181486947577..a74f6a80958998 100644 --- a/Mathlib/Algebra/Category/MonCat/ForgetCorepresentable.lean +++ b/Mathlib/Algebra/Category/MonCat/ForgetCorepresentable.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Nat.Hom -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Nat.Hom +public import Mathlib.CategoryTheory.Yoneda /-! # The forgetful functor is corepresentable @@ -17,6 +19,8 @@ and `MonCat`. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u diff --git a/Mathlib/Algebra/Category/MonCat/Limits.lean b/Mathlib/Algebra/Category/MonCat/Limits.lean index 2244738150f8d3..771f5e99855743 100644 --- a/Mathlib/Algebra/Category/MonCat/Limits.lean +++ b/Mathlib/Algebra/Category/MonCat/Limits.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Shrink -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Types.Limits +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Types.Limits /-! # The category of (commutative) (additive) monoids has all limits @@ -18,6 +20,8 @@ the underlying types are just the limits in the category of types. -/ +@[expose] public section + assert_not_exists MonoidWithZero noncomputable section @@ -119,7 +123,7 @@ end HasLimits open HasLimits /-- The category of monoids has all limits. -/ -@[to_additive (relevant_arg := 100) /-- The category of additive monoids has all limits. -/] +@[to_additive (relevant_arg := _) /-- The category of additive monoids has all limits. -/] instance hasLimitsOfSize [UnivLE.{v, u}] : HasLimitsOfSize.{w, v} MonCat.{u} where has_limits_of_shape _ _ := { } @@ -138,7 +142,7 @@ noncomputable instance forget_preservesLimitsOfShape [Small.{u} J] : /-- The forgetful functor from monoids to types preserves all limits. This means the underlying type of a limit can be computed as a limit in the category of types. -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The forgetful functor from additive monoids to types preserves all limits. This means the underlying type of a limit can be computed as a limit in the category of types. -/] @@ -272,7 +276,7 @@ instance hasLimitsOfShape [Small.{u} J] : HasLimitsOfShape J CommMonCat.{u} wher has_limit _ := inferInstance /-- The category of commutative monoids has all limits. -/ -@[to_additive (relevant_arg := 100) +@[to_additive (relevant_arg := _) /-- The category of additive commutative monoids has all limits. -/] instance hasLimitsOfSize [UnivLE.{v, u}] : HasLimitsOfSize.{w, v} CommMonCat.{u} where has_limits_of_shape _ _ := { } @@ -284,7 +288,7 @@ instance hasLimits : HasLimits CommMonCat.{u} := /-- The forgetful functor from commutative monoids to monoids preserves all limits. This means the underlying type of a limit can be computed as a limit in the category of monoids. -/ -@[to_additive (relevant_arg := 100) AddCommMonCat.forget₂AddMonPreservesLimitsOfSize +@[to_additive (relevant_arg := _) AddCommMonCat.forget₂AddMonPreservesLimitsOfSize /-- The forgetful functor from additive commutative monoids to additive monoids preserves all limits. diff --git a/Mathlib/Algebra/Category/MonCat/Yoneda.lean b/Mathlib/Algebra/Category/MonCat/Yoneda.lean index 5ee47dfe645a81..203fd42e038a6e 100644 --- a/Mathlib/Algebra/Category/MonCat/Yoneda.lean +++ b/Mathlib/Algebra/Category/MonCat/Yoneda.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.CategoryTheory.Yoneda /-! # Yoneda embeddings @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Yoneda This file defines a few Yoneda embeddings for the category of commutative monoids. -/ +@[expose] public section + open CategoryTheory universe u diff --git a/Mathlib/Algebra/Category/Ring/Adjunctions.lean b/Mathlib/Algebra/Category/Ring/Adjunctions.lean index bcb6dc2f2b798e..0303d63acbd9dc 100644 --- a/Mathlib/Algebra/Category/Ring/Adjunctions.lean +++ b/Mathlib/Algebra/Category/Ring/Adjunctions.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johannes Hölzl, Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Adjunctions in `CommRingCat` @@ -19,6 +21,8 @@ import Mathlib.CategoryTheory.Limits.Shapes.Terminal -/ +@[expose] public section + noncomputable section universe v u diff --git a/Mathlib/Algebra/Category/Ring/Basic.lean b/Mathlib/Algebra/Category/Ring/Basic.lean index 1af042df4d6ddd..9289af74dad706 100644 --- a/Mathlib/Algebra/Category/Ring/Basic.lean +++ b/Mathlib/Algebra/Category/Ring/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.PUnit -import Mathlib.CategoryTheory.ConcreteCategory.ReflectsIso +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.PUnit +public import Mathlib.CategoryTheory.ConcreteCategory.ReflectsIso /-! # Category instances for `Semiring`, `Ring`, `CommSemiring`, and `CommRing`. @@ -20,13 +22,17 @@ We introduce the bundled categories: along with the relevant forgetful functors between them. -/ +@[expose] public section + universe u v open CategoryTheory /-- The category of semirings. -/ structure SemiRingCat where - private mk :: + /-- The object in the category of semirings associated to a type equipped with the appropriate + typeclasses. -/ + of :: /-- The underlying type. -/ carrier : Type u [semiring : Semiring carrier] @@ -42,11 +48,6 @@ instance : CoeSort (SemiRingCat) (Type u) := attribute [coe] SemiRingCat.carrier -/-- The object in the category of R-algebras associated to a type equipped with the appropriate -typeclasses. This is the preferred way to construct a term of `SemiRingCat`. -/ -abbrev of (R : Type u) [Semiring R] : SemiRingCat := - ⟨R⟩ - lemma coe_of (R : Type u) [Semiring R] : (of R : Type u) = R := rfl @@ -176,7 +177,9 @@ end SemiRingCat /-- The category of rings. -/ structure RingCat where - private mk :: + /-- The object in the category of rings associated to a type equipped with the appropriate + typeclasses. -/ + of :: /-- The underlying type. -/ carrier : Type u [ring : Ring carrier] @@ -192,11 +195,6 @@ instance : CoeSort (RingCat) (Type u) := attribute [coe] RingCat.carrier -/-- The object in the category of R-algebras associated to a type equipped with the appropriate -typeclasses. This is the preferred way to construct a term of `RingCat`. -/ -abbrev of (R : Type u) [Ring R] : RingCat := - ⟨R⟩ - lemma coe_of (R : Type u) [Ring R] : (of R : Type u) = R := rfl @@ -338,7 +336,9 @@ end RingCat /-- The category of commutative semirings. -/ structure CommSemiRingCat where - private mk :: + /-- The object in the category of commutative semirings associated to a type equipped with the + appropriate typeclasses. -/ + of :: /-- The underlying type. -/ carrier : Type u [commSemiring : CommSemiring carrier] @@ -354,11 +354,6 @@ instance : CoeSort (CommSemiRingCat) (Type u) := attribute [coe] CommSemiRingCat.carrier -/-- The object in the category of R-algebras associated to a type equipped with the appropriate -typeclasses. This is the preferred way to construct a term of `CommSemiRingCat`. -/ -abbrev of (R : Type u) [CommSemiring R] : CommSemiRingCat := - ⟨R⟩ - lemma coe_of (R : Type u) [CommSemiring R] : (of R : Type u) = R := rfl @@ -499,7 +494,9 @@ end CommSemiRingCat /-- The category of commutative rings. -/ structure CommRingCat where - private mk :: + /-- The object in the category of commutative rings associated to a type equipped with the + appropriate typeclasses. -/ + of :: /-- The underlying type. -/ carrier : Type u [commRing : CommRing carrier] @@ -515,11 +512,6 @@ instance : CoeSort (CommRingCat) (Type u) := attribute [coe] CommRingCat.carrier -/-- The object in the category of R-algebras associated to a type equipped with the appropriate -typeclasses. This is the preferred way to construct a term of `CommRingCat`. -/ -abbrev of (R : Type u) [CommRing R] : CommRingCat := - ⟨R⟩ - lemma coe_of (R : Type u) [CommRing R] : (of R : Type u) = R := rfl diff --git a/Mathlib/Algebra/Category/Ring/Colimits.lean b/Mathlib/Algebra/Category/Ring/Colimits.lean index 22f10d26279483..29f23085f72f9d 100644 --- a/Mathlib/Algebra/Category/Ring/Colimits.lean +++ b/Mathlib/Algebra/Category/Ring/Colimits.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # The category of commutative rings has all colimits. @@ -15,6 +17,8 @@ It is a very uniform approach, that conceivably could be synthesised directly by a tactic that analyses the shape of `CommRing` and `RingHom`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/Category/Ring/Constructions.lean b/Mathlib/Algebra/Category/Ring/Constructions.lean index 93401decec8e94..6c27c7d8dbfb3c 100644 --- a/Mathlib/Algebra/Category/Ring/Constructions.lean +++ b/Mathlib/Algebra/Category/Ring/Constructions.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.Instances -import Mathlib.Algebra.Category.Ring.Limits -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Tactic.Algebraize -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial -import Mathlib.RingTheory.TensorProduct.Basic -import Mathlib.RingTheory.IsTensorProduct +module + +public import Mathlib.Algebra.Category.Ring.Instances +public import Mathlib.Algebra.Category.Ring.Limits +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Tactic.Algebraize +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial +public import Mathlib.RingTheory.TensorProduct.Basic +public import Mathlib.RingTheory.IsTensorProduct /-! # Constructions of (co)limits in `CommRingCat` @@ -26,6 +28,8 @@ In this file we provide the explicit (co)cones for various (co)limits in `CommRi -/ +@[expose] public section + universe u u' open CategoryTheory Limits TensorProduct diff --git a/Mathlib/Algebra/Category/Ring/Epi.lean b/Mathlib/Algebra/Category/Ring/Epi.lean index f11212bca2677e..947a69a885965b 100644 --- a/Mathlib/Algebra/Category/Ring/Epi.lean +++ b/Mathlib/Algebra/Category/Ring/Epi.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.RingTheory.TensorProduct.Finite -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +module + +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.RingTheory.TensorProduct.Finite +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono /-! # Epimorphisms in `CommRingCat` @@ -14,6 +16,8 @@ import Mathlib.CategoryTheory.ConcreteCategory.EpiMono - `RingHom.surjective_iff_epi_and_finite`: surjective <=> epi + finite -/ +@[expose] public section + open CategoryTheory TensorProduct universe u diff --git a/Mathlib/Algebra/Category/Ring/FilteredColimits.lean b/Mathlib/Algebra/Category/Ring/FilteredColimits.lean index b6e2481baedba5..7905765b86058f 100644 --- a/Mathlib/Algebra/Category/Ring/FilteredColimits.lean +++ b/Mathlib/Algebra/Category/Ring/FilteredColimits.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Justus Springer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Justus Springer -/ -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.Algebra.Category.Grp.FilteredColimits -import Mathlib.Algebra.Ring.ULift +module + +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.Algebra.Category.Grp.FilteredColimits +public import Mathlib.Algebra.Ring.ULift /-! # The forgetful functor from (commutative) (semi-) rings preserves filtered colimits. @@ -22,6 +24,8 @@ Similarly for `CommSemiRingCat`, `RingCat` and `CommRingCat`. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Category/Ring/FinitePresentation.lean b/Mathlib/Algebra/Category/Ring/FinitePresentation.lean index f823a647190526..8b7b2afa70fa20 100644 --- a/Mathlib/Algebra/Category/Ring/FinitePresentation.lean +++ b/Mathlib/Algebra/Category/Ring/FinitePresentation.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Christian Merten -/ -import Mathlib.Algebra.Category.Ring.FilteredColimits -import Mathlib.CategoryTheory.Limits.Preserves.Over -import Mathlib.CategoryTheory.Limits.Shapes.FiniteMultiequalizer -import Mathlib.CategoryTheory.Presentable.Finite -import Mathlib.RingTheory.EssentialFiniteness -import Mathlib.RingTheory.FinitePresentation +module + +public import Mathlib.Algebra.Category.Ring.FilteredColimits +public import Mathlib.CategoryTheory.Limits.Preserves.Over +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteMultiequalizer +public import Mathlib.CategoryTheory.Presentable.Finite +public import Mathlib.RingTheory.EssentialFiniteness +public import Mathlib.RingTheory.FinitePresentation /-! @@ -19,6 +21,8 @@ i.e. `Hom_R(S, -)` preserves filtered colimits. -/ +@[expose] public section + open CategoryTheory Limits universe vJ uJ u diff --git a/Mathlib/Algebra/Category/Ring/Instances.lean b/Mathlib/Algebra/Category/Ring/Instances.lean index a5577f8397b32e..7f0d6e462de808 100644 --- a/Mathlib/Algebra/Category/Ring/Instances.lean +++ b/Mathlib/Algebra/Category/Ring/Instances.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.LocalRing.RingHom.Basic +module + +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.LocalRing.RingHom.Basic /-! # Ring-theoretic results in terms of categorical language -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/Algebra/Category/Ring/Limits.lean b/Mathlib/Algebra/Category/Ring/Limits.lean index 4ef6c864d00748..5f69156836cc90 100644 --- a/Mathlib/Algebra/Category/Ring/Limits.lean +++ b/Mathlib/Algebra/Category/Ring/Limits.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.Algebra.Category.Ring.Basic -import Mathlib.Algebra.Ring.Pi -import Mathlib.Algebra.Ring.Shrink -import Mathlib.Algebra.Ring.Subring.Defs +module + +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.Algebra.Category.Ring.Basic +public import Mathlib.Algebra.Ring.Pi +public import Mathlib.Algebra.Ring.Shrink +public import Mathlib.Algebra.Ring.Subring.Defs /-! # The category of (commutative) rings has all limits @@ -16,6 +18,8 @@ Further, these limits are preserved by the forgetful functor --- that is, the underlying types are just the limits in the category of types. -/ +@[expose] public section + -- We use the following trick a lot of times in this file. library_note2 «change elaboration strategy with `by apply`» /-- diff --git a/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean b/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean index 056f49c7b389b9..4812f2dc8667d2 100644 --- a/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean +++ b/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Category.Ring.Constructions -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic +module + +public import Mathlib.Algebra.Category.Ring.Constructions +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic /-! # Results on the category of rings requiring linear algebra @@ -18,6 +20,8 @@ import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic -/ +@[expose] public section + universe u open CategoryTheory Limits TensorProduct diff --git a/Mathlib/Algebra/Category/Ring/Topology.lean b/Mathlib/Algebra/Category/Ring/Topology.lean index de03f0d8c0529a..8efca487e79dc8 100644 --- a/Mathlib/Algebra/Category/Ring/Topology.lean +++ b/Mathlib/Algebra/Category/Ring/Topology.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Christian Merten -/ -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.Category.Ring.Constructions -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Topology.Algebra.Ring.Basic +module + +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.Category.Ring.Constructions +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Topology.Algebra.Ring.Basic /-! # Topology on `Hom(R, S)` @@ -26,6 +28,8 @@ this is the subspace topology `Hom(A, R) ↪ Hom(ℤ[xᵢ], R) = Rᶥ`. -/ +@[expose] public section + universe u v open CategoryTheory Topology diff --git a/Mathlib/Algebra/Category/Ring/Under/Basic.lean b/Mathlib/Algebra/Category/Ring/Under/Basic.lean index f73058f450b323..25e5bb7a5dcb13 100644 --- a/Mathlib/Algebra/Category/Ring/Under/Basic.lean +++ b/Mathlib/Algebra/Category/Ring/Under/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.Category.Ring.Constructions -import Mathlib.CategoryTheory.Comma.Over.Pullback +module + +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.Category.Ring.Constructions +public import Mathlib.CategoryTheory.Comma.Over.Pullback /-! # Under `CommRingCat` @@ -15,6 +17,8 @@ In this file we provide basic API for `Under R` when `R : CommRingCat`. `Under R algebras, use `AlgCat R` instead. -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/Algebra/Category/Ring/Under/Limits.lean b/Mathlib/Algebra/Category/Ring/Under/Limits.lean index 90289eedb1ed37..f2af3870f69f18 100644 --- a/Mathlib/Algebra/Category/Ring/Under/Limits.lean +++ b/Mathlib/Algebra/Category/Ring/Under/Limits.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Category.Ring.Under.Basic -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Limits.Over -import Mathlib.RingTheory.TensorProduct.Pi -import Mathlib.RingTheory.RingHom.Flat -import Mathlib.RingTheory.Flat.Equalizer +module + +public import Mathlib.Algebra.Category.Ring.Under.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Limits.Over +public import Mathlib.RingTheory.TensorProduct.Pi +public import Mathlib.RingTheory.RingHom.Flat +public import Mathlib.RingTheory.Flat.Equalizer /-! # Limits in `Under R` for a commutative ring `R` @@ -18,6 +20,8 @@ flat. -/ +@[expose] public section + noncomputable section universe v u diff --git a/Mathlib/Algebra/Category/Semigrp/Basic.lean b/Mathlib/Algebra/Category/Semigrp/Basic.lean index df4c1ac72ab44d..f428723d5d3624 100644 --- a/Mathlib/Algebra/Category/Semigrp/Basic.lean +++ b/Mathlib/Algebra/Category/Semigrp/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.Algebra.PEmptyInstances -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.Algebra.PEmptyInstances +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # Category instances for `Mul`, `Add`, `Semigroup` and `AddSemigroup` @@ -27,6 +29,8 @@ This closely follows `Mathlib/Algebra/Category/MonCat/Basic.lean`. * free/forgetful adjunctions -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/Central/Basic.lean b/Mathlib/Algebra/Central/Basic.lean index e794953c237c62..6e5b091bee0412 100644 --- a/Mathlib/Algebra/Central/Basic.lean +++ b/Mathlib/Algebra/Central/Basic.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Jujian Zhang, Yunzhou Xie -/ +module -import Mathlib.Algebra.Central.Defs +public import Mathlib.Algebra.Central.Defs /-! # Central Algebras @@ -19,6 +20,8 @@ In this file, we prove some basic results about central algebras over a commutat `K` and `k` are fields. If `D` is a nontrivial central algebra over `k`, `K` is isomorphic to `k`. -/ +@[expose] public section + universe u v namespace Algebra.IsCentral diff --git a/Mathlib/Algebra/Central/Defs.lean b/Mathlib/Algebra/Central/Defs.lean index 84a98ab1559a55..bbdaed1e43c491 100644 --- a/Mathlib/Algebra/Central/Defs.lean +++ b/Mathlib/Algebra/Central/Defs.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice /-! # Central Algebras @@ -55,6 +56,8 @@ central algebra, center, simple ring, central simple algebra -/ +@[expose] public section + universe u v /-- diff --git a/Mathlib/Algebra/Central/Matrix.lean b/Mathlib/Algebra/Central/Matrix.lean index 00f3cc54fa95cd..f19b01526fc7ad 100644 --- a/Mathlib/Algebra/Central/Matrix.lean +++ b/Mathlib/Algebra/Central/Matrix.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Yunzhou Xie -/ -import Mathlib.Algebra.Central.Defs -import Mathlib.Data.Matrix.Basis +module + +public import Mathlib.Algebra.Central.Defs +public import Mathlib.Data.Matrix.Basis /-! # The matrix algebra is a central algebra -/ +@[expose] public section + namespace Matrix variable {n R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Fintype n] [DecidableEq n] diff --git a/Mathlib/Algebra/Central/TensorProduct.lean b/Mathlib/Algebra/Central/TensorProduct.lean index 2c9a0dd4708ff9..976f9e6b97bd16 100644 --- a/Mathlib/Algebra/Central/TensorProduct.lean +++ b/Mathlib/Algebra/Central/TensorProduct.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Yunzhou Xie -/ +module -import Mathlib.Algebra.Central.Basic -import Mathlib.RingTheory.Flat.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.Algebra.Central.Basic +public import Mathlib.RingTheory.Flat.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! @@ -28,6 +29,8 @@ algebra and `B, C` nontrivial, then both `B` and `C` are central algebras. Central Algebras, Central Simple Algebras, Noncommutative Algebra -/ +@[expose] public section + universe u v open TensorProduct diff --git a/Mathlib/Algebra/CharP/Algebra.lean b/Mathlib/Algebra/CharP/Algebra.lean index bdd8950acecc5a..2d675ff2b4476e 100644 --- a/Mathlib/Algebra/CharP/Algebra.lean +++ b/Mathlib/Algebra/CharP/Algebra.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Eugster, Eric Wieser -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.FreeAlgebra -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.SimpleRing.Basic +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Characteristics of algebras @@ -28,6 +30,8 @@ Instances constructed from this result: -/ +@[expose] public section + /-- Given `R →+* A`, then `char A ∣ char R`. -/ theorem CharP.dvd_of_ringHom {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A) (p q : ℕ) [CharP R p] [CharP A q] : q ∣ p := by diff --git a/Mathlib/Algebra/CharP/Basic.lean b/Mathlib/Algebra/CharP/Basic.lean index 48044fd98a896f..cc49a2236da9d2 100644 --- a/Mathlib/Algebra/CharP/Basic.lean +++ b/Mathlib/Algebra/CharP/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Joey van Langen, Casper Putz -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.Algebra.Ring.ULift -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Data.Int.ModEq -import Mathlib.Data.Nat.Cast.Prod -import Mathlib.Data.ULift -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Algebra.Ring.GrindInstances +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Group.Fin.Basic +public import Mathlib.Algebra.Ring.ULift +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Data.Int.ModEq +public import Mathlib.Data.Nat.Cast.Prod +public import Mathlib.Data.ULift +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Algebra.Ring.GrindInstances /-! # Characteristic of semirings @@ -22,6 +24,8 @@ imports of `CharP/Lemmas.lean`. As such, we can probably reorganize and find a better home for most of these lemmas. -/ +@[expose] public section + assert_not_exists Finset TwoSidedIdeal open Set diff --git a/Mathlib/Algebra/CharP/CharAndCard.lean b/Mathlib/Algebra/CharP/CharAndCard.lean index b5e7b47f73b190..104dccf394285b 100644 --- a/Mathlib/Algebra/CharP/CharAndCard.lean +++ b/Mathlib/Algebra/CharP/CharAndCard.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.CharP.Basic -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.GroupTheory.Perm.Cycle.Type -import Mathlib.RingTheory.Coprime.Lemmas +module + +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.GroupTheory.Perm.Cycle.Type +public import Mathlib.RingTheory.Coprime.Lemmas /-! # Characteristic and cardinality @@ -17,6 +19,8 @@ We prove some results relating characteristic and cardinality of finite rings characteristic, cardinality, ring -/ +@[expose] public section + /-- A prime `p` is a unit in a commutative ring `R` of nonzero characteristic iff it does not divide the characteristic. -/ diff --git a/Mathlib/Algebra/CharP/Defs.lean b/Mathlib/Algebra/CharP/Defs.lean index ea8751bc7ad5ec..ea911d4979b1d1 100644 --- a/Mathlib/Algebra/CharP/Defs.lean +++ b/Mathlib/Algebra/CharP/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Joey van Langen, Casper Putz -/ -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Data.Nat.Find -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Order.Lattice +module + +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Order.Lattice /-! # Characteristic of semirings @@ -20,6 +22,8 @@ import Mathlib.Order.Lattice prime characteristic `p`) -/ +@[expose] public section + assert_not_exists Field Finset OrderHom variable (R : Type*) diff --git a/Mathlib/Algebra/CharP/Frobenius.lean b/Mathlib/Algebra/CharP/Frobenius.lean index 1def17391ffdc5..fe886fc4db5118 100644 --- a/Mathlib/Algebra/CharP/Frobenius.lean +++ b/Mathlib/Algebra/CharP/Frobenius.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Jakob Scholbach. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Scholbach -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.CharP.Lemmas +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.CharP.Lemmas /-! ### The Frobenius endomorphism @@ -20,6 +22,8 @@ The definitions of `frobenius` and `iterateFrobenius` ring homomorphisms are in files forbidding to import algebra-related definitions (see `Mathlib/Algebra/CharP/Two.lean`). -/ +@[expose] public section + section CommSemiring variable {R : Type*} [CommSemiring R] {S : Type*} [CommSemiring S] diff --git a/Mathlib/Algebra/CharP/IntermediateField.lean b/Mathlib/Algebra/CharP/IntermediateField.lean index 6016d298478c6c..27e4608057065a 100644 --- a/Mathlib/Algebra/CharP/IntermediateField.lean +++ b/Mathlib/Algebra/CharP/IntermediateField.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.FieldTheory.IntermediateField.Basic +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.FieldTheory.IntermediateField.Basic /-! @@ -16,6 +18,8 @@ covered by `SubsemiringClass.instCharZero`. -/ +@[expose] public section + variable {F E : Type*} [Field F] [Field E] [Algebra F E] namespace Subfield diff --git a/Mathlib/Algebra/CharP/Invertible.lean b/Mathlib/Algebra/CharP/Invertible.lean index 932cf87bc84071..e0bfd66445fbd1 100644 --- a/Mathlib/Algebra/CharP/Invertible.lean +++ b/Mathlib/Algebra/CharP/Invertible.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.Parity -import Mathlib.Algebra.GroupWithZero.Invertible -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Int.GCD -import Mathlib.Data.Nat.Cast.Commute +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Algebra.GroupWithZero.Invertible +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Int.GCD +public import Mathlib.Data.Nat.Cast.Commute /-! # Invertibility of elements given a characteristic @@ -20,6 +22,8 @@ when needed. To construct instances for concrete numbers, `invertibleOfNonzero` is a useful definition. -/ +@[expose] public section + variable {R K : Type*} diff --git a/Mathlib/Algebra/CharP/Lemmas.lean b/Mathlib/Algebra/CharP/Lemmas.lean index 14b0eadf4cc90a..01ed651f738c03 100644 --- a/Mathlib/Algebra/CharP/Lemmas.lean +++ b/Mathlib/Algebra/CharP/Lemmas.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Joey van Langen, Casper Putz -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Data.Nat.Multiplicity -import Mathlib.Data.Nat.Choose.Sum +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Data.Nat.Multiplicity +public import Mathlib.Data.Nat.Choose.Sum /-! # Characteristic of semirings -/ +@[expose] public section + assert_not_exists Algebra LinearMap orderOf open Finset diff --git a/Mathlib/Algebra/CharP/LinearMaps.lean b/Mathlib/Algebra/CharP/LinearMaps.lean index 3e7fcf5cf04812..708861d4ef6e6e 100644 --- a/Mathlib/Algebra/CharP/LinearMaps.lean +++ b/Mathlib/Algebra/CharP/LinearMaps.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Wanyi He. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wanyi He, Huanyu Zheng -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.Algebra.Module.Torsion.Basic +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.Algebra.Module.Torsion.Basic /-! # Characteristic of the ring of linear Maps @@ -31,6 +33,8 @@ One can also deduce similar result via `charP_of_injective_ringHom` and -/ +@[expose] public section + namespace Module variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/Algebra/CharP/LocalRing.lean b/Mathlib/Algebra/CharP/LocalRing.lean index f8cc6f6a991be2..a9b5ce5797949b 100644 --- a/Mathlib/Algebra/CharP/LocalRing.lean +++ b/Mathlib/Algebra/CharP/LocalRing.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Eugster -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.IsPrimePow -import Mathlib.Data.Nat.Factorization.Basic -import Mathlib.RingTheory.LocalRing.ResidueField.Defs +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.IsPrimePow +public import Mathlib.Data.Nat.Factorization.Basic +public import Mathlib.RingTheory.LocalRing.ResidueField.Defs /-! # Characteristics of local rings @@ -18,6 +20,8 @@ import Mathlib.RingTheory.LocalRing.ResidueField.Defs -/ +@[expose] public section + /-- In a local ring the characteristic is either zero or a prime power. -/ theorem charP_zero_or_prime_power (R : Type*) [CommRing R] [IsLocalRing R] (q : ℕ) diff --git a/Mathlib/Algebra/CharP/MixedCharZero.lean b/Mathlib/Algebra/CharP/MixedCharZero.lean index fc47e2a622e0b1..e3f00316151750 100644 --- a/Mathlib/Algebra/CharP/MixedCharZero.lean +++ b/Mathlib/Algebra/CharP/MixedCharZero.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Eugster -/ -import Mathlib.Algebra.CharP.LocalRing -import Mathlib.RingTheory.Ideal.Quotient.Basic -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.CharP.LocalRing +public import Mathlib.RingTheory.Ideal.Quotient.Basic +public import Mathlib.Tactic.FieldSimp /-! # Equal and mixed characteristic @@ -53,6 +55,8 @@ equivalent conditions. - Relate mixed characteristic in a local ring to p-adic numbers [NumberTheory.PAdics]. -/ +@[expose] public section + variable (R : Type*) [CommRing R] /-! @@ -286,7 +290,7 @@ theorem isEmpty_algebraRat_iff_mixedCharZero [CharZero R] : apply EqualCharZero.nonempty_algebraRat_iff /-! -# Splitting statements into different characteristic +### Splitting statements into different characteristic Statements to split a proof by characteristic. There are 3 theorems here that are very similar. They only differ in the assumptions we can make on the positive characteristic diff --git a/Mathlib/Algebra/CharP/Pi.lean b/Mathlib/Algebra/CharP/Pi.lean index 0d3677687fc0d4..5555da8daee1ff 100644 --- a/Mathlib/Algebra/CharP/Pi.lean +++ b/Mathlib/Algebra/CharP/Pi.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Ring.Pi +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Ring.Pi /-! # Characteristic of semirings of functions -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/CharP/Quotient.lean b/Mathlib/Algebra/CharP/Quotient.lean index 5a65711964915f..b7f405e737766c 100644 --- a/Mathlib/Algebra/CharP/Quotient.lean +++ b/Mathlib/Algebra/CharP/Quotient.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Eric Wieser -/ -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Nonunits -import Mathlib.RingTheory.Ideal.Quotient.Defs +module + +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Nonunits +public import Mathlib.RingTheory.Ideal.Quotient.Defs /-! # Characteristic of quotient rings -/ +@[expose] public section + theorem CharP.ker_intAlgebraMap_eq_span {R : Type*} [Ring R] (p : ℕ) [CharP R p] : RingHom.ker (algebraMap ℤ R) = Ideal.span {(p : ℤ)} := by diff --git a/Mathlib/Algebra/CharP/Reduced.lean b/Mathlib/Algebra/CharP/Reduced.lean index c9a9acacb9a25f..4f96d782e015bc 100644 --- a/Mathlib/Algebra/CharP/Reduced.lean +++ b/Mathlib/Algebra/CharP/Reduced.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Joey van Langen, Casper Putz -/ -import Mathlib.Algebra.CharP.Frobenius -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.Algebra.CharP.Frobenius +public import Mathlib.RingTheory.Nilpotent.Defs /-! # Results about characteristic p reduced rings -/ +@[expose] public section + open Finset diff --git a/Mathlib/Algebra/CharP/Subring.lean b/Mathlib/Algebra/CharP/Subring.lean index 48f7d6a8805981..35af4455aba7ae 100644 --- a/Mathlib/Algebra/CharP/Subring.lean +++ b/Mathlib/Algebra/CharP/Subring.lean @@ -3,12 +3,16 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.CharP.Algebra +module + +public import Mathlib.Algebra.CharP.Algebra /-! # Characteristic of subrings -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/CharP/Two.lean b/Mathlib/Algebra/CharP/Two.lean index edf352a7be1d12..3cf9a2fb481d06 100644 --- a/Mathlib/Algebra/CharP/Two.lean +++ b/Mathlib/Algebra/CharP/Two.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.GroupTheory.OrderOfElement +module + +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.GroupTheory.OrderOfElement /-! # Lemmas about rings of characteristic two @@ -15,6 +17,8 @@ The lemmas in this file with a `_sq` suffix are just special cases of the `_pow_ elsewhere, with a shorter name for ease of discovery, and no need for a `[Fact (Prime 2)]` argument. -/ +@[expose] public section + assert_not_exists Algebra LinearMap variable {R ι : Type*} diff --git a/Mathlib/Algebra/CharZero/AddMonoidHom.lean b/Mathlib/Algebra/CharZero/AddMonoidHom.lean index fadd04e104eb9d..1adfc8d6b94ddb 100644 --- a/Mathlib/Algebra/CharZero/AddMonoidHom.lean +++ b/Mathlib/Algebra/CharZero/AddMonoidHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Data.Nat.Cast.Basic +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Data.Nat.Cast.Basic /-! # Transporting `CharZero` accross injective `AddMonoidHom`s @@ -13,6 +15,8 @@ import Mathlib.Data.Nat.Cast.Basic This file exists in order to avoid adding extra imports to other files in this subdirectory. -/ +@[expose] public section + theorem CharZero.of_addMonoidHom {M N : Type*} [AddCommMonoidWithOne M] [AddCommMonoidWithOne N] [CharZero M] (e : M →+ N) (he : e 1 = 1) (he' : Function.Injective e) : CharZero N where cast_injective n m h := by diff --git a/Mathlib/Algebra/CharZero/Defs.lean b/Mathlib/Algebra/CharZero/Defs.lean index d05ad718c6b143..98d1478627011c 100644 --- a/Mathlib/Algebra/CharZero/Defs.lean +++ b/Mathlib/Algebra/CharZero/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Int.Cast.Defs -import Mathlib.Logic.Basic +module + +public import Mathlib.Data.Int.Cast.Defs +public import Mathlib.Logic.Basic /-! @@ -25,6 +27,8 @@ from the natural numbers into it is injective. * Unify with `CharP` (possibly using an out-parameter) -/ +@[expose] public section + /-- Typeclass for monoids with characteristic zero. (This is usually stated on fields but it makes sense for any additive monoid with 1.) diff --git a/Mathlib/Algebra/CharZero/Infinite.lean b/Mathlib/Algebra/CharZero/Infinite.lean index 3a76c6548a4f08..9b694380b4b912 100644 --- a/Mathlib/Algebra/CharZero/Infinite.lean +++ b/Mathlib/Algebra/CharZero/Infinite.lean @@ -3,11 +3,15 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Data.Fintype.EquivFin /-! # A characteristic-zero semiring is infinite -/ +@[expose] public section + open Set diff --git a/Mathlib/Algebra/CharZero/Quotient.lean b/Mathlib/Algebra/CharZero/Quotient.lean index 15df0b50b6de24..04635af627070a 100644 --- a/Mathlib/Algebra/CharZero/Quotient.lean +++ b/Mathlib/Algebra/CharZero/Quotient.lean @@ -3,16 +3,20 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Module.NatInt -import Mathlib.GroupTheory.QuotientGroup.Defs -import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.GroupTheory.QuotientGroup.Defs +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic /-! # Lemmas about quotients in characteristic zero -/ +@[expose] public section + variable {R : Type*} [DivisionRing R] [CharZero R] {p : R} diff --git a/Mathlib/Algebra/Colimit/DirectLimit.lean b/Mathlib/Algebra/Colimit/DirectLimit.lean index 52cc29f38708e4..03554918fa1437 100644 --- a/Mathlib/Algebra/Colimit/DirectLimit.lean +++ b/Mathlib/Algebra/Colimit/DirectLimit.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Data.Rat.Cast.Defs -import Mathlib.Order.DirectedInverseSystem -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Data.Rat.Cast.Defs +public import Mathlib.Order.DirectedInverseSystem +public import Mathlib.Tactic.SuppressCompilation /-! # Direct limit of algebraic structures @@ -41,6 +43,8 @@ the same pattern. Since any two colimits are isomorphic, this allows us to golf equality criteria for `Module/AddCommGroup/Ring.DirectLimit`. -/ +@[expose] public section + suppress_compilation variable {R ι : Type*} [Preorder ι] {G : ι → Type*} diff --git a/Mathlib/Algebra/Colimit/Finiteness.lean b/Mathlib/Algebra/Colimit/Finiteness.lean index 5ea30d317efcb7..f32fa1d96d3d39 100644 --- a/Mathlib/Algebra/Colimit/Finiteness.lean +++ b/Mathlib/Algebra/Colimit/Finiteness.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Colimit.Module -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Algebra.Colimit.Module +public import Mathlib.RingTheory.Finiteness.Basic /-! # Modules as direct limits of finitely generated submodules @@ -19,6 +21,8 @@ We show that every module is the direct limit of its finitely generated submodul finitely generated submodules. -/ +@[expose] public section + namespace Module variable (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/Algebra/Colimit/Module.lean b/Mathlib/Algebra/Colimit/Module.lean index 73f158bae3c924..ac897d328a0ba4 100644 --- a/Mathlib/Algebra/Colimit/Module.lean +++ b/Mathlib/Algebra/Colimit/Module.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kenny Lau, Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Jujian Zhang -/ -import Mathlib.Algebra.Colimit.DirectLimit -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.Module.Congruence.Defs -import Mathlib.Data.Finset.Order -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Colimit.DirectLimit +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.Module.Congruence.Defs +public import Mathlib.Data.Finset.Order +public import Mathlib.Tactic.SuppressCompilation /-! # Direct limit of modules and abelian groups @@ -27,6 +29,8 @@ so as to make the operations (addition etc.) "computable". -/ +@[expose] public section + suppress_compilation variable {R : Type*} [Semiring R] {ι : Type*} [Preorder ι] {G : ι → Type*} diff --git a/Mathlib/Algebra/Colimit/Ring.lean b/Mathlib/Algebra/Colimit/Ring.lean index 1a182570f185b5..78a51180652f56 100644 --- a/Mathlib/Algebra/Colimit/Ring.lean +++ b/Mathlib/Algebra/Colimit/Ring.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Kenny Lau, Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Jujian Zhang -/ -import Mathlib.Algebra.Colimit.DirectLimit -import Mathlib.Data.Finset.Order -import Mathlib.RingTheory.FreeCommRing -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Colimit.DirectLimit +public import Mathlib.Data.Finset.Order +public import Mathlib.RingTheory.FreeCommRing +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.Tactic.SuppressCompilation /-! # Direct limit of rings, and fields @@ -26,6 +28,8 @@ the disjoint union so as to make the operations (addition etc.) "computable". -/ +@[expose] public section + assert_not_exists Cardinal suppress_compilation diff --git a/Mathlib/Algebra/Colimit/TensorProduct.lean b/Mathlib/Algebra/Colimit/TensorProduct.lean index a49fceb3f6948b..212518cac81c08 100644 --- a/Mathlib/Algebra/Colimit/TensorProduct.lean +++ b/Mathlib/Algebra/Colimit/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Colimit.Finiteness -import Mathlib.LinearAlgebra.TensorProduct.DirectLimit +module + +public import Mathlib.Algebra.Colimit.Finiteness +public import Mathlib.LinearAlgebra.TensorProduct.DirectLimit /-! # Tensor product with direct limit of finitely generated submodules @@ -17,6 +19,8 @@ that every module is the direct limit of its finitely generated submodules and t product preserves colimits. -/ +@[expose] public section + open TensorProduct variable {R M P : Type*} [CommSemiring R] diff --git a/Mathlib/Algebra/ContinuedFractions/Basic.lean b/Mathlib/Algebra/ContinuedFractions/Basic.lean index 5ab3a573d5c4af..c6eb3f2797c9dc 100644 --- a/Mathlib/Algebra/ContinuedFractions/Basic.lean +++ b/Mathlib/Algebra/ContinuedFractions/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Data.Seq.Defs -import Mathlib.Algebra.Field.Defs +module + +public import Mathlib.Data.Seq.Defs +public import Mathlib.Algebra.Field.Defs /-! # Basic Definitions/Theorems for Continued Fractions @@ -38,6 +40,8 @@ fractions. We hence just call them `ContFract` in the library. numerics, number theory, approximations, fractions -/ +@[expose] public section + -- Fix a carrier `α`. variable (α : Type*) diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean b/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean index fd600a335de6c4..e2c590c33de928 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Computation.Approximations -import Mathlib.Algebra.ContinuedFractions.ConvergentsEquiv -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Tactic.GCongr -import Mathlib.Topology.Order.LeftRightNhds +module + +public import Mathlib.Algebra.ContinuedFractions.Computation.Approximations +public import Mathlib.Algebra.ContinuedFractions.ConvergentsEquiv +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Tactic.GCongr +public import Mathlib.Topology.Order.LeftRightNhds /-! # Corollaries From Approximation Lemmas (`Algebra.ContinuedFractions.Computation.Approximations`) @@ -37,6 +39,8 @@ Moreover, we show the convergence of the continued fractions computations, that convergence, fractions -/ +@[expose] public section + variable {K : Type*} (v : K) [Field K] [LinearOrder K] [IsStrictOrderedRing K] [FloorRing K] open GenContFract (of) diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean b/Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean index ca228959769a6f..1b6ed3fc87983c 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Determinant -import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Data.Nat.Fib.Basic -import Mathlib.Tactic.Monotonicity -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.ContinuedFractions.Determinant +public import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Data.Nat.Fib.Basic +public import Mathlib.Tactic.Monotonicity +public import Mathlib.Tactic.GCongr /-! # Approximations for Continued Fraction Computations (`GenContFract.of`) @@ -46,6 +48,8 @@ in `Algebra.ContinuedFractions.Computation.ApproximationCorollaries`. -/ +@[expose] public section + open GenContFract open GenContFract (of) diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/Basic.lean b/Mathlib/Algebra/ContinuedFractions/Computation/Basic.lean index 19741ccc9e0a61..360199bdfe4e46 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/Basic.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Basic -import Mathlib.Algebra.Order.Floor.Defs +module + +public import Mathlib.Algebra.ContinuedFractions.Basic +public import Mathlib.Algebra.Order.Floor.Defs /-! # Computable Continued Fractions @@ -58,6 +60,8 @@ with a head term (`seq1`) is then transformed to a generalized continued fractio numerics, number theory, approximations, fractions -/ +@[expose] public section + assert_not_exists Finset namespace GenContFract diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/CorrectnessTerminating.lean b/Mathlib/Algebra/ContinuedFractions/Computation/CorrectnessTerminating.lean index 246265f28f3ed2..044e09a879e51f 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/CorrectnessTerminating.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/CorrectnessTerminating.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Computation.Translations -import Mathlib.Algebra.ContinuedFractions.TerminatedStable -import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.ContinuedFractions.Computation.Translations +public import Mathlib.Algebra.ContinuedFractions.TerminatedStable +public import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Ring /-! # Correctness of Terminating Continued Fraction Computations (`GenContFract.of`) @@ -41,6 +43,8 @@ information about the computation process, refer to `Algebra.ContinuedFractions. `v = (GenContFract.of v).convs n` if `GenContFract.of v` terminated at position `n`. -/ +@[expose] public section + assert_not_exists Finset namespace GenContFract diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean b/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean index 13be5c4fc27e60..0efabec9521a19 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Computation.Approximations -import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating -import Mathlib.Data.Rat.Floor +module + +public import Mathlib.Algebra.ContinuedFractions.Computation.Approximations +public import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating +public import Mathlib.Data.Rat.Floor /-! # Termination of Continued Fraction Computations (`GenContFract.of`) @@ -27,6 +29,8 @@ rational number, that is `↑v = q` for some `q : ℚ`. rational, continued fraction, termination -/ +@[expose] public section + namespace GenContFract diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean b/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean index 9348513700ccaa..2d3af712a2b935 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Computation.Basic -import Mathlib.Algebra.ContinuedFractions.Translations -import Mathlib.Algebra.Order.Floor.Ring +module + +public import Mathlib.Algebra.ContinuedFractions.Computation.Basic +public import Mathlib.Algebra.ContinuedFractions.Translations +public import Mathlib.Algebra.Order.Floor.Ring /-! # Basic Translation Lemmas Between Structures Defined for Computing Continued Fractions @@ -38,6 +40,8 @@ The file consists of three sections: parts. -/ +@[expose] public section + assert_not_exists Finset namespace GenContFract diff --git a/Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean b/Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean index 0c05fb47e27565..a61dbe457eaaba 100644 --- a/Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean +++ b/Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Translations +module + +public import Mathlib.Algebra.ContinuedFractions.Translations /-! # Recurrence Lemmas for the Continuants (`conts`) Function of Continued Fractions @@ -16,6 +18,8 @@ function indeed satisfies the following recurrences: - `Bₙ = bₙ * Bₙ₋₁ + aₙ * Bₙ₋₂`. -/ +@[expose] public section + namespace GenContFract diff --git a/Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean b/Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean index 449b194602d23a..90e107b88d7939 100644 --- a/Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean +++ b/Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence -import Mathlib.Algebra.ContinuedFractions.TerminatedStable -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence +public import Mathlib.Algebra.ContinuedFractions.TerminatedStable +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Ring /-! # Equivalence of Recursive and Direct Computations of Convergents of Generalized Continued Fractions @@ -63,6 +65,8 @@ The corresponding lemma in this file is `succ_nth_conv_eq_squashGCF_nth_conv`. fractions, recurrence, equivalence -/ +@[expose] public section + variable {K : Type*} {n : ℕ} diff --git a/Mathlib/Algebra/ContinuedFractions/Determinant.lean b/Mathlib/Algebra/ContinuedFractions/Determinant.lean index 34f75324ec2ca9..0300213fa49293 100644 --- a/Mathlib/Algebra/ContinuedFractions/Determinant.lean +++ b/Mathlib/Algebra/ContinuedFractions/Determinant.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence -import Mathlib.Algebra.ContinuedFractions.TerminatedStable -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence +public import Mathlib.Algebra.ContinuedFractions.TerminatedStable +public import Mathlib.Tactic.Ring /-! # Determinant Formula for Simple Continued Fraction @@ -26,6 +28,8 @@ Generalize this for `GenContFract` version: -/ +@[expose] public section + open GenContFract namespace SimpContFract diff --git a/Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean b/Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean index c76efe76007182..de1d77b9b3dcfa 100644 --- a/Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean +++ b/Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Translations +module + +public import Mathlib.Algebra.ContinuedFractions.Translations /-! # Stabilisation of gcf Computations Under Termination @@ -13,6 +15,8 @@ import Mathlib.Algebra.ContinuedFractions.Translations We show that the continuants and convergents of a gcf stabilise once the gcf terminates. -/ +@[expose] public section + namespace GenContFract diff --git a/Mathlib/Algebra/ContinuedFractions/Translations.lean b/Mathlib/Algebra/ContinuedFractions/Translations.lean index 4323af722d09ba..ed68101b281cc8 100644 --- a/Mathlib/Algebra/ContinuedFractions/Translations.lean +++ b/Mathlib/Algebra/ContinuedFractions/Translations.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann -/ -import Mathlib.Algebra.ContinuedFractions.Basic -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Data.Seq.Basic +module + +public import Mathlib.Algebra.ContinuedFractions.Basic +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Data.Seq.Basic /-! # Basic Translation Lemmas Between Functions Defined for Continued Fractions @@ -16,6 +18,8 @@ Some simple translation lemmas between the different definitions of functions de `Algebra.ContinuedFractions.Basic`. -/ +@[expose] public section + namespace GenContFract diff --git a/Mathlib/Algebra/CubicDiscriminant.lean b/Mathlib/Algebra/CubicDiscriminant.lean index aa4fefe14df873..740789446dbb0c 100644 --- a/Mathlib/Algebra/CubicDiscriminant.lean +++ b/Mathlib/Algebra/CubicDiscriminant.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.Tactic.IntervalCases /-! # Cubics and discriminants @@ -31,6 +33,8 @@ This file defines cubic polynomials over a semiring and their discriminants over cubic, discriminant, polynomial, root -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/DirectSum/AddChar.lean b/Mathlib/Algebra/DirectSum/AddChar.lean index a9a6296c828330..71ed8ce3ca5986 100644 --- a/Mathlib/Algebra/DirectSum/AddChar.lean +++ b/Mathlib/Algebra/DirectSum/AddChar.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.DirectSum.Basic -import Mathlib.Algebra.Group.AddChar +module + +public import Mathlib.Algebra.DirectSum.Basic +public import Mathlib.Algebra.Group.AddChar /-! # Direct sum of additive characters @@ -12,6 +14,8 @@ import Mathlib.Algebra.Group.AddChar This file defines the direct sum of additive characters. -/ +@[expose] public section + open Function open scoped DirectSum diff --git a/Mathlib/Algebra/DirectSum/Algebra.lean b/Mathlib/Algebra/DirectSum/Algebra.lean index 43361da92bfd38..8de9548ba2a470 100644 --- a/Mathlib/Algebra/DirectSum/Algebra.lean +++ b/Mathlib/Algebra/DirectSum/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.DirectSum.Ring +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.DirectSum.Ring /-! # Additively-graded algebra structures on `⨁ i, A i` @@ -24,6 +26,8 @@ where all `A i` are `R`-modules. This is the extra structure needed to promote ` -/ +@[expose] public section + universe uι uR uA uB diff --git a/Mathlib/Algebra/DirectSum/Basic.lean b/Mathlib/Algebra/DirectSum/Basic.lean index d6597e5285566d..d66432ecd7aaf3 100644 --- a/Mathlib/Algebra/DirectSum/Basic.lean +++ b/Mathlib/Algebra/DirectSum/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Data.DFinsupp.Sigma -import Mathlib.Data.DFinsupp.Submonoid +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Data.DFinsupp.Sigma +public import Mathlib.Data.DFinsupp.Submonoid /-! # Direct sum @@ -22,6 +24,8 @@ This notation is in the `DirectSum` locale, accessible after `open DirectSum`. * https://en.wikipedia.org/wiki/Direct_sum -/ +@[expose] public section + open Function universe u v w u₁ @@ -270,8 +274,7 @@ protected def id (M : Type v) (ι : Type* := PUnit) [AddCommMonoid M] [Unique ι invFun := of (fun _ => M) default left_inv := fun x => DirectSum.induction_on x (by rw [AddMonoidHom.map_zero, AddMonoidHom.map_zero]) - (fun p x => by rw [Unique.default_eq p, toAddMonoid_of]; rfl) fun x y ihx ihy => by - rw [AddMonoidHom.map_add, AddMonoidHom.map_add, ihx, ihy] + (fun p x => by rw [Unique.default_eq p, toAddMonoid_of]; rfl) fun x y ihx ihy => by grind right_inv := fun _ => toAddMonoid_of _ _ _ } section CongrLeft diff --git a/Mathlib/Algebra/DirectSum/Decomposition.lean b/Mathlib/Algebra/DirectSum/Decomposition.lean index d2be60a10d6755..d2cfa23b382b6e 100644 --- a/Mathlib/Algebra/DirectSum/Decomposition.lean +++ b/Mathlib/Algebra/DirectSum/Decomposition.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jujian Zhang -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.Module.Submodule.Basic +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.Module.Submodule.Basic /-! # Decompositions of additive monoids, groups, and modules into direct sums @@ -28,6 +30,8 @@ we choose to avoid heavily bundling `DirectSum.decompose`, instead making copies bundled homs, but means we don't have to repeat statements for different types of decomposition. -/ +@[expose] public section + variable {ι R M σ : Type*} diff --git a/Mathlib/Algebra/DirectSum/Finsupp.lean b/Mathlib/Algebra/DirectSum/Finsupp.lean index f83402eed1c6e6..4c95de388a53a9 100644 --- a/Mathlib/Algebra/DirectSum/Finsupp.lean +++ b/Mathlib/Algebra/DirectSum/Finsupp.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Data.Finsupp.ToDFinsupp +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Data.Finsupp.ToDFinsupp /-! # Results on direct sums and finitely supported functions. @@ -13,6 +15,8 @@ import Mathlib.Data.Finsupp.ToDFinsupp the direct sum of copies of `M` indexed by `ι`. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/DirectSum/Idempotents.lean b/Mathlib/Algebra/DirectSum/Idempotents.lean index 1b22c93e5eff4c..c561979b7a1e21 100644 --- a/Mathlib/Algebra/DirectSum/Idempotents.lean +++ b/Mathlib/Algebra/DirectSum/Idempotents.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yunzhou Xie, Jujian Zhang, Andrew Yang -/ -import Mathlib.RingTheory.Idempotents -import Mathlib.Algebra.DirectSum.Decomposition +module + +public import Mathlib.RingTheory.Idempotents +public import Mathlib.Algebra.DirectSum.Decomposition /-! # Decomposition of the identity of a semiring into orthogonal idempotents @@ -15,6 +17,8 @@ of (left) ideals `R = V₁ ⊕ V₂ ⊕ ⋯ ⊕ Vₙ` then in the corresponding `eᵢ`'s form a family of complete orthogonal idempotents. -/ +@[expose] public section + namespace DirectSum section OrthogonalIdempotents diff --git a/Mathlib/Algebra/DirectSum/Internal.lean b/Mathlib/Algebra/DirectSum/Internal.lean index 2fa7ef47dd1468..5908ba1e6de7d5 100644 --- a/Mathlib/Algebra/DirectSum/Internal.lean +++ b/Mathlib/Algebra/DirectSum/Internal.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Kevin Buzzard, Jujian Zhang, Fangming Li -/ -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.DirectSum.Algebra -import Mathlib.Algebra.Order.Antidiag.Prod +module + +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.DirectSum.Algebra +public import Mathlib.Algebra.Order.Antidiag.Prod /-! # Internally graded rings and algebras @@ -49,6 +51,8 @@ This file also provides some extra structure on `A 0`, namely: internally graded ring -/ +@[expose] public section + open DirectSum diff --git a/Mathlib/Algebra/DirectSum/LinearMap.lean b/Mathlib/Algebra/DirectSum/LinearMap.lean index 0c725a2d063305..a0feb6f80b3118 100644 --- a/Mathlib/Algebra/DirectSum/LinearMap.lean +++ b/Mathlib/Algebra/DirectSum/LinearMap.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.LinearAlgebra.Trace +module + +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.LinearAlgebra.Trace /-! # Linear maps between direct sums @@ -16,6 +18,8 @@ domain and codomain. -/ +@[expose] public section + open DirectSum Module Set namespace LinearMap diff --git a/Mathlib/Algebra/DirectSum/Module.lean b/Mathlib/Algebra/DirectSum/Module.lean index 9fd55d78471faf..5a21b2c91e9dd3 100644 --- a/Mathlib/Algebra/DirectSum/Module.lean +++ b/Mathlib/Algebra/DirectSum/Module.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.DirectSum.Basic -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Basis.Defs +module + +public import Mathlib.Algebra.DirectSum.Basic +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Basis.Defs /-! # Direct sum of modules @@ -23,6 +25,8 @@ in this file. -/ +@[expose] public section + universe u v w u₁ namespace DirectSum diff --git a/Mathlib/Algebra/DirectSum/Ring.lean b/Mathlib/Algebra/DirectSum/Ring.lean index a8a5f20ac7fef3..1da2a36dd90f52 100644 --- a/Mathlib/Algebra/DirectSum/Ring.lean +++ b/Mathlib/Algebra/DirectSum/Ring.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GradedMonoid -import Mathlib.Algebra.DirectSum.Basic -import Mathlib.Algebra.Ring.Associator +module + +public import Mathlib.Algebra.GradedMonoid +public import Mathlib.Algebra.DirectSum.Basic +public import Mathlib.Algebra.Ring.Associator /-! # Additively-graded multiplicative structures on `⨁ i, A i` @@ -72,6 +74,8 @@ can be obtained as `DirectSum.toMonoid (fun i ↦ AddSubmonoid.inclusion <| le_i graded ring, filtered ring, direct sum, add_submonoid -/ +@[expose] public section + variable {ι : Type*} [DecidableEq ι] diff --git a/Mathlib/Algebra/Divisibility/Basic.lean b/Mathlib/Algebra/Divisibility/Basic.lean index ea0547fb7a7b1c..93165efb4ebf4f 100644 --- a/Mathlib/Algebra/Divisibility/Basic.lean +++ b/Mathlib/Algebra/Divisibility/Basic.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov, Neil Strickland, Aaron Anderson -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Tactic.Common /-! # Divisibility @@ -28,6 +30,8 @@ The divisibility relation is defined for all monoids, and as such, depends on th divisibility, divides -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Divisibility/Finite.lean b/Mathlib/Algebra/Divisibility/Finite.lean index 987527daf394d7..0aa7b305278f4b 100644 --- a/Mathlib/Algebra/Divisibility/Finite.lean +++ b/Mathlib/Algebra/Divisibility/Finite.lean @@ -3,14 +3,17 @@ Copyright (c) 2025 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ +module -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Data.Fintype.Defs +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Data.Fintype.Defs /-! # Divisibility in finite types -/ +@[expose] public section + variable {M : Type*} [Semigroup M] instance [Fintype M] [DecidableEq M] (a b : M) : Decidable (a ∣ b) := diff --git a/Mathlib/Algebra/Divisibility/Hom.lean b/Mathlib/Algebra/Divisibility/Hom.lean index 9bc6a8ea610ccd..2b4b65935a8bab 100644 --- a/Mathlib/Algebra/Divisibility/Hom.lean +++ b/Mathlib/Algebra/Divisibility/Hom.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov, Neil Strickland, Aaron Anderson -/ -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Hom.Defs +module + +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Hom.Defs /-! # Mapping divisibility across multiplication-preserving homomorphisms @@ -19,6 +21,8 @@ import Mathlib.Algebra.Group.Hom.Defs divisibility, divides -/ +@[expose] public section + attribute [local simp] mul_assoc mul_comm mul_left_comm variable {M N : Type*} diff --git a/Mathlib/Algebra/Divisibility/Prod.lean b/Mathlib/Algebra/Divisibility/Prod.lean index 4a1d5e8044f205..33cdb878141ddc 100644 --- a/Mathlib/Algebra/Divisibility/Prod.lean +++ b/Mathlib/Algebra/Divisibility/Prod.lean @@ -3,15 +3,19 @@ Copyright (c) 2023 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Prod -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Tactic.Common /-! # Lemmas about the divisibility relation in product (semi)groups -/ +@[expose] public section + variable {ι G₁ G₂ : Type*} {G : ι → Type*} [Semigroup G₁] [Semigroup G₂] [∀ i, Semigroup (G i)] theorem prod_dvd_iff {x y : G₁ × G₂} : diff --git a/Mathlib/Algebra/Divisibility/Units.lean b/Mathlib/Algebra/Divisibility/Units.lean index d6c22ef6cc3c96..0501d9b80d610e 100644 --- a/Mathlib/Algebra/Divisibility/Units.lean +++ b/Mathlib/Algebra/Divisibility/Units.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov, Neil Strickland, Aaron Anderson -/ -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Units.Basic +module + +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Units.Basic /-! # Divisibility and units @@ -17,6 +19,8 @@ import Mathlib.Algebra.Group.Units.Basic -/ +@[expose] public section + variable {α : Type*} namespace Units diff --git a/Mathlib/Algebra/DualNumber.lean b/Mathlib/Algebra/DualNumber.lean index 542a46596063ca..c34bc6d5035627 100644 --- a/Mathlib/Algebra/DualNumber.lean +++ b/Mathlib/Algebra/DualNumber.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.TrivSqZeroExt +module + +public import Mathlib.Algebra.TrivSqZeroExt /-! # Dual numbers @@ -34,6 +36,8 @@ Rather than duplicating the API of `TrivSqZeroExt`, this file reuses the functio * https://en.wikipedia.org/wiki/Dual_number -/ +@[expose] public section + variable {R A B : Type*} diff --git a/Mathlib/Algebra/DualQuaternion.lean b/Mathlib/Algebra/DualQuaternion.lean index e664c0e4e642c1..3b49c02830a40d 100644 --- a/Mathlib/Algebra/DualQuaternion.lean +++ b/Mathlib/Algebra/DualQuaternion.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.DualNumber -import Mathlib.Algebra.Quaternion +module + +public import Mathlib.Algebra.DualNumber +public import Mathlib.Algebra.Quaternion /-! # Dual quaternions @@ -22,6 +24,8 @@ rigid motions in 3D space can be represented by dual quaternions of unit length. * -/ +@[expose] public section + variable {R : Type*} [CommRing R] diff --git a/Mathlib/Algebra/EuclideanDomain/Basic.lean b/Mathlib/Algebra/EuclideanDomain/Basic.lean index a25e3587b2278c..1d0e9b9bfc2735 100644 --- a/Mathlib/Algebra/EuclideanDomain/Basic.lean +++ b/Mathlib/Algebra/EuclideanDomain/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Louis Carlin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Louis Carlin, Mario Carneiro -/ -import Mathlib.Algebra.EuclideanDomain.Defs -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Regular -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.Ring.Basic +module + +public import Mathlib.Algebra.EuclideanDomain.Defs +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.Ring.Basic /-! # Lemmas about Euclidean domains @@ -18,6 +20,8 @@ import Mathlib.Algebra.Ring.Basic -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/EuclideanDomain/Defs.lean b/Mathlib/Algebra/EuclideanDomain/Defs.lean index d88467f04ee92e..35621d3926a756 100644 --- a/Mathlib/Algebra/EuclideanDomain/Defs.lean +++ b/Mathlib/Algebra/EuclideanDomain/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Louis Carlin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Louis Carlin, Mario Carneiro -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Order.RelClasses +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Order.RelClasses /-! # Euclidean domains @@ -59,6 +61,8 @@ value of `j`. Euclidean domain, transfinite Euclidean domain, Bézout's lemma -/ +@[expose] public section + universe u /-- A `EuclideanDomain` is a non-trivial commutative ring with a division and a remainder, diff --git a/Mathlib/Algebra/EuclideanDomain/Field.lean b/Mathlib/Algebra/EuclideanDomain/Field.lean index 7090ac26b2343e..81aa1eb2817426 100644 --- a/Mathlib/Algebra/EuclideanDomain/Field.lean +++ b/Mathlib/Algebra/EuclideanDomain/Field.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Louis Carlin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Louis Carlin, Mario Carneiro -/ -import Mathlib.Algebra.EuclideanDomain.Defs -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.EuclideanDomain.Defs +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Instances for Euclidean domains * `Field.toEuclideanDomain`: shows that any field is a Euclidean domain. -/ +@[expose] public section + namespace Field variable {K : Type*} [Field K] diff --git a/Mathlib/Algebra/EuclideanDomain/Int.lean b/Mathlib/Algebra/EuclideanDomain/Int.lean index ef5b187665a83b..91e55e9945d5b5 100644 --- a/Mathlib/Algebra/EuclideanDomain/Int.lean +++ b/Mathlib/Algebra/EuclideanDomain/Int.lean @@ -3,16 +3,20 @@ Copyright (c) 2018 Louis Carlin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Louis Carlin, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.EuclideanDomain.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Ring.Int.Defs +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.EuclideanDomain.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Ring.Int.Defs /-! # Instances for Euclidean domains * `Int.euclideanDomain`: shows that `ℤ` is a Euclidean domain. -/ +@[expose] public section + instance Int.euclideanDomain : EuclideanDomain ℤ := { inferInstanceAs (CommRing Int), inferInstanceAs (Nontrivial Int) with quotient := (· / ·), quotient_zero := Int.ediv_zero, remainder := (· % ·), diff --git a/Mathlib/Algebra/Exact.lean b/Mathlib/Algebra/Exact.lean index 713e336473d443..995553cfd206c1 100644 --- a/Mathlib/Algebra/Exact.lean +++ b/Mathlib/Algebra/Exact.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.Module.Submodule.Range -import Mathlib.LinearAlgebra.Prod -import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.Algebra.Module.Submodule.Range +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.LinearAlgebra.Quotient.Basic /-! # Exactness of a pair @@ -26,6 +27,8 @@ import Mathlib.LinearAlgebra.Quotient.Basic * add the multiplicative case (`Function.Exact` will become `Function.AddExact`?) -/ +@[expose] public section + variable {R M M' N N' P P' : Type*} namespace Function @@ -523,4 +526,10 @@ noncomputable def Function.Exact.linearEquivOfSurjective (h : Function.Exact f g LinearEquiv.ofBijective ((LinearMap.range f).liftQ g (h · |>.mpr)) ⟨LinearMap.injective_range_liftQ_of_exact h, LinearMap.surjective_range_liftQ _ hg⟩ +@[simp] +lemma Function.Exact.linearEquivOfSurjective_symm_apply (h : Function.Exact f g) + (hg : Function.Surjective g) (x : N) : + (h.linearEquivOfSurjective hg).symm (g x) = Submodule.Quotient.mk x := by + simp [LinearEquiv.symm_apply_eq] + end Ring diff --git a/Mathlib/Algebra/Expr.lean b/Mathlib/Algebra/Expr.lean index 0e6e8a5225eacb..77049b4e66253e 100644 --- a/Mathlib/Algebra/Expr.lean +++ b/Mathlib/Algebra/Expr.lean @@ -3,13 +3,18 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Init -import Qq +module + +public import Mathlib.Init +public import Qq +public import Qq.Typ /-! # Helpers to invoke functions involving algebra at tactic time This file provides instances on `x y : Q($α)` such that `x + y = q($x + $y)`. -/ + +@[expose] public section open Qq /-- Produce a `One` instance for `Q($α)` such that `1 : Q($α)` is `q(1 : $α)`. -/ diff --git a/Mathlib/Algebra/Field/Action/ConjAct.lean b/Mathlib/Algebra/Field/Action/ConjAct.lean index 08d434c0677852..ec5e40ff4bc7f9 100644 --- a/Mathlib/Algebra/Field/Action/ConjAct.lean +++ b/Mathlib/Algebra/Field/Action/ConjAct.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Action.ConjAct -import Mathlib.Algebra.GroupWithZero.Action.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Action.ConjAct +public import Mathlib.Algebra.GroupWithZero.Action.Defs /-! # Conjugation action on a field on itself -/ +@[expose] public section + namespace ConjAct variable {K : Type*} [DivisionRing K] diff --git a/Mathlib/Algebra/Field/Basic.lean b/Mathlib/Algebra/Field/Basic.lean index 03d3b5ca82279d..74dba05660e26e 100644 --- a/Mathlib/Algebra/Field/Basic.lean +++ b/Mathlib/Algebra/Field/Basic.lean @@ -3,17 +3,21 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.GrindInstances -import Mathlib.Algebra.Ring.Commute -import Mathlib.Algebra.Ring.Invertible -import Mathlib.Order.Synonym +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.GrindInstances +public import Mathlib.Algebra.Ring.Commute +public import Mathlib.Algebra.Ring.Invertible +public import Mathlib.Order.Synonym /-! # Lemmas about division (semi)rings and (semi)fields -/ +@[expose] public section + open Function OrderDual Set universe u diff --git a/Mathlib/Algebra/Field/Defs.lean b/Mathlib/Algebra/Field/Defs.lean index 08afcf9a9fb0db..d07e14959ce750 100644 --- a/Mathlib/Algebra/Field/Defs.lean +++ b/Mathlib/Algebra/Field/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro, Yaël Dillies -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Data.Rat.Init +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Data.Rat.Init /-! # Division (semi)rings and (semi)fields @@ -43,6 +45,8 @@ a `GroupWithZero` lemma instead. field, division ring, skew field, skew-field, skewfield -/ +@[expose] public section + assert_not_imported Mathlib.Tactic.Common -- `NeZero` theory should not be needed in the basic algebraic hierarchy diff --git a/Mathlib/Algebra/Field/Equiv.lean b/Mathlib/Algebra/Field/Equiv.lean index 29fca06496e27f..d4bd306bccccf5 100644 --- a/Mathlib/Algebra/Field/Equiv.lean +++ b/Mathlib/Algebra/Field/Equiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Field.IsField -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.GroupWithZero.Equiv +module + +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.GroupWithZero.Equiv /-! # If a semiring is a field, any isomorphic semiring is also a field. @@ -13,6 +15,8 @@ import Mathlib.Algebra.GroupWithZero.Equiv This is in a separate file to avoid needing to import `Field` in `Mathlib/Algebra/Ring/Equiv.lean` -/ +@[expose] public section + variable {A B F : Type*} [Semiring A] [Semiring B] protected theorem IsLocalHom.isField [FunLike F A B] [MonoidWithZeroHomClass F A B] {f : F} diff --git a/Mathlib/Algebra/Field/GeomSum.lean b/Mathlib/Algebra/Field/GeomSum.lean index 4272633eee66f8..f9ca820eff56d1 100644 --- a/Mathlib/Algebra/Field/GeomSum.lean +++ b/Mathlib/Algebra/Field/GeomSum.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Ring.GeomSum +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Ring.GeomSum /-! # Partial sums of geometric series in a field @@ -22,6 +24,8 @@ Several variants are recorded, generalising in particular to the case of a divis which `x` and `y` commute. -/ +@[expose] public section + assert_not_exists IsOrderedRing variable {R K : Type*} diff --git a/Mathlib/Algebra/Field/IsField.lean b/Mathlib/Algebra/Field/IsField.lean index 505261080212b5..ea5f05d68cd974 100644 --- a/Mathlib/Algebra/Field/IsField.lean +++ b/Mathlib/Algebra/Field/IsField.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Tactic.Common /-! # `IsField` predicate @@ -16,6 +18,8 @@ to an element of the field its multiplicative inverse, this predicate only assum and can therefore more easily be used to e.g. transfer along ring isomorphisms. -/ +@[expose] public section + universe u section IsField diff --git a/Mathlib/Algebra/Field/MinimalAxioms.lean b/Mathlib/Algebra/Field/MinimalAxioms.lean index 923f29633ddcb5..c39f418311a5bb 100644 --- a/Mathlib/Algebra/Field/MinimalAxioms.lean +++ b/Mathlib/Algebra/Field/MinimalAxioms.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.MinimalAxioms +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.MinimalAxioms /-! # Minimal Axioms for a Field @@ -19,6 +20,8 @@ a minimum number of equalities. -/ +@[expose] public section + universe u /-- Define a `Field` structure on a Type by proving a minimal set of axioms. diff --git a/Mathlib/Algebra/Field/NegOnePow.lean b/Mathlib/Algebra/Field/NegOnePow.lean index 9c1f1a86af7dac..2fc2b8de3277ca 100644 --- a/Mathlib/Algebra/Field/NegOnePow.lean +++ b/Mathlib/Algebra/Field/NegOnePow.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Johan Commelin -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.Tactic.NormNum +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.Tactic.NormNum /-! # Integer powers of `-1` in a field -/ +@[expose] public section + namespace Int lemma cast_negOnePow (K : Type*) (n : ℤ) [DivisionRing K] : n.negOnePow = (-1 : K) ^ n := by diff --git a/Mathlib/Algebra/Field/Opposite.lean b/Mathlib/Algebra/Field/Opposite.lean index 8d912c876ea07c..5ddb52d76c12d1 100644 --- a/Mathlib/Algebra/Field/Opposite.lean +++ b/Mathlib/Algebra/Field/Opposite.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Data.Int.Cast.Lemmas +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Data.Int.Cast.Lemmas /-! # Field structure on the multiplicative/additive opposite -/ +@[expose] public section + assert_not_exists RelIso variable {α : Type*} diff --git a/Mathlib/Algebra/Field/Periodic.lean b/Mathlib/Algebra/Field/Periodic.lean index 0a3b4fb98f919c..30038d6cda1053 100644 --- a/Mathlib/Algebra/Field/Periodic.lean +++ b/Mathlib/Algebra/Field/Periodic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Benjamin Davidson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Benjamin Davidson -/ -import Mathlib.Algebra.Field.Opposite -import Mathlib.Algebra.Module.Opposite -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Ring.Periodic +module + +public import Mathlib.Algebra.Field.Opposite +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Ring.Periodic /-! # Periodic functions @@ -28,6 +30,8 @@ Note that any `c`-antiperiodic function will necessarily also be `2 • c`-perio period, periodic, periodicity, antiperiodic -/ +@[expose] public section + assert_not_exists TwoSidedIdeal variable {α β γ : Type*} {f g : α → β} {c c₁ c₂ x : α} diff --git a/Mathlib/Algebra/Field/Power.lean b/Mathlib/Algebra/Field/Power.lean index a295fde38a1ad9..1a545eb74486b4 100644 --- a/Mathlib/Algebra/Field/Power.lean +++ b/Mathlib/Algebra/Field/Power.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.Int.Parity +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.Int.Parity /-! # Results about powers in fields or division rings. @@ -14,6 +16,8 @@ so contains some lemmas about powers of elements which need imports beyond those needed for the basic definition. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Field/Rat.lean b/Mathlib/Algebra/Field/Rat.lean index 8197bb40873406..01ca8376674e9a 100644 --- a/Mathlib/Algebra/Field/Rat.lean +++ b/Mathlib/Algebra/Field/Rat.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Data.NNRat.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Data.NNRat.Defs /-! # The rational numbers form a field @@ -18,6 +20,8 @@ See note [foundational algebra order theory]. rat, rationals, field, ℚ, numerator, denominator, num, denom -/ +@[expose] public section + namespace Rat instance instField : Field ℚ where diff --git a/Mathlib/Algebra/Field/Shrink.lean b/Mathlib/Algebra/Field/Shrink.lean index a72127e50ab530..92e41a43c6245e 100644 --- a/Mathlib/Algebra/Field/Shrink.lean +++ b/Mathlib/Algebra/Field/Shrink.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Field.TransferInstance -import Mathlib.Logic.Small.Defs -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Field.TransferInstance +public import Mathlib.Logic.Small.Defs +public import Mathlib.Tactic.SuppressCompilation /-! # Transfer field structures from `α` to `Shrink α` -/ +@[expose] public section + noncomputable section universe v diff --git a/Mathlib/Algebra/Field/Subfield/Basic.lean b/Mathlib/Algebra/Field/Subfield/Basic.lean index 15c9961fd92e6b..fa54bae118a9a9 100644 --- a/Mathlib/Algebra/Field/Subfield/Basic.lean +++ b/Mathlib/Algebra/Field/Subfield/Basic.lean @@ -3,12 +3,13 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ +module -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Field.Subfield.Defs -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.Ring.Subring.Basic -import Mathlib.RingTheory.SimpleRing.Basic +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Field.Subfield.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.Ring.Subring.Basic +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Subfields @@ -60,6 +61,8 @@ Lattice inclusion (e.g. `≤` and `⊓`) is used rather than set notation (`⊆` subfield, subfields -/ +@[expose] public section + universe u v w @@ -91,7 +94,7 @@ protected theorem sum_mem {ι : Type*} {t : Finset ι} {f : ι → K} (h : ∀ c end DerivedFromSubfieldClass -/-! # top -/ +/-! ### top -/ /-- The subfield of `K` containing all elements of `K`. -/ @@ -113,7 +116,7 @@ theorem coe_top : ((⊤ : Subfield K) : Set K) = Set.univ := def topEquiv : (⊤ : Subfield K) ≃+* K := Subsemiring.topEquiv -/-! # comap -/ +/-! ### comap -/ variable (f : K →+* L) @@ -138,7 +141,7 @@ theorem comap_comap (s : Subfield M) (g : L →+* M) (f : K →+* L) : (s.comap g).comap f = s.comap (g.comp f) := rfl -/-! # map -/ +/-! ### map -/ /-- The image of a subfield along a ring homomorphism is a subfield. -/ @@ -173,7 +176,7 @@ namespace RingHom variable (g : L →+* M) (f : K →+* L) -/-! # range -/ +/-! ### range -/ /-- The range of a ring homomorphism, as a subfield of the target. See Note [range copy pattern]. -/ @@ -212,7 +215,7 @@ end RingHom namespace Subfield -/-! # inf -/ +/-! ### inf -/ /-- The inf of two subfields is their intersection. -/ @@ -278,7 +281,7 @@ instance : CompleteLattice (Subfield K) := inf_le_right := fun _ _ _ => And.right le_inf := fun _ _ _ h₁ h₂ _ hx => ⟨h₁ hx, h₂ hx⟩ } -/-! # subfield closure of a subset -/ +/-! ### subfield closure of a subset -/ /-- The `Subfield` generated by a set. -/ def closure (s : Set K) : Subfield K := sInf {S | s ⊆ S} @@ -598,7 +601,7 @@ theorem comap_map (f : K →+* L) (s : Subfield K) : (s.map f).comap f = s := end Subfield -/-! ## Actions by `Subfield`s +/-! ### Actions by `Subfield`s These are just copies of the definitions about `Subsemiring` starting from `Subsemiring.MulAction`. diff --git a/Mathlib/Algebra/Field/Subfield/Defs.lean b/Mathlib/Algebra/Field/Subfield/Defs.lean index 3d2db31dcb5ed1..fa0d62cc12204e 100644 --- a/Mathlib/Algebra/Field/Subfield/Defs.lean +++ b/Mathlib/Algebra/Field/Subfield/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Ring.Subring.Defs -import Mathlib.Algebra.Order.Ring.Unbundled.Rat +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Ring.Subring.Defs +public import Mathlib.Algebra.Order.Ring.Unbundled.Rat /-! # Subfields @@ -43,6 +45,8 @@ Lattice inclusion (e.g. `≤` and `⊓`) is used rather than set notation (`⊆` subfield, subfields -/ +@[expose] public section + universe u v w @@ -330,7 +334,7 @@ theorem toSubring_subtype_eq_subtype (S : Subfield K) : S.toSubring.subtype = S.subtype := rfl -/-! # Partial order -/ +/-! ### Partial order -/ theorem mem_toSubmonoid {s : Subfield K} {x : K} : x ∈ s.toSubmonoid ↔ x ∈ s := diff --git a/Mathlib/Algebra/Field/TransferInstance.lean b/Mathlib/Algebra/Field/TransferInstance.lean index 3113a6f271392d..b7132e1ece85b4 100644 --- a/Mathlib/Algebra/Field/TransferInstance.lean +++ b/Mathlib/Algebra/Field/TransferInstance.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Ring.TransferInstance +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Ring.TransferInstance /-! # Transfer algebraic structures across `Equiv`s @@ -12,6 +14,8 @@ import Mathlib.Algebra.Ring.TransferInstance This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + assert_not_exists Module namespace Equiv diff --git a/Mathlib/Algebra/Field/ULift.lean b/Mathlib/Algebra/Field/ULift.lean index 81abb5a313c42b..6ea193f1b572fc 100644 --- a/Mathlib/Algebra/Field/ULift.lean +++ b/Mathlib/Algebra/Field/ULift.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.ULift -import Mathlib.Algebra.Ring.ULift +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.ULift +public import Mathlib.Algebra.Ring.ULift /-! # Field instances for `ULift` @@ -15,6 +17,8 @@ This file defines instances for field, semifield and related structures on `ULif (Recall `ULift α` is just a "copy" of a type `α` in a higher universe.) -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Algebra/Field/ZMod.lean b/Mathlib/Algebra/Field/ZMod.lean index 1bbfa86ba82f33..8ea0979fe4fe22 100644 --- a/Mathlib/Algebra/Field/ZMod.lean +++ b/Mathlib/Algebra/Field/ZMod.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Data.ZMod.Basic /-! # `ZMod p` is a field -/ +@[expose] public section + namespace ZMod variable (p : ℕ) [hp : Fact p.Prime] diff --git a/Mathlib/Algebra/FiveLemma.lean b/Mathlib/Algebra/FiveLemma.lean index aa5c1a14661bd9..d1bed9cc665eda 100644 --- a/Mathlib/Algebra/FiveLemma.lean +++ b/Mathlib/Algebra/FiveLemma.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Exact +module + +public import Mathlib.Algebra.Exact /-! # The five lemma in terms of modules @@ -39,6 +41,8 @@ In theory, we could prove these in the multiplicative version and let `to_additi the additive variants. But `Function.Exact` currently has no multiplicative analogue (yet). -/ +@[expose] public section + assert_not_exists Cardinal namespace AddMonoidHom @@ -71,6 +75,16 @@ lemma surjective_of_surjective_of_surjective_of_injective (hi₁ : Function.Surj use f₁ o + a simp [← show g₁ (i₁ o) = i₂ (f₁ o) by simpa using DFunLike.congr_fun hc₁ o, hb] +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of one four lemma such that the left-most term is zero in terms of (additive) +groups. For a diagram explaining the variables, see the module docstring. -/ +lemma surjective_of_surjective_of_injective_of_left_exact (hi₂ : Function.Surjective i₂) + (hi₃ : Function.Injective i₃) (hg₀ : Function.Injective g₁) : Function.Surjective i₁ := by + refine surjective_of_surjective_of_surjective_of_injective (0 : Unit →+ M₁) f₁ f₂ (0 : Unit →+ N₁) + g₁ g₂ 0 i₁ i₂ i₃ (by simp) hc₁ hc₂ hf₁ (fun y ↦ ?_) hg₁ (fun | .unit => ⟨0, rfl⟩) hi₂ hi₃ + simp only [Set.mem_range, zero_apply, exists_const] + exact ⟨fun h ↦ (hg₀ ((map_zero _).trans h.symm)), fun h ↦ h ▸ (map_zero _)⟩ + include hf₁ hf₂ hg₁ hc₁ hc₂ hc₃ in /-- One four lemma in terms of (additive) groups. For a diagram explaining the variables, see the module docstring. -/ @@ -89,6 +103,15 @@ lemma injective_of_surjective_of_injective_of_injective (hi₁ : Function.Surjec subst hy rw [hf₁.apply_apply_eq_zero] +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of one four lemma such that the right-most term is zero in terms of (additive) +groups. For a diagram explaining the variables, see the module docstring. -/ +lemma injective_of_surjective_of_injective_of_right_exact (hi₁ : Function.Surjective i₁) + (hi₂ : Function.Injective i₂) (hf₂ : Function.Surjective f₂) : Function.Injective i₃ := + injective_of_surjective_of_injective_of_injective f₁ f₂ (0 : M₃ →+ Unit) g₁ g₂ (0 : N₃ →+ Unit) + i₁ i₂ i₃ 0 hc₁ hc₂ (by simp) hf₁ (fun y ↦ by simpa using hf₂ y) hg₁ hi₁ hi₂ + (fun | .unit => by simp) + include hf₁ hf₂ hf₃ hg₁ hg₂ hg₃ hc₁ hc₂ hc₃ hc₄ in /-- The five lemma in terms of (additive) groups. For a diagram explaining the variables, see the module docstring. -/ @@ -100,6 +123,28 @@ lemma bijective_of_surjective_of_bijective_of_bijective_of_injective (hi₁ : Fu surjective_of_surjective_of_surjective_of_injective f₂ f₃ f₄ g₂ g₃ g₄ i₂ i₃ i₄ i₅ hc₂ hc₃ hc₄ hf₃ hg₂ hg₃ hi₂.2 hi₄.2 hi₅⟩ +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of the five lemma in terms of (additive) groups. For a diagram explaining the +variables, see the module docstring. -/ +lemma bijective_of_bijective_of_injective_of_left_exact (hi₂ : Function.Bijective i₂) + (hi₃ : Function.Injective i₃) (hf₀ : Function.Injective f₁) (hg₀ : Function.Injective g₁) : + Function.Bijective i₁ := + ⟨fun {x y} h ↦ (hf₀ (hi₂.1 (congr($hc₁ x).symm.trans (congr(g₁ $h).trans congr($hc₁ y))))), + surjective_of_surjective_of_injective_of_left_exact f₁ f₂ g₁ g₂ i₁ i₂ i₃ + hc₁ hc₂ hf₁ hg₁ hi₂.2 hi₃ hg₀⟩ + +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of the five lemma in terms of (additive) groups. For a diagram explaining the +variables, see the module docstring. -/ +lemma bijective_of_surjective_of_bijective_of_right_exact (hi₁ : Function.Surjective i₁) + (hi₂ : Function.Bijective i₂) (hf₂ : Function.Surjective f₂) (hg₂ : Function.Surjective g₂) : + Function.Bijective i₃ := by + refine ⟨injective_of_surjective_of_injective_of_right_exact f₁ f₂ g₁ g₂ i₁ i₂ i₃ + hc₁ hc₂ hf₁ hg₁ hi₁ hi₂.1 hf₂, fun y ↦ ?_⟩ + obtain ⟨y, rfl⟩ := hg₂ y + obtain ⟨y, rfl⟩ := hi₂.2 y + exact ⟨f₂ y, congr($hc₂ y).symm⟩ + end AddMonoidHom namespace LinearMap @@ -132,6 +177,17 @@ lemma surjective_of_surjective_of_surjective_of_injective (hi₁ : Function.Surj (AddMonoidHom.ext fun x ↦ DFunLike.congr_fun hc₂ x) (AddMonoidHom.ext fun x ↦ DFunLike.congr_fun hc₃ x) hf₂ hg₁ hg₂ hi₁ hi₃ hi₄ +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of one four lemma such that the left-most term is zero in terms of modules. +For a diagram explaining the variables, see the module docstring. -/ +lemma surjective_of_surjective_of_injective_of_left_exact (hi₂ : Function.Surjective i₂) + (hi₃ : Function.Injective i₃) (hg₀ : Function.Injective g₁) : Function.Surjective i₁ := by + refine surjective_of_surjective_of_surjective_of_injective (0 : Unit →ₗ[R] M₁) f₁ f₂ + (0 : Unit →ₗ[R] N₁) g₁ g₂ 0 i₁ i₂ i₃ (by simp) hc₁ hc₂ hf₁ (fun y ↦ ?_) hg₁ + (fun | .unit => ⟨0, rfl⟩) hi₂ hi₃ + simp only [Set.mem_range, zero_apply, exists_const] + exact ⟨fun h ↦ (hg₀ ((map_zero _).trans h.symm)), fun h ↦ h ▸ (map_zero _)⟩ + include hf₁ hf₂ hg₁ hc₁ hc₂ hc₃ in /-- One four lemma in terms of modules. For a diagram explaining the variables, see the module docstring. -/ @@ -145,6 +201,15 @@ lemma injective_of_surjective_of_injective_of_injective (hi₁ : Function.Surjec (AddMonoidHom.ext fun x ↦ DFunLike.congr_fun hc₂ x) (AddMonoidHom.ext fun x ↦ DFunLike.congr_fun hc₃ x) hf₁ hf₂ hg₁ hi₁ hi₂ hi₄ +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of one four lemma such that the right-most term is zero in terms of (additive) +groups. For a diagram explaining the variables, see the module docstring. -/ +lemma injective_of_surjective_of_injective_of_right_exact (hi₁ : Function.Surjective i₁) + (hi₂ : Function.Injective i₂) (hf₂ : Function.Surjective f₂) : Function.Injective i₃ := + injective_of_surjective_of_injective_of_injective f₁ f₂ (0 : M₃ →ₗ[R] Unit) g₁ g₂ + (0 : N₃ →ₗ[R] Unit) i₁ i₂ i₃ 0 hc₁ hc₂ (by simp) hf₁ (fun y ↦ by simpa using hf₂ y) hg₁ hi₁ hi₂ + (fun | .unit => by simp) + include hf₁ hf₂ hf₃ hg₁ hg₂ hg₃ hc₁ hc₂ hc₃ hc₄ in /-- The five lemma in terms of modules. For a diagram explaining the variables, see the module docstring. -/ @@ -156,4 +221,26 @@ lemma bijective_of_surjective_of_bijective_of_bijective_of_injective (hi₁ : Fu surjective_of_surjective_of_surjective_of_injective f₂ f₃ f₄ g₂ g₃ g₄ i₂ i₃ i₄ i₅ hc₂ hc₃ hc₄ hf₃ hg₂ hg₃ hi₂.2 hi₄.2 hi₅⟩ +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of the five lemma in terms of modules. For a diagram explaining the variables, +see the module docstring. -/ +lemma bijective_of_bijective_of_injective_of_left_exact (hi₂ : Function.Bijective i₂) + (hi₃ : Function.Injective i₃) (hf₀ : Function.Injective f₁) (hg₀ : Function.Injective g₁) : + Function.Bijective i₁ := + ⟨fun {x y} h ↦ (hf₀ (hi₂.1 (congr($hc₁ x).symm.trans (congr(g₁ $h).trans congr($hc₁ y))))), + surjective_of_surjective_of_injective_of_left_exact f₁ f₂ g₁ g₂ i₁ i₂ i₃ + hc₁ hc₂ hf₁ hg₁ hi₂.2 hi₃ hg₀⟩ + +include hf₁ hg₁ hc₁ hc₂ in +/-- A special case of the five lemma in terms of modules. For a diagram explaining the variables, +see the module docstring. -/ +lemma bijective_of_surjective_of_bijective_of_right_exact (hi₁ : Function.Surjective i₁) + (hi₂ : Function.Bijective i₂) (hf₂ : Function.Surjective f₂) (hg₂ : Function.Surjective g₂) : + Function.Bijective i₃ := by + refine ⟨injective_of_surjective_of_injective_of_right_exact f₁ f₂ g₁ g₂ i₁ i₂ i₃ + hc₁ hc₂ hf₁ hg₁ hi₁ hi₂.1 hf₂, fun y ↦ ?_⟩ + obtain ⟨y, rfl⟩ := hg₂ y + obtain ⟨y, rfl⟩ := hi₂.2 y + exact ⟨f₂ y, congr($hc₂ y).symm⟩ + end LinearMap diff --git a/Mathlib/Algebra/Free.lean b/Mathlib/Algebra/Free.lean index c0103c7e186636..0d329452c6756b 100644 --- a/Mathlib/Algebra/Free.lean +++ b/Mathlib/Algebra/Free.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Control.Applicative -import Mathlib.Control.Traversable.Basic -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Control.Applicative +public import Mathlib.Control.Traversable.Basic +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.AdaptationNote /-! # Free constructions @@ -26,6 +28,8 @@ import Mathlib.Tactic.AdaptationNote * `FreeMagma.lift`: the universal property of the free magma, expressing its adjointness. -/ +@[expose] public section + universe u v l -- Disable generation of `sizeOf_spec` and `injEq`, diff --git a/Mathlib/Algebra/FreeAbelianGroup/Finsupp.lean b/Mathlib/Algebra/FreeAbelianGroup/Finsupp.lean index 0a30f804dad183..bcb4336d8fa31f 100644 --- a/Mathlib/Algebra/FreeAbelianGroup/Finsupp.lean +++ b/Mathlib/Algebra/FreeAbelianGroup/Finsupp.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Algebra.Module.End -import Mathlib.GroupTheory.FreeAbelianGroup +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Algebra.Module.End +public import Mathlib.GroupTheory.FreeAbelianGroup /-! # Isomorphism between `FreeAbelianGroup X` and `X →₀ ℤ` @@ -20,6 +22,8 @@ We use this to transport the notion of `support` from `Finsupp` to `FreeAbelianG - `FreeAbelianGroup.support`: the finset of `x : X` that occur in `a : FreeAbelianGroup X` -/ +@[expose] public section + assert_not_exists Cardinal Module.Basis noncomputable section diff --git a/Mathlib/Algebra/FreeAbelianGroup/UniqueSums.lean b/Mathlib/Algebra/FreeAbelianGroup/UniqueSums.lean index 9375aa4e79ad6b..ba422e53eca46a 100644 --- a/Mathlib/Algebra/FreeAbelianGroup/UniqueSums.lean +++ b/Mathlib/Algebra/FreeAbelianGroup/UniqueSums.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Yaël Dillies, Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Paul Lezeau -/ -import Mathlib.Algebra.FreeAbelianGroup.Finsupp -import Mathlib.Algebra.Group.UniqueProds.Basic +module + +public import Mathlib.Algebra.FreeAbelianGroup.Finsupp +public import Mathlib.Algebra.Group.UniqueProds.Basic /-! # Free abelian groups have unique sums -/ +@[expose] public section + assert_not_exists Cardinal StarModule instance {σ : Type*} : TwoUniqueSums (FreeAbelianGroup σ) := diff --git a/Mathlib/Algebra/FreeAlgebra.lean b/Mathlib/Algebra/FreeAlgebra.lean index 6afbde963591a8..20b263bc974f17 100644 --- a/Mathlib/Algebra/FreeAlgebra.lean +++ b/Mathlib/Algebra/FreeAlgebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Adam Topaz, Eric Wieser -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.FreeMonoid.UniqueProds -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.FreeMonoid.UniqueProds +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors /-! # Free Algebras @@ -48,6 +50,8 @@ inductively defined relation `FreeAlgebra.Rel`. Explicitly, the construction inv the relation `FreeAlgebra.Rel R X`. -/ +@[expose] public section + variable (R : Type*) [CommSemiring R] variable (X : Type*) @@ -377,12 +381,12 @@ def lift : (X → A) ≃ (FreeAlgebra R X →ₐ[R] A) := let fa : FreeAlgebra R X := Quot.mk (Rel R X) a let fb : FreeAlgebra R X := Quot.mk (Rel R X) b change liftAux R (F ∘ ι R) (fa + fb) = F (fa + fb) - rw [map_add, map_add, ha, hb] + grind | mul a b ha hb => let fa : FreeAlgebra R X := Quot.mk (Rel R X) a let fb : FreeAlgebra R X := Quot.mk (Rel R X) b change liftAux R (F ∘ ι R) (fa * fb) = F (fa * fb) - rw [map_mul, map_mul, ha, hb] } + grind } @[simp] theorem liftAux_eq (f : X → A) : liftAux R f = lift R f := by diff --git a/Mathlib/Algebra/FreeAlgebra/Cardinality.lean b/Mathlib/Algebra/FreeAlgebra/Cardinality.lean index 923be6f0f49784..664adb9e366116 100644 --- a/Mathlib/Algebra/FreeAlgebra/Cardinality.lean +++ b/Mathlib/Algebra/FreeAlgebra/Cardinality.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.FreeAlgebra -import Mathlib.SetTheory.Cardinal.Free +module + +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.SetTheory.Cardinal.Free /-! # Cardinality of free algebras @@ -13,6 +15,8 @@ This file contains some results about the cardinality of `FreeAlgebra`, parallel to that of `MvPolynomial`. -/ +@[expose] public section + universe u v variable (R : Type u) [CommSemiring R] diff --git a/Mathlib/Algebra/FreeMonoid/Basic.lean b/Mathlib/Algebra/FreeMonoid/Basic.lean index 9a3e5262bd9c65..1a4a76138da6fd 100644 --- a/Mathlib/Algebra/FreeMonoid/Basic.lean +++ b/Mathlib/Algebra/FreeMonoid/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Algebra.BigOperators.Group.List.Basic -import Mathlib.Algebra.Group.Equiv.Defs +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Algebra.BigOperators.Group.List.Basic +public import Mathlib.Algebra.Group.Equiv.Defs /-! # Free monoid over a given alphabet @@ -20,6 +22,8 @@ import Mathlib.Algebra.Group.Equiv.Defs * `FreeMonoid.map`: embedding of `α → β` into `FreeMonoid α →* FreeMonoid β` given by `List.map`. -/ +@[expose] public section + variable {α : Type*} {β : Type*} {γ : Type*} {M : Type*} [Monoid M] {N : Type*} [Monoid N] @@ -231,7 +235,7 @@ end Mem /-- Recursor for `FreeMonoid` using `1` and `FreeMonoid.of x * xs` instead of `[]` and `x :: xs`. -/ @[to_additive (attr := elab_as_elim, induction_eliminator) /-- Recursor for `FreeAddMonoid` using `0` and - FreeAddMonoid.of x + xs` instead of `[]` and `x :: xs`. -/] + `FreeAddMonoid.of x + xs` instead of `[]` and `x :: xs`. -/] -- Porting note: change from `List.recOn` to `List.rec` since only the latter is computable def recOn {C : FreeMonoid α → Sort*} (xs : FreeMonoid α) (h0 : C 1) (ih : ∀ x xs, C xs → C (of x * xs)) : C xs := List.rec h0 ih xs diff --git a/Mathlib/Algebra/FreeMonoid/Count.lean b/Mathlib/Algebra/FreeMonoid/Count.lean index 4610e152a967e4..f115873c07349f 100644 --- a/Mathlib/Algebra/FreeMonoid/Count.lean +++ b/Mathlib/Algebra/FreeMonoid/Count.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # `List.count` as a bundled homomorphism @@ -16,6 +18,8 @@ additive homomorphisms from `FreeMonoid` and `FreeAddMonoid`. We do not use `to_additive` too much because it can't map `Multiplicative ℕ` to `ℕ`. -/ +@[expose] public section + variable {α : Type*} (p : α → Prop) [DecidablePred p] namespace FreeMonoid diff --git a/Mathlib/Algebra/FreeMonoid/Symbols.lean b/Mathlib/Algebra/FreeMonoid/Symbols.lean index fcf68ede2d39ba..23ab4a5892c1e0 100644 --- a/Mathlib/Algebra/FreeMonoid/Symbols.lean +++ b/Mathlib/Algebra/FreeMonoid/Symbols.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Hannah Fechtner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hannah Fechtner -/ +module -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Data.Finset.Lattice.Lemmas +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Data.Finset.Lattice.Lemmas /-! # The finite set of symbols in a FreeMonoid element @@ -13,6 +14,8 @@ import Mathlib.Data.Finset.Lattice.Lemmas This is separated from the main FreeMonoid file, as it imports the finiteness hierarchy -/ +@[expose] public section + variable {α : Type*} [DecidableEq α] namespace FreeMonoid diff --git a/Mathlib/Algebra/FreeMonoid/UniqueProds.lean b/Mathlib/Algebra/FreeMonoid/UniqueProds.lean index b265902fa7df49..df157b84c6836a 100644 --- a/Mathlib/Algebra/FreeMonoid/UniqueProds.lean +++ b/Mathlib/Algebra/FreeMonoid/UniqueProds.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Algebra.Group.UniqueProds.Basic -import Mathlib.Algebra.Order.Group.Nat +module + +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Algebra.Group.UniqueProds.Basic +public import Mathlib.Algebra.Order.Group.Nat /-! # Free monoids have unique products -/ +@[expose] public section + assert_not_exists Cardinal Subsemiring Algebra Submodule StarModule open Finset diff --git a/Mathlib/Algebra/FreeNonUnitalNonAssocAlgebra.lean b/Mathlib/Algebra/FreeNonUnitalNonAssocAlgebra.lean index 536bd7de8b7e13..6e84e27cdd245a 100644 --- a/Mathlib/Algebra/FreeNonUnitalNonAssocAlgebra.lean +++ b/Mathlib/Algebra/FreeNonUnitalNonAssocAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Free -import Mathlib.Algebra.MonoidAlgebra.Basic +module + +public import Mathlib.Algebra.Free +public import Mathlib.Algebra.MonoidAlgebra.Basic /-! # Free algebras @@ -35,6 +37,8 @@ free algebra, non-unital, non-associative, free magma, magma algebra, universal forgetful functor, adjoint functor -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/GCDMonoid/Basic.lean b/Mathlib/Algebra/GCDMonoid/Basic.lean index 754ba63817645e..68091237fdb73c 100644 --- a/Mathlib/Algebra/GCDMonoid/Basic.lean +++ b/Mathlib/Algebra/GCDMonoid/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker -/ -import Mathlib.Algebra.Ring.Associated -import Mathlib.Algebra.Ring.Regular +module + +public import Mathlib.Algebra.Ring.Associated +public import Mathlib.Algebra.Ring.Regular /-! # Monoids with normalization functions, `gcd`, and `lcm` @@ -60,6 +62,8 @@ For the `NormalizedGCDMonoid` instances on `ℕ` and `ℤ`, see `Mathlib/Algebra divisibility, gcd, lcm, normalize -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/GCDMonoid/Finset.lean b/Mathlib/Algebra/GCDMonoid/Finset.lean index 755c461adb3da1..1c1f52cc3121e2 100644 --- a/Mathlib/Algebra/GCDMonoid/Finset.lean +++ b/Mathlib/Algebra/GCDMonoid/Finset.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Finset.Fold -import Mathlib.Algebra.GCDMonoid.Multiset +module + +public import Mathlib.Data.Finset.Fold +public import Mathlib.Algebra.GCDMonoid.Multiset /-! # GCD and LCM operations on finsets @@ -26,6 +28,8 @@ TODO: simplify with a tactic and `Data.Finset.Lattice` finset, gcd -/ +@[expose] public section + variable {ι α β γ : Type*} namespace Finset diff --git a/Mathlib/Algebra/GCDMonoid/IntegrallyClosed.lean b/Mathlib/Algebra/GCDMonoid/IntegrallyClosed.lean index a9dea636b496ce..3cee10c61be43a 100644 --- a/Mathlib/Algebra/GCDMonoid/IntegrallyClosed.lean +++ b/Mathlib/Algebra/GCDMonoid/IntegrallyClosed.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.Polynomial.Eisenstein.Basic +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.Polynomial.Eisenstein.Basic /-! @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Polynomial.Eisenstein.Basic -/ +@[expose] public section + open scoped Polynomial diff --git a/Mathlib/Algebra/GCDMonoid/Multiset.lean b/Mathlib/Algebra/GCDMonoid/Multiset.lean index eab8287399eb6f..a8e2197fe17714 100644 --- a/Mathlib/Algebra/GCDMonoid/Multiset.lean +++ b/Mathlib/Algebra/GCDMonoid/Multiset.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Data.Multiset.FinsetOps -import Mathlib.Data.Multiset.Fold +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Data.Multiset.FinsetOps +public import Mathlib.Data.Multiset.Fold /-! # GCD and LCM operations on multisets @@ -25,6 +27,8 @@ TODO: simplify with a tactic and `Data.Multiset.Lattice` multiset, gcd -/ +@[expose] public section + namespace Multiset variable {α : Type*} [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α] diff --git a/Mathlib/Algebra/GCDMonoid/Nat.lean b/Mathlib/Algebra/GCDMonoid/Nat.lean index cb607e7e7e27f1..b3816f2b5bb9dc 100644 --- a/Mathlib/Algebra/GCDMonoid/Nat.lean +++ b/Mathlib/Algebra/GCDMonoid/Nat.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.Algebra.GroupWithZero.Nat +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.Algebra.GroupWithZero.Nat /-! # ℕ and ℤ are normalized GCD monoids. @@ -23,6 +25,8 @@ import Mathlib.Algebra.GroupWithZero.Nat natural numbers, integers, normalization monoid, gcd monoid, greatest common divisor -/ +@[expose] public section + assert_not_exists IsOrderedMonoid /-- `ℕ` is a gcd_monoid. -/ diff --git a/Mathlib/Algebra/GCDMonoid/PUnit.lean b/Mathlib/Algebra/GCDMonoid/PUnit.lean index 8279c4d6385fb9..27055c29e380bc 100644 --- a/Mathlib/Algebra/GCDMonoid/PUnit.lean +++ b/Mathlib/Algebra/GCDMonoid/PUnit.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Algebra.Ring.PUnit +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Algebra.Ring.PUnit /-! # `PUnit` is a GCD monoid @@ -13,6 +15,8 @@ This file collects facts about algebraic structures on the one-element type, e.g GCD. -/ +@[expose] public section + namespace PUnit -- This is too high-powered and should be split off also diff --git a/Mathlib/Algebra/GeomSum.lean b/Mathlib/Algebra/GeomSum.lean index 4a8750533a2710..ae304b7590bd84 100644 --- a/Mathlib/Algebra/GeomSum.lean +++ b/Mathlib/Algebra/GeomSum.lean @@ -1,8 +1,10 @@ -import Mathlib.Algebra.Group.NatPowAssoc -import Mathlib.Algebra.Order.Field.GeomSum -import Mathlib.Algebra.Order.Ring.GeomSum -import Mathlib.Algebra.Ring.Regular -import Mathlib.Tactic.Abel -import Mathlib.Tactic.Positivity.Basic +module + +public import Mathlib.Algebra.Group.NatPowAssoc +public import Mathlib.Algebra.Order.Field.GeomSum +public import Mathlib.Algebra.Order.Ring.GeomSum +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.Positivity.Basic deprecated_module (since := "2025-06-19") diff --git a/Mathlib/Algebra/GradedMonoid.lean b/Mathlib/Algebra/GradedMonoid.lean index 4aa067410cc4c3..6711e5c6299d7d 100644 --- a/Mathlib/Algebra/GradedMonoid.lean +++ b/Mathlib/Algebra/GradedMonoid.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.BigOperators.Group.List.Lemmas -import Mathlib.Algebra.Group.Action.Hom -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Data.List.FinRange -import Mathlib.Data.SetLike.Basic -import Mathlib.Data.Sigma.Basic -import Lean.Elab.Tactic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.List.Lemmas +public import Mathlib.Algebra.Group.Action.Hom +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Data.List.FinRange +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Data.Sigma.Basic +public import Lean.Elab.Tactic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Additively-graded multiplicative structures @@ -89,6 +91,8 @@ This file also defines: graded monoid -/ +@[expose] public section + variable {ι : Type*} diff --git a/Mathlib/Algebra/GradedMulAction.lean b/Mathlib/Algebra/GradedMulAction.lean index dd994a36060775..2390d94adba213 100644 --- a/Mathlib/Algebra/GradedMulAction.lean +++ b/Mathlib/Algebra/GradedMulAction.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Eric Wieser -/ -import Mathlib.Algebra.GradedMonoid +module + +public import Mathlib.Algebra.GradedMonoid /-! # Additively-graded multiplicative action structures @@ -44,6 +46,8 @@ a `MulAction` instance. graded action -/ +@[expose] public section + variable {ιA ιB ιM : Type*} diff --git a/Mathlib/Algebra/Group/Action/Basic.lean b/Mathlib/Algebra/Group/Action/Basic.lean index 10bf69c2f9f06d..e5f4b7723db481 100644 --- a/Mathlib/Algebra/Group/Action/Basic.lean +++ b/Mathlib/Algebra/Group/Action/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Action.Units -import Mathlib.Algebra.Group.Invertible.Basic -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Logic.Embedding.Basic +module + +public import Mathlib.Algebra.Group.Action.Units +public import Mathlib.Algebra.Group.Invertible.Basic +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Logic.Embedding.Basic /-! # More lemmas about group actions @@ -15,6 +17,8 @@ This file contains lemmas about group actions that require more imports than `Mathlib/Algebra/Group/Action/Defs.lean` offers. -/ +@[expose] public section + assert_not_exists MonoidWithZero Equiv.Perm.permGroup variable {G M A B α β : Type*} diff --git a/Mathlib/Algebra/Group/Action/Defs.lean b/Mathlib/Algebra/Group/Action/Defs.lean index 9000343852bc9e..613aec78fcb7b6 100644 --- a/Mathlib/Algebra/Group/Action/Defs.lean +++ b/Mathlib/Algebra/Group/Action/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Opposites -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Opposites +public import Mathlib.Tactic.Spread /-! # Definitions of group actions @@ -42,6 +44,8 @@ More sophisticated lemmas belong in `GroupTheory.GroupAction`. group action -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function (Injective Surjective) diff --git a/Mathlib/Algebra/Group/Action/End.lean b/Mathlib/Algebra/Group/Action/End.lean index 16d092594acf8d..fa4b1e545fe784 100644 --- a/Mathlib/Algebra/Group/Action/End.lean +++ b/Mathlib/Algebra/Group/Action/End.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Action.Hom -import Mathlib.Algebra.Group.End +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Action.Hom +public import Mathlib.Algebra.Group.End /-! # Interaction between actions and endomorphisms/automorphisms @@ -20,6 +22,8 @@ This file provides two things: monoid action, group action -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function (Injective Surjective) diff --git a/Mathlib/Algebra/Group/Action/Equidecomp.lean b/Mathlib/Algebra/Group/Action/Equidecomp.lean index 4313db6c93d68f..d8656a44340295 100644 --- a/Mathlib/Algebra/Group/Action/Equidecomp.lean +++ b/Mathlib/Algebra/Group/Action/Equidecomp.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Felix Weilacher. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Felix Weilacher -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Logic.Equiv.PartialEquiv -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Logic.Equiv.PartialEquiv +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Equidecompositions @@ -50,6 +52,8 @@ We take this as our definition as it is easier to work with. It is implemented a -/ +@[expose] public section + variable {X G : Type*} {A B C : Set X} open Function Set Pointwise PartialEquiv diff --git a/Mathlib/Algebra/Group/Action/Faithful.lean b/Mathlib/Algebra/Group/Action/Faithful.lean index c17f3d4cab5776..91424919a90b8f 100644 --- a/Mathlib/Algebra/Group/Action/Faithful.lean +++ b/Mathlib/Algebra/Group/Action/Faithful.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs +module + +public import Mathlib.Algebra.Group.Action.Defs /-! # Faithful group actions @@ -25,6 +27,8 @@ More sophisticated lemmas belong in `GroupTheory.GroupAction`. group action -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function (Injective Surjective) diff --git a/Mathlib/Algebra/Group/Action/Hom.lean b/Mathlib/Algebra/Group/Action/Hom.lean index 72a9f82dac8ee5..9db532a67e2fb9 100644 --- a/Mathlib/Algebra/Group/Action/Hom.lean +++ b/Mathlib/Algebra/Group/Action/Hom.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Pretransitive -import Mathlib.Algebra.Group.Hom.Defs +module + +public import Mathlib.Algebra.Group.Action.Pretransitive +public import Mathlib.Algebra.Group.Hom.Defs /-! # Homomorphisms and group actions -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function (Injective Surjective) diff --git a/Mathlib/Algebra/Group/Action/Opposite.lean b/Mathlib/Algebra/Group/Action/Opposite.lean index 104e18d527ae04..10a71bb733c0fc 100644 --- a/Mathlib/Algebra/Group/Action/Opposite.lean +++ b/Mathlib/Algebra/Group/Action/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.Opposite +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.Opposite /-! # Scalar actions on and by `Mᵐᵒᵖ` @@ -25,6 +27,8 @@ With `open scoped RightActions`, this provides: * `p <+ᵥ v` as an alias for `AddOpposite.op v +ᵥ p` -/ +@[expose] public section + assert_not_exists MonoidWithZero Units FaithfulSMul MonoidHom variable {M N α β : Type*} diff --git a/Mathlib/Algebra/Group/Action/Option.lean b/Mathlib/Algebra/Group/Action/Option.lean index 65d765e75b4949..431c6018b03de8 100644 --- a/Mathlib/Algebra/Group/Action/Option.lean +++ b/Mathlib/Algebra/Group/Action/Option.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Faithful +module + +public import Mathlib.Algebra.Group.Action.Faithful /-! # Option instances for additive and multiplicative actions @@ -18,6 +20,8 @@ multiplication is defined by `a • some b = some (a • b)` and `a • none = n * `Mathlib/Algebra/Group/Action/Sum.lean` -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {M N α : Type*} diff --git a/Mathlib/Algebra/Group/Action/Pi.lean b/Mathlib/Algebra/Group/Action/Pi.lean index 369acff8b6e49d..cadc487a7414f4 100644 --- a/Mathlib/Algebra/Group/Action/Pi.lean +++ b/Mathlib/Algebra/Group/Action/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Data.Set.Piecewise +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Data.Set.Piecewise /-! # Pi instances for multiplicative actions @@ -20,6 +22,8 @@ This file defines instances for `MulAction` and related structures on `Pi` types * `Mathlib/Algebra/Group/Action/Sum.lean` -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {ι M N : Type*} {α β γ : ι → Type*} (i : ι) diff --git a/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean b/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean index 47424441faa190..f1779b95700972 100644 --- a/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean +++ b/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Pointwise actions of finsets -/ +@[expose] public section + -- TODO -- assert_not_exists MonoidWithZero assert_not_exists Cardinal diff --git a/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean b/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean index abb5f827643bf0..26eab5c97ab06c 100644 --- a/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean +++ b/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Action.Opposite -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Data.Set.Pairwise.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Action.Opposite +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Data.Set.Pairwise.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise actions on sets @@ -25,6 +27,8 @@ of `α`/`Set α` on `Set β`. instances reducible changes the behavior of `simp`. -/ +@[expose] public section + assert_not_exists MonoidWithZero IsOrderedMonoid open Function MulOpposite diff --git a/Mathlib/Algebra/Group/Action/Pointwise/Set/Finite.lean b/Mathlib/Algebra/Group/Action/Pointwise/Set/Finite.lean index e1dd19b2194009..0ae13f3a282212 100644 --- a/Mathlib/Algebra/Group/Action/Pointwise/Set/Finite.lean +++ b/Mathlib/Algebra/Group/Action/Pointwise/Set/Finite.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Data.Set.Finite.Basic /-! # Finiteness lemmas for pointwise operations on sets -/ +@[expose] public section + open scoped Pointwise namespace Set diff --git a/Mathlib/Algebra/Group/Action/Pretransitive.lean b/Mathlib/Algebra/Group/Action/Pretransitive.lean index a4b3fe17811b66..7f3c93f298c254 100644 --- a/Mathlib/Algebra/Group/Action/Pretransitive.lean +++ b/Mathlib/Algebra/Group/Action/Pretransitive.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.TypeTags +module + +public import Mathlib.Algebra.Group.Action.TypeTags /-! # Pretransitive group actions @@ -25,6 +27,8 @@ More sophisticated lemmas belong in `GroupTheory.GroupAction`. group action -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function (Injective Surjective) diff --git a/Mathlib/Algebra/Group/Action/Prod.lean b/Mathlib/Algebra/Group/Action/Prod.lean index bc9c386514fe0f..123f72b7e017d0 100644 --- a/Mathlib/Algebra/Group/Action/Prod.lean +++ b/Mathlib/Algebra/Group/Action/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Group.Action.Hom -import Mathlib.Algebra.Group.Prod +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Group.Action.Hom +public import Mathlib.Algebra.Group.Prod /-! # Prod instances for additive and multiplicative actions @@ -25,7 +27,7 @@ scalar multiplication as a homomorphism from `α × β` to `β`. * `Mathlib/Algebra/Group/Action/Sigma.lean` * `Mathlib/Algebra/Group/Action/Sum.lean` -# Porting notes +## Porting notes The `to_additive` attribute can be used to generate both the `smul` and `vadd` lemmas from the corresponding `pow` lemmas, as explained on zulip here: @@ -34,6 +36,8 @@ https://leanprover.zulipchat.com/#narrow/near/316087838 This was not done as part of the port in order to stay as close as possible to the mathlib3 code. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {M N P E α β : Type*} diff --git a/Mathlib/Algebra/Group/Action/Sigma.lean b/Mathlib/Algebra/Group/Action/Sigma.lean index 8cdaccd36375e7..f593f124405477 100644 --- a/Mathlib/Algebra/Group/Action/Sigma.lean +++ b/Mathlib/Algebra/Group/Action/Sigma.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Data.Sigma.Basic +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Data.Sigma.Basic /-! # Sigma instances for additive and multiplicative actions @@ -19,6 +21,8 @@ This file defines instances for arbitrary sum of additive and multiplicative act * `Mathlib/Algebra/Group/Action/Sum.lean` -/ +@[expose] public section + assert_not_exists MonoidWithZero diff --git a/Mathlib/Algebra/Group/Action/Sum.lean b/Mathlib/Algebra/Group/Action/Sum.lean index 2c9e9346ceca88..41903f0cc8f338 100644 --- a/Mathlib/Algebra/Group/Action/Sum.lean +++ b/Mathlib/Algebra/Group/Action/Sum.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Faithful +module + +public import Mathlib.Algebra.Group.Action.Faithful /-! # Sum instances for additive and multiplicative actions @@ -18,6 +20,8 @@ This file defines instances for additive and multiplicative actions on the binar * `Mathlib/Algebra/Group/Action/Sigma.lean` -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {M N α β : Type*} diff --git a/Mathlib/Algebra/Group/Action/TransferInstance.lean b/Mathlib/Algebra/Group/Action/TransferInstance.lean index 4948fe3aea634b..e48665a2f15a85 100644 --- a/Mathlib/Algebra/Group/Action/TransferInstance.lean +++ b/Mathlib/Algebra/Group/Action/TransferInstance.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Data.Fintype.Basic /-! # Transfer algebraic structures across `Equiv`s @@ -15,6 +17,8 @@ import Mathlib.Data.Fintype.Basic This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace Equiv diff --git a/Mathlib/Algebra/Group/Action/TypeTags.lean b/Mathlib/Algebra/Group/Action/TypeTags.lean index 3b63ed221a9e81..7c87abd05e2126 100644 --- a/Mathlib/Algebra/Group/Action/TypeTags.lean +++ b/Mathlib/Algebra/Group/Action/TypeTags.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # Additive and Multiplicative for group actions @@ -14,6 +16,8 @@ import Mathlib.Algebra.Group.TypeTags.Basic group action -/ +@[expose] public section + assert_not_exists MonoidWithZero MonoidHom open Function (Injective Surjective) diff --git a/Mathlib/Algebra/Group/Action/Units.lean b/Mathlib/Algebra/Group/Action/Units.lean index da68759a816641..aa8d5bd595c464 100644 --- a/Mathlib/Algebra/Group/Action/Units.lean +++ b/Mathlib/Algebra/Group/Action/Units.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Units.Defs +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Units.Defs /-! # Group actions on and by `Mˣ` @@ -20,6 +22,8 @@ These instances use a primed name. The results are repeated for `AddUnits` and `VAdd` where relevant. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {G H M N α : Type*} diff --git a/Mathlib/Algebra/Group/AddChar.lean b/Mathlib/Algebra/Group/AddChar.lean index 6ab93de86ac67f..03e93d09248230 100644 --- a/Mathlib/Algebra/Group/AddChar.lean +++ b/Mathlib/Algebra/Group/AddChar.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.Ring.Regular +module + +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.Ring.Regular /-! # Characters from additive to multiplicative monoids @@ -28,7 +30,7 @@ We also include some constructions specific to the case when `A = R` is a ring; For more refined results of a number-theoretic nature (primitive characters, Gauss sums, etc) see `Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean`. -# Implementation notes +## Implementation notes Due to their role as the dual of an additive group, additive characters must themselves be an additive group. This contrasts to their pointwise operations which make them a multiplicative group. @@ -42,6 +44,8 @@ https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Additive.20ch additive character -/ +@[expose] public section + /-! ### Definitions related to and results on additive characters -/ diff --git a/Mathlib/Algebra/Group/Basic.lean b/Mathlib/Algebra/Group/Basic.lean index e464adeb8c2dd5..a1ef9de45e032a 100644 --- a/Mathlib/Algebra/Group/Basic.lean +++ b/Mathlib/Algebra/Group/Basic.lean @@ -3,12 +3,13 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Simon Hudon, Mario Carneiro -/ -import Aesop -import Mathlib.Algebra.Group.Defs -import Mathlib.Data.Int.Init -import Mathlib.Logic.Function.Iterate -import Mathlib.Tactic.SimpRw -import Mathlib.Tactic.SplitIfs +module + +public import Aesop +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Data.Int.Init +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Tactic.SimpRw /-! # Basic lemmas about semigroups, monoids, and groups @@ -18,6 +19,8 @@ one-liners from the corresponding axioms. For the definitions of semigroups, mon `Mathlib/Algebra/Group/Defs.lean`. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered open Function @@ -81,6 +84,11 @@ section MulOneClass variable [MulOneClass M] +@[to_additive] +instance Semigroup.to_isLawfulIdentity : Std.LawfulIdentity (α := M) (· * ·) 1 where + left_id := one_mul + right_id := mul_one + @[to_additive] theorem ite_mul_one {P : Prop} [Decidable P] {a b : M} : ite P (a * b) 1 = ite P a 1 * ite P b 1 := by @@ -1034,7 +1042,7 @@ lemma hom_coe_pow {F : Type*} [Monoid F] (c : F → M → M) (h1 : c 1 = id) | n + 1 => by rw [pow_succ, iterate_succ, hmul, hom_coe_pow c h1 hmul f n] /-! -# Instances for `grind`. +### Instances for `grind`. -/ open Lean diff --git a/Mathlib/Algebra/Group/Center.lean b/Mathlib/Algebra/Group/Center.lean index d05366b2c98d53..4e098fba2720ef 100644 --- a/Mathlib/Algebra/Group/Center.lean +++ b/Mathlib/Algebra/Group/Center.lean @@ -3,11 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Commute.Units -import Mathlib.Algebra.Group.Invertible.Basic -import Mathlib.Logic.Basic -import Mathlib.Data.Set.Basic -import Mathlib.Algebra.Notation.Prod +module + +public import Mathlib.Algebra.Group.Invertible.Basic +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Data.Set.Basic /-! # Centers of magmas and semigroups @@ -38,6 +38,8 @@ We provide `Monoid.centralizer`, `AddMonoid.centralizer`, `Subgroup.centralizer` `AddSubgroup.centralizer` in other files. -/ +@[expose] public section + assert_not_exists HeytingAlgebra RelIso Finset MonoidWithZero Subsemigroup variable {M : Type*} {S T : Set M} diff --git a/Mathlib/Algebra/Group/Commutator.lean b/Mathlib/Algebra/Group/Commutator.lean index b719453bc1f7a1..ee9381b6803e3d 100644 --- a/Mathlib/Algebra/Group/Commutator.lean +++ b/Mathlib/Algebra/Group/Commutator.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Data.Bracket +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Data.Bracket /-! # The bracket on a group given by commutator. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered /-- The commutator of two elements `g₁` and `g₂`. -/ diff --git a/Mathlib/Algebra/Group/Commute/Basic.lean b/Mathlib/Algebra/Group/Commute/Basic.lean index 592b85e20f27d7..4c54462ae2949c 100644 --- a/Mathlib/Algebra/Group/Commute/Basic.lean +++ b/Mathlib/Algebra/Group/Commute/Basic.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Semiconj.Basic +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Semiconj.Basic /-! # Additional lemmas about commuting pairs of elements in monoids -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {G : Type*} diff --git a/Mathlib/Algebra/Group/Commute/Defs.lean b/Mathlib/Algebra/Group/Commute/Defs.lean index af7b68f0697bca..dbaa7979ce9cac 100644 --- a/Mathlib/Algebra/Group/Commute/Defs.lean +++ b/Mathlib/Algebra/Group/Commute/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Semiconj.Defs +module + +public import Mathlib.Algebra.Group.Semiconj.Defs /-! # Commuting pairs of elements in monoids @@ -24,6 +26,8 @@ This file defines only a few operations (`mul_left`, `inv_right`, etc). Other o Most of the proofs come from the properties of `SemiconjBy`. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {G M S : Type*} diff --git a/Mathlib/Algebra/Group/Commute/Hom.lean b/Mathlib/Algebra/Group/Commute/Hom.lean index 74d5ad5e18c7b8..bb4eb3604af038 100644 --- a/Mathlib/Algebra/Group/Commute/Hom.lean +++ b/Mathlib/Algebra/Group/Commute/Hom.lean @@ -4,13 +4,17 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Kevin Buzzard, Kim Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Hom.Defs +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Hom.Defs /-! # Multiplicative homomorphisms respect semiconjugation and commutation. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered section Commute diff --git a/Mathlib/Algebra/Group/Commute/Units.lean b/Mathlib/Algebra/Group/Commute/Units.lean index d94b6d9591f5d8..7c58d890916ba1 100644 --- a/Mathlib/Algebra/Group/Commute/Units.lean +++ b/Mathlib/Algebra/Group/Commute/Units.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Semiconj.Units +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Semiconj.Units /-! # Lemmas about commuting pairs of elements involving units. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {M : Type*} diff --git a/Mathlib/Algebra/Group/Conj.lean b/Mathlib/Algebra/Group/Conj.lean index 1bb7e4a87029b9..2e052dd54d7db6 100644 --- a/Mathlib/Algebra/Group/Conj.lean +++ b/Mathlib/Algebra/Group/Conj.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Chris Hughes, Michael Howes -/ -import Mathlib.Algebra.Group.End -import Mathlib.Algebra.Group.Semiconj.Units +module + +public import Mathlib.Algebra.Group.End +public import Mathlib.Algebra.Group.Semiconj.Units /-! # Conjugacy of group elements @@ -12,6 +14,8 @@ import Mathlib.Algebra.Group.Semiconj.Units See also `MulAut.conj` and `Quandle.conj`. -/ +@[expose] public section + assert_not_exists MonoidWithZero Multiset MulAction universe u v diff --git a/Mathlib/Algebra/Group/ConjFinite.lean b/Mathlib/Algebra/Group/ConjFinite.lean index 2f857b428d4b92..001f212631a576 100644 --- a/Mathlib/Algebra/Group/ConjFinite.lean +++ b/Mathlib/Algebra/Group/ConjFinite.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Algebra.Group.Conj -import Mathlib.Data.Fintype.Units +module + +public import Mathlib.Algebra.Group.Conj +public import Mathlib.Data.Fintype.Units /-! # Conjugacy of elements of finite groups -/ +@[expose] public section + assert_not_exists Field -- TODO: the following `assert_not_exists` should work, but does not diff --git a/Mathlib/Algebra/Group/Defs.lean b/Mathlib/Algebra/Group/Defs.lean index 92d9d70745cf7b..8d34a470a090a8 100644 --- a/Mathlib/Algebra/Group/Defs.lean +++ b/Mathlib/Algebra/Group/Defs.lean @@ -3,15 +3,16 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Simon Hudon, Mario Carneiro -/ -import Batteries.Logic -import Mathlib.Algebra.Notation.Defs -import Mathlib.Algebra.Regular.Defs -import Mathlib.Data.Int.Notation -import Mathlib.Data.Nat.BinaryRec -import Mathlib.Logic.Function.Defs -import Mathlib.Tactic.MkIffOfInductiveProp -import Mathlib.Tactic.OfNat -import Mathlib.Tactic.Basic +module + +public import Batteries.Logic +public import Mathlib.Algebra.Notation.Defs +public import Mathlib.Algebra.Regular.Defs +public import Mathlib.Data.Int.Notation +public import Mathlib.Data.Nat.BinaryRec +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Mathlib.Tactic.OfNat +public import Mathlib.Tactic.Basic /-! # Typeclasses for (semi)groups and monoids @@ -40,6 +41,8 @@ We register the following instances: -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered Function.const_injective universe u v w diff --git a/Mathlib/Algebra/Group/Embedding.lean b/Mathlib/Algebra/Group/Embedding.lean index a276c9866e6869..2f25388801cdef 100644 --- a/Mathlib/Algebra/Group/Embedding.lean +++ b/Mathlib/Algebra/Group/Embedding.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Logic.Embedding.Basic -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Logic.Embedding.Basic +public import Mathlib.Algebra.Group.Defs /-! # The embedding of a cancellative semigroup into itself by multiplication by a fixed element. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {G : Type*} diff --git a/Mathlib/Algebra/Group/End.lean b/Mathlib/Algebra/Group/End.lean index 3f6bd2686de3c8..658de0d6cd0042 100644 --- a/Mathlib/Algebra/Group/End.lean +++ b/Mathlib/Algebra/Group/End.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.TypeTags -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Data.Set.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Group.Equiv.TypeTags +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Data.Set.Basic +public import Mathlib.Tactic.Common /-! # Monoids of endomorphisms, groups of automorphisms @@ -30,6 +32,8 @@ function composition, and multiplication in `CategoryTheory.End`, but not with end monoid, aut group -/ +@[expose] public section + assert_not_exists HeytingAlgebra MonoidWithZero MulAction RelIso variable {A M G α β γ : Type*} @@ -98,11 +102,11 @@ theorem mul_apply (f g : Perm α) (x) : (f * g) x = f (g x) := theorem one_apply (x) : (1 : Perm α) x = x := rfl -@[simp] +@[deprecated symm_apply_apply (since := "2025-08-16")] theorem inv_apply_self (f : Perm α) (x) : f⁻¹ (f x) = x := f.symm_apply_apply x -@[simp] +@[deprecated apply_symm_apply (since := "2025-08-16")] theorem apply_inv_self (f : Perm α) (x) : f (f⁻¹ x) = x := f.apply_symm_apply x @@ -115,6 +119,8 @@ theorem mul_def (f g : Perm α) : f * g = g.trans f := theorem inv_def (f : Perm α) : f⁻¹ = f.symm := rfl +@[simp] lemma coe_inv (f : Perm α) : ⇑f⁻¹ = ⇑f.symm := rfl + @[simp, norm_cast] lemma coe_one : ⇑(1 : Perm α) = id := rfl @[simp, norm_cast] lemma coe_mul (f g : Perm α) : ⇑(f * g) = f ∘ g := rfl @@ -367,8 +373,8 @@ variable {p : α → Prop} {f : Perm α} def subtypePerm (f : Perm α) (h : ∀ x, p (f x) ↔ p x) : Perm { x // p x } where toFun := fun x => ⟨f x, (h _).2 x.2⟩ invFun := fun x => ⟨f⁻¹ x, (h (f⁻¹ x)).1 <| by simpa using x.2⟩ - left_inv _ := by simp only [Perm.inv_apply_self, Subtype.coe_eta] - right_inv _ := by simp only [Perm.apply_inv_self, Subtype.coe_eta] + left_inv _ := by simp + right_inv _ := by simp @[simp] theorem subtypePerm_apply (f : Perm α) (h : ∀ x, p (f x) ↔ p x) (x : { x // p x }) : @@ -386,7 +392,7 @@ theorem subtypePerm_mul (f g : Perm α) (hf hg) : rfl private theorem inv_aux : (∀ x, p (f x) ↔ p x) ↔ ∀ x, p (f⁻¹ x) ↔ p x := - f⁻¹.surjective.forall.trans <| by simp_rw [f.apply_inv_self, Iff.comm] + f⁻¹.surjective.forall.trans <| by simp [Iff.comm] /-- See `Equiv.Perm.inv_subtypePerm`. -/ theorem subtypePerm_inv (f : Perm α) (hf) : @@ -519,12 +525,10 @@ theorem swap_mul_self (i j : α) : swap i j * swap i j = 1 := theorem swap_mul_eq_mul_swap (f : Perm α) (x y : α) : swap x y * f = f * swap (f⁻¹ x) (f⁻¹ y) := Equiv.ext fun z => by - simp only [Perm.mul_apply, swap_apply_def] - split_ifs <;> - simp_all only [Perm.apply_inv_self, Perm.eq_inv_iff_eq, not_true] + simp only [Perm.mul_apply, swap_apply_def]; split_ifs <;> simp_all [eq_symm_apply] theorem mul_swap_eq_swap_mul (f : Perm α) (x y : α) : f * swap x y = swap (f x) (f y) * f := by - rw [swap_mul_eq_mul_swap, Perm.inv_apply_self, Perm.inv_apply_self] + simp [swap_mul_eq_mul_swap] theorem swap_apply_apply (f : Perm α) (x y : α) : swap (f x) (f y) = f * swap x y * f⁻¹ := by rw [mul_swap_eq_swap_mul, mul_inv_cancel_right] diff --git a/Mathlib/Algebra/Group/Equiv/Basic.lean b/Mathlib/Algebra/Group/Equiv/Basic.lean index e1cf82e5566373..2c5ce51abe6854 100644 --- a/Mathlib/Algebra/Group/Equiv/Basic.lean +++ b/Mathlib/Algebra/Group/Equiv/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Logic.Equiv.Basic -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Logic.Equiv.Basic +public import Mathlib.Tactic.Spread /-! # Multiplicative and additive equivs @@ -18,6 +20,8 @@ This file contains basic results on `MulEquiv` and `AddEquiv`. Equiv, MulEquiv, AddEquiv -/ +@[expose] public section + assert_not_exists Fintype open Function diff --git a/Mathlib/Algebra/Group/Equiv/Defs.lean b/Mathlib/Algebra/Group/Equiv/Defs.lean index fa781103de72a7..e919e2f1ee2d2c 100644 --- a/Mathlib/Algebra/Group/Equiv/Defs.lean +++ b/Mathlib/Algebra/Group/Equiv/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Logic.Equiv.Defs /-! # Multiplicative and additive equivs @@ -31,6 +33,8 @@ notation when treating the isomorphisms as maps. Equiv, MulEquiv, AddEquiv -/ +@[expose] public section + open Function variable {F α β M N P G H : Type*} @@ -446,7 +450,7 @@ protected def cast {ι : Type*} {M : ι → Type*} [∀ i, Mul (M i)] {i j : ι} map_mul' _ _ := by cases h; rfl /-! -## Monoids +### Monoids -/ section MulOneClass @@ -522,7 +526,7 @@ theorem toMonoidHom_injective : Injective (toMonoidHom : M ≃* N → M →* N) end MulOneClass /-! -# Groups +### Groups -/ /-- A multiplicative equivalence of groups preserves inversion. -/ diff --git a/Mathlib/Algebra/Group/Equiv/Finite.lean b/Mathlib/Algebra/Group/Equiv/Finite.lean index 73e50571f3fe6f..beb0287f136da8 100644 --- a/Mathlib/Algebra/Group/Equiv/Finite.lean +++ b/Mathlib/Algebra/Group/Equiv/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Data.Fintype.Defs +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Data.Fintype.Defs /-! # Finite types with addition/multiplications @@ -17,6 +19,8 @@ addition/multiplication operator. * `Fintype.decidableEqMulEquivFintype`: `MulEquiv`s on finite types have decidable equality -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction open Function diff --git a/Mathlib/Algebra/Group/Equiv/Opposite.lean b/Mathlib/Algebra/Group/Equiv/Opposite.lean index 29abf63d754793..cea45d3b9f4471 100644 --- a/Mathlib/Algebra/Group/Equiv/Opposite.lean +++ b/Mathlib/Algebra/Group/Equiv/Opposite.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Opposite +module + +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Opposite /-! # Group isomorphism between a group and its opposite -/ +@[expose] public section + variable {α : Type*} namespace MulOpposite diff --git a/Mathlib/Algebra/Group/Equiv/TypeTags.lean b/Mathlib/Algebra/Group/Equiv/TypeTags.lean index cc217118734826..782a2ef913f41a 100644 --- a/Mathlib/Algebra/Group/Equiv/TypeTags.lean +++ b/Mathlib/Algebra/Group/Equiv/TypeTags.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.TypeTags.Hom -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Notation.Prod -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.TypeTags.Hom +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Tactic.Spread /-! # Additive and multiplicative equivalences associated to `Multiplicative` and `Additive`. -/ +@[expose] public section + assert_not_exists Finite Fintype variable {ι G H : Type*} diff --git a/Mathlib/Algebra/Group/Even.lean b/Mathlib/Algebra/Group/Even.lean index 56ec585f1f7748..de3397af958e07 100644 --- a/Mathlib/Algebra/Group/Even.lean +++ b/Mathlib/Algebra/Group/Even.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Equiv.Opposite -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Data.Set.Operations +module + +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Equiv.Opposite +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Data.Set.Operations /-! # Squares and even elements @@ -37,6 +39,8 @@ This file defines square and even elements in a monoid. `Even` / `IsSquare` in rings. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered open MulOpposite diff --git a/Mathlib/Algebra/Group/EvenFunction.lean b/Mathlib/Algebra/Group/EvenFunction.lean index 5e39bc3da94a37..d1fbca7b501ec5 100644 --- a/Mathlib/Algebra/Group/EvenFunction.lean +++ b/Mathlib/Algebra/Group/EvenFunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Module.Defs /-! # Even and odd functions @@ -18,6 +20,8 @@ conflicting with the root-level definitions `Even` and `Odd` (which, for functio function takes even resp. odd _values_, a wholly different concept). -/ +@[expose] public section + assert_not_exists Module.IsTorsionFree NoZeroSMulDivisors namespace Function diff --git a/Mathlib/Algebra/Group/Ext.lean b/Mathlib/Algebra/Group/Ext.lean index 8c2a61354f914b..757146b52e21f3 100644 --- a/Mathlib/Algebra/Group/Ext.lean +++ b/Mathlib/Algebra/Group/Ext.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Bryan Gin-ge Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bryan Gin-ge Chen, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Hom.Defs +module + +public import Mathlib.Algebra.Group.Hom.Defs /-! # Extensionality lemmas for monoid and group structures @@ -25,6 +27,8 @@ former uses `HMul.hMul` which is the canonical spelling. monoid, group, extensionality -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered open Function diff --git a/Mathlib/Algebra/Group/Fin/Basic.lean b/Mathlib/Algebra/Group/Fin/Basic.lean index 04ddbf51bb712c..3a648a1bf13723 100644 --- a/Mathlib/Algebra/Group/Fin/Basic.lean +++ b/Mathlib/Algebra/Group/Fin/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.NeZero -import Mathlib.Data.Nat.Cast.Defs -import Mathlib.Data.Fin.Rev +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.NeZero +public import Mathlib.Data.Nat.Cast.Defs +public import Mathlib.Data.Fin.Rev /-! # Fin is a group @@ -16,6 +18,8 @@ This file contains the additive and multiplicative monoid instances on `Fin n`. See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidWithZero open Nat diff --git a/Mathlib/Algebra/Group/Fin/Tuple.lean b/Mathlib/Algebra/Group/Fin/Tuple.lean index 3a13db7774f927..c65996958bbd97 100644 --- a/Mathlib/Algebra/Group/Fin/Tuple.lean +++ b/Mathlib/Algebra/Group/Fin/Tuple.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yury Kudryashov, Sébastien Gouëzel, Chris Hughes -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.Data.Fin.VecNotation +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.Data.Fin.VecNotation /-! # Algebraic properties of tuples -/ +@[expose] public section + namespace Fin variable {n : ℕ} {α : Fin (n + 1) → Type*} diff --git a/Mathlib/Algebra/Group/Finsupp.lean b/Mathlib/Algebra/Group/Finsupp.lean index da1a319fbd3c2d..cda5ee23adbcbc 100644 --- a/Mathlib/Algebra/Group/Finsupp.lean +++ b/Mathlib/Algebra/Group/Finsupp.lean @@ -3,16 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Data.Finset.Max -import Mathlib.Data.Finsupp.Single -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Finsupp.Single /-! # Additive monoid structure on `ι →₀ M` -/ +@[expose] public section + assert_not_exists MonoidWithZero open Finset @@ -23,11 +26,24 @@ variable {ι F M N O G H : Type*} namespace Finsupp section Zero -variable [Zero M] [Zero N] +variable [Zero M] [Zero N] [Zero O] lemma apply_single [FunLike F M N] [ZeroHomClass F M N] (e : F) (i : ι) (m : M) (b : ι) : e (single i m b) = single i (e m) b := apply_single' e (map_zero e) i m b +/-- Composition with a fixed zero-preserving homomorphism is itself a zero-preserving homomorphism +on functions. -/ +@[simps] +def mapRange.zeroHom (f : ZeroHom M N) : ZeroHom (ι →₀ M) (ι →₀ N) where + toFun := Finsupp.mapRange f f.map_zero + map_zero' := mapRange_zero + +@[simp] lemma mapRange.zeroHom_id : mapRange.zeroHom (.id M) = .id (ι →₀ M) := by ext; simp + +lemma mapRange.zeroHom_comp (f : ZeroHom N O) (f₂ : ZeroHom M N) : + mapRange.zeroHom (ι := ι) (f.comp f₂) = (mapRange.zeroHom f).comp (mapRange.zeroHom f₂) := by + ext; simp + end Zero section AddZeroClass @@ -327,7 +343,7 @@ instance instIsAddTorsionFree [IsAddTorsionFree M] : IsAddTorsionFree (ι →₀ end AddMonoid section AddCommMonoid -variable [AddCommMonoid M] +variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid O] instance instAddCommMonoid : AddCommMonoid (ι →₀ M) := fast_instance% DFunLike.coe_injective.addCommMonoid @@ -340,6 +356,52 @@ lemma single_add_single_eq_single_add_single {k l m n : ι} {u v : M} (hu : u simp_rw [DFunLike.ext_iff, coe_add, single_eq_pi_single, ← funext_iff] exact Pi.single_add_single_eq_single_add_single hu hv +/-- Composition with a fixed additive homomorphism is itself an additive homomorphism on functions. +-/ +@[simps] +def mapRange.addMonoidHom (f : M →+ N) : (ι →₀ M) →+ ι →₀ N where + toFun := mapRange f f.map_zero + map_zero' := mapRange_zero + map_add' := mapRange_add f.map_add + +@[simp] +lemma mapRange.addMonoidHom_id : + mapRange.addMonoidHom (AddMonoidHom.id M) = AddMonoidHom.id (ι →₀ M) := + AddMonoidHom.ext mapRange_id + +lemma mapRange.addMonoidHom_comp (f : N →+ O) (g : M →+ N) : + mapRange.addMonoidHom (ι := ι) (f.comp g) = + (mapRange.addMonoidHom f).comp (mapRange.addMonoidHom g) := by ext; simp + +@[simp] +lemma mapRange.addMonoidHom_toZeroHom (f : M →+ N) : + (mapRange.addMonoidHom f).toZeroHom = mapRange.zeroHom (ι := ι) f.toZeroHom := rfl + +/-- `Finsupp.mapRange.AddMonoidHom` as an equiv. -/ +@[simps! apply] +def mapRange.addEquiv (em' : M ≃+ N) : (ι →₀ M) ≃+ (ι →₀ N) where + toEquiv := mapRange.equiv em' em'.map_zero + __ := mapRange.addMonoidHom em'.toAddMonoidHom + +@[simp] +lemma mapRange.addEquiv_refl : mapRange.addEquiv (.refl M) = .refl (ι →₀ M) := by ext; simp + +lemma mapRange.addEquiv_trans (e₁ : M ≃+ N) (e₂ : N ≃+ O) : + mapRange.addEquiv (ι := ι) (e₁.trans e₂) = + (mapRange.addEquiv e₁).trans (mapRange.addEquiv e₂) := by ext; simp + +@[simp] +lemma mapRange.addEquiv_symm (e : M ≃+ N) : + (mapRange.addEquiv (ι := ι) e).symm = mapRange.addEquiv e.symm := rfl + +@[simp] +lemma mapRange.addEquiv_toAddMonoidHom (e : M ≃+ N) : + mapRange.addEquiv (ι := ι) e = mapRange.addMonoidHom (ι := ι) e.toAddMonoidHom := rfl + +@[simp] +lemma mapRange.addEquiv_toEquiv (e : M ≃+ N) : + mapRange.addEquiv (ι := ι) e = mapRange.equiv (ι := ι) (e : M ≃ N) e.map_zero := rfl + end AddCommMonoid instance instNeg [NegZeroClass G] : Neg (ι →₀ G) where neg := mapRange Neg.neg neg_zero diff --git a/Mathlib/Algebra/Group/ForwardDiff.lean b/Mathlib/Algebra/Group/ForwardDiff.lean index 140b8e339846f1..c875a9dc64945f 100644 --- a/Mathlib/Algebra/Group/ForwardDiff.lean +++ b/Mathlib/Algebra/Group/ForwardDiff.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Giulio Caflisch, David Loeffler, Yu Shao, Weijie Jiang, BeiBei Xiong -/ -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Group.AddChar -import Mathlib.Algebra.Module.Submodule.LinearMap -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Tactic.Abel -import Mathlib.Algebra.GroupWithZero.Action.Pi -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Algebra.Polynomial.Degree.Definitions -import Mathlib.Algebra.Polynomial.Eval.Degree +module + +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.Algebra.Module.Submodule.LinearMap +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Tactic.Abel +public import Mathlib.Algebra.GroupWithZero.Action.Pi +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.Algebra.Polynomial.Degree.Definitions +public import Mathlib.Algebra.Polynomial.Eval.Degree /-! # Forward difference operators and Newton series @@ -31,6 +33,8 @@ We also prove some auxiliary results about iterated forward differences of the f `n ↦ n.choose k`. -/ +@[expose] public section + open Finset Nat Function Polynomial variable {M G : Type*} [AddCommMonoid M] [AddCommGroup G] (h : M) diff --git a/Mathlib/Algebra/Group/Graph.lean b/Mathlib/Algebra/Group/Graph.lean index e438a5d6788e4a..f40e7f37b5d4d6 100644 --- a/Mathlib/Algebra/Group/Graph.lean +++ b/Mathlib/Algebra/Group/Graph.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, David Loeffler -/ -import Mathlib.Algebra.Group.Subgroup.Ker +module + +public import Mathlib.Algebra.Group.Subgroup.Ker /-! # Vertical line test for group homs @@ -23,6 +25,8 @@ We also prove specialised versions when `f` is the inclusion of a subgroup of th homomorphism version is more flexible in applications.) -/ +@[expose] public section + open Function Set variable {G H I : Type*} diff --git a/Mathlib/Algebra/Group/Hom/Basic.lean b/Mathlib/Algebra/Group/Hom/Basic.lean index 61c9f1e64866fa..48295b4d989d7c 100644 --- a/Mathlib/Algebra/Group/Hom/Basic.lean +++ b/Mathlib/Algebra/Group/Hom/Basic.lean @@ -4,14 +4,18 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Kevin Buzzard, Kim Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Hom.Defs +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Hom.Defs /-! # Additional lemmas about monoid and group homomorphisms -/ +@[expose] public section + -- `NeZero` cannot be additivised, hence its theory should be developed outside of the -- `Algebra.Group` folder. assert_not_imported Mathlib.Algebra.NeZero diff --git a/Mathlib/Algebra/Group/Hom/CompTypeclasses.lean b/Mathlib/Algebra/Group/Hom/CompTypeclasses.lean index da624918a831f4..7e6c1e100060de 100644 --- a/Mathlib/Algebra/Group/Hom/CompTypeclasses.lean +++ b/Mathlib/Algebra/Group/Hom/CompTypeclasses.lean @@ -3,10 +3,10 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module - -import Mathlib.Logic.Function.CompTypeclasses -import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Logic.Function.CompTypeclasses +public import Mathlib.Algebra.Group.Hom.Defs /-! # Propositional typeclasses on several monoid homs @@ -34,6 +34,8 @@ TODO : -/ +@[expose] public section + section MonoidHomCompTriple namespace MonoidHom diff --git a/Mathlib/Algebra/Group/Hom/Defs.lean b/Mathlib/Algebra/Group/Hom/Defs.lean index f40dae0dce654f..fccf6ced97f9dd 100644 --- a/Mathlib/Algebra/Group/Hom/Defs.lean +++ b/Mathlib/Algebra/Group/Hom/Defs.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Kevin Buzzard, Kim Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Data.FunLike.Basic -import Mathlib.Logic.Function.Iterate +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Data.FunLike.Basic +public import Mathlib.Logic.Function.Iterate /-! # Monoid and group homomorphisms @@ -58,6 +60,8 @@ MonoidHom, AddMonoidHom -/ +@[expose] public section + open Function variable {ι α β M N P : Type*} @@ -226,7 +230,7 @@ is the behavior we desire. variable [FunLike F M N] /-- See note [hom simp lemma priority] -/ -@[to_additive (attr := simp mid)] +@[to_additive (attr := simp mid, grind =)] theorem map_one [OneHomClass F M N] (f : F) : f 1 = 1 := OneHomClass.map_one f @@ -318,7 +322,7 @@ instance MulHom.mulHomClass : MulHomClass (M →ₙ* N) M N where variable [FunLike F M N] /-- See note [hom simp lemma priority] -/ -@[to_additive (attr := simp mid)] +@[to_additive (attr := simp mid, grind =)] theorem map_mul [MulHomClass F M N] (f : F) (x y : M) : f (x * y) = f x * f y := MulHomClass.map_mul f x y @@ -422,7 +426,7 @@ variable [FunLike F G H] @[to_additive] theorem map_div' [DivInvMonoid G] [DivInvMonoid H] [MulHomClass F G H] (f : F) (hf : ∀ a, f a⁻¹ = (f a)⁻¹) (a b : G) : f (a / b) = f a / f b := by - rw [div_eq_mul_inv, div_eq_mul_inv, map_mul, hf] + grind [div_eq_mul_inv] @[to_additive] lemma map_comp_div' [DivInvMonoid G] [DivInvMonoid H] [MulHomClass F G H] (f : F) @@ -432,7 +436,7 @@ lemma map_comp_div' [DivInvMonoid G] [DivInvMonoid H] [MulHomClass F G H] (f : F /-- Group homomorphisms preserve inverse. See note [hom simp lemma priority] -/ -@[to_additive (attr := simp mid) /-- Additive group homomorphisms preserve negation. -/] +@[to_additive (attr := simp mid, grind =) /-- Additive group homomorphisms preserve negation. -/] theorem map_inv [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (a : G) : f a⁻¹ = (f a)⁻¹ := eq_inv_of_mul_eq_one_left <| map_mul_eq_one f <| inv_mul_cancel _ @@ -453,7 +457,7 @@ lemma map_comp_mul_inv [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : /-- Group homomorphisms preserve division. See note [hom simp lemma priority] -/ -@[to_additive (attr := simp mid) /-- Additive group homomorphisms preserve subtraction. -/] +@[to_additive (attr := simp mid, grind =) /-- Additive group homomorphisms preserve subtraction. -/] theorem map_div [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) : ∀ a b, f (a / b) = f a / f b := map_div' _ <| map_inv f @@ -462,7 +466,7 @@ lemma map_comp_div [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) ( f ∘ (g / h) = f ∘ g / f ∘ h := by ext; simp /-- See note [hom simp lemma priority] -/ -@[to_additive (attr := simp mid) (reorder := 9 10)] +@[to_additive (attr := simp mid, grind =) (reorder := 9 10)] theorem map_pow [Monoid G] [Monoid H] [MonoidHomClass F G H] (f : F) (a : G) : ∀ n : ℕ, f (a ^ n) = f a ^ n | 0 => by rw [pow_zero, pow_zero, map_one] @@ -486,7 +490,7 @@ lemma map_comp_zpow' [DivInvMonoid G] [DivInvMonoid H] [MonoidHomClass F G H] (f /-- Group homomorphisms preserve integer power. See note [hom simp lemma priority] -/ -@[to_additive (attr := simp mid) (reorder := 9 10) +@[to_additive (attr := simp mid, grind =) (reorder := 9 10) /-- Additive group homomorphisms preserve integer scaling. -/] theorem map_zpow [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (g : G) (n : ℤ) : f (g ^ n) = f g ^ n := map_zpow' f (map_inv f) g n diff --git a/Mathlib/Algebra/Group/Hom/End.lean b/Mathlib/Algebra/Group/Hom/End.lean index 7ea0b980390d9b..b0477baf971e62 100644 --- a/Mathlib/Algebra/Group/Hom/End.lean +++ b/Mathlib/Algebra/Group/Hom/End.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Kevin Buzzard, Kim Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Hom.Instances -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.Ring.Defs /-! # Instances on spaces of monoid and group morphisms @@ -17,6 +19,8 @@ They are separate, and if someone would like to split this file in two that may * Results about `AddMonoid.End R` when `R` is a ring. -/ +@[expose] public section + universe uM diff --git a/Mathlib/Algebra/Group/Hom/Instances.lean b/Mathlib/Algebra/Group/Hom/Instances.lean index 23aee596b3f297..0d243ef2caab7f 100644 --- a/Mathlib/Algebra/Group/Hom/Instances.lean +++ b/Mathlib/Algebra/Group/Hom/Instances.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Kevin Buzzard, Kim Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Tactic.FastInstance /-! # Instances on spaces of monoid and group morphisms @@ -22,6 +24,8 @@ operations. Finally, we provide the `Ring` structure on `AddMonoid.End`. -/ +@[expose] public section + assert_not_exists AddMonoidWithOne Ring universe uM uN uP uQ diff --git a/Mathlib/Algebra/Group/Ideal.lean b/Mathlib/Algebra/Group/Ideal.lean new file mode 100644 index 00000000000000..379d90f713167e --- /dev/null +++ b/Mathlib/Algebra/Group/Ideal.lean @@ -0,0 +1,125 @@ +/- +Copyright (c) 2025 Dexin Zhang. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Dexin Zhang +-/ +module + +public import Mathlib.GroupTheory.GroupAction.SubMulAction.Closure + +/-! +# Semigroup ideals + +This file defines (left) semigroup ideals (also called monoid ideals sometimes), which are sets `s` +in a semigroup such that `a * b ∈ s` whenever `b ∈ s`. Note that semigroup ideals are different from +ring ideals (`Ideal` in Mathlib): a ring ideal is a semigroup ideal that is also an additive +submonoid of the ring. + +## References + +* [Samuel Eilenberg and M. P. Schützenberger, *Rational Sets in Commutative Monoids*][eilenberg1969] +-/ + +@[expose] public section + +open Set Pointwise + +/-- A (left) semigroup ideal in a semigroup `M` is a set `s` such that `a * b ∈ s` whenever +`b ∈ s`. -/ +@[to_additive /-- A (left) additive semigroup ideal in an additive semigroup `M` is a set `s` such +that `a + b ∈ s` whenever `b ∈ s`. -/] +abbrev SemigroupIdeal (M : Type*) [Mul M] := + SubMulAction M M + +namespace SemigroupIdeal + +variable {M : Type*} + +section Mul + +variable [Mul M] {s t : Set M} {x : M} + +@[to_additive] +protected theorem mul_mem (I : SemigroupIdeal M) (x : M) {y : M} : y ∈ I → x * y ∈ I := + SubMulAction.smul_mem I x + +/-- The semigroup ideal generated by a set `s`. -/ +@[to_additive /-- The additive semigroup ideal generated by a set `s`. -/] +abbrev closure (s : Set M) : SemigroupIdeal M := + SubMulAction.closure M s + +@[to_additive] +theorem mem_closure : x ∈ closure s ↔ ∀ p : SemigroupIdeal M, s ⊆ p → x ∈ p := + SubMulAction.mem_closure + +@[to_additive] +theorem subset_closure : s ⊆ closure s := + SubMulAction.subset_closure + +@[to_additive] +theorem mem_closure_of_mem (hx : x ∈ s) : x ∈ closure s := + SubMulAction.mem_closure_of_mem hx + +@[to_additive] +theorem closure_le {I} : closure s ≤ I ↔ s ⊆ I := + SubMulAction.closure_le + +@[to_additive (attr := gcongr)] +theorem closure_mono (h : s ⊆ t) : closure s ≤ closure t := + SubMulAction.closure_mono h + +end Mul + +/-- The semigroup ideal generated by `s` is `s ∪ Set.univ * s`. -/ +@[to_additive /-- The additive semigroup ideal generated by `s` is `s ∪ Set.univ + s`. -/] +theorem coe_closure [Semigroup M] {s : Set M} : + (closure s : Set M) = s ∪ univ * s := by + let I : SemigroupIdeal M := + { carrier := s ∪ univ * s + smul_mem' x y := by + rintro (hy | ⟨y, -, z, hz, rfl⟩) + · exact .inr <| mul_mem_mul (mem_univ _) hy + · simpa [← mul_assoc] using .inr <| mul_mem_mul (mem_univ _) hz } + suffices closure s = I by rw [this]; rfl + refine (closure_le.2 fun x => Or.inl).antisymm fun x hx => hx.elim mem_closure_of_mem ?_ + rintro ⟨y, -, z, hz, rfl⟩ + exact SemigroupIdeal.mul_mem _ _ (mem_closure_of_mem hz) + +@[to_additive, inherit_doc coe_closure] +theorem mem_closure' [Semigroup M] {s : Set M} {x : M} : + x ∈ closure s ↔ x ∈ s ∨ ∃ y, ∃ z ∈ s, y * z = x := by + rw [← SetLike.mem_coe, coe_closure] + simp [mem_mul] + +attribute [inherit_doc AddSemigroupIdeal.coe_closure] AddSemigroupIdeal.mem_closure' + +/-- In a monoid, the semigroup ideal generated by `s` is `Set.univ * s`. -/ +@[to_additive /-- In an additive monoid, the semigroup ideal generated by `s` is `Set.univ + s`. -/] +theorem coe_closure' [Monoid M] {s : Set M} : + (closure s : Set M) = univ * s := by + rw [coe_closure, union_eq_right] + exact fun x hx => ⟨1, mem_univ 1, x, hx, by simp⟩ + +@[to_additive, inherit_doc coe_closure'] +theorem mem_closure'' [Monoid M] {s : Set M} {x : M} : + x ∈ closure s ↔ ∃ y, ∃ z ∈ s, y * z = x := by + rw [← SetLike.mem_coe, coe_closure'] + simp [mem_mul] + +attribute [inherit_doc AddSemigroupIdeal.coe_closure'] AddSemigroupIdeal.mem_closure'' + +/-- A semigroup ideal is finitely generated if it is generated by a finite set. + +This is defeq to `SubMulAction.FG`, but unfolds more nicely. -/ +@[to_additive /-- An additive semigroup ideal is finitely generated if it is generated by a finite +set. + +This is defeq to `SubAddAction.FG`, but unfolds more nicely. -/] +def FG [Mul M] (I : SemigroupIdeal M) := + ∃ (s : Set M), s.Finite ∧ I = closure s + +@[to_additive] +theorem fg_iff [Mul M] {I : SemigroupIdeal M} : I.FG ↔ ∃ (s : Finset M), I = closure s := + SubMulAction.fg_iff + +end SemigroupIdeal diff --git a/Mathlib/Algebra/Group/Idempotent.lean b/Mathlib/Algebra/Group/Idempotent.lean index c3412cd6d36e20..eb272f5d58523a 100644 --- a/Mathlib/Algebra/Group/Idempotent.lean +++ b/Mathlib/Algebra/Group/Idempotent.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Data.Subtype -import Mathlib.Tactic.Conv +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Data.Subtype +public import Mathlib.Tactic.Conv /-! # Idempotents @@ -26,6 +28,8 @@ including: projection, idempotent -/ +@[expose] public section + assert_not_exists GroupWithZero variable {M N S : Type*} diff --git a/Mathlib/Algebra/Group/Indicator.lean b/Mathlib/Algebra/Group/Indicator.lean index a8a63abd868c8c..8029ca0f601ebd 100644 --- a/Mathlib/Algebra/Group/Indicator.lean +++ b/Mathlib/Algebra/Group/Indicator.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Notation.Indicator +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Notation.Indicator /-! # Indicator function @@ -33,6 +35,8 @@ arguments. This is in contrast with the design of `Pi.single` or `Set.piecewise` indicator, characteristic -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function diff --git a/Mathlib/Algebra/Group/InjSurj.lean b/Mathlib/Algebra/Group/InjSurj.lean index 8de254df3f1334..a276fe73fc93b5 100644 --- a/Mathlib/Algebra/Group/InjSurj.lean +++ b/Mathlib/Algebra/Group/InjSurj.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Logic.Function.Basic -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Logic.Function.Basic +public import Mathlib.Tactic.Spread /-! # Lifting algebraic data classes along injective/surjective maps @@ -28,6 +30,8 @@ Note that the `nsmul` and `zsmul` hypotheses in the declarations in this file ar `to_additive`ized from the versions for `^`. -/ +@[expose] public section + namespace Function diff --git a/Mathlib/Algebra/Group/Int/Defs.lean b/Mathlib/Algebra/Group/Int/Defs.lean index c5dd808e8332f4..2490578dabac54 100644 --- a/Mathlib/Algebra/Group/Int/Defs.lean +++ b/Mathlib/Algebra/Group/Int/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Algebra.Group.Defs /-! # The integers form a group @@ -13,6 +15,8 @@ This file contains the additive group and multiplicative monoid instances on the See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists Ring DenselyOrdered open Nat @@ -26,8 +30,8 @@ instance instCommMonoid : CommMonoid ℤ where mul_one := Int.mul_one one_mul := Int.one_mul npow n x := x ^ n - npow_zero _ := rfl - npow_succ _ _ := rfl + npow_zero _ := by simp [Int.pow_zero] + npow_succ _ _ := by simp [Int.pow_succ] mul_assoc := Int.mul_assoc instance instAddCommGroup : AddCommGroup ℤ where diff --git a/Mathlib/Algebra/Group/Int/Even.lean b/Mathlib/Algebra/Group/Int/Even.lean index e5727fe81cdc22..785bcc70072918 100644 --- a/Mathlib/Algebra/Group/Int/Even.lean +++ b/Mathlib/Algebra/Group/Int/Even.lean @@ -3,14 +3,18 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Group.Nat.Even -import Mathlib.Data.Int.Sqrt +module + +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Group.Nat.Even +public import Mathlib.Data.Int.Sqrt /-! # Parity of integers -/ +@[expose] public section + open Nat namespace Int diff --git a/Mathlib/Algebra/Group/Int/TypeTags.lean b/Mathlib/Algebra/Group/Int/TypeTags.lean index 42958ea577c408..170571ba3037aa 100644 --- a/Mathlib/Algebra/Group/Int/TypeTags.lean +++ b/Mathlib/Algebra/Group/Int/TypeTags.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # Lemmas about `Multiplicative ℤ`. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Algebra/Group/Int/Units.lean b/Mathlib/Algebra/Group/Int/Units.lean index 8b73b7b9d0bbe7..852727e1e412fd 100644 --- a/Mathlib/Algebra/Group/Int/Units.lean +++ b/Mathlib/Algebra/Group/Int/Units.lean @@ -3,15 +3,19 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Tactic.Tauto -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Nat.Units +module + +public import Mathlib.Tactic.Tauto +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Nat.Units /-! # Units in the integers -/ +@[expose] public section + open Nat diff --git a/Mathlib/Algebra/Group/Invertible/Basic.lean b/Mathlib/Algebra/Group/Invertible/Basic.lean index 19a631c52353ce..1bf6950d56ef1b 100644 --- a/Mathlib/Algebra/Group/Invertible/Basic.lean +++ b/Mathlib/Algebra/Group/Invertible/Basic.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Group.Commute.Units -import Mathlib.Algebra.Group.Invertible.Defs -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Algebra.Group.Commute.Units +public import Mathlib.Algebra.Group.Invertible.Defs +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Logic.Equiv.Defs /-! # Theorems about invertible elements -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered universe u diff --git a/Mathlib/Algebra/Group/Invertible/Defs.lean b/Mathlib/Algebra/Group/Invertible/Defs.lean index 420ec2ff61f515..265743e03968bf 100644 --- a/Mathlib/Algebra/Group/Invertible/Defs.lean +++ b/Mathlib/Algebra/Group/Invertible/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Algebra.Group.Defs /-! # Invertible elements @@ -73,6 +75,8 @@ invertible, inverse element, invOf, a half, one half, a third, one third, ½, -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered universe u diff --git a/Mathlib/Algebra/Group/Irreducible/Defs.lean b/Mathlib/Algebra/Group/Irreducible/Defs.lean index 6cc6d127315d1f..6defe35a851161 100644 --- a/Mathlib/Algebra/Group/Irreducible/Defs.lean +++ b/Mathlib/Algebra/Group/Irreducible/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Yaël Dillies -/ -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Logic.Basic +module + +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Logic.Basic /-! # Irreducible elements in a monoid @@ -17,6 +19,8 @@ In decomposition monoids (e.g., `ℕ`, `ℤ`), this predicate is equivalent to ` (see `irreducible_iff_prime`), however this is not true in general. -/ +@[expose] public section + assert_not_exists MonoidWithZero IsOrderedMonoid Multiset variable {M : Type*} diff --git a/Mathlib/Algebra/Group/Irreducible/Lemmas.lean b/Mathlib/Algebra/Group/Irreducible/Lemmas.lean index ddcfdfeb95174e..5ff2a3a3a66c55 100644 --- a/Mathlib/Algebra/Group/Irreducible/Lemmas.lean +++ b/Mathlib/Algebra/Group/Irreducible/Lemmas.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Yaël Dillies -/ -import Mathlib.Algebra.Group.Commute.Units -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.Irreducible.Defs -import Mathlib.Algebra.Group.Units.Equiv +module + +public import Mathlib.Algebra.Group.Commute.Units +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.Irreducible.Defs +public import Mathlib.Algebra.Group.Units.Equiv /-! # More lemmas about irreducible elements -/ +@[expose] public section + assert_not_exists MonoidWithZero IsOrderedMonoid Multiset variable {F M N : Type*} diff --git a/Mathlib/Algebra/Group/MinimalAxioms.lean b/Mathlib/Algebra/Group/MinimalAxioms.lean index b68806dbcfd67c..a07c08991113f6 100644 --- a/Mathlib/Algebra/Group/MinimalAxioms.lean +++ b/Mathlib/Algebra/Group/MinimalAxioms.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.Algebra.Group.Defs +public import Mathlib.Algebra.Group.Defs /-! # Minimal Axioms for a Group @@ -21,6 +22,8 @@ equalities. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered universe u diff --git a/Mathlib/Algebra/Group/Nat/Defs.lean b/Mathlib/Algebra/Group/Nat/Defs.lean index c3420501c0fc69..80956881673639 100644 --- a/Mathlib/Algebra/Group/Nat/Defs.lean +++ b/Mathlib/Algebra/Group/Nat/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Algebra.Group.Defs /-! # The natural numbers form a monoid @@ -13,6 +15,8 @@ This file contains the additive and multiplicative monoid instances on the natur See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered namespace Nat diff --git a/Mathlib/Algebra/Group/Nat/Even.lean b/Mathlib/Algebra/Group/Nat/Even.lean index c7cde4b908f4fc..b63580b26f654c 100644 --- a/Mathlib/Algebra/Group/Nat/Even.lean +++ b/Mathlib/Algebra/Group/Nat/Even.lean @@ -3,14 +3,18 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Data.Nat.Sqrt +module + +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Data.Nat.Sqrt /-! # `IsSquare` and `Even` for natural numbers -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered namespace Nat diff --git a/Mathlib/Algebra/Group/Nat/Hom.lean b/Mathlib/Algebra/Group/Nat/Hom.lean index fec20eb47daed6..39c9c1409e6e6a 100644 --- a/Mathlib/Algebra/Group/Nat/Hom.lean +++ b/Mathlib/Algebra/Group/Nat/Hom.lean @@ -3,16 +3,18 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.TypeTags.Hom -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.TypeTags.Hom +public import Mathlib.Tactic.Spread /-! # Extensionality of monoid homs from `ℕ` -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidWithZero open Additive Multiplicative diff --git a/Mathlib/Algebra/Group/Nat/Range.lean b/Mathlib/Algebra/Group/Nat/Range.lean index 58ff6748037f70..94d13046642ba1 100644 --- a/Mathlib/Algebra/Group/Nat/Range.lean +++ b/Mathlib/Algebra/Group/Nat/Range.lean @@ -3,13 +3,17 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Algebra.Group.Embedding -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Data.Finset.Image +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Data.Finset.Image /-! # `Finset.range` and addition of natural numbers -/ + +@[expose] public section assert_not_exists MonoidWithZero MulAction IsOrderedMonoid variable {α β γ : Type*} diff --git a/Mathlib/Algebra/Group/Nat/TypeTags.lean b/Mathlib/Algebra/Group/Nat/TypeTags.lean index e4675239184c8b..0f598ab498e03e 100644 --- a/Mathlib/Algebra/Group/Nat/TypeTags.lean +++ b/Mathlib/Algebra/Group/Nat/TypeTags.lean @@ -3,13 +3,17 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # Lemmas about `Multiplicative ℕ` -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered open Multiplicative diff --git a/Mathlib/Algebra/Group/Nat/Units.lean b/Mathlib/Algebra/Group/Nat/Units.lean index 925c8d06bf94d1..c70abdaf566660 100644 --- a/Mathlib/Algebra/Group/Nat/Units.lean +++ b/Mathlib/Algebra/Group/Nat/Units.lean @@ -3,14 +3,18 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Logic.Unique +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Logic.Unique /-! # The unit of the natural numbers -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered namespace Nat diff --git a/Mathlib/Algebra/Group/NatPowAssoc.lean b/Mathlib/Algebra/Group/NatPowAssoc.lean index 481ed5cc3c983f..aef592b5e32266 100644 --- a/Mathlib/Algebra/Group/NatPowAssoc.lean +++ b/Mathlib/Algebra/Group/NatPowAssoc.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.Cast.Basic +module + +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.Cast.Basic /-! # Typeclasses for power-associative structures @@ -35,6 +37,8 @@ We also produce the following instances: -/ +@[expose] public section + assert_not_exists DenselyOrdered variable {M : Type*} diff --git a/Mathlib/Algebra/Group/Opposite.lean b/Mathlib/Algebra/Group/Opposite.lean index e8b3da31a4f6b6..644880f6b94376 100644 --- a/Mathlib/Algebra/Group/Opposite.lean +++ b/Mathlib/Algebra/Group/Opposite.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Algebra.Group.Torsion -import Mathlib.Algebra.Opposites +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Algebra.Opposites /-! # Group structures on the multiplicative and additive opposites -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered Units variable {α : Type*} diff --git a/Mathlib/Algebra/Group/PNatPowAssoc.lean b/Mathlib/Algebra/Group/PNatPowAssoc.lean index 5a65f4e43c10a6..b2f5f1e9e8f49c 100644 --- a/Mathlib/Algebra/Group/PNatPowAssoc.lean +++ b/Mathlib/Algebra/Group/PNatPowAssoc.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ +module -import Mathlib.Data.PNat.Basic -import Mathlib.Algebra.Notation.Prod +public import Mathlib.Data.PNat.Basic +public import Mathlib.Algebra.Notation.Prod /-! # Typeclasses for power-associative structures @@ -35,6 +36,8 @@ powers are considered. -/ +@[expose] public section + -- TODO: -- assert_not_exists MonoidWithZero diff --git a/Mathlib/Algebra/Group/PUnit.lean b/Mathlib/Algebra/Group/PUnit.lean index 8a8b0aa4ff7a04..5e8485a596bbdf 100644 --- a/Mathlib/Algebra/Group/PUnit.lean +++ b/Mathlib/Algebra/Group/PUnit.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Algebra.Group.Defs /-! # `PUnit` is a commutative group @@ -12,6 +14,8 @@ This file collects facts about algebraic structures on the one-element type, e.g commutative ring. -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace PUnit diff --git a/Mathlib/Algebra/Group/Pi/Basic.lean b/Mathlib/Algebra/Group/Pi/Basic.lean index 2ce4ef778b1a05..5a9861ac38265b 100644 --- a/Mathlib/Algebra/Group/Pi/Basic.lean +++ b/Mathlib/Algebra/Group/Pi/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Eric Wieser -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.Data.Sum.Basic -import Mathlib.Logic.Unique -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.Data.Sum.Basic +public import Mathlib.Logic.Unique +public import Mathlib.Tactic.Spread /-! # Instances and theorems on pi types @@ -23,6 +25,8 @@ comment `--pi_instance` is inserted before all fields which were previously deri [https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/not.20porting.20pi_instance] -/ +@[expose] public section + -- We enforce to only import `Algebra.Group.Defs` and basic logic assert_not_exists Set.range MonoidHom MonoidWithZero DenselyOrdered diff --git a/Mathlib/Algebra/Group/Pi/Lemmas.lean b/Mathlib/Algebra/Group/Pi/Lemmas.lean index 381196984a6065..33719e38d87575 100644 --- a/Mathlib/Algebra/Group/Pi/Lemmas.lean +++ b/Mathlib/Algebra/Group/Pi/Lemmas.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Hom.Instances -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Torsion -import Mathlib.Data.Set.Piecewise -import Mathlib.Logic.Pairwise +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Logic.Pairwise /-! # Extra lemmas about products of monoids and groups @@ -17,6 +19,8 @@ This file proves lemmas about the instances defined in `Algebra.Group.Pi.Basic` imports. -/ +@[expose] public section + assert_not_exists AddMonoidWithOne MonoidWithZero universe u v w diff --git a/Mathlib/Algebra/Group/Pi/Units.lean b/Mathlib/Algebra/Group/Pi/Units.lean index bf2c48119ab5a0..f43ebce5975944 100644 --- a/Mathlib/Algebra/Group/Pi/Units.lean +++ b/Mathlib/Algebra/Group/Pi/Units.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Util.Delaborators +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Util.Delaborators /-! # Units in pi types -/ +@[expose] public section + variable {ι : Type*} {M : ι → Type*} [∀ i, Monoid (M i)] {x : Π i, M i} open Units in diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean b/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean index a3d2fd0aada20a..db3bef2f7a22b5 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Finite -import Mathlib.Algebra.Group.Pointwise.Set.ListOfFn -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Data.Finset.Max -import Mathlib.Data.Finset.NAry -import Mathlib.Data.Finset.Preimage +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Finite +public import Mathlib.Algebra.Group.Pointwise.Set.ListOfFn +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Finset.NAry +public import Mathlib.Data.Finset.Preimage /-! # Pointwise operations of finsets @@ -45,6 +47,8 @@ finset multiplication, finset addition, pointwise addition, pointwise multiplica pointwise subtraction -/ +@[expose] public section + assert_not_exists Cardinal Finset.dens MonoidWithZero MulAction IsOrderedMonoid open Function MulOpposite @@ -61,7 +65,7 @@ section One variable [One α] {s : Finset α} {a : α} -/-- The finset `1 : Finset α` is defined as `{1}` in scope Pointwise`. -/ +/-- The finset `1 : Finset α` is defined as `{1}` in scope `Pointwise`. -/ @[to_additive /-- The finset `0 : Finset α` is defined as `{0}` in scope `Pointwise`. -/] protected def one : One (Finset α) := ⟨{1}⟩ diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/BigOperators.lean b/Mathlib/Algebra/Group/Pointwise/Finset/BigOperators.lean index 246f528031cea3..7d3aecfd357b2c 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/BigOperators.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/BigOperators.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Pointwise big operators on finsets @@ -24,6 +26,8 @@ finset multiplication, finset addition, pointwise addition, pointwise multiplica pointwise subtraction -/ +@[expose] public section + open scoped Pointwise variable {α ι : Type*} diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/Density.lean b/Mathlib/Algebra/Group/Pointwise/Finset/Density.lean index 646c0ee6780ffc..7d05d19f41044d 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/Density.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/Density.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Data.Finset.Density +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Data.Finset.Density /-! # Theorems about the density of pointwise operations on finsets. -/ +@[expose] public section + open scoped Pointwise variable {α β : Type*} diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/Interval.lean b/Mathlib/Algebra/Group/Pointwise/Finset/Interval.lean index 8877a22eee3eb8..e11d839f472f60 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/Interval.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/Interval.lean @@ -3,15 +3,19 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Order.Group.Pointwise.Interval -import Mathlib.Order.Interval.Finset.Defs -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Order.Group.Pointwise.Interval +public import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Pointwise operations on intervals This should be kept in sync with `Mathlib/Data/Set/Pointwise/Interval.lean`. -/ +@[expose] public section + variable {α : Type*} namespace Finset diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean b/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean index 17eedc6125b1a0..73d345a93a9873 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yaël Dillies -/ -import Mathlib.Data.Finset.NAry -import Mathlib.Algebra.Group.Pointwise.Finset.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Finite +module + +public import Mathlib.Data.Finset.NAry +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Finite /-! # Pointwise operations of finsets @@ -42,6 +44,8 @@ finset multiplication, finset addition, pointwise addition, pointwise multiplica pointwise subtraction -/ +@[expose] public section + assert_not_exists Cardinal Finset.dens MonoidWithZero MulAction IsOrderedMonoid open Function MulOpposite diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean b/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean index f43c8fd6f8f71f..9e36608c1fb680 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Data.Set.NAry +module + +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Data.Set.NAry /-! # Pointwise operations of sets @@ -47,6 +49,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists Set.iUnion MulAction MonoidWithZero IsOrderedMonoid library_note2 «pointwise nat action» /-- diff --git a/Mathlib/Algebra/Group/Pointwise/Set/BigOperators.lean b/Mathlib/Algebra/Group/Pointwise/Set/BigOperators.lean index 9b228fee2bb95b..feedb7aa9ee57a 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/BigOperators.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/BigOperators.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.Group.Pointwise.Set.Basic -import Mathlib.Data.Fintype.Card +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +public import Mathlib.Data.Fintype.Card /-! # Results about pointwise operations on sets and big operators. -/ +@[expose] public section + namespace Set diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Card.lean b/Mathlib/Algebra/Group/Pointwise/Set/Card.lean index 092fdc237b28b8..d4e3fe0ff3cdb1 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Card.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Card.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Finite -import Mathlib.Data.Set.Card +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Finite +public import Mathlib.Data.Set.Card /-! # Cardinalities of pointwise operations on sets -/ +@[expose] public section + assert_not_exists Field open scoped Cardinal Pointwise diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Finite.lean b/Mathlib/Algebra/Group/Pointwise/Set/Finite.lean index 9da8d8eec3d80c..8e02ddafc4055c 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Finite.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Finite.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Data.Finite.Prod -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Data.Finite.Prod +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Finiteness lemmas for pointwise operations on sets -/ +@[expose] public section + assert_not_exists MulAction MonoidWithZero open Pointwise diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Lattice.lean b/Mathlib/Algebra/Group/Pointwise/Set/Lattice.lean index 6f6b9179f6e82b..0574a894bab6df 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Lattice.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Indexed unions and intersections of pointwise operations of sets @@ -19,6 +21,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists MulAction MonoidWithZero open Function MulOpposite diff --git a/Mathlib/Algebra/Group/Pointwise/Set/ListOfFn.lean b/Mathlib/Algebra/Group/Pointwise/Set/ListOfFn.lean index 48316c4a24c194..97fcf26b086dd9 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/ListOfFn.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/ListOfFn.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.List.OfFn -import Mathlib.Algebra.BigOperators.Group.List.Defs -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Data.List.OfFn +public import Mathlib.Algebra.BigOperators.Group.List.Defs +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise operations with lists of sets @@ -13,6 +15,8 @@ import Mathlib.Algebra.Group.Pointwise.Set.Basic This file proves some lemmas about pointwise algebraic operations with lists of sets. -/ +@[expose] public section + namespace Set variable {α : Type*} [Monoid α] {s : Set α} {n : ℕ} diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean b/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean index 0c83b70b127b58..08ac4fbffc1716 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Basic -import Mathlib.Algebra.Opposites -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Data.Set.NAry +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +public import Mathlib.Algebra.Opposites +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Data.Set.NAry /-! # Pointwise scalar operations of sets @@ -47,6 +49,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists Set.iUnion MulAction MonoidWithZero IsOrderedMonoid open Function MulOpposite diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Small.lean b/Mathlib/Algebra/Group/Pointwise/Set/Small.lean index d602ad2dd6c62b..9dac8812189024 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Small.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Small.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Algebra.Group.Pointwise.Set.Basic -import Mathlib.Logic.Small.Set +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +public import Mathlib.Logic.Small.Set /-! # Small instances for pointwise operations -/ +@[expose] public section + universe u variable {α β : Type*} (s t : Set α) diff --git a/Mathlib/Algebra/Group/Prod.lean b/Mathlib/Algebra/Group/Prod.lean index e403727e4f64a0..6645dce43889b1 100644 --- a/Mathlib/Algebra/Group/Prod.lean +++ b/Mathlib/Algebra/Group/Prod.lean @@ -3,15 +3,17 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Group.Torsion -import Mathlib.Algebra.Group.Units.Hom -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Notation.Prod -import Mathlib.Logic.Equiv.Prod -import Mathlib.Tactic.TermCongr +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Algebra.Group.Units.Hom +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Logic.Equiv.Prod +public import Mathlib.Tactic.TermCongr /-! # Monoid, group etc. structures on `M × N` @@ -36,6 +38,8 @@ We also prove trivial `simp` lemmas, and define the following operations on `Mon * `divMonoidHom`: Division bundled as a monoid homomorphism. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered AddMonoidWithOne variable {G : Type*} {H : Type*} {M : Type*} {N : Type*} {P : Type*} diff --git a/Mathlib/Algebra/Group/Semiconj/Basic.lean b/Mathlib/Algebra/Group/Semiconj/Basic.lean index d158c2622d6e58..6d0acfb9e69555 100644 --- a/Mathlib/Algebra/Group/Semiconj/Basic.lean +++ b/Mathlib/Algebra/Group/Semiconj/Basic.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Semiconj.Defs -import Mathlib.Algebra.Group.Basic +module + +public import Mathlib.Algebra.Group.Semiconj.Defs +public import Mathlib.Algebra.Group.Basic /-! # Lemmas about semiconjugate elements of a group -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered namespace SemiconjBy diff --git a/Mathlib/Algebra/Group/Semiconj/Defs.lean b/Mathlib/Algebra/Group/Semiconj/Defs.lean index a1f51ffcecab78..97c960b8b885fc 100644 --- a/Mathlib/Algebra/Group/Semiconj/Defs.lean +++ b/Mathlib/Algebra/Group/Semiconj/Defs.lean @@ -4,9 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -- Some proofs and docs came from mathlib3 `src/algebra/commute.lean` (c) Neil Strickland +module -import Mathlib.Algebra.Group.Defs -import Mathlib.Order.Defs.Unbundled +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Order.Defs.Unbundled /-! # Semiconjugate elements of a semigroup @@ -27,6 +28,8 @@ This file provides only basic operations (`mul_left`, `mul_right`, `inv_right` e operations (`pow_right`, field inverse etc) are in the files that define corresponding notions. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {S M G : Type*} diff --git a/Mathlib/Algebra/Group/Semiconj/Units.lean b/Mathlib/Algebra/Group/Semiconj/Units.lean index a5caf977889884..19f7d8bd4fedf7 100644 --- a/Mathlib/Algebra/Group/Semiconj/Units.lean +++ b/Mathlib/Algebra/Group/Semiconj/Units.lean @@ -4,9 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -- Some proofs and docs came from mathlib3 `src/algebra/commute.lean` (c) Neil Strickland +module -import Mathlib.Algebra.Group.Semiconj.Defs -import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.Algebra.Group.Semiconj.Defs +public import Mathlib.Algebra.Group.Units.Basic /-! # Semiconjugate elements of a semigroup @@ -27,6 +28,8 @@ This file provides only basic operations (`mul_left`, `mul_right`, `inv_right` e operations (`pow_right`, field inverse etc) are in the files that define corresponding notions. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered open scoped Int diff --git a/Mathlib/Algebra/Group/Shrink.lean b/Mathlib/Algebra/Group/Shrink.lean index 80238e7bf41095..43b69f1a2126a3 100644 --- a/Mathlib/Algebra/Group/Shrink.lean +++ b/Mathlib/Algebra/Group/Shrink.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Action.TransferInstance -import Mathlib.Logic.Small.Defs -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Group.Action.TransferInstance +public import Mathlib.Logic.Small.Defs +public import Mathlib.Tactic.SuppressCompilation /-! # Transfer group structures from `α` to `Shrink α` -/ +@[expose] public section + -- FIXME: `to_additive` is incompatible with `noncomputable section`. -- See https://github.com/leanprover-community/mathlib4/issues/1074. suppress_compilation diff --git a/Mathlib/Algebra/Group/Subgroup/Actions.lean b/Mathlib/Algebra/Group/Subgroup/Actions.lean index 40fc492beb3014..29faa3fd7b839d 100644 --- a/Mathlib/Algebra/Group/Subgroup/Actions.lean +++ b/Mathlib/Algebra/Group/Subgroup/Actions.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Submonoid.DistribMulAction -import Mathlib.GroupTheory.Subgroup.Center +module + +public import Mathlib.Algebra.Group.Submonoid.DistribMulAction +public import Mathlib.GroupTheory.Subgroup.Center /-! # Actions by `Subgroup`s @@ -16,6 +18,8 @@ subgroup, subgroups -/ +@[expose] public section + namespace Subgroup variable {G α β : Type*} [Group G] diff --git a/Mathlib/Algebra/Group/Subgroup/Basic.lean b/Mathlib/Algebra/Group/Subgroup/Basic.lean index bb9fe1d78d49b3..74170ec11b4312 100644 --- a/Mathlib/Algebra/Group/Subgroup/Basic.lean +++ b/Mathlib/Algebra/Group/Subgroup/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Conj -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Algebra.Group.Torsion +module + +public import Mathlib.Algebra.Group.Conj +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Algebra.Group.Torsion /-! # Basic results on subgroups @@ -46,6 +48,8 @@ membership of a subgroup's underlying set. subgroup, subgroups -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset Ring open Function diff --git a/Mathlib/Algebra/Group/Subgroup/Defs.lean b/Mathlib/Algebra/Group/Subgroup/Defs.lean index 140664a6b8919d..adf66249765b58 100644 --- a/Mathlib/Algebra/Group/Subgroup/Defs.lean +++ b/Mathlib/Algebra/Group/Subgroup/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Data.Set.Inclusion -import Mathlib.Tactic.Common -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Data.Set.Inclusion +public import Mathlib.Tactic.Common +public import Mathlib.Tactic.FastInstance /-! # Subgroups @@ -50,6 +52,8 @@ membership of a subgroup's underlying set. subgroup, subgroups -/ +@[expose] public section + assert_not_exists RelIso IsOrderedMonoid Multiset MonoidWithZero open Function diff --git a/Mathlib/Algebra/Group/Subgroup/Even.lean b/Mathlib/Algebra/Group/Subgroup/Even.lean index b80fed354d90e9..f23e823e8cd328 100644 --- a/Mathlib/Algebra/Group/Subgroup/Even.lean +++ b/Mathlib/Algebra/Group/Subgroup/Even.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Artie Khovanov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Artie Khovanov -/ -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.Subgroup.Defs +module + +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.Subgroup.Defs /-! # Squares and even elements @@ -12,6 +14,8 @@ import Mathlib.Algebra.Group.Subgroup.Defs This file defines the subgroup of squares / even elements in an abelian group. -/ +@[expose] public section + assert_not_exists RelIso MonoidWithZero namespace Subsemigroup diff --git a/Mathlib/Algebra/Group/Subgroup/Finite.lean b/Mathlib/Algebra/Group/Subgroup/Finite.lean index 64a4f222c7afdc..5ce9fa47594fdd 100644 --- a/Mathlib/Algebra/Group/Subgroup/Finite.lean +++ b/Mathlib/Algebra/Group/Subgroup/Finite.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Group.Submonoid.Finite -import Mathlib.Data.Finite.Card -import Mathlib.Data.Set.Finite.Range +module + +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Group.Submonoid.Finite +public import Mathlib.Data.Finite.Card +public import Mathlib.Data.Set.Finite.Range /-! # Subgroups @@ -18,6 +20,8 @@ This file provides some result on multiplicative and additive subgroups in the f subgroup, subgroups -/ +@[expose] public section + assert_not_exists Field variable {G : Type*} [Group G] diff --git a/Mathlib/Algebra/Group/Subgroup/Finsupp.lean b/Mathlib/Algebra/Group/Subgroup/Finsupp.lean index 30b5d2acb82c3f..abe4da0907e515 100644 --- a/Mathlib/Algebra/Group/Subgroup/Finsupp.lean +++ b/Mathlib/Algebra/Group/Subgroup/Finsupp.lean @@ -3,11 +3,15 @@ Copyright (c) 2024 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Algebra.Group.Subgroup.Lattice +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Algebra.Group.Subgroup.Lattice /-! # Connection between `Subgroup.closure` and `Finsupp.prod` -/ +@[expose] public section + assert_not_exists Field namespace Subgroup diff --git a/Mathlib/Algebra/Group/Subgroup/Ker.lean b/Mathlib/Algebra/Group/Subgroup/Ker.lean index 7311f65afadd6f..85a10f81d82e41 100644 --- a/Mathlib/Algebra/Group/Subgroup/Ker.lean +++ b/Mathlib/Algebra/Group/Subgroup/Ker.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Subgroup.Map -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Algebra.Group.Subgroup.Map +public import Mathlib.Tactic.ApplyFun /-! # Kernel and range of group homomorphisms @@ -42,6 +44,8 @@ membership of a subgroup's underlying set. subgroup, subgroups -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset Ring open Function diff --git a/Mathlib/Algebra/Group/Subgroup/Lattice.lean b/Mathlib/Algebra/Group/Subgroup/Lattice.lean index d455b4fa7022f4..d3cf2b27096398 100644 --- a/Mathlib/Algebra/Group/Subgroup/Lattice.lean +++ b/Mathlib/Algebra/Group/Subgroup/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Group.Subgroup.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Group.Subgroup.Defs /-! # Lattice structure of subgroups @@ -42,6 +44,8 @@ membership of a subgroup's underlying set. subgroup, subgroups -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset Ring open Function @@ -603,6 +607,32 @@ theorem mem_sup : x ∈ s ⊔ t ↔ ∃ y ∈ s, ∃ z ∈ t, y * z = x := theorem mem_sup' : x ∈ s ⊔ t ↔ ∃ (y : s) (z : t), (y : C) * z = x := mem_sup.trans <| by simp only [SetLike.exists, exists_prop] +@[to_additive] +theorem mem_sup_of_normal_right {s t : Subgroup G} [ht : t.Normal] {x : G} : + x ∈ s ⊔ t ↔ ∃ y ∈ s, ∃ z ∈ t, y * z = x := by + constructor + · intro hx; rw [sup_eq_closure] at hx + refine closure_induction ?_ ?_ ?_ ?_ hx + · rintro x (hx | hx) + · exact ⟨x, hx, 1, t.one_mem, by simp⟩ + · exact ⟨1, s.one_mem, x, hx, by simp⟩ + · exact ⟨1, s.one_mem, 1, t.one_mem, by simp⟩ + · rintro _ _ _ _ ⟨y₁, hy₁, z₁, hz₁, rfl⟩ ⟨y₂, hy₂, z₂, hz₂, rfl⟩ + exact ⟨y₁ * y₂, s.mul_mem hy₁ hy₂, + (y₂⁻¹ * z₁ * y₂) * z₂, t.mul_mem (ht.conj_mem' z₁ hz₁ y₂) hz₂, by simp [mul_assoc]⟩ + · rintro _ _ ⟨y, hy, z, hz, rfl⟩ + exact ⟨y⁻¹, s.inv_mem hy, + y * z⁻¹ * y⁻¹, ht.conj_mem z⁻¹ (t.inv_mem hz) y, by simp [mul_assoc]⟩ + · rintro ⟨y, hy, z, hz, rfl⟩; exact mul_mem_sup hy hz + +@[to_additive] +theorem mem_sup_of_normal_left {s t : Subgroup G} [hs : s.Normal] {x : G} : + x ∈ s ⊔ t ↔ ∃ y ∈ s, ∃ z ∈ t, y * z = x := by + have h := (sup_comm t s) ▸ mem_sup_of_normal_right (s := t) (t := s) (x := x) + exact h.trans + ⟨fun ⟨y, hy, z, hz, hp⟩ ↦ ⟨y * z * y⁻¹, hs.conj_mem z hz y, y, hy, by simp [hp]⟩, + fun ⟨y, hy, z, hz, hp⟩ ↦ ⟨z, hz, z⁻¹ * y * z, hs.conj_mem' y hy z, by simp [mul_assoc, hp]⟩⟩ + @[to_additive] theorem mem_closure_pair {x y z : C} : z ∈ closure ({x, y} : Set C) ↔ ∃ m n : ℤ, x ^ m * y ^ n = z := by diff --git a/Mathlib/Algebra/Group/Subgroup/Map.lean b/Mathlib/Algebra/Group/Subgroup/Map.lean index 1e689f925bed99..c1ba95c37c7731 100644 --- a/Mathlib/Algebra/Group/Subgroup/Map.lean +++ b/Mathlib/Algebra/Group/Subgroup/Map.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.Algebra.Group.TypeTags.Hom +module + +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.Algebra.Group.TypeTags.Hom /-! # `map` and `comap` for subgroups @@ -45,6 +47,8 @@ membership of a subgroup's underlying set. subgroup, subgroups -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset Ring open Function diff --git a/Mathlib/Algebra/Group/Subgroup/MulOpposite.lean b/Mathlib/Algebra/Group/Subgroup/MulOpposite.lean index 4987463da7e74c..68efa24a3b4a04 100644 --- a/Mathlib/Algebra/Group/Subgroup/MulOpposite.lean +++ b/Mathlib/Algebra/Group/Subgroup/MulOpposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alex Kontorovich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, Eric Wieser -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Group.Submonoid.MulOpposite +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Group.Submonoid.MulOpposite /-! # Mul-opposite subgroups @@ -14,6 +16,8 @@ subgroup, subgroups -/ +@[expose] public section + variable {ι : Sort*} {G : Type*} [Group G] namespace Subgroup diff --git a/Mathlib/Algebra/Group/Subgroup/MulOppositeLemmas.lean b/Mathlib/Algebra/Group/Subgroup/MulOppositeLemmas.lean index c3ece09a101142..879b0dc602cb13 100644 --- a/Mathlib/Algebra/Group/Subgroup/MulOppositeLemmas.lean +++ b/Mathlib/Algebra/Group/Subgroup/MulOppositeLemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Alex Kontorovich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, Eric Wieser -/ -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.Algebra.Group.Subgroup.MulOpposite -import Mathlib.Algebra.Group.Submonoid.MulOpposite -import Mathlib.Logic.Encodable.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.Algebra.Group.Subgroup.MulOpposite +public import Mathlib.Algebra.Group.Submonoid.MulOpposite +public import Mathlib.Logic.Encodable.Basic /-! # Mul-opposite subgroups @@ -20,6 +22,8 @@ subgroup, subgroups -/ +@[expose] public section + variable {ι : Sort*} {G : Type*} [Group G] namespace Subgroup diff --git a/Mathlib/Algebra/Group/Subgroup/Order.lean b/Mathlib/Algebra/Group/Subgroup/Order.lean index fe1ffebae7f881..97ec95839e5b7b 100644 --- a/Mathlib/Algebra/Group/Subgroup/Order.lean +++ b/Mathlib/Algebra/Group/Subgroup/Order.lean @@ -3,16 +3,20 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Ruben Van de Velde -/ -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.Algebra.Group.Subsemigroup.Operations -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Monoid.Basic -import Mathlib.Order.Atoms +module + +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.Algebra.Group.Subsemigroup.Operations +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Monoid.Basic +public import Mathlib.Order.Atoms /-! # Facts about ordered structures and ordered instances on subgroups -/ +@[expose] public section + open Subgroup @[to_additive (attr := simp)] diff --git a/Mathlib/Algebra/Group/Subgroup/Pointwise.lean b/Mathlib/Algebra/Group/Subgroup/Pointwise.lean index 43187a1f3e4075..24ffcabb7fac31 100644 --- a/Mathlib/Algebra/Group/Subgroup/Pointwise.lean +++ b/Mathlib/Algebra/Group/Subgroup/Pointwise.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.Algebra.Group.Pointwise.Set.Lattice -import Mathlib.Algebra.Group.Subgroup.MulOppositeLemmas -import Mathlib.Algebra.Group.Submonoid.Pointwise -import Mathlib.GroupTheory.GroupAction.ConjAct +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Algebra.Group.Pointwise.Set.Lattice +public import Mathlib.Algebra.Group.Subgroup.MulOppositeLemmas +public import Mathlib.Algebra.Group.Submonoid.Pointwise +public import Mathlib.GroupTheory.GroupAction.ConjAct /-! # Pointwise instances on `Subgroup` and `AddSubgroup`s @@ -27,6 +29,8 @@ the file `Mathlib/Algebra/Group/Submonoid/Pointwise.lean`. Where possible, try to keep them in sync. -/ +@[expose] public section + assert_not_exists GroupWithZero open Set diff --git a/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean b/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean index a6889bfc7e80a0..ef660798ce2485 100644 --- a/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean +++ b/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Subgroup.Map -import Mathlib.Algebra.Group.Int.Defs +module + +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Subgroup.Map +public import Mathlib.Algebra.Group.Int.Defs /-! # Subgroups generated by an element @@ -15,6 +17,8 @@ subgroup, subgroups -/ +@[expose] public section + variable {G : Type*} [Group G] variable {A : Type*} [AddGroup A] variable {N : Type*} [Group N] diff --git a/Mathlib/Algebra/Group/Subgroup/ZPowers/Lemmas.lean b/Mathlib/Algebra/Group/Subgroup/ZPowers/Lemmas.lean index 0d1a7fec359b83..52de5bba042d13 100644 --- a/Mathlib/Algebra/Group/Subgroup/ZPowers/Lemmas.lean +++ b/Mathlib/Algebra/Group/Subgroup/ZPowers/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic -import Mathlib.Data.Countable.Basic -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.GroupTheory.Subgroup.Centralizer +module + +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic +public import Mathlib.Data.Countable.Basic +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.GroupTheory.Subgroup.Centralizer /-! # Subgroups generated by an element @@ -16,6 +18,8 @@ subgroup, subgroups -/ +@[expose] public section + variable {G : Type*} [Group G] variable {A : Type*} [AddGroup A] variable {N : Type*} [Group N] diff --git a/Mathlib/Algebra/Group/Submonoid/Basic.lean b/Mathlib/Algebra/Group/Submonoid/Basic.lean index 010036df4b6d01..390762f82ae8a6 100644 --- a/Mathlib/Algebra/Group/Submonoid/Basic.lean +++ b/Mathlib/Algebra/Group/Submonoid/Basic.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Group.Subsemigroup.Basic -import Mathlib.Algebra.Group.Units.Defs +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Group.Subsemigroup.Basic +public import Mathlib.Algebra.Group.Units.Defs /-! # Submonoids: `CompleteLattice` structure @@ -48,6 +50,8 @@ numbers. `Submonoid` is implemented by extending `Subsemigroup` requiring `one_m submonoid, submonoids -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {M : Type*} {N : Type*} diff --git a/Mathlib/Algebra/Group/Submonoid/BigOperators.lean b/Mathlib/Algebra/Group/Submonoid/BigOperators.lean index 36a249fb02f0e9..cd9c63b14dc694 100644 --- a/Mathlib/Algebra/Group/Submonoid/BigOperators.lean +++ b/Mathlib/Algebra/Group/Submonoid/BigOperators.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Algebra.Group.Support -import Mathlib.Data.Finset.NoncommProd +module + +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Algebra.Group.Support +public import Mathlib.Data.Finset.NoncommProd /-! # Submonoids: membership criteria for products and sums @@ -22,6 +24,8 @@ In this file we prove various facts about membership in a submonoid: submonoid, submonoids -/ +@[expose] public section + -- We don't need ordered structures to establish basic membership facts for submonoids assert_not_exists IsOrderedRing diff --git a/Mathlib/Algebra/Group/Submonoid/Defs.lean b/Mathlib/Algebra/Group/Submonoid/Defs.lean index 4ec11ac00dc318..1d41a8d2c10cce 100644 --- a/Mathlib/Algebra/Group/Submonoid/Defs.lean +++ b/Mathlib/Algebra/Group/Submonoid/Defs.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Subsemigroup.Defs -import Mathlib.Tactic.FastInstance -import Mathlib.Data.Set.Insert +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Subsemigroup.Defs +public import Mathlib.Tactic.FastInstance +public import Mathlib.Data.Set.Insert /-! # Submonoids: definition @@ -46,6 +48,8 @@ numbers. `Submonoid` is implemented by extending `Subsemigroup` requiring `one_m submonoid, submonoids -/ +@[expose] public section + assert_not_exists RelIso CompleteLattice MonoidWithZero variable {M : Type*} {N : Type*} diff --git a/Mathlib/Algebra/Group/Submonoid/DistribMulAction.lean b/Mathlib/Algebra/Group/Submonoid/DistribMulAction.lean index 3d556ddd95a38f..1bc47ec50e2b1b 100644 --- a/Mathlib/Algebra/Group/Submonoid/DistribMulAction.lean +++ b/Mathlib/Algebra/Group/Submonoid/DistribMulAction.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Submonoid.MulAction -import Mathlib.Algebra.GroupWithZero.Action.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.MulAction +public import Mathlib.Algebra.GroupWithZero.Action.Defs /-! # Distributive actions by submonoids -/ +@[expose] public section + assert_not_exists RelIso Ring namespace Submonoid diff --git a/Mathlib/Algebra/Group/Submonoid/Finite.lean b/Mathlib/Algebra/Group/Submonoid/Finite.lean index 2f7e633146f121..8be22be4cad7c6 100644 --- a/Mathlib/Algebra/Group/Submonoid/Finite.lean +++ b/Mathlib/Algebra/Group/Submonoid/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Data.Fintype.Basic /-! # Submonoids @@ -12,6 +14,8 @@ import Mathlib.Data.Fintype.Basic This file provides some results on multiplicative and additive submonoids in the finite context. -/ +@[expose] public section + namespace Submonoid section Pi diff --git a/Mathlib/Algebra/Group/Submonoid/Finsupp.lean b/Mathlib/Algebra/Group/Submonoid/Finsupp.lean index 8c2c1be5e04d7e..38e07d24a18b87 100644 --- a/Mathlib/Algebra/Group/Submonoid/Finsupp.lean +++ b/Mathlib/Algebra/Group/Submonoid/Finsupp.lean @@ -3,10 +3,14 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.BigOperators.Finsupp.Basic +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic /-! # Connection between `Submonoid.closure` and `Finsupp.prod` -/ +@[expose] public section + assert_not_exists Field namespace Submonoid diff --git a/Mathlib/Algebra/Group/Submonoid/Membership.lean b/Mathlib/Algebra/Group/Submonoid/Membership.lean index 5912de893983fd..7e385692cad62b 100644 --- a/Mathlib/Algebra/Group/Submonoid/Membership.lean +++ b/Mathlib/Algebra/Group/Submonoid/Membership.lean @@ -4,14 +4,16 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Algebra.Group.Idempotent -import Mathlib.Algebra.Group.Nat.Hom -import Mathlib.Algebra.Group.Submonoid.MulOpposite -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Int.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Algebra.Group.Idempotent +public import Mathlib.Algebra.Group.Nat.Hom +public import Mathlib.Algebra.Group.Submonoid.MulOpposite +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Int.Basic /-! # Submonoids: membership criteria @@ -33,6 +35,8 @@ generated by a single element. submonoid, submonoids -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {M A B : Type*} diff --git a/Mathlib/Algebra/Group/Submonoid/MulAction.lean b/Mathlib/Algebra/Group/Submonoid/MulAction.lean index a157ead671ff20..456a708e2b3369 100644 --- a/Mathlib/Algebra/Group/Submonoid/MulAction.lean +++ b/Mathlib/Algebra/Group/Submonoid/MulAction.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Group.Action.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Group.Action.Defs /-! # Actions by `Submonoid`s @@ -16,6 +18,8 @@ These instances work particularly well in conjunction with `Monoid.toMulAction`, `s • m` as an alias for `↑s * m`. -/ +@[expose] public section + assert_not_exists RelIso namespace Submonoid diff --git a/Mathlib/Algebra/Group/Submonoid/MulOpposite.lean b/Mathlib/Algebra/Group/Submonoid/MulOpposite.lean index d93f8d93cdff12..5bc0a060c92f0d 100644 --- a/Mathlib/Algebra/Group/Submonoid/MulOpposite.lean +++ b/Mathlib/Algebra/Group/Submonoid/MulOpposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jujian Zhang -/ -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Group.Submonoid.Basic +module + +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Group.Submonoid.Basic /-! # Submonoid of opposite monoids @@ -13,6 +15,8 @@ For every monoid `M`, we construct an equivalence between submonoids of `M` and -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {ι : Sort*} {M : Type*} [MulOneClass M] diff --git a/Mathlib/Algebra/Group/Submonoid/Operations.lean b/Mathlib/Algebra/Group/Submonoid/Operations.lean index d37eb30246b681..5f57abe09f731e 100644 --- a/Mathlib/Algebra/Group/Submonoid/Operations.lean +++ b/Mathlib/Algebra/Group/Submonoid/Operations.lean @@ -4,13 +4,15 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Algebra.Group.Submonoid.MulAction -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Algebra.Group.Submonoid.MulAction +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # Operations on `Submonoid`s @@ -65,6 +67,8 @@ In this file we define various operations on `Submonoid`s and `MonoidHom`s. submonoid, range, product, map, comap -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function diff --git a/Mathlib/Algebra/Group/Submonoid/Pointwise.lean b/Mathlib/Algebra/Group/Submonoid/Pointwise.lean index 1762b1b5d9d887..7b39e9b4da5eb8 100644 --- a/Mathlib/Algebra/Group/Submonoid/Pointwise.lean +++ b/Mathlib/Algebra/Group/Submonoid/Pointwise.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Algebra.Order.BigOperators.Group.List -import Mathlib.Order.WellFoundedSet +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Algebra.Order.BigOperators.Group.List +public import Mathlib.Order.WellFoundedSet /-! # Pointwise instances on `Submonoid`s and `AddSubmonoid`s @@ -33,6 +35,8 @@ syntactically equal. Before adding new lemmas here, consider if they would also on `Set`s. -/ +@[expose] public section + assert_not_exists GroupWithZero open Set Pointwise diff --git a/Mathlib/Algebra/Group/Submonoid/Units.lean b/Mathlib/Algebra/Group/Submonoid/Units.lean index c1024f35a8cadb..947e58b8391a73 100644 --- a/Mathlib/Algebra/Group/Submonoid/Units.lean +++ b/Mathlib/Algebra/Group/Submonoid/Units.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Wrenna Robson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wrenna Robson -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Group.Submonoid.Pointwise -import Mathlib.Algebra.Group.Subgroup.Lattice +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Group.Submonoid.Pointwise +public import Mathlib.Algebra.Group.Subgroup.Lattice /-! @@ -20,7 +22,7 @@ of `M`. `Submonoid.units` and `Subgroup.ofUnits` form a Galois coinsertion. We also make the equivalent additive definitions. -# Implementation details +## Implementation details There are a number of other constructions which are multiplicatively equivalent to `S.units` but which have a different type. @@ -35,6 +37,8 @@ All of these are distinct from `S.leftInv`, which is the submonoid of `M` which every member of `M` with a right inverse in `S`. -/ +@[expose] public section + variable {M : Type*} [Monoid M] open Units diff --git a/Mathlib/Algebra/Group/Subsemigroup/Basic.lean b/Mathlib/Algebra/Group/Subsemigroup/Basic.lean index 02db098aa72ac0..b89932a46989c3 100644 --- a/Mathlib/Algebra/Group/Subsemigroup/Basic.lean +++ b/Mathlib/Algebra/Group/Subsemigroup/Basic.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov, Yakov Pechersky -/ -import Mathlib.Algebra.Group.Subsemigroup.Defs -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Algebra.Group.Subsemigroup.Defs +public import Mathlib.Data.Set.Lattice.Image /-! # Subsemigroups: `CompleteLattice` structure @@ -40,6 +42,8 @@ numbers. subsemigroup, subsemigroups -/ +@[expose] public section + assert_not_exists MonoidWithZero -- Only needed for notation diff --git a/Mathlib/Algebra/Group/Subsemigroup/Defs.lean b/Mathlib/Algebra/Group/Subsemigroup/Defs.lean index ef712f6aa66c8d..48418e35871086 100644 --- a/Mathlib/Algebra/Group/Subsemigroup/Defs.lean +++ b/Mathlib/Algebra/Group/Subsemigroup/Defs.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov, Yakov Pechersky -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Data.SetLike.Basic -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Tactic.FastInstance /-! # Subsemigroups: definition @@ -46,6 +48,8 @@ numbers. subsemigroup, subsemigroups -/ +@[expose] public section + assert_not_exists RelIso CompleteLattice MonoidWithZero variable {M : Type*} {N : Type*} diff --git a/Mathlib/Algebra/Group/Subsemigroup/Membership.lean b/Mathlib/Algebra/Group/Subsemigroup/Membership.lean index fc0c74dfe19f49..73619312f6816e 100644 --- a/Mathlib/Algebra/Group/Subsemigroup/Membership.lean +++ b/Mathlib/Algebra/Group/Subsemigroup/Membership.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Group.Subsemigroup.Basic +module + +public import Mathlib.Algebra.Group.Subsemigroup.Basic /-! # Subsemigroups: membership criteria @@ -27,6 +29,8 @@ stub and only provides rudimentary support. subsemigroup -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {ι : Sort*} {M : Type*} diff --git a/Mathlib/Algebra/Group/Subsemigroup/Operations.lean b/Mathlib/Algebra/Group/Subsemigroup/Operations.lean index cf1d0ade5a27c6..f79a6b89d11d7b 100644 --- a/Mathlib/Algebra/Group/Subsemigroup/Operations.lean +++ b/Mathlib/Algebra/Group/Subsemigroup/Operations.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov, Yakov Pechersky, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Group.Subsemigroup.Basic -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Group.Subsemigroup.Basic +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # Operations on `Subsemigroup`s @@ -62,6 +64,8 @@ necessary. subsemigroup, range, product, map, comap -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {M N P σ : Type*} diff --git a/Mathlib/Algebra/Group/Support.lean b/Mathlib/Algebra/Group/Support.lean index 2185a09f84288f..18aea9729de911 100644 --- a/Mathlib/Algebra/Group/Support.lean +++ b/Mathlib/Algebra/Group/Support.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Notation.Support +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Notation.Support /-! # Support of a function @@ -13,6 +15,8 @@ In this file we prove basic properties of `Function.support f = {x | f x ≠ 0}` `Function.mulSupport f = {x | f x ≠ 1}`. -/ +@[expose] public section + assert_not_exists CompleteLattice MonoidWithZero open Set diff --git a/Mathlib/Algebra/Group/Torsion.lean b/Mathlib/Algebra/Group/Torsion.lean index 2eab241491a210..274d55add446be 100644 --- a/Mathlib/Algebra/Group/Torsion.lean +++ b/Mathlib/Algebra/Group/Torsion.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies, Patrick Luo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Patrick Luo -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Tactic.MkIffOfInductiveProp +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Tactic.MkIffOfInductiveProp /-! # Torsion-free monoids and groups @@ -13,6 +15,8 @@ This file proves lemmas about torsion-free monoids. A monoid `M` is *torsion-free* if `n • · : M → M` is injective for all non-zero natural numbers `n`. -/ +@[expose] public section + open Function variable {M G : Type*} diff --git a/Mathlib/Algebra/Group/TransferInstance.lean b/Mathlib/Algebra/Group/TransferInstance.lean index 08edcaf4e41b3e..c761290bceb7b5 100644 --- a/Mathlib/Algebra/Group/TransferInstance.lean +++ b/Mathlib/Algebra/Group/TransferInstance.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Data.Fintype.Basic /-! # Transfer algebraic structures across `Equiv`s @@ -19,6 +21,8 @@ When adding new definitions that transfer type-classes across an equivalence, pl `abbrev`. See note [reducible non-instances]. -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction namespace Equiv diff --git a/Mathlib/Algebra/Group/Translate.lean b/Mathlib/Algebra/Group/Translate.lean index 3ff3ab50d2e744..cf3e3855f02159 100644 --- a/Mathlib/Algebra/Group/Translate.lean +++ b/Mathlib/Algebra/Group/Translate.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.GroupTheory.GroupAction.DomAct.Basic +module + +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic /-! # Translation operator @@ -26,6 +28,8 @@ negation appearing inside `DomAddAct.mk`. Although mathematically equivalent, th convention is that translating is an action by subtraction, not by addition. -/ +@[expose] public section + open Function Set open scoped Pointwise diff --git a/Mathlib/Algebra/Group/TypeTags/Basic.lean b/Mathlib/Algebra/Group/TypeTags/Basic.lean index 6a14a5f729ed28..13d98d311861c5 100644 --- a/Mathlib/Algebra/Group/TypeTags/Basic.lean +++ b/Mathlib/Algebra/Group/TypeTags/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Torsion -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.Data.FunLike.Basic -import Mathlib.Logic.Function.Iterate -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Set -import Mathlib.Util.AssertExists -import Mathlib.Logic.Nontrivial.Basic +module + +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.Data.FunLike.Basic +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Set +public import Mathlib.Util.AssertExists +public import Mathlib.Logic.Nontrivial.Basic /-! # Type tags that turn additive structures into multiplicative, and vice versa @@ -30,6 +32,8 @@ This file is similar to `Order.Synonym`. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered MonoidHom Finite universe u v @@ -288,6 +292,56 @@ theorem ofAdd_nsmul [AddMonoid α] (n : ℕ) (a : α) : ofAdd (n • a) = ofAdd theorem toAdd_pow [AddMonoid α] (a : Multiplicative α) (n : ℕ) : (a ^ n).toAdd = n • a.toAdd := rfl +section Monoid +variable [Monoid α] + +@[simp] +lemma isAddLeftRegular_ofMul {a : α} : IsAddLeftRegular (Additive.ofMul a) ↔ IsLeftRegular a := .rfl + +@[simp] +lemma isLeftRegular_toMul {a : Additive α} : IsLeftRegular a.toMul ↔ IsAddLeftRegular a := .rfl + +@[simp] +lemma isAddRightRegular_ofMul {a : α} : IsAddRightRegular (Additive.ofMul a) ↔ IsRightRegular a := + .rfl + +@[simp] +lemma isRightRegular_toMul {a : Additive α} : IsRightRegular a.toMul ↔ IsAddRightRegular a := .rfl + +@[simp] lemma isAddRegular_ofMul {a : α} : IsAddRegular (Additive.ofMul a) ↔ IsRegular a := by + simp [isAddRegular_iff, isRegular_iff] + +@[simp] lemma isRegular_toMul {a : Additive α} : IsRegular a.toMul ↔ IsAddRegular a := by + simp [isAddRegular_iff, isRegular_iff] + +end Monoid + +section AddMonoid +variable [AddMonoid α] + +@[simp] +lemma isLeftRegular_ofAdd {a : α} : IsLeftRegular (Multiplicative.ofAdd a) ↔ IsAddLeftRegular a := + .rfl + +@[simp] +lemma isAddLeftRegular_toAdd {a : Multiplicative α} : IsAddLeftRegular a.toAdd ↔ IsLeftRegular a := + .rfl + +@[simp] +lemma isRightRegular_ofAdd {a : α} : + IsRightRegular (Multiplicative.ofAdd a) ↔ IsAddRightRegular a := .rfl + +@[simp] lemma isAddRightRegular_toAdd {a : Multiplicative α} : + IsAddRightRegular a.toAdd ↔ IsRightRegular a := .rfl + +@[simp] lemma isRegular_ofAdd {a : α} : IsRegular (Multiplicative.ofAdd a) ↔ IsAddRegular a := by + simp [isAddRegular_iff, isRegular_iff] + +@[simp] lemma isAddRegular_toAdd {a : Multiplicative α} : IsAddRegular a.toAdd ↔ IsRegular a := by + simp [isAddRegular_iff, isRegular_iff] + +end AddMonoid + instance Additive.addLeftCancelMonoid [LeftCancelMonoid α] : AddLeftCancelMonoid (Additive α) := { Additive.addMonoid, Additive.addLeftCancelSemigroup with } diff --git a/Mathlib/Algebra/Group/TypeTags/Finite.lean b/Mathlib/Algebra/Group/TypeTags/Finite.lean index 4adcc8410f485e..daba3c763d2376 100644 --- a/Mathlib/Algebra/Group/TypeTags/Finite.lean +++ b/Mathlib/Algebra/Group/TypeTags/Finite.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Data.Finite.Defs -import Mathlib.Data.Fintype.Card +module + +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Data.Finite.Defs +public import Mathlib.Data.Fintype.Card /-! # `Finite`, `Infinite` and `Fintype` are preserved by `Additive` and `Multiplicative`. -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction universe u diff --git a/Mathlib/Algebra/Group/TypeTags/Hom.lean b/Mathlib/Algebra/Group/TypeTags/Hom.lean index 8af7df2450df91..b3ff88e0e865e4 100644 --- a/Mathlib/Algebra/Group/TypeTags/Hom.lean +++ b/Mathlib/Algebra/Group/TypeTags/Hom.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Group.TypeTags.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.Group.TypeTags.Basic /-! # Transport algebra morphisms between additive and multiplicative types. -/ +@[expose] public section + open Additive (ofMul toMul) open Multiplicative (ofAdd toAdd) diff --git a/Mathlib/Algebra/Group/ULift.lean b/Mathlib/Algebra/Group/ULift.lean index 7dfbfbff7a9fee..a6bd08e0ef18fd 100644 --- a/Mathlib/Algebra/Group/ULift.lean +++ b/Mathlib/Algebra/Group/ULift.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Logic.Nontrivial.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Logic.Nontrivial.Basic /-! # `ULift` instances for groups and monoids @@ -17,6 +19,8 @@ This file defines instances for group, monoid, semigroup and related structures We also provide `MulEquiv.ulift : ULift R ≃* R` (and its additive analogue). -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered universe u v w diff --git a/Mathlib/Algebra/Group/UniqueProds/Basic.lean b/Mathlib/Algebra/Group/UniqueProds/Basic.lean index 708ad92067c8df..2c45012640e07a 100644 --- a/Mathlib/Algebra/Group/UniqueProds/Basic.lean +++ b/Mathlib/Algebra/Group/UniqueProds/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Equiv.Opposite -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Group.Pointwise.Finset.Basic -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Algebra.Group.ULift -import Mathlib.Data.DFinsupp.Defs +module + +public import Mathlib.Algebra.Group.Equiv.Opposite +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Algebra.Group.ULift +public import Mathlib.Data.DFinsupp.Defs /-! # Unique products and related notions @@ -49,6 +51,8 @@ about the grading type and then a generic statement of the form "look at the coe The file `Algebra/MonoidAlgebra/NoZeroDivisors` contains several examples of this use. -/ +@[expose] public section + assert_not_exists Cardinal Subsemiring Algebra Submodule StarModule FreeMonoid IsOrderedMonoid open Finset diff --git a/Mathlib/Algebra/Group/UniqueProds/VectorSpace.lean b/Mathlib/Algebra/Group/UniqueProds/VectorSpace.lean index 90fa001ae4ca46..65ee77b8af30b4 100644 --- a/Mathlib/Algebra/Group/UniqueProds/VectorSpace.lean +++ b/Mathlib/Algebra/Group/UniqueProds/VectorSpace.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.UniqueProds.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Algebra.Group.UniqueProds.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # A `ℚ`-vector space has `TwoUniqueSums`. -/ +@[expose] public section + variable {G : Type*} /-- Any `ℚ`-vector space has `TwoUniqueSums`, because it is isomorphic to some diff --git a/Mathlib/Algebra/Group/Units/Basic.lean b/Mathlib/Algebra/Group/Units/Basic.lean index 5b2f36c80d5499..c0f63a681247b7 100644 --- a/Mathlib/Algebra/Group/Units/Basic.lean +++ b/Mathlib/Algebra/Group/Units/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2017 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johannes Hölzl, Chris Hughes, Jens Wagemaker, Jon Eugster -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Logic.Unique -import Mathlib.Tactic.Nontriviality -import Mathlib.Tactic.Lift -import Mathlib.Tactic.Subsingleton +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Logic.Unique +public import Mathlib.Tactic.Nontriviality +public import Mathlib.Tactic.Lift +public import Mathlib.Tactic.Subsingleton /-! # Units (i.e., invertible elements) of a monoid @@ -23,6 +25,8 @@ and unique types. The results here should be used to golf the basic `Group` lemmas. -/ +@[expose] public section + assert_not_exists Multiplicative MonoidWithZero DenselyOrdered open Function @@ -253,7 +257,7 @@ theorem mul_eq_one : a * b = 1 ↔ a = 1 ∧ b = 1 := end CommMonoid /-! -# `IsUnit` predicate +### `IsUnit` predicate -/ diff --git a/Mathlib/Algebra/Group/Units/Defs.lean b/Mathlib/Algebra/Group/Units/Defs.lean index 3afcb7b6bf9d07..77cd5624dc80a6 100644 --- a/Mathlib/Algebra/Group/Units/Defs.lean +++ b/Mathlib/Algebra/Group/Units/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johannes Hölzl, Chris Hughes, Jens Wagemaker, Jon Eugster -/ -import Mathlib.Algebra.Group.Commute.Defs +module + +public import Mathlib.Algebra.Group.Commute.Defs /-! # Units (i.e., invertible elements) of a monoid @@ -28,6 +30,8 @@ resembling the notation $R^{\times}$ for the units of a ring, which is common in The results here should be used to golf the basic `Group` lemmas. -/ +@[expose] public section + assert_not_exists Multiplicative MonoidWithZero DenselyOrdered open Function @@ -349,7 +353,7 @@ theorem val_div_eq_divp (u₁ u₂ : αˣ) : ↑(u₁ / u₂) = ↑u₁ /ₚ u end Monoid /-! -# `IsUnit` predicate +### `IsUnit` predicate -/ section IsUnit diff --git a/Mathlib/Algebra/Group/Units/Equiv.lean b/Mathlib/Algebra/Group/Units/Equiv.lean index 186eb1aaf179e2..bb64621692dd45 100644 --- a/Mathlib/Algebra/Group/Units/Equiv.lean +++ b/Mathlib/Algebra/Group/Units/Equiv.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Units.Hom +module + +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Units.Hom /-! # Multiplicative and additive equivalence acting on units. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {F α M N G : Type*} diff --git a/Mathlib/Algebra/Group/Units/Hom.lean b/Mathlib/Algebra/Group/Units/Hom.lean index d031272197126d..5186df65964363 100644 --- a/Mathlib/Algebra/Group/Units/Hom.lean +++ b/Mathlib/Algebra/Group/Units/Hom.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Chris Hughes, Kevin Buzzard -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Group.Units.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.Group.Units.Basic /-! # Monoid homomorphisms and units @@ -34,6 +36,8 @@ used to golf the basic `Group` lemmas. Add a `@[to_additive]` version of `IsLocalHom`. -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered open Function diff --git a/Mathlib/Algebra/Group/Units/Opposite.lean b/Mathlib/Algebra/Group/Units/Opposite.lean index d9e2fd7887f651..c384f65eb131fe 100644 --- a/Mathlib/Algebra/Group/Units/Opposite.lean +++ b/Mathlib/Algebra/Group/Units/Opposite.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Group.Units.Defs +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Group.Units.Defs /-! # Units in multiplicative and additive opposites -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered variable {α : Type*} diff --git a/Mathlib/Algebra/Group/WithOne/Basic.lean b/Mathlib/Algebra/Group/WithOne/Basic.lean index 7e9dd5db175c3d..99815fa2aa9134 100644 --- a/Mathlib/Algebra/Group/WithOne/Basic.lean +++ b/Mathlib/Algebra/Group/WithOne/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johan Commelin -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.WithOne.Defs +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.WithOne.Defs /-! # More operations on `WithOne` and `WithZero` @@ -19,6 +21,8 @@ that were not available in `Algebra/Group/WithOne/Defs`. * `WithOne.map`, `WithZero.map` -/ +@[expose] public section + assert_not_exists MonoidWithZero DenselyOrdered universe u v w diff --git a/Mathlib/Algebra/Group/WithOne/Defs.lean b/Mathlib/Algebra/Group/WithOne/Defs.lean index 2f12361915d832..8fd87998256243 100644 --- a/Mathlib/Algebra/Group/WithOne/Defs.lean +++ b/Mathlib/Algebra/Group/WithOne/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johan Commelin -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Data.Option.Basic -import Mathlib.Logic.Nontrivial.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Data.Option.Basic +public import Mathlib.Logic.Nontrivial.Basic +public import Mathlib.Tactic.Common /-! # Adjoining a zero/one to semigroups and related algebraic structures @@ -25,6 +27,8 @@ information about these structures (which are not that standard in informal math `WithOne.coe_mul` and `WithZero.coe_mul` have inconsistent use of implicit parameters -/ +@[expose] public section + -- Check that we haven't needed to import all the basic lemmas about groups, -- by asserting a random sample don't exist here: assert_not_exists inv_involutive div_right_inj pow_ite MonoidWithZero DenselyOrdered diff --git a/Mathlib/Algebra/Group/WithOne/Map.lean b/Mathlib/Algebra/Group/WithOne/Map.lean index df0fded4afc2f2..b7af9151f5b235 100644 --- a/Mathlib/Algebra/Group/WithOne/Map.lean +++ b/Mathlib/Algebra/Group/WithOne/Map.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Ruben Van de Velde. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ruben Van de Velde -/ -import Mathlib.Algebra.Group.WithOne.Defs -import Mathlib.Data.Option.NAry +module + +public import Mathlib.Algebra.Group.WithOne.Defs +public import Mathlib.Data.Option.NAry /-! # Adjoining a zero/one to semigroups and mapping -/ +@[expose] public section + variable {α β γ : Type*} namespace WithOne diff --git a/Mathlib/Algebra/GroupWithZero/Action/Basic.lean b/Mathlib/Algebra/GroupWithZero/Action/Basic.lean index e240c5ae82b1c5..a68ad6a9349e48 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Basic.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Group.Action.Prod -import Mathlib.Algebra.GroupWithZero.Prod +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Group.Action.Prod +public import Mathlib.Algebra.GroupWithZero.Prod /-! # Definitions of group actions @@ -44,6 +46,8 @@ More sophisticated lemmas belong in `GroupTheory.GroupAction`. group action -/ +@[expose] public section + assert_not_exists Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Action/Center.lean b/Mathlib/Algebra/GroupWithZero/Action/Center.lean index 28999262b4e9c6..ae1e08c09af022 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Center.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Center.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.GroupTheory.Subgroup.Center +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.GroupTheory.Subgroup.Center /-! # The center of a group with zero -/ +@[expose] public section + assert_not_exists Ring /-- For a group with zero, the center of the units is the same as the units of the center. -/ diff --git a/Mathlib/Algebra/GroupWithZero/Action/ConjAct.lean b/Mathlib/Algebra/GroupWithZero/Action/ConjAct.lean index 4ab00f148f92f7..f1bbcd15d6af71 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/ConjAct.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/ConjAct.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.GroupTheory.GroupAction.ConjAct +module + +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.GroupTheory.GroupAction.ConjAct /-! # Conjugation action of a group with zero on itself -/ +@[expose] public section + assert_not_exists Ring variable {α G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Action/Defs.lean b/Mathlib/Algebra/GroupWithZero/Action/Defs.lean index fa73e851434468..8d3d6ca58741a2 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Defs.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Opposite -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.GroupWithZero.Opposite -import Mathlib.Algebra.Notation.Pi.Basic +module + +public import Mathlib.Algebra.Group.Action.Opposite +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.GroupWithZero.Opposite +public import Mathlib.Algebra.Notation.Pi.Basic /-! # Definitions of group actions @@ -36,6 +38,8 @@ More sophisticated lemmas belong in `GroupTheory.GroupAction`. group action -/ +@[expose] public section + assert_not_exists Equiv.Perm.equivUnitsEnd Prod.fst_mul Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Action/End.lean b/Mathlib/Algebra/GroupWithZero/Action/End.lean index 250f6726f534cf..1a1525facf64b0 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/End.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/End.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Hom -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.GroupWithZero.Action.Units +module + +public import Mathlib.Algebra.Group.Action.Hom +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.GroupWithZero.Action.Units /-! # Group actions and (endo)morphisms -/ +@[expose] public section + assert_not_exists RelIso Equiv.Perm.equivUnitsEnd Prod.fst_mul Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Action/Faithful.lean b/Mathlib/Algebra/GroupWithZero/Action/Faithful.lean index fbb73d2353ea50..cf2ba9a074b7cb 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Faithful.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Faithful.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.GroupWithZero.NeZero +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.GroupWithZero.NeZero /-! # Faithful actions involving groups with zero -/ +@[expose] public section + assert_not_exists Equiv.Perm.equivUnitsEnd Prod.fst_mul Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Action/Hom.lean b/Mathlib/Algebra/GroupWithZero/Action/Hom.lean index 434f56444e7485..20d7357711fd88 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Hom.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Hom.lean @@ -3,12 +3,15 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ +module -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Group.Hom.Instances /-! # Zero-related `•` instances on group-like morphisms -/ +@[expose] public section + variable {M N A B C : Type*} namespace ZeroHom diff --git a/Mathlib/Algebra/GroupWithZero/Action/Opposite.lean b/Mathlib/Algebra/GroupWithZero/Action/Opposite.lean index f90448ef6608f4..ce8b99799e7f9a 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Opposite.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Opposite.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Group.Action.Opposite -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.NeZero +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Group.Action.Opposite +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.NeZero /-! # Scalar actions on and by `Mᵐᵒᵖ` @@ -27,6 +29,8 @@ With `open scoped RightActions`, this provides: * `p <+ᵥ v` as an alias for `AddOpposite.op v +ᵥ p` -/ +@[expose] public section + assert_not_exists Ring variable {M α : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Action/Pi.lean b/Mathlib/Algebra/GroupWithZero/Action/Pi.lean index d7c63cde39b819..749c5e66beeaac 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Pi.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Pi.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Algebra.GroupWithZero.Pi -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Algebra.GroupWithZero.Pi +public import Mathlib.Tactic.Common /-! # Pi instances for multiplicative actions with zero @@ -21,6 +23,8 @@ This file defines instances for `MulActionWithZero` and related structures on `P * `Algebra.GroupWithZero.Action.Units` -/ +@[expose] public section + assert_not_exists Ring universe u v diff --git a/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Finset.lean b/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Finset.lean index 9174dba42b9f98..bb28230072ab9c 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Finset.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Finset.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set -import Mathlib.Algebra.GroupWithZero.Pointwise.Finset +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set +public import Mathlib.Algebra.GroupWithZero.Pointwise.Finset /-! # Pointwise operations of finsets in a group with zero @@ -15,6 +17,8 @@ import Mathlib.Algebra.GroupWithZero.Pointwise.Finset This file proves properties of pointwise operations of finsets in a group with zero. -/ +@[expose] public section + assert_not_exists Ring open scoped Pointwise diff --git a/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Set.lean b/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Set.lean index 1a6dd82b14dbae..51ff26e87fca58 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Set.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Pointwise/Set.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.GroupWithZero.Action.Basic -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.GroupWithZero.Pointwise.Set.Basic -import Mathlib.Algebra.NoZeroSMulDivisors.Defs +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.GroupWithZero.Pointwise.Set.Basic +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs /-! # Pointwise operations of sets in a group with zero @@ -20,6 +22,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Action/Prod.lean b/Mathlib/Algebra/GroupWithZero/Action/Prod.lean index ed0f5ec6f03d45..f20dc6c0fc8b35 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Prod.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Prod -import Mathlib.Algebra.GroupWithZero.Action.End +module + +public import Mathlib.Algebra.Group.Action.Prod +public import Mathlib.Algebra.GroupWithZero.Action.End /-! # Prod instances for multiplicative actions with zero @@ -18,6 +20,8 @@ This file defines instances for `MulActionWithZero` and related structures on ` * `Algebra.GroupWithZero.Action.Units` -/ +@[expose] public section + assert_not_exists Ring variable {M N α β : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Action/TransferInstance.lean b/Mathlib/Algebra/GroupWithZero/Action/TransferInstance.lean index 8053031b6997bd..b293ce1704b2b8 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/TransferInstance.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/TransferInstance.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.TransferInstance -import Mathlib.Algebra.GroupWithZero.Action.Defs +module + +public import Mathlib.Algebra.Group.Action.TransferInstance +public import Mathlib.Algebra.GroupWithZero.Action.Defs /-! # Transfer algebraic structures across `Equiv`s @@ -12,6 +14,8 @@ import Mathlib.Algebra.GroupWithZero.Action.Defs This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + assert_not_exists Ring variable {M M₀ A B : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Action/Units.lean b/Mathlib/Algebra/GroupWithZero/Action/Units.lean index 38961e14334b9c..7ad05add78d858 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Units.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Units.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Units -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.Group.Action.Units +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Multiplicative actions with zero on and by `Mˣ` @@ -24,6 +26,8 @@ admits a `MulDistribMulAction G Mˣ` structure, again with the obvious definitio * `Algebra.GroupWithZero.Action.Prod` -/ +@[expose] public section + assert_not_exists Ring variable {G₀ G M α β : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Associated.lean b/Mathlib/Algebra/GroupWithZero/Associated.lean index 2a1769786ba871..bbc2f71704c32c 100644 --- a/Mathlib/Algebra/GroupWithZero/Associated.lean +++ b/Mathlib/Algebra/GroupWithZero/Associated.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker -/ -import Mathlib.Algebra.Prime.Lemmas -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Algebra.Prime.Lemmas +public import Mathlib.Order.BoundedOrder.Basic /-! # Associated elements. @@ -15,6 +17,8 @@ Then we show that the quotient type `Associates` is a monoid and prove basic properties of this quotient. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset Ring variable {M : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Basic.lean b/Mathlib/Algebra/GroupWithZero/Basic.lean index 9b1b9aabc6ebcc..5082b3aefb93b7 100644 --- a/Mathlib/Algebra/GroupWithZero/Basic.lean +++ b/Mathlib/Algebra/GroupWithZero/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.GroupWithZero.NeZero -import Mathlib.Logic.Unique -import Mathlib.Tactic.Conv +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.GroupWithZero.NeZero +public import Mathlib.Logic.Unique +public import Mathlib.Tactic.Conv /-! # Groups with an adjoined zero element @@ -34,6 +36,8 @@ and require `0⁻¹ = 0`. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Center.lean b/Mathlib/Algebra/GroupWithZero/Center.lean index d43d70a40877dd..790a84412effe3 100644 --- a/Mathlib/Algebra/GroupWithZero/Center.lean +++ b/Mathlib/Algebra/GroupWithZero/Center.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Center -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.Group.Center +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Center of a group with zero -/ +@[expose] public section + assert_not_exists RelIso Finset Ring Subsemigroup variable {M₀ G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Commute.lean b/Mathlib/Algebra/GroupWithZero/Commute.lean index 80b2f7ad9e7f8c..09cd256543a5ec 100644 --- a/Mathlib/Algebra/GroupWithZero/Commute.lean +++ b/Mathlib/Algebra/GroupWithZero/Commute.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.GroupWithZero.Semiconj -import Mathlib.Algebra.Group.Commute.Units -import Mathlib.Tactic.Nontriviality +module + +public import Mathlib.Algebra.GroupWithZero.Semiconj +public import Mathlib.Algebra.Group.Commute.Units +public import Mathlib.Tactic.Nontriviality /-! # Lemmas about commuting elements in a `MonoidWithZero` or a `GroupWithZero`. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring variable {M₀ G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Conj.lean b/Mathlib/Algebra/GroupWithZero/Conj.lean index aebc0f8f0e3415..e4b52ad91446f7 100644 --- a/Mathlib/Algebra/GroupWithZero/Conj.lean +++ b/Mathlib/Algebra/GroupWithZero/Conj.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.Group.Conj -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.Group.Conj +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Conjugacy in a group with zero -/ +@[expose] public section + assert_not_exists Multiset Ring -- TODO -- assert_not_exists DenselyOrdered diff --git a/Mathlib/Algebra/GroupWithZero/Defs.lean b/Mathlib/Algebra/GroupWithZero/Defs.lean index 1c179ea3da5cc2..347968151deed2 100644 --- a/Mathlib/Algebra/GroupWithZero/Defs.lean +++ b/Mathlib/Algebra/GroupWithZero/Defs.lean @@ -3,10 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Tactic.SplitIfs -import Mathlib.Logic.Basic +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Logic.Basic /-! # Typeclasses for groups with an adjoined zero element @@ -20,6 +21,8 @@ members. * `CommGroupWithZero` -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring universe u diff --git a/Mathlib/Algebra/GroupWithZero/Divisibility.lean b/Mathlib/Algebra/GroupWithZero/Divisibility.lean index 2b3cc88f2b60a5..aa36be5236900b 100644 --- a/Mathlib/Algebra/GroupWithZero/Divisibility.lean +++ b/Mathlib/Algebra/GroupWithZero/Divisibility.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov, Neil Strickland, Aaron Anderson -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Divisibility.Units -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Divisibility.Units +public import Mathlib.Data.Nat.Basic /-! # Divisibility in groups with zero. @@ -15,6 +17,8 @@ Lemmas about divisibility in groups and monoids with zero. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring variable {α : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Equiv.lean b/Mathlib/Algebra/GroupWithZero/Equiv.lean index e0f8acc337e154..aa07a99e6e75cc 100644 --- a/Mathlib/Algebra/GroupWithZero/Equiv.lean +++ b/Mathlib/Algebra/GroupWithZero/Equiv.lean @@ -3,11 +3,15 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.GroupWithZero.Hom +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.GroupWithZero.Hom /-! # Isomorphisms of monoids with zero -/ +@[expose] public section + assert_not_exists Ring namespace MulEquivClass diff --git a/Mathlib/Algebra/GroupWithZero/Hom.lean b/Mathlib/Algebra/GroupWithZero/Hom.lean index ae9ae14152f52d..fed8dd93e5e0a3 100644 --- a/Mathlib/Algebra/GroupWithZero/Hom.lean +++ b/Mathlib/Algebra/GroupWithZero/Hom.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.GroupWithZero.Basic +module + +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.GroupWithZero.Basic /-! # Monoid with zero and group with zero homomorphisms @@ -31,6 +33,8 @@ can be inferred from the type it is faster to use this method than to use type c monoid homomorphism -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Idempotent.lean b/Mathlib/Algebra/GroupWithZero/Idempotent.lean index 1b7907ca967872..59427a76ef9770 100644 --- a/Mathlib/Algebra/GroupWithZero/Idempotent.lean +++ b/Mathlib/Algebra/GroupWithZero/Idempotent.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Group.Idempotent -import Mathlib.Algebra.GroupWithZero.Defs +module + +public import Mathlib.Algebra.Group.Idempotent +public import Mathlib.Algebra.GroupWithZero.Defs /-! # Idempotent elements of a group with zero -/ +@[expose] public section + assert_not_exists Ring variable {M N S M₀ M₁ R G G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Indicator.lean b/Mathlib/Algebra/GroupWithZero/Indicator.lean index e242444e7ba6d6..1abaf25762effd 100644 --- a/Mathlib/Algebra/GroupWithZero/Indicator.lean +++ b/Mathlib/Algebra/GroupWithZero/Indicator.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Support -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Algebra.Notation.Indicator +module + +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Support +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Algebra.Notation.Indicator /-! # Indicator functions and support of a function in groups with zero -/ +@[expose] public section + assert_not_exists Ring open Set diff --git a/Mathlib/Algebra/GroupWithZero/InjSurj.lean b/Mathlib/Algebra/GroupWithZero/InjSurj.lean index 47bc4c899a6057..8eb83814d5de8d 100644 --- a/Mathlib/Algebra/GroupWithZero/InjSurj.lean +++ b/Mathlib/Algebra/GroupWithZero/InjSurj.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Algebra.GroupWithZero.NeZero +module + +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Algebra.GroupWithZero.NeZero /-! # Lifting groups with zero along injective/surjective maps -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Int.lean b/Mathlib/Algebra/GroupWithZero/Int.lean index 8613212ad92527..51d6b4258d9689 100644 --- a/Mathlib/Algebra/GroupWithZero/Int.lean +++ b/Mathlib/Algebra/GroupWithZero/Int.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.GroupWithZero.WithZero +module + +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.GroupWithZero.WithZero /-! # Lemmas about `ℤᵐ⁰`. -/ +@[expose] public section + assert_not_exists Ring open Multiplicative diff --git a/Mathlib/Algebra/GroupWithZero/Invertible.lean b/Mathlib/Algebra/GroupWithZero/Invertible.lean index 1054f204365a2e..2bf312335ef5db 100644 --- a/Mathlib/Algebra/GroupWithZero/Invertible.lean +++ b/Mathlib/Algebra/GroupWithZero/Invertible.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Group.Invertible.Basic -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.Group.Invertible.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Theorems about invertible elements in a `GroupWithZero` @@ -12,6 +14,8 @@ import Mathlib.Algebra.GroupWithZero.Units.Basic We intentionally keep imports minimal here as this file is used by `Mathlib/Tactic/NormNum.lean`. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring universe u diff --git a/Mathlib/Algebra/GroupWithZero/Nat.lean b/Mathlib/Algebra/GroupWithZero/Nat.lean index 61c491f0391df2..e994d446f25ae3 100644 --- a/Mathlib/Algebra/GroupWithZero/Nat.lean +++ b/Mathlib/Algebra/GroupWithZero/Nat.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Tactic.Spread /-! # The natural numbers form a `CancelCommMonoidWithZero` @@ -15,6 +17,8 @@ This file contains the `CancelCommMonoidWithZero` instance on the natural number See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists Ring namespace Nat diff --git a/Mathlib/Algebra/GroupWithZero/NeZero.lean b/Mathlib/Algebra/GroupWithZero/NeZero.lean index 9cf54a4bc46906..a4355f49c8a4ac 100644 --- a/Mathlib/Algebra/GroupWithZero/NeZero.lean +++ b/Mathlib/Algebra/GroupWithZero/NeZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Algebra.NeZero +module + +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Algebra.NeZero /-! # `NeZero 1` in a nontrivial `MulZeroOneClass`. @@ -13,6 +15,8 @@ This file exists to minimize the dependencies of `Mathlib/Algebra/GroupWithZero/ which is a part of the algebraic hierarchy used by basic tactics. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring universe u diff --git a/Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean b/Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean index de6c6397c82a62..bc2ac4a8514881 100644 --- a/Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean +++ b/Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Devon Tuma, Oliver Nash -/ -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Algebra.Regular.SMul +module + +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Algebra.Regular.SMul /-! # Non-zero divisors and smul-divisors @@ -28,6 +30,8 @@ your own code. -/ +@[expose] public section + assert_not_exists Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Opposite.lean b/Mathlib/Algebra/GroupWithZero/Opposite.lean index 338bbadac9c861..5b1238ece6f1b5 100644 --- a/Mathlib/Algebra/GroupWithZero/Opposite.lean +++ b/Mathlib/Algebra/GroupWithZero/Opposite.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.GroupWithZero.NeZero +module + +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.GroupWithZero.NeZero /-! # Opposites of groups with zero -/ +@[expose] public section + assert_not_exists Ring variable {α : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Pi.lean b/Mathlib/Algebra/GroupWithZero/Pi.lean index 7b04ddb4f535b1..b3901f472c735c 100644 --- a/Mathlib/Algebra/GroupWithZero/Pi.lean +++ b/Mathlib/Algebra/GroupWithZero/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Pi.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Pi.Basic /-! # Pi instances for groups with zero @@ -13,6 +15,8 @@ import Mathlib.Algebra.Group.Pi.Basic This file defines monoid with zero, group with zero, and related structure instances for pi types. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring variable {ι : Type*} {α : ι → Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Pointwise/Finset.lean b/Mathlib/Algebra/GroupWithZero/Pointwise/Finset.lean index 8b01c6adf447ad..f282f775193784 100644 --- a/Mathlib/Algebra/GroupWithZero/Pointwise/Finset.lean +++ b/Mathlib/Algebra/GroupWithZero/Pointwise/Finset.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Pointwise operations of finsets in a group with zero @@ -12,6 +14,8 @@ import Mathlib.Algebra.Group.Pointwise.Finset.Basic This file proves properties of pointwise operations of finsets in a group with zero. -/ +@[expose] public section + assert_not_exists MulAction Ring open scoped Pointwise diff --git a/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Basic.lean b/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Basic.lean index 050e8dceaee869..f7d1e6a778431a 100644 --- a/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Basic.lean +++ b/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn -/ -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise operations of sets in a group with zero @@ -17,6 +19,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists MulAction IsOrderedMonoid Ring open Function diff --git a/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Card.lean b/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Card.lean index 10fa659c1455be..65295dd822c290 100644 --- a/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Card.lean +++ b/Mathlib/Algebra/GroupWithZero/Pointwise/Set/Card.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.GroupWithZero.Action.Basic -import Mathlib.SetTheory.Cardinal.Finite +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.GroupWithZero.Action.Basic +public import Mathlib.SetTheory.Cardinal.Finite /-! # Cardinality of sets under pointwise group with zero operations -/ +@[expose] public section + assert_not_exists Field open scoped Cardinal Pointwise diff --git a/Mathlib/Algebra/GroupWithZero/Prod.lean b/Mathlib/Algebra/GroupWithZero/Prod.lean index 0652ca2b7a69d5..eb38aced7ff4c7 100644 --- a/Mathlib/Algebra/GroupWithZero/Prod.lean +++ b/Mathlib/Algebra/GroupWithZero/Prod.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Yaël Dillies -/ -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.GroupWithZero.WithZero +module + +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.GroupWithZero.WithZero /-! # Products of monoids with zero, groups with zero @@ -19,6 +21,8 @@ In this file we define `MonoidWithZero`, `GroupWithZero`, etc... instances for ` * `divMonoidWithZeroHom`: Division bundled as a monoid with zero homomorphism. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring variable {M₀ N₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/ProdHom.lean b/Mathlib/Algebra/GroupWithZero/ProdHom.lean index a3f21a2b242df1..ebc7b4a8b80234 100644 --- a/Mathlib/Algebra/GroupWithZero/ProdHom.lean +++ b/Mathlib/Algebra/GroupWithZero/ProdHom.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.GroupWithZero.Commute -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.GroupWithZero.WithZero +module + +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.GroupWithZero.Commute +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.GroupWithZero.WithZero /-! # Homomorphisms for products of groups with zero @@ -22,6 +24,8 @@ as well as a terminal object. -/ +@[expose] public section + namespace MonoidWithZeroHom /-- The trivial group-with-zero hom is absorbing for composition. -/ diff --git a/Mathlib/Algebra/GroupWithZero/Range.lean b/Mathlib/Algebra/GroupWithZero/Range.lean index 32532e308aea12..ec1d24caa181e7 100644 --- a/Mathlib/Algebra/GroupWithZero/Range.lean +++ b/Mathlib/Algebra/GroupWithZero/Range.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir and Filippo Nuccio. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ +module -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Algebra.GroupWithZero.Submonoid.Instances -import Mathlib.Algebra.GroupWithZero.WithZero +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Algebra.GroupWithZero.Submonoid.Instances +public import Mathlib.Algebra.GroupWithZero.WithZero /-! # The range of a MonoidWithZeroHom Given a `MonoidWithZeroHom` `f : A → B` whose codomain `B` is a `MonoidWithZero`, we define the @@ -45,6 +46,8 @@ required properties; that it coincides with the submonoid generated by the closu unfolding. -/ +@[expose] public section + namespace MonoidWithZeroHom open Set Subgroup Submonoid diff --git a/Mathlib/Algebra/GroupWithZero/Regular.lean b/Mathlib/Algebra/GroupWithZero/Regular.lean index 2fec807c9e09c4..9b17c8c0c5785b 100644 --- a/Mathlib/Algebra/GroupWithZero/Regular.lean +++ b/Mathlib/Algebra/GroupWithZero/Regular.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Tactic.Push +module + +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Tactic.Push /-! # Results about `IsRegular` and `0` -/ +@[expose] public section + variable {R} section MulZeroClass diff --git a/Mathlib/Algebra/GroupWithZero/Semiconj.lean b/Mathlib/Algebra/GroupWithZero/Semiconj.lean index 3a62e10bd204f8..e0f66990d5b974 100644 --- a/Mathlib/Algebra/GroupWithZero/Semiconj.lean +++ b/Mathlib/Algebra/GroupWithZero/Semiconj.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Group.Semiconj.Units +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Group.Semiconj.Units /-! # Lemmas about semiconjugate elements in a `GroupWithZero`. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring variable {G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Shrink.lean b/Mathlib/Algebra/GroupWithZero/Shrink.lean index 045c3449e4ff47..8295e1be2750f2 100644 --- a/Mathlib/Algebra/GroupWithZero/Shrink.lean +++ b/Mathlib/Algebra/GroupWithZero/Shrink.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Shrink -import Mathlib.Algebra.GroupWithZero.Action.TransferInstance -import Mathlib.Algebra.GroupWithZero.TransferInstance +module + +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.Algebra.GroupWithZero.Action.TransferInstance +public import Mathlib.Algebra.GroupWithZero.TransferInstance /-! # Transfer group with zero structures from `α` to `Shrink α` -/ +@[expose] public section + noncomputable section universe v diff --git a/Mathlib/Algebra/GroupWithZero/Subgroup.lean b/Mathlib/Algebra/GroupWithZero/Subgroup.lean index 8abe273c1a5e12..583b292b34f953 100644 --- a/Mathlib/Algebra/GroupWithZero/Subgroup.lean +++ b/Mathlib/Algebra/GroupWithZero/Subgroup.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise +module + +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise /-! # Subgroups in a group with zero -/ +@[expose] public section + assert_not_exists Ring open Set diff --git a/Mathlib/Algebra/GroupWithZero/Submonoid/CancelMulZero.lean b/Mathlib/Algebra/GroupWithZero/Submonoid/CancelMulZero.lean index 4a9d0a661ef1cc..caff15f313ca73 100644 --- a/Mathlib/Algebra/GroupWithZero/Submonoid/CancelMulZero.lean +++ b/Mathlib/Algebra/GroupWithZero/Submonoid/CancelMulZero.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Dexin Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dexin Zhang -/ -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.Group.Submonoid.Defs +module + +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.Group.Submonoid.Defs /-! # Submagmas with zero inherit cancellations -/ +@[expose] public section + namespace MulZeroMemClass variable {M₀ : Type*} [Mul M₀] [Zero M₀] {S : Type*} [SetLike S M₀] [MulMemClass S M₀] diff --git a/Mathlib/Algebra/GroupWithZero/Submonoid/Instances.lean b/Mathlib/Algebra/GroupWithZero/Submonoid/Instances.lean index fbda0b57d5adf2..80d2776c4cdd8e 100644 --- a/Mathlib/Algebra/GroupWithZero/Submonoid/Instances.lean +++ b/Mathlib/Algebra/GroupWithZero/Submonoid/Instances.lean @@ -3,14 +3,17 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ +module -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas /-! # Instances for the range submonoid of a monoid with zero hom -/ +@[expose] public section + assert_not_exists Ring namespace MonoidWithZeroHom diff --git a/Mathlib/Algebra/GroupWithZero/Submonoid/Pointwise.lean b/Mathlib/Algebra/GroupWithZero/Submonoid/Pointwise.lean index c93d3dfa11db7c..7ca9a3917a5739 100644 --- a/Mathlib/Algebra/GroupWithZero/Submonoid/Pointwise.lean +++ b/Mathlib/Algebra/GroupWithZero/Submonoid/Pointwise.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Submonoid.Pointwise -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set +module + +public import Mathlib.Algebra.Group.Submonoid.Pointwise +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set /-! # Submonoids in a group with zero -/ +@[expose] public section + assert_not_exists Ring open Set diff --git a/Mathlib/Algebra/GroupWithZero/Submonoid/Primal.lean b/Mathlib/Algebra/GroupWithZero/Submonoid/Primal.lean index 22ea2d6a07d97d..f49bbe1a6ebb16 100644 --- a/Mathlib/Algebra/GroupWithZero/Submonoid/Primal.lean +++ b/Mathlib/Algebra/GroupWithZero/Submonoid/Primal.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.GroupWithZero.Divisibility +module + +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.GroupWithZero.Divisibility /-! # Submonoid of primal elements -/ +@[expose] public section + assert_not_exists RelIso Ring /-- The submonoid of primal elements in a cancellative commutative monoid with zero. -/ diff --git a/Mathlib/Algebra/GroupWithZero/Torsion.lean b/Mathlib/Algebra/GroupWithZero/Torsion.lean index 7c4683a6005d58..f531d5bdcb0030 100644 --- a/Mathlib/Algebra/GroupWithZero/Torsion.lean +++ b/Mathlib/Algebra/GroupWithZero/Torsion.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Xavier Roblot -/ -import Mathlib.Algebra.Regular.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Torsion-free monoids with zero @@ -16,6 +18,8 @@ Note. You need to import this file to get that the monoid of ideals of a Dedekin torsion-free. -/ +@[expose] public section + variable {M : Type*} [CancelCommMonoidWithZero M] theorem IsMulTorsionFree.mk' (ih : ∀ x ≠ 0, ∀ y ≠ 0, ∀ n ≠ 0, (x ^ n : M) = y ^ n → x = y) : diff --git a/Mathlib/Algebra/GroupWithZero/TransferInstance.lean b/Mathlib/Algebra/GroupWithZero/TransferInstance.lean index c9ec3900790310..a21284c94f57ae 100644 --- a/Mathlib/Algebra/GroupWithZero/TransferInstance.lean +++ b/Mathlib/Algebra/GroupWithZero/TransferInstance.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Algebra.GroupWithZero.InjSurj +module + +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Algebra.GroupWithZero.InjSurj /-! # Transfer algebraic structures across `Equiv`s @@ -12,6 +14,8 @@ import Mathlib.Algebra.GroupWithZero.InjSurj This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + assert_not_exists MulAction Ring universe u v diff --git a/Mathlib/Algebra/GroupWithZero/ULift.lean b/Mathlib/Algebra/GroupWithZero/ULift.lean index 67036af88290e8..0ace2b207de2af 100644 --- a/Mathlib/Algebra/GroupWithZero/ULift.lean +++ b/Mathlib/Algebra/GroupWithZero/ULift.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.ULift -import Mathlib.Algebra.GroupWithZero.InjSurj +module + +public import Mathlib.Algebra.Group.ULift +public import Mathlib.Algebra.GroupWithZero.InjSurj /-! # `ULift` instances for groups and monoids with zero @@ -14,6 +16,8 @@ This file defines instances for group and monoid with zero and related structure (Recall `ULift α` is just a "copy" of a type `α` in a higher universe.) -/ +@[expose] public section + assert_not_exists Ring universe u diff --git a/Mathlib/Algebra/GroupWithZero/Units/Basic.lean b/Mathlib/Algebra/GroupWithZero/Units/Basic.lean index fe50dd1c057117..305697a5f4f6dd 100644 --- a/Mathlib/Algebra/GroupWithZero/Units/Basic.lean +++ b/Mathlib/Algebra/GroupWithZero/Units/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Units.Basic -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Data.Int.Basic -import Mathlib.Lean.Meta.CongrTheorems -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Spread +module + +public import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Data.Int.Basic +public import Mathlib.Lean.Meta.CongrTheorems +public import Mathlib.Tactic.Contrapose +public import Mathlib.Tactic.Spread /-! # Lemmas about units in a `MonoidWithZero` or a `GroupWithZero`. @@ -17,6 +19,8 @@ We also define `Ring.inverse`, a globally defined function on any ring (in fact any `MonoidWithZero`), which inverts units and sends non-units to zero. -/ +@[expose] public section + assert_not_exists DenselyOrdered Equiv Subtype.restrict Multiplicative Ring variable {α M₀ G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Units/Equiv.lean b/Mathlib/Algebra/GroupWithZero/Units/Equiv.lean index 8b6d87f3716a25..225564579cb099 100644 --- a/Mathlib/Algebra/GroupWithZero/Units/Equiv.lean +++ b/Mathlib/Algebra/GroupWithZero/Units/Equiv.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Multiplication by a nonzero element in a `GroupWithZero` is a permutation. -/ +@[expose] public section + assert_not_exists DenselyOrdered Ring variable {G₀ : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/Units/Lemmas.lean b/Mathlib/Algebra/GroupWithZero/Units/Lemmas.lean index 6edfeea50096ba..beb96a3b8fa237 100644 --- a/Mathlib/Algebra/GroupWithZero/Units/Lemmas.lean +++ b/Mathlib/Algebra/GroupWithZero/Units/Lemmas.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Units.Hom -import Mathlib.Algebra.GroupWithZero.Commute -import Mathlib.Algebra.GroupWithZero.Hom +module + +public import Mathlib.Algebra.Group.Units.Hom +public import Mathlib.Algebra.GroupWithZero.Commute +public import Mathlib.Algebra.GroupWithZero.Hom /-! # Further lemmas about units in a `MonoidWithZero` or a `GroupWithZero`. -/ +@[expose] public section + assert_not_exists DenselyOrdered MulAction Ring variable {M M₀ G₀ M₀' G₀' F F' : Type*} diff --git a/Mathlib/Algebra/GroupWithZero/WithZero.lean b/Mathlib/Algebra/GroupWithZero/WithZero.lean index dca6e3805dd718..b7fc2ffb21ca13 100644 --- a/Mathlib/Algebra/GroupWithZero/WithZero.lean +++ b/Mathlib/Algebra/GroupWithZero/WithZero.lean @@ -3,13 +3,15 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johan Commelin -/ -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Algebra.Group.WithOne.Defs -import Mathlib.Algebra.GroupWithZero.Equiv -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Data.Nat.Cast.Defs -import Mathlib.Data.Option.Basic -import Mathlib.Data.Option.NAry +module + +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Algebra.Group.WithOne.Defs +public import Mathlib.Algebra.GroupWithZero.Equiv +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Data.Nat.Cast.Defs +public import Mathlib.Data.Option.Basic +public import Mathlib.Data.Option.NAry /-! # Adjoining a zero to a group @@ -34,6 +36,8 @@ In scope `WithZero`: * `WithZero.exp`: The "logarithm" `Mᵐ⁰ → M` -/ +@[expose] public section + open Function assert_not_exists DenselyOrdered Ring @@ -363,6 +367,23 @@ lemma exp_injective : Injective (exp : M → Mᵐ⁰) := @[simp] lemma exp_inj {x y : M} : exp x = exp y ↔ x = y := exp_injective.eq_iff +/-- Recursion principle for `Mᵐ⁰`. To construct predicate for all elements of `Mᵐ⁰`, it is enough to +construct its value at `0` and its value at `exp a` for all `a : M`. -/ +-- TODO: Uncomment once it stops firing on `WithZero M`. +-- See https://github.com/leanprover-community/mathlib4/issues/31213 +@[elab_as_elim] -- , induction_eliminator, cases_eliminator] +def expRecOn {motive : Mᵐ⁰ → Sort*} (x : Mᵐ⁰) (zero : motive 0) (exp : ∀ a, motive (exp a)) : + motive x := Option.recOn x zero exp + +@[simp] lemma expRecOn_zero {motive : Mᵐ⁰ → Sort*} (zero : motive 0) (exp : ∀ a, motive (exp a)) : + expRecOn 0 zero exp = zero := rfl + +@[simp] lemma expRecOn_exp {motive : Mᵐ⁰ → Sort*} (x : M) (zero : motive 0) + (exp : ∀ a, motive (exp a)) : + expRecOn (M := M) (motive := motive) (.exp x) zero exp = exp x := rfl + +instance : CanLift Mᵐ⁰ M exp (· ≠ 0) where prf | (.exp a : Mᵐ⁰), _ => ⟨a, rfl⟩ + variable [AddMonoid M] /-- The logarithm as a function `Mᵐ⁰ → M` with junk value `log 0 = 0`. -/ diff --git a/Mathlib/Algebra/HierarchyDesign.lean b/Mathlib/Algebra/HierarchyDesign.lean index cbb841ccff50c9..a0bc05fcc6aeb8 100644 --- a/Mathlib/Algebra/HierarchyDesign.lean +++ b/Mathlib/Algebra/HierarchyDesign.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Eric Wieser -/ -import Mathlib.Init -import Mathlib.Tactic.Basic +module + +public import Mathlib.Init +public import Mathlib.Tactic.Basic /-! # Documentation of the algebraic hierarchy @@ -17,6 +19,8 @@ TODO: Add sections about interactions with topological typeclasses, and order ty -/ +@[expose] public section + library_note2 «the algebraic hierarchy» /-- # The algebraic hierarchy diff --git a/Mathlib/Algebra/Homology/Additive.lean b/Mathlib/Algebra/Homology/Additive.lean index f60c6bc8b7f9fe..6133f3748b3b25 100644 --- a/Mathlib/Algebra/Homology/Additive.lean +++ b/Mathlib/Algebra/Homology/Additive.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Homology.Single -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Homology.Single +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # Homology is an additive functor @@ -15,6 +17,8 @@ and `homologyFunctor` is additive. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Homology/AlternatingConst.lean b/Mathlib/Algebra/Homology/AlternatingConst.lean index e212e04cccce6c..3f06f1ace24c9c 100644 --- a/Mathlib/Algebra/Homology/AlternatingConst.lean +++ b/Mathlib/Algebra/Homology/AlternatingConst.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Algebra.Module.BigOperators -import Mathlib.AlgebraicTopology.ExtraDegeneracy +module + +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.AlgebraicTopology.ExtraDegeneracy /-! # The alternating constant complex @@ -20,6 +22,8 @@ In particular, we show `... ⟶ X --𝟙--> X --0--> X --𝟙--> X --0--> X ⟶ to the single complex where `X` is in degree `0`. -/ + +@[expose] public section universe v u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Homology/Augment.lean b/Mathlib/Algebra/Homology/Augment.lean index 81630b88ba4bdd..e80b354d2ed187 100644 --- a/Mathlib/Algebra/Homology/Augment.lean +++ b/Mathlib/Algebra/Homology/Augment.lean @@ -3,12 +3,16 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Homology.Single +module + +public import Mathlib.Algebra.Homology.Single /-! # Augmentation and truncation of `ℕ`-indexed (co)chain complexes. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Homology/Bifunctor.lean b/Mathlib/Algebra/Homology/Bifunctor.lean index 4f5eb642328dae..e466b5706f8469 100644 --- a/Mathlib/Algebra/Homology/Bifunctor.lean +++ b/Mathlib/Algebra/Homology/Bifunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.TotalComplex -import Mathlib.CategoryTheory.GradedObject.Bifunctor +module + +public import Mathlib.Algebra.Homology.TotalComplex +public import Mathlib.CategoryTheory.GradedObject.Bifunctor /-! # The action of a bifunctor on homological complexes @@ -21,6 +23,8 @@ bicomplex `(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂)`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Limits diff --git a/Mathlib/Algebra/Homology/BifunctorAssociator.lean b/Mathlib/Algebra/Homology/BifunctorAssociator.lean index 99da5a72aca106..4bfd25b4f22f10 100644 --- a/Mathlib/Algebra/Homology/BifunctorAssociator.lean +++ b/Mathlib/Algebra/Homology/BifunctorAssociator.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject.Associator -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.Algebra.Homology.Bifunctor +module + +public import Mathlib.CategoryTheory.GradedObject.Associator +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.Algebra.Homology.Bifunctor /-! # The associator for actions of bifunctors on homological complexes @@ -34,6 +36,8 @@ the associator for the monoidal category structure on homological complexes. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Homology/BifunctorFlip.lean b/Mathlib/Algebra/Homology/BifunctorFlip.lean index 1f1ea01d482050..27370fe41bc036 100644 --- a/Mathlib/Algebra/Homology/BifunctorFlip.lean +++ b/Mathlib/Algebra/Homology/BifunctorFlip.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Bifunctor -import Mathlib.Algebra.Homology.TotalComplexSymmetry +module + +public import Mathlib.Algebra.Homology.Bifunctor +public import Mathlib.Algebra.Homology.TotalComplexSymmetry /-! # Action of the flip of a bifunctor on homological complexes @@ -17,6 +19,8 @@ under the additional assumption `[TotalComplexShapeSymmetry c₁ c₂ c]`. -/ +@[expose] public section + open CategoryTheory Limits variable {C₁ C₂ D : Type*} [Category C₁] [Category C₂] [Category D] diff --git a/Mathlib/Algebra/Homology/BifunctorHomotopy.lean b/Mathlib/Algebra/Homology/BifunctorHomotopy.lean index 4c000b592f3c11..4455a1c13dd332 100644 --- a/Mathlib/Algebra/Homology/BifunctorHomotopy.lean +++ b/Mathlib/Algebra/Homology/BifunctorHomotopy.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Bifunctor -import Mathlib.Algebra.Homology.Homotopy +module + +public import Mathlib.Algebra.Homology.Bifunctor +public import Mathlib.Algebra.Homology.Homotopy /-! # The action of a bifunctor on homological complexes factors through homotopies @@ -17,6 +19,8 @@ the morphism `f₂` in `HomologicalComplex C c₂` (TODO). -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Homology/BifunctorShift.lean b/Mathlib/Algebra/Homology/BifunctorShift.lean index 83a5a29a3a8d24..2e5cf40344f90c 100644 --- a/Mathlib/Algebra/Homology/BifunctorShift.lean +++ b/Mathlib/Algebra/Homology/BifunctorShift.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Bifunctor -import Mathlib.Algebra.Homology.TotalComplexShift +module + +public import Mathlib.Algebra.Homology.Bifunctor +public import Mathlib.Algebra.Homology.TotalComplexShift /-! # Behavior of the action of a bifunctor on cochain complexes with respect to shifts @@ -23,6 +25,8 @@ that the two ways to deduce an isomorphism -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Homology/CommSq.lean b/Mathlib/Algebra/Homology/CommSq.lean index 31de78b776112a..c94664e11960a1 100644 --- a/Mathlib/Algebra/Homology/CommSq.lean +++ b/Mathlib/Algebra/Homology/CommSq.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Preadditive.Biproducts +module + +public import Mathlib.Algebra.Homology.ShortComplex.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Preadditive.Biproducts /-! # Relation between pullback/pushout squares and kernel/cokernel sequences @@ -29,6 +31,8 @@ via the obvious map `X₁ ⟶ X₂ ⊞ X₃`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ComplexShape.lean b/Mathlib/Algebra/Homology/ComplexShape.lean index 799fbafe6ec39a..d1e39e09cf3e1f 100644 --- a/Mathlib/Algebra/Homology/ComplexShape.lean +++ b/Mathlib/Algebra/Homology/ComplexShape.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Logic.Relation -import Mathlib.Logic.Function.Basic +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Logic.Relation +public import Mathlib.Logic.Function.Basic /-! # Shapes of homological complexes @@ -40,6 +42,8 @@ so `d : X i ⟶ X j` is nonzero only when `i = j + 1`. `HomologicalComplex` with one of these shapes baked in.) -/ +@[expose] public section + noncomputable section /-- A `c : ComplexShape ι` describes the shape of a chain complex, diff --git a/Mathlib/Algebra/Homology/ComplexShapeSigns.lean b/Mathlib/Algebra/Homology/ComplexShapeSigns.lean index aea10d2ddc78bf..6e2fbc6077a997 100644 --- a/Mathlib/Algebra/Homology/ComplexShapeSigns.lean +++ b/Mathlib/Algebra/Homology/ComplexShapeSigns.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ComplexShape -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.CategoryTheory.GradedObject.Trifunctor +module + +public import Mathlib.Algebra.Homology.ComplexShape +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.CategoryTheory.GradedObject.Trifunctor /-! Signs in constructions on homological complexes @@ -24,6 +26,8 @@ satisfying certain properties (see `ComplexShape.TensorSigns`). -/ +@[expose] public section + assert_not_exists Field TwoSidedIdeal variable {I₁ I₂ I₃ I₁₂ I₂₃ J : Type*} diff --git a/Mathlib/Algebra/Homology/ConcreteCategory.lean b/Mathlib/Algebra/Homology/ConcreteCategory.lean index 804bc456816b84..ffffd2bf74737d 100644 --- a/Mathlib/Algebra/Homology/ConcreteCategory.lean +++ b/Mathlib/Algebra/Homology/ConcreteCategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomologySequence -import Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory +module + +public import Mathlib.Algebra.Homology.HomologySequence +public import Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory /-! # Homology of complexes in concrete categories @@ -18,6 +20,8 @@ the homology sequence in terms of (co)cycles. -/ +@[expose] public section + open CategoryTheory universe v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean index 44b6956c910fa4..3c306bb0329708 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor -import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence -import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors -import Mathlib.Algebra.Homology.HomotopyCategory.Triangulated -import Mathlib.Algebra.Homology.Localization +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor +public import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence +public import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors +public import Mathlib.Algebra.Homology.HomotopyCategory.Triangulated +public import Mathlib.Algebra.Homology.Localization /-! # The derived category of an abelian category @@ -57,6 +59,8 @@ with the one defined in `Algebra.Homology.HomologySequence`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/ExactFunctor.lean b/Mathlib/Algebra/Homology/DerivedCategory/ExactFunctor.lean index 1602470be42005..edc38ee3fa4943 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/ExactFunctor.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/ExactFunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Basic +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Basic /-! # An exact functor induces a functor on derived categories @@ -14,6 +16,8 @@ abelian categories, then there is an induced triangulated functor -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w₁ w₂ v₁ v₂ u₁ u₂ diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean index 83e4894fd0f0af..a19f6b17d45f5d 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.FullyFaithful -import Mathlib.CategoryTheory.Localization.SmallShiftedHom +module + +public import Mathlib.Algebra.Homology.DerivedCategory.FullyFaithful +public import Mathlib.CategoryTheory.Localization.SmallShiftedHom /-! # Ext groups in abelian categories @@ -36,6 +38,8 @@ sheaves over `X` shall be in `Type u`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w'' w' w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean index 1b9e687873aa42..daef5d00864f4f 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences /-! # Smallness of Ext-groups from the existence of enough injectives @@ -23,6 +25,8 @@ Note: this file dualizes the results in `HasEnoughProjectives.lean`. -/ +@[expose] public section + universe w v u open CategoryTheory Category diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean index 323b43bbcfcaae..31a9158b307532 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences /-! # Smallness of Ext-groups from the existence of enough projectives @@ -21,6 +23,8 @@ So we must be very selective regarding `HasExt` instances. -/ +@[expose] public section + universe w v u open CategoryTheory Category diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean index b153016bb9a972..924d670f566c7a 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExtClass -import Mathlib.CategoryTheory.Triangulated.Yoneda +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.ExtClass +public import Mathlib.CategoryTheory.Triangulated.Yoneda /-! # Long exact sequences of `Ext`-groups @@ -17,6 +19,8 @@ Similarly, if `Y : C`, there is a contravariant long exact sequence : -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w' w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean index faecccd3b22e86..768df49054a919 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic -import Mathlib.Algebra.Homology.DerivedCategory.SingleTriangle +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic +public import Mathlib.Algebra.Homology.DerivedCategory.SingleTriangle /-! # The Ext class of a short exact sequence @@ -15,6 +17,8 @@ in an abelian category, we construct the associated class in -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w' w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Linear.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Linear.lean index 991829b151a1e4..54482a37082e38 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Linear.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Linear.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic -import Mathlib.Algebra.Homology.DerivedCategory.Linear -import Mathlib.Algebra.Module.TransferInstance -import Mathlib.LinearAlgebra.BilinearMap +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic +public import Mathlib.Algebra.Homology.DerivedCategory.Linear +public import Mathlib.Algebra.Module.TransferInstance +public import Mathlib.LinearAlgebra.BilinearMap /-! # Ext-modules in linear categories @@ -17,6 +19,8 @@ for `X` and `Y` in `C` and `n : ℕ`. -/ +@[expose] public section + universe w' w t v u namespace CategoryTheory diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean b/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean index 1acbf86d3de05c..c9af0a42ff93de 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.HomologySequence -import Mathlib.Algebra.Homology.Embedding.CochainComplex +module + +public import Mathlib.Algebra.Homology.DerivedCategory.HomologySequence +public import Mathlib.Algebra.Homology.Embedding.CochainComplex /-! # Calculus of fractions in the derived category @@ -19,6 +21,8 @@ on the auxiliary object appearing in the fraction. -/ +@[expose] public section + universe w v u open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/Homology/DerivedCategory/FullyFaithful.lean b/Mathlib/Algebra/Homology/DerivedCategory/FullyFaithful.lean index 6e6d5179914007..ae7739dac5ee6b 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/FullyFaithful.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/FullyFaithful.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Fractions -import Mathlib.Algebra.Homology.SingleHomology +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Fractions +public import Mathlib.Algebra.Homology.SingleHomology /-! # The fully faithful embedding of the abelian category in its derived category @@ -13,6 +15,8 @@ In this file, we show that for any `n : ℤ`, the functor -/ +@[expose] public section + universe w v u open CategoryTheory diff --git a/Mathlib/Algebra/Homology/DerivedCategory/HomologySequence.lean b/Mathlib/Algebra/Homology/DerivedCategory/HomologySequence.lean index 865df8de2de37b..c1a96b5e2b84c8 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/HomologySequence.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/HomologySequence.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.DerivedCategory.Basic +public import Mathlib.Algebra.Homology.DerivedCategory.Basic /-! # The homology sequence @@ -16,6 +17,8 @@ derived category. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Linear.lean b/Mathlib/Algebra/Homology/DerivedCategory/Linear.lean index 56170cf869afda..80da316606c285 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Linear.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Linear.lean @@ -3,16 +3,20 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Basic -import Mathlib.Algebra.Homology.Linear -import Mathlib.CategoryTheory.Localization.Linear -import Mathlib.CategoryTheory.Shift.Linear +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Basic +public import Mathlib.Algebra.Homology.Linear +public import Mathlib.CategoryTheory.Localization.Linear +public import Mathlib.CategoryTheory.Shift.Linear /-! # The derived category of a linear abelian category is linear -/ +@[expose] public section + open CategoryTheory Category Limits Pretriangulated ZeroObject Preadditive universe t w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/ShortExact.lean b/Mathlib/Algebra/Homology/DerivedCategory/ShortExact.lean index 41b354c4b6d110..bc992439f08239 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/ShortExact.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/ShortExact.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.ShortExact -import Mathlib.Algebra.Homology.DerivedCategory.Basic +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.ShortExact +public import Mathlib.Algebra.Homology.DerivedCategory.Basic /-! # The distinguished triangle attached to a short exact sequence of cochain complexes @@ -17,6 +19,8 @@ in the derived category of `C`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/SingleTriangle.lean b/Mathlib/Algebra/Homology/DerivedCategory/SingleTriangle.lean index a3d9e41c733c01..e6e88a0ce31f02 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/SingleTriangle.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/SingleTriangle.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.ShortExact +module + +public import Mathlib.Algebra.Homology.DerivedCategory.ShortExact /-! # The distinguished triangle of a short exact sequence in an abelian category @@ -19,6 +21,8 @@ the associated distinguished triangle in the derived category: -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w v u diff --git a/Mathlib/Algebra/Homology/DerivedCategory/TStructure.lean b/Mathlib/Algebra/Homology/DerivedCategory/TStructure.lean index ef1b286ae54781..c1719f649c77a3 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/TStructure.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/TStructure.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.DerivedCategory.Fractions -import Mathlib.Algebra.Homology.DerivedCategory.ShortExact -import Mathlib.Algebra.Homology.Embedding.CochainComplex -import Mathlib.CategoryTheory.Triangulated.TStructure.Basic +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Fractions +public import Mathlib.Algebra.Homology.DerivedCategory.ShortExact +public import Mathlib.Algebra.Homology.Embedding.CochainComplex +public import Mathlib.CategoryTheory.Triangulated.TStructure.Basic /-! # The canonical t-structure on the derived category @@ -16,6 +18,8 @@ derived category of an abelian category. -/ +@[expose] public section + open CategoryTheory Category Pretriangulated Triangulated Limits Preadditive universe w v u diff --git a/Mathlib/Algebra/Homology/DifferentialObject.lean b/Mathlib/Algebra/Homology/DifferentialObject.lean index 62b558bc85d3f9..5ff8e547e65dee 100644 --- a/Mathlib/Algebra/Homology/DifferentialObject.lean +++ b/Mathlib/Algebra/Homology/DifferentialObject.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Homology.HomologicalComplex -import Mathlib.CategoryTheory.DifferentialObject +module + +public import Mathlib.Algebra.Homology.HomologicalComplex +public import Mathlib.CategoryTheory.DifferentialObject /-! # Homological complexes are differential graded objects. @@ -16,6 +18,8 @@ This equivalence is probably not particularly useful in practice; it's here to check that definitions match up as expected. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits noncomputable section diff --git a/Mathlib/Algebra/Homology/Double.lean b/Mathlib/Algebra/Homology/Double.lean index c2619a8ade32f6..182a6f0489e3c3 100644 --- a/Mathlib/Algebra/Homology/Double.lean +++ b/Mathlib/Algebra/Homology/Double.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HasNoLoop -import Mathlib.Algebra.Homology.Single -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.Algebra.Homology.HasNoLoop +public import Mathlib.Algebra.Homology.Single +public import Mathlib.CategoryTheory.Yoneda /-! # A homological complex lying in two degrees @@ -17,6 +19,8 @@ with the differential `X₀ ⟶ X₁` given by `f`, and zero everywhere else. -/ +@[expose] public section + open CategoryTheory Category Limits ZeroObject Opposite namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/Embedding/AreComplementary.lean b/Mathlib/Algebra/Homology/Embedding/AreComplementary.lean index 9db0c2800ab4a8..ec69ed1bdf3269 100644 --- a/Mathlib/Algebra/Homology/Embedding/AreComplementary.lean +++ b/Mathlib/Algebra/Homology/Embedding/AreComplementary.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.TruncLEHomology +module + +public import Mathlib.Algebra.Homology.Embedding.TruncLEHomology /-! # Complementary embeddings @@ -19,6 +21,8 @@ the cokernel of `K.ιTruncLE e₁ : K.truncLE e₁ ⟶ K` and `K.truncGE e₂`. -/ +@[expose] public section + open CategoryTheory Limits variable {ι ι₁ ι₂ : Type*} {c : ComplexShape ι} {c₁ : ComplexShape ι₁} {c₂ : ComplexShape ι₂} diff --git a/Mathlib/Algebra/Homology/Embedding/Basic.lean b/Mathlib/Algebra/Homology/Embedding/Basic.lean index 17e21792ba9dd7..70c0308fa4173f 100644 --- a/Mathlib/Algebra/Homology/Embedding/Basic.lean +++ b/Mathlib/Algebra/Homology/Embedding/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ComplexShape -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Tactic.ByContra +module + +public import Mathlib.Algebra.Homology.ComplexShape +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Tactic.ByContra /-! # Embeddings of complex shapes @@ -50,6 +52,8 @@ in degrees in the image of `e.f` (TODO); -/ +@[expose] public section + assert_not_exists Nat.instAddMonoidWithOne Nat.instMulZeroClass variable {ι ι' : Type*} (c : ComplexShape ι) (c' : ComplexShape ι') diff --git a/Mathlib/Algebra/Homology/Embedding/Boundary.lean b/Mathlib/Algebra/Homology/Embedding/Boundary.lean index 2bafdd5149b77f..d42abd1b87c0cc 100644 --- a/Mathlib/Algebra/Homology/Embedding/Boundary.lean +++ b/Mathlib/Algebra/Homology/Embedding/Boundary.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.Basic -import Mathlib.Algebra.Homology.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.Embedding.Basic +public import Mathlib.Algebra.Homology.HomologicalComplex /-! # Boundary of an embedding of complex shapes @@ -32,6 +34,8 @@ only element in this lower boundary. Similarly, we define -/ +@[expose] public section + namespace ComplexShape namespace Embedding diff --git a/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean b/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean index c896f9889ca2fd..e8943228c5af77 100644 --- a/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean +++ b/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.AreComplementary -import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors -import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence +module + +public import Mathlib.Algebra.Homology.Embedding.AreComplementary +public import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors +public import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence /-! # Truncations on cochain complexes indexed by the integers. @@ -18,6 +20,8 @@ complexes indexed by `ℤ`, as well as the conditions -/ +@[expose] public section + open CategoryTheory Category Limits ComplexShape ZeroObject namespace CochainComplex diff --git a/Mathlib/Algebra/Homology/Embedding/Connect.lean b/Mathlib/Algebra/Homology/Embedding/Connect.lean index 027b45b62572e7..095f8ad95b8204 100644 --- a/Mathlib/Algebra/Homology/Embedding/Connect.lean +++ b/Mathlib/Algebra/Homology/Embedding/Connect.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.RestrictionHomology +module + +public import Mathlib.Algebra.Homology.Embedding.RestrictionHomology /-! # Connecting a chain complex and a cochain complex @@ -38,6 +40,8 @@ Now say `h : ConnectData K L`. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Homology/Embedding/Extend.lean b/Mathlib/Algebra/Homology/Embedding/Extend.lean index 0b6fcb80ebeec4..ccfdfb973abc67 100644 --- a/Mathlib/Algebra/Homology/Embedding/Extend.lean +++ b/Mathlib/Algebra/Homology/Embedding/Extend.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.IsSupported -import Mathlib.Algebra.Homology.Additive -import Mathlib.Algebra.Homology.Opposite +module + +public import Mathlib.Algebra.Homology.Embedding.IsSupported +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.Algebra.Homology.Opposite /-! # The extension of a homological complex by an embedding of complex shapes @@ -18,6 +20,8 @@ This construction first appeared in the Liquid Tensor Experiment. -/ +@[expose] public section + open CategoryTheory Category Limits ZeroObject variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean b/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean index 2d5d00e3d6d6f7..5e9f24ec8dc01c 100644 --- a/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.Extend -import Mathlib.Algebra.Homology.Embedding.IsSupported -import Mathlib.Algebra.Homology.QuasiIso +module + +public import Mathlib.Algebra.Homology.Embedding.Extend +public import Mathlib.Algebra.Homology.Embedding.IsSupported +public import Mathlib.Algebra.Homology.QuasiIso /-! # Homology of the extension of an homological complex @@ -17,6 +19,8 @@ the homology is obviously zero. When `e.f j = j`, we construct an isomorphism -/ +@[expose] public section + open CategoryTheory Limits Category namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean b/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean index 2af7fd3613c4cd..6af341412740d1 100644 --- a/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean +++ b/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.Restriction -import Mathlib.Algebra.Homology.Embedding.Extend -import Mathlib.Algebra.Homology.Embedding.Boundary -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.Algebra.Homology.Embedding.Restriction +public import Mathlib.Algebra.Homology.Embedding.Extend +public import Mathlib.Algebra.Homology.Embedding.Boundary +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Relations between `extend` and `restriction` @@ -22,6 +24,8 @@ condition `e.HasLift φ`. -/ +@[expose] public section + open CategoryTheory Category Limits namespace ComplexShape @@ -62,7 +66,6 @@ lemma f_eq {i' : ι'} {i : ι} (hi : e.f i = i') : f φ i' = (K.restrictionXIso e hi).inv ≫ φ.f i ≫ (L.extendXIso e hi).inv := by have hi' : ∃ k, e.f k = i' := ⟨i, hi⟩ have : hi'.choose = i := e.injective_f (by rw [hi'.choose_spec, hi]) - dsimp [f] grind [f] @[reassoc (attr := simp)] diff --git a/Mathlib/Algebra/Homology/Embedding/IsSupported.lean b/Mathlib/Algebra/Homology/Embedding/IsSupported.lean index c7f67d418188e6..9d0188d4e528c2 100644 --- a/Mathlib/Algebra/Homology/Embedding/IsSupported.lean +++ b/Mathlib/Algebra/Homology/Embedding/IsSupported.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.Basic -import Mathlib.Algebra.Homology.Opposite -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.Embedding.Basic +public import Mathlib.Algebra.Homology.Opposite +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex /-! # Support of homological complexes @@ -23,6 +25,8 @@ complementary embedding `e'`.) -/ +@[expose] public section + open CategoryTheory Limits ZeroObject variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/Restriction.lean b/Mathlib/Algebra/Homology/Embedding/Restriction.lean index cb3dd2d939761d..d6427f4ffca546 100644 --- a/Mathlib/Algebra/Homology/Embedding/Restriction.lean +++ b/Mathlib/Algebra/Homology/Embedding/Restriction.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.Basic -import Mathlib.Algebra.Homology.Additive +module + +public import Mathlib.Algebra.Homology.Embedding.Basic +public import Mathlib.Algebra.Homology.Additive /-! # The restriction functor of an embedding of complex shapes @@ -15,6 +17,8 @@ Given `c` and `c'` complex shapes on two types, and `e : c.Embedding c'` -/ +@[expose] public section + open CategoryTheory Category Limits ZeroObject variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean b/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean index dd56053c54d8cb..425c9c793659b0 100644 --- a/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.Restriction -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.Embedding.Restriction +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex /-! # The homology of a restriction @@ -16,6 +18,8 @@ and `restriction.hasHomology`. -/ +@[expose] public section + open CategoryTheory Category Limits ZeroObject variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/StupidTrunc.lean b/Mathlib/Algebra/Homology/Embedding/StupidTrunc.lean index f4a21bf38fef78..26caa097ece166 100644 --- a/Mathlib/Algebra/Homology/Embedding/StupidTrunc.lean +++ b/Mathlib/Algebra/Homology/Embedding/StupidTrunc.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.Embedding.Extend -import Mathlib.Algebra.Homology.Embedding.IsSupported -import Mathlib.Algebra.Homology.Embedding.Restriction +public import Mathlib.Algebra.Homology.Embedding.Extend +public import Mathlib.Algebra.Homology.Embedding.IsSupported +public import Mathlib.Algebra.Homology.Embedding.Restriction /-! # The stupid truncation of homological complexes @@ -21,6 +22,8 @@ which sends `K` to `K.stupidTrunc e` which is defined as `(K.restriction e).exte -/ +@[expose] public section + open CategoryTheory Category Limits ZeroObject variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/TruncGE.lean b/Mathlib/Algebra/Homology/Embedding/TruncGE.lean index 890cf31368c300..fed78b0dfca873 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncGE.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncGE.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.HomEquiv -import Mathlib.Algebra.Homology.Embedding.IsSupported -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.Embedding.HomEquiv +public import Mathlib.Algebra.Homology.Embedding.IsSupported +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex /-! # The canonical truncation @@ -39,6 +41,8 @@ We also construct the canonical epimorphism `K.πTruncGE e : K ⟶ K.truncGE e`. -/ +@[expose] public section + open CategoryTheory Limits ZeroObject Category variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean b/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean index 33aa50866daca8..13ebf14b437179 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.ExtendHomology -import Mathlib.Algebra.Homology.Embedding.TruncGE -import Mathlib.Algebra.Homology.Embedding.RestrictionHomology -import Mathlib.Algebra.Homology.QuasiIso +module + +public import Mathlib.Algebra.Homology.Embedding.ExtendHomology +public import Mathlib.Algebra.Homology.Embedding.TruncGE +public import Mathlib.Algebra.Homology.Embedding.RestrictionHomology +public import Mathlib.Algebra.Homology.QuasiIso /-! # The homology of a canonical truncation @@ -20,6 +22,8 @@ quasi-isomorphism in degree `e.f i` for all `i`. (Note that the complex -/ +@[expose] public section + open CategoryTheory Category Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/Embedding/TruncLE.lean b/Mathlib/Algebra/Homology/Embedding/TruncLE.lean index b648cb305d5c89..6444747a202b7b 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncLE.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncLE.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.TruncGE +module + +public import Mathlib.Algebra.Homology.Embedding.TruncGE /-! # The canonical truncation @@ -19,6 +21,8 @@ In order to achieve this, we dualize the constructions from the file -/ +@[expose] public section + open CategoryTheory Limits ZeroObject Category variable {ι ι' : Type*} {c : ComplexShape ι} {c' : ComplexShape ι'} diff --git a/Mathlib/Algebra/Homology/Embedding/TruncLEHomology.lean b/Mathlib/Algebra/Homology/Embedding/TruncLEHomology.lean index 91e2c63f869108..41673af10d152b 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncLEHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncLEHomology.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Embedding.TruncGEHomology -import Mathlib.Algebra.Homology.Embedding.TruncLE -import Mathlib.Algebra.Homology.HomologySequence -import Mathlib.Algebra.Homology.ShortComplex.Abelian -import Mathlib.Algebra.Homology.HomologicalComplexAbelian +module + +public import Mathlib.Algebra.Homology.Embedding.TruncGEHomology +public import Mathlib.Algebra.Homology.Embedding.TruncLE +public import Mathlib.Algebra.Homology.HomologySequence +public import Mathlib.Algebra.Homology.ShortComplex.Abelian +public import Mathlib.Algebra.Homology.HomologicalComplexAbelian /-! # The homology of a canonical truncation @@ -26,6 +28,8 @@ sequence `K.shortComplexTruncLE e` of the monomorphism `K.ιTruncLE e`. -/ +@[expose] public section + open CategoryTheory Category Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/ExactSequence.lean b/Mathlib/Algebra/Homology/ExactSequence.lean index bf75d7ca9a0402..40ad4e7ec51f15 100644 --- a/Mathlib/Algebra/Homology/ExactSequence.lean +++ b/Mathlib/Algebra/Homology/ExactSequence.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.CategoryTheory.ComposableArrows +module + +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.CategoryTheory.ComposableArrows.Basic /-! # Exact sequences @@ -25,6 +27,8 @@ Liquid Tensor Experiment as a property of lists in `Arrow C`. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/Algebra/Homology/Factorizations/Basic.lean b/Mathlib/Algebra/Homology/Factorizations/Basic.lean index 19078fd58e2dd8..c6e229baf513dc 100644 --- a/Mathlib/Algebra/Homology/Factorizations/Basic.lean +++ b/Mathlib/Algebra/Homology/Factorizations/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomologicalComplex -import Mathlib.CategoryTheory.Abelian.EpiWithInjectiveKernel +module + +public import Mathlib.Algebra.Homology.HomologicalComplex +public import Mathlib.CategoryTheory.Abelian.EpiWithInjectiveKernel /-! # Basic definitions for factorizations lemmas @@ -32,6 +34,8 @@ of total derived functors (and a refactor of the sequence of derived functors). -/ +@[expose] public section + open CategoryTheory Abelian diff --git a/Mathlib/Algebra/Homology/Functor.lean b/Mathlib/Algebra/Homology/Functor.lean index 7560ad47ae5ed7..89b61c8d869691 100644 --- a/Mathlib/Algebra/Homology/Functor.lean +++ b/Mathlib/Algebra/Homology/Functor.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Homology.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.HomologicalComplex /-! # Complexes in functor categories @@ -16,6 +18,8 @@ In fact this is an equivalence of categories. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Homology/GrothendieckAbelian.lean b/Mathlib/Algebra/Homology/GrothendieckAbelian.lean index 933502df293a9a..b8b4b83b47da19 100644 --- a/Mathlib/Algebra/Homology/GrothendieckAbelian.lean +++ b/Mathlib/Algebra/Homology/GrothendieckAbelian.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic -import Mathlib.CategoryTheory.Generator.HomologicalComplex -import Mathlib.Algebra.Homology.HomologicalComplexAbelian +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +public import Mathlib.CategoryTheory.Generator.HomologicalComplex +public import Mathlib.Algebra.Homology.HomologicalComplexAbelian /-! # Homological complexes in a Grothendieck abelian category @@ -17,6 +19,8 @@ category (with `IsGrothendieckAbelian.{w} C`), the category -/ +@[expose] public section + universe w w' t v u open CategoryTheory Limits diff --git a/Mathlib/Algebra/Homology/HasNoLoop.lean b/Mathlib/Algebra/Homology/HasNoLoop.lean index adb8013b35d431..acf330fd8c150b 100644 --- a/Mathlib/Algebra/Homology/HasNoLoop.lean +++ b/Mathlib/Algebra/Homology/HasNoLoop.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ComplexShape -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Group.Nat.Defs +module + +public import Mathlib.Algebra.Homology.ComplexShape +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Group.Nat.Defs /-! # Complex shapes with no loop @@ -15,6 +17,8 @@ which expresses that `¬ c.Rel i i` for all `i : ι`. -/ +@[expose] public section + namespace ComplexShape variable {ι : Type*} diff --git a/Mathlib/Algebra/Homology/HomologicalBicomplex.lean b/Mathlib/Algebra/Homology/HomologicalBicomplex.lean index 5f533583540547..1f39036bbeaa11 100644 --- a/Mathlib/Algebra/Homology/HomologicalBicomplex.lean +++ b/Mathlib/Algebra/Homology/HomologicalBicomplex.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Homology.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.HomologicalComplex /-! # Bicomplexes @@ -21,6 +23,8 @@ which is obtained by exchanging the horizontal and vertical directions. -/ +@[expose] public section + open CategoryTheory Limits diff --git a/Mathlib/Algebra/Homology/HomologicalComplex.lean b/Mathlib/Algebra/Homology/HomologicalComplex.lean index 73b4cfdaf448f2..6d56dcced9e275 100644 --- a/Mathlib/Algebra/Homology/HomologicalComplex.lean +++ b/Mathlib/Algebra/Homology/HomologicalComplex.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison -/ -import Mathlib.Algebra.Homology.ComplexShape -import Mathlib.CategoryTheory.Subobject.Limits -import Mathlib.CategoryTheory.GradedObject -import Mathlib.Algebra.Homology.ShortComplex.Basic +module + +public import Mathlib.Algebra.Homology.ComplexShape +public import Mathlib.CategoryTheory.Subobject.Limits +public import Mathlib.CategoryTheory.GradedObject +public import Mathlib.Algebra.Homology.ShortComplex.Basic /-! # Homological complexes. @@ -34,6 +36,8 @@ Defined in terms of these we have `C.dFrom i : C.X i ⟶ C.xNext i` and `C.dTo j : C.xPrev j ⟶ C.X j`, which are either defined as `C.d i j`, or zero, as needed. -/ +@[expose] public section + universe v u diff --git a/Mathlib/Algebra/Homology/HomologicalComplexAbelian.lean b/Mathlib/Algebra/Homology/HomologicalComplexAbelian.lean index b2edc9b29cd6df..8c45e9fe3ff119 100644 --- a/Mathlib/Algebra/Homology/HomologicalComplexAbelian.lean +++ b/Mathlib/Algebra/Homology/HomologicalComplexAbelian.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.Algebra.Homology.HomologicalComplexLimits -import Mathlib.Algebra.Homology.ShortComplex.ShortExact +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.Algebra.Homology.HomologicalComplexLimits +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact /-! # THe category of homological complexes is abelian @@ -17,6 +19,8 @@ is exact (resp. short exact) iff degreewise it is so. -/ +@[expose] public section + open CategoryTheory Category Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean b/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean index a756748af1fe7b..f8f7c7f2b371f7 100644 --- a/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean +++ b/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomologicalComplexLimits -import Mathlib.Algebra.Homology.Additive +module + +public import Mathlib.Algebra.Homology.HomologicalComplexLimits +public import Mathlib.Algebra.Homology.Additive /-! Binary biproducts of homological complexes @@ -14,6 +16,8 @@ a preadditive category are such that for all `i : ι`, the binary biproduct `biprodXIso K L i : (K ⊞ L).X i ≅ (K.X i) ⊞ (L.X i)`. -/ + +@[expose] public section open CategoryTheory Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/HomologicalComplexLimits.lean b/Mathlib/Algebra/Homology/HomologicalComplexLimits.lean index f8945bc3785c96..725a9b64c9bf91 100644 --- a/Mathlib/Algebra/Homology/HomologicalComplexLimits.lean +++ b/Mathlib/Algebra/Homology/HomologicalComplexLimits.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Single -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +module + +public import Mathlib.Algebra.Homology.Single +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono /-! # Limits and colimits in the category of homological complexes @@ -18,6 +20,8 @@ commute to these. -/ +@[expose] public section + open CategoryTheory Category Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/HomologySequence.lean b/Mathlib/Algebra/Homology/HomologySequence.lean index cfd2c61e4bf520..471dc4982f8776 100644 --- a/Mathlib/Algebra/Homology/HomologySequence.lean +++ b/Mathlib/Algebra/Homology/HomologySequence.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.Algebra.Homology.HomologicalComplexLimits +module + +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.Algebra.Homology.HomologicalComplexLimits /-! # The homology sequence @@ -29,6 +31,8 @@ the Liquid Tensor Experiment. -/ +@[expose] public section + open CategoryTheory Category Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean b/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean index 041258f64160f9..b0aa10489ff00e 100644 --- a/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean +++ b/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomologySequence -import Mathlib.Algebra.Homology.QuasiIso -import Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four +module + +public import Mathlib.Algebra.Homology.HomologySequence +public import Mathlib.Algebra.Homology.QuasiIso +public import Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four /-! # Consequences of the homology sequence @@ -26,6 +28,8 @@ for `φ.τ₁` and `φ.τ₂` shall be also obtained (TODO). -/ +@[expose] public section + open CategoryTheory ComposableArrows Abelian namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/Homotopy.lean b/Mathlib/Algebra/Homology/Homotopy.lean index fb13ab7607a7cf..1357ef77d0b1cb 100644 --- a/Mathlib/Algebra/Homology/Homotopy.lean +++ b/Mathlib/Algebra/Homology/Homotopy.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Homology.Linear -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Homology.Linear +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Tactic.Abel /-! # Chain homotopies @@ -13,6 +15,8 @@ import Mathlib.Tactic.Abel We define chain homotopies, and prove that homotopic chain maps induce the same map on homology. -/ +@[expose] public section + universe v u @@ -164,9 +168,7 @@ def symm {f g : C ⟶ D} (h : Homotopy f g) : Homotopy g f where def trans {e f g : C ⟶ D} (h : Homotopy e f) (k : Homotopy f g) : Homotopy e g where hom := h.hom + k.hom zero i j w := by rw [Pi.add_apply, Pi.add_apply, h.zero i j w, k.zero i j w, zero_add] - comm i := by - rw [AddMonoidHom.map_add, AddMonoidHom.map_add, h.comm, k.comm] - abel + comm i := by grind [Homotopy.comm] /-- the sum of two homotopies is a homotopy between the sum of the respective morphisms. -/ @[simps!] @@ -174,9 +176,7 @@ def add {f₁ g₁ f₂ g₂ : C ⟶ D} (h₁ : Homotopy f₁ g₁) (h₂ : Homo Homotopy (f₁ + f₂) (g₁ + g₂) where hom := h₁.hom + h₂.hom zero i j hij := by rw [Pi.add_apply, Pi.add_apply, h₁.zero i j hij, h₂.zero i j hij, add_zero] - comm i := by - simp only [HomologicalComplex.add_f_apply, h₁.comm, h₂.comm, AddMonoidHom.map_add] - abel + comm i := by grind [HomologicalComplex.add_f_apply, Homotopy.comm] /-- the scalar multiplication of an homotopy -/ @[simps!] diff --git a/Mathlib/Algebra/Homology/HomotopyCategory.lean b/Mathlib/Algebra/Homology/HomotopyCategory.lean index ec3bb010b4fd2d..a5dd78f34cc955 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.Algebra.Homology.Linear -import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy -import Mathlib.CategoryTheory.Quotient.Linear -import Mathlib.CategoryTheory.Quotient.Preadditive +module + +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.Algebra.Homology.Linear +public import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy +public import Mathlib.CategoryTheory.Quotient.Linear +public import Mathlib.CategoryTheory.Quotient.Preadditive /-! # The homotopy category @@ -16,6 +18,8 @@ import Mathlib.CategoryTheory.Quotient.Preadditive with chain maps identified when they are homotopic. -/ +@[expose] public section + universe v u noncomputable section diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean b/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean index ef8a657fb61232..6918863fceca6a 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated /-! # Degreewise split exact sequences of cochain complexes @@ -16,6 +18,8 @@ degreewise split short exact sequence of cochain complexes. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits Pretriangulated Preadditive diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean index ee07d323f58644..8d6e33e82967f7 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.Tactic.Linarith /-! The cochain complex of homomorphisms between cochain complexes @@ -32,6 +34,8 @@ We follow the signs conventions appearing in the introduction of -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits Preadditive diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean index 20852d174f983c..8d24794ae8c9ef 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex -import Mathlib.Algebra.Homology.HomotopyCategory.Shift -import Mathlib.Algebra.Module.Equiv.Basic +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex +public import Mathlib.Algebra.Homology.HomotopyCategory.Shift +public import Mathlib.Algebra.Module.Equiv.Basic /-! Shifting cochains @@ -28,6 +30,8 @@ appearing in the introduction of -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits Preadditive diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomologicalFunctor.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomologicalFunctor.lean index 589db46b75cf28..7869ddb5cfc234 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomologicalFunctor.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomologicalFunctor.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomologicalComplexAbelian -import Mathlib.Algebra.Homology.HomotopyCategory.DegreewiseSplit -import Mathlib.Algebra.Homology.HomologySequence -import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor +module + +public import Mathlib.Algebra.Homology.HomologicalComplexAbelian +public import Mathlib.Algebra.Homology.HomotopyCategory.DegreewiseSplit +public import Mathlib.Algebra.Homology.HomologySequence +public import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor /-! The homological functor @@ -19,6 +21,8 @@ sequence associated to a short exact sequence of homological complexes. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean b/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean index 46f0156a512a1c..2ceed113239c00 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex -import Mathlib.Algebra.Homology.HomotopyCofiber +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex +public import Mathlib.Algebra.Homology.HomotopyCofiber /-! # The mapping cone of a morphism of cochain complexes @@ -18,6 +20,8 @@ we redefine it as `CochainComplex.mappingCone φ`. The API involves definitions -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Limits @@ -536,7 +540,7 @@ lemma liftCochain_descCochain : lemma liftCochain_v_descCochain_v (p₁ p₂ p₃ : ℤ) (h₁₂ : p₁ + n = p₂) (h₂₃ : p₂ + n' = p₃) (q : ℤ) (hq : p₁ + m = q) : (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (descCochain φ α' β' h').v p₂ p₃ h₂₃ = - α.v p₁ q hq ≫ α'.v q p₃ (by cutsat) + β.v p₁ p₂ h₁₂ ≫ β'.v p₂ p₃ h₂₃ := by + α.v p₁ q hq ≫ α'.v q p₃ (by grind +revert) + β.v p₁ p₂ h₁₂ ≫ β'.v p₂ p₃ h₂₃ := by have eq := Cochain.congr_v (liftCochain_descCochain φ α β α' β' h h' p hp) p₁ p₃ (by cutsat) simpa only [Cochain.comp_v _ _ hp p₁ p₂ p₃ h₁₂ h₂₃, Cochain.add_v, Cochain.comp_v _ _ _ _ _ _ hq (show q + m' = p₃ by cutsat)] using eq diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean index c08f20e5881923..e3385de2052cb6 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.MappingCone -import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexShift -import Mathlib.CategoryTheory.Triangulated.Functor +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.MappingCone +public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexShift +public import Mathlib.CategoryTheory.Triangulated.Functor /-! The pretriangulated structure on the homotopy category of complexes @@ -30,6 +32,8 @@ complexes. Here, we follow the original definitions in [Verdiers's thesis, I.3][ -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits CochainComplex.HomComplex Pretriangulated diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean index 171308975c5bfe..29628a97f27178 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.CategoryTheory.Shift.Quotient -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Algebra.Homology.HomotopyCategory +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.CategoryTheory.Shift.Quotient +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.Tactic.Linarith /-! # The shift on cochain complexes and on the homotopy category @@ -22,6 +24,8 @@ We also show that if `F : C ⥤ D` is an additive functor, then the functors -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe v v' u u' @@ -231,14 +235,14 @@ def mapCochainComplexShiftIso (n : ℤ) : instance commShiftMapCochainComplex : (F.mapHomologicalComplex (ComplexShape.up ℤ)).CommShift ℤ where - iso := F.mapCochainComplexShiftIso - zero := by + commShiftIso := F.mapCochainComplexShiftIso + commShiftIso_zero := by ext rw [CommShift.isoZero_hom_app] dsimp simp only [CochainComplex.shiftFunctorZero_inv_app_f, CochainComplex.shiftFunctorZero_hom_app_f, HomologicalComplex.XIsoOfEq, eqToIso, eqToHom_map, eqToHom_trans, eqToHom_refl] - add := fun a b => by + commShiftIso_add := fun a b => by ext rw [CommShift.isoAdd_hom_app] dsimp diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/ShiftSequence.lean b/Mathlib/Algebra/Homology/HomotopyCategory/ShiftSequence.lean index 241c3033e3a1ab..2f64c54c54ed2e 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/ShiftSequence.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/ShiftSequence.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.InducedShiftSequence -import Mathlib.CategoryTheory.Shift.Localization -import Mathlib.Algebra.Homology.HomotopyCategory.Shift -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Algebra.Homology.QuasiIso +module + +public import Mathlib.CategoryTheory.Shift.InducedShiftSequence +public import Mathlib.CategoryTheory.Shift.Localization +public import Mathlib.Algebra.Homology.HomotopyCategory.Shift +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Algebra.Homology.QuasiIso /-! # Compatibilities of the homology functor with the shift @@ -19,6 +21,8 @@ and `HomotopyCategory` namespaces. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category ComplexShape Limits diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/ShortExact.lean b/Mathlib/Algebra/Homology/HomotopyCategory/ShortExact.lean index 068383c07235be..9e4f58ea223ab6 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/ShortExact.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/ShortExact.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor -import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence -import Mathlib.Algebra.Homology.HomologySequenceLemmas -import Mathlib.Algebra.Homology.Refinements +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor +public import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence +public import Mathlib.Algebra.Homology.HomologySequenceLemmas +public import Mathlib.Algebra.Homology.Refinements /-! # The mapping cone of a monomorphism, up to a quasi-isomophism @@ -20,6 +22,8 @@ distinguished triangle attached to the mapping cone of `S.f`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category ComplexShape HomotopyCategory Limits diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean b/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean index c02a1b34e48881..c154e4096270ed 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.Shift -import Mathlib.CategoryTheory.Shift.SingleFunctors +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.Shift +public import Mathlib.CategoryTheory.Shift.SingleFunctors /-! # Single functors from the homotopy category @@ -18,6 +20,8 @@ Similarly, we define -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe v' u' v u diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean index c991b5e0bc9075..2256b8d2925ed0 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated -import Mathlib.CategoryTheory.Triangulated.Triangulated -import Mathlib.CategoryTheory.ComposableArrows +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated +public import Mathlib.CategoryTheory.Triangulated.Triangulated +public import Mathlib.CategoryTheory.ComposableArrows.Basic /-! The triangulated structure on the homotopy category of complexes @@ -14,6 +16,8 @@ the pretriangulated category `HomotopyCategory C (ComplexShape.up ℤ)` is trian -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits Pretriangulated ComposableArrows diff --git a/Mathlib/Algebra/Homology/HomotopyCofiber.lean b/Mathlib/Algebra/Homology/HomotopyCofiber.lean index df398bf876d652..2d471b79668358 100644 --- a/Mathlib/Algebra/Homology/HomotopyCofiber.lean +++ b/Mathlib/Algebra/Homology/HomotopyCofiber.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomologicalComplexBiprod -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy +module + +public import Mathlib.Algebra.Homology.HomologicalComplexBiprod +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy /-! The homotopy cofiber of a morphism of homological complexes @@ -34,6 +36,8 @@ two homotopic maps are equal. -/ +@[expose] public section + open CategoryTheory Category Limits Preadditive diff --git a/Mathlib/Algebra/Homology/ImageToKernel.lean b/Mathlib/Algebra/Homology/ImageToKernel.lean index 17648736e62467..94227d6fadeb55 100644 --- a/Mathlib/Algebra/Homology/ImageToKernel.lean +++ b/Mathlib/Algebra/Homology/ImageToKernel.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.Limits +module + +public import Mathlib.CategoryTheory.Subobject.Limits /-! # Image-to-kernel comparison maps @@ -16,6 +18,8 @@ we have `image_le_kernel f g w : imageSubobject f ≤ kernelSubobject g` -/ +@[expose] public section + universe v u w open CategoryTheory CategoryTheory.Limits diff --git a/Mathlib/Algebra/Homology/LeftResolution/Basic.lean b/Mathlib/Algebra/Homology/LeftResolution/Basic.lean index 7d75de06670c76..a02ffef583d447 100644 --- a/Mathlib/Algebra/Homology/LeftResolution/Basic.lean +++ b/Mathlib/Algebra/Homology/LeftResolution/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.Algebra.Homology.ShortComplex.Abelian -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.Algebra.Homology.ShortComplex.Abelian +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex /-! # Left resolutions @@ -21,6 +23,8 @@ This shall be used in order to construct functorial flat resolutions. -/ +@[expose] public section + namespace CategoryTheory.Abelian open Category Limits Preadditive ZeroObject diff --git a/Mathlib/Algebra/Homology/LeftResolution/Reduced.lean b/Mathlib/Algebra/Homology/LeftResolution/Reduced.lean new file mode 100644 index 00000000000000..2ccab98e8783c7 --- /dev/null +++ b/Mathlib/Algebra/Homology/LeftResolution/Reduced.lean @@ -0,0 +1,128 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.Algebra.Homology.LeftResolution.Transport +public import Mathlib.CategoryTheory.Idempotents.FunctorExtension +public import Mathlib.CategoryTheory.MorphismProperty.Retract + +/-! +# Left resolutions which preserve the zero object + +The structure `LeftResolution` allows to define a functorial +resolution of an object (see `LeftResolution.chainComplexFunctor` +in the file `Algebra.Homology.LeftResolution.Basic`). In +order to extend this resolution to complexes, we not only +need the functoriality but also that zero morphisms +are sent to zero. In this file, given `ι : C ⥤ A`, +we extend `Λ : LeftResolution ι` to idempotent completions as +`Λ.karoubi : LeftResolution ((functorExtension₂ C A).obj ι)`, and +when both `C` and `A` are idempotent complete, we define +`Λ.reduced : LeftResolution ι` in such a way that the +functor `Λ.reduced.F : A ⥤ C` preserves zero morphisms. + +For example, if `A := ModuleCat R` and `C` is the full subcategory +of flat `R`-modules, we may first define `Λ` by using the +functor which sends an `R`-module `M` to the free `R`-module +on the elements of `M`. Then, `Λ.reduced.F.obj M` will be obtained +from the free `R`-module on `M` by factoring out the direct factor +corresponding to the submodule spanned by the generator corresponding +to `0 : M` (TODO). + +-/ + +@[expose] public section + +namespace CategoryTheory.Abelian + +variable {A C : Type*} [Category C] [Category A] {ι : C ⥤ A} + (Λ : LeftResolution ι) + +open Idempotents Limits MorphismProperty + +namespace LeftResolution + +variable [Preadditive C] [Preadditive A] [ι.Additive] + +/-- Auxiliary definition for `LeftResolution.karoubi`. -/ +@[simps] +def karoubi.F' : A ⥤ Karoubi C where + obj X := ⟨Λ.F.obj X, 𝟙 _ - Λ.F.map 0, by simp [← Functor.map_comp]⟩ + map {X Y} f := ⟨Λ.F.map f - Λ.F.map 0, by simp [← Functor.map_comp]⟩ + map_comp _ _ := by simp [← Functor.map_comp] + +/-- Auxiliary definition for `LeftResolution.karoubi`. -/ +@[simps!] +def karoubi.F : Karoubi A ⥤ Karoubi C := (functorExtension₁ A C).obj (karoubi.F' Λ) + +instance : (karoubi.F Λ).PreservesZeroMorphisms where + +/-- Auxiliary definition for `LeftResolution.karoubi`. -/ +@[simps] +def karoubi.π' : toKaroubi A ⋙ F Λ ⋙ (functorExtension₂ C A).obj ι ⟶ toKaroubi A where + app X := ⟨Λ.π.app X, by simp⟩ + +/-- The morphism `(karoubi.π' Λ).app X` is a retract of `(toKaroubi _).map (Λ.π.app X)`. -/ +def karoubi.retractArrow (X : A) : + RetractArrow ((karoubi.π' Λ).app X) ((toKaroubi _).map (Λ.π.app X)) where + i := Arrow.homMk ⟨ι.map ((karoubi.F' Λ).obj X).p, by simp [← Functor.map_comp]⟩ (𝟙 _) + r := Arrow.homMk ⟨ι.map ((karoubi.F' Λ).obj X).p, by simp [← Functor.map_comp]⟩ (𝟙 _) + retract := by + ext + · simp [← Functor.map_comp] + · simp + +instance (X : A) : Epi ((karoubi.π' Λ).app X) := + of_retract (P := epimorphisms _) (karoubi.retractArrow Λ X) + (epimorphisms.infer_property _) + +/-- Auxiliary definition for `LeftResolution.karoubi`. -/ +def karoubi.π : karoubi.F Λ ⋙ (functorExtension₂ C A).obj ι ⟶ 𝟭 (Karoubi A) := + whiskeringLeftObjToKaroubiFullyFaithful.preimage (karoubi.π' Λ) + +@[simp] +lemma karoubi.π_app_toKaroubi_obj (X : A) : + (karoubi.π Λ).app ((toKaroubi _).obj X) = (karoubi.π' Λ).app X := by + simp [π, whiskeringLeftObjToKaroubiFullyFaithful] + +instance (X : A) : Epi ((karoubi.π Λ).app ((toKaroubi _).obj X)) := by + rw [karoubi.π_app_toKaroubi_obj] + infer_instance + +instance (X : Karoubi A) : Epi ((karoubi.π Λ).app X) := + of_retract (P := epimorphisms _) (NatTrans.retractArrowApp (karoubi.π Λ) X.retract) + (epimorphisms.infer_property _) + +/-- Given `ι : C ⥤ A`, this is the extension of `Λ : LeftResolution ι` to +`LeftResolution ((functorExtension₂ C A).obj ι)`, where +`(functorExtension₂ C A).obj ι : Karoubi C ⥤ Karoubi A` is the extension of `ι`. -/ +@[simps] +noncomputable def karoubi : LeftResolution ((functorExtension₂ C A).obj ι) where + F := karoubi.F Λ + π := karoubi.π Λ + +instance : Λ.karoubi.F.PreservesZeroMorphisms where + +section + +variable [IsIdempotentComplete A] [IsIdempotentComplete C] + +/-- Given an additive functor `ι : C ⥤ A` between idempotent complete categories, +any `Λ : LeftResolution ι` induces a term `Λ.reduced : LeftResolution ι` +such that `Λ.reduced.F` preserves zero morphisms. -/ +noncomputable def reduced : LeftResolution ι := + Λ.karoubi.transport (toKaroubiEquivalence A) (toKaroubiEquivalence C) + ((karoubiUniversal₁ C A).unitIso.app _) + +instance : Λ.reduced.F.PreservesZeroMorphisms := by + dsimp [reduced, transport] + infer_instance + +end + +end LeftResolution + +end CategoryTheory.Abelian diff --git a/Mathlib/Algebra/Homology/LeftResolution/Transport.lean b/Mathlib/Algebra/Homology/LeftResolution/Transport.lean new file mode 100644 index 00000000000000..43155127a38f39 --- /dev/null +++ b/Mathlib/Algebra/Homology/LeftResolution/Transport.lean @@ -0,0 +1,60 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.Algebra.Homology.LeftResolution.Basic + +/-! +# Transport left resolutions along equivalences + +If `ι : C ⥤ A` is equipped with `Λ : LeftResolution ι` and +`ι' : C' ⥤ A'` is a functor which corresponds to `ι` via +equivalences of categories `A' ≌ A` and `C' ≌ C`, we +define `Λ.transport .. : LeftResolution ι'`. + +-/ + +@[expose] public section + +namespace CategoryTheory.Abelian + +open Category + +variable {A C : Type*} [Category C] [Category A] + {A' C' : Type*} [Category C'] [Category A'] + +namespace LeftResolution + +open Functor + +/-- Transport `LeftResolution` via equivalences of categories. -/ +def transport {ι : C ⥤ A} (Λ : LeftResolution ι) {ι' : C' ⥤ A'} + (eA : A' ≌ A) (eC : C' ≌ C) (e : ι' ⋙ eA.functor ≅ eC.functor ⋙ ι) : + LeftResolution ι' where + F := eA.functor ⋙ Λ.F ⋙ eC.inverse + π := (rightUnitor _).inv ≫ whiskerLeft _ eA.unitIso.hom ≫ + (associator _ _ _).hom ≫ whiskerLeft _ (associator _ _ _).inv ≫ + whiskerLeft _ (whiskerRight e.hom _) ≫ (associator _ _ _).inv ≫ + whiskerRight (associator _ _ _).inv _ ≫ + whiskerRight (whiskerRight (associator _ _ _).hom _) _ ≫ + whiskerRight (whiskerRight (whiskerLeft _ ((associator _ _ _).hom ≫ + whiskerLeft Λ.F eC.counitIso.hom ≫ Λ.F.rightUnitor.hom)) _) _ ≫ + (whiskerRight ((associator _ _ _).hom ≫ whiskerLeft _ Λ.π ≫ + (rightUnitor _).hom) _) ≫ eA.unitIso.inv + epi_π_app _ := by dsimp; infer_instance + +/-- If we have an isomorphism `e : G ⋙ ι' ≅ ι`, then any `Λ : LeftResolution ι` +induces `Λ.ofCompIso e : LeftResolution ι'`. -/ +def ofCompIso {ι : C ⥤ A} (Λ : LeftResolution ι) {ι' : C' ⥤ A} {G : C ⥤ C'} + (e : G ⋙ ι' ≅ ι) : + LeftResolution ι' where + F := Λ.F ⋙ G + π := (associator _ _ _).hom ≫ whiskerLeft _ e.hom ≫ Λ.π + epi_π_app _ := by dsimp; infer_instance + +end LeftResolution + +end CategoryTheory.Abelian diff --git a/Mathlib/Algebra/Homology/Linear.lean b/Mathlib/Algebra/Homology/Linear.lean index de6efcb8254fb6..0390b83d5bc933 100644 --- a/Mathlib/Algebra/Homology/Linear.lean +++ b/Mathlib/Algebra/Homology/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.CategoryTheory.Linear.LinearFunctor +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.CategoryTheory.Linear.LinearFunctor /-! # The category of homological complexes is linear @@ -19,6 +21,8 @@ for short complexes in `Mathlib/Algebra/Homology/ShortComplex/Linear.lean`) -/ +@[expose] public section + open CategoryTheory variable {R : Type*} [Semiring R] {C D : Type*} [Category C] [Preadditive C] diff --git a/Mathlib/Algebra/Homology/LocalCohomology.lean b/Mathlib/Algebra/Homology/LocalCohomology.lean index aa37a44d6dfb2a..4d0311a8919cab 100644 --- a/Mathlib/Algebra/Homology/LocalCohomology.lean +++ b/Mathlib/Algebra/Homology/LocalCohomology.lean @@ -3,14 +3,16 @@ Copyright (c) 2023 Emily Witt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Emily Witt, Kim Morrison, Jake Levinson, Sam van Gool -/ -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.Projective -import Mathlib.CategoryTheory.Abelian.Ext -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.RingTheory.Finiteness.Ideal -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.Noetherian.Defs +module + +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Projective +public import Mathlib.CategoryTheory.Abelian.Ext +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Ideal.Basic +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Noetherian.Defs /-! # Local cohomology. @@ -45,6 +47,8 @@ local cohomology, local cohomology modules * Establish long exact sequence(s) in local cohomology -/ +@[expose] public section + open Opposite diff --git a/Mathlib/Algebra/Homology/Localization.lean b/Mathlib/Algebra/Homology/Localization.lean index f5623647aa5d54..84c7495341a358 100644 --- a/Mathlib/Algebra/Homology/Localization.lean +++ b/Mathlib/Algebra/Homology/Localization.lean @@ -3,12 +3,13 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.HomotopyCofiber -import Mathlib.Algebra.Homology.HomotopyCategory -import Mathlib.Algebra.Homology.QuasiIso -import Mathlib.CategoryTheory.Localization.Composition -import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.Algebra.Homology.HomotopyCofiber +public import Mathlib.Algebra.Homology.HomotopyCategory +public import Mathlib.Algebra.Homology.QuasiIso +public import Mathlib.CategoryTheory.Localization.Composition +public import Mathlib.CategoryTheory.Localization.HasLocalization /-! The category of homological complexes up to quasi-isomorphisms @@ -25,6 +26,8 @@ the class of quasi-isomorphisms. -/ +@[expose] public section + open CategoryTheory Limits section diff --git a/Mathlib/Algebra/Homology/Monoidal.lean b/Mathlib/Algebra/Homology/Monoidal.lean index 1c0de7e8b2eac4..8277b973e19aac 100644 --- a/Mathlib/Algebra/Homology/Monoidal.lean +++ b/Mathlib/Algebra/Homology/Monoidal.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Kim Morrison -/ -import Mathlib.Algebra.Homology.BifunctorAssociator -import Mathlib.Algebra.Homology.Single -import Mathlib.CategoryTheory.GradedObject.Monoidal -import Mathlib.CategoryTheory.Monoidal.Transport +module + +public import Mathlib.Algebra.Homology.BifunctorAssociator +public import Mathlib.Algebra.Homology.Single +public import Mathlib.CategoryTheory.GradedObject.Monoidal +public import Mathlib.CategoryTheory.Monoidal.Transport /-! # The monoidal category structure on homological complexes @@ -22,6 +24,8 @@ In particular, we obtain a monoidal category structure on -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Limits MonoidalCategory Category diff --git a/Mathlib/Algebra/Homology/Opposite.lean b/Mathlib/Algebra/Homology/Opposite.lean index f4f44ae3d11b6d..a8e7f04181fc5d 100644 --- a/Mathlib/Algebra/Homology/Opposite.lean +++ b/Mathlib/Algebra/Homology/Opposite.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Amelia Livingston, Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.Opposite -import Mathlib.Algebra.Homology.Additive -import Mathlib.Algebra.Homology.ImageToKernel -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Algebra.Homology.QuasiIso +module + +public import Mathlib.CategoryTheory.Abelian.Opposite +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.Algebra.Homology.ImageToKernel +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Algebra.Homology.QuasiIso /-! # Opposite categories of complexes @@ -27,6 +29,8 @@ It is convenient to define both `op` and `opSymm`; this is because given a compl opposite, chain complex, cochain complex, homology, cohomology, homological complex -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Homology/QuasiIso.lean b/Mathlib/Algebra/Homology/QuasiIso.lean index e871785a0879c1..ef21b017374226 100644 --- a/Mathlib/Algebra/Homology/QuasiIso.lean +++ b/Mathlib/Algebra/Homology/QuasiIso.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.Algebra.Homology.ShortComplex.Retract -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.Algebra.Homology.ShortComplex.Retract +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Quasi-isomorphisms @@ -14,6 +16,8 @@ A chain map is a quasi-isomorphism if it induces isomorphisms on homology. -/ +@[expose] public section + open CategoryTheory Limits @@ -58,9 +62,7 @@ lemma quasiIsoAt_of_retract {f : K ⟶ L} {f' : K' ⟶ L'} [K'.HasHomology i] [L'.HasHomology i] [hf' : QuasiIsoAt f' i] : QuasiIsoAt f i := by rw [quasiIsoAt_iff] at hf' ⊢ - have : RetractArrow ((shortComplexFunctor C c i).map f) - ((shortComplexFunctor C c i).map f') := h.map (shortComplexFunctor C c i).mapArrow - exact ShortComplex.quasiIso_of_retract this + exact ShortComplex.quasiIso_of_retract (h.map (shortComplexFunctor C c i)) lemma quasiIsoAt_iff_isIso_homologyMap (f : K ⟶ L) (i : ι) [K.HasHomology i] [L.HasHomology i] : diff --git a/Mathlib/Algebra/Homology/Refinements.lean b/Mathlib/Algebra/Homology/Refinements.lean index a2c442807fce7b..718d0abfb692d7 100644 --- a/Mathlib/Algebra/Homology/Refinements.lean +++ b/Mathlib/Algebra/Homology/Refinements.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Abelian.Refinements -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.CategoryTheory.Abelian.Refinements +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex /-! # Refinements @@ -17,6 +18,8 @@ in the file `CategoryTheory.Abelian.Refinements`. -/ +@[expose] public section + open CategoryTheory variable {C ι : Type*} [Category C] [Abelian C] {c : ComplexShape ι} diff --git a/Mathlib/Algebra/Homology/ShortComplex/Ab.lean b/Mathlib/Algebra/Homology/ShortComplex/Ab.lean index 39c37eabd511e8..3c91b780d2d0e6 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Ab.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Ab.lean @@ -3,10 +3,13 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.Algebra.Category.Grp.Kernels -import Mathlib.Algebra.Exact +module + +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.Algebra.Category.Grp.Kernels +public import Mathlib.Algebra.Exact +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.GroupTheory.QuotientGroup.Finite /-! # Homology and exactness of short complexes of abelian groups @@ -27,6 +30,8 @@ is exact iff any element in the kernel of `S.g` belongs to the image of `S.f`. -/ +@[expose] public section + universe u namespace CategoryTheory @@ -121,6 +126,8 @@ lemma ab_exact_iff_function_exact : simp only [ab_zero_apply] · tauto +variable {S} + lemma ab_exact_iff_ker_le_range : S.Exact ↔ S.g.hom.ker ≤ S.f.hom.range := S.ab_exact_iff lemma ab_exact_iff_range_eq_ker : S.Exact ↔ S.f.hom.range = S.g.hom.ker := by @@ -134,7 +141,17 @@ lemma ab_exact_iff_range_eq_ker : S.Exact ↔ S.f.hom.range = S.g.hom.ker := by · intro h rw [h] -variable {S} +alias ⟨Exact.ab_range_eq_ker, _⟩ := ab_exact_iff_range_eq_ker + +/-- In an exact sequence of abelian groups, if the first and last groups are finite, then so is the +middle one. -/ +lemma Exact.ab_finite {S : ShortComplex Ab.{u}} (hS : S.Exact) [Finite S.X₁] [Finite S.X₃] : + Finite S.X₂ := by + have : Finite S.f.hom.range := Set.finite_range _ + have : Finite (S.X₂ ⧸ S.f.hom.range) := by + rw [hS.ab_range_eq_ker] + exact .of_equiv _ (QuotientAddGroup.quotientKerEquivRange _).toEquiv.symm + exact .of_addSubgroup_quotient (H := S.f.hom.range) lemma ShortExact.ab_injective_f (hS : S.ShortExact) : Function.Injective S.f := @@ -144,12 +161,15 @@ lemma ShortExact.ab_surjective_g (hS : S.ShortExact) : Function.Surjective S.g := (AddCommGrpCat.epi_iff_surjective _).1 hS.epi_g -variable (S) +/-- In a short exact sequence of abelian groups, the middle group is finite iff the first and last +are. -/ +lemma ShortExact.ab_finite_iff {S : ShortComplex Ab.{u}} (hS : S.ShortExact) : + Finite S.X₂ ↔ Finite S.X₁ ∧ Finite S.X₃ where + mp _ := ⟨.of_injective _ hS.ab_injective_f, .of_surjective _ hS.ab_surjective_g⟩ + mpr | ⟨_, _⟩ => hS.exact.ab_finite -lemma ShortExact.ab_exact_iff_function_exact : - S.Exact ↔ Function.Exact S.f S.g := by - rw [ab_exact_iff_range_eq_ker, AddMonoidHom.exact_iff] - tauto +@[deprecated (since := "2025-11-03")] +protected alias ShortExact.ab_exact_iff_function_exact := ab_exact_iff_function_exact end ShortComplex diff --git a/Mathlib/Algebra/Homology/ShortComplex/Abelian.lean b/Mathlib/Algebra/Homology/ShortComplex/Abelian.lean index 806aabbe913404..56759f82a449c4 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Abelian.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Abelian.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.Homology -import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.Algebra.Homology.ShortComplex.Homology +public import Mathlib.CategoryTheory.Abelian.Basic /-! # Abelian categories have homology @@ -25,6 +26,8 @@ coimage-image isomorphism in abelian categories. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/Algebra/Homology/ShortComplex/Basic.lean b/Mathlib/Algebra/Homology/ShortComplex/Basic.lean index 5de4f497910949..d4967258d11dc7 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Basic.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero /-! # Short complexes @@ -16,6 +18,8 @@ the Liquid Tensor Experiment. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/ConcreteCategory.lean b/Mathlib/Algebra/Homology/ShortComplex/ConcreteCategory.lean index 7bbabbd2b3a1cc..9d1c9129b87262 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/ConcreteCategory.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/ConcreteCategory.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Ab -import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor -import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma -import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory +module + +public import Mathlib.Algebra.Homology.ShortComplex.Ab +public import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor +public import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma +public import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory /-! # Exactness of short complexes in concrete abelian categories @@ -17,6 +19,8 @@ if and only if it is so after applying the functor `forget₂ C Ab`. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/Algebra/Homology/ShortComplex/Exact.lean b/Mathlib/Algebra/Homology/ShortComplex/Exact.lean index e53f58b11fabdf..bebd4d12e68a6e 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Exact.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Exact.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology -import Mathlib.Algebra.Homology.ShortComplex.Abelian -import Mathlib.Algebra.Homology.ShortComplex.QuasiIso -import Mathlib.CategoryTheory.Abelian.Opposite -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Preadditive.Injective.Basic +module + +public import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology +public import Mathlib.Algebra.Homology.ShortComplex.Abelian +public import Mathlib.Algebra.Homology.ShortComplex.QuasiIso +public import Mathlib.CategoryTheory.Abelian.Opposite +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic /-! # Exact short complexes @@ -24,6 +26,8 @@ see `Exact.op` and `Exact.unop`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits ZeroObject Preadditive @@ -539,11 +543,7 @@ noncomputable def leftHomologyData [HasZeroObject C] (s : S.Splitting) : sub_eq_self, reassoc_of% hx, zero_comp]) (fun x _ b hb => by simp only [← hb, assoc, f_r, comp_id]) let f' := hi.lift (KernelFork.ofι S.f S.zero) - have hf' : f' = 𝟙 _ := by - apply Fork.IsLimit.hom_ext hi - dsimp - erw [Fork.IsLimit.lift_ι hi] - simp only [Fork.ι_ofι, id_comp] + have hf' : f' = 𝟙 _ := by simp [f'] have wπ : f' ≫ (0 : S.X₁ ⟶ 0) = 0 := comp_zero have hπ : IsColimit (CokernelCofork.ofπ 0 wπ) := CokernelCofork.IsColimit.ofEpiOfIsZero _ (by rw [hf']; infer_instance) (isZero_zero _) diff --git a/Mathlib/Algebra/Homology/ShortComplex/ExactFunctor.lean b/Mathlib/Algebra/Homology/ShortComplex/ExactFunctor.lean index 3afb0951d6c3c0..c41ef43328f08e 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/ExactFunctor.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/ExactFunctor.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Jujian Zhang -/ -import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.Algebra.Homology.ShortComplex.Abelian -import Mathlib.CategoryTheory.Preadditive.LeftExact -import Mathlib.CategoryTheory.Abelian.Exact +module + +public import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.Algebra.Homology.ShortComplex.Abelian +public import Mathlib.CategoryTheory.Preadditive.LeftExact +public import Mathlib.CategoryTheory.Abelian.Exact /-! # Exact functors @@ -51,6 +53,8 @@ If we further assume that `C` and `D` are abelian categories, then we have: -/ +@[expose] public section + namespace CategoryTheory open Limits ZeroObject ShortComplex diff --git a/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean b/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean index 15a90653ba4433..28dba65cb421ff 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Basic +module + +public import Mathlib.Algebra.Homology.ShortComplex.Basic /-! # Short complexes in functor categories @@ -14,6 +16,8 @@ that `C` has zero morphisms), then there is an equivalence of categories -/ +@[expose] public section + namespace CategoryTheory open Limits Functor diff --git a/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean b/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean index 410c9d12e87620..b70883623353b6 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.Algebra.Homology.ShortComplex.Preadditive -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.Algebra.Homology.ShortComplex.Preadditive +public import Mathlib.Tactic.Linarith /-! # The short complexes attached to homological complexes @@ -22,6 +24,8 @@ abbreviated as `K.sc i`. -/ +@[expose] public section + open CategoryTheory Category Limits namespace HomologicalComplex diff --git a/Mathlib/Algebra/Homology/ShortComplex/Homology.lean b/Mathlib/Algebra/Homology/ShortComplex/Homology.lean index 7ddc33c1507cc2..9e6e894cf682a7 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Homology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Homology.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.RightHomology +public import Mathlib.Algebra.Homology.ShortComplex.RightHomology /-! # Homology of short complexes @@ -31,6 +32,8 @@ such a structure could be used as a basis for the *definition* of homology. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean index 96ad4a0fed3dc3..e9643333f7a41d 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.Algebra.Homology.ShortComplex.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! # Left Homology of short complexes @@ -29,6 +30,8 @@ and `S.homology`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/Limits.lean b/Mathlib/Algebra/Homology/ShortComplex/Limits.lean index a8946c6f93022c..bad65b20159f97 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Limits.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Limits.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Basic -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Preserves.Finite +module + +public import Mathlib.Algebra.Homology.ShortComplex.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of short complexes @@ -16,6 +18,8 @@ of a certain shape `J`, then it is also the case of the category `ShortComplex C -/ +@[expose] public section + namespace CategoryTheory open Category Limits Functor diff --git a/Mathlib/Algebra/Homology/ShortComplex/Linear.lean b/Mathlib/Algebra/Homology/ShortComplex/Linear.lean index 7d76eeebfd50b8..328d8592eaf833 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Linear.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Preadditive -import Mathlib.CategoryTheory.Linear.LinearFunctor +module + +public import Mathlib.Algebra.Homology.ShortComplex.Preadditive +public import Mathlib.CategoryTheory.Linear.LinearFunctor /-! # Homology of linear categories @@ -15,6 +17,8 @@ are also shown to be linear. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/ModuleCat.lean b/Mathlib/Algebra/Homology/ShortComplex/ModuleCat.lean index 58b64293ea0b16..071951f4a94615 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/ModuleCat.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/ModuleCat.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory -import Mathlib.Algebra.Category.ModuleCat.Colimits +module + +public import Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory +public import Mathlib.Algebra.Category.ModuleCat.Colimits /-! # Homology and exactness of short complexes of modules @@ -15,6 +17,8 @@ with the quotient of `LinearMap.ker S.g` by the image of the morphism -/ +@[expose] public section + universe v u variable {R : Type u} [Ring R] diff --git a/Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean b/Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean index 83532e5e699910..581779cd987c36 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Homology -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Preadditive.Opposite +module + +public import Mathlib.Algebra.Homology.ShortComplex.Homology +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Preadditive.Opposite /-! # Homology of preadditive categories @@ -15,6 +17,8 @@ In this file, it is shown that if `C` is a preadditive category, then -/ +@[expose] public section + namespace CategoryTheory open Category Limits Preadditive diff --git a/Mathlib/Algebra/Homology/ShortComplex/PreservesHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/PreservesHomology.lean index 0450a0b845370a..eb68a509223a31 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/PreservesHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/PreservesHomology.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.QuasiIso -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +public import Mathlib.Algebra.Homology.ShortComplex.QuasiIso +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels /-! # Functors which preserves homology @@ -23,6 +24,8 @@ is part of the natural isomorphism `homologyFunctorIso F` between the functors -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean b/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean index 060f915f097a53..4d74226954f4c9 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.Homology +public import Mathlib.Algebra.Homology.ShortComplex.Homology /-! # Quasi-isomorphisms of short complexes @@ -15,6 +16,8 @@ morphism `homologyMap φ` in homology is an isomorphism. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/Retract.lean b/Mathlib/Algebra/Homology/ShortComplex/Retract.lean index 6a83271823fd11..a4f92814a265c3 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Retract.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Retract.lean @@ -3,15 +3,18 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.QuasiIso -import Mathlib.CategoryTheory.MorphismProperty.Retract +public import Mathlib.Algebra.Homology.ShortComplex.QuasiIso +public import Mathlib.CategoryTheory.MorphismProperty.Retract /-! # Quasi-isomorphisms of short complexes are stable under retracts -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean index 7274b0d47b5c93..659791ae7f93ec 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Homology.ShortComplex.LeftHomology -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Kernels +public import Mathlib.Algebra.Homology.ShortComplex.LeftHomology +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Kernels /-! # Right Homology of short complexes @@ -27,6 +28,8 @@ In `Homology.lean`, when `S` has two compatible left and right homology data -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/ShortComplex/ShortExact.lean b/Mathlib/Algebra/Homology/ShortComplex/ShortExact.lean index 26e0b933d82822..5be291aae384c8 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/ShortExact.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/ShortExact.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.CategoryTheory.Preadditive.Injective.Basic +module + +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic /-! # Short exact short complexes @@ -14,6 +16,8 @@ A short complex `S : ShortComplex C` is short exact (`S.ShortExact`) when it is -/ +@[expose] public section + namespace CategoryTheory open Category Limits ZeroObject diff --git a/Mathlib/Algebra/Homology/ShortComplex/SnakeLemma.lean b/Mathlib/Algebra/Homology/ShortComplex/SnakeLemma.lean index 58f7cf3f80bdcb..9fe3cb59f18887 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/SnakeLemma.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/SnakeLemma.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ExactSequence -import Mathlib.Algebra.Homology.ShortComplex.Limits -import Mathlib.CategoryTheory.Abelian.Refinements +module + +public import Mathlib.Algebra.Homology.ExactSequence +public import Mathlib.Algebra.Homology.ShortComplex.Limits +public import Mathlib.CategoryTheory.Abelian.Refinements /-! # The snake lemma @@ -45,6 +47,8 @@ the other half by arguing in the opposite category), and the use of "refinements -/ +@[expose] public section + namespace CategoryTheory open Category Limits Preadditive diff --git a/Mathlib/Algebra/Homology/Single.lean b/Mathlib/Algebra/Homology/Single.lean index 7c78d117083b85..d402c719905faf 100644 --- a/Mathlib/Algebra/Homology/Single.lean +++ b/Mathlib/Algebra/Homology/Single.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Homology.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.HomologicalComplex /-! # Homological complexes supported in a single degree @@ -19,6 +21,8 @@ an augmented exact complex of projectives.) -/ +@[expose] public section + open CategoryTheory Category Limits ZeroObject universe v u diff --git a/Mathlib/Algebra/Homology/SingleHomology.lean b/Mathlib/Algebra/Homology/SingleHomology.lean index ad3cb61fb37010..b586a7c0762586 100644 --- a/Mathlib/Algebra/Homology/SingleHomology.lean +++ b/Mathlib/Algebra/Homology/SingleHomology.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Single -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +module + +public import Mathlib.Algebra.Homology.Single +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex /-! # The homology of single complexes @@ -13,6 +15,8 @@ which is a natural isomorphism `single C c j ⋙ homologyFunctor C c j ≅ 𝟭 -/ +@[expose] public section + universe v u open CategoryTheory Category Limits ZeroObject diff --git a/Mathlib/Algebra/Homology/Square.lean b/Mathlib/Algebra/Homology/Square.lean index 774d7fff375139..c26606ac039306 100644 --- a/Mathlib/Algebra/Homology/Square.lean +++ b/Mathlib/Algebra/Homology/Square.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Square +module + +public import Mathlib.Algebra.Homology.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Square /-! # Relation between pullback/pushout squares and kernel/cokernel sequences @@ -14,6 +16,8 @@ The same results are obtained here for squares `sq : Square C` where `C` is an additive category. -/ + +@[expose] public section namespace CategoryTheory open Category Limits diff --git a/Mathlib/Algebra/Homology/TotalComplex.lean b/Mathlib/Algebra/Homology/TotalComplex.lean index 575e571cb1ac19..6c29787d34cdee 100644 --- a/Mathlib/Algebra/Homology/TotalComplex.lean +++ b/Mathlib/Algebra/Homology/TotalComplex.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.Algebra.Homology.ComplexShapeSigns -import Mathlib.Algebra.Homology.HomologicalBicomplex -import Mathlib.Algebra.Module.Basic +module + +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.Algebra.Homology.ComplexShapeSigns +public import Mathlib.Algebra.Homology.HomologicalBicomplex +public import Mathlib.Algebra.Module.Basic /-! # The total complex of a bicomplex @@ -25,6 +27,8 @@ differentials `(K.X p).X q ⟶ (K.X p).X (q + 1)`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category Limits Preadditive diff --git a/Mathlib/Algebra/Homology/TotalComplexShift.lean b/Mathlib/Algebra/Homology/TotalComplexShift.lean index 05ca61967b97b0..b218b0c9c67b00 100644 --- a/Mathlib/Algebra/Homology/TotalComplexShift.lean +++ b/Mathlib/Algebra/Homology/TotalComplexShift.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.HomotopyCategory.Shift -import Mathlib.Algebra.Homology.TotalComplex +module + +public import Mathlib.Algebra.Homology.HomotopyCategory.Shift +public import Mathlib.Algebra.Homology.TotalComplex /-! # Behaviour of the total complex with respect to shifts @@ -33,6 +35,8 @@ these two compositions of isomorphisms differ by the sign `(x * y).negOnePow`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Category ComplexShape Limits diff --git a/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean b/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean index 055aafaffef784..8cdbfd98887171 100644 --- a/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean +++ b/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.TotalComplex +module + +public import Mathlib.Algebra.Homology.TotalComplex /-! The symmetry of the total complex of a bicomplex @@ -20,6 +22,8 @@ are compatible `[TotalComplexShapeSymmetrySymmetry c₁ c₂ c]`, then the isomo -/ +@[expose] public section + assert_not_exists Ideal TwoSidedIdeal open CategoryTheory Category Limits diff --git a/Mathlib/Algebra/IsPrimePow.lean b/Mathlib/Algebra/IsPrimePow.lean index b214305a96c43f..e629c55de51868 100644 --- a/Mathlib/Algebra/IsPrimePow.lean +++ b/Mathlib/Algebra/IsPrimePow.lean @@ -3,17 +3,21 @@ Copyright (c) 2022 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Order.Nat -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.Nat.Log -import Mathlib.Data.Nat.Prime.Pow +module + +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Order.Nat +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Data.Nat.Log +public import Mathlib.Data.Nat.Prime.Pow /-! # Prime powers This file deals with prime powers: numbers which are positive integer powers of a single prime. -/ + +@[expose] public section assert_not_exists Nat.divisors variable {R : Type*} [CommMonoidWithZero R] (n p : R) (k : ℕ) diff --git a/Mathlib/Algebra/Jordan/Basic.lean b/Mathlib/Algebra/Jordan/Basic.lean index 7a7f365c2cc807..ec28c2bd0ed857 100644 --- a/Mathlib/Algebra/Jordan/Basic.lean +++ b/Mathlib/Algebra/Jordan/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Lie.OfAssociative +module + +public import Mathlib.Algebra.Lie.OfAssociative /-! # Jordan rings @@ -71,6 +73,8 @@ Non-commutative Jordan algebras have connections to the Vidav-Palmer theorem -/ +@[expose] public section + variable (A : Type*) diff --git a/Mathlib/Algebra/Lie/Abelian.lean b/Mathlib/Algebra/Lie/Abelian.lean index 6544cab357bacf..0fada37d1c93ca 100644 --- a/Mathlib/Algebra/Lie/Abelian.lean +++ b/Mathlib/Algebra/Lie/Abelian.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Lie.IdealOperations +module + +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.IdealOperations /-! # Trivial Lie modules and Abelian Lie algebras @@ -29,6 +31,8 @@ In this file we define these concepts and provide some related definitions and r lie algebra, abelian, commutative, center -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/BaseChange.lean b/Mathlib/Algebra/Lie/BaseChange.lean index 3637f4c92c0e60..ab75d6e1c5105a 100644 --- a/Mathlib/Algebra/Lie/BaseChange.lean +++ b/Mathlib/Algebra/Lie/BaseChange.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.Algebra.Lie.TensorProduct +module + +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.Algebra.Lie.TensorProduct /-! # Extension and restriction of scalars for Lie algebras and Lie modules @@ -23,6 +25,8 @@ scalars. lie ring, lie algebra, extension of scalars, restriction of scalars, base change -/ +@[expose] public section + open scoped TensorProduct variable (R A L M : Type*) @@ -88,14 +92,9 @@ private theorem bracket_leibniz_lie (x y : A ⊗[R] L) (z : A ⊗[R] M) : · simp only [LinearMap.map_zero, add_zero] · intro a₃ l₃; simp only [bracket'_tmul] rw [mul_left_comm a₂ a₁ a₃, mul_assoc, leibniz_lie, TensorProduct.tmul_add] - · intro u₁ u₂ h₁ h₂ - rw [map_add, map_add, map_add, map_add, map_add, h₁, h₂, add_add_add_comm] - · intro u₁ u₂ h₁ h₂ - rw [map_add, LinearMap.add_apply, LinearMap.add_apply, map_add, map_add, map_add, - LinearMap.add_apply, h₁, h₂, add_add_add_comm] - · intro u₁ u₂ h₁ h₂ - rw [map_add, LinearMap.add_apply, LinearMap.add_apply, map_add, map_add, LinearMap.add_apply, - map_add, LinearMap.add_apply, h₁, h₂, add_add_add_comm] + · grind + · grind [LinearMap.add_apply] + · grind [LinearMap.add_apply] instance instLieRing : LieRing (A ⊗[R] L) where add_lie x y z := by simp only [bracket_def, LinearMap.add_apply, LinearMap.map_add] diff --git a/Mathlib/Algebra/Lie/Basic.lean b/Mathlib/Algebra/Lie/Basic.lean index 6b570e41e31d40..2270f57c2e1785 100644 --- a/Mathlib/Algebra/Lie/Basic.lean +++ b/Mathlib/Algebra/Lie/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Module.Submodule.Equiv -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.Rat -import Mathlib.Data.Bracket -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Module.Submodule.Equiv +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Data.Bracket +public import Mathlib.Tactic.Abel /-! # Lie algebras @@ -47,6 +49,8 @@ are partially unbundled. lie bracket, jacobi identity, lie ring, lie algebra, lie module -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/CartanExists.lean b/Mathlib/Algebra/Lie/CartanExists.lean index c06e1c48491cc4..e36fe885270f5a 100644 --- a/Mathlib/Algebra/Lie/CartanExists.lean +++ b/Mathlib/Algebra/Lie/CartanExists.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ +module -import Mathlib.Algebra.Lie.CartanSubalgebra -import Mathlib.Algebra.Lie.Rank +public import Mathlib.Algebra.Lie.CartanSubalgebra +public import Mathlib.Algebra.Lie.Rank /-! # Existence of Cartan subalgebras @@ -27,6 +28,8 @@ following [barnes1967]. -/ +@[expose] public section + namespace LieAlgebra section CommRing diff --git a/Mathlib/Algebra/Lie/CartanMatrix.lean b/Mathlib/Algebra/Lie/CartanMatrix.lean index 9e06cf1a505975..670aeec234189d 100644 --- a/Mathlib/Algebra/Lie/CartanMatrix.lean +++ b/Mathlib/Algebra/Lie/CartanMatrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Free -import Mathlib.Algebra.Lie.Quotient -import Mathlib.LinearAlgebra.Matrix.Notation +module + +public import Mathlib.Algebra.Lie.Free +public import Mathlib.Algebra.Lie.Quotient +public import Mathlib.LinearAlgebra.Matrix.Notation /-! # Lie algebras from Cartan matrices @@ -78,6 +80,8 @@ exceptional semisimple Lie algebras. lie algebra, semi-simple, cartan matrix -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Lie/CartanSubalgebra.lean b/Mathlib/Algebra/Lie/CartanSubalgebra.lean index 234bcfa6a066ca..edcb3343555956 100644 --- a/Mathlib/Algebra/Lie/CartanSubalgebra.lean +++ b/Mathlib/Algebra/Lie/CartanSubalgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Nilpotent -import Mathlib.Algebra.Lie.Normalizer +module + +public import Mathlib.Algebra.Lie.Nilpotent +public import Mathlib.Algebra.Lie.Normalizer /-! # Cartan subalgebras @@ -23,6 +25,8 @@ The standard example is the set of diagonal matrices in the Lie algebra of matri lie subalgebra, normalizer, idealizer, cartan subalgebra -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/Character.lean b/Mathlib/Algebra/Lie/Character.lean index 5d3ea02bbdf9fc..d44e8fa9d1d2b9 100644 --- a/Mathlib/Algebra/Lie/Character.lean +++ b/Mathlib/Algebra/Lie/Character.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Abelian -import Mathlib.Algebra.Lie.Solvable -import Mathlib.LinearAlgebra.Dual.Defs +module + +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.Algebra.Lie.Solvable +public import Mathlib.LinearAlgebra.Dual.Defs /-! # Characters of Lie algebras @@ -24,6 +26,8 @@ algebra (e.g., a Cartan subalgebra of a semisimple Lie algebra) a character is j lie algebra, lie character -/ +@[expose] public section + universe u v w w₁ diff --git a/Mathlib/Algebra/Lie/Classical.lean b/Mathlib/Algebra/Lie/Classical.lean index 571493849a3c04..d611ac449a6496 100644 --- a/Mathlib/Algebra/Lie/Classical.lean +++ b/Mathlib/Algebra/Lie/Classical.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.DMatrix -import Mathlib.Algebra.Lie.Abelian -import Mathlib.LinearAlgebra.Matrix.Trace -import Mathlib.Algebra.Lie.SkewAdjoint -import Mathlib.LinearAlgebra.SymplecticGroup +module + +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.DMatrix +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.LinearAlgebra.Matrix.Trace +public import Mathlib.Algebra.Lie.SkewAdjoint +public import Mathlib.LinearAlgebra.SymplecticGroup /-! # Classical Lie algebras @@ -63,6 +65,8 @@ definitions are equivalent. Similarly for the algebras of type `B`. classical lie algebra, special linear, symplectic, orthogonal -/ +@[expose] public section + universe u₁ u₂ @@ -233,8 +237,7 @@ theorem soIndefiniteEquiv_apply {i : R} (hi : i * i = -1) (A : so' p q R) : (soIndefiniteEquiv p q R hi A : Matrix (p ⊕ q) (p ⊕ q) R) = (Pso p q R i)⁻¹ * (A : Matrix (p ⊕ q) (p ⊕ q) R) * Pso p q R i := by rw [soIndefiniteEquiv, LieEquiv.trans_apply, LieEquiv.ofEq_apply] - -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 - erw [skewAdjointMatricesLieSubalgebraEquiv_apply] + grind [skewAdjointMatricesLieSubalgebraEquiv_apply] /-- A matrix defining a canonical even-rank symmetric bilinear form. diff --git a/Mathlib/Algebra/Lie/Cochain.lean b/Mathlib/Algebra/Lie/Cochain.lean index 55e2701f4f3736..83486d77d71245 100644 --- a/Mathlib/Algebra/Lie/Cochain.lean +++ b/Mathlib/Algebra/Lie/Cochain.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Lie.Abelian +module + +public import Mathlib.Algebra.Lie.Abelian /-! # Lie algebra cohomology in low degree @@ -28,6 +30,8 @@ general theory of Lie algebra cohomology. -/ +@[expose] public section + namespace LieModule.Cohomology variable (R : Type*) [CommRing R] diff --git a/Mathlib/Algebra/Lie/Derivation/AdjointAction.lean b/Mathlib/Algebra/Lie/Derivation/AdjointAction.lean index c960d0e005a95d..e8b2cd9cc6b5d2 100644 --- a/Mathlib/Algebra/Lie/Derivation/AdjointAction.lean +++ b/Mathlib/Algebra/Lie/Derivation/AdjointAction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Frédéric Marbach. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Marbach -/ -import Mathlib.Algebra.Lie.Abelian -import Mathlib.Algebra.Lie.Derivation.Basic -import Mathlib.Algebra.Lie.OfAssociative +module + +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.Algebra.Lie.Derivation.Basic +public import Mathlib.Algebra.Lie.OfAssociative /-! # Adjoint action of a Lie algebra on itself @@ -28,6 +30,8 @@ values in the endormophisms of `L`. derivations. -/ +@[expose] public section + namespace LieDerivation section AdjointAction diff --git a/Mathlib/Algebra/Lie/Derivation/Basic.lean b/Mathlib/Algebra/Lie/Derivation/Basic.lean index 5295f9ff2829d6..81fd2c783ad983 100644 --- a/Mathlib/Algebra/Lie/Derivation/Basic.lean +++ b/Mathlib/Algebra/Lie/Derivation/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Frédéric Marbach. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Marbach -/ -import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Lie.Subalgebra -import Mathlib.RingTheory.Nilpotent.Exp -import Mathlib.RingTheory.Noetherian.Basic +module + +public import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.Subalgebra +public import Mathlib.RingTheory.Nilpotent.Exp +public import Mathlib.RingTheory.Noetherian.Basic /-! # Lie derivations @@ -36,6 +38,8 @@ the `RingTheory.Derivation.Basic.lean` file. as `- [b, D a]`. Within Lie algebras, skew symmetry restores the expected definition `[D a, b]`. -/ +@[expose] public section + /-- A Lie derivation `D` from the Lie `R`-algebra `L` to the `L`-module `M` is an `R`-linear map that satisfies the Leibniz rule `D [a, b] = [a, D b] - [b, D a]`. -/ structure LieDerivation (R L M : Type*) [CommRing R] [LieRing L] [LieAlgebra R L] diff --git a/Mathlib/Algebra/Lie/Derivation/Killing.lean b/Mathlib/Algebra/Lie/Derivation/Killing.lean index 49006f10b65c64..349b027f975985 100644 --- a/Mathlib/Algebra/Lie/Derivation/Killing.lean +++ b/Mathlib/Algebra/Lie/Derivation/Killing.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Frédéric Marbach. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Marbach -/ -import Mathlib.Algebra.Lie.Derivation.AdjointAction -import Mathlib.Algebra.Lie.Killing -import Mathlib.LinearAlgebra.BilinearForm.Orthogonal +module + +public import Mathlib.Algebra.Lie.Derivation.AdjointAction +public import Mathlib.Algebra.Lie.Killing +public import Mathlib.LinearAlgebra.BilinearForm.Orthogonal /-! # Derivations of finite-dimensional Killing Lie algebras @@ -23,6 +25,8 @@ Killing form, the range of the adjoint action is full, Killing form, any derivation is an inner derivation. -/ +@[expose] public section + namespace LieDerivation.IsKilling section diff --git a/Mathlib/Algebra/Lie/DirectSum.lean b/Mathlib/Algebra/Lie/DirectSum.lean index 238f119db8ff42..cd8423431e6c9d 100644 --- a/Mathlib/Algebra/Lie/DirectSum.lean +++ b/Mathlib/Algebra/Lie/DirectSum.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Lie.Ideal -import Mathlib.Algebra.Lie.Basic +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.Ideal +public import Mathlib.Algebra.Lie.Basic /-! # Direct sums of Lie algebras and Lie modules @@ -18,6 +20,8 @@ Direct sums of Lie algebras and Lie modules carry natural algebra and module str lie algebra, lie module, direct sum -/ +@[expose] public section + universe u v w w₁ diff --git a/Mathlib/Algebra/Lie/Engel.lean b/Mathlib/Algebra/Lie/Engel.lean index 2eab6636cfff87..40c531daad0b0d 100644 --- a/Mathlib/Algebra/Lie/Engel.lean +++ b/Mathlib/Algebra/Lie/Engel.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Nilpotent -import Mathlib.Algebra.Lie.Normalizer +module + +public import Mathlib.Algebra.Lie.Nilpotent +public import Mathlib.Algebra.Lie.Normalizer /-! # Engel's theorem @@ -64,6 +66,8 @@ into a single statement about nilpotency of Lie modules. This is not usually emp -/ +@[expose] public section + universe u₁ u₂ u₃ u₄ diff --git a/Mathlib/Algebra/Lie/EngelSubalgebra.lean b/Mathlib/Algebra/Lie/EngelSubalgebra.lean index f925ebd6087b61..831001f70b6c37 100644 --- a/Mathlib/Algebra/Lie/EngelSubalgebra.lean +++ b/Mathlib/Algebra/Lie/EngelSubalgebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Lie.Engel -import Mathlib.Algebra.Lie.Normalizer -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Lie.Subalgebra -import Mathlib.Data.Finset.NatAntidiagonal +module + +public import Mathlib.Algebra.Lie.Engel +public import Mathlib.Algebra.Lie.Normalizer +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.Subalgebra +public import Mathlib.Data.Finset.NatAntidiagonal /-! # Engel subalgebras @@ -30,6 +32,8 @@ and minimal ones are nilpotent (TODO), hence Cartan subalgebras. if it is contained in the Engel subalgebra of all its elements. -/ +@[expose] public section + open LieAlgebra LieModule variable {R L M : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] diff --git a/Mathlib/Algebra/Lie/Extension.lean b/Mathlib/Algebra/Lie/Extension.lean index 238acdf89e438b..a8aee2349d8d3e 100644 --- a/Mathlib/Algebra/Lie/Extension.lean +++ b/Mathlib/Algebra/Lie/Extension.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Exact -import Mathlib.Algebra.Lie.Cochain -import Mathlib.Algebra.Module.TransferInstance +module + +public import Mathlib.Algebra.Exact +public import Mathlib.Algebra.Lie.Cochain +public import Mathlib.Algebra.Module.TransferInstance /-! # Extensions of Lie algebras @@ -37,6 +39,8 @@ change of signs in the "action" part of the Lie bracket. -/ +@[expose] public section + namespace LieAlgebra variable {R N L M : Type*} diff --git a/Mathlib/Algebra/Lie/Free.lean b/Mathlib/Algebra/Lie/Free.lean index 01b7aff6a35b07..6b79db692d4189 100644 --- a/Mathlib/Algebra/Lie/Free.lean +++ b/Mathlib/Algebra/Lie/Free.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra -import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra -import Mathlib.Algebra.Lie.UniversalEnveloping -import Mathlib.GroupTheory.GroupAction.Ring +module + +public import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra +public import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra +public import Mathlib.Algebra.Lie.UniversalEnveloping +public import Mathlib.GroupTheory.GroupAction.Ring /-! # Free Lie algebras @@ -48,6 +50,8 @@ lie algebra, free algebra, non-unital, non-associative, universal property, forg adjoint functor -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Lie/Ideal.lean b/Mathlib/Algebra/Lie/Ideal.lean index c42bbcb281c319..98838eefaddaa6 100644 --- a/Mathlib/Algebra/Lie/Ideal.lean +++ b/Mathlib/Algebra/Lie/Ideal.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Submodule +module + +public import Mathlib.Algebra.Lie.Submodule /-! # Lie Ideals @@ -26,6 +28,8 @@ on Lie submodules. Lie algebra, ideal, submodule, Lie submodule -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/IdealOperations.lean b/Mathlib/Algebra/Lie/IdealOperations.lean index 46298d760fa287..f2e2f25dcd3cfb 100644 --- a/Mathlib/Algebra/Lie/IdealOperations.lean +++ b/Mathlib/Algebra/Lie/IdealOperations.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Ideal +module + +public import Mathlib.Algebra.Lie.Ideal /-! # Ideal operations for Lie algebras @@ -31,6 +33,8 @@ the action defined in this file. lie algebra, ideal operation -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/InvariantForm.lean b/Mathlib/Algebra/Lie/InvariantForm.lean index b6298ed013b836..ef893ef75ae8c6 100644 --- a/Mathlib/Algebra/Lie/InvariantForm.lean +++ b/Mathlib/Algebra/Lie/InvariantForm.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Lie.Semisimple.Defs -import Mathlib.LinearAlgebra.BilinearForm.Orthogonal +module + +public import Mathlib.Algebra.Lie.Semisimple.Defs +public import Mathlib.LinearAlgebra.BilinearForm.Orthogonal /-! # Lie algebras with non-degenerate invariant bilinear forms are semisimple @@ -30,6 +32,8 @@ in the sense that `⁅x, Φ⁆ = 0` for all `x` or equivalently, `Φ ⁅x, y⁆ We follow the short and excellent paper [dieudonne1953]. -/ +@[expose] public section + namespace LieAlgebra namespace InvariantForm diff --git a/Mathlib/Algebra/Lie/Killing.lean b/Mathlib/Algebra/Lie/Killing.lean index e246f8f290e62f..9c425933f0fedd 100644 --- a/Mathlib/Algebra/Lie/Killing.lean +++ b/Mathlib/Algebra/Lie/Killing.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.InvariantForm -import Mathlib.Algebra.Lie.Semisimple.Basic -import Mathlib.Algebra.Lie.TraceForm +module + +public import Mathlib.Algebra.Lie.InvariantForm +public import Mathlib.Algebra.Lie.Semisimple.Basic +public import Mathlib.Algebra.Lie.TraceForm /-! # Lie algebras with non-degenerate Killing forms. @@ -38,6 +40,8 @@ This file contains basic definitions and results for such Lie algebras. -/ +@[expose] public section + variable (R K L : Type*) [CommRing R] [Field K] [LieRing L] [LieAlgebra R L] [LieAlgebra K L] namespace LieAlgebra diff --git a/Mathlib/Algebra/Lie/LieTheorem.lean b/Mathlib/Algebra/Lie/LieTheorem.lean index cd70529234be71..1b290d71d9c063 100644 --- a/Mathlib/Algebra/Lie/LieTheorem.lean +++ b/Mathlib/Algebra/Lie/LieTheorem.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Lucas Whitfield. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lucas Whitfield, Johan Commelin -/ -import Mathlib.Algebra.Lie.Weights.Basic -import Mathlib.RingTheory.Finiteness.Nilpotent +module + +public import Mathlib.Algebra.Lie.Weights.Basic +public import Mathlib.RingTheory.Finiteness.Nilpotent /-! # Lie's theorem for Solvable Lie algebras. @@ -14,6 +16,8 @@ have a common eigenvector for the action of all elements of the Lie algebra. This result is named `LieModule.exists_forall_lie_eq_smul_of_isSolvable`. -/ +@[expose] public section + namespace LieModule section diff --git a/Mathlib/Algebra/Lie/Matrix.lean b/Mathlib/Algebra/Lie/Matrix.lean index cbccede03065d5..60ece59846e0e0 100644 --- a/Mathlib/Algebra/Lie/Matrix.lean +++ b/Mathlib/Algebra/Lie/Matrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.LinearAlgebra.Matrix.Reindex -import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv +module + +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.LinearAlgebra.Matrix.Reindex +public import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv /-! # Lie algebras of matrices @@ -25,6 +27,8 @@ primary value stems from their utility when constructing the classical Lie algeb lie algebra, matrix -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/Nilpotent.lean b/Mathlib/Algebra/Lie/Nilpotent.lean index f5d8c7af21689a..2e6343370e5b84 100644 --- a/Mathlib/Algebra/Lie/Nilpotent.lean +++ b/Mathlib/Algebra/Lie/Nilpotent.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Solvable -import Mathlib.Algebra.Lie.Quotient -import Mathlib.Algebra.Lie.Normalizer -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.RingTheory.Artinian.Module -import Mathlib.RingTheory.Nilpotent.Lemmas +module + +public import Mathlib.Algebra.Lie.Solvable +public import Mathlib.Algebra.Lie.Quotient +public import Mathlib.Algebra.Lie.Normalizer +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.RingTheory.Nilpotent.Lemmas /-! # Nilpotent Lie algebras @@ -29,6 +31,8 @@ carries a natural concept of nilpotency. We define these here via the lower cent lie algebra, lower central series, nilpotent, max nilpotent ideal -/ +@[expose] public section + universe u v w w₁ w₂ section NilpotentModules diff --git a/Mathlib/Algebra/Lie/NonUnitalNonAssocAlgebra.lean b/Mathlib/Algebra/Lie/NonUnitalNonAssocAlgebra.lean index 292c535a796a7d..06ea9a9054e66e 100644 --- a/Mathlib/Algebra/Lie/NonUnitalNonAssocAlgebra.lean +++ b/Mathlib/Algebra/Lie/NonUnitalNonAssocAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.Algebra.Lie.Basic +module + +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.Algebra.Lie.Basic /-! # Lie algebras as non-unital, non-associative algebras @@ -32,6 +34,8 @@ algebra and we provide some basic definitions for doing so here. lie algebra, non-unital, non-associative -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Lie/Normalizer.lean b/Mathlib/Algebra/Lie/Normalizer.lean index cf2530b63ccb03..51b040ca20e68a 100644 --- a/Mathlib/Algebra/Lie/Normalizer.lean +++ b/Mathlib/Algebra/Lie/Normalizer.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Abelian -import Mathlib.Algebra.Lie.IdealOperations -import Mathlib.Algebra.Lie.Quotient +module + +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.Algebra.Lie.IdealOperations +public import Mathlib.Algebra.Lie.Quotient /-! # The normalizer of Lie submodules and subalgebras. @@ -32,6 +34,8 @@ consider the normalizer. This turns out to be a Lie subalgebra. lie algebra, normalizer -/ +@[expose] public section + variable {R L M M' : Type*} variable [CommRing R] [LieRing L] [LieAlgebra R L] diff --git a/Mathlib/Algebra/Lie/OfAssociative.lean b/Mathlib/Algebra/Lie/OfAssociative.lean index e1b81dc5ed1316..0f66744ba449eb 100644 --- a/Mathlib/Algebra/Lie/OfAssociative.lean +++ b/Mathlib/Algebra/Lie/OfAssociative.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Basic -import Mathlib.Algebra.Lie.Subalgebra -import Mathlib.Algebra.Lie.Submodule -import Mathlib.Algebra.Algebra.Subalgebra.Basic +module + +public import Mathlib.Algebra.Lie.Basic +public import Mathlib.Algebra.Lie.Subalgebra +public import Mathlib.Algebra.Lie.Submodule +public import Mathlib.Algebra.Algebra.Subalgebra.Basic /-! # Lie algebras of associative algebras @@ -32,6 +34,8 @@ make such a definition in this file. lie algebra, ring commutator, adjoint action -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/Quotient.lean b/Mathlib/Algebra/Lie/Quotient.lean index e2cd96c91beb32..bbb2501069e4f3 100644 --- a/Mathlib/Algebra/Lie/Quotient.lean +++ b/Mathlib/Algebra/Lie/Quotient.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Ideal -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.RingTheory.Noetherian.Basic +module + +public import Mathlib.Algebra.Lie.Ideal +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.RingTheory.Noetherian.Basic /-! # Quotients of Lie algebras and Lie modules @@ -28,6 +30,8 @@ is a statement and proof of the universal property of these quotients. lie algebra, quotient -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/Rank.lean b/Mathlib/Algebra/Lie/Rank.lean index bdaf65110c6b11..938b4a11b6eab6 100644 --- a/Mathlib/Algebra/Lie/Rank.lean +++ b/Mathlib/Algebra/Lie/Rank.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Lie.EngelSubalgebra -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Module.LinearMap.Polynomial -import Mathlib.LinearAlgebra.Eigenspace.Zero +module + +public import Mathlib.Algebra.Lie.EngelSubalgebra +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Module.LinearMap.Polynomial +public import Mathlib.LinearAlgebra.Eigenspace.Zero /-! # Rank of a Lie algebra and regular elements @@ -30,6 +32,8 @@ if the `n`-th coefficient of the characteristic polynomial of `ad R L x` is non- -/ +@[expose] public section + open Module variable {R A L M ι ιₘ : Type*} diff --git a/Mathlib/Algebra/Lie/Semisimple/Basic.lean b/Mathlib/Algebra/Lie/Semisimple/Basic.lean index 4d347c36127900..b9a1a72b05f3a5 100644 --- a/Mathlib/Algebra/Lie/Semisimple/Basic.lean +++ b/Mathlib/Algebra/Lie/Semisimple/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Semisimple.Defs -import Mathlib.Order.BooleanGenerators +module + +public import Mathlib.Algebra.Lie.Semisimple.Defs +public import Mathlib.Order.BooleanGenerators /-! # Semisimple Lie algebras @@ -29,6 +31,8 @@ about simple and semisimple Lie algebras. lie algebra, radical, simple, semisimple -/ +@[expose] public section + section Irreducible variable (R L M : Type*) [CommRing R] [LieRing L] [AddCommGroup M] [Module R M] [LieRingModule L M] diff --git a/Mathlib/Algebra/Lie/Semisimple/Defs.lean b/Mathlib/Algebra/Lie/Semisimple/Defs.lean index dc68c1d0df904f..1a4789f12a5575 100644 --- a/Mathlib/Algebra/Lie/Semisimple/Defs.lean +++ b/Mathlib/Algebra/Lie/Semisimple/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Johan Commelin -/ -import Mathlib.Algebra.Lie.Solvable +module + +public import Mathlib.Algebra.Lie.Solvable /-! # Semisimple Lie algebras @@ -22,6 +24,8 @@ In this file we define simple and semisimple Lie algebras, together with related lie algebra, radical, simple, semisimple -/ +@[expose] public section + variable (R L M : Type*) variable [CommRing R] [LieRing L] [AddCommGroup M] [Module R M] [LieRingModule L M] diff --git a/Mathlib/Algebra/Lie/Semisimple/Lemmas.lean b/Mathlib/Algebra/Lie/Semisimple/Lemmas.lean index c8d8f7296907c1..219c6b7fa82ad7 100644 --- a/Mathlib/Algebra/Lie/Semisimple/Lemmas.lean +++ b/Mathlib/Algebra/Lie/Semisimple/Lemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.LieTheorem -import Mathlib.Algebra.Lie.Semisimple.Basic +module + +public import Mathlib.Algebra.Lie.LieTheorem +public import Mathlib.Algebra.Lie.Semisimple.Basic /-! # Lemmas about semisimple Lie algebras @@ -26,6 +28,8 @@ This file is a home for lemmas about semisimple and reductive Lie algebras. -/ +@[expose] public section + namespace LieAlgebra open LieModule LieSubmodule Module Set diff --git a/Mathlib/Algebra/Lie/SkewAdjoint.lean b/Mathlib/Algebra/Lie/SkewAdjoint.lean index 0e2555137e9de7..b9084a35204261 100644 --- a/Mathlib/Algebra/Lie/SkewAdjoint.lean +++ b/Mathlib/Algebra/Lie/SkewAdjoint.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Matrix -import Mathlib.LinearAlgebra.Matrix.SesquilinearForm -import Mathlib.Tactic.NoncommRing +module + +public import Mathlib.Algebra.Lie.Matrix +public import Mathlib.LinearAlgebra.Matrix.SesquilinearForm +public import Mathlib.Tactic.NoncommRing /-! # Lie algebras of skew-adjoint endomorphisms of a bilinear form @@ -30,6 +32,8 @@ results for the Lie algebra of square matrices. lie algebra, skew-adjoint, bilinear form -/ +@[expose] public section + universe u v w w₁ diff --git a/Mathlib/Algebra/Lie/Sl2.lean b/Mathlib/Algebra/Lie/Sl2.lean index c89473702e1daa..43b8dba22d9c81 100644 --- a/Mathlib/Algebra/Lie/Sl2.lean +++ b/Mathlib/Algebra/Lie/Sl2.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +module + +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition /-! @@ -25,6 +27,8 @@ about `sl₂`. -/ +@[expose] public section + variable (R L M : Type*) [CommRing R] [LieRing L] [LieAlgebra R L] [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] diff --git a/Mathlib/Algebra/Lie/Solvable.lean b/Mathlib/Algebra/Lie/Solvable.lean index bc722f4dbdd218..5f76e57036f73b 100644 --- a/Mathlib/Algebra/Lie/Solvable.lean +++ b/Mathlib/Algebra/Lie/Solvable.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Abelian -import Mathlib.Algebra.Lie.BaseChange -import Mathlib.Algebra.Lie.IdealOperations -import Mathlib.Order.Hom.Basic -import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic +module + +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.Algebra.Lie.BaseChange +public import Mathlib.Algebra.Lie.IdealOperations +public import Mathlib.Order.Hom.Basic +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic /-! # Solvable Lie algebras @@ -33,6 +35,8 @@ prove that it is solvable when the Lie algebra is Noetherian. lie algebra, derived series, derived length, solvable, radical -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/Subalgebra.lean b/Mathlib/Algebra/Lie/Subalgebra.lean index 5a89c1ea77a33a..24b87ba650ae48 100644 --- a/Mathlib/Algebra/Lie/Subalgebra.lean +++ b/Mathlib/Algebra/Lie/Subalgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Basic -import Mathlib.RingTheory.Artinian.Module +module + +public import Mathlib.Algebra.Lie.Basic +public import Mathlib.RingTheory.Artinian.Module /-! # Lie subalgebras @@ -27,6 +29,8 @@ results. lie algebra, lie subalgebra -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/Submodule.lean b/Mathlib/Algebra/Lie/Submodule.lean index c6790d48425a40..03a343b8813382 100644 --- a/Mathlib/Algebra/Lie/Submodule.lean +++ b/Mathlib/Algebra/Lie/Submodule.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Subalgebra -import Mathlib.LinearAlgebra.Finsupp.Span +module + +public import Mathlib.Algebra.Lie.Subalgebra +public import Mathlib.LinearAlgebra.Finsupp.Span /-! # Lie submodules of a Lie algebra @@ -25,6 +27,8 @@ use it to define various important operations, notably the Lie span of a subset lie algebra, lie submodule, lie ideal, lattice structure -/ +@[expose] public section + universe u v w w₁ w₂ diff --git a/Mathlib/Algebra/Lie/TensorProduct.lean b/Mathlib/Algebra/Lie/TensorProduct.lean index c4fbf4631e4d96..0e152a03a89fdc 100644 --- a/Mathlib/Algebra/Lie/TensorProduct.lean +++ b/Mathlib/Algebra/Lie/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Abelian -import Mathlib.LinearAlgebra.TensorProduct.Tower +module + +public import Mathlib.Algebra.Lie.Abelian +public import Mathlib.LinearAlgebra.TensorProduct.Tower /-! # Tensor products of Lie modules @@ -16,6 +18,8 @@ Tensor products of Lie modules carry natural Lie module structures. lie module, tensor product, universal property -/ +@[expose] public section + universe u v w w₁ w₂ w₃ variable {R : Type u} [CommRing R] diff --git a/Mathlib/Algebra/Lie/TraceForm.lean b/Mathlib/Algebra/Lie/TraceForm.lean index e81f55f1757d2d..44ab9a55854123 100644 --- a/Mathlib/Algebra/Lie/TraceForm.lean +++ b/Mathlib/Algebra/Lie/TraceForm.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.DirectSum.LinearMap -import Mathlib.Algebra.Lie.InvariantForm -import Mathlib.Algebra.Lie.Weights.Cartan -import Mathlib.Algebra.Lie.Weights.Linear -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.LinearAlgebra.PID +module + +public import Mathlib.Algebra.DirectSum.LinearMap +public import Mathlib.Algebra.Lie.InvariantForm +public import Mathlib.Algebra.Lie.Weights.Cartan +public import Mathlib.Algebra.Lie.Weights.Linear +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.LinearAlgebra.PID /-! # The trace and Killing forms of a Lie algebra. @@ -32,6 +34,8 @@ We define the trace / Killing form in this file and prove some basic properties. form on `L` via the trace form construction. -/ +@[expose] public section + variable (R K L M : Type*) [CommRing R] [LieRing L] [LieAlgebra R L] [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] diff --git a/Mathlib/Algebra/Lie/UniversalEnveloping.lean b/Mathlib/Algebra/Lie/UniversalEnveloping.lean index 58723e917d3209..8596517aeb39d9 100644 --- a/Mathlib/Algebra/Lie/UniversalEnveloping.lean +++ b/Mathlib/Algebra/Lie/UniversalEnveloping.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.RingQuot -import Mathlib.LinearAlgebra.TensorAlgebra.Basic +module + +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.RingQuot +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic /-! # Universal enveloping algebra @@ -33,6 +35,8 @@ enveloping algebra of `L`, together with its universal property. lie algebra, universal enveloping algebra, tensor algebra -/ +@[expose] public section + universe u₁ u₂ u₃ diff --git a/Mathlib/Algebra/Lie/Weights/Basic.lean b/Mathlib/Algebra/Lie/Weights/Basic.lean index 203c5e4b980af5..3246899feae8bf 100644 --- a/Mathlib/Algebra/Lie/Weights/Basic.lean +++ b/Mathlib/Algebra/Lie/Weights/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Ring.Divisibility.Lemmas -import Mathlib.Algebra.Lie.Nilpotent -import Mathlib.Algebra.Lie.Engel -import Mathlib.LinearAlgebra.Eigenspace.Pi -import Mathlib.RingTheory.Artinian.Module -import Mathlib.LinearAlgebra.Trace -import Mathlib.LinearAlgebra.FreeModule.PID +module + +public import Mathlib.Algebra.Ring.Divisibility.Lemmas +public import Mathlib.Algebra.Lie.Nilpotent +public import Mathlib.Algebra.Lie.Engel +public import Mathlib.LinearAlgebra.Eigenspace.Pi +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.LinearAlgebra.Trace +public import Mathlib.LinearAlgebra.FreeModule.PID /-! # Weight spaces of Lie modules of nilpotent Lie algebras @@ -45,6 +47,8 @@ Basic definitions and properties of the above ideas are provided in this file. lie character, eigenvalue, eigenspace, weight, weight vector, root, root vector -/ +@[expose] public section + variable {K R L M : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] diff --git a/Mathlib/Algebra/Lie/Weights/Cartan.lean b/Mathlib/Algebra/Lie/Weights/Cartan.lean index 4b5dc3fa13d45c..4831227237b130 100644 --- a/Mathlib/Algebra/Lie/Weights/Cartan.lean +++ b/Mathlib/Algebra/Lie/Weights/Cartan.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.CartanSubalgebra -import Mathlib.Algebra.Lie.Weights.Basic +module + +public import Mathlib.Algebra.Lie.CartanSubalgebra +public import Mathlib.Algebra.Lie.Weights.Basic /-! # Weights and roots of Lie modules and Lie algebras with respect to Cartan subalgebras @@ -26,6 +28,8 @@ Basic definitions and properties of the above ideas are provided in this file. -/ +@[expose] public section + open Set variable {R L : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] diff --git a/Mathlib/Algebra/Lie/Weights/Chain.lean b/Mathlib/Algebra/Lie/Weights/Chain.lean index 78e0ce03dc8419..963b5cc14bfbf7 100644 --- a/Mathlib/Algebra/Lie/Weights/Chain.lean +++ b/Mathlib/Algebra/Lie/Weights/Chain.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.DirectSum.LinearMap -import Mathlib.Algebra.Lie.Weights.Cartan -import Mathlib.Algebra.Order.Group.Pointwise.Interval -import Mathlib.RingTheory.Finiteness.Nilpotent -import Mathlib.Data.Int.Interval -import Mathlib.Order.Filter.Cofinite +module + +public import Mathlib.Algebra.DirectSum.LinearMap +public import Mathlib.Algebra.Lie.Weights.Cartan +public import Mathlib.Algebra.Order.Group.Pointwise.Interval +public import Mathlib.RingTheory.Finiteness.Nilpotent +public import Mathlib.Data.Int.Interval +public import Mathlib.Order.Filter.Cofinite /-! # Chains of roots and weights @@ -53,6 +55,8 @@ It should be possible to unify some of the definitions here such as `LieModule.c -/ +@[expose] public section + open Module Function Set variable {R L : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] diff --git a/Mathlib/Algebra/Lie/Weights/IsSimple.lean b/Mathlib/Algebra/Lie/Weights/IsSimple.lean index 9aaf7c1b7f4a04..6d348c217dbcdf 100644 --- a/Mathlib/Algebra/Lie/Weights/IsSimple.lean +++ b/Mathlib/Algebra/Lie/Weights/IsSimple.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Janos Wolosz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Janos Wolosz -/ -import Mathlib.Algebra.Lie.Weights.RootSystem -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +module + +public import Mathlib.Algebra.Lie.Weights.RootSystem +public import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas /-! # Simple Lie algebras @@ -19,6 +21,8 @@ We show the irreducibility of root systems of simple Lie algebras. * `LieAlgebra.IsKilling.instIsIrreducible`: the root system of a simple Lie algebra is irreducible -/ +@[expose] public section + namespace LieAlgebra.IsKilling variable {K L : Type*} [Field K] [CharZero K] [LieRing L] [LieAlgebra K L] [FiniteDimensional K L] diff --git a/Mathlib/Algebra/Lie/Weights/Killing.lean b/Mathlib/Algebra/Lie/Weights/Killing.lean index 9763cc37414961..340274caaeebdb 100644 --- a/Mathlib/Algebra/Lie/Weights/Killing.lean +++ b/Mathlib/Algebra/Lie/Weights/Killing.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Derivation.Killing -import Mathlib.Algebra.Lie.Killing -import Mathlib.Algebra.Lie.Sl2 -import Mathlib.Algebra.Lie.Weights.Chain -import Mathlib.LinearAlgebra.Eigenspace.Semisimple -import Mathlib.LinearAlgebra.JordanChevalley +module + +public import Mathlib.Algebra.Lie.Derivation.Killing +public import Mathlib.Algebra.Lie.Killing +public import Mathlib.Algebra.Lie.Sl2 +public import Mathlib.Algebra.Lie.Weights.Chain +public import Mathlib.LinearAlgebra.Eigenspace.Semisimple +public import Mathlib.LinearAlgebra.JordanChevalley /-! # Roots of Lie algebras with non-degenerate Killing forms @@ -34,6 +36,8 @@ forms. -/ +@[expose] public section + variable (R K L : Type*) [CommRing R] [LieRing L] [LieAlgebra R L] [Field K] [LieAlgebra K L] namespace LieAlgebra diff --git a/Mathlib/Algebra/Lie/Weights/Linear.lean b/Mathlib/Algebra/Lie/Weights/Linear.lean index e71432fd512cb9..57e996a2fd5051 100644 --- a/Mathlib/Algebra/Lie/Weights/Linear.lean +++ b/Mathlib/Algebra/Lie/Weights/Linear.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Weights.Basic -import Mathlib.LinearAlgebra.Trace -import Mathlib.LinearAlgebra.FreeModule.PID +module + +public import Mathlib.Algebra.Lie.Weights.Basic +public import Mathlib.LinearAlgebra.Trace +public import Mathlib.LinearAlgebra.FreeModule.PID /-! # Lie modules with linear weights @@ -39,6 +41,8 @@ or `R` has characteristic zero. -/ +@[expose] public section + open Set variable (k R L M : Type*) [CommRing R] [LieRing L] [LieAlgebra R L] diff --git a/Mathlib/Algebra/Lie/Weights/RootSystem.lean b/Mathlib/Algebra/Lie/Weights/RootSystem.lean index aa572d7c5ac17d..fdb5b74f0dff22 100644 --- a/Mathlib/Algebra/Lie/Weights/RootSystem.lean +++ b/Mathlib/Algebra/Lie/Weights/RootSystem.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Algebra.Lie.Weights.Killing -import Mathlib.Algebra.Module.Torsion.Free -import Mathlib.LinearAlgebra.RootSystem.Basic -import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear -import Mathlib.LinearAlgebra.RootSystem.Reduced +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.Lie.Weights.Killing +public import Mathlib.Algebra.Module.Torsion.Free +public import Mathlib.LinearAlgebra.RootSystem.Basic +public import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear +public import Mathlib.LinearAlgebra.RootSystem.Reduced /-! # The root system associated with a Lie algebra @@ -34,6 +36,8 @@ characteristic 0 form a root system. We achieve this by studying root chains. -/ +@[expose] public section + noncomputable section namespace LieAlgebra.IsKilling diff --git a/Mathlib/Algebra/LinearRecurrence.lean b/Mathlib/Algebra/LinearRecurrence.lean index d24ae2e099d150..51f6d1572f0803 100644 --- a/Mathlib/Algebra/LinearRecurrence.lean +++ b/Mathlib/Algebra/LinearRecurrence.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Algebra.Polynomial.Eval.Defs -import Mathlib.LinearAlgebra.Dimension.Constructions +module + +public import Mathlib.Algebra.Polynomial.Eval.Defs +public import Mathlib.LinearAlgebra.Dimension.Constructions /-! # Linear recurrence @@ -35,6 +37,8 @@ properties of eigenvalues and eigenvectors. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/ModEq.lean b/Mathlib/Algebra/ModEq.lean index 3666bb73d7e2bb..ea25a92cb2be84 100644 --- a/Mathlib/Algebra/ModEq.lean +++ b/Mathlib/Algebra/ModEq.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.Data.Int.ModEq -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.Data.Int.ModEq +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # Equality modulo an element @@ -31,6 +33,8 @@ to `AddSubgroup.ModEq` and multiplicativise it. Longer term, we could generalise also unify with `Nat.ModEq`. -/ +@[expose] public section + assert_not_exists Module namespace AddCommGroup diff --git a/Mathlib/Algebra/Module/Basic.lean b/Mathlib/Algebra/Module/Basic.lean index 328e98339d87c2..e8c973bc27a1ba 100644 --- a/Mathlib/Algebra/Module/Basic.lean +++ b/Mathlib/Algebra/Module/Basic.lean @@ -3,19 +3,23 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Algebra.Ring.Invertible +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Algebra.Ring.Invertible /-! # Further basic results about modules. -/ +@[expose] public section + assert_not_exists Nonneg.inv Multiset open Function Set diff --git a/Mathlib/Algebra/Module/BigOperators.lean b/Mathlib/Algebra/Module/BigOperators.lean index 8e45b22d5e3ede..be7c367cfa215e 100644 --- a/Mathlib/Algebra/Module/BigOperators.lean +++ b/Mathlib/Algebra/Module/BigOperators.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.Module.Defs -import Mathlib.Data.Fintype.BigOperators +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Data.Fintype.BigOperators /-! # Finite sums over modules over a ring -/ +@[expose] public section + variable {ι κ α β R M : Type*} section AddCommMonoid diff --git a/Mathlib/Algebra/Module/Bimodule.lean b/Mathlib/Algebra/Module/Bimodule.lean index 06ca631ba9b507..6878e65c37e531 100644 --- a/Mathlib/Algebra/Module/Bimodule.lean +++ b/Mathlib/Algebra/Module/Bimodule.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Bimodules @@ -53,6 +55,8 @@ Develop the theory of two-sided ideals, which have type `Submodule (R ⊗[ℕ] R -/ +@[expose] public section + open TensorProduct diff --git a/Mathlib/Algebra/Module/Card.lean b/Mathlib/Algebra/Module/Card.lean index 3941ffd972d1d7..9f33b8f08d1d47 100644 --- a/Mathlib/Algebra/Module/Card.lean +++ b/Mathlib/Algebra/Module/Card.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.NoZeroSMulDivisors.Basic -import Mathlib.SetTheory.Cardinal.Basic +module + +public import Mathlib.Algebra.NoZeroSMulDivisors.Basic +public import Mathlib.SetTheory.Cardinal.Basic /-! # Cardinality of a module @@ -13,6 +15,8 @@ This file proves that the cardinality of a module without zero divisors is at le of its base ring. -/ +@[expose] public section + open Function universe u v diff --git a/Mathlib/Algebra/Module/CharacterModule.lean b/Mathlib/Algebra/Module/CharacterModule.lean index e7189dc834e62d..f84bb525162226 100644 --- a/Mathlib/Algebra/Module/CharacterModule.lean +++ b/Mathlib/Algebra/Module/CharacterModule.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Junyan Xu -/ +module -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.Algebra.Category.Grp.Injective -import Mathlib.Topology.Instances.AddCircle.Defs -import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.Algebra.Category.Grp.Injective +public import Mathlib.Topology.Instances.AddCircle.Defs +public import Mathlib.LinearAlgebra.Isomorphisms /-! # Character module of a module @@ -28,6 +29,8 @@ an `R`-linear map `l : M ⟶ N` induces an `R`-linear map `l⋆ : f ↦ f ∘ l` -/ +@[expose] public section + open CategoryTheory universe uR uA uB diff --git a/Mathlib/Algebra/Module/Congruence/Defs.lean b/Mathlib/Algebra/Module/Congruence/Defs.lean index 759c0cd739fdc7..b1110520f7421e 100644 --- a/Mathlib/Algebra/Module/Congruence/Defs.lean +++ b/Mathlib/Algebra/Module/Congruence/Defs.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.GroupTheory.Congruence.Basic +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.GroupTheory.Congruence.Basic /-! # Congruence relations respecting scalar multiplication -/ +@[expose] public section + variable (R S M N : Type*) /-- A congruence relation that preserves additive action. -/ diff --git a/Mathlib/Algebra/Module/DedekindDomain.lean b/Mathlib/Algebra/Module/DedekindDomain.lean index 9750d5112767c4..49a9fc35ab0dd9 100644 --- a/Mathlib/Algebra/Module/DedekindDomain.lean +++ b/Mathlib/Algebra/Module/DedekindDomain.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pierre-Alexandre Bazin -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas /-! # Modules over a Dedekind domain @@ -15,6 +17,8 @@ Therefore, as any finitely generated torsion module is `I`-torsion for some `I`, direct sum of its `p i ^ e i`-torsion submodules for some prime ideals `p i` and numbers `e i`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/Module/Defs.lean b/Mathlib/Algebra/Module/Defs.lean index ef4fc5f70a29f0..02ab6480921094 100644 --- a/Mathlib/Algebra/Module/Defs.lean +++ b/Mathlib/Algebra/Module/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Ring.Defs /-! # Modules over a ring @@ -33,6 +35,8 @@ to use a canonical `Module` typeclass throughout. semimodule, module, vector space -/ +@[expose] public section + assert_not_exists Field Invertible Pi.single_smul₀ RingHom Set.indicator Multiset Units open Function Set diff --git a/Mathlib/Algebra/Module/End.lean b/Mathlib/Algebra/Module/End.lean index 67f35cb9c40109..4a5f04dbc3a4a1 100644 --- a/Mathlib/Algebra/Module/End.lean +++ b/Mathlib/Algebra/Module/End.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Group.Hom.End -import Mathlib.Algebra.Module.NatInt +module + +public import Mathlib.Algebra.Group.Hom.End +public import Mathlib.Algebra.Module.NatInt /-! # Module structure and endomorphisms @@ -13,6 +15,8 @@ In this file, we define `Module.toAddMonoidEnd`, which is `(•)` as a monoid ho We use this to prove some results on scalar multiplication by integers. -/ +@[expose] public section + assert_not_exists RelIso Multiset Set.indicator Pi.single_smul₀ Field open Function Set diff --git a/Mathlib/Algebra/Module/Equiv/Basic.lean b/Mathlib/Algebra/Module/Equiv/Basic.lean index 5708330aceceeb..e094ff912a70a1 100644 --- a/Mathlib/Algebra/Module/Equiv/Basic.lean +++ b/Mathlib/Algebra/Module/Equiv/Basic.lean @@ -4,20 +4,24 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Action.Basic -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Hom -import Mathlib.Algebra.Module.LinearMap.Basic -import Mathlib.Algebra.Module.LinearMap.End -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Module.Prod +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Action.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.Hom +public import Mathlib.Algebra.Module.LinearMap.Basic +public import Mathlib.Algebra.Module.LinearMap.End +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Module.Prod /-! # Further results on (semi)linear equivalences. -/ +@[expose] public section + open Function variable {R : Type*} {R₂ : Type*} @@ -92,6 +96,8 @@ lemma mul_eq_trans (f g : M ≃ₗ[R] M) : f * g = g.trans f := rfl @[simp] lemma coe_one : ↑(1 : M ≃ₗ[R] M) = id := rfl +@[simp] lemma coe_inv (f : M ≃ₗ[R] M) : ⇑f⁻¹ = ⇑f.symm := rfl + @[simp] lemma coe_toLinearMap_one : (↑(1 : M ≃ₗ[R] M) : M →ₗ[R] M) = LinearMap.id := rfl diff --git a/Mathlib/Algebra/Module/Equiv/Defs.lean b/Mathlib/Algebra/Module/Equiv/Defs.lean index 1969cbfe4f4a14..8b9c4934c85f7c 100644 --- a/Mathlib/Algebra/Module/Equiv/Defs.lean +++ b/Mathlib/Algebra/Module/Equiv/Defs.lean @@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.LinearMap.Defs +module + +public import Mathlib.Algebra.Module.LinearMap.Defs /-! # (Semi)linear equivalences @@ -33,6 +35,8 @@ The group structure on automorphisms, `LinearEquiv.automorphismGroup`, is provid linear equiv, linear equivalences, linear isomorphism, linear isomorphic -/ +@[expose] public section + assert_not_exists Field Pi.module open Function diff --git a/Mathlib/Algebra/Module/Equiv/Opposite.lean b/Mathlib/Algebra/Module/Equiv/Opposite.lean index 37c1211cb03766..9dd15de6ea38e7 100644 --- a/Mathlib/Algebra/Module/Equiv/Opposite.lean +++ b/Mathlib/Algebra/Module/Equiv/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Opposite +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.Opposite /-! # Module operations on `Mᵐᵒᵖ` @@ -13,6 +15,8 @@ This file contains definitions that build on top of the group action definitions `Mathlib/Algebra/GroupWithZero/Action/Opposite.lean`. -/ +@[expose] public section + section variable {R S M : Type*} [Semiring R] [Semiring S] [AddCommMonoid M] [Module S M] diff --git a/Mathlib/Algebra/Module/FinitePresentation.lean b/Mathlib/Algebra/Module/FinitePresentation.lean index 36e3493c287645..bfb98ca84a69e8 100644 --- a/Mathlib/Algebra/Module/FinitePresentation.lean +++ b/Mathlib/Algebra/Module/FinitePresentation.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.Finiteness.Projective -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Noetherian.Basic -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.Finiteness.Projective +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Noetherian.Basic +public import Mathlib.RingTheory.TensorProduct.Finite /-! @@ -52,6 +54,8 @@ For finitely presented algebras, see `Algebra.FinitePresentation` in file `Mathlib/RingTheory/FinitePresentation.lean`. -/ +@[expose] public section + open Finsupp section Semiring diff --git a/Mathlib/Algebra/Module/GradedModule.lean b/Mathlib/Algebra/Module/GradedModule.lean index 0e6d6fde09aab8..f03ee0cabf30ad 100644 --- a/Mathlib/Algebra/Module/GradedModule.lean +++ b/Mathlib/Algebra/Module/GradedModule.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.Algebra.GradedMulAction -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.Algebra.Module.BigOperators +module + +public import Mathlib.RingTheory.GradedAlgebra.Basic +public import Mathlib.Algebra.GradedMulAction +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.Algebra.Module.BigOperators /-! # Graded Module @@ -20,6 +22,8 @@ Then `⨁ i, 𝓜 i` is an `A`-module and is isomorphic to `M`. graded module -/ +@[expose] public section + section diff --git a/Mathlib/Algebra/Module/Hom.lean b/Mathlib/Algebra/Module/Hom.lean index c7deb6b92ed993..d4ad1b01e4fd33 100644 --- a/Mathlib/Algebra/Module/Hom.lean +++ b/Mathlib/Algebra/Module/Hom.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Hom.Instances -import Mathlib.Algebra.GroupWithZero.Action.End -import Mathlib.Algebra.GroupWithZero.Action.Hom -import Mathlib.Algebra.Module.End -import Mathlib.Algebra.Ring.Opposite -import Mathlib.GroupTheory.GroupAction.DomAct.Basic +module + +public import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.GroupWithZero.Action.End +public import Mathlib.Algebra.GroupWithZero.Action.Hom +public import Mathlib.Algebra.Module.End +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic /-! # Bundled Hom instances for module and multiplicative actions @@ -22,6 +24,8 @@ We also define bundled versions of `(c • ·)` and `(· • ·)` as `AddMonoidH `AddMonoidHom.smul`, respectively. -/ +@[expose] public section + variable {R S M A B : Type*} namespace ZeroHom diff --git a/Mathlib/Algebra/Module/Injective.lean b/Mathlib/Algebra/Module/Injective.lean index 4c966a4e453084..908836950e2156 100644 --- a/Mathlib/Algebra/Module/Injective.lean +++ b/Mathlib/Algebra/Module/Injective.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.Algebra.Module.Shrink -import Mathlib.LinearAlgebra.LinearPMap -import Mathlib.Logic.Small.Basic -import Mathlib.RingTheory.Ideal.Defs +module + +public import Mathlib.Algebra.Module.Shrink +public import Mathlib.LinearAlgebra.LinearPMap +public import Mathlib.Logic.Small.Basic +public import Mathlib.RingTheory.Ideal.Defs /-! # Injective modules @@ -32,6 +34,8 @@ import Mathlib.RingTheory.Ideal.Defs -/ +@[expose] public section + assert_not_exists ModuleCat noncomputable section diff --git a/Mathlib/Algebra/Module/Lattice.lean b/Mathlib/Algebra/Module/Lattice.lean index 432c4edf553a6f..699dc78c0dbbdf 100644 --- a/Mathlib/Algebra/Module/Lattice.lean +++ b/Mathlib/Algebra/Module/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.LinearAlgebra.Dimension.Localization -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.FreeModule.PID +module + +public import Mathlib.LinearAlgebra.Dimension.Localization +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.FreeModule.PID /-! # Lattices @@ -42,6 +44,8 @@ generated condition is replaced by having the discrete topology. This is for exa for complex tori. -/ +@[expose] public section + open Module open scoped Pointwise diff --git a/Mathlib/Algebra/Module/LinearMap/Basic.lean b/Mathlib/Algebra/Module/LinearMap/Basic.lean index 312d5dfdbe7892..d8f9a69f1a56ca 100644 --- a/Mathlib/Algebra/Module/LinearMap/Basic.lean +++ b/Mathlib/Algebra/Module/LinearMap/Basic.lean @@ -4,15 +4,19 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Algebra.NoZeroSMulDivisors.Pi -import Mathlib.Algebra.Ring.Opposite -import Mathlib.GroupTheory.GroupAction.DomAct.Basic +module + +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Algebra.NoZeroSMulDivisors.Pi +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic /-! # Further results on (semi)linear maps -/ +@[expose] public section + assert_not_exists Submonoid Finset TrivialStar diff --git a/Mathlib/Algebra/Module/LinearMap/Defs.lean b/Mathlib/Algebra/Module/LinearMap/Defs.lean index 68c756b1c457fd..e4d26e541837f2 100644 --- a/Mathlib/Algebra/Module/LinearMap/Defs.lean +++ b/Mathlib/Algebra/Module/LinearMap/Defs.lean @@ -4,11 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Group.Hom.Instances -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.Module.RingHom -import Mathlib.Algebra.Ring.CompTypeclasses -import Mathlib.GroupTheory.GroupAction.Hom +module + +public import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.Module.RingHom +public import Mathlib.Algebra.Ring.CompTypeclasses +public import Mathlib.GroupTheory.GroupAction.Hom /-! # (Semi)linear maps @@ -50,6 +52,8 @@ To ensure that composition works smoothly for semilinear maps, we use the typecl linear map -/ +@[expose] public section + assert_not_exists TrivialStar DomMulAct Pi.module WCovBy.image Field diff --git a/Mathlib/Algebra/Module/LinearMap/DivisionRing.lean b/Mathlib/Algebra/Module/LinearMap/DivisionRing.lean index 15731b3f4672cb..665acb40abe54a 100644 --- a/Mathlib/Algebra/Module/LinearMap/DivisionRing.lean +++ b/Mathlib/Algebra/Module/LinearMap/DivisionRing.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Module.Submodule.Range -import Mathlib.LinearAlgebra.Span.Defs +module + +public import Mathlib.Algebra.Module.Submodule.Range +public import Mathlib.LinearAlgebra.Span.Defs /-! # Some lemmas about linear functionals on division rings @@ -18,6 +20,8 @@ This file proves some results on linear functionals on division semirings. the range of `f.smulRight x` is the span of the set `{x}`. -/ +@[expose] public section + namespace LinearMap variable {R M M₁ : Type*} [AddCommMonoid M] [AddCommMonoid M₁] diff --git a/Mathlib/Algebra/Module/LinearMap/End.lean b/Mathlib/Algebra/Module/LinearMap/End.lean index 13e4cd2af5efc9..33dc429df3a376 100644 --- a/Mathlib/Algebra/Module/LinearMap/End.lean +++ b/Mathlib/Algebra/Module/LinearMap/End.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.Equiv.Opposite -import Mathlib.Algebra.NoZeroSMulDivisors.Defs +module + +public import Mathlib.Algebra.Module.Equiv.Opposite +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs /-! # Endomorphisms of a module @@ -20,6 +22,8 @@ including the action of `Module.End` on the module we are considering endomorphi taking the additive structure above with composition as multiplication. -/ +@[expose] public section + universe u v /-- Linear endomorphisms of a module, with associated ring structure diff --git a/Mathlib/Algebra/Module/LinearMap/Polynomial.lean b/Mathlib/Algebra/Module/LinearMap/Polynomial.lean index f6ecb9d749f254..b9571675891188 100644 --- a/Mathlib/Algebra/Module/LinearMap/Polynomial.lean +++ b/Mathlib/Algebra/Module/LinearMap/Polynomial.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Monad -import Mathlib.LinearAlgebra.Charpoly.ToMatrix -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.Matrix.Charpoly.Univ -import Mathlib.RingTheory.TensorProduct.Finite -import Mathlib.RingTheory.TensorProduct.Free +module + +public import Mathlib.Algebra.MvPolynomial.Monad +public import Mathlib.LinearAlgebra.Charpoly.ToMatrix +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Univ +public import Mathlib.RingTheory.TensorProduct.Finite +public import Mathlib.RingTheory.TensorProduct.Free /-! # Characteristic polynomials of linear families of endomorphisms @@ -62,6 +64,8 @@ The proof concludes because characteristic polynomials are independent of the ch -/ +@[expose] public section + open Module MvPolynomial open scoped Matrix diff --git a/Mathlib/Algebra/Module/LinearMap/Prod.lean b/Mathlib/Algebra/Module/LinearMap/Prod.lean index 9740ffe6d6eb48..8a44d526e18267 100644 --- a/Mathlib/Algebra/Module/LinearMap/Prod.lean +++ b/Mathlib/Algebra/Module/LinearMap/Prod.lean @@ -3,10 +3,11 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ +module -import Mathlib.Algebra.Module.Prod -import Mathlib.Tactic.Abel -import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Algebra.Module.Prod +public import Mathlib.Tactic.Abel +public import Mathlib.Algebra.Module.LinearMap.Defs /-! # Addition and subtraction are linear maps from the product space @@ -18,6 +19,8 @@ linear algebra, vector space, module -/ +@[expose] public section + variable {R : Type*} {M : Type*} [Semiring R] namespace IsLinearMap diff --git a/Mathlib/Algebra/Module/LinearMap/Rat.lean b/Mathlib/Algebra/Module/LinearMap/Rat.lean index 68dc81821f5cf2..7bf73746d75bc9 100644 --- a/Mathlib/Algebra/Module/LinearMap/Rat.lean +++ b/Mathlib/Algebra/Module/LinearMap/Rat.lean @@ -4,13 +4,17 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.Rat -import Mathlib.Algebra.Module.LinearMap.Defs +module + +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Algebra.Module.LinearMap.Defs /-! # Reinterpret an additive homomorphism as a `ℚ`-linear map. -/ +@[expose] public section + open Function variable {M M₂ : Type*} diff --git a/Mathlib/Algebra/Module/LinearMap/Star.lean b/Mathlib/Algebra/Module/LinearMap/Star.lean index dccae5176a383a..81594c7d497b56 100644 --- a/Mathlib/Algebra/Module/LinearMap/Star.lean +++ b/Mathlib/Algebra/Module/LinearMap/Star.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Star.Basic +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Star.Basic /-! # Notation for star-linear maps @@ -13,6 +15,8 @@ This is in a separate file as a it is not needed until much later, and avoids importing the theory of star operations unnecessarily early. -/ +@[expose] public section + /-- `M →ₗ⋆[R] N` is the type of `R`-conjugate-linear maps from `M` to `N`. -/ notation:25 M " →ₗ⋆[" R:25 "] " M₂:0 => LinearMap (starRingEnd R) M M₂ diff --git a/Mathlib/Algebra/Module/LocalizedModule/AtPrime.lean b/Mathlib/Algebra/Module/LocalizedModule/AtPrime.lean index 791f3c0ccd6da7..b9bbea44515ac0 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/AtPrime.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/AtPrime.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Yongle Hu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongle Hu -/ -import Mathlib.Algebra.Module.LocalizedModule.Basic -import Mathlib.RingTheory.Ideal.Prime +module + +public import Mathlib.Algebra.Module.LocalizedModule.Basic +public import Mathlib.RingTheory.Ideal.Prime /-! # Localizations of modules at the complement of a prime ideal -/ +@[expose] public section + /-- Given a prime ideal `P` and `f : M →ₗ[R] M'`, `IsLocalizedModule.AtPrime P f` states that `M'` is isomorphic to the localization of `M` at the complement of `P`. -/ protected abbrev IsLocalizedModule.AtPrime {R M M' : Type*} [CommSemiring R] (P : Ideal R) diff --git a/Mathlib/Algebra/Module/LocalizedModule/Away.lean b/Mathlib/Algebra/Module/LocalizedModule/Away.lean index af585a025721d5..9a4d48df108d79 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Away.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Away.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Yongle Hu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongle Hu -/ -import Mathlib.Algebra.Module.LocalizedModule.Basic +module + +public import Mathlib.Algebra.Module.LocalizedModule.Basic /-! # Localizations of modules away from an element -/ -/-- Given `x : R` and `f : M →ₗ[R] M'`, IsLocalization.Away x f` states that `M'` +@[expose] public section + +/-- Given `x : R` and `f : M →ₗ[R] M'`, `IsLocalization.Away x f` states that `M'` is isomorphic to the localization of `M` at the submonoid generated by `x`. -/ protected abbrev IsLocalizedModule.Away {R M M' : Type*} [CommSemiring R] (x : R) [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] (f : M →ₗ[R] M') := diff --git a/Mathlib/Algebra/Module/LocalizedModule/Basic.lean b/Mathlib/Algebra/Module/LocalizedModule/Basic.lean index 1723dc1c090151..e0aeb93d263e40 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Basic.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Jujian Zhang -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Module.TransferInstance -import Mathlib.RingTheory.Localization.Defs +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Module.TransferInstance +public import Mathlib.RingTheory.Localization.Defs /-! # Localized Module @@ -35,6 +37,8 @@ localize `M` by `S`. This gives us a `Localization S`-module. * Redefine `Localization` for monoids and rings to coincide with `LocalizedModule`. -/ +@[expose] public section + namespace LocalizedModule @@ -1289,8 +1293,7 @@ variable {R A M M' : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A] (S : [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] [IsLocalization S A] -/-- If `M'` is the localization of `M` at `S` and `A = S⁻¹R`, then -`M' is an `A`-module. -/ +/-- If `M'` is the localization of `M` at `S` and `A = S⁻¹R`, then `M'` is an `A`-module. -/ @[reducible] noncomputable def module (f : M →ₗ[R] M') [IsLocalizedModule S f] : Module A M' := (IsLocalizedModule.iso S f).symm.toAddEquiv.module A diff --git a/Mathlib/Algebra/Module/LocalizedModule/Exact.lean b/Mathlib/Algebra/Module/LocalizedModule/Exact.lean index 81b4d1a919335b..4348779b8e8dd8 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Exact.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Exact.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Jujian Zhang -/ -import Mathlib.Algebra.Exact -import Mathlib.Algebra.Module.LocalizedModule.Basic +module + +public import Mathlib.Algebra.Exact +public import Mathlib.Algebra.Module.LocalizedModule.Basic /-! # Localization of modules is an exact functor @@ -16,6 +18,8 @@ import Mathlib.Algebra.Module.LocalizedModule.Basic -/ +@[expose] public section + section open IsLocalizedModule Function Submonoid diff --git a/Mathlib/Algebra/Module/LocalizedModule/Int.lean b/Mathlib/Algebra/Module/LocalizedModule/Int.lean index c4a947564e0ad3..0457da3909a235 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Int.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Int.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Module.LocalizedModule.Basic -import Mathlib.Algebra.Module.Submodule.Pointwise +module + +public import Mathlib.Algebra.Module.LocalizedModule.Basic +public import Mathlib.Algebra.Module.Submodule.Pointwise /-! @@ -23,6 +25,8 @@ can be unified. -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] {S : Submonoid R} {M : Type*} [AddCommMonoid M] [Module R M] {M' : Type*} [AddCommMonoid M'] [Module R M'] (f : M →ₗ[R] M') diff --git a/Mathlib/Algebra/Module/LocalizedModule/IsLocalization.lean b/Mathlib/Algebra/Module/LocalizedModule/IsLocalization.lean index d30404dae67836..201de89b3a840e 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/IsLocalization.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/IsLocalization.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Jujian Zhang -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Algebra.Module.LocalizedModule.Basic +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Algebra.Module.LocalizedModule.Basic /-! # Equivalence between `IsLocalizedModule` and `IsLocalization` -/ +@[expose] public section + section IsLocalizedModule variable {R : Type*} [CommSemiring R] (S : Submonoid R) diff --git a/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean b/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean index 1de0ce4ce43c6a..5a6db1bfcd9a79 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.Submodule.Pointwise -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Localization.Module -import Mathlib.Algebra.Algebra.Operations +module + +public import Mathlib.Algebra.Module.Submodule.Pointwise +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Localization.Module +public import Mathlib.Algebra.Algebra.Operations /-! # Localization of Submodules @@ -16,7 +18,7 @@ Results about localizations of submodules and quotient modules are provided in t ## Main results - `Submodule.localized`: The localization of an `R`-submodule of `M` at `p` viewed as an `Rₚ`-submodule of `Mₚ`. - A direct consequence of this is that `Rₚ` is flat over `R, see `IsLocalization.flat`. + A direct consequence of this is that `Rₚ` is flat over `R`; see `IsLocalization.flat`. - `Submodule.toLocalized`: The localization map of a submodule `M' →ₗ[R] M'.localized p`. - `Submodule.toLocalizedQuotient`: @@ -27,6 +29,8 @@ Results about localizations of submodules and quotient modules are provided in t -/ +@[expose] public section + open nonZeroDivisors variable {R S M N : Type*} diff --git a/Mathlib/Algebra/Module/MinimalAxioms.lean b/Mathlib/Algebra/Module/MinimalAxioms.lean index 50e16b3cebcf42..f2deb664e98021 100644 --- a/Mathlib/Algebra/Module/MinimalAxioms.lean +++ b/Mathlib/Algebra/Module/MinimalAxioms.lean @@ -3,7 +3,9 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Martin C. Martin -/ -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Algebra.Module.Defs /-! # Minimal Axioms for a Module @@ -18,6 +20,8 @@ This file defines a constructor to define a `Module` structure on a Type with an -/ +@[expose] public section + universe u v /-- Define a `Module` structure on a Type by proving a minimized set of axioms. -/ diff --git a/Mathlib/Algebra/Module/NatInt.lean b/Mathlib/Algebra/Module/NatInt.lean index 2726b7cd9f0506..47fdc48104ecb0 100644 --- a/Mathlib/Algebra/Module/NatInt.lean +++ b/Mathlib/Algebra/Module/NatInt.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Module.Defs -import Mathlib.Data.Int.Cast.Lemmas +module + +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Data.Int.Cast.Lemmas /-! # Modules over `ℕ` and `ℤ` @@ -25,6 +27,8 @@ This file concerns modules where the scalars are the natural numbers or the inte semimodule, module, vector space -/ +@[expose] public section + assert_not_exists RelIso Field Invertible Multiset Pi.single_smul₀ Set.indicator open Function Set diff --git a/Mathlib/Algebra/Module/Opposite.lean b/Mathlib/Algebra/Module/Opposite.lean index 6671b194e4c9cf..ecca770b14df8c 100644 --- a/Mathlib/Algebra/Module/Opposite.lean +++ b/Mathlib/Algebra/Module/Opposite.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Action.Opposite -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Ring.Opposite +module + +public import Mathlib.Algebra.GroupWithZero.Action.Opposite +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Ring.Opposite /-! # Module operations on `Mᵐᵒᵖ` @@ -14,6 +16,8 @@ This file contains definitions that build on top of the group action definitions `Mathlib/Algebra/GroupWithZero/Action/Opposite.lean`. -/ +@[expose] public section + assert_not_exists LinearMap section diff --git a/Mathlib/Algebra/Module/PID.lean b/Mathlib/Algebra/Module/PID.lean index a4fa3719978c4f..fde80383c60b31 100644 --- a/Mathlib/Algebra/Module/PID.lean +++ b/Mathlib/Algebra/Module/PID.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pierre-Alexandre Bazin -/ -import Mathlib.Algebra.Module.DedekindDomain -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.Algebra.Module.Projective -import Mathlib.Algebra.Category.ModuleCat.Biproducts -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Algebra.Module.DedekindDomain +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.Algebra.Module.Projective +public import Mathlib.Algebra.Category.ModuleCat.Biproducts +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Structure of finitely generated modules over a PID @@ -45,6 +47,8 @@ Then we get the general result using that a torsion free module is free (which h Finitely generated module, principal ideal domain, classification, structure theorem -/ +@[expose] public section + -- We shouldn't need to know about topology to prove -- the structure theorem for finitely generated modules over a PID. assert_not_exists TopologicalSpace diff --git a/Mathlib/Algebra/Module/PUnit.lean b/Mathlib/Algebra/Module/PUnit.lean index 97329efc031a23..f74e2665c37c5a 100644 --- a/Mathlib/Algebra/Module/PUnit.lean +++ b/Mathlib/Algebra/Module/PUnit.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.Algebra.Ring.PUnit +module + +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.Algebra.Ring.PUnit /-! # Instances on PUnit @@ -13,6 +15,8 @@ import Mathlib.Algebra.Ring.PUnit This file collects facts about module structures on the one-element type -/ +@[expose] public section + namespace PUnit variable {R S : Type*} diff --git a/Mathlib/Algebra/Module/Pi.lean b/Mathlib/Algebra/Module/Pi.lean index 73fb20b65fdc08..c27c0fefb65d6a 100644 --- a/Mathlib/Algebra/Module/Pi.lean +++ b/Mathlib/Algebra/Module/Pi.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.GroupWithZero.Action.Pi -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Regular.SMul -import Mathlib.Algebra.Ring.Pi +module + +public import Mathlib.Algebra.GroupWithZero.Action.Pi +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Regular.SMul +public import Mathlib.Algebra.Ring.Pi /-! # Pi instances for modules @@ -14,6 +16,8 @@ import Mathlib.Algebra.Ring.Pi This file defines instances for module and related structures on Pi Types -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Module/PointwisePi.lean b/Mathlib/Algebra/Module/PointwisePi.lean index 40379da001d397..dbb80cdd9a6c12 100644 --- a/Mathlib/Algebra/Module/PointwisePi.lean +++ b/Mathlib/Algebra/Module/PointwisePi.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Scalar +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar /-! # Pointwise actions on sets in Pi types @@ -18,6 +20,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, -/ +@[expose] public section + open Pointwise open Set diff --git a/Mathlib/Algebra/Module/Presentation/Basic.lean b/Mathlib/Algebra/Module/Presentation/Basic.lean index cd3c122cde379c..eee05016a6ae26 100644 --- a/Mathlib/Algebra/Module/Presentation/Basic.lean +++ b/Mathlib/Algebra/Module/Presentation/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Exact -import Mathlib.Algebra.Module.ULift -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.LinearAlgebra.Finsupp.LinearCombination +module + +public import Mathlib.Algebra.Exact +public import Mathlib.Algebra.Module.ULift +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination /-! # Presentations of modules @@ -36,6 +38,8 @@ generators and relations. -/ +@[expose] public section + assert_not_exists Cardinal universe w' w'' w₀ w₁ v'' v' v u diff --git a/Mathlib/Algebra/Module/Presentation/Cokernel.lean b/Mathlib/Algebra/Module/Presentation/Cokernel.lean index d9f2c84e6cd05a..5e7bd266e20efd 100644 --- a/Mathlib/Algebra/Module/Presentation/Cokernel.lean +++ b/Mathlib/Algebra/Module/Presentation/Cokernel.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Module.Presentation.Basic +module + +public import Mathlib.Algebra.Module.Presentation.Basic /-! # Presentation of a cokernel @@ -24,6 +26,8 @@ we obtain a presentation of `M₃`, see `Presentation.ofExact`. -/ +@[expose] public section + universe w w₁ w₂₀ w₂₁ v₁ v₂ v₃ u namespace Module diff --git a/Mathlib/Algebra/Module/Presentation/Differentials.lean b/Mathlib/Algebra/Module/Presentation/Differentials.lean index 58e900d4b79c49..11cf7a8a8251d4 100644 --- a/Mathlib/Algebra/Module/Presentation/Differentials.lean +++ b/Mathlib/Algebra/Module/Presentation/Differentials.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.RingTheory.Kaehler.Polynomial -import Mathlib.RingTheory.Extension.Cotangent.Basic -import Mathlib.RingTheory.Extension.Presentation.Basic +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.RingTheory.Kaehler.Polynomial +public import Mathlib.RingTheory.Extension.Cotangent.Basic +public import Mathlib.RingTheory.Extension.Presentation.Basic /-! # Presentation of the module of differentials @@ -31,6 +32,8 @@ from the file `Mathlib/RingTheory/Kaehler/CotangentComplex.lean`. -/ +@[expose] public section + open Module universe w' t w u v diff --git a/Mathlib/Algebra/Module/Presentation/DirectSum.lean b/Mathlib/Algebra/Module/Presentation/DirectSum.lean index 673880af26a323..4b889999a013fb 100644 --- a/Mathlib/Algebra/Module/Presentation/DirectSum.lean +++ b/Mathlib/Algebra/Module/Presentation/DirectSum.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Data.Finsupp.ToDFinsupp +module + +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Data.Finsupp.ToDFinsupp /-! # Presentation of a direct sum @@ -17,6 +19,8 @@ a presentation of `ι →₀ M`. -/ +@[expose] public section + universe w' w₀ w₁ w v u namespace Module diff --git a/Mathlib/Algebra/Module/Presentation/Finite.lean b/Mathlib/Algebra/Module/Presentation/Finite.lean index fa50407683fcbe..1311dda7b45a74 100644 --- a/Mathlib/Algebra/Module/Presentation/Finite.lean +++ b/Mathlib/Algebra/Module/Presentation/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.Algebra.Module.FinitePresentation +module + +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.Algebra.Module.FinitePresentation /-! # Characterization of finitely presented modules @@ -14,6 +16,8 @@ it admits a presentation with finitely many generators and relations. -/ +@[expose] public section + universe w₀ w₁ v u namespace Module diff --git a/Mathlib/Algebra/Module/Presentation/Free.lean b/Mathlib/Algebra/Module/Presentation/Free.lean index e88a04b51493bc..8680c4ca1848bb 100644 --- a/Mathlib/Algebra/Module/Presentation/Free.lean +++ b/Mathlib/Algebra/Module/Presentation/Free.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.Logic.UnivLE +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.Logic.UnivLE /-! # Presentation of free modules @@ -17,6 +18,8 @@ see `Module.free_iff_exists_presentation`. -/ +@[expose] public section + assert_not_exists Cardinal universe w w₀ w₁ v u diff --git a/Mathlib/Algebra/Module/Presentation/RestrictScalars.lean b/Mathlib/Algebra/Module/Presentation/RestrictScalars.lean index e70e369b2fb9c6..151e13dbf23626 100644 --- a/Mathlib/Algebra/Module/Presentation/RestrictScalars.lean +++ b/Mathlib/Algebra/Module/Presentation/RestrictScalars.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Module.Presentation.DirectSum -import Mathlib.Algebra.Module.Presentation.Cokernel +module + +public import Mathlib.Algebra.Module.Presentation.DirectSum +public import Mathlib.Algebra.Module.Presentation.Cokernel /-! # Presentation of the restriction of scalars of a module @@ -19,6 +21,8 @@ a presentation of `B` as a `A`-module (and some additional data). -/ +@[expose] public section + namespace Module variable {B : Type*} [Ring B] {M : Type*} [AddCommGroup M] [Module B M] diff --git a/Mathlib/Algebra/Module/Presentation/Tautological.lean b/Mathlib/Algebra/Module/Presentation/Tautological.lean index 97e54cc2295400..b724c1b24817f8 100644 --- a/Mathlib/Algebra/Module/Presentation/Tautological.lean +++ b/Mathlib/Algebra/Module/Presentation/Tautological.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.Algebra.Module.Presentation.Basic /-! # The tautological presentation of a module @@ -15,6 +16,8 @@ Given an `A`-module `M`, we provide its tautological presentation: -/ +@[expose] public section + universe w v u namespace Module diff --git a/Mathlib/Algebra/Module/Presentation/Tensor.lean b/Mathlib/Algebra/Module/Presentation/Tensor.lean index dfd33c564834db..01740d716ac87c 100644 --- a/Mathlib/Algebra/Module/Presentation/Tensor.lean +++ b/Mathlib/Algebra/Module/Presentation/Tensor.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.LinearAlgebra.TensorProduct.Basic +module + +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Basic /-! # Presentation of the tensor product of two modules @@ -13,6 +15,8 @@ Given presentations of two `A`-modules `M₁` and `M₂`, we obtain a presentati -/ +@[expose] public section + universe w w₁₀ w₁₁ w₂₀ w₂₁ u v₁ v₂ namespace Module diff --git a/Mathlib/Algebra/Module/Prod.lean b/Mathlib/Algebra/Module/Prod.lean index 62fe11801adeee..6143b71444e0aa 100644 --- a/Mathlib/Algebra/Module/Prod.lean +++ b/Mathlib/Algebra/Module/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Action.Prod -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.Prod +public import Mathlib.Algebra.Module.Defs /-! # Prod instances for module and multiplicative actions @@ -12,6 +14,8 @@ import Mathlib.Algebra.Module.Defs This file defines instances for binary product of modules -/ +@[expose] public section + variable {R : Type*} {M : Type*} {N : Type*} diff --git a/Mathlib/Algebra/Module/Projective.lean b/Mathlib/Algebra/Module/Projective.lean index 0a193e42c25525..19d9c93715ca54 100644 --- a/Mathlib/Algebra/Module/Projective.lean +++ b/Mathlib/Algebra/Module/Projective.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Antoine Labelle -/ -import Mathlib.Algebra.Module.Shrink -import Mathlib.LinearAlgebra.TensorProduct.Basis -import Mathlib.Logic.UnivLE +module + +public import Mathlib.Algebra.Module.Shrink +public import Mathlib.LinearAlgebra.TensorProduct.Basis +public import Mathlib.Logic.UnivLE /-! @@ -59,6 +61,8 @@ projective module -/ +@[expose] public section + universe w v u open LinearMap hiding id diff --git a/Mathlib/Algebra/Module/Rat.lean b/Mathlib/Algebra/Module/Rat.lean index 303768c7867bd3..96c6817c1ee3bd 100644 --- a/Mathlib/Algebra/Module/Rat.lean +++ b/Mathlib/Algebra/Module/Rat.lean @@ -3,14 +3,18 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Module.Basic -import Mathlib.Algebra.Module.End -import Mathlib.Algebra.Field.Rat +module + +public import Mathlib.Algebra.Module.Basic +public import Mathlib.Algebra.Module.End +public import Mathlib.Algebra.Field.Rat /-! # Basic results about modules over the rationals. -/ +@[expose] public section + universe u v variable {M M₂ : Type*} diff --git a/Mathlib/Algebra/Module/RingHom.lean b/Mathlib/Algebra/Module/RingHom.lean index 1fa13009342d84..f2c66c48d2bfee 100644 --- a/Mathlib/Algebra/Module/RingHom.lean +++ b/Mathlib/Algebra/Module/RingHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Action.End -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Ring.Hom.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.End +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Ring.Hom.Defs /-! # Composing modules with a ring hom @@ -20,6 +22,8 @@ import Mathlib.Algebra.Ring.Hom.Defs semimodule, module, vector space -/ +@[expose] public section + assert_not_exists Field Invertible Multiset Pi.single_smul₀ Set.indicator open Function Set diff --git a/Mathlib/Algebra/Module/Shrink.lean b/Mathlib/Algebra/Module/Shrink.lean index 785fdcad6a9fb6..65f85f3f1565c5 100644 --- a/Mathlib/Algebra/Module/Shrink.lean +++ b/Mathlib/Algebra/Module/Shrink.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Shrink -import Mathlib.Algebra.Module.TransferInstance +module + +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.Algebra.Module.TransferInstance /-! # Transfer module and algebra structures from `α` to `Shrink α` -/ +@[expose] public section + -- FIXME: `to_additive` is incompatible with `noncomputable section`. -- See https://github.com/leanprover-community/mathlib4/issues/1074. suppress_compilation diff --git a/Mathlib/Algebra/Module/SnakeLemma.lean b/Mathlib/Algebra/Module/SnakeLemma.lean index a18ceb6bede8b1..2afbf3a399239a 100644 --- a/Mathlib/Algebra/Module/SnakeLemma.lean +++ b/Mathlib/Algebra/Module/SnakeLemma.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Exact +module + +public import Mathlib.Algebra.Exact /-! @@ -19,6 +21,8 @@ categories, but for definitional equality and universe issues we reprove them he -/ +@[expose] public section + open LinearMap hiding id open Function diff --git a/Mathlib/Algebra/Module/SpanRank.lean b/Mathlib/Algebra/Module/SpanRank.lean index efdd980af33e30..f894195d05c718 100644 --- a/Mathlib/Algebra/Module/SpanRank.lean +++ b/Mathlib/Algebra/Module/SpanRank.lean @@ -3,11 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wanyi He, Jiedong Jiang, Xuchun Li, Christian Merten, Jingting Wang, Andrew Yang -/ -import Mathlib.Data.Set.Card -import Mathlib.Data.ENat.Lattice -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +module + +public import Mathlib.Data.ENat.Lattice +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.RingTheory.Finiteness.Ideal /-! # Minimum Cardinality of generating set of a submodule @@ -47,6 +47,8 @@ submodule, so there is some asymmetry here. Further refactoring might be needed creates a friction later on. -/ +@[expose] public section + namespace Submodule section Defs @@ -114,6 +116,12 @@ lemma spanRank_finite_iff_fg {p : Submodule R M} : p.spanRank < aleph0 ↔ p.FG · rintro ⟨s, hs₁, hs₂⟩ exact (ciInf_le' _ ⟨s, hs₂⟩).trans_lt (by simpa) +lemma spanFinrank_of_not_fg {p : Submodule R M} (hp : ¬p.FG) : p.spanFinrank = 0 := by + refine toNat_eq_zero.2 ?_ + right + by_contra! h + exact hp (spanRank_finite_iff_fg.1 h) + /-- A submodule is finitely generated if and only if its `spanRank` is equal to its `spanFinrank`. -/ lemma fg_iff_spanRank_eq_spanFinrank {p : Submodule R M} : p.spanRank = p.spanFinrank ↔ p.FG := by @@ -243,15 +251,58 @@ lemma spanFinrank_singleton {m : M} (hm : m ≠ 0) : (span R {m}).spanFinrank = simp [Submodule.spanFinrank_eq_zero_iff_eq_bot (fg_span_singleton m), hm] at this end Defs + end Submodule +section map + +universe u +section Submodule + +variable {R : Type*} {M N : Type u} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] + [Module R N] (f : M →ₗ[R] N) (p : Submodule R M) + +lemma Submodule.spanRank_map_le : (p.map f).spanRank ≤ p.spanRank := by + rw [← generators_card p, FG.spanRank_le_iff_exists_span_set_card_le] + exact ⟨f '' p.generators, Cardinal.mk_image_le, le_antisymm (span_le.2 (fun n ⟨m, hm, h⟩ ↦ + ⟨m, span_generators p ▸ subset_span hm, h⟩)) (by simp [span_generators])⟩ + +variable {p} in +lemma Submodule.spanFinrank_map_le_of_fg (hp : p.FG) : (p.map f).spanFinrank ≤ p.spanFinrank := + (Cardinal.toNat_le_iff_le_of_lt_aleph0 (spanRank_finite_iff_fg.mpr (FG.map f hp)) + (spanRank_finite_iff_fg.mpr hp)).2 (p.spanRank_map_le f) + +end Submodule + +section Ideal + +variable {R S : Type u} [Semiring R] [Semiring S] (f : R →+* S) (I : Ideal R) + +open Submodule in +lemma Ideal.spanRank_map_le : (I.map f).spanRank ≤ I.spanRank := by + rw [← generators_card I, FG.spanRank_le_iff_exists_span_set_card_le] + refine ⟨f '' I.generators, Cardinal.mk_image_le, le_antisymm (span_le.2 (fun s ⟨r, hr, hfr⟩ ↦ + hfr ▸ mem_map_of_mem _ <| span_generators I ▸ subset_span hr)) ?_⟩ + refine map_le_of_le_comap (fun r hr ↦ ?_) + simp only [submodule_span_eq, mem_comap] + rw [← map_span, ← submodule_span_eq, span_generators] + exact mem_map_of_mem f hr + +open Submodule in +variable {I} in +lemma Ideal.spanFinrank_map_le_of_fg (hI : I.FG) : (I.map f).spanFinrank ≤ I.spanFinrank := + (Cardinal.toNat_le_iff_le_of_lt_aleph0 (spanRank_finite_iff_fg.mpr (Ideal.FG.map hI f)) + ((spanRank_finite_iff_fg.mpr hI))).2 (spanRank_map_le f I) + +end Ideal + +end map + section rank open Cardinal Module Submodule -universe u v w - -variable {R : Type u} {M : Type v} [Semiring R] [AddCommMonoid M] [Module R M] +variable {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] lemma Module.Basis.mk_eq_spanRank [RankCondition R] {ι : Type*} (v : Basis ι R M) : #(Set.range v) = (⊤ : Submodule R M).spanRank := by diff --git a/Mathlib/Algebra/Module/Submodule/Basic.lean b/Mathlib/Algebra/Module/Submodule/Basic.lean index 6898c548580504..585b45c1bc481d 100644 --- a/Mathlib/Algebra/Module/Submodule/Basic.lean +++ b/Mathlib/Algebra/Module/Submodule/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Submodules of a module @@ -21,6 +23,8 @@ As such it is a good target for organizing and splitting further. submodule, subspace, linear map -/ +@[expose] public section + open Function universe u'' u' u v w diff --git a/Mathlib/Algebra/Module/Submodule/Bilinear.lean b/Mathlib/Algebra/Module/Submodule/Bilinear.lean index b917236c820337..c23edbb308c2eb 100644 --- a/Mathlib/Algebra/Module/Submodule/Bilinear.lean +++ b/Mathlib/Algebra/Module/Submodule/Bilinear.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Eric Wieser -/ -import Mathlib.LinearAlgebra.Span.Basic -import Mathlib.LinearAlgebra.BilinearMap +module + +public import Mathlib.LinearAlgebra.Span.Basic +public import Mathlib.LinearAlgebra.BilinearMap /-! # Images of pairs of submodules under bilinear maps @@ -26,6 +28,8 @@ Please keep them in sync. Generalize this file to semilinear maps. -/ +@[expose] public section + universe uι u v diff --git a/Mathlib/Algebra/Module/Submodule/Defs.lean b/Mathlib/Algebra/Module/Submodule/Defs.lean index c54ffb5b06d8b7..98cde53ac0161b 100644 --- a/Mathlib/Algebra/Module/Submodule/Defs.lean +++ b/Mathlib/Algebra/Module/Submodule/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.Algebra.Group.Submonoid.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.Algebra.Group.Submonoid.Basic /-! @@ -23,6 +25,8 @@ In this file we define submodule, subspace, linear map -/ +@[expose] public section + assert_not_exists DivisionRing open Function diff --git a/Mathlib/Algebra/Module/Submodule/EqLocus.lean b/Mathlib/Algebra/Module/Submodule/EqLocus.lean index 1462cc65e63d66..a33162f313e46e 100644 --- a/Mathlib/Algebra/Module/Submodule/EqLocus.lean +++ b/Mathlib/Algebra/Module/Submodule/EqLocus.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Module.Submodule.Ker +module + +public import Mathlib.Algebra.Module.Submodule.Ker /-! # The submodule of elements `x : M` such that `f x = g x` @@ -17,6 +19,8 @@ linear algebra, vector space, module -/ +@[expose] public section + variable {R : Type*} {R₂ : Type*} variable {M : Type*} {M₂ : Type*} diff --git a/Mathlib/Algebra/Module/Submodule/Equiv.lean b/Mathlib/Algebra/Module/Submodule/Equiv.lean index 5c804f8cb36009..4de5021d3345d7 100644 --- a/Mathlib/Algebra/Module/Submodule/Equiv.lean +++ b/Mathlib/Algebra/Module/Submodule/Equiv.lean @@ -4,10 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.Submodule.Range +module + +public import Mathlib.Algebra.Module.Submodule.Range /-! ### Linear equivalences involving submodules -/ +@[expose] public section + open Function variable {R : Type*} {R₁ : Type*} {R₂ : Type*} {R₃ : Type*} diff --git a/Mathlib/Algebra/Module/Submodule/Invariant.lean b/Mathlib/Algebra/Module/Submodule/Invariant.lean index 3c56beb586f285..a0803321e2e74d 100644 --- a/Mathlib/Algebra/Module/Submodule/Invariant.lean +++ b/Mathlib/Algebra/Module/Submodule/Invariant.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.Submodule.Map -import Mathlib.LinearAlgebra.Span.Defs -import Mathlib.Order.Sublattice +module + +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.Submodule.Map +public import Mathlib.LinearAlgebra.Span.Defs +public import Mathlib.Order.Sublattice /-! # The lattice of invariant submodules @@ -19,6 +21,8 @@ See also `Mathlib/Algebra/Polynomial/Module/AEval.lean`. -/ +@[expose] public section + open Submodule (span) namespace Module.End diff --git a/Mathlib/Algebra/Module/Submodule/IterateMapComap.lean b/Mathlib/Algebra/Module/Submodule/IterateMapComap.lean index 566ed459806f03..669f714ed2679d 100644 --- a/Mathlib/Algebra/Module/Submodule/IterateMapComap.lean +++ b/Mathlib/Algebra/Module/Submodule/IterateMapComap.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Module.Submodule.Ker +module + +public import Mathlib.Algebra.Module.Submodule.Ker /-! @@ -30,6 +32,8 @@ The construction here is adapted from the proof in Djoković's paper -/ +@[expose] public section + open Function Submodule namespace LinearMap diff --git a/Mathlib/Algebra/Module/Submodule/Ker.lean b/Mathlib/Algebra/Module/Submodule/Ker.lean index e8797a18bfcf46..54d323c6d96afa 100644 --- a/Mathlib/Algebra/Module/Submodule/Ker.lean +++ b/Mathlib/Algebra/Module/Submodule/Ker.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Algebra.Module.Submodule.Map +module + +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Algebra.Module.Submodule.Map /-! # Kernel of a linear map @@ -26,6 +28,8 @@ linear algebra, vector space, module -/ +@[expose] public section + open Function open Pointwise diff --git a/Mathlib/Algebra/Module/Submodule/Lattice.lean b/Mathlib/Algebra/Module/Submodule/Lattice.lean index 30ff941c890d87..b737d48882e48a 100644 --- a/Mathlib/Algebra/Module/Submodule/Lattice.lean +++ b/Mathlib/Algebra/Module/Submodule/Lattice.lean @@ -3,15 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.PUnit -import Mathlib.Data.Set.Subsingleton -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.PUnit +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # The lattice structure on `Submodule`s @@ -30,6 +32,8 @@ to unify the APIs where possible. -/ +@[expose] public section + universe v variable {R S M : Type*} @@ -76,7 +80,6 @@ instance uniqueBot : Unique (⊥ : Submodule R M) := ⟨inferInstance, fun x ↦ Subtype.ext <| (mem_bot R).1 x.mem⟩ instance : OrderBot (Submodule R M) where - bot := ⊥ bot_le p x := by simp +contextual [zero_mem] protected theorem eq_bot_iff (p : Submodule R M) : p = ⊥ ↔ ∀ x ∈ p, x = (0 : M) := @@ -145,7 +148,6 @@ theorem mem_top {x : M} : x ∈ (⊤ : Submodule R M) := trivial instance : OrderTop (Submodule R M) where - top := ⊤ le_top _ _ _ := trivial theorem eq_top_iff' {p : Submodule R M} : p = ⊤ ↔ ∀ x, x ∈ p := diff --git a/Mathlib/Algebra/Module/Submodule/LinearMap.lean b/Mathlib/Algebra/Module/Submodule/LinearMap.lean index d121bb863f0ed0..2e542632d2331d 100644 --- a/Mathlib/Algebra/Module/Submodule/LinearMap.lean +++ b/Mathlib/Algebra/Module/Submodule/LinearMap.lean @@ -3,10 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ +module -import Mathlib.Algebra.Module.LinearMap.End -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Algebra.Module.LinearMap.End +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! @@ -28,6 +29,8 @@ In this file we define a number of linear maps involving submodules of a module. submodule, subspace, linear map -/ +@[expose] public section + open Function Set universe u'' u' u v w diff --git a/Mathlib/Algebra/Module/Submodule/Map.lean b/Mathlib/Algebra/Module/Submodule/Map.lean index cb8febfe49605d..646c7388b61a06 100644 --- a/Mathlib/Algebra/Module/Submodule/Map.lean +++ b/Mathlib/Algebra/Module/Submodule/Map.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Group.Subgroup.Map -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.Algebra.Module.Submodule.LinearMap +module + +public import Mathlib.Algebra.Group.Subgroup.Map +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.Algebra.Module.Submodule.LinearMap /-! # `map` and `comap` for `Submodule`s @@ -24,6 +26,8 @@ import Mathlib.Algebra.Module.Submodule.LinearMap submodule, subspace, linear map, pushforward, pullback -/ +@[expose] public section + open Function Pointwise Set variable {R : Type*} {R₁ : Type*} {R₂ : Type*} {R₃ : Type*} diff --git a/Mathlib/Algebra/Module/Submodule/Order.lean b/Mathlib/Algebra/Module/Submodule/Order.lean index de41661261ce75..a2d2ea40f334a1 100644 --- a/Mathlib/Algebra/Module/Submodule/Order.lean +++ b/Mathlib/Algebra/Module/Submodule/Order.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.Algebra.Order.Monoid.Basic +module + +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.Algebra.Order.Monoid.Basic /-! # Ordered instances on submodules -/ +@[expose] public section + namespace Submodule variable {R M : Type*} diff --git a/Mathlib/Algebra/Module/Submodule/Pointwise.lean b/Mathlib/Algebra/Module/Submodule/Pointwise.lean index 87f31b33dfc93c..069c7030301b04 100644 --- a/Mathlib/Algebra/Module/Submodule/Pointwise.lean +++ b/Mathlib/Algebra/Module/Submodule/Pointwise.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jujian Zhang -/ -import Mathlib.Algebra.GroupWithZero.Subgroup -import Mathlib.Algebra.Order.Group.Action -import Mathlib.LinearAlgebra.Finsupp.Supported -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Subgroup +public import Mathlib.Algebra.Order.Group.Action +public import Mathlib.LinearAlgebra.Finsupp.Supported +public import Mathlib.LinearAlgebra.Span.Basic /-! # Pointwise instances on `Submodule`s @@ -39,6 +41,8 @@ Other than section `set_acting_on_submodules`, most of the lemmas in this file a lemmas from the file `Mathlib/Algebra/Group/Submonoid/Pointwise.lean`. -/ +@[expose] public section + assert_not_exists Ideal variable {α : Type*} {R : Type*} {M : Type*} diff --git a/Mathlib/Algebra/Module/Submodule/Range.lean b/Mathlib/Algebra/Module/Submodule/Range.lean index 73826cb1de6560..dede3b070ac8d7 100644 --- a/Mathlib/Algebra/Module/Submodule/Range.lean +++ b/Mathlib/Algebra/Module/Submodule/Range.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.Submodule.Ker -import Mathlib.Algebra.Module.Submodule.RestrictScalars -import Mathlib.Data.Set.Finite.Range +module + +public import Mathlib.Algebra.Module.Submodule.Ker +public import Mathlib.Algebra.Module.Submodule.RestrictScalars +public import Mathlib.Data.Set.Finite.Range /-! # Range of linear maps @@ -27,6 +29,8 @@ Note that this also means that dot notation (i.e. `f.range` for a linear map `f` linear algebra, vector space, module, range -/ +@[expose] public section + open Function variable {R : Type*} {R₂ : Type*} {R₃ : Type*} diff --git a/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean b/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean index e8a669cb2926b7..ff1cb21e249407 100644 --- a/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean +++ b/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Andrew Yang, Johannes Hölzl, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.Order.Hom.CompleteLattice +module + +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.Order.Hom.CompleteLattice /-! @@ -20,6 +22,8 @@ this restriction of scalars for submodules. -/ +@[expose] public section + namespace Submodule variable (S : Type*) {R M : Type*} [Semiring R] [AddCommMonoid M] [Semiring S] diff --git a/Mathlib/Algebra/Module/Submodule/Union.lean b/Mathlib/Algebra/Module/Submodule/Union.lean index c9a549a03fc951..6d64c940a1c60b 100644 --- a/Mathlib/Algebra/Module/Submodule/Union.lean +++ b/Mathlib/Algebra/Module/Submodule/Union.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.Data.Set.Card -import Mathlib.LinearAlgebra.Dual.Defs -import Mathlib.Tactic.Module +module + +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.Data.Set.Card +public import Mathlib.LinearAlgebra.Dual.Defs +public import Mathlib.Tactic.Module /-! # Unions of `Submodule`s @@ -19,6 +21,8 @@ a proper subset, provided the coefficients are a sufficiently large field. -/ +@[expose] public section + open Function Set variable {ι K M : Type*} [Field K] [AddCommGroup M] [Module K M] diff --git a/Mathlib/Algebra/Module/Torsion/Basic.lean b/Mathlib/Algebra/Module/Torsion/Basic.lean index 8ffcc5b73520d8..898a37d668acb6 100644 --- a/Mathlib/Algebra/Module/Torsion/Basic.lean +++ b/Mathlib/Algebra/Module/Torsion/Basic.lean @@ -3,16 +3,18 @@ Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pierre-Alexandre Bazin -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.Module.ZMod -import Mathlib.Algebra.Regular.Opposite -import Mathlib.GroupTheory.Torsion -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.RingTheory.Coprime.Ideal -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.Module.ZMod +public import Mathlib.Algebra.Regular.Opposite +public import Mathlib.GroupTheory.Torsion +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.RingTheory.Coprime.Ideal +public import Mathlib.RingTheory.Finiteness.Defs +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Torsion submodules @@ -68,6 +70,8 @@ import Mathlib.RingTheory.SimpleModule.Basic Torsion, submodule, module, quotient -/ +@[expose] public section + namespace Ideal section TorsionOf @@ -921,7 +925,7 @@ macro_rules | `($A[$n]) => `(torsionBy $A $n) /-- Unexpander for `torsionBy`. -/ @[scoped app_unexpander torsionBy] -def torsionByUnexpander : Lean.PrettyPrinter.Unexpander +meta def torsionByUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $A $n) => `($A[$n]) | _ => throw () diff --git a/Mathlib/Algebra/Module/Torsion/Field.lean b/Mathlib/Algebra/Module/Torsion/Field.lean index 8fe725cc8c6a4f..33cacce0583e67 100644 --- a/Mathlib/Algebra/Module/Torsion/Field.lean +++ b/Mathlib/Algebra/Module/Torsion/Field.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.Module.Torsion.Free +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.Module.Torsion.Free /-! # Vector spaces are torsion-free @@ -15,6 +17,8 @@ In this file, we show that any module over a division semiring is torsion-free. Note that more generally any reflexive module is torsion-free. -/ +@[expose] public section + open Module variable {𝕜 M : Type*} [DivisionSemiring 𝕜] [AddCommMonoid M] [Module 𝕜 M] diff --git a/Mathlib/Algebra/Module/Torsion/Free.lean b/Mathlib/Algebra/Module/Torsion/Free.lean index a6b0dbc5027fd2..9d0e5de7908ebe 100644 --- a/Mathlib/Algebra/Module/Torsion/Free.lean +++ b/Mathlib/Algebra/Module/Torsion/Free.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.Module.Opposite -import Mathlib.Algebra.Regular.Opposite -import Mathlib.Algebra.Regular.SMul +module + +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.Algebra.Regular.Opposite +public import Mathlib.Algebra.Regular.SMul /-! # Torsion-free modules @@ -21,15 +23,18 @@ If furthermore the base ring is a domain, this is equivalent to the naïve `r • m = 0 ↔ r = 0 ∨ m = 0` definition. -/ +@[expose] public section + open Module -variable {R M N : Type*} +variable {R S M N : Type*} section Semiring -variable [Semiring R] +variable [Semiring R] [Semiring S] section AddCommMonoid -variable [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] {r : R} {m m₁ m₂ : M} +variable [AddCommMonoid M] [Module R M] [Module S M] [AddCommMonoid N] [Module R N] + {r : R} {m m₁ m₂ : M} variable (R M) in /-- A `R`-module `M` is torsion-free if scalar multiplication by an element `r : R` is injective if @@ -53,6 +58,9 @@ lemma Function.Injective.moduleIsTorsionFree [IsTorsionFree R N] (f : M → N) ( instance IsAddTorsionFree.to_isTorsionFree_nat [IsAddTorsionFree M] : IsTorsionFree ℕ M where isSMulRegular n hn := nsmul_right_injective (by simpa [isRegular_iff_ne_zero] using hn) +instance Subsingleton.to_moduleIsTorsionFree [Subsingleton M] : IsTorsionFree R M where + isSMulRegular _ _ := Function.injective_of_subsingleton _ + variable [IsTorsionFree R M] variable (M) in @@ -68,6 +76,14 @@ protected lemma IsRegular.smul_right_injective (hr : IsRegular r) : ((r • ·) protected lemma IsRegular.smul_ne_zero_iff_right (hr : IsRegular r) : r • m ≠ 0 ↔ m ≠ 0 := hr.smul_eq_zero_iff_right.ne +variable (R) in +lemma Module.IsTorsionFree.trans [Module S R] [IsTorsionFree S R] [IsScalarTower S R R] + [SMulCommClass S R R] [IsScalarTower S R M] : IsTorsionFree S M where + isSMulRegular s hs x y hxy := by + refine (?_ : IsRegular (s • 1 : R)).isSMulRegular (by simpa using hxy) + exact ⟨fun x y hxy ↦ hs.isSMulRegular <| by simpa using hxy, + fun x y hxy ↦ hs.isSMulRegular <| by simpa using hxy⟩ + variable [IsDomain R] lemma IsSMulRegular.of_ne_zero (hr : r ≠ 0) : IsSMulRegular M r := diff --git a/Mathlib/Algebra/Module/Torsion/Pi.lean b/Mathlib/Algebra/Module/Torsion/Pi.lean index 637d5fb4458c97..76e7192b665431 100644 --- a/Mathlib/Algebra/Module/Torsion/Pi.lean +++ b/Mathlib/Algebra/Module/Torsion/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Module.Torsion.Free -import Mathlib.Algebra.Module.Pi +module + +public import Mathlib.Algebra.Module.Torsion.Free +public import Mathlib.Algebra.Module.Pi /-! # Product of torsion-free modules @@ -12,6 +14,8 @@ import Mathlib.Algebra.Module.Pi This file shows that the product of torsion-free modules is torsion-free. -/ +@[expose] public section + open Module variable {ι R : Type*} {M : ι → Type*} diff --git a/Mathlib/Algebra/Module/Torsion/Prod.lean b/Mathlib/Algebra/Module/Torsion/Prod.lean index 6b3a0ef2d4fd9a..27d1b9a7d3ee29 100644 --- a/Mathlib/Algebra/Module/Torsion/Prod.lean +++ b/Mathlib/Algebra/Module/Torsion/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Module.Prod -import Mathlib.Algebra.Module.Torsion.Free +module + +public import Mathlib.Algebra.Module.Prod +public import Mathlib.Algebra.Module.Torsion.Free /-! # Product of torsion-free modules @@ -12,6 +14,8 @@ import Mathlib.Algebra.Module.Torsion.Free This file shows that the product of two torsion-free modules is torsion-free. -/ +@[expose] public section + open Module variable {R M N : Type*} diff --git a/Mathlib/Algebra/Module/TransferInstance.lean b/Mathlib/Algebra/Module/TransferInstance.lean index 44e59816396ad2..90b793ec1d0e02 100644 --- a/Mathlib/Algebra/Module/TransferInstance.lean +++ b/Mathlib/Algebra/Module/TransferInstance.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.GroupWithZero.Action.TransferInstance -import Mathlib.Algebra.Module.Equiv.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.TransferInstance +public import Mathlib.Algebra.Module.Equiv.Defs /-! # Transfer algebraic structures across `Equiv`s @@ -12,6 +14,8 @@ import Mathlib.Algebra.Module.Equiv.Defs This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + assert_not_exists Algebra universe u v diff --git a/Mathlib/Algebra/Module/ULift.lean b/Mathlib/Algebra/Module/ULift.lean index fdc0541c24793e..d56e9e3cd517c3 100644 --- a/Mathlib/Algebra/Module/ULift.lean +++ b/Mathlib/Algebra/Module/ULift.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.GroupWithZero.ULift -import Mathlib.Algebra.Ring.ULift -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Data.ULift +module + +public import Mathlib.Algebra.GroupWithZero.ULift +public import Mathlib.Algebra.Ring.ULift +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Data.ULift /-! # `ULift` instances for module and multiplicative actions @@ -18,6 +20,8 @@ This file defines instances for module, mul_action and related structures on `UL We also provide `ULift.moduleEquiv : ULift M ≃ₗ[R] M`. -/ +@[expose] public section + namespace ULift diff --git a/Mathlib/Algebra/Module/ZLattice/Basic.lean b/Mathlib/Algebra/Module/ZLattice/Basic.lean index 215f72b6feba42..d48c19a1a442c6 100644 --- a/Mathlib/Algebra/Module/ZLattice/Basic.lean +++ b/Mathlib/Algebra/Module/ZLattice/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.LinearAlgebra.Countable -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.MeasureTheory.Group.FundamentalDomain -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.RingTheory.Localization.Module +module + +public import Mathlib.LinearAlgebra.Countable +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.MeasureTheory.Group.FundamentalDomain +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.RingTheory.Localization.Module /-! # ℤ-lattices @@ -50,6 +52,8 @@ consistent with the `ZSpan` construction of `ℤ`-lattices. -/ +@[expose] public section + noncomputable section @@ -332,7 +336,7 @@ theorem setFinite_inter [ProperSpace E] [Finite ι] {s : Set E} (hs : Bornology. theorem fundamentalDomain_measurableSet [MeasurableSpace E] [OpensMeasurableSpace E] [Finite ι] : MeasurableSet (fundamentalDomain b) := by cases nonempty_fintype ι - haveI : FiniteDimensional ℝ E := FiniteDimensional.of_fintype_basis b + haveI : FiniteDimensional ℝ E := b.finiteDimensional_of_finite let D : Set (ι → ℝ) := Set.pi Set.univ fun _ : ι => Set.Ico (0 : ℝ) 1 rw [(_ : fundamentalDomain b = b.equivFun.toLinearMap ⁻¹' D)] · refine measurableSet_preimage (LinearMap.continuous_of_finiteDimensional _).measurable ?_ @@ -365,7 +369,7 @@ theorem measure_fundamentalDomain_ne_zero [Finite ι] [MeasurableSpace E] [Borel theorem measure_fundamentalDomain [Fintype ι] [DecidableEq ι] [MeasurableSpace E] (μ : Measure E) [BorelSpace E] [Measure.IsAddHaarMeasure μ] (b₀ : Basis ι ℝ E) : μ (fundamentalDomain b) = ENNReal.ofReal |b₀.det b| * μ (fundamentalDomain b₀) := by - have : FiniteDimensional ℝ E := FiniteDimensional.of_fintype_basis b + have : FiniteDimensional ℝ E := b.finiteDimensional_of_finite convert μ.addHaar_preimage_linearEquiv (b.equiv b₀ (Equiv.refl ι)) (fundamentalDomain b₀) · rw [Set.eq_preimage_iff_image_eq (LinearEquiv.bijective _), map_fundamentalDomain, Basis.map_equiv, Equiv.refl_symm, Basis.reindex_refl] @@ -394,7 +398,7 @@ theorem fundamentalDomain_ae_parallelepiped [Fintype ι] [MeasurableSpace E] (μ [BorelSpace E] [Measure.IsAddHaarMeasure μ] : fundamentalDomain b =ᵐ[μ] parallelepiped b := by classical - have : FiniteDimensional ℝ E := FiniteDimensional.of_fintype_basis b + have : FiniteDimensional ℝ E := b.finiteDimensional_of_finite rw [← measure_symmDiff_eq_zero_iff, symmDiff_of_le (fundamentalDomain_subset_parallelepiped b)] suffices (parallelepiped b \ fundamentalDomain b) ⊆ ⋃ i, AffineSubspace.mk' (b i) (span ℝ (b '' (Set.univ \ {i}))) by diff --git a/Mathlib/Algebra/Module/ZLattice/Covolume.lean b/Mathlib/Algebra/Module/ZLattice/Covolume.lean index 5c07bd52df52cd..9856795de8781e 100644 --- a/Mathlib/Algebra/Module/ZLattice/Covolume.lean +++ b/Mathlib/Algebra/Module/ZLattice/Covolume.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Analysis.BoxIntegral.UnitPartition -import Mathlib.LinearAlgebra.FreeModule.Finite.CardQuotient -import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace +module + +public import Mathlib.Analysis.BoxIntegral.UnitPartition +public import Mathlib.LinearAlgebra.FreeModule.Finite.CardQuotient +public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace /-! # Covolume of ℤ-lattices @@ -52,6 +54,8 @@ general case, we had two primes, e.g. `covolume.tendsto_card_div_pow''`. -/ +@[expose] public section + noncomputable section namespace ZLattice diff --git a/Mathlib/Algebra/Module/ZLattice/Summable.lean b/Mathlib/Algebra/Module/ZLattice/Summable.lean index 110e3ff6feee55..e514495ed2c109 100644 --- a/Mathlib/Algebra/Module/ZLattice/Summable.lean +++ b/Mathlib/Algebra/Module/ZLattice/Summable.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.ZLattice.Basic -import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite -import Mathlib.Analysis.PSeries +module + +public import Mathlib.Algebra.Module.ZLattice.Basic +public import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite +public import Mathlib.Analysis.PSeries /-! # Convergence of `p`-series on lattices @@ -21,6 +23,8 @@ We show that `∑ z ∈ L, ‖z - x‖ʳ` is convergent for `r < -d`. -/ +@[expose] public section + noncomputable section open Module diff --git a/Mathlib/Algebra/Module/ZMod.lean b/Mathlib/Algebra/Module/ZMod.lean index b2a4ad707eda3d..e490d5bffe440a 100644 --- a/Mathlib/Algebra/Module/ZMod.lean +++ b/Mathlib/Algebra/Module/ZMod.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Lawrence Wu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lawrence Wu -/ -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.GroupTheory.Sylow +module + +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.GroupTheory.Sylow /-! # The `ZMod n`-module structure on Abelian groups whose elements have order dividing `n` -/ +@[expose] public section + assert_not_exists TwoSidedIdeal variable {n : ℕ} {M M₁ : Type*} diff --git a/Mathlib/Algebra/MonoidAlgebra/Basic.lean b/Mathlib/Algebra/MonoidAlgebra/Basic.lean index 9b40b70f50a0b6..1dd5508a1d6332 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Basic.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Basic.lean @@ -3,19 +3,24 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kim Morrison -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Algebra.MonoidAlgebra.MapDomain -import Mathlib.Algebra.MonoidAlgebra.Module -import Mathlib.Data.Finsupp.SMul -import Mathlib.LinearAlgebra.Finsupp.SumProd +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Algebra.MonoidAlgebra.MapDomain +public import Mathlib.Algebra.MonoidAlgebra.Module +public import Mathlib.Data.Finsupp.SMul +public import Mathlib.LinearAlgebra.Finsupp.SumProd /-! # Monoid algebras -/ +@[expose] public section + noncomputable section open Finset @@ -352,24 +357,25 @@ lemma mapRangeAlgHom_single (f : A →ₐ[R] B) (m : M) (a : A) : mapRangeAlgHom M f (single m a) = single m (f a) := by classical ext; simp [single_apply, apply_ite f] -variable (M) in +variable (R M) in /-- The algebra isomorphism of monoid algebras induced by an isomorphism of the base algebras. -/ @[to_additive (attr := simps apply) /-- The algebra isomorphism of additive monoid algebras induced by an isomorphism of the base algebras. -/] -noncomputable def mapRangeAlgEquiv (f : A ≃ₐ[R] B) : - MonoidAlgebra A M ≃ₐ[R] MonoidAlgebra B M where - __ := mapRangeAlgHom M f - invFun := mapRangeAlgHom M (f.symm : B →ₐ[R] A) +noncomputable def mapRangeAlgEquiv (e : A ≃ₐ[R] B) : MonoidAlgebra A M ≃ₐ[R] MonoidAlgebra B M where + __ := mapRangeAlgHom M e + invFun := mapRangeAlgHom M (e.symm : B →ₐ[R] A) left_inv _ := by aesop right_inv _ := by aesop +@[simp] lemma symm_mapRangeAlgEquiv (e : A ≃ₐ[R] B) : + (mapRangeAlgEquiv R M e).symm = mapRangeAlgEquiv R M e.symm := rfl + end mapRange section -variable (k) - +variable (k) in /-- When `V` is a `k[G]`-module, multiplication by a group element `g` is a `k`-linear map. -/ def GroupSMul.linearMap [Monoid G] [CommSemiring k] (V : Type*) [AddCommMonoid V] [Module k V] [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] (g : G) : V →ₗ[k] V where @@ -377,15 +383,13 @@ def GroupSMul.linearMap [Monoid G] [CommSemiring k] (V : Type*) [AddCommMonoid V map_add' x y := smul_add (single g (1 : k)) x y map_smul' _c _x := smul_algebra_smul_comm _ _ _ +variable (k) in @[simp] theorem GroupSMul.linearMap_apply [Monoid G] [CommSemiring k] (V : Type*) [AddCommMonoid V] [Module k V] [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] (g : G) (v : V) : (GroupSMul.linearMap k V g) v = single g (1 : k) • v := rfl -section - -variable {k} variable [Monoid G] [CommSemiring k] {V W : Type*} [AddCommMonoid V] [Module k V] [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] [AddCommMonoid W] [Module k W] [Module (MonoidAlgebra k G) W] [IsScalarTower k (MonoidAlgebra k G) W] @@ -414,7 +418,33 @@ theorem equivariantOfLinearOfComm_apply (v : V) : (equivariantOfLinearOfComm f h end -end +variable [CommMonoid M] [CommSemiring R] [CommSemiring S] [Algebra R S] + +/-- If `S` is an `R`-algebra, then `MonoidAlgebra S M` is a `MonoidAlgebra R M` algebra. + +Warning: This produces a diamond for +`Algebra (MonoidAlgebra R M) (MonoidAlgebra (MonoidAlgebra S M) M)` and another one fro +`Algebra (MonoidAlgebra R M) (MonoidAlgebra R M)`. +That's why it is not a global instance. -/ +@[to_additive +/-- If `S` is an `R`-algebra, then `S[M]` is an `R[M]`-algebra. + +Warning: This produces a diamond for `Algebra R[M] S[M][M]` and another one for `Algebra R[M] R[M]`. +That's why it is not a global instance. -/] +noncomputable abbrev algebraMonoidAlgebra : Algebra (MonoidAlgebra R M) (MonoidAlgebra S M) := + (mapRangeRingHom M (algebraMap R S)).toAlgebra + +attribute [local instance] algebraMonoidAlgebra + +@[to_additive (attr := simp)] +lemma algebraMap_def : + algebraMap (MonoidAlgebra R M) (MonoidAlgebra S M) = mapRangeRingHom M (algebraMap R S) := + rfl + +@[to_additive (dont_translate := R)] +instance [CommSemiring T] [Algebra R T] [Algebra S T] [IsScalarTower R S T] : + IsScalarTower R (MonoidAlgebra S M) (MonoidAlgebra T M) := + .of_algebraMap_eq' (mapRangeAlgHom _ (IsScalarTower.toAlgHom R S T)).comp_algebraMap.symm end MonoidAlgebra diff --git a/Mathlib/Algebra/MonoidAlgebra/Defs.lean b/Mathlib/Algebra/MonoidAlgebra/Defs.lean index f5b63084a8cc2d..b2ea21e630f2a5 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Defs.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kim Morrison -/ -import Mathlib.Algebra.Module.Defs -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Finsupp.SMulWithZero +module + +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Finsupp.SMulWithZero /-! # Monoid algebras @@ -40,6 +42,8 @@ When the domain is multiplicative, e.g. a group, this will be used to define the We introduce the notation `R[A]` for `AddMonoidAlgebra R A`. -/ +@[expose] public section + assert_not_exists NonUnitalAlgHom AlgEquiv noncomputable section @@ -70,7 +74,7 @@ macro_rules | `($R[$M]) => `(AddMonoidAlgebra $R $M) /-- Unexpander for `AddMonoidAlgebra`. -/ @[scoped app_unexpander AddMonoidAlgebra] -def unexpander : Lean.PrettyPrinter.Unexpander +meta def unexpander : Lean.PrettyPrinter.Unexpander | `($_ $k $g) => `($k[$g]) | _ => throw () diff --git a/Mathlib/Algebra/MonoidAlgebra/Degree.lean b/Mathlib/Algebra/MonoidAlgebra/Degree.lean index 9015cd88e3ac7e..b357b1e1b49236 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Degree.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Degree.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Subsemigroup.Operations -import Mathlib.Algebra.MonoidAlgebra.Support -import Mathlib.Order.Filter.Extr +module + +public import Mathlib.Algebra.Group.Subsemigroup.Operations +public import Mathlib.Algebra.MonoidAlgebra.Support +public import Mathlib.Order.Filter.Extr /-! # Lemmas about the `sup` and `inf` of the support of `AddMonoidAlgebra` @@ -17,6 +19,8 @@ The current plan is to state and prove lemmas about `Finset.sup (Finsupp.support Next, the general lemmas get specialized for some yet-to-be-defined `degree`s. -/ +@[expose] public section + variable {R R' A T B ι : Type*} @@ -24,7 +28,7 @@ namespace AddMonoidAlgebra /-! -# sup-degree and inf-degree of an `AddMonoidAlgebra` +## sup-degree and inf-degree of an `AddMonoidAlgebra` Let `R` be a semiring and let `A` be a `SemilatticeSup`. For an element `f : R[A]`, this file defines @@ -48,7 +52,7 @@ The main results are * `AddMonoidAlgebra.le_infDegree_add`: the inf-degree of a sum is at least the inf of the inf-degrees. -## Implementation notes +### Implementation notes The current plan is to state and prove lemmas about `Finset.sup (Finsupp.support f) D` with a "generic" degree/weight function `D` from the grading Type `A` to a somewhat ordered Type `B`. diff --git a/Mathlib/Algebra/MonoidAlgebra/Division.lean b/Mathlib/Algebra/MonoidAlgebra/Division.lean index 5788d87810d13c..86fcc9854eb119 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Division.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Division.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Hom.End -import Mathlib.Algebra.MonoidAlgebra.Defs +module + +public import Mathlib.Algebra.Group.Hom.End +public import Mathlib.Algebra.MonoidAlgebra.Defs /-! # Division of `AddMonoidAlgebra` by monomials @@ -35,6 +37,8 @@ likely to be very useful. -/ +@[expose] public section + variable {k G : Type*} [Semiring k] diff --git a/Mathlib/Algebra/MonoidAlgebra/Grading.lean b/Mathlib/Algebra/MonoidAlgebra/Grading.lean index baf0a9c38f6c58..637412b2b2ed78 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Grading.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Grading.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.DirectSum.Internal -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Algebra.MonoidAlgebra.Support -import Mathlib.LinearAlgebra.Finsupp.SumProd -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.Algebra.DirectSum.Internal +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Algebra.MonoidAlgebra.Support +public import Mathlib.LinearAlgebra.Finsupp.SumProd +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! # Internal grading of an `AddMonoidAlgebra` @@ -31,6 +33,8 @@ In this file, we show that an `AddMonoidAlgebra` has an internal direct sum stru is the identity. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MonoidAlgebra/Ideal.lean b/Mathlib/Algebra/MonoidAlgebra/Ideal.lean index 832475cf07b0cf..b8732d3f3f836a 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Ideal.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Ideal.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.Ideal.Span -import Mathlib.Algebra.MonoidAlgebra.Defs +module + +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.Ideal.Span +public import Mathlib.Algebra.MonoidAlgebra.Defs /-! # Lemmas about ideals of `MonoidAlgebra` and `AddMonoidAlgebra` -/ +@[expose] public section + variable {k A G : Type*} diff --git a/Mathlib/Algebra/MonoidAlgebra/Lift.lean b/Mathlib/Algebra/MonoidAlgebra/Lift.lean index f9c11017f2bae8..5e8877a73354f4 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Lift.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Lift.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kim Morrison -/ -import Mathlib.Algebra.MonoidAlgebra.Defs +module + +public import Mathlib.Algebra.MonoidAlgebra.Defs /-! # Lifting monoid algebras @@ -16,6 +18,8 @@ This file defines `liftNC`. For the definition of `MonoidAlgebra.lift`, see function `g : G → R` to a homomorphism `MonoidAlgebra k G →+ R`. -/ +@[expose] public section + assert_not_exists NonUnitalAlgHom AlgEquiv noncomputable section diff --git a/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean b/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean index 275a15e4a0034f..a2a5954ee5fb51 100644 --- a/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean +++ b/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kim Morrison -/ -import Mathlib.Algebra.MonoidAlgebra.Lift +module + +public import Mathlib.Algebra.MonoidAlgebra.Lift /-! # MonoidAlgebra.mapDomain -/ +@[expose] public section + assert_not_exists NonUnitalAlgHom AlgEquiv open Function diff --git a/Mathlib/Algebra/MonoidAlgebra/Module.lean b/Mathlib/Algebra/MonoidAlgebra/Module.lean index a2a5bb028d92ae..b3ae7b0603af5e 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Module.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Module.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kim Morrison -/ -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.Algebra.MonoidAlgebra.Lift -import Mathlib.LinearAlgebra.Finsupp.LSum +module + +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.Algebra.MonoidAlgebra.Lift +public import Mathlib.LinearAlgebra.Finsupp.LSum /-! # Module structure on monoid algebras @@ -16,6 +18,8 @@ import Mathlib.LinearAlgebra.Finsupp.LSum * `MonoidAlgebra.module`, `AddMonoidAlgebra.module`: lift a module structure to monoid algebras -/ +@[expose] public section + assert_not_exists NonUnitalAlgHom AlgEquiv noncomputable section diff --git a/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean b/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean index 7b92f025f43471..a3b81cdb7cb907 100644 --- a/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean +++ b/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.UniqueProds.Basic -import Mathlib.Algebra.MonoidAlgebra.Opposite +module + +public import Mathlib.Algebra.Group.UniqueProds.Basic +public import Mathlib.Algebra.MonoidAlgebra.Opposite /-! # Variations on non-zero divisors in `AddMonoidAlgebra`s @@ -55,6 +57,8 @@ These conditions are sufficient, but not necessary. As mentioned above, *Kaplan asserts that `A` being torsion-free may be enough. -/ +@[expose] public section + open Finsupp variable {R A : Type*} diff --git a/Mathlib/Algebra/MonoidAlgebra/Opposite.lean b/Mathlib/Algebra/MonoidAlgebra/Opposite.lean index 9d2230eaae9bea..3ce7c18ed2daf0 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Opposite.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Opposite.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kim Morrison -/ -import Mathlib.Algebra.MonoidAlgebra.Defs -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Data.Finsupp.Basic +module + +public import Mathlib.Algebra.MonoidAlgebra.Defs +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Data.Finsupp.Basic /-! # Monoid algebras and the opposite ring -/ +@[expose] public section + assert_not_exists NonUnitalAlgHom AlgEquiv noncomputable section diff --git a/Mathlib/Algebra/MonoidAlgebra/Support.lean b/Mathlib/Algebra/MonoidAlgebra/Support.lean index b9db3a1b7f0c33..7c5d2c3bb31f40 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Support.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Support.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Embedding -import Mathlib.Algebra.MonoidAlgebra.Module -import Mathlib.LinearAlgebra.Finsupp.Supported -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Algebra.MonoidAlgebra.Module +public import Mathlib.LinearAlgebra.Finsupp.Supported +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Lemmas about the support of a finitely supported function -/ +@[expose] public section + open scoped Pointwise universe u₁ u₂ u₃ diff --git a/Mathlib/Algebra/MonoidAlgebra/ToDirectSum.lean b/Mathlib/Algebra/MonoidAlgebra/ToDirectSum.lean index de1a807fe3501a..ea6fa080c076c1 100644 --- a/Mathlib/Algebra/MonoidAlgebra/ToDirectSum.lean +++ b/Mathlib/Algebra/MonoidAlgebra/ToDirectSum.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.DirectSum.Algebra -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Data.Finsupp.ToDFinsupp +module + +public import Mathlib.Algebra.DirectSum.Algebra +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Data.Finsupp.ToDFinsupp /-! # Conversion between `AddMonoidAlgebra` and homogeneous `DirectSum` @@ -54,6 +56,8 @@ Note that there is no `AddMonoidAlgebra` equivalent to `Finsupp.single`, so many still involve this definition. -/ +@[expose] public section + variable {ι : Type*} {R : Type*} {M : Type*} {A : Type*} diff --git a/Mathlib/Algebra/MvPolynomial/Basic.lean b/Mathlib/Algebra/MvPolynomial/Basic.lean index 0f27390d594fc9..dc85722c6d4ca0 100644 --- a/Mathlib/Algebra/MvPolynomial/Basic.lean +++ b/Mathlib/Algebra/MvPolynomial/Basic.lean @@ -3,16 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors -import Mathlib.Algebra.MonoidAlgebra.Support -import Mathlib.Algebra.Regular.Pow -import Mathlib.Data.Finsupp.Antidiagonal -import Mathlib.Data.Finsupp.Order -import Mathlib.Order.SymmDiff +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors +public import Mathlib.Algebra.MonoidAlgebra.Support +public import Mathlib.Algebra.Regular.Pow +public import Mathlib.Data.Finsupp.Antidiagonal +public import Mathlib.Data.Finsupp.Order +public import Mathlib.Order.SymmDiff /-! # Multivariate polynomials @@ -63,6 +65,8 @@ polynomial, multivariate polynomial, multivariable polynomial -/ +@[expose] public section + noncomputable section open Set Function Finsupp AddMonoidAlgebra diff --git a/Mathlib/Algebra/MvPolynomial/Cardinal.lean b/Mathlib/Algebra/MvPolynomial/Cardinal.lean index 5423fa37992103..f56d127638f7aa 100644 --- a/Mathlib/Algebra/MvPolynomial/Cardinal.lean +++ b/Mathlib/Algebra/MvPolynomial/Cardinal.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Chris Hughes, Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Junyan Xu -/ -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Data.Finsupp.Fintype -import Mathlib.SetTheory.Cardinal.Finsupp +module + +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Data.Finsupp.Fintype +public import Mathlib.SetTheory.Cardinal.Finsupp /-! # Cardinality of Multivariate Polynomial Ring @@ -15,6 +17,8 @@ the cardinality of `MvPolynomial σ R` is bounded above by the maximum of `#R`, and `ℵ₀`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/MvPolynomial/Comap.lean b/Mathlib/Algebra/MvPolynomial/Comap.lean index 2d0ec2c481f22f..44f783485ab228 100644 --- a/Mathlib/Algebra/MvPolynomial/Comap.lean +++ b/Mathlib/Algebra/MvPolynomial/Comap.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Rename +module + +public import Mathlib.Algebra.MvPolynomial.Rename /-! # `comap` operation on `MvPolynomial` @@ -23,6 +25,8 @@ As in other polynomial files, we typically use the notation: -/ +@[expose] public section + namespace MvPolynomial diff --git a/Mathlib/Algebra/MvPolynomial/CommRing.lean b/Mathlib/Algebra/MvPolynomial/CommRing.lean index d83992d156787e..b312b3a5c9ab55 100644 --- a/Mathlib/Algebra/MvPolynomial/CommRing.lean +++ b/Mathlib/Algebra/MvPolynomial/CommRing.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Algebra.MvPolynomial.Variables +module + +public import Mathlib.Algebra.MvPolynomial.Variables /-! # Multivariate polynomials over a ring @@ -32,6 +34,8 @@ This will give rise to a monomial in `MvPolynomial σ R` which mathematicians mi -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MvPolynomial/Counit.lean b/Mathlib/Algebra/MvPolynomial/Counit.lean index be5ce465ef3a6c..f9ad0e70ece9d3 100644 --- a/Mathlib/Algebra/MvPolynomial/Counit.lean +++ b/Mathlib/Algebra/MvPolynomial/Counit.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Eval +module + +public import Mathlib.Algebra.MvPolynomial.Eval /-! ## Counit morphisms for multivariate polynomials @@ -22,6 +24,8 @@ obtained by `X a ↦ a`. -/ +@[expose] public section + namespace MvPolynomial diff --git a/Mathlib/Algebra/MvPolynomial/Degrees.lean b/Mathlib/Algebra/MvPolynomial/Degrees.lean index dc90e0f1f3364c..6a463a2a57aab7 100644 --- a/Mathlib/Algebra/MvPolynomial/Degrees.lean +++ b/Mathlib/Algebra/MvPolynomial/Degrees.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Algebra.MonoidAlgebra.Degree -import Mathlib.Algebra.MvPolynomial.Rename +module + +public import Mathlib.Algebra.MonoidAlgebra.Degree +public import Mathlib.Algebra.MvPolynomial.Rename /-! # Degrees of polynomials @@ -47,6 +49,8 @@ This will give rise to a monomial in `MvPolynomial σ R` which mathematicians mi -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MvPolynomial/Derivation.lean b/Mathlib/Algebra/MvPolynomial/Derivation.lean index 51e9cd9a85fd97..8b022f32906437 100644 --- a/Mathlib/Algebra/MvPolynomial/Derivation.lean +++ b/Mathlib/Algebra/MvPolynomial/Derivation.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.MvPolynomial.Supported -import Mathlib.RingTheory.Derivation.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Supported +public import Mathlib.RingTheory.Derivation.Basic /-! # Derivations of multivariate polynomials @@ -15,6 +17,8 @@ builds a derivation from its values on `X i`s and a linear equivalence `MvPolynomial.mkDerivationEquiv` between `σ → A` and `Derivation (MvPolynomial σ R) A`. -/ +@[expose] public section + namespace MvPolynomial diff --git a/Mathlib/Algebra/MvPolynomial/Division.lean b/Mathlib/Algebra/MvPolynomial/Division.lean index c92a26639eb0eb..656dbe582b00ef 100644 --- a/Mathlib/Algebra/MvPolynomial/Division.lean +++ b/Mathlib/Algebra/MvPolynomial/Division.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.MonoidAlgebra.Division -import Mathlib.Algebra.MvPolynomial.Basic +module + +public import Mathlib.Algebra.MonoidAlgebra.Division +public import Mathlib.Algebra.MvPolynomial.Basic /-! # Division of `MvPolynomial` by monomials @@ -27,6 +29,8 @@ Where possible, the results in this file should be first proved in the generalit -/ +@[expose] public section + variable {σ R : Type*} [CommSemiring R] diff --git a/Mathlib/Algebra/MvPolynomial/Equiv.lean b/Mathlib/Algebra/MvPolynomial/Equiv.lean index 930626d652142f..5cdda015ff0b40 100644 --- a/Mathlib/Algebra/MvPolynomial/Equiv.lean +++ b/Mathlib/Algebra/MvPolynomial/Equiv.lean @@ -3,13 +3,15 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Finsupp.Fin -import Mathlib.Algebra.MvPolynomial.Degrees -import Mathlib.Algebra.MvPolynomial.Rename -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Data.Finsupp.Option -import Mathlib.Logic.Equiv.Fin.Basic +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Fin +public import Mathlib.Algebra.MvPolynomial.Degrees +public import Mathlib.Algebra.MvPolynomial.Rename +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Data.Finsupp.Option +public import Mathlib.Logic.Equiv.Fin.Basic /-! # Equivalences between polynomial rings @@ -40,6 +42,8 @@ equivalence, isomorphism, morphism, ring hom, hom -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MvPolynomial/Eval.lean b/Mathlib/Algebra/MvPolynomial/Eval.lean index 7db5fd98f5a33f..8bb79ed8b0a9e2 100644 --- a/Mathlib/Algebra/MvPolynomial/Eval.lean +++ b/Mathlib/Algebra/MvPolynomial/Eval.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Algebra.MvPolynomial.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Basic /-! # Multivariate polynomials @@ -39,6 +41,8 @@ In the definitions below, we use the following notation: -/ +@[expose] public section + noncomputable section open Set Function Finsupp AddMonoidAlgebra diff --git a/Mathlib/Algebra/MvPolynomial/Expand.lean b/Mathlib/Algebra/MvPolynomial/Expand.lean index bec811a7630ba1..257edce5ab8324 100644 --- a/Mathlib/Algebra/MvPolynomial/Expand.lean +++ b/Mathlib/Algebra/MvPolynomial/Expand.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.MvPolynomial.Monad +module + +public import Mathlib.Algebra.MvPolynomial.Monad /-! ## Expand multivariate polynomials @@ -17,6 +19,8 @@ This operation is called `MvPolynomial.expand` and it is an algebra homomorphism * `MvPolynomial.expand`: expand a polynomial by a factor of p, so `∑ aₙ xⁿ` becomes `∑ aₙ xⁿᵖ`. -/ +@[expose] public section + namespace MvPolynomial diff --git a/Mathlib/Algebra/MvPolynomial/Funext.lean b/Mathlib/Algebra/MvPolynomial/Funext.lean index 3bb95d181683df..2ba361d0be0a35 100644 --- a/Mathlib/Algebra/MvPolynomial/Funext.lean +++ b/Mathlib/Algebra/MvPolynomial/Funext.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.RingDivision -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.MvPolynomial.Polynomial -import Mathlib.Algebra.MvPolynomial.Rename +module + +public import Mathlib.Algebra.Polynomial.RingDivision +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.MvPolynomial.Polynomial +public import Mathlib.Algebra.MvPolynomial.Rename /-! ## Function extensionality for multivariate polynomials @@ -22,6 +24,8 @@ if they are equal upon evaluating them on an arbitrary assignment of the variabl -/ +@[expose] public section + namespace MvPolynomial variable {R : Type*} [CommRing R] [IsDomain R] diff --git a/Mathlib/Algebra/MvPolynomial/Invertible.lean b/Mathlib/Algebra/MvPolynomial/Invertible.lean index 7235fa7a10a642..0db6b20b55fde7 100644 --- a/Mathlib/Algebra/MvPolynomial/Invertible.lean +++ b/Mathlib/Algebra/MvPolynomial/Invertible.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin, Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.MvPolynomial.Basic -import Mathlib.RingTheory.AlgebraTower +module + +public import Mathlib.Algebra.MvPolynomial.Basic +public import Mathlib.RingTheory.AlgebraTower /-! # Invertible polynomials @@ -13,6 +15,8 @@ This file is a stub containing some basic facts about invertible elements in the ring of polynomials. -/ +@[expose] public section + open MvPolynomial diff --git a/Mathlib/Algebra/MvPolynomial/Monad.lean b/Mathlib/Algebra/MvPolynomial/Monad.lean index 92a91223447f1b..46f307025f513a 100644 --- a/Mathlib/Algebra/MvPolynomial/Monad.lean +++ b/Mathlib/Algebra/MvPolynomial/Monad.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin, Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.MvPolynomial.Rename -import Mathlib.Algebra.MvPolynomial.Variables +module + +public import Mathlib.Algebra.MvPolynomial.Rename +public import Mathlib.Algebra.MvPolynomial.Variables /-! @@ -44,6 +46,8 @@ since it is not a monad in `Type` but in `CommRingCat` (or rather `CommSemiRingC -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MvPolynomial/Nilpotent.lean b/Mathlib/Algebra/MvPolynomial/Nilpotent.lean index e5dd77f2fee9b8..29aa4276ac7efc 100644 --- a/Mathlib/Algebra/MvPolynomial/Nilpotent.lean +++ b/Mathlib/Algebra/MvPolynomial/Nilpotent.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.MvPolynomial.Homogeneous -import Mathlib.RingTheory.Polynomial.Nilpotent +module + +public import Mathlib.RingTheory.MvPolynomial.Homogeneous +public import Mathlib.RingTheory.Polynomial.Nilpotent /-! # Nilpotents and units in multivariate polynomial rings @@ -17,6 +19,8 @@ We prove that and its other coefficients are nilpotent. -/ +@[expose] public section + namespace MvPolynomial variable {σ R : Type*} [CommRing R] {P : MvPolynomial σ R} diff --git a/Mathlib/Algebra/MvPolynomial/PDeriv.lean b/Mathlib/Algebra/MvPolynomial/PDeriv.lean index e94104b76d3be8..5b2619a0c90317 100644 --- a/Mathlib/Algebra/MvPolynomial/PDeriv.lean +++ b/Mathlib/Algebra/MvPolynomial/PDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shing Tak Lam, Yury Kudryashov -/ -import Mathlib.Algebra.MvPolynomial.Derivation -import Mathlib.Algebra.MvPolynomial.Variables +module + +public import Mathlib.Algebra.MvPolynomial.Derivation +public import Mathlib.Algebra.MvPolynomial.Variables /-! # Partial derivatives of polynomials @@ -38,6 +40,8 @@ This will give rise to a monomial in `MvPolynomial σ R` which mathematicians mi -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MvPolynomial/Polynomial.lean b/Mathlib/Algebra/MvPolynomial/Polynomial.lean index 1ab4a4f81932ad..1ce4a68d7b1297 100644 --- a/Mathlib/Algebra/MvPolynomial/Polynomial.lean +++ b/Mathlib/Algebra/MvPolynomial/Polynomial.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.MvPolynomial.Equiv +module + +public import Mathlib.Algebra.MvPolynomial.Equiv /-! # Some lemmas relating polynomials and multivariable polynomials. -/ +@[expose] public section + namespace MvPolynomial variable {R S σ : Type*} diff --git a/Mathlib/Algebra/MvPolynomial/Rename.lean b/Mathlib/Algebra/MvPolynomial/Rename.lean index 36a2e42a5d9b24..3161df81725c17 100644 --- a/Mathlib/Algebra/MvPolynomial/Rename.lean +++ b/Mathlib/Algebra/MvPolynomial/Rename.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Algebra.MvPolynomial.Eval +module + +public import Mathlib.Algebra.MvPolynomial.Eval /-! # Renaming variables of polynomials @@ -35,6 +37,8 @@ This will give rise to a monomial in `MvPolynomial σ R` which mathematicians mi -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/MvPolynomial/SchwartzZippel.lean b/Mathlib/Algebra/MvPolynomial/SchwartzZippel.lean index 7fd854adf37471..d022d511d709db 100644 --- a/Mathlib/Algebra/MvPolynomial/SchwartzZippel.lean +++ b/Mathlib/Algebra/MvPolynomial/SchwartzZippel.lean @@ -3,15 +3,17 @@ Copyright (c) 2023 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey, Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Algebra.MvPolynomial.Variables -import Mathlib.Algebra.Order.GroupWithZero.Finset -import Mathlib.Algebra.Order.Ring.Finset -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Data.Fin.Tuple.Finset -import Mathlib.Tactic.Positivity.Finset -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Algebra.MvPolynomial.Variables +public import Mathlib.Algebra.Order.GroupWithZero.Finset +public import Mathlib.Algebra.Order.Ring.Finset +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Data.Fin.Tuple.Finset +public import Mathlib.Tactic.Positivity.Finset +public import Mathlib.Tactic.GCongr /-! # The Schwartz-Zippel lemma @@ -50,6 +52,8 @@ of the field. This lemma is useful as a probabilistic polynomial identity test. * [zippel_1979] -/ +@[expose] public section + open Fin Finset Fintype local notation:70 s:70 " ^^ " n:71 => piFinset fun i : Fin n ↦ s i diff --git a/Mathlib/Algebra/MvPolynomial/Supported.lean b/Mathlib/Algebra/MvPolynomial/Supported.lean index 3fb1d81189d5fa..0e88ba15b78853 100644 --- a/Mathlib/Algebra/MvPolynomial/Supported.lean +++ b/Mathlib/Algebra/MvPolynomial/Supported.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.MvPolynomial.Variables +module + +public import Mathlib.Algebra.MvPolynomial.Variables /-! # Polynomials supported by a set of variables @@ -20,6 +22,8 @@ This file contains the definition and lemmas about `MvPolynomial.supported`. variables, polynomial, vars -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/MvPolynomial/Variables.lean b/Mathlib/Algebra/MvPolynomial/Variables.lean index 36909668fcd2c3..8c36a88f915325 100644 --- a/Mathlib/Algebra/MvPolynomial/Variables.lean +++ b/Mathlib/Algebra/MvPolynomial/Variables.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ -import Mathlib.Data.Finsupp.Lex -import Mathlib.Algebra.MvPolynomial.Degrees +module + +public import Mathlib.Data.Finsupp.Lex +public import Mathlib.Algebra.MvPolynomial.Degrees /-! # Variables of polynomials @@ -39,6 +41,8 @@ This will give rise to a monomial in `MvPolynomial σ R` which mathematicians mi -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/NeZero.lean b/Mathlib/Algebra/NeZero.lean index 15f3c16aa1b327..0c22994457825a 100644 --- a/Mathlib/Algebra/NeZero.lean +++ b/Mathlib/Algebra/NeZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Logic.Basic -import Mathlib.Order.Defs.PartialOrder +module + +public import Mathlib.Logic.Basic +public import Mathlib.Order.Defs.PartialOrder /-! # `NeZero` typeclass @@ -13,6 +15,8 @@ We give basic facts about the `NeZero n` typeclass. -/ +@[expose] public section + variable {R : Type*} [Zero R] theorem not_neZero {n : R} : ¬NeZero n ↔ n = 0 := by simp [neZero_iff] diff --git a/Mathlib/Algebra/NoZeroSMulDivisors/Basic.lean b/Mathlib/Algebra/NoZeroSMulDivisors/Basic.lean index 24582af5ead6b4..2ce173b1e89c6d 100644 --- a/Mathlib/Algebra/NoZeroSMulDivisors/Basic.lean +++ b/Mathlib/Algebra/NoZeroSMulDivisors/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Yury Kudryashov, Joseph Myers, Heather Macbeth, Kim Morrison, Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.Module.End -import Mathlib.Algebra.NoZeroSMulDivisors.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.Module.End +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs /-! # `NoZeroSMulDivisors` @@ -14,6 +16,8 @@ This file defines the `NoZeroSMulDivisors` class, and includes some tests for the vanishing of elements (especially in modules over division rings). -/ +@[expose] public section + assert_not_exists Multiset Set.indicator Pi.single_smul₀ Field section NoZeroSMulDivisors diff --git a/Mathlib/Algebra/NoZeroSMulDivisors/Defs.lean b/Mathlib/Algebra/NoZeroSMulDivisors/Defs.lean index 2ba46ced071f5f..5f830b8ccf49a2 100644 --- a/Mathlib/Algebra/NoZeroSMulDivisors/Defs.lean +++ b/Mathlib/Algebra/NoZeroSMulDivisors/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Nathaniel Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Yury Kudryashov, Joseph Myers, Heather Macbeth, Kim Morrison, Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Group.Torsion -import Mathlib.Tactic.Contrapose +module + +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Tactic.Contrapose /-! # `NoZeroSMulDivisors` @@ -20,6 +22,8 @@ for the vanishing of elements (especially in modules over division rings). seen the same change happen already. -/ +@[expose] public section + assert_not_exists RelIso Multiset Set.indicator Pi.single_smul₀ Ring Module variable {R M G : Type*} diff --git a/Mathlib/Algebra/NoZeroSMulDivisors/Pi.lean b/Mathlib/Algebra/NoZeroSMulDivisors/Pi.lean index ac7b42a019040f..be88af0874e4c8 100644 --- a/Mathlib/Algebra/NoZeroSMulDivisors/Pi.lean +++ b/Mathlib/Algebra/NoZeroSMulDivisors/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Yaël Dillies -/ -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Algebra.Group.Action.Pi +module + +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Algebra.Group.Action.Pi /-! # Pi instances for NoZeroSMulDivisors @@ -12,6 +14,8 @@ import Mathlib.Algebra.Group.Action.Pi This file defines instances for NoZeroSMulDivisors on Pi types. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/NoZeroSMulDivisors/Prod.lean b/Mathlib/Algebra/NoZeroSMulDivisors/Prod.lean index 9538dd5fb2b580..1e8c716314fdbd 100644 --- a/Mathlib/Algebra/NoZeroSMulDivisors/Prod.lean +++ b/Mathlib/Algebra/NoZeroSMulDivisors/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Algebra.Notation.Prod +module + +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Algebra.Notation.Prod /-! # Prod instances for NoZeroSMulDivisors @@ -12,6 +14,8 @@ import Mathlib.Algebra.Notation.Prod This file defines a NoZeroSMulDivisors instance for the binary product of actions. -/ +@[expose] public section + variable {R M N : Type*} namespace Prod diff --git a/Mathlib/Algebra/NonAssoc/LieAdmissible/Defs.lean b/Mathlib/Algebra/NonAssoc/LieAdmissible/Defs.lean index 0178332c2e1b23..701e566b412087 100644 --- a/Mathlib/Algebra/NonAssoc/LieAdmissible/Defs.lean +++ b/Mathlib/Algebra/NonAssoc/LieAdmissible/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Nikolas Tapia. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nikolas Tapia -/ -import Mathlib.Algebra.Lie.Basic -import Mathlib.Algebra.NonAssoc.PreLie.Basic +module + +public import Mathlib.Algebra.Lie.Basic +public import Mathlib.Algebra.NonAssoc.PreLie.Basic /-! # Lie admissible rings and algebras @@ -36,6 +38,8 @@ documentation of `Algebra`. Frames.**][munthe-kaas_lundervold_2013] -/ +@[expose] public section + /-- A `LieAdmissibleRing` is a `NonUnitalNonAssocRing` such that the canonical bracket `⁅x, y⁆ := x * y - y * x` turns it into a `LieRing`. This is expressed by an associator identity. -/ @[ext] diff --git a/Mathlib/Algebra/NonAssoc/PreLie/Basic.lean b/Mathlib/Algebra/NonAssoc/PreLie/Basic.lean index 4b257b74657c3b..4fef981f19bc0f 100644 --- a/Mathlib/Algebra/NonAssoc/PreLie/Basic.lean +++ b/Mathlib/Algebra/NonAssoc/PreLie/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Nikolas Tapia. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nikolas Tapia -/ -import Mathlib.Algebra.Module.Opposite -import Mathlib.Algebra.Ring.Associator -import Mathlib.GroupTheory.GroupAction.Ring +module + +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.Algebra.Ring.Associator +public import Mathlib.GroupTheory.GroupAction.Ring /-! # Pre-Lie rings and algebras @@ -40,6 +42,8 @@ Perhaps one could be favored but there is no real reason to. -/ +@[expose] public section + /-- `LeftPreLieRing`s are `NonUnitalNonAssocRing`s such that the `associator` is symmetric in the first two variables. -/ @[ext] diff --git a/Mathlib/Algebra/Notation.lean b/Mathlib/Algebra/Notation.lean index 9068883f0c810e..b879ac83a157c6 100644 --- a/Mathlib/Algebra/Notation.lean +++ b/Mathlib/Algebra/Notation.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.ToAdditive +module + +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.ToAdditive /-! # Notations for operations involving order and algebraic structure @@ -17,6 +19,8 @@ import Mathlib.Tactic.ToAdditive * `a⁻ = (-a) ⊔ 0`: *Negative component* of an element `a` of a lattice ordered group -/ +@[expose] public section + /-- A notation class for the *positive part* function: `a⁺`. -/ class PosPart (α : Type*) where /-- The *positive part* of an element `a`. -/ diff --git a/Mathlib/Algebra/Notation/Defs.lean b/Mathlib/Algebra/Notation/Defs.lean index 397dcefd87f48b..eb32051385f6d2 100644 --- a/Mathlib/Algebra/Notation/Defs.lean +++ b/Mathlib/Algebra/Notation/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Simon Hudon, Mario Carneiro -/ -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.ToAdditive -import Mathlib.Util.AssertExists +module + +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.ToAdditive +public import Mathlib.Util.AssertExists /-! # Typeclasses for algebraic operations @@ -31,6 +33,8 @@ Note `Zero` has already been defined in core Lean. -/ +@[expose] public section + assert_not_exists Function.Bijective universe u v w diff --git a/Mathlib/Algebra/Notation/FiniteSupport.lean b/Mathlib/Algebra/Notation/FiniteSupport.lean index 8d275c6d792c3c..d2f88d7ed3bca9 100644 --- a/Mathlib/Algebra/Notation/FiniteSupport.lean +++ b/Mathlib/Algebra/Notation/FiniteSupport.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Notation.Support -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Data.Set.Finite.Basic /-! # Finiteness of support -/ +@[expose] public section + assert_not_exists Monoid namespace Function diff --git a/Mathlib/Algebra/Notation/Indicator.lean b/Mathlib/Algebra/Notation/Indicator.lean index 3606a1465b2338..360e0485c17857 100644 --- a/Mathlib/Algebra/Notation/Indicator.lean +++ b/Mathlib/Algebra/Notation/Indicator.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.Algebra.Notation.Support -import Mathlib.Data.Set.Piecewise +module + +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Data.Set.Piecewise /-! # Indicator function @@ -34,6 +36,8 @@ arguments. This is in contrast with the design of `Pi.single` or `Set.piecewise` indicator, characteristic -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Algebra/Notation/Lemmas.lean b/Mathlib/Algebra/Notation/Lemmas.lean index 5d83476d67cb2f..bf2ea7f07b0ae8 100644 --- a/Mathlib/Algebra/Notation/Lemmas.lean +++ b/Mathlib/Algebra/Notation/Lemmas.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Yael Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yael Dillies -/ -import Batteries.Tactic.Init -import Mathlib.Tactic.ToAdditive -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar -import Mathlib.Util.AssertExists +module + +public import Batteries.Tactic.Init +public import Mathlib.Tactic.ToAdditive +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar +public import Mathlib.Util.AssertExists /-! # Lemmas about inequalities with `1`. -/ +@[expose] public section + assert_not_exists Monoid variable {α : Type*} diff --git a/Mathlib/Algebra/Notation/Pi/Basic.lean b/Mathlib/Algebra/Notation/Pi/Basic.lean index 2c526e6efc9b1b..161c9652d960a4 100644 --- a/Mathlib/Algebra/Notation/Pi/Basic.lean +++ b/Mathlib/Algebra/Notation/Pi/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Eric Wieser -/ -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Logic.Function.Basic +module + +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Logic.Function.Basic /-! # Very basic algebraic operations on pi types @@ -12,6 +14,8 @@ import Mathlib.Logic.Function.Basic This file provides very basic algebraic operations on functions. -/ +@[expose] public section + assert_not_exists Monoid Preorder open Function diff --git a/Mathlib/Algebra/Notation/Pi/Defs.lean b/Mathlib/Algebra/Notation/Pi/Defs.lean index 4b8431c0ce3ecc..4cbc4c00a73ad1 100644 --- a/Mathlib/Algebra/Notation/Pi/Defs.lean +++ b/Mathlib/Algebra/Notation/Pi/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Eric Wieser -/ -import Mathlib.Algebra.Notation.Defs -import Mathlib.Util.AssertExists -import Mathlib.Tactic.Push.Attr +module + +public import Mathlib.Algebra.Notation.Defs +public import Mathlib.Util.AssertExists +public import Mathlib.Tactic.Push.Attr /-! # Notation for algebraic operators on pi types @@ -15,6 +17,8 @@ See `Mathlib/Algebra/Group/Pi/Basic.lean` for the `Monoid` and `Group` instances an instance of the `Star` notation typeclass, but no default notation is included. -/ +@[expose] public section + assert_not_exists Set.range Monoid Preorder open Function diff --git a/Mathlib/Algebra/Notation/Prod.lean b/Mathlib/Algebra/Notation/Prod.lean index 2cac3b54a66256..1b50383191ac11 100644 --- a/Mathlib/Algebra/Notation/Prod.lean +++ b/Mathlib/Algebra/Notation/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot, Yury Kudryashov -/ -import Mathlib.Util.AssertExists -import Mathlib.Algebra.Notation.Defs -import Mathlib.Data.Prod.Basic +module + +public import Mathlib.Util.AssertExists +public import Mathlib.Algebra.Notation.Defs +public import Mathlib.Data.Prod.Basic /-! # Arithmetic operators on (pairwise) product types @@ -17,6 +19,8 @@ included. -/ +@[expose] public section + assert_not_exists Monoid DenselyOrdered variable {G H M N P R S : Type*} diff --git a/Mathlib/Algebra/Notation/Support.lean b/Mathlib/Algebra/Notation/Support.lean index f79ca7b35d0c7c..c3a73b587e6984 100644 --- a/Mathlib/Algebra/Notation/Support.lean +++ b/Mathlib/Algebra/Notation/Support.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.Algebra.Notation.Prod -import Mathlib.Data.Set.Image +module + +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Data.Set.Image /-! # Support of a function @@ -14,6 +16,8 @@ In this file we define `Function.support f = {x | f x ≠ 0}` and prove its basi We also define `Function.mulSupport f = {x | f x ≠ 1}`. -/ +@[expose] public section + assert_not_exists Monoid CompleteLattice open Function Set diff --git a/Mathlib/Algebra/Opposites.lean b/Mathlib/Algebra/Opposites.lean index 80fd305da60c28..1a0c9a6b52fad2 100644 --- a/Mathlib/Algebra/Opposites.lean +++ b/Mathlib/Algebra/Opposites.lean @@ -3,10 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Logic.Equiv.Defs -import Mathlib.Logic.Nontrivial.Basic -import Mathlib.Logic.IsEmpty +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Logic.Nontrivial.Basic /-! # Multiplicative opposite and algebraic operations on it @@ -38,6 +39,8 @@ definitional eta reduction for structures (Lean 3 does not). multiplicative opposite, additive opposite -/ +@[expose] public section + variable {α β : Type*} open Function diff --git a/Mathlib/Algebra/Order/AbsoluteValue/Basic.lean b/Mathlib/Algebra/Order/AbsoluteValue/Basic.lean index 6421f0a4b0f789..bd00de19ff58db 100644 --- a/Mathlib/Algebra/Order/AbsoluteValue/Basic.lean +++ b/Mathlib/Algebra/Order/AbsoluteValue/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Anne Baanen -/ -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.Order.Hom.Basic -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Tactic.Positivity.Core +module + +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.Order.Hom.Basic +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Tactic.Positivity.Core /-! # Absolute values @@ -24,6 +26,8 @@ This file defines a bundled type of absolute values `AbsoluteValue R S`. value -/ +@[expose] public section + variable {ι α R S : Type*} /-- `AbsoluteValue R S` is the type of absolute values on `R` mapping to `S`: @@ -406,7 +410,7 @@ lemma abv_nonneg (x) : 0 ≤ abv x := abv_nonneg' x open Lean Meta Mathlib Meta Positivity Qq in /-- The `positivity` extension which identifies expressions of the form `abv a`. -/ @[positivity _] -def Mathlib.Meta.Positivity.evalAbv : PositivityExt where eval {_ _α} _zα _pα e := do +meta def Mathlib.Meta.Positivity.evalAbv : PositivityExt where eval {_ _α} _zα _pα e := do let (.app f a) ← whnfR e | throwError "not abv ·" let pa' ← mkAppM ``abv_nonneg #[f, a] pure (.nonnegative pa') diff --git a/Mathlib/Algebra/Order/AbsoluteValue/Euclidean.lean b/Mathlib/Algebra/Order/AbsoluteValue/Euclidean.lean index 55d474ed090dd9..7b362f9d40c56a 100644 --- a/Mathlib/Algebra/Order/AbsoluteValue/Euclidean.lean +++ b/Mathlib/Algebra/Order/AbsoluteValue/Euclidean.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Order.AbsoluteValue.Basic -import Mathlib.Algebra.EuclideanDomain.Int +module + +public import Mathlib.Algebra.Order.AbsoluteValue.Basic +public import Mathlib.Algebra.EuclideanDomain.Int /-! # Euclidean absolute values @@ -20,6 +22,8 @@ absolute value is compatible with the Euclidean domain structure on its domain. mapping negative `x` to `-x`, is Euclidean. -/ +@[expose] public section + @[inherit_doc] local infixl:50 " ≺ " => EuclideanDomain.r diff --git a/Mathlib/Algebra/Order/AddGroupWithTop.lean b/Mathlib/Algebra/Order/AddGroupWithTop.lean index d49101dc90aa6e..8103b01b844755 100644 --- a/Mathlib/Algebra/Order/AddGroupWithTop.lean +++ b/Mathlib/Algebra/Order/AddGroupWithTop.lean @@ -3,10 +3,12 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.WithTop -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.Order.Monoid.Canonical.Defs +module + +public import Mathlib.Algebra.Order.Monoid.WithTop +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs /-! # Linearly ordered commutative additive groups and monoids with a top element adjoined @@ -23,6 +25,8 @@ whereas it is a very common target for valuations. The solutions is to use a typeclass, and that is exactly what we do in this file. -/ +@[expose] public section + variable {α : Type*} /-- A linearly ordered commutative monoid with an additively absorbing `⊤` element. diff --git a/Mathlib/Algebra/Order/AddTorsor.lean b/Mathlib/Algebra/Order/AddTorsor.lean index d248256edd47e9..7763fa70b31cde 100644 --- a/Mathlib/Algebra/Order/AddTorsor.lean +++ b/Mathlib/Algebra/Order/AddTorsor.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Order.Monoid.Defs +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Order.Monoid.Defs /-! # Ordered scalar multiplication and vector addition @@ -47,6 +49,8 @@ an ordered field. * WithTop (in a different file?) -/ +@[expose] public section + open Function variable {G P : Type*} diff --git a/Mathlib/Algebra/Order/Algebra.lean b/Mathlib/Algebra/Order/Algebra.lean index c0198123049579..e0d81549ed0c6d 100644 --- a/Mathlib/Algebra/Order/Algebra.lean +++ b/Mathlib/Algebra/Order/Algebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Order.Module.Defs +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Order.Module.Defs /-! # Ordered algebras @@ -28,6 +30,8 @@ and `IsStrictOrderedModule` mixins. ordered algebra -/ +@[expose] public section + section OrderedAlgebra variable {R A : Type*} [CommRing R] [PartialOrder R] [IsOrderedRing R] diff --git a/Mathlib/Algebra/Order/Antidiag/Finsupp.lean b/Mathlib/Algebra/Order/Antidiag/Finsupp.lean index 79d000a03963bb..f312d513cb9334 100644 --- a/Mathlib/Algebra/Order/Antidiag/Finsupp.lean +++ b/Mathlib/Algebra/Order/Antidiag/Finsupp.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández, Eric Wieser, Bhavik Mehta, Yaël Dillies -/ -import Mathlib.Algebra.Order.Antidiag.Pi -import Mathlib.Data.Finsupp.Basic +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Algebra.Order.Antidiag.Pi /-! # Antidiagonal of finitely supported functions as finsets @@ -26,6 +28,10 @@ We define it using `Finset.piAntidiag s n`, the corresponding antidiagonal in ` -/ +@[expose] public section + +assert_not_exists Field + open Finsupp Function variable {ι μ μ' : Type*} @@ -102,6 +108,14 @@ theorem finsuppAntidiag_insert {a : ι} {s : Finset ι} simp_rw [mem_map, mem_attach, true_and, Subtype.exists, Embedding.coeFn_mk, exists_prop, and_comm, eq_comm] +@[gcongr] +theorem finsuppAntidiag_mono {s t : Finset ι} (h : s ⊆ t) (n : μ) : + finsuppAntidiag s n ⊆ finsuppAntidiag t n := by + intro a + simp_rw [mem_finsuppAntidiag'] + rintro ⟨hsum, hmem⟩ + exact ⟨hsum, hmem.trans h⟩ + variable [AddCommMonoid μ'] [HasAntidiagonal μ'] [DecidableEq μ'] -- This should work under the assumption that e is an embedding and an AddHom diff --git a/Mathlib/Algebra/Order/Antidiag/Nat.lean b/Mathlib/Algebra/Order/Antidiag/Nat.lean index 32e256b443ddbe..d39529c1a94840 100644 --- a/Mathlib/Algebra/Order/Antidiag/Nat.lean +++ b/Mathlib/Algebra/Order/Antidiag/Nat.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 Arend Mellendijk. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ -import Mathlib.Algebra.Order.Antidiag.Pi -import Mathlib.NumberTheory.ArithmeticFunction -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Algebra.Order.Antidiag.Pi +public import Mathlib.NumberTheory.ArithmeticFunction +public import Mathlib.Tactic.IntervalCases +import Mathlib.Data.PNat.Basic /-! # Sets of tuples with a fixed product @@ -20,6 +23,8 @@ This file defines the finite set of `d`-tuples of natural numbers with a fixed p (`card_pair_lcm_eq`) -/ +@[expose] public section + open Finset open scoped BigOperators ArithmeticFunction namespace PNat diff --git a/Mathlib/Algebra/Order/Antidiag/Pi.lean b/Mathlib/Algebra/Order/Antidiag/Pi.lean index f3e94e1293b6a1..170819e401db71 100644 --- a/Mathlib/Algebra/Order/Antidiag/Pi.lean +++ b/Mathlib/Algebra/Order/Antidiag/Pi.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández, Eric Wieser, Bhavik Mehta, Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.Data.Fin.Tuple.NatAntidiagonal -import Mathlib.Data.Finset.Sym +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.Data.Fin.Tuple.NatAntidiagonal +public import Mathlib.Data.Finset.Sym /-! # Antidiagonal of functions as finsets @@ -39,6 +41,8 @@ identification. See `Finset.finAntidiag` for the details. `Finset.finsuppAntidiag` for the `Finset (ι →₀ μ)`-valued version of `Finset.piAntidiag`. -/ +@[expose] public section + open Function variable {ι μ μ' : Type*} diff --git a/Mathlib/Algebra/Order/Antidiag/Prod.lean b/Mathlib/Algebra/Order/Antidiag/Prod.lean index 48ffc81b990281..f333dc4ac64ea3 100644 --- a/Mathlib/Algebra/Order/Antidiag/Prod.lean +++ b/Mathlib/Algebra/Order/Antidiag/Prod.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Antoine Chambert-Loir and María Inés de Frutos-Fernández. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández, Bhavik Mehta, Eric Wieser -/ -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Data.Finset.Basic -import Mathlib.Order.Interval.Finset.Defs +module + +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Data.Finset.Basic +public import Mathlib.Order.Interval.Finset.Defs /-! # Antidiagonal with values in general types @@ -47,6 +49,8 @@ def s : Multiset ℕ := {0, 0, 0} For `PNat`, we will recover the set of divisors of a strictly positive integer. -/ +@[expose] public section + open Function namespace Finset diff --git a/Mathlib/Algebra/Order/Archimedean/Basic.lean b/Mathlib/Algebra/Order/Archimedean/Basic.lean index 4d39c31ac86441..7a87b3ea8bc39c 100644 --- a/Mathlib/Algebra/Order/Archimedean/Basic.lean +++ b/Mathlib/Algebra/Order/Archimedean/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Algebra.Order.Monoid.Units -import Mathlib.Algebra.Order.Ring.Pow -import Mathlib.Data.Int.LeastGreatest -import Mathlib.Data.Rat.Floor +module + +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Algebra.Order.Monoid.Units +public import Mathlib.Algebra.Order.Ring.Pow +public import Mathlib.Data.Int.LeastGreatest +public import Mathlib.Data.Rat.Floor /-! # Archimedean groups and fields. @@ -30,6 +32,8 @@ number `n` such that `x ≤ n • y`. * `ℕ`, `ℤ`, and `ℚ` are archimedean. -/ +@[expose] public section + assert_not_exists Finset open Int Set @@ -183,7 +187,7 @@ theorem add_one_pow_unbounded_of_pos (x : R) (hy : 0 < y) : ∃ n : ℕ, x < (y _ = n * y := nsmul_eq_mul _ _ _ < 1 + n * y := lt_one_add _ _ ≤ (1 + y) ^ n := - one_add_mul_le_pow' (mul_nonneg hy.le hy.le) (mul_nonneg this this) + one_add_mul_le_pow_of_sq_nonneg (pow_nonneg hy.le _) (pow_nonneg this _) (add_nonneg zero_le_two hy.le) _ _ = (y + 1) ^ n := by rw [add_comm] diff --git a/Mathlib/Algebra/Order/Archimedean/Class.lean b/Mathlib/Algebra/Order/Archimedean/Class.lean index 91870b9194b86a..78c5667c64ee4d 100644 --- a/Mathlib/Algebra/Order/Archimedean/Class.lean +++ b/Mathlib/Algebra/Order/Archimedean/Class.lean @@ -3,15 +3,17 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Data.Finset.Max -import Mathlib.Order.Antisymmetrization -import Mathlib.Order.Hom.WithTopBot -import Mathlib.Order.UpperLower.CompleteLattice -import Mathlib.Order.UpperLower.Principal +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Data.Finset.Max +public import Mathlib.Order.Antisymmetrization +public import Mathlib.Order.Hom.WithTopBot +public import Mathlib.Order.UpperLower.CompleteLattice +public import Mathlib.Order.UpperLower.Principal /-! # Archimedean classes of a linearly ordered group @@ -52,6 +54,8 @@ the order. -/ +@[expose] public section + section ArchimedeanOrder variable {M : Type*} diff --git a/Mathlib/Algebra/Order/Archimedean/Hom.lean b/Mathlib/Algebra/Order/Archimedean/Hom.lean index 59726e03ede4cb..2be4c7abbed53b 100644 --- a/Mathlib/Algebra/Order/Archimedean/Hom.lean +++ b/Mathlib/Algebra/Order/Archimedean/Hom.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alex J. Best, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Yaël Dillies -/ -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Order.Hom.Ring +module + +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Order.Hom.Ring /-! ### Uniqueness of ring homomorphisms to archimedean fields. @@ -14,6 +16,8 @@ ordered field. Reciprocally, such an ordered ring homomorphism exists when the c conditionally complete. -/ +@[expose] public section + assert_not_exists Finset variable {α β : Type*} [Field α] [LinearOrder α] [Field β] [LinearOrder β] diff --git a/Mathlib/Algebra/Order/Archimedean/IndicatorCard.lean b/Mathlib/Algebra/Order/Archimedean/IndicatorCard.lean index 3fe4e60337861c..34fcde067b28f5 100644 --- a/Mathlib/Algebra/Order/Archimedean/IndicatorCard.lean +++ b/Mathlib/Algebra/Order/Archimedean/IndicatorCard.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Indicator -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Group.Indicator -import Mathlib.Order.LiminfLimsup -import Mathlib.SetTheory.Cardinal.Finite +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Indicator +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Group.Indicator +public import Mathlib.Order.LiminfLimsup +public import Mathlib.SetTheory.Cardinal.Finite /-! # Cardinality and limit of sum of indicators @@ -19,6 +21,8 @@ limsups of sums of indicators. finite, indicator, limsup, tendsto -/ +@[expose] public section + namespace Set open Filter Finset diff --git a/Mathlib/Algebra/Order/Archimedean/Submonoid.lean b/Mathlib/Algebra/Order/Archimedean/Submonoid.lean index 45f64496807cd0..6b73e0629c8da4 100644 --- a/Mathlib/Algebra/Order/Archimedean/Submonoid.lean +++ b/Mathlib/Algebra/Order/Archimedean/Submonoid.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Order.Archimedean.Basic +module + +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Order.Archimedean.Basic /-! # Submonoids of archimedean monoids @@ -21,6 +23,8 @@ submonoid of the ambient group. submonoid. -/ +@[expose] public section + assert_not_exists Finset @[to_additive] diff --git a/Mathlib/Algebra/Order/BigOperators/Expect.lean b/Mathlib/Algebra/Order/BigOperators/Expect.lean index bb61309841d49b..5f304c8fd31039 100644 --- a/Mathlib/Algebra/Order/BigOperators/Expect.lean +++ b/Mathlib/Algebra/Order/BigOperators/Expect.lean @@ -3,17 +3,21 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Expect -import Mathlib.Algebra.Module.Rat -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.Module.Field -import Mathlib.Algebra.Order.Module.Rat -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.BigOperators.Expect +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.Module.Field +public import Mathlib.Algebra.Order.Module.Rat +public import Mathlib.Tactic.GCongr /-! # Order properties of the average over a finset -/ +@[expose] public section + open Function open Fintype (card) open scoped BigOperators Pointwise NNRat @@ -182,7 +186,7 @@ open scoped BigOperators attribute [local instance] monadLiftOptionMetaM in /-- Positivity extension for `Finset.expect`. -/ @[positivity Finset.expect _ _] -def evalFinsetExpect : PositivityExt where eval {u α} zα pα e := do +meta def evalFinsetExpect : PositivityExt where eval {u α} zα pα e := do match e with | ~q(@Finset.expect $ι _ $instα $instmod $s $f) => let i : Q($ι) ← mkFreshExprMVarQ q($ι) .syntheticOpaque diff --git a/Mathlib/Algebra/Order/BigOperators/Group/Finset.lean b/Mathlib/Algebra/Order/BigOperators/Group/Finset.lean index bd7cde0b9f296c..6c867005e2b9fa 100644 --- a/Mathlib/Algebra/Order/BigOperators/Group/Finset.lean +++ b/Mathlib/Algebra/Order/BigOperators/Group/Finset.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Algebra.Order.BigOperators.Group.Multiset -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Data.Multiset.OrderedMonoid -import Mathlib.Tactic.Bound.Attribute -import Mathlib.Algebra.BigOperators.Group.Finset.Sigma -import Mathlib.Data.Multiset.Powerset -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Algebra.Order.BigOperators.Group.Multiset +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Data.Multiset.OrderedMonoid +public import Mathlib.Tactic.Bound.Attribute +public import Mathlib.Algebra.BigOperators.Group.Finset.Sigma +public import Mathlib.Data.Multiset.Powerset +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow /-! # Big operators on a finset in ordered groups @@ -19,6 +21,8 @@ This file contains the results concerning the interaction of multiset big operat groups/monoids. -/ +@[expose] public section + assert_not_exists Ring open Function diff --git a/Mathlib/Algebra/Order/BigOperators/Group/List.lean b/Mathlib/Algebra/Order/BigOperators/Group/List.lean index 14badc44a36d45..8f6ff77e6b646d 100644 --- a/Mathlib/Algebra/Order/BigOperators/Group/List.lean +++ b/Mathlib/Algebra/Order/BigOperators/Group/List.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Algebra.BigOperators.Group.List.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Algebra.BigOperators.Group.List.Basic /-! # Big operators on a list in ordered groups @@ -14,6 +16,8 @@ This file contains the results concerning the interaction of list big operators groups/monoids. -/ +@[expose] public section + variable {ι α M N : Type*} namespace List diff --git a/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean b/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean index 2b00b20c2207db..a5b5f54c1f01da 100644 --- a/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean +++ b/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Sigma -import Mathlib.Algebra.Order.Interval.Finset.SuccPred -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.Disjointed -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Sigma +public import Mathlib.Algebra.Order.Interval.Finset.SuccPred +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.Disjointed +public import Mathlib.Order.Interval.Finset.Nat /-! # Big operators indexed by intervals @@ -15,6 +17,8 @@ import Mathlib.Order.Interval.Finset.Nat This file proves lemmas about `∏ x ∈ Ixx a b, f x` and `∑ x ∈ Ixx a b, f x`. -/ +@[expose] public section + open Order variable {α M : Type*} [CommMonoid M] {f : α → M} {a b : α} diff --git a/Mathlib/Algebra/Order/BigOperators/Group/Multiset.lean b/Mathlib/Algebra/Order/BigOperators/Group/Multiset.lean index 2bd820be79ae7e..70b51fdc1f1c80 100644 --- a/Mathlib/Algebra/Order/BigOperators/Group/Multiset.lean +++ b/Mathlib/Algebra/Order/BigOperators/Group/Multiset.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Algebra.Order.BigOperators.Group.List -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Data.List.MinMax -import Mathlib.Data.Multiset.Fold +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Algebra.Order.BigOperators.Group.List +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Data.List.MinMax +public import Mathlib.Data.Multiset.Fold /-! # Big operators on a multiset in ordered groups @@ -16,6 +18,8 @@ This file contains the results concerning the interaction of multiset big operat groups. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {ι α β : Type*} diff --git a/Mathlib/Algebra/Order/BigOperators/GroupWithZero/List.lean b/Mathlib/Algebra/Order/BigOperators/GroupWithZero/List.lean index 2d1516e138c632..68585d1d545bfe 100644 --- a/Mathlib/Algebra/Order/BigOperators/GroupWithZero/List.lean +++ b/Mathlib/Algebra/Order/BigOperators/GroupWithZero/List.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell, Daniel Weber -/ -import Mathlib.Algebra.BigOperators.Group.List.Defs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.List.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic /-! # Big operators on a list in ordered groups with zeros @@ -13,6 +15,8 @@ This file contains the results concerning the interaction of list big operators groups with zeros. -/ +@[expose] public section + namespace List variable {R : Type*} [CommMonoidWithZero R] [PartialOrder R] [ZeroLEOneClass R] [PosMulMono R] diff --git a/Mathlib/Algebra/Order/BigOperators/GroupWithZero/Multiset.lean b/Mathlib/Algebra/Order/BigOperators/GroupWithZero/Multiset.lean index 72b133f33bdefb..1b97912fd06aeb 100644 --- a/Mathlib/Algebra/Order/BigOperators/GroupWithZero/Multiset.lean +++ b/Mathlib/Algebra/Order/BigOperators/GroupWithZero/Multiset.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Ruben Van de Velde. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ruben Van de Velde, Daniel Weber -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Algebra.Order.BigOperators.GroupWithZero.List +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Algebra.Order.BigOperators.GroupWithZero.List /-! # Big operators on a multiset in ordered groups with zeros @@ -13,6 +15,8 @@ This file contains the results concerning the interaction of multiset big operat groups with zeros. -/ +@[expose] public section + namespace Multiset variable {R : Type*} [CommMonoidWithZero R] [PartialOrder R] [ZeroLEOneClass R] [PosMulMono R] diff --git a/Mathlib/Algebra/Order/BigOperators/Ring/Finset.lean b/Mathlib/Algebra/Order/BigOperators/Ring/Finset.lean index 87a2f5288c6514..b74541c1b9ff44 100644 --- a/Mathlib/Algebra/Order/BigOperators/Ring/Finset.lean +++ b/Mathlib/Algebra/Order/BigOperators/Ring/Finset.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.AbsoluteValue.Basic -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.BigOperators.Ring.Multiset -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.AbsoluteValue.Basic +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.BigOperators.Ring.Multiset +public import Mathlib.Tactic.Ring /-! # Big operators on a finset in ordered rings @@ -19,6 +21,8 @@ In particular, this file contains the standard form of the Cauchy-Schwarz inequa some of its immediate consequences. -/ +@[expose] public section + variable {ι R S : Type*} namespace Finset @@ -271,7 +275,7 @@ example (s : Finset ℕ) (f : ℕ → ℤ) (hf : ∀ n, 0 ≤ f n) : 0 ≤ s.pro because `compareHyp` can't look for assumptions behind binders. -/ @[positivity Finset.prod _ _] -def evalFinsetProd : PositivityExt where eval {u α} zα pα e := do +meta def evalFinsetProd : PositivityExt where eval {u α} zα pα e := do match e with | ~q(@Finset.prod $ι _ $instα $s $f) => let i : Q($ι) ← mkFreshExprMVarQ q($ι) .syntheticOpaque diff --git a/Mathlib/Algebra/Order/BigOperators/Ring/List.lean b/Mathlib/Algebra/Order/BigOperators/Ring/List.lean index 430a8c46ccb012..e71accf957455a 100644 --- a/Mathlib/Algebra/Order/BigOperators/Ring/List.lean +++ b/Mathlib/Algebra/Order/BigOperators/Ring/List.lean @@ -3,8 +3,9 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell -/ -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Algebra.BigOperators.Group.List.Defs +module + +public import Mathlib.Algebra.Order.Ring.Canonical /-! # Big operators on a list in ordered rings @@ -12,6 +13,8 @@ import Mathlib.Algebra.BigOperators.Group.List.Defs This file contains the results concerning the interaction of list big operators with ordered rings. -/ +@[expose] public section + variable {R : Type*} /-- A variant of `List.prod_pos` for `CanonicallyOrderedAdd`. -/ diff --git a/Mathlib/Algebra/Order/BigOperators/Ring/Multiset.lean b/Mathlib/Algebra/Order/BigOperators/Ring/Multiset.lean index fdd55c3b75c8fd..b0add54864dc5c 100644 --- a/Mathlib/Algebra/Order/BigOperators/Ring/Multiset.lean +++ b/Mathlib/Algebra/Order/BigOperators/Ring/Multiset.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Ruben Van de Velde. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ruben Van de Velde -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Defs -import Mathlib.Algebra.Order.BigOperators.Ring.List +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Defs +public import Mathlib.Algebra.Order.BigOperators.Ring.List /-! # Big operators on a multiset in ordered rings @@ -13,6 +15,8 @@ This file contains the results concerning the interaction of multiset big operat rings. -/ +@[expose] public section + open Multiset @[simp] diff --git a/Mathlib/Algebra/Order/CauSeq/Basic.lean b/Mathlib/Algebra/Order/CauSeq/Basic.lean index 18d9099543130b..f6c89e67df3db4 100644 --- a/Mathlib/Algebra/Order/CauSeq/Basic.lean +++ b/Mathlib/Algebra/Order/CauSeq/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Order.AbsoluteValue.Basic -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Algebra.Order.Group.MinMax -import Mathlib.Algebra.Ring.Pi -import Mathlib.Data.Setoid.Basic -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Order.AbsoluteValue.Basic +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Algebra.Order.Group.MinMax +public import Mathlib.Algebra.Ring.Pi +public import Mathlib.Data.Setoid.Basic +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.Tactic.GCongr /-! # Cauchy sequences @@ -31,6 +33,8 @@ This is a concrete implementation that is useful for simplicity and computabilit sequence, cauchy, abs val, absolute value -/ +@[expose] public section + assert_not_exists Finset Module Submonoid FloorRing variable {α β : Type*} diff --git a/Mathlib/Algebra/Order/CauSeq/BigOperators.lean b/Mathlib/Algebra/Order/CauSeq/BigOperators.lean index 04f176cc8f0e73..82eb1e3d9f1e12 100644 --- a/Mathlib/Algebra/Order/CauSeq/BigOperators.lean +++ b/Mathlib/Algebra/Order/CauSeq/BigOperators.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yaël Dillies -/ -import Mathlib.Algebra.Field.GeomSum -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.CauSeq.Basic +module + +public import Mathlib.Algebra.Field.GeomSum +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.CauSeq.Basic /-! # Cauchy sequences and big operators @@ -14,6 +16,8 @@ import Mathlib.Algebra.Order.CauSeq.Basic This file proves some more lemmas about basic Cauchy sequences that involve finite sums. -/ +@[expose] public section + open Finset IsAbsoluteValue namespace IsCauSeq diff --git a/Mathlib/Algebra/Order/CauSeq/Completion.lean b/Mathlib/Algebra/Order/CauSeq/Completion.lean index f285c57d00ebc4..2916bdfda3944c 100644 --- a/Mathlib/Algebra/Order/CauSeq/Completion.lean +++ b/Mathlib/Algebra/Order/CauSeq/Completion.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Robert Y. Lewis -/ -import Mathlib.Algebra.Order.CauSeq.Basic -import Mathlib.Algebra.Ring.Action.Rat -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Order.CauSeq.Basic +public import Mathlib.Algebra.Ring.Action.Rat +public import Mathlib.Tactic.FastInstance /-! # Cauchy completion @@ -14,6 +16,8 @@ This file generalizes the Cauchy completion of `(ℚ, abs)` to the completion of with absolute value. -/ +@[expose] public section + namespace CauSeq.Completion diff --git a/Mathlib/Algebra/Order/Chebyshev.lean b/Mathlib/Algebra/Order/Chebyshev.lean index 9ecec7f997883c..6fd65b5f1c31a4 100644 --- a/Mathlib/Algebra/Order/Chebyshev.lean +++ b/Mathlib/Algebra/Order/Chebyshev.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Mantas Bakšys, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mantas Bakšys, Yaël Dillies -/ -import Mathlib.Algebra.Order.Monovary -import Mathlib.Algebra.Order.Rearrangement -import Mathlib.GroupTheory.Perm.Cycle.Basic -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.Positivity +module + +public import Mathlib.Algebra.Order.Monovary +public import Mathlib.Algebra.Order.Rearrangement +public import Mathlib.GroupTheory.Perm.Cycle.Basic +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.Positivity /-! # Chebyshev's sum inequality @@ -36,6 +38,8 @@ The case for `Monotone`/`Antitone` pairs of functions over a `LinearOrder` is no file because it is easily deducible from the `Monovary` API. -/ +@[expose] public section + open Equiv Equiv.Perm Finset Function OrderDual diff --git a/Mathlib/Algebra/Order/CompleteField.lean b/Mathlib/Algebra/Order/CompleteField.lean index 307e3434e09c6c..a8402acd8631fa 100644 --- a/Mathlib/Algebra/Order/CompleteField.lean +++ b/Mathlib/Algebra/Order/CompleteField.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Yaël Dillies -/ -import Mathlib.Algebra.Order.Archimedean.Hom -import Mathlib.Algebra.Order.Group.Pointwise.CompleteLattice +module + +public import Mathlib.Algebra.Order.Archimedean.Hom +public import Mathlib.Algebra.Order.Group.Pointwise.CompleteLattice /-! # Conditionally complete linear ordered fields @@ -41,6 +43,8 @@ archimedean. We also construct the natural map from a `LinearOrderedField` to su reals, conditionally complete, ordered field, uniqueness -/ +@[expose] public section + variable {F α β γ : Type*} noncomputable section diff --git a/Mathlib/Algebra/Order/Disjointed.lean b/Mathlib/Algebra/Order/Disjointed.lean index 897ce236ef3010..3320414c1daf06 100644 --- a/Mathlib/Algebra/Order/Disjointed.lean +++ b/Mathlib/Algebra/Order/Disjointed.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.Order.SuccPred.PartialSups -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.Disjointed +module + +public import Mathlib.Algebra.Order.SuccPred.PartialSups +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.Disjointed /-! # `Disjointed` for functions on a `SuccAddOrder` @@ -18,6 +20,8 @@ dependencies from `Mathlib.Algebra.Order` into `Mathlib.Order`. Find a useful statement of `disjointedRec_succ`. -/ +@[expose] public section + open Order variable {α ι : Type*} [GeneralizedBooleanAlgebra α] diff --git a/Mathlib/Algebra/Order/Field/Basic.lean b/Mathlib/Algebra/Order/Field/Basic.lean index dbc61fb7f8b7fc..e33b927f3ef18a 100644 --- a/Mathlib/Algebra/Order/Field/Basic.lean +++ b/Mathlib/Algebra/Order/Field/Basic.lean @@ -3,18 +3,22 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Data.Set.Monotone -import Mathlib.Order.Bounds.OrderIso -import Mathlib.Tactic.Positivity.Core -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Data.Set.Monotone +public import Mathlib.Order.Bounds.OrderIso +public import Mathlib.Tactic.Positivity.Core +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso /-! # Lemmas about linear ordered (semi)fields -/ +@[expose] public section + open Function OrderDual @@ -677,7 +681,7 @@ end LinearOrderedSemifield /-- The `positivity` extension which identifies expressions of the form `a / b`, such that `positivity` successfully recognises both `a` and `b`. -/ -@[positivity _ / _] def evalDiv : PositivityExt where eval {u α} zα pα e := do +@[positivity _ / _] meta def evalDiv : PositivityExt where eval {u α} zα pα e := do let .app (.app (f : Q($α → $α → $α)) (a : Q($α))) (b : Q($α)) ← withReducible (whnf e) | throwError "not /" let _e_eq : $e =Q $f $a $b := ⟨⟩ @@ -700,7 +704,7 @@ such that `positivity` successfully recognises both `a` and `b`. -/ /-- The `positivity` extension which identifies expressions of the form `a⁻¹`, such that `positivity` successfully recognises `a`. -/ @[positivity _⁻¹] -def evalInv : PositivityExt where eval {u α} zα pα e := do +meta def evalInv : PositivityExt where eval {u α} zα pα e := do let .app (f : Q($α → $α)) (a : Q($α)) ← withReducible (whnf e) | throwError "not ⁻¹" let _e_eq : $e =Q $f $a := ⟨⟩ let _a ← synthInstanceQ q(Semifield $α) @@ -717,7 +721,7 @@ def evalInv : PositivityExt where eval {u α} zα pα e := do /-- The `positivity` extension which identifies expressions of the form `a ^ (0:ℤ)`. -/ @[positivity _ ^ (0 : ℤ), Pow.pow _ (0 : ℤ)] -def evalPowZeroInt : PositivityExt where eval {u α} _zα _pα e := do +meta def evalPowZeroInt : PositivityExt where eval {u α} _zα _pα e := do let .app (.app _ (a : Q($α))) _ ← withReducible (whnf e) | throwError "not ^" let _a ← synthInstanceQ q(Semifield $α) let _a ← synthInstanceQ q(LinearOrder $α) diff --git a/Mathlib/Algebra/Order/Field/Canonical.lean b/Mathlib/Algebra/Order/Field/Canonical.lean index 9b22a18c24c8af..4bd1ce43f5391b 100644 --- a/Mathlib/Algebra/Order/Field/Canonical.lean +++ b/Mathlib/Algebra/Order/Field/Canonical.lean @@ -3,14 +3,18 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.Ring.Canonical +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.Ring.Canonical /-! # Canonically ordered semifields -/ +@[expose] public section + variable {α : Type*} [Semifield α] [LinearOrder α] [CanonicallyOrderedAdd α] -- See note [reducible non-instances] diff --git a/Mathlib/Algebra/Order/Field/Defs.lean b/Mathlib/Algebra/Order/Field/Defs.lean index d51b8db88c009e..86f95f44436ac5 100644 --- a/Mathlib/Algebra/Order/Field/Defs.lean +++ b/Mathlib/Algebra/Order/Field/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Field.Defs -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "for `[LinearOrderedSemifield]`, use `[Semifield K] [LinearOrder K] [IsStrictOrderedRing K]` \ diff --git a/Mathlib/Algebra/Order/Field/GeomSum.lean b/Mathlib/Algebra/Order/Field/GeomSum.lean index 2621ca20645912..e1eb5657eb5cb8 100644 --- a/Mathlib/Algebra/Order/Field/GeomSum.lean +++ b/Mathlib/Algebra/Order/Field/GeomSum.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland -/ -import Mathlib.Algebra.Field.GeomSum -import Mathlib.Algebra.Order.Ring.Defs +module + +public import Mathlib.Algebra.Field.GeomSum +public import Mathlib.Algebra.Order.Ring.Defs /-! # Partial sums of geometric series in an ordered field @@ -13,6 +15,8 @@ This file upper- and lower-bounds the values of the geometric series $\sum_{i=0} $\sum_{i=0}^{n-1} x^i y^{n-1-i}$ and variants thereof. -/ +@[expose] public section + variable {K : Type*} open Finset MulOpposite diff --git a/Mathlib/Algebra/Order/Field/InjSurj.lean b/Mathlib/Algebra/Order/Field/InjSurj.lean index 53bfafee89d81e..251ec1bbcaf2a9 100644 --- a/Mathlib/Algebra/Order/Field/InjSurj.lean +++ b/Mathlib/Algebra/Order/Field/InjSurj.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Order.Ring.InjSurj -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Ring.InjSurj +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-16") diff --git a/Mathlib/Algebra/Order/Field/Pi.lean b/Mathlib/Algebra/Order/Field/Pi.lean index 01426c4a02874e..2fffd39059c8eb 100644 --- a/Mathlib/Algebra/Order/Field/Pi.lean +++ b/Mathlib/Algebra/Order/Field/Pi.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Fintype.Basic /-! # Lemmas about (finite domain) functions into fields. @@ -15,6 +17,8 @@ import Mathlib.Data.Fintype.Basic We split this from `Algebra.Order.Field.Basic` to avoid importing the finiteness hierarchy there. -/ +@[expose] public section + variable {α ι : Type*} [AddCommMonoid α] [LinearOrder α] [IsOrderedCancelAddMonoid α] [Nontrivial α] [DenselyOrdered α] diff --git a/Mathlib/Algebra/Order/Field/Pointwise.lean b/Mathlib/Algebra/Order/Field/Pointwise.lean index f8fa44d48d2986..d8498cf724c69a 100644 --- a/Mathlib/Algebra/Order/Field/Pointwise.lean +++ b/Mathlib/Algebra/Order/Field/Pointwise.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Yaël Dillies -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Order.Interval.Set.OrderIso +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Order.Interval.Set.OrderIso /-! # Pointwise operations on ordered algebraic objects @@ -16,6 +18,8 @@ import Mathlib.Order.Interval.Set.OrderIso This file contains lemmas about the effect of pointwise operations on sets with an order structure. -/ +@[expose] public section + open Function Set open scoped Pointwise diff --git a/Mathlib/Algebra/Order/Field/Power.lean b/Mathlib/Algebra/Order/Field/Power.lean index 55e1ef689175dc..f51082e4818bf5 100644 --- a/Mathlib/Algebra/Order/Field/Power.lean +++ b/Mathlib/Algebra/Order/Field/Power.lean @@ -3,15 +3,19 @@ Copyright (c) 2014 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn, Sabbir Rahman -/ -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Algebra.Order.Ring.Pow -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Tactic.Positivity.Core +module + +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Algebra.Order.Ring.Pow +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Tactic.Positivity.Core /-! # Lemmas about powers in ordered fields. -/ +@[expose] public section + variable {α : Type*} @@ -113,7 +117,7 @@ open Lean Meta Qq /-- The `positivity` extension which identifies expressions of the form `a ^ (b : ℤ)`, such that `positivity` successfully recognises both `a` and `b`. -/ @[positivity _ ^ (_ : ℤ), Pow.pow _ (_ : ℤ)] -def evalZPow : PositivityExt where eval {u α} zα pα e := do +meta def evalZPow : PositivityExt where eval {u α} zα pα e := do let .app (.app _ (a : Q($α))) (b : Q(ℤ)) ← withReducible (whnf e) | throwError "not ^" let result ← catchNone do let _a ← synthInstanceQ q(Field $α) diff --git a/Mathlib/Algebra/Order/Field/Rat.lean b/Mathlib/Algebra/Order/Field/Rat.lean index ff3a00c2f07606..ee102e7827cebc 100644 --- a/Mathlib/Algebra/Order/Field/Rat.lean +++ b/Mathlib/Algebra/Order/Field/Rat.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Rat -import Mathlib.Algebra.Order.Nonneg.Field -import Mathlib.Algebra.Order.Ring.Rat +module + +public import Mathlib.Algebra.Field.Rat +public import Mathlib.Algebra.Order.Nonneg.Field +public import Mathlib.Algebra.Order.Ring.Rat /-! # The rational numbers form a linear ordered field @@ -21,4 +23,6 @@ See note [foundational algebra order theory]. rat, rationals, field, ℚ, numerator, denominator, num, denom -/ +@[expose] public section + deriving instance LinearOrderedCommGroupWithZero for NNRat diff --git a/Mathlib/Algebra/Order/Field/Subfield.lean b/Mathlib/Algebra/Order/Field/Subfield.lean index 0cd2a3c567eccb..dc5fcd3356fe13 100644 --- a/Mathlib/Algebra/Order/Field/Subfield.lean +++ b/Mathlib/Algebra/Order/Field/Subfield.lean @@ -3,14 +3,17 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Algebra.Field.Subfield.Defs -import Mathlib.Algebra.Order.Ring.InjSurj +public import Mathlib.Algebra.Field.Subfield.Defs +public import Mathlib.Algebra.Order.Ring.InjSurj /-! # Ordered instances on subfields -/ +@[expose] public section + namespace Subfield variable {K : Type*} diff --git a/Mathlib/Algebra/Order/Floor.lean b/Mathlib/Algebra/Order/Floor.lean index 77425b9340c624..44d46218d6923e 100644 --- a/Mathlib/Algebra/Order/Floor.lean +++ b/Mathlib/Algebra/Order/Floor.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Floor.Defs -import Mathlib.Algebra.Order.Floor.Ring -import Mathlib.Algebra.Order.Floor.Semiring +module + +public import Mathlib.Algebra.Order.Floor.Defs +public import Mathlib.Algebra.Order.Floor.Ring +public import Mathlib.Algebra.Order.Floor.Semiring deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Algebra/Order/Floor/Defs.lean b/Mathlib/Algebra/Order/Floor/Defs.lean index 3c8b802e9b5483..890bcc11aa2ae4 100644 --- a/Mathlib/Algebra/Order/Floor/Defs.lean +++ b/Mathlib/Algebra/Order/Floor/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Ring.Cast -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Tactic.HaveI +module + +public import Mathlib.Algebra.Order.Ring.Cast +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Tactic.HaveI /-! # Floor and ceil @@ -44,6 +46,8 @@ many lemmas. rounding, floor, ceil -/ +@[expose] public section + assert_not_exists Finset open Set diff --git a/Mathlib/Algebra/Order/Floor/Div.lean b/Mathlib/Algebra/Order/Floor/Div.lean index bd67bdd48a214a..6e7a6171554461 100644 --- a/Mathlib/Algebra/Order/Floor/Div.lean +++ b/Mathlib/Algebra/Order/Floor/Div.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Action.Pi -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.Order.Preorder.Finsupp +module + +public import Mathlib.Algebra.GroupWithZero.Action.Pi +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.Finsupp.SMulWithZero +public import Mathlib.Order.Preorder.Finsupp /-! # Flooring, ceiling division @@ -49,6 +51,8 @@ Note in both cases we only allow dividing by positive inputs. We enforce the fol * Prove `⌈a / b⌉ = a ⌈/⌉ b` when `a, b : ℕ` -/ +@[expose] public section + variable {ι α β : Type*} section OrderedAddCommMonoid diff --git a/Mathlib/Algebra/Order/Floor/Ring.lean b/Mathlib/Algebra/Order/Floor/Ring.lean index 71f2bef2a1f52d..8335e1411fb7b1 100644 --- a/Mathlib/Algebra/Order/Floor/Ring.lean +++ b/Mathlib/Algebra/Order/Floor/Ring.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Tactic.Abel -import Mathlib.Tactic.Field -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Positivity.Core +module + +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Positivity.Core /-! # Lemmas on `Int.floor`, `Int.ceil` and `Int.fract` @@ -25,6 +27,8 @@ fractional part operator. rounding, floor, ceil -/ +@[expose] public section + assert_not_exists Finset open Set @@ -46,7 +50,7 @@ private theorem int_floor_nonneg_of_pos [Ring α] [LinearOrder α] [FloorRing α /-- Extension for the `positivity` tactic: `Int.floor` is nonnegative if its input is. -/ @[positivity ⌊_⌋] -def evalIntFloor : PositivityExt where eval {u α} _zα _pα e := do +meta def evalIntFloor : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℤ), ~q(@Int.floor $α' $ir $io $j $a) => match ← core q(inferInstance) q(inferInstance) a with @@ -65,7 +69,7 @@ private theorem nat_ceil_pos [Semiring α] [LinearOrder α] [FloorSemiring α] { /-- Extension for the `positivity` tactic: `Nat.ceil` is positive if its input is. -/ @[positivity ⌈_⌉₊] -def evalNatCeil : PositivityExt where eval {u α} _zα _pα e := do +meta def evalNatCeil : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℕ), ~q(@Nat.ceil $α' $ir $io $j $a) => let _i ← synthInstanceQ q(LinearOrder $α') @@ -83,7 +87,7 @@ private theorem int_ceil_pos [Ring α] [LinearOrder α] [FloorRing α] {a : α} /-- Extension for the `positivity` tactic: `Int.ceil` is positive/nonnegative if its input is. -/ @[positivity ⌈_⌉] -def evalIntCeil : PositivityExt where eval {u α} _zα _pα e := do +meta def evalIntCeil : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℤ), ~q(@Int.ceil $α' $ir $io $j $a) => match ← core q(inferInstance) q(inferInstance) a with diff --git a/Mathlib/Algebra/Order/Floor/Semifield.lean b/Mathlib/Algebra/Order/Floor/Semifield.lean index c1253653120a80..fc06c1d12e20c5 100644 --- a/Mathlib/Algebra/Order/Floor/Semifield.lean +++ b/Mathlib/Algebra/Order/Floor/Semifield.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Tactic.Linarith /-! # Lemmas on `Nat.floor` and `Nat.ceil` for semifields @@ -17,6 +19,8 @@ This file contains basic results on the natural-valued floor and ceiling functio rounding, floor, ceil -/ +@[expose] public section + assert_not_exists Finset open Set @@ -136,7 +140,7 @@ theorem IsRat.natFloor {R : Type*} [Field R] [LinearOrder R] [IsStrictOrderedRin open Lean in /-- `norm_num` extension for `Nat.floor` -/ @[norm_num ⌊_⌋₊] -def evalNatFloor : NormNumExt where eval {u αZ} e := do +meta def evalNatFloor : NormNumExt where eval {u αZ} e := do match u, αZ, e with | 0, ~q(ℕ), ~q(@Nat.floor $α $instSemiring $instPartialOrder $instFloorSemiring $x) => match ← derive x with diff --git a/Mathlib/Algebra/Order/Floor/Semiring.lean b/Mathlib/Algebra/Order/Floor/Semiring.lean index e4f6cfe2650434..06f0ec403f5e5a 100644 --- a/Mathlib/Algebra/Order/Floor/Semiring.lean +++ b/Mathlib/Algebra/Order/Floor/Semiring.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Floor.Defs -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Algebra.Order.Floor.Defs +public import Mathlib.Order.Interval.Set.Defs /-! # Lemmas on `Nat.floor` and `Nat.ceil` for semirings @@ -20,6 +22,8 @@ This file contains basic results on the natural-valued floor and ceiling functio rounding, floor, ceil -/ +@[expose] public section + assert_not_exists Finset open Set diff --git a/Mathlib/Algebra/Order/Group/Abs.lean b/Mathlib/Algebra/Order/Group/Abs.lean index 3a6d9a1ce91632..4b0d031987fd52 100644 --- a/Mathlib/Algebra/Order/Group/Abs.lean +++ b/Mathlib/Algebra/Order/Group/Abs.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +module + +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow /-! # Absolute values in ordered groups @@ -19,6 +21,8 @@ negation. This generalizes the usual absolute value on real numbers (`|x| = max - `|a|ₘ`: The *absolute value* of an element `a` of a multiplicative lattice ordered group -/ +@[expose] public section + open Function variable {G : Type*} diff --git a/Mathlib/Algebra/Order/Group/Action.lean b/Mathlib/Algebra/Order/Group/Action.lean index a7518e16fe6800..1bf8f63f7f9206 100644 --- a/Mathlib/Algebra/Order/Group/Action.lean +++ b/Mathlib/Algebra/Order/Group/Action.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.Defs -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.Defs +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Results about `CovariantClass G α HSMul.hSMul LE.le` @@ -15,6 +17,8 @@ When working with group actions rather than modules, we drop the `0 < c` conditi Notably these are relevant for pointwise actions on set-like objects. -/ +@[expose] public section + variable {ι : Sort*} {M α : Type*} theorem smul_mono_right [SMul M α] [Preorder α] [CovariantClass M α HSMul.hSMul LE.le] diff --git a/Mathlib/Algebra/Order/Group/Action/End.lean b/Mathlib/Algebra/Order/Group/Action/End.lean index a9f54fbeedda5d..80898f808cbb4e 100644 --- a/Mathlib/Algebra/Order/Group/Action/End.lean +++ b/Mathlib/Algebra/Order/Group/Action/End.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Faithful -import Mathlib.Algebra.Order.Group.End -import Mathlib.Order.RelIso.Basic +module + +public import Mathlib.Algebra.Group.Action.Faithful +public import Mathlib.Algebra.Order.Group.End +public import Mathlib.Order.RelIso.Basic /-! # Tautological action by relation automorphisms -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace RelHom diff --git a/Mathlib/Algebra/Order/Group/Action/Flag.lean b/Mathlib/Algebra/Order/Group/Action/Flag.lean index 9c0df44a78e6dd..f96960bce35f73 100644 --- a/Mathlib/Algebra/Order/Group/Action/Flag.lean +++ b/Mathlib/Algebra/Order/Group/Action/Flag.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Order.Group.Action.End -import Mathlib.Order.Preorder.Chain +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Order.Group.Action.End +public import Mathlib.Order.Preorder.Chain /-! # Action on flags @@ -13,6 +15,8 @@ import Mathlib.Order.Preorder.Chain Order isomorphisms act on flags. -/ +@[expose] public section + open scoped Pointwise variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Group/Action/Synonym.lean b/Mathlib/Algebra/Order/Group/Action/Synonym.lean index 7c948e968c2b3d..6ff2b276941c84 100644 --- a/Mathlib/Algebra/Order/Group/Action/Synonym.lean +++ b/Mathlib/Algebra/Order/Group/Action/Synonym.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Order.Group.Synonym +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Order.Group.Synonym /-! # Actions by and on order synonyms @@ -17,6 +19,8 @@ This PR transfers group action instances from a type `α` to `αᵒᵈ` and `Lex * `Mathlib/Algebra/Order/Module/Synonym.lean` -/ +@[expose] public section + variable {M N α : Type*} namespace OrderDual diff --git a/Mathlib/Algebra/Order/Group/Basic.lean b/Mathlib/Algebra/Order/Group/Basic.lean index 5dafc9212f8b0d..2c65020341ab4e 100644 --- a/Mathlib/Algebra/Order/Group/Basic.lean +++ b/Mathlib/Algebra/Order/Group/Basic.lean @@ -3,14 +3,18 @@ Copyright (c) 2015 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Robert Y. Lewis -/ -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow /-! # Lemmas about the interaction of power operations with order -/ +@[expose] public section + -- We should need only a minimal development of sets in order to get here. assert_not_exists Set.Subsingleton diff --git a/Mathlib/Algebra/Order/Group/Bounds.lean b/Mathlib/Algebra/Order/Group/Bounds.lean index 0e0f9be68fffbe..de1fd6dbc93f0b 100644 --- a/Mathlib/Algebra/Order/Group/Bounds.lean +++ b/Mathlib/Algebra/Order/Group/Bounds.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Order.Bounds.Basic -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Basic +module + +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic /-! # Least upper bound and the greatest lower bound in linear ordered additive commutative groups -/ +@[expose] public section + section LinearOrderedAddCommGroup variable {α : Type*} [AddCommGroup α] [LinearOrder α] [IsOrderedAddMonoid α] {s : Set α} {a ε : α} diff --git a/Mathlib/Algebra/Order/Group/CompleteLattice.lean b/Mathlib/Algebra/Order/Group/CompleteLattice.lean index 69e9649b537def..f6ceab3d95ca84 100644 --- a/Mathlib/Algebra/Order/Group/CompleteLattice.lean +++ b/Mathlib/Algebra/Order/Group/CompleteLattice.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Order.ConditionallyCompleteLattice.Indexed +module + +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed /-! # Distributivity of group operations over supremum/infimum -/ +@[expose] public section + open Function Set variable {ι G : Type*} [Group G] [ConditionallyCompleteLattice G] [Nonempty ι] {f : ι → G} diff --git a/Mathlib/Algebra/Order/Group/Cone.lean b/Mathlib/Algebra/Order/Group/Cone.lean index 92a41e04655e06..32c030bfe31f64 100644 --- a/Mathlib/Algebra/Order/Group/Cone.lean +++ b/Mathlib/Algebra/Order/Group/Cone.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison, Artie Khovanov -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Submonoid +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Submonoid /-! # Construct ordered groups from groups with a specified positive cone. @@ -18,6 +20,8 @@ We also provide constructors that convert between cones in groups and the corresponding ordered groups. -/ +@[expose] public section + /-- `AddGroupConeClass S G` says that `S` is a type of cones in `G`. -/ class AddGroupConeClass (S : Type*) (G : outParam Type*) [AddCommGroup G] [SetLike S G] : Prop extends AddSubmonoidClass S G where diff --git a/Mathlib/Algebra/Order/Group/Cyclic.lean b/Mathlib/Algebra/Order/Group/Cyclic.lean index e4eb9613e6f6c3..5741ab7e3a05ab 100644 --- a/Mathlib/Algebra/Order/Group/Cyclic.lean +++ b/Mathlib/Algebra/Order/Group/Cyclic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.Order.Group.Basic -import Mathlib.GroupTheory.SpecificGroups.Cyclic +module + +public import Mathlib.Algebra.Order.Group.Basic +public import Mathlib.GroupTheory.SpecificGroups.Cyclic /-! # Cyclic linearly ordered groups @@ -18,6 +20,8 @@ ordered commutative group with (*resp.* of a non-trivial linearly ordered commut is strictly less than `1`. The corresponding additive definitions are also provided. -/ +@[expose] public section + noncomputable section namespace LinearOrderedCommGroup diff --git a/Mathlib/Algebra/Order/Group/Defs.lean b/Mathlib/Algebra/Order/Group/Defs.lean index 74cb4e0e3a985b..a3734b99d10c57 100644 --- a/Mathlib/Algebra/Order/Group/Defs.lean +++ b/Mathlib/Algebra/Order/Group/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Util.AssertExists +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Util.AssertExists /-! # Ordered groups @@ -20,6 +22,8 @@ may differ between the multiplicative and the additive version of a lemma. The reason is that we did not want to change existing names in the library. -/ +@[expose] public section + /- `NeZero` theory should not be needed at this point in the ordered algebraic hierarchy. -/ @@ -59,7 +63,7 @@ but we still use the namespaces. TODO: everything in these namespaces should be renamed; even if these typeclasses still existed, it's unconventional to put theorems in namespaces named after them. -/ -run_meta ToAdditive.insertTranslation `LinearOrderedCommGroup `LinearOrderedAddCommGroup +insert_to_additive_translation LinearOrderedCommGroup LinearOrderedAddCommGroup section LinearOrderedCommGroup diff --git a/Mathlib/Algebra/Order/Group/DenselyOrdered.lean b/Mathlib/Algebra/Order/Group/DenselyOrdered.lean index f467a4a9e6e7c9..69879c031ea0e3 100644 --- a/Mathlib/Algebra/Order/Group/DenselyOrdered.lean +++ b/Mathlib/Algebra/Order/Group/DenselyOrdered.lean @@ -3,17 +3,21 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +module + +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow /-! # Lemmas about densely linearly ordered groups. -/ +@[expose] public section + variable {α : Type*} section DenselyOrdered diff --git a/Mathlib/Algebra/Order/Group/End.lean b/Mathlib/Algebra/Order/Group/End.lean index 1d95f7ccec9105..92ab1280f939a9 100644 --- a/Mathlib/Algebra/Order/Group/End.lean +++ b/Mathlib/Algebra/Order/Group/End.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Order.RelIso.Basic +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Order.RelIso.Basic /-! # Relation isomorphisms form a group -/ +@[expose] public section + assert_not_exists MulAction MonoidWithZero variable {α : Type*} {r : α → α → Prop} diff --git a/Mathlib/Algebra/Order/Group/Equiv.lean b/Mathlib/Algebra/Order/Group/Equiv.lean index fcbfb26951c75c..0cdaffe601e267 100644 --- a/Mathlib/Algebra/Order/Group/Equiv.lean +++ b/Mathlib/Algebra/Order/Group/Equiv.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Order.Group.Synonym +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Order.Group.Synonym /-! # Add/Mul equivalence for order type synonyms -/ +@[expose] public section + variable (α : Type*) [Mul α] /-- `toLex` as a `MulEquiv`. -/ diff --git a/Mathlib/Algebra/Order/Group/Finset.lean b/Mathlib/Algebra/Order/Group/Finset.lean index f3aeaf2a9363e5..ba4f2e16aed65f 100644 --- a/Mathlib/Algebra/Order/Group/Finset.lean +++ b/Mathlib/Algebra/Order/Group/Finset.lean @@ -3,17 +3,21 @@ Copyright (c) 2024 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Data.Finset.Lattice.Prod +module + +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Data.Finset.Lattice.Prod /-! # `Finset.sup` in a group -/ +@[expose] public section + open scoped Finset assert_not_exists MonoidWithZero diff --git a/Mathlib/Algebra/Order/Group/Ideal.lean b/Mathlib/Algebra/Order/Group/Ideal.lean new file mode 100644 index 00000000000000..5a2f671c8a3646 --- /dev/null +++ b/Mathlib/Algebra/Order/Group/Ideal.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2025 Dexin Zhang. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Dexin Zhang +-/ +module + +public import Mathlib.Algebra.Group.Ideal +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Order.WellFoundedSet + +/-! +# Semigroup ideals in a canonically ordered and well-quasi-ordered monoid + +This file proves that in a canonically ordered and well-quasi-ordered monoid, any semigroup ideal is +finitely generated, and the semigroup ideals satisfy the ascending chain condition. + +## References + +* [Samuel Eilenberg and M. P. Schützenberger, *Rational Sets in Commutative Monoids*][eilenberg1969] +-/ + +@[expose] public section + +namespace SemigroupIdeal + +variable {M : Type*} [CommMonoid M] [PartialOrder M] [WellQuasiOrderedLE M] + [CanonicallyOrderedMul M] + +/-- In a canonically ordered and well-quasi-ordered monoid, any semigroup ideal is finitely +generated. -/ +@[to_additive /-- In a canonically ordered and well-quasi-ordered additive monoid, any semigroup +ideal is finitely generated. -/] +theorem fg_of_wellQuasiOrderedLE (I : SemigroupIdeal M) : I.FG := by + have hpwo := Set.isPWO_of_wellQuasiOrderedLE { x | x ∈ I } + refine ⟨_, (setOf_minimal_antichain _).finite_of_partiallyWellOrderedOn + (hpwo.mono (setOf_minimal_subset _)), ?_⟩ + ext x + simp only [mem_closure'', SetLike.setOf_mem_eq, SetLike.mem_coe, Set.mem_setOf_eq] + constructor + · intro hx + rcases hpwo.exists_le_minimal hx with ⟨z, hz, hz'⟩ + rw [le_iff_exists_mul'] at hz + rcases hz with ⟨y, rfl⟩ + exact ⟨y, z, hz', rfl⟩ + · rintro ⟨y, z, hz, rfl⟩ + apply SubMulAction.smul_mem + exact hz.1 + +/-- In a canonically ordered and well-quasi-ordered monoid, the semigroup ideals satisfy the +ascending chain condition. -/ +@[to_additive /-- A canonically ordered and well-quasi-ordered additive monoid, the semigroup ideals +satisfy the ascending chain condition. -/] +instance : WellFoundedGT (SemigroupIdeal M) := by + rw [wellFoundedGT_iff_monotone_chain_condition] + intro f + rcases fg_iff.1 (fg_of_wellQuasiOrderedLE (⨆ i, f i)) with ⟨s, hI⟩ + have hs : ∀ x ∈ s, ∃ i, x ∈ f i := by + intro x hx + apply subset_closure (s := (s : Set M)) at hx + simpa [← hI] using hx + choose! g hg using hs + exists s.sup g + intro n hn + apply (f.mono hn).antisymm + apply (le_iSup f n).trans + intro x hx + rw [SetLike.mem_coe, hI, mem_closure''] at hx + rcases hx with ⟨y, z, hz, rfl⟩ + exact SemigroupIdeal.mul_mem _ _ (f.mono (Finset.le_sup hz) (hg _ hz)) + +end SemigroupIdeal diff --git a/Mathlib/Algebra/Order/Group/Indicator.lean b/Mathlib/Algebra/Order/Group/Indicator.lean index 90813a690ad225..7f1be67b967faf 100644 --- a/Mathlib/Algebra/Order/Group/Indicator.lean +++ b/Mathlib/Algebra/Order/Group/Indicator.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Indicator -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Monoid.Canonical.Defs +module + +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs /-! # Support of a function in an order @@ -15,6 +17,8 @@ import Mathlib.Algebra.Order.Monoid.Canonical.Defs This file relates the support of a function to order constructions. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Set diff --git a/Mathlib/Algebra/Order/Group/InjSurj.lean b/Mathlib/Algebra/Order/Group/InjSurj.lean index 9f13b468a24c89..40790f39be6da7 100644 --- a/Mathlib/Algebra/Order/Group/InjSurj.lean +++ b/Mathlib/Algebra/Order/Group/InjSurj.lean @@ -3,7 +3,9 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Monoid.Basic +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-16") diff --git a/Mathlib/Algebra/Order/Group/Instances.lean b/Mathlib/Algebra/Order/Group/Instances.lean index 79e96bc821e7a4..6850cd5d3ecde1 100644 --- a/Mathlib/Algebra/Order/Group/Instances.lean +++ b/Mathlib/Algebra/Order/Group/Instances.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-16") diff --git a/Mathlib/Algebra/Order/Group/Int.lean b/Mathlib/Algebra/Order/Group/Int.lean index 5b96cfa1ab753b..7e04df1b52255f 100644 --- a/Mathlib/Algebra/Order/Group/Int.lean +++ b/Mathlib/Algebra/Order/Group/Int.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Order.Monoid.Defs +module + +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Order.Monoid.Defs /-! # The integers form a linear ordered group @@ -15,6 +17,8 @@ additive group. See note [foundational algebra order theory]. -/ +@[expose] public section + -- We should need only a minimal development of sets in order to get here. assert_not_exists Set.Subsingleton Ring diff --git a/Mathlib/Algebra/Order/Group/Int/Sum.lean b/Mathlib/Algebra/Order/Group/Int/Sum.lean index bf589ca3008da4..7ce2517aae8c69 100644 --- a/Mathlib/Algebra/Order/Group/Int/Sum.lean +++ b/Mathlib/Algebra/Order/Group/Int/Sum.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Data.Int.Interval +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Data.Int.Interval /-! # Sharp bounds for sums of bounded finsets of integers @@ -16,6 +18,8 @@ a sharper upper bound than `#s * c`, because the elements are distinct. This file provides these sharp bounds, both in the upper-bounded and analogous lower-bounded cases. -/ +@[expose] public section + namespace Finset diff --git a/Mathlib/Algebra/Order/Group/Lattice.lean b/Mathlib/Algebra/Order/Group/Lattice.lean index f615bc5101bf0b..015f62bce25b8d 100644 --- a/Mathlib/Algebra/Order/Group/Lattice.lean +++ b/Mathlib/Algebra/Order/Group/Lattice.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin, Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.OrderIso +module + +public import Mathlib.Algebra.Order.Group.OrderIso /-! # Lattice ordered groups @@ -35,6 +37,8 @@ in mathlib. lattice, order, group -/ +@[expose] public section + open Function variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Group/MinMax.lean b/Mathlib/Algebra/Order/Group/MinMax.lean index 342852146627d7..0e0d491022b9aa 100644 --- a/Mathlib/Algebra/Order/Group/MinMax.lean +++ b/Mathlib/Algebra/Order/Group/MinMax.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax +module + +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax /-! # `min` and `max` in linearly ordered groups. -/ +@[expose] public section + section diff --git a/Mathlib/Algebra/Order/Group/Multiset.lean b/Mathlib/Algebra/Order/Group/Multiset.lean index ec14ec5558484f..c9cd76d34c66bd 100644 --- a/Mathlib/Algebra/Order/Group/Multiset.lean +++ b/Mathlib/Algebra/Order/Group/Multiset.lean @@ -3,11 +3,13 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Data.Multiset.Fold +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Data.Multiset.Fold /-! # Multisets form an ordered monoid @@ -17,6 +19,8 @@ This file contains the ordered monoid instance on multisets, and lemmas related See note [foundational algebra order theory]. -/ +@[expose] public section + open List Nat variable {α β : Type*} diff --git a/Mathlib/Algebra/Order/Group/Nat.lean b/Mathlib/Algebra/Order/Group/Nat.lean index 8095d6adcb265e..a99e3537605c30 100644 --- a/Mathlib/Algebra/Order/Group/Nat.lean +++ b/Mathlib/Algebra/Order/Group/Nat.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Sub.Defs +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Sub.Defs /-! # The naturals form a linear ordered monoid @@ -15,6 +17,8 @@ This file contains the linear ordered monoid instance on the natural numbers. See note [foundational algebra order theory]. -/ +@[expose] public section + namespace Nat /-! ### Instances -/ diff --git a/Mathlib/Algebra/Order/Group/Opposite.lean b/Mathlib/Algebra/Order/Group/Opposite.lean index b5e7bfcb136bec..b757e1f3783757 100644 --- a/Mathlib/Algebra/Order/Group/Opposite.lean +++ b/Mathlib/Algebra/Order/Group/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Order.Monoid.Defs +module + +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Order.Monoid.Defs /-! # Order instances for `MulOpposite`/`AddOpposite` @@ -13,6 +15,8 @@ This file transfers order instances and ordered monoid/group instances from `α` `αᵃᵒᵖ`. -/ +@[expose] public section + variable {α : Type*} namespace MulOpposite diff --git a/Mathlib/Algebra/Order/Group/OrderIso.lean b/Mathlib/Algebra/Order/Group/OrderIso.lean index a10a10770a104f..400baf0164f2f7 100644 --- a/Mathlib/Algebra/Order/Group/OrderIso.lean +++ b/Mathlib/Algebra/Order/Group/OrderIso.lean @@ -3,15 +3,19 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Order.Hom.Basic /-! # Inverse and multiplication as order isomorphisms in ordered groups -/ +@[expose] public section + open Function universe u diff --git a/Mathlib/Algebra/Order/Group/PartialSups.lean b/Mathlib/Algebra/Order/Group/PartialSups.lean index 075a880f37f5d8..6bae4155fb5f61 100644 --- a/Mathlib/Algebra/Order/Group/PartialSups.lean +++ b/Mathlib/Algebra/Order/Group/PartialSups.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Lua Viana Reis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lua Viana Reis -/ -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Order.PartialSups +module + +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Order.PartialSups /-! # Results about `partialSups` of functions taking values in a `Group` -/ +@[expose] public section + variable {α ι : Type*} variable [SemilatticeSup α] [Group α] [Preorder ι] [LocallyFiniteOrderBot ι] diff --git a/Mathlib/Algebra/Order/Group/PiLex.lean b/Mathlib/Algebra/Order/Group/PiLex.lean index f0d895b498b748..ff98752bf037ac 100644 --- a/Mathlib/Algebra/Order/Group/PiLex.lean +++ b/Mathlib/Algebra/Order/Group/PiLex.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Order.PiLex +module + +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Order.PiLex /-! # Lexicographic product of algebraic order structures @@ -15,6 +17,8 @@ This file proves that the lexicographic order on pi types is compatible with the operations. -/ +@[expose] public section + namespace Pi.Lex variable {ι : Type*} {α : ι → Type*} [LinearOrder ι] diff --git a/Mathlib/Algebra/Order/Group/Pointwise/Bounds.lean b/Mathlib/Algebra/Order/Group/Pointwise/Bounds.lean index 9582521b172a44..516aff68563b6a 100644 --- a/Mathlib/Algebra/Order/Group/Pointwise/Bounds.lean +++ b/Mathlib/Algebra/Order/Group/Pointwise/Bounds.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Order.Bounds.OrderIso -import Mathlib.Order.GaloisConnection.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Order.Bounds.OrderIso +public import Mathlib.Order.GaloisConnection.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Upper/lower bounds in ordered monoids and groups @@ -16,6 +18,8 @@ In this file we prove a few facts like “`-s` is bounded above iff `s` is bound (`bddAbove_neg`). -/ +@[expose] public section + open Function Set open scoped Pointwise diff --git a/Mathlib/Algebra/Order/Group/Pointwise/CompleteLattice.lean b/Mathlib/Algebra/Order/Group/Pointwise/CompleteLattice.lean index bdd12efab2f9b6..e1e34747c02d4b 100644 --- a/Mathlib/Algebra/Order/Group/Pointwise/CompleteLattice.lean +++ b/Mathlib/Algebra/Order/Group/Pointwise/CompleteLattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.Pointwise.Bounds -import Mathlib.Order.ConditionallyCompleteLattice.Indexed +module + +public import Mathlib.Algebra.Order.Group.Pointwise.Bounds +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed /-! # Infima/suprema in ordered monoids and groups @@ -17,6 +19,8 @@ In this file we prove a few facts like “The infimum of `-s` is `-` the supremu `CovariantClass` is currently not polymorphic enough to state it. -/ +@[expose] public section + open Function Set open scoped Pointwise diff --git a/Mathlib/Algebra/Order/Group/Pointwise/Interval.lean b/Mathlib/Algebra/Order/Group/Pointwise/Interval.lean index 319012df849a87..cb4d5eff3fdd0e 100644 --- a/Mathlib/Algebra/Order/Group/Pointwise/Interval.lean +++ b/Mathlib/Algebra/Order/Group/Pointwise/Interval.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Algebra.Order.Group.MinMax -import Mathlib.Algebra.Order.Interval.Set.Monoid -import Mathlib.Order.Interval.Set.OrderIso -import Mathlib.Order.Interval.Set.UnorderedInterval -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Algebra.Order.Group.MinMax +public import Mathlib.Algebra.Order.Interval.Set.Monoid +public import Mathlib.Order.Interval.Set.OrderIso +public import Mathlib.Order.Interval.Set.UnorderedInterval +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # (Pre)images of intervals @@ -21,6 +23,8 @@ lemmas about preimages and images of all intervals. We also prove a few lemmas a `x ↦ a * x`, `x ↦ x * a` and `x ↦ x⁻¹`. -/ +@[expose] public section + open Interval Pointwise diff --git a/Mathlib/Algebra/Order/Group/PosPart.lean b/Mathlib/Algebra/Order/Group/PosPart.lean index 466d3319d09249..6db33b65c80408 100644 --- a/Mathlib/Algebra/Order/Group/PosPart.lean +++ b/Mathlib/Algebra/Order/Group/PosPart.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin, Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Notation +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Notation /-! # Positive & negative parts @@ -35,6 +37,8 @@ element in a lattice ordered group. positive part, negative part -/ +@[expose] public section + open Function variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Group/Prod.lean b/Mathlib/Algebra/Order/Group/Prod.lean index b5c4c7c6950c48..bdd4ef2977c68f 100644 --- a/Mathlib/Algebra/Order/Group/Prod.lean +++ b/Mathlib/Algebra/Order/Group/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Monoid.Prod -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Monoid.Prod +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-16") diff --git a/Mathlib/Algebra/Order/Group/Synonym.lean b/Mathlib/Algebra/Order/Group/Synonym.lean index 4a378ceda4fd8a..7a0dfc29743ed5 100644 --- a/Mathlib/Algebra/Order/Group/Synonym.lean +++ b/Mathlib/Algebra/Order/Group/Synonym.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Order.Synonym +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Order.Synonym /-! # Group structure on the order type synonyms @@ -12,6 +14,8 @@ import Mathlib.Order.Synonym Transfer algebraic instances from `α` to `αᵒᵈ`, `Lex α`, and `Colex α`. -/ +@[expose] public section + open OrderDual @@ -104,6 +108,9 @@ theorem toDual_one [One α] : toDual (1 : α) = 1 := rfl @[to_additive (attr := simp)] theorem ofDual_one [One α] : (ofDual 1 : α) = 1 := rfl +@[to_additive (attr := simp)] lemma toDual_eq_one [One α] {a : α} : toDual a = 1 ↔ a = 1 := .rfl +@[to_additive (attr := simp)] lemma ofDual_eq_one [One α] {a : αᵒᵈ} : ofDual a = 1 ↔ a = 1 := .rfl + @[to_additive (attr := simp)] theorem toDual_mul [Mul α] (a b : α) : toDual (a * b) = toDual a * toDual b := rfl @@ -134,6 +141,29 @@ theorem pow_toDual [Pow α β] (a : α) (b : β) : a ^ toDual b = a ^ b := rfl @[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofDual_smul'] theorem pow_ofDual [Pow α β] (a : α) (b : βᵒᵈ) : a ^ ofDual b = a ^ b := rfl +section Monoid +variable [Monoid α] + +@[to_additive (attr := simp)] +lemma isLeftRegular_toDual {a : α} : IsLeftRegular (toDual a) ↔ IsLeftRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isLeftRegular_ofDual {a : αᵒᵈ} : IsLeftRegular (ofDual a) ↔ IsLeftRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRightRegular_toDual {a : α} : IsRightRegular (toDual a) ↔ IsRightRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRightRegular_ofDual {a : αᵒᵈ} : IsRightRegular (ofDual a) ↔ IsRightRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRegular_toDual {a : α} : IsRegular (toDual a) ↔ IsRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRegular_ofDual {a : αᵒᵈ} : IsRegular (ofDual a) ↔ IsRegular a := .rfl + +end Monoid + /-! ### Lexicographical order -/ @@ -260,6 +290,29 @@ theorem pow_toLex [Pow α β] (a : α) (b : β) : a ^ toLex b = a ^ b := rfl @[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofLex_smul'] theorem pow_ofLex [Pow α β] (a : α) (b : Lex β) : a ^ ofLex b = a ^ b := rfl +section Monoid +variable [Monoid α] + +@[to_additive (attr := simp)] +lemma isLeftRegular_toLex {a : α} : IsLeftRegular (toLex a) ↔ IsLeftRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isLeftRegular_ofLex {a : Lex α} : IsLeftRegular (ofLex a) ↔ IsLeftRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRightRegular_toLex {a : α} : IsRightRegular (toLex a) ↔ IsRightRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRightRegular_ofLex {a : Lex α} : IsRightRegular (ofLex a) ↔ IsRightRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRegular_toLex {a : α} : IsRegular (toLex a) ↔ IsRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRegular_ofLex {a : Lex α} : IsRegular (ofLex a) ↔ IsRegular a := .rfl + +end Monoid + /-! ### Colexicographical order -/ @@ -385,3 +438,26 @@ theorem pow_toColex [Pow α β] (a : α) (b : β) : a ^ toColex b = a ^ b := rfl @[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofColex_smul'] theorem pow_ofColex [Pow α β] (a : α) (b : Colex β) : a ^ ofColex b = a ^ b := rfl + +section Monoid +variable [Monoid α] + +@[to_additive (attr := simp)] +lemma isLeftRegular_toColex {a : α} : IsLeftRegular (toColex a) ↔ IsLeftRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isLeftRegular_ofColex {a : Colex α} : IsLeftRegular (ofColex a) ↔ IsLeftRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRightRegular_toColex {a : α} : IsRightRegular (toColex a) ↔ IsRightRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRightRegular_ofColex {a : Colex α} : IsRightRegular (ofColex a) ↔ IsRightRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRegular_toColex {a : α} : IsRegular (toColex a) ↔ IsRegular a := .rfl + +@[to_additive (attr := simp)] +lemma isRegular_ofColex {a : Colex α} : IsRegular (ofColex a) ↔ IsRegular a := .rfl + +end Monoid diff --git a/Mathlib/Algebra/Order/Group/TypeTags.lean b/Mathlib/Algebra/Order/Group/TypeTags.lean index 48c9800a3cba1d..dfed346cd93555 100644 --- a/Mathlib/Algebra/Order/Group/TypeTags.lean +++ b/Mathlib/Algebra/Order/Group/TypeTags.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Monoid.TypeTags -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Monoid.TypeTags +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-16") diff --git a/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean b/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean index f02b3974aff9c1..3c19511d68cdcb 100644 --- a/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean +++ b/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Order.Group.Lattice +module + +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Order.Group.Lattice /-! # Absolute values in ordered groups @@ -19,6 +21,8 @@ negation. This generalizes the usual absolute value on real numbers (`|x| = max - `|a|ₘ`: The *absolute value* of an element `a` of a multiplicative lattice ordered group -/ +@[expose] public section + open Function variable {α : Type*} @@ -42,7 +46,7 @@ macro:max atomic("|" noWs) a:term noWs "|" : term => `(abs $a) /-- Unexpander for the notation `|a|ₘ` for `mabs a`. Tries to add discretionary parentheses in unparsable cases. -/ @[app_unexpander mabs] -def mabs.unexpander : Lean.PrettyPrinter.Unexpander +meta def mabs.unexpander : Lean.PrettyPrinter.Unexpander | `($_ $a) => match a with | `(|$_|) | `(|$_|ₘ) | `(-$_) => `(|($a)|ₘ) @@ -52,7 +56,7 @@ def mabs.unexpander : Lean.PrettyPrinter.Unexpander /-- Unexpander for the notation `|a|` for `abs a`. Tries to add discretionary parentheses in unparsable cases. -/ @[app_unexpander abs] -def abs.unexpander : Lean.PrettyPrinter.Unexpander +meta def abs.unexpander : Lean.PrettyPrinter.Unexpander | `($_ $a) => match a with | `(|$_|) | `(|$_|ₘ) | `(-$_) => `(|($a)|) diff --git a/Mathlib/Algebra/Order/Group/Unbundled/Basic.lean b/Mathlib/Algebra/Order/Group/Unbundled/Basic.lean index 20bcd9fc595ca5..a8c493df6a3e16 100644 --- a/Mathlib/Algebra/Order/Group/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/Group/Unbundled/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Util.AssertExists +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Util.AssertExists /-! # Ordered groups @@ -19,6 +21,8 @@ may differ between the multiplicative and the additive version of a lemma. The reason is that we did not want to change existing names in the library. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid open Function diff --git a/Mathlib/Algebra/Order/Group/Unbundled/Int.lean b/Mathlib/Algebra/Order/Group/Unbundled/Int.lean index b5ecac88895b60..7366cd67e6aeba 100644 --- a/Mathlib/Algebra/Order/Group/Unbundled/Int.lean +++ b/Mathlib/Algebra/Order/Group/Unbundled/Int.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Data.Int.Basic +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Data.Int.Basic /-! # Facts about `ℤ` as an (unbundled) ordered group @@ -22,6 +24,8 @@ See note [foundational algebra order theory]. induction on numbers less than `b`. -/ +@[expose] public section + -- We should need only a minimal development of sets in order to get here. assert_not_exists Set.Subsingleton Ring diff --git a/Mathlib/Algebra/Order/Group/Units.lean b/Mathlib/Algebra/Order/Group/Units.lean index ae24b69b8cf7fb..56ed05570f2643 100644 --- a/Mathlib/Algebra/Order/Group/Units.lean +++ b/Mathlib/Algebra/Order/Group/Units.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Units +module + +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Units /-! # The units of an ordered commutative monoid form an ordered commutative group -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Order/GroupWithZero/Action/Synonym.lean b/Mathlib/Algebra/Order/GroupWithZero/Action/Synonym.lean index 91d193d7e09c93..aaa7bcc444f0d1 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Action/Synonym.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Action/Synonym.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Order.GroupWithZero.Synonym -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Synonym +public import Mathlib.Tactic.Common /-! # Actions by and on order synonyms @@ -19,6 +21,8 @@ the `SMul` instances are already defined in `Mathlib/Algebra/Order/Group/Synonym * `Mathlib/Algebra/Order/Module/Synonym.lean` -/ +@[expose] public section + variable {G₀ M₀ : Type*} namespace OrderDual diff --git a/Mathlib/Algebra/Order/GroupWithZero/Bounds.lean b/Mathlib/Algebra/Order/GroupWithZero/Bounds.lean index 1d59efeb2b69df..b8678aa1a7ca7a 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Bounds.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Bounds.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 María Inés de Frutos-Fernández . All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.Bounds.Image +module + +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.Bounds.Image /-! # Lemmas about `BddAbove` -/ +@[expose] public section + open Set /-- A variant of `BddAbove.range_comp` that assumes that `f` is nonnegative and `g` is monotone on diff --git a/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean b/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean index 2f5e2f1a238bf5..ebee2e94cfb61d 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean @@ -3,17 +3,20 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Johan Commelin, Patrick Massot -/ -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.GroupWithZero.WithZero -import Mathlib.Algebra.Order.AddGroupWithTop -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Group.Int -import Mathlib.Algebra.Order.Group.Units -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Basic -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Algebra.Order.Monoid.TypeTags -import Mathlib.Algebra.Group.WithOne.Map +module + +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.GroupWithZero.WithZero +public import Mathlib.Algebra.Order.AddGroupWithTop +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Group.Int +public import Mathlib.Algebra.Order.Group.Units +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Basic +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Algebra.Order.Monoid.TypeTags +public import Mathlib.Algebra.Group.WithOne.Map +public import Mathlib.Tactic.Tauto /-! # Linearly ordered commutative groups and monoids with a zero element adjoined @@ -29,6 +32,8 @@ whereas it is a very common target for valuations. The solutions is to use a typeclass, and that is exactly what we do in this file. -/ +@[expose] public section + variable {α β : Type*} /-- A linearly ordered commutative monoid with a zero element. -/ @@ -205,15 +210,15 @@ instance instLinearOrderedCommMonoidWithZeroMultiplicativeOrderDual mul_zero := @add_top _ (_) zero_le_one := (le_top : (0 : α) ≤ ⊤) -@[simp] +@[deprecated "Use simp" (since := "2025-11-17")] theorem ofAdd_toDual_eq_zero_iff [LinearOrderedAddCommMonoidWithTop α] (x : α) : Multiplicative.ofAdd (OrderDual.toDual x) = 0 ↔ x = ⊤ := Iff.rfl -@[simp] +@[deprecated "Use simp" (since := "2025-11-17")] theorem ofDual_toAdd_eq_top_iff [LinearOrderedAddCommMonoidWithTop α] (x : Multiplicative αᵒᵈ) : OrderDual.ofDual x.toAdd = ⊤ ↔ x = 0 := Iff.rfl -@[simp] +@[deprecated bot_eq_zero'' (since := "2025-11-17")] theorem ofAdd_bot [LinearOrderedAddCommMonoidWithTop α] : Multiplicative.ofAdd ⊥ = (0 : Multiplicative αᵒᵈ) := rfl diff --git a/Mathlib/Algebra/Order/GroupWithZero/Finset.lean b/Mathlib/Algebra/Order/GroupWithZero/Finset.lean index 453306049652f8..4b28b9eff6b340 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Finset.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Finset.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso +public import Mathlib.Data.Finset.Lattice.Fold /-! # `Finset.sup` in a group with zero -/ +@[expose] public section + namespace Finset variable {ι M₀ G₀ : Type*} diff --git a/Mathlib/Algebra/Order/GroupWithZero/Lex.lean b/Mathlib/Algebra/Order/GroupWithZero/Lex.lean index a21ab4ff61d902..b989a02d0bcc45 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Lex.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Lex.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.GroupWithZero.ProdHom -import Mathlib.Algebra.Order.Group.Equiv -import Mathlib.Algebra.Order.Monoid.Lex -import Mathlib.Algebra.Order.Hom.MonoidWithZero -import Mathlib.Data.Prod.Lex +module + +public import Mathlib.Algebra.GroupWithZero.ProdHom +public import Mathlib.Algebra.Order.Group.Equiv +public import Mathlib.Algebra.Order.Monoid.Lex +public import Mathlib.Algebra.Order.Hom.MonoidWithZero +public import Mathlib.Data.Prod.Lex /-! # Order homomorphisms for products of linearly ordered groups with zero @@ -26,6 +28,8 @@ Create the "LinOrdCommGrpWithZero" category. -/ +@[expose] public section + namespace MonoidWithZeroHom variable {M₀ N₀ : Type*} diff --git a/Mathlib/Algebra/Order/GroupWithZero/Submonoid.lean b/Mathlib/Algebra/Order/GroupWithZero/Submonoid.lean index 2e8cbb18cbedb4..2707560ec325b7 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Submonoid.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Submonoid.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Order.Interval.Set.Defs /-! # The submonoid of positive elements -/ +@[expose] public section + assert_not_exists RelIso Ring namespace Submonoid diff --git a/Mathlib/Algebra/Order/GroupWithZero/Synonym.lean b/Mathlib/Algebra/Order/GroupWithZero/Synonym.lean index 9a011c669888cb..9a59604b1e247e 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Synonym.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Synonym.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Algebra.Order.Group.Synonym +module + +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Algebra.Order.Group.Synonym /-! # Group with zero structure on the order type synonyms @@ -12,6 +14,8 @@ import Mathlib.Algebra.Order.Group.Synonym Transfer algebraic instances from `α` to `αᵒᵈ` and `Lex α`. -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean b/Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean index f8cb63bf13067c..0b2652140814f3 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Yuyang Zhao -/ -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Basic.lean b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Basic.lean index 61903833eda255..0bbdb1d15c4093 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Yuyang Zhao -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Order.Monotone.Basic -import Mathlib.Tactic.Bound.Attribute -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Order.Monotone.Basic +public import Mathlib.Tactic.Bound.Attribute +public import Mathlib.Tactic.Monotonicity.Attr /-! # Lemmas on the monotone multiplication typeclasses @@ -18,6 +20,8 @@ This file builds on `Mathlib/Algebra/Order/GroupWithZero/Unbundled/Defs.lean` by lemmas that do not immediately follow from the typeclass specifications. -/ +@[expose] public section + open Function variable {α M₀ G₀ : Type*} diff --git a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Defs.lean b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Defs.lean index 5f7105f9f9f0e5..6c4e071d58d5c6 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Defs.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Yuyang Zhao -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Defs -import Mathlib.Tactic.MkIffOfInductiveProp -import Mathlib.Util.Notation3 +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Defs +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Mathlib.Util.Notation3 /-! # (Strict) monotonicity of multiplication by nonnegative (positive) elements @@ -71,6 +73,8 @@ for a discussion about this notation, and whether to enable it globally (note th currently global but broken, hence actually only works locally). -/ +@[expose] public section + assert_not_exists MulZeroClass open Function diff --git a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Lemmas.lean b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Lemmas.lean index b188694d60a938..ece67126a4f08e 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Lemmas.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/Lemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/OrderIso.lean b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/OrderIso.lean index 227d3c62d65ec0..1e230a11270cc0 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Unbundled/OrderIso.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Unbundled/OrderIso.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.GroupWithZero.Units.Equiv -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Equiv +public import Mathlib.Order.Hom.Basic /-! # Multiplication by a positive element as an order isomorphism -/ +@[expose] public section + variable {G₀ : Type*} [GroupWithZero G₀] namespace OrderIso diff --git a/Mathlib/Algebra/Order/GroupWithZero/WithZero.lean b/Mathlib/Algebra/Order/GroupWithZero/WithZero.lean index 25818813090898..de153341e51f03 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/WithZero.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/WithZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +module + +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic /-! # Covariant instances on `WithZero` @@ -25,6 +27,8 @@ theory. These instances enable lemmas such as `mul_pos` to fire on `ℤᵐ⁰`. -/ +@[expose] public section + assert_not_exists Ring -- this makes `mul_lt_mul_iff_right₀`, `mul_pos` etc. work on `ℤᵐ⁰` diff --git a/Mathlib/Algebra/Order/Hom/Basic.lean b/Mathlib/Algebra/Order/Hom/Basic.lean index c336262e3039aa..78c34888e606bb 100644 --- a/Mathlib/Algebra/Order/Hom/Basic.lean +++ b/Mathlib/Algebra/Order/Hom/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Ring.Defs /-! # Algebraic order homomorphism classes @@ -45,6 +47,8 @@ multiplicative ring norms but outside of this use we only consider real-valued s Finitary versions of the current lemmas. -/ +@[expose] public section + assert_not_exists Field library_note2 «out-param inheritance» /-- diff --git a/Mathlib/Algebra/Order/Hom/Monoid.lean b/Mathlib/Algebra/Order/Hom/Monoid.lean index 33d3d5ebcdef5a..54ed66b2159ee2 100644 --- a/Mathlib/Algebra/Order/Hom/Monoid.lean +++ b/Mathlib/Algebra/Order/Hom/Monoid.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Hom.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Hom.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Order.Hom.Basic /-! # Ordered monoid and group homomorphisms @@ -55,6 +57,8 @@ making some definitions and lemmas irrelevant. ordered monoid, ordered group -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function diff --git a/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean b/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean index dbb5b092ebf601..82a46fa3173df0 100644 --- a/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean +++ b/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.Hom.Monoid +module + +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.Hom.Monoid /-! # Ordered monoid and group homomorphisms @@ -28,6 +30,8 @@ This file defines morphisms between (additive) ordered monoids with zero. monoid with zero -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/Hom/Ring.lean b/Mathlib/Algebra/Order/Hom/Ring.lean index 1d0cfd304626c5..bc7d1fbaf33b01 100644 --- a/Mathlib/Algebra/Order/Hom/Ring.lean +++ b/Mathlib/Algebra/Order/Hom/Ring.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alex J. Best, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Yaël Dillies -/ -import Mathlib.Algebra.Order.Hom.MonoidWithZero -import Mathlib.Algebra.Ring.Equiv +module + +public import Mathlib.Algebra.Order.Hom.MonoidWithZero +public import Mathlib.Algebra.Ring.Equiv /-! # Ordered ring homomorphisms @@ -33,6 +35,8 @@ making some typeclasses and instances irrelevant. ordered ring homomorphism, order homomorphism -/ +@[expose] public section + assert_not_exists FloorRing Archimedean open Function diff --git a/Mathlib/Algebra/Order/Hom/Submonoid.lean b/Mathlib/Algebra/Order/Hom/Submonoid.lean index 8c514b0b6cca62..1e574a1c484dee 100644 --- a/Mathlib/Algebra/Order/Hom/Submonoid.lean +++ b/Mathlib/Algebra/Order/Hom/Submonoid.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Order.Hom.Monoid +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Order.Hom.Monoid /-! # Isomorphism of submonoids of ordered monoids -/ +@[expose] public section + /-- The top submonoid is order isomorphic to the whole monoid. -/ @[simps!] def Submonoid.topOrderMonoidIso {α : Type*} [Preorder α] [Monoid α] : (⊤ : Submonoid α) ≃*o α where diff --git a/Mathlib/Algebra/Order/Hom/TypeTags.lean b/Mathlib/Algebra/Order/Hom/TypeTags.lean index d7b8cf8832e364..3977d698672ce0 100644 --- a/Mathlib/Algebra/Order/Hom/TypeTags.lean +++ b/Mathlib/Algebra/Order/Hom/TypeTags.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Group.Equiv.TypeTags -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags +module + +public import Mathlib.Algebra.Group.Equiv.TypeTags +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags /-! @@ -13,6 +15,8 @@ import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags -/ +@[expose] public section + section TypeTags /-- Reinterpret `G ≃*o H` as `Additive G ≃+o Additive H`. -/ diff --git a/Mathlib/Algebra/Order/Hom/Units.lean b/Mathlib/Algebra/Order/Hom/Units.lean index a6f797bbf54378..ac474bf6b7bcf8 100644 --- a/Mathlib/Algebra/Order/Hom/Units.lean +++ b/Mathlib/Algebra/Order/Hom/Units.lean @@ -3,14 +3,17 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ +module -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Algebra.Order.Monoid.Units +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Algebra.Order.Monoid.Units /-! # Isomorphism of ordered monoids descends to units -/ +@[expose] public section + /-- An isomorphism of ordered monoids descends to their units. -/ @[simps!] def OrderMonoidIso.unitsCongr {α β : Type*} [Preorder α] [Monoid α] [Preorder β] [Monoid β] diff --git a/Mathlib/Algebra/Order/Interval/Basic.lean b/Mathlib/Algebra/Order/Interval/Basic.lean index c2dc1c2c95abe5..f47bed673c93f8 100644 --- a/Mathlib/Algebra/Order/Interval/Basic.lean +++ b/Mathlib/Algebra/Order/Interval/Basic.lean @@ -3,12 +3,15 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Ring.Prod -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Order.Interval.Basic -import Mathlib.Tactic.Positivity.Core -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Order.Interval.Basic +public import Mathlib.Tactic.Positivity.Core +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop /-! # Interval arithmetic @@ -18,6 +21,8 @@ full precision operations. The essentials of float operations can be found in `Data.FP.Basic`. We have not yet integrated these with the rest of the library. -/ +@[expose] public section + open Function Set @@ -658,7 +663,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: The length of an interval is always nonnegative. -/ @[positivity NonemptyInterval.length _] -def evalNonemptyIntervalLength : PositivityExt where +meta def evalNonemptyIntervalLength : PositivityExt where eval {u α} _ _ e := do let ~q(@NonemptyInterval.length _ $ig $ipo $a) := e | throwError "not NonemptyInterval.length" @@ -668,7 +673,7 @@ def evalNonemptyIntervalLength : PositivityExt where /-- Extension for the `positivity` tactic: The length of an interval is always nonnegative. -/ @[positivity Interval.length _] -def evalIntervalLength : PositivityExt where +meta def evalIntervalLength : PositivityExt where eval {u α} _ _ e := do let ~q(@Interval.length _ $ig $ipo $a) := e | throwError "not Interval.length" let _i ← synthInstanceQ q(IsOrderedAddMonoid $α) diff --git a/Mathlib/Algebra/Order/Interval/Finset/Basic.lean b/Mathlib/Algebra/Order/Interval/Finset/Basic.lean index fad44f969a23aa..d4b7be86f82782 100644 --- a/Mathlib/Algebra/Order/Interval/Finset/Basic.lean +++ b/Mathlib/Algebra/Order/Interval/Finset/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Embedding -import Mathlib.Algebra.Order.Interval.Set.Monoid -import Mathlib.Order.Interval.Finset.Defs +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Algebra.Order.Interval.Set.Monoid +public import Mathlib.Order.Interval.Finset.Defs /-! # Algebraic properties of finset intervals @@ -13,6 +15,8 @@ import Mathlib.Order.Interval.Finset.Defs This file provides results about the interaction of algebra with `Finset.Ixx`. -/ +@[expose] public section + open Function OrderDual variable {ι α : Type*} diff --git a/Mathlib/Algebra/Order/Interval/Finset/SuccPred.lean b/Mathlib/Algebra/Order/Interval/Finset/SuccPred.lean index 834e96628c6a81..4d8cd3c5a71cd2 100644 --- a/Mathlib/Algebra/Order/Interval/Finset/SuccPred.lean +++ b/Mathlib/Algebra/Order/Interval/Finset/SuccPred.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Order.Interval.Finset.SuccPred +module + +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Order.Interval.Finset.SuccPred /-! # Finset intervals in an additive successor-predecessor order @@ -24,6 +26,8 @@ Please keep in sync with: Copy over `insert` lemmas from `Mathlib/Order/Interval/Finset/Nat.lean`. -/ +@[expose] public section + open Function Order OrderDual variable {ι α : Type*} diff --git a/Mathlib/Algebra/Order/Interval/Multiset.lean b/Mathlib/Algebra/Order/Interval/Multiset.lean index cd77bffc72171a..b608263c90e648 100644 --- a/Mathlib/Algebra/Order/Interval/Multiset.lean +++ b/Mathlib/Algebra/Order/Interval/Multiset.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Interval.Finset.Basic -import Mathlib.Order.Interval.Multiset +module + +public import Mathlib.Algebra.Order.Interval.Finset.Basic +public import Mathlib.Order.Interval.Multiset /-! # Algebraic properties of multiset intervals @@ -12,6 +14,8 @@ import Mathlib.Order.Interval.Multiset This file provides results about the interaction of algebra with `Multiset.Ixx`. -/ +@[expose] public section + variable {α : Type*} namespace Multiset diff --git a/Mathlib/Algebra/Order/Interval/Set/Group.lean b/Mathlib/Algebra/Order/Interval/Set/Group.lean index cc8d946d5f0be0..01a376b29cca66 100644 --- a/Mathlib/Algebra/Order/Interval/Set/Group.lean +++ b/Mathlib/Algebra/Order/Interval/Set/Group.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot, Yury Kudryashov, Rémy Degenne -/ -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Order.Group.Basic -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Logic.Pairwise +module + +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Order.Group.Basic +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Logic.Pairwise /-! ### Lemmas about arithmetic operations and intervals. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Interval/Set/Instances.lean b/Mathlib/Algebra/Order/Interval/Set/Instances.lean index c9e0004822bc51..376aa5034adbf0 100644 --- a/Mathlib/Algebra/Order/Interval/Set/Instances.lean +++ b/Mathlib/Algebra/Order/Interval/Set/Instances.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell, Eric Wieser, Yaël Dillies, Patrick Massot, Kim Morrison -/ -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Regular -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Tactic.FastInstance /-! # Algebraic instances for unit intervals @@ -35,6 +37,8 @@ The strongest typeclass provided on each interval is: some arbitrary ordered semiring -/ +@[expose] public section + assert_not_exists RelIso open Set @@ -64,11 +68,11 @@ theorem coe_zero : ↑(0 : Icc (0 : R) 1) = (0 : R) := theorem coe_one : ↑(1 : Icc (0 : R) 1) = (1 : R) := rfl -@[simp] +@[simp, grind =] theorem mk_zero (h : (0 : R) ∈ Icc (0 : R) 1) : (⟨0, h⟩ : Icc (0 : R) 1) = 0 := rfl -@[simp] +@[simp, grind =] theorem mk_one (h : (1 : R) ∈ Icc (0 : R) 1) : (⟨1, h⟩ : Icc (0 : R) 1) = 1 := rfl @@ -169,7 +173,7 @@ instance instZero [Nontrivial R] : Zero (Ico (0 : R) 1) where zero := ⟨0, by s theorem coe_zero [Nontrivial R] : ↑(0 : Ico (0 : R) 1) = (0 : R) := rfl -@[simp] +@[simp, grind =] theorem mk_zero [Nontrivial R] (h : (0 : R) ∈ Ico (0 : R) 1) : (⟨0, h⟩ : Ico (0 : R) 1) = 0 := rfl @@ -225,7 +229,7 @@ instance instOne : One (Ioc (0 : R) 1) where one := ⟨1, ⟨zero_lt_one, le_ref theorem coe_one : ↑(1 : Ioc (0 : R) 1) = (1 : R) := rfl -@[simp] +@[simp, grind =] theorem mk_one (h : (1 : R) ∈ Ioc (0 : R) 1) : (⟨1, h⟩ : Ioc (0 : R) 1) = 1 := rfl diff --git a/Mathlib/Algebra/Order/Interval/Set/Monoid.lean b/Mathlib/Algebra/Order/Interval/Set/Monoid.lean index 791b180cca1f65..1574b526893f3e 100644 --- a/Mathlib/Algebra/Order/Interval/Set/Monoid.lean +++ b/Mathlib/Algebra/Order/Interval/Set/Monoid.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Data.Set.Function -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Data.Set.Function +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE /-! # Images of intervals under `(+ d)` @@ -18,6 +20,8 @@ The lemmas in this file state that addition maps intervals bijectively. The type `OrderedAddCommGroup`, but also to `ℕ` and `ℝ≥0`, which are not groups. -/ +@[expose] public section + namespace Set diff --git a/Mathlib/Algebra/Order/Interval/Set/SuccPred.lean b/Mathlib/Algebra/Order/Interval/Set/SuccPred.lean index afbc5269f0333d..0302496f02f2d9 100644 --- a/Mathlib/Algebra/Order/Interval/Set/SuccPred.lean +++ b/Mathlib/Algebra/Order/Interval/Set/SuccPred.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Order.Interval.Set.SuccPred +module + +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Order.Interval.Set.SuccPred /-! # Set intervals in an additive successor-predecessor order @@ -24,6 +26,8 @@ Please keep in sync with: Copy over `insert` lemmas from `Mathlib/Order/Interval/Finset/Nat.lean`. -/ +@[expose] public section + open Function Order OrderDual variable {ι α : Type*} diff --git a/Mathlib/Algebra/Order/Invertible.lean b/Mathlib/Algebra/Order/Invertible.lean index 4184268d8b2846..00154b1218c6b2 100644 --- a/Mathlib/Algebra/Order/Invertible.lean +++ b/Mathlib/Algebra/Order/Invertible.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Invertible -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Invertible +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # Lemmas about `invOf` in ordered (semi)rings. -/ +@[expose] public section + variable {R : Type*} [Semiring R] [LinearOrder R] [IsStrictOrderedRing R] {a : R} @[simp] diff --git a/Mathlib/Algebra/Order/Kleene.lean b/Mathlib/Algebra/Order/Kleene.lean index 9d6ca3d7074cbf..3393efda8dad5f 100644 --- a/Mathlib/Algebra/Order/Kleene.lean +++ b/Mathlib/Algebra/Order/Kleene.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Siddhartha Prasad, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Siddhartha Prasad, Yaël Dillies -/ -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Ring.Pi -import Mathlib.Algebra.Ring.Prod -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Ring.Pi +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Tactic.Monotonicity.Attr /-! # Kleene Algebras @@ -48,6 +50,8 @@ Instances for `AddOpposite`, `MulOpposite`, `ULift`, `Subsemiring`, `Subring`, ` kleene algebra, idempotent semiring -/ +@[expose] public section + open Function @@ -324,7 +328,6 @@ protected abbrev idemSemiring [IdemSemiring α] [Zero β] [One β] [Add β] [Mul { hf.semiring f zero one add mul nsmul npow natCast, hf.semilatticeSup _ sup, ‹Bot β› with add_eq_sup := fun a b ↦ hf <| by rw [sup, add, add_eq_sup] - bot := ⊥ bot_le := fun a ↦ bot.trans_le <| @bot_le _ _ _ <| f a } -- See note [reducible non-instances] diff --git a/Mathlib/Algebra/Order/Module/Algebra.lean b/Mathlib/Algebra/Order/Module/Algebra.lean index a79e58880db6d4..aa52d750565212 100644 --- a/Mathlib/Algebra/Order/Module/Algebra.lean +++ b/Mathlib/Algebra/Order/Module/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Tactic.Positivity.Core +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Tactic.Positivity.Core /-! # Ordered algebras @@ -17,6 +19,8 @@ This file proves properties of algebras where both rings are ordered compatibly. `positivity` extension for `algebraMap` -/ +@[expose] public section + variable {α β : Type*} [CommSemiring α] [PartialOrder α] section OrderedSemiring @@ -67,7 +71,7 @@ open Lean Meta Qq Function /-- Extension for `algebraMap`. -/ @[positivity algebraMap _ _ _] -def evalAlgebraMap : PositivityExt where eval {u β} _zβ _pβ e := do +meta def evalAlgebraMap : PositivityExt where eval {u β} _zβ _pβ e := do let ~q(@algebraMap $α _ $instα $instβ $instαβ $a) := e | throwError "not `algebraMap`" let pα ← synthInstanceQ q(PartialOrder $α) match ← core q(inferInstance) pα a with diff --git a/Mathlib/Algebra/Order/Module/Archimedean.lean b/Mathlib/Algebra/Order/Module/Archimedean.lean index 04d21db21e3143..263b9da068212f 100644 --- a/Mathlib/Algebra/Order/Module/Archimedean.lean +++ b/Mathlib/Algebra/Order/Module/Archimedean.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ +module -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.Algebra.Order.Archimedean.Class -import Mathlib.Algebra.Order.Module.Basic +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.Algebra.Order.Archimedean.Class +public import Mathlib.Algebra.Order.Module.Basic /-! # Archimedean classes for ordered module @@ -17,6 +18,8 @@ import Mathlib.Algebra.Order.Module.Basic * `ArchimedeanClass.closedBall` are `ArchimedeanClass.closedBallAddSubgroup` as a submodules. -/ +@[expose] public section + namespace ArchimedeanClass variable {M : Type*} [AddCommGroup M] [LinearOrder M] [IsOrderedAddMonoid M] diff --git a/Mathlib/Algebra/Order/Module/Basic.lean b/Mathlib/Algebra/Order/Module/Basic.lean index fdcde24d40db41..6511603e76b7fe 100644 --- a/Mathlib/Algebra/Order/Module/Basic.lean +++ b/Mathlib/Algebra/Order/Module/Basic.lean @@ -3,15 +3,19 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Invertible -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Module.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Invertible +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Module.Defs /-! # Further lemmas about monotonicity of scalar multiplication -/ +@[expose] public section + variable {𝕜 R M : Type*} section Semiring diff --git a/Mathlib/Algebra/Order/Module/Defs.lean b/Mathlib/Algebra/Order/Module/Defs.lean index fd58e53df548e6..72e2d38aa9b76a 100644 --- a/Mathlib/Algebra/Order/Module/Defs.lean +++ b/Mathlib/Algebra/Order/Module/Defs.lean @@ -3,13 +3,15 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.NoZeroSMulDivisors.Basic -import Mathlib.Algebra.Notation.Prod -import Mathlib.Algebra.Order.Group.Basic -import Mathlib.Algebra.Order.GroupWithZero.Action.Synonym -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.NoZeroSMulDivisors.Basic +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Algebra.Order.Group.Basic +public import Mathlib.Algebra.Order.GroupWithZero.Action.Synonym +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Order.Hom.Basic /-! # Monotonicity of scalar multiplication by positive elements @@ -121,6 +123,8 @@ In the future, it would be good to make the corresponding typeclasses in `Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean` custom typeclasses too. -/ +@[expose] public section + assert_not_exists Field Finset open OrderDual diff --git a/Mathlib/Algebra/Order/Module/Equiv.lean b/Mathlib/Algebra/Order/Module/Equiv.lean index f1b6dcc307bf5d..93ab53b16de6eb 100644 --- a/Mathlib/Algebra/Order/Module/Equiv.lean +++ b/Mathlib/Algebra/Order/Module/Equiv.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Order.Group.Equiv -import Mathlib.Algebra.Order.Module.Synonym +module + +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Order.Group.Equiv +public import Mathlib.Algebra.Order.Module.Synonym /-! # Linear equivalence for order type synonyms -/ +@[expose] public section + variable (α β : Type*) variable [Semiring α] [AddCommMonoid β] [Module α β] diff --git a/Mathlib/Algebra/Order/Module/Field.lean b/Mathlib/Algebra/Order/Module/Field.lean index 2365293d56bba9..baff7037ffb590 100644 --- a/Mathlib/Algebra/Order/Module/Field.lean +++ b/Mathlib/Algebra/Order/Module/Field.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Field.Defs -import Mathlib.Tactic.Positivity.Core +module + +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Tactic.Positivity.Core /-! # Ordered vector spaces -/ +@[expose] public section + open OrderDual variable {𝕜 G : Type*} @@ -97,7 +101,7 @@ end NoZeroSMulDivisors /-- Positivity extension for scalar multiplication. -/ @[positivity HSMul.hSMul _ _] -def evalSMul : PositivityExt where eval {_u α} zα pα (e : Q($α)) := do +meta def evalSMul : PositivityExt where eval {_u α} zα pα (e : Q($α)) := do let .app (.app (.app (.app (.app (.app (.const ``HSMul.hSMul [u1, _, _]) (β : Q(Type u1))) _) _) _) (a : Q($β))) (b : Q($α)) ← whnfR e | throwError "failed to match hSMul" diff --git a/Mathlib/Algebra/Order/Module/HahnEmbedding.lean b/Mathlib/Algebra/Order/Module/HahnEmbedding.lean index 46899a2c1982b1..1b3beec700235c 100644 --- a/Mathlib/Algebra/Order/Module/HahnEmbedding.lean +++ b/Mathlib/Algebra/Order/Module/HahnEmbedding.lean @@ -3,14 +3,16 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Algebra.Module.Submodule.Order -import Mathlib.Algebra.Order.Module.Archimedean -import Mathlib.Algebra.Order.Module.Equiv -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.LinearPMap -import Mathlib.RingTheory.HahnSeries.Lex +module + +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Algebra.Module.Submodule.Order +public import Mathlib.Algebra.Order.Module.Archimedean +public import Mathlib.Algebra.Order.Module.Equiv +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.LinearPMap +public import Mathlib.RingTheory.HahnSeries.Lex /-! # Hahn embedding theorem on ordered modules @@ -42,6 +44,8 @@ to a proof of the classic Hahn embedding theorem. (See `hahnEmbedding_isOrderedA * [M. Hausner, J.G. Wendel, *Ordered vector spaces*][hausnerwendel1952] -/ +@[expose] public section + /-! ### Step 1: base embedding We start with `HahnEmbedding.ArchimedeanStrata` that gives a family of Archimedean submodules, diff --git a/Mathlib/Algebra/Order/Module/OrderedSMul.lean b/Mathlib/Algebra/Order/Module/OrderedSMul.lean index a4484f9e8363b0..6e4d9adc632a84 100644 --- a/Mathlib/Algebra/Order/Module/OrderedSMul.lean +++ b/Mathlib/Algebra/Order/Module/OrderedSMul.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.GroupWithZero.Action.Pi -import Mathlib.Algebra.GroupWithZero.Action.Prod -import Mathlib.Algebra.Order.Module.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Pi +public import Mathlib.Algebra.GroupWithZero.Action.Prod +public import Mathlib.Algebra.Order.Module.Defs /-! # Ordered scalar product @@ -39,6 +41,8 @@ This file is now mostly useless. We should try deleting `OrderedSMul` ordered module, ordered scalar, ordered smul, ordered action, ordered vector space -/ +@[expose] public section + deprecated_module (since := "2025-08-25") /-- The ordered scalar product property is when an ordered additive commutative monoid diff --git a/Mathlib/Algebra/Order/Module/Pointwise.lean b/Mathlib/Algebra/Order/Module/Pointwise.lean index fe8b76379547f2..448784c674ca4e 100644 --- a/Mathlib/Algebra/Order/Module/Pointwise.lean +++ b/Mathlib/Algebra/Order/Module/Pointwise.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Order.Module.Field -import Mathlib.Order.Bounds.OrderIso -import Mathlib.Order.GaloisConnection.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Order.Module.Field +public import Mathlib.Order.Bounds.OrderIso +public import Mathlib.Order.GaloisConnection.Basic /-! # Bounds on scalar multiplication of set @@ -14,6 +16,8 @@ import Mathlib.Order.GaloisConnection.Basic This file proves order properties of pointwise operations of sets. -/ +@[expose] public section + open scoped Pointwise variable {α β : Type*} diff --git a/Mathlib/Algebra/Order/Module/PositiveLinearMap.lean b/Mathlib/Algebra/Order/Module/PositiveLinearMap.lean index 7d6235f98ecabd..dca3b2e88055d0 100644 --- a/Mathlib/Algebra/Order/Module/PositiveLinearMap.lean +++ b/Mathlib/Algebra/Order/Module/PositiveLinearMap.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Tactic.ContinuousFunctionalCalculus /-! # Positive linear maps @@ -24,6 +25,8 @@ More substantial results on positive maps such as their continuity can be found the `Analysis/CStarAlgebra` folder. -/ +@[expose] public section + /-- A positive linear map is a linear map that is also an order homomorphism. -/ structure PositiveLinearMap (R E₁ E₂ : Type*) [Semiring R] [AddCommMonoid E₁] [PartialOrder E₁] [AddCommMonoid E₂] [PartialOrder E₂] diff --git a/Mathlib/Algebra/Order/Module/Rat.lean b/Mathlib/Algebra/Order/Module/Rat.lean index cbbef8a62f832f..e5f09cd370dbb7 100644 --- a/Mathlib/Algebra/Order/Module/Rat.lean +++ b/Mathlib/Algebra/Order/Module/Rat.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Module.Rat -import Mathlib.Algebra.Order.Module.Basic -import Mathlib.Data.Rat.Cast.Order +module + +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Algebra.Order.Module.Basic +public import Mathlib.Data.Rat.Cast.Order /-! # Monotonicity of the action by rational numbers -/ +@[expose] public section + variable {α : Type*} instance PosSMulMono.nnrat_of_rat [Preorder α] [MulAction ℚ α] [MulAction ℚ≥0 α] diff --git a/Mathlib/Algebra/Order/Module/Synonym.lean b/Mathlib/Algebra/Order/Module/Synonym.lean index 858df1e0658ea4..18f783d74ef5ce 100644 --- a/Mathlib/Algebra/Order/Module/Synonym.lean +++ b/Mathlib/Algebra/Order/Module/Synonym.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Order.GroupWithZero.Action.Synonym -import Mathlib.Algebra.Order.Ring.Synonym +module + +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Action.Synonym +public import Mathlib.Algebra.Order.Ring.Synonym /-! # Action instances for `OrderDual` @@ -20,6 +22,8 @@ the `SMul` instances are already defined in `Mathlib/Algebra/Order/Group/Synonym * `Mathlib/Algebra/Order/GroupWithZero/Action/Synonym.lean` -/ +@[expose] public section + variable {α β : Type*} namespace OrderDual diff --git a/Mathlib/Algebra/Order/Monoid/Associated.lean b/Mathlib/Algebra/Order/Monoid/Associated.lean index 8f58a6a8034dba..53bd1a08d1573f 100644 --- a/Mathlib/Algebra/Order/Monoid/Associated.lean +++ b/Mathlib/Algebra/Order/Monoid/Associated.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau -/ -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.Order.Monoid.Canonical.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs /-! # Order on associates @@ -12,6 +14,8 @@ import Mathlib.Algebra.Order.Monoid.Canonical.Defs This file shows that divisibility makes associates into a canonically ordered monoid. -/ +@[expose] public section + variable {M : Type*} [CancelCommMonoidWithZero M] namespace Associates diff --git a/Mathlib/Algebra/Order/Monoid/Basic.lean b/Mathlib/Algebra/Order/Monoid/Basic.lean index 5adbce8cf6564e..21f3b74e8098fc 100644 --- a/Mathlib/Algebra/Order/Monoid/Basic.lean +++ b/Mathlib/Algebra/Order/Monoid/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Order.Hom.Basic /-! # Ordered monoids @@ -12,6 +14,8 @@ import Mathlib.Order.Hom.Basic This file develops some additional material on ordered monoids. -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/Monoid/Canonical/Basic.lean b/Mathlib/Algebra/Order/Monoid/Canonical/Basic.lean index 0a618ac84cc8c3..ca6df20a2eb00c 100644 --- a/Mathlib/Algebra/Order/Monoid/Canonical/Basic.lean +++ b/Mathlib/Algebra/Order/Monoid/Canonical/Basic.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Data.Finset.Lattice.Fold /-! # Extra lemmas about canonically ordered monoids -/ +@[expose] public section + namespace Finset variable {ι α : Type*} [AddCommMonoid α] [LinearOrder α] [OrderBot α] [CanonicallyOrderedAdd α] {s : Finset ι} {f : ι → α} diff --git a/Mathlib/Algebra/Order/Monoid/Canonical/Defs.lean b/Mathlib/Algebra/Order/Monoid/Canonical/Defs.lean index 767e3ace53c852..02ba5ce5a6b706 100644 --- a/Mathlib/Algebra/Order/Monoid/Canonical/Defs.lean +++ b/Mathlib/Algebra/Order/Monoid/Canonical/Defs.lean @@ -3,16 +3,20 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl, Yuyang Zhao -/ -import Mathlib.Algebra.Group.Units.Basic -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.NeZero -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.NeZero +public import Mathlib.Order.BoundedOrder.Basic /-! # Canonically ordered monoids -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Algebra/Order/Monoid/Defs.lean b/Mathlib/Algebra/Order/Monoid/Defs.lean index 05521932474a2f..65fd1085261bdb 100644 --- a/Mathlib/Algebra/Order/Monoid/Defs.lean +++ b/Mathlib/Algebra/Order/Monoid/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl, Yuyang Zhao -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic /-! # Ordered monoids @@ -12,6 +14,8 @@ This file provides the definitions of ordered monoids. -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/Monoid/Lex.lean b/Mathlib/Algebra/Order/Monoid/Lex.lean index 4a151173a6ad33..598d87cf069618 100644 --- a/Mathlib/Algebra/Order/Monoid/Lex.lean +++ b/Mathlib/Algebra/Order/Monoid/Lex.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Data.Prod.Lex -import Mathlib.Order.Prod.Lex.Hom +module + +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Data.Prod.Lex +public import Mathlib.Order.Prod.Lex.Hom /-! # Order homomorphisms for products of ordered monoids @@ -23,6 +25,8 @@ Create the "OrdCommMon" category. -/ +@[expose] public section + namespace MonoidHom variable {α β : Type*} [Monoid α] [Preorder α] [Monoid β] [Preorder β] diff --git a/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean b/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean index d6c765e714e84b..44942b4a803d64 100644 --- a/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean +++ b/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean @@ -3,15 +3,17 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Algebra.Order.Group.Units -import Mathlib.Algebra.Order.Hom.MonoidWithZero -import Mathlib.Algebra.Order.Hom.TypeTags -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Data.Nat.Cast.Order.Ring -import Mathlib.Tactic.Abel -import Mathlib.Algebra.Group.Embedding -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Algebra.Order.Group.Units +public import Mathlib.Algebra.Order.Hom.MonoidWithZero +public import Mathlib.Algebra.Order.Hom.TypeTags +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Data.Nat.Cast.Order.Ring +public import Mathlib.Tactic.Abel +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Order.Interval.Finset.Basic /-! @@ -30,6 +32,8 @@ import Mathlib.Order.Interval.Finset.Basic -/ +@[expose] public section + open Finset section Multiplicative diff --git a/Mathlib/Algebra/Order/Monoid/NatCast.lean b/Mathlib/Algebra/Order/Monoid/NatCast.lean index f64f5811a374db..3ce274153409d9 100644 --- a/Mathlib/Algebra/Order/Monoid/NatCast.lean +++ b/Mathlib/Algebra/Order/Monoid/NatCast.lean @@ -3,14 +3,18 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl, Yuyang Zhao -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Data.Nat.Cast.Defs +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Data.Nat.Cast.Defs /-! # Order of numerals in an `AddMonoidWithOne`. -/ +@[expose] public section + variable {α : Type*} open Function diff --git a/Mathlib/Algebra/Order/Monoid/OrderDual.lean b/Mathlib/Algebra/Order/Monoid/OrderDual.lean index a50f4351f5f580..700ee15fce9c67 100644 --- a/Mathlib/Algebra/Order/Monoid/OrderDual.lean +++ b/Mathlib/Algebra/Order/Monoid/OrderDual.lean @@ -3,12 +3,16 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Algebra.Order.Monoid.Defs +module + +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Algebra.Order.Monoid.Defs /-! # Ordered monoid structures on the order dual. -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Algebra/Order/Monoid/PNat.lean b/Mathlib/Algebra/Order/Monoid/PNat.lean index 6c873f976544dd..277b428ade600d 100644 --- a/Mathlib/Algebra/Order/Monoid/PNat.lean +++ b/Mathlib/Algebra/Order/Monoid/PNat.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Data.PNat.Basic +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Data.PNat.Basic /-! # Equivalence between `ℕ+` and `nonZeroDivisors ℕ` -/ +@[expose] public section + /-- `ℕ+` is equivalent to `nonZeroDivisors ℕ` in terms of order and multiplication. -/ @[simps] def PNat.equivNonZeroDivisorsNat : ℕ+ ≃*o nonZeroDivisors ℕ where diff --git a/Mathlib/Algebra/Order/Monoid/Prod.lean b/Mathlib/Algebra/Order/Monoid/Prod.lean index 0c06852e4e7669..99bf4862a62f0e 100644 --- a/Mathlib/Algebra/Order/Monoid/Prod.lean +++ b/Mathlib/Algebra/Order/Monoid/Prod.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Data.Prod.Lex +module + +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Data.Prod.Lex /-! # Products of ordered monoids -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace Prod diff --git a/Mathlib/Algebra/Order/Monoid/Submonoid.lean b/Mathlib/Algebra/Order/Monoid/Submonoid.lean index 62c31e83239e0a..7121817da20d37 100644 --- a/Mathlib/Algebra/Order/Monoid/Submonoid.lean +++ b/Mathlib/Algebra/Order/Monoid/Submonoid.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Order.Monoid.Basic -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Order.Monoid.Basic +public import Mathlib.Order.Interval.Set.Defs /-! # Ordered instances on submonoids -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace SubmonoidClass diff --git a/Mathlib/Algebra/Order/Monoid/ToMulBot.lean b/Mathlib/Algebra/Order/Monoid/ToMulBot.lean index 16daacd9a4f06d..ae7f525de72e2c 100644 --- a/Mathlib/Algebra/Order/Monoid/ToMulBot.lean +++ b/Mathlib/Algebra/Order/Monoid/ToMulBot.lean @@ -3,15 +3,19 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +module + +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop /-! Making an additive monoid multiplicative then adding a zero is the same as adding a bottom element then making it multiplicative. -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Order/Monoid/TypeTags.lean b/Mathlib/Algebra/Order/Monoid/TypeTags.lean index 7ab1b5c60115a2..475ff9f9e8ba86 100644 --- a/Mathlib/Algebra/Order/Monoid/TypeTags.lean +++ b/Mathlib/Algebra/Order/Monoid/TypeTags.lean @@ -3,11 +3,15 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags -import Mathlib.Algebra.Order.Monoid.Canonical.Defs +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs /-! # Bundled ordered monoid structures on `Multiplicative α` and `Additive α`. -/ +@[expose] public section + variable {α : Type*} instance Multiplicative.isOrderedMonoid [AddCommMonoid α] [PartialOrder α] [IsOrderedAddMonoid α] : diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean index fc874e9ae6c73a..5baf984e89b8c2 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean @@ -4,11 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl, Damiano Testa, Yuyang Zhao -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Defs -import Mathlib.Data.Ordering.Basic -import Mathlib.Order.MinMax -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Use +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Defs +public import Mathlib.Data.Ordering.Basic +public import Mathlib.Order.MinMax +public import Mathlib.Tactic.Contrapose +public import Mathlib.Tactic.Use /-! # Ordered monoids @@ -28,6 +30,8 @@ Almost no monoid is actually present in this file: most assumptions have been ge -/ +@[expose] public section + -- TODO: If possible, uniformize lemma names, taking special care of `'`, -- after the `ordered`-refactor is done. diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean index 7e0bfe9a02b48c..ca534c574b3b37 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Order.Basic -import Mathlib.Order.Monotone.Defs +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Order.Basic +public import Mathlib.Order.Monotone.Defs /-! @@ -45,7 +47,7 @@ the most common usage. In the opposite direction, the implication ``` holds -- note the `Co*ntra*` assumption on the `(≤)`-relation. -# Formalization notes +## Formalization notes We stick to the convention of using `Function.swap (*)` (or `Function.swap (+)`), for the typeclass assumptions, since `Function.swap` is slightly better behaved than `flip`. @@ -54,6 +56,8 @@ as it is easier to use. -/ +@[expose] public section + -- TODO: convert `ExistsMulOfLE`, `ExistsAddOfLE`? -- TODO: relationship with `Con/AddCon` diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/ExistsOfLE.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/ExistsOfLE.lean index c2e25592e58cd5..39fac99f1d5214 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/ExistsOfLE.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/ExistsOfLE.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson, Yaël Dillies -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Order.MinMax +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Order.MinMax /-! # Unbundled and weaker forms of canonically ordered monoids @@ -15,6 +17,8 @@ generalising statements from groups/rings/fields that don't mention negation or monoids/semirings/semifields. -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean index 722c1a635efd28..e51c9a0d706a09 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean @@ -3,12 +3,16 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic /-! # Lemmas about `min` and `max` in an ordered monoid. -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/OrderDual.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/OrderDual.lean index c93cbe11c49023..dfa6f82d8a7e34 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/OrderDual.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/OrderDual.lean @@ -3,11 +3,15 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Order.Monoid.Unbundled.Defs +module + +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Order.Monoid.Unbundled.Defs /-! # Unbundled ordered monoid structures on the order dual. -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean index 8ea0150dde8608..dff3efa184d79f 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean @@ -3,15 +3,19 @@ Copyright (c) 2015 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Robert Y. Lewis, Yury Kudryashov -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Tactic.Lift -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Tactic.Lift +public import Mathlib.Tactic.Monotonicity.Attr /-! # Lemmas about the interaction of power operations with order in terms of `CovariantClass` -/ +@[expose] public section + open Function variable {β G M : Type*} diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/TypeTags.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/TypeTags.lean index 483877e4fee6ec..f5011888659ecd 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/TypeTags.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/TypeTags.lean @@ -3,12 +3,16 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Group.TypeTags.Basic -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Group.TypeTags.Basic +public import Mathlib.Order.BoundedOrder.Basic /-! # Ordered monoid structures on `Multiplicative α` and `Additive α`. -/ +@[expose] public section + variable {α : Type*} instance : ∀ [LE α], LE (Multiplicative α) := @@ -67,7 +71,7 @@ instance Additive.existsAddOfLe [Mul α] [LE α] [ExistsMulOfLE α] : ExistsAddO ⟨@exists_mul_of_le α _ _ _⟩ namespace Additive - +section Preorder variable [Preorder α] @[simp] @@ -89,12 +93,37 @@ theorem toMul_lt {a b : Additive α} : a.toMul < b.toMul ↔ a < b := @[gcongr] alias ⟨_, toMul_mono⟩ := toMul_le @[gcongr] alias ⟨_, ofMul_mono⟩ := ofMul_le @[gcongr] alias ⟨_, toMul_strictMono⟩ := toMul_lt -@[gcongr] alias ⟨_, foMul_strictMono⟩ := ofMul_lt +@[gcongr] alias ⟨_, ofMul_strictMono⟩ := ofMul_lt + +@[deprecated (since := "2025-11-18")] alias foMul_strictMono := ofMul_strictMono + +end Preorder + +section OrderTop +variable [LE α] [OrderTop α] + +@[simp] lemma ofMul_top : ofMul (⊤ : α) = ⊤ := rfl +@[simp] lemma toMul_top : toMul ⊤ = (⊤ : α) := rfl + +@[simp] lemma ofMul_eq_top {a : α} : ofMul a = ⊤ ↔ a = ⊤ := .rfl +@[simp] lemma toMul_eq_top {a : Additive α} : toMul a = ⊤ ↔ a = ⊤ := .rfl + +end OrderTop + +section OrderBot +variable [LE α] [OrderBot α] + +@[simp] lemma ofMul_bot : ofMul (⊥ : α) = ⊥ := rfl +@[simp] lemma toMul_bot : toMul ⊥ = (⊥ : α) := rfl +@[simp] lemma ofMul_eq_bot {a : α} : ofMul a = ⊥ ↔ a = ⊥ := .rfl +@[simp] lemma toMul_eq_bot {a : Additive α} : toMul a = ⊥ ↔ a = ⊥ := .rfl + +end OrderBot end Additive namespace Multiplicative - +section Preorder variable [Preorder α] @[simp] @@ -118,4 +147,28 @@ theorem toAdd_lt {a b : Multiplicative α} : a.toAdd < b.toAdd ↔ a < b := @[gcongr] alias ⟨_, toAdd_strictMono⟩ := toAdd_lt @[gcongr] alias ⟨_, ofAdd_strictMono⟩ := ofAdd_lt +end Preorder + +section OrderTop +variable [LE α] [OrderTop α] + +@[simp] lemma ofAdd_top : ofAdd (⊤ : α) = ⊤ := rfl +@[simp] lemma toAdd_top : toAdd ⊤ = (⊤ : α) := rfl + +@[simp] lemma ofAdd_eq_top {a : α} : ofAdd a = ⊤ ↔ a = ⊤ := .rfl +@[simp] lemma toAdd_eq_top {a : Multiplicative α} : toAdd a = ⊤ ↔ a = ⊤ := .rfl + +end OrderTop + +section OrderBot +variable [LE α] [OrderBot α] + +@[simp] lemma ofAdd_bot : ofAdd (⊥ : α) = ⊥ := rfl +@[simp] lemma toAdd_bot : toAdd ⊥ = (⊥ : α) := rfl + +@[simp] lemma ofAdd_eq_bot {a : α} : ofAdd a = ⊥ ↔ a = ⊥ := .rfl +@[simp] lemma toAdd_eq_bot {a : Multiplicative α} : toAdd a = ⊥ ↔ a = ⊥ := .rfl + +end OrderBot + end Multiplicative diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Units.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Units.lean index e4100892a24028..d8fa81e10949fa 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Units.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Units.lean @@ -3,14 +3,17 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ +module -import Mathlib.Algebra.Group.Units.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic /-! # Lemmas for units in an ordered monoid -/ +@[expose] public section + variable {M : Type*} [Monoid M] [LE M] namespace Units diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean index ea5fc1ef37fc70..178148af285d77 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean @@ -3,15 +3,19 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Order.WithBot +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Order.WithBot /-! # Adjoining top/bottom elements to ordered monoids. -/ +@[expose] public section + universe u v variable {α : Type u} {β : Type v} diff --git a/Mathlib/Algebra/Order/Monoid/Units.lean b/Mathlib/Algebra/Order/Monoid/Units.lean index 7addf50d6ab41a..a2c4b062dccaea 100644 --- a/Mathlib/Algebra/Order/Monoid/Units.lean +++ b/Mathlib/Algebra/Order/Monoid/Units.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Order.Hom.Basic -import Mathlib.Algebra.Group.Units.Defs +module + +public import Mathlib.Order.Hom.Basic +public import Mathlib.Algebra.Group.Units.Defs /-! # Units in ordered monoids -/ +@[expose] public section + namespace Units variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Monoid/WithTop.lean b/Mathlib/Algebra/Order/Monoid/WithTop.lean index 4d4b67e61070b8..c15812a0ffbe9f 100644 --- a/Mathlib/Algebra/Order/Monoid/WithTop.lean +++ b/Mathlib/Algebra/Order/Monoid/WithTop.lean @@ -3,12 +3,16 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Algebra.Order.Monoid.Canonical.Defs +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs /-! # Adjoining top/bottom elements to ordered monoids. -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Algebra/Order/Monovary.lean b/Mathlib/Algebra/Order/Monovary.lean index a273273f05e2bf..82f920176ee2cc 100644 --- a/Mathlib/Algebra/Order/Monovary.lean +++ b/Mathlib/Algebra/Order/Monovary.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Module.Synonym -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Order.Monotone.Monovary +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Module.Synonym +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Order.Monotone.Monovary /-! # Monovarying functions and algebraic operations @@ -20,6 +22,8 @@ of functions. `Mathlib.Algebra.Order.Rearrangement` for the n-ary rearrangement inequality -/ +@[expose] public section + variable {ι α β : Type*} /-! ### Algebraic operations on monovarying functions -/ diff --git a/Mathlib/Algebra/Order/Nonneg/Basic.lean b/Mathlib/Algebra/Order/Nonneg/Basic.lean index 7ab105ce99ba03..95bd34847e7ad7 100644 --- a/Mathlib/Algebra/Order/Nonneg/Basic.lean +++ b/Mathlib/Algebra/Order/Nonneg/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Data.Nat.Cast.Order.Basic +module + +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Data.Nat.Cast.Order.Basic /-! # The type of nonnegative elements @@ -30,6 +32,8 @@ equal, this often confuses the elaborator. Similar problems arise when doing cas The disadvantage is that we have to duplicate some instances about `Set.Ici` to this subtype. -/ + +@[expose] public section assert_not_exists GeneralizedHeytingAlgebra assert_not_exists IsOrderedMonoid -- TODO -- assert_not_exists PosMulMono @@ -161,6 +165,14 @@ instance addCommMonoid : AddCommMonoid { x : α // 0 ≤ x } := end AddCommMonoid +section AddCancelCommMonoid +variable [AddCancelCommMonoid α] [Preorder α] [AddLeftMono α] + +instance addCancelCommMonoid : AddCancelCommMonoid {x : α // 0 ≤ x} := + Subtype.coe_injective.addCancelCommMonoid _ Nonneg.coe_zero (fun _ _ => rfl) (fun _ _ => rfl) + +end AddCancelCommMonoid + section AddMonoidWithOne variable [AddMonoidWithOne α] [PartialOrder α] [AddLeftMono α] [ZeroLEOneClass α] diff --git a/Mathlib/Algebra/Order/Nonneg/Field.lean b/Mathlib/Algebra/Order/Nonneg/Field.lean index 49e7509fad94f1..17fc1bf5f8c1ff 100644 --- a/Mathlib/Algebra/Order/Nonneg/Field.lean +++ b/Mathlib/Algebra/Order/Nonneg/Field.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Order.Field.Canonical -import Mathlib.Algebra.Order.Nonneg.Ring -import Mathlib.Algebra.Order.Positive.Ring -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Order.Field.Canonical +public import Mathlib.Algebra.Order.Nonneg.Ring +public import Mathlib.Algebra.Order.Positive.Ring +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # Semifield structure on the type of nonnegative elements @@ -22,6 +24,8 @@ This is used to derive algebraic structures on `ℝ≥0` and `ℚ≥0` automatic * `{x : α // 0 ≤ x}` is a `CanonicallyLinearOrderedSemifield` if `α` is a `LinearOrderedField`. -/ +@[expose] public section + assert_not_exists abs_inv open Set diff --git a/Mathlib/Algebra/Order/Nonneg/Floor.lean b/Mathlib/Algebra/Order/Nonneg/Floor.lean index e415401d16b838..862dc1ba10b1b7 100644 --- a/Mathlib/Algebra/Order/Nonneg/Floor.lean +++ b/Mathlib/Algebra/Order/Nonneg/Floor.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.Floor.Defs -import Mathlib.Algebra.Order.Nonneg.Basic +module + +public import Mathlib.Algebra.Order.Floor.Defs +public import Mathlib.Algebra.Order.Nonneg.Basic /-! # Nonnegative elements are archimedean @@ -19,6 +21,8 @@ This is used to derive algebraic structures on `ℝ≥0` and `ℚ≥0` automatic * `{x : α // 0 ≤ x}` is a `FloorSemiring` if `α` is. -/ +@[expose] public section + assert_not_exists Finset Field namespace Nonneg diff --git a/Mathlib/Algebra/Order/Nonneg/Lattice.lean b/Mathlib/Algebra/Order/Nonneg/Lattice.lean index c52502466e1cd1..e26effe9a39e72 100644 --- a/Mathlib/Algebra/Order/Nonneg/Lattice.lean +++ b/Mathlib/Algebra/Order/Nonneg/Lattice.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Order.CompleteLatticeIntervals -import Mathlib.Order.LatticeIntervals +module + +public import Mathlib.Order.CompleteLatticeIntervals +public import Mathlib.Order.LatticeIntervals /-! # Lattice structures on the type of nonnegative elements -/ + +@[expose] public section assert_not_exists Ring assert_not_exists IsOrderedMonoid diff --git a/Mathlib/Algebra/Order/Nonneg/Module.lean b/Mathlib/Algebra/Order/Nonneg/Module.lean index e1332340195171..78ceb6bf3a962d 100644 --- a/Mathlib/Algebra/Order/Nonneg/Module.lean +++ b/Mathlib/Algebra/Order/Nonneg/Module.lean @@ -3,19 +3,23 @@ Copyright (c) 2023 Apurva Nakade. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Apurva Nakade -/ -import Mathlib.Algebra.Module.RingHom -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Nonneg.Basic +module + +public import Mathlib.Algebra.Module.RingHom +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Nonneg.Basic /-! # Modules over nonnegative elements For an ordered ring `R`, this file proves that any (ordered) `R`-module `M` is also an (ordered) -`R≥0`-module`. +`R≥0`-module. Among other things, these instances are useful for working with `ConvexCone`. -/ +@[expose] public section + assert_not_exists Finset variable {R S M : Type*} diff --git a/Mathlib/Algebra/Order/Nonneg/Ring.lean b/Mathlib/Algebra/Order/Nonneg/Ring.lean index df46a4d3f7bf0d..6289f4aaded9ef 100644 --- a/Mathlib/Algebra/Order/Nonneg/Ring.lean +++ b/Mathlib/Algebra/Order/Nonneg/Ring.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.Nonneg.Basic -import Mathlib.Algebra.Order.Nonneg.Lattice -import Mathlib.Algebra.Order.Ring.InjSurj -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.Nonneg.Basic +public import Mathlib.Algebra.Order.Nonneg.Lattice +public import Mathlib.Algebra.Order.Ring.InjSurj +public import Mathlib.Tactic.FastInstance /-! # Bundled ordered algebra instance on the type of nonnegative elements @@ -34,6 +36,8 @@ equal, this often confuses the elaborator. Similar problems arise when doing cas The disadvantage is that we have to duplicate some instances about `Set.Ici` to this subtype. -/ +@[expose] public section + open Set variable {α : Type*} diff --git a/Mathlib/Algebra/Order/PUnit.lean b/Mathlib/Algebra/Order/PUnit.lean index 7c6ba68a92893b..be85d52f1048a4 100644 --- a/Mathlib/Algebra/Order/PUnit.lean +++ b/Mathlib/Algebra/Order/PUnit.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.PUnit -import Mathlib.Algebra.Order.AddGroupWithTop +module + +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.Algebra.Order.AddGroupWithTop /-! # Instances on PUnit This file collects facts about ordered algebraic structures on the one-element type. -/ +@[expose] public section + namespace PUnit instance canonicallyOrderedAdd : CanonicallyOrderedAdd PUnit where diff --git a/Mathlib/Algebra/Order/PartialSups.lean b/Mathlib/Algebra/Order/PartialSups.lean index 572926d7e8ef03..673dfb808925c7 100644 --- a/Mathlib/Algebra/Order/PartialSups.lean +++ b/Mathlib/Algebra/Order/PartialSups.lean @@ -3,6 +3,8 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Order.SuccPred.PartialSups +module + +public import Mathlib.Algebra.Order.SuccPred.PartialSups deprecated_module (since := "2025-08-18") diff --git a/Mathlib/Algebra/Order/Pi.lean b/Mathlib/Algebra/Order/Pi.lean index a00237b4b45751..2defbb46c661c0 100644 --- a/Mathlib/Algebra/Order/Pi.lean +++ b/Mathlib/Algebra/Order/Pi.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.Notation.Lemmas -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Pi +module + +public import Mathlib.Algebra.Notation.Lemmas +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Pi /-! # Pi instances for ordered groups and monoids @@ -14,6 +16,8 @@ import Mathlib.Algebra.Ring.Pi This file defines instances for ordered group, monoid, and related structures on Pi types. -/ +@[expose] public section + variable {I α β γ : Type*} -- The indexing type diff --git a/Mathlib/Algebra/Order/Positive/Field.lean b/Mathlib/Algebra/Order/Positive/Field.lean index 4cab5483cf3bd6..911c748941afc9 100644 --- a/Mathlib/Algebra/Order/Positive/Field.lean +++ b/Mathlib/Algebra/Order/Positive/Field.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.Positive.Ring +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Order.Positive.Ring /-! # Algebraic structures on the set of positive numbers @@ -13,6 +15,8 @@ In this file we prove that the set of positive elements of a linear ordered fiel ordered commutative group. -/ +@[expose] public section + variable {K : Type*} [Field K] [LinearOrder K] [IsStrictOrderedRing K] diff --git a/Mathlib/Algebra/Order/Positive/Ring.lean b/Mathlib/Algebra/Order/Positive/Ring.lean index 42e6a661200b1d..87e3c6c822e59d 100644 --- a/Mathlib/Algebra/Order/Positive/Ring.lean +++ b/Mathlib/Algebra/Order/Positive/Ring.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Tactic.FastInstance /-! # Algebraic structures on the set of positive numbers @@ -15,6 +17,8 @@ type `{x : R // 0 < x}`. In each case we try to require the weakest possible typ assumptions on `R` but possibly, there is a room for improvements. -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/Quantale.lean b/Mathlib/Algebra/Order/Quantale.lean index 0a573faf5f891c..71cb4d071d7404 100644 --- a/Mathlib/Algebra/Order/Quantale.lean +++ b/Mathlib/Algebra/Order/Quantale.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Pieter Cuijpers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pieter Cuijpers -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Order.CompleteLattice.Basic -import Mathlib.Tactic.Variable +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Order.CompleteLattice.Basic +public import Mathlib.Tactic.Variable /-! # Theory of quantales @@ -57,6 +58,8 @@ integral, and involutive quantales easier to add on later. -/ +@[expose] public section + open Function /-- An additive quantale is an additive semigroup distributing over a complete lattice. -/ diff --git a/Mathlib/Algebra/Order/Rearrangement.lean b/Mathlib/Algebra/Order/Rearrangement.lean index d99a183934a537..c7f9f3def3ac1d 100644 --- a/Mathlib/Algebra/Order/Rearrangement.lean +++ b/Mathlib/Algebra/Order/Rearrangement.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Mantas Bakšys. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mantas Bakšys -/ -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Module.Synonym -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Data.Finset.Max -import Mathlib.Data.Prod.Lex -import Mathlib.GroupTheory.Perm.Support -import Mathlib.Order.Monotone.Monovary +module + +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Module.Synonym +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Prod.Lex +public import Mathlib.GroupTheory.Perm.Support +public import Mathlib.Order.Monotone.Monovary /-! # Rearrangement inequality @@ -46,6 +48,8 @@ Add equality cases for when the permute function is injective. This comes from t If `Monovary f g`, `Injective g` and `σ` is a permutation, then `Monovary f (g ∘ σ) ↔ σ = 1`. -/ +@[expose] public section + open Equiv Equiv.Perm Finset Function OrderDual @@ -87,15 +91,15 @@ theorem MonovaryOn.sum_smul_comp_perm_le_sum_smul (hfg : MonovaryOn f g s) grw [← hind] obtain hσa | hσa := eq_or_ne a (σ a) · rw [hτ, ← hσa, swap_self, trans_refl] - have h1s : σ⁻¹ a ∈ s := by + have h1s : σ.symm a ∈ s := by rw [Ne, ← inv_eq_iff_eq] at hσa refine mem_of_mem_insert_of_ne (hσ fun h ↦ hσa ?_) hσa - rwa [apply_inv_self, eq_comm] at h + rwa [apply_symm_apply, eq_comm] at h simp only [← s.sum_erase_add _ h1s, add_comm] rw [← add_assoc, ← add_assoc] - simp only [hτ, swap_apply_left, Function.comp_apply, Equiv.coe_trans, apply_inv_self] + simp only [hτ, swap_apply_left, Function.comp_apply, Equiv.coe_trans, apply_symm_apply] refine add_le_add (smul_add_smul_le_smul_add_smul' ?_ ?_) (sum_congr rfl fun x hx ↦ ?_).le - · specialize hamax (σ⁻¹ a) h1s + · specialize hamax (σ.symm a) h1s rw [Prod.Lex.toLex_le_toLex] at hamax rcases hamax with hamax | hamax · exact hfg (mem_insert_of_mem h1s) (mem_insert_self _ _) hamax @@ -105,7 +109,7 @@ theorem MonovaryOn.sum_smul_comp_perm_le_sum_smul (hfg : MonovaryOn f g s) rcases hamax with hamax | hamax · exact hamax.le · exact hamax.1.le - · rw [mem_erase, Ne, eq_inv_iff_eq] at hx + · rw [mem_erase, Ne, eq_symm_apply] at hx rw [swap_apply_of_ne_of_ne hx.1 (σ.injective.ne _)] rintro rfl exact has hx.2 @@ -121,7 +125,7 @@ theorem AntivaryOn.sum_smul_le_sum_smul_comp_perm (hfg : AntivaryOn f g s) theorem MonovaryOn.sum_comp_perm_smul_le_sum_smul (hfg : MonovaryOn f g s) (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f (σ i) • g i ≤ ∑ i ∈ s, f i • g i := by convert hfg.sum_smul_comp_perm_le_sum_smul - (show { x | σ⁻¹ x ≠ x } ⊆ s by simp only [set_support_inv_eq, hσ]) using 1 + (show { x | σ⁻¹ x ≠ x } ⊆ s by simp [set_support_symm_eq, hσ]) using 1 exact σ.sum_comp' s (fun i j ↦ f i • g j) hσ /-- **Rearrangement Inequality**: Pointwise scalar multiplication of `f` and `g` is minimized when @@ -170,26 +174,25 @@ theorem MonovaryOn.sum_smul_comp_perm_eq_sum_smul_iff (hfg : MonovaryOn f g s) (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f i • g (σ i) = ∑ i ∈ s, f i • g i ↔ MonovaryOn f (g ∘ σ) s := by classical - refine ⟨not_imp_not.1 fun h ↦ ?_, fun h ↦ (hfg.sum_smul_comp_perm_le_sum_smul hσ).antisymm ?_⟩ - · rw [MonovaryOn] at h - push_neg at h - obtain ⟨x, hx, y, hy, hgxy, hfxy⟩ := h - set τ : Perm ι := (Equiv.swap x y).trans σ - have hτs : {x | τ x ≠ x} ⊆ s := by - refine (set_support_mul_subset σ <| swap x y).trans (Set.union_subset hσ fun z hz ↦ ?_) - obtain ⟨_, rfl | rfl⟩ := swap_apply_ne_self_iff.1 hz <;> assumption - refine ((hfg.sum_smul_comp_perm_le_sum_smul hτs).trans_lt' ?_).ne - obtain rfl | hxy := eq_or_ne x y - · cases lt_irrefl _ hfxy - simp only [τ, ← s.sum_erase_add _ hx, - ← (s.erase x).sum_erase_add _ (mem_erase.2 ⟨hxy.symm, hy⟩), - add_assoc, Equiv.coe_trans, Function.comp_apply, swap_apply_right, swap_apply_left] - refine add_lt_add_of_le_of_lt (Finset.sum_congr rfl fun z hz ↦ ?_).le - (smul_add_smul_lt_smul_add_smul hfxy hgxy) - simp_rw [mem_erase] at hz - rw [swap_apply_of_ne_of_ne hz.2.1 hz.1] - · convert h.sum_smul_comp_perm_le_sum_smul ((set_support_inv_eq _).subset.trans hσ) using 1 - simp_rw [Function.comp_apply, apply_inv_self] + refine ⟨not_imp_not.1 fun h ↦ ?_, fun h ↦ (hfg.sum_smul_comp_perm_le_sum_smul hσ).antisymm <| by + simpa using h.sum_smul_comp_perm_le_sum_smul ((set_support_symm_eq _).subset.trans hσ)⟩ + rw [MonovaryOn] at h + push_neg at h + obtain ⟨x, hx, y, hy, hgxy, hfxy⟩ := h + set τ : Perm ι := (Equiv.swap x y).trans σ + have hτs : {x | τ x ≠ x} ⊆ s := by + refine (set_support_mul_subset σ <| swap x y).trans (Set.union_subset hσ fun z hz ↦ ?_) + obtain ⟨_, rfl | rfl⟩ := swap_apply_ne_self_iff.1 hz <;> assumption + refine ((hfg.sum_smul_comp_perm_le_sum_smul hτs).trans_lt' ?_).ne + obtain rfl | hxy := eq_or_ne x y + · cases lt_irrefl _ hfxy + simp only [τ, ← s.sum_erase_add _ hx, + ← (s.erase x).sum_erase_add _ (mem_erase.2 ⟨hxy.symm, hy⟩), + add_assoc, Equiv.coe_trans, Function.comp_apply, swap_apply_right, swap_apply_left] + refine add_lt_add_of_le_of_lt (Finset.sum_congr rfl fun z hz ↦ ?_).le + (smul_add_smul_lt_smul_add_smul hfxy hgxy) + simp_rw [mem_erase] at hz + rw [swap_apply_of_ne_of_ne hz.2.1 hz.1] /-- **Equality case of the Rearrangement Inequality**: Pointwise scalar multiplication of `f` and `g`, which antivary together on `s`, is unchanged by a permutation if and only if `f` and `g ∘ σ` @@ -205,7 +208,7 @@ monovary together on `s`. Stated by permuting the entries of `f`. -/ theorem MonovaryOn.sum_comp_perm_smul_eq_sum_smul_iff (hfg : MonovaryOn f g s) (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f (σ i) • g i = ∑ i ∈ s, f i • g i ↔ MonovaryOn (f ∘ σ) g s := by - have hσinv : { x | σ⁻¹ x ≠ x } ⊆ s := (set_support_inv_eq _).subset.trans hσ + have hσinv : { x | σ⁻¹ x ≠ x } ⊆ s := (set_support_symm_eq _).subset.trans hσ refine (Iff.trans ?_ <| hfg.sum_smul_comp_perm_eq_sum_smul_iff hσinv).trans ⟨fun h ↦ ?_, fun h ↦ ?_⟩ · apply eq_iff_eq_cancel_right.2 diff --git a/Mathlib/Algebra/Order/Ring/Abs.lean b/Mathlib/Algebra/Order/Ring/Abs.lean index 1d327223b03eb3..46e25dc87e02fb 100644 --- a/Mathlib/Algebra/Order/Ring/Abs.lean +++ b/Mathlib/Algebra/Order/Ring/Abs.lean @@ -3,17 +3,21 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # Absolute values in linear ordered rings. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Ring/Archimedean.lean b/Mathlib/Algebra/Order/Ring/Archimedean.lean index 917cf94acb9018..09ce17a9b6b5dd 100644 --- a/Mathlib/Algebra/Order/Ring/Archimedean.lean +++ b/Mathlib/Algebra/Order/Ring/Archimedean.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang, Violeta Hernández Palacios -/ -import Mathlib.Algebra.Order.Archimedean.Class -import Mathlib.Algebra.Order.Group.DenselyOrdered -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Order.Hom.Ring -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.Algebra.Order.Archimedean.Class +public import Mathlib.Algebra.Order.Group.DenselyOrdered +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Order.Hom.Ring +public import Mathlib.RingTheory.Valuation.Basic /-! # Archimedean classes of a linearly ordered ring @@ -36,6 +38,8 @@ reasons: one on `Valuation`. -/ +@[expose] public section + variable {R S : Type*} [LinearOrder R] [LinearOrder S] namespace ArchimedeanClass diff --git a/Mathlib/Algebra/Order/Ring/Basic.lean b/Mathlib/Algebra/Order/Ring/Basic.lean index f24e0883586310..046cc97b8384cc 100644 --- a/Mathlib/Algebra/Order/Ring/Basic.lean +++ b/Mathlib/Algebra/Order/Ring/Basic.lean @@ -3,15 +3,19 @@ Copyright (c) 2015 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Robert Y. Lewis -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Parity -import Mathlib.Tactic.Bound.Attribute +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Tactic.Bound.Attribute /-! # Basic lemmas about ordered rings -/ +@[expose] public section + -- We should need only a minimal development of sets in order to get here. assert_not_exists Set.Subsingleton diff --git a/Mathlib/Algebra/Order/Ring/Canonical.lean b/Mathlib/Algebra/Order/Ring/Canonical.lean index d1081bcc7a2b47..6a16c39ff171fb 100644 --- a/Mathlib/Algebra/Order/Ring/Canonical.lean +++ b/Mathlib/Algebra/Order/Ring/Canonical.lean @@ -3,15 +3,19 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Algebra.Ring.Parity +module + +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Algebra.Ring.Parity /-! # Canonically ordered rings and semirings. -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/Order/Ring/Cast.lean b/Mathlib/Algebra/Order/Ring/Cast.lean index 3317c7496ca3d3..1907f0c0d6ff60 100644 --- a/Mathlib/Algebra/Order/Ring/Cast.lean +++ b/Mathlib/Algebra/Order/Ring/Cast.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # Order properties of cast of integers @@ -20,6 +22,8 @@ which were not available in the import dependencies of `Mathlib/Data/Int/Cast/Ba Move order lemmas about `Nat.cast`, `Rat.cast`, `NNRat.cast` here. -/ +@[expose] public section + open Function Nat variable {R : Type*} diff --git a/Mathlib/Algebra/Order/Ring/Cone.lean b/Mathlib/Algebra/Order/Ring/Cone.lean index 0c82182f1f0350..ca30d7f7a8cb7a 100644 --- a/Mathlib/Algebra/Order/Ring/Cone.lean +++ b/Mathlib/Algebra/Order/Ring/Cone.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Artie Khovanov -/ -import Mathlib.Algebra.Order.Group.Cone -import Mathlib.Algebra.Ring.Subsemiring.Order +module + +public import Mathlib.Algebra.Order.Group.Cone +public import Mathlib.Algebra.Ring.Subsemiring.Order /-! # Construct ordered rings from rings with a specified positive cone. @@ -17,6 +19,8 @@ We also provide constructors that convert between cones in rings and the corresponding ordered rings. -/ +@[expose] public section + /-- `RingConeClass S R` says that `S` is a type of cones in `R`. -/ class RingConeClass (S : Type*) (R : outParam Type*) [Ring R] [SetLike S R] : Prop extends AddGroupConeClass S R, SubsemiringClass S R diff --git a/Mathlib/Algebra/Order/Ring/Defs.lean b/Mathlib/Algebra/Order/Ring/Defs.lean index 721351db5d558b..f6a9b7cfbdc28b 100644 --- a/Mathlib/Algebra/Order/Ring/Defs.lean +++ b/Mathlib/Algebra/Order/Ring/Defs.lean @@ -3,16 +3,18 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Yaël Dillies, Yuyang Zhao -/ -import Mathlib.Algebra.Order.Ring.Unbundled.Basic -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.NatCast -import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Ring.GrindInstances -import Mathlib.Tactic.Tauto -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +module + +public import Mathlib.Algebra.Order.Ring.Unbundled.Basic +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.NatCast +public import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Ring.GrindInstances +public import Mathlib.Tactic.Tauto +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE /-! # Ordered rings and semirings @@ -102,6 +104,8 @@ immediate predecessors and what conditions are added to each of them. - `CommRing` & `IsDomain` & linear order structure -/ +@[expose] public section + assert_not_exists MonoidHom open Function diff --git a/Mathlib/Algebra/Order/Ring/Finset.lean b/Mathlib/Algebra/Order/Ring/Finset.lean index 7545266bd1f94b..2fcbcc81913285 100644 --- a/Mathlib/Algebra/Order/Ring/Finset.lean +++ b/Mathlib/Algebra/Order/Ring/Finset.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Eric Wieser, Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # `Finset.sup` and ring operations -/ +@[expose] public section + open Finset namespace Nat diff --git a/Mathlib/Algebra/Order/Ring/GeomSum.lean b/Mathlib/Algebra/Order/Ring/GeomSum.lean index 4334c5ff9e1017..fe2cd5c1e8cbfc 100644 --- a/Mathlib/Algebra/Order/Ring/GeomSum.lean +++ b/Mathlib/Algebra/Order/Ring/GeomSum.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland -/ -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.GeomSum +module + +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.GeomSum /-! # Partial sums of geometric series in an ordered ring @@ -15,6 +17,8 @@ $\sum_{i=0}^{n-1} x^i y^{n-1-i}$ and variants thereof. We also provide some boun "geometric" sum of `a/b^i` where `a b : ℕ`. -/ +@[expose] public section + assert_not_exists Field open Finset MulOpposite diff --git a/Mathlib/Algebra/Order/Ring/Idempotent.lean b/Mathlib/Algebra/Order/Ring/Idempotent.lean index 41add520f55d74..4c8adc036fe903 100644 --- a/Mathlib/Algebra/Order/Ring/Idempotent.lean +++ b/Mathlib/Algebra/Order/Ring/Idempotent.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Ring.Idempotent -import Mathlib.Order.BooleanAlgebra.Defs -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Ring.Idempotent +public import Mathlib.Order.BooleanAlgebra.Defs +public import Mathlib.Order.Hom.Basic /-! # Boolean algebra structure on idempotents in a commutative (semi)ring @@ -17,6 +19,8 @@ is not available, it is still true that pairs of elements `(a, b)` satisfying `a is uniquely determined by either `a` or `b`). -/ +@[expose] public section + variable {R : Type*} instance [CommMonoid R] [AddCommMonoid R] : diff --git a/Mathlib/Algebra/Order/Ring/InjSurj.lean b/Mathlib/Algebra/Order/Ring/InjSurj.lean index d1656a0eea249b..872c42e19549f9 100644 --- a/Mathlib/Algebra/Order/Ring/InjSurj.lean +++ b/Mathlib/Algebra/Order/Ring/InjSurj.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Order.Monoid.Basic -import Mathlib.Algebra.Order.Ring.Defs +module + +public import Mathlib.Algebra.Order.Monoid.Basic +public import Mathlib.Algebra.Order.Ring.Defs /-! # Pulling back ordered rings along injective maps -/ +@[expose] public section + variable {R S : Type*} namespace Function.Injective diff --git a/Mathlib/Algebra/Order/Ring/Int.lean b/Mathlib/Algebra/Order/Ring/Int.lean index 8d3faf7c2fe7d4..7f4f8f336885ed 100644 --- a/Mathlib/Algebra/Order/Ring/Int.lean +++ b/Mathlib/Algebra/Order/Ring/Int.lean @@ -3,13 +3,15 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Emirhan Duysak, Adem Alp Gök, Junyan Xu -/ -import Mathlib.Algebra.Order.Group.Int -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Int.Parity -import Mathlib.Data.Int.GCD -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Order.BooleanAlgebra.Set +module + +public import Mathlib.Algebra.Order.Group.Int +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Int.Parity +public import Mathlib.Data.Int.GCD +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Order.BooleanAlgebra.Set /-! # The integers form a linear ordered ring @@ -28,6 +30,8 @@ This file contains: induction on numbers less than `b`. -/ +@[expose] public section + -- We should need only a minimal development of sets in order to get here. assert_not_exists Set.Subsingleton diff --git a/Mathlib/Algebra/Order/Ring/IsNonarchimedean.lean b/Mathlib/Algebra/Order/Ring/IsNonarchimedean.lean index 8450b68b3f6f01..98d7e4bfb788af 100644 --- a/Mathlib/Algebra/Order/Ring/IsNonarchimedean.lean +++ b/Mathlib/Algebra/Order/Ring/IsNonarchimedean.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Fabrizio Barroero -/ -import Mathlib.Algebra.Order.Hom.Basic -import Mathlib.Data.Nat.Choose.Sum +module + +public import Mathlib.Algebra.Order.Hom.Basic +public import Mathlib.Data.Nat.Choose.Sum /-! # Nonarchimedean functions @@ -14,6 +16,8 @@ A function `f : α → R` is nonarchimedean if it satisfies the strong triangle nonarchimedean functions. -/ +@[expose] public section + namespace IsNonarchimedean variable {R : Type*} [Semiring R] [LinearOrder R] {a b : R} {m n : ℕ} diff --git a/Mathlib/Algebra/Order/Ring/Nat.lean b/Mathlib/Algebra/Order/Ring/Nat.lean index d13c6e5b73c50f..918b423196e08c 100644 --- a/Mathlib/Algebra/Order/Ring/Nat.lean +++ b/Mathlib/Algebra/Order/Ring/Nat.lean @@ -3,11 +3,13 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Parity -import Mathlib.Order.BooleanAlgebra.Set +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Order.BooleanAlgebra.Set /-! # The natural numbers form an ordered semiring @@ -17,6 +19,8 @@ This file contains the commutative linear orderded semiring instance on the natu See note [foundational algebra order theory]. -/ +@[expose] public section + namespace Nat /-! ### Instances -/ diff --git a/Mathlib/Algebra/Order/Ring/Opposite.lean b/Mathlib/Algebra/Order/Ring/Opposite.lean index 43dd5a61953361..9d635bc4d3ea64 100644 --- a/Mathlib/Algebra/Order/Ring/Opposite.lean +++ b/Mathlib/Algebra/Order/Ring/Opposite.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.Opposite -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Opposite +module + +public import Mathlib.Algebra.Order.Group.Opposite +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Opposite /-! # Ordered ring instances for `MulOpposite`/`AddOpposite` @@ -13,6 +15,8 @@ import Mathlib.Algebra.Ring.Opposite This file transfers ordered (semi)ring instances from `R` to `Rᵐᵒᵖ` and `Rᵃᵒᵖ`. -/ +@[expose] public section + variable {R : Type*} namespace MulOpposite diff --git a/Mathlib/Algebra/Order/Ring/Ordering/Basic.lean b/Mathlib/Algebra/Order/Ring/Ordering/Basic.lean index 8e4697dbc4a32c..9e51c4015a1cce 100644 --- a/Mathlib/Algebra/Order/Ring/Ordering/Basic.lean +++ b/Mathlib/Algebra/Order/Ring/Ordering/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Florent Schaffhauser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Florent Schaffhauser, Artie Khovanov -/ -import Mathlib.Algebra.Field.IsField -import Mathlib.Algebra.Order.Ring.Ordering.Defs -import Mathlib.Algebra.Ring.SumsOfSquares -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Algebra.Order.Ring.Ordering.Defs +public import Mathlib.Algebra.Ring.SumsOfSquares +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.LinearCombination /-! # Ring orderings @@ -20,6 +22,8 @@ We prove basic properties of (pre)orderings on rings and their supports. -/ +@[expose] public section + variable {R : Type*} [CommRing R] {P : RingPreordering R} /-! diff --git a/Mathlib/Algebra/Order/Ring/Ordering/Defs.lean b/Mathlib/Algebra/Order/Ring/Ordering/Defs.lean index 4d8fc87de4cea5..e54a8719c61724 100644 --- a/Mathlib/Algebra/Order/Ring/Ordering/Defs.lean +++ b/Mathlib/Algebra/Order/Ring/Ordering/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Florent Schaffhauser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Florent Schaffhauser, Artie Khovanov -/ -import Mathlib.Algebra.Ring.Subsemiring.Defs -import Mathlib.RingTheory.Ideal.Prime -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Ring.Subsemiring.Defs +public import Mathlib.RingTheory.Ideal.Prime +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Ring orderings @@ -31,6 +33,8 @@ into an ordered ring, and vice versa. -/ +@[expose] public section + /-! #### Preorderings -/ diff --git a/Mathlib/Algebra/Order/Ring/Pow.lean b/Mathlib/Algebra/Order/Ring/Pow.lean index f5967162b07624..287500dc9b0fe8 100644 --- a/Mathlib/Algebra/Order/Ring/Pow.lean +++ b/Mathlib/Algebra/Order/Ring/Pow.lean @@ -3,45 +3,110 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Nat.Cast.Commute -import Mathlib.Data.Nat.Cast.Order.Ring +module -/-! # Bernoulli's inequality -/ +public import Mathlib.Data.Nat.Cast.Commute +public import Mathlib.Data.Nat.Cast.Order.Ring +public import Mathlib.Tactic.Abel + +/-! # Bernoulli's inequality + +In this file we prove several versions of Bernoulli's inequality. +Besides the standard version `1 + n * a ≤ (1 + a) ^ n`, +we also prove `a ^ n + n * a ^ (n - 1) * b ≤ (a + b) ^ n`, +which can be regarded as Bernoulli's inequality for `b / a` multiplied by `a ^ n`. + +Also, we prove versions for different typeclass assumptions on the (semi)ring. +-/ + +@[expose] public section variable {R : Type*} section OrderedSemiring -variable [Semiring R] [PartialOrder R] [IsOrderedRing R] {a : R} +variable [Semiring R] [PartialOrder R] [IsOrderedRing R] {a b : R} -/-- **Bernoulli's inequality**. This version works for semirings but requires -additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/ -lemma one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) : - ∀ n : ℕ, 1 + n * a ≤ (1 + a) ^ n +/-- Bernoulli's inequality for `b / a`, written after multiplication by the denominators. -/ +lemma Commute.pow_add_mul_le_add_pow_of_sq_nonneg (Hcomm : Commute a b) (ha : 0 ≤ a) + (Hsq : 0 ≤ b ^ 2) (Hsq' : 0 ≤ (a + b) ^ 2) (H : 0 ≤ 2 * a + b) : + ∀ n : ℕ, a ^ n + n * a ^ (n - 1) * b ≤ (a + b) ^ n | 0 => by simp | 1 => by simp - | n + 2 => - have : 0 ≤ n * (a * a * (2 + a)) + a * a := - add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq + | 2 => + calc + a ^ 2 + (2 : ℕ) * a ^ 1 * b ≤ a ^ 2 + (2 : ℕ) * a ^ 1 * b + b ^ 2 := + le_add_of_nonneg_right Hsq + _ = (a + b) ^ 2 := by simp [sq, add_mul, mul_add, two_mul, Hcomm.eq, add_assoc] + | n + 3 => by calc - _ ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) := le_add_of_nonneg_right this - _ = (1 + a) * (1 + a) * (1 + n * a) := by - simp only [Nat.cast_add, add_mul, mul_add, one_mul, mul_one, ← one_add_one_eq_two, - Nat.cast_one, add_assoc] - simp only [← add_assoc, add_comm _ (↑n * a)] - simp only [add_assoc, (n.cast_commute (_ : R)).left_comm] - simp only [add_comm, add_left_comm] - _ ≤ (1 + a) * (1 + a) * (1 + a) ^ n := - mul_le_mul_of_nonneg_left (one_add_mul_le_pow' Hsq Hsq' H _) Hsq' - _ = (1 + a) ^ (n + 2) := by simp only [pow_succ', mul_assoc] + _ ≤ a ^ (n + 3) + ↑(n + 3) * a ^ (n + 2) * b + + ((n + 1) * (b ^ 2 * (2 * a + b) * a ^ n) + a ^ (n + 1) * b ^ 2) := + le_add_of_nonneg_right <| by + apply_rules [add_nonneg, mul_nonneg, Nat.cast_nonneg, pow_nonneg, zero_le_one] + _ = (a + b) ^ 2 * (a ^ (n + 1) + ↑(n + 1) * a ^ n * b) := by + simp only [Nat.cast_add, Nat.cast_one, Nat.cast_ofNat, pow_succ', add_mul, mul_add, + two_mul, pow_zero, mul_one, + Hcomm.eq, (n.cast_commute (_ : R)).symm.left_comm, mul_assoc, (Hcomm.pow_left _).eq, + (Hcomm.pow_left _).left_comm, Hcomm.left_comm, ← @two_add_one_eq_three R, one_mul] + abel + _ ≤ (a + b) ^ 2 * (a + b) ^ (n + 1) := by + gcongr + · assumption + · apply Commute.pow_add_mul_le_add_pow_of_sq_nonneg <;> assumption + _ = (a + b) ^ (n + 3) := by simp [pow_succ', mul_assoc] + +/-- **Bernoulli's inequality**. This version works for semirings but requires +additional hypotheses `0 ≤ a ^ 2` and `0 ≤ (1 + a) ^ 2`. -/ +lemma one_add_mul_le_pow_of_sq_nonneg (Hsq : 0 ≤ a ^ 2) (Hsq' : 0 ≤ (1 + a) ^ 2) (H : 0 ≤ 2 + a) + (n : ℕ) : 1 + n * a ≤ (1 + a) ^ n := by + simpa using (Commute.one_left a).pow_add_mul_le_add_pow_of_sq_nonneg zero_le_one Hsq Hsq' + (by simpa using H) n + +/-- **Bernoulli's inequality**. This version works for semirings but requires +additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/ +@[deprecated one_add_mul_le_pow_of_sq_nonneg (since := "2025-11-11")] +lemma one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) (n : ℕ) : + 1 + n * a ≤ (1 + a) ^ n := + one_add_mul_le_pow_of_sq_nonneg (by rwa [sq]) (by rwa [sq]) H n end OrderedSemiring +/-- Bernoulli's inequality for `b / a`, written after multiplication by the denominators. + +This version works for partially ordered commutative semirings, +but explicitly assumes that `b ^ 2` and `(a + b) ^ 2` are nonnegative. -/ +lemma pow_add_mul_le_add_pow_of_sq_nonneg [CommSemiring R] [PartialOrder R] [IsOrderedRing R] + {a b : R} (ha : 0 ≤ a) (Hsq : 0 ≤ b ^ 2) (Hsq' : 0 ≤ (a + b) ^ 2) (H : 0 ≤ 2 * a + b) + (n : ℕ) : a ^ n + n * a ^ (n - 1) * b ≤ (a + b) ^ n := + (Commute.all a b).pow_add_mul_le_add_pow_of_sq_nonneg ha Hsq Hsq' H n + +/-- Bernoulli's inequality for `b / a`, written after multiplication by the denominators. + +This is a version for a linear ordered semiring. -/ +lemma Commute.pow_add_mul_le_add_pow [Semiring R] [LinearOrder R] [IsOrderedRing R] + [ExistsAddOfLE R] {a b : R} (Hcomm : Commute a b) (ha : 0 ≤ a) (H : 0 ≤ 2 * a + b) + (n : ℕ) : a ^ n + n * a ^ (n - 1) * b ≤ (a + b) ^ n := + Hcomm.pow_add_mul_le_add_pow_of_sq_nonneg ha (sq_nonneg _) (sq_nonneg _) H n + +/-- Bernoulli's inequality for `b / a`, written after multiplication by the denominators. + +This is a version for a linear ordered semiring. -/ +lemma pow_add_mul_le_add_pow [CommSemiring R] [LinearOrder R] [IsOrderedRing R] [ExistsAddOfLE R] + {a b : R} (ha : 0 ≤ a) (H : 0 ≤ 2 * a + b) (n : ℕ) : + a ^ n + n * a ^ (n - 1) * b ≤ (a + b) ^ n := + (Commute.all a b).pow_add_mul_le_add_pow ha H n + +/-- Bernoulli's inequality for linear ordered semirings. -/ +lemma one_add_le_pow_of_two_add_nonneg [Semiring R] [LinearOrder R] [IsOrderedRing R] + [ExistsAddOfLE R] {a : R} (H : 0 ≤ 2 + a) (n : ℕ) : 1 + n * a ≤ (1 + a) ^ n := + one_add_mul_le_pow_of_sq_nonneg (sq_nonneg _) (sq_nonneg _) H _ + section LinearOrderedRing variable [Ring R] [LinearOrder R] [IsStrictOrderedRing R] {a : R} {n : ℕ} /-- **Bernoulli's inequality** for `n : ℕ`, `-2 ≤ a`. -/ lemma one_add_mul_le_pow (H : -2 ≤ a) (n : ℕ) : 1 + n * a ≤ (1 + a) ^ n := - one_add_mul_le_pow' (mul_self_nonneg _) (mul_self_nonneg _) (neg_le_iff_add_nonneg'.1 H) _ + one_add_le_pow_of_two_add_nonneg (neg_le_iff_add_nonneg'.mp H) n /-- **Bernoulli's inequality** reformulated to estimate `a^n`. -/ lemma one_add_mul_sub_le_pow (H : -1 ≤ a) (n : ℕ) : 1 + n * (a - 1) ≤ a ^ n := by diff --git a/Mathlib/Algebra/Order/Ring/Prod.lean b/Mathlib/Algebra/Order/Ring/Prod.lean index e7c9e9d41b50bb..75fb96d1eb6a94 100644 --- a/Mathlib/Algebra/Order/Ring/Prod.lean +++ b/Mathlib/Algebra/Order/Ring/Prod.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Monoid.Prod -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Ring.Prod +module + +public import Mathlib.Algebra.Order.Monoid.Prod +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Ring.Prod /-! # Products of ordered rings -/ +@[expose] public section + variable {α β : Type*} instance [Semiring α] [PartialOrder α] [IsOrderedRing α] diff --git a/Mathlib/Algebra/Order/Ring/Rat.lean b/Mathlib/Algebra/Order/Ring/Rat.lean index 7a36001efd8d4e..2a5c1523517efc 100644 --- a/Mathlib/Algebra/Order/Ring/Rat.lean +++ b/Mathlib/Algebra/Order/Ring/Rat.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Order.Ring.Unbundled.Rat -import Mathlib.Algebra.Ring.Rat +module + +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Order.Ring.Unbundled.Rat +public import Mathlib.Algebra.Ring.Rat /-! # The rational numbers form a linear ordered field @@ -21,6 +23,8 @@ here because we need the order on `ℚ` to define `ℚ≥0`, which we itself nee rat, rationals, field, ℚ, numerator, denominator, num, denom, order, ordering -/ +@[expose] public section + assert_not_exists Field Finset Set.Icc GaloisConnection namespace Rat diff --git a/Mathlib/Algebra/Order/Ring/Star.lean b/Mathlib/Algebra/Order/Ring/Star.lean index 72fca8a0e8fb85..d6db420ad77fcd 100644 --- a/Mathlib/Algebra/Order/Ring/Star.lean +++ b/Mathlib/Algebra/Order/Ring/Star.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Order.Star.Basic +module + +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Algebra.Order.Star.Basic /-! # Commutative star-ordered rings are ordered rings @@ -19,6 +21,8 @@ ordered ring, then it is commutative. In this file we prove the converse: a *commutative* star-ordered ring is an ordered ring. -/ +@[expose] public section + namespace StarOrderedRing /- This example shows that nonnegative elements in a ordered semiring which is also star-ordered diff --git a/Mathlib/Algebra/Order/Ring/Synonym.lean b/Mathlib/Algebra/Order/Ring/Synonym.lean index a1ae0a58d0074e..fca1dbe5cae6e2 100644 --- a/Mathlib/Algebra/Order/Ring/Synonym.lean +++ b/Mathlib/Algebra/Order/Ring/Synonym.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.Synonym -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Order.Group.Synonym +public import Mathlib.Algebra.Ring.Defs /-! # Ring structure on the order type synonyms @@ -12,6 +14,8 @@ import Mathlib.Algebra.Ring.Defs Transfer algebraic instances from `R` to `Rᵒᵈ` and `Lex R`. -/ +@[expose] public section + variable {R : Type*} diff --git a/Mathlib/Algebra/Order/Ring/Unbundled/Basic.lean b/Mathlib/Algebra/Order/Ring/Unbundled/Basic.lean index b176a8d5934184..69b4cf53198f51 100644 --- a/Mathlib/Algebra/Order/Ring/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/Ring/Unbundled/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Yaël Dillies -/ -import Mathlib.Algebra.Group.Units.Basic -import Mathlib.Algebra.GroupWithZero.NeZero -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Order.Monoid.NatCast -import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax -import Mathlib.Algebra.Ring.Defs -import Mathlib.Tactic.Tauto +module + +public import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.Algebra.GroupWithZero.NeZero +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Order.Monoid.NatCast +public import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Tactic.Tauto /-! # Basic facts for ordered rings and semirings @@ -112,6 +114,8 @@ TODO: the mixin assumptions can be relaxed in most cases -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidHom open Function diff --git a/Mathlib/Algebra/Order/Ring/Unbundled/Rat.lean b/Mathlib/Algebra/Order/Ring/Unbundled/Rat.lean index e3b62a7d67c24e..87facd6f65be0b 100644 --- a/Mathlib/Algebra/Order/Ring/Unbundled/Rat.lean +++ b/Mathlib/Algebra/Order/Ring/Unbundled/Rat.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Data.Rat.Defs -import Mathlib.Algebra.Ring.Int.Defs +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Data.Rat.Defs +public import Mathlib.Algebra.Ring.Int.Defs /-! # The rational numbers possess a linear order @@ -22,6 +24,8 @@ For the bundled `LinearOrderedCommRing` instance on `ℚ`, see `Algebra.Order.Ri rat, rationals, field, ℚ, numerator, denominator, num, denom, order, ordering -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Field Finset Set.Icc GaloisConnection namespace Rat diff --git a/Mathlib/Algebra/Order/Ring/Units.lean b/Mathlib/Algebra/Order/Ring/Units.lean index b9e1bd495b9fb6..8d56bae8211715 100644 --- a/Mathlib/Algebra/Order/Ring/Units.lean +++ b/Mathlib/Algebra/Order/Ring/Units.lean @@ -3,11 +3,15 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Ring.Subring.Units -import Mathlib.GroupTheory.Index +module + +public import Mathlib.Algebra.Ring.Subring.Units +public import Mathlib.GroupTheory.Index /-! # Lemmas about units of ordered rings -/ +@[expose] public section + lemma Units.index_posSubgroup (R : Type*) [Ring R] [LinearOrder R] [IsStrictOrderedRing R] : (posSubgroup R).index = 2 := by rw [Subgroup.index_eq_two_iff] diff --git a/Mathlib/Algebra/Order/Ring/WithTop.lean b/Mathlib/Algebra/Order/Ring/WithTop.lean index a1381c387949f6..44c6b0a827bba9 100644 --- a/Mathlib/Algebra/Order/Ring/WithTop.lean +++ b/Mathlib/Algebra/Order/Ring/WithTop.lean @@ -3,16 +3,20 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Order.GroupWithZero.Synonym -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Algebra.Order.Monoid.WithTop +module + +public import Mathlib.Algebra.Order.GroupWithZero.Synonym +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Algebra.Order.Monoid.WithTop /-! # Structures involving `*` and `0` on `WithTop` and `WithBot` The main results of this section are `WithTop.instOrderedCommSemiring` and `WithBot.instOrderedCommSemiring`. -/ +@[expose] public section + variable {α : Type*} namespace WithTop diff --git a/Mathlib/Algebra/Order/Round.lean b/Mathlib/Algebra/Order/Round.lean index 19c0930de14fab..41587eaff96893 100644 --- a/Mathlib/Algebra/Order/Round.lean +++ b/Mathlib/Algebra/Order/Round.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Floor.Ring -import Mathlib.Algebra.Order.Interval.Set.Group +module + +public import Mathlib.Algebra.Order.Floor.Ring +public import Mathlib.Algebra.Order.Interval.Set.Group /-! # Rounding @@ -21,6 +23,8 @@ to the nearest integer. rounding -/ +@[expose] public section + assert_not_exists Finset open Set diff --git a/Mathlib/Algebra/Order/Star/Basic.lean b/Mathlib/Algebra/Order/Star/Basic.lean index 8f130d48afdc2d..5916581116228f 100644 --- a/Mathlib/Algebra/Order/Star/Basic.lean +++ b/Mathlib/Algebra/Order/Star/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Group.Opposite -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Star.StarRingHom -import Mathlib.Tactic.ContinuousFunctionalCalculus -import Mathlib.Algebra.Star.StarProjection +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Group.Opposite +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Star.StarRingHom +public import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Algebra.Star.StarProjection /-! # Star ordered rings @@ -39,6 +41,8 @@ It is important to note that while a `StarOrderedRing` is an `OrderedAddCommMono the advantage of not requiring a topology. -/ +@[expose] public section + open Set open scoped NNRat diff --git a/Mathlib/Algebra/Order/Star/Conjneg.lean b/Mathlib/Algebra/Order/Star/Conjneg.lean index 9a25fd347ad523..12f18c8084cc38 100644 --- a/Mathlib/Algebra/Order/Star/Conjneg.lean +++ b/Mathlib/Algebra/Order/Star/Conjneg.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Pi -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Algebra.Star.Conjneg +module + +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Algebra.Star.Conjneg /-! # Order properties of conjugation-negation -/ +@[expose] public section + open scoped ComplexConjugate variable {G R : Type*} [AddGroup G] diff --git a/Mathlib/Algebra/Order/Star/Pi.lean b/Mathlib/Algebra/Order/Star/Pi.lean index 7c45f94db48012..a68a79a47af02f 100644 --- a/Mathlib/Algebra/Order/Star/Pi.lean +++ b/Mathlib/Algebra/Order/Star/Pi.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Group.Submonoid.Finite -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Algebra.Star.Pi +module + +public import Mathlib.Algebra.Group.Submonoid.Finite +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Algebra.Star.Pi /-! # Pi-types of star-ordered rings -/ +@[expose] public section + variable {ι : Type*} [Finite ι] {A : ι → Type*} [Π i, PartialOrder (A i)] [Π i, NonUnitalSemiring (A i)] [Π i, StarRing (A i)] [∀ i, StarOrderedRing (A i)] diff --git a/Mathlib/Algebra/Order/Star/Prod.lean b/Mathlib/Algebra/Order/Star/Prod.lean index f2375c7d57a81b..1f5e4ae82ae26e 100644 --- a/Mathlib/Algebra/Order/Star/Prod.lean +++ b/Mathlib/Algebra/Order/Star/Prod.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Algebra.Star.Prod -import Mathlib.Algebra.Ring.Prod +module + +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Algebra.Star.Prod +public import Mathlib.Algebra.Ring.Prod /-! # Products of star-ordered rings -/ +@[expose] public section + variable {α β : Type*} open AddSubmonoid in diff --git a/Mathlib/Algebra/Order/Sub/Basic.lean b/Mathlib/Algebra/Order/Sub/Basic.lean index bbbdc00475a130..a71b02c26c6ee2 100644 --- a/Mathlib/Algebra/Order/Sub/Basic.lean +++ b/Mathlib/Algebra/Order/Sub/Basic.lean @@ -3,15 +3,19 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.Sub.Unbundled.Basic -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Group.Even +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Group.Even /-! # Lemmas about subtraction in unbundled canonically ordered monoids -/ +@[expose] public section + variable {α : Type*} section CanonicallyOrderedAddCommMonoid diff --git a/Mathlib/Algebra/Order/Sub/Defs.lean b/Mathlib/Algebra/Order/Sub/Defs.lean index ff7e233cf5b59d..9ba82901dd193d 100644 --- a/Mathlib/Algebra/Order/Sub/Defs.lean +++ b/Mathlib/Algebra/Order/Sub/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Order.Lattice +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Order.Lattice /-! # Ordered Subtraction @@ -40,6 +42,8 @@ TODO: generalize `Nat.le_of_le_of_sub_le_sub_right`, `Nat.sub_le_sub_right_iff`, `Nat.mul_self_sub_mul_self_eq` -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Order/Sub/Prod.lean b/Mathlib/Algebra/Order/Sub/Prod.lean index ef2cf82b32501c..034960fe4483a4 100644 --- a/Mathlib/Algebra/Order/Sub/Prod.lean +++ b/Mathlib/Algebra/Order/Sub/Prod.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Notation.Prod +module + +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Notation.Prod /-! # Products of `OrderedSub` types. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {α β : Type*} diff --git a/Mathlib/Algebra/Order/Sub/Unbundled/Basic.lean b/Mathlib/Algebra/Order/Sub/Unbundled/Basic.lean index ac4b86662b407d..e58b117107ca34 100644 --- a/Mathlib/Algebra/Order/Sub/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/Sub/Unbundled/Basic.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +module + +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE /-! # Lemmas about subtraction in an unbundled canonically ordered monoids -/ +@[expose] public section + -- These are about *unbundled* canonically ordered monoids assert_not_exists IsOrderedMonoid diff --git a/Mathlib/Algebra/Order/Sub/Unbundled/Hom.lean b/Mathlib/Algebra/Order/Sub/Unbundled/Hom.lean index e3fb21131032c2..e4d341c20d66fa 100644 --- a/Mathlib/Algebra/Order/Sub/Unbundled/Hom.lean +++ b/Mathlib/Algebra/Order/Sub/Unbundled/Hom.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Order.Sub.Unbundled.Basic -import Mathlib.Algebra.Ring.Basic -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic +public import Mathlib.Algebra.Ring.Basic +public import Mathlib.Order.Hom.Basic /-! # Lemmas about subtraction in unbundled canonically ordered monoids -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Algebra/Order/Sub/WithTop.lean b/Mathlib/Algebra/Order/Sub/WithTop.lean index 2cbd94df8b2b35..910d370d254d2c 100644 --- a/Mathlib/Algebra/Order/Sub/WithTop.lean +++ b/Mathlib/Algebra/Order/Sub/WithTop.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.Sub.Defs -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +module + +public import Mathlib.Algebra.Order.Sub.Defs +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop /-! # Lemma about subtraction in ordered monoids with a top element adjoined. @@ -20,6 +22,8 @@ other instance is only registered for `LinearOrderedAddCommGroup α` (which does element, unless the group is trivial), this shouldn't create diamonds. -/ +@[expose] public section + variable {α β : Type*} namespace WithTop diff --git a/Mathlib/Algebra/Order/SuccPred.lean b/Mathlib/Algebra/Order/SuccPred.lean index 7588a3010c0a4e..edfaf3f2ff5447 100644 --- a/Mathlib/Algebra/Order/SuccPred.lean +++ b/Mathlib/Algebra/Order/SuccPred.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios, Yaël Dillies -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Data.Int.Cast.Defs -import Mathlib.Order.SuccPred.Limit -import Mathlib.Order.SuccPred.WithBot +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Data.Int.Cast.Defs +public import Mathlib.Order.SuccPred.Limit +public import Mathlib.Order.SuccPred.WithBot /-! # Interaction between successors and arithmetic @@ -24,6 +26,8 @@ respectively. This will require a refactor of `Ordinal` first, as the `simp`-nor currently set the other way around. -/ +@[expose] public section + /-- A typeclass for `succ x = x + 1`. -/ class SuccAddOrder (α : Type*) [Preorder α] [Add α] [One α] extends SuccOrder α where succ_eq_add_one (x : α) : succ x = x + 1 diff --git a/Mathlib/Algebra/Order/SuccPred/PartialSups.lean b/Mathlib/Algebra/Order/SuccPred/PartialSups.lean index d9765c7cff1485..1a1883fbb3aead 100644 --- a/Mathlib/Algebra/Order/SuccPred/PartialSups.lean +++ b/Mathlib/Algebra/Order/SuccPred/PartialSups.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Oliver Butterley, Lua Viana Reis -/ -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Order.PartialSups -import Mathlib.Order.SuccPred.LinearLocallyFinite +module + +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Order.PartialSups +public import Mathlib.Order.SuccPred.LinearLocallyFinite /-! # `PartialSups` in a `SuccAddOrder` @@ -14,6 +16,8 @@ Basic results concerning `PartialSups` which follow with minimal assumptions bey the `PartialSup` is defined over a `SuccAddOrder`. -/ +@[expose] public section + open Finset variable {α ι : Type*} [SemilatticeSup α] [LinearOrder ι] diff --git a/Mathlib/Algebra/Order/SuccPred/TypeTags.lean b/Mathlib/Algebra/Order/SuccPred/TypeTags.lean index 6b9851c1ad7790..7eaa4b15e847dc 100644 --- a/Mathlib/Algebra/Order/SuccPred/TypeTags.lean +++ b/Mathlib/Algebra/Order/SuccPred/TypeTags.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Order.SuccPred.Archimedean -import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags +module + +public import Mathlib.Order.SuccPred.Archimedean +public import Mathlib.Algebra.Order.Monoid.Unbundled.TypeTags /-! # Successor and predecessor on type tags @@ -13,6 +15,8 @@ This file declates successor and predecessor orders on type tags. -/ +@[expose] public section + variable {X : Type*} instance [Preorder X] [h : SuccOrder X] : SuccOrder (Multiplicative X) := h diff --git a/Mathlib/Algebra/Order/SuccPred/WithBot.lean b/Mathlib/Algebra/Order/SuccPred/WithBot.lean index bd3460556c4cc3..a4fa23edffd7eb 100644 --- a/Mathlib/Algebra/Order/SuccPred/WithBot.lean +++ b/Mathlib/Algebra/Order/SuccPred/WithBot.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Order.SuccPred.WithBot +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Order.SuccPred.WithBot /-! # Algebraic properties of the successor function on `WithBot` -/ +@[expose] public section + namespace WithBot variable {α : Type*} [Preorder α] [OrderBot α] [AddMonoidWithOne α] [SuccAddOrder α] diff --git a/Mathlib/Algebra/Order/Sum.lean b/Mathlib/Algebra/Order/Sum.lean index 0e6e2d5813aeb6..380e574feb4e97 100644 --- a/Mathlib/Algebra/Order/Sum.lean +++ b/Mathlib/Algebra/Order/Sum.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Martin Dvorak. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Dvorak -/ -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Order.Basic +module + +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Order.Basic /-! # Interaction between `Sum.elim`, `≤`, and `0` or `1` @@ -12,6 +14,8 @@ import Mathlib.Order.Basic This file provides basic API for part-wise comparison of `Sum.elim` vectors against `0` or `1`. -/ +@[expose] public section + namespace Sum variable {α₁ α₂ β : Type*} [LE β] [One β] {v₁ : α₁ → β} {v₂ : α₂ → β} diff --git a/Mathlib/Algebra/Order/ToIntervalMod.lean b/Mathlib/Algebra/Order/ToIntervalMod.lean index 901cb55f916e23..7767bd33d7911c 100644 --- a/Mathlib/Algebra/Order/ToIntervalMod.lean +++ b/Mathlib/Algebra/Order/ToIntervalMod.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.ModEq -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Ring.Periodic -import Mathlib.Data.Int.SuccPred -import Mathlib.Order.Circular +module + +public import Mathlib.Algebra.ModEq +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Ring.Periodic +public import Mathlib.Data.Int.SuccPred +public import Mathlib.Order.Circular /-! # Reducing to an interval modulo its length @@ -26,6 +28,8 @@ interval. * `toIocMod hp a b` (where `hp : 0 < p`): Reduce `b` to the interval `Ioc a (a + p)`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal noncomputable section diff --git a/Mathlib/Algebra/Order/UpperLower.lean b/Mathlib/Algebra/Order/UpperLower.lean index 2101c7eeed0179..8e83c912eb64ff 100644 --- a/Mathlib/Algebra/Order/UpperLower.lean +++ b/Mathlib/Algebra/Order/UpperLower.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Lattice -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Lattice +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Order.UpperLower.Closure /-! # Algebraic operations on upper/lower sets @@ -16,6 +18,8 @@ import Mathlib.Order.UpperLower.Closure Upper/lower sets are preserved under pointwise algebraic operations in ordered groups. -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Algebra/Order/WithTop/Untop0.lean b/Mathlib/Algebra/Order/WithTop/Untop0.lean index c41aa2d452b885..bc719e9a84f821 100644 --- a/Mathlib/Algebra/Order/WithTop/Untop0.lean +++ b/Mathlib/Algebra/Order/WithTop/Untop0.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ +module -import Mathlib.Algebra.Order.AddGroupWithTop -import Mathlib.Algebra.Order.Ring.WithTop +public import Mathlib.Algebra.Order.AddGroupWithTop +public import Mathlib.Algebra.Order.Ring.WithTop /-! # Conversion from WithTop to Base Type @@ -17,6 +18,8 @@ For settings where `α` has additional structure, we provide a large number of s akin to those that already exists for `ENat.toNat`. -/ +@[expose] public section + namespace WithTop variable {α : Type*} diff --git a/Mathlib/Algebra/Order/ZeroLEOne.lean b/Mathlib/Algebra/Order/ZeroLEOne.lean index ac05e643dc70f6..2da3dc261959ee 100644 --- a/Mathlib/Algebra/Order/ZeroLEOne.lean +++ b/Mathlib/Algebra/Order/ZeroLEOne.lean @@ -3,14 +3,18 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Notation.Prod -import Mathlib.Order.Basic +module + +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Order.Basic /-! # Typeclass expressing `0 ≤ 1`. -/ +@[expose] public section + variable {α : Type*} open Function diff --git a/Mathlib/Algebra/PEmptyInstances.lean b/Mathlib/Algebra/PEmptyInstances.lean index 8a333398678d12..d743ba3837e1ec 100644 --- a/Mathlib/Algebra/PEmptyInstances.lean +++ b/Mathlib/Algebra/PEmptyInstances.lean @@ -3,8 +3,9 @@ Copyright (c) 2021 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Tactic.ToAdditive +module + +public import Mathlib.Algebra.Group.Defs /-! # Instances on pempty @@ -13,6 +14,8 @@ This file collects facts about algebraic structures on the (universe-polymorphic that it is a semigroup. -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Pointwise/Stabilizer.lean b/Mathlib/Algebra/Pointwise/Stabilizer.lean index 95770bf488529d..46d6beef3808fd 100644 --- a/Mathlib/Algebra/Pointwise/Stabilizer.lean +++ b/Mathlib/Algebra/Pointwise/Stabilizer.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.GroupTheory.QuotientGroup.Defs -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.GroupTheory.QuotientGroup.Defs +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Stabilizer of a set under a pointwise action @@ -13,6 +15,8 @@ import Mathlib.Order.ConditionallyCompleteLattice.Basic This file characterises the stabilizer of a set/finset under the pointwise action of a group. -/ +@[expose] public section + open Function MulOpposite Set open scoped Pointwise diff --git a/Mathlib/Algebra/Polynomial/AlgebraMap.lean b/Mathlib/Algebra/Polynomial/AlgebraMap.lean index 7da4f1c2c292e7..34fdd1522ea14c 100644 --- a/Mathlib/Algebra/Polynomial/AlgebraMap.lean +++ b/Mathlib/Algebra/Polynomial/AlgebraMap.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Algebra.Polynomial.Eval.Algebra -import Mathlib.Algebra.Polynomial.Eval.Degree -import Mathlib.Algebra.Polynomial.Monomial +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Algebra.Polynomial.Eval.Algebra +public import Mathlib.Algebra.Polynomial.Eval.Degree +public import Mathlib.Algebra.Polynomial.Monomial /-! # Theory of univariate polynomials @@ -19,6 +21,8 @@ We show that `A[X]` is an R-algebra when `A` is an R-algebra. We promote `eval₂` to an algebra hom in `aeval`. -/ +@[expose] public section + assert_not_exists Ideal noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Basic.lean b/Mathlib/Algebra/Polynomial/Basic.lean index 2250fc14982e7f..bdae62a11a9493 100644 --- a/Mathlib/Algebra/Polynomial/Basic.lean +++ b/Mathlib/Algebra/Polynomial/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.MonoidAlgebra.Module -import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Algebra.Ring.Action.Rat -import Mathlib.Data.Finset.Sort -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.MonoidAlgebra.Module +public import Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Algebra.Ring.Action.Rat +public import Mathlib.Data.Finset.Sort +public import Mathlib.Tactic.FastInstance /-! # Theory of univariate polynomials @@ -53,6 +55,8 @@ equivalence is also registered as a ring equiv in `Polynomial.toFinsuppIso`. The in general not be used once the basic API for polynomials is constructed. -/ +@[expose] public section + noncomputable section /-- `Polynomial R` is the type of univariate polynomials over `R`, @@ -404,7 +408,7 @@ theorem monomial_zero_right (n : ℕ) : monomial n (0 : R) = 0 := theorem monomial_zero_one : monomial 0 (1 : R) = 1 := rfl --- TODO: can't we just delete this one? +@[deprecated map_add (since := "2025-11-15")] theorem monomial_add (n : ℕ) (r s : R) : monomial n (r + s) = monomial n r + monomial n s := (monomial n).map_add _ _ @@ -1116,10 +1120,10 @@ theorem coeff_sub (p q : R[X]) (n : ℕ) : coeff (p - q) n = coeff p n - coeff q @[simp] theorem monomial_neg (n : ℕ) (a : R) : monomial n (-a) = -monomial n a := by - rw [eq_neg_iff_add_eq_zero, ← monomial_add, neg_add_cancel, monomial_zero_right] + rw [eq_neg_iff_add_eq_zero, ← map_add, neg_add_cancel, monomial_zero_right] theorem monomial_sub (n : ℕ) : monomial n (a - b) = monomial n a - monomial n b := by - rw [sub_eq_add_neg, monomial_add, monomial_neg, sub_eq_add_neg] + rw [sub_eq_add_neg, map_add, monomial_neg, sub_eq_add_neg] @[simp] theorem support_neg {p : R[X]} : (-p).support = p.support := by diff --git a/Mathlib/Algebra/Polynomial/Basis.lean b/Mathlib/Algebra/Polynomial/Basis.lean index 28035306a142c8..0a51748fe1bb58 100644 --- a/Mathlib/Algebra/Polynomial/Basis.lean +++ b/Mathlib/Algebra/Polynomial/Basis.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.LinearAlgebra.Basis.Defs +module + +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.LinearAlgebra.Basis.Defs /-! @@ -12,6 +14,8 @@ import Mathlib.LinearAlgebra.Basis.Defs -/ +@[expose] public section + open Module universe u diff --git a/Mathlib/Algebra/Polynomial/BigOperators.lean b/Mathlib/Algebra/Polynomial/BigOperators.lean index 00439fab88615c..adb93976e0a1cc 100644 --- a/Mathlib/Algebra/Polynomial/BigOperators.lean +++ b/Mathlib/Algebra/Polynomial/BigOperators.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark -/ -import Mathlib.Algebra.Polynomial.Monic +module + +public import Mathlib.Algebra.Polynomial.Monic /-! # Lemmas for the interaction between polynomials and `∑` and `∏`. @@ -23,6 +25,8 @@ Recall that `∑` and `∏` are notation for `Finset.sum` and `Finset.prod` resp the second coefficient of the characteristic polynomial. -/ +@[expose] public section + open Finset diff --git a/Mathlib/Algebra/Polynomial/Bivariate.lean b/Mathlib/Algebra/Polynomial/Bivariate.lean index 0a7d20220f271d..9cb1c57c1086f1 100644 --- a/Mathlib/Algebra/Polynomial/Bivariate.lean +++ b/Mathlib/Algebra/Polynomial/Bivariate.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.RingTheory.AdjoinRoot +module + +public import Mathlib.RingTheory.AdjoinRoot /-! # Bivariate polynomials @@ -16,6 +18,8 @@ on the affine plane, which is a ring homomorphism (`Polynomial.evalEvalRingHom`) the abbreviation `CC` to view a constant in the base ring `R` as a bivariate polynomial. -/ +@[expose] public section + /-- The notation `Y` for `X` in the `Polynomial` scope. -/ scoped[Polynomial.Bivariate] notation3:max "Y" => Polynomial.X (R := Polynomial _) diff --git a/Mathlib/Algebra/Polynomial/CancelLeads.lean b/Mathlib/Algebra/Polynomial/CancelLeads.lean index d18b65205f8ccb..ca71cbddbbdd97 100644 --- a/Mathlib/Algebra/Polynomial/CancelLeads.lean +++ b/Mathlib/Algebra/Polynomial/CancelLeads.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Tactic.ComputeDegree +module + +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Tactic.ComputeDegree /-! # Cancel the leading terms of two polynomials @@ -19,6 +21,8 @@ The degree of `cancelLeads` is less than that of the larger of the two polynomia Thus it is useful for induction or minimal-degree arguments. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/Cardinal.lean b/Mathlib/Algebra/Polynomial/Cardinal.lean index b659c5b0d6870f..9bf4603bf528b9 100644 --- a/Mathlib/Algebra/Polynomial/Cardinal.lean +++ b/Mathlib/Algebra/Polynomial/Cardinal.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Chris Hughes, Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Junyan Xu -/ -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.SetTheory.Cardinal.Finsupp +module + +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.SetTheory.Cardinal.Finsupp /-! # Cardinality of Polynomial Ring @@ -13,6 +15,8 @@ The result in this file is that the cardinality of `R[X]` is at most the maximum of `#R` and `ℵ₀`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Polynomial/Coeff.lean b/Mathlib/Algebra/Polynomial/Coeff.lean index 04e4d4426e6a8b..bed6667d46822b 100644 --- a/Mathlib/Algebra/Polynomial/Coeff.lean +++ b/Mathlib/Algebra/Polynomial/Coeff.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.MonoidAlgebra.Support -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Algebra.Regular.Basic -import Mathlib.Data.Nat.Choose.Sum +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.MonoidAlgebra.Support +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.Data.Nat.Choose.Sum /-! # Theory of univariate polynomials @@ -17,6 +19,8 @@ The theorems include formulas for computing coefficients, such as -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/CoeffList.lean b/Mathlib/Algebra/Polynomial/CoeffList.lean index 2c207d0049e744..134ea25829af71 100644 --- a/Mathlib/Algebra/Polynomial/CoeffList.lean +++ b/Mathlib/Algebra/Polynomial/CoeffList.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Alex Meiburg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Meiburg -/ -import Mathlib.Algebra.Polynomial.Degree.Definitions -import Mathlib.Algebra.Polynomial.EraseLead -import Mathlib.Data.List.Range +module + +public import Mathlib.Algebra.Polynomial.Degree.Definitions +public import Mathlib.Algebra.Polynomial.EraseLead +public import Mathlib.Data.List.Range /-! # A list of coefficients of a polynomial @@ -33,6 +35,8 @@ of coefficients starts with the leading coefficient, followed by some number of coefficients of `P.eraseLead`. -/ +@[expose] public section + namespace Polynomial variable {R : Type*} diff --git a/Mathlib/Algebra/Polynomial/CoeffMem.lean b/Mathlib/Algebra/Polynomial/CoeffMem.lean index e303a4dfc07911..524b3a5686e4ec 100644 --- a/Mathlib/Algebra/Polynomial/CoeffMem.lean +++ b/Mathlib/Algebra/Polynomial/CoeffMem.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Polynomial.Div -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.RingTheory.Ideal.Span /-! # Bounding the coefficients of the quotient and remainder of polynomials @@ -17,6 +19,8 @@ Precisely, we show that each summand needs at most one coefficient of `p` and `d of `q`. -/ +@[expose] public section + namespace Polynomial variable {ι R S : Type*} [CommRing R] [Ring S] [Algebra R S] diff --git a/Mathlib/Algebra/Polynomial/Degree/CardPowDegree.lean b/Mathlib/Algebra/Polynomial/Degree/CardPowDegree.lean index 23ab64d7018f09..a6b13afc1c5302 100644 --- a/Mathlib/Algebra/Polynomial/Degree/CardPowDegree.lean +++ b/Mathlib/Algebra/Polynomial/Degree/CardPowDegree.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Order.AbsoluteValue.Euclidean -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Polynomial.FieldDivision +module + +public import Mathlib.Algebra.Order.AbsoluteValue.Euclidean +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Polynomial.FieldDivision /-! # Absolute value on polynomials over a finite field. @@ -25,6 +27,8 @@ to `q ^ degree p` (where `q ^ degree 0 = 0`) is an absolute value. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/Degree/Definitions.lean b/Mathlib/Algebra/Polynomial/Degree/Definitions.lean index 5bcbe895e79d17..268bbb340c4358 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Definitions.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Definitions.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.MonoidAlgebra.Degree -import Mathlib.Algebra.Order.Ring.WithTop -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Data.Nat.Cast.WithTop -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.SuccPred.WithBot +module + +public import Mathlib.Algebra.MonoidAlgebra.Degree +public import Mathlib.Algebra.Order.Ring.WithTop +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.Data.Nat.Cast.WithTop +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.SuccPred.WithBot /-! # Degree of univariate polynomials @@ -26,6 +28,8 @@ import Mathlib.Order.SuccPred.WithBot * `Polynomial.degree_eq_natDegree`: the degree and natDegree coincide for nonzero polynomials -/ +@[expose] public section + noncomputable section open Finsupp Finset diff --git a/Mathlib/Algebra/Polynomial/Degree/Domain.lean b/Mathlib/Algebra/Polynomial/Degree/Domain.lean index cb1d5430acc391..fc7d3bde5d8e26 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Domain.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Domain.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Operations +module + +public import Mathlib.Algebra.Polynomial.Degree.Operations /-! # Univariate polynomials form a domain @@ -14,6 +16,8 @@ import Mathlib.Algebra.Polynomial.Degree.Operations * `Polynomial.instDomain`: `R[X]` is a domain if `R` is -/ +@[expose] public section + noncomputable section open Finsupp Finset diff --git a/Mathlib/Algebra/Polynomial/Degree/IsMonicOfDegree.lean b/Mathlib/Algebra/Polynomial/Degree/IsMonicOfDegree.lean index 64c2412227c2ad..586a34837b8a4c 100644 --- a/Mathlib/Algebra/Polynomial/Degree/IsMonicOfDegree.lean +++ b/Mathlib/Algebra/Polynomial/Degree/IsMonicOfDegree.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Monic +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Monic /-! # Monic polynomials of given degree @@ -15,6 +17,8 @@ the polynomial `p` is monic and has degree `n` (i.e., `p.natDegree = n`.) We also provide some basic API. -/ +@[expose] public section + namespace Polynomial variable {R : Type*} diff --git a/Mathlib/Algebra/Polynomial/Degree/Lemmas.lean b/Mathlib/Algebra/Polynomial/Degree/Lemmas.lean index 523a4a23eab24b..129e9f28bdcfe7 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Lemmas.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Lemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Eval.Degree -import Mathlib.Algebra.Prime.Lemmas +module + +public import Mathlib.Algebra.Polynomial.Eval.Degree +public import Mathlib.Algebra.Prime.Lemmas /-! # Theory of degrees of polynomials @@ -14,6 +16,8 @@ Some of the main results include -/ +@[expose] public section + noncomputable section @@ -355,7 +359,7 @@ lemma natDegree_eq_one : p.natDegree = 1 ↔ ∃ a ≠ 0, ∃ b, C a * X + C b = · rintro ⟨a, ha, b, rfl⟩ simp [ha] -theorem subsingleton_isRoot_of_natDegree_eq_one [IsLeftCancelMulZero R] [IsRightCancelAdd R] +theorem subsingleton_isRoot_of_natDegree_eq_one [IsLeftCancelMulZero R] (h : p.natDegree = 1) : { x | IsRoot p x }.Subsingleton := by intro r₁ obtain ⟨r₂, hr₂, r₃, rfl⟩ : ∃ a, a ≠ 0 ∧ ∃ b, C a * X + C b = p := by rwa [natDegree_eq_one] at h diff --git a/Mathlib/Algebra/Polynomial/Degree/Monomial.lean b/Mathlib/Algebra/Polynomial/Degree/Monomial.lean index f52db7e3a53f92..a7d589d9fe3ff9 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Monomial.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Monomial.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Definitions -import Mathlib.Algebra.Polynomial.Monomial -import Mathlib.Data.Nat.SuccPred +module + +public import Mathlib.Algebra.Polynomial.Degree.Definitions +public import Mathlib.Algebra.Polynomial.Monomial +public import Mathlib.Data.Nat.SuccPred /-! # Degree of univariate monomials -/ +@[expose] public section + noncomputable section open Finsupp Finset Polynomial diff --git a/Mathlib/Algebra/Polynomial/Degree/Operations.lean b/Mathlib/Algebra/Polynomial/Degree/Operations.lean index a6e4da664c90c8..fe79a3758d6b33 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Operations.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Operations.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.Polynomial.Coeff -import Mathlib.Algebra.Polynomial.Degree.Definitions +module + +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.Polynomial.Coeff +public import Mathlib.Algebra.Polynomial.Degree.Definitions /-! # Lemmas for calculating the degree of univariate polynomials @@ -16,6 +18,8 @@ import Mathlib.Algebra.Polynomial.Degree.Definitions The leading coefficient of a sum is determined by the leading coefficients and degrees -/ +@[expose] public section + noncomputable section open Finsupp Finset diff --git a/Mathlib/Algebra/Polynomial/Degree/SmallDegree.lean b/Mathlib/Algebra/Polynomial/Degree/SmallDegree.lean index 0849b57c5fc74e..44f5faec3081a2 100644 --- a/Mathlib/Algebra/Polynomial/Degree/SmallDegree.lean +++ b/Mathlib/Algebra/Polynomial/Degree/SmallDegree.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Operations -import Mathlib.Data.Nat.WithBot +module + +public import Mathlib.Algebra.Polynomial.Degree.Operations +public import Mathlib.Data.Nat.WithBot /-! # Results on polynomials of specific small degrees -/ +@[expose] public section + open Finsupp Finset open Polynomial diff --git a/Mathlib/Algebra/Polynomial/Degree/Support.lean b/Mathlib/Algebra/Polynomial/Degree/Support.lean index 8362c18e525e1d..87abdad6976130 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Support.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Support.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.MonoidAlgebra.Support -import Mathlib.Algebra.Polynomial.Degree.Operations +module + +public import Mathlib.Algebra.MonoidAlgebra.Support +public import Mathlib.Algebra.Polynomial.Degree.Operations /-! # Degree and support of univariate polynomials @@ -15,6 +17,8 @@ import Mathlib.Algebra.Polynomial.Degree.Operations * `Polynomial.natDegree_mem_support_of_nonzero`: `natDegree p ∈ support p` if `p ≠ 0` -/ +@[expose] public section + noncomputable section open Finsupp Finset diff --git a/Mathlib/Algebra/Polynomial/Degree/TrailingDegree.lean b/Mathlib/Algebra/Polynomial/Degree/TrailingDegree.lean index a80aa34560dd3f..a9c8e0d67744e1 100644 --- a/Mathlib/Algebra/Polynomial/Degree/TrailingDegree.lean +++ b/Mathlib/Algebra/Polynomial/Degree/TrailingDegree.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Data.ENat.Basic +module + +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Data.ENat.Basic /-! # Trailing degree of univariate polynomials @@ -19,6 +21,8 @@ Converts most results about `degree`, `natDegree` and `leadingCoeff` to results end of a polynomial -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Degree/Units.lean b/Mathlib/Algebra/Polynomial/Degree/Units.lean index 405b21b67fb078..de36cd7a7a2160 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Units.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Units.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Domain -import Mathlib.Algebra.Polynomial.Degree.SmallDegree +module + +public import Mathlib.Algebra.Polynomial.Degree.Domain +public import Mathlib.Algebra.Polynomial.Degree.SmallDegree /-! # Degree of polynomials that are units -/ +@[expose] public section + noncomputable section open Finsupp Finset Polynomial diff --git a/Mathlib/Algebra/Polynomial/DenomsClearable.lean b/Mathlib/Algebra/Polynomial/DenomsClearable.lean index 1225c103a7f328..45b335a145aca0 100644 --- a/Mathlib/Algebra/Polynomial/DenomsClearable.lean +++ b/Mathlib/Algebra/Polynomial/DenomsClearable.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Algebra.Basic -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Algebra.Polynomial.EraseLead +module + +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Algebra.Polynomial.EraseLead /-! # Denominators of evaluation of polynomials at ratios @@ -16,6 +18,8 @@ Let `i : R → K` be a homomorphism of semirings. Assume that `K` is commutativ the image of the homomorphism `i`. -/ +@[expose] public section + open Polynomial Finset diff --git a/Mathlib/Algebra/Polynomial/Derivation.lean b/Mathlib/Algebra/Polynomial/Derivation.lean index 7c092cae102598..5534f308d66264 100644 --- a/Mathlib/Algebra/Polynomial/Derivation.lean +++ b/Mathlib/Algebra/Polynomial/Derivation.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Richard M. Hill -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Polynomial.Module.AEval -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Derivation.Basic +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Polynomial.Module.AEval +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Derivation.Basic /-! # Derivations of univariate polynomials @@ -17,6 +19,8 @@ builds a derivation from its value on `X`, and a linear equivalence `Polynomial.mkDerivationEquiv` between `A` and `Derivation (Polynomial R) A`. -/ +@[expose] public section + noncomputable section namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/Derivative.lean b/Mathlib/Algebra/Polynomial/Derivative.lean index 0fb8abb1f749b1..7b4985c4882390 100644 --- a/Mathlib/Algebra/Polynomial/Derivative.lean +++ b/Mathlib/Algebra/Polynomial/Derivative.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Domain -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Algebra.Polynomial.Eval.Coeff -import Mathlib.GroupTheory.GroupAction.Ring +module + +public import Mathlib.Algebra.Polynomial.Degree.Domain +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Algebra.Polynomial.Eval.Coeff +public import Mathlib.GroupTheory.GroupAction.Ring /-! # The derivative map on polynomials @@ -17,6 +19,8 @@ import Mathlib.GroupTheory.GroupAction.Ring -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Div.lean b/Mathlib/Algebra/Polynomial/Div.lean index 6bbf96cbde6f70..b259f75efe9f44 100644 --- a/Mathlib/Algebra/Polynomial/Div.lean +++ b/Mathlib/Algebra/Polynomial/Div.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Field.IsField -import Mathlib.Algebra.Polynomial.Inductions -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.Algebra.Ring.Regular -import Mathlib.RingTheory.Multiplicity -import Mathlib.Data.Nat.Lattice +module + +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Algebra.Polynomial.Inductions +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.RingTheory.Multiplicity +public import Mathlib.Data.Nat.Lattice /-! # Division of univariate polynomials @@ -18,6 +20,8 @@ The compatibility between these is given by `modByMonic_add_div`. We also define `rootMultiplicity`. -/ +@[expose] public section + noncomputable section open Polynomial @@ -756,7 +760,7 @@ lemma _root_.Irreducible.isRoot_eq_bot_of_natDegree_ne_one (hi : Irreducible p) (hdeg : p.natDegree ≠ 1) : p.IsRoot = ⊥ := le_bot_iff.mp fun _ ↦ hi.not_isRoot_of_natDegree_ne_one hdeg -lemma _root_.Irreducible.subsingleton_isRoot [IsLeftCancelMulZero R] [IsRightCancelAdd R] +lemma _root_.Irreducible.subsingleton_isRoot [IsLeftCancelMulZero R] (hi : Irreducible p) : { x | p.IsRoot x }.Subsingleton := fun _ hx ↦ (subsingleton_isRoot_of_natDegree_eq_one <| natDegree_eq_of_degree_eq_some <| degree_eq_one_of_irreducible_of_root hi hx) hx diff --git a/Mathlib/Algebra/Polynomial/EraseLead.lean b/Mathlib/Algebra/Polynomial/EraseLead.lean index e91347d926f1a8..138b8ef38941aa 100644 --- a/Mathlib/Algebra/Polynomial/EraseLead.lean +++ b/Mathlib/Algebra/Polynomial/EraseLead.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Alex Meiburg -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Algebra.Polynomial.Degree.Monomial +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Algebra.Polynomial.Degree.Monomial /-! # Erase the leading term of a univariate polynomial @@ -19,6 +21,8 @@ The definition is set up so that it does not mention subtraction in the definiti and thus works for polynomials over semirings as well as rings. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Eval/Algebra.lean b/Mathlib/Algebra/Polynomial/Eval/Algebra.lean index f4fbd64fc094fe..dbad325cbc43a7 100644 --- a/Mathlib/Algebra/Polynomial/Eval/Algebra.lean +++ b/Mathlib/Algebra/Polynomial/Eval/Algebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Polynomial.Eval.Defs +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Polynomial.Eval.Defs /-! # Evaluation of polynomials in an algebra @@ -14,6 +16,8 @@ This file concerns evaluating polynomials where the map is `algebraMap` TODO: merge with parts of `Algebra/Polynomial/AlgebraMap.lean`? -/ +@[expose] public section + noncomputable section open Finset AddMonoidAlgebra diff --git a/Mathlib/Algebra/Polynomial/Eval/Coeff.lean b/Mathlib/Algebra/Polynomial/Eval/Coeff.lean index 5275359a96fe2f..2e4f57169b5ff9 100644 --- a/Mathlib/Algebra/Polynomial/Eval/Coeff.lean +++ b/Mathlib/Algebra/Polynomial/Eval/Coeff.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Coeff -import Mathlib.Algebra.Polynomial.Eval.Defs +module + +public import Mathlib.Algebra.Polynomial.Coeff +public import Mathlib.Algebra.Polynomial.Eval.Defs /-! # Evaluation of polynomials @@ -12,6 +14,8 @@ import Mathlib.Algebra.Polynomial.Eval.Defs This file contains results on the interaction of `Polynomial.eval` and `Polynomial.coeff` -/ +@[expose] public section + noncomputable section open Finset AddMonoidAlgebra diff --git a/Mathlib/Algebra/Polynomial/Eval/Defs.lean b/Mathlib/Algebra/Polynomial/Eval/Defs.lean index 10857becdd9e88..be3fdefab6d085 100644 --- a/Mathlib/Algebra/Polynomial/Eval/Defs.lean +++ b/Mathlib/Algebra/Polynomial/Eval/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Group.Nat.Hom -import Mathlib.Algebra.Polynomial.Basic +module + +public import Mathlib.Algebra.Group.Nat.Hom +public import Mathlib.Algebra.Polynomial.Basic /-! # Evaluating a polynomial @@ -26,6 +28,8 @@ We include results on applying the definitions to `C`, `X` and ring operations. -/ +@[expose] public section + noncomputable section open Finset AddMonoidAlgebra diff --git a/Mathlib/Algebra/Polynomial/Eval/Degree.lean b/Mathlib/Algebra/Polynomial/Eval/Degree.lean index d4b6295a5ca603..a8639992c2c964 100644 --- a/Mathlib/Algebra/Polynomial/Eval/Degree.lean +++ b/Mathlib/Algebra/Polynomial/Eval/Degree.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Algebra.Polynomial.Degree.Units -import Mathlib.Algebra.Polynomial.Eval.Coeff +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Algebra.Polynomial.Degree.Units +public import Mathlib.Algebra.Polynomial.Eval.Coeff /-! # Evaluation of polynomials and degrees @@ -15,6 +17,8 @@ This file contains results on the interaction of `Polynomial.eval` and `Polynomi -/ +@[expose] public section + noncomputable section open Finset AddMonoidAlgebra @@ -184,7 +188,7 @@ theorem leadingCoeff_map_of_leadingCoeff_ne_zero (f : R →+* S) (hf : f (leadin theorem nextCoeff_map_of_leadingCoeff_ne_zero (f : R →+* S) (hf : f p.leadingCoeff ≠ 0) : (p.map f).nextCoeff = f p.nextCoeff := by - grind [nextCoeff, natDegree_map_of_leadingCoeff_ne_zero, coeff_map, map_zero] + grind [nextCoeff, natDegree_map_of_leadingCoeff_ne_zero, coeff_map] end Map diff --git a/Mathlib/Algebra/Polynomial/Eval/Irreducible.lean b/Mathlib/Algebra/Polynomial/Eval/Irreducible.lean index ff1a253c18b510..cd1f2077febfb9 100644 --- a/Mathlib/Algebra/Polynomial/Eval/Irreducible.lean +++ b/Mathlib/Algebra/Polynomial/Eval/Irreducible.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Eval.Coeff -import Mathlib.Algebra.Polynomial.Eval.Degree -import Mathlib.Algebra.Prime.Defs +module + +public import Mathlib.Algebra.Polynomial.Eval.Coeff +public import Mathlib.Algebra.Polynomial.Eval.Degree +public import Mathlib.Algebra.Prime.Defs /-! # Mapping irreducible polynomials @@ -16,6 +18,8 @@ import Mathlib.Algebra.Prime.Defs by mapping it to another integral domain and checking for irreducibility there. -/ +@[expose] public section + noncomputable section open Finset AddMonoidAlgebra diff --git a/Mathlib/Algebra/Polynomial/Eval/SMul.lean b/Mathlib/Algebra/Polynomial/Eval/SMul.lean index be233a2b07ec71..52d1055d9bf4c4 100644 --- a/Mathlib/Algebra/Polynomial/Eval/SMul.lean +++ b/Mathlib/Algebra/Polynomial/Eval/SMul.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Algebra.Polynomial.Eval.Defs +module + +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Algebra.Polynomial.Eval.Defs /-! # Evaluating polynomials and scalar multiplication @@ -15,6 +17,8 @@ import Mathlib.Algebra.Polynomial.Eval.Defs -/ +@[expose] public section + noncomputable section open Finset AddMonoidAlgebra diff --git a/Mathlib/Algebra/Polynomial/Eval/Subring.lean b/Mathlib/Algebra/Polynomial/Eval/Subring.lean index e4bb9e8b004cd9..4302ea1ccac0f2 100644 --- a/Mathlib/Algebra/Polynomial/Eval/Subring.lean +++ b/Mathlib/Algebra/Polynomial/Eval/Subring.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Algebra.Polynomial.Eval.Coeff -import Mathlib.Algebra.Ring.Subring.Basic +module + +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Algebra.Polynomial.Eval.Coeff +public import Mathlib.Algebra.Ring.Subring.Basic /-! # Evaluation of polynomials in subrings @@ -17,6 +19,8 @@ import Mathlib.Algebra.Ring.Subring.Basic -/ +@[expose] public section + namespace Polynomial universe u v w y diff --git a/Mathlib/Algebra/Polynomial/Expand.lean b/Mathlib/Algebra/Polynomial/Expand.lean index 130415f60eac51..a8061412d485dc 100644 --- a/Mathlib/Algebra/Polynomial/Expand.lean +++ b/Mathlib/Algebra/Polynomial/Expand.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.CharP.Frobenius -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Polynomial.RingDivision -import Mathlib.RingTheory.Polynomial.Basic +module + +public import Mathlib.Algebra.CharP.Frobenius +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Polynomial.RingDivision +public import Mathlib.RingTheory.Polynomial.Basic /-! # Expand a polynomial by a factor of p, so `∑ aₙ xⁿ` becomes `∑ aₙ xⁿᵖ`. @@ -19,6 +21,8 @@ import Mathlib.RingTheory.Polynomial.Basic -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Polynomial/Factors.lean b/Mathlib/Algebra/Polynomial/Factors.lean index 3aba4e0cbfcd08..d7b6219d5d570f 100644 --- a/Mathlib/Algebra/Polynomial/Factors.lean +++ b/Mathlib/Algebra/Polynomial/Factors.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Polynomial.FieldDivision +module + +public import Mathlib.Algebra.Polynomial.FieldDivision /-! # Split polynomials @@ -21,6 +23,8 @@ A polynomial `f : R[X]` factors if it is a product of constant and monic linear -/ +@[expose] public section + variable {R : Type*} namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/FieldDivision.lean b/Mathlib/Algebra/Polynomial/FieldDivision.lean index 96e36bf0b5c882..d11027844fa2ab 100644 --- a/Mathlib/Algebra/Polynomial/FieldDivision.lean +++ b/Mathlib/Algebra/Polynomial/FieldDivision.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Order.Group.Finset -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.RingTheory.EuclideanDomain -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.Algebra.Order.Group.Finset +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.RingTheory.EuclideanDomain +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Theory of univariate polynomials @@ -17,6 +19,8 @@ This file starts looking like the ring theory of $R[X]$ -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/GroupRingAction.lean b/Mathlib/Algebra/Polynomial/GroupRingAction.lean index beca6bcff08f38..193b27f7501620 100644 --- a/Mathlib/Algebra/Polynomial/GroupRingAction.lean +++ b/Mathlib/Algebra/Polynomial/GroupRingAction.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.GroupTheory.Coset.Card -import Mathlib.GroupTheory.GroupAction.Hom -import Mathlib.GroupTheory.GroupAction.Quotient +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.GroupTheory.Coset.Card +public import Mathlib.GroupTheory.GroupAction.Hom +public import Mathlib.GroupTheory.GroupAction.Quotient /-! # Group action on rings applied to polynomials @@ -16,6 +18,8 @@ import Mathlib.GroupTheory.GroupAction.Quotient This file contains instances and definitions relating `MulSemiringAction` to `Polynomial`. -/ +@[expose] public section + variable (M : Type*) [Monoid M] diff --git a/Mathlib/Algebra/Polynomial/HasseDeriv.lean b/Mathlib/Algebra/Polynomial/HasseDeriv.lean index 2fc29ef482c9bd..cba1cba766330f 100644 --- a/Mathlib/Algebra/Polynomial/HasseDeriv.lean +++ b/Mathlib/Algebra/Polynomial/HasseDeriv.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.BigOperators -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Data.Nat.Choose.Cast -import Mathlib.Data.Nat.Choose.Vandermonde -import Mathlib.Tactic.Field -import Mathlib.Tactic.Positivity +module + +public import Mathlib.Algebra.Polynomial.BigOperators +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Data.Nat.Choose.Cast +public import Mathlib.Data.Nat.Choose.Vandermonde +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.Positivity /-! # Hasse derivative of polynomials @@ -39,6 +41,8 @@ https://math.fontein.de/2009/08/12/the-hasse-derivative/ -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Homogenize.lean b/Mathlib/Algebra/Polynomial/Homogenize.lean index 4fe6eedbdf99d4..5b7d8806b7bfce 100644 --- a/Mathlib/Algebra/Polynomial/Homogenize.lean +++ b/Mathlib/Algebra/Polynomial/Homogenize.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Concordance Inc. dba Harmonic. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Finsupp.Notation -import Mathlib.RingTheory.MvPolynomial.Homogeneous +module + +public import Mathlib.Data.Finsupp.Notation +public import Mathlib.RingTheory.MvPolynomial.Homogeneous /-! # Homogenize a univariate polynomial @@ -21,6 +23,8 @@ because Mathlib has a theory about homogeneous multivariate polynomials, but not about homogeneous bivariate polynomials encoded as `R[X][Y]`. -/ +@[expose] public section + open Finset namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/Identities.lean b/Mathlib/Algebra/Polynomial/Identities.lean index b5cddbeb6f597d..9e79bfbc540184 100644 --- a/Mathlib/Algebra/Polynomial/Identities.lean +++ b/Mathlib/Algebra/Polynomial/Identities.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.Ring /-! # Theory of univariate polynomials @@ -13,6 +15,8 @@ import Mathlib.Tactic.Ring The main def is `Polynomial.binomExpansion`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Inductions.lean b/Mathlib/Algebra/Polynomial/Inductions.lean index fcb66b4f2d50b2..8ccb749f0e25b7 100644 --- a/Mathlib/Algebra/Polynomial/Inductions.lean +++ b/Mathlib/Algebra/Polynomial/Inductions.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Damiano Testa, Jens Wagemaker -/ -import Mathlib.Algebra.MonoidAlgebra.Division -import Mathlib.Algebra.Polynomial.Degree.Operations -import Mathlib.Algebra.Polynomial.EraseLead -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Algebra.MonoidAlgebra.Division +public import Mathlib.Algebra.Polynomial.Degree.Operations +public import Mathlib.Algebra.Polynomial.EraseLead +public import Mathlib.Order.Interval.Finset.Nat /-! # Induction on polynomials @@ -14,6 +16,8 @@ import Mathlib.Order.Interval.Finset.Nat This file contains lemmas dealing with different flavours of induction on polynomials. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Laurent.lean b/Mathlib/Algebra/Polynomial/Laurent.lean index 90af82775a7688..25c5ddc348aa4a 100644 --- a/Mathlib/Algebra/Polynomial/Laurent.lean +++ b/Mathlib/Algebra/Polynomial/Laurent.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Reverse -import Mathlib.Algebra.Polynomial.Inductions -import Mathlib.RingTheory.Localization.Away.Basic +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Reverse +public import Mathlib.Algebra.Polynomial.Inductions +public import Mathlib.RingTheory.Localization.Away.Basic /-! # Laurent polynomials @@ -67,6 +69,8 @@ Lots is missing! -- Add `degree, intDegree, intTrailingDegree, leadingCoeff, trailingCoeff,...`. -/ +@[expose] public section + open Polynomial Function AddMonoidAlgebra Finsupp diff --git a/Mathlib/Algebra/Polynomial/Lifts.lean b/Mathlib/Algebra/Polynomial/Lifts.lean index 27f0a6f64de314..5d277b9bd4a320 100644 --- a/Mathlib/Algebra/Polynomial/Lifts.lean +++ b/Mathlib/Algebra/Polynomial/Lifts.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Eval.Subring -import Mathlib.Algebra.Polynomial.Monic +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Eval.Subring +public import Mathlib.Algebra.Polynomial.Monic /-! # Polynomials that lift @@ -39,6 +41,8 @@ that lift is a subalgebra. (By `lift_iff` this is true if `R` is commutative.) -/ +@[expose] public section + open Polynomial diff --git a/Mathlib/Algebra/Polynomial/Mirror.lean b/Mathlib/Algebra/Polynomial/Mirror.lean index 804488801b7dca..22d1a02dec67ab 100644 --- a/Mathlib/Algebra/Polynomial/Mirror.lean +++ b/Mathlib/Algebra/Polynomial/Mirror.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.BigOperators.NatAntidiagonal -import Mathlib.Algebra.Polynomial.Reverse +module + +public import Mathlib.Algebra.BigOperators.NatAntidiagonal +public import Mathlib.Algebra.Polynomial.Reverse /-! # "Mirror" of a univariate polynomial @@ -24,6 +26,8 @@ divisible by `X`. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/Module/AEval.lean b/Mathlib/Algebra/Polynomial/Module/AEval.lean index 13a7024fa94069..9f01121714dad5 100644 --- a/Mathlib/Algebra/Polynomial/Module/AEval.lean +++ b/Mathlib/Algebra/Polynomial/Module/AEval.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Richard M. Hill. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Richard M. Hill -/ -import Mathlib.Algebra.Module.Submodule.Invariant -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.Algebra.Module.Submodule.Invariant +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Ideal.Maps /-! # Action of the polynomial ring on module induced by an algebra element. @@ -21,6 +23,8 @@ In the special case that `A = M →ₗ[R] M` and `φ : M →ₗ[R] M`, the modul abbreviated `Module.AEval' φ`. In this module we have `X • m = ↑φ m`. -/ +@[expose] public section + open Set Function Polynomial namespace Module diff --git a/Mathlib/Algebra/Polynomial/Module/Basic.lean b/Mathlib/Algebra/Polynomial/Module/Basic.lean index f87cb166ef21bd..932ab60092ce3a 100644 --- a/Mathlib/Algebra/Polynomial/Module/Basic.lean +++ b/Mathlib/Algebra/Polynomial/Module/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Polynomial.Module.AEval +module + +public import Mathlib.Algebra.Polynomial.Module.AEval /-! # Polynomial module @@ -13,6 +15,8 @@ In this file, we define the polynomial module for an `R`-module `M`, i.e. the `R This is defined as a type alias `PolynomialModule R M := ℕ →₀ M`, since there might be different module structures on `ℕ →₀ M` of interest. See the docstring of `PolynomialModule` for details. -/ + +@[expose] public section universe u v open Polynomial diff --git a/Mathlib/Algebra/Polynomial/Module/FiniteDimensional.lean b/Mathlib/Algebra/Polynomial/Module/FiniteDimensional.lean index 268fb601540a5c..bb78e9f09b91f3 100644 --- a/Mathlib/Algebra/Polynomial/Module/FiniteDimensional.lean +++ b/Mathlib/Algebra/Polynomial/Module/FiniteDimensional.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.FieldTheory.Minpoly.Field -import Mathlib.Algebra.Polynomial.Module.AEval -import Mathlib.Algebra.Module.Torsion.Basic +module + +public import Mathlib.FieldTheory.Minpoly.Field +public import Mathlib.Algebra.Polynomial.Module.AEval +public import Mathlib.Algebra.Module.Torsion.Basic /-! # Polynomial modules in finite dimensions @@ -19,6 +21,8 @@ by an `R`-linear endomorphism, which require the concept of finite-dimensionalit -/ +@[expose] public section + open Polynomial variable {R K M A : Type*} {a : A} diff --git a/Mathlib/Algebra/Polynomial/Module/TensorProduct.lean b/Mathlib/Algebra/Polynomial/Module/TensorProduct.lean index ce3d886b19fa5c..ae49ac109a421b 100644 --- a/Mathlib/Algebra/Polynomial/Module/TensorProduct.lean +++ b/Mathlib/Algebra/Polynomial/Module/TensorProduct.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 George McNinch. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: George McNinch -/ +module -import Mathlib.Algebra.Polynomial.Module.Basic -import Mathlib.RingTheory.TensorProduct.Basic +public import Mathlib.Algebra.Polynomial.Module.Basic +public import Mathlib.RingTheory.TensorProduct.Basic /-! # PolynomialModule is isomorphic to a tensor product @@ -15,6 +16,8 @@ For a commutative ring `R` and an `R`-module `M`, we obtain an isomorphism betwe `polynomialTensorProductLEquivPolynomialModule`. -/ +@[expose] public section + open Polynomial TensorProduct LinearMap noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Monic.lean b/Mathlib/Algebra/Polynomial/Monic.lean index 1f6a208792ccff..aba2254640d10f 100644 --- a/Mathlib/Algebra/Polynomial/Monic.lean +++ b/Mathlib/Algebra/Polynomial/Monic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.Reverse -import Mathlib.Algebra.Regular.SMul +module + +public import Mathlib.Algebra.Polynomial.Reverse +public import Mathlib.Algebra.Regular.SMul /-! # Theory of monic polynomials @@ -13,6 +15,8 @@ We give several tools for proving that polynomials are monic, e.g. `Monic.mul`, `Monic.map`, `Monic.pow`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Monomial.lean b/Mathlib/Algebra/Polynomial/Monomial.lean index 9f569ab4415671..155f12d78dde02 100644 --- a/Mathlib/Algebra/Polynomial/Monomial.lean +++ b/Mathlib/Algebra/Polynomial/Monomial.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Group.Nat.Hom -import Mathlib.Algebra.Polynomial.Basic +module + +public import Mathlib.Algebra.Group.Nat.Hom +public import Mathlib.Algebra.Polynomial.Basic /-! # Univariate monomials -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/OfFn.lean b/Mathlib/Algebra/Polynomial/OfFn.lean index 5c859edf1a6f46..d1808a252eea76 100644 --- a/Mathlib/Algebra/Polynomial/OfFn.lean +++ b/Mathlib/Algebra/Polynomial/OfFn.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Data.List.ToFinsupp -import Mathlib.LinearAlgebra.Pi +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Data.List.ToFinsupp +public import Mathlib.LinearAlgebra.Pi /-! # `Polynomial.ofFn` and `Polynomial.toFn` @@ -20,6 +22,8 @@ of its coefficients and vice versa. We prove some basic APIs for these functions the vector as coefficients. -/ +@[expose] public section + namespace Polynomial section toFn diff --git a/Mathlib/Algebra/Polynomial/PartialFractions.lean b/Mathlib/Algebra/Polynomial/PartialFractions.lean index 4b774dea885767..ac8adb78bc2954 100644 --- a/Mathlib/Algebra/Polynomial/PartialFractions.lean +++ b/Mathlib/Algebra/Polynomial/PartialFractions.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Sidharth Hariharan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Sidharth Hariharan -/ -import Mathlib.Algebra.Polynomial.Div -import Mathlib.Logic.Function.Basic -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.Logic.Function.Basic +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.LinearCombination /-! @@ -18,7 +20,7 @@ These results were formalised by the Xena Project, at the suggestion of Patrick Massot. -# The main theorem +## The main theorem * `div_eq_quo_add_sum_rem_div`: General partial fraction decomposition theorem for polynomials over an integral domain R : @@ -40,6 +42,8 @@ of Patrick Massot. -/ +@[expose] public section + variable (R : Type*) [CommRing R] [IsDomain R] diff --git a/Mathlib/Algebra/Polynomial/Reverse.lean b/Mathlib/Algebra/Polynomial/Reverse.lean index abebf3733ff69a..f5f897981043f5 100644 --- a/Mathlib/Algebra/Polynomial/Reverse.lean +++ b/Mathlib/Algebra/Polynomial/Reverse.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Polynomial.Degree.TrailingDegree -import Mathlib.Algebra.Polynomial.EraseLead +module + +public import Mathlib.Algebra.Polynomial.Degree.TrailingDegree +public import Mathlib.Algebra.Polynomial.EraseLead /-! # Reverse of a univariate polynomial @@ -16,6 +18,8 @@ The main result is that `reverse (f * g) = reverse f * reverse g`, provided the coefficients of `f` and `g` do not multiply to zero. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/Algebra/Polynomial/RingDivision.lean b/Mathlib/Algebra/Polynomial/RingDivision.lean index 2f14f469e948b7..85ea6633578cb1 100644 --- a/Mathlib/Algebra/Polynomial/RingDivision.lean +++ b/Mathlib/Algebra/Polynomial/RingDivision.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker, Johan Commelin -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Div -import Mathlib.RingTheory.Coprime.Basic +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.RingTheory.Coprime.Basic /-! # Theory of univariate polynomials @@ -14,6 +16,8 @@ We prove basic results about univariate polynomials. -/ +@[expose] public section + assert_not_exists Ideal.map noncomputable section diff --git a/Mathlib/Algebra/Polynomial/Roots.lean b/Mathlib/Algebra/Polynomial/Roots.lean index 318aaad94a3d17..e672d18ff19f19 100644 --- a/Mathlib/Algebra/Polynomial/Roots.lean +++ b/Mathlib/Algebra/Polynomial/Roots.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker, Johan Commelin -/ -import Mathlib.Algebra.Polynomial.BigOperators -import Mathlib.Algebra.Polynomial.RingDivision -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.SetTheory.Cardinal.Order +module + +public import Mathlib.Algebra.Polynomial.BigOperators +public import Mathlib.Algebra.Polynomial.RingDivision +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.SetTheory.Cardinal.Order /-! # Theory of univariate polynomials @@ -29,6 +31,8 @@ We define the multiset of roots of a polynomial, and prove basic results about i -/ +@[expose] public section + assert_not_exists Ideal open Multiset Finset diff --git a/Mathlib/Algebra/Polynomial/RuleOfSigns.lean b/Mathlib/Algebra/Polynomial/RuleOfSigns.lean index 5ea5749f9d249f..6a1f9b3a69c22c 100644 --- a/Mathlib/Algebra/Polynomial/RuleOfSigns.lean +++ b/Mathlib/Algebra/Polynomial/RuleOfSigns.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Alex Meiburg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Meiburg -/ -import Mathlib.Algebra.Polynomial.CoeffList -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Data.List.Destutter -import Mathlib.Data.Sign.Basic +module + +public import Mathlib.Algebra.Polynomial.CoeffList +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Data.List.Destutter +public import Mathlib.Data.Sign.Basic /-! @@ -36,6 +38,8 @@ coefficient, or vice versa, with any number of zero coefficients in between. [Wikipedia: Descartes' Rule of Signs](https://en.wikipedia.org/wiki/Descartes%27_rule_of_signs) -/ +@[expose] public section + namespace Polynomial section Semiring @@ -265,7 +269,7 @@ private lemma exists_cons_of_leadingCoeff_pos (η) (h₁ : 0 < leadingCoeff P) ( grind [X_mul_monomial, sub_mul, mul_sub, self_sub_monomial_natDegree_leadingCoeff, natDegree_eraseLead_add_one, leadingCoeff_eraseLead_eq_nextCoeff] rw [nextCoeff_of_natDegree_pos (h₇ ▸ P.natDegree.succ_pos), h₇] at h₉ - grind [coeff_X_sub_C_mul, map_sub, C_mul_monomial, nextCoeff_of_natDegree_pos, leadingCoeff] + grind [coeff_X_sub_C_mul, C_mul_monomial, nextCoeff_of_natDegree_pos, leadingCoeff] · rw [h_cons, leadingCoeff_mul, leadingCoeff_X_sub_C, one_mul, h₂] /-- If a polynomial starts with two positive coefficients, then the sign changes in the product diff --git a/Mathlib/Algebra/Polynomial/Sequence.lean b/Mathlib/Algebra/Polynomial/Sequence.lean index b2bc62b29a4fba..374d423b775382 100644 --- a/Mathlib/Algebra/Polynomial/Sequence.lean +++ b/Mathlib/Algebra/Polynomial/Sequence.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Julian Berman. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Hill, Julian Berman, Austin Letson, Matej Penciak -/ -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.LinearAlgebra.Basis.Basic +module + +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.LinearAlgebra.Basis.Basic /-! @@ -29,6 +31,8 @@ Generalize linear independence to: * arbitrary sets of polynomials which are pairwise different degree. -/ +@[expose] public section + open Module Submodule open scoped Function diff --git a/Mathlib/Algebra/Polynomial/Smeval.lean b/Mathlib/Algebra/Polynomial/Smeval.lean index 715fbdb461d8f5..4d11e559bdfc26 100644 --- a/Mathlib/Algebra/Polynomial/Smeval.lean +++ b/Mathlib/Algebra/Polynomial/Smeval.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Group.NatPowAssoc -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Eval.SMul +module + +public import Mathlib.Algebra.Group.NatPowAssoc +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Eval.SMul /-! # Scalar-multiple polynomial evaluation @@ -37,6 +39,8 @@ is a generalization of `Algebra.Polynomial.Eval`. -/ +@[expose] public section + namespace Polynomial section MulActionWithZero diff --git a/Mathlib/Algebra/Polynomial/SpecificDegree.lean b/Mathlib/Algebra/Polynomial/SpecificDegree.lean index 58dd4b35c9458b..665a1ae3af4783 100644 --- a/Mathlib/Algebra/Polynomial/SpecificDegree.lean +++ b/Mathlib/Algebra/Polynomial/SpecificDegree.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best -/ -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Tactic.IntervalCases -import Mathlib.Algebra.Polynomial.FieldDivision +module + +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Tactic.IntervalCases +public import Mathlib.Algebra.Polynomial.FieldDivision /-! # Polynomials of specific degree @@ -13,6 +15,8 @@ import Mathlib.Algebra.Polynomial.FieldDivision Facts about polynomials that have a specific integer degree. -/ +@[expose] public section + namespace Polynomial section IsDomain diff --git a/Mathlib/Algebra/Polynomial/Splits.lean b/Mathlib/Algebra/Polynomial/Splits.lean index ede678b5d2305d..eb3a43191b5b49 100644 --- a/Mathlib/Algebra/Polynomial/Splits.lean +++ b/Mathlib/Algebra/Polynomial/Splits.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Polynomial.Factors -import Mathlib.Algebra.Polynomial.Lifts -import Mathlib.RingTheory.Polynomial.Tower +module + +public import Mathlib.Algebra.Polynomial.Factors +public import Mathlib.Algebra.Polynomial.Lifts +public import Mathlib.RingTheory.Polynomial.Tower /-! # Split polynomials @@ -20,6 +22,8 @@ irreducible factors over `L` have degree `1`. -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/Algebra/Polynomial/SumIteratedDerivative.lean b/Mathlib/Algebra/Polynomial/SumIteratedDerivative.lean index e7cf6c4b3ab5f7..0c8b0a0d3f8267 100644 --- a/Mathlib/Algebra/Polynomial/SumIteratedDerivative.lean +++ b/Mathlib/Algebra/Polynomial/SumIteratedDerivative.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.BigOperators -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Polynomial.Eval.SMul +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.BigOperators +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Polynomial.Eval.SMul /-! # Sum of iterated derivatives @@ -35,6 +37,8 @@ as a linear map. This is used in particular in the proof of the Lindemann-Weiers -/ +@[expose] public section + open Finset open scoped Nat diff --git a/Mathlib/Algebra/Polynomial/Taylor.lean b/Mathlib/Algebra/Polynomial/Taylor.lean index 67fd1aa0be7024..6615eac0b97a02 100644 --- a/Mathlib/Algebra/Polynomial/Taylor.lean +++ b/Mathlib/Algebra/Polynomial/Taylor.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.Algebra.Polynomial.HasseDeriv +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.Algebra.Polynomial.HasseDeriv /-! # Taylor expansions of polynomials @@ -21,6 +23,8 @@ import Mathlib.Algebra.Polynomial.HasseDeriv -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/Polynomial/UnitTrinomial.lean b/Mathlib/Algebra/Polynomial/UnitTrinomial.lean index 2637e1f9a2f387..61054d6a09bad2 100644 --- a/Mathlib/Algebra/Polynomial/UnitTrinomial.lean +++ b/Mathlib/Algebra/Polynomial/UnitTrinomial.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Polynomial.Mirror -import Mathlib.Algebra.Ring.Regular -import Mathlib.Data.Int.Order.Units -import Mathlib.RingTheory.Coprime.Basic +module + +public import Mathlib.Algebra.Polynomial.Mirror +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.Data.Int.Order.Units +public import Mathlib.RingTheory.Coprime.Basic /-! # Unit Trinomials @@ -24,6 +26,8 @@ This file defines irreducible trinomials and proves an irreducibility criterion. -/ +@[expose] public section + assert_not_exists TopologicalSpace namespace Polynomial diff --git a/Mathlib/Algebra/PresentedMonoid/Basic.lean b/Mathlib/Algebra/PresentedMonoid/Basic.lean index 2f9bb1cad4a4bf..9cd7c7514515a6 100644 --- a/Mathlib/Algebra/PresentedMonoid/Basic.lean +++ b/Mathlib/Algebra/PresentedMonoid/Basic.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Hannah Fechtner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hannah Fechtner -/ +module -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.GroupTheory.Congruence.Hom +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.GroupTheory.Congruence.Hom /-! # Defining a monoid given by generators and relations @@ -27,6 +28,8 @@ given by generators `x : α` and relations `rels`. generators, relations, monoid presentations -/ +@[expose] public section + variable {α : Type*} /-- Given a set of relations, `rels`, over a type `α`, `PresentedMonoid` constructs the monoid with diff --git a/Mathlib/Algebra/Prime/Defs.lean b/Mathlib/Algebra/Prime/Defs.lean index 5acfadb9e964d9..fe5d892ad37c83 100644 --- a/Mathlib/Algebra/Prime/Defs.lean +++ b/Mathlib/Algebra/Prime/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker -/ -import Mathlib.Algebra.Group.Irreducible.Defs -import Mathlib.Algebra.GroupWithZero.Divisibility +module + +public import Mathlib.Algebra.Group.Irreducible.Defs +public import Mathlib.Algebra.GroupWithZero.Divisibility /-! # Prime elements @@ -26,6 +28,8 @@ In decomposition monoids (e.g., `ℕ`, `ℤ`), this predicate is equivalent to ` * `irreducible_iff_prime`: the two definitions are equivalent in a decomposition monoid. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset variable {M : Type*} diff --git a/Mathlib/Algebra/Prime/Lemmas.lean b/Mathlib/Algebra/Prime/Lemmas.lean index 3ad5f094c047fa..ebe515db5368c2 100644 --- a/Mathlib/Algebra/Prime/Lemmas.lean +++ b/Mathlib/Algebra/Prime/Lemmas.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker -/ -import Mathlib.Algebra.Divisibility.Hom -import Mathlib.Algebra.Group.Irreducible.Lemmas -import Mathlib.Algebra.GroupWithZero.Equiv -import Mathlib.Algebra.Prime.Defs -import Mathlib.Order.Monotone.Defs +module + +public import Mathlib.Algebra.Divisibility.Hom +public import Mathlib.Algebra.Group.Irreducible.Lemmas +public import Mathlib.Algebra.GroupWithZero.Equiv +public import Mathlib.Algebra.Prime.Defs +public import Mathlib.Order.Monotone.Defs /-! # Associated, prime, and irreducible elements. @@ -26,6 +28,8 @@ Then we show that the quotient type `Associates` is a monoid and prove basic properties of this quotient. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset variable {M N : Type*} diff --git a/Mathlib/Algebra/QuadraticAlgebra.lean b/Mathlib/Algebra/QuadraticAlgebra.lean index 5346bcd3eb7522..9b027a39058f8d 100644 --- a/Mathlib/Algebra/QuadraticAlgebra.lean +++ b/Mathlib/Algebra/QuadraticAlgebra.lean @@ -1,471 +1,5 @@ -/- -Copyright (c) 2025 Kenny Lau. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Yunzhou Xie, Kenny Lau, Jiayang Hong --/ +module -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.Algebra.QuadraticAlgebra.Defs -/-! - -# Quadratic Algebra - -In this file we define the quadratic algebra `QuadraticAlgebra R a b` over a commutative ring `R`, -and define some algebraic structures on it. - -## Main definitions - -* `QuadraticAlgebra R a b`: - [Bourbaki, *Algebra I*][bourbaki1989] with coefficients `a`, `b` in `R`. - -## Tags - -Quadratic algebra, quadratic extension - --/ - -universe u - -/-- Quadratic algebra over a type with fixed coefficient where $i^2 = a + bi$, implemented as -a structure with two fields, `re` and `im`. When `R` is a commutative ring, this is isomorphic to -`R[X]/(X^2-b*X-a)`. -/ -@[ext] -structure QuadraticAlgebra (R : Type u) (a b : R) : Type u where - /-- Real part of an element in quadratic algebra -/ - re : R - /-- Imaginary part of an element in quadratic algebra -/ - im : R -deriving DecidableEq - -initialize_simps_projections QuadraticAlgebra (as_prefix re, as_prefix im) - -variable {R : Type*} -namespace QuadraticAlgebra - -/-- The equivalence between quadratic algebra over `R` and `R × R`. -/ -@[simps symm_apply] -def equivProd (a b : R) : QuadraticAlgebra R a b ≃ R × R where - toFun z := (z.re, z.im) - invFun p := ⟨p.1, p.2⟩ - -@[simp] -theorem mk_eta {a b} (z : QuadraticAlgebra R a b) : - mk z.re z.im = z := rfl - -variable {S T : Type*} {a b} (r : R) (x y : QuadraticAlgebra R a b) - -instance [Subsingleton R] : Subsingleton (QuadraticAlgebra R a b) := (equivProd a b).subsingleton - -instance [Nontrivial R] : Nontrivial (QuadraticAlgebra R a b) := (equivProd a b).nontrivial - -section Zero -variable [Zero R] - -/-- Coercion `R → QuadraticAlgebra R a b`. -/ -@[coe] def coe (x : R) : QuadraticAlgebra R a b := ⟨x, 0⟩ - -instance : Coe R (QuadraticAlgebra R a b) := ⟨coe⟩ - -@[simp, norm_cast] -theorem re_coe : (r : QuadraticAlgebra R a b).re = r := rfl - -@[simp, norm_cast] -theorem im_coe : (r : QuadraticAlgebra R a b).im = 0 := rfl - -theorem coe_injective : Function.Injective (coe : R → QuadraticAlgebra R a b) := - fun _ _ h => congr_arg re h - -@[simp] -theorem coe_inj {x y : R} : (x : QuadraticAlgebra R a b) = y ↔ x = y := - coe_injective.eq_iff - -instance : Zero (QuadraticAlgebra R a b) := ⟨⟨0, 0⟩⟩ - -@[simp] theorem re_zero : (0 : QuadraticAlgebra R a b).re = 0 := rfl - -@[simp] theorem im_zero : (0 : QuadraticAlgebra R a b).im = 0 := rfl - -@[simp, norm_cast] -theorem coe_zero : ((0 : R) : QuadraticAlgebra R a b) = 0 := rfl - -@[simp] -theorem coe_eq_zero_iff {r : R} : (r : QuadraticAlgebra R a b) = 0 ↔ r = 0 := by - rw [← coe_zero, coe_inj] - -instance : Inhabited (QuadraticAlgebra R a b) := ⟨0⟩ - -section One -variable [One R] - -instance : One (QuadraticAlgebra R a b) := ⟨⟨1, 0⟩⟩ - -@[scoped simp] theorem re_one : (1 : QuadraticAlgebra R a b).re = 1 := rfl - -@[scoped simp] theorem im_one : (1 : QuadraticAlgebra R a b).im = 0 := rfl - -@[simp, norm_cast] -theorem coe_one : ((1 : R) : QuadraticAlgebra R a b) = 1 := rfl - -@[simp] -theorem coe_eq_one_iff {r : R} : (r : QuadraticAlgebra R a b) = 1 ↔ r = 1 := by - rw [← coe_one, coe_inj] - -end One - -end Zero - -section Add -variable [Add R] - -instance : Add (QuadraticAlgebra R a b) where - add z w := ⟨z.re + w.re, z.im + w.im⟩ - -@[simp] theorem re_add (z w : QuadraticAlgebra R a b) : - (z + w).re = z.re + w.re := rfl - -@[simp] theorem im_add (z w : QuadraticAlgebra R a b) : - (z + w).im = z.im + w.im := rfl - -@[simp] -theorem mk_add_mk (z w : QuadraticAlgebra R a b) : - mk z.re z.im + mk w.re w.im = (mk (z.re + w.re) (z.im + w.im) : QuadraticAlgebra R a b) := rfl - -end Add - -section AddZeroClass -variable [AddZeroClass R] - -@[simp] -theorem coe_add (x y : R) : ((x + y : R) : QuadraticAlgebra R a b) = x + y := by ext <;> simp - -end AddZeroClass - -section Neg -variable [Neg R] - -instance : Neg (QuadraticAlgebra R a b) where neg z := ⟨-z.re, -z.im⟩ - -@[simp] theorem re_neg (z : QuadraticAlgebra R a b) : (-z).re = -z.re := rfl - -@[simp] theorem im_neg (z : QuadraticAlgebra R a b) : (-z).im = -z.im := rfl - -@[simp] -theorem neg_mk (x y : R) : - - (mk x y : QuadraticAlgebra R a b) = ⟨-x, -y⟩ := rfl - -end Neg - -section AddGroup - -@[simp] -theorem coe_neg [NegZeroClass R] (x : R) : - ((-x : R) : QuadraticAlgebra R a b) = -x := by ext <;> simp - -instance [Sub R] : Sub (QuadraticAlgebra R a b) where - sub z w := ⟨z.re - w.re, z.im - w.im⟩ - -@[simp] theorem re_sub [Sub R] (z w : QuadraticAlgebra R a b) : - (z - w).re = z.re - w.re := rfl - -@[simp] theorem im_sub [Sub R] (z w : QuadraticAlgebra R a b) : - (z - w).im = z.im - w.im := rfl - -@[simp] -theorem mk_sub_mk [Sub R] (x1 y1 x2 y2 : R) : - (mk x1 y1 : QuadraticAlgebra R a b) - mk x2 y2 = mk (x1 - x2) (y1 - y2) := rfl - -@[norm_cast, simp] -theorem coe_sub (r1 r2 : R) [SubNegZeroMonoid R] : - ((r1 - r2 : R) : QuadraticAlgebra R a b) = r1 - r2 := - QuadraticAlgebra.ext rfl zero_sub_zero.symm - -end AddGroup - -section Mul -variable [Mul R] [Add R] - -instance : Mul (QuadraticAlgebra R a b) where - mul z w := ⟨z.1 * w.1 + a * z.2 * w.2, z.1 * w.2 + z.2 * w.1 + b * z.2 * w.2⟩ - -@[simp] theorem re_mul (z w : QuadraticAlgebra R a b) : - (z * w).re = z.re * w.re + a * z.im * w.im := rfl - -@[simp] theorem im_mul (z w : QuadraticAlgebra R a b) : - (z * w).im = z.re * w.im + z.im * w.re + b * z.im * w.im := rfl - -@[simp] -theorem mk_mul_mk (x1 y1 x2 y2 : R) : - (mk x1 y1 : QuadraticAlgebra R a b) * mk x2 y2 = - mk (x1 * x2 + a * y1 * y2) (x1 * y2 + y1 * x2 + b * y1 * y2) := rfl - -end Mul - -section SMul -variable [SMul S R] [SMul T R] (s : S) - -instance : SMul S (QuadraticAlgebra R a b) where smul s z := ⟨s • z.re, s • z.im⟩ - -instance [SMul S T] [IsScalarTower S T R] : IsScalarTower S T (QuadraticAlgebra R a b) where - smul_assoc s t z := by ext <;> exact smul_assoc _ _ _ - -instance [SMulCommClass S T R] : SMulCommClass S T (QuadraticAlgebra R a b) where - smul_comm s t z := by ext <;> exact smul_comm _ _ _ - -instance [SMul Sᵐᵒᵖ R] [IsCentralScalar S R] : IsCentralScalar S (QuadraticAlgebra R a b) where - op_smul_eq_smul s z := by ext <;> exact op_smul_eq_smul _ _ - -@[simp] theorem re_smul (s : S) (z : QuadraticAlgebra R a b) : (s • z).re = s • z.re := rfl - -@[simp] theorem im_smul (s : S) (z : QuadraticAlgebra R a b) : (s • z).im = s • z.im := rfl - -@[simp] -theorem smul_mk (s : S) (x y : R) : - s • (mk x y : QuadraticAlgebra R a b) = mk (s • x) (s • y) := rfl - -end SMul - -section MulAction - -instance [Monoid S] [MulAction S R] : MulAction S (QuadraticAlgebra R a b) where - one_smul _ := by ext <;> simp - mul_smul _ _ _ := by ext <;> simp [mul_smul] - -end MulAction - -@[simp, norm_cast] -theorem coe_smul [Zero R] [SMulZeroClass S R] (s : S) (r : R) : - (↑(s • r) : QuadraticAlgebra R a b) = s • (r : QuadraticAlgebra R a b) := - QuadraticAlgebra.ext rfl (smul_zero _).symm - -instance [AddMonoid R] : AddMonoid (QuadraticAlgebra R a b) := fast_instance% by - refine (equivProd a b).injective.addMonoid _ rfl ?_ ?_ <;> intros <;> rfl - -instance [Monoid S] [AddMonoid R] [DistribMulAction S R] : - DistribMulAction S (QuadraticAlgebra R a b) where - smul_zero _ := by ext <;> simp - smul_add _ _ _ := by ext <;> simp - -instance [AddCommMonoid R] : AddCommMonoid (QuadraticAlgebra R a b) := fast_instance% by - refine (equivProd a b).injective.addCommMonoid _ rfl ?_ ?_ <;> intros <;> rfl - -instance [Semiring S] [AddCommMonoid R] [Module S R] : Module S (QuadraticAlgebra R a b) where - add_smul r s x := by ext <;> simp [add_smul] - zero_smul x := by ext <;> simp - -instance [AddGroup R] : AddGroup (QuadraticAlgebra R a b) := fast_instance% by - refine (equivProd a b).injective.addGroup _ rfl ?_ ?_ ?_ ?_ ?_ <;> intros <;> rfl - -instance [AddCommGroup R] : AddCommGroup (QuadraticAlgebra R a b) where - -section AddCommMonoidWithOne -variable [AddCommMonoidWithOne R] - -instance : AddCommMonoidWithOne (QuadraticAlgebra R a b) where - natCast n := ((n : R) : QuadraticAlgebra R a b) - natCast_zero := by ext <;> simp - natCast_succ n := by ext <;> simp - -@[simp, norm_cast] -theorem coe_ofNat (n : ℕ) [n.AtLeastTwo] : - ((ofNat(n) : R) : QuadraticAlgebra R a b) = (ofNat(n) : QuadraticAlgebra R a b) := by - ext <;> rfl - -@[simp, norm_cast] -theorem re_natCast (n : ℕ) : (n : QuadraticAlgebra R a b).re = n := rfl - -@[simp, norm_cast] -theorem im_natCast (n : ℕ) : (n : QuadraticAlgebra R a b).im = 0 := rfl - -@[norm_cast] -theorem coe_natCast (n : ℕ) : ↑(↑n : R) = (↑n : QuadraticAlgebra R a b) := rfl - -@[scoped simp] -theorem re_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : QuadraticAlgebra R a b).re = ofNat(n) := rfl - -@[scoped simp] -theorem im_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : QuadraticAlgebra R a b).im = 0 := rfl - -end AddCommMonoidWithOne - -section AddCommGroupWithOne -variable [AddCommGroupWithOne R] - -instance : AddCommGroupWithOne (QuadraticAlgebra R a b) where - intCast n := ((n : R) : QuadraticAlgebra R a b) - intCast_ofNat n := by norm_cast - intCast_negSucc n := by rw [Int.negSucc_eq, Int.cast_neg, coe_neg]; norm_cast - -@[simp, norm_cast] -theorem re_intCast (n : ℤ) : (n : QuadraticAlgebra R a b).re = n := rfl - -@[simp, norm_cast] -theorem im_intCast (n : ℤ) : (n : QuadraticAlgebra R a b).im = 0 := rfl - -@[norm_cast] -theorem coe_intCast (n : ℤ) : ↑(n : R) = (n : QuadraticAlgebra R a b) := rfl - -end AddCommGroupWithOne - -section NonUnitalNonAssocSemiring -variable [NonUnitalNonAssocSemiring R] - -instance instNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (QuadraticAlgebra R a b) where - left_distrib _ _ _ := by ext <;> simpa using by simp [mul_add]; abel - right_distrib _ _ _ := by ext <;> simpa using by simp [mul_add, add_mul]; abel - zero_mul _ := by ext <;> simp - mul_zero _ := by ext <;> simp - -theorem coe_mul_eq_smul (r : R) (x : QuadraticAlgebra R a b) : - (r * x : QuadraticAlgebra R a b) = r • x := by ext <;> simp - -@[simp, norm_cast] -theorem coe_mul (x y : R) : ↑(x * y) = (↑x * ↑y : QuadraticAlgebra R a b) := by ext <;> simp - -end NonUnitalNonAssocSemiring - -section NonAssocSemiring -variable [NonAssocSemiring R] - -instance instNonAssocSemiring : NonAssocSemiring (QuadraticAlgebra R a b) where - one_mul _ := by ext <;> simp - mul_one _ := by ext <;> simp - -@[simp] -theorem nsmul_mk (n : ℕ) (x y : R) : - (n : QuadraticAlgebra R a b) * ⟨x, y⟩ = ⟨n * x, n * y⟩ := by - ext <;> simp - -end NonAssocSemiring - -section Semiring -variable (a b) [Semiring R] - -/-- `QuadraticAlgebra.re` as a `LinearMap` -/ -@[simps] -def reₗ : QuadraticAlgebra R a b →ₗ[R] R where - toFun := re - map_add' _ _ := rfl - map_smul' _ _ := rfl - -/-- `QuadraticAlgebra.im` as a `LinearMap` -/ -@[simps] -def imₗ : QuadraticAlgebra R a b →ₗ[R] R where - toFun := im - map_add' _ _ := rfl - map_smul' _ _ := rfl - -/-- `QuadraticAlgebra.equivTuple` as a `LinearEquiv` -/ -def linearEquivTuple : QuadraticAlgebra R a b ≃ₗ[R] (Fin 2 → R) where - __ := equivProd a b |>.trans <| finTwoArrowEquiv _ |>.symm - map_add' _ _ := funext <| Fin.forall_fin_two.2 ⟨rfl, rfl⟩ - map_smul' _ _ := funext <| Fin.forall_fin_two.2 ⟨rfl, rfl⟩ - -@[simp] -lemma linearEquivTuple_apply (z : QuadraticAlgebra R a b) : - (linearEquivTuple a b) z = ![z.re, z.im] := rfl - -@[simp] -lemma linearEquivTuple_symm_apply (x : Fin 2 → R) : - (linearEquivTuple a b).symm x = ⟨x 0, x 1⟩ := rfl - -/-- `QuadraticAlgebra R a b` has a basis over `R` given by `1` and `i` -/ -noncomputable def basis : Module.Basis (Fin 2) R (QuadraticAlgebra R a b) := - .ofEquivFun <| linearEquivTuple a b - -@[simp] -theorem basis_repr_apply (x : QuadraticAlgebra R a b) : - (basis a b).repr x = ![x.re, x.im] := rfl - -instance : Module.Finite R (QuadraticAlgebra R a b) := .of_basis (basis a b) - -instance : Module.Free R (QuadraticAlgebra R a b) := .of_basis (basis a b) - -theorem rank_eq_two [StrongRankCondition R] : Module.rank R (QuadraticAlgebra R a b) = 2 := by - simp [rank_eq_card_basis (basis a b)] - -theorem finrank_eq_two [StrongRankCondition R] : - Module.finrank R (QuadraticAlgebra R a b) = 2 := by - simp [Module.finrank, rank_eq_two] - -end Semiring - -section CommSemiring -variable [CommSemiring R] - -instance instCommSemiring : CommSemiring (QuadraticAlgebra R a b) where - mul_assoc _ _ _ := by ext <;> simpa using by ring - mul_comm _ _ := by ext <;> simpa using by ring - -instance [CommSemiring S] [CommSemiring R] [Algebra S R] : - Algebra S (QuadraticAlgebra R a b) where - algebraMap.toFun s := coe (algebraMap S R s) - algebraMap.map_one' := by ext <;> simp - algebraMap.map_mul' x y:= by ext <;> simp - algebraMap.map_zero' := by ext <;> simp - algebraMap.map_add' x y:= by ext <;> simp - commutes' s z := by ext <;> simp [Algebra.commutes] - smul_def' s x := by ext <;> simp [Algebra.smul_def] - -theorem algebraMap_eq (r : R) : algebraMap R (QuadraticAlgebra R a b) r = ⟨r, 0⟩ := rfl - -theorem algebraMap_injective : (algebraMap R (QuadraticAlgebra R a b) : _ → _).Injective := - fun _ _ ↦ by simp [algebraMap_eq] - -instance [Zero S] [SMulWithZero S R] [NoZeroSMulDivisors S R] : - NoZeroSMulDivisors S (QuadraticAlgebra R a b) := - ⟨by simp [QuadraticAlgebra.ext_iff, or_and_left]⟩ - -@[norm_cast, simp] -theorem coe_pow (n : ℕ) (r : R) : ((r ^ n : R) : QuadraticAlgebra R a b) = - (r : QuadraticAlgebra R a b) ^ n := - (algebraMap R (QuadraticAlgebra R a b)).map_pow r n - -theorem mul_coe_eq_smul (r : R) (x : QuadraticAlgebra R a b) : - (x * r : QuadraticAlgebra R a b) = r • x := by - rw [mul_comm, coe_mul_eq_smul r x] - -@[norm_cast, simp] -theorem coe_algebraMap : ⇑(algebraMap R (QuadraticAlgebra R a b)) = coe := rfl - -theorem smul_coe (r1 r2 : R) : - r1 • (r2 : QuadraticAlgebra R a b) = ↑(r1 * r2) := by rw [coe_mul, coe_mul_eq_smul] - -theorem coe_dvd_iff {r : R} {z : QuadraticAlgebra R a b} : - (r : QuadraticAlgebra R a b) ∣ z ↔ r ∣ z.re ∧ r ∣ z.im := by - constructor - · rintro ⟨x, rfl⟩ - simp [dvd_mul_right] - · rintro ⟨⟨r, hr⟩, ⟨i, hi⟩⟩ - use ⟨r, i⟩ - simp [QuadraticAlgebra.ext_iff, hr, hi] - -@[simp, norm_cast] -theorem coe_dvd_iff_dvd {z w : R} : - (z : QuadraticAlgebra R a b) ∣ w ↔ z ∣ w := by - rw [coe_dvd_iff] - constructor - · rintro ⟨hx, -⟩ - simpa using hx - · simp - -end CommSemiring - -section CommRing - -variable [CommRing R] - -instance instCommRing : CommRing (QuadraticAlgebra R a b) where - -instance [CharZero R] : CharZero (QuadraticAlgebra R a b) where - cast_injective m n := by - simp [QuadraticAlgebra.ext_iff] - -@[simp] -theorem zsmul_val (n : ℤ) (x y : R) : - (n : QuadraticAlgebra R a b) * ⟨x, y⟩ = ⟨n * x, n * y⟩ := by - ext <;> simp - -end CommRing - -end QuadraticAlgebra +deprecated_module (since := "2025-11-10") diff --git a/Mathlib/Algebra/QuadraticAlgebra/Basic.lean b/Mathlib/Algebra/QuadraticAlgebra/Basic.lean index 61b9d8df8150ec..9f4f49b5b3d047 100644 --- a/Mathlib/Algebra/QuadraticAlgebra/Basic.lean +++ b/Mathlib/Algebra/QuadraticAlgebra/Basic.lean @@ -3,10 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.QuadraticAlgebra -import Mathlib.Algebra.Star.Unitary -import Mathlib.Tactic.FieldSimp +public import Mathlib.Algebra.QuadraticAlgebra.Defs +public import Mathlib.Algebra.Star.Unitary /-! # Quadratic algebras : involution and norm. @@ -26,9 +26,10 @@ We prove : `w.norm` isn't a zero divisor in `R`. * If `R` is a field, and `∀ r, r ^ 2 ≠ a + b * r`, then `QuadraticAlgebra R a b` is a field. -` -/ +@[expose] public section + namespace QuadraticAlgebra variable {R : Type*} {a b : R} diff --git a/Mathlib/Algebra/QuadraticAlgebra/Defs.lean b/Mathlib/Algebra/QuadraticAlgebra/Defs.lean new file mode 100644 index 00000000000000..b027066dcec096 --- /dev/null +++ b/Mathlib/Algebra/QuadraticAlgebra/Defs.lean @@ -0,0 +1,474 @@ +/- +Copyright (c) 2025 Kenny Lau. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Yunzhou Xie, Kenny Lau, Jiayang Hong +-/ +module + +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic + +/-! + +# Quadratic Algebra + +In this file we define the quadratic algebra `QuadraticAlgebra R a b` over a commutative ring `R`, +and define some algebraic structures on it. + +## Main definitions + +* `QuadraticAlgebra R a b`: + [Bourbaki, *Algebra I*][bourbaki1989] with coefficients `a`, `b` in `R`. + +## Tags + +Quadratic algebra, quadratic extension + +-/ + +@[expose] public section + +universe u + +/-- Quadratic algebra over a type with fixed coefficient where $i^2 = a + bi$, implemented as +a structure with two fields, `re` and `im`. When `R` is a commutative ring, this is isomorphic to +`R[X]/(X^2-b*X-a)`. -/ +@[ext] +structure QuadraticAlgebra (R : Type u) (a b : R) : Type u where + /-- Real part of an element in quadratic algebra -/ + re : R + /-- Imaginary part of an element in quadratic algebra -/ + im : R +deriving DecidableEq + +initialize_simps_projections QuadraticAlgebra (as_prefix re, as_prefix im) + +variable {R : Type*} +namespace QuadraticAlgebra + +/-- The equivalence between quadratic algebra over `R` and `R × R`. -/ +@[simps symm_apply] +def equivProd (a b : R) : QuadraticAlgebra R a b ≃ R × R where + toFun z := (z.re, z.im) + invFun p := ⟨p.1, p.2⟩ + +@[simp] +theorem mk_eta {a b} (z : QuadraticAlgebra R a b) : + mk z.re z.im = z := rfl + +variable {S T : Type*} {a b} (r : R) (x y : QuadraticAlgebra R a b) + +instance [Subsingleton R] : Subsingleton (QuadraticAlgebra R a b) := (equivProd a b).subsingleton + +instance [Nontrivial R] : Nontrivial (QuadraticAlgebra R a b) := (equivProd a b).nontrivial + +section Zero +variable [Zero R] + +/-- Coercion `R → QuadraticAlgebra R a b`. -/ +@[coe] def coe (x : R) : QuadraticAlgebra R a b := ⟨x, 0⟩ + +instance : Coe R (QuadraticAlgebra R a b) := ⟨coe⟩ + +@[simp, norm_cast] +theorem re_coe : (r : QuadraticAlgebra R a b).re = r := rfl + +@[simp, norm_cast] +theorem im_coe : (r : QuadraticAlgebra R a b).im = 0 := rfl + +theorem coe_injective : Function.Injective (coe : R → QuadraticAlgebra R a b) := + fun _ _ h => congr_arg re h + +@[simp] +theorem coe_inj {x y : R} : (x : QuadraticAlgebra R a b) = y ↔ x = y := + coe_injective.eq_iff + +instance : Zero (QuadraticAlgebra R a b) := ⟨⟨0, 0⟩⟩ + +@[simp] theorem re_zero : (0 : QuadraticAlgebra R a b).re = 0 := rfl + +@[simp] theorem im_zero : (0 : QuadraticAlgebra R a b).im = 0 := rfl + +@[simp, norm_cast] +theorem coe_zero : ((0 : R) : QuadraticAlgebra R a b) = 0 := rfl + +@[simp] +theorem coe_eq_zero_iff {r : R} : (r : QuadraticAlgebra R a b) = 0 ↔ r = 0 := by + rw [← coe_zero, coe_inj] + +instance : Inhabited (QuadraticAlgebra R a b) := ⟨0⟩ + +section One +variable [One R] + +instance : One (QuadraticAlgebra R a b) := ⟨⟨1, 0⟩⟩ + +@[scoped simp] theorem re_one : (1 : QuadraticAlgebra R a b).re = 1 := rfl + +@[scoped simp] theorem im_one : (1 : QuadraticAlgebra R a b).im = 0 := rfl + +@[simp, norm_cast] +theorem coe_one : ((1 : R) : QuadraticAlgebra R a b) = 1 := rfl + +@[simp] +theorem coe_eq_one_iff {r : R} : (r : QuadraticAlgebra R a b) = 1 ↔ r = 1 := by + rw [← coe_one, coe_inj] + +end One + +end Zero + +section Add +variable [Add R] + +instance : Add (QuadraticAlgebra R a b) where + add z w := ⟨z.re + w.re, z.im + w.im⟩ + +@[simp] theorem re_add (z w : QuadraticAlgebra R a b) : + (z + w).re = z.re + w.re := rfl + +@[simp] theorem im_add (z w : QuadraticAlgebra R a b) : + (z + w).im = z.im + w.im := rfl + +@[simp] +theorem mk_add_mk (z w : QuadraticAlgebra R a b) : + mk z.re z.im + mk w.re w.im = (mk (z.re + w.re) (z.im + w.im) : QuadraticAlgebra R a b) := rfl + +end Add + +section AddZeroClass +variable [AddZeroClass R] + +@[simp] +theorem coe_add (x y : R) : ((x + y : R) : QuadraticAlgebra R a b) = x + y := by ext <;> simp + +end AddZeroClass + +section Neg +variable [Neg R] + +instance : Neg (QuadraticAlgebra R a b) where neg z := ⟨-z.re, -z.im⟩ + +@[simp] theorem re_neg (z : QuadraticAlgebra R a b) : (-z).re = -z.re := rfl + +@[simp] theorem im_neg (z : QuadraticAlgebra R a b) : (-z).im = -z.im := rfl + +@[simp] +theorem neg_mk (x y : R) : + - (mk x y : QuadraticAlgebra R a b) = ⟨-x, -y⟩ := rfl + +end Neg + +section AddGroup + +@[simp] +theorem coe_neg [NegZeroClass R] (x : R) : + ((-x : R) : QuadraticAlgebra R a b) = -x := by ext <;> simp + +instance [Sub R] : Sub (QuadraticAlgebra R a b) where + sub z w := ⟨z.re - w.re, z.im - w.im⟩ + +@[simp] theorem re_sub [Sub R] (z w : QuadraticAlgebra R a b) : + (z - w).re = z.re - w.re := rfl + +@[simp] theorem im_sub [Sub R] (z w : QuadraticAlgebra R a b) : + (z - w).im = z.im - w.im := rfl + +@[simp] +theorem mk_sub_mk [Sub R] (x1 y1 x2 y2 : R) : + (mk x1 y1 : QuadraticAlgebra R a b) - mk x2 y2 = mk (x1 - x2) (y1 - y2) := rfl + +@[norm_cast, simp] +theorem coe_sub (r1 r2 : R) [SubNegZeroMonoid R] : + ((r1 - r2 : R) : QuadraticAlgebra R a b) = r1 - r2 := + QuadraticAlgebra.ext rfl zero_sub_zero.symm + +end AddGroup + +section Mul +variable [Mul R] [Add R] + +instance : Mul (QuadraticAlgebra R a b) where + mul z w := ⟨z.1 * w.1 + a * z.2 * w.2, z.1 * w.2 + z.2 * w.1 + b * z.2 * w.2⟩ + +@[simp] theorem re_mul (z w : QuadraticAlgebra R a b) : + (z * w).re = z.re * w.re + a * z.im * w.im := rfl + +@[simp] theorem im_mul (z w : QuadraticAlgebra R a b) : + (z * w).im = z.re * w.im + z.im * w.re + b * z.im * w.im := rfl + +@[simp] +theorem mk_mul_mk (x1 y1 x2 y2 : R) : + (mk x1 y1 : QuadraticAlgebra R a b) * mk x2 y2 = + mk (x1 * x2 + a * y1 * y2) (x1 * y2 + y1 * x2 + b * y1 * y2) := rfl + +end Mul + +section SMul +variable [SMul S R] [SMul T R] (s : S) + +instance : SMul S (QuadraticAlgebra R a b) where smul s z := ⟨s • z.re, s • z.im⟩ + +instance [SMul S T] [IsScalarTower S T R] : IsScalarTower S T (QuadraticAlgebra R a b) where + smul_assoc s t z := by ext <;> exact smul_assoc _ _ _ + +instance [SMulCommClass S T R] : SMulCommClass S T (QuadraticAlgebra R a b) where + smul_comm s t z := by ext <;> exact smul_comm _ _ _ + +instance [SMul Sᵐᵒᵖ R] [IsCentralScalar S R] : IsCentralScalar S (QuadraticAlgebra R a b) where + op_smul_eq_smul s z := by ext <;> exact op_smul_eq_smul _ _ + +@[simp] theorem re_smul (s : S) (z : QuadraticAlgebra R a b) : (s • z).re = s • z.re := rfl + +@[simp] theorem im_smul (s : S) (z : QuadraticAlgebra R a b) : (s • z).im = s • z.im := rfl + +@[simp] +theorem smul_mk (s : S) (x y : R) : + s • (mk x y : QuadraticAlgebra R a b) = mk (s • x) (s • y) := rfl + +end SMul + +section MulAction + +instance [Monoid S] [MulAction S R] : MulAction S (QuadraticAlgebra R a b) where + one_smul _ := by ext <;> simp + mul_smul _ _ _ := by ext <;> simp [mul_smul] + +end MulAction + +@[simp, norm_cast] +theorem coe_smul [Zero R] [SMulZeroClass S R] (s : S) (r : R) : + (↑(s • r) : QuadraticAlgebra R a b) = s • (r : QuadraticAlgebra R a b) := + QuadraticAlgebra.ext rfl (smul_zero _).symm + +instance [AddMonoid R] : AddMonoid (QuadraticAlgebra R a b) := fast_instance% by + refine (equivProd a b).injective.addMonoid _ rfl ?_ ?_ <;> intros <;> rfl + +instance [Monoid S] [AddMonoid R] [DistribMulAction S R] : + DistribMulAction S (QuadraticAlgebra R a b) where + smul_zero _ := by ext <;> simp + smul_add _ _ _ := by ext <;> simp + +instance [AddCommMonoid R] : AddCommMonoid (QuadraticAlgebra R a b) := fast_instance% by + refine (equivProd a b).injective.addCommMonoid _ rfl ?_ ?_ <;> intros <;> rfl + +instance [Semiring S] [AddCommMonoid R] [Module S R] : Module S (QuadraticAlgebra R a b) where + add_smul r s x := by ext <;> simp [add_smul] + zero_smul x := by ext <;> simp + +instance [AddGroup R] : AddGroup (QuadraticAlgebra R a b) := fast_instance% by + refine (equivProd a b).injective.addGroup _ rfl ?_ ?_ ?_ ?_ ?_ <;> intros <;> rfl + +instance [AddCommGroup R] : AddCommGroup (QuadraticAlgebra R a b) where + +section AddCommMonoidWithOne +variable [AddCommMonoidWithOne R] + +instance : AddCommMonoidWithOne (QuadraticAlgebra R a b) where + natCast n := ((n : R) : QuadraticAlgebra R a b) + natCast_zero := by ext <;> simp + natCast_succ n := by ext <;> simp + +@[simp, norm_cast] +theorem coe_ofNat (n : ℕ) [n.AtLeastTwo] : + ((ofNat(n) : R) : QuadraticAlgebra R a b) = (ofNat(n) : QuadraticAlgebra R a b) := by + ext <;> rfl + +@[simp, norm_cast] +theorem re_natCast (n : ℕ) : (n : QuadraticAlgebra R a b).re = n := rfl + +@[simp, norm_cast] +theorem im_natCast (n : ℕ) : (n : QuadraticAlgebra R a b).im = 0 := rfl + +@[norm_cast] +theorem coe_natCast (n : ℕ) : ↑(↑n : R) = (↑n : QuadraticAlgebra R a b) := rfl + +@[scoped simp] +theorem re_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : QuadraticAlgebra R a b).re = ofNat(n) := rfl + +@[scoped simp] +theorem im_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : QuadraticAlgebra R a b).im = 0 := rfl + +end AddCommMonoidWithOne + +section AddCommGroupWithOne +variable [AddCommGroupWithOne R] + +instance : AddCommGroupWithOne (QuadraticAlgebra R a b) where + intCast n := ((n : R) : QuadraticAlgebra R a b) + intCast_ofNat n := by norm_cast + intCast_negSucc n := by rw [Int.negSucc_eq, Int.cast_neg, coe_neg]; norm_cast + +@[simp, norm_cast] +theorem re_intCast (n : ℤ) : (n : QuadraticAlgebra R a b).re = n := rfl + +@[simp, norm_cast] +theorem im_intCast (n : ℤ) : (n : QuadraticAlgebra R a b).im = 0 := rfl + +@[norm_cast] +theorem coe_intCast (n : ℤ) : ↑(n : R) = (n : QuadraticAlgebra R a b) := rfl + +end AddCommGroupWithOne + +section NonUnitalNonAssocSemiring +variable [NonUnitalNonAssocSemiring R] + +instance instNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (QuadraticAlgebra R a b) where + left_distrib _ _ _ := by ext <;> simpa using by simp [mul_add]; abel + right_distrib _ _ _ := by ext <;> simpa using by simp [mul_add, add_mul]; abel + zero_mul _ := by ext <;> simp + mul_zero _ := by ext <;> simp + +theorem coe_mul_eq_smul (r : R) (x : QuadraticAlgebra R a b) : + (r * x : QuadraticAlgebra R a b) = r • x := by ext <;> simp + +@[simp, norm_cast] +theorem coe_mul (x y : R) : ↑(x * y) = (↑x * ↑y : QuadraticAlgebra R a b) := by ext <;> simp + +end NonUnitalNonAssocSemiring + +section NonAssocSemiring +variable [NonAssocSemiring R] + +instance instNonAssocSemiring : NonAssocSemiring (QuadraticAlgebra R a b) where + one_mul _ := by ext <;> simp + mul_one _ := by ext <;> simp + +@[simp] +theorem nsmul_mk (n : ℕ) (x y : R) : + (n : QuadraticAlgebra R a b) * ⟨x, y⟩ = ⟨n * x, n * y⟩ := by + ext <;> simp + +end NonAssocSemiring + +section Semiring +variable (a b) [Semiring R] + +/-- `QuadraticAlgebra.re` as a `LinearMap` -/ +@[simps] +def reₗ : QuadraticAlgebra R a b →ₗ[R] R where + toFun := re + map_add' _ _ := rfl + map_smul' _ _ := rfl + +/-- `QuadraticAlgebra.im` as a `LinearMap` -/ +@[simps] +def imₗ : QuadraticAlgebra R a b →ₗ[R] R where + toFun := im + map_add' _ _ := rfl + map_smul' _ _ := rfl + +/-- `QuadraticAlgebra.equivTuple` as a `LinearEquiv` -/ +def linearEquivTuple : QuadraticAlgebra R a b ≃ₗ[R] (Fin 2 → R) where + __ := equivProd a b |>.trans <| finTwoArrowEquiv _ |>.symm + map_add' _ _ := funext <| Fin.forall_fin_two.2 ⟨rfl, rfl⟩ + map_smul' _ _ := funext <| Fin.forall_fin_two.2 ⟨rfl, rfl⟩ + +@[simp] +lemma linearEquivTuple_apply (z : QuadraticAlgebra R a b) : + (linearEquivTuple a b) z = ![z.re, z.im] := rfl + +@[simp] +lemma linearEquivTuple_symm_apply (x : Fin 2 → R) : + (linearEquivTuple a b).symm x = ⟨x 0, x 1⟩ := rfl + +/-- `QuadraticAlgebra R a b` has a basis over `R` given by `1` and `i` -/ +noncomputable def basis : Module.Basis (Fin 2) R (QuadraticAlgebra R a b) := + .ofEquivFun <| linearEquivTuple a b + +@[simp] +theorem basis_repr_apply (x : QuadraticAlgebra R a b) : + (basis a b).repr x = ![x.re, x.im] := rfl + +instance : Module.Finite R (QuadraticAlgebra R a b) := .of_basis (basis a b) + +instance : Module.Free R (QuadraticAlgebra R a b) := .of_basis (basis a b) + +theorem rank_eq_two [StrongRankCondition R] : Module.rank R (QuadraticAlgebra R a b) = 2 := by + simp [rank_eq_card_basis (basis a b)] + +theorem finrank_eq_two [StrongRankCondition R] : + Module.finrank R (QuadraticAlgebra R a b) = 2 := by + simp [Module.finrank, rank_eq_two] + +end Semiring + +section CommSemiring +variable [CommSemiring R] + +instance instCommSemiring : CommSemiring (QuadraticAlgebra R a b) where + mul_assoc _ _ _ := by ext <;> simpa using by ring + mul_comm _ _ := by ext <;> simpa using by ring + +instance [CommSemiring S] [CommSemiring R] [Algebra S R] : + Algebra S (QuadraticAlgebra R a b) where + algebraMap.toFun s := coe (algebraMap S R s) + algebraMap.map_one' := by ext <;> simp + algebraMap.map_mul' x y:= by ext <;> simp + algebraMap.map_zero' := by ext <;> simp + algebraMap.map_add' x y:= by ext <;> simp + commutes' s z := by ext <;> simp [Algebra.commutes] + smul_def' s x := by ext <;> simp [Algebra.smul_def] + +theorem algebraMap_eq (r : R) : algebraMap R (QuadraticAlgebra R a b) r = ⟨r, 0⟩ := rfl + +theorem algebraMap_injective : (algebraMap R (QuadraticAlgebra R a b) : _ → _).Injective := + fun _ _ ↦ by simp [algebraMap_eq] + +instance [Zero S] [SMulWithZero S R] [NoZeroSMulDivisors S R] : + NoZeroSMulDivisors S (QuadraticAlgebra R a b) := + ⟨by simp [QuadraticAlgebra.ext_iff, or_and_left]⟩ + +@[norm_cast, simp] +theorem coe_pow (n : ℕ) (r : R) : ((r ^ n : R) : QuadraticAlgebra R a b) = + (r : QuadraticAlgebra R a b) ^ n := + (algebraMap R (QuadraticAlgebra R a b)).map_pow r n + +theorem mul_coe_eq_smul (r : R) (x : QuadraticAlgebra R a b) : + (x * r : QuadraticAlgebra R a b) = r • x := by + rw [mul_comm, coe_mul_eq_smul r x] + +@[norm_cast, simp] +theorem coe_algebraMap : ⇑(algebraMap R (QuadraticAlgebra R a b)) = coe := rfl + +theorem smul_coe (r1 r2 : R) : + r1 • (r2 : QuadraticAlgebra R a b) = ↑(r1 * r2) := by rw [coe_mul, coe_mul_eq_smul] + +theorem coe_dvd_iff {r : R} {z : QuadraticAlgebra R a b} : + (r : QuadraticAlgebra R a b) ∣ z ↔ r ∣ z.re ∧ r ∣ z.im := by + constructor + · rintro ⟨x, rfl⟩ + simp [dvd_mul_right] + · rintro ⟨⟨r, hr⟩, ⟨i, hi⟩⟩ + use ⟨r, i⟩ + simp [QuadraticAlgebra.ext_iff, hr, hi] + +@[simp, norm_cast] +theorem coe_dvd_iff_dvd {z w : R} : + (z : QuadraticAlgebra R a b) ∣ w ↔ z ∣ w := by + rw [coe_dvd_iff] + constructor + · rintro ⟨hx, -⟩ + simpa using hx + · simp + +end CommSemiring + +section CommRing + +variable [CommRing R] + +instance instCommRing : CommRing (QuadraticAlgebra R a b) where + +instance [CharZero R] : CharZero (QuadraticAlgebra R a b) where + cast_injective m n := by + simp [QuadraticAlgebra.ext_iff] + +@[simp] +theorem zsmul_val (n : ℤ) (x y : R) : + (n : QuadraticAlgebra R a b) * ⟨x, y⟩ = ⟨n * x, n * y⟩ := by + ext <;> simp + +end CommRing + +end QuadraticAlgebra diff --git a/Mathlib/Algebra/QuadraticAlgebra/NormDeterminant.lean b/Mathlib/Algebra/QuadraticAlgebra/NormDeterminant.lean new file mode 100644 index 00000000000000..c94618cc9cd589 --- /dev/null +++ b/Mathlib/Algebra/QuadraticAlgebra/NormDeterminant.lean @@ -0,0 +1,44 @@ +/- +Copyright (c) 2025 Snir Broshi. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Snir Broshi +-/ +module + +public import Mathlib.Algebra.QuadraticAlgebra.Basic +public import Mathlib.LinearAlgebra.Determinant + +/-! +# Quadratic Algebra + +We prove that the expression for the norm of an element in a quadratic algebra comes from looking at +the endomorphism defined by left multiplication by that element and taking its determinant. +-/ + +@[expose] public section + +namespace QuadraticAlgebra + +variable {R : Type*} [CommRing R] {a b : R} + +/-- The norm of an element in a quadratic algebra is the determinant of the endomorphism defined by +left multiplication by that element. -/ +@[simp] +theorem det_toLinearMap_eq_norm (z : QuadraticAlgebra R a b) : + (DistribMulAction.toLinearMap R (QuadraticAlgebra R a b) z).det = z.norm := by + rw [← LinearMap.det_toMatrix <| basis ..] + have : !![z.re, a * z.im; z.im, z.re + b * z.im].det = z.norm := by + simp [norm] + ring + convert this + apply LinearEquiv.eq_symm_apply _ |>.mp + ext1 w + apply basis .. |>.repr.injective + apply DFunLike.coe_injective' + rw [LinearMap.toMatrix_symm, Matrix.repr_toLin] + ext i + fin_cases i + <;> simp + <;> ring + +end QuadraticAlgebra diff --git a/Mathlib/Algebra/QuadraticDiscriminant.lean b/Mathlib/Algebra/QuadraticDiscriminant.lean index 6aa9d93bdc845b..46adc0b95ab134 100644 --- a/Mathlib/Algebra/QuadraticDiscriminant.lean +++ b/Mathlib/Algebra/QuadraticDiscriminant.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.Order.Filter.AtTopBot.Field -import Mathlib.Tactic.Field -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.Linarith.Frontend +module + +public import Mathlib.Order.Filter.AtTopBot.Field +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.Linarith.Frontend /-! # Quadratic discriminants and roots of a quadratic @@ -32,6 +34,8 @@ This file defines the discriminant of a quadratic and gives the solution to a qu polynomial, quadratic, discriminant, root -/ +@[expose] public section + assert_not_exists Finite Finset open Filter diff --git a/Mathlib/Algebra/Quandle.lean b/Mathlib/Algebra/Quandle.lean index d93fa59a59bdfe..c3fe65bb407a65 100644 --- a/Mathlib/Algebra/Quandle.lean +++ b/Mathlib/Algebra/Quandle.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.Group.End -import Mathlib.Data.ZMod.Defs -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Group.End +public import Mathlib.Data.ZMod.Defs +public import Mathlib.Tactic.Ring /-! # Racks and Quandles @@ -82,6 +84,8 @@ Use `open quandles` to use these. rack, quandle -/ +@[expose] public section + open MulOpposite diff --git a/Mathlib/Algebra/Quaternion.lean b/Mathlib/Algebra/Quaternion.lean index 33396aafba4d01..4fa50dcbbc2de5 100644 --- a/Mathlib/Algebra/Quaternion.lean +++ b/Mathlib/Algebra/Quaternion.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +module + +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic /-! # Quaternions @@ -36,7 +38,7 @@ We also define the following algebraic structures on `ℍ[R]`: The following notation is available with `open Quaternion` or `open scoped Quaternion`. * `ℍ[R,c₁,c₂,c₃]` : `QuaternionAlgebra R c₁ c₂ c₃` -* `ℍ[R,c₁,c₂] : `QuaternionAlgebra R c₁ 0 c₂` +* `ℍ[R,c₁,c₂]` : `QuaternionAlgebra R c₁ 0 c₂` * `ℍ[R]` : quaternions over `R`. ## Implementation notes @@ -50,6 +52,8 @@ are computable. quaternion -/ +@[expose] public section + open Module /-- Quaternion algebra over a type with fixed coefficients where $i^2 = a + bi$ and $j^2 = c$, diff --git a/Mathlib/Algebra/QuaternionBasis.lean b/Mathlib/Algebra/QuaternionBasis.lean index 3b03909cc23dbf..dbfc4d745769d6 100644 --- a/Mathlib/Algebra/QuaternionBasis.lean +++ b/Mathlib/Algebra/QuaternionBasis.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Quaternion -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Quaternion +public import Mathlib.Tactic.Ring /-! # Basis on a quaternion-like algebra @@ -22,6 +24,8 @@ import Mathlib.Tactic.Ring data / proofs is non-negligible. -/ +@[expose] public section + open Quaternion diff --git a/Mathlib/Algebra/Quotient.lean b/Mathlib/Algebra/Quotient.lean index 5e2198bd8174f7..72c07d00e16e2b 100644 --- a/Mathlib/Algebra/Quotient.lean +++ b/Mathlib/Algebra/Quotient.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Tactic.Common +module + +public import Mathlib.Tactic.Common /-! # Algebraic quotients @@ -32,6 +34,8 @@ quotient, group quotient, quotient group, module quotient, quotient module, ring ideal quotient, quotient ring -/ +@[expose] public section + universe u v diff --git a/Mathlib/Algebra/Regular/Basic.lean b/Mathlib/Algebra/Regular/Basic.lean index b63fb5060f87de..11abae76fcf19b 100644 --- a/Mathlib/Algebra/Regular/Basic.lean +++ b/Mathlib/Algebra/Regular/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Algebra.Regular.Defs +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Algebra.Regular.Defs /-! # Regular elements @@ -23,6 +25,8 @@ by adding one further `0`. The final goal is to develop part of the API to prove, eventually, results about non-zero-divisors. -/ +@[expose] public section + variable {R : Type*} section Mul diff --git a/Mathlib/Algebra/Regular/Defs.lean b/Mathlib/Algebra/Regular/Defs.lean index 25f36b7b726798..865930deedbc74 100644 --- a/Mathlib/Algebra/Regular/Defs.lean +++ b/Mathlib/Algebra/Regular/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Notation.Defs +module + +public import Mathlib.Algebra.Notation.Defs /-! # Regular elements @@ -14,6 +16,8 @@ analogues add-left-regular, add-right-regular and add-regular elements. For monoids where _every_ element is regular, see `IsCancelMul` and nearby typeclasses. -/ +@[expose] public section + variable {R : Type*} [Mul R] /-- A left-regular element is an element `c` such that multiplication on the left by `c` diff --git a/Mathlib/Algebra/Regular/Opposite.lean b/Mathlib/Algebra/Regular/Opposite.lean index a1a463c9458ef3..9cfebd82dcfed1 100644 --- a/Mathlib/Algebra/Regular/Opposite.lean +++ b/Mathlib/Algebra/Regular/Opposite.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Opposites +module + +public import Mathlib.Algebra.Opposites /-! # Results about `IsRegular` and `MulOpposite` -/ +@[expose] public section + variable {R} [Mul R] open MulOpposite diff --git a/Mathlib/Algebra/Regular/Pi.lean b/Mathlib/Algebra/Regular/Pi.lean index 891490c1b513f3..276a143e9ec7c7 100644 --- a/Mathlib/Algebra/Regular/Pi.lean +++ b/Mathlib/Algebra/Regular/Pi.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Regular.SMul +module + +public import Mathlib.Algebra.Regular.SMul /-! # Results about `IsRegular` and pi types -/ +@[expose] public section + variable {ι α : Type*} {R : ι → Type*} namespace Pi diff --git a/Mathlib/Algebra/Regular/Pow.lean b/Mathlib/Algebra/Regular/Pow.lean index 1de8f79c9c3893..61b89bd48dbdc5 100644 --- a/Mathlib/Algebra/Regular/Pow.lean +++ b/Mathlib/Algebra/Regular/Pow.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Defs -import Mathlib.Algebra.Regular.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Algebra.Regular.Basic /-! # Product of regular elements @@ -14,6 +16,8 @@ import Mathlib.Algebra.Regular.Basic Move to `Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean`? -/ +@[expose] public section + variable {R : Type*} {a b : R} diff --git a/Mathlib/Algebra/Regular/Prod.lean b/Mathlib/Algebra/Regular/Prod.lean index e86e35b50f3c03..b786d5bf651598 100644 --- a/Mathlib/Algebra/Regular/Prod.lean +++ b/Mathlib/Algebra/Regular/Prod.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Notation.Prod -import Mathlib.Algebra.Regular.SMul +module + +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Algebra.Regular.SMul /-! # Results about `IsRegular` and `Prod` -/ +@[expose] public section + variable {α R S : Type*} section diff --git a/Mathlib/Algebra/Regular/SMul.lean b/Mathlib/Algebra/Regular/SMul.lean index 39ff782cdc4b7e..3af5b3a9a1dab1 100644 --- a/Mathlib/Algebra/Regular/SMul.lean +++ b/Mathlib/Algebra/Regular/SMul.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Push +module + +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Push /-! # Action of regular elements on a module @@ -27,6 +29,8 @@ This property is the direct generalization to modules of the property `IsLeftReg coincide. -/ +@[expose] public section + variable {R S : Type*} (M : Type*) {a b : R} {s : S} diff --git a/Mathlib/Algebra/Regular/ULift.lean b/Mathlib/Algebra/Regular/ULift.lean index 7fda4fa5c7db7a..3c5dffa6851d40 100644 --- a/Mathlib/Algebra/Regular/ULift.lean +++ b/Mathlib/Algebra/Regular/ULift.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.ULift -import Mathlib.Algebra.Regular.SMul +module + +public import Mathlib.Algebra.Group.ULift +public import Mathlib.Algebra.Regular.SMul /-! # Results about `IsRegular` and `ULift` -/ +@[expose] public section + universe u v variable {α} {R : Type v} diff --git a/Mathlib/Algebra/Ring/Action/Basic.lean b/Mathlib/Algebra/Ring/Action/Basic.lean index 0da738df55222d..70b3146116217a 100644 --- a/Mathlib/Algebra/Ring/Action/Basic.lean +++ b/Mathlib/Algebra/Ring/Action/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.GroupWithZero.Action.End -import Mathlib.Algebra.Ring.Hom.Defs +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.GroupWithZero.Action.End +public import Mathlib.Algebra.Ring.Hom.Defs /-! # Group action on rings @@ -32,6 +34,8 @@ group action -/ +@[expose] public section + assert_not_exists Equiv.Perm.equivUnitsEnd Prod.fst_mul universe u v diff --git a/Mathlib/Algebra/Ring/Action/ConjAct.lean b/Mathlib/Algebra/Ring/Action/ConjAct.lean index f6401f3572c323..b2c20afea03f52 100644 --- a/Mathlib/Algebra/Ring/Action/ConjAct.lean +++ b/Mathlib/Algebra/Ring/Action/ConjAct.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.GroupTheory.GroupAction.ConjAct +module + +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.GroupTheory.GroupAction.ConjAct /-! # Conjugation action of a ring on itself -/ +@[expose] public section + assert_not_exists Field namespace ConjAct diff --git a/Mathlib/Algebra/Ring/Action/End.lean b/Mathlib/Algebra/Ring/Action/End.lean index ba46302be0c6ef..4a51f031613f9d 100644 --- a/Mathlib/Algebra/Ring/Action/End.lean +++ b/Mathlib/Algebra/Ring/Action/End.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Ring.Action.Group -import Mathlib.Algebra.Ring.Aut +module + +public import Mathlib.Algebra.Ring.Action.Group +public import Mathlib.Algebra.Ring.Aut /-! # Ring automorphisms @@ -26,6 +28,8 @@ the group structure is defined. ring aut -/ +@[expose] public section + namespace RingAut variable {G R : Type*} [Group G] [Semiring R] diff --git a/Mathlib/Algebra/Ring/Action/Field.lean b/Mathlib/Algebra/Ring/Action/Field.lean index b0bcedf99ac298..a48a0ec0fc71bd 100644 --- a/Mathlib/Algebra/Ring/Action/Field.lean +++ b/Mathlib/Algebra/Ring/Action/Field.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Units.Lemmas +module + +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas /-! # Group action on fields -/ +@[expose] public section + variable {M} [Monoid M] {F} [DivisionRing F] /-- Note that `smul_inv'` refers to the group case, and `smul_inv` has an additional inverse diff --git a/Mathlib/Algebra/Ring/Action/Group.lean b/Mathlib/Algebra/Ring/Action/Group.lean index 3a252307f625cd..d5dce7f17fa431 100644 --- a/Mathlib/Algebra/Ring/Action/Group.lean +++ b/Mathlib/Algebra/Ring/Action/Group.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.GroupWithZero.Action.Basic -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.Algebra.Ring.Equiv +module + +public import Mathlib.Algebra.GroupWithZero.Action.Basic +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.Algebra.Ring.Equiv /-! # If a group acts multiplicatively on a semiring, each group element acts by a ring automorphism. @@ -14,6 +16,8 @@ This result is split out from `Mathlib/Algebra/Ring/Action/Basic.lean` to avoid needing the import of `Mathlib/Algebra/GroupWithZero/Action/Basic.lean`. -/ +@[expose] public section + section Semiring variable (G : Type*) [Group G] diff --git a/Mathlib/Algebra/Ring/Action/Invariant.lean b/Mathlib/Algebra/Ring/Action/Invariant.lean index 3fd0ff4121b2a3..e0b4840095b336 100644 --- a/Mathlib/Algebra/Ring/Action/Invariant.lean +++ b/Mathlib/Algebra/Ring/Action/Invariant.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.GroupTheory.GroupAction.Hom -import Mathlib.Algebra.Ring.Subring.Defs +module + +public import Mathlib.GroupTheory.GroupAction.Hom +public import Mathlib.Algebra.Ring.Subring.Defs /-! # Subrings invariant under an action @@ -14,6 +16,8 @@ action. -/ +@[expose] public section + assert_not_exists RelIso section Ring diff --git a/Mathlib/Algebra/Ring/Action/Pointwise/Finset.lean b/Mathlib/Algebra/Ring/Action/Pointwise/Finset.lean index 8c7b8e9c33dd98..b03918122982ac 100644 --- a/Mathlib/Algebra/Ring/Action/Pointwise/Finset.lean +++ b/Mathlib/Algebra/Ring/Action/Pointwise/Finset.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Pointwise actions on sets in a ring @@ -18,6 +20,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + open scoped Pointwise variable {R G : Type*} diff --git a/Mathlib/Algebra/Ring/Action/Pointwise/Set.lean b/Mathlib/Algebra/Ring/Action/Pointwise/Set.lean index 10c36f55c07efb..d8b89941483e0b 100644 --- a/Mathlib/Algebra/Ring/Action/Pointwise/Set.lean +++ b/Mathlib/Algebra/Ring/Action/Pointwise/Set.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise operations of sets in a ring @@ -18,6 +20,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Field open Function diff --git a/Mathlib/Algebra/Ring/Action/Rat.lean b/Mathlib/Algebra/Ring/Action/Rat.lean index 0d528de15f5287..f92b590ad7632c 100644 --- a/Mathlib/Algebra/Ring/Action/Rat.lean +++ b/Mathlib/Algebra/Ring/Action/Rat.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Action.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Action.Defs /-! # Actions by nonnegative rational numbers -/ +@[expose] public section + assert_not_exists IsOrderedMonoid variable {R : Type*} diff --git a/Mathlib/Algebra/Ring/Action/Submonoid.lean b/Mathlib/Algebra/Ring/Action/Submonoid.lean index 9a7f43af971011..6dd9687cce75a3 100644 --- a/Mathlib/Algebra/Ring/Action/Submonoid.lean +++ b/Mathlib/Algebra/Ring/Action/Submonoid.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 David Ang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Ang -/ -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.GroupTheory.GroupAction.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.GroupTheory.GroupAction.Defs /-! # The subgroup of fixed points of an action -/ +@[expose] public section + variable (M α : Type*) [Monoid M] section AddMonoid diff --git a/Mathlib/Algebra/Ring/Action/Subobjects.lean b/Mathlib/Algebra/Ring/Action/Subobjects.lean index 940e6eb55e6a67..011b55666bb54a 100644 --- a/Mathlib/Algebra/Ring/Action/Subobjects.lean +++ b/Mathlib/Algebra/Ring/Action/Subobjects.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Group.Submonoid.DistribMulAction -import Mathlib.Algebra.Ring.Action.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Group.Submonoid.DistribMulAction +public import Mathlib.Algebra.Ring.Action.Basic /-! # Instances of `MulSemiringAction` for subobjects @@ -18,6 +20,8 @@ for those subobjects. -/ +@[expose] public section + assert_not_exists RelIso variable {M G R : Type*} diff --git a/Mathlib/Algebra/Ring/AddAut.lean b/Mathlib/Algebra/Ring/AddAut.lean index e6522bff220d5d..c7009b3e0136ab 100644 --- a/Mathlib/Algebra/Ring/AddAut.lean +++ b/Mathlib/Algebra/Ring/AddAut.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.GroupWithZero.Action.Basic -import Mathlib.Algebra.GroupWithZero.Action.Units -import Mathlib.Algebra.Group.Units.Opposite -import Mathlib.Algebra.Module.Opposite +module + +public import Mathlib.Algebra.GroupWithZero.Action.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Units +public import Mathlib.Algebra.Group.Units.Opposite +public import Mathlib.Algebra.Module.Opposite /-! # Multiplication on the left/right as additive automorphisms @@ -18,6 +20,8 @@ See also `AddMonoidHom.mulLeft`, `AddMonoidHom.mulRight`, `AddMonoid.End.mulLeft `Rˣ` as an automorphism. -/ +@[expose] public section + namespace AddAut diff --git a/Mathlib/Algebra/Ring/Associated.lean b/Mathlib/Algebra/Ring/Associated.lean index 0156368fe35376..5a38f97e6cb052 100644 --- a/Mathlib/Algebra/Ring/Associated.lean +++ b/Mathlib/Algebra/Ring/Associated.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker -/ -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.Ring.Units +module + +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.Ring.Units /-! # Associated elements in rings -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Multiset Field namespace Associated diff --git a/Mathlib/Algebra/Ring/Associator.lean b/Mathlib/Algebra/Ring/Associator.lean index c3e9e32f290791..51c1fbf7cf7c67 100644 --- a/Mathlib/Algebra/Ring/Associator.lean +++ b/Mathlib/Algebra/Ring/Associator.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Bernhard Reinke. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bernhard Reinke -/ -import Mathlib.Algebra.Ring.Basic -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Ring.Basic +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Tactic.Abel /-! # Associator in a ring @@ -20,6 +22,8 @@ as well as the bundled version of `mulLeft₃` and `mulRight₃`, the multiplica `x * (y * z)`. -/ +@[expose] public section + variable {R : Type*} section NonUnitalNonAssocRing diff --git a/Mathlib/Algebra/Ring/Aut.lean b/Mathlib/Algebra/Ring/Aut.lean index 88fff105aa6ac0..f8cd5a3e7dc4fe 100644 --- a/Mathlib/Algebra/Ring/Aut.lean +++ b/Mathlib/Algebra/Ring/Aut.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.End -import Mathlib.Algebra.Ring.Equiv +module + +public import Mathlib.Algebra.Group.End +public import Mathlib.Algebra.Ring.Equiv /-! # Ring automorphisms @@ -22,6 +24,8 @@ multiplication in `Equiv.Perm`, and multiplication in `CategoryTheory.End`, but ring aut -/ +@[expose] public section + variable (R : Type*) [Mul R] [Add R] /-- The group of ring automorphisms. -/ diff --git a/Mathlib/Algebra/Ring/Basic.lean b/Mathlib/Algebra/Ring/Basic.lean index 0a4290e0d87a57..b8a7e05a9d4f97 100644 --- a/Mathlib/Algebra/Ring/Basic.lean +++ b/Mathlib/Algebra/Ring/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Algebra.Group.Hom.Instances -import Mathlib.Algebra.GroupWithZero.NeZero -import Mathlib.Algebra.Opposites -import Mathlib.Algebra.Ring.Defs -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Algebra.Group.Hom.Instances +public import Mathlib.Algebra.GroupWithZero.NeZero +public import Mathlib.Algebra.Opposites +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Tactic.TFAE /-! # Semirings and rings @@ -21,6 +23,8 @@ the present file is about their interaction. For the definitions of semirings and rings see `Mathlib/Algebra/Ring/Defs.lean`. -/ +@[expose] public section + assert_not_exists Nat.cast_sub variable {R S : Type*} diff --git a/Mathlib/Algebra/Ring/BooleanRing.lean b/Mathlib/Algebra/Ring/BooleanRing.lean index 481d1ef3847820..4bf2e3b19984e1 100644 --- a/Mathlib/Algebra/Ring/BooleanRing.lean +++ b/Mathlib/Algebra/Ring/BooleanRing.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Bryan Gin-ge Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bryan Gin-ge Chen, Yaël Dillies -/ -import Mathlib.Algebra.Group.Idempotent -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.PUnit -import Mathlib.Order.Hom.BoundedLattice -import Mathlib.Tactic.Abel -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Group.Idempotent +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.PUnit +public import Mathlib.Order.Hom.BoundedLattice +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.Ring /-! # Boolean rings @@ -40,6 +42,8 @@ purposes and because it is easier than dealing with boolean ring, boolean algebra -/ +@[expose] public section + open scoped symmDiff variable {α β γ : Type*} diff --git a/Mathlib/Algebra/Ring/Center.lean b/Mathlib/Algebra/Ring/Center.lean index f4e6fa8ed1fb3a..bb072176bad4ba 100644 --- a/Mathlib/Algebra/Ring/Center.lean +++ b/Mathlib/Algebra/Ring/Center.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Center -import Mathlib.Data.Int.Cast.Lemmas +module + +public import Mathlib.Algebra.Group.Center +public import Mathlib.Data.Int.Cast.Lemmas /-! # Centers of rings -/ +@[expose] public section + assert_not_exists RelIso Finset Subsemigroup Field variable {M : Type*} diff --git a/Mathlib/Algebra/Ring/Centralizer.lean b/Mathlib/Algebra/Ring/Centralizer.lean index 923c7992874345..5ce1f8352c3467 100644 --- a/Mathlib/Algebra/Ring/Centralizer.lean +++ b/Mathlib/Algebra/Ring/Centralizer.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Center -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Center +public import Mathlib.Algebra.Ring.Defs /-! # Centralizers of rings -/ +@[expose] public section + assert_not_exists RelIso variable {M : Type*} {S : Set M} diff --git a/Mathlib/Algebra/Ring/CentroidHom.lean b/Mathlib/Algebra/Ring/CentroidHom.lean index 68cd8d72218b90..529f410b5094c1 100644 --- a/Mathlib/Algebra/Ring/CentroidHom.lean +++ b/Mathlib/Algebra/Ring/CentroidHom.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Christopher Hoskin -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Module.Hom -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.RingTheory.NonUnitalSubsemiring.Basic -import Mathlib.Algebra.Ring.Subsemiring.Basic +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Module.Hom +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +public import Mathlib.Algebra.Ring.Subsemiring.Basic /-! # Centroid homomorphisms @@ -43,6 +45,8 @@ be satisfied by itself and all stricter types. centroid -/ +@[expose] public section + assert_not_exists Field open Function diff --git a/Mathlib/Algebra/Ring/CharZero.lean b/Mathlib/Algebra/Ring/CharZero.lean index 998cca807c722e..74ca6915bd47f4 100644 --- a/Mathlib/Algebra/Ring/CharZero.lean +++ b/Mathlib/Algebra/Ring/CharZero.lean @@ -3,16 +3,20 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Notation.Support -import Mathlib.Algebra.Ring.Units -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Logic.Embedding.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Algebra.Ring.Units +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Logic.Embedding.Basic /-! # Characteristic zero rings -/ +@[expose] public section + assert_not_exists Field open Function Set diff --git a/Mathlib/Algebra/Ring/Commute.lean b/Mathlib/Algebra/Ring/Commute.lean index 4e4fd867f7b173..5ee61f26fb82ca 100644 --- a/Mathlib/Algebra/Ring/Commute.lean +++ b/Mathlib/Algebra/Ring/Commute.lean @@ -3,10 +3,12 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Ring.Semiconj -import Mathlib.Algebra.Ring.Units -import Mathlib.Algebra.Group.Commute.Defs -import Mathlib.Data.Bracket +module + +public import Mathlib.Algebra.Ring.Semiconj +public import Mathlib.Algebra.Ring.Units +public import Mathlib.Algebra.Group.Commute.Defs +public import Mathlib.Data.Bracket /-! # Semirings and rings @@ -20,6 +22,8 @@ For the definitions of semirings and rings see `Mathlib/Algebra/Ring/Defs.lean`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Ring/CompTypeclasses.lean b/Mathlib/Algebra/Ring/CompTypeclasses.lean index a2fcb1e9213882..9347bdd1eb8cb1 100644 --- a/Mathlib/Algebra/Ring/CompTypeclasses.lean +++ b/Mathlib/Algebra/Ring/CompTypeclasses.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Ring.Equiv +module + +public import Mathlib.Algebra.Ring.Equiv /-! # Propositional typeclasses on several ring homs @@ -40,6 +42,8 @@ Instances of these typeclasses mostly involving `RingHom.id` are also provided: `RingHomCompTriple`, `RingHomInvPair`, `RingHomSurjective` -/ +@[expose] public section + variable {R₁ : Type*} {R₂ : Type*} {R₃ : Type*} variable [Semiring R₁] [Semiring R₂] [Semiring R₃] diff --git a/Mathlib/Algebra/Ring/Defs.lean b/Mathlib/Algebra/Ring/Defs.lean index 0db5d592957ee8..e483c52bae29ca 100644 --- a/Mathlib/Algebra/Ring/Defs.lean +++ b/Mathlib/Algebra/Ring/Defs.lean @@ -3,12 +3,12 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Data.Int.Cast.Defs -import Mathlib.Tactic.Spread -import Mathlib.Util.AssertExists -import Mathlib.Tactic.StacksAttribute +module + +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Data.Int.Cast.Defs +public import Mathlib.Tactic.Spread +public import Mathlib.Tactic.StacksAttribute /-! # Semirings and rings @@ -35,6 +35,8 @@ the present file is about their interaction. `Semiring`, `CommSemiring`, `Ring`, `CommRing`, domain, `IsDomain`, nonzero, units -/ +@[expose] public section + /-! Previously an import dependency on `Mathlib/Algebra/Group/Basic.lean` had crept in. diff --git a/Mathlib/Algebra/Ring/Divisibility/Basic.lean b/Mathlib/Algebra/Ring/Divisibility/Basic.lean index 1a9a4bdbc74cda..d00b8e581f8fe5 100644 --- a/Mathlib/Algebra/Ring/Divisibility/Basic.lean +++ b/Mathlib/Algebra/Ring/Divisibility/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Divisibility.Hom -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Divisibility.Hom +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Algebra.Ring.Defs /-! # Lemmas about divisibility in rings @@ -15,6 +17,8 @@ imports. Further results about divisibility in rings may be found in `Mathlib/Algebra/Ring/Divisibility/Lemmas.lean` which is not subject to this import constraint. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Algebra/Ring/Divisibility/Lemmas.lean b/Mathlib/Algebra/Ring/Divisibility/Lemmas.lean index 4450259e6bd609..2c344b25bd860c 100644 --- a/Mathlib/Algebra/Ring/Divisibility/Lemmas.lean +++ b/Mathlib/Algebra/Ring/Divisibility/Lemmas.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.Algebra.GCDMonoid.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.Algebra.GCDMonoid.Basic /-! # Lemmas about divisibility in rings @@ -18,6 +20,8 @@ import Mathlib.Algebra.GCDMonoid.Basic `x ^ m ∣ (x + y) ^ p` for sufficiently large `p` (together with many variations for convenience). -/ +@[expose] public section + variable {R : Type*} lemma dvd_smul_of_dvd {M : Type*} [SMul M R] [Semigroup R] [SMulCommClass M R R] {x y : R} diff --git a/Mathlib/Algebra/Ring/Equiv.lean b/Mathlib/Algebra/Ring/Equiv.lean index f922254e535cc6..8ef6d2dbc3605e 100644 --- a/Mathlib/Algebra/Ring/Equiv.lean +++ b/Mathlib/Algebra/Ring/Equiv.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Callum Sutton, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Equiv.Opposite -import Mathlib.Algebra.GroupWithZero.Equiv -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Logic.Equiv.Set -import Mathlib.Algebra.Notation.Prod +module + +public import Mathlib.Algebra.Group.Equiv.Opposite +public import Mathlib.Algebra.GroupWithZero.Equiv +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Logic.Equiv.Set /-! # (Semi)ring equivs @@ -37,6 +39,8 @@ multiplication in `Equiv.Perm`, and multiplication in `CategoryTheory.End`, not Equiv, MulEquiv, AddEquiv, RingEquiv, MulAut, AddAut, RingAut -/ +@[expose] public section + -- guard against import creep assert_not_exists Field Fintype diff --git a/Mathlib/Algebra/Ring/Ext.lean b/Mathlib/Algebra/Ring/Ext.lean index 3542d4206056ad..025446922cb9b9 100644 --- a/Mathlib/Algebra/Ring/Ext.lean +++ b/Mathlib/Algebra/Ring/Ext.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Raghuram Sundararajan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Raghuram Sundararajan -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Group.Ext +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Group.Ext /-! # Extensionality lemmas for rings and similar structures @@ -27,6 +29,8 @@ sometimes we don't need them to prove extensionality. semiring, ring, extensionality -/ +@[expose] public section + local macro:max "local_hAdd[" type:term ", " inst:term "]" : term => `(term| (letI := $inst; HAdd.hAdd : $type → $type → $type)) local macro:max "local_hMul[" type:term ", " inst:term "]" : term => diff --git a/Mathlib/Algebra/Ring/Fin.lean b/Mathlib/Algebra/Ring/Fin.lean index bcdd132277aeee..7e13865e99fa0a 100644 --- a/Mathlib/Algebra/Ring/Fin.lean +++ b/Mathlib/Algebra/Ring/Fin.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Data.Fin.Tuple.Basic +module + +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Data.Fin.Tuple.Basic /-! # Rings and `Fin` @@ -17,6 +19,8 @@ This file collects some basic results involving rings and the `Fin` type -/ +@[expose] public section + /-- The product over `Fin 2` of some rings is just the Cartesian product of these rings. -/ @[simps] diff --git a/Mathlib/Algebra/Ring/GeomSum.lean b/Mathlib/Algebra/Ring/GeomSum.lean index eaa55949cb7e4f..04658cde9deb13 100644 --- a/Mathlib/Algebra/Ring/GeomSum.lean +++ b/Mathlib/Algebra/Ring/GeomSum.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Ring.Opposite +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Ring.Opposite /-! # Partial sums of geometric series in a ring @@ -18,6 +20,8 @@ which `x` and `y` commute. Even versions not using division or subtraction, vali are recorded. -/ +@[expose] public section + assert_not_exists Field IsOrderedRing open Finset MulOpposite @@ -61,7 +65,7 @@ lemma op_geom_sum₂ (x y : R) (n : ℕ) : ∑ i ∈ range n, op y ^ (n - 1 - i) ∑ i ∈ range n, op y ^ i * op x ^ (n - 1 - i) := by rw [← sum_range_reflect] refine sum_congr rfl fun j j_in => ?_ - grind + grind +revert lemma geom_sum₂_with_one (x : R) (n : ℕ) : ∑ i ∈ range n, x ^ i * 1 ^ (n - 1 - i) = ∑ i ∈ range n, x ^ i := diff --git a/Mathlib/Algebra/Ring/GrindInstances.lean b/Mathlib/Algebra/Ring/GrindInstances.lean index 4e05c74e32e62f..99a12673661e7c 100644 --- a/Mathlib/Algebra/Ring/GrindInstances.lean +++ b/Mathlib/Algebra/Ring/GrindInstances.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Data.Int.Cast.Basic +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Data.Int.Cast.Basic /-! # Instances for `grind`. -/ +@[expose] public section + open Lean variable (α : Type*) diff --git a/Mathlib/Algebra/Ring/Hom/Basic.lean b/Mathlib/Algebra/Ring/Hom/Basic.lean index e72658cc1499d3..b5bd0e29eccac3 100644 --- a/Mathlib/Algebra/Ring/Hom/Basic.lean +++ b/Mathlib/Algebra/Ring/Hom/Basic.lean @@ -3,9 +3,10 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Jireh Loreaux -/ +module -import Mathlib.Algebra.Ring.Hom.InjSurj -import Mathlib.Deprecated.RingHom -import Mathlib.Tactic.Linter.DeprecatedModule +public import Mathlib.Algebra.Ring.Hom.InjSurj +public import Mathlib.Deprecated.RingHom +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-06-09") diff --git a/Mathlib/Algebra/Ring/Hom/Defs.lean b/Mathlib/Algebra/Ring/Hom/Defs.lean index 07035d769aef5a..a3f0f3bdb9d5ad 100644 --- a/Mathlib/Algebra/Ring/Hom/Defs.lean +++ b/Mathlib/Algebra/Ring/Hom/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Jireh Loreaux -/ -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Ring.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Ring.Basic /-! # Homomorphisms of semirings and rings @@ -41,6 +43,8 @@ groups, we use the same structure `RingHom a β`, a.k.a. `α →+* β`, for both `RingHom`, `SemiringHom` -/ +@[expose] public section + assert_not_exists Function.Injective.mulZeroClass semigroupDvd Units.map open Function diff --git a/Mathlib/Algebra/Ring/Hom/InjSurj.lean b/Mathlib/Algebra/Ring/Hom/InjSurj.lean index 9e413df2e23275..f92af6822b2770 100644 --- a/Mathlib/Algebra/Ring/Hom/InjSurj.lean +++ b/Mathlib/Algebra/Ring/Hom/InjSurj.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Jireh Loreaux -/ -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Algebra.Ring.Defs /-! # Pulling back rings along injective maps, and pushing them forward along surjective maps -/ +@[expose] public section + open Function variable {α β : Type*} diff --git a/Mathlib/Algebra/Ring/Idempotent.lean b/Mathlib/Algebra/Ring/Idempotent.lean index 341431b55a3401..2be8e2d4599ea0 100644 --- a/Mathlib/Algebra/Ring/Idempotent.lean +++ b/Mathlib/Algebra/Ring/Idempotent.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.GroupWithZero.Idempotent -import Mathlib.Algebra.Ring.Defs -import Mathlib.Order.Notation -import Mathlib.Tactic.Convert -import Mathlib.Algebra.Group.Torsion +module + +public import Mathlib.Algebra.GroupWithZero.Idempotent +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Order.Notation +public import Mathlib.Tactic.Convert +public import Mathlib.Algebra.Group.Torsion /-! # Idempotent elements of a ring @@ -17,6 +19,8 @@ This file proves result about idempotent elements of a ring, like: `1 - a` is an idempotent. -/ +@[expose] public section + variable {R : Type*} namespace IsIdempotentElem diff --git a/Mathlib/Algebra/Ring/Identities.lean b/Mathlib/Algebra/Ring/Identities.lean index a3c111282fdd3f..ea7ef5e6d6b342 100644 --- a/Mathlib/Algebra/Ring/Identities.lean +++ b/Mathlib/Algebra/Ring/Identities.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Bryan Gin-ge Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bryan Gin-ge Chen, Kevin Lacker -/ -import Mathlib.Tactic.Ring +module + +public import Mathlib.Tactic.Ring /-! # Identities @@ -11,6 +13,8 @@ import Mathlib.Tactic.Ring This file contains some "named" commutative ring identities. -/ +@[expose] public section + variable {R : Type*} [CommRing R] {a b x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ y₁ y₂ y₃ y₄ y₅ y₆ y₇ y₈ n : R} diff --git a/Mathlib/Algebra/Ring/InjSurj.lean b/Mathlib/Algebra/Ring/InjSurj.lean index 3c48e069b40b5d..3f84fc7fd0c96e 100644 --- a/Mathlib/Algebra/Ring/InjSurj.lean +++ b/Mathlib/Algebra/Ring/InjSurj.lean @@ -3,10 +3,12 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Opposites -import Mathlib.Algebra.GroupWithZero.InjSurj -import Mathlib.Data.Int.Cast.Basic +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Opposites +public import Mathlib.Algebra.GroupWithZero.InjSurj +public import Mathlib.Data.Int.Cast.Basic /-! # Pulling back rings along injective maps, and pushing them forward along surjective maps @@ -22,6 +24,8 @@ As a result, we must use `Function.swap` when using additivised transfer definit non-additivised ones. -/ +@[expose] public section + variable {R S : Type*} namespace Function.Injective diff --git a/Mathlib/Algebra/Ring/Int/Defs.lean b/Mathlib/Algebra/Ring/Int/Defs.lean index d7164263eb3f14..d01a764a09c32a 100644 --- a/Mathlib/Algebra/Ring/Int/Defs.lean +++ b/Mathlib/Algebra/Ring/Int/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Data.Int.Basic -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Algebra.Ring.GrindInstances +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Data.Int.Basic +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Algebra.Ring.GrindInstances /-! # The integers are a ring @@ -18,6 +20,8 @@ This file contains the commutative ring instance on `ℤ`. See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists DenselyOrdered Set.Subsingleton namespace Int @@ -32,8 +36,8 @@ instance instCommRing : CommRing ℤ where mul_one := Int.mul_one one_mul := Int.one_mul npow n x := x ^ n - npow_zero _ := rfl - npow_succ _ _ := rfl + npow_zero _ := by simp + npow_succ _ _ := by simp [Int.pow_succ] natCast := (·) natCast_zero := rfl natCast_succ _ := rfl diff --git a/Mathlib/Algebra/Ring/Int/Parity.lean b/Mathlib/Algebra/Ring/Int/Parity.lean index dd5d7ce62d326a..a46dc50987ca68 100644 --- a/Mathlib/Algebra/Ring/Int/Parity.lean +++ b/Mathlib/Algebra/Ring/Int/Parity.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Ring.Parity -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Group.Int.Even +module + +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Group.Int.Even /-! # Basic parity lemmas for the ring `ℤ` @@ -13,6 +15,8 @@ import Mathlib.Algebra.Group.Int.Even See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists DenselyOrdered Set.Subsingleton namespace Int @@ -44,7 +48,6 @@ lemma even_xor'_odd (n : ℤ) : Xor' (Even n) (Odd n) := by lemma even_xor'_odd' (n : ℤ) : ∃ k, Xor' (n = 2 * k) (n = 2 * k + 1) := by rcases even_or_odd n with (⟨k, rfl⟩ | ⟨k, rfl⟩) <;> · use k - simp only [Xor'] -- Perhaps `grind` needs a normalization rule for `Xor'`? grind instance : DecidablePred (Odd : ℤ → Prop) := fun _ => decidable_of_iff _ not_even_iff_odd diff --git a/Mathlib/Algebra/Ring/Int/Units.lean b/Mathlib/Algebra/Ring/Int/Units.lean index f987c97ac1f8ee..b5fdd79b36598e 100644 --- a/Mathlib/Algebra/Ring/Int/Units.lean +++ b/Mathlib/Algebra/Ring/Int/Units.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Ring.Units -import Mathlib.Algebra.Group.Int.Units +module + +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Ring.Units +public import Mathlib.Algebra.Group.Int.Units /-! # Basic lemmas for `ℤˣ`. @@ -19,6 +21,8 @@ This file contains lemmas on the units of `ℤ`. See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists DenselyOrdered Set.Subsingleton namespace Int diff --git a/Mathlib/Algebra/Ring/Invertible.lean b/Mathlib/Algebra/Ring/Invertible.lean index d7d0fca8ad4a06..dccc6cc68610fd 100644 --- a/Mathlib/Algebra/Ring/Invertible.lean +++ b/Mathlib/Algebra/Ring/Invertible.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.GroupWithZero.Invertible -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Invertible +public import Mathlib.Algebra.Ring.Defs /-! # Theorems about additively and multiplicatively invertible elements in rings -/ +@[expose] public section + variable {R : Type*} section NonUnitalNonAssocSemiring diff --git a/Mathlib/Algebra/Ring/MinimalAxioms.lean b/Mathlib/Algebra/Ring/MinimalAxioms.lean index 785c415a9e2054..29e7416c385766 100644 --- a/Mathlib/Algebra/Ring/MinimalAxioms.lean +++ b/Mathlib/Algebra/Ring/MinimalAxioms.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.MinimalAxioms +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.MinimalAxioms /-! # Minimal Axioms for a Ring @@ -22,6 +23,8 @@ a minimum number of equalities. -/ +@[expose] public section + universe u /-- Define a `Ring` structure on a Type by proving a minimized set of axioms. diff --git a/Mathlib/Algebra/Ring/Nat.lean b/Mathlib/Algebra/Ring/Nat.lean index 7fb0e2873bf242..2983800a25ff3e 100644 --- a/Mathlib/Algebra/Ring/Nat.lean +++ b/Mathlib/Algebra/Ring/Nat.lean @@ -3,10 +3,12 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.GroupWithZero.Nat -import Mathlib.Algebra.Ring.Defs -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.GroupWithZero.Nat +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Data.Nat.Basic /-! # The natural numbers form a semiring @@ -16,6 +18,8 @@ This file contains the commutative semiring instance on the natural numbers. See note [foundational algebra order theory]. -/ +@[expose] public section + namespace Nat instance instAddMonoidWithOne : AddMonoidWithOne ℕ where diff --git a/Mathlib/Algebra/Ring/NegOnePow.lean b/Mathlib/Algebra/Ring/NegOnePow.lean index 82d71d63694400..2d43d5bf09e5ff 100644 --- a/Mathlib/Algebra/Ring/NegOnePow.lean +++ b/Mathlib/Algebra/Ring/NegOnePow.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Johan Commelin -/ -import Mathlib.Algebra.Ring.Int.Parity -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.Data.ZMod.IntUnitsPower +module + +public import Mathlib.Algebra.Ring.Int.Parity +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.Data.ZMod.IntUnitsPower /-! # Integer powers of (-1) @@ -17,6 +19,8 @@ Johan Commelin to the Liquid Tensor Experiment. -/ +@[expose] public section + assert_not_exists Field assert_not_exists TwoSidedIdeal diff --git a/Mathlib/Algebra/Ring/NonZeroDivisors.lean b/Mathlib/Algebra/Ring/NonZeroDivisors.lean index 3563cc44c8ba83..0ac4f34071f8d9 100644 --- a/Mathlib/Algebra/Ring/NonZeroDivisors.lean +++ b/Mathlib/Algebra/Ring/NonZeroDivisors.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.Regular.Basic -import Mathlib.Algebra.Regular.Opposite -import Mathlib.Algebra.Ring.Basic +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.Algebra.Regular.Opposite +public import Mathlib.Algebra.Ring.Basic /-! # Non-zero divisors in a ring -/ +@[expose] public section + assert_not_exists Field open scoped nonZeroDivisors diff --git a/Mathlib/Algebra/Ring/Opposite.lean b/Mathlib/Algebra/Ring/Opposite.lean index beb48103be5747..035f922bc9a369 100644 --- a/Mathlib/Algebra/Ring/Opposite.lean +++ b/Mathlib/Algebra/Ring/Opposite.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.Equiv.Opposite -import Mathlib.Algebra.GroupWithZero.Opposite -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Data.Int.Cast.Basic +module + +public import Mathlib.Algebra.Group.Equiv.Opposite +public import Mathlib.Algebra.GroupWithZero.Opposite +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Data.Int.Cast.Basic /-! # Ring structures on the multiplicative opposite -/ +@[expose] public section + variable {R : Type*} namespace MulOpposite diff --git a/Mathlib/Algebra/Ring/PUnit.lean b/Mathlib/Algebra/Ring/PUnit.lean index 18dc75b92b2b24..fe1926c1f368b9 100644 --- a/Mathlib/Algebra/Ring/PUnit.lean +++ b/Mathlib/Algebra/Ring/PUnit.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Group.PUnit -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.Algebra.Ring.Defs /-! # `PUnit` is a commutative ring @@ -13,6 +15,8 @@ This file collects facts about algebraic structures on the one-element type, e.g commutative ring. -/ +@[expose] public section + assert_not_exists Field namespace PUnit diff --git a/Mathlib/Algebra/Ring/Parity.lean b/Mathlib/Algebra/Ring/Parity.lean index 97266988f23797..dc90e859de55fc 100644 --- a/Mathlib/Algebra/Ring/Parity.lean +++ b/Mathlib/Algebra/Ring/Parity.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Nat.Even -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Data.Nat.Cast.Commute -import Mathlib.Data.Set.Operations -import Mathlib.Logic.Function.Iterate +module + +public import Mathlib.Algebra.Group.Nat.Even +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Data.Nat.Cast.Commute +public import Mathlib.Data.Set.Operations +public import Mathlib.Logic.Function.Iterate /-! # Even and odd elements in rings @@ -27,6 +29,8 @@ to `Mathlib/Algebra/Group/Even.lean`. `Mathlib/Algebra/Group/Even.lean` for the definition of even elements. -/ +@[expose] public section + assert_not_exists DenselyOrdered IsOrderedRing open MulOpposite diff --git a/Mathlib/Algebra/Ring/Periodic.lean b/Mathlib/Algebra/Ring/Periodic.lean index 400fdb8bbd44f0..e7436057f31ab5 100644 --- a/Mathlib/Algebra/Ring/Periodic.lean +++ b/Mathlib/Algebra/Ring/Periodic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Benjamin Davidson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Benjamin Davidson -/ -import Mathlib.Algebra.Ring.NegOnePow +module + +public import Mathlib.Algebra.Ring.NegOnePow /-! # Periodicity @@ -25,6 +27,8 @@ Note that any `c`-antiperiodic function will necessarily also be `2 • c`-perio period, periodic, periodicity, antiperiodic -/ +@[expose] public section + assert_not_exists Field variable {α β γ : Type*} {f g : α → β} {c c₁ c₂ x : α} diff --git a/Mathlib/Algebra/Ring/Pi.lean b/Mathlib/Algebra/Ring/Pi.lean index 9c868b76162b36..26a96114236770 100644 --- a/Mathlib/Algebra/Ring/Pi.lean +++ b/Mathlib/Algebra/Ring/Pi.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Patrick Massot -/ -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.GroupWithZero.Pi -import Mathlib.Algebra.Ring.CompTypeclasses -import Mathlib.Algebra.Ring.Hom.Defs +module + +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.GroupWithZero.Pi +public import Mathlib.Algebra.Ring.CompTypeclasses +public import Mathlib.Algebra.Ring.Hom.Defs /-! # Pi instances for ring @@ -14,6 +16,8 @@ import Mathlib.Algebra.Ring.Hom.Defs This file defines instances for ring, semiring and related structures on Pi Types -/ +@[expose] public section + -- Porting note: used to import `tactic.pi_instances` namespace Pi diff --git a/Mathlib/Algebra/Ring/Pointwise/Finset.lean b/Mathlib/Algebra/Ring/Pointwise/Finset.lean index 03d4bcb4f3813f..b204f119c27883 100644 --- a/Mathlib/Algebra/Ring/Pointwise/Finset.lean +++ b/Mathlib/Algebra/Ring/Pointwise/Finset.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Ring.Pointwise.Set -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Ring.Pointwise.Set +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Pointwise operations of sets in a ring @@ -18,6 +20,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists MulAction open scoped Pointwise diff --git a/Mathlib/Algebra/Ring/Pointwise/Set.lean b/Mathlib/Algebra/Ring/Pointwise/Set.lean index 9151d320ce4eb3..3e16932b7c0ad3 100644 --- a/Mathlib/Algebra/Ring/Pointwise/Set.lean +++ b/Mathlib/Algebra/Ring/Pointwise/Set.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise operations of sets in a ring @@ -17,6 +19,8 @@ set multiplication, set addition, pointwise addition, pointwise multiplication, pointwise subtraction -/ +@[expose] public section + assert_not_exists MulAction IsOrderedMonoid Field open Function diff --git a/Mathlib/Algebra/Ring/Prod.lean b/Mathlib/Algebra/Ring/Prod.lean index 2ed24e54a123e6..16dda7ec38aa78 100644 --- a/Mathlib/Algebra/Ring/Prod.lean +++ b/Mathlib/Algebra/Ring/Prod.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Chris Hughes, Mario Carneiro, Yury Kudryashov -/ -import Mathlib.Data.Int.Cast.Prod -import Mathlib.Algebra.GroupWithZero.Prod -import Mathlib.Algebra.Ring.CompTypeclasses -import Mathlib.Algebra.Ring.Equiv +module + +public import Mathlib.Data.Int.Cast.Prod +public import Mathlib.Algebra.GroupWithZero.Prod +public import Mathlib.Algebra.Ring.CompTypeclasses +public import Mathlib.Algebra.Ring.Equiv /-! # Semiring, ring etc. structures on `R × S` @@ -22,6 +24,8 @@ trivial `simp` lemmas, and define the following operations on `RingHom`s and sim sends `(x, y)` to `(f x, g y)`. -/ +@[expose] public section + variable {R R' S S' T : Type*} diff --git a/Mathlib/Algebra/Ring/Rat.lean b/Mathlib/Algebra/Ring/Rat.lean index 5c4fe8b6dff9a8..b776e39b8f9fe2 100644 --- a/Mathlib/Algebra/Ring/Rat.lean +++ b/Mathlib/Algebra/Ring/Rat.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Ring.Basic -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Rat.Defs -import Mathlib.Algebra.Group.Nat.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Ring.Basic +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Rat.Defs +public import Mathlib.Algebra.Group.Nat.Defs /-! # The rational numbers are a commutative ring @@ -17,6 +19,8 @@ This file contains the commutative ring instance on the rational numbers. See note [foundational algebra order theory]. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Field PNat Nat.gcd_greatest IsDomain.toCancelMonoidWithZero namespace Rat diff --git a/Mathlib/Algebra/Ring/Regular.lean b/Mathlib/Algebra/Ring/Regular.lean index 3fbd523172fd5d..c848a2697e27fb 100644 --- a/Mathlib/Algebra/Ring/Regular.lean +++ b/Mathlib/Algebra/Ring/Regular.lean @@ -3,14 +3,18 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.Ring.Defs /-! # Lemmas about regular elements in rings. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Algebra/Ring/Semiconj.lean b/Mathlib/Algebra/Ring/Semiconj.lean index 9a2596fbc9c227..dd97eab2db1a95 100644 --- a/Mathlib/Algebra/Ring/Semiconj.lean +++ b/Mathlib/Algebra/Ring/Semiconj.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Group.Semiconj.Defs -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Semiconj.Defs +public import Mathlib.Algebra.Ring.Defs /-! # Semirings and rings @@ -18,6 +20,8 @@ For the definitions of semirings and rings see `Mathlib/Algebra/Ring/Defs.lean`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Ring/Semireal/Defs.lean b/Mathlib/Algebra/Ring/Semireal/Defs.lean index 6b64b60a5c274b..1cf14a08274f8f 100644 --- a/Mathlib/Algebra/Ring/Semireal/Defs.lean +++ b/Mathlib/Algebra/Ring/Semireal/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Florent Schaffhauser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Florent Schaffhauser, Artie Khovanov -/ -import Mathlib.Algebra.Ring.SumsOfSquares +module + +public import Mathlib.Algebra.Ring.SumsOfSquares /-! # Semireal rings @@ -23,6 +25,8 @@ not. [lam_1984](https://doi.org/10.1216/RMJ-1984-14-4-767) -/ +@[expose] public section + variable {R : Type*} variable (R) in diff --git a/Mathlib/Algebra/Ring/Shrink.lean b/Mathlib/Algebra/Ring/Shrink.lean index dbf637dcb87f17..612e7bffaf1e6e 100644 --- a/Mathlib/Algebra/Ring/Shrink.lean +++ b/Mathlib/Algebra/Ring/Shrink.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Shrink -import Mathlib.Algebra.Ring.TransferInstance +module + +public import Mathlib.Algebra.Group.Shrink +public import Mathlib.Algebra.Ring.TransferInstance /-! # Transfer ring structures from `α` to `Shrink α` -/ +@[expose] public section + noncomputable section namespace Shrink diff --git a/Mathlib/Algebra/Ring/Subgroup.lean b/Mathlib/Algebra/Ring/Subgroup.lean index 79fde5f0e0409d..ea25a3b71b35f3 100644 --- a/Mathlib/Algebra/Ring/Subgroup.lean +++ b/Mathlib/Algebra/Ring/Subgroup.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.GroupWithZero.Subgroup -import Mathlib.Algebra.Ring.Submonoid.Pointwise -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Subgroup +public import Mathlib.Algebra.Ring.Submonoid.Pointwise +public import Mathlib.Algebra.Module.Defs /-! # Additive subgroups of rings -/ +@[expose] public section + open scoped Pointwise variable {R M : Type*} diff --git a/Mathlib/Algebra/Ring/Submonoid.lean b/Mathlib/Algebra/Ring/Submonoid.lean index d33e3b8062cfb2..02ab89ecfdabf8 100644 --- a/Mathlib/Algebra/Ring/Submonoid.lean +++ b/Mathlib/Algebra/Ring/Submonoid.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Algebra.Ring.Defs -import Mathlib.Tactic.MinImports -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Tactic.MinImports +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-09") diff --git a/Mathlib/Algebra/Ring/Submonoid/Basic.lean b/Mathlib/Algebra/Ring/Submonoid/Basic.lean index eed649eab505eb..9ed2e26902ec4c 100644 --- a/Mathlib/Algebra/Ring/Submonoid/Basic.lean +++ b/Mathlib/Algebra/Ring/Submonoid/Basic.lean @@ -4,11 +4,15 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Algebra.Ring.Defs /-! # Lemmas about additive closures of `Subsemigroup`. -/ +@[expose] public section + open AddSubmonoid namespace MulMemClass diff --git a/Mathlib/Algebra/Ring/Submonoid/Pointwise.lean b/Mathlib/Algebra/Ring/Submonoid/Pointwise.lean index 0fd37e3624b5f4..5da4b2e6de95b3 100644 --- a/Mathlib/Algebra/Ring/Submonoid/Pointwise.lean +++ b/Mathlib/Algebra/Ring/Submonoid/Pointwise.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard, Amelia Livingston, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Submonoid.Pointwise -import Mathlib.Algebra.Module.Defs -import Mathlib.Data.Nat.Cast.Basic +module + +public import Mathlib.Algebra.Group.Submonoid.Pointwise +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Data.Nat.Cast.Basic /-! # Elementwise monoid structure of additive submonoids @@ -35,6 +37,8 @@ multiplication, but results requiring right distributivity do not have SMul vers due to the lack of a suitable typeclass (unless one goes all the way to `Module`). -/ +@[expose] public section + open AddSubmonoid Set open scoped Pointwise diff --git a/Mathlib/Algebra/Ring/Subring/Basic.lean b/Mathlib/Algebra/Ring/Subring/Basic.lean index 3320aa6ae2de48..33f4d1f35efb3e 100644 --- a/Mathlib/Algebra/Ring/Subring/Basic.lean +++ b/Mathlib/Algebra/Ring/Subring/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Ashvni Narayanan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ashvni Narayanan -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.Algebra.Ring.Subring.Defs -import Mathlib.Algebra.Ring.Subsemiring.Basic -import Mathlib.RingTheory.NonUnitalSubring.Defs -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.Algebra.Ring.Subring.Defs +public import Mathlib.Algebra.Ring.Subsemiring.Basic +public import Mathlib.RingTheory.NonUnitalSubring.Defs +public import Mathlib.Data.Set.Finite.Basic /-! # Subrings @@ -58,6 +60,8 @@ Lattice inclusion (e.g. `≤` and `⊓`) is used rather than set notation (`⊆` subring, subrings -/ +@[expose] public section + assert_not_exists IsOrderedRing universe u v w diff --git a/Mathlib/Algebra/Ring/Subring/Defs.lean b/Mathlib/Algebra/Ring/Subring/Defs.lean index d2e10102b43e68..687db4eed5b909 100644 --- a/Mathlib/Algebra/Ring/Subring/Defs.lean +++ b/Mathlib/Algebra/Ring/Subring/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Ashvni Narayanan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ashvni Narayanan -/ -import Mathlib.Algebra.Ring.Subsemiring.Defs -import Mathlib.RingTheory.NonUnitalSubring.Defs +module + +public import Mathlib.Algebra.Ring.Subsemiring.Defs +public import Mathlib.RingTheory.NonUnitalSubring.Defs /-! # Subrings @@ -61,6 +63,8 @@ Lattice inclusion (e.g. `≤` and `⊓`) is used rather than set notation (`⊆` subring, subrings -/ +@[expose] public section + assert_not_exists RelIso Even IsOrderedMonoid universe u v w diff --git a/Mathlib/Algebra/Ring/Subring/IntPolynomial.lean b/Mathlib/Algebra/Ring/Subring/IntPolynomial.lean index 211df9171d84a3..8ecf9812305533 100644 --- a/Mathlib/Algebra/Ring/Subring/IntPolynomial.lean +++ b/Mathlib/Algebra/Ring/Subring/IntPolynomial.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.Polynomial.AlgebraMap +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap /-! # Polynomials over subrings. @@ -13,11 +15,13 @@ with coefficients in `R` to `R[X]`. We provide several lemmas to deal with coefficients, degree, and evaluation of `Polynomial.int`. This is useful when dealing with integral elements in an extension of fields. -# Main Definitions +## Main Definitions * `Polynomial.int` : given a polynomial `P` in `K[X]` whose coefficients all belong to a subring `R` of the field `K`, `P.int R` is the corresponding polynomial in `R[X]`. -/ +@[expose] public section + variable {K : Type*} [Field K] (R : Subring K) open scoped Polynomial diff --git a/Mathlib/Algebra/Ring/Subring/MulOpposite.lean b/Mathlib/Algebra/Ring/Subring/MulOpposite.lean index f51fd743c3738f..e693845c6aabf2 100644 --- a/Mathlib/Algebra/Ring/Subring/MulOpposite.lean +++ b/Mathlib/Algebra/Ring/Subring/MulOpposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Ring.Subsemiring.MulOpposite -import Mathlib.Algebra.Ring.Subring.Basic +module + +public import Mathlib.Algebra.Ring.Subsemiring.MulOpposite +public import Mathlib.Algebra.Ring.Subring.Basic /-! @@ -14,6 +16,8 @@ For every ring `R`, we construct an equivalence between subrings of `R` and that -/ +@[expose] public section + namespace Subring variable {ι : Sort*} {R : Type*} [Ring R] diff --git a/Mathlib/Algebra/Ring/Subring/Order.lean b/Mathlib/Algebra/Ring/Subring/Order.lean index 45ef3b127b6399..75996567c47603 100644 --- a/Mathlib/Algebra/Ring/Subring/Order.lean +++ b/Mathlib/Algebra/Ring/Subring/Order.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Order.Hom.Ring -import Mathlib.Algebra.Order.Ring.InjSurj -import Mathlib.Algebra.Ring.Subring.Defs +module + +public import Mathlib.Algebra.Order.Hom.Ring +public import Mathlib.Algebra.Order.Ring.InjSurj +public import Mathlib.Algebra.Ring.Subring.Defs /-! @@ -20,6 +22,8 @@ We study subrings of ordered rings and prove their basic properties. -/ +@[expose] public section + namespace Subring variable {R : Type*} diff --git a/Mathlib/Algebra/Ring/Subring/Pointwise.lean b/Mathlib/Algebra/Ring/Subring/Pointwise.lean index 326a25bd2b9d27..0a7c8ab5b332e6 100644 --- a/Mathlib/Algebra/Ring/Subring/Pointwise.lean +++ b/Mathlib/Algebra/Ring/Subring/Pointwise.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Subgroup -import Mathlib.Algebra.Ring.Subring.Basic -import Mathlib.Algebra.Ring.Subsemiring.Pointwise +module + +public import Mathlib.Algebra.GroupWithZero.Subgroup +public import Mathlib.Algebra.Ring.Subring.Basic +public import Mathlib.Algebra.Ring.Subsemiring.Pointwise /-! # Pointwise instances on `Subring`s @@ -21,6 +23,8 @@ possible, try to keep them in sync. -/ +@[expose] public section + open Set diff --git a/Mathlib/Algebra/Ring/Subring/Units.lean b/Mathlib/Algebra/Ring/Subring/Units.lean index d32c5d0cbe4c45..2ced35b1d82cc1 100644 --- a/Mathlib/Algebra/Ring/Subring/Units.lean +++ b/Mathlib/Algebra/Ring/Subring/Units.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Order.GroupWithZero.Submonoid -import Mathlib.Algebra.Order.Ring.Defs +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Order.GroupWithZero.Submonoid +public import Mathlib.Algebra.Order.Ring.Defs /-! @@ -14,6 +16,8 @@ import Mathlib.Algebra.Order.Ring.Defs -/ +@[expose] public section + /-- The subgroup of positive units of a linear ordered semiring. -/ def Units.posSubgroup (R : Type*) [Semiring R] [LinearOrder R] [IsStrictOrderedRing R] : Subgroup Rˣ := diff --git a/Mathlib/Algebra/Ring/Subsemiring/Basic.lean b/Mathlib/Algebra/Ring/Subsemiring/Basic.lean index 3558ede5af0463..2d73b345f7b4d4 100644 --- a/Mathlib/Algebra/Ring/Subsemiring/Basic.lean +++ b/Mathlib/Algebra/Ring/Subsemiring/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Ring.Action.Subobjects -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.Prod -import Mathlib.Algebra.Ring.Subsemiring.Defs -import Mathlib.GroupTheory.Submonoid.Centralizer -import Mathlib.RingTheory.NonUnitalSubsemiring.Basic -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Ring.Action.Subobjects +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Algebra.Ring.Subsemiring.Defs +public import Mathlib.GroupTheory.Submonoid.Centralizer +public import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +public import Mathlib.Algebra.Module.Defs /-! # Bundled subsemirings @@ -19,6 +21,8 @@ We define some standard constructions on bundled subsemirings: `CompleteLattice` subsemiring `map`, `comap` and range (`rangeS`) of a `RingHom` etc. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Ring/Subsemiring/Defs.lean b/Mathlib/Algebra/Ring/Subsemiring/Defs.lean index b4b73658dc4504..10b5a6089cc098 100644 --- a/Mathlib/Algebra/Ring/Subsemiring/Defs.lean +++ b/Mathlib/Algebra/Ring/Subsemiring/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.RingTheory.NonUnitalSubsemiring.Defs +module + +public import Mathlib.RingTheory.NonUnitalSubsemiring.Defs /-! # Bundled subsemirings @@ -12,6 +14,8 @@ We define bundled subsemirings and some standard constructions: `subtype` and `i ring homomorphisms. -/ +@[expose] public section + assert_not_exists RelIso universe u v w diff --git a/Mathlib/Algebra/Ring/Subsemiring/MulOpposite.lean b/Mathlib/Algebra/Ring/Subsemiring/MulOpposite.lean index 4bfbfecdaae76c..f99d361ceae8e2 100644 --- a/Mathlib/Algebra/Ring/Subsemiring/MulOpposite.lean +++ b/Mathlib/Algebra/Ring/Subsemiring/MulOpposite.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Group.Submonoid.MulOpposite -import Mathlib.Algebra.Ring.Subsemiring.Basic -import Mathlib.Algebra.Ring.Opposite +module + +public import Mathlib.Algebra.Group.Submonoid.MulOpposite +public import Mathlib.Algebra.Ring.Subsemiring.Basic +public import Mathlib.Algebra.Ring.Opposite /-! @@ -15,6 +17,8 @@ For every semiring `R`, we construct an equivalence between subsemirings of `R` -/ +@[expose] public section + namespace Subsemiring variable {ι : Sort*} {R : Type*} [NonAssocSemiring R] diff --git a/Mathlib/Algebra/Ring/Subsemiring/Order.lean b/Mathlib/Algebra/Ring/Subsemiring/Order.lean index d82ec2b57bbe8a..0df2b55ac24923 100644 --- a/Mathlib/Algebra/Ring/Subsemiring/Order.lean +++ b/Mathlib/Algebra/Ring/Subsemiring/Order.lean @@ -3,15 +3,19 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Order.Ring.InjSurj -import Mathlib.Algebra.Ring.Subsemiring.Defs -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Order.Ring.InjSurj +public import Mathlib.Algebra.Ring.Subsemiring.Defs +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Tactic.FastInstance /-! # `Order`ed instances for `SubsemiringClass` and `Subsemiring`. -/ +@[expose] public section + namespace SubsemiringClass variable {R S : Type*} [SetLike S R] (s : S) diff --git a/Mathlib/Algebra/Ring/Subsemiring/Pointwise.lean b/Mathlib/Algebra/Ring/Subsemiring/Pointwise.lean index 19a645fcd81d2e..46a92aff39a426 100644 --- a/Mathlib/Algebra/Ring/Subsemiring/Pointwise.lean +++ b/Mathlib/Algebra/Ring/Subsemiring/Pointwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise -import Mathlib.Algebra.Ring.Subsemiring.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise +public import Mathlib.Algebra.Ring.Subsemiring.Basic /-! # Pointwise instances on `Subsemiring`s @@ -19,6 +21,8 @@ This file is almost identical to the files `Mathlib/Algebra/GroupWithZero/Submon and `Mathlib/Algebra/Ring/Submonoid/Pointwise.lean`. Where possible, try to keep them in sync. -/ +@[expose] public section + open Set diff --git a/Mathlib/Algebra/Ring/SumsOfSquares.lean b/Mathlib/Algebra/Ring/SumsOfSquares.lean index 2d6aa823705d52..aaba308196b9cc 100644 --- a/Mathlib/Algebra/Ring/SumsOfSquares.lean +++ b/Mathlib/Algebra/Ring/SumsOfSquares.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Florent Schaffhauser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Florent Schaffhauser, Artie Khovanov -/ -import Mathlib.Algebra.Group.Subgroup.Even -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Ring.Parity -- Algebra.Group.Even can't prove `IsSquare 0` by simp -import Mathlib.Algebra.Ring.Subsemiring.Basic -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Algebra.Group.Subgroup.Even +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Ring.Parity -- Algebra.Group.Even can't prove `IsSquare 0` by simp +public import Mathlib.Algebra.Ring.Subsemiring.Basic +public import Mathlib.Tactic.ApplyFun /-! # Sums of squares @@ -25,6 +27,8 @@ We introduce a predicate for sums of squares in a ring. with multiplication. -/ +@[expose] public section + variable {R : Type*} /-- diff --git a/Mathlib/Algebra/Ring/Torsion.lean b/Mathlib/Algebra/Ring/Torsion.lean index c3307fe345c5dc..95ff9b4e7f40e9 100644 --- a/Mathlib/Algebra/Ring/Torsion.lean +++ b/Mathlib/Algebra/Ring/Torsion.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Algebra.Ring.Regular +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Algebra.Ring.Regular /-! # Torsion-free rings @@ -13,6 +15,8 @@ import Mathlib.Algebra.Ring.Regular A characteristic zero domain is torsion-free. -/ +@[expose] public section + namespace IsDomain -- This instance is potentially expensive, and is known to slow down grind. diff --git a/Mathlib/Algebra/Ring/TransferInstance.lean b/Mathlib/Algebra/Ring/TransferInstance.lean index be3e068deee8c6..dd9da001db04e6 100644 --- a/Mathlib/Algebra/Ring/TransferInstance.lean +++ b/Mathlib/Algebra/Ring/TransferInstance.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.Hom.InjSurj -import Mathlib.Algebra.Ring.InjSurj +module + +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.Hom.InjSurj +public import Mathlib.Algebra.Ring.InjSurj /-! # Transfer algebraic structures across `Equiv`s @@ -14,6 +16,8 @@ import Mathlib.Algebra.Ring.InjSurj This continues the pattern set in `Mathlib/Algebra/Group/TransferInstance.lean`. -/ +@[expose] public section + assert_not_exists Field Module namespace Equiv diff --git a/Mathlib/Algebra/Ring/ULift.lean b/Mathlib/Algebra/Ring/ULift.lean index 6c7cea1d6b6b8e..1f73c79b59f9bc 100644 --- a/Mathlib/Algebra/Ring/ULift.lean +++ b/Mathlib/Algebra/Ring/ULift.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.ULift -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Data.Int.Cast.Basic +module + +public import Mathlib.Algebra.Group.ULift +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Data.Int.Cast.Basic /-! # `ULift` instances for ring @@ -17,6 +19,8 @@ This file defines instances for ring, semiring and related structures on `ULift` We also provide `ULift.ringEquiv : ULift R ≃+* R`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Ring/Units.lean b/Mathlib/Algebra/Ring/Units.lean index 2c83953268e0d8..5ef62304cc7488 100644 --- a/Mathlib/Algebra/Ring/Units.lean +++ b/Mathlib/Algebra/Ring/Units.lean @@ -3,15 +3,19 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Yury Kudryashov, Neil Strickland -/ -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Group.Units.Hom -import Mathlib.Algebra.Ring.Hom.Defs +module + +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Group.Units.Hom +public import Mathlib.Algebra.Ring.Hom.Defs /-! # Units in semirings and rings -/ +@[expose] public section + universe u v w x diff --git a/Mathlib/Algebra/Ring/WithZero.lean b/Mathlib/Algebra/Ring/WithZero.lean index 25dd019cdf566a..aff7094b70062d 100644 --- a/Mathlib/Algebra/Ring/WithZero.lean +++ b/Mathlib/Algebra/Ring/WithZero.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Mario Carneiro, Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johan Commelin -/ -import Mathlib.Algebra.GroupWithZero.WithZero -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.GroupWithZero.WithZero +public import Mathlib.Algebra.Ring.Defs /-! # Adjoining a zero to a semiring -/ +@[expose] public section + namespace WithZero variable {α : Type*} diff --git a/Mathlib/Algebra/RingQuot.lean b/Mathlib/Algebra/RingQuot.lean index 76e1b0ce065cc1..80caee675a3841 100644 --- a/Mathlib/Algebra/RingQuot.lean +++ b/Mathlib/Algebra/RingQuot.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.Hom -import Mathlib.RingTheory.Congruence.Basic -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.RingTheory.Congruence.Basic +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Ideal.Span /-! # Quotients of semirings @@ -20,6 +22,8 @@ definition, which is made irreducible for this purpose. Since everything runs in parallel for quotients of `R`-algebras, we do that case at the same time. -/ +@[expose] public section + assert_not_exists TrivialStar universe uR uS uT uA u₄ diff --git a/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean b/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean index c60895f17f6eb8..3f6bbf831008b5 100644 --- a/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean +++ b/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 María Inés de Frutos Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos Fernández, Xavier Généreux -/ -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.Algebra.Algebra.NonUnitalHom +module + +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.Algebra.Algebra.NonUnitalHom /-! # Skew Monoid Algebras @@ -27,6 +29,8 @@ yields a not-necessarily-unital, not-necessarily-associative algebra. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Algebra/SkewMonoidAlgebra/Lift.lean b/Mathlib/Algebra/SkewMonoidAlgebra/Lift.lean index 4755d3b12a201e..255001b037d372 100644 --- a/Mathlib/Algebra/SkewMonoidAlgebra/Lift.lean +++ b/Mathlib/Algebra/SkewMonoidAlgebra/Lift.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Xavier Généreux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos Fernández, Xavier Généreux -/ -import Mathlib.Algebra.SkewMonoidAlgebra.Basic -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Algebra.Algebra.Equiv +module + +public import Mathlib.Algebra.SkewMonoidAlgebra.Basic +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Algebra.Algebra.Equiv /-! # Lemmas about different kinds of "lifts" to `SkewMonoidAlgebra`. -/ +@[expose] public section + noncomputable section namespace SkewMonoidAlgebra diff --git a/Mathlib/Algebra/SkewMonoidAlgebra/Single.lean b/Mathlib/Algebra/SkewMonoidAlgebra/Single.lean index 37f053f126d14f..fb0002d54e45c8 100644 --- a/Mathlib/Algebra/SkewMonoidAlgebra/Single.lean +++ b/Mathlib/Algebra/SkewMonoidAlgebra/Single.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Xavier Généreux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos Fernández, Xavier Généreux -/ -import Mathlib.Algebra.SkewMonoidAlgebra.Basic +module + +public import Mathlib.Algebra.SkewMonoidAlgebra.Basic /-! # Modifying skew monoid algebra at exactly one point @@ -11,6 +13,8 @@ This file contains basic results on updating/erasing an element of a skew monoid one point of the domain. -/ +@[expose] public section + noncomputable section namespace SkewMonoidAlgebra diff --git a/Mathlib/Algebra/SkewMonoidAlgebra/Support.lean b/Mathlib/Algebra/SkewMonoidAlgebra/Support.lean index 1997afff694650..2fa8ced14266e1 100644 --- a/Mathlib/Algebra/SkewMonoidAlgebra/Support.lean +++ b/Mathlib/Algebra/SkewMonoidAlgebra/Support.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Généreux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Généreux, María Inés de Frutos Fernández -/ -import Mathlib.Algebra.Group.Pointwise.Finset.Basic -import Mathlib.Algebra.SkewMonoidAlgebra.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic +public import Mathlib.Algebra.SkewMonoidAlgebra.Basic /-! # Lemmas about the support of an element of a skew monoid algebra @@ -12,6 +14,8 @@ import Mathlib.Algebra.SkewMonoidAlgebra.Basic For `f : SkewMonoidAlgebra k G`, `f.support` is the set of all `a ∈ G` such that `f.coeff a ≠ 0`. -/ +@[expose] public section + open scoped Pointwise namespace SkewMonoidAlgebra diff --git a/Mathlib/Algebra/SkewPolynomial/Basic.lean b/Mathlib/Algebra/SkewPolynomial/Basic.lean index 84251db9a803ec..6991640caaa9b6 100644 --- a/Mathlib/Algebra/SkewPolynomial/Basic.lean +++ b/Mathlib/Algebra/SkewPolynomial/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Généreux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Généreux, María Inés de Frutos Fernández -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.SkewMonoidAlgebra.Basic +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.SkewMonoidAlgebra.Basic /-! # Univariate skew polynomials @@ -66,6 +68,8 @@ multiplication is determined by $Xa = \varphi (a)X + δ (a)$, where `ϕ` is as -/ +@[expose] public section + noncomputable section open Multiplicative SkewMonoidAlgebra diff --git a/Mathlib/Algebra/Squarefree/Basic.lean b/Mathlib/Algebra/Squarefree/Basic.lean index 0f7ec3df209f43..41f036789c6c0f 100644 --- a/Mathlib/Algebra/Squarefree/Basic.lean +++ b/Mathlib/Algebra/Squarefree/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity +module + +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity /-! # Squarefree elements of monoids @@ -29,6 +31,8 @@ squarefree, multiplicity -/ +@[expose] public section + variable {R : Type*} diff --git a/Mathlib/Algebra/Star/Basic.lean b/Mathlib/Algebra/Star/Basic.lean index b4ca24393ea77f..154ca7682eee65 100644 --- a/Mathlib/Algebra/Star/Basic.lean +++ b/Mathlib/Algebra/Star/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Action.Opposite -import Mathlib.Algebra.Group.Action.Units -import Mathlib.Algebra.Group.Invertible.Defs -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.Ring.Aut -import Mathlib.Algebra.Ring.CompTypeclasses -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.Data.SetLike.Basic +module + +public import Mathlib.Algebra.Group.Action.Opposite +public import Mathlib.Algebra.Group.Action.Units +public import Mathlib.Algebra.Group.Invertible.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.Ring.Aut +public import Mathlib.Algebra.Ring.CompTypeclasses +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.Data.SetLike.Basic /-! # Star monoids, rings, and modules @@ -31,6 +33,8 @@ Our star rings are actually star non-unital, non-associative, semirings, but of `star_neg : star (-r) = - star r` when the underlying semiring is a ring. -/ +@[expose] public section + assert_not_exists Finset Subgroup Rat.instField universe u v w diff --git a/Mathlib/Algebra/Star/BigOperators.lean b/Mathlib/Algebra/Star/BigOperators.lean index ef3fbd46c12b8e..e9931530d06aee 100644 --- a/Mathlib/Algebra/Star/BigOperators.lean +++ b/Mathlib/Algebra/Star/BigOperators.lean @@ -3,15 +3,19 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Star.Basic -import Mathlib.Algebra.Star.SelfAdjoint +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Algebra.Star.SelfAdjoint /-! # Big-operators lemmas about `star` algebraic operations These results are kept separate from `Algebra.Star.Basic` to avoid it needing to import `Finset`. -/ +@[expose] public section + variable {R : Type*} diff --git a/Mathlib/Algebra/Star/CHSH.lean b/Mathlib/Algebra/Star/CHSH.lean index 37bf70da17c6e6..528c3efeb43b05 100644 --- a/Mathlib/Algebra/Star/CHSH.lean +++ b/Mathlib/Algebra/Star/CHSH.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Tactic.LinearCombination -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Data.Real.Sqrt -import Mathlib.Data.Real.Star +module + +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Data.Real.Sqrt +public import Mathlib.Data.Real.Star /-! # The Clauser-Horne-Shimony-Holt inequality and Tsirelson's inequality. @@ -73,6 +75,8 @@ There is a CHSH tuple in 4-by-4 matrices such that -/ +@[expose] public section + universe u diff --git a/Mathlib/Algebra/Star/Center.lean b/Mathlib/Algebra/Star/Center.lean index e6c1379dc882db..c6732be3ffe8d7 100644 --- a/Mathlib/Algebra/Star/Center.lean +++ b/Mathlib/Algebra/Star/Center.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Star.Basic -import Mathlib.Algebra.Star.Pointwise -import Mathlib.Algebra.Group.Center +module + +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Algebra.Star.Pointwise +public import Mathlib.Algebra.Group.Center /-! # `Set.center`, `Set.centralizer` and the `star` operation -/ +@[expose] public section + variable {R : Type*} [Mul R] [StarMul R] {a : R} {s : Set R} theorem Set.star_mem_center (ha : a ∈ Set.center R) : star a ∈ Set.center R where diff --git a/Mathlib/Algebra/Star/CentroidHom.lean b/Mathlib/Algebra/Star/CentroidHom.lean index 9f22c0cd9ebe0e..f9426a4854b033 100644 --- a/Mathlib/Algebra/Star/CentroidHom.lean +++ b/Mathlib/Algebra/Star/CentroidHom.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ +module -import Mathlib.Algebra.Ring.CentroidHom -import Mathlib.Algebra.Star.StarRingHom -import Mathlib.Algebra.Star.Subsemiring -import Mathlib.Algebra.Star.Basic +public import Mathlib.Algebra.Ring.CentroidHom +public import Mathlib.Algebra.Star.StarRingHom +public import Mathlib.Algebra.Star.Subsemiring +public import Mathlib.Algebra.Star.Basic /-! # Centroid homomorphisms on Star Rings @@ -21,6 +22,8 @@ the semiring into the centre of the centroid becomes a *-homomorphism. centroid -/ +@[expose] public section + variable {α : Type*} namespace CentroidHom diff --git a/Mathlib/Algebra/Star/Conjneg.lean b/Mathlib/Algebra/Star/Conjneg.lean index 08cecd34d25c31..1a982d32a3704b 100644 --- a/Mathlib/Algebra/Star/Conjneg.lean +++ b/Mathlib/Algebra/Star/Conjneg.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Star.Pi -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Star.Pi +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Conjugation-negation operator @@ -16,6 +18,8 @@ The way this operator enters the picture is that the adjoint of convolution with convolution with `conjneg f`. -/ +@[expose] public section + open Function open scoped ComplexConjugate diff --git a/Mathlib/Algebra/Star/Free.lean b/Mathlib/Algebra/Star/Free.lean index 77da51f43b866e..6e80ddb99fea8a 100644 --- a/Mathlib/Algebra/Star/Free.lean +++ b/Mathlib/Algebra/Star/Free.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Star.Basic -import Mathlib.Algebra.FreeAlgebra +module + +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Algebra.FreeAlgebra /-! # A *-algebra structure on the free algebra. @@ -16,6 +18,8 @@ We have this in a separate file, rather than in `Algebra.FreeMonoid` and `Algebr to avoid importing `Algebra.Star.Basic` into the entire hierarchy. -/ +@[expose] public section + namespace FreeMonoid diff --git a/Mathlib/Algebra/Star/LinearMap.lean b/Mathlib/Algebra/Star/LinearMap.lean index 0cd3e0a6963540..138f6589ea9011 100644 --- a/Mathlib/Algebra/Star/LinearMap.lean +++ b/Mathlib/Algebra/Star/LinearMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Star.TensorProduct +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Star.TensorProduct /-! # Intrinsic star operation on `E →ₗ[R] F` @@ -22,6 +24,8 @@ is mathematically distinct from the global instance on `E →ₗ[𝕜] E` where For that reason, the intrinsic star operation is scoped to `IntrinsicStar`. -/ +@[expose] public section + namespace LinearMap variable {R E F : Type*} [Semiring R] [InvolutiveStar R] [AddCommMonoid E] [Module R E] [StarAddMonoid E] [StarModule R E] diff --git a/Mathlib/Algebra/Star/Module.lean b/Mathlib/Algebra/Star/Module.lean index 358fa895a75e0f..50a3342a3e94de 100644 --- a/Mathlib/Algebra/Star/Module.lean +++ b/Mathlib/Algebra/Star/Module.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Frédéric Dupuis -/ -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Module.Basic -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.LinearMap.Star -import Mathlib.Algebra.Module.Rat -import Mathlib.LinearAlgebra.Prod +module + +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Module.Basic +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.LinearMap.Star +public import Mathlib.Algebra.Module.Rat +public import Mathlib.LinearAlgebra.Prod /-! # The star operation, bundled as a star-linear equiv @@ -30,6 +32,8 @@ This file also provides some lemmas that need `Algebra.Module.Basic` imported to equivalence. -/ +@[expose] public section + section SMulLemmas diff --git a/Mathlib/Algebra/Star/MonoidHom.lean b/Mathlib/Algebra/Star/MonoidHom.lean index 0739f25e01a9c2..58ba06190e1191 100644 --- a/Mathlib/Algebra/Star/MonoidHom.lean +++ b/Mathlib/Algebra/Star/MonoidHom.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Star.Basic +module + +public import Mathlib.Algebra.Star.Basic /-! # Morphisms of star monoids @@ -24,6 +26,8 @@ a corresponding morphism between the unitary groups in a star monoid. monoid, star -/ +@[expose] public section + variable {F A B C D : Type*} /-! ### Star monoid homomorphisms -/ diff --git a/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean b/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean index c0db5f383cfcc0..7cd1b5414c9098 100644 --- a/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean +++ b/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.NonUnitalSubalgebra -import Mathlib.Algebra.Star.StarAlgHom -import Mathlib.Algebra.Star.Center -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Star.Prod +module + +public import Mathlib.Algebra.Algebra.NonUnitalSubalgebra +public import Mathlib.Algebra.Star.StarAlgHom +public import Mathlib.Algebra.Star.Center +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Star.Prod /-! # Non-unital Star Subalgebras @@ -21,6 +23,8 @@ In this file we define `NonUnitalStarSubalgebra`s and the usual operations on th non-unital subalgebra on the larger algebra. -/ +@[expose] public section + namespace StarMemClass /-- If a type carries an involutive star, then any star-closed subset does too. -/ diff --git a/Mathlib/Algebra/Star/NonUnitalSubsemiring.lean b/Mathlib/Algebra/Star/NonUnitalSubsemiring.lean index 5366d7166183e7..2b29abbaccbf3a 100644 --- a/Mathlib/Algebra/Star/NonUnitalSubsemiring.lean +++ b/Mathlib/Algebra/Star/NonUnitalSubsemiring.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Group.Subsemigroup.Basic -import Mathlib.RingTheory.NonUnitalSubsemiring.Basic -import Mathlib.Algebra.Star.Center +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Group.Subsemigroup.Basic +public import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +public import Mathlib.Algebra.Star.Center /-! # Non-unital Star Subsemirings @@ -19,6 +21,8 @@ This file is heavily inspired by `Mathlib/Algebra/Star/NonUnitalSubalgebra.lean` -/ +@[expose] public section + universe v w w' variable {A : Type v} {B : Type w} {C : Type w'} diff --git a/Mathlib/Algebra/Star/Pi.lean b/Mathlib/Algebra/Star/Pi.lean index 15219c28597cb7..ca4aed45b94deb 100644 --- a/Mathlib/Algebra/Star/Pi.lean +++ b/Mathlib/Algebra/Star/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Star.Basic -import Mathlib.Algebra.Notation.Pi.Defs -import Mathlib.Algebra.Ring.Pi +module + +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Algebra.Notation.Pi.Defs +public import Mathlib.Algebra.Ring.Pi /-! # Basic Results about Star on Pi Types @@ -14,6 +16,8 @@ This file provides basic results about the star on product types defined in `Mathlib/Algebra/Notation/Pi/Defs.lean`. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Star/Pointwise.lean b/Mathlib/Algebra/Star/Pointwise.lean index 72df2423daa95f..bc239ea5648a27 100644 --- a/Mathlib/Algebra/Star/Pointwise.lean +++ b/Mathlib/Algebra/Star/Pointwise.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Star.Basic -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise star operation on sets @@ -20,6 +22,8 @@ if `s t : Set α`, then under suitable assumption on `α`, it is shown * `(s⁻¹)⋆ = (s⋆)⁻¹` -/ +@[expose] public section + namespace Set @@ -29,7 +33,7 @@ local postfix:max "⋆" => star variable {α : Type*} {s t : Set α} {a : α} -/-- The set `(star s : Set α)` is defined as `{x | star x ∈ s}` in the scope Pointwise`. +/-- The set `(star s : Set α)` is defined as `{x | star x ∈ s}` in the scope `Pointwise`. In the usual case where `star` is involutive, it is equal to `{star s | x ∈ s}`, see `Set.image_star`. -/ protected def star [Star α] : Star (Set α) := ⟨preimage Star.star⟩ diff --git a/Mathlib/Algebra/Star/Prod.lean b/Mathlib/Algebra/Star/Prod.lean index 463f19c78a181b..d7a82c401e91b5 100644 --- a/Mathlib/Algebra/Star/Prod.lean +++ b/Mathlib/Algebra/Star/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Ring.Prod -import Mathlib.Algebra.Star.Basic +module + +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Algebra.Star.Basic /-! # Basic Results about Star on Product Type @@ -14,6 +16,8 @@ This file provides basic results about the star on product types defined in -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Algebra/Star/Rat.lean b/Mathlib/Algebra/Star/Rat.lean index 927ff6812ec1dd..2ffa05b1726ab7 100644 --- a/Mathlib/Algebra/Star/Rat.lean +++ b/Mathlib/Algebra/Star/Rat.lean @@ -3,15 +3,19 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Field.Opposite -import Mathlib.Algebra.Star.Basic -import Mathlib.Data.NNRat.Defs -import Mathlib.Data.Rat.Cast.Defs +module + +public import Mathlib.Algebra.Field.Opposite +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Data.NNRat.Defs +public import Mathlib.Data.Rat.Cast.Defs /-! # *-ring structure on ℚ and ℚ≥0. -/ +@[expose] public section + instance Rat.instStarRing : StarRing ℚ := starRingOfComm instance NNRat.instStarRing : StarRing ℚ≥0 := starRingOfComm instance Rat.instTrivialStar : TrivialStar ℚ := ⟨fun _ ↦ rfl⟩ diff --git a/Mathlib/Algebra/Star/RingQuot.lean b/Mathlib/Algebra/Star/RingQuot.lean index c8633430a1659d..de34b3d73e9919 100644 --- a/Mathlib/Algebra/Star/RingQuot.lean +++ b/Mathlib/Algebra/Star/RingQuot.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.RingQuot -import Mathlib.Algebra.Star.Basic +module + +public import Mathlib.Algebra.RingQuot +public import Mathlib.Algebra.Star.Basic /-! # The *-ring structure on suitable quotients of a *-ring. -/ +@[expose] public section + namespace RingQuot universe u diff --git a/Mathlib/Algebra/Star/SelfAdjoint.lean b/Mathlib/Algebra/Star/SelfAdjoint.lean index 31225c2ce58df6..483f52e597879c 100644 --- a/Mathlib/Algebra/Star/SelfAdjoint.lean +++ b/Mathlib/Algebra/Star/SelfAdjoint.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Star.Rat +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Star.Rat /-! # Self-adjoint, skew-adjoint and normal elements of a star additive group @@ -38,6 +40,8 @@ We also define `IsStarNormal R`, a `Prop` that states that an element `x` satisf -/ +@[expose] public section + open Function variable {R A : Type*} diff --git a/Mathlib/Algebra/Star/StarAlgHom.lean b/Mathlib/Algebra/Star/StarAlgHom.lean index ea479592e9e5d6..e1abfa6d401afd 100644 --- a/Mathlib/Algebra/Star/StarAlgHom.lean +++ b/Mathlib/Algebra/Star/StarAlgHom.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Algebra.Algebra.NonUnitalHom -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Star.StarRingHom +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Algebra.Algebra.NonUnitalHom +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Star.StarRingHom /-! # Morphisms of star algebras @@ -40,6 +42,8 @@ of unital C⋆-algebras (with `StarAlgHom`s) and of C⋆-algebras (with `NonUnit non-unital, algebra, morphism, star -/ +@[expose] public section + open EquivLike /-! ### Non-unital star algebra homomorphisms -/ @@ -618,12 +622,9 @@ end StarAlgHom /-- A *⋆-algebra* equivalence is an equivalence preserving addition, multiplication, scalar multiplication and the star operation, which allows for considering both unital and non-unital -equivalences with a single structure. Currently, `AlgEquiv` requires unital algebras, which is -why this structure does not extend it. -/ +equivalences with a single structure. -/ structure StarAlgEquiv (R A B : Type*) [Add A] [Add B] [Mul A] [Mul B] [SMul R A] [SMul R B] - [Star A] [Star B] extends A ≃+* B where - /-- By definition, a ⋆-algebra equivalence preserves the `star` operation. -/ - map_star' : ∀ a : A, toFun (star a) = star (toFun a) + [Star A] [Star B] extends A ≃⋆+* B where /-- By definition, a ⋆-algebra equivalence commutes with the action of scalars. -/ map_smul' : ∀ (r : R) (a : A), toFun (r • a) = r • toFun a @@ -631,20 +632,19 @@ structure StarAlgEquiv (R A B : Type*) [Add A] [Add B] [Mul A] [Mul B] [SMul R A @[inherit_doc] notation:25 A " ≃⋆ₐ[" R "] " B => StarAlgEquiv R A B -/-- Reinterpret a star algebra equivalence as a `RingEquiv` by forgetting the interaction with -the star operation and scalar multiplication. -/ -add_decl_doc StarAlgEquiv.toRingEquiv +/-- Reinterpret a star algebra equivalence as a `StarRingEquiv` by forgetting the interaction with +the scalar multiplication. -/ +add_decl_doc StarAlgEquiv.toStarRingEquiv /-- The class that directly extends `RingEquivClass` and `SMulHomClass`. -Mostly an implementation detail for `StarAlgEquivClass`. +Mostly an implementation detail for the ⋆-algebra equivalence class +which is currently: `[NonUnitalAlgEquivClass]` and `[StarHomClass]`. -/ class NonUnitalAlgEquivClass (F : Type*) (R A B : outParam Type*) [Add A] [Mul A] [SMul R A] [Add B] [Mul B] [SMul R B] [EquivLike F A B] : Prop extends RingEquivClass F A B, MulActionSemiHomClass F (@id R) A B where -namespace StarAlgEquivClass - -- See note [lower instance priority] instance (priority := 100) {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [EquivLike F A B] @@ -653,11 +653,13 @@ instance (priority := 100) {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiri { } -- See note [lower instance priority] -instance (priority := 100) instAlgHomClass (F R A B : Type*) [CommSemiring R] [Semiring A] +instance (priority := 100) (F R A B : Type*) [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [EquivLike F A B] [NonUnitalAlgEquivClass F R A B] : AlgEquivClass F R A B := { commutes := fun f r => by simp only [Algebra.algebraMap_eq_smul_one, map_smul, map_one] } +namespace StarAlgEquivClass + /-- Turn an element of a type `F` satisfying `AlgEquivClass F R A B` and `StarHomClass F A B` into an actual `StarAlgEquiv`. This is declared as the default coercion from `F` to `A ≃⋆ₐ[R] B`. -/ @[coe] @@ -690,8 +692,8 @@ instance : EquivLike (A ≃⋆ₐ[R] B) A B where left_inv f := f.left_inv right_inv f := f.right_inv coe_injective' f g h₁ h₂ := by - rcases f with ⟨⟨⟨_, _, _⟩, _⟩, _⟩ - rcases g with ⟨⟨⟨_, _, _⟩, _⟩, _⟩ + rcases f with ⟨⟨⟨⟨_, _, _⟩, _⟩, _⟩, _⟩ + rcases g with ⟨⟨⟨⟨_, _, _⟩, _⟩, _⟩, _⟩ congr instance : NonUnitalAlgEquivClass (A ≃⋆ₐ[R] B) R A B where @@ -699,8 +701,8 @@ instance : NonUnitalAlgEquivClass (A ≃⋆ₐ[R] B) R A B where map_add f := f.map_add' map_smulₛₗ := map_smul' -instance : StarHomClass (A ≃⋆ₐ[R] B) A B where - map_star := map_star' +instance : StarRingEquivClass (A ≃⋆ₐ[R] B) A B where + map_star f := f.map_star' /-- Helper instance for cases where the inference via `EquivLike` is too hard. -/ instance : FunLike (A ≃⋆ₐ[R] B) A B where @@ -708,6 +710,8 @@ instance : FunLike (A ≃⋆ₐ[R] B) A B where coe_injective' := DFunLike.coe_injective @[simp] +theorem toStarRingEquiv_eq_coe (e : A ≃⋆ₐ[R] B) : e.toStarRingEquiv = e := rfl + theorem toRingEquiv_eq_coe (e : A ≃⋆ₐ[R] B) : e.toRingEquiv = e := rfl @@ -718,9 +722,8 @@ theorem ext {f g : A ≃⋆ₐ[R] B} (h : ∀ a, f a = g a) : f = g := /-- The identity map is a star algebra isomorphism. -/ @[refl] def refl : A ≃⋆ₐ[R] A := - { RingEquiv.refl A with - map_smul' := fun _ _ => rfl - map_star' := fun _ => rfl } + { StarRingEquiv.refl (A := A) with + map_smul' := fun _ _ => rfl } instance : Inhabited (A ≃⋆ₐ[R] A) := ⟨refl⟩ @@ -733,9 +736,6 @@ theorem coe_refl : ⇑(refl : A ≃⋆ₐ[R] A) = id := @[symm] nonrec def symm (e : A ≃⋆ₐ[R] B) : B ≃⋆ₐ[R] A := { e.symm with - map_star' := fun b => by - simpa only [apply_inv_apply, inv_apply_apply] using - congr_arg (inv e) (map_star e (inv e b)).symm map_smul' := fun r b => by simpa only [apply_inv_apply, inv_apply_apply] using congr_arg (inv e) (map_smul e r (inv e b)).symm } @@ -757,19 +757,19 @@ theorem symm_bijective : Function.Bijective (symm : (A ≃⋆ₐ[R] B) → B ≃ Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩ @[simp] -theorem coe_mk (e h₁ h₂) : ⇑(⟨e, h₁, h₂⟩ : A ≃⋆ₐ[R] B) = e := rfl +theorem coe_mk (e h) : ⇑(⟨e, h⟩ : A ≃⋆ₐ[R] B) = e := rfl @[simp] theorem mk_coe (e : A ≃⋆ₐ[R] B) (e' h₁ h₂ h₃ h₄ h₅ h₆) : - (⟨⟨⟨e, e', h₁, h₂⟩, h₃, h₄⟩, h₅, h₆⟩ : A ≃⋆ₐ[R] B) = e := ext fun _ => rfl + (⟨⟨⟨⟨e, e', h₁, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A ≃⋆ₐ[R] B) = e := ext fun _ => rfl /-- Auxiliary definition to avoid looping in `dsimp` with `StarAlgEquiv.symm_mk`. -/ protected def symm_mk.aux (f f') (h₁ h₂ h₃ h₄ h₅ h₆) := - (⟨⟨⟨f, f', h₁, h₂⟩, h₃, h₄⟩, h₅, h₆⟩ : A ≃⋆ₐ[R] B).symm + (⟨⟨⟨⟨f, f', h₁, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A ≃⋆ₐ[R] B).symm @[simp] theorem symm_mk (f f') (h₁ h₂ h₃ h₄ h₅ h₆) : - (⟨⟨⟨f, f', h₁, h₂⟩, h₃, h₄⟩, h₅, h₆⟩ : A ≃⋆ₐ[R] B).symm = + (⟨⟨⟨⟨f, f', h₁, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A ≃⋆ₐ[R] B).symm = { symm_mk.aux f f' h₁ h₂ h₃ h₄ h₅ h₆ with toFun := f' invFun := f } := @@ -779,6 +779,8 @@ theorem symm_mk (f f') (h₁ h₂ h₃ h₄ h₅ h₆) : theorem refl_symm : (StarAlgEquiv.refl : A ≃⋆ₐ[R] A).symm = StarAlgEquiv.refl := rfl +@[simp] +theorem toStarRingEquiv_symm (e : A ≃⋆ₐ[R] B) : (e.symm : B ≃⋆+* A) = (e : A ≃⋆+* B).symm := rfl @[simp] theorem toRingEquiv_symm (e : A ≃⋆ₐ[R] B) : (e.symm : B ≃+* A) = (e : A ≃+* B).symm := @@ -791,22 +793,18 @@ theorem to_ringEquiv_symm (f : A ≃⋆ₐ[R] B) : (f : A ≃+* B).symm = f.symm /-- Transitivity of `StarAlgEquiv`. -/ @[trans] def trans (e₁ : A ≃⋆ₐ[R] B) (e₂ : B ≃⋆ₐ[R] C) : A ≃⋆ₐ[R] C := - { e₁.toRingEquiv.trans - e₂.toRingEquiv with + { e₁.toStarRingEquiv.trans e₂.toStarRingEquiv with map_smul' := fun r a => show e₂.toFun (e₁.toFun (r • a)) = r • e₂.toFun (e₁.toFun a) by - rw [e₁.map_smul', e₂.map_smul'] - map_star' := fun a => - show e₂.toFun (e₁.toFun (star a)) = star (e₂.toFun (e₁.toFun a)) by - rw [e₁.map_star', e₂.map_star'] } + rw [e₁.map_smul', e₂.map_smul'] } @[simp] theorem apply_symm_apply (e : A ≃⋆ₐ[R] B) : ∀ x, e (e.symm x) = x := - e.toRingEquiv.apply_symm_apply + e.toStarRingEquiv.apply_symm_apply @[simp] theorem symm_apply_apply (e : A ≃⋆ₐ[R] B) : ∀ x, e.symm (e x) = x := - e.toRingEquiv.symm_apply_apply + e.toStarRingEquiv.symm_apply_apply @[simp] theorem symm_trans_apply (e₁ : A ≃⋆ₐ[R] B) (e₂ : B ≃⋆ₐ[R] C) (x : C) : diff --git a/Mathlib/Algebra/Star/StarProjection.lean b/Mathlib/Algebra/Star/StarProjection.lean index 74fbaf71c451ba..1efd524c75a7a0 100644 --- a/Mathlib/Algebra/Star/StarProjection.lean +++ b/Mathlib/Algebra/Star/StarProjection.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Group.Idempotent -import Mathlib.Algebra.Ring.Idempotent +module + +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Group.Idempotent +public import Mathlib.Algebra.Ring.Idempotent /-! # Star projections @@ -16,6 +18,8 @@ In star-ordered rings, star projections are non-negative. (See `IsStarProjection.nonneg` in `Mathlib/Algebra/Order/Star/Basic.lean`.) -/ +@[expose] public section + variable {R : Type*} /-- A star projection is a self-adjoint idempotent. -/ diff --git a/Mathlib/Algebra/Star/StarRingHom.lean b/Mathlib/Algebra/Star/StarRingHom.lean index e996d6297439d1..abdc2f14a79978 100644 --- a/Mathlib/Algebra/Star/StarRingHom.lean +++ b/Mathlib/Algebra/Star/StarRingHom.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Star.Basic +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Star.Basic /-! # Morphisms of star rings @@ -29,6 +31,8 @@ This file is heavily inspired by `Mathlib/Algebra/Star/StarAlgHom.lean`. non-unital, ring, morphism, star -/ +@[expose] public section + open EquivLike /-! ### Non-unital star ring homomorphisms -/ @@ -357,7 +361,7 @@ theorem symm_symm (e : A ≃⋆+* B) : e.symm.symm = e := rfl theorem symm_bijective : Function.Bijective (symm : (A ≃⋆+* B) → B ≃⋆+* A) := Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩ -theorem coe_mk (e h₁) : ⇑(⟨e, h₁⟩ : A ≃⋆+* B) = e := rfl +@[simp] theorem coe_mk (e h₁) : ⇑(⟨e, h₁⟩ : A ≃⋆+* B) = e := rfl @[simp] theorem mk_coe (e : A ≃⋆+* B) (e' h₁ h₂ h₃ h₄ h₅) : diff --git a/Mathlib/Algebra/Star/Subalgebra.lean b/Mathlib/Algebra/Star/Subalgebra.lean index 5635dd826e833c..a9ba9a73c53b5e 100644 --- a/Mathlib/Algebra/Star/Subalgebra.lean +++ b/Mathlib/Algebra/Star/Subalgebra.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Star.Module -import Mathlib.Algebra.Star.NonUnitalSubalgebra +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Star.Module +public import Mathlib.Algebra.Star.NonUnitalSubalgebra /-! # Star subalgebras @@ -16,6 +18,8 @@ A *-subalgebra is a subalgebra of a *-algebra which is closed under *. The centralizer of a *-closed set is a *-subalgebra. -/ +@[expose] public section + universe u v /-- A *-subalgebra is a subalgebra of a *-algebra which is closed under *. -/ diff --git a/Mathlib/Algebra/Star/Subsemiring.lean b/Mathlib/Algebra/Star/Subsemiring.lean index bb78fc1e389b09..f9c016a4fd8fac 100644 --- a/Mathlib/Algebra/Star/Subsemiring.lean +++ b/Mathlib/Algebra/Star/Subsemiring.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Star.NonUnitalSubsemiring -import Mathlib.Algebra.Ring.Subsemiring.Basic +module + +public import Mathlib.Algebra.Star.NonUnitalSubsemiring +public import Mathlib.Algebra.Ring.Subsemiring.Basic /-! # Star subrings @@ -12,6 +14,8 @@ import Mathlib.Algebra.Ring.Subsemiring.Basic A *-subring is a subring of a *-ring which is closed under *. -/ +@[expose] public section + universe v /-- A (unital) star subsemiring is a non-associative ring which is closed under the `star` diff --git a/Mathlib/Algebra/Star/TensorProduct.lean b/Mathlib/Algebra/Star/TensorProduct.lean index 6906dde4413b49..9f912a36cede72 100644 --- a/Mathlib/Algebra/Star/TensorProduct.lean +++ b/Mathlib/Algebra/Star/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Star.Module -import Mathlib.LinearAlgebra.TensorProduct.Basic +module + +public import Mathlib.Algebra.Star.Module +public import Mathlib.LinearAlgebra.TensorProduct.Basic /-! # The star structure on tensor products @@ -13,6 +15,8 @@ This file defines the `Star` structure on tensor products. This also defines the `StarAddMonoid` and `StarModule` instances for tensor products. -/ +@[expose] public section + namespace TensorProduct variable {R A B : Type*} [CommSemiring R] [StarRing R] diff --git a/Mathlib/Algebra/Star/Unitary.lean b/Mathlib/Algebra/Star/Unitary.lean index 91ad1a6e6fe7fe..24751bc6d0ffb0 100644 --- a/Mathlib/Algebra/Star/Unitary.lean +++ b/Mathlib/Algebra/Star/Unitary.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shing Tak Lam, Frédéric Dupuis -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Algebra.Spectrum.Basic -import Mathlib.Tactic.ContinuousFunctionalCalculus -import Mathlib.Algebra.Star.MonoidHom -import Mathlib.Algebra.Star.StarProjection +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Algebra.Spectrum.Basic +public import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Algebra.Star.MonoidHom +public import Mathlib.Algebra.Star.StarProjection /-! # Unitary elements of a star monoid @@ -24,6 +26,8 @@ See also `Matrix.UnitaryGroup` for specializations to `unitary (Matrix n n R)`. unitary -/ +@[expose] public section + /-- In a *-monoid, `unitary R` is the submonoid consisting of all the elements `U` of `R` such that `star U * U = 1` and `U * star U = 1`. diff --git a/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean b/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean index 0664d51e650cfc..171ac93f19dc2d 100644 --- a/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean +++ b/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Algebra.Ring.Action.ConjAct -import Mathlib.Algebra.Star.StarAlgHom -import Mathlib.Algebra.Star.Unitary +module + +public import Mathlib.Algebra.Ring.Action.ConjAct +public import Mathlib.Algebra.Star.StarAlgHom +public import Mathlib.Algebra.Star.Unitary /-! # The ⋆-algebra automorphism given by a unitary element @@ -14,6 +16,8 @@ This file defines the ⋆-algebra automorphism on `R` given by a unitary `u`, which is `Unitary.conjStarAlgAut S R u`, defined to be `x ↦ u * x * star u`. -/ +@[expose] public section + namespace Unitary variable {S R : Type*} [Semiring R] [StarMul R] [SMul S R] [IsScalarTower S R R] [SMulCommClass S R R] diff --git a/Mathlib/Algebra/Symmetrized.lean b/Mathlib/Algebra/Symmetrized.lean index 4aa7e36769ca7b..9a6ac8283f9827 100644 --- a/Mathlib/Algebra/Symmetrized.lean +++ b/Mathlib/Algebra/Symmetrized.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Jordan.Basic -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Algebra.Jordan.Basic +public import Mathlib.Algebra.Module.Defs /-! # Symmetrized algebra @@ -31,6 +33,8 @@ See `SymmetricAlgebra` instead if you are looking for the symmetric algebra of a * [Hanche-Olsen and Størmer, Jordan Operator Algebras][hancheolsenstormer1984] -/ +@[expose] public section + open Function diff --git a/Mathlib/Algebra/TrivSqZeroExt.lean b/Mathlib/Algebra/TrivSqZeroExt.lean index 37f8279b787620..9a95aed7d3fb44 100644 --- a/Mathlib/Algebra/TrivSqZeroExt.lean +++ b/Mathlib/Algebra/TrivSqZeroExt.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Eric Wieser -/ -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.GroupWithZero.Invertible -import Mathlib.LinearAlgebra.Prod -import Mathlib.Algebra.Algebra.Subalgebra.Lattice +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.GroupWithZero.Invertible +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice /-! # Trivial Square-Zero Extension @@ -51,6 +53,8 @@ Many of the later results in this file are only stated for the commutative `R'` -/ +@[expose] public section + universe u v w /-- "Trivial Square-Zero Extension". diff --git a/Mathlib/Algebra/Tropical/Basic.lean b/Mathlib/Algebra/Tropical/Basic.lean index 06c4b01f8f7475..dd9242ccf4a9f5 100644 --- a/Mathlib/Algebra/Tropical/Basic.lean +++ b/Mathlib/Algebra/Tropical/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Order.AddGroupWithTop -import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Algebra.Ring.Defs -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Order.AddGroupWithTop +public import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Order.Hom.Basic /-! @@ -44,6 +46,8 @@ most references rely on `Semiring (Tropical R)` for building up the whole theory -/ +@[expose] public section + assert_not_exists Nat.instMulOneClass universe u v diff --git a/Mathlib/Algebra/Tropical/BigOperators.lean b/Mathlib/Algebra/Tropical/BigOperators.lean index 7f5c9ae2c4d718..59b1d7d009a8f8 100644 --- a/Mathlib/Algebra/Tropical/BigOperators.lean +++ b/Mathlib/Algebra/Tropical/BigOperators.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.List.MinMax -import Mathlib.Algebra.Tropical.Basic -import Mathlib.Order.ConditionallyCompleteLattice.Finset -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.List.MinMax +public import Mathlib.Algebra.Tropical.Basic +public import Mathlib.Order.ConditionallyCompleteLattice.Finset +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! @@ -31,6 +33,8 @@ directly transfer to minima over multisets or finsets. -/ +@[expose] public section + variable {R S : Type*} open Tropical Finset diff --git a/Mathlib/Algebra/Tropical/Lattice.lean b/Mathlib/Algebra/Tropical/Lattice.lean index de3f3f1ca0c3a5..35a3c6dd15f77c 100644 --- a/Mathlib/Algebra/Tropical/Lattice.lean +++ b/Mathlib/Algebra/Tropical/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Tropical.Basic -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Algebra.Tropical.Basic +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! @@ -24,6 +26,8 @@ constructions quicker to implement. -/ +@[expose] public section + variable {R S : Type*} diff --git a/Mathlib/Algebra/Vertex/HVertexOperator.lean b/Mathlib/Algebra/Vertex/HVertexOperator.lean index 635cf3478736d2..8d2a83b3880041 100644 --- a/Mathlib/Algebra/Vertex/HVertexOperator.lean +++ b/Mathlib/Algebra/Vertex/HVertexOperator.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.RingTheory.HahnSeries.Multiplication +module + +public import Mathlib.RingTheory.HahnSeries.Multiplication /-! # Vertex operators @@ -26,6 +28,8 @@ here allows us to consider composites and scalar-multiply by multivariable Laure -/ +@[expose] public section + assert_not_exists Cardinal noncomputable section diff --git a/Mathlib/Algebra/Vertex/VertexOperator.lean b/Mathlib/Algebra/Vertex/VertexOperator.lean index 2714b8ddb80499..c0b460bfc9400c 100644 --- a/Mathlib/Algebra/Vertex/VertexOperator.lean +++ b/Mathlib/Algebra/Vertex/VertexOperator.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Vertex.HVertexOperator -import Mathlib.Data.Int.Interval +module + +public import Mathlib.Algebra.Vertex.HVertexOperator +public import Mathlib.Data.Int.Interval /-! # Vertex operators @@ -25,6 +27,8 @@ In this file we introduce vertex operators as linear maps to Laurent series. fields*][matsuo1997] -/ +@[expose] public section + noncomputable section variable {R V : Type*} [CommRing R] [AddCommGroup V] [Module R V] diff --git a/Mathlib/AlgebraicGeometry/AffineScheme.lean b/Mathlib/AlgebraicGeometry/AffineScheme.lean index 67ec7f2020a157..6ff614a9327645 100644 --- a/Mathlib/AlgebraicGeometry/AffineScheme.lean +++ b/Mathlib/AlgebraicGeometry/AffineScheme.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Cover.Open -import Mathlib.AlgebraicGeometry.GammaSpecAdjunction -import Mathlib.AlgebraicGeometry.Restrict -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.RingTheory.Localization.InvSubmonoid -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.Topology.Sheaves.CommRingCat -import Mathlib.CategoryTheory.Monad.Limits +module + +public import Mathlib.AlgebraicGeometry.Cover.Open +public import Mathlib.AlgebraicGeometry.GammaSpecAdjunction +public import Mathlib.AlgebraicGeometry.Restrict +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.RingTheory.Localization.InvSubmonoid +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.Topology.Sheaves.CommRingCat +public import Mathlib.CategoryTheory.Monad.Limits /-! # Affine schemes @@ -34,6 +36,8 @@ We also define predicates about affine schemes and affine open sets. -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 noncomputable section diff --git a/Mathlib/AlgebraicGeometry/AffineSpace.lean b/Mathlib/AlgebraicGeometry/AffineSpace.lean index 8f188915b065f5..48821898931881 100644 --- a/Mathlib/AlgebraicGeometry/AffineSpace.lean +++ b/Mathlib/AlgebraicGeometry/AffineSpace.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.MvPolynomial.Monad -import Mathlib.AlgebraicGeometry.Morphisms.Finite -import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation -import Mathlib.RingTheory.Spectrum.Prime.Polynomial -import Mathlib.AlgebraicGeometry.PullbackCarrier +module + +public import Mathlib.Algebra.MvPolynomial.Monad +public import Mathlib.AlgebraicGeometry.Morphisms.Finite +public import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation +public import Mathlib.RingTheory.Spectrum.Prime.Polynomial +public import Mathlib.AlgebraicGeometry.PullbackCarrier /-! # Affine space @@ -24,6 +26,8 @@ import Mathlib.AlgebraicGeometry.PullbackCarrier -/ +@[expose] public section + open CategoryTheory Limits MvPolynomial noncomputable section diff --git a/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean b/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean index 4ecfa3fe33f4c7..dcfc8f9dfbd7b8 100644 --- a/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean +++ b/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Christian Merten -/ -import Mathlib.Algebra.Category.Ring.FinitePresentation -import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial -import Mathlib.AlgebraicGeometry.Morphisms.Separated -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Connected -import Mathlib.CategoryTheory.Monad.Limits +module + +public import Mathlib.Algebra.Category.Ring.FinitePresentation +public import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial +public import Mathlib.AlgebraicGeometry.Morphisms.Separated +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Connected +public import Mathlib.CategoryTheory.Monad.Limits /-! @@ -18,6 +20,8 @@ following EGA IV 8 and https://stacks.math.columbia.edu/tag/01YT. -/ +@[expose] public section + universe uI u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicGeometry/Cover/Directed.lean b/Mathlib/AlgebraicGeometry/Cover/Directed.lean index 3e6f615c717d4e..020903940f317e 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Directed.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Directed.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.LocallyDirected -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.AlgebraicGeometry.Gluing +module + +public import Mathlib.CategoryTheory.LocallyDirected +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.AlgebraicGeometry.Gluing /-! # Locally directed covers @@ -22,6 +24,8 @@ Many natural covers are naturally directed, most importantly the cover of all af opens of a scheme. -/ +@[expose] public section + universe u noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean b/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean index 803c2136497c9f..0a8585f73a8358 100644 --- a/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean +++ b/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Sites.MorphismProperty -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.AlgebraicGeometry.Sites.MorphismProperty +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Covers of schemes @@ -23,6 +25,8 @@ immersions can be used to deduce these assumptions in the general case. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Cover/Open.lean b/Mathlib/AlgebraicGeometry/Cover/Open.lean index 781da4b906f430..2473fe53899a95 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Open.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Open.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Cover.MorphismProperty +module + +public import Mathlib.AlgebraicGeometry.Cover.MorphismProperty /-! # Open covers of schemes @@ -18,6 +20,8 @@ This file provides the basic API for open covers of schemes. - `AlgebraicGeometry.Scheme.AffineOpenCover`: The type of affine open covers of a scheme `X`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Cover/Over.lean b/Mathlib/AlgebraicGeometry/Cover/Over.lean index 01de50d8d7bcd5..0e06bd55c313b9 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Over.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Over.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap -import Mathlib.CategoryTheory.Limits.MorphismProperty +module + +public import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap +public import Mathlib.CategoryTheory.Limits.MorphismProperty /-! @@ -18,6 +20,8 @@ We provide instances of `𝒰.Over S` for standard constructions on covers. -/ +@[expose] public section + universe v u noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Cover/Sigma.lean b/Mathlib/AlgebraicGeometry/Cover/Sigma.lean index c85a89936287e7..d09d2bb7443a0d 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Sigma.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Sigma.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Basic +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Basic /-! # Collapsing covers @@ -11,6 +13,8 @@ import Mathlib.AlgebraicGeometry.Morphisms.Basic We define the endofunctor on `Scheme.Cover P` that collapses a cover to a single object cover. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean index 56599c8ad1daaa..32051bcbe6dcdc 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Algebra.Polynomial.Bivariate -import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass -import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange +module + +public import Mathlib.Algebra.Polynomial.Bivariate +public import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass +public import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange deprecated_module (since := "2025-05-03") diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Basic.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Basic.lean index d6722c319e0286..4e39438e1bd92e 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Basic.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Algebra.Polynomial.Bivariate -import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange +module + +public import Mathlib.Algebra.Polynomial.Bivariate +public import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange /-! # Weierstrass equations and the nonsingular condition in affine coordinates @@ -44,6 +46,8 @@ abbreviation for `WeierstrassCurve` that can be converted using `WeierstrassCurv elliptic curve, affine, Weierstrass equation, nonsingular -/ +@[expose] public section + open Polynomial open scoped Polynomial.Bivariate diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean index 67895c6c6e1d7f..708d36c52f7021 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic /-! # Negation and addition formulae for nonsingular points in affine coordinates @@ -55,6 +57,8 @@ coordinates will be defined in `Mathlib/AlgebraicGeometry/EllipticCurve/Affine/P elliptic curve, affine, negation, doubling, addition, group law -/ +@[expose] public section + open Polynomial open scoped Polynomial.Bivariate diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean index ae956317874812..fa1512877d5ffa 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula -import Mathlib.LinearAlgebra.FreeModule.Norm -import Mathlib.RingTheory.ClassGroup -import Mathlib.RingTheory.Polynomial.UniqueFactorization +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula +public import Mathlib.LinearAlgebra.FreeModule.Norm +public import Mathlib.RingTheory.ClassGroup +public import Mathlib.RingTheory.Polynomial.UniqueFactorization /-! # Nonsingular points and the group law in affine coordinates @@ -62,6 +64,8 @@ This file defines the group law on nonsingular points `W⟮F⟯` in affine coord elliptic curve, affine, point, group law, class group -/ +@[expose] public section + open FractionalIdeal (coeIdeal_mul) open Ideal hiding map_mul diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Basic.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Basic.lean index 9f46d90d21858c..c3e9c4f3a8391b 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Basic.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point -import Mathlib.NumberTheory.EllipticDivisibilitySequence +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point +public import Mathlib.NumberTheory.EllipticDivisibilitySequence /-! # Division polynomials of Weierstrass curves @@ -89,6 +91,8 @@ TODO: implementation notes for the definition of `ωₙ`. elliptic curve, division polynomial, torsion point -/ +@[expose] public section + open Polynomial open scoped Polynomial.Bivariate diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Degree.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Degree.lean index d871efa4ca429d..ccb912570127f7 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Degree.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Degree.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Basic -import Mathlib.Tactic.ComputeDegree +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Basic +public import Mathlib.Tactic.ComputeDegree /-! # Division polynomials of Weierstrass curves @@ -48,6 +50,8 @@ polynomials `preΨₙ`, `ΨSqₙ`, and `Φₙ` all have their expected leading t elliptic curve, division polynomial, torsion point -/ +@[expose] public section + open Polynomial universe u diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean index 86afcd8fa41c52..90b7ace766fbe0 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ +module -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point deprecated_module (since := "2025-05-07") diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean index 85d2c4403a48dd..9da0a826419b9e 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.NormalForms -import Mathlib.FieldTheory.IsSepClosed +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.NormalForms +public import Mathlib.FieldTheory.IsSepClosed /-! @@ -18,6 +20,8 @@ import Mathlib.FieldTheory.IsSepClosed -/ +@[expose] public section + open Polynomial variable {F : Type*} [Field F] [IsSepClosed F] diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Basic.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Basic.lean index 40a86efd1e6615..fbe5cc4cb7e856 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Basic.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic -import Mathlib.Data.Fin.Tuple.Reflection -import Mathlib.Tactic.Ring.NamePolyVars +module + +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic +public import Mathlib.Data.Fin.Tuple.Reflection +public import Mathlib.Tactic.Ring.NamePolyVars /-! # Weierstrass equations and the nonsingular condition in Jacobian coordinates @@ -67,6 +69,8 @@ mirrored in `Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Basic.lean`. elliptic curve, Jacobian, Weierstrass equation, nonsingular -/ +@[expose] public section + local notation3 "x" => (0 : Fin 3) local notation3 "y" => (1 : Fin 3) diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Formula.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Formula.lean index d6460b37c30bba..0233647018abfc 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Formula.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Formula.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula -import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Basic +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula +public import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Basic /-! # Negation and addition formulae for nonsingular points in Jacobian coordinates @@ -56,6 +58,8 @@ mirrored in `Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Formula.lean`. elliptic curve, Jacobian, negation, doubling, addition, group law -/ +@[expose] public section + local notation3 "x" => (0 : Fin 3) local notation3 "y" => (1 : Fin 3) @@ -359,8 +363,8 @@ lemma dblXYZ_smul (P : Fin 3 → R) (u : R) : W'.dblXYZ (u • P) = u ^ 4 • W' lemma dblXYZ_of_Z_eq_zero {P : Fin 3 → R} (hP : W'.Equation P) (hPz : P z = 0) : W'.dblXYZ P = P x ^ 2 • ![1, 1, 0] := by - erw [dblXYZ, dblX_of_Z_eq_zero hP hPz, dblY_of_Z_eq_zero hP hPz, dblZ_of_Z_eq_zero hPz, smul_fin3, - mul_one, mul_one, mul_zero] + simp [dblXYZ, dblX_of_Z_eq_zero hP hPz, dblY_of_Z_eq_zero hP hPz, dblZ_of_Z_eq_zero hPz, + smul_fin3] lemma dblXYZ_of_Y_eq' [NoZeroDivisors R] {P Q : Fin 3 → R} (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3) @@ -371,7 +375,7 @@ lemma dblXYZ_of_Y_eq' [NoZeroDivisors R] {P Q : Fin 3 → R} (hQz : Q z ≠ 0) lemma dblXYZ_of_Y_eq {P Q : Fin 3 → F} (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3) (hy' : P y * Q z ^ 3 = W.negY Q * P z ^ 3) : W.dblXYZ P = W.dblU P • ![1, 1, 0] := by - erw [dblXYZ_of_Y_eq' hQz hx hy hy', smul_fin3, mul_one, mul_one, mul_zero] + simp [dblXYZ_of_Y_eq' hQz hx hy hy', smul_fin3] lemma dblXYZ_of_Z_ne_zero [DecidableEq F] {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0) (hQz : Q z ≠ 0) @@ -686,8 +690,8 @@ lemma addXYZ_of_Z_eq_zero_right {P Q : Fin 3 → R} (hQ : W'.Equation Q) (hQz : lemma addXYZ_of_X_eq {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0) (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) : W.addXYZ P Q = addU P Q • ![1, 1, 0] := by - erw [addXYZ, addX_of_X_eq hP hQ hPz hQz hx, addY_of_X_eq hP hQ hPz hQz hx, addZ_of_X_eq hx, - smul_fin3, mul_one, mul_one, mul_zero] + simp [addXYZ, addX_of_X_eq hP hQ hPz hQz hx, addY_of_X_eq hP hQ hPz hQz hx, addZ_of_X_eq hx, + smul_fin3] lemma addXYZ_of_Z_ne_zero [DecidableEq F] {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0) (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) : W.addXYZ P Q = addZ P Q • diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Point.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Point.lean index 05c07f47890ebe..fc215749809899 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Point.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Point.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point -import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Formula +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian.Formula /-! # Nonsingular points and the group law in Jacobian coordinates @@ -59,6 +61,8 @@ mirrored in `Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Point.lean`. elliptic curve, Jacobian, point, group law -/ +@[expose] public section + local notation3 "x" => (0 : Fin 3) local notation3 "y" => (1 : Fin 3) diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/ModelsWithJ.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/ModelsWithJ.lean index 4ee985ad40d838..7179657b09d9e6 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/ModelsWithJ.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/ModelsWithJ.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass /-! # Models of elliptic curves with prescribed j-invariant @@ -32,6 +34,8 @@ It is a modification of [silverman2009], Chapter III, Proposition 1.4 (c). elliptic curve, weierstrass equation, j invariant -/ +@[expose] public section + namespace WeierstrassCurve variable (R : Type*) [CommRing R] (W : WeierstrassCurve R) diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean index 752ffbd9f12614..294a9ebfcb05d9 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange -import Mathlib.Algebra.CharP.Defs +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange +public import Mathlib.Algebra.CharP.Defs /-! @@ -92,6 +94,8 @@ elliptic curve, weierstrass equation, normal form -/ +@[expose] public section + variable {R : Type*} [CommRing R] {F : Type*} [Field F] (W : WeierstrassCurve R) namespace WeierstrassCurve diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Basic.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Basic.lean index 98c612feac1793..270fd4e47fb441 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Basic.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic -import Mathlib.Data.Fin.Tuple.Reflection -import Mathlib.Tactic.Ring.NamePolyVars +module + +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Basic +public import Mathlib.Data.Fin.Tuple.Reflection +public import Mathlib.Tactic.Ring.NamePolyVars /-! # Weierstrass equations and the nonsingular condition in projective coordinates @@ -67,6 +69,8 @@ mirrored in `Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Basic.lean`. elliptic curve, projective, Weierstrass equation, nonsingular -/ +@[expose] public section + local notation3 "x" => (0 : Fin 3) local notation3 "y" => (1 : Fin 3) diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Formula.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Formula.lean index 80a4d5cd482695..6b2620a8146ccc 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Formula.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Formula.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula -import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Basic +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Formula +public import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Basic /-! # Negation and addition formulae for nonsingular points in projective coordinates @@ -57,6 +59,8 @@ mirrored in `Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Formula.lean`. elliptic curve, projective, negation, doubling, addition, group law -/ +@[expose] public section + local notation3 "x" => (0 : Fin 3) local notation3 "y" => (1 : Fin 3) diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Point.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Point.lean index 2d1db3f34f6bf3..387b4b956aeeee 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Point.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Projective/Point.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point -import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Formula +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Formula /-! # Nonsingular points and the group law in projective coordinates @@ -59,6 +61,8 @@ mirrored in `Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian/Point.lean`. elliptic curve, projective, point, group law -/ +@[expose] public section + local notation3 "x" => (0 : Fin 3) local notation3 "y" => (1 : Fin 3) @@ -108,8 +112,7 @@ lemma neg_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : W'.neg P ≈ W'.neg Q := by lemma neg_of_Z_eq_zero [NoZeroDivisors R] {P : Fin 3 → R} (hP : W'.Equation P) (hPz : P z = 0) : W'.neg P = -P y • ![0, 1, 0] := by - erw [neg, X_eq_zero_of_Z_eq_zero hP hPz, negY_of_Z_eq_zero hP hPz, hPz, smul_fin3, mul_zero, - mul_one] + simp [neg, X_eq_zero_of_Z_eq_zero hP hPz, negY_of_Z_eq_zero hP hPz, hPz] lemma neg_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) : W.neg P = P z • ![P x / P z, W.toAffine.negY (P x / P z) (P y / P z), 1] := by diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Reduction.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Reduction.lean index 74cb5c39fa4594..2d09f624daf83e 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Reduction.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Reduction.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Bryan Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bryan Wang -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange -import Mathlib.RingTheory.DiscreteValuationRing.Basic -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.Valuation.Discrete.Basic -import Mathlib.GroupTheory.ArchimedeanDensely +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange +public import Mathlib.RingTheory.DiscreteValuationRing.Basic +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.Valuation.Discrete.Basic +public import Mathlib.GroupTheory.ArchimedeanDensely /-! # Reduction of Weierstrass curves over local fields @@ -42,6 +44,8 @@ fraction fields of discrete valuation rings. elliptic curve, weierstrass equation, minimal weierstrass equation, reduction -/ +@[expose] public section + namespace WeierstrassCurve section Integral diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/VariableChange.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/VariableChange.lean index b37b03146e6193..2d318cc6cea186 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/VariableChange.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/VariableChange.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, David Kurniadi Angdinata, Jz Pan -/ -import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass +module + +public import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass /-! # Change of variables of Weierstrass curves @@ -31,6 +33,8 @@ This file defines admissible linear change of variables of Weierstrass curves. elliptic curve, weierstrass equation, change of variables -/ +@[expose] public section + local macro "map_simp" : tactic => `(tactic| simp only [map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow]) diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean index e02bb1a9dd8bf3..07c050d9416c45 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, David Kurniadi Angdinata -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.CubicDiscriminant -import Mathlib.RingTheory.Nilpotent.Defs -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.CubicDiscriminant +public import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.LinearCombination /-! # Weierstrass equations of elliptic curves @@ -62,6 +64,8 @@ which are not globally defined by a cubic equation valid over the entire base. elliptic curve, weierstrass equation, j invariant -/ +@[expose] public section + local macro "map_simp" : tactic => `(tactic| simp only [map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow]) diff --git a/Mathlib/AlgebraicGeometry/Fiber.lean b/Mathlib/AlgebraicGeometry/Fiber.lean index 1e125d94b22ee8..8fbc411cd600a9 100644 --- a/Mathlib/AlgebraicGeometry/Fiber.lean +++ b/Mathlib/AlgebraicGeometry/Fiber.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.AlgebraicGeometry.Morphisms.Finite -import Mathlib.RingTheory.Spectrum.Prime.Jacobson +module + +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.AlgebraicGeometry.Morphisms.Finite +public import Mathlib.RingTheory.Spectrum.Prime.Jacobson /-! # Scheme-theoretic fiber @@ -18,6 +20,8 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson -/ +@[expose] public section + universe u noncomputable section diff --git a/Mathlib/AlgebraicGeometry/FunctionField.lean b/Mathlib/AlgebraicGeometry/FunctionField.lean index 9479815d309e20..088fde9d931712 100644 --- a/Mathlib/AlgebraicGeometry/FunctionField.lean +++ b/Mathlib/AlgebraicGeometry/FunctionField.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Properties +module + +public import Mathlib.AlgebraicGeometry.Properties /-! # Function field of integral schemes @@ -17,6 +19,8 @@ This is a field when the scheme is integral. function field. This map is injective. -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 diff --git a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean index c875dd12fe8baa..b1d3a2556c742e 100644 --- a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean +++ b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.AlgebraicGeometry.Restrict -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Adjunction.Opposites -import Mathlib.CategoryTheory.Adjunction.Reflective +module + +public import Mathlib.AlgebraicGeometry.Restrict +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Adjunction.Opposites +public import Mathlib.CategoryTheory.Adjunction.Reflective /-! # Adjunction between `Γ` and `Spec` @@ -31,6 +33,8 @@ case the unit and the counit would switch to each other. -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 diff --git a/Mathlib/AlgebraicGeometry/Gluing.lean b/Mathlib/AlgebraicGeometry/Gluing.lean index cc4066561f3b73..99757232907a29 100644 --- a/Mathlib/AlgebraicGeometry/Gluing.lean +++ b/Mathlib/AlgebraicGeometry/Gluing.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Restrict -import Mathlib.CategoryTheory.LocallyDirected -import Mathlib.Geometry.RingedSpace.PresheafedSpace.Gluing +module + +public import Mathlib.AlgebraicGeometry.Restrict +public import Mathlib.CategoryTheory.LocallyDirected +public import Mathlib.Geometry.RingedSpace.PresheafedSpace.Gluing /-! # Gluing Schemes @@ -49,6 +51,8 @@ presheafed spaces, sheafed spaces, and locally ringed spaces. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/GluingOneHypercover.lean b/Mathlib/AlgebraicGeometry/GluingOneHypercover.lean index 46cbf373fae350..2e0589712f98ab 100644 --- a/Mathlib/AlgebraicGeometry/GluingOneHypercover.lean +++ b/Mathlib/AlgebraicGeometry/GluingOneHypercover.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne, Joël Riou, Ravi Vakil -/ -import Mathlib.AlgebraicGeometry.Gluing -import Mathlib.AlgebraicGeometry.Sites.BigZariski -import Mathlib.CategoryTheory.Sites.Hypercover.One +module + +public import Mathlib.AlgebraicGeometry.Gluing +public import Mathlib.AlgebraicGeometry.Sites.BigZariski +public import Mathlib.CategoryTheory.Limits.Types.Multiequalizer +public import Mathlib.CategoryTheory.Sites.Hypercover.One /-! # The 1-hypercover of a glue data @@ -22,6 +25,8 @@ This contribution was created as part of the AIM workshop -/ +@[expose] public section + universe v u open CategoryTheory Opposite Limits diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf.lean b/Mathlib/AlgebraicGeometry/IdealSheaf.lean index 3b18b296ee5ad2..52c5032027f5e8 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf.lean @@ -3,6 +3,8 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme +module + +public import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme deprecated_module (since := "2025-04-13") diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean index 8b49d339450401..205bd19c2ae524 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact -import Mathlib.AlgebraicGeometry.Properties +module + +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact +public import Mathlib.AlgebraicGeometry.Properties /-! # Ideal sheaves on schemes @@ -40,6 +42,8 @@ into mathlib. -/ +@[expose] public section + open CategoryTheory TopologicalSpace universe u diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean index c9fe6415b97b1d..b5ba5596f2e613 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion -import Mathlib.AlgebraicGeometry.PullbackCarrier +module + +public import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion +public import Mathlib.AlgebraicGeometry.PullbackCarrier /-! # Functorial constructions of ideal sheaves @@ -19,6 +21,8 @@ We define the pullback and pushforward of ideal sheaves in this file. -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean index 4040ffddc7f9a9..2646bfce230c99 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion -import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated -import Mathlib.AlgebraicGeometry.IdealSheaf.Basic -import Mathlib.CategoryTheory.Adjunction.Opposites +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated +public import Mathlib.AlgebraicGeometry.IdealSheaf.Basic +public import Mathlib.CategoryTheory.Adjunction.Opposites /-! # Subscheme associated to an ideal sheaf @@ -27,6 +29,8 @@ Some instances are in `Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion` and -/ +@[expose] public section + open CategoryTheory TopologicalSpace PrimeSpectrum Limits universe u diff --git a/Mathlib/AlgebraicGeometry/Limits.lean b/Mathlib/AlgebraicGeometry/Limits.lean index 2e1a917b625a43..91b4f4119bb93e 100644 --- a/Mathlib/AlgebraicGeometry/Limits.lean +++ b/Mathlib/AlgebraicGeometry/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products -import Mathlib.AlgebraicGeometry.Pullbacks -import Mathlib.AlgebraicGeometry.AffineScheme +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products +public import Mathlib.AlgebraicGeometry.Pullbacks +public import Mathlib.AlgebraicGeometry.AffineScheme /-! # (Co)Limits of Schemes @@ -25,6 +27,8 @@ We construct various limits and colimits in the category of schemes. -/ +@[expose] public section + suppress_compilation diff --git a/Mathlib/AlgebraicGeometry/Modules/Presheaf.lean b/Mathlib/AlgebraicGeometry/Modules/Presheaf.lean index d30cf672000eed..c9df4ad94439e8 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Presheaf.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Presheaf.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.ModuleCat.Presheaf -import Mathlib.AlgebraicGeometry.Scheme -import Mathlib.CategoryTheory.Sites.Whiskering +module + +public import Mathlib.Algebra.Category.ModuleCat.Presheaf +public import Mathlib.AlgebraicGeometry.Scheme +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # The category of presheaves of modules over a scheme @@ -18,6 +20,8 @@ of rings of `X`. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean b/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean index 77ae709c68df48..12b53282243ebe 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Algebra.Category.ModuleCat.Sheaf.Abelian -import Mathlib.AlgebraicGeometry.Modules.Presheaf +public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Abelian +public import Mathlib.AlgebraicGeometry.Modules.Presheaf /-! # The category of sheaves of modules over a scheme @@ -15,6 +16,8 @@ In this file, we define the abelian category of sheaves of modules -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean index 2d9879bb462bfc..46fb02c559f1bc 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean @@ -3,13 +3,14 @@ Copyright (c) 2024 Weihong Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Johan Commelin, Amelia Livingston, Sophie Morel, Jujian Zhang, Weihong Xu -/ +module -import Mathlib.Algebra.Module.LocalizedModule.Basic -import Mathlib.AlgebraicGeometry.StructureSheaf -import Mathlib.AlgebraicGeometry.Modules.Sheaf -import Mathlib.Algebra.Category.ModuleCat.Sheaf -import Mathlib.Algebra.Category.ModuleCat.FilteredColimits -import Mathlib.CategoryTheory.Limits.ConcreteCategory.WithAlgebraicStructures +public import Mathlib.Algebra.Module.LocalizedModule.Basic +public import Mathlib.AlgebraicGeometry.StructureSheaf +public import Mathlib.AlgebraicGeometry.Modules.Sheaf +public import Mathlib.Algebra.Category.ModuleCat.Sheaf +public import Mathlib.Algebra.Category.ModuleCat.FilteredColimits +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.WithAlgebraicStructures /-! @@ -33,6 +34,8 @@ applying a forgetful functor to `ModuleCat.tilde M`. -/ +@[expose] public section + universe u open TopCat AlgebraicGeometry TopologicalSpace CategoryTheory Opposite diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean index 47a1647ef79e37..28b9eddb5c4a64 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated -import Mathlib.AlgebraicGeometry.Morphisms.IsIso +module + +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated +public import Mathlib.AlgebraicGeometry.Morphisms.IsIso /-! @@ -28,6 +30,8 @@ We also provide the instance `HasAffineProperty @IsAffineHom fun X _ _ _ ↦ IsA -/ +@[expose] public section + universe v u open CategoryTheory Limits TopologicalSpace Opposite diff --git a/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean b/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean index 55ea7f0d694cd2..24409137d594b8 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Affine -import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Affine +public import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties /-! # Affine morphisms with additional ring hom property @@ -22,6 +24,8 @@ Typical examples of this are affine morphisms (where `Q` is trivial), finite mor -/ +@[expose] public section + universe v u open CategoryTheory TopologicalSpace Opposite MorphismProperty diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean index cd914fc15815c6..e76967c62b507f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.AlgebraicGeometry.Pullbacks -import Mathlib.CategoryTheory.MorphismProperty.Local -import Mathlib.Data.List.TFAE +module + +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.AlgebraicGeometry.Pullbacks +public import Mathlib.CategoryTheory.MorphismProperty.Local +public import Mathlib.Data.List.TFAE /-! # Properties of morphisms between Schemes @@ -96,6 +98,8 @@ for the respective local property of morphism properties defined generally for c with a `Precoverage`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean index 262ffa6e21815b..6b60a55d8efec4 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Jonas van der Schaaf. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Christian Merten, Jonas van der Schaaf -/ -import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme -import Mathlib.AlgebraicGeometry.Morphisms.AffineAnd -import Mathlib.AlgebraicGeometry.Morphisms.FiniteType -import Mathlib.AlgebraicGeometry.ResidueField -import Mathlib.CategoryTheory.MorphismProperty.Comma +module + +public import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme +public import Mathlib.AlgebraicGeometry.Morphisms.AffineAnd +public import Mathlib.AlgebraicGeometry.Morphisms.FiniteType +public import Mathlib.AlgebraicGeometry.ResidueField +public import Mathlib.CategoryTheory.MorphismProperty.Comma /-! @@ -29,6 +31,8 @@ is a closed immersion and the induced morphisms of stalks are all surjective. -/ +@[expose] public section + universe v u open CategoryTheory Opposite TopologicalSpace Topology diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean index d8ebe7b6371252..7979f37192ab65 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Basic -import Mathlib.RingTheory.RingHomProperties +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Basic +public import Mathlib.RingTheory.RingHomProperties /-! @@ -30,6 +32,8 @@ types of properties. -/ +@[expose] public section + universe u v w open TopologicalSpace CategoryTheory CategoryTheory.Limits Opposite diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean b/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean index 0b06f6a0be691a..4c1540883cb23f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.AffineAnd -import Mathlib.AlgebraicGeometry.Morphisms.LocalIso -import Mathlib.CategoryTheory.MorphismProperty.Descent +module + +public import Mathlib.AlgebraicGeometry.Morphisms.AffineAnd +public import Mathlib.AlgebraicGeometry.Morphisms.LocalIso +public import Mathlib.CategoryTheory.MorphismProperty.Descent /-! # Descent of morphism properties @@ -28,6 +30,8 @@ that `P` descends along `P'` from a codescent property of ring homomorphisms. -/ +@[expose] public section + universe u v open TensorProduct CategoryTheory Limits @@ -108,7 +112,7 @@ lemma of_pullback_fst_Spec_of_codescendsAlong [P.RespectsIso] refine hQQ'.algebraMap_tensorProduct (R := R) (S := T) (T := S) _ (H₁ h) ?_ rwa [← pullbackSpecIso_hom_fst R T S, P.cancel_left_of_respectsIso, H₂] at hf -/-- If `X` admits a morphism `p : T ⟶ X` from an affine scheme satisfying `P', to +/-- If `X` admits a morphism `p : T ⟶ X` from an affine scheme satisfying `P'`, to show a property descends along a morphism `f : X ⟶ Z` satisfying `P'`, `X` may assumed to be affine. -/ lemma IsStableUnderBaseChange.of_pullback_fst_of_isAffine [P'.RespectsIso] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean b/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean index e6dd1bc2945faa..8dfc1ce8a94600 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Smooth -import Mathlib.AlgebraicGeometry.Morphisms.FormallyUnramified -import Mathlib.CategoryTheory.MorphismProperty.Comma -import Mathlib.RingTheory.Smooth.StandardSmoothCotangent -import Mathlib.CategoryTheory.Limits.MorphismProperty +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Smooth +public import Mathlib.AlgebraicGeometry.Morphisms.FormallyUnramified +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.RingTheory.Smooth.StandardSmoothCotangent +public import Mathlib.CategoryTheory.Limits.MorphismProperty /-! @@ -18,6 +20,8 @@ also define the category of schemes étale over `X`. -/ +@[expose] public section + universe t u universe u₂ u₁ v₂ v₁ diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean b/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean index af0a716657d376..4d91c3a35c2d03 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Integral -import Mathlib.Algebra.Category.Ring.Epi +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Integral +public import Mathlib.Algebra.Category.Ring.Epi /-! @@ -21,6 +23,8 @@ Also see `AlgebraicGeometry.IsFinite.finite_preimage_singleton` in -/ +@[expose] public section + universe v u open CategoryTheory TopologicalSpace Opposite MorphismProperty diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean b/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean index aeb3f982ba0601..88f9c3b5168172 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.FiniteType -import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated -import Mathlib.AlgebraicGeometry.Properties -import Mathlib.RingTheory.RingHom.FinitePresentation -import Mathlib.RingTheory.Spectrum.Prime.Chevalley +module + +public import Mathlib.AlgebraicGeometry.Morphisms.FiniteType +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated +public import Mathlib.AlgebraicGeometry.Properties +public import Mathlib.RingTheory.RingHom.FinitePresentation +public import Mathlib.RingTheory.Spectrum.Prime.Chevalley /-! @@ -24,6 +26,8 @@ We show that these properties are local, and are stable under compositions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean b/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean index c24679dec89311..526d169d4e68fc 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties -import Mathlib.RingTheory.RingHom.FiniteType -import Mathlib.RingTheory.Spectrum.Prime.Jacobson +module + +public import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties +public import Mathlib.RingTheory.RingHom.FiniteType +public import Mathlib.RingTheory.Spectrum.Prime.Jacobson /-! # Morphisms of finite type @@ -19,6 +21,8 @@ We show that these properties are local, and are stable under compositions and b -/ +@[expose] public section + noncomputable section open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean index 2ba722a796b492..224637a93dec0f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Affine -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.RingTheory.RingHom.FaithfullyFlat +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Affine +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.RingTheory.RingHom.FaithfullyFlat /-! # Flat morphisms @@ -18,6 +20,8 @@ We show that this property is local, and are stable under compositions and base -/ +@[expose] public section + noncomputable section open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean index 3dbaadf1099548..e76900c27b6722 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Separated -import Mathlib.RingTheory.Ideal.IdempotentFG -import Mathlib.RingTheory.RingHom.Unramified +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Separated +public import Mathlib.RingTheory.Ideal.IdempotentFG +public import Mathlib.RingTheory.RingHom.Unramified /-! # Formally unramified morphisms @@ -17,6 +19,8 @@ We show that these properties are local, and are stable under compositions and b -/ +@[expose] public section + noncomputable section @@ -98,7 +102,7 @@ theorem of_comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [FormallyUnramified (f ≫ g)] : FormallyUnramified f := HasRingHomProperty.of_comp (fun {R S T _ _ _} f g H ↦ by algebraize [f, g, g.comp f] - exact Algebra.FormallyUnramified.of_comp R S T) ‹_› + exact Algebra.FormallyUnramified.of_restrictScalars R S T) ‹_› instance : MorphismProperty.IsMultiplicative @FormallyUnramified where id_mem _ := inferInstance diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean index 58b94980f636f9..3ebe93d8fc527f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion -import Mathlib.AlgebraicGeometry.Morphisms.Separated -import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion +public import Mathlib.AlgebraicGeometry.Morphisms.Separated +public import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial /-! @@ -25,6 +27,8 @@ if and only if it can be factored into a closed immersion followed by an open im -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean b/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean index 758fc7c2f91e02..4ee64b8e450e6f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Separated -import Mathlib.AlgebraicGeometry.Morphisms.UniversallyClosed -import Mathlib.RingTheory.RingHom.Integral +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Separated +public import Mathlib.AlgebraicGeometry.Morphisms.UniversallyClosed +public import Mathlib.RingTheory.RingHom.Integral /-! @@ -19,6 +21,8 @@ and the induced ring map is integral. -/ +@[expose] public section + universe v u open CategoryTheory TopologicalSpace Opposite MorphismProperty diff --git a/Mathlib/AlgebraicGeometry/Morphisms/IsIso.lean b/Mathlib/AlgebraicGeometry/Morphisms/IsIso.lean index f279fb47423d47..a2b50e67db644c 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/IsIso.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/IsIso.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.OpenImmersion +module + +public import Mathlib.AlgebraicGeometry.Morphisms.OpenImmersion /-! @@ -11,6 +13,8 @@ import Mathlib.AlgebraicGeometry.Morphisms.OpenImmersion -/ +@[expose] public section + open CategoryTheory MorphismProperty namespace AlgebraicGeometry diff --git a/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean b/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean index eb6cb8a69d58fb..28df4a82fa3a34 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Basic +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Basic /-! # Local closure of morphism properties @@ -12,6 +14,8 @@ We define the source local closure of a property `P` w.r.t. a morphism property inherits stability properties from `P`. -/ +@[expose] public section + universe u open CategoryTheory Limits MorphismProperty diff --git a/Mathlib/AlgebraicGeometry/Morphisms/LocalIso.lean b/Mathlib/AlgebraicGeometry/Morphisms/LocalIso.lean index 31e9a224a271eb..dd5efe00ddebb2 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/LocalIso.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/LocalIso.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.LocalClosure +module + +public import Mathlib.AlgebraicGeometry.Morphisms.LocalClosure /-! # Local isomorphisms @@ -11,6 +13,8 @@ import Mathlib.AlgebraicGeometry.Morphisms.LocalClosure A local isomorphism of schemes is a morphism that is source-locally an open immersion. -/ +@[expose] public section + universe u open CategoryTheory MorphismProperty diff --git a/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean index 535f8f1f093921..565d778e03d010 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap +module + +public import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap /-! @@ -17,6 +19,8 @@ remaining theorems analogous to other lemmas in `AlgebraicGeometry/Morphisms/*`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean index e91699a13ca254..ed09628754fccc 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap -import Mathlib.AlgebraicGeometry.Morphisms.SurjectiveOnStalks +module + +public import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap +public import Mathlib.AlgebraicGeometry.Morphisms.SurjectiveOnStalks /-! @@ -17,6 +19,8 @@ in the literature but it is useful for generalizing results on immersions to oth -/ +@[expose] public section + universe v u open CategoryTheory Topology diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean index 241eb874ec197a..27278f5aa66a0e 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Separated -import Mathlib.AlgebraicGeometry.Morphisms.Finite +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Separated +public import Mathlib.AlgebraicGeometry.Morphisms.Finite /-! @@ -22,6 +24,8 @@ Note that we don't require quasi-compact, since this is implied by universally c -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean index a9255bca3d498c..bf16ea2df25552 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap -import Mathlib.Topology.Spectral.Hom -import Mathlib.AlgebraicGeometry.Limits +module + +public import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap +public import Mathlib.Topology.Spectral.Hom +public import Mathlib.AlgebraicGeometry.Limits /-! # Quasi-compact morphisms @@ -18,6 +20,8 @@ It suffices to check that preimages of affine open sets are compact -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean index d258fb8bcdf07f..d47d8aa596232d 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Constructors -import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Equalizer -import Mathlib.Topology.QuasiSeparated -import Mathlib.Topology.Sheaves.CommRingCat +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Constructors +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Equalizer +public import Mathlib.Topology.QuasiSeparated +public import Mathlib.Topology.Sheaves.CommRingCat /-! # Quasi-separated morphisms @@ -29,6 +31,8 @@ and is stable under compositions and base-changes. -/ +@[expose] public section + noncomputable section open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace diff --git a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean index 3681e3a995f38d..c29674006e3838 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Constructors -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.RingHom.Locally +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Constructors +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.RingHom.Locally /-! @@ -56,6 +58,8 @@ We also provide the instances `P.IsMultiplicative`, `P.IsStableUnderComposition` -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 universe u diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean b/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean index 383e13576c8487..cb3940980a4252 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic -import Mathlib.CategoryTheory.Limits.Constructions.Over.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Equalizer +module + +public import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Equalizer /-! @@ -22,6 +24,8 @@ A morphism of schemes is separated if its diagonal morphism is a closed immersio A morphism is separated iff the preimage of affine opens are separated schemes. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean index df10ef66e2c5ec..2d36fff84424c8 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties -import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation -import Mathlib.RingTheory.RingHom.StandardSmooth +module + +public import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties +public import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation +public import Mathlib.RingTheory.RingHom.StandardSmooth /-! @@ -36,6 +38,8 @@ June 2024. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean b/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean index 62a5a99856cf6d..a6cc7fe520a3af 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties -import Mathlib.RingTheory.RingHom.Surjective -import Mathlib.RingTheory.Spectrum.Prime.TensorProduct -import Mathlib.Topology.LocalAtTarget +module + +public import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties +public import Mathlib.RingTheory.RingHom.Surjective +public import Mathlib.RingTheory.Spectrum.Prime.TensorProduct +public import Mathlib.Topology.LocalAtTarget /-! # Morphisms surjective on stalks @@ -19,6 +21,8 @@ if `Y ⟶ S` is surjective on stalks, then for every `X ⟶ S`, `X ×ₛ Y` is a `X × Y` (Cartesian product as topological spaces) with the induced topology. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits Topology namespace AlgebraicGeometry diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean b/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean index d20643d2f3a8a3..a8aba8d2f6aeb0 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Topology.LocalAtTarget -import Mathlib.AlgebraicGeometry.Morphisms.Constructors +module + +public import Mathlib.Topology.LocalAtTarget +public import Mathlib.AlgebraicGeometry.Morphisms.Constructors /-! @@ -25,6 +27,8 @@ of the underlying map of topological spaces, including -/ +@[expose] public section + open CategoryTheory Topology TopologicalSpace namespace AlgebraicGeometry diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean index e81b1cde28c039..4d866f367c1ec9 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.Topology.LocalAtTarget +module + +public import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.Topology.LocalAtTarget /-! # Universally closed morphism @@ -19,6 +21,8 @@ base changes. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean index d76ea7e2c71fab..e2a213258f60c1 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.Topology.LocalAtTarget +module + +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.Topology.LocalAtTarget /-! # Universally injective morphism @@ -23,6 +25,8 @@ compositions and base changes. -/ +@[expose] public section + noncomputable section open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean index 9bc191f65caf4d..dbaad916cd56f3 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation -import Mathlib.AlgebraicGeometry.Morphisms.Flat -import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap -import Mathlib.RingTheory.Spectrum.Prime.Chevalley +module + +public import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation +public import Mathlib.AlgebraicGeometry.Morphisms.Flat +public import Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap +public import Mathlib.RingTheory.Spectrum.Prime.Chevalley /-! # Universally open morphism @@ -19,6 +21,8 @@ base changes. -/ +@[expose] public section + noncomputable section open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace diff --git a/Mathlib/AlgebraicGeometry/Noetherian.lean b/Mathlib/AlgebraicGeometry/Noetherian.lean index 656133981b617e..f50c5b83bfe44e 100644 --- a/Mathlib/AlgebraicGeometry/Noetherian.lean +++ b/Mathlib/AlgebraicGeometry/Noetherian.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Geno Racklin Asher. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Geno Racklin Asher -/ -import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated -import Mathlib.RingTheory.Localization.Submodule -import Mathlib.RingTheory.Spectrum.Prime.Noetherian +module + +public import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated +public import Mathlib.RingTheory.Localization.Submodule +public import Mathlib.RingTheory.Spectrum.Prime.Noetherian /-! # Noetherian and Locally Noetherian Schemes @@ -42,6 +44,8 @@ giving definitions, equivalent conditions, and basic properties. -/ +@[expose] public section + universe u v open Opposite AlgebraicGeometry Localization IsLocalization TopologicalSpace CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/OpenImmersion.lean b/Mathlib/AlgebraicGeometry/OpenImmersion.lean index a24cdc36ab38e7..77f36c765eb2bc 100644 --- a/Mathlib/AlgebraicGeometry/OpenImmersion.lean +++ b/Mathlib/AlgebraicGeometry/OpenImmersion.lean @@ -3,16 +3,20 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Geometry.RingedSpace.OpenImmersion -import Mathlib.AlgebraicGeometry.Scheme -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.Geometry.RingedSpace.OpenImmersion +public import Mathlib.AlgebraicGeometry.Scheme +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Open immersions of schemes -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 diff --git a/Mathlib/AlgebraicGeometry/Over.lean b/Mathlib/AlgebraicGeometry/Over.lean index 8271be17df00d1..67989f2a9bd493 100644 --- a/Mathlib/AlgebraicGeometry/Over.lean +++ b/Mathlib/AlgebraicGeometry/Over.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Scheme -import Mathlib.CategoryTheory.Comma.Over.OverClass +module + +public import Mathlib.AlgebraicGeometry.Scheme +public import Mathlib.CategoryTheory.Comma.Over.OverClass /-! # Typeclasses for `S`-schemes and `S`-morphisms @@ -18,6 +20,8 @@ We define these as thin wrappers around `CategoryTheory/Comma/OverClass`. -/ +@[expose] public section + namespace AlgebraicGeometry.Scheme universe u diff --git a/Mathlib/AlgebraicGeometry/PointsPi.lean b/Mathlib/AlgebraicGeometry/PointsPi.lean index 268f54efa3e843..21c044af28ea59 100644 --- a/Mathlib/AlgebraicGeometry/PointsPi.lean +++ b/Mathlib/AlgebraicGeometry/PointsPi.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Immersion +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Immersion /-! @@ -14,6 +16,8 @@ is injective and surjective under various assumptions. -/ +@[expose] public section + open CategoryTheory Limits PrimeSpectrum namespace AlgebraicGeometry diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean index 58528910072085..6174f91073d78c 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.AlgebraicGeometry.Gluing +module + +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.AlgebraicGeometry.Gluing /-! @@ -31,6 +33,8 @@ In this file we provide basic properties of the scheme. -/ +@[expose] public section + namespace AlgebraicGeometry.Proj open HomogeneousLocalization CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean index d1b9f9ac76a1f1..4c4368b2e9bac2 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Patience Ablett, Kevin Buzzard, Harald Carlens, Wayne Ng Kwing King, Michael Schlößer, Justus Springer, Andrew Yang, Jujian Zhang -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Basic -import Mathlib.AlgebraicGeometry.ValuativeCriterion +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Basic +public import Mathlib.AlgebraicGeometry.ValuativeCriterion /-! # Properness of `Proj A` @@ -18,6 +20,8 @@ This contribution was created as part of the Durham Computational Algebraic Geom -/ +@[expose] public section + namespace AlgebraicGeometry.Proj variable {σ A : Type*} diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean index 3eed7136a31e44..8f44527d1742d1 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Andrew Yang -/ -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf -import Mathlib.AlgebraicGeometry.GammaSpecAdjunction -import Mathlib.RingTheory.GradedAlgebra.Radical +module + +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf +public import Mathlib.AlgebraicGeometry.GammaSpecAdjunction +public import Mathlib.RingTheory.GradedAlgebra.Radical /-! # Proj as a scheme @@ -89,6 +91,8 @@ Finally, * [Robin Hartshorne, *Algebraic Geometry*][Har77]: Chapter II.2 Proposition 2.5 -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean index 946a1c57f48793..da74b781e1576f 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Topology -import Mathlib.Topology.Sheaves.LocalPredicate -import Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace +module + +public import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Topology +public import Mathlib.Topology.Sheaves.LocalPredicate +public import Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace /-! # The structure sheaf on `ProjectiveSpectrum 𝒜`. @@ -45,6 +47,8 @@ Then we establish that `Proj 𝒜` is a `LocallyRingedSpace`: -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean index 7790c3cb7a6ef1..80176923855512 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Johan Commelin -/ -import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal -import Mathlib.Topology.Category.TopCat.Basic -import Mathlib.Topology.Sets.Opens -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal +public import Mathlib.Topology.Category.TopCat.Basic +public import Mathlib.Topology.Sets.Opens +public import Mathlib.Data.Set.Subsingleton /-! # Projective spectrum of a graded ring @@ -35,6 +37,8 @@ It is naturally endowed with a topology: the Zariski topology. Zariski topology. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Properties.lean b/Mathlib/AlgebraicGeometry/Properties.lean index b4babc6e8d51d7..d423ff21af8819 100644 --- a/Mathlib/AlgebraicGeometry/Properties.lean +++ b/Mathlib/AlgebraicGeometry/Properties.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.RingTheory.LocalProperties.Reduced +module + +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.RingTheory.LocalProperties.Reduced /-! # Basic properties of schemes @@ -18,6 +20,8 @@ We provide some basic properties of schemes are reduced. -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 diff --git a/Mathlib/AlgebraicGeometry/PullbackCarrier.lean b/Mathlib/AlgebraicGeometry/PullbackCarrier.lean index 943991ac5dc55d..a6322387272c5b 100644 --- a/Mathlib/AlgebraicGeometry/PullbackCarrier.lean +++ b/Mathlib/AlgebraicGeometry/PullbackCarrier.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Qi Ge, Christian Merten, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Qi Ge, Christian Merten, Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.LinearAlgebra -import Mathlib.AlgebraicGeometry.ResidueField +module + +public import Mathlib.Algebra.Category.Ring.LinearAlgebra +public import Mathlib.AlgebraicGeometry.ResidueField /-! # Underlying topological space of fibre product of schemes @@ -24,6 +26,8 @@ We also give the ranges of `pullback.fst`, `pullback.snd` and `pullback.map`. -/ +@[expose] public section + open CategoryTheory Limits TopologicalSpace IsLocalRing TensorProduct noncomputable section diff --git a/Mathlib/AlgebraicGeometry/Pullbacks.lean b/Mathlib/AlgebraicGeometry/Pullbacks.lean index 30ced8e1559e95..dd127fe23afe5e 100644 --- a/Mathlib/AlgebraicGeometry/Pullbacks.lean +++ b/Mathlib/AlgebraicGeometry/Pullbacks.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.AlgebraicGeometry.Gluing -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Shapes.Diagonal -import Mathlib.CategoryTheory.Monoidal.Cartesian.Over +module + +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.AlgebraicGeometry.Gluing +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Shapes.Diagonal +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Over /-! # Fibred products of schemes @@ -24,6 +26,8 @@ constructed via tensor products. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/AlgebraicGeometry/QuasiAffine.lean b/Mathlib/AlgebraicGeometry/QuasiAffine.lean index 0e6763cef19904..90787b2e8fc764 100644 --- a/Mathlib/AlgebraicGeometry/QuasiAffine.lean +++ b/Mathlib/AlgebraicGeometry/QuasiAffine.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.Immersion +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Immersion /-! @@ -18,6 +20,8 @@ import Mathlib.AlgebraicGeometry.Morphisms.Immersion -/ +@[expose] public section + open CategoryTheory Limits TopologicalSpace universe u diff --git a/Mathlib/AlgebraicGeometry/RationalMap.lean b/Mathlib/AlgebraicGeometry/RationalMap.lean index bfe06f3dbdc1ed..00d05a4b0267c0 100644 --- a/Mathlib/AlgebraicGeometry/RationalMap.lean +++ b/Mathlib/AlgebraicGeometry/RationalMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.SpreadingOut -import Mathlib.AlgebraicGeometry.FunctionField -import Mathlib.AlgebraicGeometry.Morphisms.Separated +module + +public import Mathlib.AlgebraicGeometry.SpreadingOut +public import Mathlib.AlgebraicGeometry.FunctionField +public import Mathlib.AlgebraicGeometry.Morphisms.Separated /-! # Rational maps between schemes @@ -26,6 +28,8 @@ import Mathlib.AlgebraicGeometry.Morphisms.Separated map on `f.domain`, the domain of definition of `f`. -/ +@[expose] public section + universe u open CategoryTheory hiding Quotient diff --git a/Mathlib/AlgebraicGeometry/ResidueField.lean b/Mathlib/AlgebraicGeometry/ResidueField.lean index 351211c1970af0..93d59407404141 100644 --- a/Mathlib/AlgebraicGeometry/ResidueField.lean +++ b/Mathlib/AlgebraicGeometry/ResidueField.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Stalk -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace.ResidueField +module + +public import Mathlib.AlgebraicGeometry.Stalk +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace.ResidueField /-! @@ -26,6 +28,8 @@ The following are in the `AlgebraicGeometry.Scheme` namespace: -/ +@[expose] public section + universe u open CategoryTheory TopologicalSpace Opposite IsLocalRing diff --git a/Mathlib/AlgebraicGeometry/Restrict.lean b/Mathlib/AlgebraicGeometry/Restrict.lean index 99112656b3294f..403db74bcccd41 100644 --- a/Mathlib/AlgebraicGeometry/Restrict.lean +++ b/Mathlib/AlgebraicGeometry/Restrict.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Cover.Open -import Mathlib.AlgebraicGeometry.Over +module + +public import Mathlib.AlgebraicGeometry.Cover.Open +public import Mathlib.AlgebraicGeometry.Over /-! # Restriction of Schemes and Morphisms @@ -18,6 +20,8 @@ import Mathlib.AlgebraicGeometry.Over -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 diff --git a/Mathlib/AlgebraicGeometry/Scheme.lean b/Mathlib/AlgebraicGeometry/Scheme.lean index d4b1e498e1ea8f..f7f30340ab527e 100644 --- a/Mathlib/AlgebraicGeometry/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/Scheme.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.AlgebraicGeometry.Spec -import Mathlib.Algebra.Category.Ring.Constructions -import Mathlib.CategoryTheory.Elementwise +module + +public import Mathlib.AlgebraicGeometry.Spec +public import Mathlib.Algebra.Category.Ring.Constructions +public import Mathlib.CategoryTheory.Elementwise /-! # The category of schemes @@ -18,6 +20,8 @@ A morphism of schemes is just a morphism of the underlying locally ringed spaces -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 @@ -50,7 +54,7 @@ instance : CoeSort Scheme Type* where open Lean PrettyPrinter.Delaborator SubExpr in /-- Pretty printer for coercing schemes to types. -/ @[app_delab TopCat.carrier] -partial def delabAdjoinNotation : Delab := whenPPOption getPPNotation do +meta def delabAdjoinNotation : Delab := whenPPOption getPPNotation do guard <| (← getExpr).isAppOfArity ``TopCat.carrier 1 withNaryArg 0 do guard <| (← getExpr).isAppOfArity ``PresheafedSpace.carrier 3 diff --git a/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean b/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean index 0d730bc3390788..e6b82fc4da7734 100644 --- a/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean +++ b/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Adam Topaz -/ -import Mathlib.AlgebraicGeometry.Sites.Pretopology -import Mathlib.CategoryTheory.Sites.Canonical +module + +public import Mathlib.AlgebraicGeometry.Sites.Pretopology +public import Mathlib.CategoryTheory.Sites.Canonical /-! # The big Zariski site of schemes @@ -26,6 +28,8 @@ TODO: -/ +@[expose] public section + universe v u open CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/Sites/Etale.lean b/Mathlib/AlgebraicGeometry/Sites/Etale.lean index 49e2befa4130b9..017b35d30f1bc1 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Etale.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Etale.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Etale -import Mathlib.AlgebraicGeometry.PullbackCarrier -import Mathlib.AlgebraicGeometry.Sites.BigZariski -import Mathlib.AlgebraicGeometry.Sites.Small +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Etale +public import Mathlib.AlgebraicGeometry.PullbackCarrier +public import Mathlib.AlgebraicGeometry.Sites.BigZariski +public import Mathlib.AlgebraicGeometry.Sites.Small /-! @@ -17,6 +19,8 @@ on the category of schemes. -/ +@[expose] public section + universe v u open CategoryTheory MorphismProperty Limits diff --git a/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean b/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean index 836b91089e7b3b..3117ce4d8585ad 100644 --- a/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean +++ b/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Joël Riou, Adam Topaz -/ -import Mathlib.AlgebraicGeometry.OpenImmersion -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.Sites.JointlySurjective -import Mathlib.CategoryTheory.Sites.MorphismProperty +module + +public import Mathlib.AlgebraicGeometry.OpenImmersion +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.Sites.JointlySurjective +public import Mathlib.CategoryTheory.Sites.MorphismProperty /-! @@ -18,6 +20,8 @@ by jointly surjective families of morphisms satisfying `P`. -/ +@[expose] public section + universe v u open CategoryTheory MorphismProperty Limits diff --git a/Mathlib/AlgebraicGeometry/Sites/Pretopology.lean b/Mathlib/AlgebraicGeometry/Sites/Pretopology.lean index d43e79ad978490..672271252338cd 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Pretopology.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Pretopology.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Sites.MorphismProperty -import Mathlib.AlgebraicGeometry.PullbackCarrier +module + +public import Mathlib.AlgebraicGeometry.Sites.MorphismProperty +public import Mathlib.AlgebraicGeometry.PullbackCarrier /-! # Grothendieck topology defined by a morphism property @@ -20,6 +22,8 @@ The pretopology is obtained from the precoverage `AlgebraicGeometry.Scheme.preco because the former does not have `HasPullbacks Scheme`. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicGeometry/Sites/Representability.lean b/Mathlib/AlgebraicGeometry/Sites/Representability.lean index e6345b1108b4cf..bc5bd34d8fe271 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Representability.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Representability.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne, Joël Riou, Ravi Vakil -/ -import Mathlib.CategoryTheory.MorphismProperty.Representable -import Mathlib.AlgebraicGeometry.Sites.BigZariski -import Mathlib.AlgebraicGeometry.OpenImmersion -import Mathlib.AlgebraicGeometry.GluingOneHypercover -import Mathlib.CategoryTheory.Sites.LocallyBijective -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso +module + +public import Mathlib.CategoryTheory.MorphismProperty.Representable +public import Mathlib.AlgebraicGeometry.Sites.BigZariski +public import Mathlib.AlgebraicGeometry.OpenImmersion +public import Mathlib.AlgebraicGeometry.GluingOneHypercover +public import Mathlib.CategoryTheory.Sites.LocallyBijective +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso /-! # Representability of schemes is a local property @@ -32,6 +34,8 @@ locally representable. -/ +@[expose] public section + namespace AlgebraicGeometry open CategoryTheory Category Limits Opposite diff --git a/Mathlib/AlgebraicGeometry/Sites/Small.lean b/Mathlib/AlgebraicGeometry/Sites/Small.lean index ff6928e3c76e54..697c45c7a62c64 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Small.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Small.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.AlgebraicGeometry.Cover.Over -import Mathlib.AlgebraicGeometry.Sites.Pretopology -import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology -import Mathlib.CategoryTheory.Sites.Over +module + +public import Mathlib.AlgebraicGeometry.Cover.Over +public import Mathlib.AlgebraicGeometry.Sites.Pretopology +public import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology +public import Mathlib.CategoryTheory.Sites.Over /-! # Small sites @@ -29,6 +31,8 @@ generating pretopologies. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean b/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean index 2cad6b4acc7883..dce9e62f764158 100644 --- a/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean +++ b/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology +module + +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology /-! @@ -26,6 +28,8 @@ Zariski site are arbitrary inclusions. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/Spec.lean b/Mathlib/AlgebraicGeometry/Spec.lean index 15dcec5fd5c048..d71b8214723d4f 100644 --- a/Mathlib/AlgebraicGeometry/Spec.lean +++ b/Mathlib/AlgebraicGeometry/Spec.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Justus Springer -/ -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace -import Mathlib.AlgebraicGeometry.StructureSheaf -import Mathlib.RingTheory.Localization.LocalizationLocalization -import Mathlib.Topology.Sheaves.SheafCondition.Sites -import Mathlib.Topology.Sheaves.Functors -import Mathlib.Algebra.Module.LocalizedModule.Basic +module + +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace +public import Mathlib.AlgebraicGeometry.StructureSheaf +public import Mathlib.RingTheory.Localization.LocalizationLocalization +public import Mathlib.Topology.Sheaves.SheafCondition.Sites +public import Mathlib.Topology.Sheaves.Functors +public import Mathlib.Algebra.Module.LocalizedModule.Basic /-! # $Spec$ as a functor to locally ringed spaces. @@ -32,6 +34,8 @@ The adjunction `Γ ⊣ Spec` is constructed in `Mathlib/AlgebraicGeometry/GammaS -/ +@[expose] public section + -- Explicit universe annotations were used in this file to improve performance https://github.com/leanprover-community/mathlib4/issues/12737 diff --git a/Mathlib/AlgebraicGeometry/SpreadingOut.lean b/Mathlib/AlgebraicGeometry/SpreadingOut.lean index 487d4d94b471bb..27f80103eb4b5a 100644 --- a/Mathlib/AlgebraicGeometry/SpreadingOut.lean +++ b/Mathlib/AlgebraicGeometry/SpreadingOut.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.AlgebraicGeometry.Morphisms.FiniteType -import Mathlib.AlgebraicGeometry.Noetherian -import Mathlib.AlgebraicGeometry.Stalk -import Mathlib.AlgebraicGeometry.Properties +module + +public import Mathlib.AlgebraicGeometry.Morphisms.FiniteType +public import Mathlib.AlgebraicGeometry.Noetherian +public import Mathlib.AlgebraicGeometry.Stalk +public import Mathlib.AlgebraicGeometry.Properties /-! # Spreading out morphisms @@ -43,6 +45,8 @@ Show that certain morphism properties can also be spread out. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/AlgebraicGeometry/Stalk.lean b/Mathlib/AlgebraicGeometry/Stalk.lean index a2b439995c1309..57bd704cae487b 100644 --- a/Mathlib/AlgebraicGeometry/Stalk.lean +++ b/Mathlib/AlgebraicGeometry/Stalk.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Fangming Li -/ -import Mathlib.AlgebraicGeometry.AffineScheme -import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion +module + +public import Mathlib.AlgebraicGeometry.AffineScheme +public import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion /-! # Stalks of a Scheme @@ -19,6 +21,8 @@ import Mathlib.AlgebraicGeometry.Morphisms.Preimmersion `(x, f)` where `x : X` and `f : 𝒪_{X, x} ⟶ R` is a local ring homomorphism. -/ +@[expose] public section + namespace AlgebraicGeometry open CategoryTheory Opposite TopologicalSpace IsLocalRing diff --git a/Mathlib/AlgebraicGeometry/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/StructureSheaf.lean index 657ab33b405c97..1600e3025dc9e2 100644 --- a/Mathlib/AlgebraicGeometry/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/StructureSheaf.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison -/ -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.Category.Ring.Instances -import Mathlib.Algebra.Category.Ring.Limits -import Mathlib.Algebra.Ring.Subring.Basic -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.Topology.Sheaves.LocalPredicate +module + +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.Category.Ring.Instances +public import Mathlib.Algebra.Category.Ring.Limits +public import Mathlib.Algebra.Ring.Subring.Basic +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.Topology.Sheaves.LocalPredicate /-! # The structure sheaf on `PrimeSpectrum R`. @@ -45,6 +47,8 @@ and the localization of `R` at the submonoid of powers of `f`. -/ +@[expose] public section + universe u diff --git a/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean b/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean index 188d3aa8cda662..73416b909ad0d1 100644 --- a/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean +++ b/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang, Qi Ge, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Qi Ge, Christian Merten -/ -import Mathlib.AlgebraicGeometry.Morphisms.Immersion -import Mathlib.AlgebraicGeometry.Morphisms.Proper -import Mathlib.RingTheory.RingHom.Injective -import Mathlib.RingTheory.Valuation.LocalSubring +module + +public import Mathlib.AlgebraicGeometry.Morphisms.Immersion +public import Mathlib.AlgebraicGeometry.Morphisms.Proper +public import Mathlib.RingTheory.RingHom.Injective +public import Mathlib.RingTheory.Valuation.LocalSubring /-! # Valuative criterion @@ -28,6 +30,8 @@ Show that it suffices to check discrete valuation rings when the base is Noether -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits namespace AlgebraicGeometry diff --git a/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean b/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean index 38a650bf3ef1de..2fa06ec4c01815 100644 --- a/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean +++ b/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Adam Topaz, Johan Commelin -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.AlgebraicTopology.MooreComplex -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.CategoryTheory.Preadditive.Opposite -import Mathlib.CategoryTheory.Idempotents.FunctorCategories +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.AlgebraicTopology.MooreComplex +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.CategoryTheory.Preadditive.Opposite +public import Mathlib.CategoryTheory.Idempotents.FunctorCategories /-! @@ -32,6 +34,8 @@ when `A` is an abelian category. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits CategoryTheory.Subobject diff --git a/Mathlib/AlgebraicTopology/CechNerve.lean b/Mathlib/AlgebraicTopology/CechNerve.lean index 8739f1cef206cb..1c58a43a3e4076 100644 --- a/Mathlib/AlgebraicTopology/CechNerve.lean +++ b/Mathlib/AlgebraicTopology/CechNerve.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! @@ -29,6 +31,8 @@ object, when `C` has finite products. We call this `cechNerveTerminalFrom`. When -/ +@[expose] public section + open CategoryTheory Limits diff --git a/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean b/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean index f8b81e2c2fbfeb..ea483067522c11 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Equivalence +module + +public import Mathlib.CategoryTheory.Equivalence /-! Tools for compatibilities between Dold-Kan equivalences @@ -38,6 +40,8 @@ unit and counit isomorphisms of `equivalence`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category Functor diff --git a/Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean b/Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean index 99ebe59ac247ce..a67e2068316c0b 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.PInfty +module + +public import Mathlib.AlgebraicTopology.DoldKan.PInfty /-! @@ -29,6 +31,8 @@ reflects isomorphisms. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Preadditive Opposite Simplicial diff --git a/Mathlib/AlgebraicTopology/DoldKan/Degeneracies.lean b/Mathlib/AlgebraicTopology/DoldKan/Degeneracies.lean index 709208869fabf2..83ee6e284ab5bc 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Degeneracies.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Degeneracies.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.Decomposition -import Mathlib.Tactic.FinCases +module + +public import Mathlib.AlgebraicTopology.DoldKan.Decomposition +public import Mathlib.Tactic.FinCases /-! @@ -25,6 +27,8 @@ statement vanishing statement `σ_comp_P_eq_zero` for the `P q`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive Simplicial diff --git a/Mathlib/AlgebraicTopology/DoldKan/Equivalence.lean b/Mathlib/AlgebraicTopology/DoldKan/Equivalence.lean index 14ef2971ea6b8b..3956630cb07052 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Equivalence.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Equivalence.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.EquivalencePseudoabelian -import Mathlib.AlgebraicTopology.DoldKan.Normalized +module + +public import Mathlib.AlgebraicTopology.DoldKan.EquivalencePseudoabelian +public import Mathlib.AlgebraicTopology.DoldKan.Normalized /-! @@ -119,6 +121,8 @@ what is the best way to do this. The exact design may be decided when it is need -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicTopology/DoldKan/EquivalenceAdditive.lean b/Mathlib/AlgebraicTopology/DoldKan/EquivalenceAdditive.lean index 2f2684686e03ab..73e4580bc08284 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/EquivalenceAdditive.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/EquivalenceAdditive.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.NCompGamma +module + +public import Mathlib.AlgebraicTopology.DoldKan.NCompGamma /-! The Dold-Kan equivalence for additive categories. @@ -14,6 +16,8 @@ of categories `Karoubi (SimplicialObject C) ≌ Karoubi (ChainComplex C ℕ)`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicTopology/DoldKan/EquivalencePseudoabelian.lean b/Mathlib/AlgebraicTopology/DoldKan/EquivalencePseudoabelian.lean index 4abe1e6c68e410..c73c01a1a39807 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/EquivalencePseudoabelian.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/EquivalencePseudoabelian.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.EquivalenceAdditive -import Mathlib.AlgebraicTopology.DoldKan.Compatibility -import Mathlib.CategoryTheory.Idempotents.SimplicialObject -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.AlgebraicTopology.DoldKan.EquivalenceAdditive +public import Mathlib.AlgebraicTopology.DoldKan.Compatibility +public import Mathlib.CategoryTheory.Idempotents.SimplicialObject +public import Mathlib.Tactic.SuppressCompilation /-! @@ -33,6 +35,8 @@ the composition of `N₁ : SimplicialObject C ⥤ Karoubi (ChainComplex C ℕ)` -/ +@[expose] public section + suppress_compilation noncomputable section @@ -97,8 +101,8 @@ theorem equivalence_functor : (equivalence : SimplicialObject C ≌ _).functor = theorem equivalence_inverse : (equivalence : SimplicialObject C ≌ _).inverse = Γ := rfl -/-- The natural isomorphism `NΓ' satisfies the compatibility that is needed -for the construction of our counit isomorphism `η` -/ +/-- The natural isomorphism `NΓ'` satisfies the compatibility that is needed +for the construction of our counit isomorphism `η`. -/ theorem hη : Compatibility.τ₀ = Compatibility.τ₁ isoN₁ isoΓ₀ diff --git a/Mathlib/AlgebraicTopology/DoldKan/Faces.lean b/Mathlib/AlgebraicTopology/DoldKan/Faces.lean index f552fff1b3a655..8cddd8e3eb8d12 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Faces.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Faces.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.Homotopies -import Mathlib.Tactic.Ring +module + +public import Mathlib.AlgebraicTopology.DoldKan.Homotopies +public import Mathlib.Tactic.Ring /-! @@ -23,6 +25,8 @@ on two technical lemmas `HigherFacesVanish.comp_Hσ_eq` and -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.SimplicialObject Simplicial diff --git a/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean b/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean index 415442541ad505..56bb13a2717ec0 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Split -import Mathlib.AlgebraicTopology.DoldKan.PInfty +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Split +public import Mathlib.AlgebraicTopology.DoldKan.PInfty /-! @@ -28,6 +30,8 @@ which shall be an equivalence for any additive category `C`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean b/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean index 87f31cc84df12b..e99840961385e5 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.PInfty +module + +public import Mathlib.AlgebraicTopology.DoldKan.PInfty /-! @@ -30,6 +32,8 @@ normalized Moore complex functor shall be obtained in `Normalized.lean`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Idempotents diff --git a/Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean b/Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean index 14e52299d2675e..2da4a9dc9f889f 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma -import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject -import Mathlib.CategoryTheory.Idempotents.HomologicalComplex -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma +public import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject +public import Mathlib.CategoryTheory.Idempotents.HomologicalComplex +public import Mathlib.Tactic.SuppressCompilation /-! The counit isomorphism of the Dold-Kan equivalence @@ -18,6 +20,8 @@ and `N₂Γ₂ : Γ₂ ⋙ N₂ ≅ 𝟭 (Karoubi (ChainComplex C ℕ))`. -/ +@[expose] public section + suppress_compilation noncomputable section diff --git a/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean b/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean index 3707c1a00644f2..9f2ffa31b43a55 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.AlgebraicTopology.DoldKan.Notations +module + +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.AlgebraicTopology.DoldKan.Notations /-! @@ -55,6 +57,8 @@ compatible the application of additive functors (see `map_Hσ`). -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive CategoryTheory.SimplicialObject Homotopy Opposite Simplicial DoldKan diff --git a/Mathlib/AlgebraicTopology/DoldKan/HomotopyEquivalence.lean b/Mathlib/AlgebraicTopology/DoldKan/HomotopyEquivalence.lean index 367111399ca9c9..a08f3fb954e522 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/HomotopyEquivalence.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/HomotopyEquivalence.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.Normalized +module + +public import Mathlib.AlgebraicTopology.DoldKan.Normalized /-! @@ -15,6 +17,8 @@ normalized Moore complex and the alternating face map complex of a simplicial ob -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive Simplicial DoldKan diff --git a/Mathlib/AlgebraicTopology/DoldKan/NCompGamma.lean b/Mathlib/AlgebraicTopology/DoldKan/NCompGamma.lean index b097c079e420ab..884a46fca31055 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/NCompGamma.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/NCompGamma.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.GammaCompN -import Mathlib.AlgebraicTopology.DoldKan.NReflectsIso +module + +public import Mathlib.AlgebraicTopology.DoldKan.GammaCompN +public import Mathlib.AlgebraicTopology.DoldKan.NReflectsIso /-! The unit isomorphism of the Dold-Kan equivalence @@ -21,6 +23,8 @@ which reflects isomorphisms. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean b/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean index b6618c2a1c9b61..89e433ab29a35f 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.FunctorN -import Mathlib.AlgebraicTopology.DoldKan.Decomposition -import Mathlib.CategoryTheory.Idempotents.HomologicalComplex -import Mathlib.CategoryTheory.Idempotents.KaroubiKaroubi +module + +public import Mathlib.AlgebraicTopology.DoldKan.FunctorN +public import Mathlib.AlgebraicTopology.DoldKan.Decomposition +public import Mathlib.CategoryTheory.Idempotents.HomologicalComplex +public import Mathlib.CategoryTheory.Idempotents.KaroubiKaroubi /-! @@ -21,6 +23,8 @@ reflect isomorphisms for any preadditive category `C`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Idempotents Opposite Simplicial diff --git a/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean b/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean index 902c1ed0baac74..253ae6f5c35751 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.FunctorN +module + +public import Mathlib.AlgebraicTopology.DoldKan.FunctorN /-! @@ -25,6 +27,8 @@ with a functor (definitionally) equal to `normalizedMooreComplex A`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Subobject CategoryTheory.Idempotents DoldKan diff --git a/Mathlib/AlgebraicTopology/DoldKan/Notations.lean b/Mathlib/AlgebraicTopology/DoldKan/Notations.lean index 6fd035027232c3..0b5cf3191a18b8 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Notations.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Notations.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex +module + +public import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex /-! @@ -17,6 +19,8 @@ as `N[X]` for the normalized subcomplex in the case `C` is an abelian category. -/ +@[expose] public section + @[inherit_doc] scoped[DoldKan] notation "K[" X "]" => AlgebraicTopology.AlternatingFaceMapComplex.obj X diff --git a/Mathlib/AlgebraicTopology/DoldKan/PInfty.lean b/Mathlib/AlgebraicTopology/DoldKan/PInfty.lean index 6d2644d1ca7d9c..b17c7cc4c61ba4 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/PInfty.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/PInfty.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.Projections -import Mathlib.CategoryTheory.Idempotents.FunctorCategories -import Mathlib.CategoryTheory.Idempotents.FunctorExtension +module + +public import Mathlib.AlgebraicTopology.DoldKan.Projections +public import Mathlib.CategoryTheory.Idempotents.FunctorCategories +public import Mathlib.CategoryTheory.Idempotents.FunctorExtension /-! @@ -21,6 +23,8 @@ projection on the normalized Moore subcomplex, with kernel the degenerate subcom -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.SimplicialObject CategoryTheory.Idempotents Opposite Simplicial DoldKan diff --git a/Mathlib/AlgebraicTopology/DoldKan/Projections.lean b/Mathlib/AlgebraicTopology/DoldKan/Projections.lean index 1aab041729c35e..4c156f4a343906 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Projections.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Projections.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.DoldKan.Faces -import Mathlib.CategoryTheory.Idempotents.Basic +module + +public import Mathlib.AlgebraicTopology.DoldKan.Faces +public import Mathlib.CategoryTheory.Idempotents.Basic /-! @@ -27,6 +29,8 @@ in order to define `PInfty : K[X] ⟶ K[X]`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive CategoryTheory.SimplicialObject Opposite CategoryTheory.Idempotents diff --git a/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean b/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean index 9a694ca6a60aaa..fb439003b0e5b1 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Split -import Mathlib.AlgebraicTopology.DoldKan.Degeneracies -import Mathlib.AlgebraicTopology.DoldKan.FunctorN +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Split +public import Mathlib.AlgebraicTopology.DoldKan.Degeneracies +public import Mathlib.AlgebraicTopology.DoldKan.FunctorN /-! @@ -19,6 +21,8 @@ when `C` is a preadditive category with finite coproducts, and get an isomorphis -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.Idempotents Opposite AlgebraicTopology AlgebraicTopology.DoldKan diff --git a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean index 97abde1929d53b..69b34e12d9f637 100644 --- a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean +++ b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex -import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex -import Mathlib.AlgebraicTopology.CechNerve -import Mathlib.Algebra.Homology.Homotopy -import Mathlib.Tactic.FinCases +module + +public import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex +public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex +public import Mathlib.AlgebraicTopology.CechNerve +public import Mathlib.Algebra.Homology.Homotopy +public import Mathlib.Tactic.FinCases /-! @@ -42,6 +44,8 @@ equivalence. -/ +@[expose] public section + open CategoryTheory Category SimplicialObject.Augmented Opposite Simplicial diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean index 1b472b5d803c68..294d44f5994d69 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Shing Tak Lam. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shing Tak Lam -/ -import Mathlib.CategoryTheory.Category.Grpd -import Mathlib.CategoryTheory.Groupoid -import Mathlib.Topology.Category.TopCat.Basic -import Mathlib.Topology.Homotopy.Path -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.CategoryTheory.Category.Grpd +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.Topology.Category.TopCat.Basic +public import Mathlib.Topology.Homotopy.Path +public import Mathlib.Data.Set.Subsingleton /-! # Fundamental groupoid of a space @@ -18,6 +20,8 @@ homotopy equivalence. With this, the fundamental group of `X` based at `x` is ju group of `x`. -/ +@[expose] public section + open CategoryTheory variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] @@ -38,36 +42,19 @@ def reflTransSymmAux (x : I × I) : ℝ := if (x.2 : ℝ) ≤ 1 / 2 then x.1 * 2 * x.2 else x.1 * (2 - 2 * x.2) @[continuity, fun_prop] -theorem continuous_reflTransSymmAux : Continuous reflTransSymmAux := by - refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_ - iterate 4 fun_prop - intro x hx - norm_num [hx, mul_assoc] +theorem continuous_reflTransSymmAux : Continuous reflTransSymmAux := + continuous_if_le (by fun_prop) (by fun_prop) (by fun_prop) (by fun_prop) (by grind) theorem reflTransSymmAux_mem_I (x : I × I) : reflTransSymmAux x ∈ I := by dsimp only [reflTransSymmAux] split_ifs · constructor - · apply mul_nonneg - · apply mul_nonneg - · unit_interval - · simp - · unit_interval + · apply mul_nonneg <;> grind · rw [mul_assoc] - apply mul_le_one₀ - · unit_interval - · apply mul_nonneg - · simp - · unit_interval - · linarith + apply mul_le_one₀ <;> grind · constructor - · apply mul_nonneg - · unit_interval - linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] - · apply mul_le_one₀ - · unit_interval - · linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] - · linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] + · apply mul_nonneg <;> grind + · apply mul_le_one₀ <;> grind /-- For any path `p` from `x₀` to `x₁`, we have a homotopy from the constant path based at `x₀` to `p.trans p.symm`. -/ @@ -78,10 +65,10 @@ def reflTransSymm (p : Path x₀ x₁) : Homotopy (Path.refl x₀) (p.trans p.sy map_one_left x := by simp only [reflTransSymmAux, Path.trans] cases le_or_gt (x : ℝ) 2⁻¹ with - | inl hx => simp [hx, ← extend_extends] + | inl hx => simp [hx, ← extend_apply] | inr hx => have : p.extend (2 - 2 * ↑x) = p.extend (1 - (2 * ↑x - 1)) := by ring_nf - simpa [hx.not_ge, ← extend_extends] + simpa [hx.not_ge, ← extend_apply] prop' t := by norm_num [reflTransSymmAux] /-- For any path `p` from `x₀` to `x₁`, we have a homotopy from the constant path based at `x₁` to @@ -98,11 +85,8 @@ def transReflReparamAux (t : I) : ℝ := if (t : ℝ) ≤ 1 / 2 then 2 * t else 1 @[continuity, fun_prop] -theorem continuous_transReflReparamAux : Continuous transReflReparamAux := by - refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_ <;> - [fun_prop; fun_prop; fun_prop; fun_prop; skip] - intro x hx - simp [hx] +theorem continuous_transReflReparamAux : Continuous transReflReparamAux := + continuous_if_le (by fun_prop) (by fun_prop) (by fun_prop) (by fun_prop) (by grind) theorem transReflReparamAux_mem_I (t : I) : transReflReparamAux t ∈ I := by unfold transReflReparamAux @@ -120,12 +104,8 @@ theorem trans_refl_reparam (p : Path x₀ x₁) : (Subtype.ext transReflReparamAux_zero) (Subtype.ext transReflReparamAux_one) := by ext unfold transReflReparamAux - simp only [Path.trans_apply, coe_reparam, Function.comp_apply, one_div, Path.refl_apply] - split_ifs - · rfl - · rfl - · simp - · simp + simp only [coe_reparam] + grind /-- For any path `p` from `x₀` to `x₁`, we have a homotopy from `p.trans (Path.refl x₁)` to `p`. -/ def transRefl (p : Path x₀ x₁) : Homotopy (p.trans (Path.refl x₁)) p := @@ -147,15 +127,10 @@ def transAssocReparamAux (t : I) : ℝ := if (t : ℝ) ≤ 1 / 4 then 2 * t else if (t : ℝ) ≤ 1 / 2 then t + 1 / 4 else 1 / 2 * (t + 1) @[continuity, fun_prop] -theorem continuous_transAssocReparamAux : Continuous transAssocReparamAux := by - refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) - (continuous_if_le ?_ ?_ - (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_).continuousOn - ?_ <;> - [fun_prop; fun_prop; fun_prop; fun_prop; fun_prop; fun_prop; fun_prop; skip; - skip] <;> - · intro x hx - norm_num [hx] +theorem continuous_transAssocReparamAux : Continuous transAssocReparamAux := + continuous_if_le (by fun_prop) (by fun_prop) (by fun_prop) + (continuous_if_le (by fun_prop) (by fun_prop) (by fun_prop) (by fun_prop) + (by grind)).continuousOn (by grind) theorem transAssocReparamAux_mem_I (t : I) : transAssocReparamAux t ∈ I := by unfold transAssocReparamAux @@ -173,16 +148,12 @@ theorem trans_assoc_reparam {x₀ x₁ x₂ x₃ : X} (p : Path x₀ x₁) (q : (fun t => ⟨transAssocReparamAux t, transAssocReparamAux_mem_I t⟩) (by fun_prop) (Subtype.ext transAssocReparamAux_zero) (Subtype.ext transAssocReparamAux_one) := by ext x - simp only [transAssocReparamAux, Path.trans_apply, Function.comp_apply, mul_ite, Path.coe_reparam] - -- TODO: why does split_ifs not reduce the ifs?????? - split_ifs with h₁ h₂ h₃ h₄ h₅ - · rfl - iterate 6 exfalso; linarith - · have h : 2 * (2 * (x : ℝ)) - 1 = 2 * (2 * (↑x + 1 / 4) - 1) := by linarith - simp [h] - iterate 6 exfalso; linarith - · congr - ring + simp only [transAssocReparamAux, Path.trans_apply, Function.comp_apply, Path.coe_reparam] + split_ifs + iterate 12 grind + · linarith + · linarith + · grind /-- For paths `p q r`, we have a homotopy from `(p.trans q).trans r` to `p.trans (q.trans r)`. -/ def transAssoc {x₀ x₁ x₂ x₃ : X} (p : Path x₀ x₁) (q : Path x₁ x₂) (r : Path x₂ x₃) : @@ -196,6 +167,69 @@ end Assoc end Homotopy +namespace Homotopic + +theorem refl_trans (p : Path x₀ x₁) : + ((Path.refl x₀).trans p).Homotopic p := + ⟨Homotopy.reflTrans p⟩ + +theorem trans_refl (p : Path x₀ x₁) : + (p.trans (Path.refl x₁)).Homotopic p := + ⟨Homotopy.transRefl p⟩ + +theorem trans_symm (p : Path x₀ x₁) : + (p.trans p.symm).Homotopic (Path.refl x₀) := + ⟨(Homotopy.reflTransSymm p).symm⟩ + +theorem symm_trans (p : Path x₀ x₁) : + (p.symm.trans p).Homotopic (Path.refl x₁) := + ⟨(Homotopy.reflSymmTrans p).symm⟩ + +theorem trans_assoc {x₀ x₁ x₂ x₃ : X} (p : Path x₀ x₁) (q : Path x₁ x₂) (r : Path x₂ x₃) : + ((p.trans q).trans r).Homotopic (p.trans (q.trans r)) := + ⟨Homotopy.transAssoc p q r⟩ + +namespace Quotient + +@[simp, grind =] +theorem refl_trans (γ : Homotopic.Quotient x₀ x₁) : + trans (refl x₀) γ = γ := by + induction γ using Quotient.ind with | mk γ => + simpa [← mk_trans, ← mk_refl, eq] using Homotopic.refl_trans γ + +@[simp, grind =] +theorem trans_refl (γ : Homotopic.Quotient x₀ x₁) : + trans γ (refl x₁) = γ := by + induction γ using Quotient.ind with | mk γ => + simpa [← mk_trans, ← mk_refl, eq] using Homotopic.trans_refl γ + +@[simp, grind =] +theorem trans_symm (γ : Homotopic.Quotient x₀ x₁) : + trans γ (symm γ) = refl x₀ := by + induction γ using Quotient.ind with | mk γ => + simpa [← mk_trans, ← mk_symm, ← mk_refl, eq] using Homotopic.trans_symm γ + +@[simp, grind =] +theorem symm_trans (γ : Homotopic.Quotient x₀ x₁) : + trans (symm γ) γ = refl x₁ := by + induction γ using Quotient.ind with | mk γ => + simpa [← mk_trans, ← mk_symm, ← mk_refl, eq] using Homotopic.symm_trans γ + +@[simp, grind _=_] +theorem trans_assoc {x₀ x₁ x₂ x₃ : X} + (γ₀ : Homotopic.Quotient x₀ x₁) + (γ₁ : Homotopic.Quotient x₁ x₂) + (γ₂ : Homotopic.Quotient x₂ x₃) : + trans (trans γ₀ γ₁) γ₂ = trans γ₀ (trans γ₁ γ₂) := by + induction γ₀ using Quotient.ind with | mk γ₀ => + induction γ₁ using Quotient.ind with | mk γ₁ => + induction γ₂ using Quotient.ind with | mk γ₂ => + simpa [← mk_trans, eq] using Homotopic.trans_assoc γ₀ γ₁ γ₂ + +end Quotient + +end Homotopic + end Path /-- The fundamental groupoid of a space `X` is defined to be a wrapper around `X`, and we @@ -251,7 +285,7 @@ instance {X : Type*} [Inhabited X] : Inhabited (FundamentalGroupoid X) := instance : Groupoid (FundamentalGroupoid X) where Hom x y := Path.Homotopic.Quotient x.as y.as id x := ⟦Path.refl x.as⟧ - comp := Path.Homotopic.Quotient.comp + comp := Path.Homotopic.Quotient.trans id_comp := by rintro _ _ ⟨f⟩; exact Quotient.sound ⟨Path.Homotopy.reflTrans f⟩ comp_id := by rintro _ _ ⟨f⟩; exact Quotient.sound ⟨Path.Homotopy.transRefl f⟩ assoc := by rintro _ _ _ _ ⟨f⟩ ⟨g⟩ ⟨h⟩; exact Quotient.sound ⟨Path.Homotopy.transAssoc f g h⟩ @@ -259,14 +293,14 @@ instance : Groupoid (FundamentalGroupoid X) where inv_comp := by rintro _ _ ⟨f⟩; exact Quotient.sound ⟨(Path.Homotopy.reflSymmTrans f).symm⟩ comp_inv := by rintro _ _ ⟨f⟩; exact Quotient.sound ⟨(Path.Homotopy.reflTransSymm f).symm⟩ -theorem comp_eq (x y z : FundamentalGroupoid X) (p : x ⟶ y) (q : y ⟶ z) : p ≫ q = p.comp q := rfl +theorem comp_eq (x y z : FundamentalGroupoid X) (p : x ⟶ y) (q : y ⟶ z) : p ≫ q = p.trans q := rfl theorem id_eq_path_refl (x : FundamentalGroupoid X) : 𝟙 x = ⟦Path.refl x.as⟧ := rfl /-- The functor on fundamental groupoid induced by a continuous map. -/ @[simps] def map (f : C(X, Y)) : FundamentalGroupoid X ⥤ FundamentalGroupoid Y where obj x := ⟨f x.as⟩ - map p := p.mapFn f + map p := p.map f map_id _ := rfl map_comp := by rintro _ _ _ ⟨p⟩ ⟨q⟩; exact congr_arg Quotient.mk'' (p.map_trans q f.continuous) @@ -286,7 +320,7 @@ scoped notation "πₓ" => FundamentalGroupoid.fundamentalGroupoidFunctor.obj scoped notation "πₘ" => FundamentalGroupoid.fundamentalGroupoidFunctor.map theorem map_eq {X Y : TopCat} {x₀ x₁ : X} (f : C(X, Y)) (p : Path.Homotopic.Quotient x₀ x₁) : - (πₘ (TopCat.ofHom f)).map p = p.mapFn f := rfl + (πₘ (TopCat.ofHom f)).map p = p.map f := rfl /-- Help the typechecker by converting a point in a groupoid back to a point in the underlying topological space. -/ diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/FundamentalGroup.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/FundamentalGroup.lean index 934e75530055d8..75c87da27da42b 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/FundamentalGroup.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/FundamentalGroup.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Mark Lavrentyev. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mark Lavrentyev -/ -import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic -import Mathlib.CategoryTheory.Conj -import Mathlib.CategoryTheory.Groupoid -import Mathlib.Topology.Category.TopCat.Basic -import Mathlib.Topology.Connected.PathConnected -import Mathlib.Topology.Homotopy.Path +module + +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic +public import Mathlib.CategoryTheory.Conj +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.Topology.Category.TopCat.Basic +public import Mathlib.Topology.Connected.PathConnected +public import Mathlib.Topology.Homotopy.Path /-! # Fundamental group of a space @@ -17,6 +19,8 @@ Given a topological space `X` and a basepoint `x`, the fundamental group is the of `x` i.e. the group with elements being loops based at `x` (quotiented by homotopy equivalence). -/ +@[expose] public section + variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] variable {x₀ x₁ : X} diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean index e209dcef26a85e..93fa1fc582b025 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Praneeth Kolichala. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Praneeth Kolichala -/ -import Mathlib.Topology.Homotopy.Equiv -import Mathlib.CategoryTheory.Equivalence -import Mathlib.AlgebraicTopology.FundamentalGroupoid.Product +module + +public import Mathlib.Topology.Homotopy.Equiv +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.Product /-! # Homotopic maps induce naturally isomorphic functors @@ -27,6 +29,8 @@ import Mathlib.AlgebraicTopology.FundamentalGroupoid.Product But `FundamentalGroupoidFunctor.prodToProdTop` requires two spaces in the same universe. -/ +@[expose] public section + noncomputable section @@ -84,8 +88,10 @@ include hfg /-- If `f(p(t) = g(q(t))` for two paths `p` and `q`, then the induced path homotopy classes `f(p)` and `g(p)` are the same as well, despite having a priori different types -/ theorem heq_path_of_eq_image : - (πₘ (TopCat.ofHom f)).map ⟦p⟧ ≍ (πₘ (TopCat.ofHom g)).map ⟦q⟧ := by - simp only [map_eq, ← Path.Homotopic.map_lift]; apply Path.Homotopic.hpath_hext; exact hfg + (πₘ (TopCat.ofHom f)).map ⟦p⟧ ≍ (πₘ (TopCat.ofHom g)).map (Path.Homotopic.Quotient.mk q) := by + simp only [map_eq, ← Path.Homotopic.Quotient.mk_map] + apply Path.Homotopic.hpath_hext + exact hfg private theorem start_path : f x₀ = g x₂ := by convert hfg 0 <;> simp only [Path.source] diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/PUnit.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/PUnit.lean index 354d877aad6f4b..babca34641aae0 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/PUnit.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/PUnit.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Praneeth Kolichala. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Praneeth Kolichala -/ -import Mathlib.CategoryTheory.PUnit -import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic +module + +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic /-! # Fundamental groupoid of punit @@ -12,6 +14,8 @@ import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic The fundamental groupoid of punit is naturally isomorphic to `CategoryTheory.Discrete PUnit` -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/Product.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/Product.lean index a5130d5ff7d81d..6063350bcc84af 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/Product.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/Product.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Praneeth Kolichala. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Praneeth Kolichala -/ -import Mathlib.CategoryTheory.Groupoid -import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic -import Mathlib.Topology.Category.TopCat.Limits.Products -import Mathlib.Topology.Homotopy.Product +module + +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic +public import Mathlib.Topology.Category.TopCat.Limits.Products +public import Mathlib.Topology.Homotopy.Product /-! # Fundamental groupoid preserves products @@ -24,6 +26,8 @@ In this file, we give the following definitions/theorems: preserves all products. -/ +@[expose] public section + noncomputable section @@ -56,7 +60,7 @@ def piToPiTop : (∀ i, πₓ (X i)) ⥤ πₓ (TopCat.of (∀ i, X i)) where obj g := ⟨fun i => (g i).as⟩ map p := Path.Homotopic.pi p map_id x := by - change (Path.Homotopic.pi fun i => ⟦_⟧) = _ + change (Path.Homotopic.pi fun i => Path.Homotopic.Quotient.mk _) = _ simp only [Path.Homotopic.pi_lift] rfl map_comp f g := (Path.Homotopic.comp_pi_eq_pi_comp f g).symm diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/SimplyConnected.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/SimplyConnected.lean index 83b1c2f90bf607..37a7be4d07284b 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/SimplyConnected.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/SimplyConnected.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Praneeth Kolichala. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Praneeth Kolichala -/ -import Mathlib.AlgebraicTopology.FundamentalGroupoid.InducedMaps -import Mathlib.Topology.Homotopy.Contractible -import Mathlib.CategoryTheory.PUnit -import Mathlib.AlgebraicTopology.FundamentalGroupoid.PUnit +module + +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.InducedMaps +public import Mathlib.Topology.Homotopy.Contractible +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.PUnit /-! # Simply connected spaces @@ -20,6 +22,8 @@ A topological space is simply connected if its fundamental groupoid is equivalen - `SimplyConnectedSpace.ofContractible` - A contractible space is simply connected -/ +@[expose] public section + universe u noncomputable section diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean b/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean index 71f31c35c14f4a..8509d812801a49 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.MorphismProperty.Composition -import Mathlib.CategoryTheory.MorphismProperty.Factorization -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty -import Mathlib.CategoryTheory.MorphismProperty.WeakFactorizationSystem -import Mathlib.AlgebraicTopology.ModelCategory.Instances +module + +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.MorphismProperty.Factorization +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +public import Mathlib.CategoryTheory.MorphismProperty.WeakFactorizationSystem +public import Mathlib.AlgebraicTopology.ModelCategory.Instances /-! # Model categories @@ -31,6 +33,8 @@ to define only local instances of `ModelCategory`, or to set these instances on -/ +@[expose] public section + universe w v u namespace HomotopicalAlgebra diff --git a/Mathlib/AlgebraicTopology/ModelCategory/BrownLemma.lean b/Mathlib/AlgebraicTopology/ModelCategory/BrownLemma.lean index 9122410819a3fa..1f9e3ebaf55be8 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/BrownLemma.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/BrownLemma.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.Basic -import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Basic +public import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant /-! # The factorization lemma by K. S. Brown @@ -27,6 +29,8 @@ between fibrant objects.) -/ +@[expose] public section + open CategoryTheory Limits MorphismProperty namespace HomotopicalAlgebra diff --git a/Mathlib/AlgebraicTopology/ModelCategory/CategoryWithCofibrations.lean b/Mathlib/AlgebraicTopology/ModelCategory/CategoryWithCofibrations.lean index 738d727b4af055..9363db09445938 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/CategoryWithCofibrations.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/CategoryWithCofibrations.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Categories with classes of fibrations, cofibrations, weak equivalences @@ -14,6 +16,8 @@ classes of morphisms named "fibrations", "cofibrations" or "weak equivalences". -/ +@[expose] public section + universe v u namespace HomotopicalAlgebra diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean b/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean index bc15aecfdfb621..1c2cd0f220a508 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.Basic -import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Basic +public import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant /-! # Cylinders @@ -33,6 +35,8 @@ in the lemma `Cylinder.exists_very_good`. -/ +@[expose] public section + universe v u open CategoryTheory Category Limits diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Homotopy.lean b/Mathlib/AlgebraicTopology/ModelCategory/Homotopy.lean index 3510c2bf8696cf..829ede7b4606bf 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Homotopy.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Homotopy.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.BrownLemma -import Mathlib.AlgebraicTopology.ModelCategory.LeftHomotopy -import Mathlib.AlgebraicTopology.ModelCategory.RightHomotopy +module + +public import Mathlib.AlgebraicTopology.ModelCategory.BrownLemma +public import Mathlib.AlgebraicTopology.ModelCategory.LeftHomotopy +public import Mathlib.AlgebraicTopology.ModelCategory.RightHomotopy /-! # Homotopies in model categories @@ -25,6 +27,8 @@ then any weak equivalence `X ⟶ Y` is a homotopy equivalence. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Instances.lean b/Mathlib/AlgebraicTopology/ModelCategory/Instances.lean index c4a6e337269d27..c3db11e567d597 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Instances.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Instances.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.WeakFactorizationSystem -import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations +module + +public import Mathlib.CategoryTheory.MorphismProperty.WeakFactorizationSystem +public import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations /-! # Consequences of model category axioms @@ -14,6 +16,8 @@ and weak equivalences from the axioms of model categories. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/AlgebraicTopology/ModelCategory/IsCofibrant.lean b/Mathlib/AlgebraicTopology/ModelCategory/IsCofibrant.lean index 1254cc84847912..e61167069e3c7f 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/IsCofibrant.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/IsCofibrant.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.Instances -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Instances +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Fibrant and cofibrant objects in a model category @@ -16,6 +18,8 @@ any `X : C` as an abbreviation for `Cofibration (initial.to X : ⊥_ C ⟶ X)`. -/ +@[expose] public section + open CategoryTheory Limits namespace HomotopicalAlgebra diff --git a/Mathlib/AlgebraicTopology/ModelCategory/JoyalTrick.lean b/Mathlib/AlgebraicTopology/ModelCategory/JoyalTrick.lean index c98c5ae0212d95..0f11d5443a81cc 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/JoyalTrick.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/JoyalTrick.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # A trick by Joyal @@ -21,6 +23,8 @@ namely that cofibrations are stable under composition and cobase change. -/ +@[expose] public section + open CategoryTheory Category Limits MorphismProperty namespace HomotopicalAlgebra diff --git a/Mathlib/AlgebraicTopology/ModelCategory/LeftHomotopy.lean b/Mathlib/AlgebraicTopology/ModelCategory/LeftHomotopy.lean index b9626a37715fcf..4cc7836cb11efb 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/LeftHomotopy.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/LeftHomotopy.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.Cylinder -import Mathlib.CategoryTheory.Localization.Quotient +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Cylinder +public import Mathlib.CategoryTheory.Localization.Quotient /-! # Left homotopies in model categories @@ -23,6 +25,8 @@ relation on `X ⟶ Y`. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Opposite.lean b/Mathlib/AlgebraicTopology/ModelCategory/Opposite.lean index ee3766c108f1e4..f0912d668cdb21 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Opposite.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Opposite.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.Basic +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Basic /-! # The opposite of a model category structure -/ +@[expose] public section + universe v u open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Over.lean b/Mathlib/AlgebraicTopology/ModelCategory/Over.lean new file mode 100644 index 00000000000000..102a0b7733729b --- /dev/null +++ b/Mathlib/AlgebraicTopology/ModelCategory/Over.lean @@ -0,0 +1,150 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.CategoryTheory.LiftingProperties.Over +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic + +/-! +# The model category structure on Over categories + +Let `C` be a model category. For any `S : C`, we define +a model category structure on the category `Over S`: +a morphism `X ⟶ Y` in `Over S` is a cofibration +(resp. a fibration, a weak equivalence) if the +underlying morphism `f.left : X.left ⟶ Y.left` is. +(Apart from the existence of (finite) limits +from `Limits.Constructions.Over.Basic`, the verification +of the axioms is straightforward.) + +## TODO +* Proceed to the dual construction for `Under S`. + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory + +variable {C : Type u} [Category.{v} C] (S : C) + +namespace HomotopicalAlgebra + +section + +variable [CategoryWithCofibrations C] + +instance : CategoryWithCofibrations (Over S) where + cofibrations := (cofibrations C).over + +lemma cofibrations_over_def : + cofibrations (Over S) = (cofibrations C).over := rfl + +lemma cofibrations_over_iff {X Y : Over S} (f : X ⟶ Y) : + Cofibration f ↔ Cofibration f.left := by + simp only [cofibration_iff] + rfl + +instance {X Y : Over S} (f : X ⟶ Y) [Cofibration f] : Cofibration f.left := by + rwa [← cofibrations_over_iff] + +instance [(cofibrations C).IsStableUnderRetracts] : + (cofibrations (Over S)).IsStableUnderRetracts := by + rw [cofibrations_over_def, MorphismProperty.over_eq_inverseImage] + infer_instance + +end + +section + +variable [CategoryWithFibrations C] + +instance : CategoryWithFibrations (Over S) where + fibrations := (fibrations C).over + +lemma fibrations_over_def : + fibrations (Over S) = (fibrations C).over := rfl + +lemma fibrations_over_iff {X Y : Over S} (f : X ⟶ Y) : + Fibration f ↔ Fibration f.left := by + simp only [fibration_iff] + rfl + +instance {X Y : Over S} (f : X ⟶ Y) [Fibration f] : Fibration f.left := by + rwa [← fibrations_over_iff] + +instance [(fibrations C).IsStableUnderRetracts] : + (fibrations (Over S)).IsStableUnderRetracts := by + rw [fibrations_over_def, MorphismProperty.over_eq_inverseImage] + infer_instance + +end + +section + +variable [CategoryWithWeakEquivalences C] + +instance : CategoryWithWeakEquivalences (Over S) where + weakEquivalences := (weakEquivalences C).over + +lemma weakEquivalences_over_def : + weakEquivalences (Over S) = (weakEquivalences C).over := rfl + +lemma weakEquivalences_over_iff {X Y : Over S} (f : X ⟶ Y) : + WeakEquivalence f ↔ WeakEquivalence f.left := by + simp only [weakEquivalence_iff] + rfl + +instance {X Y : Over S} (f : X ⟶ Y) [WeakEquivalence f] : WeakEquivalence f.left := by + rwa [← weakEquivalences_over_iff] + +instance [(weakEquivalences C).IsStableUnderRetracts] : + (weakEquivalences (Over S)).IsStableUnderRetracts := by + rw [weakEquivalences_over_def, MorphismProperty.over_eq_inverseImage] + infer_instance + +end + +lemma trivialCofibrations_over_eq + [CategoryWithWeakEquivalences C] [CategoryWithCofibrations C] : + trivialCofibrations (Over S) = (trivialCofibrations C).over := rfl + +lemma trivialFibrations_over_eq + [CategoryWithWeakEquivalences C] [CategoryWithFibrations C] : + trivialFibrations (Over S) = (trivialFibrations C).over := rfl + +instance [CategoryWithWeakEquivalences C] + [(weakEquivalences C).HasTwoOutOfThreeProperty] : + (weakEquivalences (Over S)).HasTwoOutOfThreeProperty := by + rw [weakEquivalences_over_def, MorphismProperty.over_eq_inverseImage] + infer_instance + +section + +variable [CategoryWithWeakEquivalences C] [CategoryWithCofibrations C] + [CategoryWithFibrations C] + +instance [(trivialCofibrations C).HasFactorization (fibrations C)] : + (trivialCofibrations (Over S)).HasFactorization (fibrations (Over S)) := by + rw [fibrations_over_def, trivialCofibrations_over_eq] + infer_instance + +instance [(cofibrations C).HasFactorization (trivialFibrations C)] : + (cofibrations (Over S)).HasFactorization (trivialFibrations (Over S)) := by + rw [cofibrations_over_def, trivialFibrations_over_eq] + infer_instance + +end + +instance ModelCategory.over [ModelCategory C] : ModelCategory (Over S) where + cm4a _ _ _ _ _ := .over _ _ + cm4b _ _ _ _ _ := .over _ _ + +end HomotopicalAlgebra diff --git a/Mathlib/AlgebraicTopology/ModelCategory/PathObject.lean b/Mathlib/AlgebraicTopology/ModelCategory/PathObject.lean index 0ab86beb60c1e1..c0918f0d338cf4 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/PathObject.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/PathObject.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.Basic -import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant +module + +public import Mathlib.AlgebraicTopology.ModelCategory.Basic +public import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant /-! # Path objects @@ -36,6 +38,8 @@ in the lemma `PathObject.exists_very_good`. -/ +@[expose] public section + universe v u open CategoryTheory Category Limits diff --git a/Mathlib/AlgebraicTopology/ModelCategory/RightHomotopy.lean b/Mathlib/AlgebraicTopology/ModelCategory/RightHomotopy.lean index b79d081c53f10c..344ed177d2b1b4 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/RightHomotopy.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/RightHomotopy.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.PathObject -import Mathlib.CategoryTheory.Localization.Quotient +module + +public import Mathlib.AlgebraicTopology.ModelCategory.PathObject +public import Mathlib.CategoryTheory.Localization.Quotient /-! # Right homotopies in model categories @@ -25,6 +27,8 @@ relation on `X ⟶ Y`. -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicTopology/MooreComplex.lean b/Mathlib/AlgebraicTopology/MooreComplex.lean index b2e097b7613976..2624554bb347c0 100644 --- a/Mathlib/AlgebraicTopology/MooreComplex.lean +++ b/Mathlib/AlgebraicTopology/MooreComplex.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Homology.HomologicalComplex -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.CategoryTheory.Abelian.Basic +module + +public import Mathlib.Algebra.Homology.HomologicalComplex +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.CategoryTheory.Abelian.Basic /-! ## Moore complex @@ -28,6 +30,8 @@ This functor is one direction of the Dold-Kan equivalence, which we're still wor * https://ncatlab.org/nlab/show/Moore+complex -/ +@[expose] public section + universe v u diff --git a/Mathlib/AlgebraicTopology/Quasicategory/Basic.lean b/Mathlib/AlgebraicTopology/Quasicategory/Basic.lean index ccfef652e05964..587764ecb11661 100644 --- a/Mathlib/AlgebraicTopology/Quasicategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/Quasicategory/Basic.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ +module -import Mathlib.AlgebraicTopology.SimplicialSet.KanComplex +public import Mathlib.AlgebraicTopology.SimplicialSet.KanComplex /-! # Quasicategories @@ -24,6 +25,8 @@ we show that the nerve of a category is a quasicategory. -/ +@[expose] public section + namespace SSet open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/Quasicategory/Nerve.lean b/Mathlib/AlgebraicTopology/Quasicategory/Nerve.lean index 432af27d7a69a3..718349346da387 100644 --- a/Mathlib/AlgebraicTopology/Quasicategory/Nerve.lean +++ b/Mathlib/AlgebraicTopology/Quasicategory/Nerve.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Nick Ward. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Emily Riehl, Nick Ward -/ -import Mathlib.AlgebraicTopology.Quasicategory.StrictSegal +module + +public import Mathlib.AlgebraicTopology.Quasicategory.StrictSegal /-! # The nerve of a category is a quasicategory @@ -17,6 +19,8 @@ In this file, we prove as a direct consequence that the nerve of a category is a quasicategory. -/ +@[expose] public section + universe v u open SSet diff --git a/Mathlib/AlgebraicTopology/Quasicategory/StrictSegal.lean b/Mathlib/AlgebraicTopology/Quasicategory/StrictSegal.lean index 02e487b44b85a1..92240542db2bb2 100644 --- a/Mathlib/AlgebraicTopology/Quasicategory/StrictSegal.lean +++ b/Mathlib/AlgebraicTopology/Quasicategory/StrictSegal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Nick Ward. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Emily Riehl, Nick Ward -/ -import Mathlib.AlgebraicTopology.Quasicategory.Basic -import Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal +module + +public import Mathlib.AlgebraicTopology.Quasicategory.Basic +public import Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal /-! # Strict Segal simplicial sets are quasicategories @@ -17,6 +19,8 @@ In this file, we prove that any simplicial set satisfying the strict Segal condition is a quasicategory. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/Quasicategory/TwoTruncated.lean b/Mathlib/AlgebraicTopology/Quasicategory/TwoTruncated.lean index 7cc25b4c1406c9..1764141b7ed33e 100644 --- a/Mathlib/AlgebraicTopology/Quasicategory/TwoTruncated.lean +++ b/Mathlib/AlgebraicTopology/Quasicategory/TwoTruncated.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Julian Komaromy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Komaromy -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Basic -import Mathlib.AlgebraicTopology.SimplicialSet.CompStructTruncated +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Basic +public import Mathlib.AlgebraicTopology.SimplicialSet.CompStructTruncated /-! # 2-truncated quasicategories and homotopy relations @@ -22,6 +24,8 @@ Throughout this file, we make use of `Edge` and `CompStruct` to conveniently dea edges and triangles in a 2-truncated simplicial set. -/ +@[expose] public section + open CategoryTheory SimplicialObject.Truncated namespace SSet.Truncated diff --git a/Mathlib/AlgebraicTopology/RelativeCellComplex/AttachCells.lean b/Mathlib/AlgebraicTopology/RelativeCellComplex/AttachCells.lean index 25b17c5dd71cde..8c3f3404b1661b 100644 --- a/Mathlib/AlgebraicTopology/RelativeCellComplex/AttachCells.lean +++ b/Mathlib/AlgebraicTopology/RelativeCellComplex/AttachCells.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Attaching cells @@ -26,6 +28,8 @@ of morphisms `f` with `AttachCells g f` structures. -/ +@[expose] public section + universe w' w t t' v u open CategoryTheory Limits diff --git a/Mathlib/AlgebraicTopology/RelativeCellComplex/Basic.lean b/Mathlib/AlgebraicTopology/RelativeCellComplex/Basic.lean index 7e1e9497e99352..46e13c5e0e6a48 100644 --- a/Mathlib/AlgebraicTopology/RelativeCellComplex/Basic.lean +++ b/Mathlib/AlgebraicTopology/RelativeCellComplex/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.RelativeCellComplex.AttachCells -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +module + +public import Mathlib.AlgebraicTopology.RelativeCellComplex.AttachCells +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition /-! # Relative cell complexes @@ -26,6 +28,8 @@ see the file `Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgumen -/ +@[expose] public section + universe w w' t v u open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented.lean index c3732e26ef2639..150ab49f5b06f9 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented.lean @@ -3,6 +3,8 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Basic +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Basic deprecated_module (since := "2025-07-05") diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Basic.lean index f6e2cf1a759a25..431f41a6318ff1 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.WithTerminal.Basic -import Mathlib.AlgebraicTopology.SimplexCategory.Basic -import Mathlib.AlgebraicTopology.SimplicialObject.Basic +module + +public import Mathlib.CategoryTheory.WithTerminal.Basic +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic /-! # The Augmented simplex category @@ -23,6 +25,8 @@ objects, and we provide a translation of the main constrcutions on augmented (co -/ +@[expose] public section + open CategoryTheory /-- The `AugmentedSimplexCategory` is the category obtained from `SimplexCategory` by adjoining an diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean index 390b2bd3d6b16c..6bcaa5abfe94b1 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Basic -import Mathlib.CategoryTheory.Monoidal.Category +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Augmented.Basic +public import Mathlib.CategoryTheory.Monoidal.Category /-! # Monoidal structure on the augmented simplex category @@ -25,6 +27,8 @@ of the associator isomorphism with respect to these maps. -/ +@[expose] public section + namespace AugmentedSimplexCategory attribute [local aesop safe cases (rule_sets := [CategoryTheory])] CategoryTheory.WithInitial diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean index 292d33b96fcfc6..0018026e83e50b 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Defs -import Mathlib.Data.Fintype.Sort -import Mathlib.Order.Category.NonemptyFinLinOrd -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.Linarith +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Defs +public import Mathlib.Data.Fintype.Sort +public import Mathlib.Order.Category.NonemptyFinLinOrd +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.Linarith /-! # Basic properties of the simplex category @@ -20,6 +22,8 @@ this category is equivalent to `NonemptyFinLinOrd`, and establish basic properties of its epimorphisms and monomorphisms. -/ +@[expose] public section + universe v open Simplicial CategoryTheory Limits diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Defs.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Defs.lean index 891fe170e69ad0..45aaac465a45d6 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Defs.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Opposites -import Mathlib.Order.Fin.Basic -import Mathlib.Util.Superscript +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.Order.Fin.Basic +public import Mathlib.Util.Superscript /-! # The simplex category @@ -37,6 +39,8 @@ We provide the following functions to work with these objects: This notation is available with `open SimplexCategory.Truncated`. -/ +@[expose] public section + universe v open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/Basic.lean index eb241d81302cfe..d6dea4c36710ad 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Basic -import Mathlib.CategoryTheory.PathCategory.Basic +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic +public import Mathlib.CategoryTheory.PathCategory.Basic /-! # Presentation of the simplex category by generators and relations. We introduce `SimplexCategoryGenRel` as the category presented by generating @@ -15,6 +17,8 @@ objects and morphisms in this category. This category admits a canonical functor `toSimplexCategory` to the usual simplex category. The fact that this functor is an equivalence will be recorded in a separate file. -/ + +@[expose] public section open CategoryTheory /-- The objects of the free simplex quiver are the natural numbers. -/ diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/EpiMono.lean b/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/EpiMono.lean index 4fc0c7e287c896..46a62bea82870e 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/EpiMono.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/EpiMono.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.Basic +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.Basic /-! # Epi-mono factorization in the simplex category presented by generators and relations This file aims to establish that there is a nice epi-mono factorization in `SimplexCategoryGenRel`. @@ -15,6 +17,8 @@ moprhism as a decomposition of a `P_σ` followed by a `P_δ`. -/ +@[expose] public section + namespace SimplexCategoryGenRel open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/NormalForms.lean b/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/NormalForms.lean index 6e6f1a28dce154..c66b4576088ce0 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/NormalForms.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/GeneratorsRelations/NormalForms.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.EpiMono +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.EpiMono /-! # Normal forms for morphisms in `SimplexCategoryGenRel`. In this file, we establish that `P_δ` and `P_σ` morphisms in `SimplexCategoryGenRel` @@ -32,6 +34,8 @@ stones towards proving that the canonical functor - Show that every `P_δ` admits a unique normal form. -/ +@[expose] public section + namespace SimplexCategoryGenRel open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/MorphismProperty.lean b/Mathlib/AlgebraicTopology/SimplexCategory/MorphismProperty.lean index 587fe8b2e10eac..a3aa5af51c2b54 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/MorphismProperty.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/MorphismProperty.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Basic -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Properties of morphisms in the simplex category @@ -18,6 +20,8 @@ the category `SimplexCategory.Truncated d`. -/ +@[expose] public section + open CategoryTheory namespace SimplexCategory diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean index 997683616bdb03..2c02222e407d1d 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Basic +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic /-! # The covariant involution of the simplex category @@ -15,6 +17,8 @@ the *covariant* functor which sends a type `α` to `αᵒᵈ`. -/ +@[expose] public section + open CategoryTheory namespace SimplexCategory diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Truncated.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Truncated.lean index cc546fbf7d3574..c241c71c7bc025 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Truncated.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Truncated.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Basic -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic +public import Mathlib.CategoryTheory.Limits.Final /-! # Properties of the truncated simplex category @@ -13,6 +15,8 @@ untruncated simplex category, and the inclusion functor from the `n`-truncated t simplex category, for `n ≤ m` are initial. -/ +@[expose] public section + open Simplicial CategoryTheory namespace SimplexCategory.Truncated diff --git a/Mathlib/AlgebraicTopology/SimplicialCategory/Basic.lean b/Mathlib/AlgebraicTopology/SimplicialCategory/Basic.lean index 863a5836dfd6a1..b138ed24350525 100644 --- a/Mathlib/AlgebraicTopology/SimplicialCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplicialCategory/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Monoidal -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Monoidal +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic /-! # Simplicial categories @@ -31,6 +33,8 @@ category of simplicial sets in such a way that morphisms in -/ +@[expose] public section + universe v u open CategoryTheory Category Simplicial MonoidalCategory diff --git a/Mathlib/AlgebraicTopology/SimplicialCategory/SimplicialObject.lean b/Mathlib/AlgebraicTopology/SimplicialCategory/SimplicialObject.lean index 2dde40d7ea1e5e..995a7945cf8a02 100644 --- a/Mathlib/AlgebraicTopology/SimplicialCategory/SimplicialObject.lean +++ b/Mathlib/AlgebraicTopology/SimplicialCategory/SimplicialObject.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialCategory.Basic -import Mathlib.CategoryTheory.Functor.FunctorHom +module + +public import Mathlib.AlgebraicTopology.SimplicialCategory.Basic +public import Mathlib.CategoryTheory.Functor.FunctorHom /-! # The category of simplicial objects is simplicial @@ -19,6 +21,8 @@ sets is a simplicial category. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplicialNerve.lean b/Mathlib/AlgebraicTopology/SimplicialNerve.lean index c299b3fbbcfe45..5b25ff2655ed80 100644 --- a/Mathlib/AlgebraicTopology/SimplicialNerve.lean +++ b/Mathlib/AlgebraicTopology/SimplicialNerve.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.AlgebraicTopology.SimplicialCategory.Basic -import Mathlib.AlgebraicTopology.SimplicialSet.Nerve +module + +public import Mathlib.AlgebraicTopology.SimplicialCategory.Basic +public import Mathlib.AlgebraicTopology.SimplicialSet.Nerve /-! # The simplicial nerve of a simplicial category @@ -35,6 +37,8 @@ the linear order `Fin (n + 1)` to `C`, in other words * [Jacob Lurie, *Higher Topos Theory*, Section 1.1.5][LurieHTT] -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean index 2076275562cffd..23a5e422ca5213 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Basic -import Mathlib.CategoryTheory.Adjunction.Reflective -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Opposites -import Mathlib.Util.Superscript +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Basic +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.Util.Superscript /-! # Simplicial objects in a category. @@ -31,6 +33,8 @@ The following notations can be enabled via - `X ^⦋m⦌ₙ` denotes the `m`-th term of an `n`-truncated cosimplicial object `X`. -/ +@[expose] public section + open Opposite open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Coskeletal.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Coskeletal.lean index f650da6cb53ed8..8d1b785fcd2c07 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Coskeletal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Coskeletal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Functor.KanExtension.Basic +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Functor.KanExtension.Basic /-! # Coskeletal simplicial objects @@ -23,6 +25,8 @@ then when `X` is `n`-coskeletal, the unit of `coskAdj n` defines an isomorphism: TODO: Prove that `X` is `n`-coskeletal whenever a certain canonical cone is a limit cone. -/ +@[expose] public section + open Opposite open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/II.lean b/Mathlib/AlgebraicTopology/SimplicialObject/II.lean index a666e203d4b43c..fbcd1563110394 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/II.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/II.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic /-! # A construction by Gabriel and Zisman @@ -27,6 +29,8 @@ by Gabriel and Zisman. -/ +@[expose] public section + open CategoryTheory Simplicial Opposite namespace SimplexCategory diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean index f0fd098c35f972..a6160f5af96594 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplexCategory.Rev -import Mathlib.AlgebraicTopology.SimplicialObject.Basic +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.Rev +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic /-! # The covariant involution of the category of simplicial objects @@ -15,6 +17,8 @@ covariant involution `SimplexCategory.rev : SimplexCategory ⥤ SimplexCategory` -/ +@[expose] public section + universe v open CategoryTheory diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean index 7356498118f385..962d84524251c3 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.Data.Fintype.Sigma +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.Data.Fintype.Sigma /-! @@ -32,6 +34,8 @@ Simplicial objects equipped with a splitting form a category -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean index 36928433769897..cf1ac27c488739 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Simplices +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Simplices /-! # Simplices that are uniquely codimensional one faces @@ -21,6 +23,8 @@ study of strong (inner) anodyne extensions. -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean index 3758420b5d13d7..0d1bf4fda73471 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplicesSubcomplex -import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.IsUniquelyCodimOneFace +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplicesSubcomplex +public import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.IsUniquelyCodimOneFace /-! # Pairings @@ -38,6 +40,8 @@ a strong anodyne extension (TODO @joelriou), and the converse is also true -/ +@[expose] public section + universe u namespace SSet.Subcomplex diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean index eae802c233c61d..6e5228e41e1f27 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.Pairing +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.AnodyneExtensions.Pairing /-! # Helper structure in order to construct pairings @@ -17,6 +19,8 @@ their dimensions are respectively `dim s` or `dim s + 1` for `s : ι`. -/ +@[expose] public section + universe v u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Basic.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Basic.lean index f4040c01af24f2..49092bdf71b7cd 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Yoneda -import Mathlib.Tactic.FinCases +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Yoneda +public import Mathlib.Tactic.FinCases /-! # Simplicial sets @@ -20,6 +22,8 @@ homotopy type theory.) -/ +@[expose] public section + universe v u open CategoryTheory CategoryTheory.Limits CategoryTheory.Functor diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Boundary.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Boundary.lean index 076839f6ea7c37..f4b6aa0f6b4642 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Boundary.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Boundary.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz -/ -import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex /-! # The boundary of the standard simplex @@ -21,6 +23,8 @@ a morphism `Δ[n] ⟶ ∂Δ[n]`. -/ +@[expose] public section + universe u open Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/CategoryWithFibrations.lean b/Mathlib/AlgebraicTopology/SimplicialSet/CategoryWithFibrations.lean index dd31a8dfee7830..873b6cfa3be7d8 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/CategoryWithFibrations.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/CategoryWithFibrations.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations -import Mathlib.AlgebraicTopology.SimplicialSet.Boundary -import Mathlib.AlgebraicTopology.SimplicialSet.Horn -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +module + +public import Mathlib.AlgebraicTopology.ModelCategory.CategoryWithCofibrations +public import Mathlib.AlgebraicTopology.SimplicialSet.Boundary +public import Mathlib.AlgebraicTopology.SimplicialSet.Horn +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty /-! # Cofibrations and fibrations in the category of simplicial sets @@ -21,6 +23,8 @@ to use the assumption `[Mono f]` instead of `[Cofibration f]`. -/ +@[expose] public section + open CategoryTheory HomotopicalAlgebra MorphismProperty Simplicial universe u diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/CompStruct.lean b/Mathlib/AlgebraicTopology/SimplicialSet/CompStruct.lean new file mode 100644 index 00000000000000..4bfa1a48bd259d --- /dev/null +++ b/Mathlib/AlgebraicTopology/SimplicialSet/CompStruct.lean @@ -0,0 +1,188 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.CompStructTruncated + +/-! +# Edges and "triangles" in simplicial sets + +Given a simplicial set `X`, we introduce two types: +* Given `0`-simplices `x₀` and `x₁`, we define `Edge x₀ x₁` +which is the type of `1`-simplices with faces `x₁` and `x₀` respectively; +* Given `0`-simplices `x₀`, `x₁`, `x₂`, edges `e₀₁ : Edge x₀ x₁`, `e₁₂ : Edge x₁ x₂`, +`e₀₂ : Edge x₀ x₂`, a structure `CompStruct e₀₁ e₁₂ e₀₂` which records the +data of a `2`-simplex with faces `e₁₂`, `e₀₂` and `e₀₁` respectively. This data +will allow to obtain relations in the homotopy category of `X`. +(This API parallels similar definitions for `2`-truncated simplicial sets. +The definitions in this file are definitionally equal to their `2`-truncated +counterparts.) + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory Simplicial + +namespace SSet + +variable {X Y : SSet.{u}} {x₀ x₁ x₂ : X _⦋0⦌} + +variable (x₀ x₁) in +/-- In a simplicial set, an edge from a vertex `x₀` to `x₁` is +a `1`-simplex with prescribed `0`-dimensional faces. -/ +def Edge := ((truncation 2).obj X).Edge x₀ x₁ + +namespace Edge + +/-- Constructor for `SSet.Edge` which takes as an input a term in the definitionally +equal type `SSet.Truncated.Edge` for the `2`-truncation of the simplicial set. +(This definition is made to contain abuse of defeq in other definitions.) -/ +def ofTruncated (e : ((truncation 2).obj X).Edge x₀ x₁) : + Edge x₀ x₁ := e + +/-- The edge of the `2`-truncation of a simplicial set `X` that is induced +by an edge of `X`. -/ +def toTruncated (e : Edge x₀ x₁) : + ((truncation 2).obj X).Edge x₀ x₁ := + e + +/-- In a simplicial set, an edge from a vertex `x₀` to `x₁` is +a `1`-simplex with prescribed `0`-dimensional faces. -/ +def edge (e : Edge x₀ x₁) : X _⦋1⦌ := e.toTruncated.edge + +@[simp] +lemma ofTruncated_edge (e : ((truncation 2).obj X).Edge x₀ x₁) : + (ofTruncated e).edge = e.edge := rfl + +@[simp] +lemma toTruncated_edge (e : Edge x₀ x₁) : + (toTruncated e).edge = e.edge := rfl + +@[simp] +lemma src_eq (e : Edge x₀ x₁) : X.δ 1 e.edge = x₀ := Truncated.Edge.src_eq e + +@[simp] +lemma tgt_eq (e : Edge x₀ x₁) : X.δ 0 e.edge = x₁ := Truncated.Edge.tgt_eq e + +@[ext] +lemma ext {e e' : Edge x₀ x₁} (h : e.edge = e'.edge) : + e = e' := Truncated.Edge.ext h + +variable (x₀) in +/-- The constant edge on a `0`-simplex. -/ +def id : Edge x₀ x₀ := ofTruncated (.id _) + +variable (x₀) in +@[simp] +lemma id_edge : (id x₀).edge = X.σ 0 x₀ := rfl + +/-- The image of an edge by a morphism of simplicial sets. -/ +def map (e : Edge x₀ x₁) (f : X ⟶ Y) : Edge (f.app _ x₀) (f.app _ x₁) := + ofTruncated (e.toTruncated.map ((truncation 2).map f)) + +variable (x₀) in +@[simp] +lemma map_id (f : X ⟶ Y) : + (Edge.id x₀).map f = Edge.id (f.app _ x₀) := + Truncated.Edge.map_id _ _ + +/-- The edge given by a `1`-simplex. -/ +def mk' (s : X _⦋1⦌) : Edge (X.δ 1 s) (X.δ 0 s) := + .ofTruncated (Truncated.Edge.mk' (X := (truncation 2).obj X) s) + +@[simp] +lemma mk'_edge (s : X _⦋1⦌) : (mk' s).edge = s := rfl + +lemma exists_of_simplex (s : X _⦋1⦌) : + ∃ (x₀ x₁ : X _⦋0⦌) (e : Edge x₀ x₁), e.edge = s := + ⟨_, _, mk' s, rfl⟩ + +/-- Let `x₀`, `x₁`, `x₂` be `0`-simplices of a simplicial set `X`, +`e₀₁` an edge from `x₀` to `x₁`, `e₁₂` an edge from `x₁` to `x₂`, +`e₀₂` an edge from `x₀` to `x₂`. This is the data of a `2`-simplex whose +faces are respectively `e₀₂`, `e₁₂` and `e₀₁`. Such structures shall provide +relations in the homotopy category of arbitrary simplicial sets +(and specialized constructions for quasicategories and Kan complexes.). -/ +def CompStruct (e₀₁ : Edge x₀ x₁) (e₁₂ : Edge x₁ x₂) (e₀₂ : Edge x₀ x₂) := + Truncated.Edge.CompStruct e₀₁.toTruncated e₁₂.toTruncated e₀₂.toTruncated + +namespace CompStruct + +variable {e₀₁ : Edge x₀ x₁} {e₁₂ : Edge x₁ x₂} {e₀₂ : Edge x₀ x₂} + +/-- Constructor for `SSet.Edge.CompStruct` which takes as an input a term in the +definitionally equal type `SSet.Truncated.Edge.CompStruct` for the `2`-truncation of +the simplicial set. (This definition is made to contain abuse of defeq in +other definitions.) -/ +def ofTruncated (h : Truncated.Edge.CompStruct e₀₁.toTruncated e₁₂.toTruncated e₀₂.toTruncated) : + CompStruct e₀₁ e₁₂ e₀₂ := h + +/-- Conversion from `SSet.Edge.CompStruct` to `SSet.Truncated.Edge.CompStruct`. -/ +def toTruncated (h : CompStruct e₀₁ e₁₂ e₀₂) : + Truncated.Edge.CompStruct e₀₁.toTruncated e₁₂.toTruncated e₀₂.toTruncated := + h + +/-- The underlying `2`-simplex in a structure `SSet.Edge.CompStruct`. -/ +def simplex (h : CompStruct e₀₁ e₁₂ e₀₂) : X _⦋2⦌ := + h.toTruncated.simplex + +section + +variable (simplex : X _⦋2⦌) + (d₂ : X.δ 2 simplex = e₀₁.edge := by cat_disch) + (d₀ : X.δ 0 simplex = e₁₂.edge := by cat_disch) + (d₁ : X.δ 1 simplex = e₀₂.edge := by cat_disch) + +/-- Constructor for `SSet.Edge.CompStruct`. -/ +def mk : CompStruct e₀₁ e₁₂ e₀₂ where + simplex := simplex + +@[simp] +lemma mk_simplex : (mk simplex).simplex = simplex := rfl + +end + +@[ext] +lemma ext {h h' : CompStruct e₀₁ e₁₂ e₀₂} (eq : h.simplex = h'.simplex) : + h = h' := + Truncated.Edge.CompStruct.ext eq + +lemma exists_of_simplex (s : X _⦋2⦌) : + ∃ (x₀ x₁ x₂ : X _⦋0⦌) (e₀₁ : Edge x₀ x₁) (e₁₂ : Edge x₁ x₂) + (e₀₂ : Edge x₀ x₂) (h : CompStruct e₀₁ e₁₂ e₀₂), h.simplex = s := + Truncated.Edge.CompStruct.exists_of_simplex (X := (truncation 2).obj X) s + +/-- `e : Edge x₀ x₁` is a composition of `Edge.id x₀` with `e`. -/ +def idComp (e : Edge x₀ x₁) : CompStruct (.id x₀) e e := + ofTruncated (.idComp _) + +@[simp] +lemma idComp_simplex (e : Edge x₀ x₁) : (idComp e).simplex = X.σ 0 e.edge := rfl + +/-- `e : Edge x₀ x₁` is a composition of `e` with `Edge.id x₁` -/ +def compId (e : Edge x₀ x₁) : CompStruct e (.id x₁) e := + ofTruncated (.compId _) + +@[simp] +lemma compId_simplex (e : Edge x₀ x₁) : (compId e).simplex = X.σ 1 e.edge := rfl + +/-- The image of a `Edge.CompStruct` by a morphism of simplicial sets. -/ +def map (h : CompStruct e₀₁ e₁₂ e₀₂) (f : X ⟶ Y) : + CompStruct (e₀₁.map f) (e₁₂.map f) (e₀₂.map f) := + .ofTruncated (h.toTruncated.map ((truncation 2).map f)) + +@[simp] +lemma map_simplex (h : CompStruct e₀₁ e₁₂ e₀₂) (f : X ⟶ Y) : + (h.map f).simplex = f.app _ h.simplex := rfl + +end CompStruct + +end Edge + +end SSet diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/CompStructTruncated.lean b/Mathlib/AlgebraicTopology/SimplicialSet/CompStructTruncated.lean index f5e4fa35cb67a3..f787680ae23856 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/CompStructTruncated.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/CompStructTruncated.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Basic -import Mathlib.AlgebraicTopology.SimplexCategory.Truncated +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Basic +public import Mathlib.AlgebraicTopology.SimplexCategory.Truncated /-! # Edges and "triangles" in truncated simplicial sets @@ -19,6 +21,8 @@ will allow to obtain relations in the homotopy category of `X`. -/ +@[expose] public section + universe v u open CategoryTheory Simplicial SimplicialObject.Truncated @@ -79,6 +83,7 @@ lemma map_id (x : X _⦋0⦌₂) (f : X ⟶ Y) : faces are respectively `e₀₂`, `e₁₂` and `e₀₁`. Such structures shall provide relations in the homotopy category of arbitrary (truncated) simplicial sets (and specialized constructions for quasicategories and Kan complexes.). -/ +@[ext] structure CompStruct {x₀ x₁ x₂ : X _⦋0⦌₂} (e₀₁ : Edge x₀ x₁) (e₁₂ : Edge x₁ x₂) (e₀₂ : Edge x₀ x₂) where /-- A `2`-simplex with prescribed `1`-dimensional faces -/ @@ -117,7 +122,7 @@ def idComp {x y : X _⦋0⦌₂} (e : Edge x y) : rw [← FunctorToTypes.map_comp_apply, ← op_comp, δ₂_one_comp_σ₂_zero] simp -/-- `e : Edge x y` is a composition of `Edge.id y` with `e`. -/ +/-- `e : Edge x y` is a composition of `e` with `Edge.id y`. -/ def compId {x y : X _⦋0⦌₂} (e : Edge x y) : CompStruct e (.id y) e where simplex := X.map (σ₂ 1).op e.edge diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean index 5119ffafd07784..33390b8859ac03 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Coskeletal -import Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Functor.KanExtension.Basic +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Coskeletal +public import Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Functor.KanExtension.Basic /-! # Coskeletal simplicial sets @@ -22,6 +24,8 @@ As an example, `SimplicialObject.IsCoskeletal (nerve C) 2` shows that nerves of 2-coskeletal. -/ +@[expose] public section + universe v u @@ -243,6 +247,10 @@ instance (C : Type u) [Category.{v} C] : recorded by the composite functor `nerveFunctor₂`. -/ def nerveFunctor₂ : Cat.{v, u} ⥤ SSet.Truncated 2 := nerveFunctor ⋙ truncation 2 +instance (X : Cat.{v, u}) : (nerveFunctor₂.obj X).IsStrictSegal := by + dsimp [nerveFunctor₂] + infer_instance + /-- The natural isomorphism between `nerveFunctor` and `nerveFunctor₂ ⋙ Truncated.cosk 2` whose components `nerve C ≅ (Truncated.cosk 2).obj (nerveFunctor₂.obj C)` shows that nerves of categories are 2-coskeletal. -/ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean index 6a2fdf7c4a8c75..31831f6baecb56 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex /-! # Degenerate simplices @@ -18,6 +20,8 @@ for an epimorphism `f : ⦋n⦌ ⟶ ⦋m⦌` and a non-degenerate `m`-simplex `y -/ +@[expose] public section + universe u open CategoryTheory Simplicial Limits Opposite diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean b/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean index 89f91ae46fad0b..14ae1c10df5d58 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean @@ -3,14 +3,15 @@ Copyright (c) 2024 Mario Carneiro and Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl, Joël Riou -/ +module -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal -import Mathlib.AlgebraicTopology.SimplexCategory.Truncated -import Mathlib.CategoryTheory.Category.ReflQuiv -import Mathlib.Combinatorics.Quiver.ReflQuiver -import Mathlib.AlgebraicTopology.SimplicialSet.Monoidal -import Mathlib.CategoryTheory.Category.Cat.Terminal +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal +public import Mathlib.AlgebraicTopology.SimplexCategory.Truncated +public import Mathlib.CategoryTheory.Category.ReflQuiv +public import Mathlib.Combinatorics.Quiver.ReflQuiver +public import Mathlib.AlgebraicTopology.SimplicialSet.Monoidal +public import Mathlib.CategoryTheory.Category.Cat.Terminal /-! @@ -36,6 +37,8 @@ nerve functor, made by possible by the fact that nerves of categories are 2-cosk composing a pair of adjunctions, which factor through the category of 2-truncated simplicial sets. -/ +@[expose] public section + namespace SSet open CategoryTheory Category Limits Functor Opposite Simplicial Nerve open SimplexCategory.Truncated SimplicialObject.Truncated diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean index 95206af4cbf9c1..88d111fcc30985 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex -import Mathlib.CategoryTheory.Subpresheaf.Equalizer +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex +public import Mathlib.CategoryTheory.Subpresheaf.Equalizer /-! # Horns @@ -13,6 +15,8 @@ This file introduces horns `Λ[n, i]`. -/ +@[expose] public section + universe u open CategoryTheory Simplicial Opposite diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/KanComplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/KanComplex.lean index 7bc631725c255c..00099630333ed8 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/KanComplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/KanComplex.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Joël Riou -/ -import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant -import Mathlib.AlgebraicTopology.SimplicialSet.CategoryWithFibrations -import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex +module + +public import Mathlib.AlgebraicTopology.ModelCategory.IsCofibrant +public import Mathlib.AlgebraicTopology.SimplicialSet.CategoryWithFibrations +public import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex /-! # Kan complexes @@ -23,6 +25,8 @@ we show that every Kan complex is a quasicategory. -/ +@[expose] public section + universe u namespace SSet diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean index bf0086be864200..4b56686e4291c5 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Jack McKoen -/ -import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex -import Mathlib.CategoryTheory.Closed.FunctorToTypes -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex +public import Mathlib.CategoryTheory.Closed.FunctorToTypes +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory /-! # The monoidal category structure on simplicial sets @@ -19,6 +21,8 @@ category structure on `SSet`. -/ +@[expose] public section + universe u open Simplicial CategoryTheory MonoidalCategory Limits diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean index afbe82790f4753..b07a4a4bc56dd3 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Basic -import Mathlib.CategoryTheory.ComposableArrows +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Basic +public import Mathlib.CategoryTheory.ComposableArrows.Basic /-! @@ -20,6 +22,8 @@ which is the category `Fin (n + 1) ⥤ C`. -/ +@[expose] public section + open CategoryTheory.Category Simplicial universe v u diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean index d3d143c5af0dec..a86170d146b9e8 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Mario Carneiro and Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplexCategory.MorphismProperty -import Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat -import Mathlib.CategoryTheory.Category.Cat.CartesianClosed -import Mathlib.CategoryTheory.Closed.FunctorToTypes -import Mathlib.CategoryTheory.Limits.Presheaf +module + +public import Mathlib.AlgebraicTopology.SimplexCategory.MorphismProperty +public import Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat +public import Mathlib.CategoryTheory.Category.Cat.CartesianClosed +public import Mathlib.CategoryTheory.Closed.FunctorToTypes +public import Mathlib.CategoryTheory.Limits.Presheaf /-! # The adjunction between the nerve and the homotopy category functor. @@ -32,6 +34,8 @@ Finally we show that `hoFunctor : SSet.{u} ⥤ Cat.{u, u}` preserves finite cart that it fails to preserve infinite products. -/ +@[expose] public section + namespace CategoryTheory open Category Functor Limits Opposite SimplexCategory Simplicial SSet Nerve diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean index bbb20f5c4a2020..0268bc0dfd3baf 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate -import Mathlib.AlgebraicTopology.SimplicialSet.Nerve +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate +public import Mathlib.AlgebraicTopology.SimplicialSet.Nerve /-! # The nondegenerate simplices in the nerve of a partially ordered type @@ -15,6 +17,8 @@ the monotone map `s.obj : Fin (n + 1) → X` is strictly monotone. -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplices.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplices.lean index cd315cf35cfd37..e0ff57cd1dfbc1 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplices.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplices.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate -import Mathlib.AlgebraicTopology.SimplicialSet.Simplices +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate +public import Mathlib.AlgebraicTopology.SimplicialSet.Simplices /-! # The partially ordered type of non degenerate simplices of a simplicial set @@ -19,6 +21,8 @@ non degenerate `x.toN : X.N` such that `x.toN.subcomplex = x.subcomplex`. -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplicesSubcomplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplicesSubcomplex.lean index 827fc8feb0537b..b386b8cf7d002b 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplicesSubcomplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NonDegenerateSimplicesSubcomplex.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplices +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.NonDegenerateSimplices /-! # The type of nondegenerate simplices not in a subcomplex @@ -14,6 +16,8 @@ that are not in `A`. -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Op.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Op.lean index d903b050b5d77a..67c2a9d0929190 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Op.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Op.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Op -import Mathlib.AlgebraicTopology.SimplicialSet.Basic +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Op +public import Mathlib.AlgebraicTopology.SimplicialSet.Basic /-! # The covariant involution of the category of simplicial sets @@ -25,6 +27,8 @@ topological realization of `X` (@joelriou) -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean index c75434b5342863..46efd6759e93de 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Horn +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Horn /-! # Paths in simplicial sets @@ -19,6 +21,8 @@ An `n`-simplex has a maximal path, the `spine` of the simplex, which is a path of length `n`. -/ +@[expose] public section + universe v u open CategoryTheory Opposite Simplicial SimplexCategory @@ -198,14 +202,20 @@ abbrev vertex (f : Path X n) (i : Fin (n + 1)) : X _⦋0⦌ := abbrev arrow (f : Path X n) (i : Fin n) : X _⦋1⦌ := Truncated.Path.arrow f i +lemma congr_vertex {f g : Path X n} (h : f = g) (i : Fin (n + 1)) : + f.vertex i = g.vertex i := by rw [h] + +lemma congr_arrow {f g : Path X n} (h : f = g) (i : Fin n) : + f.arrow i = g.arrow i := by rw [h] + /-- The source of a 1-simplex in a path is identified with the source vertex. -/ lemma arrow_src (f : Path X n) (i : Fin n) : - X.map (δ 1).op (f.arrow i) = f.vertex i.castSucc := + X.δ 1 (f.arrow i) = f.vertex i.castSucc := Truncated.Path.arrow_src f i /-- The target of a 1-simplex in a path is identified with the target vertex. -/ lemma arrow_tgt (f : Path X n) (i : Fin n) : - X.map (δ 0).op (f.arrow i) = f.vertex i.succ := + X.δ 0 (f.arrow i) = f.vertex i.succ := Truncated.Path.arrow_tgt f i @[ext] @@ -218,11 +228,23 @@ lemma ext {f g : Path X n} (hᵥ : f.vertex = g.vertex) (hₐ : f.arrow = g.arro lemma ext' {f g : Path X (n + 1)} (h : ∀ i, f.arrow i = g.arrow i) : f = g := Truncated.Path.ext' h +@[ext] +lemma ext₀ {f g : Path X 0} (h : f.vertex 0 = g.vertex 0) : f = g := by + ext i + · fin_cases i; exact h + · fin_cases i + /-- For `j + l ≤ n`, a path of length `n` restricts to a path of length `l`, namely the subpath spanned by the vertices `j ≤ i ≤ j + l` and edges `j ≤ i < j + l`. -/ -def interval (f : Path X n) (j l : ℕ) (h : j + l ≤ n := by omega) : Path X l := +def interval (f : Path X n) (j l : ℕ) (h : j + l ≤ n := by grind) : Path X l := Truncated.Path.interval f j l h +lemma arrow_interval (f : Path X n) (j l : ℕ) (k' : Fin l) (k : Fin n) + (h : j + l ≤ n := by omega) (hkk' : j + k' = k := by grind) : + (f.interval j l h).arrow k' = f.arrow k := by + dsimp [interval, arrow, Truncated.Path.interval, Truncated.Path.arrow] + congr + variable {X Y : SSet.{u}} {n : ℕ} /-- Maps of simplicial sets induce maps of paths in a simplicial set. -/ @@ -265,6 +287,20 @@ lemma spine_arrow (Δ : X _⦋n⦌) (i : Fin n) : (X.spine n Δ).arrow i = X.map (mkOfSucc i).op Δ := rfl +lemma spine_δ₀ {m : ℕ} (x : X _⦋m + 1⦌) : + X.spine m (X.δ 0 x) = (X.spine (m + 1) x).interval 1 m := by + obtain _ | m := m + · ext + simp [spine, Path.vertex, Truncated.Path.vertex, SimplicialObject.truncation, + Truncated.spine, Path.interval, Truncated.Path.interval, Truncated.inclusion, + Truncated.Hom.tr, ← SimplexCategory.δ_zero_eq_const, ← SimplicialObject.δ_def] + · ext i + dsimp + rw [SimplicialObject.δ_def, ← FunctorToTypes.map_comp_apply, ← op_comp, + SimplexCategory.mkOfSucc_δ_gt (j := 0) (i := i) (by simp)] + symm + exact Path.arrow_interval _ _ _ _ _ _ (by rw [Fin.val_succ, add_comm]) + /-- For `m ≤ n + 1`, the `m`-spine of `X` factors through the `n + 1`-truncation of `X`. -/ lemma truncation_spine (m : ℕ) (h : m ≤ n + 1) : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Simplices.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Simplices.lean index 7aa1b27ae2cd2b..11909202d5989c 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Simplices.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Simplices.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Elements -import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex +module + +public import Mathlib.CategoryTheory.Elements +public import Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex /-! # The preordered type of simplices of a simplicial set @@ -25,6 +27,8 @@ simplices of a simplicial set `X` which do not belong to a given subcomplex. -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean index b75f896843ca1c..65af70fe1921f4 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean @@ -3,10 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.NerveNondegenerate -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.Data.Fin.VecNotation -import Mathlib.Order.Fin.SuccAboveOrderIso +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.NerveNondegenerate +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Order.Fin.SuccAboveOrderIso /-! # The standard simplex @@ -18,6 +19,8 @@ for their boundaries`∂Δ[n]` and horns `Λ[n, i]`. -/ +@[expose] public section + universe u open CategoryTheory Limits Simplicial Opposite diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean index 1451de9820e13a..7d56de0b287dde 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl, Joël Riou, Johan Commelin, Nick Ward -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Nerve -import Mathlib.AlgebraicTopology.SimplicialSet.Path +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Nerve +public import Mathlib.AlgebraicTopology.SimplicialSet.Path /-! # Strict Segal simplicial sets @@ -23,6 +25,8 @@ in `Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean`. -/ +@[expose] public section + universe v u open CategoryTheory Simplicial SimplexCategory @@ -48,8 +52,45 @@ structure StrictSegal where /-- For an `n + 1`-truncated simplicial set `X`, `IsStrictSegal X` asserts the mere existence of an inverse to `spine X m` for all `m ≤ n + 1`. -/ -class IsStrictSegal : Prop where - segal (m : ℕ) (h : m ≤ n + 1 := by omega) : Function.Bijective (X.spine m) +class IsStrictSegal (X : SSet.Truncated.{u} (n + 1)) : Prop where + spine_bijective (X) (m : ℕ) (h : m ≤ n + 1 := by grind) : Function.Bijective (X.spine m) + +export IsStrictSegal (spine_bijective) + +@[deprecated (since := "2025-11-04")] alias IsStrictSegal.segal := spine_bijective + +lemma spine_injective (X : SSet.Truncated.{u} (n + 1)) [X.IsStrictSegal] + {m : ℕ} {h : m ≤ n + 1} : + Function.Injective (X.spine m) := + (spine_bijective X m).injective + +lemma spine_surjective (X : SSet.Truncated.{u} (n + 1)) [X.IsStrictSegal] + {m : ℕ} (p : X.Path m) (h : m ≤ n + 1 := by grind) : + ∃ (x : X _⦋m⦌ₙ₊₁), X.spine m _ x = p := + (spine_bijective X m).surjective p + +variable {X} in +lemma IsStrictSegal.ext [X.IsStrictSegal] {d : ℕ} {hd} {x y : X _⦋d + 1⦌ₙ₊₁} + (h : ∀ (i : Fin (d + 1)), + X.map (SimplexCategory.Truncated.Hom.tr (mkOfSucc i)).op x = + X.map (SimplexCategory.Truncated.Hom.tr (mkOfSucc i)).op y) : + x = y := + X.spine_injective (by ext i; apply h) + +variable {X} in +lemma IsStrictSegal.hom_ext {Y : SSet.Truncated.{u} (n + 1)} [Y.IsStrictSegal] + {f g : X ⟶ Y} (h : ∀ (x : X _⦋1⦌ₙ₊₁), f.app _ x = g.app _ x) : f = g := by + ext ⟨⟨m, hm⟩⟩ x + induction m using SimplexCategory.rec with | _ m + obtain _ | m := m + · have fac := δ_comp_σ_self (i := (0 : Fin 1)) + dsimp at fac + simpa [← FunctorToTypes.naturality, + ← FunctorToTypes.map_comp_apply, ← op_comp, + ← SimplexCategory.Truncated.Hom.tr_comp, fac] using + congr_arg (Y.map (SimplexCategory.Truncated.Hom.tr (SimplexCategory.δ 0)).op) + (h (X.map (SimplexCategory.Truncated.Hom.tr (SimplexCategory.σ 0)).op x)) + · exact IsStrictSegal.ext (fun i ↦ by simp only [← FunctorToTypes.naturality, h]) namespace StrictSegal @@ -57,7 +98,7 @@ namespace StrictSegal `m ≤ n + 1` determines an inhabitant of `StrictSegal X`. -/ noncomputable def ofIsStrictSegal [IsStrictSegal X] : StrictSegal X where spineToSimplex m h := - Equiv.ofBijective (X.spine m) (IsStrictSegal.segal m h) |>.invFun + Equiv.ofBijective (X.spine m) (X.spine_bijective m h) |>.invFun spine_spineToSimplex m _ := funext <| Equiv.ofBijective (X.spine m) _ |>.right_inv spineToSimplex_spine m _ := @@ -102,7 +143,7 @@ end autoParam /-- The unique existence of an inverse to `spine X m` for all `m ≤ n + 1` implies the mere existence of such an inverse. -/ lemma isStrictSegal (sx : StrictSegal X) : IsStrictSegal X where - segal m h := sx.spineEquiv m h |>.bijective + spine_bijective m h := sx.spineEquiv m h |>.bijective variable (m : ℕ) (h : m ≤ n + 1) @@ -245,11 +286,15 @@ variable {X} (sx : StrictSegal X) /-- A `StrictSegal` structure on a simplicial set `X` restricts to a `Truncated.StrictSegal` structure on the `n + 1`-truncation of `X`. -/ -def truncation (n : ℕ) : truncation (n + 1) |>.obj X |>.StrictSegal where +protected def truncation (n : ℕ) : truncation (n + 1) |>.obj X |>.StrictSegal where spineToSimplex _ _ := sx.spineToSimplex spine_spineToSimplex m _ := sx.spine_spineToSimplex m spineToSimplex_spine m _ := sx.spineToSimplex_spine m +instance [X.IsStrictSegal] (n : ℕ) : + ((truncation (n + 1)).obj X).IsStrictSegal := + ((ofIsStrictSegal X).truncation n).isStrictSegal + @[simp] lemma spine_spineToSimplex_apply {n : ℕ} (f : Path X n) : X.spine n (sx.spineToSimplex f) = f := @@ -386,6 +431,79 @@ lemma spine_δ_arrow_eq (h : j = i.succ.castSucc) : rw [mkOfSucc_δ_eq h, spineToSimplex_edge] end StrictSegal + +/-- Helper structure in order to show that a simplicial set is strict Segal. -/ +structure StrictSegalCore (n : ℕ) where + /-- Map which produces a `n + 1`-simplex from a `1`-simplex and a `n`-simplex when + the target vertex of the `1`-simplex equals the zeroth simplex of the `n`-simplex. -/ + concat (x : X _⦋1⦌) (s : X _⦋n⦌) (h : X.δ 0 x = X.map (SimplexCategory.const _ _ 0).op s) : + X _⦋n + 1⦌ + map_mkOfSucc_zero_concat x s h : X.map (mkOfSucc 0).op (concat x s h) = x + δ₀_concat x s h : X.δ 0 (concat x s h) = s + injective {x y : X _⦋n + 1⦌} (h : X.map (mkOfSucc 0).op x = X.map (mkOfSucc 0).op y) + (h₀ : X.δ 0 x = X.δ 0 y) : x = y + +namespace StrictSegalCore + +variable {X} (h : ∀ n, X.StrictSegalCore n) {n : ℕ} (p : X.Path n) + +/-- Auxiliary definition for `StrictSegalCore.spineToSimplex`. -/ +def spineToSimplexAux : { s : X _⦋n⦌ // X.spine _ s = p } := by + induction n with + | zero => exact ⟨p.vertex 0, by aesop⟩ + | succ n hn => + refine ⟨(h n).concat (p.arrow 0) (hn (p.interval 1 n)).val ?_, ?_⟩ + · rw [p.arrow_tgt 0] + exact Path.congr_vertex (hn (p.interval 1 n)).prop.symm 0 + · ext i + obtain rfl | ⟨i, rfl⟩ := i.eq_zero_or_eq_succ + · dsimp + rw [map_mkOfSucc_zero_concat] + · simpa [spine_arrow, ← SimplexCategory.mkOfSucc_δ_gt (j := 0) (i := i) (by simp), + op_comp, FunctorToTypes.map_comp_apply, ← SimplicialObject.δ_def, δ₀_concat, + ← p.arrow_interval 1 n i i.succ (by grind) (by grind [Fin.val_succ])] using + Path.congr_arrow (hn (p.interval 1 n)).prop i + +/-- Auxiliary definition for `StrictSegal.ofCore`. -/ +def spineToSimplex : X _⦋n⦌ := (spineToSimplexAux h p).val + +@[simp] +lemma spine_spineToSimplex : X.spine n (spineToSimplex h p) = p := (spineToSimplexAux h p).prop + +lemma spineToSimplex_zero (p : X.Path 0) : spineToSimplex h p = p.vertex 0 := rfl + +lemma spineToSimplex_succ (p : X.Path (n + 1)) : + spineToSimplex h p = (h n).concat (p.arrow 0) (spineToSimplex h (p.interval 1 n)) (by + rw [p.arrow_tgt 0] + exact Path.congr_vertex (spine_spineToSimplex h (p.interval 1 n)).symm 0) := + rfl + +lemma map_mkOfSucc_zero_spineToSimplex (p : X.Path (n + 1)) : + X.map (mkOfSucc 0).op (spineToSimplex h p) = p.arrow 0 := by + rw [spineToSimplex_succ, map_mkOfSucc_zero_concat] + +lemma δ₀_spineToSimplex (p : X.Path (n + 1)) : + X.δ 0 (spineToSimplex h p) = spineToSimplex h (p.interval 1 n) := by + rw [spineToSimplex_succ, δ₀_concat] + +@[simp] +lemma spineToSimplex_spine (s : X _⦋n⦌) : spineToSimplex h (X.spine _ s) = s := by + induction n with + | zero => simp [spineToSimplex_zero] + | succ n hn => + exact (h n).injective (map_mkOfSucc_zero_spineToSimplex _ _) + (by rw [δ₀_spineToSimplex, ← hn (X.δ 0 s), spine_δ₀]) + +end StrictSegalCore + +variable {X} in +/-- Given a simplicial set `X`, this constructs a `StrictSegal` structure for `X` from +`StrictSegalCore` structures for all `n : ℕ`. -/ +def StrictSegal.ofCore (h : ∀ n, X.StrictSegalCore n) : X.StrictSegal where + spineToSimplex := StrictSegalCore.spineToSimplex h + spine_spineToSimplex := by aesop + spineToSimplex_spine n := by aesop + end SSet namespace CategoryTheory.Nerve @@ -396,27 +514,16 @@ variable (C : Type u) [Category.{v} C] /-- Simplices in the nerve of categories are uniquely determined by their spine. Indeed, this property describes the essential image of the nerve functor. -/ -noncomputable def strictSegal : StrictSegal (nerve C) where - spineToSimplex {n} F := - ComposableArrows.mkOfObjOfMapSucc (fun i ↦ (F.vertex i).obj 0) - (fun i ↦ eqToHom (Functor.congr_obj (F.arrow_src i).symm 0) ≫ - (F.arrow i).map' 0 1 ≫ eqToHom (Functor.congr_obj (F.arrow_tgt i) 0)) - spine_spineToSimplex n := by - ext F i - · exact ComposableArrows.ext₀ rfl - · refine ComposableArrows.ext₁ ?_ ?_ ?_ - · exact Functor.congr_obj (F.arrow_src i).symm 0 - · exact Functor.congr_obj (F.arrow_tgt i).symm 0 - · dsimp - apply ComposableArrows.mkOfObjOfMapSucc_map_succ - spineToSimplex_spine n := by - ext F - fapply ComposableArrows.ext - · intro i - rfl - · intro i hi - dsimp - exact ComposableArrows.mkOfObjOfMapSucc_map_succ _ _ i hi +def strictSegal : StrictSegal (nerve C) := + StrictSegal.ofCore (fun n ↦ + { concat f s h := s.precomp (f.hom ≫ eqToHom (Functor.congr_obj h 0)) + map_mkOfSucc_zero_concat f s h := + ComposableArrows.ext₁ rfl (Functor.congr_obj h 0).symm (by cat_disch) + δ₀_concat f s h := rfl + injective {f g} h h₀ := + ComposableArrows.ext_succ (Functor.congr_obj h 0) h₀ + ((Arrow.mk_eq_mk_iff _ _).1 + (DFunLike.congr_arg ComposableArrows.arrowEquiv h)).2.2 }) instance isStrictSegal : IsStrictSegal (nerve C) := strictSegal C |>.isStrictSegal diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Subcomplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Subcomplex.lean index 33c0c8220742a9..710e2dff17ee71 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Subcomplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Subcomplex.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialSet.Basic -import Mathlib.CategoryTheory.Subpresheaf.OfSection +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.Basic +public import Mathlib.CategoryTheory.Subpresheaf.OfSection /-! # Subcomplexes of a simplicial set @@ -22,6 +24,8 @@ in the category of presheaves. -/ +@[expose] public section + universe u open CategoryTheory Simplicial Limits diff --git a/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean b/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean index c193178cdd3d19..fc17ce502e264d 100644 --- a/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean +++ b/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Homology.AlternatingConst -import Mathlib.AlgebraicTopology.SingularSet +module + +public import Mathlib.Algebra.Homology.AlternatingConst +public import Mathlib.AlgebraicTopology.SingularSet /-! # Singular homology @@ -14,6 +16,8 @@ We also calculate the homology of a totally disconnected space as an example. -/ +@[expose] public section + noncomputable section namespace AlgebraicTopology diff --git a/Mathlib/AlgebraicTopology/SingularSet.lean b/Mathlib/AlgebraicTopology/SingularSet.lean index 4530f1f76b5bd6..5b0bc57545d03a 100644 --- a/Mathlib/AlgebraicTopology/SingularSet.lean +++ b/Mathlib/AlgebraicTopology/SingularSet.lean @@ -3,25 +3,27 @@ Copyright (c) 2023 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison, Adam Topaz -/ -import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex -import Mathlib.AlgebraicTopology.TopologicalSimplex -import Mathlib.CategoryTheory.Limits.Presheaf -import Mathlib.Topology.Category.TopCat.Limits.Basic -import Mathlib.Topology.Category.TopCat.ULift +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex +public import Mathlib.AlgebraicTopology.TopologicalSimplex +public import Mathlib.CategoryTheory.Limits.Presheaf +public import Mathlib.Topology.Category.TopCat.Limits.Basic +public import Mathlib.Topology.Category.TopCat.ULift /-! # The singular simplicial set of a topological space and geometric realization of a simplicial set The *singular simplicial set* `TopCat.toSSet.obj X` of a topological space `X` -has `n`-simplices which identify to continuous maps `stdSimplex ℝ (Fin (n + 1) → X`, -where `stdSimplex ℝ (Fin (n + 1) → X` is the standard topological `n`-simplex, -which is defined as the subtype of `Fin (n + 1) → ℝ` consists of functions `f` +has `n`-simplices which identify to continuous maps `stdSimplex ℝ (Fin (n + 1)) → X`, +where `stdSimplex ℝ (Fin (n + 1))` is the standard topological `n`-simplex, +defined as the subtype of `Fin (n + 1) → ℝ` consisting of functions `f` such that `0 ≤ f i` for all `i` and `∑ i, f i = 1`. -The *geometric realization* functor `SSet.toTop.obj` is left adjoint to `TopCat.toSSet`. +The *geometric realization* functor `SSet.toTop` is left adjoint to `TopCat.toSSet`. It is the left Kan extension of `SimplexCategory.toTop` along the Yoneda embedding. -# Main definitions +## Main definitions * `TopCat.toSSet : TopCat ⥤ SSet` is the functor assigning the singular simplicial set to a topological space. @@ -36,6 +38,8 @@ It is the left Kan extension of `SimplexCategory.toTop` along the Yoneda embeddi -/ +@[expose] public section + universe u open CategoryTheory @@ -45,8 +49,8 @@ open CategoryTheory Let `X : TopCat.{u}` be a topological space. Then the singular simplicial set of `X` has as `n`-simplices the continuous maps `ULift.{u} (stdSimplex ℝ (Fin (n + 1))) → X`. -Here, `stdSimplex ℝ (Fin (n + 1)` is the standard topological `n`-simplex, -defined as `{ f : Fin (n + 1) → ℝ // ∀ i, 0 ≤ f i ∧ ∑ i, f i = 1 }` with its subspace topology. -/ +Here, `stdSimplex ℝ (Fin (n + 1))` is the standard topological `n`-simplex, +defined as `{ f : Fin (n + 1) → ℝ // (∀ i, 0 ≤ f i) ∧ ∑ i, f i = 1 }` with its subspace topology. -/ noncomputable def TopCat.toSSet : TopCat.{u} ⥤ SSet.{u} := Presheaf.restrictedULiftYoneda.{0} SimplexCategory.toTop.{u} diff --git a/Mathlib/AlgebraicTopology/TopologicalSimplex.lean b/Mathlib/AlgebraicTopology/TopologicalSimplex.lean index 05509ad3fbcaff..3b8353347544a2 100644 --- a/Mathlib/AlgebraicTopology/TopologicalSimplex.lean +++ b/Mathlib/AlgebraicTopology/TopologicalSimplex.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Adam Topaz, Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.Analysis.Convex.StdSimplex -import Mathlib.Topology.Category.TopCat.ULift +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.Analysis.Convex.StdSimplex +public import Mathlib.Topology.Category.TopCat.ULift /-! # Topological simplices @@ -15,6 +17,8 @@ topological `n`-simplex. This is used to define `TopCat.toSSet` in `AlgebraicTopology.SingularSet`. -/ +@[expose] public section + universe u open CategoryTheory Simplicial diff --git a/Mathlib/Analysis/AbsoluteValue/Equivalence.lean b/Mathlib/Analysis/AbsoluteValue/Equivalence.lean index 3c9e3b96016c38..9c8f4f389b2451 100644 --- a/Mathlib/Analysis/AbsoluteValue/Equivalence.lean +++ b/Mathlib/Analysis/AbsoluteValue/Equivalence.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Analysis.Normed.Field.WithAbs +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Analysis.Normed.Field.WithAbs /-! # Equivalence of real-valued absolute values @@ -13,6 +15,8 @@ Two absolute values `v₁, v₂ : AbsoluteValue R ℝ` are *equivalent* if there positive real number `c` such that `v₁ x ^ c = v₂ x` for all `x : R`. -/ +@[expose] public section + namespace AbsoluteValue section OrderedSemiring diff --git a/Mathlib/Analysis/Analytic/Basic.lean b/Mathlib/Analysis/Analytic/Basic.lean index 36f20cf8081663..36dd6a48020945 100644 --- a/Mathlib/Analysis/Analytic/Basic.lean +++ b/Mathlib/Analysis/Analytic/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.ConvergenceRadius -import Mathlib.Topology.Algebra.InfiniteSum.Module +module + +public import Mathlib.Analysis.Analytic.ConvergenceRadius +public import Mathlib.Topology.Algebra.InfiniteSum.Module /-! # Analytic functions @@ -49,6 +51,8 @@ We develop the basic properties of these notions, notably: -/ +@[expose] public section + variable {𝕜 E F G : Type*} variable [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] diff --git a/Mathlib/Analysis/Analytic/Binomial.lean b/Mathlib/Analysis/Analytic/Binomial.lean index 1202f85299352f..9293286def963b 100644 --- a/Mathlib/Analysis/Analytic/Binomial.lean +++ b/Mathlib/Analysis/Analytic/Binomial.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Vasilii Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasilii Nesterov -/ -import Mathlib.Analysis.Calculus.IteratedDeriv.ConvergenceOnBall -import Mathlib.Analysis.Complex.OperatorNorm -import Mathlib.Analysis.SpecialFunctions.Complex.Analytic -import Mathlib.Analysis.SpecialFunctions.OrdinaryHypergeometric -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv -import Mathlib.RingTheory.Binomial +module + +public import Mathlib.Analysis.Calculus.IteratedDeriv.ConvergenceOnBall +public import Mathlib.Analysis.Complex.OperatorNorm +public import Mathlib.Analysis.SpecialFunctions.Complex.Analytic +public import Mathlib.Analysis.SpecialFunctions.OrdinaryHypergeometric +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.RingTheory.Binomial /-! # Binomial Series @@ -29,6 +31,8 @@ and $x$ is an element of a normed algebra over $\mathbb{K}$. since it is finite. -/ +@[expose] public section + open scoped Nat universe u v diff --git a/Mathlib/Analysis/Analytic/CPolynomial.lean b/Mathlib/Analysis/Analytic/CPolynomial.lean index e52f38e92980c2..0b47de48ef47a0 100644 --- a/Mathlib/Analysis/Analytic/CPolynomial.lean +++ b/Mathlib/Analysis/Analytic/CPolynomial.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Analytic.CPolynomialDef +module + +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Analytic.CPolynomialDef /-! # Properties of continuously polynomial functions @@ -16,6 +18,8 @@ are continuous linear maps into continuous multilinear maps. In particular, such analytic. -/ +@[expose] public section + variable {𝕜 E F G : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] [NormedAddCommGroup G] [NormedSpace 𝕜 G] diff --git a/Mathlib/Analysis/Analytic/CPolynomialDef.lean b/Mathlib/Analysis/Analytic/CPolynomialDef.lean index 7f51d9dc7a7336..18891738fbbb96 100644 --- a/Mathlib/Analysis/Analytic/CPolynomialDef.lean +++ b/Mathlib/Analysis/Analytic/CPolynomialDef.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Analysis.Analytic.ChangeOrigin +module + +public import Mathlib.Analysis.Analytic.ChangeOrigin /-! We specialize the theory of analytic functions to the case of functions that admit a development given by a *finite* formal multilinear series. We call them "continuously polynomial", @@ -42,6 +44,8 @@ More API is available in the file `Mathlib/Analysis/Analytic/CPolynomial.lean`, imports. -/ +@[expose] public section + variable {𝕜 E F G : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] [NormedAddCommGroup G] [NormedSpace 𝕜 G] diff --git a/Mathlib/Analysis/Analytic/ChangeOrigin.lean b/Mathlib/Analysis/Analytic/ChangeOrigin.lean index 7b20fef27e27a2..21c68fbf747691 100644 --- a/Mathlib/Analysis/Analytic/ChangeOrigin.lean +++ b/Mathlib/Analysis/Analytic/ChangeOrigin.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.Basic +module + +public import Mathlib.Analysis.Analytic.Basic /-! # Changing origin in a power series @@ -33,6 +35,8 @@ series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It f that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. -/ +@[expose] public section + noncomputable section open scoped NNReal ENNReal Topology diff --git a/Mathlib/Analysis/Analytic/Composition.lean b/Mathlib/Analysis/Analytic/Composition.lean index db3f9853d46939..32d135f0254347 100644 --- a/Mathlib/Analysis/Analytic/Composition.lean +++ b/Mathlib/Analysis/Analytic/Composition.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Johan Commelin -/ -import Mathlib.Analysis.Analytic.Basic -import Mathlib.Analysis.Analytic.CPolynomialDef -import Mathlib.Combinatorics.Enumerative.Composition +module + +public import Mathlib.Analysis.Analytic.Basic +public import Mathlib.Analysis.Analytic.CPolynomialDef +public import Mathlib.Combinatorics.Enumerative.Composition /-! # Composition of analytic functions @@ -64,6 +66,8 @@ double sums in a careful way. The change of variables is a canonical (combinator in more details below in the paragraph on associativity. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Analytic/Constructions.lean b/Mathlib/Analysis/Analytic/Constructions.lean index 72277afcdd262f..d8d733fd2aa1df 100644 --- a/Mathlib/Analysis/Analytic/Constructions.lean +++ b/Mathlib/Analysis/Analytic/Constructions.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Geoffrey Irving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler, Geoffrey Irving, Stefan Kebekus -/ -import Mathlib.Analysis.Analytic.Composition -import Mathlib.Analysis.Analytic.Linear -import Mathlib.Analysis.Normed.Operator.Mul -import Mathlib.Analysis.Normed.Ring.Units -import Mathlib.Analysis.Analytic.OfScalars +module + +public import Mathlib.Analysis.Analytic.Composition +public import Mathlib.Analysis.Analytic.Linear +public import Mathlib.Analysis.Normed.Operator.Mul +public import Mathlib.Analysis.Normed.Ring.Units +public import Mathlib.Analysis.Analytic.OfScalars /-! # Various ways to combine analytic functions @@ -19,6 +21,8 @@ We show that the following are analytic: 3. Finite sums and products: `Finset.sum`, `Finset.prod` -/ +@[expose] public section + noncomputable section open scoped Topology diff --git a/Mathlib/Analysis/Analytic/ConvergenceRadius.lean b/Mathlib/Analysis/Analytic/ConvergenceRadius.lean index 1146b935a62c53..c1a81f392ce826 100644 --- a/Mathlib/Analysis/Analytic/ConvergenceRadius.lean +++ b/Mathlib/Analysis/Analytic/ConvergenceRadius.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FormalMultilinearSeries -import Mathlib.Analysis.SpecificLimits.Normed +module + +public import Mathlib.Analysis.Calculus.FormalMultilinearSeries +public import Mathlib.Analysis.SpecificLimits.Normed /-! # Radius of convergence of a power series @@ -36,6 +38,8 @@ notion, describing the polydisk of convergence. This notion is more specific, an build the general theory. We do not define it here. -/ +@[expose] public section + noncomputable section variable {𝕜 E F G : Type*} diff --git a/Mathlib/Analysis/Analytic/Inverse.lean b/Mathlib/Analysis/Analytic/Inverse.lean index 1059ef8794f056..c114580654c16c 100644 --- a/Mathlib/Analysis/Analytic/Inverse.lean +++ b/Mathlib/Analysis/Analytic/Inverse.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Analytic.Composition -import Mathlib.Analysis.Analytic.Linear -import Mathlib.Tactic.Positivity +module + +public import Mathlib.Analysis.Analytic.Composition +public import Mathlib.Analysis.Analytic.Linear +public import Mathlib.Tactic.Positivity /-! @@ -32,6 +34,8 @@ inverse of an analytic open partial homeomorphism is analytic. at the image point, given by `p.leftInv`. -/ +@[expose] public section + open scoped Topology ENNReal open Finset Filter diff --git a/Mathlib/Analysis/Analytic/IsolatedZeros.lean b/Mathlib/Analysis/Analytic/IsolatedZeros.lean index 2e2d8f7e696e50..0f748627b29350 100644 --- a/Mathlib/Analysis/Analytic/IsolatedZeros.lean +++ b/Mathlib/Analysis/Analytic/IsolatedZeros.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Vincent Beffara. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vincent Beffara, Stefan Kebekus -/ -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Calculus.DSlope -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Analytic.Uniqueness -import Mathlib.Order.Filter.EventuallyConst -import Mathlib.Topology.Perfect +module + +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Calculus.DSlope +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Analytic.Uniqueness +public import Mathlib.Order.Filter.EventuallyConst +public import Mathlib.Topology.Perfect /-! # Principle of isolated zeros @@ -36,6 +38,8 @@ in this setup. within `f '' U` is codiscrete within `U`. -/ +@[expose] public section + open Filter Function Nat FormalMultilinearSeries EMetric Set open scoped Topology diff --git a/Mathlib/Analysis/Analytic/IteratedFDeriv.lean b/Mathlib/Analysis/Analytic/IteratedFDeriv.lean index 98e5b8e21d3573..779f459cf49b85 100644 --- a/Mathlib/Analysis/Analytic/IteratedFDeriv.lean +++ b/Mathlib/Analysis/Analytic/IteratedFDeriv.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.ContDiff.CPolynomial -import Mathlib.Data.Fintype.Perm +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.ContDiff.CPolynomial +public import Mathlib.Data.Fintype.Perm /-! # The iterated derivative of an analytic function @@ -44,6 +46,8 @@ statements. When needed, we give versions of some statements assuming completene analyticity, for ease of use. -/ +@[expose] public section + open scoped ENNReal Topology ContDiff open Equiv Set diff --git a/Mathlib/Analysis/Analytic/Linear.lean b/Mathlib/Analysis/Analytic/Linear.lean index 34e73a5fc092ec..de5b7b74d30c52 100644 --- a/Mathlib/Analysis/Analytic/Linear.lean +++ b/Mathlib/Analysis/Analytic/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.Basic -import Mathlib.Analysis.Analytic.CPolynomialDef +module + +public import Mathlib.Analysis.Analytic.Basic +public import Mathlib.Analysis.Analytic.CPolynomialDef /-! # Linear functions are analytic @@ -16,6 +18,8 @@ We deduce this fact from the stronger result that continuous linear maps are con polynomial, i.e., they admit a finite power series. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] diff --git a/Mathlib/Analysis/Analytic/OfScalars.lean b/Mathlib/Analysis/Analytic/OfScalars.lean index 027b7bd598306f..1918ed40a89c51 100644 --- a/Mathlib/Analysis/Analytic/OfScalars.lean +++ b/Mathlib/Analysis/Analytic/OfScalars.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Edward Watine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Edward Watine -/ -import Mathlib.Analysis.Analytic.ConvergenceRadius +module + +public import Mathlib.Analysis.Analytic.ConvergenceRadius /-! # Scalar series @@ -20,6 +22,8 @@ This file contains API for analytic functions `∑ cᵢ • xⁱ` defined in ter the ratio test for an analytic function using `ENNReal` division for all values `ℝ≥0∞`. -/ +@[expose] public section + namespace FormalMultilinearSeries section Field @@ -271,10 +275,9 @@ theorem ofScalars_radius_eq_zero_of_tendsto [NormOneClass E] refine not_summable_of_ratio_norm_eventually_ge (r := 2) (by simp) ?_ ?_ · contrapose! hc apply not_tendsto_atTop_of_tendsto_nhds (a:=0) - rw [not_frequently] at hc apply Tendsto.congr' ?_ tendsto_const_nhds filter_upwards [hc] with n hc' - rw [ofScalars_norm, norm_mul, norm_norm, not_ne_iff, mul_eq_zero] at hc' + rw [ofScalars_norm, norm_mul, norm_norm, mul_eq_zero] at hc' cases hc' <;> aesop · filter_upwards [hc.eventually_ge_atTop (2*r⁻¹), eventually_ne_atTop 0] with n hc hn simp only [ofScalars_norm, norm_mul, norm_norm, norm_pow, NNReal.norm_eq] diff --git a/Mathlib/Analysis/Analytic/Order.lean b/Mathlib/Analysis/Analytic/Order.lean index 2c7dc9ddaf1dea..eb41f3305a876b 100644 --- a/Mathlib/Analysis/Analytic/Order.lean +++ b/Mathlib/Analysis/Analytic/Order.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Vincent Beffara. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vincent Beffara, Stefan Kebekus -/ -import Mathlib.Analysis.Analytic.IsolatedZeros +module + +public import Mathlib.Analysis.Analytic.IsolatedZeros /-! # Vanishing Order of Analytic Functions @@ -16,6 +18,8 @@ of `ℕ∞`. Uniformize API between analytic and meromorphic functions -/ +@[expose] public section + open Filter Set open scoped Topology @@ -81,7 +85,7 @@ lemma AnalyticAt.analyticOrderAt_eq_natCast (hf : AnalyticAt 𝕜 f z₀) : unfold analyticOrderAt split_ifs with h · simp only [ENat.top_ne_coe, false_iff] - contrapose! h + contrapose h rw [← hf.exists_eventuallyEq_pow_smul_nonzero_iff] exact ⟨n, h⟩ · rw [← hf.exists_eventuallyEq_pow_smul_nonzero_iff] at h diff --git a/Mathlib/Analysis/Analytic/Polynomial.lean b/Mathlib/Analysis/Analytic/Polynomial.lean index d1a951e7379004..dfe0c140df7365 100644 --- a/Mathlib/Analysis/Analytic/Polynomial.lean +++ b/Mathlib/Analysis/Analytic/Polynomial.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.MvPolynomial.Eval -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Topology.Algebra.Module.FiniteDimension +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Topology.Algebra.Module.FiniteDimension /-! # Polynomials are analytic @@ -15,6 +17,8 @@ This file combines the analysis and algebra libraries and shows that evaluation is an analytic function. -/ +@[expose] public section + variable {𝕜 E A B : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CommSemiring A] {z : E} {s : Set E} diff --git a/Mathlib/Analysis/Analytic/RadiusLiminf.lean b/Mathlib/Analysis/Analytic/RadiusLiminf.lean index c563f1e4949509..c44eac33502c8e 100644 --- a/Mathlib/Analysis/Analytic/RadiusLiminf.lean +++ b/Mathlib/Analysis/Analytic/RadiusLiminf.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.ConvergenceRadius -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +module + +public import Mathlib.Analysis.Analytic.ConvergenceRadius +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal /-! # Representation of `FormalMultilinearSeries.radius` as a `liminf` @@ -14,6 +16,8 @@ because this would create a circular dependency once we redefine `exp` using `FormalMultilinearSeries`. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] diff --git a/Mathlib/Analysis/Analytic/Uniqueness.lean b/Mathlib/Analysis/Analytic/Uniqueness.lean index 0e2084592eeed5..6d211c8c17aa7a 100644 --- a/Mathlib/Analysis/Analytic/Uniqueness.lean +++ b/Mathlib/Analysis/Analytic/Uniqueness.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Analytic.Linear -import Mathlib.Analysis.Analytic.Composition -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Normed.Module.Completion -import Mathlib.Analysis.Analytic.ChangeOrigin +module + +public import Mathlib.Analysis.Analytic.Linear +public import Mathlib.Analysis.Analytic.Composition +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Normed.Module.Completion +public import Mathlib.Analysis.Analytic.ChangeOrigin /-! # Uniqueness principle for analytic functions @@ -16,6 +18,8 @@ We show that two analytic functions which coincide around a point coincide on wh in `AnalyticOnNhd.eqOn_of_preconnected_of_eventuallyEq`. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] diff --git a/Mathlib/Analysis/Analytic/WithLp.lean b/Mathlib/Analysis/Analytic/WithLp.lean index e590182c35f4a9..cd7708513ccb32 100644 --- a/Mathlib/Analysis/Analytic/WithLp.lean +++ b/Mathlib/Analysis/Analytic/WithLp.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Analysis.Analytic.Linear -import Mathlib.Analysis.Normed.Lp.PiLp +module + +public import Mathlib.Analysis.Analytic.Linear +public import Mathlib.Analysis.Normed.Lp.PiLp /-! # Analyticity on `WithLp` -/ +@[expose] public section + open WithLp open scoped ENNReal diff --git a/Mathlib/Analysis/Analytic/Within.lean b/Mathlib/Analysis/Analytic/Within.lean index 2dbcb5234f3c3a..4251e6a6ae1df5 100644 --- a/Mathlib/Analysis/Analytic/Within.lean +++ b/Mathlib/Analysis/Analytic/Within.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Geoffrey Irving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Geoffrey Irving -/ -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Analytic.ChangeOrigin +module + +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Analytic.ChangeOrigin /-! # Properties of analyticity restricted to a set @@ -21,6 +23,8 @@ Here we prove basic properties of these definitions. Where convenient we assume ambient space, which allows us to relate `AnalyticWithinAt` to analyticity of a local extension. -/ +@[expose] public section + noncomputable section open Topology Filter ENNReal diff --git a/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean b/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean index c580192a128337..cea46c4c101d64 100644 --- a/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean +++ b/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.Asymptotics.Theta +module + +public import Mathlib.Analysis.Asymptotics.Theta /-! # Asymptotic equivalence @@ -53,6 +55,8 @@ This is to enable `calc` support, as `calc` requires that the last two explicit -/ +@[expose] public section + namespace Asymptotics diff --git a/Mathlib/Analysis/Asymptotics/Completion.lean b/Mathlib/Analysis/Asymptotics/Completion.lean index fe5e32527dee4a..0d480ee3d7f339 100644 --- a/Mathlib/Analysis/Asymptotics/Completion.lean +++ b/Mathlib/Analysis/Asymptotics/Completion.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Asymptotics.Theta -import Mathlib.Analysis.Normed.Group.Completion +module + +public import Mathlib.Analysis.Asymptotics.Theta +public import Mathlib.Analysis.Normed.Group.Completion /-! # Asymptotics in the completion of a normed space @@ -13,6 +15,8 @@ In this file we prove lemmas relating `f = O(g)` etc for composition of functions with coercion of a seminormed group to its completion. -/ +@[expose] public section + variable {α E F : Type*} [Norm E] [SeminormedAddCommGroup F] {f : α → E} {g : α → F} {l : Filter α} diff --git a/Mathlib/Analysis/Asymptotics/Defs.lean b/Mathlib/Analysis/Asymptotics/Defs.lean index 25e8903e84ec0e..d48b4eca7daae5 100644 --- a/Mathlib/Analysis/Asymptotics/Defs.lean +++ b/Mathlib/Analysis/Asymptotics/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Field.Basic +module + +public import Mathlib.Analysis.Normed.Field.Basic /-! # Asymptotics @@ -41,6 +43,8 @@ it suffices to assume that `f` is zero wherever `g` is. (This generalization is the Fréchet derivative.) -/ +@[expose] public section + assert_not_exists IsBoundedSMul Summable OpenPartialHomeomorph BoundedLENhdsClass open Set Topology Filter NNReal diff --git a/Mathlib/Analysis/Asymptotics/ExpGrowth.lean b/Mathlib/Analysis/Asymptotics/ExpGrowth.lean index 2665376fbb71f7..ec6907dce12bc8 100644 --- a/Mathlib/Analysis/Asymptotics/ExpGrowth.lean +++ b/Mathlib/Analysis/Asymptotics/ExpGrowth.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine -/ -import Mathlib.Analysis.Asymptotics.LinearGrowth -import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLogExp +module + +public import Mathlib.Analysis.Asymptotics.LinearGrowth +public import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLogExp /-! # Exponential growth @@ -23,6 +25,8 @@ as homomorphisms preserving finitary `Inf`/`Sup` respectively. asymptotics, exponential -/ +@[expose] public section + namespace ExpGrowth open ENNReal EReal Filter Function LinearGrowth diff --git a/Mathlib/Analysis/Asymptotics/Lemmas.lean b/Mathlib/Analysis/Asymptotics/Lemmas.lean index 58e44b11dfc0a5..6f9b2e00773494 100644 --- a/Mathlib/Analysis/Asymptotics/Lemmas.lean +++ b/Mathlib/Analysis/Asymptotics/Lemmas.lean @@ -3,17 +3,21 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Yury Kudryashov -/ -import Mathlib.Analysis.Asymptotics.Defs -import Mathlib.Analysis.Normed.Group.Bounded -import Mathlib.Analysis.Normed.Group.InfiniteSum -import Mathlib.Analysis.Normed.MulAction -import Mathlib.Topology.OpenPartialHomeomorph +module + +public import Mathlib.Analysis.Asymptotics.Defs +public import Mathlib.Analysis.Normed.Group.Bounded +public import Mathlib.Analysis.Normed.Group.InfiniteSum +public import Mathlib.Analysis.Normed.MulAction +public import Mathlib.Topology.OpenPartialHomeomorph /-! # Further basic lemmas about asymptotics -/ +@[expose] public section + open Set Topology Filter NNReal namespace Asymptotics diff --git a/Mathlib/Analysis/Asymptotics/LinearGrowth.lean b/Mathlib/Analysis/Asymptotics/LinearGrowth.lean index ad7e0ac4ce2d70..dc9e6eb8c78d29 100644 --- a/Mathlib/Analysis/Asymptotics/LinearGrowth.lean +++ b/Mathlib/Analysis/Asymptotics/LinearGrowth.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine -/ -import Mathlib.Analysis.SpecificLimits.Basic +module + +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Linear growth @@ -26,6 +28,8 @@ Lemma about coercion from `ENNReal` to `EReal`. This needs additional lemmas abo `ENNReal.toEReal`. -/ +@[expose] public section + namespace LinearGrowth open EReal Filter Function @@ -544,9 +548,9 @@ lemma _root_.Monotone.linearGrowthInf_comp {a : EReal} (h : Monotone u) -- In the latter case, we apply `le_linearGrowthInf_comp` and `linearGrowthInf_comp_le`. by_cases u_0 : u = ⊥ · rw [u_0, Pi.bot_comp, linearGrowthInf_bot, ← hv.liminf_eq, mul_bot_of_pos hv₁] - by_cases h1 : ∃ᶠ n : ℕ in atTop, u n ≤ 0 + by_cases! h' : ∃ᶠ n : ℕ in atTop, u n ≤ 0 · replace h' (n : ℕ) : u n ≤ 0 := by - obtain ⟨m, n_m, um_1⟩ := (frequently_atTop.1 h1) n + obtain ⟨m, n_m, um_1⟩ := (frequently_atTop.1 h') n exact (h n_m).trans um_1 have u_0' : linearGrowthInf u = 0 := by apply le_antisymm _ (h.linearGrowthInf_nonneg u_0) @@ -555,7 +559,7 @@ lemma _root_.Monotone.linearGrowthInf_comp {a : EReal} (h : Monotone u) apply le_antisymm _ (linearGrowthInf_comp_nonneg h u_0 v_top) apply (linearGrowthInf_monotone fun n ↦ h' (v n)).trans_eq exact linearGrowthInf_const zero_ne_bot zero_ne_top - · replace h' := (not_frequently.1 h1).mono fun _ hn ↦ le_of_not_ge hn + · replace h' := h'.mono fun _ hn ↦ hn.le apply le_antisymm · rw [← hv.limsup_eq] at ha ha' ⊢ exact h.linearGrowthInf_comp_le ha ha' @@ -573,7 +577,7 @@ lemma _root_.Monotone.linearGrowthSup_comp {a : EReal} (h : Monotone u) -- In the latter case, we apply `le_linearGrowthSup_comp` and `linearGrowthSup_comp_le`. by_cases u_0 : u = ⊥ · rw [u_0, Pi.bot_comp, linearGrowthSup_bot, ← hv.liminf_eq, mul_bot_of_pos hv₁] - by_cases u_1 : ∀ᶠ n : ℕ in atTop, u n ≤ 0 + by_cases! u_1 : ∀ᶠ n : ℕ in atTop, u n ≤ 0 · have u_0' : linearGrowthSup u = 0 := by apply le_antisymm _ (h.linearGrowthSup_nonneg u_0) apply (linearGrowthSup_eventually_monotone u_1).trans_eq @@ -582,10 +586,10 @@ lemma _root_.Monotone.linearGrowthSup_comp {a : EReal} (h : Monotone u) apply le_antisymm _ (linearGrowthSup_comp_nonneg h u_0 v_top) apply (linearGrowthSup_eventually_monotone (v_top.eventually u_1)).trans_eq exact linearGrowthSup_const zero_ne_bot zero_ne_top - · replace h' := (not_eventually.1 u_1).mono fun x hx ↦ (lt_of_not_ge hx).le + · replace u_1 := u_1.mono fun x hx ↦ hx.le apply le_antisymm · rw [← hv.limsup_eq] at ha ha' ⊢ - exact linearGrowthSup_comp_le h' ha ha' v_top + exact linearGrowthSup_comp_le u_1 ha ha' v_top · rw [← hv.liminf_eq] exact h.le_linearGrowthSup_comp hv₁.ne.symm diff --git a/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean b/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean index 231a3c25b297bc..5725d668716e6e 100644 --- a/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean +++ b/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +module + +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity /-! # A collection of specific asymptotic results @@ -14,6 +16,8 @@ theory developed in `Mathlib/Analysis/Asymptotics/Defs.lean` and `Mathlib/Analysis/Asymptotics/Lemmas.lean`. -/ +@[expose] public section + open Filter Asymptotics diff --git a/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean b/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean index b6d03912b26bde..eee9e80e47da23 100644 --- a/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean +++ b/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma -/ -import Mathlib.Algebra.Polynomial.Eval.Defs -import Mathlib.Analysis.Asymptotics.Lemmas +module + +public import Mathlib.Algebra.Polynomial.Eval.Defs +public import Mathlib.Analysis.Asymptotics.Lemmas /-! # Super-Polynomial Function Decay @@ -42,6 +44,8 @@ https://ncatlab.org/nlab/show/rapidly+decreasing+function of decaying faster than `k(x) ^ n` for all naturals `n` or `k(x) ^ c` for all integer `c`. -/ +@[expose] public section + namespace Asymptotics diff --git a/Mathlib/Analysis/Asymptotics/TVS.lean b/Mathlib/Analysis/Asymptotics/TVS.lean index 277c17c576fd4f..2d3484444c1889 100644 --- a/Mathlib/Analysis/Asymptotics/TVS.lean +++ b/Mathlib/Analysis/Asymptotics/TVS.lean @@ -3,13 +3,15 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Eric Wieser -/ -import Mathlib.Analysis.Convex.EGauge -import Mathlib.Analysis.LocallyConvex.BalancedCoreHull -import Mathlib.Analysis.Seminorm -import Mathlib.Tactic.Peel -import Mathlib.Topology.Instances.ENNReal.Lemmas -import Mathlib.Analysis.Asymptotics.Defs -import Mathlib.Topology.Algebra.Module.LinearMapPiProd +module + +public import Mathlib.Analysis.Convex.EGauge +public import Mathlib.Analysis.LocallyConvex.BalancedCoreHull +public import Mathlib.Analysis.Seminorm +public import Mathlib.Tactic.Peel +public import Mathlib.Topology.Instances.ENNReal.Lemmas +public import Mathlib.Analysis.Asymptotics.Defs +public import Mathlib.Topology.Algebra.Module.LinearMapPiProd /-! # Asymptotics in a Topological Vector Space @@ -61,6 +63,8 @@ and `Asymptotics.IsBigOTVS` was defined in a similar manner. -/ +@[expose] public section + open Set Filter Asymptotics Metric open scoped Topology Pointwise ENNReal NNReal diff --git a/Mathlib/Analysis/Asymptotics/Theta.lean b/Mathlib/Analysis/Asymptotics/Theta.lean index 1a1890ee8f9e43..3de03561a15e3c 100644 --- a/Mathlib/Analysis/Asymptotics/Theta.lean +++ b/Mathlib/Analysis/Asymptotics/Theta.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Asymptotics.Lemmas -import Mathlib.Analysis.Normed.Module.Basic +module + +public import Mathlib.Analysis.Asymptotics.Lemmas +public import Mathlib.Analysis.Normed.Module.Basic /-! # Asymptotic equivalence up to a constant @@ -13,6 +15,8 @@ In this file we define `Asymptotics.IsTheta l f g` (notation: `f =Θ[l] g`) as `f =O[l] g ∧ g =O[l] f`, then prove basic properties of this equivalence relation. -/ +@[expose] public section + open Filter diff --git a/Mathlib/Analysis/BoundedVariation.lean b/Mathlib/Analysis/BoundedVariation.lean index e8b754aa79029e..cebaacf2671126 100644 --- a/Mathlib/Analysis/BoundedVariation.lean +++ b/Mathlib/Analysis/BoundedVariation.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Calculus.Monotone -import Mathlib.Topology.EMetricSpace.BoundedVariation +module + +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Calculus.FDeriv.Prod +public import Mathlib.Analysis.Calculus.Monotone +public import Mathlib.Topology.EMetricSpace.BoundedVariation /-! # Almost everywhere differentiability of functions with locally bounded variation @@ -29,6 +31,8 @@ We also give several variations around these results. -/ +@[expose] public section + open scoped NNReal Topology open Set MeasureTheory Filter diff --git a/Mathlib/Analysis/BoxIntegral/Basic.lean b/Mathlib/Analysis/BoxIntegral/Basic.lean index 769f263c56bf73..6fdc8eb1f4ba1a 100644 --- a/Mathlib/Analysis/BoxIntegral/Basic.lean +++ b/Mathlib/Analysis/BoxIntegral/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Partition.Filter -import Mathlib.Analysis.BoxIntegral.Partition.Measure -import Mathlib.Analysis.Oscillation -import Mathlib.Data.Bool.Basic -import Mathlib.MeasureTheory.Measure.Real -import Mathlib.Topology.UniformSpace.Compact +module + +public import Mathlib.Analysis.BoxIntegral.Partition.Filter +public import Mathlib.Analysis.BoxIntegral.Partition.Measure +public import Mathlib.Analysis.Oscillation +public import Mathlib.Data.Bool.Basic +public import Mathlib.MeasureTheory.Measure.Real +public import Mathlib.Topology.UniformSpace.Compact /-! # Integrals of Riemann, Henstock-Kurzweil, and McShane @@ -51,6 +53,8 @@ non-Riemann filter (e.g., Henstock-Kurzweil and McShane). integral -/ +@[expose] public section + open scoped Topology NNReal Filter Uniformity BoxIntegral open Set Finset Function Filter Metric BoxIntegral.IntegrationParams diff --git a/Mathlib/Analysis/BoxIntegral/Box/Basic.lean b/Mathlib/Analysis/BoxIntegral/Box/Basic.lean index cbbe350bd2ebe1..d4ecbe96fb3ba6 100644 --- a/Mathlib/Analysis/BoxIntegral/Box/Basic.lean +++ b/Mathlib/Analysis/BoxIntegral/Box/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.NNReal.Basic -import Mathlib.Order.Fin.Tuple -import Mathlib.Order.Interval.Set.Monotone -import Mathlib.Topology.MetricSpace.Basic -import Mathlib.Topology.MetricSpace.Bounded -import Mathlib.Topology.MetricSpace.Pseudo.Real -import Mathlib.Topology.Order.MonotoneConvergence +module + +public import Mathlib.Data.NNReal.Basic +public import Mathlib.Order.Fin.Tuple +public import Mathlib.Order.Interval.Set.Monotone +public import Mathlib.Topology.MetricSpace.Basic +public import Mathlib.Topology.MetricSpace.Bounded +public import Mathlib.Topology.MetricSpace.Pseudo.Real +public import Mathlib.Topology.Order.MonotoneConvergence /-! # Rectangular boxes in `ℝⁿ` @@ -52,6 +54,8 @@ that returns the box `⟨l, u, _⟩` if it is nonempty and `⊥` otherwise. rectangular box -/ +@[expose] public section + open Set Function Metric Filter noncomputable section diff --git a/Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean b/Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean index a949e2fa6b9525..7cccd2578e95af 100644 --- a/Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean +++ b/Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Box.Basic -import Mathlib.Analysis.SpecificLimits.Basic +module + +public import Mathlib.Analysis.BoxIntegral.Box.Basic +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Induction on subboxes @@ -26,6 +28,8 @@ Then `p I` is true. rectangular box, induction -/ +@[expose] public section + open Set Function Filter Topology noncomputable section diff --git a/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean b/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean index 403784cb4ac8a4..551383877a5bd1 100644 --- a/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean +++ b/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Basic -import Mathlib.Analysis.BoxIntegral.Partition.Additive -import Mathlib.Analysis.Calculus.FDeriv.Prod +module + +public import Mathlib.Analysis.BoxIntegral.Basic +public import Mathlib.Analysis.BoxIntegral.Partition.Additive +public import Mathlib.Analysis.Calculus.FDeriv.Prod /-! # Divergence integral for Henstock-Kurzweil integral @@ -38,6 +40,8 @@ Henstock-Kurzweil integral. Henstock-Kurzweil integral, integral, Stokes theorem, divergence theorem -/ +@[expose] public section + open scoped NNReal ENNReal Topology BoxIntegral open ContinuousLinearMap (lsmul) diff --git a/Mathlib/Analysis/BoxIntegral/Integrability.lean b/Mathlib/Analysis/BoxIntegral/Integrability.lean index c89bde18daf3c9..9bf63a80928112 100644 --- a/Mathlib/Analysis/BoxIntegral/Integrability.lean +++ b/Mathlib/Analysis/BoxIntegral/Integrability.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Basic -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.Tactic.Generalize +module + +public import Mathlib.Analysis.BoxIntegral.Basic +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.Tactic.Generalize /-! # McShane integrability vs Bochner integrability @@ -21,6 +23,8 @@ We deduce that the same is true for the Riemann integral for continuous function integral, McShane integral, Bochner integral -/ +@[expose] public section + open scoped NNReal ENNReal Topology universe u v diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Additive.lean b/Mathlib/Analysis/BoxIntegral/Partition/Additive.lean index a9f0f6d096d55f..3365229aeb8a61 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Additive.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Additive.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Partition.Split -import Mathlib.Analysis.Normed.Operator.Mul +module + +public import Mathlib.Analysis.BoxIntegral.Partition.Split +public import Mathlib.Analysis.Normed.Operator.Mul /-! # Box additive functions @@ -26,6 +28,8 @@ In this file we define box-additive functions and prove that a function such tha rectangular box, additive function -/ +@[expose] public section + noncomputable section open Function Set diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean b/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean index 7102437401f05b..d4d048837f65a7 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Option -import Mathlib.Analysis.BoxIntegral.Box.Basic -import Mathlib.Data.Set.Pairwise.Lattice +module + +public import Mathlib.Algebra.BigOperators.Option +public import Mathlib.Analysis.BoxIntegral.Box.Basic +public import Mathlib.Data.Set.Pairwise.Lattice /-! # Partitions of rectangular boxes in `ℝⁿ` @@ -36,6 +38,8 @@ We also define a `SemilatticeInf` structure on `BoxIntegral.Prepartition I` for rectangular box, partition -/ +@[expose] public section + open Set Finset Function open scoped NNReal @@ -112,7 +116,6 @@ instance : LE (Prepartition I) := ⟨fun π π' => ∀ ⦃I⦄, I ∈ π → ∃ I' ∈ π', I ≤ I'⟩ instance partialOrder : PartialOrder (Prepartition I) where - le := (· ≤ ·) le_refl _ I hI := ⟨I, hI, le_rfl⟩ le_trans _ _ _ h₁₂ h₂₃ _ hI₁ := let ⟨_, hI₂, hI₁₂⟩ := h₁₂ hI₁ diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean b/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean index f5bbe256ac8c9b..823eac493c042c 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Partition.SubboxInduction -import Mathlib.Analysis.BoxIntegral.Partition.Split +module + +public import Mathlib.Analysis.BoxIntegral.Partition.SubboxInduction +public import Mathlib.Analysis.BoxIntegral.Partition.Split /-! # Filters used in box-based integrals @@ -163,6 +165,8 @@ prepartition (and consider the special case `π = ⊥` separately if needed). integral, rectangular box, partition, filter -/ +@[expose] public section + open Set Function Filter Metric Finset Bool open scoped Topology Filter NNReal diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Measure.lean b/Mathlib/Analysis/BoxIntegral/Partition/Measure.lean index c934fdc73f311d..7592beab86c6ba 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Measure.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Measure.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Partition.Additive -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +module + +public import Mathlib.Analysis.BoxIntegral.Partition.Additive +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic /-! # Box-additive functions defined by measures @@ -23,6 +25,8 @@ For the last statement, we both prove it as a proposition and define a bundled rectangular box, measure -/ +@[expose] public section + open Set noncomputable section diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index 155392dda11e12..c02e63f92539e7 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Partition.Basic +module + +public import Mathlib.Analysis.BoxIntegral.Partition.Basic /-! # Split a box along one or more hyperplanes @@ -35,6 +37,8 @@ is available as `BoxIntegral.Prepartition.compl`. rectangular box, partition, hyperplane -/ +@[expose] public section + noncomputable section open Function Set Filter diff --git a/Mathlib/Analysis/BoxIntegral/Partition/SubboxInduction.lean b/Mathlib/Analysis/BoxIntegral/Partition/SubboxInduction.lean index ac9965aaeb4509..f792cc0f4b341a 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/SubboxInduction.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/SubboxInduction.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Box.SubboxInduction -import Mathlib.Analysis.BoxIntegral.Partition.Tagged +module + +public import Mathlib.Analysis.BoxIntegral.Box.SubboxInduction +public import Mathlib.Analysis.BoxIntegral.Partition.Tagged /-! # Induction on subboxes @@ -26,6 +28,8 @@ integral is well-defined. partition, tagged partition, Henstock integral -/ +@[expose] public section + namespace BoxIntegral diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Tagged.lean b/Mathlib/Analysis/BoxIntegral/Partition/Tagged.lean index e065e7eb9a36d3..46b58f40fd0212 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Tagged.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Tagged.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.Partition.Basic +module + +public import Mathlib.Analysis.BoxIntegral.Partition.Basic /-! # Tagged partitions @@ -22,6 +24,8 @@ requirement. rectangular box, box partition -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/BoxIntegral/UnitPartition.lean b/Mathlib/Analysis/BoxIntegral/UnitPartition.lean index a1bd7d9ba5e7ec..9d62b73e2e0540 100644 --- a/Mathlib/Analysis/BoxIntegral/UnitPartition.lean +++ b/Mathlib/Analysis/BoxIntegral/UnitPartition.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.Module.ZLattice.Basic -import Mathlib.Analysis.BoxIntegral.Integrability -import Mathlib.Analysis.BoxIntegral.Partition.Measure -import Mathlib.Analysis.BoxIntegral.Partition.Tagged +module + +public import Mathlib.Algebra.Module.ZLattice.Basic +public import Mathlib.Analysis.BoxIntegral.Integrability +public import Mathlib.Analysis.BoxIntegral.Partition.Measure +public import Mathlib.Analysis.BoxIntegral.Partition.Tagged /-! # Unit Partition @@ -52,6 +54,8 @@ is its vertices are in `ι → ℤ`, then the corresponding prepartition is actu -/ +@[expose] public section + noncomputable section variable {ι : Type*} diff --git a/Mathlib/Analysis/CStarAlgebra/ApproximateUnit.lean b/Mathlib/Analysis/CStarAlgebra/ApproximateUnit.lean index 76d4d0e3c955cc..5a89736b3073af 100644 --- a/Mathlib/Analysis/CStarAlgebra/ApproximateUnit.lean +++ b/Mathlib/Analysis/CStarAlgebra/ApproximateUnit.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order -import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -import Mathlib.Topology.ApproximateUnit +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +public import Mathlib.Topology.ApproximateUnit /-! # Nonnegative contractions in a C⋆-algebra form an approximate unit @@ -36,6 +38,8 @@ moreover, this filter is an increasing approximate unit. -/ +@[expose] public section + variable {A : Type*} [NonUnitalCStarAlgebra A] local notation "σₙ" => quasispectrum diff --git a/Mathlib/Analysis/CStarAlgebra/Basic.lean b/Mathlib/Analysis/CStarAlgebra/Basic.lean index 3729bb1e72f83b..8353d20203d679 100644 --- a/Mathlib/Analysis/CStarAlgebra/Basic.lean +++ b/Mathlib/Analysis/CStarAlgebra/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.Algebra.Star.Pi -import Mathlib.Algebra.Star.SelfAdjoint -import Mathlib.Algebra.Star.Subalgebra -import Mathlib.Algebra.Star.Unitary -import Mathlib.Data.Real.Star -import Mathlib.Topology.Algebra.Module.Star +module + +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.Algebra.Star.Pi +public import Mathlib.Algebra.Star.SelfAdjoint +public import Mathlib.Algebra.Star.Subalgebra +public import Mathlib.Algebra.Star.Unitary +public import Mathlib.Data.Real.Star +public import Mathlib.Topology.Algebra.Module.Star /-! # Normed star rings and algebras @@ -32,6 +34,8 @@ Note that the type classes corresponding to C⋆-algebras are defined in -/ +@[expose] public section + assert_not_exists ContinuousLinearMap.hasOpNorm open Topology diff --git a/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean b/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean index 31f7df54bde650..c858935f9acbfd 100644 --- a/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean +++ b/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.CStarAlgebra.Module.Constructions -import Mathlib.Analysis.Matrix.Normed -import Mathlib.Topology.UniformSpace.Matrix +public import Mathlib.Analysis.CStarAlgebra.Module.Constructions +public import Mathlib.Analysis.Matrix.Normed +public import Mathlib.Topology.UniformSpace.Matrix /-! # Matrices with entries in a C⋆-algebra @@ -32,6 +33,8 @@ replace the uniformity and bornology by the Pi ones when registering the below for more details. -/ +@[expose] public section + open scoped ComplexOrder Topology Uniformity Bornology Matrix NNReal InnerProductSpace WithCStarModule @@ -418,8 +421,7 @@ lemma reindexₐ_apply [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [M lemma mapₗ_reindexₐ [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [Mul A] [Module R A] [Star A] [AddCommMonoid B] [Mul B] [Module R B] [Star B] {e : m ≃ n} {M : CStarMatrix m m A} - (φ : A →ₗ[R] B) : reindexₐ R B e (M.mapₗ φ) = ((reindexₐ R A e M).mapₗ φ) := by - ext; simp [reindexₐ, reindexₗ] + (φ : A →ₗ[R] B) : reindexₐ R B e (M.mapₗ φ) = ((reindexₐ R A e M).mapₗ φ) := rfl @[simp] lemma reindexₐ_symm [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [Mul A] [Module R A] diff --git a/Mathlib/Analysis/CStarAlgebra/Classes.lean b/Mathlib/Analysis/CStarAlgebra/Classes.lean index 694344b6856f6b..f720a41963fde3 100644 --- a/Mathlib/Analysis/CStarAlgebra/Classes.lean +++ b/Mathlib/Analysis/CStarAlgebra/Classes.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Analysis.Complex.Basic -import Mathlib.Topology.Algebra.NonUnitalStarAlgebra -import Mathlib.Topology.Algebra.StarSubalgebra +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Topology.Algebra.NonUnitalStarAlgebra +public import Mathlib.Topology.Algebra.StarSubalgebra /-! # Classes of C⋆-algebras @@ -21,6 +22,8 @@ heavier imports. -/ +@[expose] public section + /-- The class of non-unital (complex) C⋆-algebras. -/ class NonUnitalCStarAlgebra (A : Type*) extends NonUnitalNormedRing A, StarRing A, CompleteSpace A, CStarRing A, NormedSpace ℂ A, IsScalarTower ℂ A A, SMulCommClass ℂ A A, StarModule ℂ A where diff --git a/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean b/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean index a588e8a5b410b8..57b20c10dd3076 100644 --- a/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean +++ b/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.CStarAlgebra.PositiveLinearMap -import Mathlib.Analysis.CStarAlgebra.CStarMatrix +public import Mathlib.Analysis.CStarAlgebra.PositiveLinearMap +public import Mathlib.Analysis.CStarAlgebra.CStarMatrix /-! # Completely positive maps @@ -33,6 +34,8 @@ to be used in conjunction with `LinearMapClass`. This is meant to avoid mixing o as much as possible. -/ +@[expose] public section + open scoped CStarAlgebra /-- diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean index 6293e3101a479c..1188a7af1022f8 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric -import Mathlib.Analysis.CStarAlgebra.GelfandDuality -import Mathlib.Analysis.CStarAlgebra.Unitization -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +public import Mathlib.Analysis.CStarAlgebra.GelfandDuality +public import Mathlib.Analysis.CStarAlgebra.Unitization +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic /-! # Continuous functional calculus @@ -49,6 +51,8 @@ relevant instances on C⋆-algebra can be found in the `Instances` file. -/ +@[expose] public section + open scoped Pointwise ENNReal NNReal ComplexOrder diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Commute.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Commute.lean index a37810d83bb695..b653b83d3698f7 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Commute.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Commute.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances /-! # Commuting with applications of the continuous functional calculus @@ -26,6 +28,8 @@ to call these lemmas, and give a straightforward proof by induction. -/ +@[expose] public section + variable {𝕜 A : Type*} open scoped NNReal diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Continuity.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Continuity.lean index 1e507846732594..71d2d1349ff2ed 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Continuity.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Continuity.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric -import Mathlib.Topology.MetricSpace.UniformConvergence -import Mathlib.Topology.UniformSpace.CompactConvergence +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +public import Mathlib.Topology.MetricSpace.UniformConvergence +public import Mathlib.Topology.UniformSpace.CompactConvergence /-! # Continuity of the continuous functional calculus in each variable @@ -61,6 +62,8 @@ results in the variable `a` come in two flavors: those for `RCLike 𝕜` and tho -/ +@[expose] public section + open scoped UniformConvergence NNReal open Filter Topology @@ -284,28 +287,54 @@ protected theorem ContinuousWithinAt.cfc [TopologicalSpace X] {s : Set 𝕜} (hs ContinuousWithinAt (fun x ↦ cfc f (a x)) t x₀ := ha_cont.tendsto.cfc hs f ha ha' (ha.self_of_nhdsWithin hx₀) (ha'.self_of_nhdsWithin hx₀) +/-- Suppose `a : X → Set A` is continuous on `t : Set X` and `a x` satisfies the predicate `p` for +all `x ∈ t`. Suppose further that `s : X → Set 𝕜` is a family of sets with `s x` compact when +`x ∈ t` such that `s x₀` contains the spectrum of `a x` for all sufficiently close `x ∈ t`. +If `f : 𝕜 → 𝕜` is continuous on `s x`, for each `x ∈ t`, then `fun x ↦ cfc f (a x)` is +continuous on `t`. -/ +protected theorem ContinuousOn.cfc [TopologicalSpace X] {s : X → Set 𝕜} (f : 𝕜 → 𝕜) {a : X → A} + {t : Set X} (hs : ∀ x ∈ t, IsCompact (s x)) (ha_cont : ContinuousOn a t) + (ha : ∀ x₀ ∈ t, ∀ᶠ x in 𝓝[t] x₀, spectrum 𝕜 (a x) ⊆ s x₀) (ha' : ∀ x ∈ t, p (a x)) + (hf : ∀ x ∈ t, ContinuousOn f (s x) := by cfc_cont_tac) : + ContinuousOn (fun x ↦ cfc f (a x)) t := by + rw [ContinuousOn] at ha_cont ⊢ + refine fun x hx ↦ (ha_cont x hx).cfc (hs x hx) f hx ?_ ?_ (hf x hx) + all_goals filter_upwards [ha x hx, self_mem_nhdsWithin] with x hx hxt + exacts [hx, ha' x hxt] + /-- If `f : 𝕜 → 𝕜` is continuous on a compact set `s` and `a : X → A` is continuous on `t : Set X`, and `a x` satisfies the predicate `p` associated to `𝕜` and has spectrum contained in `s` for all `x ∈ t`, then `fun x ↦ cfc f (a x)` is continuous on `t`. -/ -protected theorem ContinuousOn.cfc [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) +theorem ContinuousOn.cfc' [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (f : 𝕜 → 𝕜) {a : X → A} {t : Set X} (ha_cont : ContinuousOn a t) (ha : ∀ x ∈ t, spectrum 𝕜 (a x) ⊆ s) (ha' : ∀ x ∈ t, p (a x)) (hf : ContinuousOn f s := by cfc_cont_tac) : ContinuousOn (fun x ↦ cfc f (a x)) t := by - rw [ContinuousOn] at ha_cont ⊢ - refine fun x hx ↦ (ha_cont x hx).cfc hs f hx ?_ ?_ hf - all_goals filter_upwards [self_mem_nhdsWithin] with x hx - exacts [ha x hx, ha' x hx] + refine ContinuousOn.cfc _ (fun _ _ ↦ hs) ha_cont (fun _ _ ↦ ?_) ha' + filter_upwards [self_mem_nhdsWithin] with x hx + exact ha x hx + +/-- Suppose `a : X → Set A` is continuous and `a x` satisfies the predicate `p` for all `x`. +Suppose further that `s : X → Set 𝕜` is a family of compact sets `s x₀` contains the spectrum of +`a x` for all sufficiently close `x`. If `f : 𝕜 → 𝕜` is continuous on each `s x`, then +`fun x ↦ cfc f (a x)` is continuous. -/ +protected theorem Continuous.cfc [TopologicalSpace X] {s : X → Set 𝕜} (f : 𝕜 → 𝕜) {a : X → A} + (ha_cont : Continuous a) (hs : ∀ x, IsCompact (s x)) + (ha : ∀ x₀, ∀ᶠ x in 𝓝 x₀, spectrum 𝕜 (a x) ⊆ s x₀) + (hf : ∀ x, ContinuousOn f (s x) := by cfc_cont_tac) (ha' : ∀ x, p (a x) := by cfc_tac) : + Continuous (fun x ↦ cfc f (a x)) := by + rw [← continuousOn_univ] at ha_cont ⊢ + exact ha_cont.cfc f (fun x _ ↦ hs x) (fun x _ ↦ by simpa using ha x) (fun x _ ↦ ha' x) /-- `cfc` is continuous in the variable `a : A` when `s : Set 𝕜` is compact and `a` varies over elements whose spectrum is contained in `s`, all of which satisfy the predicate `p`, and the function `f` is continuous on the spectrum of `a`. -/ -protected theorem Continuous.cfc [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (f : 𝕜 → 𝕜) +theorem Continuous.cfc' [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (f : 𝕜 → 𝕜) {a : X → A} (ha_cont : Continuous a) (ha : ∀ x, spectrum 𝕜 (a x) ⊆ s) (hf : ContinuousOn f s := by cfc_cont_tac) (ha' : ∀ x, p (a x) := by cfc_tac) : Continuous (fun x ↦ cfc f (a x)) := by rw [← continuousOn_univ] at ha_cont ⊢ - exact ha_cont.cfc hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) + exact ha_cont.cfc' hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) end RCLike @@ -381,28 +410,54 @@ theorem ContinuousWithinAt.cfc_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs ContinuousWithinAt (fun x ↦ cfc f (a x)) t x₀ := ha_cont.tendsto.cfc_nnreal hs f ha ha' (ha.self_of_nhdsWithin hx₀) (ha'.self_of_nhdsWithin hx₀) +/-- Suppose `a : X → Set A` is continuous on `t : Set X` and `0 ≤ a x` for all `x ∈ t`. +Suppose further that `s : X → Set ℝ≥0` is a family of sets with `s x` compact when +`x ∈ t` such that `s x₀` contains the spectrum of `a x` for all sufficiently close `x ∈ t`. +If `f : ℝ≥0 → ℝ≥0` is continuous on `s x`, for each `x ∈ t`, then `fun x ↦ cfc f (a x)` is +continuous on `t`. -/ +theorem ContinuousOn.cfc_nnreal [TopologicalSpace X] {s : X → Set ℝ≥0} (f : ℝ≥0 → ℝ≥0) {a : X → A} + {t : Set X} (hs : ∀ x ∈ t, IsCompact (s x)) (ha_cont : ContinuousOn a t) + (ha : ∀ x₀ ∈ t, ∀ᶠ x in 𝓝[t] x₀, spectrum ℝ≥0 (a x) ⊆ s x₀) (ha' : ∀ x ∈ t, 0 ≤ a x) + (hf : ∀ x ∈ t, ContinuousOn f (s x) := by cfc_cont_tac) : + ContinuousOn (fun x ↦ cfc f (a x)) t := by + rw [ContinuousOn] at ha_cont ⊢ + refine fun x hx ↦ (ha_cont x hx).cfc_nnreal (hs x hx) f hx ?_ ?_ (hf x hx) + all_goals filter_upwards [ha x hx, self_mem_nhdsWithin] with x hx hxt + exacts [hx, ha' x hxt] + /-- If `f : ℝ≥0 → ℝ≥0` is continuous on a compact set `s` and `a : X → A` is continuous on `t : Set X`, and `0 ≤ a x` and has spectrum contained in `s` for all `x ∈ t`, then `fun x ↦ cfc f (a x)` is continuous on `t`. -/ -theorem ContinuousOn.cfc_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) +theorem ContinuousOn.cfc_nnreal' [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} {t : Set X} (ha_cont : ContinuousOn a t) (ha : ∀ x ∈ t, spectrum ℝ≥0 (a x) ⊆ s) (ha' : ∀ x ∈ t, 0 ≤ a x) (hf : ContinuousOn f s := by cfc_cont_tac) : ContinuousOn (fun x ↦ cfc f (a x)) t := by - rw [ContinuousOn] at ha_cont ⊢ - refine fun x hx ↦ (ha_cont x hx).cfc_nnreal hs f hx ?_ ?_ hf - all_goals filter_upwards [self_mem_nhdsWithin] with x hx - exacts [ha x hx, ha' x hx] + refine ContinuousOn.cfc_nnreal _ (fun _ _ ↦ hs) ha_cont (fun _ _ ↦ ?_) ha' + filter_upwards [self_mem_nhdsWithin] with x hx + exact ha x hx + +/-- Suppose `a : X → Set A` is a continuous family of nonnegative elements. +Suppose further that `s : X → Set ℝ≥0` is a family of compact sets such that `s x₀` contains the +spectrum of `a x` for all sufficiently close `x`. If `f : ℝ≥0 → ℝ≥0` is continuous on each `s x`, +then `fun x ↦ cfc f (a x)` is continuous. -/ +theorem Continuous.cfc_nnreal [TopologicalSpace X] {s : X → Set ℝ≥0} (f : ℝ≥0 → ℝ≥0) {a : X → A} + (ha_cont : Continuous a) (hs : ∀ x, IsCompact (s x)) + (ha : ∀ x₀, ∀ᶠ x in 𝓝 x₀, spectrum ℝ≥0 (a x) ⊆ s x₀) + (hf : ∀ x, ContinuousOn f (s x) := by cfc_cont_tac) (ha' : ∀ x, 0 ≤ a x := by cfc_tac) : + Continuous (fun x ↦ cfc f (a x)) := by + rw [← continuousOn_univ] at ha_cont ⊢ + exact ha_cont.cfc_nnreal f (fun x _ ↦ hs x) (fun x _ ↦ by simpa using ha x) (fun x _ ↦ ha' x) /-- `cfc` is continuous in the variable `a : A` when `s : Set ℝ≥0` is compact and `a` varies over nonnegative elements whose spectrum is contained in `s`, and the function `f` is continuous on `s`. -/ -theorem Continuous.cfc_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) +theorem Continuous.cfc_nnreal' [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} (ha_cont : Continuous a) (ha : ∀ x, spectrum ℝ≥0 (a x) ⊆ s) (hf : ContinuousOn f s := by cfc_cont_tac) (ha' : ∀ x, 0 ≤ a x := by cfc_tac) : Continuous (fun x ↦ cfc f (a x)) := by rw [← continuousOn_univ] at ha_cont ⊢ - exact ha_cont.cfc_nnreal hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) + exact ha_cont.cfc_nnreal' hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) end NNReal @@ -649,41 +704,56 @@ protected theorem ContinuousWithinAt.cfcₙ [TopologicalSpace X] {s : Set 𝕜} ContinuousWithinAt (fun x ↦ cfcₙ f (a x)) t x₀ := ha_cont.tendsto.cfcₙ hs f ha ha' (ha.self_of_nhdsWithin hx₀) (ha'.self_of_nhdsWithin hx₀) +/-- Suppose `a : X → Set A` is continuous on `t : Set X` and `a x` satisfies the predicate `p` for +all `x ∈ t`. Suppose further that `s : X → Set 𝕜` is a family of sets with `s x` compact when +`x ∈ t` such that `s x₀` contains the spectrum of `a x` for all sufficiently close `x ∈ t`. +If `f : 𝕜 → 𝕜` is continuous on `s x` for each `x ∈ t`, and `f 0 = 0` then `fun x ↦ cfcₙ f (a x)` +is continuous on `t`. -/ +protected theorem ContinuousOn.cfcₙ [TopologicalSpace X] {s : X → Set 𝕜} (f : 𝕜 → 𝕜) {a : X → A} + {t : Set X} (hs : ∀ x ∈ t, IsCompact (s x)) (ha_cont : ContinuousOn a t) + (ha : ∀ x₀ ∈ t, ∀ᶠ x in 𝓝[t] x₀, quasispectrum 𝕜 (a x) ⊆ s x₀) (ha' : ∀ x ∈ t, p (a x)) + (hf : ∀ x ∈ t, ContinuousOn f (s x) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) : + ContinuousOn (fun x ↦ cfcₙ f (a x)) t := by + rw [ContinuousOn] at ha_cont ⊢ + refine fun x hx ↦ (ha_cont x hx).cfcₙ (hs x hx) f hx ?_ ?_ (hf x hx) + all_goals filter_upwards [ha x hx, self_mem_nhdsWithin] with x hx hxt + exacts [hx, ha' x hxt] + /-- If `f : 𝕜 → 𝕜` is continuous on a compact set `s` and `f 0 = 0` and `a : X → A` is continuous on `t : Set X`, and `a x` satisfies the predicate `p` associated to `𝕜` and has quasispectrum contained in `s` for all `x ∈ t`, then `fun x ↦ cfcₙ f (a x)` is continuous on `t`. -/ -protected theorem ContinuousOn.cfcₙ [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) +theorem ContinuousOn.cfcₙ' [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (f : 𝕜 → 𝕜) {a : X → A} {t : Set X} (ha_cont : ContinuousOn a t) (ha : ∀ x ∈ t, quasispectrum 𝕜 (a x) ⊆ s) (ha' : ∀ x ∈ t, p (a x)) (hf : ContinuousOn f s := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) : ContinuousOn (fun x ↦ cfcₙ f (a x)) t := by - rw [ContinuousOn] at ha_cont ⊢ - refine fun x hx ↦ (ha_cont x hx).cfcₙ hs f hx ?_ ?_ hf - all_goals filter_upwards [self_mem_nhdsWithin] with x hx - exacts [ha x hx, ha' x hx] + refine ContinuousOn.cfcₙ _ (fun _ _ ↦ hs) ha_cont (fun _ _ ↦ ?_) ha' + filter_upwards [self_mem_nhdsWithin] with x hx + exact ha x hx + +/-- Suppose `a : X → Set A` is continuous and `a x` satisfies the predicate `p` for all `x`. +Suppose further that `s : X → Set 𝕜` is a family of compact sets `s x₀` contains the spectrum of +`a x` for all sufficiently close `x`. If `f : 𝕜 → 𝕜` is continuous on each `s x` and `f 0 = 0`, then +`fun x ↦ cfc f (a x)` is continuous. -/ +protected theorem Continuous.cfcₙ [TopologicalSpace X] {s : X → Set 𝕜} (f : 𝕜 → 𝕜) {a : X → A} + (ha_cont : Continuous a) (hs : ∀ x, IsCompact (s x)) + (ha : ∀ x₀, ∀ᶠ x in 𝓝 x₀, quasispectrum 𝕜 (a x) ⊆ s x₀) + (hf : ∀ x, ContinuousOn f (s x) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) + (ha' : ∀ x, p (a x) := by cfc_tac) : + Continuous (fun x ↦ cfcₙ f (a x)) := by + rw [← continuousOn_univ] at ha_cont ⊢ + exact ha_cont.cfcₙ f (fun x _ ↦ hs x) (fun x _ ↦ by simpa using ha x) (fun x _ ↦ ha' x) /-- `cfcₙ` is continuous in the variable `a : A` when `s : Set 𝕜` is compact and `a` varies over elements whose quasispectrum is contained in `s`, all of which satisfy the predicate `p`, and the function `f` is continuous `s` and `f 0 = 0`. -/ -protected theorem Continuous.cfcₙ [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (f : 𝕜 → 𝕜) +theorem Continuous.cfcₙ' [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (f : 𝕜 → 𝕜) {a : X → A} (ha_cont : Continuous a) (ha : ∀ x, quasispectrum 𝕜 (a x) ⊆ s) (hf : ContinuousOn f s := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) (ha' : ∀ x, p (a x) := by cfc_tac) : Continuous (fun x ↦ cfcₙ f (a x)) := by rw [← continuousOn_univ] at ha_cont ⊢ - exact ha_cont.cfcₙ hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) - -/-- `cfcₙ` is continuous in the variable `a : A` when `s : Set 𝕜` is compact and `a` varies over -elements whose spectrum is contained in `s`, all of which satisfy the predicate `p`, and the -function `f` is continuous on the spectrum of `a` and maps zero to itself. -/ -theorem continuous_cfcₙ [TopologicalSpace X] {s : Set 𝕜} (hs : IsCompact s) (hs0 : 0 ∈ s) - (f : 𝕜 → 𝕜) (a : X → A) (ha_cont : Continuous a) (ha : ∀ x, quasispectrum 𝕜 (a x) ⊆ s) - (hf : ContinuousOn f s := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) - (ha' : ∀ x, p (a x) := by cfc_tac) : - Continuous (fun x ↦ cfcₙ f (a x)) := by - convert continuous_cfcₙHomSuperset_left hs (hs0 := ⟨hs0⟩) ⟨⟨_, hf.restrict⟩, hf0⟩ ha_cont ha - rw [cfcₙHomSuperset_apply, cfcₙ_apply (hf := hf.mono (ha _))] - congr! + exact ha_cont.cfcₙ' hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) end RCLike @@ -729,9 +799,8 @@ theorem continuousOn_cfcₙ_nnreal_setProd {s : Set ℝ≥0} (hs : IsCompact s) (fun a ⟨_, ha'⟩ ↦ lipschitzOnWith_cfcₙ_fun_of_subset a ha') /-- If `f : ℝ≥0 → ℝ≥0` is continuous on a compact set `s` and `f 0 = 0` and `a : X → A` tends to -`a₀ : A` along a filter `l` (such that eventually `a x` satisfies the predicate `p` associated to -`ℝ≥0` and has quasispectrum contained in `s`, as does `a₀`), then `fun x ↦ cfcₙ f (a x)` tends to -`cfcₙ f a₀`. -/ +`a₀ : A` along a filter `l` (such that eventually `0 ≤ a x` and has quasispectrum contained in `s`, +as does `a₀`), then `fun x ↦ cfcₙ f (a x)` tends to `cfcₙ f a₀`. -/ theorem Filter.Tendsto.cfcₙ_nnreal {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} {a₀ : A} {l : Filter X} (ha_tendsto : Tendsto a l (𝓝 a₀)) (ha : ∀ᶠ x in l, quasispectrum ℝ≥0 (a x) ⊆ s) (ha' : ∀ᶠ x in l, 0 ≤ a x) @@ -743,8 +812,8 @@ theorem Filter.Tendsto.cfcₙ_nnreal {s : Set ℝ≥0} (hs : IsCompact s) (f : exact ⟨ha_tendsto, ha'.and ha⟩ /-- If `f : ℝ≥0 → ℝ≥0` is continuous on a compact set `s` and `f 0 = 0` and `a : X → A` is -continuous at `x₀`, and eventually `a x` satisfies the predicate `p` associated to `ℝ≥0` and has -quasispectrum contained in `s`), then `fun x ↦ cfcₙ f (a x)` is continuous at `x₀`. -/ +continuous at `x₀`, and eventually `0 ≤ a x` and has quasispectrum contained in `s`), then +`fun x ↦ cfcₙ f (a x)` is continuous at `x₀`. -/ theorem ContinuousAt.cfcₙ_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} {x₀ : X} (ha_cont : ContinuousAt a x₀) (ha : ∀ᶠ x in 𝓝 x₀, quasispectrum ℝ≥0 (a x) ⊆ s) (ha' : ∀ᶠ x in 𝓝 x₀, 0 ≤ a x) @@ -753,9 +822,8 @@ theorem ContinuousAt.cfcₙ_nnreal [TopologicalSpace X] {s : Set ℝ≥0} ha_cont.tendsto.cfcₙ_nnreal hs f ha ha' ha.self_of_nhds ha'.self_of_nhds /-- If `f : ℝ≥0 → ℝ≥0` is continuous on a compact set `s` and `f 0 = 0` and `a : X → A` is -continuous at `x₀` within a set `t : Set X`, and eventually `a x` satisfies the predicate `p` -associated to `ℝ≥0` and has quasispectrum contained in `s`), then `fun x ↦ cfcₙ f (a x)` is -continuous at `x₀` within `t`. -/ +continuous at `x₀` within a set `t : Set X`, and eventually `0 ≤ a x` and has quasispectrum +contained in `s`), then `fun x ↦ cfcₙ f (a x)` is continuous at `x₀` within `t`. -/ theorem ContinuousWithinAt.cfcₙ_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} {x₀ : X} {t : Set X} (hx₀ : x₀ ∈ t) (ha_cont : ContinuousWithinAt a t x₀) (ha : ∀ᶠ x in 𝓝[t] x₀, quasispectrum ℝ≥0 (a x) ⊆ s) @@ -764,30 +832,56 @@ theorem ContinuousWithinAt.cfcₙ_nnreal [TopologicalSpace X] {s : Set ℝ≥0} ContinuousWithinAt (fun x ↦ cfcₙ f (a x)) t x₀ := ha_cont.tendsto.cfcₙ_nnreal hs f ha ha' (ha.self_of_nhdsWithin hx₀) (ha'.self_of_nhdsWithin hx₀) +/-- Suppose `a : X → Set A` is continuous on `t : Set X` and `0 ≤ a x` for all `x ∈ t`. +Suppose further that `s : X → Set ℝ≥0` is a family of sets with `s x` compact when +`x ∈ t` such that `s x₀` contains the spectrum of `a x` for all sufficiently close `x ∈ t`. +If `f : ℝ≥0 → ℝ≥0` is continuous on `s x` for each `x ∈ t` and `f 0 = 0`, then +`fun x ↦ cfc f (a x)` is continuous on `t`. -/ +theorem ContinuousOn.cfcₙ_nnreal [TopologicalSpace X] {s : X → Set ℝ≥0} (f : ℝ≥0 → ℝ≥0) {a : X → A} + {t : Set X} (hs : ∀ x ∈ t, IsCompact (s x)) (ha_cont : ContinuousOn a t) + (ha : ∀ x₀ ∈ t, ∀ᶠ x in 𝓝[t] x₀, quasispectrum ℝ≥0 (a x) ⊆ s x₀) (ha' : ∀ x ∈ t, 0 ≤ a x) + (hf : ∀ x ∈ t, ContinuousOn f (s x) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) : + ContinuousOn (fun x ↦ cfcₙ f (a x)) t := by + rw [ContinuousOn] at ha_cont ⊢ + refine fun x hx ↦ (ha_cont x hx).cfcₙ_nnreal (hs x hx) f hx ?_ ?_ (hf x hx) + all_goals filter_upwards [ha x hx, self_mem_nhdsWithin] with x hx hxt + exacts [hx, ha' x hxt] + /-- If `f : ℝ≥0 → ℝ≥0` is continuous on a compact set `s` and `f 0 = 0` and `a : X → A` is -continuous on `t : Set X`, and `a x` satisfies the predicate `p` associated to `ℝ≥0` and has -quasispectrum contained in `s` for all `x ∈ t`, then `fun x ↦ cfcₙ f (a x)` is continuous -on `t`. -/ -theorem ContinuousOn.cfcₙ_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) +continuous on `t : Set X`, and `0 ≤ a x` and has quasispectrum contained in `s` for all `x ∈ t`, +then `fun x ↦ cfcₙ f (a x)` is continuous on `t`. -/ +theorem ContinuousOn.cfcₙ_nnreal' [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} {t : Set X} (ha_cont : ContinuousOn a t) (ha : ∀ x ∈ t, quasispectrum ℝ≥0 (a x) ⊆ s) (ha' : ∀ x ∈ t, 0 ≤ a x) (hf : ContinuousOn f s := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) : ContinuousOn (fun x ↦ cfcₙ f (a x)) t := by - rw [ContinuousOn] at ha_cont ⊢ - refine fun x hx ↦ (ha_cont x hx).cfcₙ_nnreal hs f hx ?_ ?_ hf - all_goals filter_upwards [self_mem_nhdsWithin] with x hx - exacts [ha x hx, ha' x hx] + refine ContinuousOn.cfcₙ_nnreal _ (fun _ _ ↦ hs) ha_cont (fun _ _ ↦ ?_) ha' + filter_upwards [self_mem_nhdsWithin] with x hx + exact ha x hx + +/-- Suppose `a : X → Set A` is a continuous family of nonnegative elements. +Suppose further that `s : X → Set ℝ≥0` is a family of compact sets such that `s x₀` contains the +spectrum of `a x` for all sufficiently close `x`. If `f : ℝ≥0 → ℝ≥0` is continuous on each `s x` +and `f 0 = 0`, then `fun x ↦ cfc f (a x)` is continuous. -/ +theorem Continuous.cfcₙ_nnreal [TopologicalSpace X] {s : X → Set ℝ≥0} (f : ℝ≥0 → ℝ≥0) {a : X → A} + (ha_cont : Continuous a) (hs : ∀ x, IsCompact (s x)) + (ha : ∀ x₀, ∀ᶠ x in 𝓝 x₀, quasispectrum ℝ≥0 (a x) ⊆ s x₀) + (hf : ∀ x, ContinuousOn f (s x) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) + (ha' : ∀ x, 0 ≤ a x := by cfc_tac) : + Continuous (fun x ↦ cfcₙ f (a x)) := by + rw [← continuousOn_univ] at ha_cont ⊢ + exact ha_cont.cfcₙ_nnreal f (fun x _ ↦ hs x) (fun x _ ↦ by simpa using ha x) (fun x _ ↦ ha' x) /-- `cfcₙ` is continuous in the variable `a : A` when `s : Set ℝ≥0` is compact and `a` varies over -elements whose quasispectrum is contained in `s`, all of which satisfy the predicate `p`, and the -function `f` is continuous `s` and `f 0 = 0`. -/ -theorem Continuous.cfcₙ_nnreal [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) +nonnegative elements whose quasispectrum is contained in `s`, and the function `f` is +continuous on `s` and `f 0 = 0`. -/ +theorem Continuous.cfcₙ_nnreal' [TopologicalSpace X] {s : Set ℝ≥0} (hs : IsCompact s) (f : ℝ≥0 → ℝ≥0) {a : X → A} (ha_cont : Continuous a) (ha : ∀ x, quasispectrum ℝ≥0 (a x) ⊆ s) (hf : ContinuousOn f s := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) (ha' : ∀ x, 0 ≤ a x := by cfc_tac) : Continuous (fun x ↦ cfcₙ f (a x)) := by rw [← continuousOn_univ] at ha_cont ⊢ - exact ha_cont.cfcₙ_nnreal hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) + exact ha_cont.cfcₙ_nnreal' hs f (fun x _ ↦ ha x) (fun x _ ↦ ha' x) end NNReal diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean index 7bd87abcdf86d0..7a04a092bd6d43 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Complex.Spectrum -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Analysis.CStarAlgebra.Unitization -import Mathlib.Analysis.Normed.Algebra.Spectrum -import Mathlib.Analysis.RCLike.Lemmas +module + +public import Mathlib.Analysis.Complex.Spectrum +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Analysis.CStarAlgebra.Unitization +public import Mathlib.Analysis.Normed.Algebra.Spectrum +public import Mathlib.Analysis.RCLike.Lemmas /-! # Instances of the continuous functional calculus @@ -28,6 +30,8 @@ import Mathlib.Analysis.RCLike.Lemmas continuous functional calculus, normal, selfadjoint -/ +@[expose] public section + open Topology noncomputable section diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Integral.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Integral.lean index 036274751c9e96..2ca7842b786f95 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Integral.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Integral.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis, Anatole Dedecker -/ +module -import Mathlib.Analysis.Normed.Algebra.Spectrum -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMapZero -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.Analysis.Normed.Algebra.Spectrum +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital +public import Mathlib.Analysis.RCLike.Lemmas +public import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMapZero +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap /-! # Integrals and the continuous functional calculus @@ -38,6 +39,8 @@ with the API developed in `Mathlib.MeasureTheory.SpecificCodomains.ContinuousMap + Use this to prove operator monotonicity and concavity/convexity of `rpow` and `log` -/ +@[expose] public section + open MeasureTheory Topology open scoped ContinuousMapZero diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index 20729011c5f310..df4e77ed6cf842 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances /-! # Isometric continuous functional calculus @@ -17,6 +19,8 @@ the main purpose is to allow for the continuous functional calculus to be a isom scalar rings `ℝ` and `ℝ≥0` too. -/ +@[expose] public section + local notation "σ" => spectrum local notation "σₙ" => quasispectrum diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean index 50f2b05efaed02..cab6375a7c792a 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Topology.ContinuousMap.Compact -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unital -import Mathlib.Topology.UniformSpace.CompactConvergence +module + +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Topology.ContinuousMap.Compact +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unital +public import Mathlib.Topology.UniformSpace.CompactConvergence /-! # The continuous functional calculus for non-unital algebras @@ -44,6 +46,8 @@ encoded in the `ContinuousMapZero.UniqueHom` class. + `cfcₙ_comp : cfcₙ (x ↦ g (f x)) a = cfcₙ g (cfcₙ f a)` -/ + +@[expose] public section local notation "σₙ" => quasispectrum open Topology ContinuousMapZero diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Note.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Note.lean index e748cd0aa41e67..1b08954a048250 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Note.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Note.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Init -import Mathlib.Tactic.Basic +module + +public import Mathlib.Init +public import Mathlib.Tactic.Basic /-! # Documentation concerning the continuous functional calculus @@ -13,6 +15,8 @@ A library note giving advice on developing and using the continuous functional c as the organizational structure within Mathlib. -/ +@[expose] public section + library_note2 «continuous functional calculus» /-- # The continuous functional calculus diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index 119e69b05401d4..77f36243b37477 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic -import Mathlib.Analysis.CStarAlgebra.Unitization -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric -import Mathlib.Topology.ContinuousMap.ContinuousSqrt +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic +public import Mathlib.Analysis.CStarAlgebra.Unitization +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +public import Mathlib.Topology.ContinuousMap.ContinuousSqrt /-! # Facts about star-ordered rings that depend on the continuous functional calculus @@ -36,6 +37,8 @@ the spectral order. continuous functional calculus, normal, selfadjoint -/ +@[expose] public section + open scoped NNReal CStarAlgebra local notation "σₙ" => quasispectrum diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean index 9d8dfa762b889a..808d2b86dde6c1 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Algebra.Algebra.Spectrum.Pi -import Mathlib.Algebra.Star.StarAlgHom +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Algebra.Algebra.Spectrum.Pi +public import Mathlib.Algebra.Star.StarAlgHom /-! # The continuous functional calculus on product types @@ -20,6 +21,8 @@ This file contains results about the continuous functional calculus on (indexed) `cfc f (a, b) = (cfc f a, cfc f b)` (and likewise for the non-unital version) -/ +@[expose] public section + section nonunital_pi variable {ι R S : Type*} {A : ι → Type*} [CommSemiring R] [Nontrivial R] [StarRing R] diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean index 6553da8ff083a1..568ae23a61c565 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances -import Mathlib.Topology.ContinuousMap.ContinuousSqrt +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +public import Mathlib.Topology.ContinuousMap.ContinuousSqrt /-! # Range of the continuous functional calculus @@ -21,6 +23,8 @@ consequences thereof. -/ +@[expose] public section + open Topology open scoped CStarAlgebra diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean index ad150f14bea5b0..67de9cfc3ddf52 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Topology.Algebra.Algebra -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital +module + +public import Mathlib.Topology.Algebra.Algebra +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital /-! # Restriction of the continuous functional calculus to a scalar subring @@ -23,6 +25,8 @@ simply by proving: 2. `0 ≤ x ↔ IsSelfAdjoint x ∧ SpectrumRestricts Real.toNNReal x`. -/ +@[expose] public section + open Set Topology namespace SpectrumRestricts diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean index 056f27e95493f5..46da3c7eb09aec 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital -import Mathlib.Topology.ContinuousMap.StoneWeierstrass +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.NonUnital +public import Mathlib.Topology.ContinuousMap.StoneWeierstrass /-! # Uniqueness of the continuous functional calculus @@ -24,6 +26,8 @@ This is the reason the `ContinuousMap.UniqueHom` class exists in the first place opposed to simply appealing directly to Stone-Weierstrass to prove `StarAlgHom.ext_continuousMap`. -/ +@[expose] public section + open Topology section UniqueUnital diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unital.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unital.lean index da952d5f14c206..464dedb06b4444 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unital.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unital.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Algebra.Algebra.StrictPositivity -import Mathlib.Tactic.ContinuousFunctionalCalculus -import Mathlib.Topology.Algebra.Polynomial -import Mathlib.Topology.Algebra.Star.Real -import Mathlib.Topology.ContinuousMap.StarOrdered +module + +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Algebra.Algebra.StrictPositivity +public import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Topology.Algebra.Polynomial +public import Mathlib.Topology.Algebra.Star.Real +public import Mathlib.Topology.ContinuousMap.StarOrdered /-! # The continuous functional calculus @@ -138,6 +140,8 @@ the predicate `p`, it should be noted that these will only ever be of the form ` goals, but it can be modified to become more sophisticated as the need arises. -/ +@[expose] public section + open Topology ContinuousMap section Basic diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unitary.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unitary.lean index c1c484fec1e035..0b2dc8eae9158b 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unitary.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unitary.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Tactic.Peel -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unital -import Mathlib.Analysis.Complex.Basic +module + +public import Mathlib.Tactic.Peel +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unital +public import Mathlib.Analysis.Complex.Basic /-! # Conditions on unitary elements imposed by the continuous functional calculus @@ -16,6 +18,8 @@ import Mathlib.Analysis.Complex.Basic -/ +@[expose] public section + section Generic variable {R A : Type*} {p : A → Prop} [CommRing R] [StarRing R] [MetricSpace R] diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousLinearMap.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousLinearMap.lean index e1a7aacd09ffa7..77d744c5ec5642 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousLinearMap.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousLinearMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.InnerProductSpace.Adjoint +module + +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.InnerProductSpace.Adjoint /-! # `E →L[ℂ] E` as a C⋆-algebra @@ -12,6 +14,8 @@ We place this here because, for reasons related to the import hierarchy, it shou in earlier files. -/ +@[expose] public section + noncomputable instance {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] : CStarAlgebra (E →L[ℂ] E) where diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousMap.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousMap.lean index bcd319fcc6c0b0..5addb29fa05ee6 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousMap.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Topology.ContinuousMap.Compact -import Mathlib.Topology.ContinuousMap.ZeroAtInfty +module + +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Topology.ContinuousMap.Compact +public import Mathlib.Topology.ContinuousMap.ZeroAtInfty /-! # C⋆-algebras of continuous functions @@ -13,6 +15,8 @@ We place these here because, for reasons related to the import hierarchy, they c earlier files. -/ +@[expose] public section + variable {α A : Type*} noncomputable section diff --git a/Mathlib/Analysis/CStarAlgebra/Exponential.lean b/Mathlib/Analysis/CStarAlgebra/Exponential.lean index 860c4b1769bd72..c0abf9e7be4eea 100644 --- a/Mathlib/Analysis/CStarAlgebra/Exponential.lean +++ b/Mathlib/Analysis/CStarAlgebra/Exponential.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Normed.Algebra.Exponential +module + +public import Mathlib.Analysis.Normed.Algebra.Exponential /-! # The exponential map from selfadjoint to unitary In this file, we establish various properties related to the map @@ -18,6 +20,8 @@ In this file, we establish various properties related to the map unitaries. -/ +@[expose] public section + open NormedSpace -- For `NormedSpace.exp`. section Star diff --git a/Mathlib/Analysis/CStarAlgebra/GelfandDuality.lean b/Mathlib/Analysis/CStarAlgebra/GelfandDuality.lean index 92969945b2445b..9216d11b20bd59 100644 --- a/Mathlib/Analysis/CStarAlgebra/GelfandDuality.lean +++ b/Mathlib/Analysis/CStarAlgebra/GelfandDuality.lean @@ -3,15 +3,17 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Spectrum -import Mathlib.Analysis.CStarAlgebra.ContinuousMap -import Mathlib.Analysis.Normed.Group.Quotient -import Mathlib.Analysis.Normed.Algebra.Basic -import Mathlib.Topology.ContinuousMap.Units -import Mathlib.Topology.ContinuousMap.Compact -import Mathlib.Topology.Algebra.Algebra -import Mathlib.Topology.ContinuousMap.Ideals -import Mathlib.Topology.ContinuousMap.StoneWeierstrass +module + +public import Mathlib.Analysis.CStarAlgebra.Spectrum +public import Mathlib.Analysis.CStarAlgebra.ContinuousMap +public import Mathlib.Analysis.Normed.Group.Quotient +public import Mathlib.Analysis.Normed.Algebra.Basic +public import Mathlib.Topology.ContinuousMap.Units +public import Mathlib.Topology.ContinuousMap.Compact +public import Mathlib.Topology.Algebra.Algebra +public import Mathlib.Topology.ContinuousMap.Ideals +public import Mathlib.Topology.ContinuousMap.StoneWeierstrass /-! # Gelfand Duality @@ -61,6 +63,8 @@ Then `η₁ : id → F ∘ G := gelfandStarTransform` and Gelfand transform, character space, C⋆-algebra -/ +@[expose] public section + open WeakDual diff --git a/Mathlib/Analysis/CStarAlgebra/Hom.lean b/Mathlib/Analysis/CStarAlgebra/Hom.lean index 5b00083cad5f48..4feb36c2894104 100644 --- a/Mathlib/Analysis/CStarAlgebra/Hom.lean +++ b/Mathlib/Analysis/CStarAlgebra/Hom.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order /-! # Properties of C⋆-algebra homomorphisms @@ -16,6 +17,8 @@ Here we collect properties of C⋆-algebra homomorphisms. is isometric. -/ +@[expose] public section + open CStarAlgebra in lemma IsSelfAdjoint.map_spectrum_real {F A B : Type*} [CStarAlgebra A] [CStarAlgebra B] [FunLike F A B] [AlgHomClass F ℂ A B] [StarHomClass F A B] diff --git a/Mathlib/Analysis/CStarAlgebra/Matrix.lean b/Mathlib/Analysis/CStarAlgebra/Matrix.lean index ed781d3ae21473..62d536a1fcb069 100644 --- a/Mathlib/Analysis/CStarAlgebra/Matrix.lean +++ b/Mathlib/Analysis/CStarAlgebra/Matrix.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Hans Parshall. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hans Parshall -/ -import Mathlib.Analysis.InnerProductSpace.Adjoint -import Mathlib.Analysis.Matrix.Normed -import Mathlib.Analysis.RCLike.Basic -import Mathlib.LinearAlgebra.UnitaryGroup -import Mathlib.Topology.UniformSpace.Matrix +module + +public import Mathlib.Analysis.InnerProductSpace.Adjoint +public import Mathlib.Analysis.Matrix.Normed +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.LinearAlgebra.UnitaryGroup +public import Mathlib.Topology.UniformSpace.Matrix /-! # Analytic properties of the `star` operation on matrices @@ -36,6 +38,8 @@ coincide with the existing topology and uniformity on matrices. -/ +@[expose] public section + open WithLp open scoped Matrix diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Constructions.lean b/Mathlib/Analysis/CStarAlgebra/Module/Constructions.lean index e1f21fc558d464..08b49015338e4e 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Constructions.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Constructions.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Module.Defs -import Mathlib.Analysis.CStarAlgebra.Module.Synonym -import Mathlib.Topology.MetricSpace.Bilipschitz +module + +public import Mathlib.Analysis.CStarAlgebra.Module.Defs +public import Mathlib.Analysis.CStarAlgebra.Module.Synonym +public import Mathlib.Topology.MetricSpace.Bilipschitz /-! # Constructions of Hilbert C⋆-modules @@ -56,6 +58,8 @@ and then replace the uniformity and bornology with the correct ones. -/ +@[expose] public section + open CStarModule CStarRing namespace WithCStarModule diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean b/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean index 1216f436fbce73..00ef86104873ec 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order /-! # Hilbert C⋆-modules @@ -55,6 +56,8 @@ then an `InnerProductSpace` over `ℂ`. December 2022. Master's thesis, Southern Illinois University Edwardsville. -/ +@[expose] public section + open scoped ComplexOrder RightActions /-- A *Hilbert C⋆-module* is a complex module `E` endowed with a right `A`-module structure diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean index ddd5b8bf7548fe..15b240839fdd91 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.Topology.Bornology.Constructions -import Mathlib.Topology.UniformSpace.Equiv -import Mathlib.Topology.Algebra.Module.Equiv -import Mathlib.Topology.Algebra.IsUniformGroup.Constructions +module + +public import Mathlib.RingTheory.Finiteness.Defs +public import Mathlib.Topology.Bornology.Constructions +public import Mathlib.Topology.UniformSpace.Equiv +public import Mathlib.Topology.Algebra.Module.Equiv +public import Mathlib.Topology.Algebra.IsUniformGroup.Constructions /-! # Type synonym for types with a `CStarModule` structure @@ -48,6 +50,8 @@ The pattern here is the same one as is used by `Lex` for order structures; it av separate synonym for each type, and allows all the structure-copying code to be shared. -/ +@[expose] public section + set_option linter.unusedVariables false in /-- A type synonym for endowing a given type with a `CStarModule` structure. This has the scoped notation `C⋆ᵐᵒᵈ`. -/ diff --git a/Mathlib/Analysis/CStarAlgebra/Multiplier.lean b/Mathlib/Analysis/CStarAlgebra/Multiplier.lean index ca79a0c018b1ac..5614f4b1e7221a 100644 --- a/Mathlib/Analysis/CStarAlgebra/Multiplier.lean +++ b/Mathlib/Analysis/CStarAlgebra/Multiplier.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux, Jon Bannon -/ -import Mathlib.Analysis.CStarAlgebra.Unitization -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +module + +public import Mathlib.Analysis.CStarAlgebra.Unitization +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal /-! # Multiplier Algebra of a C⋆-algebra @@ -52,6 +54,8 @@ separately. + Show that if `A` is unital, then `A ≃⋆ₐ[𝕜] 𝓜(𝕜, A)`. -/ +@[expose] public section + open NNReal ENNReal ContinuousLinearMap MulOpposite diff --git a/Mathlib/Analysis/CStarAlgebra/PositiveLinearMap.lean b/Mathlib/Analysis/CStarAlgebra/PositiveLinearMap.lean index 0ccc3f2faf912a..6d6aa91b66105a 100644 --- a/Mathlib/Analysis/CStarAlgebra/PositiveLinearMap.lean +++ b/Mathlib/Analysis/CStarAlgebra/PositiveLinearMap.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Algebra.Order.Module.PositiveLinearMap -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order -import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart +public import Mathlib.Algebra.Order.Module.PositiveLinearMap +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart /-! # Positive linear maps in C⋆-algebras @@ -24,6 +25,8 @@ This file develops the API for positive linear maps over C⋆-algebras. https://math.stackexchange.com/questions/426487/why-is-every-positive-linear-map-between-c-algebras-bounded -/ +@[expose] public section + open scoped NNReal variable {A₁ A₂ B₁ B₂ : Type*} diff --git a/Mathlib/Analysis/CStarAlgebra/Projection.lean b/Mathlib/Analysis/CStarAlgebra/Projection.lean index 5f26c7d75f5409..93076e1b287294 100644 --- a/Mathlib/Analysis/CStarAlgebra/Projection.lean +++ b/Mathlib/Analysis/CStarAlgebra/Projection.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances /-! @@ -16,6 +18,8 @@ elements in non-unital C⋆-algebras. -/ +@[expose] public section + variable {A : Type*} [TopologicalSpace A] [NonUnitalRing A] [StarRing A] [Module ℂ A] [IsScalarTower ℂ A A] [SMulCommClass ℂ A A] [NonUnitalContinuousFunctionalCalculus ℂ A IsStarNormal] diff --git a/Mathlib/Analysis/CStarAlgebra/SpecialFunctions/PosPart.lean b/Mathlib/Analysis/CStarAlgebra/SpecialFunctions/PosPart.lean index 720e03b16db01e..1fac0a4282ad4b 100644 --- a/Mathlib/Analysis/CStarAlgebra/SpecialFunctions/PosPart.lean +++ b/Mathlib/Analysis/CStarAlgebra/SpecialFunctions/PosPart.lean @@ -3,11 +3,15 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Isometric -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Isometric +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic /-! # C⋆-algebraic facts about `a⁺` and `a⁻`. -/ +@[expose] public section + variable {A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] [StarOrderedRing A] namespace CStarAlgebra diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index 52564b697af703..da002d043df00e 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Unitization -import Mathlib.Analysis.Complex.Convex -import Mathlib.Analysis.Normed.Algebra.GelfandFormula -import Mathlib.Analysis.SpecialFunctions.Exponential -import Mathlib.Algebra.Star.StarAlgHom +module + +public import Mathlib.Analysis.CStarAlgebra.Unitization +public import Mathlib.Analysis.Complex.Convex +public import Mathlib.Analysis.Normed.Algebra.GelfandFormula +public import Mathlib.Analysis.SpecialFunctions.Exponential +public import Mathlib.Algebra.Star.StarAlgHom /-! # Spectral properties in C⋆-algebras @@ -53,6 +55,8 @@ we can still establish a form of spectral permanence. -/ +@[expose] public section + local notation "σ" => spectrum local postfix:max "⋆" => star diff --git a/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean b/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean index bdf9921160d239..58e1eb6846571d 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Continuity -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order -import Mathlib.Analysis.CStarAlgebra.Exponential -import Mathlib.Analysis.SpecialFunctions.Complex.Circle -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Continuity +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.Exponential +public import Mathlib.Analysis.SpecialFunctions.Complex.Circle +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog.Basic /-! # The unitary group in a unital C⋆-algebra is locally path connected @@ -51,6 +53,8 @@ products of exponential unitaries. selfadjoint elements. -/ +@[expose] public section + variable {A : Type*} [CStarAlgebra A] open Complex Metric NormedSpace selfAdjoint Unitary @@ -64,7 +68,7 @@ lemma Unitary.two_mul_one_sub_le_norm_sub_one_sq {u : A} (hu : u ∈ unitary A) simp only [mem_sphere_iff_norm, sub_zero] at this rw [← cfc_id' ℂ u, ← cfc_one ℂ u, ← cfc_sub ..] convert norm_apply_le_norm_cfc (fun z ↦ z - 1) u hz - simpa using congr(Real.sqrt $(norm_sub_one_sq_eq_of_norm_one this)).symm + simpa using congr(Real.sqrt $(norm_sub_one_sq_eq_of_norm_eq_one this)).symm @[deprecated (since := "2025-10-29")] alias unitary.two_mul_one_sub_le_norm_sub_one_sq := Unitary.two_mul_one_sub_le_norm_sub_one_sq diff --git a/Mathlib/Analysis/CStarAlgebra/Unitary/Span.lean b/Mathlib/Analysis/CStarAlgebra/Unitary/Span.lean index 4ac9aa72383f18..466b31d21724f0 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitary/Span.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitary/Span.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unitary -import Mathlib.Analysis.NormedSpace.Normalize +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unitary +public import Mathlib.Analysis.NormedSpace.Normalize /-! # Unitary elements span C⋆-algebras @@ -16,6 +18,8 @@ import Mathlib.Analysis.NormedSpace.Normalize + `CStarAlgebra.span_unitary`: a unital C⋆-algebra is spanned by its unitary elements. -/ +@[expose] public section + variable {A : Type*} [CStarAlgebra A] open scoped ComplexStarModule diff --git a/Mathlib/Analysis/CStarAlgebra/Unitization.lean b/Mathlib/Analysis/CStarAlgebra/Unitization.lean index 4ac2df07198f5c..6e789d584bd5a7 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitization.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitization.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.Normed.Algebra.Unitization +module + +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.Normed.Algebra.Unitization /-! # The minimal unitization of a C⋆-algebra This file shows that when `E` is a C⋆-algebra (over a densely normed field `𝕜`), that the minimal @@ -16,6 +18,8 @@ involution is isometric, that multiplication on the right is also an isometry (i `Isometry (ContinuousLinearMap.mul 𝕜 E).flip`). -/ +@[expose] public section + open ContinuousLinearMap local postfix:max "⋆" => star diff --git a/Mathlib/Analysis/CStarAlgebra/lpSpace.lean b/Mathlib/Analysis/CStarAlgebra/lpSpace.lean index 4819de7d845885..05d9890d13eaf8 100644 --- a/Mathlib/Analysis/CStarAlgebra/lpSpace.lean +++ b/Mathlib/Analysis/CStarAlgebra/lpSpace.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.Normed.Lp.lpSpace +module + +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.Normed.Lp.lpSpace /-! # `lp ∞ A` as a C⋆-algebra We place these here because, for reasons related to the import hierarchy, they should not be placed in earlier files. -/ + +@[expose] public section open scoped ENNReal noncomputable section diff --git a/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean b/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean index ceda6dc2472160..666c111544356f 100644 --- a/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean +++ b/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Topology.Algebra.ContinuousAffineMap -import Mathlib.Analysis.Normed.Group.AddTorsor +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Topology.Algebra.ContinuousAffineMap +public import Mathlib.Analysis.Normed.Group.AddTorsor /-! # Smooth affine maps @@ -17,6 +19,8 @@ This file contains results about smoothness of affine maps. * `ContinuousAffineMap.contDiff`: a continuous affine map is smooth -/ + +@[expose] public section namespace ContinuousAffineMap variable {𝕜 V W : Type*} [NontriviallyNormedField 𝕜] diff --git a/Mathlib/Analysis/Calculus/AddTorsor/Coord.lean b/Mathlib/Analysis/Calculus/AddTorsor/Coord.lean index e35d6930847756..b429d5e6b3eb17 100644 --- a/Mathlib/Analysis/Calculus/AddTorsor/Coord.lean +++ b/Mathlib/Analysis/Calculus/AddTorsor/Coord.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Analysis.Calculus.AddTorsor.AffineMap -import Mathlib.Analysis.Normed.Affine.AddTorsorBases +module + +public import Mathlib.Analysis.Calculus.AddTorsor.AffineMap +public import Mathlib.Analysis.Normed.Affine.AddTorsorBases /-! # Barycentric coordinates are smooth -/ +@[expose] public section + variable {ι 𝕜 E P : Type*} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] variable [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable [MetricSpace P] [NormedAddTorsor E P] diff --git a/Mathlib/Analysis/Calculus/BumpFunction/Basic.lean b/Mathlib/Analysis/Calculus/BumpFunction/Basic.lean index d7fe4ad9f55322..c295ab7993c2b9 100644 --- a/Mathlib/Analysis/Calculus/BumpFunction/Basic.lean +++ b/Mathlib/Analysis/Calculus/BumpFunction/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Normed.Module.FiniteDimension +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Normed.Module.FiniteDimension /-! # Infinitely smooth "bump" functions @@ -46,6 +48,8 @@ such that smooth function, smooth bump function -/ + +@[expose] public section noncomputable section open Function Set Filter diff --git a/Mathlib/Analysis/Calculus/BumpFunction/Convolution.lean b/Mathlib/Analysis/Calculus/BumpFunction/Convolution.lean index 799ed4b4c6698a..fa95edb98a82de 100644 --- a/Mathlib/Analysis/Calculus/BumpFunction/Convolution.lean +++ b/Mathlib/Analysis/Calculus/BumpFunction/Convolution.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Analysis.Convolution -import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension -import Mathlib.Analysis.Calculus.BumpFunction.Normed -import Mathlib.MeasureTheory.Integral.Average -import Mathlib.MeasureTheory.Covering.Differentiation -import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.Analysis.Convolution +public import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension +public import Mathlib.Analysis.Calculus.BumpFunction.Normed +public import Mathlib.MeasureTheory.Integral.Average +public import Mathlib.MeasureTheory.Covering.Differentiation +public import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Convolution with a bump function @@ -37,6 +39,8 @@ We also provide estimates in the case if `g x` is close to `g x₀` on this ball convolution, smooth function, bump function -/ +@[expose] public section + universe uG uE' open ContinuousLinearMap Metric MeasureTheory Filter Function Measure Set diff --git a/Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean b/Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean index 8cc51fbb44f325..5cc96529235623 100644 --- a/Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean +++ b/Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.SmoothSeries -import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct -import Mathlib.Analysis.Convolution -import Mathlib.Analysis.InnerProductSpace.EuclideanDist -import Mathlib.Data.Set.Pointwise.Support -import Mathlib.MeasureTheory.Measure.Haar.NormedSpace -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.Analysis.Calculus.SmoothSeries +public import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct +public import Mathlib.Analysis.Convolution +public import Mathlib.Analysis.InnerProductSpace.EuclideanDist +public import Mathlib.Data.Set.Pointwise.Support +public import Mathlib.MeasureTheory.Measure.Haar.NormedSpace +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Bump functions in finite-dimensional vector spaces @@ -22,6 +24,8 @@ Then we use this construction to construct bump functions with nice behavior, by the indicator function of `closedBall 0 1` with a function as above with `s = ball 0 D`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/BumpFunction/InnerProduct.lean b/Mathlib/Analysis/Calculus/BumpFunction/InnerProduct.lean index 5a83219028362e..17c3db4b7d37a7 100644 --- a/Mathlib/Analysis/Calculus/BumpFunction/InnerProduct.lean +++ b/Mathlib/Analysis/Calculus/BumpFunction/InnerProduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.BumpFunction.Basic -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.SpecialFunctions.SmoothTransition +module + +public import Mathlib.Analysis.Calculus.BumpFunction.Basic +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.SpecialFunctions.SmoothTransition /-! # Smooth bump functions in inner product spaces @@ -18,6 +20,8 @@ see `hasContDiffBump_of_innerProductSpace`. smooth function, bump function, inner product space -/ +@[expose] public section + open Function Real open scoped Topology diff --git a/Mathlib/Analysis/Calculus/BumpFunction/Normed.lean b/Mathlib/Analysis/Calculus/BumpFunction/Normed.lean index b8426243a8b556..043548137f8327 100644 --- a/Mathlib/Analysis/Calculus/BumpFunction/Normed.lean +++ b/Mathlib/Analysis/Calculus/BumpFunction/Normed.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Analysis.Calculus.BumpFunction.Basic -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +module + +public import Mathlib.Analysis.Calculus.BumpFunction.Basic +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar /-! # Normed bump function @@ -14,6 +16,8 @@ In this file we define `ContDiffBump.normed f μ` to be the bump function `f` no `∫ x, f.normed μ x ∂μ = 1` and prove some properties of this function. -/ +@[expose] public section + noncomputable section open Function Filter Set Metric MeasureTheory Module Measure diff --git a/Mathlib/Analysis/Calculus/BumpFunction/SmoothApprox.lean b/Mathlib/Analysis/Calculus/BumpFunction/SmoothApprox.lean index cdd64ec3318f95..8af882ca47ad3c 100644 --- a/Mathlib/Analysis/Calculus/BumpFunction/SmoothApprox.lean +++ b/Mathlib/Analysis/Calculus/BumpFunction/SmoothApprox.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.BumpFunction.Convolution -import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension +module + +public import Mathlib.Analysis.Calculus.BumpFunction.Convolution +public import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension /-! # Density of smooth functions in the space of continuous functions @@ -19,6 +21,8 @@ and `HasCompactSupport.contDiff_convolution_left`. Here we wrap these results removing measure-related arguments from the assumptions. -/ +@[expose] public section + variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] {f : E → F} {ε : ℝ} diff --git a/Mathlib/Analysis/Calculus/Conformal/InnerProduct.lean b/Mathlib/Analysis/Calculus/Conformal/InnerProduct.lean index 6a4b7044ba5967..a99db219bd00e9 100644 --- a/Mathlib/Analysis/Calculus/Conformal/InnerProduct.lean +++ b/Mathlib/Analysis/Calculus/Conformal/InnerProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ -import Mathlib.Analysis.Calculus.Conformal.NormedSpace -import Mathlib.Analysis.InnerProductSpace.ConformalLinearMap +module + +public import Mathlib.Analysis.Calculus.Conformal.NormedSpace +public import Mathlib.Analysis.InnerProductSpace.ConformalLinearMap /-! # Conformal maps between inner product spaces @@ -13,6 +15,8 @@ A function between inner product spaces which has a derivative at `x` is conformal at `x` iff the derivative preserves inner products up to a scalar multiple. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/Conformal/NormedSpace.lean b/Mathlib/Analysis/Calculus/Conformal/NormedSpace.lean index fdb955faa223e9..96c8c91f6e8ebb 100644 --- a/Mathlib/Analysis/Calculus/Conformal/NormedSpace.lean +++ b/Mathlib/Analysis/Calculus/Conformal/NormedSpace.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Const -import Mathlib.Analysis.Normed.Operator.Conformal +module + +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Const +public import Mathlib.Analysis.Normed.Operator.Conformal /-! # Conformal Maps @@ -40,6 +42,8 @@ The definition of conformality in this file does NOT require the maps to be orie Maps such as the complex conjugate are considered to be conformal. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/ContDiff/Basic.lean b/Mathlib/Analysis/Calculus/ContDiff/Basic.lean index 9e9c74160794f7..57aa806c8c3831 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/Basic.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.ContDiff.Defs -import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.CompCLM +module + +public import Mathlib.Analysis.Calculus.ContDiff.Defs +public import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.CompCLM /-! # Higher differentiability of composition @@ -32,6 +34,8 @@ In this file, we denote `(⊤ : ℕ∞) : WithTop ℕ∞` with `∞` and `⊤ : derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor series, formal series -/ +@[expose] public section + noncomputable section open scoped NNReal Nat ContDiff diff --git a/Mathlib/Analysis/Calculus/ContDiff/Bounds.lean b/Mathlib/Analysis/Calculus/ContDiff/Bounds.lean index f66e876aea32a0..c28266852451b7 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/Bounds.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/Bounds.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Nat.Choose.Cast -import Mathlib.Data.Nat.Choose.Multinomial +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Nat.Choose.Cast +public import Mathlib.Data.Nat.Choose.Multinomial /-! # Bounds on higher derivatives @@ -16,6 +18,8 @@ import Mathlib.Data.Nat.Choose.Multinomial derivative of `f` is bounded by `D ^ i`. -/ +@[expose] public section + noncomputable section open scoped NNReal Nat diff --git a/Mathlib/Analysis/Calculus/ContDiff/CPolynomial.lean b/Mathlib/Analysis/Calculus/ContDiff/CPolynomial.lean index 75ba4b2e775a74..234aa2918350e4 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/CPolynomial.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/CPolynomial.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.ContDiff.Defs +module + +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.ContDiff.Defs /-! # Higher smoothness of continuously polynomial functions @@ -13,6 +15,8 @@ We prove that continuously polynomial functions are `C^∞`. In particular, this of continuous multilinear maps. -/ +@[expose] public section + open Filter Asymptotics open scoped ENNReal diff --git a/Mathlib/Analysis/Calculus/ContDiff/Defs.lean b/Mathlib/Analysis/Calculus/ContDiff/Defs.lean index fc6e4f7b37a7f3..ef7b29d69c80e5 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/Defs.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Analytic.Within -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries +module + +public import Mathlib.Analysis.Analytic.Within +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries /-! # Higher differentiability @@ -94,6 +96,8 @@ These notations are scoped in `ContDiff`. derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor series, formal series -/ +@[expose] public section + noncomputable section open Set Fin Filter Function diff --git a/Mathlib/Analysis/Calculus/ContDiff/FTaylorSeries.lean b/Mathlib/Analysis/Calculus/ContDiff/FTaylorSeries.lean index 39059812b8d804..1a8f14e540d8a4 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/FTaylorSeries.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/FTaylorSeries.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Calculus.FormalMultilinearSeries -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Calculus.FormalMultilinearSeries +public import Mathlib.Data.ENat.Lattice /-! # Iterated derivatives of a function @@ -99,6 +101,8 @@ values in `F`. This is the space in which the `n`-th derivative of a function fr In this file, we denote `⊤ : ℕ∞` with `∞`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean b/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean index 244db9a93604f4..bdf8e0685e1056 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Finite.Card -import Mathlib.Analysis.Analytic.Within -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries +module + +public import Mathlib.Data.Finite.Card +public import Mathlib.Analysis.Analytic.Within +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries /-! # Faa di Bruno formula @@ -75,6 +77,8 @@ and `OrderedFinpartition (n + 1)`. This equivalence shows up prominently in the of Faa di Bruno formula to identify the sums that show up. -/ +@[expose] public section + noncomputable section open Set Fin Filter Function diff --git a/Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean b/Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean index 268ae4fa9aaa99..895bb42a5cb787 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Normed.Module.FiniteDimension +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Normed.Module.FiniteDimension /-! # Higher differentiability in finite dimensions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/ContDiff/Operations.lean b/Mathlib/Analysis/Calculus/ContDiff/Operations.lean index 9f68b6c92ae343..fb58ff5d4587ad 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/Operations.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/Operations.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.Deriv.Inverse +module + +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.Deriv.Inverse /-! # Higher differentiability of usual operations @@ -24,6 +26,8 @@ In this file, we denote `(⊤ : ℕ∞) : WithTop ℕ∞` with `∞` and `⊤ : derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor series, formal series -/ +@[expose] public section + open scoped NNReal Nat ContDiff universe u uE uF uG diff --git a/Mathlib/Analysis/Calculus/ContDiff/RCLike.lean b/Mathlib/Analysis/Calculus/ContDiff/RCLike.lean index 82243a13be9ebe..a98ea27cbaf7c6 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/RCLike.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/RCLike.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.ContDiff.Defs -import Mathlib.Analysis.Calculus.MeanValue +module + +public import Mathlib.Analysis.Calculus.ContDiff.Defs +public import Mathlib.Analysis.Calculus.MeanValue /-! # Higher differentiability over `ℝ` or `ℂ` -/ +@[expose] public section + noncomputable section open Set Fin Filter Function diff --git a/Mathlib/Analysis/Calculus/ContDiff/RestrictScalars.lean b/Mathlib/Analysis/Calculus/ContDiff/RestrictScalars.lean index 9103c77d354c39..89712751f9b1e2 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/RestrictScalars.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/RestrictScalars.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Calculus.ContDiff.Defs -import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars +module + +public import Mathlib.Analysis.Calculus.ContDiff.Defs +public import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars /-! ### Restricting Scalars in Iterated Fréchet Derivatives @@ -15,6 +17,8 @@ a subfield `𝕜 ⊆ 𝕜'`. The results are analogous to those found in `Mathlib.Analysis.Calculus.FDeriv.RestrictScalars`. -/ +@[expose] public section + variable {𝕜 𝕜' : Type*} [NontriviallyNormedField 𝕜] [NontriviallyNormedField 𝕜'] [NormedAlgebra 𝕜 𝕜'] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedSpace 𝕜' E] [IsScalarTower 𝕜 𝕜' E] diff --git a/Mathlib/Analysis/Calculus/ContDiff/WithLp.lean b/Mathlib/Analysis/Calculus/ContDiff/WithLp.lean index d0adbd66923c8c..cbc1fd09371e5a 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/WithLp.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/WithLp.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Eric Wieser -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Normed.Lp.PiLp +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Normed.Lp.PiLp /-! # Derivatives on `WithLp` -/ +@[expose] public section + open scoped ENNReal section PiLp diff --git a/Mathlib/Analysis/Calculus/DSlope.lean b/Mathlib/Analysis/Calculus/DSlope.lean index a819dd5bb9676d..a338dfa6862c4f 100644 --- a/Mathlib/Analysis/Calculus/DSlope.lean +++ b/Mathlib/Analysis/Calculus/DSlope.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Mul +module + +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Mul /-! # Slope of a differentiable function @@ -19,6 +21,8 @@ In this file we define `dslope` and prove some basic lemmas about its continuity differentiability. -/ +@[expose] public section + open scoped Topology Filter open Function Set Filter diff --git a/Mathlib/Analysis/Calculus/Darboux.lean b/Mathlib/Analysis/Calculus/Darboux.lean index e99b3d6cff269a..5387a3dba640f8 100644 --- a/Mathlib/Analysis/Calculus/Darboux.lean +++ b/Mathlib/Analysis/Calculus/Darboux.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.LocalExtr.Basic +module + +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.LocalExtr.Basic /-! # Darboux's theorem @@ -15,6 +17,8 @@ intermediate values. The proof is based on the [Wikipedia](https://en.wikipedia.org/wiki/Darboux%27s_theorem_(analysis)) page about this theorem. -/ +@[expose] public section + open Filter Set open scoped Topology diff --git a/Mathlib/Analysis/Calculus/Deriv/Abs.lean b/Mathlib/Analysis/Calculus/Deriv/Abs.lean index 747e319813e695..0425e8420ba1f9 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Abs.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Abs.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.InnerProductSpace.Calculus +module + +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.InnerProductSpace.Calculus /-! # Derivative of the absolute value @@ -18,6 +20,8 @@ from an inner product space. absolute value, derivative -/ +@[expose] public section + open Filter Real Set variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] diff --git a/Mathlib/Analysis/Calculus/Deriv/Add.lean b/Mathlib/Analysis/Calculus/Deriv/Add.lean index d6e5e5ebac656f..a20fbcc0be71a1 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Add.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Add.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Sébastien Gouëzel, Yury Kudryashov, Anatole Dedecker -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Add +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Add /-! # One-dimensional derivatives of sums etc @@ -20,6 +22,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative -/ +@[expose] public section + universe u v w open scoped Topology Filter ENNReal diff --git a/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean b/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean index 0ff6e4aa7e268f..8d86f7f3949587 100644 --- a/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean +++ b/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.Linear -import Mathlib.LinearAlgebra.AffineSpace.AffineMap +module + +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.Linear +public import Mathlib.LinearAlgebra.AffineSpace.AffineMap /-! # Derivatives of affine maps @@ -23,6 +25,8 @@ Mathlib 4. affine map, derivative, differentiability -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] (f : 𝕜 →ᵃ[𝕜] E) {a b : E} {L : Filter 𝕜} {s : Set 𝕜} {x : 𝕜} diff --git a/Mathlib/Analysis/Calculus/Deriv/Basic.lean b/Mathlib/Analysis/Calculus/Deriv/Basic.lean index 45bc960cc41cb4..0207da6e2a778a 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Basic.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Const -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Analysis.Calculus.TangentCone.DimOne -import Mathlib.Analysis.Calculus.TangentCone.Real +module + +public import Mathlib.Analysis.Calculus.FDeriv.Const +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.Calculus.TangentCone.DimOne +public import Mathlib.Analysis.Calculus.TangentCone.Real /-! @@ -88,6 +90,8 @@ derivatives is the same as the one for differentiability statements, as explaine `FDeriv/Basic.lean`. See the explanations there. -/ +@[expose] public section + universe u v w noncomputable section diff --git a/Mathlib/Analysis/Calculus/Deriv/Comp.lean b/Mathlib/Analysis/Calculus/Deriv/Comp.lean index 2180926aea8f7d..2d71798dc53fb2 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Comp.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Comp.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Sébastien Gouëzel, Yury Kudryashov, Yuyang Zhao -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars /-! # One-dimensional derivatives of compositions of functions @@ -31,6 +33,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, chain rule -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Analysis/Calculus/Deriv/CompMul.lean b/Mathlib/Analysis/Calculus/Deriv/CompMul.lean index 3a1cff6c19da7a..997accb82107ef 100644 --- a/Mathlib/Analysis/Calculus/Deriv/CompMul.lean +++ b/Mathlib/Analysis/Calculus/Deriv/CompMul.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Calculus.Deriv.Mul +module + +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Calculus.Deriv.Mul /-! # Derivative of `x ↦ f (cx)` @@ -17,6 +19,8 @@ the theorems in this file require neither differentiability of `f`, nor assumptions like `UniqueDiffWithinAt 𝕜 s x`. -/ +@[expose] public section + open Set open scoped Pointwise diff --git a/Mathlib/Analysis/Calculus/Deriv/Inv.lean b/Mathlib/Analysis/Calculus/Deriv/Inv.lean index 251c95d0c64198..06c6d835b010cd 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Inv.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Inv.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Comp +module + +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Comp /-! # Derivatives of `x ↦ x⁻¹` and `f x / g x` @@ -20,6 +22,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative -/ +@[expose] public section + universe u diff --git a/Mathlib/Analysis/Calculus/Deriv/Inverse.lean b/Mathlib/Analysis/Calculus/Deriv/Inverse.lean index 4f392121e4c442..ac67b8ec32da7b 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Inverse.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Inverse.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Equiv +module + +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Equiv /-! # Inverse function theorem - the easy half @@ -21,6 +23,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, inverse function -/ +@[expose] public section + universe u v @@ -105,8 +109,7 @@ either because it has derivative zero or because it isn't differentiable at this theorem derivWithin_zero_of_frequently_const {c} (h : ∃ᶠ y in 𝓝[s \ {x}] x, f y = c) : derivWithin f s x = 0 := by by_cases hf : DifferentiableWithinAt 𝕜 f s x - · contrapose h - rw [not_frequently] + · contrapose! h exact hf.hasDerivWithinAt.eventually_ne h · exact derivWithin_zero_of_not_differentiableWithinAt hf diff --git a/Mathlib/Analysis/Calculus/Deriv/Linear.lean b/Mathlib/Analysis/Calculus/Deriv/Linear.lean index e88464c3aba100..607cdff943267c 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Linear.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Linear +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Linear /-! # Derivatives of continuous linear maps from the base field @@ -19,6 +21,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, linear map -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean b/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean index 94f332dad3ec5a..3478cee6233249 100644 --- a/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean +++ b/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.AffineMap -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.Analysis.Calculus.LocalExtr.Rolle -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.Analysis.Calculus.Deriv.AffineMap +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.Analysis.Calculus.LocalExtr.Rolle +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Analysis.RCLike.Basic /-! # Mean value theorem @@ -61,6 +63,8 @@ is not differentiable on the right at that point, and similarly differentiabilit -/ +@[expose] public section + open Set Function Filter open scoped Topology diff --git a/Mathlib/Analysis/Calculus/Deriv/Mul.lean b/Mathlib/Analysis/Calculus/Deriv/Mul.lean index 4bd10dcc4f6c7e..6541ac94b36bc0 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Mul.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Mul.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Anatole Dedecker, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Mul -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.CompCLM +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Mul +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.CompCLM /-! # Derivative of `f x * g x` @@ -21,6 +23,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, multiplication -/ +@[expose] public section + universe u v w noncomputable section diff --git a/Mathlib/Analysis/Calculus/Deriv/Pi.lean b/Mathlib/Analysis/Calculus/Deriv/Pi.lean index ea735b8e03a989..48419570560f5a 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Pi.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Pi.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Analysis.Calculus.FDeriv.Pi -import Mathlib.Analysis.Calculus.Deriv.Basic +module + +public import Mathlib.Analysis.Calculus.FDeriv.Pi +public import Mathlib.Analysis.Calculus.Deriv.Basic /-! # One-dimensional derivatives on pi-types. -/ +@[expose] public section + variable {𝕜 ι : Type*} [DecidableEq ι] [Fintype ι] [NontriviallyNormedField 𝕜] theorem hasDerivAt_update (x : ι → 𝕜) (i : ι) (y : 𝕜) : diff --git a/Mathlib/Analysis/Calculus/Deriv/Polynomial.lean b/Mathlib/Analysis/Calculus/Deriv/Polynomial.lean index 02852d7b876e42..2fca55eaaaa91f 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Polynomial.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Polynomial.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Eric Wieser -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Pow -import Mathlib.Analysis.Calculus.Deriv.Add +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Pow +public import Mathlib.Analysis.Calculus.Deriv.Add /-! # Derivatives of polynomials @@ -28,6 +30,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, polynomial -/ +@[expose] public section + universe u diff --git a/Mathlib/Analysis/Calculus/Deriv/Pow.lean b/Mathlib/Analysis/Calculus/Deriv/Pow.lean index f476ebac19be09..613a436c501b1d 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Pow.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Pow.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Pow +module + +public import Mathlib.Analysis.Calculus.FDeriv.Pow /-! # Derivative of `(f x) ^ n`, `n : ℕ` @@ -21,6 +23,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, power -/ +@[expose] public section + variable {𝕜 𝔸 : Type*} section NormedRing diff --git a/Mathlib/Analysis/Calculus/Deriv/Prod.lean b/Mathlib/Analysis/Calculus/Deriv/Prod.lean index e09ff68539a87a..3d09c5acd97770 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Prod.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Yury Kudryashov, Eric Wieser -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Prod +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Prod /-! # Derivatives of functions taking values in product types @@ -20,6 +22,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative -/ +@[expose] public section + universe u v w open Topology Filter Asymptotics Set diff --git a/Mathlib/Analysis/Calculus/Deriv/Shift.lean b/Mathlib/Analysis/Calculus/Deriv/Shift.lean index 5f3cf8994feb79..bc94fe6f157d81 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Shift.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Shift.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll, Yaël Dillies -/ -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.Deriv.CompMul +module + +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.Deriv.CompMul /-! ### Invariance of the derivative under translation @@ -14,6 +16,8 @@ We show that if a function `f` has derivative `f'` at a point `a + x`, then `f ( has derivative `f'` at `x`. Similarly for `x + a`. -/ +@[expose] public section + open scoped Pointwise variable {𝕜 F : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup F] [NormedSpace 𝕜 F] diff --git a/Mathlib/Analysis/Calculus/Deriv/Slope.lean b/Mathlib/Analysis/Calculus/Deriv/Slope.lean index a13669e8671d1d..cfc0f4b02ff07d 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Slope.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Slope.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.LinearAlgebra.AffineSpace.Slope -import Mathlib.Topology.Algebra.Module.PerfectSpace +module + +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.LinearAlgebra.AffineSpace.Slope +public import Mathlib.Topology.Algebra.Module.PerfectSpace /-! # Derivative as the limit of the slope @@ -25,6 +27,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, slope -/ +@[expose] public section + universe u v open scoped Topology diff --git a/Mathlib/Analysis/Calculus/Deriv/Star.lean b/Mathlib/Analysis/Calculus/Deriv/Star.lean index 1d41e13699c016..7f810ffd692f1c 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Star.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Star.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Star +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Star /-! # Star operations on derivatives @@ -18,6 +20,8 @@ trivial star operation; which as should be expected rules out `𝕜 = ℂ`. The differentiable when `f` is (and giving a formula for its derivative). -/ +@[expose] public section + universe u v w variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] [StarRing 𝕜] diff --git a/Mathlib/Analysis/Calculus/Deriv/Support.lean b/Mathlib/Analysis/Calculus/Deriv/Support.lean index 87665519af4ef8..4db449c235d1e8 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Support.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Support.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Analysis.Calculus.Deriv.Basic +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic /-! # Support of the derivative of a function @@ -17,6 +19,8 @@ compact support. derivative, support -/ +@[expose] public section + universe u v diff --git a/Mathlib/Analysis/Calculus/Deriv/ZPow.lean b/Mathlib/Analysis/Calculus/Deriv/ZPow.lean index fe57305e5926c2..756e3822e74306 100644 --- a/Mathlib/Analysis/Calculus/Deriv/ZPow.lean +++ b/Mathlib/Analysis/Calculus/Deriv/ZPow.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Pow -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.Calculus.Deriv.Shift +module + +public import Mathlib.Analysis.Calculus.Deriv.Pow +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.Calculus.Deriv.Shift /-! # Derivatives of `x ^ m`, `m : ℤ` @@ -20,6 +22,8 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the derivative, power -/ +@[expose] public section + universe u v w open Topology Filter Asymptotics Set diff --git a/Mathlib/Analysis/Calculus/DerivativeTest.lean b/Mathlib/Analysis/Calculus/DerivativeTest.lean index 91d08de4c13dd3..1d234e796fcbb8 100644 --- a/Mathlib/Analysis/Calculus/DerivativeTest.lean +++ b/Mathlib/Analysis/Calculus/DerivativeTest.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Bjørn Kjos-Hanssen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bjørn Kjos-Hanssen, Patrick Massot, Floris van Doorn, Jireh Loreaux, Eric Wieser -/ -import Mathlib.Topology.Order.OrderClosedExtr -import Mathlib.Analysis.Calculus.Deriv.MeanValue -import Mathlib.Order.Interval.Set.Basic -import Mathlib.LinearAlgebra.AffineSpace.Ordered +module + +public import Mathlib.Topology.Order.OrderClosedExtr +public import Mathlib.Analysis.Calculus.Deriv.MeanValue +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Ordered /-! # The First- and Second-Derivative Tests @@ -44,6 +46,8 @@ Source: [Wikipedia](https://en.wikipedia.org/wiki/Derivative_test#Proof_of_the_s derivative test, first-derivative test, second-derivative test, calculus -/ +@[expose] public section + open Set Topology diff --git a/Mathlib/Analysis/Calculus/DiffContOnCl.lean b/Mathlib/Analysis/Calculus/DiffContOnCl.lean index 75471d4d094d1f..3ef60c91409e07 100644 --- a/Mathlib/Analysis/Calculus/DiffContOnCl.lean +++ b/Mathlib/Analysis/Calculus/DiffContOnCl.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.RCLike.Real -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Mul +module + +public import Mathlib.Analysis.Normed.Module.RCLike.Real +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Mul /-! # Functions differentiable on a domain and continuous on its closure @@ -15,6 +17,8 @@ is continuous on its closure. In this file we define a predicate `DiffContOnCl` this property and prove basic facts about this predicate. -/ +@[expose] public section + open Set Filter Metric diff --git a/Mathlib/Analysis/Calculus/DifferentialForm/Basic.lean b/Mathlib/Analysis/Calculus/DifferentialForm/Basic.lean index e16cad008ecf2f..bf1868f73c32a6 100644 --- a/Mathlib/Analysis/Calculus/DifferentialForm/Basic.lean +++ b/Mathlib/Analysis/Calculus/DifferentialForm/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov, Sam Lindauer -/ -import Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin -import Mathlib.Analysis.Calculus.FDeriv.Symmetric -import Mathlib.Analysis.Calculus.FDeriv.CompCLM +module + +public import Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin +public import Mathlib.Analysis.Calculus.FDeriv.Symmetric +public import Mathlib.Analysis.Calculus.FDeriv.CompCLM /-! # Exterior derivative of a differential form on a normed space @@ -42,6 +44,8 @@ where $$\widehat{v_i}$$ means that we omit this element of the tuple, see `extDe sync with the API for `ContinuousMultilinearMap`. -/ +@[expose] public section + open Filter ContinuousAlternatingMap Set open scoped Topology diff --git a/Mathlib/Analysis/Calculus/FDeriv/Add.lean b/Mathlib/Analysis/Calculus/FDeriv/Add.lean index 4dcbdabd2be6f1..5bd379fe5cc09a 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Add.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Add.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Linear -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Const +module + +public import Mathlib.Analysis.Calculus.FDeriv.Linear +public import Mathlib.Analysis.Calculus.FDeriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Const /-! # Additive operations on derivatives @@ -21,6 +23,8 @@ This file contains the usual formulas (and existence assertions) for the derivat * subtraction of two functions -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap diff --git a/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean b/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean index ae722f0e31f357..1fa87f0983cdb1 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.CPolynomial -import Mathlib.Analysis.Analytic.Inverse -import Mathlib.Analysis.Analytic.Within -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Normed.Module.Completion +module + +public import Mathlib.Analysis.Analytic.CPolynomial +public import Mathlib.Analysis.Analytic.Inverse +public import Mathlib.Analysis.Analytic.Within +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Prod +public import Mathlib.Analysis.Normed.Module.Completion /-! # Fréchet derivatives of analytic functions. @@ -61,6 +63,8 @@ differentiability at points in a neighborhood of `s`. Therefore, the theorem tha -/ +@[expose] public section + open Filter Asymptotics Set open scoped ENNReal Topology @@ -604,7 +608,7 @@ theorem changeOrigin_toFormalMultilinearSeries [DecidableEq ι] : simp_rw [domDomCongr_apply, compContinuousLinearMap_apply, ContinuousLinearMap.proj_apply, Function.update_apply, (Equiv.injective _).eq_iff, ite_apply] congr - grind [Function.update_self, Function.update_of_ne] + grind protected theorem hasStrictFDerivAt [DecidableEq ι] : HasStrictFDerivAt f (f.linearDeriv x) x := by rw [← changeOrigin_toFormalMultilinearSeries] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Basic.lean b/Mathlib/Analysis/Calculus/FDeriv/Basic.lean index ac727f8d22489f..a402e8c3414eeb 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Basic.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Asymptotics.Lemmas -import Mathlib.Analysis.Calculus.FDeriv.Defs -import Mathlib.Analysis.Normed.Operator.Asymptotics -import Mathlib.Analysis.Calculus.TangentCone.Basic +module + +public import Mathlib.Analysis.Asymptotics.Lemmas +public import Mathlib.Analysis.Calculus.FDeriv.Defs +public import Mathlib.Analysis.Normed.Operator.Asymptotics +public import Mathlib.Analysis.Calculus.TangentCone.Basic /-! # The Fréchet derivative: basic properties @@ -106,6 +108,8 @@ derivative, differentiable, Fréchet, calculus -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal noncomputable section diff --git a/Mathlib/Analysis/Calculus/FDeriv/Bilinear.lean b/Mathlib/Analysis/Calculus/FDeriv/Bilinear.lean index 95d53bb0d512cb..914d64bb15393a 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Bilinear.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Bilinear.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Prod +module + +public import Mathlib.Analysis.Calculus.FDeriv.Prod /-! # The derivative of bounded bilinear maps @@ -15,6 +17,8 @@ This file contains the usual formulas (and existence assertions) for the derivat bounded bilinear maps. -/ +@[expose] public section + open Asymptotics Topology diff --git a/Mathlib/Analysis/Calculus/FDeriv/Comp.lean b/Mathlib/Analysis/Calculus/FDeriv/Comp.lean index cb4cbad61cb447..50f4b1b4ff61a2 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Comp.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Comp.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Basic +module + +public import Mathlib.Analysis.Calculus.FDeriv.Basic /-! # The derivative of a composition (chain rule) @@ -15,6 +17,8 @@ This file contains the usual formulas (and existence assertions) for the derivat composition of functions (the chain rule). -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal diff --git a/Mathlib/Analysis/Calculus/FDeriv/CompCLM.lean b/Mathlib/Analysis/Calculus/FDeriv/CompCLM.lean index 0c5cfa7d5edebb..ed467e4c220b5f 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/CompCLM.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/CompCLM.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Bilinear -import Mathlib.Analysis.NormedSpace.Alternating.Basic +module + +public import Mathlib.Analysis.Calculus.FDeriv.Bilinear +public import Mathlib.Analysis.NormedSpace.Alternating.Basic /-! # Multiplicative operations on derivatives @@ -18,6 +20,8 @@ This file contains the usual formulas (and existence assertions) for the derivat * application of continuous (multi)linear maps to a constant -/ +@[expose] public section + open Asymptotics ContinuousLinearMap Topology diff --git a/Mathlib/Analysis/Calculus/FDeriv/Congr.lean b/Mathlib/Analysis/Calculus/FDeriv/Congr.lean index 17f35e53379806..d841b8945b8eb6 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Congr.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Congr.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Basic +module + +public import Mathlib.Analysis.Calculus.FDeriv.Basic /-! # The Fréchet derivative: congruence properties @@ -16,6 +18,8 @@ derivative, differentiable, Fréchet, calculus -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal noncomputable section diff --git a/Mathlib/Analysis/Calculus/FDeriv/Const.lean b/Mathlib/Analysis/Calculus/FDeriv/Const.lean index c01cd71a802354..7514bc02629c8b 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Const.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Const.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Congr +module + +public import Mathlib.Analysis.Calculus.FDeriv.Congr /-! # Fréchet derivative of constant functions @@ -18,6 +20,8 @@ derivative, differentiable, Fréchet, calculus -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal noncomputable section diff --git a/Mathlib/Analysis/Calculus/FDeriv/ContinuousMultilinearMap.lean b/Mathlib/Analysis/Calculus/FDeriv/ContinuousMultilinearMap.lean index 730e9123b6f5eb..d725e476f81b81 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/ContinuousMultilinearMap.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/ContinuousMultilinearMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.FDeriv.CompCLM +module + +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.FDeriv.CompCLM /-! # Derivatives of operations on continuous multilinear maps @@ -36,6 +38,8 @@ All statements in the first section are claiming this, for various notions of di The second section deduces the corresponding differentiability results when `ι` is finite. -/ +@[expose] public section + variable {𝕜 ι E : Type*} {F G : ι → Type*} {H : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Defs.lean b/Mathlib/Analysis/Calculus/FDeriv/Defs.lean index 136c92de695c70..9ea7bbda1b425d 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Defs.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Asymptotics.TVS +module + +public import Mathlib.Analysis.Asymptotics.TVS /-! # The Fréchet derivative: definition @@ -78,6 +80,8 @@ derivative, differentiable, Fréchet, calculus -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Equiv.lean b/Mathlib/Analysis/Calculus/FDeriv/Equiv.lean index dd29bb990aeba2..c6d0ca6016c079 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Equiv.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Equiv.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Const -import Mathlib.Analysis.Calculus.FDeriv.Linear +module + +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.Calculus.FDeriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Const +public import Mathlib.Analysis.Calculus.FDeriv.Linear /-! # The derivative of a linear equivalence @@ -21,6 +23,8 @@ We also prove the usual formula for the derivative of the inverse function, assu The inverse function theorem is in `Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean`. -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal noncomputable section diff --git a/Mathlib/Analysis/Calculus/FDeriv/Extend.lean b/Mathlib/Analysis/Calculus/FDeriv/Extend.lean index 07321bf906d061..bd7c1e5224691c 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Extend.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Extend.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.MeanValue +module + +public import Mathlib.Analysis.Calculus.MeanValue /-! # Extending differentiability to the boundary @@ -18,6 +20,8 @@ the right endpoint of an interval, are given in `hasDerivWithinAt_Ici_of_tendsto one-dimensional derivative `deriv ℝ f`. -/ +@[expose] public section + variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Linear.lean b/Mathlib/Analysis/Calculus/FDeriv/Linear.lean index 7a7ffd50334e88..43842ab35c3fd9 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Linear.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Basic -import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +module + +public import Mathlib.Analysis.Calculus.FDeriv.Basic +public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps /-! # The derivative of bounded linear maps @@ -16,6 +18,8 @@ This file contains the usual formulas (and existence assertions) for the derivat bounded linear maps. -/ +@[expose] public section + open Asymptotics diff --git a/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean b/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean index c6d58ab4d720fb..cfdefb89fbefec 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable /-! # Derivative is measurable @@ -79,6 +81,8 @@ is exactly the set of points where `f` is differentiable with a derivative in `K derivative, measurable function, Borel σ-algebra -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/FDeriv/Mul.lean b/Mathlib/Analysis/Calculus/FDeriv/Mul.lean index 404234c5d7511b..352e7a1a1529ed 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Mul.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Mul.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.FDeriv.Bilinear +module + +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.FDeriv.Bilinear /-! # Multiplicative operations on derivatives @@ -20,6 +22,8 @@ This file contains the usual formulas (and existence assertions) for the derivat * taking the pointwise multiplicative inverse (i.e. `Inv.inv` or `Ring.inverse`) of a function -/ +@[expose] public section + open Asymptotics ContinuousLinearMap Topology diff --git a/Mathlib/Analysis/Calculus/FDeriv/Norm.lean b/Mathlib/Analysis/Calculus/FDeriv/Norm.lean index 87d84e7162dc94..90bf3eb9ffbb04 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Norm.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Norm.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Analysis.Calculus.Deriv.Abs -import Mathlib.Analysis.Calculus.LineDeriv.Basic +module + +public import Mathlib.Analysis.Calculus.Deriv.Abs +public import Mathlib.Analysis.Calculus.LineDeriv.Basic /-! # Differentiability of the norm in a real normed vector space @@ -35,6 +37,8 @@ differentiability, norm -/ +@[expose] public section + open ContinuousLinearMap Filter NNReal Real Set variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Pi.lean b/Mathlib/Analysis/Calculus/FDeriv/Pi.lean index 61192f5726f098..329c97258d087b 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Pi.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Pi.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Const +module + +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Const /-! # Derivatives on pi-types. -/ +@[expose] public section + variable {𝕜 ι : Type*} [DecidableEq ι] [Fintype ι] [NontriviallyNormedField 𝕜] variable {E : ι → Type*} [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Pow.lean b/Mathlib/Analysis/Calculus/FDeriv/Pow.lean index 069c05c7212246..614597aa8a20a4 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Pow.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Pow.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Calculus.FDeriv.Mul -import Mathlib.Analysis.Calculus.FDeriv.Comp +module + +public import Mathlib.Analysis.Calculus.FDeriv.Mul +public import Mathlib.Analysis.Calculus.FDeriv.Comp /-! # Fréchet Derivative of `f x ^ n`, `n : ℕ` @@ -22,6 +24,8 @@ see the module docstring of `Mathlib/Analysis/Calculus/FDeriv/Basic.lean`. derivative, power -/ +@[expose] public section + variable {𝕜 𝔸 E : Type*} section NormedRing diff --git a/Mathlib/Analysis/Calculus/FDeriv/Prod.lean b/Mathlib/Analysis/Calculus/FDeriv/Prod.lean index e8fd3775b4405c..569caed8bc6d46 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Prod.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov, Eric Wieser -/ -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Const -import Mathlib.Analysis.Calculus.FDeriv.Linear +module + +public import Mathlib.Analysis.Calculus.FDeriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Const +public import Mathlib.Analysis.Calculus.FDeriv.Linear /-! # Derivative of the Cartesian product of functions @@ -17,6 +19,8 @@ This file contains the usual formulas (and existence assertions) for the derivat Cartesian products of functions, and functions into Pi-types. -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal diff --git a/Mathlib/Analysis/Calculus/FDeriv/RestrictScalars.lean b/Mathlib/Analysis/Calculus/FDeriv/RestrictScalars.lean index 2848af5f190b4d..afd995b273e237 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/RestrictScalars.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/RestrictScalars.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Basic +module + +public import Mathlib.Analysis.Calculus.FDeriv.Basic /-! # The derivative of the scalar restriction of a linear map @@ -15,6 +17,8 @@ This file contains the usual formulas (and existence assertions) for the derivat the scalar restriction of a linear map. -/ +@[expose] public section + open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal diff --git a/Mathlib/Analysis/Calculus/FDeriv/Star.lean b/Mathlib/Analysis/Calculus/FDeriv/Star.lean index 411d39d48bff14..5dbfd578049fbc 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Star.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Star.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Calculus.FDeriv.Linear -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.CStarAlgebra.Basic -import Mathlib.Topology.Algebra.Module.Star +module + +public import Mathlib.Analysis.Calculus.FDeriv.Linear +public import Mathlib.Analysis.Calculus.FDeriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.CStarAlgebra.Basic +public import Mathlib.Topology.Algebra.Module.Star /-! # Star operations on derivatives @@ -22,6 +24,8 @@ trivial star operation; which as should be expected rules out `𝕜 = ℂ`. The differentiable when `f` is (and giving a formula for its derivative). -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [StarRing 𝕜] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] diff --git a/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean b/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean index a6f71894c69752..515e9d730b941e 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Analytic.IteratedFDeriv -import Mathlib.Analysis.Calculus.Deriv.Pow -import Mathlib.Analysis.Calculus.MeanValue -import Mathlib.Analysis.Calculus.ContDiff.Basic +module + +public import Mathlib.Analysis.Analytic.IteratedFDeriv +public import Mathlib.Analysis.Calculus.Deriv.Pow +public import Mathlib.Analysis.Calculus.MeanValue +public import Mathlib.Analysis.Calculus.ContDiff.Basic /-! # Symmetry of the second derivative @@ -60,6 +62,8 @@ when `v` and `w` both point towards the interior of `s`, to make sure that all t rectangle are contained in `s` by convexity. The general case follows by linearity, though. -/ +@[expose] public section + open Asymptotics Set Filter diff --git a/Mathlib/Analysis/Calculus/FDeriv/WithLp.lean b/Mathlib/Analysis/Calculus/FDeriv/WithLp.lean index bac2f643857c67..2febda4b384e6c 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/WithLp.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/WithLp.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Eric Wieser -/ -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Normed.Lp.PiLp +module + +public import Mathlib.Analysis.Calculus.FDeriv.Prod +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Normed.Lp.PiLp /-! # Derivatives on `WithLp` -/ +@[expose] public section + open ContinuousLinearMap PiLp WithLp section PiLp diff --git a/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean b/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean index 0dbf033e868465..f662a5d8ea752d 100644 --- a/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean +++ b/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.NormedSpace.Multilinear.Curry +module + +public import Mathlib.Analysis.NormedSpace.Multilinear.Curry /-! # Formal multilinear series @@ -22,6 +24,8 @@ values in `F`. This is the space in which the `n`-th derivative of a function fr multilinear, formal series -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/Gradient/Basic.lean b/Mathlib/Analysis/Calculus/Gradient/Basic.lean index 418a64aba6ca77..d9e17a983a46b3 100644 --- a/Mathlib/Analysis/Calculus/Gradient/Basic.lean +++ b/Mathlib/Analysis/Calculus/Gradient/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Ziyu Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ziyu Wang, Chenyi Li, Sébastien Gouëzel, Penghao Yu, Zhipeng Cao -/ -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.Calculus.FDeriv.Basic -import Mathlib.Analysis.Calculus.Deriv.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.Calculus.FDeriv.Basic +public import Mathlib.Analysis.Calculus.Deriv.Basic /-! # Gradient @@ -37,6 +39,8 @@ This file develops the following aspects of the theory of gradients: * the continuity of a function admitting a gradient. -/ +@[expose] public section + open Topology InnerProductSpace Function Set noncomputable section diff --git a/Mathlib/Analysis/Calculus/Implicit.lean b/Mathlib/Analysis/Calculus/Implicit.lean index f4bc983205b169..e71fe525858e84 100644 --- a/Mathlib/Analysis/Calculus/Implicit.lean +++ b/Mathlib/Analysis/Calculus/Implicit.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Normed.Module.Complemented +module + +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv +public import Mathlib.Analysis.Calculus.FDeriv.Add +public import Mathlib.Analysis.Calculus.FDeriv.Prod +public import Mathlib.Analysis.Normed.Module.Complemented /-! # Implicit function theorem @@ -44,6 +46,8 @@ and `f'.range = ⊤`. This version is named `HasStrictFDerivAt.implicitFunction` implicit function, inverse function -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean index 5bb706b518a4f5..3aed95b907db3c 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Operator.Banach -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Topology.OpenPartialHomeomorph +module + +public import Mathlib.Analysis.Normed.Operator.Banach +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Topology.OpenPartialHomeomorph /-! # Non-linear maps close to affine maps @@ -44,6 +46,8 @@ We introduce some `local notation` to make formulas shorter: `{x | f x = y}` is nonempty. -/ +@[expose] public section + open Function Set Filter Metric open scoped Topology NNReal diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ContDiff.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ContDiff.lean index 0b574a530f13a5..4fe358203d9b7a 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ContDiff.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ContDiff.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.ContDiff.RCLike -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.ContDiff.RCLike +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv /-! # Inverse function theorem, `C^r` case @@ -13,6 +15,8 @@ import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv In this file we specialize the inverse function theorem to `C^r`-smooth functions. -/ +@[expose] public section + noncomputable section namespace ContDiffAt diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/Deriv.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/Deriv.lean index be38e1e55e5cc5..1cbe4e1eae7a3e 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/Deriv.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/Deriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Inverse -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv +module + +public import Mathlib.Analysis.Calculus.Deriv.Inverse +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv /-! # Inverse function theorem, 1D case @@ -14,6 +16,8 @@ We use `ContinuousLinearEquiv.unitsEquivAut` to translate `HasStrictDerivAt f f' `f' ≠ 0` into `HasStrictFDerivAt f (_ : 𝕜 ≃L[𝕜] 𝕜) a`. -/ +@[expose] public section + open Filter open scoped Topology diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean index f0a4c87f3e3da9..34f2228c3d1667 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn +module + +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn /-! # Inverse function theorem @@ -38,6 +40,8 @@ folders, and in `ContDiff.lean`. derivative, strictly differentiable, continuously differentiable, smooth, inverse function -/ +@[expose] public section + open Function Set Filter Metric open scoped Topology NNReal diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean index 09f63bcf9f6d0d..84ea52b27a8adc 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn -import Mathlib.Analysis.Normed.Module.FiniteDimension +module + +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn +public import Mathlib.Analysis.Normed.Module.FiniteDimension /-! # A lemma about `ApproximatesLinearOn` that needs `FiniteDimensional` @@ -17,6 +19,8 @@ This used to be the only lemma in `Mathlib/Analysis/Calculus/Inverse` depending on `FiniteDimensional`, so it was moved to a new file when the original file got split. -/ +@[expose] public section + open Set open scoped NNReal diff --git a/Mathlib/Analysis/Calculus/IteratedDeriv/ConvergenceOnBall.lean b/Mathlib/Analysis/Calculus/IteratedDeriv/ConvergenceOnBall.lean index 85663761ecd80d..f45ed5d7bc2827 100644 --- a/Mathlib/Analysis/Calculus/IteratedDeriv/ConvergenceOnBall.lean +++ b/Mathlib/Analysis/Calculus/IteratedDeriv/ConvergenceOnBall.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Vasilii Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasilii Nesterov -/ -import Mathlib.Analysis.Analytic.Uniqueness -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs -import Mathlib.Analysis.NormedSpace.Connected -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.Analysis.Analytic.Uniqueness +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +public import Mathlib.Analysis.NormedSpace.Connected +public import Mathlib.Analysis.RCLike.Basic /-! # Taylor series converges to function on whole ball @@ -15,6 +17,8 @@ In this file we prove that if a function `f` is analytic on the ball of converge series, then the series converges to `f` on this ball. -/ +@[expose] public section + variable {𝕜 : Type*} [RCLike 𝕜] {f : 𝕜 → 𝕜} {x : 𝕜} /-- If `f` is analytic on `Bᵣ(x₀)` and its Taylor series converges on this ball, then it converges diff --git a/Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean b/Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean index 805b14c8a24934..e09fc973bf1146 100644 --- a/Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean +++ b/Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.ContDiff.Defs +module + +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.ContDiff.Defs /-! # One-dimensional iterated derivatives @@ -40,6 +42,8 @@ by translating the corresponding result `iteratedFDerivWithin_succ_apply_left` f iterated Fréchet derivative. -/ +@[expose] public section + noncomputable section open scoped Topology diff --git a/Mathlib/Analysis/Calculus/IteratedDeriv/FaaDiBruno.lean b/Mathlib/Analysis/Calculus/IteratedDeriv/FaaDiBruno.lean index da568b530c46e4..aa135fd5456fc7 100644 --- a/Mathlib/Analysis/Calculus/IteratedDeriv/FaaDiBruno.lean +++ b/Mathlib/Analysis/Calculus/IteratedDeriv/FaaDiBruno.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +module + +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs /-! # Iterated derivatives of compositions @@ -30,6 +32,8 @@ Before starting to work on these TODOs, please contact Yury Kudryashov who may have partial progress towards some of them. -/ +@[expose] public section + open Function Set open scoped ContDiff diff --git a/Mathlib/Analysis/Calculus/IteratedDeriv/Lemmas.lean b/Mathlib/Analysis/Calculus/IteratedDeriv/Lemmas.lean index 57088881bf2888..10d3d04722115d 100644 --- a/Mathlib/Analysis/Calculus/IteratedDeriv/Lemmas.lean +++ b/Mathlib/Analysis/Calculus/IteratedDeriv/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, Ruben Van de Velde -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Shift -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Shift +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs /-! # One-dimensional iterated derivatives @@ -15,6 +17,8 @@ This file contains a number of further results on `iteratedDerivWithin` that nee than are available in `Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean`. -/ +@[expose] public section + section one_dimensional variable diff --git a/Mathlib/Analysis/Calculus/IteratedDeriv/WithinZpow.lean b/Mathlib/Analysis/Calculus/IteratedDeriv/WithinZpow.lean index b3eee675c6d744..48cf7f3ebea4d6 100644 --- a/Mathlib/Analysis/Calculus/IteratedDeriv/WithinZpow.lean +++ b/Mathlib/Analysis/Calculus/IteratedDeriv/WithinZpow.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs -import Mathlib.Analysis.Calculus.Deriv.ZPow +module + +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +public import Mathlib.Analysis.Calculus.Deriv.ZPow /-! # Derivatives of `x ^ m`, `m : ℤ` within an open set @@ -16,6 +18,8 @@ In this file we prove theorems about iterated derivatives of `x ^ m`, `m : ℤ` iterated, derivative, power, open set -/ +@[expose] public section + open scoped Nat variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {s : Set 𝕜} diff --git a/Mathlib/Analysis/Calculus/LHopital.lean b/Mathlib/Analysis/Calculus/LHopital.lean index f294aefb2150ff..a497469be8325d 100644 --- a/Mathlib/Analysis/Calculus/LHopital.lean +++ b/Mathlib/Analysis/Calculus/LHopital.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.Calculus.Deriv.MeanValue +module + +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.Calculus.Deriv.MeanValue /-! # L'Hôpital's rule for 0/0 indeterminate forms @@ -29,6 +31,8 @@ namespace. L'Hôpital's rule, L'Hopital's rule -/ +@[expose] public section + open Filter Set diff --git a/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean b/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean index c79784ec21912f..8fff3f4c627aae 100644 --- a/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean +++ b/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv -import Mathlib.LinearAlgebra.Dual.Defs +module + +public import Mathlib.Analysis.Calculus.FDeriv.Prod +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv +public import Mathlib.LinearAlgebra.Dual.Defs /-! # Lagrange multipliers @@ -27,6 +29,8 @@ lagrange multiplier, local extremum -/ +@[expose] public section + open Filter Set diff --git a/Mathlib/Analysis/Calculus/LineDeriv/Basic.lean b/Mathlib/Analysis/Calculus/LineDeriv/Basic.lean index eeb147589b88e2..59c6a385210561 100644 --- a/Mathlib/Analysis/Calculus/LineDeriv/Basic.lean +++ b/Mathlib/Analysis/Calculus/LineDeriv/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Slope +module + +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Slope /-! # Line derivatives @@ -45,6 +47,8 @@ on the direction would make them barely usable: * We do not define `LineDifferentiableOn` nor `LineDifferentiable`. -/ +@[expose] public section + noncomputable section open scoped Topology Filter ENNReal NNReal diff --git a/Mathlib/Analysis/Calculus/LineDeriv/IntegrationByParts.lean b/Mathlib/Analysis/Calculus/LineDeriv/IntegrationByParts.lean index 17d2af01219343..19cbef939969c2 100644 --- a/Mathlib/Analysis/Calculus/LineDeriv/IntegrationByParts.lean +++ b/Mathlib/Analysis/Calculus/LineDeriv/IntegrationByParts.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.LineDeriv.Basic -import Mathlib.MeasureTheory.Integral.IntegralEqImproper +module + +public import Mathlib.Analysis.Calculus.LineDeriv.Basic +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper /-! # Integration by parts for line derivatives @@ -44,6 +46,8 @@ TODO: prove similar theorems assuming that the functions tend to zero at infinit integrable derivatives. -/ +@[expose] public section + open MeasureTheory Measure Module Topology variable {E F G W : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] diff --git a/Mathlib/Analysis/Calculus/LineDeriv/Measurable.lean b/Mathlib/Analysis/Calculus/LineDeriv/Measurable.lean index 7d4ac9cbb734d5..b22e81a49949ad 100644 --- a/Mathlib/Analysis/Calculus/LineDeriv/Measurable.lean +++ b/Mathlib/Analysis/Calculus/LineDeriv/Measurable.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.LineDeriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Measurable +module + +public import Mathlib.Analysis.Calculus.LineDeriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Measurable /-! # Measurability of the line derivative @@ -19,6 +21,8 @@ way between differentiable and non-differentiable functions along the various li directed by `v`. -/ +@[expose] public section + open MeasureTheory variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [LocallyCompactSpace 𝕜] diff --git a/Mathlib/Analysis/Calculus/LineDeriv/QuadraticMap.lean b/Mathlib/Analysis/Calculus/LineDeriv/QuadraticMap.lean index af9d06dad747ca..6a47bc1f07d20a 100644 --- a/Mathlib/Analysis/Calculus/LineDeriv/QuadraticMap.lean +++ b/Mathlib/Analysis/Calculus/LineDeriv/QuadraticMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.LineDeriv.Basic -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.LinearAlgebra.QuadraticForm.Basic +module + +public import Mathlib.Analysis.Calculus.LineDeriv.Basic +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.LinearAlgebra.QuadraticForm.Basic /-! # Quadratic forms are line (Gateaux) differentiable @@ -16,6 +18,8 @@ Note that this statement does not need topology on the domain. In particular, it applies to discontinuous quadratic forms on infinite-dimensional spaces. -/ +@[expose] public section + variable {𝕜 E F : Type*} [NontriviallyNormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] diff --git a/Mathlib/Analysis/Calculus/LocalExtr/Basic.lean b/Mathlib/Analysis/Calculus/LocalExtr/Basic.lean index a752742bb50e61..6aa14fa9dbc6cb 100644 --- a/Mathlib/Analysis/Calculus/LocalExtr/Basic.lean +++ b/Mathlib/Analysis/Calculus/LocalExtr/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Add +module + +public import Mathlib.Analysis.Calculus.Deriv.Add /-! # Local extrema of differentiable functions @@ -53,6 +55,8 @@ due to the fact that `fderiv` and `deriv` are defined to be zero for non-differe local extremum, tangent cone, Fermat's Theorem -/ +@[expose] public section + universe u v diff --git a/Mathlib/Analysis/Calculus/LocalExtr/LineDeriv.lean b/Mathlib/Analysis/Calculus/LocalExtr/LineDeriv.lean index 0a903aeacbc7ed..7a127a73ef39df 100644 --- a/Mathlib/Analysis/Calculus/LocalExtr/LineDeriv.lean +++ b/Mathlib/Analysis/Calculus/LocalExtr/LineDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.LocalExtr.Basic -import Mathlib.Analysis.Calculus.LineDeriv.Basic +module + +public import Mathlib.Analysis.Calculus.LocalExtr.Basic +public import Mathlib.Analysis.Calculus.LineDeriv.Basic /-! # Local extremum and line derivatives @@ -13,6 +15,8 @@ If `f` has a local extremum at a point, then the derivative at this point is zer In this file we prove several versions of this fact for line derivatives. -/ +@[expose] public section + open Function Set Filter open scoped Topology diff --git a/Mathlib/Analysis/Calculus/LocalExtr/Polynomial.lean b/Mathlib/Analysis/Calculus/LocalExtr/Polynomial.lean index 7269dd223397c0..937f6f00b464bc 100644 --- a/Mathlib/Analysis/Calculus/LocalExtr/Polynomial.lean +++ b/Mathlib/Analysis/Calculus/LocalExtr/Polynomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Benjamin Davidson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Benjamin Davidson, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.LocalExtr.Rolle -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Topology.Algebra.Polynomial +module + +public import Mathlib.Analysis.Calculus.LocalExtr.Rolle +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Topology.Algebra.Polynomial /-! # Rolle's Theorem for polynomials @@ -27,6 +29,8 @@ Namely, we prove the following facts. polynomial, Rolle's Theorem, root -/ +@[expose] public section + namespace Polynomial /-- The number of roots of a real polynomial `p` is at most the number of roots of its derivative diff --git a/Mathlib/Analysis/Calculus/LocalExtr/Rolle.lean b/Mathlib/Analysis/Calculus/LocalExtr/Rolle.lean index 96262341051f73..a768f821a8751c 100644 --- a/Mathlib/Analysis/Calculus/LocalExtr/Rolle.lean +++ b/Mathlib/Analysis/Calculus/LocalExtr/Rolle.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Anatole Dedecker -/ -import Mathlib.Analysis.Calculus.LocalExtr.Basic -import Mathlib.Topology.Order.Rolle +module + +public import Mathlib.Analysis.Calculus.LocalExtr.Basic +public import Mathlib.Topology.Order.Rolle /-! # Rolle's Theorem @@ -29,7 +31,7 @@ We prove four versions of this theorem. continuity on the closed interval $[a, b]$ it assumes that $f$ tends to the same limit as $x$ tends to $a$ from the right and as $x$ tends to $b$ from the left. * `exists_deriv_eq_zero'` relates to `exists_deriv_eq_zero` as `exists_hasDerivAt_eq_zero'` - relates to ``exists_hasDerivAt_eq_zero`. + relates to `exists_hasDerivAt_eq_zero`. ## References @@ -40,6 +42,8 @@ We prove four versions of this theorem. local extremum, Rolle's Theorem -/ +@[expose] public section + open Set Filter Topology variable {f f' : ℝ → ℝ} {a b l : ℝ} diff --git a/Mathlib/Analysis/Calculus/LogDeriv.lean b/Mathlib/Analysis/Calculus/LogDeriv.lean index 85c794c6640c23..1cdd53aaea0698 100644 --- a/Mathlib/Analysis/Calculus/LogDeriv.lean +++ b/Mathlib/Analysis/Calculus/LogDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Calculus.Deriv.ZPow -import Mathlib.Analysis.Calculus.MeanValue +module + +public import Mathlib.Analysis.Calculus.Deriv.ZPow +public import Mathlib.Analysis.Calculus.MeanValue /-! # Logarithmic Derivatives @@ -14,6 +16,8 @@ facts about this, including how it changes under multiplication and composition. -/ +@[expose] public section + noncomputable section open Filter Function Set diff --git a/Mathlib/Analysis/Calculus/LogDerivUniformlyOn.lean b/Mathlib/Analysis/Calculus/LogDerivUniformlyOn.lean index 2cfdc1e4d03dbd..fb48402b27080a 100644 --- a/Mathlib/Analysis/Calculus/LogDerivUniformlyOn.lean +++ b/Mathlib/Analysis/Calculus/LogDerivUniformlyOn.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.Topology.Algebra.InfiniteSum.UniformOn +module + +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.Topology.Algebra.InfiniteSum.UniformOn /-! # The Logarithmic derivative of an infinite product @@ -15,6 +17,8 @@ individual functions. -/ +@[expose] public section + open Complex theorem logDeriv_tprod_eq_tsum {ι : Type*} {s : Set ℂ} (hs : IsOpen s) {x : s} {f : ι → ℂ → ℂ} diff --git a/Mathlib/Analysis/Calculus/MeanValue.lean b/Mathlib/Analysis/Calculus/MeanValue.lean index 4d2390a71b5061..0b28c3bba6957b 100644 --- a/Mathlib/Analysis/Calculus/MeanValue.lean +++ b/Mathlib/Analysis/Calculus/MeanValue.lean @@ -3,15 +3,17 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.AffineMap -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Topology.Instances.RealVectorSpace -import Mathlib.Topology.LocallyConstant.Basic +module + +public import Mathlib.Analysis.Calculus.Deriv.AffineMap +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Topology.Instances.RealVectorSpace +public import Mathlib.Topology.LocallyConstant.Basic /-! # The mean value inequality and equalities @@ -48,6 +50,8 @@ In this file we prove the following facts: strictly differentiable. (This is a corollary of the mean value inequality.) -/ +@[expose] public section + variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] diff --git a/Mathlib/Analysis/Calculus/Monotone.lean b/Mathlib/Analysis/Calculus/Monotone.lean index c55661e5318c9e..45b37246f4e4d5 100644 --- a/Mathlib/Analysis/Calculus/Monotone.lean +++ b/Mathlib/Analysis/Calculus/Monotone.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.MeasureTheory.Covering.OneDim -import Mathlib.Order.Monotone.Extension +module + +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.MeasureTheory.Covering.OneDim +public import Mathlib.Order.Monotone.Extension /-! # Differentiability of monotone functions @@ -29,6 +31,8 @@ limit of `(f y - f x) / (y - x)` by a lower and upper approximation argument fro behavior of `μ [x, y]`. -/ +@[expose] public section + open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsUnifLocDoublingMeasure diff --git a/Mathlib/Analysis/Calculus/ParametricIntegral.lean b/Mathlib/Analysis/Calculus/ParametricIntegral.lean index 5aaa2cbb2db252..f909eabd90cf9b 100644 --- a/Mathlib/Analysis/Calculus/ParametricIntegral.lean +++ b/Mathlib/Analysis/Calculus/ParametricIntegral.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot -/ -import Mathlib.Analysis.Calculus.MeanValue -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.Analysis.LocallyConvex.SeparatingDual +module + +public import Mathlib.Analysis.Calculus.MeanValue +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.Analysis.LocallyConvex.SeparatingDual /-! # Derivatives of integrals depending on parameters @@ -53,6 +55,8 @@ We also provide versions of these theorems for set integrals. integral, derivative -/ +@[expose] public section + noncomputable section @@ -268,10 +272,7 @@ theorem hasDerivAt_integral_of_dominated_loc_of_lip {F' : α → E} (ε_pos : 0 ε_pos hF_meas hF_int hm h_lipsch bound_integrable h_diff replace hF'_int : Integrable F' μ := by rw [← integrable_norm_iff hm] at hF'_int - simpa only [L, (· ∘ ·), integrable_norm_iff, hF'_meas, one_mul, norm_one, - ContinuousLinearMap.comp_apply, ContinuousLinearMap.coe_restrict_scalarsL', - ContinuousLinearMap.norm_restrictScalars, ContinuousLinearMap.norm_smulRightL_apply] using - hF'_int + simpa [L, (· ∘ ·), integrable_norm_iff hF'_meas] using hF'_int refine ⟨hF'_int, ?_⟩ by_cases hE : CompleteSpace E; swap · simpa [integral, hE] using hasDerivAt_const x₀ 0 diff --git a/Mathlib/Analysis/Calculus/ParametricIntervalIntegral.lean b/Mathlib/Analysis/Calculus/ParametricIntervalIntegral.lean index 0c95694a82624c..bca1b07aba40d1 100644 --- a/Mathlib/Analysis/Calculus/ParametricIntervalIntegral.lean +++ b/Mathlib/Analysis/Calculus/ParametricIntervalIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.ParametricIntegral -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.Analysis.Calculus.ParametricIntegral +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Derivatives of interval integrals depending on parameters @@ -12,6 +14,8 @@ import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic In this file we restate theorems about derivatives of integrals depending on parameters for interval integrals. -/ +@[expose] public section + open TopologicalSpace MeasureTheory Filter Metric diff --git a/Mathlib/Analysis/Calculus/Rademacher.lean b/Mathlib/Analysis/Calculus/Rademacher.lean index 272e1200e5e036..b2997de7573f6d 100644 --- a/Mathlib/Analysis/Calculus/Rademacher.lean +++ b/Mathlib/Analysis/Calculus/Rademacher.lean @@ -3,13 +3,15 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.LineDeriv.Measurable -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.Analysis.BoundedVariation -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff -import Mathlib.MeasureTheory.Measure.Haar.Disintegration +module + +public import Mathlib.Analysis.Calculus.LineDeriv.Measurable +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.Analysis.BoundedVariation +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff +public import Mathlib.MeasureTheory.Measure.Haar.Disintegration /-! # Rademacher's theorem: a Lipschitz function is differentiable almost everywhere @@ -42,6 +44,8 @@ elementary but maybe the most elegant once necessary prerequisites are set up. * [Pertti Mattila, Geometry of sets and measures in Euclidean spaces, Theorem 7.3][Federer1996] -/ +@[expose] public section + open Filter MeasureTheory Measure Module Metric Set Asymptotics open scoped NNReal ENNReal Topology diff --git a/Mathlib/Analysis/Calculus/SmoothSeries.lean b/Mathlib/Analysis/Calculus/SmoothSeries.lean index 60b9f2d12faafb..e1418f572f5fa7 100644 --- a/Mathlib/Analysis/Calculus/SmoothSeries.lean +++ b/Mathlib/Analysis/Calculus/SmoothSeries.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.UniformLimitsDeriv -import Mathlib.Topology.Algebra.InfiniteSum.Module -import Mathlib.Analysis.Normed.Group.FunctionSeries +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.UniformLimitsDeriv +public import Mathlib.Topology.Algebra.InfiniteSum.Module +public import Mathlib.Analysis.Normed.Group.FunctionSeries /-! # Smoothness of series @@ -21,6 +23,8 @@ More specifically, We also give versions of these statements which are localized to a set. -/ +@[expose] public section + open Set Metric TopologicalSpace Function Asymptotics Filter diff --git a/Mathlib/Analysis/Calculus/TangentCone.lean b/Mathlib/Analysis/Calculus/TangentCone.lean index d5c0d542309e8b..54844cc201c4d8 100644 --- a/Mathlib/Analysis/Calculus/TangentCone.lean +++ b/Mathlib/Analysis/Calculus/TangentCone.lean @@ -1,9 +1,11 @@ -import Mathlib.Analysis.Calculus.TangentCone.Basic -import Mathlib.Analysis.Calculus.TangentCone.Defs -import Mathlib.Analysis.Calculus.TangentCone.DimOne -import Mathlib.Analysis.Calculus.TangentCone.Pi -import Mathlib.Analysis.Calculus.TangentCone.Prod -import Mathlib.Analysis.Calculus.TangentCone.ProperSpace -import Mathlib.Analysis.Calculus.TangentCone.Real +module + +public import Mathlib.Analysis.Calculus.TangentCone.Basic +public import Mathlib.Analysis.Calculus.TangentCone.Defs +public import Mathlib.Analysis.Calculus.TangentCone.DimOne +public import Mathlib.Analysis.Calculus.TangentCone.Pi +public import Mathlib.Analysis.Calculus.TangentCone.Prod +public import Mathlib.Analysis.Calculus.TangentCone.ProperSpace +public import Mathlib.Analysis.Calculus.TangentCone.Real deprecated_module (since := "2025-11-06") diff --git a/Mathlib/Analysis/Calculus/TangentCone/Basic.lean b/Mathlib/Analysis/Calculus/TangentCone/Basic.lean index 890a09e8970bab..a06a635566b771 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/Basic.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.TangentCone.Defs -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Analysis.Normed.Module.Basic +module + +public import Mathlib.Analysis.Calculus.TangentCone.Defs +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.Normed.Module.Basic /-! # Basic properties of tangent cones and sets with unique differentiability property @@ -14,6 +16,8 @@ In this file we prove basic lemmas about `tangentConeAt`, `UniqueDiffWithinAt`, and `UniqueDiffOn`. -/ +@[expose] public section + open Filter Set Metric NormedField open scoped Topology Pointwise diff --git a/Mathlib/Analysis/Calculus/TangentCone/Defs.lean b/Mathlib/Analysis/Calculus/TangentCone/Defs.lean index b4096c85a531d7..c239f10a212916 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/Defs.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Field.Basic +module + +public import Mathlib.Analysis.Normed.Field.Basic /-! # Tangent cone @@ -29,6 +31,8 @@ are not defined yet. The property of uniqueness of the derivative is therefore p prove here. -/ +@[expose] public section + open Filter Set Metric open scoped Topology Pointwise diff --git a/Mathlib/Analysis/Calculus/TangentCone/DimOne.lean b/Mathlib/Analysis/Calculus/TangentCone/DimOne.lean index 585b2d23a8c0f1..79e189b39840e3 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/DimOne.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/DimOne.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.TangentCone.Basic +module + +public import Mathlib.Analysis.Calculus.TangentCone.Basic /-! # Unique differentiability property of a set in the base field @@ -12,6 +14,8 @@ In this file we prove that a set in the base field has the unique differentiabil iff `x` is an accumulation point of the set, see `uniqueDiffWithinAt_iff_accPt`. -/ +@[expose] public section + open Filter Metric Set open scoped Topology diff --git a/Mathlib/Analysis/Calculus/TangentCone/Pi.lean b/Mathlib/Analysis/Calculus/TangentCone/Pi.lean index be138542d1b46a..6a2e68173ad57f 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/Pi.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.TangentCone.Basic +module + +public import Mathlib.Analysis.Calculus.TangentCone.Basic /-! # Indexed product of sets with unique differentiability property @@ -13,6 +15,8 @@ of a family sets with unique differentiability property has the same property, see `UniqueDiffOn.pi` and `UniqueDiffOn.univ_pi`. -/ +@[expose] public section + open Filter Set open scoped Topology diff --git a/Mathlib/Analysis/Calculus/TangentCone/Prod.lean b/Mathlib/Analysis/Calculus/TangentCone/Prod.lean index 7ad1ce311f1d92..03c296b772916d 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/Prod.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Analysis.Calculus.TangentCone.Defs -import Mathlib.Analysis.Normed.Module.Basic +module + +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.Calculus.TangentCone.Defs +public import Mathlib.Analysis.Normed.Module.Basic /-! # Product of sets with unique differentiability property @@ -14,6 +16,8 @@ In this file we prove that the product of two sets with unique differentiability has the same property, see `UniqueDiffOn.prod`. -/ +@[expose] public section + open Filter Set open scoped Topology diff --git a/Mathlib/Analysis/Calculus/TangentCone/ProperSpace.lean b/Mathlib/Analysis/Calculus/TangentCone/ProperSpace.lean index 7de341a88fbb8f..3ddf3e3a3a3db7 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/ProperSpace.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/ProperSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Seminorm -import Mathlib.Analysis.Calculus.TangentCone.Defs +module + +public import Mathlib.Analysis.Seminorm +public import Mathlib.Analysis.Calculus.TangentCone.Defs /-! # Tangent cone in a proper space @@ -13,6 +15,8 @@ In this file we prove that the tangent cone of a set in a proper normed space at an accumulation point of this set is nontrivial. -/ +@[expose] public section + open Filter Set Metric NormedField open scoped Topology diff --git a/Mathlib/Analysis/Calculus/TangentCone/Real.lean b/Mathlib/Analysis/Calculus/TangentCone/Real.lean index f31f3b8943bc88..7ea6270a2d6776 100644 --- a/Mathlib/Analysis/Calculus/TangentCone/Real.lean +++ b/Mathlib/Analysis/Calculus/TangentCone/Real.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.TangentCone.Basic -import Mathlib.Analysis.Convex.Topology +module + +public import Mathlib.Analysis.Calculus.TangentCone.Basic +public import Mathlib.Analysis.Convex.Topology /-! # Unique differentiability property in real normed spaces @@ -16,6 +18,8 @@ In this file we prove that - `uniqueDiffOn_Ioc` etc: intervals on the real line have the unique differentiability property. -/ +@[expose] public section + open Filter Set open scoped Topology diff --git a/Mathlib/Analysis/Calculus/Taylor.lean b/Mathlib/Analysis/Calculus/Taylor.lean index ed8bfe9a2d1139..6d2de936970b23 100644 --- a/Mathlib/Analysis/Calculus/Taylor.lean +++ b/Mathlib/Analysis/Calculus/Taylor.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.EuclideanDomain.Field -import Mathlib.Algebra.Polynomial.Module.Basic -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.Deriv.Pow -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs -import Mathlib.Analysis.Calculus.MeanValue -import Mathlib.Analysis.Calculus.Deriv.MeanValue +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.EuclideanDomain.Field +public import Mathlib.Algebra.Polynomial.Module.Basic +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.Deriv.Pow +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +public import Mathlib.Analysis.Calculus.MeanValue +public import Mathlib.Analysis.Calculus.Deriv.MeanValue /-! # Taylor's theorem @@ -45,6 +47,8 @@ which states that if `f` is sufficiently smooth, then Taylor polynomial, Taylor's theorem -/ +@[expose] public section + open scoped Interval Topology Nat diff --git a/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean b/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean index c9782c49542ce2..a05b37535d3e25 100644 --- a/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean +++ b/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Kevin H. Wilson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin H. Wilson -/ -import Mathlib.Analysis.Calculus.MeanValue -import Mathlib.Analysis.Normed.Module.RCLike.Basic -import Mathlib.Order.Filter.Curry +module + +public import Mathlib.Analysis.Calculus.MeanValue +public import Mathlib.Analysis.Normed.Module.RCLike.Basic +public import Mathlib.Order.Filter.Curry /-! # Swapping limits and derivatives via uniform convergence @@ -92,6 +94,8 @@ continuous, then you can avoid the mean value theorem and much of the work aroun uniform convergence, limits of derivatives -/ +@[expose] public section + open Filter diff --git a/Mathlib/Analysis/Calculus/VectorField.lean b/Mathlib/Analysis/Calculus/VectorField.lean index 464d03c0e9ae3e..5a80dff51c3d41 100644 --- a/Mathlib/Analysis/Calculus/VectorField.lean +++ b/Mathlib/Analysis/Calculus/VectorField.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Symmetric +module + +public import Mathlib.Analysis.Calculus.FDeriv.Symmetric /-! # Vector fields in vector spaces @@ -28,6 +30,8 @@ In addition to comprehensive API on these two notions, the main results are the -/ +@[expose] public section + open Set open scoped Topology diff --git a/Mathlib/Analysis/Complex/AbelLimit.lean b/Mathlib/Analysis/Complex/AbelLimit.lean index aebb448c3d0511..cbad15d8f1c07e 100644 --- a/Mathlib/Analysis/Complex/AbelLimit.lean +++ b/Mathlib/Analysis/Complex/AbelLimit.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.Tactic.Peel -import Mathlib.Tactic.Positivity +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.Tactic.Peel +public import Mathlib.Tactic.Positivity /-! # Abel's limit theorem @@ -28,6 +30,8 @@ left with angle less than `π`. * https://en.wikipedia.org/wiki/Abel%27s_theorem -/ +@[expose] public section + open Filter Finset diff --git a/Mathlib/Analysis/Complex/AbsMax.lean b/Mathlib/Analysis/Complex/AbsMax.lean index ff0f7bcb65e675..8f276ed3f3ac60 100644 --- a/Mathlib/Analysis/Complex/AbsMax.lean +++ b/Mathlib/Analysis/Complex/AbsMax.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.InnerProductSpace.Convex -import Mathlib.Analysis.Normed.Affine.AddTorsor -import Mathlib.Analysis.NormedSpace.Extr -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.Topology.Order.ExtrClosure +module + +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.InnerProductSpace.Convex +public import Mathlib.Analysis.Normed.Affine.AddTorsor +public import Mathlib.Analysis.NormedSpace.Extr +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.Topology.Order.ExtrClosure /-! # Maximum modulus principle @@ -78,6 +80,8 @@ are continuous on its closure. We prove the following theorems. maximum modulus principle, complex analysis -/ +@[expose] public section + open TopologicalSpace Metric Set Filter Asymptotics Function MeasureTheory AffineMap Bornology diff --git a/Mathlib/Analysis/Complex/Angle.lean b/Mathlib/Analysis/Complex/Angle.lean index 501f8896890c2b..49b184c652c07b 100644 --- a/Mathlib/Analysis/Complex/Angle.lean +++ b/Mathlib/Analysis/Complex/Angle.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic /-! # Angle between complex numbers @@ -24,6 +26,8 @@ Prove the corresponding results for oriented angles. arc-length, arc-distance -/ +@[expose] public section + open InnerProductGeometry Set open scoped Real diff --git a/Mathlib/Analysis/Complex/Arg.lean b/Mathlib/Analysis/Complex/Arg.lean index 16fac107c242c9..b89efa7ac0bd4e 100644 --- a/Mathlib/Analysis/Complex/Arg.lean +++ b/Mathlib/Analysis/Complex/Arg.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Analysis.InnerProductSpace.Convex -import Mathlib.Analysis.SpecialFunctions.Complex.Arg +module + +public import Mathlib.Analysis.InnerProductSpace.Convex +public import Mathlib.Analysis.SpecialFunctions.Complex.Arg /-! # Rays in the complex numbers @@ -21,6 +23,8 @@ the usual way this is considered. -/ +@[expose] public section + variable {x y : ℂ} diff --git a/Mathlib/Analysis/Complex/Asymptotics.lean b/Mathlib/Analysis/Complex/Asymptotics.lean index 72a08470ee1aa1..908b658010e866 100644 --- a/Mathlib/Analysis/Complex/Asymptotics.lean +++ b/Mathlib/Analysis/Complex/Asymptotics.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.Asymptotics.Theta +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.Asymptotics.Theta /-! # Lemmas about asymptotics and the natural embedding `ℝ → ℂ` @@ -12,6 +14,8 @@ import Mathlib.Analysis.Asymptotics.Theta In this file we prove several trivial lemmas about `Asymptotics.IsBigO` etc. and `(↑) : ℝ → ℂ`. -/ +@[expose] public section + namespace Complex variable {α E : Type*} [Norm E] {l : Filter α} diff --git a/Mathlib/Analysis/Complex/Basic.lean b/Mathlib/Analysis/Complex/Basic.lean index 5b4b71d324cc36..8a1841eaf409ab 100644 --- a/Mathlib/Analysis/Complex/Basic.lean +++ b/Mathlib/Analysis/Complex/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Complex.Order -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Data.Complex.BigOperators -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.Topology.Algebra.InfiniteSum.Module -import Mathlib.Topology.Instances.RealVectorSpace -import Mathlib.Topology.MetricSpace.ProperSpace.Real +module + +public import Mathlib.Analysis.Complex.Order +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Data.Complex.BigOperators +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.Topology.Algebra.InfiniteSum.Module +public import Mathlib.Topology.Instances.RealVectorSpace +public import Mathlib.Topology.MetricSpace.ProperSpace.Real /-! @@ -37,6 +39,8 @@ We also register the fact that `ℂ` is an `RCLike` field. -/ +@[expose] public section + assert_not_exists Absorbs diff --git a/Mathlib/Analysis/Complex/Cardinality.lean b/Mathlib/Analysis/Complex/Cardinality.lean index f3039ac320dff4..500ce754dee75b 100644 --- a/Mathlib/Analysis/Complex/Cardinality.lean +++ b/Mathlib/Analysis/Complex/Cardinality.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Analysis.Real.Cardinality -import Mathlib.Data.Complex.Basic +module + +public import Mathlib.Analysis.Real.Cardinality +public import Mathlib.Data.Complex.Basic /-! # The cardinality of the complex numbers @@ -12,6 +14,8 @@ import Mathlib.Data.Complex.Basic This file shows that the complex numbers have cardinality continuum, i.e. `#ℂ = 𝔠`. -/ +@[expose] public section + open Cardinal Set open Cardinal diff --git a/Mathlib/Analysis/Complex/CauchyIntegral.lean b/Mathlib/Analysis/Complex/CauchyIntegral.lean index 4900474770cc26..9efc9ffc60bfe2 100644 --- a/Mathlib/Analysis/Complex/CauchyIntegral.lean +++ b/Mathlib/Analysis/Complex/CauchyIntegral.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.Uniqueness -import Mathlib.Analysis.Calculus.DiffContOnCl -import Mathlib.Analysis.Calculus.DSlope -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Complex.ReImTopology -import Mathlib.Analysis.Real.Cardinality -import Mathlib.MeasureTheory.Integral.CircleIntegral -import Mathlib.MeasureTheory.Integral.DivergenceTheorem -import Mathlib.MeasureTheory.Measure.Lebesgue.Complex +module + +public import Mathlib.Analysis.Analytic.Uniqueness +public import Mathlib.Analysis.Calculus.DiffContOnCl +public import Mathlib.Analysis.Calculus.DSlope +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Complex.ReImTopology +public import Mathlib.Analysis.Real.Cardinality +public import Mathlib.MeasureTheory.Integral.CircleIntegral +public import Mathlib.MeasureTheory.Integral.DivergenceTheorem +public import Mathlib.MeasureTheory.Measure.Lebesgue.Complex /-! # Cauchy integral formula @@ -156,6 +158,8 @@ function is analytic on the open ball. Cauchy-Goursat theorem, Cauchy integral formula -/ +@[expose] public section + open TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function open scoped Interval Real NNReal ENNReal Topology diff --git a/Mathlib/Analysis/Complex/Circle.lean b/Mathlib/Analysis/Complex/Circle.lean index cbde83419a6d1a..2cd197849c514b 100644 --- a/Mathlib/Analysis/Complex/Circle.lean +++ b/Mathlib/Analysis/Complex/Circle.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -import Mathlib.Analysis.Normed.Field.UnitBall +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.Analysis.Normed.Field.UnitBall /-! # The circle @@ -37,6 +39,8 @@ is the kernel of the homomorphism `Complex.normSq` from `ℂ` to `ℝ`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Complex/Conformal.lean b/Mathlib/Analysis/Complex/Conformal.lean index a607346d2b88a6..f32294c2aaee18 100644 --- a/Mathlib/Analysis/Complex/Conformal.lean +++ b/Mathlib/Analysis/Complex/Conformal.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang, Stefan Kebekus -/ -import Mathlib.Analysis.Calculus.Conformal.NormedSpace -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars -import Mathlib.Analysis.Complex.Isometry -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.LinearAlgebra.Complex.Module +module + +public import Mathlib.Analysis.Calculus.Conformal.NormedSpace +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars +public import Mathlib.Analysis.Complex.Isometry +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.LinearAlgebra.Complex.Module /-! # Conformal maps between complex vector spaces @@ -52,6 +54,8 @@ this file. throughout or antiholomorphic throughout. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Complex/Convex.lean b/Mathlib/Analysis/Complex/Convex.lean index 0b9d067a4451a0..a788c8dad7bbc0 100644 --- a/Mathlib/Analysis/Complex/Convex.lean +++ b/Mathlib/Analysis/Complex/Convex.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Analysis.Complex.ReImTopology -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.PathConnected +module + +public import Mathlib.Analysis.Complex.ReImTopology +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.PathConnected /-! # Theorems about convexity on the complex plane @@ -15,6 +17,8 @@ imaginary part are all convex over ℝ. We also prove some results on star-conve slit plane. -/ +@[expose] public section + open Set open scoped ComplexOrder diff --git a/Mathlib/Analysis/Complex/Exponential.lean b/Mathlib/Analysis/Complex/Exponential.lean index 52e106084f572a..c47628a31570df 100644 --- a/Mathlib/Analysis/Complex/Exponential.lean +++ b/Mathlib/Analysis/Complex/Exponential.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Analysis.Complex.Norm -import Mathlib.Algebra.Order.CauSeq.BigOperators -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Data.Complex.BigOperators -import Mathlib.Data.Nat.Choose.Sum +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Analysis.Complex.Norm +public import Mathlib.Algebra.Order.CauSeq.BigOperators +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Data.Complex.BigOperators +public import Mathlib.Data.Nat.Choose.Sum /-! # Exponential Function @@ -23,6 +25,8 @@ This file contains the definitions of the real and complex exponential function. -/ +@[expose] public section + open CauSeq Finset IsAbsoluteValue open scoped ComplexConjugate @@ -667,7 +671,7 @@ open Lean.Meta Qq /-- Extension for the `positivity` tactic: `Real.exp` is always positive. -/ @[positivity Real.exp _] -def evalExp : PositivityExt where eval {u α} _ _ e := do +meta def evalExp : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.exp $a) => assertInstancesCommute diff --git a/Mathlib/Analysis/Complex/ExponentialBounds.lean b/Mathlib/Analysis/Complex/ExponentialBounds.lean index 9c71603431c1b3..d7ac417d6bafac 100644 --- a/Mathlib/Analysis/Complex/ExponentialBounds.lean +++ b/Mathlib/Analysis/Complex/ExponentialBounds.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Joseph Myers -/ -import Mathlib.Analysis.Complex.Exponential -import Mathlib.Analysis.SpecialFunctions.Log.Deriv +module + +public import Mathlib.Analysis.Complex.Exponential +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv /-! # Bounds on specific values of the exponential -/ +@[expose] public section + namespace Real diff --git a/Mathlib/Analysis/Complex/Hadamard.lean b/Mathlib/Analysis/Complex/Hadamard.lean index 236689a5b43cc3..5164b71804b343 100644 --- a/Mathlib/Analysis/Complex/Hadamard.lean +++ b/Mathlib/Analysis/Complex/Hadamard.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Xavier Généreux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Généreux -/ +module -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv -import Mathlib.Analysis.Complex.PhragmenLindelof +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.Analysis.Complex.PhragmenLindelof /-! # Hadamard three-lines Theorem @@ -57,6 +58,8 @@ The proof follows from Phragmén-Lindelöf when both frontiers are not everywher We then use a limit argument to cover the case when either of the sides are `0`. -/ +@[expose] public section + open Set Filter Function Complex Topology @@ -405,7 +408,7 @@ lemma sSupNormIm_scale_right (f : ℂ → E) {l u : ℝ} (hul : l < u) : rw [this] /-- A technical lemma relating the bounds given by the three lines lemma on a general strip -to the bounds for its scaled version on the strip ``re ⁻¹' [0, 1]`. -/ +to the bounds for its scaled version on the strip `re ⁻¹' [0, 1]`. -/ lemma interpStrip_scale (f : ℂ → E) {l u : ℝ} (hul : l < u) (z : ℂ) : interpStrip (scale f l u) ((z - ↑l) / (↑u - ↑l)) = interpStrip' f l u z := by simp only [interpStrip, interpStrip'] diff --git a/Mathlib/Analysis/Complex/HalfPlane.lean b/Mathlib/Analysis/Complex/HalfPlane.lean index d2cf605ce5148d..9556f81c378fd8 100644 --- a/Mathlib/Analysis/Complex/HalfPlane.lean +++ b/Mathlib/Analysis/Complex/HalfPlane.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Topology.Instances.EReal.Lemmas +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Topology.Instances.EReal.Lemmas /-! # Half-planes in ℂ are open @@ -14,6 +16,8 @@ where the bounding value of the real or imaginary part is given by an `EReal` `x So this includes the full plane and the empty set for `x = ⊤`/`x = ⊥`. -/ +@[expose] public section + namespace Complex /-- An open left half-plane (with boundary real part given by an `EReal`) is an open set diff --git a/Mathlib/Analysis/Complex/Harmonic/Analytic.lean b/Mathlib/Analysis/Complex/Harmonic/Analytic.lean index d6653930c6ef5a..bd1d8d742c569a 100644 --- a/Mathlib/Analysis/Complex/Harmonic/Analytic.lean +++ b/Mathlib/Analysis/Complex/Harmonic/Analytic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Calculus.FDeriv.Symmetric -import Mathlib.Analysis.Complex.Conformal -import Mathlib.Analysis.Complex.HasPrimitives -import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic +module + +public import Mathlib.Analysis.Calculus.FDeriv.Symmetric +public import Mathlib.Analysis.Complex.Conformal +public import Mathlib.Analysis.Complex.HasPrimitives +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic /-! # Analyticity of Harmonic Functions @@ -16,6 +18,8 @@ If `f : ℂ → ℝ` is harmonic at `x`, we show that `∂f/∂1 - I • ∂f/ holomorphic on the ball. This implies in particular that harmonic functions are real-analytic. -/ +@[expose] public section + open Complex InnerProductSpace Metric Topology variable diff --git a/Mathlib/Analysis/Complex/Harmonic/MeanValue.lean b/Mathlib/Analysis/Complex/Harmonic/MeanValue.lean index 88e7c1922739bd..0b4d339ea3eae8 100644 --- a/Mathlib/Analysis/Complex/Harmonic/MeanValue.lean +++ b/Mathlib/Analysis/Complex/Harmonic/MeanValue.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Complex.Harmonic.Analytic -import Mathlib.Analysis.Complex.MeanValue +module + +public import Mathlib.Analysis.Complex.Harmonic.Analytic +public import Mathlib.Analysis.Complex.MeanValue /-! # The Mean Value Property of Harmonic Functions on the Complex Plane -/ +@[expose] public section + open InnerProductSpace Metric Real variable {f : ℂ → ℝ} {c : ℂ} {R : ℝ} diff --git a/Mathlib/Analysis/Complex/HasPrimitives.lean b/Mathlib/Analysis/Complex/HasPrimitives.lean index 8c68b444e8dcd6..5d9b62c4cf1e27 100644 --- a/Mathlib/Analysis/Complex/HasPrimitives.lean +++ b/Mathlib/Analysis/Complex/HasPrimitives.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Ian Jauslin and Alex Kontorovich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ian Jauslin, Alex Kontorovich, Oliver Nash -/ -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.Complex.Convex +module + +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.Complex.Convex /-! # Primitives of Holomorphic Functions @@ -27,6 +29,8 @@ segment in the disk), and compute its derivative. TODO: Extend to holomorphic functions on simply connected domains. -/ +@[expose] public section + noncomputable section open Complex MeasureTheory Metric Set Topology diff --git a/Mathlib/Analysis/Complex/IntegerCompl.lean b/Mathlib/Analysis/Complex/IntegerCompl.lean index d8064ad29a9bb5..934762e844f48b 100644 --- a/Mathlib/Analysis/Complex/IntegerCompl.lean +++ b/Mathlib/Analysis/Complex/IntegerCompl.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic +public import Mathlib.Analysis.Complex.UpperHalfPlane.Basic /-! # Integer Complement @@ -14,6 +15,8 @@ We also show that the upper half plane embeds into the integer complement. -/ +@[expose] public section + open UpperHalfPlane /-- The complement of the integers in `ℂ` -/ diff --git a/Mathlib/Analysis/Complex/IsIntegral.lean b/Mathlib/Analysis/Complex/IsIntegral.lean index 5be54b86d1177e..414f6da4f64c36 100644 --- a/Mathlib/Analysis/Complex/IsIntegral.lean +++ b/Mathlib/Analysis/Complex/IsIntegral.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Data.Complex.Basic -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Data.Complex.Basic +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic /-! # Integral elements of ℂ @@ -13,6 +15,8 @@ import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic This file proves that `Complex.I` is integral over ℤ and ℚ. -/ +@[expose] public section + open Polynomial namespace Complex diff --git a/Mathlib/Analysis/Complex/Isometry.lean b/Mathlib/Analysis/Complex/Isometry.lean index 371c75d394db20..da4f99e7f361cb 100644 --- a/Mathlib/Analysis/Complex/Isometry.lean +++ b/Mathlib/Analysis/Complex/Isometry.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 François Sunatori. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François Sunatori -/ -import Mathlib.Analysis.Complex.Circle -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Basic +module + +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Basic /-! # Isometries of the Complex Plane @@ -25,6 +27,8 @@ The proof of `linear_isometry_complex_aux` is separated in the following parts: * [Isometries of the Complex Plane](http://helmut.knaust.info/mediawiki/images/b/b5/Iso.pdf) -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Complex/JensenFormula.lean b/Mathlib/Analysis/Complex/JensenFormula.lean index 9f338ba57ae16e..1e620982151891 100644 --- a/Mathlib/Analysis/Complex/JensenFormula.lean +++ b/Mathlib/Analysis/Complex/JensenFormula.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.PosLogEqCircleAverage +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.PosLogEqCircleAverage /-! # Jensen's Formula of Complex Analysis @@ -20,6 +22,8 @@ equals `log ‖meromorphicTrailingCoeffAt g c‖` plus a correction term that ac poles of `g` within the ball. -/ +@[expose] public section + open Filter MeromorphicAt MeromorphicOn Metric Real /-! @@ -108,6 +112,9 @@ lemma countingFunction_finsum_eq_finsum_add {c : ℂ} {R : ℝ} {D : ℂ → ℤ **Jensen's Formula**: If `f : ℂ → ℂ` is meromorphic on the closed ball with center `c` and radius `R`, then the `circleAverage (log ‖f ·‖) c R` equals `log ‖meromorphicTrailingCoeffAt f c‖` plus a correction term that accounts for the zeros and poles of `f` within the ball. + +See `Function.locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_const` for a +reformulation in terms of the logarithmic counting function of Value Distribution Theory. -/ theorem MeromorphicOn.circleAverage_log_norm {c : ℂ} {R : ℝ} {f : ℂ → ℂ} (hR : R ≠ 0) (h₁f : MeromorphicOn f (closedBall c |R|)) : diff --git a/Mathlib/Analysis/Complex/Liouville.lean b/Mathlib/Analysis/Complex/Liouville.lean index 1bb6efc54f449e..0165f950e2712f 100644 --- a/Mathlib/Analysis/Complex/Liouville.lean +++ b/Mathlib/Analysis/Complex/Liouville.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Normed.Module.Completion +module + +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Normed.Module.Completion /-! # Liouville's theorem @@ -20,6 +22,8 @@ The proof is based on the Cauchy integral formula for the derivative of an analy `Complex.deriv_eq_smul_circleIntegral`. -/ +@[expose] public section + open TopologicalSpace Metric Set Filter Asymptotics Function MeasureTheory Bornology open scoped Topology Filter NNReal Real diff --git a/Mathlib/Analysis/Complex/LocallyUniformLimit.lean b/Mathlib/Analysis/Complex/LocallyUniformLimit.lean index e6d78234db94d1..c555108fc5d153 100644 --- a/Mathlib/Analysis/Complex/LocallyUniformLimit.lean +++ b/Mathlib/Analysis/Complex/LocallyUniformLimit.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Vincent Beffara. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vincent Beffara -/ -import Mathlib.Analysis.Complex.RemovableSingularity -import Mathlib.Analysis.Calculus.UniformLimitsDeriv -import Mathlib.Analysis.Normed.Group.FunctionSeries +module + +public import Mathlib.Analysis.Complex.RemovableSingularity +public import Mathlib.Analysis.Calculus.UniformLimitsDeriv +public import Mathlib.Analysis.Normed.Group.FunctionSeries /-! # Locally uniform limits of holomorphic functions @@ -21,6 +23,8 @@ subset of the complex plane. convergence of the derivatives to the derivative of the limit. -/ +@[expose] public section + open Set Metric MeasureTheory Filter Complex intervalIntegral diff --git a/Mathlib/Analysis/Complex/MeanValue.lean b/Mathlib/Analysis/Complex/MeanValue.lean index cd14fc025bf1e6..92063e3b0f1467 100644 --- a/Mathlib/Analysis/Complex/MeanValue.lean +++ b/Mathlib/Analysis/Complex/MeanValue.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.MeasureTheory.Integral.CircleAverage +module + +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.MeasureTheory.Integral.CircleAverage /-! # The Mean Value Property of Complex Differentiable Functions -/ +@[expose] public section + open Complex Metric Real variable diff --git a/Mathlib/Analysis/Complex/Norm.lean b/Mathlib/Analysis/Complex/Norm.lean index e93c30cc1970b6..ee814fa699f242 100644 --- a/Mathlib/Analysis/Complex/Norm.lean +++ b/Mathlib/Analysis/Complex/Norm.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Data.Complex.Basic -import Mathlib.Data.Real.Sqrt +module + +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Data.Complex.Basic +public import Mathlib.Data.Real.Sqrt /-! # Norm on the complex numbers -/ +@[expose] public section + noncomputable section open ComplexConjugate Topology Filter Set @@ -354,7 +358,7 @@ lemma re_neg_ne_zero_of_re_pos {s : ℂ} (hs : 0 < s.re) : (-s).re ≠ 0 := lemma re_neg_ne_zero_of_one_lt_re {s : ℂ} (hs : 1 < s.re) : (-s).re ≠ 0 := re_neg_ne_zero_of_re_pos <| zero_lt_one.trans hs -lemma norm_sub_one_sq_eq_of_norm_one {z : ℂ} (hz : ‖z‖ = 1) : +lemma norm_sub_one_sq_eq_of_norm_eq_one {z : ℂ} (hz : ‖z‖ = 1) : ‖z - 1‖ ^ 2 = 2 * (1 - z.re) := by have : z.im * z.im = 1 - z.re * z.re := by replace hz := sq_eq_one_iff.mpr (.inl hz) @@ -363,9 +367,12 @@ lemma norm_sub_one_sq_eq_of_norm_one {z : ℂ} (hz : ‖z‖ = 1) : simp [Complex.sq_norm, normSq_apply, this] ring +@[deprecated (since := "2025-11-15")] alias norm_sub_one_sq_eq_of_norm_one := + norm_sub_one_sq_eq_of_norm_eq_one + lemma norm_sub_one_sq_eqOn_sphere : (Metric.sphere (0 : ℂ) 1).EqOn (‖· - 1‖ ^ 2) (fun z ↦ 2 * (1 - z.re)) := - fun z hz ↦ norm_sub_one_sq_eq_of_norm_one (by simpa using hz) + fun z hz ↦ norm_sub_one_sq_eq_of_norm_eq_one (by simpa using hz) lemma normSq_ofReal_add_I_mul_sqrt_one_sub {x : ℝ} (hx : ‖x‖ ≤ 1) : normSq (x + I * √(1 - x ^ 2)) = 1 := by diff --git a/Mathlib/Analysis/Complex/OpenMapping.lean b/Mathlib/Analysis/Complex/OpenMapping.lean index a31527ec7e96c5..2533212db0d7eb 100644 --- a/Mathlib/Analysis/Complex/OpenMapping.lean +++ b/Mathlib/Analysis/Complex/OpenMapping.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Vincent Beffara. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vincent Beffara -/ -import Mathlib.Analysis.Analytic.IsolatedZeros -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.Complex.AbsMax -import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas +module + +public import Mathlib.Analysis.Analytic.IsolatedZeros +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.Complex.AbsMax +public import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas /-! # The open mapping theorem for holomorphic functions @@ -30,6 +32,8 @@ That second step is implemented in `DiffContOnCl.ball_subset_image_closedBall`. * `AnalyticOnNhd.is_constant_or_isOpen` is the open mapping theorem on a connected open set. -/ +@[expose] public section + open Set Filter Metric Complex @@ -123,7 +127,7 @@ theorem AnalyticAt.eventually_constant_or_nhds_le_map_nhds {z₀ : E} (hg : Anal · exact hgr (by simpa [ray, norm_smul, mem_sphere_zero_iff_norm.mp hz] using ht) · exact analyticAt_const.add ((ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℂ ℂ) z).analyticAt t) - by_cases! h : ∀ z ∈ sphere (0 : E) 1, ∀ᶠ t in 𝓝 0, gray z t = gray z 0 + by_cases h : ∀ z ∈ sphere (0 : E) 1, ∀ᶠ t in 𝓝 0, gray z t = gray z 0 · left -- If g is eventually constant along every direction, then it is eventually constant refine eventually_of_mem (ball_mem_nhds z₀ hr) fun z hz => ?_ @@ -141,6 +145,7 @@ theorem AnalyticAt.eventually_constant_or_nhds_le_map_nhds {z₀ : E} (hg : Anal simpa only [ray, gray, w, smul_smul, mul_inv_cancel₀ h', one_smul, add_sub_cancel, Function.comp_apply, coe_smul] using h3 (↑‖z - z₀‖) h4 · right + simp only [not_forall] at h -- Otherwise, it is open along at least one direction and that implies the result obtain ⟨z, hz, hrz⟩ := h specialize h1 z hz 0 (mem_ball_self hr) @@ -156,10 +161,11 @@ is analytic on a connected set `U`, then either it is constant on `U`, or it is sense that it maps any open set contained in `U` to an open set in `ℂ`). -/ theorem AnalyticOnNhd.is_constant_or_isOpen (hg : AnalyticOnNhd ℂ g U) (hU : IsPreconnected U) : (∃ w, ∀ z ∈ U, g z = w) ∨ ∀ s ⊆ U, IsOpen s → IsOpen (g '' s) := by - by_cases! h : ∃ z₀ ∈ U, ∀ᶠ z in 𝓝 z₀, g z = g z₀ + by_cases h : ∃ z₀ ∈ U, ∀ᶠ z in 𝓝 z₀, g z = g z₀ · obtain ⟨z₀, hz₀, h⟩ := h exact Or.inl ⟨g z₀, hg.eqOn_of_preconnected_of_eventuallyEq analyticOnNhd_const hU hz₀ h⟩ - · refine Or.inr fun s hs1 hs2 => isOpen_iff_mem_nhds.mpr ?_ + · simp only [not_exists, not_and] at h + refine Or.inr fun s hs1 hs2 => isOpen_iff_mem_nhds.mpr ?_ rintro z ⟨w, hw1, rfl⟩ exact (hg w (hs1 hw1)).eventually_constant_or_nhds_le_map_nhds.resolve_left (h w (hs1 hw1)) (image_mem_map (hs2.mem_nhds hw1)) diff --git a/Mathlib/Analysis/Complex/OperatorNorm.lean b/Mathlib/Analysis/Complex/OperatorNorm.lean index f8b46b110904d6..1e9c47c82bbe27 100644 --- a/Mathlib/Analysis/Complex/OperatorNorm.lean +++ b/Mathlib/Analysis/Complex/OperatorNorm.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.LinearAlgebra.Complex.Determinant +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.LinearAlgebra.Complex.Determinant /-! # The basic continuous linear maps associated to `ℂ` @@ -15,6 +17,8 @@ The continuous linear maps `Complex.reCLM` (real part), `Complex.imCLM` (imagina the operator norm and (for `Complex.conjCLE`) the determinant. -/ +@[expose] public section + open ContinuousLinearMap namespace Complex diff --git a/Mathlib/Analysis/Complex/Order.lean b/Mathlib/Analysis/Complex/Order.lean index 89019f87ed016e..5a8890162b6198 100644 --- a/Mathlib/Analysis/Complex/Order.lean +++ b/Mathlib/Analysis/Complex/Order.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Analysis.Complex.Norm +module + +public import Mathlib.Analysis.Complex.Norm /-! # The partial order on the complex numbers @@ -26,6 +28,8 @@ provided in `Mathlib/Analysis/RCLike/Basic.lean` as These are all only available with `open scoped ComplexOrder`. -/ +@[expose] public section + namespace Complex /-- We put a partial order on ℂ so that `z ≤ w` exactly if `w - z` is real and nonnegative. @@ -127,7 +131,7 @@ private alias ⟨_, ofReal_ne_zero_of_ne_zero⟩ := ofReal_ne_zero /-- Extension for the `positivity` tactic: `Complex.ofReal` is positive/nonnegative/nonzero if its input is. -/ @[positivity Complex.ofReal _, Complex.ofReal _] -def evalComplexOfReal : PositivityExt where eval {u α} _ _ e := do +meta def evalComplexOfReal : PositivityExt where eval {u α} _ _ e := do -- TODO: Can we avoid duplicating the code? match u, α, e with | 0, ~q(ℂ), ~q(Complex.ofReal $a) => diff --git a/Mathlib/Analysis/Complex/Periodic.lean b/Mathlib/Analysis/Complex/Periodic.lean index 93b261053d1b3f..60f8642d349d83 100644 --- a/Mathlib/Analysis/Complex/Periodic.lean +++ b/Mathlib/Analysis/Complex/Periodic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Complex.RemovableSingularity -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv -import Mathlib.Order.Filter.ZeroAndBoundedAtFilter +module + +public import Mathlib.Analysis.Complex.RemovableSingularity +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv +public import Mathlib.Order.Filter.ZeroAndBoundedAtFilter /-! # Periodic holomorphic functions @@ -20,6 +22,8 @@ for all sufficiently large `im z`, then `F` extends to a holomorphic function on to zero. These results are important in the theory of modular forms. -/ +@[expose] public section + open Complex Filter Asymptotics open scoped Real Topology diff --git a/Mathlib/Analysis/Complex/PhragmenLindelof.lean b/Mathlib/Analysis/Complex/PhragmenLindelof.lean index 0bbc78c24d49af..32b4b3deb30533 100644 --- a/Mathlib/Analysis/Complex/PhragmenLindelof.lean +++ b/Mathlib/Analysis/Complex/PhragmenLindelof.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.AbsMax -import Mathlib.Analysis.Asymptotics.SuperpolynomialDecay +module + +public import Mathlib.Analysis.Complex.AbsMax +public import Mathlib.Analysis.Asymptotics.SuperpolynomialDecay /-! # Phragmen-Lindelöf principle @@ -42,6 +44,8 @@ useful for Ilyashenko's proof of the individual finiteness theorem (a polynomial real plane has only finitely many limit cycles). -/ +@[expose] public section + open Set Function Filter Asymptotics Metric Complex Bornology open scoped Topology Filter Real diff --git a/Mathlib/Analysis/Complex/Polynomial/Basic.lean b/Mathlib/Analysis/Complex/Polynomial/Basic.lean index d52429d90be383..cd91133d8beb11 100644 --- a/Mathlib/Analysis/Complex/Polynomial/Basic.lean +++ b/Mathlib/Analysis/Complex/Polynomial/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Junyan Xu, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Analysis.Complex.Liouville -import Mathlib.FieldTheory.PolynomialGaloisGroup -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.Topology.Algebra.Polynomial +module + +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Analysis.Complex.Liouville +public import Mathlib.FieldTheory.PolynomialGaloisGroup +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.Topology.Algebra.Polynomial /-! # The fundamental theorem of algebra @@ -22,6 +24,8 @@ of non-real roots. We also show that an irreducible real polynomial has degree at most two. -/ +@[expose] public section + open Polynomial Bornology Complex open scoped ComplexConjugate diff --git a/Mathlib/Analysis/Complex/Polynomial/GaussLucas.lean b/Mathlib/Analysis/Complex/Polynomial/GaussLucas.lean index 5814b244341fd0..2f5737935156ad 100644 --- a/Mathlib/Analysis/Complex/Polynomial/GaussLucas.lean +++ b/Mathlib/Analysis/Complex/Polynomial/GaussLucas.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Aristotle AI -/ -import Mathlib.Analysis.Complex.Polynomial.Basic +module + +public import Mathlib.Analysis.Complex.Polynomial.Basic /-! # Gauss-Lucas Theorem @@ -12,6 +14,8 @@ In this file we prove Gauss-Lucas Theorem: the roots of the derivative of a nonconstant complex polynomial are included in the convex hull of the roots of the polynomial. -/ + +@[expose] public section open scoped BigOperators Polynomial ComplexConjugate namespace Polynomial diff --git a/Mathlib/Analysis/Complex/Polynomial/UnitTrinomial.lean b/Mathlib/Analysis/Complex/Polynomial/UnitTrinomial.lean index 35e745ecec6a56..05861d59f7a0ca 100644 --- a/Mathlib/Analysis/Complex/Polynomial/UnitTrinomial.lean +++ b/Mathlib/Analysis/Complex/Polynomial/UnitTrinomial.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Polynomial.UnitTrinomial -import Mathlib.Analysis.Complex.Polynomial.Basic +module + +public import Mathlib.Algebra.Polynomial.UnitTrinomial +public import Mathlib.Analysis.Complex.Polynomial.Basic /-! # Irreducibility of unit trinomials @@ -15,6 +17,8 @@ Develop more theory (e.g., it suffices to check that `aeval z p ≠ 0` for `z = unity). -/ +@[expose] public section + namespace Polynomial.IsUnitTrinomial variable {p : ℤ[X]} diff --git a/Mathlib/Analysis/Complex/Positivity.lean b/Mathlib/Analysis/Complex/Positivity.lean index cb3902ccb6bfc2..46866e4fc7d9fa 100644 --- a/Mathlib/Analysis/Complex/Positivity.lean +++ b/Mathlib/Analysis/Complex/Positivity.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Complex.TaylorSeries +module + +public import Mathlib.Analysis.Complex.TaylorSeries /-! # Nonnegativity of values of holomorphic functions @@ -15,6 +17,8 @@ variant `Differentiable.nonneg_of_iteratedDeriv_nonneg` for entire functions and showing `f z ≥ f c` when all iterated derivatives except `f` itseld are nonnegative. -/ +@[expose] public section + open Complex open scoped ComplexOrder diff --git a/Mathlib/Analysis/Complex/ReImTopology.lean b/Mathlib/Analysis/Complex/ReImTopology.lean index 9047ba7081fa30..073e00859307a3 100644 --- a/Mathlib/Analysis/Complex/ReImTopology.lean +++ b/Mathlib/Analysis/Complex/ReImTopology.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Topology.FiberBundle.IsHomeomorphicTrivialBundle +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Topology.FiberBundle.IsHomeomorphicTrivialBundle /-! # Closure, interior, and frontier of preimages under `re` and `im` @@ -31,6 +33,8 @@ Each statement about `Complex.re` listed below has a counterpart about `Complex. complex, real part, imaginary part, closure, interior, frontier -/ +@[expose] public section + open Set Topology noncomputable section diff --git a/Mathlib/Analysis/Complex/RealDeriv.lean b/Mathlib/Analysis/Complex/RealDeriv.lean index 36ab5525d67616..15ff4ae78bcdb2 100644 --- a/Mathlib/Analysis/Complex/RealDeriv.lean +++ b/Mathlib/Analysis/Complex/RealDeriv.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yourong Zang -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.Deriv.Linear -import Mathlib.Analysis.Complex.Basic +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.Deriv.Linear +public import Mathlib.Analysis.Complex.Basic /-! # Real differentiability of complex-differentiable functions @@ -14,6 +16,8 @@ then its restriction to `ℝ` is differentiable over `ℝ`, with derivative the complex derivative. -/ +@[expose] public section + assert_not_exists IsConformalMap Conformal section RealDerivOfComplex diff --git a/Mathlib/Analysis/Complex/RemovableSingularity.lean b/Mathlib/Analysis/Complex/RemovableSingularity.lean index f1eedd09fad379..6dbabfbb88a926 100644 --- a/Mathlib/Analysis/Complex/RemovableSingularity.lean +++ b/Mathlib/Analysis/Complex/RemovableSingularity.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Asymptotics.SpecificAsymptotics -import Mathlib.Analysis.Complex.CauchyIntegral +module + +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +public import Mathlib.Analysis.Complex.CauchyIntegral /-! # Removable singularity theorem @@ -16,6 +18,8 @@ of `c` (or, more generally, $f(z) - f(c)=o((z-c)^{-1})$), then it has a limit at function `update f c (limUnder (𝓝[≠] c) f)` is complex differentiable in a neighborhood of `c`. -/ +@[expose] public section + open TopologicalSpace Metric Set Filter Asymptotics Function diff --git a/Mathlib/Analysis/Complex/Schwarz.lean b/Mathlib/Analysis/Complex/Schwarz.lean index 9f59f93542efd5..c3a57049f6d95e 100644 --- a/Mathlib/Analysis/Complex/Schwarz.lean +++ b/Mathlib/Analysis/Complex/Schwarz.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.AbsMax -import Mathlib.Analysis.Complex.RemovableSingularity +module + +public import Mathlib.Analysis.Complex.AbsMax +public import Mathlib.Analysis.Complex.RemovableSingularity /-! # Schwarz lemma @@ -47,6 +49,8 @@ over complex numbers. Schwarz lemma -/ +@[expose] public section + open Metric Set Function Filter TopologicalSpace diff --git a/Mathlib/Analysis/Complex/Spectrum.lean b/Mathlib/Analysis/Complex/Spectrum.lean index bc58e76fdc1ead..7f807d3c157e3b 100644 --- a/Mathlib/Analysis/Complex/Spectrum.lean +++ b/Mathlib/Analysis/Complex/Spectrum.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Analysis.Complex.Basic +module + +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Analysis.Complex.Basic /-! # Some lemmas on the spectrum and quasispectrum of elements and positivity on `ℂ` -/ +@[expose] public section + namespace SpectrumRestricts variable {A : Type*} [Ring A] diff --git a/Mathlib/Analysis/Complex/SummableUniformlyOn.lean b/Mathlib/Analysis/Complex/SummableUniformlyOn.lean index 1b612df6051345..4aa9a0188c0076 100644 --- a/Mathlib/Analysis/Complex/SummableUniformlyOn.lean +++ b/Mathlib/Analysis/Complex/SummableUniformlyOn.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.Topology.Algebra.InfiniteSum.UniformOn +module + +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.Topology.Algebra.InfiniteSum.UniformOn /-! # Differentiability of uniformly convergent series sums of functions @@ -14,6 +16,8 @@ We collect some results about the differentiability of infinite sums. -/ +@[expose] public section + lemma SummableLocallyUniformlyOn.differentiableOn {ι E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {f : ι → ℂ → E} {s : Set ℂ} (hs : IsOpen s) (h : SummableLocallyUniformlyOn f s) diff --git a/Mathlib/Analysis/Complex/TaylorSeries.lean b/Mathlib/Analysis/Complex/TaylorSeries.lean index 91e330885478dd..0949ce7ca4a25b 100644 --- a/Mathlib/Analysis/Complex/TaylorSeries.lean +++ b/Mathlib/Analysis/Complex/TaylorSeries.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Complex.CauchyIntegral +module + +public import Mathlib.Analysis.Complex.CauchyIntegral /-! # Convergence of Taylor series of holomorphic functions @@ -24,6 +26,8 @@ see `Complex.hasSum_taylorSeries_of_entire`, `Complex.taylorSeries_eq_of_entire` `Complex.taylorSeries_eq_of_entire'`. -/ +@[expose] public section + namespace Complex open Nat diff --git a/Mathlib/Analysis/Complex/Tietze.lean b/Mathlib/Analysis/Complex/Tietze.lean index a60a75e02395e8..9a1ee6b9dfa870 100644 --- a/Mathlib/Analysis/Complex/Tietze.lean +++ b/Mathlib/Analysis/Complex/Tietze.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.Topology.TietzeExtension -import Mathlib.Analysis.Normed.Module.Ball.Homeomorph -import Mathlib.Analysis.Normed.Module.RCLike.Basic +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.RCLike.Lemmas +public import Mathlib.Topology.TietzeExtension +public import Mathlib.Analysis.Normed.Module.Ball.Homeomorph +public import Mathlib.Analysis.Normed.Module.RCLike.Basic /-! # Finite-dimensional topological vector spaces over `ℝ` satisfy the Tietze extension property @@ -21,6 +23,8 @@ There are two main results here: -/ +@[expose] public section + universe u u₁ v w -- this is not an instance because Lean cannot determine `𝕜`. diff --git a/Mathlib/Analysis/Complex/Trigonometric.lean b/Mathlib/Analysis/Complex/Trigonometric.lean index e5743032023480..877dff5310d560 100644 --- a/Mathlib/Analysis/Complex/Trigonometric.lean +++ b/Mathlib/Analysis/Complex/Trigonometric.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir -/ -import Mathlib.Analysis.Complex.Exponential +module + +public import Mathlib.Analysis.Complex.Exponential /-! # Trigonometric and hyperbolic trigonometric functions @@ -13,6 +15,8 @@ hyperbolic sine, hyperbolic cosine, and hyperbolic tangent functions. -/ +@[expose] public section + open CauSeq Finset IsAbsoluteValue open scoped ComplexConjugate @@ -470,6 +474,11 @@ theorem cos_sq' : cos x ^ 2 = 1 - sin x ^ 2 := by rw [← sin_sq_add_cos_sq x, a theorem sin_sq : sin x ^ 2 = 1 - cos x ^ 2 := by rw [← sin_sq_add_cos_sq x, add_sub_cancel_right] +theorem one_add_tan_sq_mul_cos_sq_eq_one {x : ℂ} (h : cos x ≠ 0) : + (1 + tan x ^ 2) * cos x ^ 2 = 1 := by + conv_rhs => rw [← sin_sq_add_cos_sq x, ← tan_mul_cos h] + ring + theorem inv_one_add_tan_sq {x : ℂ} (hx : cos x ≠ 0) : (1 + tan x ^ 2)⁻¹ = cos x ^ 2 := by rw [tan_eq_sin_div_cos, div_pow] simp [field] @@ -656,6 +665,10 @@ theorem abs_sin_eq_sqrt_one_sub_cos_sq (x : ℝ) : |sin x| = √(1 - cos x ^ 2) theorem abs_cos_eq_sqrt_one_sub_sin_sq (x : ℝ) : |cos x| = √(1 - sin x ^ 2) := by rw [← cos_sq', sqrt_sq_eq_abs] +theorem one_add_tan_sq_mul_cos_sq_eq_one {x : ℝ} (h : cos x ≠ 0) : + (1 + tan x ^ 2) * cos x ^ 2 = 1 := + mod_cast @Complex.one_add_tan_sq_mul_cos_sq_eq_one x (mod_cast h) + theorem inv_one_add_tan_sq {x : ℝ} (hx : cos x ≠ 0) : (1 + tan x ^ 2)⁻¹ = cos x ^ 2 := have : Complex.cos x ≠ 0 := mt (congr_arg re) hx ofReal_inj.1 <| by simpa using Complex.inv_one_add_tan_sq this @@ -904,7 +917,7 @@ open Lean.Meta Qq /-- Extension for the `positivity` tactic: `Real.cosh` is always positive. -/ @[positivity Real.cosh _] -def evalCosh : PositivityExt where eval {u α} _ _ e := do +meta def evalCosh : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.cosh $a) => assertInstancesCommute diff --git a/Mathlib/Analysis/Complex/UnitDisc/Basic.lean b/Mathlib/Analysis/Complex/UnitDisc/Basic.lean index a0d60ed505cc4f..bd1f33f30887b8 100644 --- a/Mathlib/Analysis/Complex/UnitDisc/Basic.lean +++ b/Mathlib/Analysis/Complex/UnitDisc/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.Circle -import Mathlib.Analysis.Normed.Module.Ball.Action +module + +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.Analysis.Normed.Module.Ball.Action /-! # Poincaré disc @@ -13,6 +15,8 @@ In this file we define `Complex.UnitDisc` to be the unit disc in the complex pla introduce some basic operations on this disc. -/ +@[expose] public section + open Set Function Metric diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean index aadd5e999fd494..dbc74025fec436 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Alex Kontorovich and Heather Macbeth and Marc Masdeu. All rig Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, Heather Macbeth, Marc Masdeu -/ -import Mathlib.Analysis.Complex.Basic +module + +public import Mathlib.Analysis.Complex.Basic /-! # The upper half plane @@ -14,6 +16,8 @@ We define the notation `ℍ` for the upper half plane available in the locale `UpperHalfPlane` so as not to conflict with the quaternions. -/ +@[expose] public section + noncomputable section /-- The open upper half plane, denoted as `ℍ` within the `UpperHalfPlane` namespace -/ @@ -119,7 +123,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: `UpperHalfPlane.im`. -/ @[positivity UpperHalfPlane.im _] -def evalUpperHalfPlaneIm : PositivityExt where eval {u α} _zα _pα e := do +meta def evalUpperHalfPlaneIm : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(UpperHalfPlane.im $a) => assertInstancesCommute @@ -128,7 +132,7 @@ def evalUpperHalfPlaneIm : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for the `positivity` tactic: `UpperHalfPlane.coe`. -/ @[positivity UpperHalfPlane.coe _] -def evalUpperHalfPlaneCoe : PositivityExt where eval {u α} _zα _pα e := do +meta def evalUpperHalfPlaneCoe : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℂ), ~q(UpperHalfPlane.coe $a) => assertInstancesCommute diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Exp.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Exp.lean index 883af8bb90c486..a84992cab3560d 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Exp.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Exp.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -import Mathlib.Analysis.Complex.Periodic -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.Analysis.Complex.Periodic +public import Mathlib.Analysis.Complex.UpperHalfPlane.Basic /-! # Exp on the upper half plane @@ -14,6 +16,8 @@ This file contains lemmas about the exponential function on the upper half plane q-expansions of modular forms. -/ +@[expose] public section + open Real Complex UpperHalfPlane Function local notation "𝕢" => Periodic.qParam diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean index 2c074a7c3b4cd8..b8eb290c6448be 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.Analysis.Complex.UpperHalfPlane.Topology -import Mathlib.Order.Filter.ZeroAndBoundedAtFilter +module + +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.Analysis.Complex.UpperHalfPlane.Topology +public import Mathlib.Order.Filter.ZeroAndBoundedAtFilter /-! # Bounded at infinity @@ -15,6 +17,8 @@ For complex-valued functions on the upper half plane, this file defines the filt infinity. Both of which are relevant for defining modular forms. -/ +@[expose] public section + open Complex Filter open scoped Topology UpperHalfPlane diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Manifold.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Manifold.lean index c464b1bf97b7bb..df2ee4f9fed6f3 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Manifold.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Manifold.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.Complex.UpperHalfPlane.Topology -import Mathlib.Geometry.Manifold.Algebra.Structures -import Mathlib.Geometry.Manifold.ContMDiff.Atlas -import Mathlib.Geometry.Manifold.MFDeriv.FDeriv +module + +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.Complex.UpperHalfPlane.Topology +public import Mathlib.Geometry.Manifold.Algebra.Structures +public import Mathlib.Geometry.Manifold.ContMDiff.Atlas +public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! # Manifold structure on the upper half plane. @@ -15,6 +17,8 @@ import Mathlib.Geometry.Manifold.MFDeriv.FDeriv In this file we define the complex manifold structure on the upper half-plane. -/ +@[expose] public section + open Filter open scoped Manifold ContDiff MatrixGroups diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean index 7d6ba1564a3060..1f14a739f73e98 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.Topology -import Mathlib.Analysis.SpecialFunctions.Arsinh -import Mathlib.Geometry.Euclidean.Inversion.Basic +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.Topology +public import Mathlib.Analysis.SpecialFunctions.Arsinh +public import Mathlib.Geometry.Euclidean.Inversion.Basic /-! # Metric on the upper half-plane @@ -22,6 +24,8 @@ ball/sphere with another center and radius. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean index b566fb9f31ba6b..a939b7aad31312 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Alex Kontorovich and Heather Macbeth and Marc Masdeu. All rig Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, Heather Macbeth, Marc Masdeu -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Data.Fintype.Parity -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.Basic +public import Mathlib.Data.Fintype.Parity +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs /-! # Group action on the upper half-plane @@ -15,6 +17,8 @@ transformations (composing with complex conjugation when needed to extend the ac positive-determinant subgroup, so that `!![-1, 0; 0, 1]` acts as `z ↦ -conj z`.) -/ +@[expose] public section + noncomputable section open Matrix Matrix.SpecialLinearGroup UpperHalfPlane diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Topology.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Topology.lean index b06d0c5e075ac4..1a5e704c7fdb36 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Topology.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Topology.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction -import Mathlib.Analysis.Convex.Contractible -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.Complex.Convex -import Mathlib.Analysis.Complex.ReImTopology -import Mathlib.Topology.Homotopy.Contractible -import Mathlib.Topology.OpenPartialHomeomorph +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction +public import Mathlib.Analysis.Convex.Contractible +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.Complex.Convex +public import Mathlib.Analysis.Complex.ReImTopology +public import Mathlib.Topology.Homotopy.Contractible +public import Mathlib.Topology.OpenPartialHomeomorph /-! # Topology on the upper half plane @@ -18,6 +20,8 @@ In this file we introduce a `TopologicalSpace` structure on the upper half plane various instances. -/ +@[expose] public section + noncomputable section open Complex Filter Function Set TopologicalSpace Topology diff --git a/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean b/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean index 3b8c7d862d69dd..4ad490ef284e00 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Complex.ValueDistribution.CountingFunction -import Mathlib.Analysis.Complex.ValueDistribution.ProximityFunction +module + +public import Mathlib.Analysis.Complex.ValueDistribution.CountingFunction +public import Mathlib.Analysis.Complex.ValueDistribution.ProximityFunction /-! # The Characteristic Function of Value Distribution Theory @@ -29,6 +31,8 @@ Approximation*][MR3156076] for a detailed discussion. Spaces*][MR886677]. -/ +@[expose] public section + open Metric Real Set namespace ValueDistribution diff --git a/Mathlib/Analysis/Complex/ValueDistribution/CountingFunction.lean b/Mathlib/Analysis/Complex/ValueDistribution/CountingFunction.lean index c14a779416d8c4..67c315d2015421 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/CountingFunction.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/CountingFunction.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Meromorphic.Divisor -import Mathlib.Analysis.SpecialFunctions.Log.Basic +module + +public import Mathlib.Analysis.Complex.JensenFormula /-! # The Counting Function of Value Distribution Theory @@ -33,12 +34,13 @@ Approximation*][MR3156076] for a detailed discussion. ## TODO -- For `𝕜 = ℂ`, add the integral presentation of the logarithmic counting function - Discuss the counting function for rational functions, add a forward reference to the upcoming converse, formulated in terms of the Nevanlinna height. -/ -open MeromorphicOn Metric Real Set +@[expose] public section + +open Function MeromorphicOn Metric Real Set /-! ## Supporting Notation @@ -64,6 +66,11 @@ lemma toClosedBall_eval_within {r : ℝ} {z : E} (f : locallyFinsuppWithin (univ unfold toClosedBall simp_all [restrict_apply] +@[simp] +lemma toClosedBall_divisor {r : ℝ} {f : ℂ → ℂ} (h : MeromorphicOn f univ) : + (divisor f (closedBall 0 |r|)) = (locallyFinsuppWithin.toClosedBall r) (divisor f univ) := by + simp_all [locallyFinsuppWithin.toClosedBall] + /-! ## The Logarithmic Counting Function of a Function with Locally Finite Support -/ @@ -174,6 +181,13 @@ noncomputable def logCounting : ℝ → ℝ := by · exact (divisor f univ)⁻.logCounting · exact (divisor (fun z ↦ f z - a.untop₀) univ)⁺.logCounting +/-- +Relation between `ValueDistribution.logCounting` and `locallyFinsuppWithin.logCounting`. +-/ +lemma _root_.locallyFinsuppWithin.logCounting_divisor {f : ℂ → ℂ} : + locallyFinsuppWithin.logCounting (divisor f ⊤) = logCounting f 0 - logCounting f ⊤ := by + simp [logCounting, ← locallyFinsuppWithin.logCounting.map_sub] + /-- For finite values `a₀`, the logarithmic counting function `logCounting f a₀` is the counting function associated with the zero-divisor of the meromorphic function `f - a₀`. @@ -339,3 +353,40 @@ counting function counting poles of `f`. simp [logCounting, divisor_pow hf n] end ValueDistribution + +/-! +## Representation by Integrals + +For `𝕜 = ℂ`, the theorems below describe the logarithmic counting function in terms of circle +averages. +-/ + +/-- +Over the complex numbers, present the logarithmic counting function attached to the divisor of a +meromorphic function `f` as a circle average over `log ‖f ·‖`. + +This is a reformulation of Jensen's formula of complex analysis. See +`MeromorphicOn.circleAverage_log_norm` for Jensen's formula in the original context. +-/ +theorem Function.locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_const {R : ℝ} + {f : ℂ → ℂ} (h : MeromorphicOn f ⊤) (hR : R ≠ 0) : + locallyFinsuppWithin.logCounting (divisor f ⊤) R = + circleAverage (log ‖f ·‖) 0 R - log ‖meromorphicTrailingCoeffAt f 0‖ := by + have h₁f : MeromorphicOn f (closedBall 0 |R|) := by tauto + simp only [MeromorphicOn.circleAverage_log_norm hR h₁f, locallyFinsuppWithin.logCounting, + top_eq_univ, AddMonoidHom.coe_mk, ZeroHom.coe_mk, zero_sub, norm_neg, add_sub_cancel_right] + congr 1 + · simp_all + · rw [divisor_apply, divisor_apply] + all_goals aesop + +/-- +Variant of `locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_const`, using +`ValueDistribution.logCounting` instead of `locallyFinsuppWithin.logCounting`. +-/ +theorem ValueDistribution.logCounting_zero_sub_logCounting_top_eq_circleAverage_sub_const {R : ℝ} + {f : ℂ → ℂ} (h : MeromorphicOn f ⊤) (hR : R ≠ 0) : + (logCounting f 0 - logCounting f ⊤) R = + circleAverage (log ‖f ·‖) 0 R - log ‖meromorphicTrailingCoeffAt f 0‖ := by + rw [← locallyFinsuppWithin.logCounting_divisor] + exact locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_const h hR diff --git a/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean b/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean index b303ae1b492af7..cd2d265dfb34ff 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Complex.JensenFormula -import Mathlib.Analysis.Complex.ValueDistribution.CharacteristicFunction +module + +public import Mathlib.Analysis.Complex.JensenFormula +public import Mathlib.Analysis.Complex.ValueDistribution.CharacteristicFunction /-! # The First Main Theorem of Value Distribution Theory @@ -24,6 +26,8 @@ See Section VI.2 of [Lang, *Introduction to Complex Hyperbolic Spaces*][MR886677 [Noguchi-Winkelmann, *Nevanlinna Theory in Several Complex Variables and Diophantine Approximation*][MR3156076] for a detailed discussion. -/ + +@[expose] public section namespace ValueDistribution open Asymptotics Filter Function.locallyFinsuppWithin MeromorphicAt MeromorphicOn Metric Real diff --git a/Mathlib/Analysis/Complex/ValueDistribution/ProximityFunction.lean b/Mathlib/Analysis/Complex/ValueDistribution/ProximityFunction.lean index 49cd8aa48fdfd3..7d361b4930d34f 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/ProximityFunction.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/ProximityFunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Algebra.Order.WithTop.Untop0 -import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic -import Mathlib.MeasureTheory.Integral.CircleAverage +module + +public import Mathlib.Algebra.Order.WithTop.Untop0 +public import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic +public import Mathlib.MeasureTheory.Integral.CircleAverage /-! @@ -24,6 +26,8 @@ See Section VI.2 of [Lang, *Introduction to Complex Hyperbolic Spaces*][MR886677 Approximation*][MR3156076] for a detailed discussion. -/ +@[expose] public section + open Metric Real Set namespace ValueDistribution diff --git a/Mathlib/Analysis/ConstantSpeed.lean b/Mathlib/Analysis/ConstantSpeed.lean index eb6c4693f3fde4..d8002440ee85e5 100644 --- a/Mathlib/Analysis/ConstantSpeed.lean +++ b/Mathlib/Analysis/ConstantSpeed.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémi Bottinelli -/ -import Mathlib.Data.Set.Function -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Topology.EMetricSpace.BoundedVariation +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Topology.EMetricSpace.BoundedVariation /-! # Constant speed @@ -38,6 +40,8 @@ as a composite `φ ∘ (variationOnFromTo f s a)`, where `φ` has unit speed and arc-length, parameterization -/ +@[expose] public section + open scoped NNReal ENNReal diff --git a/Mathlib/Analysis/Convex/AmpleSet.lean b/Mathlib/Analysis/Convex/AmpleSet.lean index c2d1fb05a400fa..5cd8084868c429 100644 --- a/Mathlib/Analysis/Convex/AmpleSet.lean +++ b/Mathlib/Analysis/Convex/AmpleSet.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Floris van Doorn -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Analysis.NormedSpace.Connected -import Mathlib.Topology.Algebra.ContinuousAffineEquiv +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Analysis.NormedSpace.Connected +public import Mathlib.Topology.Algebra.ContinuousAffineEquiv /-! # Ample subsets of real vector spaces @@ -38,6 +40,8 @@ connected fields, that is not useful in practice. ample set -/ +@[expose] public section + /-! ## Definition and invariance -/ open Set diff --git a/Mathlib/Analysis/Convex/Basic.lean b/Mathlib/Analysis/Convex/Basic.lean index 7d42b5a1c9070d..31db892a0f5184 100644 --- a/Mathlib/Analysis/Convex/Basic.lean +++ b/Mathlib/Analysis/Convex/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Algebra.Ring.Action.Pointwise.Set -import Mathlib.Analysis.Convex.Star -import Mathlib.Tactic.Field -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs +module + +public import Mathlib.Algebra.Ring.Action.Pointwise.Set +public import Mathlib.Analysis.Convex.Star +public import Mathlib.Tactic.Field +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs /-! # Convex sets @@ -21,6 +23,8 @@ We provide various equivalent versions, and prove that some specific sets are co Generalize all this file to affine spaces. -/ +@[expose] public section + variable {𝕜 E F β : Type*} @@ -117,6 +121,9 @@ theorem DirectedOn.convex_sUnion {c : Set (Set E)} (hdir : DirectedOn (· ⊆ · rw [sUnion_eq_iUnion] exact (directedOn_iff_directed.1 hdir).convex_iUnion fun A => hc A.2 +theorem Convex.setOf_const_imp {P : Prop} (hs : Convex 𝕜 s) : Convex 𝕜 {x | P → x ∈ s} := by + by_cases hP : P <;> simp [hP, hs, convex_univ] + end SMul section Module diff --git a/Mathlib/Analysis/Convex/Between.lean b/Mathlib/Analysis/Convex/Between.lean index 114218981319d5..f23b3f9430f2d4 100644 --- a/Mathlib/Analysis/Convex/Between.lean +++ b/Mathlib/Analysis/Convex/Between.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Algebra.Order.Interval.Set.Group -import Mathlib.Analysis.Convex.Basic -import Mathlib.Analysis.Convex.Segment -import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.Order.Interval.Set.Group +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.Analysis.Convex.Segment +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.Tactic.FieldSimp /-! # Betweenness in affine spaces @@ -23,6 +25,8 @@ This file defines notions of a point in an affine space being between two given -/ +@[expose] public section + variable (R : Type*) {V V' P P' : Type*} diff --git a/Mathlib/Analysis/Convex/BetweenList.lean b/Mathlib/Analysis/Convex/BetweenList.lean index 4fb4a94f3f32a9..bae1d27d00bee5 100644 --- a/Mathlib/Analysis/Convex/BetweenList.lean +++ b/Mathlib/Analysis/Convex/BetweenList.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Convex.Between -import Mathlib.Data.List.Triplewise +module + +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Data.List.Triplewise /-! # Betweenness for lists of points. @@ -18,6 +20,8 @@ This file defines notions of lists of points in an affine space being in order o -/ +@[expose] public section + variable (R : Type*) {V V' P P' : Type*} diff --git a/Mathlib/Analysis/Convex/Birkhoff.lean b/Mathlib/Analysis/Convex/Birkhoff.lean index 6877290dc76809..812789f85e5446 100644 --- a/Mathlib/Analysis/Convex/Birkhoff.lean +++ b/Mathlib/Analysis/Convex/Birkhoff.lean @@ -3,14 +3,15 @@ Copyright (c) 2024 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ +module -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.Extreme -import Mathlib.Analysis.Convex.Jensen -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Combinatorics.Hall.Basic -import Mathlib.Analysis.Convex.DoublyStochasticMatrix -import Mathlib.Tactic.Linarith +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.Extreme +public import Mathlib.Analysis.Convex.Jensen +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Combinatorics.Hall.Basic +public import Mathlib.Analysis.Convex.DoublyStochasticMatrix +public import Mathlib.Tactic.Linarith /-! # Birkhoff's theorem @@ -34,6 +35,8 @@ import Mathlib.Tactic.Linarith Doubly stochastic, Birkhoff's theorem, Birkhoff-von Neumann theorem -/ +@[expose] public section + open Finset Function Matrix variable {R n : Type*} [Fintype n] [DecidableEq n] diff --git a/Mathlib/Analysis/Convex/Body.lean b/Mathlib/Analysis/Convex/Body.lean index c564d089bf84d5..a7f1f1e6644ce5 100644 --- a/Mathlib/Analysis/Convex/Body.lean +++ b/Mathlib/Analysis/Convex/Body.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Paul A. Reichert. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul A. Reichert -/ -import Mathlib.Analysis.Convex.Basic -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Topology.MetricSpace.HausdorffDistance +module + +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Topology.MetricSpace.HausdorffDistance /-! # Convex bodies @@ -29,6 +31,8 @@ If `V` is a normed space, `ConvexBody V` is a metric space. convex, convex body -/ +@[expose] public section + open scoped Pointwise Topology NNReal diff --git a/Mathlib/Analysis/Convex/Caratheodory.lean b/Mathlib/Analysis/Convex/Caratheodory.lean index 24e2146648a77e..7cd7dd08e02fe2 100644 --- a/Mathlib/Analysis/Convex/Caratheodory.lean +++ b/Mathlib/Analysis/Convex/Caratheodory.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kim Morrison -/ -import Mathlib.Analysis.Convex.Combination -import Mathlib.LinearAlgebra.AffineSpace.Independent -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.LinearAlgebra.AffineSpace.Independent +public import Mathlib.Tactic.FieldSimp /-! # Carathéodory's convexity theorem @@ -36,6 +38,8 @@ convex hull, caratheodory -/ +@[expose] public section + open Set Finset diff --git a/Mathlib/Analysis/Convex/Combination.lean b/Mathlib/Analysis/Convex/Combination.lean index 034ac583b040e6..5663a3b051f93c 100644 --- a/Mathlib/Analysis/Convex/Combination.lean +++ b/Mathlib/Analysis/Convex/Combination.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Analysis.Convex.Hull -import Mathlib.LinearAlgebra.AffineSpace.Basis +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Analysis.Convex.Hull +public import Mathlib.LinearAlgebra.AffineSpace.Basis /-! # Convex combinations @@ -23,6 +25,8 @@ mathematical arguments go: one doesn't change weights, but merely adds some. Thi lemmas unconditional on the sum of the weights being `1`. -/ +@[expose] public section + assert_not_exists Cardinal open Set Function Pointwise @@ -144,6 +148,34 @@ end Finset variable {z} +lemma Finset.centerMass_const (hw : ∑ j ∈ t, w j ≠ 0) (c : E) : + t.centerMass w (Function.const _ c) = c := by + simp [centerMass, ← sum_smul, hw] + +lemma Finset.centerMass_congr [DecidableEq ι] {t' : Finset ι} {w' : ι → R} {z' : ι → E} + (h : ∀ i, (i ∈ t ∧ w i ≠ 0 ∨ i ∈ t' ∧ w' i ≠ 0) → i ∈ t ∩ t' ∧ w i = w' i ∧ z i = z' i) : + t.centerMass w z = t'.centerMass w' z' := by + classical + rw [← centerMass_filter_ne_zero, centerMass, ← centerMass_filter_ne_zero, centerMass] + congr 1 + · congr 1 + exact sum_congr (by grind) (by grind) + · exact sum_congr (by grind) (by grind) + +lemma Finset.centerMass_congr_finset [DecidableEq ι] {t' : Finset ι} + (h : ∀ i ∈ t ∪ t', w i ≠ 0 → i ∈ t ∩ t') : t.centerMass w z = t'.centerMass w z := + centerMass_congr (by grind) + +lemma Finset.centerMass_congr_weights {w' : ι → R} (h : ∀ i ∈ t, w i = w' i) : + t.centerMass w z = t.centerMass w' z := by + classical + exact centerMass_congr (by grind) + +lemma Finset.centerMass_congr_fun {z' : ι → E} (h : ∀ i ∈ t, w i ≠ 0 → z i = z' i) : + t.centerMass w z = t.centerMass w z' := by + classical + exact centerMass_congr (by grind) + lemma Finset.centerMass_of_sum_add_sum_eq_zero {s t : Finset ι} (hw : ∑ i ∈ s, w i + ∑ i ∈ t, w i = 0) (hz : ∑ i ∈ s, w i • z i + ∑ i ∈ t, w i • z i = 0) : s.centerMass w z = t.centerMass w z := by diff --git a/Mathlib/Analysis/Convex/Cone/Basic.lean b/Mathlib/Analysis/Convex/Cone/Basic.lean index 912c1dc8a91dc3..1608813feca05c 100644 --- a/Mathlib/Analysis/Convex/Cone/Basic.lean +++ b/Mathlib/Analysis/Convex/Cone/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Apurva Nakade. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Apurva Nakade, Yaël Dillies -/ -import Mathlib.Analysis.Convex.Cone.Closure -import Mathlib.Geometry.Convex.Cone.Pointed -import Mathlib.Topology.Algebra.Module.ClosedSubmodule -import Mathlib.Topology.Algebra.Order.Module -import Mathlib.Topology.Order.DenselyOrdered +module + +public import Mathlib.Analysis.Convex.Cone.Closure +public import Mathlib.Geometry.Convex.Cone.Pointed +public import Mathlib.Topology.Algebra.Module.ClosedSubmodule +public import Mathlib.Topology.Algebra.Order.Module +public import Mathlib.Topology.Order.DenselyOrdered /-! # Proper cones @@ -40,6 +42,8 @@ The next steps are: -/ +@[expose] public section + open ContinuousLinearMap Filter Function Set variable {𝕜 R E F G : Type*} [Semiring R] [PartialOrder R] [IsOrderedRing R] diff --git a/Mathlib/Analysis/Convex/Cone/Closure.lean b/Mathlib/Analysis/Convex/Cone/Closure.lean index cc068ef35c076d..c73d84a0e28790 100644 --- a/Mathlib/Analysis/Convex/Cone/Closure.lean +++ b/Mathlib/Analysis/Convex/Cone/Closure.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Apurva Nakade. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Apurva Nakade -/ -import Mathlib.Geometry.Convex.Cone.Pointed -import Mathlib.Topology.Algebra.ConstMulAction -import Mathlib.Topology.Algebra.Monoid.Defs +module + +public import Mathlib.Geometry.Convex.Cone.Pointed +public import Mathlib.Topology.Algebra.ConstMulAction +public import Mathlib.Topology.Algebra.Monoid.Defs /-! # Closure of cones @@ -15,6 +17,8 @@ defining maps between proper cones. The current API is basic and should be exten -/ +@[expose] public section + namespace ConvexCone variable {𝕜 : Type*} [Semiring 𝕜] [PartialOrder 𝕜] diff --git a/Mathlib/Analysis/Convex/Cone/Dual.lean b/Mathlib/Analysis/Convex/Cone/Dual.lean index bafdd03547bcad..21dea2da14012b 100644 --- a/Mathlib/Analysis/Convex/Cone/Dual.lean +++ b/Mathlib/Analysis/Convex/Cone/Dual.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Analysis.Convex.Cone.Basic -import Mathlib.Analysis.LocallyConvex.Separation -import Mathlib.Geometry.Convex.Cone.Dual -import Mathlib.Topology.Algebra.Module.PerfectPairing +module + +public import Mathlib.Analysis.Convex.Cone.Basic +public import Mathlib.Analysis.LocallyConvex.Separation +public import Mathlib.Geometry.Convex.Cone.Dual +public import Mathlib.Topology.Algebra.Module.PerfectPairing /-! # The topological dual of a cone and Farkas' lemma @@ -37,6 +39,8 @@ We prove the following theorems: * https://en.wikipedia.org/wiki/Farkas%27_lemma#Geometric_interpretation -/ +@[expose] public section + assert_not_exists InnerProductSpace open Set LinearMap Pointwise diff --git a/Mathlib/Analysis/Convex/Cone/Extension.lean b/Mathlib/Analysis/Convex/Cone/Extension.lean index e9863a33f4ca12..1bfa70c64b8b7d 100644 --- a/Mathlib/Analysis/Convex/Cone/Extension.lean +++ b/Mathlib/Analysis/Convex/Cone/Extension.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Frédéric Dupuis -/ -import Mathlib.Data.Real.Archimedean -import Mathlib.Geometry.Convex.Cone.Basic -import Mathlib.LinearAlgebra.LinearPMap +module + +public import Mathlib.Data.Real.Archimedean +public import Mathlib.Geometry.Convex.Cone.Basic +public import Mathlib.LinearAlgebra.LinearPMap /-! # Extension theorems @@ -25,6 +27,8 @@ We prove two extension theorems: -/ +@[expose] public section + open Set LinearMap variable {𝕜 E F G : Type*} diff --git a/Mathlib/Analysis/Convex/Cone/InnerDual.lean b/Mathlib/Analysis/Convex/Cone/InnerDual.lean index f8dc12c7594956..1dbba0524fde98 100644 --- a/Mathlib/Analysis/Convex/Cone/InnerDual.lean +++ b/Mathlib/Analysis/Convex/Cone/InnerDual.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yaël Dillies -/ -import Mathlib.Analysis.Convex.Cone.Dual -import Mathlib.Analysis.InnerProductSpace.Adjoint +module + +public import Mathlib.Analysis.Convex.Cone.Dual +public import Mathlib.Analysis.InnerProductSpace.Adjoint /-! # Inner dual cone of a set @@ -33,6 +35,8 @@ Furthermore, the strict version `{y | ∀ x ∈ s, 0 < ⟪x, y⟫}` is a candida `ConvexCone.innerDual`. -/ +@[expose] public section + open Set LinearMap Pointwise open scoped RealInnerProductSpace @@ -60,7 +64,7 @@ def innerDual (s : Set E) : ProperCone ℝ E := .dual (innerₗ E) s /-- Dual cone of the total space is the convex cone `{0}`. -/ @[simp] lemma innerDual_univ : innerDual (univ : Set E) = ⊥ := - le_antisymm (fun x hx ↦ by simpa [← real_inner_self_nonpos] using hx (mem_univ (-x))) (by simp) + le_antisymm (fun x hx ↦ by simpa using hx (mem_univ (-x))) (by simp) @[gcongr] lemma innerDual_le_innerDual (h : t ⊆ s) : innerDual s ≤ innerDual t := fun _y hy _x hx ↦ hy (h hx) @@ -179,7 +183,7 @@ theorem innerDualCone_univ : (univ : Set H).innerDualCone = 0 := by suffices ∀ x : H, x ∈ (univ : Set H).innerDualCone → x = 0 by apply SetLike.coe_injective exact eq_singleton_iff_unique_mem.mpr ⟨fun x _ => (inner_zero_right _).ge, this⟩ - exact fun x hx => by simpa [← real_inner_self_nonpos] using hx (-x) (mem_univ _) + exact fun x hx => by simpa using hx (-x) (mem_univ _) variable {s t} in set_option linter.deprecated false in diff --git a/Mathlib/Analysis/Convex/Continuous.lean b/Mathlib/Analysis/Convex/Continuous.lean index 753a8db59281a5..912e7621d6deef 100644 --- a/Mathlib/Analysis/Convex/Continuous.lean +++ b/Mathlib/Analysis/Convex/Continuous.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies, Zichen Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Zichen Wang -/ -import Mathlib.Analysis.Normed.Affine.Convex +module + +public import Mathlib.Analysis.Normed.Affine.Convex /-! # Convex functions are continuous @@ -12,6 +14,8 @@ This file proves that a convex function from a finite-dimensional real normed sp continuous. -/ +@[expose] public section + open FiniteDimensional Metric Set List Bornology open scoped Topology diff --git a/Mathlib/Analysis/Convex/ContinuousLinearEquiv.lean b/Mathlib/Analysis/Convex/ContinuousLinearEquiv.lean index a122e133f14112..a30e2a684d9184 100644 --- a/Mathlib/Analysis/Convex/ContinuousLinearEquiv.lean +++ b/Mathlib/Analysis/Convex/ContinuousLinearEquiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Strict -import Mathlib.Topology.Algebra.Module.Equiv +module + +public import Mathlib.Analysis.Convex.Strict +public import Mathlib.Topology.Algebra.Module.Equiv /-! # (Pre)images of strict convex sets under continuous linear equivalences @@ -13,6 +15,8 @@ In this file we prove that the (pre)image of a strict convex set under a continuous linear equivalence is a strict convex set. -/ +@[expose] public section + variable {𝕜 E F : Type*} [Field 𝕜] [PartialOrder 𝕜] [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] diff --git a/Mathlib/Analysis/Convex/Contractible.lean b/Mathlib/Analysis/Convex/Contractible.lean index 44ce20925acfce..bcdd0740641f14 100644 --- a/Mathlib/Analysis/Convex/Contractible.lean +++ b/Mathlib/Analysis/Convex/Contractible.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Star -import Mathlib.Topology.Homotopy.Contractible +module + +public import Mathlib.Analysis.Convex.Star +public import Mathlib.Topology.Homotopy.Contractible /-! # A convex set is contractible @@ -13,6 +15,8 @@ In this file we prove that a (star) convex set in a real topological vector spac topological space. -/ +@[expose] public section + variable {E : Type*} [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] [ContinuousAdd E] [ContinuousSMul ℝ E] {s : Set E} {x : E} diff --git a/Mathlib/Analysis/Convex/Deriv.lean b/Mathlib/Analysis/Convex/Deriv.lean index ec1917e2d28d4c..1dbb1cf5a2ac0e 100644 --- a/Mathlib/Analysis/Convex/Deriv.lean +++ b/Mathlib/Analysis/Convex/Deriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov, David Loeffler -/ -import Mathlib.Analysis.Convex.Slope -import Mathlib.Analysis.Calculus.Deriv.MeanValue +module + +public import Mathlib.Analysis.Convex.Slope +public import Mathlib.Analysis.Calculus.Deriv.MeanValue /-! # Convexity of functions and derivatives @@ -19,6 +21,8 @@ Here we relate convexity of functions `ℝ → ℝ` to properties of their deriv monotone. -/ +@[expose] public section + open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Topology NNReal diff --git a/Mathlib/Analysis/Convex/DoublyStochasticMatrix.lean b/Mathlib/Analysis/Convex/DoublyStochasticMatrix.lean index b0d67ade3d03d7..7a65912e0ff688 100644 --- a/Mathlib/Analysis/Convex/DoublyStochasticMatrix.lean +++ b/Mathlib/Analysis/Convex/DoublyStochasticMatrix.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ +module -import Mathlib.Analysis.Convex.Basic -import Mathlib.LinearAlgebra.Matrix.Permutation +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.LinearAlgebra.Matrix.Permutation /-! # Doubly stochastic matrices @@ -31,6 +32,8 @@ Show that the submonoid of doubly stochastic matrices is the meet of them, or re Doubly stochastic, Birkhoff's theorem, Birkhoff-von Neumann theorem -/ +@[expose] public section + open Finset Function Matrix variable {R n : Type*} [Fintype n] [DecidableEq n] diff --git a/Mathlib/Analysis/Convex/EGauge.lean b/Mathlib/Analysis/Convex/EGauge.lean index d0cee846f89ecf..5f897fd244b25a 100644 --- a/Mathlib/Analysis/Convex/EGauge.lean +++ b/Mathlib/Analysis/Convex/EGauge.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Seminorm -import Mathlib.GroupTheory.GroupAction.Pointwise +module + +public import Mathlib.Analysis.Seminorm +public import Mathlib.GroupTheory.GroupAction.Pointwise /-! # The Minkowski functional, normed field version @@ -25,6 +27,8 @@ Currently, we can't reuse results about `egauge` for `gauge`, because we lack a theory of normed semifields. -/ +@[expose] public section + open Function Set Filter Metric open scoped Topology Pointwise ENNReal NNReal diff --git a/Mathlib/Analysis/Convex/Exposed.lean b/Mathlib/Analysis/Convex/Exposed.lean index 4f4fb377955d4b..d01762dabdb571 100644 --- a/Mathlib/Analysis/Convex/Exposed.lean +++ b/Mathlib/Analysis/Convex/Exposed.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Convex.Extreme -import Mathlib.Analysis.Convex.Function -import Mathlib.Topology.Algebra.Module.LinearMap -import Mathlib.Topology.Order.OrderClosed +module + +public import Mathlib.Analysis.Convex.Extreme +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Topology.Algebra.Module.LinearMap +public import Mathlib.Topology.Order.OrderClosed /-! # Exposed sets @@ -39,6 +41,8 @@ See chapter 8 of [Barry Simon, *Convexity*][simon2011] Prove lemmas relating exposed sets and points to the intrinsic frontier. -/ +@[expose] public section + open Affine Set section PreorderSemiring diff --git a/Mathlib/Analysis/Convex/Extrema.lean b/Mathlib/Analysis/Convex/Extrema.lean index f5bfc1960b0f8e..a62c3558f8d957 100644 --- a/Mathlib/Analysis/Convex/Extrema.lean +++ b/Mathlib/Analysis/Convex/Extrema.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Analysis.Convex.Function -import Mathlib.Topology.Algebra.Affine -import Mathlib.Topology.Order.LocalExtr -import Mathlib.Topology.MetricSpace.Pseudo.Lemmas +module + +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Topology.Algebra.Affine +public import Mathlib.Topology.Order.LocalExtr +public import Mathlib.Topology.MetricSpace.Pseudo.Lemmas /-! # Minima and maxima of convex functions @@ -15,6 +17,8 @@ We show that if a function `f : E → β` is convex, then a local minimum is als a global minimum, and likewise for concave functions. -/ +@[expose] public section + variable {E β : Type*} [AddCommGroup E] [TopologicalSpace E] [Module ℝ E] [IsTopologicalAddGroup E] [ContinuousSMul ℝ E] [AddCommGroup β] [PartialOrder β] [IsOrderedAddMonoid β] diff --git a/Mathlib/Analysis/Convex/Extreme.lean b/Mathlib/Analysis/Convex/Extreme.lean index 6a19eed4c9e065..79bc2c4b3a7776 100644 --- a/Mathlib/Analysis/Convex/Extreme.lean +++ b/Mathlib/Analysis/Convex/Extreme.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Convex.Hull +module + +public import Mathlib.Analysis.Convex.Hull /-! # Extreme sets @@ -38,6 +40,8 @@ See chapter 8 of [Barry Simon, *Convexity*][simon2011] Prove lemmas relating extreme sets and points to the intrinsic frontier. -/ +@[expose] public section + open Function Set Affine diff --git a/Mathlib/Analysis/Convex/Function.lean b/Mathlib/Analysis/Convex/Function.lean index 52942da269231a..587c44475e366e 100644 --- a/Mathlib/Analysis/Convex/Function.lean +++ b/Mathlib/Analysis/Convex/Function.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, François Dupuis -/ -import Mathlib.Analysis.Convex.Basic -import Mathlib.Order.Filter.Extr -import Mathlib.Tactic.NormNum +module + +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.Order.Filter.Extr +public import Mathlib.Tactic.NormNum /-! # Convex and concave functions @@ -26,6 +28,8 @@ a convex set. * `StrictConcaveOn 𝕜 s f`: The function `f` is strictly concave on `s` with scalars `𝕜`. -/ +@[expose] public section + open LinearMap Set Convex Pointwise variable {𝕜 E F α β ι : Type*} diff --git a/Mathlib/Analysis/Convex/Gauge.lean b/Mathlib/Analysis/Convex/Gauge.lean index 1dde64f29bd3c0..e05a4f8f34a02a 100644 --- a/Mathlib/Analysis/Convex/Gauge.lean +++ b/Mathlib/Analysis/Convex/Gauge.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Convex.Topology -import Mathlib.Analysis.Normed.Module.Ball.Pointwise -import Mathlib.Analysis.Seminorm -import Mathlib.Analysis.LocallyConvex.Bounded -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.Analysis.Convex.Topology +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise +public import Mathlib.Analysis.Seminorm +public import Mathlib.Analysis.LocallyConvex.Bounded +public import Mathlib.Analysis.RCLike.Basic /-! # The Minkowski functional @@ -36,6 +38,8 @@ For a real vector space, Minkowski functional, gauge -/ +@[expose] public section + open NormedField Set open scoped Pointwise Topology NNReal diff --git a/Mathlib/Analysis/Convex/GaugeRescale.lean b/Mathlib/Analysis/Convex/GaugeRescale.lean index 64784ae3b43688..93d718b659f978 100644 --- a/Mathlib/Analysis/Convex/GaugeRescale.lean +++ b/Mathlib/Analysis/Convex/GaugeRescale.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Gauge -import Mathlib.Analysis.Normed.Module.Convex +module + +public import Mathlib.Analysis.Convex.Gauge +public import Mathlib.Analysis.Normed.Module.Convex /-! # "Gauge rescale" homeomorphism between convex sets @@ -15,6 +17,8 @@ that sends the interior, the closure, and the frontier of one set to the interior, the closure, and the frontier of the other set. -/ +@[expose] public section + open Metric Bornology Filter Set open scoped NNReal Topology Pointwise diff --git a/Mathlib/Analysis/Convex/Hull.lean b/Mathlib/Analysis/Convex/Hull.lean index cc8c782ab62e70..d9feb4d859895c 100644 --- a/Mathlib/Analysis/Convex/Hull.lean +++ b/Mathlib/Analysis/Convex/Hull.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Analysis.Convex.Basic -import Mathlib.Order.Closure +module + +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.Order.Closure /-! # Convex hull @@ -19,6 +21,8 @@ while the impact on writing code is minimal as `convexHull 𝕜 s` is automatica `(convexHull 𝕜) s`. -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/Convex/Independent.lean b/Mathlib/Analysis/Convex/Independent.lean index 987a227caa15f7..321d90af666632 100644 --- a/Mathlib/Analysis/Convex/Independent.lean +++ b/Mathlib/Analysis/Convex/Independent.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.Extreme +module + +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.Extreme /-! # Convex independence @@ -39,6 +41,8 @@ and `Finset.centerMass`. independence, convex position -/ +@[expose] public section + open Affine Finset Function diff --git a/Mathlib/Analysis/Convex/Integral.lean b/Mathlib/Analysis/Convex/Integral.lean index 296efa97a585f1..ce945ee5cd7e95 100644 --- a/Mathlib/Analysis/Convex/Integral.lean +++ b/Mathlib/Analysis/Convex/Integral.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Function -import Mathlib.Analysis.Convex.StrictConvexSpace -import Mathlib.MeasureTheory.Function.AEEqOfIntegral -import Mathlib.MeasureTheory.Integral.Average +module + +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Analysis.Convex.StrictConvexSpace +public import Mathlib.MeasureTheory.Function.AEEqOfIntegral +public import Mathlib.MeasureTheory.Integral.Average /-! # Jensen's inequality for integrals @@ -34,6 +36,8 @@ In this file we prove several forms of Jensen's inequality for integrals. convex, integral, center mass, average value, Jensen's inequality -/ +@[expose] public section + open MeasureTheory MeasureTheory.Measure Metric Set Filter TopologicalSpace Function diff --git a/Mathlib/Analysis/Convex/Intrinsic.lean b/Mathlib/Analysis/Convex/Intrinsic.lean index d5d77d1a61c4ba..14f5aa3e67192c 100644 --- a/Mathlib/Analysis/Convex/Intrinsic.lean +++ b/Mathlib/Analysis/Convex/Intrinsic.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Paul Reichert. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Reichert, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Affine.AddTorsorBases +module + +public import Mathlib.Analysis.Normed.Affine.AddTorsorBases /-! # Intrinsic frontier and interior @@ -43,6 +45,8 @@ The main results are: * `x ∈ s → y ∈ intrinsicInterior 𝕜 s → openSegment 𝕜 x y ⊆ intrinsicInterior 𝕜 s` -/ +@[expose] public section + open AffineSubspace Set Topology open scoped Pointwise diff --git a/Mathlib/Analysis/Convex/Jensen.lean b/Mathlib/Analysis/Convex/Jensen.lean index 908e8b62643cea..d2b9b87cc07c5b 100644 --- a/Mathlib/Analysis/Convex/Jensen.lean +++ b/Mathlib/Analysis/Convex/Jensen.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.Function -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Tactic.FieldSimp /-! # Jensen's inequality and maximum principle for convex functions @@ -30,6 +32,8 @@ As corollaries, we get: * `ConcaveOn.exists_le_of_mem_convexHull`: Minimum principle for concave functions. -/ +@[expose] public section + open Finset LinearMap Set Convex Pointwise diff --git a/Mathlib/Analysis/Convex/Join.lean b/Mathlib/Analysis/Convex/Join.lean index b97b3e535c7fd1..c69e166f64635c 100644 --- a/Mathlib/Analysis/Convex/Join.lean +++ b/Mathlib/Analysis/Convex/Join.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Convex.Hull +module + +public import Mathlib.Analysis.Convex.Hull /-! # Convex join @@ -13,6 +15,8 @@ segments with one end in `s` and the other in `t`. This is notably a useful gadg convex hulls of finite sets. -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/Convex/KreinMilman.lean b/Mathlib/Analysis/Convex/KreinMilman.lean index ae6495c6f0103b..c735beb6570288 100644 --- a/Mathlib/Analysis/Convex/KreinMilman.lean +++ b/Mathlib/Analysis/Convex/KreinMilman.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Convex.Exposed -import Mathlib.Analysis.LocallyConvex.Separation -import Mathlib.Topology.Algebra.ContinuousAffineMap +module + +public import Mathlib.Analysis.Convex.Exposed +public import Mathlib.Analysis.LocallyConvex.Separation +public import Mathlib.Topology.Algebra.ContinuousAffineMap /-! # The Krein-Milman theorem @@ -50,6 +52,8 @@ See chapter 8 of [Barry Simon, *Convexity*][simon2011] -/ +@[expose] public section + open Set variable {E F : Type*} [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] [T2Space E] diff --git a/Mathlib/Analysis/Convex/LinearIsometry.lean b/Mathlib/Analysis/Convex/LinearIsometry.lean index bef0b57a7f93d3..ec2730471fe3a1 100644 --- a/Mathlib/Analysis/Convex/LinearIsometry.lean +++ b/Mathlib/Analysis/Convex/LinearIsometry.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.ContinuousLinearEquiv -import Mathlib.Analysis.Convex.StrictConvexSpace -import Mathlib.Analysis.Normed.Operator.LinearIsometry +module + +public import Mathlib.Analysis.Convex.ContinuousLinearEquiv +public import Mathlib.Analysis.Convex.StrictConvexSpace +public import Mathlib.Analysis.Normed.Operator.LinearIsometry /-! # (Strict) convexity and linear isometries @@ -13,6 +15,8 @@ import Mathlib.Analysis.Normed.Operator.LinearIsometry In this file we prove some basic lemmas about (strict) convexity and linear isometries. -/ +@[expose] public section + open Function Set Metric open scoped Convex diff --git a/Mathlib/Analysis/Convex/Measure.lean b/Mathlib/Analysis/Convex/Measure.lean index d2784c998dd189..d792c87a563ad6 100644 --- a/Mathlib/Analysis/Convex/Measure.lean +++ b/Mathlib/Analysis/Convex/Measure.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Affine.AddTorsorBases -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +module + +public import Mathlib.Analysis.Normed.Affine.AddTorsorBases +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar /-! # Convex sets are null-measurable @@ -15,6 +17,8 @@ convex set in `E`. Then the frontier of `s` has measure zero (see `Convex.addHaa `s` is a `NullMeasurableSet` (see `Convex.nullMeasurableSet`). -/ +@[expose] public section + open MeasureTheory MeasureTheory.Measure Set Metric Filter Bornology diff --git a/Mathlib/Analysis/Convex/Mul.lean b/Mathlib/Analysis/Convex/Mul.lean index 10f4a3a1b1085f..23f3de90e0fdd1 100644 --- a/Mathlib/Analysis/Convex/Mul.lean +++ b/Mathlib/Analysis/Convex/Mul.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Monovary -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Analysis.Convex.Function -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.Order.Monovary +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Tactic.FieldSimp /-! # Product of convex functions @@ -19,6 +21,8 @@ As corollaries, we also prove that `x ↦ x ^ n` is convex * `convexOn_zpow`: over $(0, +∞)$ For `n : ℤ`. -/ +@[expose] public section + open Set variable {𝕜 E F G : Type*} diff --git a/Mathlib/Analysis/Convex/PartitionOfUnity.lean b/Mathlib/Analysis/Convex/PartitionOfUnity.lean index 08634daa0deabc..8b60e782c399fd 100644 --- a/Mathlib/Analysis/Convex/PartitionOfUnity.lean +++ b/Mathlib/Analysis/Convex/PartitionOfUnity.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Topology.PartitionOfUnity -import Mathlib.Analysis.Convex.Combination +module + +public import Mathlib.Topology.PartitionOfUnity +public import Mathlib.Analysis.Convex.Combination /-! # Partition of unity and convex sets @@ -24,6 +26,8 @@ assumes that local functions `g` are constants. partition of unity -/ +@[expose] public section + open Set Function diff --git a/Mathlib/Analysis/Convex/PathConnected.lean b/Mathlib/Analysis/Convex/PathConnected.lean index 8911d79385a5bc..c2953ba0475bca 100644 --- a/Mathlib/Analysis/Convex/PathConnected.lean +++ b/Mathlib/Analysis/Convex/PathConnected.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Basic -import Mathlib.LinearAlgebra.Projection -import Mathlib.Topology.Connected.PathConnected +module + +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.LinearAlgebra.Projection +public import Mathlib.Topology.Connected.PathConnected /-! # Segment between 2 points as a bundled path @@ -18,6 +20,8 @@ then use it to show that a nonempty convex set is path connected. In particular, a topological vector space over `ℝ` is path connected. -/ +@[expose] public section + open AffineMap Set open scoped Convex unitInterval diff --git a/Mathlib/Analysis/Convex/Piecewise.lean b/Mathlib/Analysis/Convex/Piecewise.lean index 34aa739ed942f4..0252500303fb32 100644 --- a/Mathlib/Analysis/Convex/Piecewise.lean +++ b/Mathlib/Analysis/Convex/Piecewise.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Horner -/ -import Mathlib.Analysis.Convex.Function +module + +public import Mathlib.Analysis.Convex.Function /-! # Convex and concave piecewise functions @@ -26,6 +28,8 @@ This file proves convex and concave theorems for piecewise functions. and `concaveOn_univ_piecewise_Ici_of_antitoneOn_Ici_monotoneOn_Iic`. -/ +@[expose] public section + variable {𝕜 E β : Type*} [Semiring 𝕜] [PartialOrder 𝕜] [AddCommMonoid E] [LinearOrder E] [IsOrderedAddMonoid E] [Module 𝕜 E] diff --git a/Mathlib/Analysis/Convex/Quasiconvex.lean b/Mathlib/Analysis/Convex/Quasiconvex.lean index 29aa8940314d8b..dce949157316b7 100644 --- a/Mathlib/Analysis/Convex/Quasiconvex.lean +++ b/Mathlib/Analysis/Convex/Quasiconvex.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Convex.Function +module + +public import Mathlib.Analysis.Convex.Function /-! # Quasiconvex and quasiconcave functions @@ -26,6 +28,8 @@ quasiconcavity, and monotonicity implies quasilinearity. * https://en.wikipedia.org/wiki/Quasiconvex_function -/ +@[expose] public section + open Function OrderDual Set diff --git a/Mathlib/Analysis/Convex/Radon.lean b/Mathlib/Analysis/Convex/Radon.lean index 0d439c68f9f40c..26b4640e647e6b 100644 --- a/Mathlib/Analysis/Convex/Radon.lean +++ b/Mathlib/Analysis/Convex/Radon.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ -import Mathlib.Analysis.Convex.Combination -import Mathlib.Data.Set.Card -import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional -import Mathlib.Topology.Separation.Hausdorff +module + +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Data.Set.Card +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.Topology.Separation.Hausdorff /-! # Radon's theorem on convex sets @@ -26,6 +28,8 @@ compactness of sets (see `helly_theorem_compact`). convex hull, affine independence, Radon, Helly -/ +@[expose] public section + open Fintype Finset Set namespace Convex diff --git a/Mathlib/Analysis/Convex/Segment.lean b/Mathlib/Analysis/Convex/Segment.lean index 5c3e19c36ffdce..2158cde112a090 100644 --- a/Mathlib/Analysis/Convex/Segment.lean +++ b/Mathlib/Analysis/Convex/Segment.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov, Yaël Dillies -/ -import Mathlib.LinearAlgebra.AffineSpace.Midpoint -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas -import Mathlib.LinearAlgebra.Ray +module + +public import Mathlib.LinearAlgebra.AffineSpace.Midpoint +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +public import Mathlib.LinearAlgebra.Ray /-! # Segments in vector spaces @@ -27,6 +29,8 @@ Should we rename `segment` and `openSegment` to `convex.Icc` and `convex.Ioo`? S define `clopenSegment`/`convex.Ico`/`convex.Ioc`? -/ +@[expose] public section + variable {𝕜 E F G ι : Type*} {M : ι → Type*} open Function Set diff --git a/Mathlib/Analysis/Convex/Side.lean b/Mathlib/Analysis/Convex/Side.lean index e9a35281ebb1b0..b1e186438d6c16 100644 --- a/Mathlib/Analysis/Convex/Side.lean +++ b/Mathlib/Analysis/Convex/Side.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Convex.Between -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Analysis.Normed.Module.Convex +module + +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Analysis.Normed.Module.Convex /-! # Sides of affine subspaces @@ -25,6 +27,8 @@ This file defines notions of two points being on the same or opposite sides of a -/ +@[expose] public section + variable {R V V' P P' : Type*} diff --git a/Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean b/Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean index 6294376bdfa559..348e8549fec6aa 100644 --- a/Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean +++ b/Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Convex.Hull -import Mathlib.LinearAlgebra.AffineSpace.Independent +module + +public import Mathlib.Analysis.Convex.Hull +public import Mathlib.LinearAlgebra.AffineSpace.Independent /-! # Simplicial complexes @@ -40,6 +42,8 @@ vertices. Simplicial complexes can be generalized to affine spaces once `ConvexHull` has been ported. -/ +@[expose] public section + open Finset Set diff --git a/Mathlib/Analysis/Convex/Slope.lean b/Mathlib/Analysis/Convex/Slope.lean index 8c1bceb44c2698..e83eb5e72e0c04 100644 --- a/Mathlib/Analysis/Convex/Slope.lean +++ b/Mathlib/Analysis/Convex/Slope.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Malo Jaffré -/ -import Mathlib.Analysis.Convex.Function -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Linarith /-! # Slopes of convex functions @@ -17,6 +19,8 @@ of their slopes. The main use is to show convexity/concavity from monotonicity of the derivative. -/ +@[expose] public section + variable {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} /-- If `f : 𝕜 → 𝕜` is convex, then for any three points `x < y < z` the slope of the secant line of diff --git a/Mathlib/Analysis/Convex/SpecificFunctions/Basic.lean b/Mathlib/Analysis/Convex/SpecificFunctions/Basic.lean index f5043c0024fb71..b8b7e373f71429 100644 --- a/Mathlib/Analysis/Convex/SpecificFunctions/Basic.lean +++ b/Mathlib/Analysis/Convex/SpecificFunctions/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel, Heather Macbeth -/ -import Mathlib.Analysis.Convex.Slope -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Analysis.Convex.Slope +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Tactic.LinearCombination /-! # Collection of convex functions @@ -31,6 +33,8 @@ theory. `Mathlib/Analysis/Convex/Mul.lean` for convexity of `x ↦ x ^ n` -/ +@[expose] public section + open Real Set NNReal /-- `Real.exp` is strictly convex on the whole real line. -/ diff --git a/Mathlib/Analysis/Convex/SpecificFunctions/Deriv.lean b/Mathlib/Analysis/Convex/SpecificFunctions/Deriv.lean index 1a3b05034a1ed1..a545695270ba34 100644 --- a/Mathlib/Analysis/Convex/SpecificFunctions/Deriv.lean +++ b/Mathlib/Analysis/Convex/SpecificFunctions/Deriv.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.ZPow -import Mathlib.Analysis.SpecialFunctions.Sqrt -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv -import Mathlib.Analysis.Convex.Deriv +module + +public import Mathlib.Analysis.Calculus.Deriv.ZPow +public import Mathlib.Analysis.SpecialFunctions.Sqrt +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +public import Mathlib.Analysis.Convex.Deriv /-! # Collection of convex functions @@ -29,6 +31,8 @@ of these could also be switched to elementary proofs, like in -/ +@[expose] public section + open Real Set diff --git a/Mathlib/Analysis/Convex/SpecificFunctions/Pow.lean b/Mathlib/Analysis/Convex/SpecificFunctions/Pow.lean index b05c631bd7793a..e2dbd993ef6adb 100644 --- a/Mathlib/Analysis/Convex/SpecificFunctions/Pow.lean +++ b/Mathlib/Analysis/Convex/SpecificFunctions/Pow.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.Convex.SpecificFunctions.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.Analysis.Convex.SpecificFunctions.Basic +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal /-! # Convexity properties of `rpow` @@ -27,6 +28,8 @@ requires slightly less imports. * Prove convexity for negative powers. -/ +@[expose] public section + open Set namespace NNReal diff --git a/Mathlib/Analysis/Convex/Star.lean b/Mathlib/Analysis/Convex/Star.lean index 5df52c577fd038..217bd3c0f25245 100644 --- a/Mathlib/Analysis/Convex/Star.lean +++ b/Mathlib/Analysis/Convex/Star.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set -import Mathlib.Algebra.Module.LinearMap.Prod -import Mathlib.Algebra.Order.Module.Synonym -import Mathlib.Analysis.Convex.Segment -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.Module +module + +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set +public import Mathlib.Algebra.Module.LinearMap.Prod +public import Mathlib.Algebra.Order.Module.Synonym +public import Mathlib.Analysis.Convex.Segment +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.Module /-! # Star-convex sets @@ -46,6 +48,8 @@ Star-convex sets are contractible. A nonempty open star-convex set in `ℝ^n` is diffeomorphic to the entire space. -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/Convex/StdSimplex.lean b/Mathlib/Analysis/Convex/StdSimplex.lean index 4e40144e1345a2..9fc659b06df1e6 100644 --- a/Mathlib/Analysis/Convex/StdSimplex.lean +++ b/Mathlib/Analysis/Convex/StdSimplex.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov, Yaël Dillies, Joël Riou -/ -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.PathConnected -import Mathlib.Topology.Algebra.Monoid.FunOnFinite -import Mathlib.Topology.MetricSpace.ProperSpace.Real -import Mathlib.Topology.UnitInterval +module + +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.PathConnected +public import Mathlib.Topology.Algebra.Monoid.FunOnFinite +public import Mathlib.Topology.MetricSpace.ProperSpace.Real +public import Mathlib.Topology.UnitInterval /-! # The standard simplex @@ -21,6 +23,8 @@ When `f : X → Y` is a map between finite types, we define the map -/ +@[expose] public section + open Set Convex Bornology section OrderedSemiring @@ -136,7 +140,7 @@ theorem convexHull_basis_eq_stdSimplex [DecidableEq ι] : exact Finset.univ.centerMass_mem_convexHull (fun i _ => hw₀ i) (hw₁.symm ▸ zero_lt_one) fun i _ => mem_range_self i -/-- `stdSimplex 𝕜 ι` is the convex hull of the points `Pi.single i 1` for `i : `i`. -/ +/-- `stdSimplex 𝕜 ι` is the convex hull of the points `Pi.single i 1` for `i : ι`. -/ theorem convexHull_rangle_single_eq_stdSimplex [DecidableEq ι] : convexHull R (range fun i : ι ↦ Pi.single i 1) = stdSimplex R ι := by convert convexHull_basis_eq_stdSimplex R ι diff --git a/Mathlib/Analysis/Convex/StoneSeparation.lean b/Mathlib/Analysis/Convex/StoneSeparation.lean index 13ac2357d59203..9cf403138d0408 100644 --- a/Mathlib/Analysis/Convex/StoneSeparation.lean +++ b/Mathlib/Analysis/Convex/StoneSeparation.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Convex.Combination -import Mathlib.Analysis.Convex.Join +module + +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Analysis.Convex.Join /-! # Stone's separation theorem @@ -17,6 +19,8 @@ stronger statements: one may find a separating hyperplane, instead of merely a c complement is convex. -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/Convex/Strict.lean b/Mathlib/Analysis/Convex/Strict.lean index 137310445d760f..7db4804180d860 100644 --- a/Mathlib/Analysis/Convex/Strict.lean +++ b/Mathlib/Analysis/Convex/Strict.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Convex.Basic -import Mathlib.Topology.Algebra.Group.Pointwise -import Mathlib.Topology.Order.Basic +module + +public import Mathlib.Analysis.Convex.Basic +public import Mathlib.Topology.Algebra.Group.Pointwise +public import Mathlib.Topology.Order.Basic /-! # Strictly convex sets @@ -15,6 +17,8 @@ This file defines strictly convex sets. A set is strictly convex if the open segment between any two distinct points lies in its interior. -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/Convex/StrictConvexBetween.lean b/Mathlib/Analysis/Convex/StrictConvexBetween.lean index e48860e480acad..139a6b8534b7ef 100644 --- a/Mathlib/Analysis/Convex/StrictConvexBetween.lean +++ b/Mathlib/Analysis/Convex/StrictConvexBetween.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Convex.Between -import Mathlib.Analysis.Convex.StrictConvexSpace -import Mathlib.Analysis.Normed.Affine.AddTorsor -import Mathlib.Analysis.Normed.Affine.Isometry +module + +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Analysis.Convex.StrictConvexSpace +public import Mathlib.Analysis.Normed.Affine.AddTorsor +public import Mathlib.Analysis.Normed.Affine.Isometry /-! # Betweenness in affine spaces for strictly convex spaces @@ -16,6 +18,8 @@ space. -/ +@[expose] public section + open Metric open scoped Convex diff --git a/Mathlib/Analysis/Convex/StrictConvexSpace.lean b/Mathlib/Analysis/Convex/StrictConvexSpace.lean index e1a7c47c964fbd..ebfddc691e2c91 100644 --- a/Mathlib/Analysis/Convex/StrictConvexSpace.lean +++ b/Mathlib/Analysis/Convex/StrictConvexSpace.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Analysis.Normed.Module.Ray -import Mathlib.Analysis.Normed.Module.Ball.Pointwise +module + +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Analysis.Normed.Module.Ray +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise /-! # Strictly convex spaces @@ -52,6 +54,8 @@ formulated only for the case `𝕜 = ℝ`. convex, strictly convex -/ +@[expose] public section + open Convex Pointwise Set Metric /-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only diff --git a/Mathlib/Analysis/Convex/Strong.lean b/Mathlib/Analysis/Convex/Strong.lean index 6e20f81df67c1f..8f863de6b29b77 100644 --- a/Mathlib/Analysis/Convex/Strong.lean +++ b/Mathlib/Analysis/Convex/Strong.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies, Chenyi Li. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chenyi Li, Ziyu Wang, Yaël Dillies -/ -import Mathlib.Analysis.Convex.Function -import Mathlib.Analysis.InnerProductSpace.Basic +module + +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Analysis.InnerProductSpace.Basic /-! # Uniformly and strongly convex functions @@ -23,6 +25,8 @@ If `E` is an inner product space, this is equivalent to `x ↦ f x - m / 2 * ‖ Prove derivative properties of strongly convex functions. -/ +@[expose] public section + open Real variable {E : Type*} [NormedAddCommGroup E] diff --git a/Mathlib/Analysis/Convex/Topology.lean b/Mathlib/Analysis/Convex/Topology.lean index bd3edbf1b59122..38637a64dcd253 100644 --- a/Mathlib/Analysis/Convex/Topology.lean +++ b/Mathlib/Analysis/Convex/Topology.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Strict -import Mathlib.Analysis.Convex.StdSimplex -import Mathlib.Topology.Algebra.Affine -import Mathlib.Topology.Algebra.Module.Basic +module + +public import Mathlib.Analysis.Convex.Strict +public import Mathlib.Analysis.Convex.StdSimplex +public import Mathlib.Topology.Algebra.Affine +public import Mathlib.Topology.Algebra.Module.Basic /-! # Topological properties of convex sets @@ -21,6 +23,8 @@ We prove the following facts: * `Set.Finite.isClosed_convexHull` : convex hull of a finite set is closed. -/ +@[expose] public section + assert_not_exists Cardinal Norm open Metric Bornology Set Pointwise Convex diff --git a/Mathlib/Analysis/Convex/TotallyBounded.lean b/Mathlib/Analysis/Convex/TotallyBounded.lean index b8b6b00c6fdc63..3ad5a554ec550a 100644 --- a/Mathlib/Analysis/Convex/TotallyBounded.lean +++ b/Mathlib/Analysis/Convex/TotallyBounded.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ +module -import Mathlib.Topology.UniformSpace.Cauchy -import Mathlib.Analysis.Convex.Hull -import Mathlib.Topology.Algebra.IsUniformGroup.Basic -import Mathlib.Topology.Algebra.Module.LocallyConvex +public import Mathlib.Topology.UniformSpace.Cauchy +public import Mathlib.Analysis.Convex.Hull +public import Mathlib.Topology.Algebra.IsUniformGroup.Basic +public import Mathlib.Topology.Algebra.Module.LocallyConvex /-! # Totally Bounded sets and Convex Hulls @@ -25,6 +26,8 @@ import Mathlib.Topology.Algebra.Module.LocallyConvex convex, totally bounded -/ +@[expose] public section + open Set Pointwise variable (E : Type*) {s : Set E} diff --git a/Mathlib/Analysis/Convex/Uniform.lean b/Mathlib/Analysis/Convex/Uniform.lean index 130f44f7391b9b..c67baba99aae24 100644 --- a/Mathlib/Analysis/Convex/Uniform.lean +++ b/Mathlib/Analysis/Convex/Uniform.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Convex.StrictConvexSpace +module + +public import Mathlib.Analysis.Convex.StrictConvexSpace /-! # Uniformly convex spaces @@ -29,6 +31,8 @@ the same ray). convex, uniformly convex -/ +@[expose] public section + open Set Metric diff --git a/Mathlib/Analysis/Convex/Visible.lean b/Mathlib/Analysis/Convex/Visible.lean index 6a69d5af982022..c22d2e245e0eb5 100644 --- a/Mathlib/Analysis/Convex/Visible.lean +++ b/Mathlib/Analysis/Convex/Visible.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Algebra.Group.Pointwise.Set.Card -import Mathlib.Analysis.Convex.Between -import Mathlib.Analysis.Convex.Combination -import Mathlib.Topology.Algebra.Affine -import Mathlib.Topology.MetricSpace.Pseudo.Lemmas -import Mathlib.Topology.Order.Monotone +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Algebra.Group.Pointwise.Set.Card +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Analysis.Convex.Combination +public import Mathlib.Topology.Algebra.Affine +public import Mathlib.Topology.MetricSpace.Pseudo.Lemmas +public import Mathlib.Topology.Order.Monotone /-! # Points in sight @@ -23,6 +25,8 @@ The art gallery problem can be stated using the visibility predicate: A set `A` guarded by a finite set `G` (the guards) iff `∀ a ∈ A, ∃ g ∈ G, IsVisible ℝ sᶜ a g`. -/ +@[expose] public section + open AffineMap Filter Finset Set open scoped Cardinal Pointwise Topology diff --git a/Mathlib/Analysis/Convolution.lean b/Mathlib/Analysis/Convolution.lean index 2834c755f1e19d..f98b67b4b0c6d9 100644 --- a/Mathlib/Analysis/Convolution.lean +++ b/Mathlib/Analysis/Convolution.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.ParametricIntegral -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Function.LocallyIntegrable -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Group.Prod -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.ParametricIntegral +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Function.LocallyIntegrable +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Group.Prod +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Convolution of functions @@ -88,6 +90,8 @@ The following notations are localized in the scope `Convolution`: * Prove properties about the convolution if both functions are rapidly decreasing. * Use `@[to_additive]` everywhere (this likely requires changes in `to_additive`) -/ + +@[expose] public section open Set Function Filter MeasureTheory MeasureTheory.Measure TopologicalSpace open Bornology ContinuousLinearMap Metric Topology diff --git a/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean b/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean index 160bf77d5f6c40..aa202ca9bca529 100644 --- a/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean +++ b/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Geometry.Manifold.PartitionOfUnity -import Mathlib.Geometry.Manifold.Metrizable -import Mathlib.MeasureTheory.Function.AEEqOfIntegral +module + +public import Mathlib.Geometry.Manifold.PartitionOfUnity +public import Mathlib.Geometry.Manifold.Metrizable +public import Mathlib.MeasureTheory.Function.AEEqOfIntegral /-! # Functions which vanish as distributions vanish as functions @@ -22,6 +24,8 @@ These are deduced from the same results on finite-dimensional real manifolds, gi as `ae_eq_zero_of_integral_smooth_smul_eq_zero` and `ae_eq_of_integral_smooth_smul_eq`. -/ +@[expose] public section + open MeasureTheory Filter Metric Function Set TopologicalSpace open scoped Topology Manifold ContDiff diff --git a/Mathlib/Analysis/Distribution/ContDiffMapSupportedIn.lean b/Mathlib/Analysis/Distribution/ContDiffMapSupportedIn.lean index 7fded3b664ec5b..4499f62654c7b8 100644 --- a/Mathlib/Analysis/Distribution/ContDiffMapSupportedIn.lean +++ b/Mathlib/Analysis/Distribution/ContDiffMapSupportedIn.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Luigi Massacci -/ +module -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Topology.ContinuousMap.Bounded.Normed -import Mathlib.Topology.Sets.Compacts +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Topology.ContinuousMap.Bounded.Normed +public import Mathlib.Topology.Sets.Compacts /-! # Continuously differentiable functions supported in a given compact set @@ -21,7 +22,7 @@ functions `f : E → F` (where `F` is a normed vector space) such that: - `f` vanishes outside of a compact set: `EqOn f 0 Kᶜ`. The main reason this exists as a bundled type is to be endowed with its natural locally convex -topology (namely, uniform convergence of `f` and its derivative up to order `n`). +topology (namely, uniform convergence of `f` and its derivatives up to order `n`). Taking the locally convex inductive limit of these as `K` varies yields the natural topology on test functions, used to define distributions. While most of distribution theory cares only about `C^∞` functions, we also want to endow the space of `C^n` test functions with its natural topology. @@ -32,15 +33,19 @@ larger space of test functions. - `ContDiffMapSupportedIn E F n K`: the type of bundled `n`-times continuously differentiable functions `E → F` which vanish outside of `K`. -- `ContDiffMapSupportedIn.iteratedFDerivₗ'`: wraps `iteratedFDeriv` into a `𝕜`-linear map on - `ContDiffMapSupportedIn E F n K`, as a map into - `ContDiffMapSupportedIn E (E [×i]→L[ℝ] F) (n-i) K`. +- `ContDiffMapSupportedIn.iteratedFDerivWithOrderLM`: wrapper, as a `𝕜`-linear map, for + `iteratedFDeriv` from `ContDiffMapSupportedIn E F n K` to + `ContDiffMapSupportedIn E (E [×i]→L[ℝ] F) k K`. +- `ContDiffMapSupportedIn.iteratedFDerivLM`: specialization of the above, giving a `𝕜`-linear map + from `ContDiffMapSupportedIn E F ⊤ K` to `ContDiffMapSupportedIn E (E [×i]→L[ℝ] F) ⊤ K`. +- `ContDiffMapSupportedIn.topologicalSpace`, `ContDiffMapSupportedIn.uniformSpace`: the topology + and uniform structures on `𝓓^{n}_{K}(E, F)`, given by uniform convergence of the functions and + all their derivatives up to order `n`. ## Main statements -TODO: -- `ContDiffMapSupportedIn.instIsUniformAddGroup` and - `ContDiffMapSupportedIn.instLocallyConvexSpace`: `ContDiffMapSupportedIn` is a locally convex +- `ContDiffMapSupportedIn.isTopologicalAddGroup`, `ContDiffMapSupportedIn.continuousSMul` and + `ContDiffMapSupportedIn.instLocallyConvexSpace`: `𝓓^{n}_{K}(E, F)` is a locally convex topological vector space. ## Notation @@ -52,21 +57,30 @@ TODO: ## Implementation details -The technical choice of spelling `EqOn f 0 Kᶜ` in the definition, as opposed to `tsupport f ⊆ K` -is to make rewriting `f x` to `0` easier when `x ∉ K`. +* The technical choice of spelling `EqOn f 0 Kᶜ` in the definition, as opposed to `tsupport f ⊆ K` + is to make rewriting `f x` to `0` easier when `x ∉ K`. +* Since the most common case is by far the smooth case, we often reserve the "expected" name + of a result/definition to this case, and add `WithOrder` to the declaration applying to + any regularity. +* In `iteratedFDerivWithOrderLM`, we define the `i`-th iterated differentiation operator as + a map from `𝓓^{n}_{K}` to `𝓓^{k}_{K}` without imposing relations on `n`, `k` and `i`. Of course + this is defined as `0` if `k + i > n`. This creates some verbosity as all of these variables are + explicit, but it allows the most flexibility while avoiding DTT hell. ## Tags distributions -/ +@[expose] public section + open TopologicalSpace SeminormFamily Set Function Seminorm UniformSpace -open scoped BoundedContinuousFunction Topology NNReal +open scoped BoundedContinuousFunction Topology NNReal ContDiff variable (𝕜 E F : Type*) [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedSpace 𝕜 F] [SMulCommClass ℝ 𝕜 F] - {n : ℕ∞} {K : Compacts E} + {n k : ℕ∞} {K : Compacts E} /-- The type of bundled `n`-times continuously differentiable maps which vanish outside of a fixed compact set `K`. -/ @@ -99,6 +113,8 @@ class ContDiffMapSupportedInClass (B : Type*) (E F : outParam <| Type*) open ContDiffMapSupportedInClass +namespace ContDiffMapSupportedInClass + instance (B : Type*) (E F : outParam <| Type*) [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedSpace ℝ E] [NormedSpace ℝ F] (n : outParam ℕ∞) (K : outParam <| Compacts E) @@ -116,6 +132,8 @@ instance (B : Type*) (E F : outParam <| Type*) rcases (map_continuous f).bounded_above_of_compact_support this with ⟨C, hC⟩ exact map_bounded (BoundedContinuousFunction.ofNormedAddCommGroup f (map_continuous f) C hC) +end ContDiffMapSupportedInClass + namespace ContDiffMapSupportedIn instance toContDiffMapSupportedInClass : @@ -160,8 +178,8 @@ theorem copy_eq (f : 𝓓^{n}_{K}(E, F)) (f' : E → F) (h : f' = f) : f.copy f' DFunLike.ext' h @[simp] -theorem toBoundedContinuousFunction_apply (f : 𝓓^{n}_{K}(E, F)) (x : E) : - (f : BoundedContinuousFunction E F) x = (f x) := rfl +theorem coe_toBoundedContinuousFunction (f : 𝓓^{n}_{K}(E, F)) : + (f : BoundedContinuousFunction E F) = (f : E → F) := rfl section AddCommGroup @@ -243,4 +261,238 @@ protected def of_support_subset {f : E → F} (hf : ContDiff ℝ n f) (hsupp : s contDiff' := hf zero_on_compl' := support_subset_iff'.mp hsupp +protected theorem bounded_iteratedFDeriv (f : 𝓓^{n}_{K}(E, F)) {i : ℕ} (hi : i ≤ n) : + ∃ C, ∀ x, ‖iteratedFDeriv ℝ i f x‖ ≤ C := + Continuous.bounded_above_of_compact_support + (f.contDiff.continuous_iteratedFDeriv <| (WithTop.le_coe rfl).mpr hi) + (f.hasCompactSupport.iteratedFDeriv i) + +/-- Inclusion of `𝓓^{n}_{K}(E, F)` into the space `E →ᵇ F` of bounded continuous maps +as a `𝕜`-linear map. + +This is subsumed by `toBoundedContinuousFunctionCLM` (not yet in Mathlib), which also bundles the +continuity. -/ +@[simps -fullyApplied] +noncomputable def toBoundedContinuousFunctionLM : 𝓓^{n}_{K}(E, F) →ₗ[𝕜] E →ᵇ F where + toFun f := f + map_add' _ _ := rfl + map_smul' _ _ := rfl + +-- Workaround for simps' automatic name generation: manually specifying names is not supported yet. +alias toBoundedContinuousFunctionLM_apply := toBoundedContinuousFunctionLM_apply_apply + +lemma toBoundedContinuousFunctionLM_eq_of_scalars (𝕜' : Type*) [NontriviallyNormedField 𝕜'] + [NormedSpace 𝕜' F] [SMulCommClass ℝ 𝕜' F] : + (toBoundedContinuousFunctionLM 𝕜 : 𝓓^{n}_{K}(E, F) → _) = toBoundedContinuousFunctionLM 𝕜' := + rfl + +variable (n k) in +/-- `iteratedFDerivWithOrderLM 𝕜 n k i` is the `𝕜`-linear-map sending `f : 𝓓^{n}_{K}(E, F)` to +its `i`-th iterated derivative as an element of `𝓓^{k}_{K}(E, E [×i]→L[ℝ] F)`. +This only makes mathematical sense if `k + i ≤ n`, otherwise we define it as the zero map. + +See `iteratedFDerivLM` for the very common case where everything is infinitely differentiable. + +This is subsumed by `iteratedFDerivWithOrderCLM` (not yet in Mathlib), which also bundles the +continuity. -/ +noncomputable def iteratedFDerivWithOrderLM (i : ℕ) : + 𝓓^{n}_{K}(E, F) →ₗ[𝕜] 𝓓^{k}_{K}(E, E [×i]→L[ℝ] F) where + /- + Note: it is tempting to define this as some linear map if `k + i ≤ n`, + and the zero map otherwise. However, we would lose the definitional equality between + `iteratedFDerivWithOrderLM 𝕜 n k i f` and `iteratedFDerivWithOrderLM ℝ n k i f`. + + This is caused by the fact that the equality `f (if p then x else y) = if p then f x else f y` + is not definitional. + -/ + toFun f := + if hi : k + i ≤ n then + .of_support_subset + (f.contDiff.iteratedFDeriv_right <| by exact_mod_cast hi) + ((support_iteratedFDeriv_subset i).trans f.tsupport_subset) + else 0 + map_add' f g := by + split_ifs with hi + · have hi' : (i : WithTop ℕ∞) ≤ n := by exact_mod_cast le_of_add_le_right hi + ext + simp [iteratedFDeriv_add (f.contDiff.of_le hi') (g.contDiff.of_le hi')] + · simp + map_smul' c f := by + split_ifs with hi + · have hi' : (i : WithTop ℕ∞) ≤ n := by exact_mod_cast le_of_add_le_right hi + ext + simp [iteratedFDeriv_const_smul_apply (f.contDiff.of_le hi').contDiffAt] + · simp + +@[simp] +lemma iteratedFDerivWithOrderLM_apply {i : ℕ} (f : 𝓓^{n}_{K}(E, F)) : + iteratedFDerivWithOrderLM 𝕜 n k i f = if k + i ≤ n then iteratedFDeriv ℝ i f else 0 := by + rw [ContDiffMapSupportedIn.iteratedFDerivWithOrderLM] + split_ifs <;> rfl + +lemma iteratedFDerivWithOrderLM_apply_of_le {i : ℕ} (f : 𝓓^{n}_{K}(E, F)) (hin : k + i ≤ n) : + iteratedFDerivWithOrderLM 𝕜 n k i f = iteratedFDeriv ℝ i f := by + simp [hin] + +lemma iteratedFDerivWithOrderLM_apply_of_gt {i : ℕ} (f : 𝓓^{n}_{K}(E, F)) (hin : ¬ (k + i ≤ n)) : + iteratedFDerivWithOrderLM 𝕜 n k i f = 0 := by + ext : 1 + simp [hin] + +lemma iteratedFDerivWithOrderLM_eq_of_scalars {i : ℕ} (𝕜' : Type*) [NontriviallyNormedField 𝕜'] + [NormedSpace 𝕜' F] [SMulCommClass ℝ 𝕜' F] : + (iteratedFDerivWithOrderLM 𝕜 n k i : 𝓓^{n}_{K}(E, F) → _) + = iteratedFDerivWithOrderLM 𝕜' n k i := + rfl + +/-- `iteratedFDerivLM 𝕜 i` is the `𝕜`-linear-map sending `f : 𝓓_{K}(E, F)` to +its `i`-th iterated derivative as an element of `𝓓_{K}(E, E [×i]→L[ℝ] F)`. + +See also `iteratedFDerivWithOrderLM` if you need more control on the regularities. + +This is subsumed by `iteratedFDerivCLM` (not yet in Mathlib), which also bundles the +continuity. -/ +noncomputable def iteratedFDerivLM (i : ℕ) : + 𝓓_{K}(E, F) →ₗ[𝕜] 𝓓_{K}(E, E [×i]→L[ℝ] F) where + toFun f := .of_support_subset + (f.contDiff.iteratedFDeriv_right le_rfl) + ((support_iteratedFDeriv_subset i).trans f.tsupport_subset) + map_add' f g := by + have hi : (i : WithTop ℕ∞) ≤ ∞ := by exact_mod_cast le_top + ext + simp [iteratedFDeriv_add (f.contDiff.of_le hi) (g.contDiff.of_le hi)] + map_smul' c f := by + have hi : (i : WithTop ℕ∞) ≤ ∞ := by exact_mod_cast le_top + ext + simp [iteratedFDeriv_const_smul_apply (f.contDiff.of_le hi).contDiffAt] + +@[simp] +lemma iteratedFDerivLM_apply {i : ℕ} (f : 𝓓_{K}(E, F)) : + iteratedFDerivLM 𝕜 i f = iteratedFDeriv ℝ i f := + rfl + +/-- Note: this turns out to be a definitional equality thanks to decidablity of the order +on `ℕ∞`. This means we could have *defined* `iteratedFDerivLM` this way, but we avoid it +to make sure that `if`s won't appear in the smooth case. -/ +lemma iteratedFDerivLM_eq_withOrder (i : ℕ) : + (iteratedFDerivLM 𝕜 i : 𝓓_{K}(E, F) →ₗ[𝕜] _) = iteratedFDerivWithOrderLM 𝕜 ⊤ ⊤ i := + rfl + +lemma iteratedFDerivLM_eq_of_scalars {i : ℕ} (𝕜' : Type*) [NontriviallyNormedField 𝕜'] + [NormedSpace 𝕜' F] [SMulCommClass ℝ 𝕜' F] : + (iteratedFDerivLM 𝕜 i : 𝓓_{K}(E, F) → _) = iteratedFDerivLM 𝕜' i := + rfl + +variable (n) in +/-- `structureMapLM 𝕜 n i` is the `𝕜`-linear-map sending `f : 𝓓^{n}_{K}(E, F)` to its +`i`-th iterated derivative as an element of `E →ᵇ (E [×i]→L[ℝ] F)`. In other words, it +is the composition of `toBoundedContinuousFunctionLM 𝕜` and `iteratedFDerivWithOrderLM 𝕜 n 0 i`. +This only makes mathematical sense if `i ≤ n`, otherwise we define it as the zero map. + +We call these "structure maps" because they define the topology on `𝓓^{n}_{K}(E, F)`. + +This is subsumed by `structureMapCLM`, which also bundles the +continuity. -/ +noncomputable def structureMapLM (i : ℕ) : + 𝓓^{n}_{K}(E, F) →ₗ[𝕜] E →ᵇ (E [×i]→L[ℝ] F) := + toBoundedContinuousFunctionLM 𝕜 ∘ₗ iteratedFDerivWithOrderLM 𝕜 n 0 i + +lemma structureMapLM_eq {i : ℕ} : + (structureMapLM 𝕜 ⊤ i : 𝓓_{K}(E, F) →ₗ[𝕜] E →ᵇ (E [×i]→L[ℝ] F)) = + (toBoundedContinuousFunctionLM 𝕜 : 𝓓_{K}(E, E [×i]→L[ℝ] F) →ₗ[𝕜] E →ᵇ (E [×i]→L[ℝ] F)) ∘ₗ + (iteratedFDerivLM 𝕜 i : 𝓓_{K}(E, F) →ₗ[𝕜] 𝓓_{K}(E, E [×i]→L[ℝ] F)) := + rfl + +lemma structureMapLM_apply_withOrder {i : ℕ} (f : 𝓓^{n}_{K}(E, F)) : + structureMapLM 𝕜 n i f = if i ≤ n then iteratedFDeriv ℝ i f else 0 := by + simp [structureMapLM] + +lemma structureMapLM_apply {i : ℕ} (f : 𝓓_{K}(E, F)) : + structureMapLM 𝕜 ⊤ i f = iteratedFDeriv ℝ i f := by + simp [structureMapLM_eq] + +lemma structureMapLM_eq_of_scalars {i : ℕ} (𝕜' : Type*) [NontriviallyNormedField 𝕜'] + [NormedSpace 𝕜' F] [SMulCommClass ℝ 𝕜' F] : + (structureMapLM 𝕜 n i : 𝓓^{n}_{K}(E, F) → _) = structureMapLM 𝕜' n i := + rfl + +section Topology + +noncomputable instance topologicalSpace : TopologicalSpace 𝓓^{n}_{K}(E, F) := + ⨅ (i : ℕ), induced (structureMapLM ℝ n i) inferInstance + +noncomputable instance uniformSpace : UniformSpace 𝓓^{n}_{K}(E, F) := .replaceTopology + (⨅ (i : ℕ), UniformSpace.comap (structureMapLM ℝ n i) inferInstance) + toTopologicalSpace_iInf.symm + +protected theorem uniformSpace_eq_iInf : (uniformSpace : UniformSpace 𝓓^{n}_{K}(E, F)) = + ⨅ (i : ℕ), UniformSpace.comap (structureMapLM ℝ n i) inferInstance := + UniformSpace.replaceTopology_eq _ toTopologicalSpace_iInf.symm + +instance isTopologicalAddGroup : IsTopologicalAddGroup 𝓓^{n}_{K}(E, F) := + topologicalAddGroup_iInf fun _ ↦ topologicalAddGroup_induced _ + +instance isUniformAddGroup : IsUniformAddGroup 𝓓^{n}_{K}(E, F) := by + rw [ContDiffMapSupportedIn.uniformSpace_eq_iInf] + exact isUniformAddGroup_iInf fun _ ↦ IsUniformAddGroup.comap _ + +instance continuousSMul : ContinuousSMul 𝕜 𝓓^{n}_{K}(E, F) := + continuousSMul_iInf fun i ↦ continuousSMul_induced (structureMapLM 𝕜 n i) + +instance locallyConvexSpace : LocallyConvexSpace ℝ 𝓓^{n}_{K}(E, F) := + LocallyConvexSpace.iInf fun _ ↦ LocallyConvexSpace.induced _ + +variable (n) in +/-- `structureMapCLM 𝕜 n i` is the continuous `𝕜`-linear-map sending `f : 𝓓^{n}_{K}(E, F)` to its +`i`-th iterated derivative as an element of `E →ᵇ (E [×i]→L[ℝ] F)`. +This only makes mathematical sense if `i ≤ n`, otherwise we define it as the zero map. + +We call these "structure maps" because they define the topology on `𝓓^{n}_{K}(E, F)`. -/ +noncomputable def structureMapCLM (i : ℕ) : + 𝓓^{n}_{K}(E, F) →L[𝕜] E →ᵇ (E [×i]→L[ℝ] F) where + toLinearMap := structureMapLM 𝕜 n i + cont := continuous_iInf_dom continuous_induced_dom + +lemma structureMapCLM_apply_withOrder {i : ℕ} (f : 𝓓^{n}_{K}(E, F)) : + structureMapCLM 𝕜 n i f = if i ≤ n then iteratedFDeriv ℝ i f else 0 := by + simp [structureMapCLM, structureMapLM_apply_withOrder] + +lemma structureMapCLM_apply {i : ℕ} (f : 𝓓_{K}(E, F)) : + structureMapCLM 𝕜 ⊤ i f = iteratedFDeriv ℝ i f := by + simp [structureMapCLM, structureMapLM_apply] + +lemma structureMapCLM_eq_of_scalars {i : ℕ} (𝕜' : Type*) [NontriviallyNormedField 𝕜'] + [NormedSpace 𝕜' F] [SMulCommClass ℝ 𝕜' F] : + (structureMapCLM 𝕜 n i : 𝓓^{n}_{K}(E, F) → _) = structureMapCLM 𝕜' n i := + rfl + +/-- The **universal property** of the topology on `𝓓^{n}_{K}(E, F)`: a map to `𝓓^{n}_{K}(E, F)` +is continuous if and only if its composition with each structure map +`structureMapCLM ℝ n i : 𝓓^{n}_{K}(E, F) → (E →ᵇ (E [×i]→L[ℝ] F))` is continuous. + +Since `structureMapCLM ℝ n i` is zero whenever `i > n`, it suffices to check it for `i ≤ n`, +as proven by `continuous_iff_comp_withOrder`. -/ +-- Note: if needed, we could allow an extra parameter `𝕜` in case the user wants to use +-- `structureMapCLM 𝕜 n i`. +theorem continuous_iff_comp {X} [TopologicalSpace X] (φ : X → 𝓓^{n}_{K}(E, F)) : + Continuous φ ↔ ∀ i, Continuous (structureMapCLM ℝ n i ∘ φ) := by + simp [continuous_iInf_rng, continuous_induced_rng, structureMapCLM] + +/-- The **universal property** of the topology on `𝓓^{n}_{K}(E, F)`: a map to `𝓓^{n}_{K}(E, F)` +is continuous if and only if its composition with the structure map +`structureMapCLM ℝ n i : 𝓓^{n}_{K}(E, F) → (E →ᵇ (E [×i]→L[ℝ] F))` is continuous for each +`i ≤ n`. -/ +-- Note: if needed, we could allow an extra parameter `𝕜` in case the user wants to use +-- `structureMapCLM 𝕜 n i`. +theorem continuous_iff_comp_withOrder {X : Type*} [TopologicalSpace X] (φ : X → 𝓓^{n}_{K}(E, F)) : + Continuous φ ↔ ∀ (i : ℕ), i ≤ n → Continuous (structureMapCLM ℝ n i ∘ φ) := by + rw [continuous_iff_comp] + congrm (∀ i, ?_) + by_cases hin : i ≤ n <;> simp only [hin, true_imp_iff, false_imp_iff, iff_true] + refine continuous_zero.congr fun x ↦ ?_ + ext t : 1 + simp [hin, structureMapCLM_apply_withOrder] + +end Topology + end ContDiffMapSupportedIn diff --git a/Mathlib/Analysis/Distribution/FourierSchwartz.lean b/Mathlib/Analysis/Distribution/FourierSchwartz.lean index bad5fa74dcc3bb..36bd85ab0ddba8 100644 --- a/Mathlib/Analysis/Distribution/FourierSchwartz.lean +++ b/Mathlib/Analysis/Distribution/FourierSchwartz.lean @@ -1,11 +1,13 @@ /- Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Sébastien Gouëzel +Authors: Sébastien Gouëzel, Moritz Doll -/ -import Mathlib.Analysis.Distribution.SchwartzSpace -import Mathlib.Analysis.Fourier.FourierTransformDeriv -import Mathlib.Analysis.Fourier.Inversion +module + +public import Mathlib.Analysis.Distribution.SchwartzSpace +public import Mathlib.Analysis.Fourier.FourierTransformDeriv +public import Mathlib.Analysis.Fourier.Inversion /-! # Fourier transform on Schwartz functions @@ -15,9 +17,13 @@ functions, in `fourierTransformCLM`. It is also given as a continuous linear equ `fourierTransformCLE`. -/ +@[expose] public section + open Real MeasureTheory MeasureTheory.Measure open scoped FourierTransform ComplexInnerProductSpace +noncomputable section + namespace SchwartzMap variable @@ -28,26 +34,28 @@ variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] +section definition + /-- The Fourier transform on a real inner product space, as a continuous linear map on the Schwartz space. -/ -noncomputable def fourierTransformCLM : 𝓢(V, E) →L[𝕜] 𝓢(V, E) := by +def fourierTransformCLM : 𝓢(V, E) →L[𝕜] 𝓢(V, E) := by refine mkCLM ((𝓕 : (V → E) → (V → E)) ·) ?_ ?_ ?_ ?_ · intro f g x - simp only [fourierIntegral_eq, add_apply, smul_add] + simp only [fourier_eq, add_apply, smul_add] rw [integral_add] · exact (fourierIntegral_convergent_iff _).2 f.integrable · exact (fourierIntegral_convergent_iff _).2 g.integrable · intro c f x - simp only [fourierIntegral_eq, smul_apply, smul_comm _ c, integral_smul, RingHom.id_apply] + simp only [fourier_eq, smul_apply, smul_comm _ c, integral_smul, RingHom.id_apply] · intro f - exact Real.contDiff_fourierIntegral (fun n _ ↦ integrable_pow_mul volume f n) + exact Real.contDiff_fourier (fun n _ ↦ integrable_pow_mul volume f n) · rintro ⟨k, n⟩ refine ⟨Finset.range (n + integrablePower (volume : Measure V) + 1) ×ˢ Finset.range (k + 1), (2 * π) ^ n * (2 * ↑n + 2) ^ k * (Finset.range (n + 1) ×ˢ Finset.range (k + 1)).card * 2 ^ integrablePower (volume : Measure V) * (∫ (x : V), (1 + ‖x‖) ^ (- (integrablePower (volume : Measure V) : ℝ))) * 2, ⟨by positivity, fun f x ↦ ?_⟩⟩ - apply (pow_mul_norm_iteratedFDeriv_fourierIntegral_le (f.smooth ⊤) + apply (pow_mul_norm_iteratedFDeriv_fourier_le (f.smooth ⊤) (fun k n _hk _hn ↦ integrable_pow_mul_iteratedFDeriv _ f k n) le_top le_top x).trans simp only [mul_assoc] gcongr @@ -77,99 +85,136 @@ noncomputable def fourierTransformCLM : 𝓢(V, E) →L[𝕜] 𝓢(V, E) := by apply Finset.le_sup this (f := fun p ↦ SchwartzMap.seminorm 𝕜 p.1 p.2 (E := V) (F := E)) _ = _ := by simp [mul_assoc] -@[simp] lemma fourierTransformCLM_apply (f : 𝓢(V, E)) : - fourierTransformCLM 𝕜 f = 𝓕 (f : V → E) := rfl +instance instFourierTransform : FourierTransform 𝓢(V, E) 𝓢(V, E) where + fourier f := fourierTransformCLM ℂ f + +lemma fourier_coe (f : 𝓢(V, E)) : 𝓕 f = 𝓕 (f : V → E) := rfl + +instance instFourierModule : FourierModule 𝕜 𝓢(V, E) 𝓢(V, E) where + fourier_add := ContinuousLinearMap.map_add _ + fourier_smul := (fourierTransformCLM 𝕜).map_smul + +@[simp] +theorem fourierTransformCLM_apply (f : 𝓢(V, E)) : + fourierTransformCLM 𝕜 f = 𝓕 f := rfl + +instance instFourierTransformInv : FourierTransformInv 𝓢(V, E) 𝓢(V, E) where + fourierInv := (compCLMOfContinuousLinearEquiv ℂ (LinearIsometryEquiv.neg ℝ (E := V))) + ∘L (fourierTransformCLM ℂ) + +lemma fourierInv_coe (f : 𝓢(V, E)) : + 𝓕⁻ f = 𝓕⁻ (f : V → E) := by + ext x + exact (fourierInv_eq_fourier_neg f x).symm + +instance instFourierInvModule : FourierInvModule 𝕜 𝓢(V, E) 𝓢(V, E) where + fourierInv_add := ContinuousLinearMap.map_add _ + fourierInv_smul := ((compCLMOfContinuousLinearEquiv 𝕜 (D := V) (E := V) (F := E) + (LinearIsometryEquiv.neg ℝ (E := V))) ∘L (fourierTransformCLM 𝕜)).map_smul variable [CompleteSpace E] +instance instFourierPair : FourierPair 𝓢(V, E) 𝓢(V, E) where + fourierInv_fourier_eq := by + intro f + ext x + rw [fourierInv_coe, fourier_coe, f.continuous.fourierInv_fourier_eq f.integrable + (𝓕 f).integrable] + +instance instFourierInvPair : FourierInvPair 𝓢(V, E) 𝓢(V, E) where + fourier_fourierInv_eq := by + intro f + ext x + rw [fourier_coe, fourierInv_coe, f.continuous.fourier_fourierInv_eq f.integrable + (𝓕 f).integrable] + +@[deprecated (since := "2025-11-13")] +alias fourier_inversion := FourierTransform.fourierInv_fourier_eq + +@[deprecated (since := "2025-11-13")] +alias fourier_inversion_inv := FourierTransform.fourier_fourierInv_eq + +/-- The Fourier transform on a real inner product space, as a continuous linear equiv on the +Schwartz space. -/ +def fourierTransformCLE : 𝓢(V, E) ≃L[𝕜] 𝓢(V, E) where + __ := FourierTransform.fourierEquiv 𝕜 𝓢(V, E) 𝓢(V, E) + continuous_toFun := (fourierTransformCLM 𝕜).continuous + continuous_invFun := ContinuousLinearMap.continuous _ + @[simp] -theorem fourier_inversion (f : 𝓢(V, E)) (x : V) : 𝓕⁻ (𝓕 (f : V → E)) x = f x := - Integrable.fourier_inversion f.integrable (fourierTransformCLM ℂ f).integrable - f.continuous.continuousAt +lemma fourierTransformCLE_apply (f : 𝓢(V, E)) : fourierTransformCLE 𝕜 f = 𝓕 f := rfl @[simp] -theorem fourier_inversion_inv (f : 𝓢(V, E)) (x : V) : 𝓕 (𝓕⁻ (f : V → E)) x = f x := - Integrable.fourier_inversion_inv f.integrable (fourierTransformCLM ℂ f).integrable - f.continuous.continuousAt +lemma fourierTransformCLE_symm_apply (f : 𝓢(V, E)) : (fourierTransformCLE 𝕜).symm f = 𝓕⁻ f := rfl + +end definition + +section fubini variable - {F : Type*} [NormedAddCommGroup F] [NormedSpace ℂ F] [NormedSpace 𝕜 F] [SMulCommClass ℂ 𝕜 F] + {F : Type*} [NormedAddCommGroup F] [NormedSpace ℂ F] {G : Type*} [NormedAddCommGroup G] [NormedSpace ℂ G] -variable [CompleteSpace F] +variable [CompleteSpace E] [CompleteSpace F] /-- The Fourier transform satisfies `∫ 𝓕 f * g = ∫ f * 𝓕 g`, i.e., it is self-adjoint. Version where the multiplication is replaced by a general bilinear form `M`. -/ -theorem integral_bilin_fourierIntegral_eq (f : 𝓢(V, E)) (g : 𝓢(V, F)) (M : E →L[ℂ] F →L[ℂ] G) : - ∫ ξ, M (𝓕 (f : V → E) ξ) (g ξ) = ∫ x, M (f x) (𝓕 (g : V → F) x) := by - have := VectorFourier.integral_bilin_fourierIntegral_eq_flip M (μ := volume) (ν := volume) - (L := (innerₗ V)) continuous_fourierChar continuous_inner f.integrable g.integrable - rwa [flip_innerₗ] at this +theorem integral_bilin_fourier_eq (f : 𝓢(V, E)) (g : 𝓢(V, F)) (M : E →L[ℂ] F →L[ℂ] G) : + ∫ ξ, M (𝓕 f ξ) (g ξ) = ∫ x, M (f x) (𝓕 g x) := by + simpa using VectorFourier.integral_bilin_fourierIntegral_eq_flip M (L := (innerₗ V)) + continuous_fourierChar continuous_inner f.integrable g.integrable -theorem integral_sesq_fourierIntegral_eq (f : 𝓢(V, E)) (g : 𝓢(V, F)) (M : E →L⋆[ℂ] F →L[ℂ] G) : - ∫ ξ, M (𝓕 (f : V → E) ξ) (g ξ) = ∫ x, M (f x) (𝓕⁻ (g : V → F) x) := by - have := VectorFourier.integral_sesq_fourierIntegral_eq_neg_flip M (μ := volume) (ν := volume) +@[deprecated (since := "2025-11-16")] +alias integral_bilin_fourierIntegral_eq := integral_bilin_fourier_eq + +theorem integral_sesq_fourier_eq (f : 𝓢(V, E)) (g : 𝓢(V, F)) (M : E →L⋆[ℂ] F →L[ℂ] G) : + ∫ ξ, M (𝓕 f ξ) (g ξ) = ∫ x, M (f x) (𝓕⁻ g x) := by + simpa [fourierInv_coe] using VectorFourier.integral_sesq_fourierIntegral_eq_neg_flip M (L := (innerₗ V)) continuous_fourierChar continuous_inner f.integrable g.integrable - rwa [flip_innerₗ] at this + +@[deprecated (since := "2025-11-16")] +alias integral_sesq_fourierIntegral_eq := integral_sesq_fourier_eq /-- Plancherel's theorem for Schwartz functions. Version where the multiplication is replaced by a general bilinear form `M`. -/ theorem integral_sesq_fourier_fourier (f : 𝓢(V, E)) (g : 𝓢(V, F)) (M : E →L⋆[ℂ] F →L[ℂ] G) : - ∫ ξ, M (𝓕 (f : V → E) ξ) (𝓕 (g : V → F) ξ) = ∫ x, M (f x) (g x) := by - simpa only [fourierTransformCLM_apply, fourier_inversion] - using integral_sesq_fourierIntegral_eq f (fourierTransformCLM ℂ g) M + ∫ ξ, M (𝓕 f ξ) (𝓕 g ξ) = ∫ x, M (f x) (g x) := by + simpa using integral_sesq_fourier_eq f (𝓕 g) M + +end fubini + +section L2 variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] /-- Plancherel's theorem for Schwartz functions. -/ theorem integral_inner_fourier_fourier (f g : 𝓢(V, H)) : - ∫ ξ, ⟪𝓕 (f : V → H) ξ, 𝓕 (g : V → H) ξ⟫ = ∫ x, ⟪f x, g x⟫ := + ∫ ξ, ⟪𝓕 f ξ, 𝓕 g ξ⟫ = ∫ x, ⟪f x, g x⟫ := integral_sesq_fourier_fourier f g (innerSL ℂ) theorem integral_norm_sq_fourier (f : 𝓢(V, H)) : - ∫ ξ, ‖𝓕 (f : V → H) ξ‖^2 = ∫ x, ‖f x‖^2 := by + ∫ ξ, ‖𝓕 f ξ‖^2 = ∫ x, ‖f x‖^2 := by apply Complex.ofRealLI.injective - simp only [← LinearIsometry.integral_comp_comm] - convert integral_inner_fourier_fourier f f <;> - simp [inner_self_eq_norm_sq_to_K] + simpa [← LinearIsometry.integral_comp_comm, inner_self_eq_norm_sq_to_K] using + integral_inner_fourier_fourier f f -theorem inner_fourierTransformCLM_toL2_eq (f : 𝓢(V, H)) : - ⟪(fourierTransformCLM ℂ f).toLp 2, (fourierTransformCLM ℂ f).toLp 2⟫ = +theorem inner_fourier_toL2_eq (f : 𝓢(V, H)) : + ⟪(𝓕 f).toLp 2, (𝓕 f).toLp 2⟫ = ⟪f.toLp 2, f.toLp 2⟫ := by simp only [inner_toL2_toL2_eq] exact integral_sesq_fourier_fourier f f (innerSL ℂ) -theorem norm_fourierTransformCLM_toL2_eq (f : 𝓢(V, H)) : - ‖(fourierTransformCLM ℂ f).toLp 2‖ = ‖f.toLp 2‖ := by - simp_rw [norm_eq_sqrt_re_inner (𝕜 := ℂ), inner_fourierTransformCLM_toL2_eq] +@[deprecated (since := "2025-11-13")] +alias inner_fourierTransformCLM_toL2_eq := inner_fourier_toL2_eq -/-- The Fourier transform on a real inner product space, as a continuous linear equiv on the -Schwartz space. -/ -noncomputable def fourierTransformCLE : 𝓢(V, E) ≃L[𝕜] 𝓢(V, E) where - __ := fourierTransformCLM 𝕜 - invFun := (compCLMOfContinuousLinearEquiv 𝕜 (LinearIsometryEquiv.neg ℝ (E := V))) - ∘L (fourierTransformCLM 𝕜) - left_inv := by - intro f - ext x - change 𝓕 (𝓕 (f : V → E)) (-x) = f x - rw [← fourierIntegralInv_eq_fourierIntegral_neg, Continuous.fourier_inversion f.continuous - f.integrable (fourierTransformCLM 𝕜 f).integrable] - right_inv := by - intro f - ext x - change 𝓕 (fun (x : V) ↦ ((𝓕 (f : V → E)) (-x) : E)) x = f x - simp_rw [← fourierIntegralInv_eq_fourierIntegral_neg, Continuous.fourier_inversion_inv - f.continuous f.integrable (fourierTransformCLM 𝕜 f).integrable] - continuous_invFun := ContinuousLinearMap.continuous _ +@[simp] theorem norm_fourier_toL2_eq (f : 𝓢(V, H)) : + ‖(𝓕 f).toLp 2‖ = ‖f.toLp 2‖ := by + simp_rw [norm_eq_sqrt_re_inner (𝕜 := ℂ), inner_fourier_toL2_eq] -@[simp] lemma fourierTransformCLE_apply (f : 𝓢(V, E)) : - fourierTransformCLE 𝕜 f = 𝓕 (f : V → E) := rfl +@[deprecated (since := "2025-11-13")] +alias norm_fourierTransformCLM_toL2_eq := norm_fourier_toL2_eq -@[simp] lemma fourierTransformCLE_symm_apply (f : 𝓢(V, E)) : - (fourierTransformCLE 𝕜).symm f = 𝓕⁻ (f : V → E) := by - ext x - exact (fourierIntegralInv_eq_fourierIntegral_neg f x).symm +end L2 end SchwartzMap diff --git a/Mathlib/Analysis/Distribution/SchwartzSpace.lean b/Mathlib/Analysis/Distribution/SchwartzSpace.lean index 5ea584c6ded2a8..5c993111a985d5 100644 --- a/Mathlib/Analysis/Distribution/SchwartzSpace.lean +++ b/Mathlib/Analysis/Distribution/SchwartzSpace.lean @@ -3,16 +3,18 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs -import Mathlib.Analysis.Calculus.LineDeriv.Basic -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.Normed.Group.ZeroAtInfty -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Analysis.Distribution.TemperateGrowth -import Mathlib.Topology.Algebra.UniformFilterBasis -import Mathlib.MeasureTheory.Integral.IntegralEqImproper -import Mathlib.Tactic.MoveAdd -import Mathlib.MeasureTheory.Function.L2Space +module + +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +public import Mathlib.Analysis.Calculus.LineDeriv.Basic +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.Normed.Group.ZeroAtInfty +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Analysis.Distribution.TemperateGrowth +public import Mathlib.Topology.Algebra.UniformFilterBasis +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper +public import Mathlib.Tactic.MoveAdd +public import Mathlib.MeasureTheory.Function.L2Space /-! # Schwartz space @@ -63,6 +65,8 @@ The implementation of the seminorms is taken almost literally from `ContinuousLi Schwartz space, tempered distributions -/ +@[expose] public section + noncomputable section open scoped Nat NNReal ContDiff @@ -514,6 +518,7 @@ instance instFirstCountableTopology : FirstCountableTopology 𝓢(E, F) := end Topology +@[fun_prop] theorem hasTemperateGrowth (f : 𝓢(E, F)) : Function.HasTemperateGrowth f := by refine ⟨smooth f ⊤, fun n => ?_⟩ rcases f.decay 0 n with ⟨C, Cpos, hC⟩ diff --git a/Mathlib/Analysis/Distribution/TemperateGrowth.lean b/Mathlib/Analysis/Distribution/TemperateGrowth.lean index b87d4a8e8c5cd7..5e753b50a58330 100644 --- a/Mathlib/Analysis/Distribution/TemperateGrowth.lean +++ b/Mathlib/Analysis/Distribution/TemperateGrowth.lean @@ -3,19 +3,24 @@ Copyright (c) 2025 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Anatole Dedecker, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ContDiff.Bounds -import Mathlib.Analysis.SpecialFunctions.JapaneseBracket +module + +public import Mathlib.Analysis.Calculus.ContDiff.Bounds +public import Mathlib.Analysis.SpecialFunctions.JapaneseBracket +public import Mathlib.Analysis.InnerProductSpace.Calculus /-! # Functions and measures of temperate growth -/ +@[expose] public section + noncomputable section open scoped Nat NNReal ContDiff open Asymptotics -variable {𝕜 R D E F G : Type*} +variable {𝕜 R D E F G H : Type*} namespace Function @@ -174,6 +179,17 @@ theorem _root_.ContinuousLinearMap.bilinear_hasTemperateGrowth [NormedSpace 𝕜 refine .const_mul_left (.mul (h1 i ?_).norm_left (h2 (n-i) ?_).norm_left) _ <;> grind +lemma _root_.Function.HasTemperateGrowth.id : Function.HasTemperateGrowth (id : E → E) := by + apply Function.HasTemperateGrowth.of_fderiv (k := 1) (C := 1) + · convert Function.HasTemperateGrowth.const (ContinuousLinearMap.id ℝ E) + exact fderiv_id' + · apply differentiable_id + · simp + +@[fun_prop] +lemma _root_.Function.HasTemperateGrowth.id' : Function.HasTemperateGrowth (fun (x : E) ↦ x) := + Function.HasTemperateGrowth.id + /-- The product of two functions of temperate growth is again of temperate growth. Version for scalar multiplication. -/ @@ -200,6 +216,19 @@ lemma _root_.ContinuousLinearMap.hasTemperateGrowth (f : E →L[ℝ] F) : simpa [this] using .const _ · exact (f.le_opNorm x).trans (by simp [mul_add]) +variable [NormedAddCommGroup H] [InnerProductSpace ℝ H] + +variable (H) in +@[fun_prop] +theorem hasTemperateGrowth_norm_sq : (fun (x : H) ↦ ‖x‖ ^ 2).HasTemperateGrowth := by + apply _root_.Function.HasTemperateGrowth.of_fderiv (C := 1) (k := 2) + · rw [fderiv_norm_sq] + convert (2 • (innerSL ℝ)).hasTemperateGrowth + · exact (contDiff_norm_sq ℝ (n := 1)).differentiable rfl.le + · intro x + rw [norm_pow, norm_norm, one_mul, add_pow_two] + exact le_add_of_nonneg_left (by positivity) + end Function namespace MeasureTheory.Measure diff --git a/Mathlib/Analysis/Distribution/TestFunction.lean b/Mathlib/Analysis/Distribution/TestFunction.lean new file mode 100644 index 00000000000000..2833aafdd9d0bc --- /dev/null +++ b/Mathlib/Analysis/Distribution/TestFunction.lean @@ -0,0 +1,151 @@ +/- +Copyright (c) 2025 Luigi Massacci. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Luigi Massacci +-/ +module + +public import Mathlib.Analysis.Calculus.ContDiff.Defs +public import Mathlib.Topology.ContinuousMap.Bounded.Normed + +/-! +# Continuously differentiable functions with compact support + +This file develops the basic theory of bundled `n`-times continuously differentiable functions +with compact support contained in some open set `Ω`. More explicitly, given normed spaces `E` +and `F`, an open set `Ω : Opens E` and `n : ℕ∞`, we are interested in the space `𝓓^{n}(Ω, F)` of +maps `f : E → F` such that: + +- `f` is `n`-times continuously differentiable: `ContDiff ℝ n f`. +- `f` has compact support: `HasCompactSupport f`. +- the support of `f` is inside the open set `Ω`: `tsupport f ⊆ Ω`. + +This exists as a bundled type to equip it with the canonical LF topology induced by the inclusions +`𝓓_{K}^{n}(Ω, F) → 𝓓^{n}(Ω, F)` (see `ContDiffMapSupportedIn`). The dual space is then the space of +distributions, or "weak solutions" to PDEs, on `Ω`. + +## Main definitions + +- `TestFunction Ω F n`: the type of bundled `n`-times continuously differentiable + functions `E → F` with compact support contained in `Ω`. + +## Notation + +- `𝓓^{n}(Ω, F)`: the space of bundled `n`-times continuously differentiable functions `E → F` + with compact support contained in `Ω`. +- `𝓓(Ω, F)`: the space of bundled smooth (infinitely differentiable) functions `E → F` + with compact support contained in `Ω`, i.e. `𝓓^{⊤}(Ω, F)`. + +## Tags + +distributions, test function +-/ + +@[expose] public section + +open Function Seminorm SeminormFamily Set TopologicalSpace UniformSpace +open scoped BoundedContinuousFunction NNReal Topology + +variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] + {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {Ω : Opens E} + {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedSpace 𝕜 F] [SMulCommClass ℝ 𝕜 F] + {n : ℕ∞} + +variable (𝕜 Ω F n) in +/-- The type of bundled `n`-times continuously differentiable maps with compact support -/ +structure TestFunction : Type _ where + /-- The underlying function. Use coercion instead. -/ + protected toFun : E → F + protected contDiff' : ContDiff ℝ n toFun + protected hasCompactSupport' : HasCompactSupport toFun + protected tsupport_subset' : tsupport toFun ⊆ Ω + +/-- Notation for the space of bundled `n`-times continuously differentiable maps +with compact support. -/ +scoped[Distributions] notation "𝓓^{" n "}(" Ω ", " F ")" => TestFunction Ω F n + +/-- Notation for the space of "test functions", i.e. bundled smooth (infinitely differentiable) maps +with compact support. -/ +scoped[Distributions] notation "𝓓(" Ω ", " F ")" => TestFunction Ω F ⊤ + +open Distributions + +/-- `TestFunctionClass B Ω F n` states that `B` is a type of `n`-times continously +differentiable functions `E → F` with compact support contained in `Ω : Opens E`. -/ +class TestFunctionClass (B : Type*) + {E : outParam <| Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (Ω : outParam <| Opens E) + (F : outParam <| Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] + (n : outParam ℕ∞) extends FunLike B E F where + map_contDiff (f : B) : ContDiff ℝ n f + map_hasCompactSupport (f : B) : HasCompactSupport f + tsupport_map_subset (f : B) : tsupport f ⊆ Ω + +open TestFunctionClass + +namespace TestFunctionClass + +instance (B : Type*) + {E : outParam <| Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (Ω : outParam <| Opens E) + (F : outParam <| Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] + (n : outParam ℕ∞) [TestFunctionClass B Ω F n] : + ContinuousMapClass B E F where + map_continuous f := (map_contDiff f).continuous + +instance (B : Type*) + {E : outParam <| Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (Ω : outParam <| Opens E) + (F : outParam <| Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] + (n : outParam ℕ∞) [TestFunctionClass B Ω F n] : + BoundedContinuousMapClass B E F where + map_bounded f := by + obtain ⟨C, hC⟩ := (map_continuous f).bounded_above_of_compact_support (map_hasCompactSupport f) + exact map_bounded (BoundedContinuousFunction.ofNormedAddCommGroup f (map_continuous f) C hC) + +end TestFunctionClass + +namespace TestFunction + +instance toTestFunctionClass : TestFunctionClass 𝓓^{n}(Ω, F) Ω F n where + coe f := f.toFun + coe_injective' f g h := by cases f; cases g; congr + map_contDiff f := f.contDiff' + map_hasCompactSupport f := f.hasCompactSupport' + tsupport_map_subset f := f.tsupport_subset' + +protected theorem contDiff (f : 𝓓^{n}(Ω, F)) : ContDiff ℝ n f := map_contDiff f +protected theorem hasCompactSupport (f : 𝓓^{n}(Ω, F)) : HasCompactSupport f := + map_hasCompactSupport f +protected theorem tsupport_subset (f : 𝓓^{n}(Ω, F)) : tsupport f ⊆ Ω := tsupport_map_subset f + +@[simp] +theorem toFun_eq_coe {f : 𝓓^{n}(Ω, F)} : f.toFun = (f : E → F) := + rfl + +/-- See note [custom simps projection]. -/ +def Simps.coe (f : 𝓓^{n}(Ω, F)) : E → F := f + +initialize_simps_projections TestFunction (toFun → coe, as_prefix coe) + +@[ext] +theorem ext {f g : 𝓓^{n}(Ω, F)} (h : ∀ a, f a = g a) : f = g := + DFunLike.ext _ _ h + +/-- Copy of a `TestFunction` with a new `toFun` equal to the old one. Useful to fix +definitional equalities. -/ +protected def copy (f : 𝓓^{n}(Ω, F)) (f' : E → F) (h : f' = f) : 𝓓^{n}(Ω, F) where + toFun := f' + contDiff' := h.symm ▸ f.contDiff + hasCompactSupport' := h.symm ▸ f.hasCompactSupport + tsupport_subset' := h.symm ▸ f.tsupport_subset + +@[simp] +theorem coe_copy (f : 𝓓^{n}(Ω, F)) (f' : E → F) (h : f' = f) : ⇑(f.copy f' h) = f' := + rfl + +theorem copy_eq (f : 𝓓^{n}(Ω, F)) (f' : E → F) (h : f' = f) : f.copy f' h = f := + DFunLike.ext' h + +@[simp] +theorem coe_toBoundedContinuousFunction (f : 𝓓^{n}(Ω, F)) : + (f : BoundedContinuousFunction E F) = (f : E → F) := rfl + +end TestFunction diff --git a/Mathlib/Analysis/Fourier/AddCircle.lean b/Mathlib/Analysis/Fourier/AddCircle.lean index 617bac5c3a4a3f..710727014c11c6 100644 --- a/Mathlib/Analysis/Fourier/AddCircle.lean +++ b/Mathlib/Analysis/Fourier/AddCircle.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Complex.Circle -import Mathlib.Analysis.InnerProductSpace.l2Space -import Mathlib.MeasureTheory.Function.ContinuousMapDense -import Mathlib.MeasureTheory.Function.L2Space -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic -import Mathlib.Topology.ContinuousMap.StoneWeierstrass -import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +module + +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.SpecialFunctions.Complex.Circle +public import Mathlib.Analysis.InnerProductSpace.l2Space +public import Mathlib.MeasureTheory.Function.ContinuousMapDense +public import Mathlib.MeasureTheory.Function.L2Space +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +public import Mathlib.Topology.ContinuousMap.StoneWeierstrass +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts /-! @@ -59,6 +61,8 @@ coefficients of `f` is summable, then the Fourier series `∑ (i : ℤ), fourier converges to `f` in the uniform-convergence topology of `C(AddCircle T, ℂ)`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Fourier/AddCircleMulti.lean b/Mathlib/Analysis/Fourier/AddCircleMulti.lean index 8bc3e80ca58778..47ec5c4f2e5157 100644 --- a/Mathlib/Analysis/Fourier/AddCircleMulti.lean +++ b/Mathlib/Analysis/Fourier/AddCircleMulti.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Fourier.AddCircle -import Mathlib.MeasureTheory.Integral.Pi +module + +public import Mathlib.Analysis.Fourier.AddCircle +public import Mathlib.MeasureTheory.Integral.Pi /-! # Multivariate Fourier series @@ -14,6 +16,8 @@ show that it converges to the function in the L² norm. We also prove uniform co Fourier series if `f` is continuous and the sequence of its Fourier coefficients is summable. -/ +@[expose] public section + noncomputable section open scoped BigOperators ComplexConjugate ENNReal diff --git a/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean b/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean index d2ed46b5d1f615..d38c0dd08cb5a7 100644 --- a/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean +++ b/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Jakob Stiefel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Stiefel -/ -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.Analysis.Complex.Circle -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Topology.ContinuousMap.Bounded.Star +module + +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Topology.ContinuousMap.Bounded.Star /-! # Definition of BoundedContinuousFunction.char @@ -35,6 +37,8 @@ measure. -/ +@[expose] public section + open Filter BoundedContinuousFunction Complex namespace BoundedContinuousFunction diff --git a/Mathlib/Analysis/Fourier/FiniteAbelian/Orthogonality.lean b/Mathlib/Analysis/Fourier/FiniteAbelian/Orthogonality.lean index db0b55a3968790..d4a4c943e2a759 100644 --- a/Mathlib/Analysis/Fourier/FiniteAbelian/Orthogonality.lean +++ b/Mathlib/Analysis/Fourier/FiniteAbelian/Orthogonality.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.BigOperators.Expect -import Mathlib.Algebra.Group.AddChar -import Mathlib.Analysis.RCLike.Inner +module + +public import Mathlib.Algebra.BigOperators.Expect +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.Analysis.RCLike.Inner /-! # Orthogonality of characters of a finite abelian group @@ -14,6 +16,8 @@ This file proves that characters of a finite abelian group are orthogonal, and i there are at most as many characters as there are elements of the group. -/ +@[expose] public section + open Finset hiding card open Fintype (card) open Function RCLike @@ -42,7 +46,7 @@ section RCLike variable [RCLike R] [Fintype G] lemma wInner_cWeight_self (ψ : AddChar G R) : ⟪(ψ : G → R), ψ⟫ₙ_[R] = 1 := by - simp [wInner_cWeight_eq_expect, ψ.norm_apply, RCLike.mul_conj] + simp [wInner_cWeight_eq_expect, ψ.norm_apply] end RCLike end AddGroup diff --git a/Mathlib/Analysis/Fourier/FiniteAbelian/PontryaginDuality.lean b/Mathlib/Analysis/Fourier/FiniteAbelian/PontryaginDuality.lean index 062719c57b7a1a..6551740ad2fd69 100644 --- a/Mathlib/Analysis/Fourier/FiniteAbelian/PontryaginDuality.lean +++ b/Mathlib/Analysis/Fourier/FiniteAbelian/PontryaginDuality.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.DirectSum.AddChar -import Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality -import Mathlib.Analysis.SpecialFunctions.Complex.Circle -import Mathlib.GroupTheory.FiniteAbelian.Basic -import Mathlib.Topology.Instances.AddCircle.Real +module + +public import Mathlib.Algebra.DirectSum.AddChar +public import Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality +public import Mathlib.Analysis.SpecialFunctions.Complex.Circle +public import Mathlib.GroupTheory.FiniteAbelian.Basic +public import Mathlib.Topology.Instances.AddCircle.Real /-! # Pontryagin duality for finite abelian groups @@ -25,6 +27,8 @@ Reuse the work done in `Mathlib/GroupTheory/FiniteAbelian/Duality.lean`. This re more glue. -/ +@[expose] public section + noncomputable section open Circle Finset Function Module Multiplicative diff --git a/Mathlib/Analysis/Fourier/FourierTransform.lean b/Mathlib/Analysis/Fourier/FourierTransform.lean index ff6fcb77edc105..fa1e28b4c28cf4 100644 --- a/Mathlib/Analysis/Fourier/FourierTransform.lean +++ b/Mathlib/Analysis/Fourier/FourierTransform.lean @@ -3,14 +3,16 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.Group.AddChar -import Mathlib.Analysis.Complex.Circle -import Mathlib.Analysis.Fourier.Notation -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace -import Mathlib.MeasureTheory.Measure.Haar.OfBasis +module + +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.Analysis.Fourier.Notation +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace +public import Mathlib.MeasureTheory.Measure.Haar.OfBasis /-! # The Fourier transform @@ -53,6 +55,8 @@ At present the only nontrivial lemma we prove is `fourierIntegral_continuous`, s Fourier transform of an integrable function is continuous (under mild assumptions). -/ +@[expose] public section + noncomputable section @@ -414,78 +418,117 @@ open scoped RealInnerProductSpace variable [FiniteDimensional ℝ V] -instance FourierTransform : FourierTransform (V → E) (V → E) where - fourierTransform f := VectorFourier.fourierIntegral 𝐞 volume (innerₗ V) f +instance instFourierTransform : FourierTransform (V → E) (V → E) where + fourier f := VectorFourier.fourierIntegral 𝐞 volume (innerₗ V) f -instance FourierTransformInv : FourierTransformInv (V → E) (V → E) where - fourierTransformInv f w := VectorFourier.fourierIntegral 𝐞 volume (-innerₗ V) f w +instance instFourierTransformInv : FourierTransformInv (V → E) (V → E) where + fourierInv f w := VectorFourier.fourierIntegral 𝐞 volume (-innerₗ V) f w @[deprecated (since := "2025-11-12")] -alias fourierIntegral := FourierTransform.fourierTransform +alias fourierIntegral := FourierTransform.fourier @[deprecated (since := "2025-11-12")] -alias fourierIntegralInv := FourierTransform.fourierTransformInv +alias fourierIntegralInv := FourierTransform.fourierInv -lemma fourierIntegral_eq (f : V → E) (w : V) : +lemma fourier_eq (f : V → E) (w : V) : 𝓕 f w = ∫ v, 𝐞 (-⟪v, w⟫) • f v := rfl -lemma fourierIntegral_eq' (f : V → E) (w : V) : +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_eq := fourier_eq + +lemma fourier_eq' (f : V → E) (w : V) : 𝓕 f w = ∫ v, Complex.exp ((↑(-2 * π * ⟪v, w⟫) * Complex.I)) • f v := by - simp_rw [fourierIntegral_eq, Circle.smul_def, Real.fourierChar_apply, mul_neg, neg_mul] + simp_rw [fourier_eq, Circle.smul_def, Real.fourierChar_apply, mul_neg, neg_mul] + +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_eq' := fourier_eq' -lemma fourierIntegralInv_eq (f : V → E) (w : V) : +lemma fourierInv_eq (f : V → E) (w : V) : 𝓕⁻ f w = ∫ v, 𝐞 ⟪v, w⟫ • f v := by - simp [FourierTransformInv.fourierTransformInv, VectorFourier.fourierIntegral] + simp [FourierTransformInv.fourierInv, VectorFourier.fourierIntegral] -lemma fourierIntegralInv_eq' (f : V → E) (w : V) : +@[deprecated (since := "2025-11-16")] +alias fourierIntegralInv_eq := fourierInv_eq + +lemma fourierInv_eq' (f : V → E) (w : V) : 𝓕⁻ f w = ∫ v, Complex.exp ((↑(2 * π * ⟪v, w⟫) * Complex.I)) • f v := by - simp_rw [fourierIntegralInv_eq, Circle.smul_def, Real.fourierChar_apply] + simp_rw [fourierInv_eq, Circle.smul_def, Real.fourierChar_apply] + +@[deprecated (since := "2025-11-16")] +alias fourierIntegralInv_eq' := fourierInv_eq' -lemma fourierIntegral_comp_linearIsometry (A : W ≃ₗᵢ[ℝ] V) (f : V → E) (w : W) : +lemma fourier_comp_linearIsometry (A : W ≃ₗᵢ[ℝ] V) (f : V → E) (w : W) : 𝓕 (f ∘ A) w = (𝓕 f) (A w) := by - simp only [fourierIntegral_eq, ← A.inner_map_map, Function.comp_apply, + simp only [fourier_eq, ← A.inner_map_map, Function.comp_apply, ← MeasurePreserving.integral_comp A.measurePreserving A.toHomeomorph.measurableEmbedding] -lemma fourierIntegralInv_eq_fourierIntegral_neg (f : V → E) (w : V) : +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_comp_linearIsometry := fourier_comp_linearIsometry + +lemma fourierInv_eq_fourier_neg (f : V → E) (w : V) : 𝓕⁻ f w = 𝓕 f (-w) := by - simp [fourierIntegral_eq, fourierIntegralInv_eq] + simp [fourier_eq, fourierInv_eq] + +@[deprecated (since := "2025-11-16")] +alias fourierIntegralInv_eq_fourierIntegral_neg := fourierInv_eq_fourier_neg -lemma fourierIntegralInv_eq_fourierIntegral_comp_neg (f : V → E) : +lemma fourierInv_eq_fourier_comp_neg (f : V → E) : 𝓕⁻ f = 𝓕 (fun x ↦ f (-x)) := by ext y - rw [fourierIntegralInv_eq_fourierIntegral_neg] + rw [fourierInv_eq_fourier_neg] change 𝓕 f (LinearIsometryEquiv.neg ℝ y) = 𝓕 (f ∘ LinearIsometryEquiv.neg ℝ) y - exact (fourierIntegral_comp_linearIsometry _ _ _).symm + exact (fourier_comp_linearIsometry _ _ _).symm -lemma fourierIntegralInv_comm (f : V → E) : +@[deprecated (since := "2025-11-16")] +alias fourierIntegralInv_eq_fourierIntegral_comp_neg := fourierInv_eq_fourier_comp_neg + +lemma fourierInv_comm (f : V → E) : 𝓕 (𝓕⁻ f) = 𝓕⁻ (𝓕 f) := by - conv_rhs => rw [fourierIntegralInv_eq_fourierIntegral_comp_neg] - simp_rw [← fourierIntegralInv_eq_fourierIntegral_neg] + conv_rhs => rw [fourierInv_eq_fourier_comp_neg] + simp_rw [← fourierInv_eq_fourier_neg] + +@[deprecated (since := "2025-11-16")] +alias fourierIntegralInv_comm := fourierInv_comm -lemma fourierIntegralInv_comp_linearIsometry (A : W ≃ₗᵢ[ℝ] V) (f : V → E) (w : W) : +lemma fourierInv_comp_linearIsometry (A : W ≃ₗᵢ[ℝ] V) (f : V → E) (w : W) : 𝓕⁻ (f ∘ A) w = (𝓕⁻ f) (A w) := by - simp [fourierIntegralInv_eq_fourierIntegral_neg, fourierIntegral_comp_linearIsometry] + simp [fourierInv_eq_fourier_neg, fourier_comp_linearIsometry] -theorem fourierIntegral_real_eq (f : ℝ → E) (w : ℝ) : +@[deprecated (since := "2025-11-16")] +alias fourierIntegralInv_comp_linearIsometry := fourierInv_comp_linearIsometry + +theorem fourier_real_eq (f : ℝ → E) (w : ℝ) : 𝓕 f w = ∫ v : ℝ, 𝐞 (-(v * w)) • f v := by simp_rw [mul_comm _ w] rfl -theorem fourierIntegral_real_eq_integral_exp_smul (f : ℝ → E) (w : ℝ) : +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_real_eq := fourier_real_eq + +theorem fourier_real_eq_integral_exp_smul (f : ℝ → E) (w : ℝ) : 𝓕 f w = ∫ v : ℝ, Complex.exp (↑(-2 * π * v * w) * Complex.I) • f v := by - simp_rw [fourierIntegral_real_eq, Circle.smul_def, Real.fourierChar_apply, mul_neg, neg_mul, + simp_rw [fourier_real_eq, Circle.smul_def, Real.fourierChar_apply, mul_neg, neg_mul, mul_assoc] -theorem fourierIntegral_continuousLinearMap_apply +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_real_eq_integral_exp_smul := fourier_real_eq_integral_exp_smul + +theorem fourier_continuousLinearMap_apply {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] {f : V → (F →L[ℝ] E)} {a : F} {v : V} (hf : Integrable f) : 𝓕 f v a = 𝓕 (fun x ↦ f x a) v := fourierIntegral_continuousLinearMap_apply' (L := innerSL ℝ) hf -theorem fourierIntegral_continuousMultilinearMap_apply {ι : Type*} [Fintype ι] +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_continuousLinearMap_apply := fourier_continuousLinearMap_apply + +theorem fourier_continuousMultilinearMap_apply {ι : Type*} [Fintype ι] {M : ι → Type*} [∀ i, NormedAddCommGroup (M i)] [∀ i, NormedSpace ℝ (M i)] {f : V → ContinuousMultilinearMap ℝ M E} {m : (i : ι) → M i} {v : V} (hf : Integrable f) : 𝓕 f v m = 𝓕 (fun x ↦ f x m) v := fourierIntegral_continuousMultilinearMap_apply' (L := innerSL ℝ) hf +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_continuousMultilinearMap_apply := fourier_continuousMultilinearMap_apply + end Real diff --git a/Mathlib/Analysis/Fourier/FourierTransformDeriv.lean b/Mathlib/Analysis/Fourier/FourierTransformDeriv.lean index f3efb2123cd393..3b8b945f0344be 100644 --- a/Mathlib/Analysis/Fourier/FourierTransformDeriv.lean +++ b/Mathlib/Analysis/Fourier/FourierTransformDeriv.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, David Loeffler, Heather Macbeth, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ParametricIntegral -import Mathlib.Analysis.Calculus.ContDiff.CPolynomial -import Mathlib.Analysis.Fourier.AddCircle -import Mathlib.Analysis.Fourier.FourierTransform -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts -import Mathlib.Analysis.Calculus.ContDiff.Bounds +module + +public import Mathlib.Analysis.Calculus.ParametricIntegral +public import Mathlib.Analysis.Calculus.ContDiff.CPolynomial +public import Mathlib.Analysis.Fourier.AddCircle +public import Mathlib.Analysis.Fourier.FourierTransform +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts +public import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! # Derivatives of the Fourier transform @@ -78,6 +80,8 @@ We also give specialized versions of the one-dimensional real derivative (and it in `Real.deriv_fourierIntegral` and `Real.iteratedDeriv_fourierIntegral`. -/ +@[expose] public section + noncomputable section open Real Complex MeasureTheory Filter TopologicalSpace @@ -670,57 +674,78 @@ variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDim /-- The Fréchet derivative of the Fourier transform of `f` is the Fourier transform of `fun v ↦ -2 * π * I ⟪v, ⬝⟫ f v`. -/ -theorem hasFDerivAt_fourierIntegral +theorem hasFDerivAt_fourier (hf_int : Integrable f) (hvf_int : Integrable (fun v ↦ ‖v‖ * ‖f v‖)) (x : V) : HasFDerivAt (𝓕 f) (𝓕 (fourierSMulRight (innerSL ℝ) f) x) x := VectorFourier.hasFDerivAt_fourierIntegral (innerSL ℝ) hf_int hvf_int x +@[deprecated (since := "2025-11-16")] +alias hasFDerivAt_fourierIntegral := hasFDerivAt_fourier + /-- The Fréchet derivative of the Fourier transform of `f` is the Fourier transform of `fun v ↦ -2 * π * I ⟪v, ⬝⟫ f v`. -/ -theorem fderiv_fourierIntegral +theorem fderiv_fourier (hf_int : Integrable f) (hvf_int : Integrable (fun v ↦ ‖v‖ * ‖f v‖)) : fderiv ℝ (𝓕 f) = 𝓕 (fourierSMulRight (innerSL ℝ) f) := VectorFourier.fderiv_fourierIntegral (innerSL ℝ) hf_int hvf_int -theorem differentiable_fourierIntegral +@[deprecated (since := "2025-11-16")] +alias fderiv_fourierIntegral := fderiv_fourier + +theorem differentiable_fourier (hf_int : Integrable f) (hvf_int : Integrable (fun v ↦ ‖v‖ * ‖f v‖)) : Differentiable ℝ (𝓕 f) := VectorFourier.differentiable_fourierIntegral (innerSL ℝ) hf_int hvf_int +@[deprecated (since := "2025-11-16")] +alias differentiable_fourierIntegral := differentiable_fourier + /-- The Fourier integral of the Fréchet derivative of a function is obtained by multiplying the Fourier integral of the original function by `2πI ⟪v, w⟫`. -/ -theorem fourierIntegral_fderiv +theorem fourier_fderiv (hf : Integrable f) (h'f : Differentiable ℝ f) (hf' : Integrable (fderiv ℝ f)) : 𝓕 (fderiv ℝ f) = fourierSMulRight (-innerSL ℝ) (𝓕 f) := by - rw [← innerSL_real_flip V] + rw [← flip_innerSL_real V] exact VectorFourier.fourierIntegral_fderiv (innerSL ℝ) hf h'f hf' +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_fderiv := fourier_fderiv + /-- If `‖v‖^n * ‖f v‖` is integrable, then the Fourier transform of `f` is `C^n`. -/ -theorem contDiff_fourierIntegral {N : ℕ∞} +theorem contDiff_fourier {N : ℕ∞} (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖ ^ n * ‖f v‖)) : ContDiff ℝ N (𝓕 f) := VectorFourier.contDiff_fourierIntegral (innerSL ℝ) hf +@[deprecated (since := "2025-11-16")] +alias contDiff_fourierIntegral := contDiff_fourier + /-- If `‖v‖^n * ‖f v‖` is integrable, then the `n`-th derivative of the Fourier transform of `f` is the Fourier transform of `fun v ↦ (-2 * π * I) ^ n ⟪v, ⬝⟫^n f v`. -/ -theorem iteratedFDeriv_fourierIntegral {N : ℕ∞} +theorem iteratedFDeriv_fourier {N : ℕ∞} (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖ ^ n * ‖f v‖)) (h'f : AEStronglyMeasurable f) {n : ℕ} (hn : n ≤ N) : iteratedFDeriv ℝ n (𝓕 f) = 𝓕 (fun v ↦ fourierPowSMulRight (innerSL ℝ) f v n) := VectorFourier.iteratedFDeriv_fourierIntegral (innerSL ℝ) hf h'f hn +@[deprecated (since := "2025-11-16")] +alias iteratedFDeriv_fourierIntegral := iteratedFDeriv_fourier + /-- The Fourier integral of the `n`-th derivative of a function is obtained by multiplying the Fourier integral of the original function by `(2πI L w ⬝ )^n`. -/ -theorem fourierIntegral_iteratedFDeriv {N : ℕ∞} (hf : ContDiff ℝ N f) +theorem fourier_iteratedFDeriv {N : ℕ∞} (hf : ContDiff ℝ N f) (h'f : ∀ (n : ℕ), n ≤ N → Integrable (iteratedFDeriv ℝ n f)) {n : ℕ} (hn : n ≤ N) : 𝓕 (iteratedFDeriv ℝ n f) = (fun w ↦ fourierPowSMulRight (-innerSL ℝ) (𝓕 f) w n) := by - rw [← innerSL_real_flip V] + rw [← flip_innerSL_real V] exact VectorFourier.fourierIntegral_iteratedFDeriv (innerSL ℝ) hf h'f hn +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_iteratedFDeriv := fourier_iteratedFDeriv + /-- One can bound `‖w‖^n * ‖D^k (𝓕 f) w‖` in terms of integrals of the derivatives of `f` (or order at most `n`) multiplied by powers of `v` (of order at most `k`). -/ -lemma pow_mul_norm_iteratedFDeriv_fourierIntegral_le +lemma pow_mul_norm_iteratedFDeriv_fourier_le {K N : ℕ∞} (hf : ContDiff ℝ N f) (h'f : ∀ (k n : ℕ), k ≤ K → n ≤ N → Integrable (fun v ↦ ‖v‖ ^ k * ‖iteratedFDeriv ℝ n f v‖)) {k n : ℕ} (hk : k ≤ K) (hn : n ≤ N) (w : V) : @@ -733,7 +758,7 @@ lemma pow_mul_norm_iteratedFDeriv_fourierIntegral_le ∫ (v : V), ‖v‖ ^ p.1 * ‖iteratedFDeriv ℝ p.2 f v‖ ∂volume)) := by have := VectorFourier.pow_mul_norm_iteratedFDeriv_fourierIntegral_le (innerSL ℝ) hf h'f hk hn w w - simp only [innerSL_apply _ w w, real_inner_self_eq_norm_sq w, abs_pow, abs_norm, + simp only [innerSL_apply_apply _ w w, real_inner_self_eq_norm_sq w, abs_pow, abs_norm, mul_assoc] at this rwa [pow_two, mul_pow, mul_assoc] at this rcases eq_or_ne n 0 with rfl | hn @@ -753,7 +778,10 @@ lemma pow_mul_norm_iteratedFDeriv_fourierIntegral_le gcongr exact norm_innerSL_le _ -lemma hasDerivAt_fourierIntegral +@[deprecated (since := "2025-11-16")] +alias pow_mul_norm_iteratedFDeriv_fourierIntegral_le := pow_mul_norm_iteratedFDeriv_fourier_le + +lemma hasDerivAt_fourier {f : ℝ → E} (hf : Integrable f) (hf' : Integrable (fun x : ℝ ↦ x • f x)) (w : ℝ) : HasDerivAt (𝓕 f) (𝓕 (fun x : ℝ ↦ (-2 * π * I * x) • f x) w) w := by have hf'' : Integrable (fun v : ℝ ↦ ‖v‖ * ‖f v‖) := by simpa only [norm_smul] using hf'.norm @@ -776,27 +804,36 @@ lemma hasDerivAt_fourierIntegral ContinuousLinearMap.mul_apply', one_mul, ← neg_mul, mul_smul] rfl -theorem deriv_fourierIntegral +@[deprecated (since := "2025-11-16")] +alias hasDerivAt_fourierIntegral := hasDerivAt_fourier + +theorem deriv_fourier {f : ℝ → E} (hf : Integrable f) (hf' : Integrable (fun x : ℝ ↦ x • f x)) : deriv (𝓕 f) = 𝓕 (fun x : ℝ ↦ (-2 * π * I * x) • f x) := by ext x - exact (hasDerivAt_fourierIntegral hf hf' x).deriv + exact (hasDerivAt_fourier hf hf' x).deriv + +@[deprecated (since := "2025-11-16")] +alias deriv_fourierIntegral := deriv_fourier /-- The Fourier integral of the Fréchet derivative of a function is obtained by multiplying the Fourier integral of the original function by `2πI x`. -/ -theorem fourierIntegral_deriv +theorem fourier_deriv {f : ℝ → E} (hf : Integrable f) (h'f : Differentiable ℝ f) (hf' : Integrable (deriv f)) : 𝓕 (deriv f) = fun (x : ℝ) ↦ (2 * π * I * x) • (𝓕 f x) := by ext x have I : Integrable (fun x ↦ fderiv ℝ f x) := by simpa only [← deriv_fderiv] using (ContinuousLinearMap.smulRightL ℝ ℝ E 1).integrable_comp hf' have : 𝓕 (deriv f) x = 𝓕 (fderiv ℝ f) x 1 := by - simp only [fourierIntegral_continuousLinearMap_apply I, fderiv_deriv] - rw [this, fourierIntegral_fderiv hf h'f I] - simp only [fourierSMulRight_apply, ContinuousLinearMap.neg_apply, innerSL_apply, smul_smul, + simp only [fourier_continuousLinearMap_apply I, fderiv_deriv] + rw [this, fourier_fderiv hf h'f I] + simp only [fourierSMulRight_apply, ContinuousLinearMap.neg_apply, innerSL_apply_apply, smul_smul, RCLike.inner_apply', conj_trivial, mul_one, neg_smul, smul_neg, neg_neg, neg_mul, ← coe_smul] -theorem iteratedDeriv_fourierIntegral {f : ℝ → E} {N : ℕ∞} {n : ℕ} +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_deriv := fourier_deriv + +theorem iteratedDeriv_fourier {f : ℝ → E} {N : ℕ∞} {n : ℕ} (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun x ↦ x ^ n • f x)) (hn : n ≤ N) : iteratedDeriv n (𝓕 f) = 𝓕 (fun x : ℝ ↦ (-2 * π * I * x) ^ n • f x) := by ext x : 1 @@ -804,15 +841,18 @@ theorem iteratedDeriv_fourierIntegral {f : ℝ → E} {N : ℕ∞} {n : ℕ} convert (hf n hn).norm with x simp [norm_smul] have B : AEStronglyMeasurable f := by simpa using (hf 0 (zero_le _)).1 - rw [iteratedDeriv, iteratedFDeriv_fourierIntegral A B hn, - fourierIntegral_continuousMultilinearMap_apply (integrable_fourierPowSMulRight _ (A n hn) B), - fourierIntegral_eq, fourierIntegral_eq] + rw [iteratedDeriv, iteratedFDeriv_fourier A B hn, + fourier_continuousMultilinearMap_apply (integrable_fourierPowSMulRight _ (A n hn) B), + fourier_eq, fourier_eq] congr with y suffices (-(2 * π * I)) ^ n • y ^ n • f y = (-(2 * π * I * y)) ^ n • f y by - simpa [innerSL_apply _] + simpa [innerSL_apply_apply _] simp only [← neg_mul, ← coe_smul, smul_smul, mul_pow, ofReal_pow, mul_assoc] -theorem fourierIntegral_iteratedDeriv {f : ℝ → E} {N : ℕ∞} {n : ℕ} (hf : ContDiff ℝ N f) +@[deprecated (since := "2025-11-16")] +alias iteratedDeriv_fourierIntegral := iteratedDeriv_fourier + +theorem fourier_iteratedDeriv {f : ℝ → E} {N : ℕ∞} {n : ℕ} (hf : ContDiff ℝ N f) (h'f : ∀ (n : ℕ), n ≤ N → Integrable (iteratedDeriv n f)) (hn : n ≤ N) : 𝓕 (iteratedDeriv n f) = fun (x : ℝ) ↦ (2 * π * I * x) ^ n • (𝓕 f x) := by ext x : 1 @@ -821,8 +861,11 @@ theorem fourierIntegral_iteratedDeriv {f : ℝ → E} {N : ℕ∞} {n : ℕ} (hf rw [iteratedFDeriv_eq_equiv_comp] exact (LinearIsometryEquiv.integrable_comp_iff _).2 (h'f n hn) change 𝓕 (fun x ↦ iteratedDeriv n f x) x = _ - simp_rw [iteratedDeriv, ← fourierIntegral_continuousMultilinearMap_apply (A n hn), - fourierIntegral_iteratedFDeriv hf A hn] + simp_rw [iteratedDeriv, ← fourier_continuousMultilinearMap_apply (A n hn), + fourier_iteratedFDeriv hf A hn] simp [← coe_smul, smul_smul, ← mul_pow] +@[deprecated (since := "2025-11-16")] +alias fourierIntegral_iteratedDeriv := fourier_iteratedDeriv + end Real diff --git a/Mathlib/Analysis/Fourier/Inversion.lean b/Mathlib/Analysis/Fourier/Inversion.lean index 04012e48d837b2..9dfedf74c5caa8 100644 --- a/Mathlib/Analysis/Fourier/Inversion.lean +++ b/Mathlib/Analysis/Fourier/Inversion.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.PeakFunction -import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform +module + +public import Mathlib.MeasureTheory.Integral.PeakFunction +public import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform /-! # Fourier inversion formula @@ -37,6 +39,8 @@ To check the concentration property of the middle factor and the fact that it ha rely on the explicit computation of the Fourier transform of Gaussians. -/ +@[expose] public section + open Filter MeasureTheory Complex Module Metric Real Bornology open scoped Topology FourierTransform RealInnerProductSpace Complex @@ -83,7 +87,7 @@ lemma tendsto_integral_gaussian_smul (hf : Integrable f) (h'f : Integrable (𝓕 congr 3 simp only [ofReal_mul, ofReal_ofNat] ring - · simp [fourierIntegralInv_eq] + · simp [fourierInv_eq] have B : Tendsto (fun (c : ℝ) ↦ (∫ w : V, 𝓕 (fun w ↦ cexp (- c⁻¹ * ‖w‖^2 + 2 * π * I * ⟪v, w⟫)) w • f w)) atTop (𝓝 (𝓕⁻ (𝓕 f) v)) := by @@ -96,7 +100,7 @@ lemma tendsto_integral_gaussian_smul (hf : Integrable f) (h'f : Integrable (𝓕 apply B.congr' filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c) congr with w - rw [fourierIntegral_gaussian_innerProductSpace' (by simpa)] + rw [fourier_gaussian_innerProductSpace' (by simpa)] congr · simp · simp; ring @@ -156,35 +160,48 @@ variable [CompleteSpace E] /-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product space is integrable, and its Fourier transform `𝓕 f` is also integrable, then `𝓕⁻ (𝓕 f) = f` at continuity points of `f`. -/ -theorem MeasureTheory.Integrable.fourier_inversion +theorem MeasureTheory.Integrable.fourierInv_fourier_eq (hf : Integrable f) (h'f : Integrable (𝓕 f)) {v : V} (hv : ContinuousAt f v) : 𝓕⁻ (𝓕 f) v = f v := tendsto_nhds_unique (Real.tendsto_integral_gaussian_smul hf h'f v) (Real.tendsto_integral_gaussian_smul' hf hv) +@[deprecated (since := "2025-11-16")] +alias MeasureTheory.Integrable.fourier_inversion := MeasureTheory.Integrable.fourierInv_fourier_eq + /-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product space is continuous, integrable, and its Fourier transform `𝓕 f` is also integrable, then `𝓕⁻ (𝓕 f) = f`. -/ -theorem Continuous.fourier_inversion (h : Continuous f) +theorem Continuous.fourierInv_fourier_eq (h : Continuous f) (hf : Integrable f) (h'f : Integrable (𝓕 f)) : 𝓕⁻ (𝓕 f) = f := by ext v - exact hf.fourier_inversion h'f h.continuousAt + exact hf.fourierInv_fourier_eq h'f h.continuousAt + +@[deprecated (since := "2025-11-16")] +alias Continuous.fourier_inversion := Continuous.fourierInv_fourier_eq /-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product space is integrable, and its Fourier transform `𝓕 f` is also integrable, then `𝓕 (𝓕⁻ f) = f` at continuity points of `f`. -/ -theorem MeasureTheory.Integrable.fourier_inversion_inv +theorem MeasureTheory.Integrable.fourier_fourierInv_eq (hf : Integrable f) (h'f : Integrable (𝓕 f)) {v : V} (hv : ContinuousAt f v) : 𝓕 (𝓕⁻ f) v = f v := by - rw [fourierIntegralInv_comm] - exact fourier_inversion hf h'f hv + rw [fourierInv_comm] + exact hf.fourierInv_fourier_eq h'f hv + +@[deprecated (since := "2025-11-16")] +alias MeasureTheory.Integrable.fourier_inversion_inv := + MeasureTheory.Integrable.fourier_fourierInv_eq /-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product space is continuous, integrable, and its Fourier transform `𝓕 f` is also integrable, then `𝓕 (𝓕⁻ f) = f`. -/ -theorem Continuous.fourier_inversion_inv (h : Continuous f) +theorem Continuous.fourier_fourierInv_eq (h : Continuous f) (hf : Integrable f) (h'f : Integrable (𝓕 f)) : 𝓕 (𝓕⁻ f) = f := by ext v - exact hf.fourier_inversion_inv h'f h.continuousAt + exact hf.fourier_fourierInv_eq h'f h.continuousAt + +@[deprecated (since := "2025-11-16")] +alias Continuous.fourier_inversion_inv := Continuous.fourier_fourierInv_eq diff --git a/Mathlib/Analysis/Fourier/Notation.lean b/Mathlib/Analysis/Fourier/Notation.lean index 13a8626da6d9b0..408d5c3ca2e782 100644 --- a/Mathlib/Analysis/Fourier/Notation.lean +++ b/Mathlib/Analysis/Fourier/Notation.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Algebra.Module.Equiv.Defs +module + +public import Mathlib.Algebra.Module.Equiv.Defs /-! # Type classes for the Fourier transform @@ -15,6 +17,8 @@ Moreover, we provide type-classes that encode the linear structure and the Fouri theorem. -/ +@[expose] public section + universe u v w /-- @@ -27,7 +31,7 @@ Moreover, including a scalar multiplication causes problems for inferring the no -/ class FourierTransform (E : Type u) (F : outParam (Type v)) where /-- `𝓕 f` is the Fourier transform of `f`. The meaning of this notation is type-dependent. -/ - fourierTransform : E → F + fourier : E → F /-- The notation typeclass for the inverse Fourier transform. @@ -40,14 +44,14 @@ Moreover, including a scalar multiplication causes problems for inferring the no class FourierTransformInv (E : Type u) (F : outParam (Type v)) where /-- `𝓕⁻ f` is the inverse Fourier transform of `f`. The meaning of this notation is type-dependent. -/ - fourierTransformInv : E → F + fourierInv : E → F namespace FourierTransform -export FourierTransformInv (fourierTransformInv) +export FourierTransformInv (fourierInv) -@[inherit_doc] scoped notation "𝓕" => fourierTransform -@[inherit_doc] scoped notation "𝓕⁻" => fourierTransformInv +@[inherit_doc] scoped notation "𝓕" => fourier +@[inherit_doc] scoped notation "𝓕⁻" => fourierInv end FourierTransform @@ -129,19 +133,19 @@ open FourierTransform /-- A `FourierPair` is a pair of spaces `E` and `F` such that `𝓕⁻ ∘ 𝓕 = id` on `E`. -/ class FourierPair (E F : Type*) [FourierTransform E F] [FourierTransformInv F E] where - inv_fourier : ∀ (f : E), 𝓕⁻ (𝓕 f) = f + fourierInv_fourier_eq : ∀ (f : E), 𝓕⁻ (𝓕 f) = f /-- A `FourierInvPair` is a pair of spaces `E` and `F` such that `𝓕 ∘ 𝓕⁻ = id` on `E`. -/ class FourierInvPair (E F : Type*) [FourierTransform F E] [FourierTransformInv E F] where - fourier_inv : ∀ (f : E), 𝓕 (𝓕⁻ f) = f + fourier_fourierInv_eq : ∀ (f : E), 𝓕 (𝓕⁻ f) = f namespace FourierTransform -export FourierPair (inv_fourier) -export FourierInvPair (fourier_inv) +export FourierPair (fourierInv_fourier_eq) +export FourierInvPair (fourier_fourierInv_eq) -attribute [simp] inv_fourier -attribute [simp] fourier_inv +attribute [simp] fourierInv_fourier_eq +attribute [simp] fourier_fourierInv_eq variable {R E F : Type*} [Semiring R] [AddCommMonoid E] [AddCommMonoid F] [Module R E] [Module R F] [FourierModule R E F] [FourierInvModule R F E] [FourierPair E F] [FourierInvPair F E] @@ -151,8 +155,8 @@ variable (R E F) in def fourierEquiv : E ≃ₗ[R] F where __ := fourierₗ R E F invFun := 𝓕⁻ - left_inv := inv_fourier - right_inv := fourier_inv + left_inv := fourierInv_fourier_eq + right_inv := fourier_fourierInv_eq @[simp] lemma fourierEquiv_apply (f : E) : fourierEquiv R E F f = 𝓕 f := rfl diff --git a/Mathlib/Analysis/Fourier/PoissonSummation.lean b/Mathlib/Analysis/Fourier/PoissonSummation.lean index b4ef4212e56e1c..5691c41af6c9bc 100644 --- a/Mathlib/Analysis/Fourier/PoissonSummation.lean +++ b/Mathlib/Analysis/Fourier/PoissonSummation.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Fourier.AddCircle -import Mathlib.Analysis.Fourier.FourierTransform -import Mathlib.Analysis.PSeries -import Mathlib.Analysis.Distribution.FourierSchwartz -import Mathlib.MeasureTheory.Measure.Lebesgue.Integral -import Mathlib.Topology.ContinuousMap.Periodic +module + +public import Mathlib.Analysis.Fourier.AddCircle +public import Mathlib.Analysis.Fourier.FourierTransform +public import Mathlib.Analysis.PSeries +public import Mathlib.Analysis.Distribution.FourierSchwartz +public import Mathlib.MeasureTheory.Measure.Lebesgue.Integral +public import Mathlib.Topology.ContinuousMap.Periodic /-! # Poisson's summation formula @@ -23,9 +25,9 @@ Fourier transform of `f`, under the following hypotheses: These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result -`SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz -functions. --/ +`SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that `f` is a Schwartz function. -/ + +@[expose] public section noncomputable section @@ -89,7 +91,7 @@ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, ℂ)} exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 (f : ℝ → ℂ) m := by - rw [fourierIntegral_real_eq_integral_exp_smul] + rw [fourier_real_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 @@ -97,7 +99,7 @@ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, ℂ)} ring /-- **Poisson's summation formula**, most general form. -/ -theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, ℂ)} +theorem Real.tsum_eq_tsum_fourier {f : C(ℝ, ℂ)} (h_norm : ∀ K : Compacts ℝ, Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict K‖) (h_sum : Summable fun n : ℤ => 𝓕 (f : ℝ → ℂ) n) (x : ℝ) : @@ -113,6 +115,9 @@ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, ℂ)} using (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum x).tsum_eq · simp_rw [← Real.fourierCoeff_tsum_comp_add h_norm, smul_eq_mul, F, coe_mk] +@[deprecated (since := "2025-11-16")] +alias Real.tsum_eq_tsum_fourierIntegral := Real.tsum_eq_tsum_fourier + section RpowDecay variable {E : Type*} [NormedAddCommGroup E] @@ -189,34 +194,47 @@ theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) /-- **Poisson's summation formula**, assuming that `f` decays as `|x| ^ (-b)` for some `1 < b` and its Fourier transform is summable. -/ -theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable {f : ℝ → ℂ} (hc : Continuous f) +theorem Real.tsum_eq_tsum_fourier_of_rpow_decay_of_summable {f : ℝ → ℂ} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : Summable fun n : ℤ => 𝓕 f n) (x : ℝ) : ∑' n : ℤ, f (x + n) = ∑' n : ℤ, 𝓕 f n * fourier n (x : UnitAddCircle) := - Real.tsum_eq_tsum_fourierIntegral (fun K => summable_of_isBigO (Real.summable_abs_int_rpow hb) + Real.tsum_eq_tsum_fourier (fun K => summable_of_isBigO (Real.summable_abs_int_rpow hb) ((isBigO_norm_restrict_cocompact ⟨_, hc⟩ (zero_lt_one.trans hb) hf K).comp_tendsto Int.tendsto_coe_cofinite)) hFf x +@[deprecated (since := "2025-11-16")] +alias Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable := + Real.tsum_eq_tsum_fourier_of_rpow_decay_of_summable + /-- **Poisson's summation formula**, assuming that both `f` and its Fourier transform decay as `|x| ^ (-b)` for some `1 < b`. (This is the one-dimensional case of Corollary VII.2.6 of Stein and Weiss, *Introduction to Fourier analysis on Euclidean spaces*.) -/ -theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay {f : ℝ → ℂ} (hc : Continuous f) {b : ℝ} +theorem Real.tsum_eq_tsum_fourier_of_rpow_decay {f : ℝ → ℂ} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : f =O[cocompact ℝ] (|·| ^ (-b))) (hFf : (𝓕 f) =O[cocompact ℝ] (|·| ^ (-b))) (x : ℝ) : ∑' n : ℤ, f (x + n) = ∑' n : ℤ, 𝓕 f n * fourier n (x : UnitAddCircle) := - Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable hc hb hf (summable_of_isBigO + Real.tsum_eq_tsum_fourier_of_rpow_decay_of_summable hc hb hf (summable_of_isBigO (Real.summable_abs_int_rpow hb) (hFf.comp_tendsto Int.tendsto_coe_cofinite)) x +@[deprecated (since := "2025-11-16")] +alias Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay := + Real.tsum_eq_tsum_fourier_of_rpow_decay + end RpowDecay section Schwartz +open scoped SchwartzMap + /-- **Poisson's summation formula** for Schwartz functions. -/ -theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f : SchwartzMap ℝ ℂ) (x : ℝ) : - ∑' n : ℤ, f (x + n) = ∑' n : ℤ, fourierTransformCLM ℝ f n * fourier n (x : UnitAddCircle) := by +theorem SchwartzMap.tsum_eq_tsum_fourier (f : 𝓢(ℝ, ℂ)) (x : ℝ) : + ∑' n : ℤ, f (x + n) = ∑' n : ℤ, 𝓕 f n * fourier n (x : UnitAddCircle) := by -- We know that Schwartz functions are `O(‖x ^ (-b)‖)` for *every* `b`; for this argument we take -- `b = 2` and work with that. - apply Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay f.continuous one_lt_two - (f.isBigO_cocompact_rpow (-2)) ((fourierTransformCLM ℝ f).isBigO_cocompact_rpow (-2)) + apply Real.tsum_eq_tsum_fourier_of_rpow_decay f.continuous one_lt_two + (f.isBigO_cocompact_rpow (-2)) ((𝓕 f).isBigO_cocompact_rpow (-2)) + +@[deprecated (since := "2025-11-16")] +alias SchwartzMap.tsum_eq_tsum_fourierIntegral := SchwartzMap.tsum_eq_tsum_fourier end Schwartz diff --git a/Mathlib/Analysis/Fourier/RiemannLebesgueLemma.lean b/Mathlib/Analysis/Fourier/RiemannLebesgueLemma.lean index 1bec94f1fd6733..e1781f23d32c21 100644 --- a/Mathlib/Analysis/Fourier/RiemannLebesgueLemma.lean +++ b/Mathlib/Analysis/Fourier/RiemannLebesgueLemma.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Fourier.FourierTransform -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.InnerProductSpace.EuclideanDist -import Mathlib.MeasureTheory.Function.ContinuousMapDense -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.Topology.EMetricSpace.Paracompact -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.Analysis.Fourier.FourierTransform +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.InnerProductSpace.EuclideanDist +public import Mathlib.MeasureTheory.Function.ContinuousMapDense +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.Topology.EMetricSpace.Paracompact +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # The Riemann-Lebesgue Lemma @@ -42,6 +44,8 @@ equivalence to an inner-product space. reformulations explicitly using the Fourier integral. -/ +@[expose] public section + noncomputable section open MeasureTheory Filter Complex Set Module @@ -207,10 +211,14 @@ theorem Real.tendsto_integral_exp_smul_cocompact (f : ℝ → E) : simp_rw [mul_comm] exact tendsto_integral_exp_inner_smul_cocompact f -/-- The Riemann-Lebesgue lemma for functions on `ℝ`, formulated via `Real.fourierIntegral`. -/ -theorem Real.zero_at_infty_fourierIntegral (f : ℝ → E) : Tendsto (𝓕 f) (cocompact ℝ) (𝓝 0) := +/-- The Riemann-Lebesgue lemma for functions on `ℝ`, formulated via +`Real.instFourierTransform.fourier`. -/ +theorem Real.zero_at_infty_fourier (f : ℝ → E) : Tendsto (𝓕 f) (cocompact ℝ) (𝓝 0) := tendsto_integral_exp_inner_smul_cocompact f +@[deprecated (since := "2025-11-16")] +alias Real.zero_at_infty_fourierIntegral := Real.zero_at_infty_fourier + /-- Riemann-Lebesgue lemma for functions on a finite-dimensional inner-product space, formulated via dual space. **Do not use** -- it is only a stepping stone to `tendsto_integral_exp_smul_cocompact` where the inner-product-space structure isn't required. -/ diff --git a/Mathlib/Analysis/Fourier/ZMod.lean b/Mathlib/Analysis/Fourier/ZMod.lean index 70d80c7d9e17f8..b12bc9140bceff 100644 --- a/Mathlib/Analysis/Fourier/ZMod.lean +++ b/Mathlib/Analysis/Fourier/ZMod.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.Group.EvenFunction -import Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar -import Mathlib.Analysis.Fourier.FourierTransform -import Mathlib.NumberTheory.DirichletCharacter.GaussSum +module + +public import Mathlib.Algebra.Group.EvenFunction +public import Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar +public import Mathlib.Analysis.Fourier.FourierTransform +public import Mathlib.NumberTheory.DirichletCharacter.GaussSum /-! # Fourier theory on `ZMod N` @@ -24,6 +26,8 @@ Basic definitions and properties of the discrete Fourier transform for functions primitive Dirichlet character `χ` is a Gauss sum times `χ⁻¹`. -/ +@[expose] public section + open MeasureTheory Finset AddChar ZMod namespace ZMod diff --git a/Mathlib/Analysis/FunctionalSpaces/SobolevInequality.lean b/Mathlib/Analysis/FunctionalSpaces/SobolevInequality.lean index 15dc17cdca17a8..cdadc9753fa58e 100644 --- a/Mathlib/Analysis/FunctionalSpaces/SobolevInequality.lean +++ b/Mathlib/Analysis/FunctionalSpaces/SobolevInequality.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Analysis.Calculus.Deriv.Pi -import Mathlib.Analysis.InnerProductSpace.EuclideanDist -import Mathlib.Analysis.InnerProductSpace.NormPow -import Mathlib.Data.Finset.Interval -import Mathlib.MeasureTheory.Integral.IntegralEqImproper +module + +public import Mathlib.Analysis.Calculus.Deriv.Pi +public import Mathlib.Analysis.InnerProductSpace.EuclideanDist +public import Mathlib.Analysis.InnerProductSpace.NormPow +public import Mathlib.Data.Finset.Interval +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper /-! # Gagliardo-Nirenberg-Sobolev inequality @@ -49,6 +51,8 @@ Potentially also useful: the codomain is assumed to be a Hilbert space, without restrictions on its dimension. -/ +@[expose] public section + open scoped ENNReal NNReal open Set Function Finset MeasureTheory Measure Filter diff --git a/Mathlib/Analysis/Hofer.lean b/Mathlib/Analysis/Hofer.lean index d1bc8866f42b46..211e9de4086e73 100644 --- a/Mathlib/Analysis/Hofer.lean +++ b/Mathlib/Analysis/Hofer.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot -/ -import Mathlib.Analysis.SpecificLimits.Basic +module + +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Hofer's lemma @@ -18,6 +20,8 @@ example of a proof needing to construct a sequence by induction in the middle of * H. Hofer and C. Viterbo, *The Weinstein conjecture in the presence of holomorphic spheres* -/ +@[expose] public section + open Topology Filter Finset local notation "d" => dist diff --git a/Mathlib/Analysis/InnerProductSpace/Adjoint.lean b/Mathlib/Analysis/InnerProductSpace/Adjoint.lean index 4211a059c96d67..76d1cb86ad55ec 100644 --- a/Mathlib/Analysis/InnerProductSpace/Adjoint.lean +++ b/Mathlib/Analysis/InnerProductSpace/Adjoint.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.InnerProductSpace.PiL2 +module + +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # Adjoint of operators on Hilbert spaces @@ -38,6 +40,8 @@ adjoint -/ +@[expose] public section + noncomputable section open Module RCLike @@ -74,7 +78,7 @@ theorem adjointAux_apply (A : E →L[𝕜] F) (x : F) : rfl theorem adjointAux_inner_left (A : E →L[𝕜] F) (x : E) (y : F) : ⟪adjointAux A y, x⟫ = ⟪y, A x⟫ := by - rw [adjointAux_apply, toDual_symm_apply, toSesqForm_apply_coe, coe_comp', innerSL_apply_coe, + rw [adjointAux_apply, toDual_symm_apply, toSesqForm_apply_coe, coe_comp', coe_innerSL_apply, Function.comp_apply] theorem adjointAux_inner_right (A : E →L[𝕜] F) (x : E) (y : F) : diff --git a/Mathlib/Analysis/InnerProductSpace/Affine.lean b/Mathlib/Analysis/InnerProductSpace/Affine.lean index e69a0536c2ce52..01ef2e0019f691 100644 --- a/Mathlib/Analysis/InnerProductSpace/Affine.lean +++ b/Mathlib/Analysis/InnerProductSpace/Affine.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.Normed.Group.AddTorsor +module + +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.Normed.Group.AddTorsor /-! # Normed affine spaces over an inner product space -/ +@[expose] public section + variable {𝕜 V P : Type*} section RCLike diff --git a/Mathlib/Analysis/InnerProductSpace/Basic.lean b/Mathlib/Analysis/InnerProductSpace/Basic.lean index cdd063d2d8b32b..99fe4b48dfbd8a 100644 --- a/Mathlib/Analysis/InnerProductSpace/Basic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.Complex.Basic -import Mathlib.Analysis.InnerProductSpace.Defs +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Analysis.InnerProductSpace.Defs /-! # Properties of inner product spaces @@ -25,6 +27,8 @@ inner product space, Hilbert space, norm -/ +@[expose] public section + noncomputable section @@ -61,8 +65,8 @@ theorem inner_eq_zero_symm {x y : E} : ⟪x, y⟫ = 0 ↔ ⟪y, x⟫ = 0 := by instance {ι : Sort*} (v : ι → E) : IsSymm ι fun i j => ⟪v i, v j⟫ = 0 where symm _ _ := inner_eq_zero_symm.1 -@[simp] -theorem inner_self_im (x : E) : im ⟪x, x⟫ = 0 := by rw [← @ofReal_inj 𝕜, im_eq_conj_sub]; simp +theorem inner_self_im (x : E) : im ⟪x, x⟫ = 0 := by + rw [← @ofReal_inj 𝕜, im_eq_conj_sub]; simp theorem inner_add_left (x y z : E) : ⟪x + y, z⟫ = ⟪x, z⟫ + ⟪y, z⟫ := InnerProductSpace.add_left _ _ _ @@ -183,10 +187,10 @@ theorem inner_self_nonneg {x : E} : 0 ≤ re ⟪x, x⟫ := theorem real_inner_self_nonneg {x : F} : 0 ≤ ⟪x, x⟫_ℝ := @inner_self_nonneg ℝ F _ _ _ x -@[simp] theorem inner_self_ofReal_re (x : E) : (re ⟪x, x⟫ : 𝕜) = ⟪x, x⟫ := ((RCLike.is_real_TFAE (⟪x, x⟫ : 𝕜)).out 2 3).2 (inner_self_im (𝕜 := 𝕜) x) +@[simp] theorem inner_self_eq_norm_sq_to_K (x : E) : ⟪x, x⟫ = (‖x‖ : 𝕜) ^ 2 := by rw [← inner_self_ofReal_re, ← norm_sq_eq_re_inner, ofReal_pow] @@ -290,7 +294,6 @@ local notation "⟪" x ", " y "⟫" => inner 𝕜 x y export InnerProductSpace (norm_sq_eq_re_inner) -@[simp] theorem inner_self_eq_zero {x : E} : ⟪x, x⟫ = 0 ↔ x = 0 := by rw [inner_self_eq_norm_sq_to_K, sq_eq_zero_iff, ofReal_eq_zero, norm_eq_zero] @@ -313,13 +316,11 @@ theorem ext_iff_inner_right {x y : E} : x = y ↔ ∀ v, ⟪x, v⟫ = ⟪y, v⟫ variable {𝕜} -@[simp] theorem re_inner_self_nonpos {x : E} : re ⟪x, x⟫ ≤ 0 ↔ x = 0 := by - rw [← norm_sq_eq_re_inner, (sq_nonneg _).ge_iff_eq', sq_eq_zero_iff, norm_eq_zero] + simp -@[simp] lemma re_inner_self_pos {x : E} : 0 < re ⟪x, x⟫ ↔ x ≠ 0 := by - simpa [-re_inner_self_nonpos] using re_inner_self_nonpos (𝕜 := 𝕜) (x := x).not + simp [sq_pos_iff] @[deprecated (since := "2025-04-22")] alias inner_self_nonpos := re_inner_self_nonpos @[deprecated (since := "2025-04-22")] alias inner_self_pos := re_inner_self_pos @@ -744,7 +745,7 @@ theorem inner_eq_norm_mul_iff_div {x y : E} (h₀ : x ≠ 0) : · have : x = 0 ∨ y = (⟪x, y⟫ / ⟪x, x⟫ : 𝕜) • x := ((norm_inner_eq_norm_tfae 𝕜 x y).out 0 1).1 (by simp [h]) rw [this.resolve_left h₀, h] - simp [norm_smul, inner_self_ofReal_norm, mul_div_cancel_right₀ _ h₀'] + simp [norm_smul, mul_div_cancel_right₀ _ h₀'] · conv_lhs => rw [← h, inner_smul_right, inner_self_eq_norm_sq_to_K] field @@ -792,10 +793,13 @@ theorem real_inner_div_norm_mul_norm_eq_neg_one_iff (x y : F) : /-- If the inner product of two unit vectors is `1`, then the two vectors are equal. One form of the equality case for Cauchy-Schwarz. -/ -theorem inner_eq_one_iff_of_norm_one {x y : E} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) : +theorem inner_eq_one_iff_of_norm_eq_one {x y : E} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) : ⟪x, y⟫ = 1 ↔ x = y := by convert inner_eq_norm_mul_iff (𝕜 := 𝕜) (E := E) using 2 <;> simp [hx, hy] +theorem inner_self_eq_one_of_norm_eq_one {x : E} (hx : ‖x‖ = 1) : ⟪x, x⟫_𝕜 = 1 := + (inner_eq_one_iff_of_norm_eq_one hx hx).mpr rfl + theorem inner_lt_norm_mul_iff_real {x y : F} : ⟪x, y⟫_ℝ < ‖x‖ * ‖y‖ ↔ ‖y‖ • x ≠ ‖x‖ • y := calc ⟪x, y⟫_ℝ < ‖x‖ * ‖y‖ ↔ ⟪x, y⟫_ℝ ≠ ‖x‖ * ‖y‖ := @@ -804,16 +808,24 @@ theorem inner_lt_norm_mul_iff_real {x y : F} : ⟪x, y⟫_ℝ < ‖x‖ * ‖y /-- If the inner product of two unit vectors is strictly less than `1`, then the two vectors are distinct. One form of the equality case for Cauchy-Schwarz. -/ -theorem inner_lt_one_iff_real_of_norm_one {x y : F} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) : +theorem inner_lt_one_iff_real_of_norm_eq_one {x y : F} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) : ⟪x, y⟫_ℝ < 1 ↔ x ≠ y := by convert inner_lt_norm_mul_iff_real (F := F) <;> simp [hx, hy] +@[deprecated (since := "2025-11-15")] alias inner_eq_one_iff_of_norm_one := + inner_eq_one_iff_of_norm_eq_one +@[deprecated (since := "2025-11-15")] alias inner_self_eq_one_of_norm_one := + inner_self_eq_one_of_norm_eq_one +@[deprecated (since := "2025-11-15")] alias inner_lt_one_iff_real_of_norm_one := + inner_lt_one_iff_real_of_norm_eq_one + /-- The sphere of radius `r = ‖y‖` is tangent to the plane `⟪x, y⟫ = ‖y‖ ^ 2` at `x = y`. -/ theorem eq_of_norm_le_re_inner_eq_norm_sq {x y : E} (hle : ‖x‖ ≤ ‖y‖) (h : re ⟪x, y⟫ = ‖y‖ ^ 2) : x = y := by suffices H : re ⟪x - y, x - y⟫ ≤ 0 by rwa [re_inner_self_nonpos, sub_eq_zero] at H have H₁ : ‖x‖ ^ 2 ≤ ‖y‖ ^ 2 := by gcongr have H₂ : re ⟪y, x⟫ = ‖y‖ ^ 2 := by rwa [← inner_conj_symm, conj_re] - simpa [inner_sub_left, inner_sub_right, ← norm_sq_eq_re_inner, h, H₂] using H₁ + simp only [inner_sub_left, inner_sub_right] + simpa [h, H₂] using H₁ /-- Equality is achieved in the triangle inequality iff the two vectors are collinear. -/ theorem norm_add_eq_iff_real {x y : F} : ‖x + y‖ = ‖x‖ + ‖y‖ ↔ ‖y‖ • x = ‖x‖ • y := by diff --git a/Mathlib/Analysis/InnerProductSpace/Calculus.lean b/Mathlib/Analysis/InnerProductSpace/Calculus.lean index 3e42998f00a978..3b8c05281a686a 100644 --- a/Mathlib/Analysis/InnerProductSpace/Calculus.lean +++ b/Mathlib/Analysis/InnerProductSpace/Calculus.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Analysis.SpecialFunctions.Sqrt -import Mathlib.Analysis.Normed.Module.Ball.Homeomorph -import Mathlib.Analysis.Calculus.ContDiff.WithLp -import Mathlib.Analysis.Calculus.FDeriv.WithLp +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Analysis.SpecialFunctions.Sqrt +public import Mathlib.Analysis.Normed.Module.Ball.Homeomorph +public import Mathlib.Analysis.Calculus.ContDiff.WithLp +public import Mathlib.Analysis.Calculus.FDeriv.WithLp /-! # Calculus in inner product spaces @@ -26,6 +28,8 @@ and from the equivalence of norms in finite dimensions. The last part of the file should be generalized to `PiLp`. -/ +@[expose] public section + noncomputable section open RCLike Real Filter diff --git a/Mathlib/Analysis/InnerProductSpace/CanonicalTensor.lean b/Mathlib/Analysis/InnerProductSpace/CanonicalTensor.lean index 61863683f0ebaf..760593b19cfd3a 100644 --- a/Mathlib/Analysis/InnerProductSpace/CanonicalTensor.lean +++ b/Mathlib/Analysis/InnerProductSpace/CanonicalTensor.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ +module -import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # Canonical tensors in real inner product spaces @@ -23,6 +24,8 @@ The theorem `canonicalCovariantTensor_eq_sum` shows that `∑ i, (v i) ⊗ₜ[ℝ] (v i)`. -/ +@[expose] public section + open InnerProductSpace TensorProduct variable (E : Type*) [NormedAddCommGroup E] [InnerProductSpace ℝ E] diff --git a/Mathlib/Analysis/InnerProductSpace/Completion.lean b/Mathlib/Analysis/InnerProductSpace/Completion.lean index 6662bab85be51d..a98ce97606d510 100644 --- a/Mathlib/Analysis/InnerProductSpace/Completion.lean +++ b/Mathlib/Analysis/InnerProductSpace/Completion.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ -import Mathlib.Analysis.InnerProductSpace.LinearMap -import Mathlib.Analysis.Normed.Module.Completion +module + +public import Mathlib.Analysis.InnerProductSpace.LinearMap +public import Mathlib.Analysis.Normed.Module.Completion /-! # Completion of an inner product space @@ -13,6 +15,8 @@ We show that the separation quotient and the completion of an inner product spac product spaces. -/ +@[expose] public section + noncomputable section variable {𝕜 E F : Type*} [RCLike 𝕜] diff --git a/Mathlib/Analysis/InnerProductSpace/ConformalLinearMap.lean b/Mathlib/Analysis/InnerProductSpace/ConformalLinearMap.lean index 169584fb27fa63..f1fa2254d30862 100644 --- a/Mathlib/Analysis/InnerProductSpace/ConformalLinearMap.lean +++ b/Mathlib/Analysis/InnerProductSpace/ConformalLinearMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ -import Mathlib.Analysis.Normed.Operator.Conformal -import Mathlib.Analysis.InnerProductSpace.LinearMap +module + +public import Mathlib.Analysis.Normed.Operator.Conformal +public import Mathlib.Analysis.InnerProductSpace.LinearMap /-! # Conformal maps between inner product spaces @@ -12,6 +14,8 @@ import Mathlib.Analysis.InnerProductSpace.LinearMap In an inner product space, a map is conformal iff it preserves inner products up to a scalar factor. -/ +@[expose] public section + variable {E F : Type*} variable [NormedAddCommGroup E] [NormedAddCommGroup F] diff --git a/Mathlib/Analysis/InnerProductSpace/Continuous.lean b/Mathlib/Analysis/InnerProductSpace/Continuous.lean index 9689ce29d56c83..d5b519b9efc81d 100644 --- a/Mathlib/Analysis/InnerProductSpace/Continuous.lean +++ b/Mathlib/Analysis/InnerProductSpace/Continuous.lean @@ -3,9 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ +module -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps /-! # Continuity of inner product @@ -18,6 +19,8 @@ inner product space, Hilbert space, norm -/ +@[expose] public section + noncomputable section open RCLike Real Filter Topology ComplexConjugate Finsupp diff --git a/Mathlib/Analysis/InnerProductSpace/Convex.lean b/Mathlib/Analysis/InnerProductSpace/Convex.lean index cba95b6e150fa0..d3dcbfeea59534 100644 --- a/Mathlib/Analysis/InnerProductSpace/Convex.lean +++ b/Mathlib/Analysis/InnerProductSpace/Convex.lean @@ -3,9 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ +module -import Mathlib.Analysis.Convex.Uniform -import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.Convex.Uniform +public import Mathlib.Analysis.InnerProductSpace.Basic /-! # Convexity properties of inner product spaces @@ -20,6 +21,8 @@ inner product space, Hilbert space, norm -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/InnerProductSpace/Defs.lean b/Mathlib/Analysis/InnerProductSpace/Defs.lean index 6ccf7cf1af730c..9b5c2ec3ce8bdc 100644 --- a/Mathlib/Analysis/InnerProductSpace/Defs.lean +++ b/Mathlib/Analysis/InnerProductSpace/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ -import Mathlib.Algebra.QuadraticDiscriminant -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Data.Complex.Basic +module + +public import Mathlib.Algebra.QuadraticDiscriminant +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Data.Complex.Basic /-! # Inner product spaces @@ -62,6 +64,8 @@ inner product space, Hilbert space, norm The Coq code is available at the following address: -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/InnerProductSpace/Dual.lean b/Mathlib/Analysis/InnerProductSpace/Dual.lean index c6a74e6d377b3b..af7d70d2819836 100644 --- a/Mathlib/Analysis/InnerProductSpace/Dual.lean +++ b/Mathlib/Analysis/InnerProductSpace/Dual.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule -import Mathlib.Analysis.Normed.Group.NullSubmodule -import Mathlib.Topology.Algebra.Module.PerfectPairing +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +public import Mathlib.Analysis.Normed.Group.NullSubmodule +public import Mathlib.Topology.Algebra.Module.PerfectPairing /-! # The Fréchet-Riesz representation theorem @@ -34,6 +36,8 @@ given by substituting `E →L[𝕜] 𝕜` with `E` using `toDual`. dual, Fréchet-Riesz -/ +@[expose] public section + noncomputable section open ComplexConjugate Module @@ -66,8 +70,13 @@ def toDualMap : E →ₗᵢ⋆[𝕜] StrongDual 𝕜 E := variable {E} @[simp] -theorem toDualMap_apply {x y : E} : toDualMap 𝕜 E x y = ⟪x, y⟫ := - rfl +theorem toContinuousLinearMap_toDualMap : + (toDualMap 𝕜 E).toContinuousLinearMap = innerSL 𝕜 := rfl + +@[simp] +theorem toDualMap_apply_apply {x y : E} : toDualMap 𝕜 E x y = ⟪x, y⟫ := rfl + +@[deprecated (since := "2025-11-15")] alias toDualMap_apply := toDualMap_apply_apply variable {𝕜} in @[simp] @@ -108,8 +117,7 @@ theorem ext_inner_left_basis {ι : Type*} {x y : E} (b : Basis ι 𝕜 E) apply (toDualMap 𝕜 E).map_eq_iff.mp refine (Function.Injective.eq_iff ContinuousLinearMap.coe_injective).mp (b.ext ?_) intro i - simp only [ContinuousLinearMap.coe_coe] - rw [toDualMap_apply, toDualMap_apply] + simp only [ContinuousLinearMap.coe_coe, toDualMap_apply_apply] rw [← inner_conj_symm] conv_rhs => rw [← inner_conj_symm] exact congr_arg conj (h i) @@ -163,19 +171,27 @@ def toDual : E ≃ₗᵢ⋆[𝕜] StrongDual 𝕜 E := ⟪(ℓ z† / ⟪z, z⟫) • z, x⟫ = ℓ z / ⟪z, z⟫ * ⟪z, x⟫ := by simp [inner_smul_left] _ = ℓ z * ⟪z, x⟫ / ⟪z, z⟫ := by rw [← div_mul_eq_mul_div] _ = ℓ x * ⟪z, z⟫ / ⟪z, z⟫ := by rw [h₂] - _ = ℓ x := by field [inner_self_ne_zero.2]) + _ = ℓ x := by have : ⟪z, z⟫ ≠ 0 := inner_self_ne_zero.mpr z_ne_0; field) variable {𝕜} {E} @[simp] -theorem toDual_apply {x y : E} : toDual 𝕜 E x y = ⟪x, y⟫ := - rfl +theorem toDual_apply_apply {x y : E} : toDual 𝕜 E x y = ⟪x, y⟫ := rfl + +@[deprecated (since := "2025-11-15")] alias toDual_apply := toDual_apply_apply @[simp] theorem toDual_symm_apply {x : E} {y : StrongDual 𝕜 E} : ⟪(toDual 𝕜 E).symm y, x⟫ = y x := by - rw [← toDual_apply] + rw [← toDual_apply_apply] simp only [LinearIsometryEquiv.apply_symm_apply] +@[simp] +lemma toLinearIsometry_toDual : + (toDual 𝕜 E).toLinearIsometry = toDualMap 𝕜 E := rfl + +lemma toDual_apply_eq_toDualMap_apply (x : E) : + toDual 𝕜 E x = toDualMap 𝕜 E x := rfl + /-- Maps a bounded sesquilinear form to its continuous linear map, given by interpreting the form as a map `B : E →L⋆[𝕜] StrongDual 𝕜 E` and dualizing the result using `toDual`. diff --git a/Mathlib/Analysis/InnerProductSpace/EuclideanDist.lean b/Mathlib/Analysis/InnerProductSpace/EuclideanDist.lean index 42a4445544801b..241dca7cc37495 100644 --- a/Mathlib/Analysis/InnerProductSpace/EuclideanDist.lean +++ b/Mathlib/Analysis/InnerProductSpace/EuclideanDist.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas +module + +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas /-! # Euclidean distance on a finite-dimensional space @@ -19,6 +21,8 @@ provide some definitions (`Euclidean.ball`, `Euclidean.closedBall`) and simple l distance. This way we hide the usage of `toEuclidean` behind an API. -/ +@[expose] public section + open scoped Topology diff --git a/Mathlib/Analysis/InnerProductSpace/GramMatrix.lean b/Mathlib/Analysis/InnerProductSpace/GramMatrix.lean index 14173511dc18c2..a655301a573816 100644 --- a/Mathlib/Analysis/InnerProductSpace/GramMatrix.lean +++ b/Mathlib/Analysis/InnerProductSpace/GramMatrix.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Pfaffelhuber -/ +module -import Mathlib.LinearAlgebra.Matrix.PosDef +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.LinearAlgebra.Matrix.PosDef /-! # Gram Matrices @@ -23,6 +25,8 @@ Results require `RCLike 𝕜`. equivalent to positive definiteness of `gram 𝕜 v`. -/ +@[expose] public section + open RCLike Real Matrix open scoped InnerProductSpace ComplexOrder ComplexConjugate @@ -78,7 +82,7 @@ theorem posSemidef_gram (v : n → E) : PosSemidef (gram 𝕜 v) := by refine ⟨isHermitian_gram _ _, fun x ↦ ?_⟩ rw [star_dotProduct_gram_mulVec, le_iff_re_im] - simp [inner_self_nonneg] + simp /-- In a normed space, positive definiteness of `gram 𝕜 v` implies linear independence of `v`. -/ theorem linearIndependent_of_posDef_gram {v : n → E} (h_gram : PosDef (gram 𝕜 v)) : diff --git a/Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean b/Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean index 4a9b49653e66b6..1f80cff2f45548 100644 --- a/Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean +++ b/Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Jiale Miao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiale Miao, Kevin Buzzard, Alexander Bentkamp -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.LinearAlgebra.Matrix.Block +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.LinearAlgebra.Matrix.Block /-! # Gram-Schmidt Orthogonalization and Orthonormalization @@ -31,6 +33,8 @@ and outputs a set of orthogonal vectors which have the same span. an indexed set of vectors of the right size -/ +@[expose] public section + open Finset Submodule Module diff --git a/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean b/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean index 26448d261c19ef..e40cc1bd655eec 100644 --- a/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.Harmonic.Analytic +module + +public import Mathlib.Analysis.Complex.Harmonic.Analytic deprecated_module (since := "2025-09-16") diff --git a/Mathlib/Analysis/InnerProductSpace/Harmonic/Basic.lean b/Mathlib/Analysis/InnerProductSpace/Harmonic/Basic.lean index b80045a25cfa68..9457ba761d40ed 100644 --- a/Mathlib/Analysis/InnerProductSpace/Harmonic/Basic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Harmonic/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.InnerProductSpace.Laplacian +module + +public import Mathlib.Analysis.InnerProductSpace.Laplacian /-! # Harmonic Functions @@ -11,6 +13,8 @@ import Mathlib.Analysis.InnerProductSpace.Laplacian This file defines harmonic functions on real, finite-dimensional, inner product spaces `E`. -/ +@[expose] public section + variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] diff --git a/Mathlib/Analysis/InnerProductSpace/Harmonic/Constructions.lean b/Mathlib/Analysis/InnerProductSpace/Harmonic/Constructions.lean index d31c5eee91226f..cd04667e3ec38a 100644 --- a/Mathlib/Analysis/InnerProductSpace/Harmonic/Constructions.lean +++ b/Mathlib/Analysis/InnerProductSpace/Harmonic/Constructions.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic -import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars -import Mathlib.Analysis.SpecialFunctions.Complex.Analytic +module + +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic +public import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars +public import Mathlib.Analysis.SpecialFunctions.Complex.Analytic /-! # Construction of Harmonic Functions @@ -16,6 +18,8 @@ If `f : ℂ → F` is complex-differentiable, then `f` is harmonic. If `F = ℂ` part, imaginary part, and complex conjugate. If `f` has no zero, then `log ‖f‖` is harmonic. -/ +@[expose] public section + open Complex ComplexConjugate InnerProductSpace Topology variable diff --git a/Mathlib/Analysis/InnerProductSpace/JointEigenspace.lean b/Mathlib/Analysis/InnerProductSpace/JointEigenspace.lean index d31f207db50402..124427405cc83d 100644 --- a/Mathlib/Analysis/InnerProductSpace/JointEigenspace.lean +++ b/Mathlib/Analysis/InnerProductSpace/JointEigenspace.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Jon Bannon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Bannon, Jack Cheverton, Samyak Dhar Tuladhar -/ +module -import Mathlib.Analysis.InnerProductSpace.Spectrum -import Mathlib.LinearAlgebra.Eigenspace.Pi -import Mathlib.LinearAlgebra.Eigenspace.Semisimple -import Mathlib.Analysis.InnerProductSpace.Semisimple +public import Mathlib.Analysis.InnerProductSpace.Spectrum +public import Mathlib.LinearAlgebra.Eigenspace.Pi +public import Mathlib.LinearAlgebra.Eigenspace.Semisimple +public import Mathlib.Analysis.InnerProductSpace.Semisimple /-! # Joint eigenspaces of commuting symmetric operators @@ -38,6 +39,8 @@ symmetric operator, simultaneous eigenspaces, joint eigenspaces -/ +@[expose] public section + open Module.End namespace LinearMap diff --git a/Mathlib/Analysis/InnerProductSpace/Laplacian.lean b/Mathlib/Analysis/InnerProductSpace/Laplacian.lean index 210e8a00a36e8a..a40733e6c367f0 100644 --- a/Mathlib/Analysis/InnerProductSpace/Laplacian.lean +++ b/Mathlib/Analysis/InnerProductSpace/Laplacian.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.IteratedDeriv.Defs -import Mathlib.Analysis.InnerProductSpace.CanonicalTensor +module + +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +public import Mathlib.Analysis.InnerProductSpace.CanonicalTensor /-! # The Laplacian @@ -20,6 +22,8 @@ We show that the Laplacian is `ℝ`-linear on continuously differentiable functi standard formula for computing the Laplacian in terms of orthonormal bases of `E`. -/ +@[expose] public section + open Filter TensorProduct Topology section secondDerivativeAPI @@ -42,7 +46,7 @@ variable variable (𝕜) in /-- Convenience reformulation of the second iterated derivative, as a map from `E` to bilinear maps -`E →ₗ[ℝ] E →ₗ[ℝ] ℝ +`E →ₗ[ℝ] E →ₗ[ℝ] ℝ`. -/ noncomputable def bilinearIteratedFDerivWithinTwo (f : E → F) (s : Set E) : E → E →ₗ[𝕜] E →ₗ[𝕜] F := fun x ↦ (fderivWithin 𝕜 (fderivWithin 𝕜 f s) s x).toLinearMap₁₂ @@ -50,7 +54,7 @@ noncomputable def bilinearIteratedFDerivWithinTwo (f : E → F) (s : Set E) : E variable (𝕜) in /-- Convenience reformulation of the second iterated derivative, as a map from `E` to bilinear maps -`E →ₗ[ℝ] E →ₗ[ℝ] ℝ +`E →ₗ[ℝ] E →ₗ[ℝ] ℝ`. -/ noncomputable def bilinearIteratedFDerivTwo (f : E → F) : E → E →ₗ[𝕜] E →ₗ[𝕜] F := fun x ↦ (fderiv 𝕜 (fderiv 𝕜 f) x).toLinearMap₁₂ diff --git a/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean b/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean index e86f4b7c73950a..d01fe6ec65173c 100644 --- a/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean +++ b/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Daniel Roca González. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Roca González -/ -import Mathlib.Analysis.InnerProductSpace.Dual +module + +public import Mathlib.Analysis.InnerProductSpace.Dual /-! # The Lax-Milgram Theorem @@ -28,6 +30,8 @@ that is, the map `InnerProductSpace.continuousLinearMapOfBilin` from dual, Lax-Milgram -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/InnerProductSpace/LinearMap.lean b/Mathlib/Analysis/InnerProductSpace/LinearMap.lean index 06069ed50a55d8..e272a219bc5365 100644 --- a/Mathlib/Analysis/InnerProductSpace/LinearMap.lean +++ b/Mathlib/Analysis/InnerProductSpace/LinearMap.lean @@ -3,8 +3,9 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ +module -import Mathlib.Analysis.InnerProductSpace.Continuous +public import Mathlib.Analysis.InnerProductSpace.Continuous /-! # Linear maps on inner product spaces @@ -26,6 +27,8 @@ inner product space, Hilbert space, norm -/ +@[expose] public section + noncomputable section open RCLike Real Filter Topology ComplexConjugate Finsupp @@ -162,11 +165,11 @@ def innerₛₗ : E →ₗ⋆[𝕜] E →ₗ[𝕜] 𝕜 := inner_add_right fun _ _ _ => inner_smul_right _ _ _ @[simp] -theorem innerₛₗ_apply_coe (v : E) : ⇑(innerₛₗ 𝕜 v) = fun w => ⟪v, w⟫ := +theorem coe_innerₛₗ_apply (v : E) : ⇑(innerₛₗ 𝕜 v) = fun w => ⟪v, w⟫ := rfl @[simp] -theorem innerₛₗ_apply (v w : E) : innerₛₗ 𝕜 v w = ⟪v, w⟫ := +theorem innerₛₗ_apply_apply (v w : E) : innerₛₗ 𝕜 v w = ⟪v, w⟫ := rfl variable (F) @@ -179,21 +182,20 @@ def innerₗ : F →ₗ[ℝ] F →ₗ[ℝ] ℝ := innerₛₗ ℝ variable {F} -@[simp] lemma innerₗ_apply (v w : F) : innerₗ F v w = ⟪v, w⟫_ℝ := rfl +@[simp] lemma innerₗ_apply_apply (v w : F) : innerₗ F v w = ⟪v, w⟫_ℝ := rfl /-- The inner product as a continuous sesquilinear map. Note that `toDualMap` (resp. `toDual`) in `InnerProductSpace.Dual` is a version of this given as a linear isometry (resp. linear isometric equivalence). -/ def innerSL : E →L⋆[𝕜] E →L[𝕜] 𝕜 := LinearMap.mkContinuous₂ (innerₛₗ 𝕜) 1 fun x y => by - simp only [norm_inner_le_norm, one_mul, innerₛₗ_apply] + simp only [norm_inner_le_norm, one_mul, innerₛₗ_apply_apply] @[simp] -theorem innerSL_apply_coe (v : E) : ⇑(innerSL 𝕜 v) = fun w => ⟪v, w⟫ := +theorem coe_innerSL_apply (v : E) : ⇑(innerSL 𝕜 v) = fun w => ⟪v, w⟫ := rfl -@[simp] -theorem innerSL_apply (v w : E) : innerSL 𝕜 v w = ⟪v, w⟫ := +theorem innerSL_apply_apply (v w : E) : innerSL 𝕜 v w = ⟪v, w⟫ := rfl /-- The inner product as a continuous sesquilinear map, with the two arguments flipped. -/ @@ -202,14 +204,22 @@ def innerSLFlip : E →L[𝕜] E →L⋆[𝕜] 𝕜 := (innerSL 𝕜) @[simp] -theorem innerSLFlip_apply (x y : E) : innerSLFlip 𝕜 x y = ⟪y, x⟫ := +theorem innerSLFlip_apply_apply (x y : E) : innerSLFlip 𝕜 x y = ⟪y, x⟫ := rfl variable (F) in -@[simp] lemma innerSL_real_flip : (innerSL ℝ (E := F)).flip = innerSL ℝ (E := F) := by +@[simp] lemma flip_innerSL_real : (innerSL ℝ (E := F)).flip = innerSL ℝ (E := F) := by ext v w exact real_inner_comm _ _ +@[deprecated (since := "2025-11-15")] alias innerₛₗ_apply_coe := coe_innerₛₗ_apply +@[deprecated (since := "2025-11-15")] alias innerₛₗ_apply := innerₛₗ_apply_apply +@[deprecated (since := "2025-11-15")] alias innerₗ_apply := innerₗ_apply_apply +@[deprecated (since := "2025-11-15")] alias innerSL_apply_coe := coe_innerSL_apply +@[deprecated (since := "2025-11-15")] alias innerSL_apply := innerSL_apply_apply +@[deprecated (since := "2025-11-15")] alias innerSLFlip_apply := innerSLFlip_apply_apply +@[deprecated (since := "2025-11-15")] alias innerSL_real_flip := flip_innerSL_real + variable {𝕜} namespace ContinuousLinearMap diff --git a/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean b/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean index a8d9dc0da2c746..d6992b554f2556 100644 --- a/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean +++ b/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.InnerProductSpace.Adjoint -import Mathlib.Analysis.InnerProductSpace.ProdL2 -import Mathlib.Analysis.Normed.Operator.Extend -import Mathlib.Topology.Algebra.Module.Equiv -import Mathlib.Topology.Algebra.Module.LinearPMap +module + +public import Mathlib.Analysis.InnerProductSpace.Adjoint +public import Mathlib.Analysis.InnerProductSpace.ProdL2 +public import Mathlib.Analysis.Normed.Operator.Extend +public import Mathlib.Topology.Algebra.Module.Equiv +public import Mathlib.Topology.Algebra.Module.LinearPMap /-! @@ -50,6 +52,8 @@ We use the junk value pattern to define the adjoint for all `LinearPMap`s. In th Unbounded operators, closed operators -/ +@[expose] public section + noncomputable section @@ -207,7 +211,7 @@ theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) : (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by ext x y hxy · simp only [LinearMap.toPMap_domain, Submodule.mem_top, iff_true, - LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, innerₛₗ_apply_coe] + LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, coe_innerₛₗ_apply] exact ((innerSL 𝕜 x).comp <| A.comp <| Submodule.subtypeL _).cont refine LinearPMap.adjoint_apply_eq hp _ fun v => ?_ simp only [adjoint_inner_left, LinearMap.toPMap_apply, coe_coe] diff --git a/Mathlib/Analysis/InnerProductSpace/MeanErgodic.lean b/Mathlib/Analysis/InnerProductSpace/MeanErgodic.lean index f2e37ae15f8458..ed0313ea49d550 100644 --- a/Mathlib/Analysis/InnerProductSpace/MeanErgodic.lean +++ b/Mathlib/Analysis/InnerProductSpace/MeanErgodic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule -import Mathlib.Dynamics.BirkhoffSum.NormedSpace +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +public import Mathlib.Dynamics.BirkhoffSum.NormedSpace /-! # Von Neumann Mean Ergodic Theorem in a Hilbert Space @@ -19,6 +21,8 @@ converge to the orthogonal projection of `x` to the subspace of fixed points of see `ContinuousLinearMap.tendsto_birkhoffAverage_orthogonalProjection`. -/ +@[expose] public section + open Filter Finset Function Bornology open scoped Topology @@ -100,4 +104,4 @@ theorem ContinuousLinearMap.tendsto_birkhoffAverage_orthogonalProjection (f : E · simpa using f.le_of_opNorm_le hf x · have : ∀ y, ⟪f y, x⟫ = ⟪y, x⟫ := by simpa [Submodule.mem_orthogonal, inner_sub_left, sub_eq_zero] using hx - simp [this, ← norm_sq_eq_re_inner] + simp [this] diff --git a/Mathlib/Analysis/InnerProductSpace/MulOpposite.lean b/Mathlib/Analysis/InnerProductSpace/MulOpposite.lean index 51886b80c43ffb..cb29d6e5076882 100644 --- a/Mathlib/Analysis/InnerProductSpace/MulOpposite.lean +++ b/Mathlib/Analysis/InnerProductSpace/MulOpposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.LinearAlgebra.Basis.MulOpposite +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.LinearAlgebra.Basis.MulOpposite /-! # Inner product space on `Hᵐᵒᵖ` @@ -13,6 +15,8 @@ This file defines the inner product space structure on `Hᵐᵒᵖ` where we def the inner product naturally. We also define `OrthonormalBasis.mulOpposite`. -/ +@[expose] public section + namespace MulOpposite variable {𝕜 H : Type*} diff --git a/Mathlib/Analysis/InnerProductSpace/NormPow.lean b/Mathlib/Analysis/InnerProductSpace/NormPow.lean index 93b208d8fc70bb..78ccf785250698 100644 --- a/Mathlib/Analysis/InnerProductSpace/NormPow.lean +++ b/Mathlib/Analysis/InnerProductSpace/NormPow.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +module + +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv /-! # Properties about the powers of the norm @@ -17,6 +19,8 @@ an inner product space and for a real number `p > 1`. -/ +@[expose] public section + section ContDiffNormPow open Asymptotics Real Topology diff --git a/Mathlib/Analysis/InnerProductSpace/OfNorm.lean b/Mathlib/Analysis/InnerProductSpace/OfNorm.lean index 59da2bbc485db5..3cb8ac9aecb474 100644 --- a/Mathlib/Analysis/InnerProductSpace/OfNorm.lean +++ b/Mathlib/Analysis/InnerProductSpace/OfNorm.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Topology.Algebra.Algebra -import Mathlib.Analysis.InnerProductSpace.Convex -import Mathlib.Algebra.Module.LinearMap.Rat -import Mathlib.Tactic.Module +module + +public import Mathlib.Topology.Algebra.Algebra +public import Mathlib.Analysis.InnerProductSpace.Convex +public import Mathlib.Algebra.Module.LinearMap.Rat +public import Mathlib.Tactic.Module /-! # Inner product space derived from a norm @@ -52,6 +54,8 @@ Move upstream to `Analysis.InnerProductSpace.Basic`. inner product space, Hilbert space, norm -/ +@[expose] public section + open RCLike diff --git a/Mathlib/Analysis/InnerProductSpace/Orientation.lean b/Mathlib/Analysis/InnerProductSpace/Orientation.lean index 2b6eb83c49601b..48a770f98db49f 100644 --- a/Mathlib/Analysis/InnerProductSpace/Orientation.lean +++ b/Mathlib/Analysis/InnerProductSpace/Orientation.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho -import Mathlib.LinearAlgebra.Orientation +module + +public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho +public import Mathlib.LinearAlgebra.Orientation /-! # Orientations of real inner product spaces. @@ -33,6 +35,8 @@ This file provides definitions and proves lemmas about orientations of real inne -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/InnerProductSpace/Orthogonal.lean b/Mathlib/Analysis/InnerProductSpace/Orthogonal.lean index 2c328d86a29610..d575352766f275 100644 --- a/Mathlib/Analysis/InnerProductSpace/Orthogonal.lean +++ b/Mathlib/Analysis/InnerProductSpace/Orthogonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ -import Mathlib.Analysis.InnerProductSpace.Subspace -import Mathlib.LinearAlgebra.SesquilinearForm.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Subspace +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic /-! # Orthogonal complements of submodules @@ -23,6 +25,8 @@ The proposition that two submodules are orthogonal, `Submodule.IsOrtho`, is deno Note this is not the same unicode symbol as `⊥` (`Bot`). -/ +@[expose] public section + variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] @@ -119,6 +123,11 @@ theorem isClosed_orthogonal : IsClosed (Kᗮ : Set E) := by instance instOrthogonalCompleteSpace [CompleteSpace E] : CompleteSpace Kᗮ := K.isClosed_orthogonal.completeSpace_coe +lemma map_orthogonal (f : E ≃ₗᵢ[𝕜] F) : Kᗮ.map f = (K.map f)ᗮ := by + simp only [Submodule.ext_iff, mem_map, mem_orthogonal, forall_exists_index, and_imp, + forall_apply_eq_imp_iff₂, LinearIsometryEquiv.inner_map_eq_flip] + exact fun x ↦ ⟨fun ⟨y, hy⟩ z hz ↦ by simp [← hy.2, hy.1 _ hz], fun h ↦ ⟨_, h, by simp⟩⟩ + variable (𝕜 E) /-- `orthogonal` gives a `GaloisConnection` between diff --git a/Mathlib/Analysis/InnerProductSpace/Orthonormal.lean b/Mathlib/Analysis/InnerProductSpace/Orthonormal.lean index 33086b2ed7bc7f..ebfc7ab38c9dfd 100644 --- a/Mathlib/Analysis/InnerProductSpace/Orthonormal.lean +++ b/Mathlib/Analysis/InnerProductSpace/Orthonormal.lean @@ -3,10 +3,11 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ +module -import Mathlib.Analysis.InnerProductSpace.LinearMap -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.RingTheory.LocalRing.Basic +public import Mathlib.Analysis.InnerProductSpace.LinearMap +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.RingTheory.LocalRing.Basic /-! # Orthonormal sets @@ -25,6 +26,8 @@ For the existence of orthonormal bases, Hilbert bases, etc., see the file `Analysis.InnerProductSpace.projection`. -/ +@[expose] public section + noncomputable section open RCLike Real Filter Module Topology ComplexConjugate Finsupp @@ -84,7 +87,8 @@ theorem orthonormal_iff_ite [DecidableEq ι] {v : ι → E} : · intro h constructor · intro i - have h' : ‖v i‖ ^ 2 = 1 ^ 2 := by simp [@norm_sq_eq_re_inner 𝕜, h i i] + have h' : ‖v i‖ ^ 2 = 1 ^ 2 := by + rw [@norm_sq_eq_re_inner 𝕜, h i i]; simp have h₁ : 0 ≤ ‖v i‖ := norm_nonneg _ have h₂ : (0 : ℝ) ≤ 1 := zero_le_one rwa [sq_eq_sq₀ h₁ h₂] at h' diff --git a/Mathlib/Analysis/InnerProductSpace/PiL2.lean b/Mathlib/Analysis/InnerProductSpace/PiL2.lean index 8101e9c5404b46..835915cc070fac 100644 --- a/Mathlib/Analysis/InnerProductSpace/PiL2.lean +++ b/Mathlib/Analysis/InnerProductSpace/PiL2.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Sébastien Gouëzel, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional -import Mathlib.Analysis.Normed.Lp.PiLp -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.UnitaryGroup -import Mathlib.Util.Superscript +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional +public import Mathlib.Analysis.Normed.Lp.PiLp +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.UnitaryGroup +public import Mathlib.Util.Superscript /-! # `L²` inner product space structure on finite products of inner product spaces @@ -53,6 +55,8 @@ For consequences in infinite dimension (Hilbert bases, etc.), see the file -/ +@[expose] public section + open Module Real Set Filter RCLike Submodule Function Uniformity Topology NNReal ENNReal ComplexConjugate DirectSum WithLp @@ -119,7 +123,7 @@ macro_rules | `(!$p:subscript[$e:term,*]) => do /-- Unexpander for the `!₂[x, y, ...]` notation. -/ @[app_delab WithLp.toLp] -def EuclideanSpace.delabVecNotation : Delab := +meta def EuclideanSpace.delabVecNotation : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| withOverApp 3 do -- check that the `WithLp.toLp _` is present let p : Term ← withNaryArg 0 <| delab @@ -422,9 +426,8 @@ lemma enorm_eq_one (b : OrthonormalBasis ι 𝕜 E) (i : ι) : lemma inner_eq_zero (b : OrthonormalBasis ι 𝕜 E) {i j : ι} (hij : i ≠ j) : ⟪b i, b j⟫ = 0 := b.orthonormal.inner_eq_zero hij -@[simp] lemma inner_eq_one (b : OrthonormalBasis ι 𝕜 E) (i : ι) : ⟪b i, b i⟫ = 1 := by - simp [inner_self_eq_norm_sq_to_K] + simp lemma inner_eq_ite [DecidableEq ι] (b : OrthonormalBasis ι 𝕜 E) (i j : ι) : ⟪b i, b j⟫ = if i = j then 1 else 0 := by diff --git a/Mathlib/Analysis/InnerProductSpace/Positive.lean b/Mathlib/Analysis/InnerProductSpace/Positive.lean index 815b6ad4947854..35f571056a0d8d 100644 --- a/Mathlib/Analysis/InnerProductSpace/Positive.lean +++ b/Mathlib/Analysis/InnerProductSpace/Positive.lean @@ -3,8 +3,11 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.InnerProductSpace.Spectrum -import Mathlib.LinearAlgebra.Matrix.PosDef +module + +public import Mathlib.Analysis.InnerProductSpace.Spectrum +public import Mathlib.Analysis.Matrix.Hermitian +public import Mathlib.LinearAlgebra.Matrix.PosDef /-! # Positive operators @@ -36,6 +39,8 @@ of requiring self adjointness in the definition. Positive operator -/ +@[expose] public section + open InnerProductSpace RCLike LinearMap ContinuousLinearMap open scoped InnerProduct ComplexConjugate diff --git a/Mathlib/Analysis/InnerProductSpace/ProdL2.lean b/Mathlib/Analysis/InnerProductSpace/ProdL2.lean index 716572a3825065..111d84759b1bfc 100644 --- a/Mathlib/Analysis/InnerProductSpace/ProdL2.lean +++ b/Mathlib/Analysis/InnerProductSpace/ProdL2.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Analysis.Normed.Lp.ProdLp +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Analysis.Normed.Lp.ProdLp /-! # `L²` inner product space structure on products of inner product spaces @@ -16,6 +18,8 @@ $$ This is recorded in this file as an inner product space instance on `WithLp 2 (E × F)`. -/ +@[expose] public section + open Module open scoped InnerProductSpace @@ -29,7 +33,7 @@ noncomputable instance instProdInnerProductSpace : InnerProductSpace 𝕜 (WithLp 2 (E × F)) where inner x y := ⟪x.fst, y.fst⟫_𝕜 + ⟪x.snd, y.snd⟫_𝕜 norm_sq_eq_re_inner x := by - simp [prod_norm_sq_eq_of_L2, ← norm_sq_eq_re_inner] + simp [prod_norm_sq_eq_of_L2] conj_inner_symm x y := by simp add_left x y z := by diff --git a/Mathlib/Analysis/InnerProductSpace/Projection.lean b/Mathlib/Analysis/InnerProductSpace/Projection.lean index 5988ff13fd12aa..663901e120637d 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection.lean @@ -1,7 +1,9 @@ -import Mathlib.Analysis.InnerProductSpace.Projection.Basic -import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional -import Mathlib.Analysis.InnerProductSpace.Projection.Minimal -import Mathlib.Analysis.InnerProductSpace.Projection.Reflection -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic +public import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional +public import Mathlib.Analysis.InnerProductSpace.Projection.Minimal +public import Mathlib.Analysis.InnerProductSpace.Projection.Reflection +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule deprecated_module (since := "2025-08-08") diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean index 692b540e3a99d7..77bb720388f415 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Minimal -import Mathlib.Analysis.InnerProductSpace.Symmetric -import Mathlib.Analysis.RCLike.Lemmas +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Minimal +public import Mathlib.Analysis.InnerProductSpace.Symmetric +public import Mathlib.Analysis.RCLike.Lemmas /-! # The orthogonal projection @@ -30,6 +32,8 @@ The orthogonal projection construction is adapted from The Coq code is available at the following address: -/ +@[expose] public section + variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [NormedAddCommGroup F] variable [InnerProductSpace 𝕜 E] [InnerProductSpace ℝ F] diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean b/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean index 1eb99892bdd0b0..088610d2de46d3 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Basic -import Mathlib.Analysis.InnerProductSpace.Projection.Reflection -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.Analysis.Normed.Module.RCLike.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic +public import Mathlib.Analysis.InnerProductSpace.Projection.Reflection +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.Analysis.Normed.Module.RCLike.Basic /-! # Orthogonal projections in finite-dimensional spaces @@ -29,6 +31,8 @@ generated by reflections. * `maximal_orthonormal_iff_orthogonalComplement_eq_bot` -/ +@[expose] public section + variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [NormedAddCommGroup F] variable [InnerProductSpace 𝕜 E] [InnerProductSpace ℝ F] diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean index 923e6f6228749d..38974a91ad5ac4 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.SpecificLimits.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Existence of minimizers (Hilbert projection theorem) @@ -14,6 +16,8 @@ This is the key tool that is used to define `Submodule.orthogonalProjection` in `Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean`. -/ +@[expose] public section + variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [NormedAddCommGroup F] variable [InnerProductSpace 𝕜 E] [InnerProductSpace ℝ F] diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean index 40e6f2356cc919..ba6024001ee472 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic /-! # Reflection @@ -12,6 +14,8 @@ A linear isometry equivalence `K.reflection : E ≃ₗᵢ[𝕜] E` in constructe for each `u : E`, `K.reflection u = 2 • K.starProjection u - u`. -/ +@[expose] public section + noncomputable section namespace Submodule diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Submodule.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Submodule.lean index 7ad4e084d6436b..77ddf73d7e03b2 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Submodule.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Submodule.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic /-! # Subspaces associated with orthogonal projections @@ -17,6 +19,8 @@ stating that for a subspace `K` of `E` such that `K` admits an orthogonal projec `K ⊔ Kᗮ = ⊤`, is a typical example. -/ +@[expose] public section + variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [NormedAddCommGroup F] variable [InnerProductSpace 𝕜 E] [InnerProductSpace ℝ F] diff --git a/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean b/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean index ae548225aedd2e..1c97dba4fd9c94 100644 --- a/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean +++ b/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth, Frédéric Dupuis -/ -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.InnerProductSpace.Adjoint -import Mathlib.Analysis.Calculus.LagrangeMultipliers -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.Algebra.EuclideanDomain.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.InnerProductSpace.Adjoint +public import Mathlib.Analysis.Calculus.LagrangeMultipliers +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.Algebra.EuclideanDomain.Basic /-! # The Rayleigh quotient @@ -35,6 +37,8 @@ A slightly more elaborate corollary is that if `E` is complete and `T` is a comp -/ +@[expose] public section + variable {𝕜 : Type*} [RCLike 𝕜] variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] @@ -101,7 +105,7 @@ theorem _root_.LinearMap.IsSymmetric.hasStrictFDerivAt_reApplyInnerSelf {T : F convert T.hasStrictFDerivAt.inner ℝ (hasStrictFDerivAt_id x₀) using 1 ext y rw [ContinuousLinearMap.smul_apply, ContinuousLinearMap.comp_apply, fderivInnerCLM_apply, - ContinuousLinearMap.prod_apply, innerSL_apply, id, ContinuousLinearMap.id_apply, + ContinuousLinearMap.prod_apply, innerSL_apply_apply, id, ContinuousLinearMap.id_apply, hT.apply_clm x₀ y, real_inner_comm _ x₀, two_smul] variable [CompleteSpace F] {T : F →L[ℝ] F} @@ -144,7 +148,7 @@ theorem eq_smul_self_of_isLocalExtrOn_real (hT : IsSelfAdjoint T) {x₀ : F} set c : ℝ := -b⁻¹ * a convert hc have := congr_arg (fun x => ⟪x, x₀⟫_ℝ) hc - simp [field, inner_smul_left, real_inner_self_eq_norm_mul_norm, mul_comm a] at this ⊢ + simp [field, inner_smul_left, mul_comm a] at this ⊢ exact this end Real diff --git a/Mathlib/Analysis/InnerProductSpace/Semisimple.lean b/Mathlib/Analysis/InnerProductSpace/Semisimple.lean index 247823f55e9065..6ac3ae4c0724f8 100644 --- a/Mathlib/Analysis/InnerProductSpace/Semisimple.lean +++ b/Mathlib/Analysis/InnerProductSpace/Semisimple.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule -import Mathlib.LinearAlgebra.Semisimple +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +public import Mathlib.LinearAlgebra.Semisimple /-! # Semisimple operators on inner product spaces @@ -14,6 +16,8 @@ product spaces. -/ +@[expose] public section + variable {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] namespace LinearMap.IsSymmetric diff --git a/Mathlib/Analysis/InnerProductSpace/Spectrum.lean b/Mathlib/Analysis/InnerProductSpace/Spectrum.lean index d6d62a0f89c52f..8a5f077dad2e34 100644 --- a/Mathlib/Analysis/InnerProductSpace/Spectrum.lean +++ b/Mathlib/Analysis/InnerProductSpace/Spectrum.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Rayleigh -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.LinearAlgebra.Eigenspace.Minpoly -import Mathlib.Data.Fin.Tuple.Sort +module + +public import Mathlib.Analysis.InnerProductSpace.Rayleigh +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.LinearAlgebra.Eigenspace.Minpoly +public import Mathlib.Data.Fin.Tuple.Sort /-! # Spectral theory of self-adjoint operators @@ -55,6 +57,8 @@ self-adjoint operator, spectral theorem, diagonalization theorem -/ +@[expose] public section + variable {𝕜 : Type*} [RCLike 𝕜] variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] diff --git a/Mathlib/Analysis/InnerProductSpace/StarOrder.lean b/Mathlib/Analysis/InnerProductSpace/StarOrder.lean index 4a9197677eeba3..ec54ce37b69dea 100644 --- a/Mathlib/Analysis/InnerProductSpace/StarOrder.lean +++ b/Mathlib/Analysis/InnerProductSpace/StarOrder.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.InnerProductSpace.Positive -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap +module + +public import Mathlib.Analysis.InnerProductSpace.Positive +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap /-! # Continuous linear maps on a Hilbert space are a `StarOrderedRing` @@ -18,6 +20,8 @@ equipped with all the usual instances of the continuous functional calculus. -/ +@[expose] public section + namespace ContinuousLinearMap open RCLike diff --git a/Mathlib/Analysis/InnerProductSpace/Subspace.lean b/Mathlib/Analysis/InnerProductSpace/Subspace.lean index d99917a9f8f540..051a2b01d452b5 100644 --- a/Mathlib/Analysis/InnerProductSpace/Subspace.lean +++ b/Mathlib/Analysis/InnerProductSpace/Subspace.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis -/ -import Mathlib.Analysis.InnerProductSpace.Orthonormal +module + +public import Mathlib.Analysis.InnerProductSpace.Orthonormal /-! # Subspaces of inner product spaces @@ -12,6 +14,8 @@ This file defines the inner-product structure on a subspace of an inner-product some theorems about orthogonal families of subspaces. -/ +@[expose] public section + noncomputable section open RCLike Real Filter Topology ComplexConjugate Finsupp Module diff --git a/Mathlib/Analysis/InnerProductSpace/Symmetric.lean b/Mathlib/Analysis/InnerProductSpace/Symmetric.lean index 516fdab15f86f1..8ae2c484e91753 100644 --- a/Mathlib/Analysis/InnerProductSpace/Symmetric.lean +++ b/Mathlib/Analysis/InnerProductSpace/Symmetric.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Subspace -import Mathlib.Analysis.Normed.Operator.Banach -import Mathlib.LinearAlgebra.SesquilinearForm.Basic -import Mathlib.Analysis.InnerProductSpace.Orthogonal +module + +public import Mathlib.Analysis.InnerProductSpace.Subspace +public import Mathlib.Analysis.Normed.Operator.Banach +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic +public import Mathlib.Analysis.InnerProductSpace.Orthogonal /-! # Symmetric linear maps in an inner product space @@ -32,6 +34,8 @@ doesn't rely on the definition of the adjoint, which allows it to be stated in n self-adjoint, symmetric -/ +@[expose] public section + open RCLike diff --git a/Mathlib/Analysis/InnerProductSpace/TensorProduct.lean b/Mathlib/Analysis/InnerProductSpace/TensorProduct.lean index 81abb339c31f94..0bc4e18f13bdc8 100644 --- a/Mathlib/Analysis/InnerProductSpace/TensorProduct.lean +++ b/Mathlib/Analysis/InnerProductSpace/TensorProduct.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Analysis.InnerProductSpace.Adjoint -import Mathlib.Analysis.InnerProductSpace.LinearMap -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.LinearAlgebra.TensorProduct.Basic -import Mathlib.LinearAlgebra.TensorProduct.Finiteness -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.Analysis.InnerProductSpace.Adjoint +public import Mathlib.Analysis.InnerProductSpace.LinearMap +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.LinearAlgebra.TensorProduct.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.RingTheory.TensorProduct.Finite /-! @@ -45,6 +47,8 @@ inner product spaces. -/ +@[expose] public section + variable {𝕜 E F G H : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] @@ -64,6 +68,7 @@ instance instInner : Inner 𝕜 (E ⊗[𝕜] F) := ⟨fun x y => inner_ x y⟩ private lemma inner_def (x y : E ⊗[𝕜] F) : inner 𝕜 x y = inner_ x y := rfl +variable (𝕜) in @[simp] theorem inner_tmul (x x' : E) (y y' : F) : inner 𝕜 (x ⊗ₜ[𝕜] y) (x' ⊗ₜ[𝕜] y') = inner 𝕜 x x' * inner 𝕜 y y' := rfl @@ -139,7 +144,7 @@ instance instInnerProductSpace : InnerProductSpace 𝕜 (E ⊗[𝕜] F) := .ofCo @[simp] theorem norm_tmul (x : E) (y : F) : ‖x ⊗ₜ[𝕜] y‖ = ‖x‖ * ‖y‖ := by - simp [norm_eq_sqrt_re_inner (𝕜 := 𝕜), Real.sqrt_mul inner_self_nonneg] + simpa using congr(√(RCLike.re $(inner_tmul 𝕜 x x y y))) @[simp] theorem nnnorm_tmul (x : E) (y : F) : ‖x ⊗ₜ[𝕜] y‖₊ = ‖x‖₊ * ‖y‖₊ := by simp [← NNReal.coe_inj] diff --git a/Mathlib/Analysis/InnerProductSpace/Trace.lean b/Mathlib/Analysis/InnerProductSpace/Trace.lean index 761658d3c9c888..55728de0a67608 100644 --- a/Mathlib/Analysis/InnerProductSpace/Trace.lean +++ b/Mathlib/Analysis/InnerProductSpace/Trace.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Iván Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Iván Renison -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Analysis.InnerProductSpace.Spectrum -import Mathlib.LinearAlgebra.Trace +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Analysis.InnerProductSpace.Spectrum +public import Mathlib.LinearAlgebra.Trace /-! # Traces in inner product spaces @@ -13,6 +15,8 @@ import Mathlib.LinearAlgebra.Trace This file contains various results about traces of linear operators in inner product spaces. -/ +@[expose] public section + namespace LinearMap variable {𝕜 E ι : Type*} [RCLike 𝕜] [Fintype ι] diff --git a/Mathlib/Analysis/InnerProductSpace/TwoDim.lean b/Mathlib/Analysis/InnerProductSpace/TwoDim.lean index 1d681c6d5c33b8..5ed8eaf542ce3d 100644 --- a/Mathlib/Analysis/InnerProductSpace/TwoDim.lean +++ b/Mathlib/Analysis/InnerProductSpace/TwoDim.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.InnerProductSpace.Orientation -import Mathlib.LinearAlgebra.Alternating.Curry -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.LinearAlgebra.Complex.Orientation -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.InnerProductSpace.Orientation +public import Mathlib.LinearAlgebra.Alternating.Curry +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.LinearAlgebra.Complex.Orientation +public import Mathlib.Tactic.LinearCombination /-! # Oriented two-dimensional real inner product spaces @@ -67,6 +69,8 @@ local notation "J" => o.rightAngleRotation -/ +@[expose] public section + noncomputable section @@ -349,8 +353,8 @@ theorem inner_mul_inner_add_areaForm_mul_areaForm' (a x : E) : apply (o.basisRightAngleRotation a ha).ext intro i fin_cases i - · simp [real_inner_self_eq_norm_sq, mul_comm, real_inner_comm] - · simp [real_inner_self_eq_norm_sq, mul_comm, o.areaForm_swap a x] + · simp [mul_comm, real_inner_comm] + · simp [mul_comm, o.areaForm_swap a x] /-- For vectors `a x y : E`, the identity `⟪a, x⟫ * ⟪a, y⟫ + ω a x * ω a y = ‖a‖ ^ 2 * ⟪x, y⟫`. -/ theorem inner_mul_inner_add_areaForm_mul_areaForm (a x y : E) : @@ -368,8 +372,8 @@ theorem inner_mul_areaForm_sub' (a x : E) : ⟪a, x⟫ • ω a - ω a x • inn apply (o.basisRightAngleRotation a ha).ext intro i fin_cases i - · simp [real_inner_self_eq_norm_sq, mul_comm, o.areaForm_swap a x] - · simp [real_inner_self_eq_norm_sq, mul_comm, real_inner_comm] + · simp [mul_comm, o.areaForm_swap a x] + · simp [mul_comm, real_inner_comm] /-- For vectors `a x y : E`, the identity `⟪a, x⟫ * ω a y - ω a x * ⟪a, y⟫ = ‖a‖ ^ 2 * ω x y`. -/ theorem inner_mul_areaForm_sub (a x y : E) : ⟪a, x⟫ * ω a y - ω a x * ⟪a, y⟫ = ‖a‖ ^ 2 * ω x y := @@ -420,7 +424,7 @@ theorem kahler_swap (x y : E) : o.kahler x y = conj (o.kahler y x) := by @[simp] theorem kahler_apply_self (x : E) : o.kahler x x = ‖x‖ ^ 2 := by - simp [kahler_apply_apply, real_inner_self_eq_norm_sq] + simp [kahler_apply_apply] @[simp] theorem kahler_rightAngleRotation_left (x y : E) : diff --git a/Mathlib/Analysis/InnerProductSpace/WeakOperatorTopology.lean b/Mathlib/Analysis/InnerProductSpace/WeakOperatorTopology.lean index 29ec80a409d577..a8a44c2b8d2b70 100644 --- a/Mathlib/Analysis/InnerProductSpace/WeakOperatorTopology.lean +++ b/Mathlib/Analysis/InnerProductSpace/WeakOperatorTopology.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.LocallyConvex.WeakOperatorTopology +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.LocallyConvex.WeakOperatorTopology /-! # The weak operator topology in Hilbert spaces @@ -15,6 +16,8 @@ Hilbert spaces. This mostly involves using the Fréchet-Riesz representation to applications of elements of the dual and inner products with vectors in the space. -/ +@[expose] public section + open scoped Topology InnerProductSpace namespace ContinuousLinearMapWOT @@ -33,7 +36,7 @@ open Filter in lemma tendsto_iff_forall_inner_apply_tendsto [CompleteSpace F] {α : Type*} {l : Filter α} {f : α → E →WOT[𝕜] F} {A : E →WOT[𝕜] F} : Tendsto f l (𝓝 A) ↔ ∀ x y, Tendsto (fun a => ⟪y, (f a) x⟫_𝕜) l (𝓝 ⟪y, A x⟫_𝕜) := by - simp_rw [tendsto_iff_forall_dual_apply_tendsto, ← InnerProductSpace.toDual_apply] + simp_rw [tendsto_iff_forall_dual_apply_tendsto] exact .symm <| forall_congr' fun _ ↦ Equiv.forall_congr (InnerProductSpace.toDual 𝕜 F) fun _ ↦ Iff.rfl diff --git a/Mathlib/Analysis/InnerProductSpace/l2Space.lean b/Mathlib/Analysis/InnerProductSpace/l2Space.lean index 0087ab2095ad70..bea367bf427921 100644 --- a/Mathlib/Analysis/InnerProductSpace/l2Space.lean +++ b/Mathlib/Analysis/InnerProductSpace/l2Space.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Basic -import Mathlib.Analysis.Normed.Lp.lpSpace -import Mathlib.Analysis.InnerProductSpace.PiL2 +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic +public import Mathlib.Analysis.Normed.Lp.lpSpace +public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # Hilbert sum of a family of inner product spaces @@ -79,6 +81,8 @@ We also define a *predicate* `IsHilbertSum 𝕜 G V`, where `V : Π i, G i → Hilbert space, Hilbert sum, l2, Hilbert basis, unitary equivalence, isometric isomorphism -/ +@[expose] public section + open RCLike Submodule Filter open scoped NNReal ENNReal ComplexConjugate Topology @@ -115,7 +119,7 @@ instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) := ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := lp.norm_rpow_eq_tsum ?_ f _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast - _ = ∑' i, re ⟪f i, f i⟫ := by simp [norm_sq_eq_re_inner (𝕜 := 𝕜)] + _ = ∑' i, re ⟪f i, f i⟫ := by simp _ = re (∑' i, ⟪f i, f i⟫) := (RCLike.reCLM.map_tsum ?_).symm · norm_num · exact summable_inner f f @@ -458,7 +462,7 @@ protected theorem hasSum_inner_mul_inner (b : HilbertBasis ι 𝕜 E) (x y : E) HasSum (fun i => ⟪x, b i⟫ * ⟪b i, y⟫) ⟪x, y⟫ := by convert (b.hasSum_repr y).mapL (innerSL 𝕜 x) using 1 ext i - rw [innerSL_apply, b.repr_apply_apply, inner_smul_right, mul_comm] + rw [innerSL_apply_apply, b.repr_apply_apply, inner_smul_right, mul_comm] protected theorem summable_inner_mul_inner (b : HilbertBasis ι 𝕜 E) (x y : E) : Summable fun i => ⟪x, b i⟫ * ⟪b i, y⟫ := diff --git a/Mathlib/Analysis/LConvolution.lean b/Mathlib/Analysis/LConvolution.lean index 9bb72320bb166a..0c56729852b780 100644 --- a/Mathlib/Analysis/LConvolution.lean +++ b/Mathlib/Analysis/LConvolution.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Ledvinka. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Ledvinka -/ -import Mathlib.MeasureTheory.Group.Prod -import Mathlib.MeasureTheory.Group.LIntegral +module + +public import Mathlib.MeasureTheory.Group.Prod +public import Mathlib.MeasureTheory.Group.LIntegral /-! # Convolution of functions using the Lebesgue integral @@ -31,6 +33,8 @@ the order of the densities would be flipped. is the additive convolution of `f` and `g` w.r.t. the measure `μ`. -/ +@[expose] public section + namespace MeasureTheory open Measure open scoped ENNReal diff --git a/Mathlib/Analysis/LocallyConvex/AbsConvex.lean b/Mathlib/Analysis/LocallyConvex/AbsConvex.lean index e09bf7536fa646..ccb918fe349555 100644 --- a/Mathlib/Analysis/LocallyConvex/AbsConvex.lean +++ b/Mathlib/Analysis/LocallyConvex/AbsConvex.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.LocallyConvex.BalancedCoreHull -import Mathlib.Analysis.Convex.TotallyBounded -import Mathlib.Analysis.LocallyConvex.Bounded +module + +public import Mathlib.Analysis.LocallyConvex.BalancedCoreHull +public import Mathlib.Analysis.Convex.TotallyBounded +public import Mathlib.Analysis.LocallyConvex.Bounded /-! # Absolutely convex sets @@ -35,6 +37,8 @@ topological vector space has a basis consisting of absolutely convex sets. disks, convex, balanced -/ +@[expose] public section + open NormedField Set open NNReal Pointwise Topology diff --git a/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean b/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean index 5d32f705620a8a..b27eab527c3a49 100644 --- a/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean +++ b/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.LocallyConvex.AbsConvex -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.Convex.Gauge +module + +public import Mathlib.Analysis.LocallyConvex.AbsConvex +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.Convex.Gauge /-! # Absolutely convex open sets @@ -28,6 +30,8 @@ convex open neighborhoods of zero. -/ +@[expose] public section + open NormedField Set open NNReal Pointwise Topology diff --git a/Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean b/Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean index 4993891584121f..98739e0484eb31 100644 --- a/Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean +++ b/Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.LocallyConvex.Basic +module + +public import Mathlib.Analysis.LocallyConvex.Basic /-! # Balanced Core and Balanced Hull @@ -36,6 +38,8 @@ this is `balancedCore_eq_iInter`. balanced -/ +@[expose] public section + open Set Pointwise Topology Filter diff --git a/Mathlib/Analysis/LocallyConvex/Barrelled.lean b/Mathlib/Analysis/LocallyConvex/Barrelled.lean index eebdf650eb91aa..a380434f46272b 100644 --- a/Mathlib/Analysis/LocallyConvex/Barrelled.lean +++ b/Mathlib/Analysis/LocallyConvex/Barrelled.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Topology.Semicontinuous -import Mathlib.Topology.Baire.Lemmas +module + +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Topology.Semicontinuous +public import Mathlib.Topology.Baire.Lemmas /-! # Barrelled spaces and the Banach-Steinhaus theorem / Uniform Boundedness Principle @@ -71,6 +73,8 @@ with the seminorm characterization! banach-steinhaus, uniform boundedness, equicontinuity -/ +@[expose] public section + open Filter Topology Set ContinuousLinearMap section defs diff --git a/Mathlib/Analysis/LocallyConvex/Basic.lean b/Mathlib/Analysis/LocallyConvex/Basic.lean index 3ab9c7a556629e..36242953f2d072 100644 --- a/Mathlib/Analysis/LocallyConvex/Basic.lean +++ b/Mathlib/Analysis/LocallyConvex/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jean Lo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jean Lo, Bhavik Mehta, Yaël Dillies -/ -import Mathlib.Analysis.Convex.Hull -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Topology.Bornology.Absorbs +module + +public import Mathlib.Analysis.Convex.Hull +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Topology.Bornology.Absorbs /-! # Local convexity @@ -41,6 +43,8 @@ For a module over a normed ring: absorbent, balanced, locally convex, LCTVS -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/LocallyConvex/Bounded.lean b/Mathlib/Analysis/LocallyConvex/Bounded.lean index 16f86ea7ca6fc5..9b129c272088f3 100644 --- a/Mathlib/Analysis/LocallyConvex/Bounded.lean +++ b/Mathlib/Analysis/LocallyConvex/Bounded.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.GroupTheory.GroupAction.Pointwise -import Mathlib.Analysis.LocallyConvex.Basic -import Mathlib.Analysis.LocallyConvex.BalancedCoreHull -import Mathlib.Analysis.Seminorm -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.Topology.Bornology.Basic -import Mathlib.Topology.Algebra.IsUniformGroup.Basic -import Mathlib.Topology.UniformSpace.Cauchy +module + +public import Mathlib.GroupTheory.GroupAction.Pointwise +public import Mathlib.Analysis.LocallyConvex.Basic +public import Mathlib.Analysis.LocallyConvex.BalancedCoreHull +public import Mathlib.Analysis.Seminorm +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.Topology.Bornology.Basic +public import Mathlib.Topology.Algebra.IsUniformGroup.Basic +public import Mathlib.Topology.UniformSpace.Cauchy /-! # Von Neumann Boundedness @@ -40,6 +42,8 @@ This file defines natural or von Neumann bounded sets and proves elementary prop -/ +@[expose] public section + variable {𝕜 𝕜' E F ι : Type*} @@ -263,7 +267,20 @@ theorem IsVonNBounded.extend_scalars [NontriviallyNormedField 𝕜] section NormedField variable [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] -variable [TopologicalSpace E] [ContinuousSMul 𝕜 E] +variable [TopologicalSpace E] + +/-- The closure of a bounded set is bounded. -/ +theorem IsVonNBounded.closure [T1Space E] [RegularSpace E] [ContinuousConstSMul 𝕜 E] + {a : Set E} (ha : IsVonNBounded 𝕜 a) : IsVonNBounded 𝕜 (closure a) := by + intro V hV + rcases exists_mem_nhds_isClosed_subset hV with ⟨W, hW₁, hW₂, hW₃⟩ + specialize ha hW₁ + filter_upwards [ha] with b ha' + grw [closure_mono ha', closure_smul₀ b] + apply smul_set_mono + grw [closure_subset_iff_isClosed.mpr hW₂, hW₃] + +variable [ContinuousSMul 𝕜 E] /-- Singletons are bounded. -/ theorem isVonNBounded_singleton (x : E) : IsVonNBounded 𝕜 ({x} : Set E) := fun _ hV => @@ -343,10 +360,13 @@ theorem isVonNBounded_sub : end IsTopologicalAddGroup /-- The union of all bounded set is the whole space. -/ -theorem isVonNBounded_covers : ⋃₀ setOf (IsVonNBounded 𝕜) = (Set.univ : Set E) := +theorem sUnion_isVonNBounded_eq_univ : ⋃₀ setOf (IsVonNBounded 𝕜) = (Set.univ : Set E) := Set.eq_univ_iff_forall.mpr fun x => Set.mem_sUnion.mpr ⟨{x}, isVonNBounded_singleton _, Set.mem_singleton _⟩ +@[deprecated (since := "2025-11-14")] +alias isVonNBounded_covers := sUnion_isVonNBounded_eq_univ + variable (𝕜 E) -- See note [reducible non-instances] diff --git a/Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean b/Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean index d33af4ed0bbbec..3ae8d68f13a6c7 100644 --- a/Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean +++ b/Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.LocallyConvex.Bounded -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.Analysis.LocallyConvex.Bounded +public import Mathlib.Analysis.RCLike.Basic /-! # Continuity and Von Neumann boundedness @@ -24,6 +26,8 @@ continuous linear maps will require importing `Analysis/LocallyConvex/Bounded` i -/ +@[expose] public section + open TopologicalSpace Bornology Filter Topology Pointwise diff --git a/Mathlib/Analysis/LocallyConvex/Montel.lean b/Mathlib/Analysis/LocallyConvex/Montel.lean new file mode 100644 index 00000000000000..8c4cc4eec32d75 --- /dev/null +++ b/Mathlib/Analysis/LocallyConvex/Montel.lean @@ -0,0 +1,126 @@ +/- +Copyright (c) 2025 Moritz Doll. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Moritz Doll +-/ +module + +public import Mathlib.Topology.Algebra.Module.StrongTopology +public import Mathlib.Analysis.Normed.Module.FiniteDimension +/-! +# Montel spaces + +A Montel space is a topological vector space `E` that has the Heine-Borel property: every closed and +(von Neumann) bounded set is compact. + +Note that we are not requiring that `E` is a barrelled space, so the usual definition of a Montel +space would be `[MontelSpace 𝕜 E] [BarrelledSpace 𝕜 E]`. + +* `MontelSpace.finiteDimensional_of_normedSpace`: every normed Montel space is finite dimensional. +* `ContinuousLinearEquiv.toCompactConvergenceCLM`: if `E` is a Montel space then topology of compact + convergence and the strong topology on `E →SL[σ] F` coincide. We record this as a continuous + linear equivalence between `E →SL[σ] F` and `E →SL_c[σ] F`. This is Proposition 34.5 in + [F. Trèves][treves1967]. + +## References +* [F. Trèves, *Topological vector spaces, distributions and kernels*][treves1967] + +-/ + +@[expose] public section + +open Filter Topology Set ContinuousLinearMap Bornology + +section Definition + +variable {𝕜 E F : Type*} +variable [SeminormedRing 𝕜] [Zero E] [SMul 𝕜 E] + [TopologicalSpace E] + +/-- A Montel space is a topological vector space that has the Heine-Borel property: every closed and +(von Neumann) bounded set is compact. + +Note that we are not requiring that `E` is a barrelled space, so the usual definition of a Montel +space would be `[MontelSpace 𝕜 E] [BarrelledSpace 𝕜 E]`. -/ +class MontelSpace (𝕜 E : Type*) [SeminormedRing 𝕜] [Zero E] [SMul 𝕜 E] + [TopologicalSpace E] : Prop where + heine_borel : ∀ s : Set E, IsClosed s → IsVonNBounded 𝕜 s → IsCompact s + +namespace MontelSpace + +variable (𝕜) in +theorem isCompact_of_isClosed_of_isVonNBounded [hm : MontelSpace 𝕜 E] {s : Set E} + (h_closed : IsClosed s) (h_bounded : IsVonNBounded 𝕜 s) : IsCompact s := + hm.heine_borel s h_closed h_bounded + +end MontelSpace + +end Definition + +section Normed + +namespace MontelSpace + +variable {𝕜 E F : Type*} +variable [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace 𝕜] + [hM : MontelSpace 𝕜 E] + +theorem finiteDimensional_of_normedSpace : FiniteDimensional 𝕜 E := + FiniteDimensional.of_isCompact_closedBall₀ 𝕜 zero_lt_one + (isCompact_of_isClosed_of_isVonNBounded 𝕜 Metric.isClosed_closedBall + (NormedSpace.isVonNBounded_closedBall _ _ _) ) + +end MontelSpace + +end Normed + +variable {𝕜₁ 𝕜₂ : Type*} [NormedField 𝕜₁] [NormedField 𝕜₂] {σ : 𝕜₁ →+* 𝕜₂} +variable {E F : Type*} + [AddCommGroup E] [Module 𝕜₁ E] + [UniformSpace E] [IsUniformAddGroup E] [ContinuousSMul 𝕜₁ E] + [AddCommGroup F] [Module 𝕜₂ F] + [TopologicalSpace F] [IsTopologicalAddGroup F] [ContinuousSMul 𝕜₂ F] + +open CompactConvergenceCLM + +variable (σ E F) in +/-- The linear equivalence that sends a continuous linear map to the type copy endowed with the +topology of compact convergence. + +This definition is only used to prove the continuous linear equivalence. -/ +private def _root_.LinearEquiv.toCompactConvergenceCLM : + (E →SL[σ] F) ≃ₗ[𝕜₂] E →SL_c[σ] F := + LinearEquiv.refl 𝕜₂ _ + +variable (σ E F) in +/-- If `E` is a Montel space, then the strong topology on `E →L[𝕜] F` coincides with the topology +of compact convergence. + +We realize this equality in terms of a continuous linear equivalence between the type synonyms. -/ +def _root_.ContinuousLinearEquiv.toCompactConvergenceCLM [T1Space E] [MontelSpace 𝕜₁ E] : + (E →SL[σ] F) ≃L[𝕜₂] E →SL_c[σ] F where + __ := LinearEquiv.toCompactConvergenceCLM σ E F + continuous_toFun := by + simp only [AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, LinearEquiv.coe_coe, continuous_def] + intro s hs + apply hs.mono + apply UniformConvergenceCLM.topologicalSpace_mono + intro x hx + exact hx.totallyBounded.isVonNBounded 𝕜₁ + continuous_invFun := by + apply continuous_of_continuousAt_zero (LinearEquiv.toCompactConvergenceCLM σ E F).symm + rw [ContinuousAt, _root_.map_zero, CompactConvergenceCLM.hasBasis_nhds_zero.tendsto_iff + ContinuousLinearMap.hasBasis_nhds_zero] + rintro ⟨a, b⟩ ⟨ha, hb⟩ + use ⟨closure a, b⟩ + exact ⟨⟨MontelSpace.isCompact_of_isClosed_of_isVonNBounded 𝕜₁ isClosed_closure + ha.closure, hb⟩, fun _ hf _ hx ↦ hf _ (subset_closure hx)⟩ + +@[simp] +theorem _root_.ContinuousLinearEquiv.toCompactConvergenceCLM_apply [T1Space E] [MontelSpace 𝕜₁ E] + (f : E →SL[σ] F) (x : E) : ContinuousLinearEquiv.toCompactConvergenceCLM σ E F f x = f x := rfl + +@[simp] +theorem _root_.ContinuousLinearEquiv.toCompactConvergenceCLM_symm_apply [T1Space E] + [MontelSpace 𝕜₁ E] (f : E →SL_c[σ] F) (x : E) : + (ContinuousLinearEquiv.toCompactConvergenceCLM σ E F).symm f x = f x := rfl diff --git a/Mathlib/Analysis/LocallyConvex/PointwiseConvergence.lean b/Mathlib/Analysis/LocallyConvex/PointwiseConvergence.lean new file mode 100644 index 00000000000000..4d37d9f43b6e88 --- /dev/null +++ b/Mathlib/Analysis/LocallyConvex/PointwiseConvergence.lean @@ -0,0 +1,84 @@ +/- +Copyright (c) 2025 Moritz Doll. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Moritz Doll +-/ +module + +public import Mathlib.Topology.Algebra.Module.PointwiseConvergence +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.LocallyConvex.StrongTopology + +/-! +# The topology of pointwise convergence is locally convex + +We prove that the topology of pointwise convergence is induced by a family of seminorms and +that it is locally convex in the topological sense + +* `PointwiseConvergenceCLM.seminorm`: the seminorms on `E →SLₚₜ[σ] F` given by `A ↦ ‖A x‖` for fixed +`x : E`. +* `PointwiseConvergenceCLM.withSeminorm`: the topology is induced by the seminorms. +* `PointwiseConvergenceCLM.instLocallyConvexSpace`: `E →SLₚₜ[σ] F` is locally convex. + +-/ + +@[expose] public section + +variable {R 𝕜₁ 𝕜₂ : Type*} [NormedField 𝕜₁] [NormedField 𝕜₂] + {σ : 𝕜₁ →+* 𝕜₂} {E F : Type*} + [AddCommGroup E] [TopologicalSpace E] [Module 𝕜₁ E] + +namespace PointwiseConvergenceCLM + +section NormedSpace + +variable [NormedAddCommGroup F] [NormedSpace 𝕜₂ F] + +/-- The family of seminorms that induce the topology of pointwise convergence, namely `‖A x‖` for +all `x : E`. -/ +protected def seminorm (x : E) : Seminorm 𝕜₂ (E →SLₚₜ[σ] F) where + toFun A := ‖A x‖ + map_zero' := by simp + add_le' A B := by simpa only using norm_add_le _ _ + neg' A := by simp + smul' r A := by simp [norm_smul] + +variable (σ E F) in +/-- The family of seminorms that induce the topology of pointwise convergence, namely `‖A x‖` for +all `x : E`. -/ +protected abbrev seminormFamily : SeminormFamily 𝕜₂ (E →SLₚₜ[σ] F) E := + PointwiseConvergenceCLM.seminorm + +variable (σ E F) in +/-- The coercion `E →SLₚₜ[σ] F` to `E → F` as a linear map. + +The topology on `E →SLₚₜ[σ] F` is induced by this map. -/ +def inducingFn : (E →SLₚₜ[σ] F) →ₗ[𝕜₂] (E → F) where + toFun f := f + map_add' _ _ := rfl + map_smul' _ _ := rfl + +variable (σ E F) in +theorem isInducing_inducingFn : Topology.IsInducing (inducingFn σ E F) := + (PointwiseConvergenceCLM.isEmbedding_coeFn σ E F).isInducing + +lemma withSeminorms : WithSeminorms (PointwiseConvergenceCLM.seminormFamily σ E F) := + let e : E ≃ (Σ _ : E, Fin 1) := .symm <| .sigmaUnique _ _ + (isInducing_inducingFn σ E F).withSeminorms <| withSeminorms_pi (fun _ ↦ norm_withSeminorms 𝕜₂ F) + |>.congr_equiv e + +end NormedSpace + +section IsTopologicalAddGroup + +variable [AddCommGroup F] [TopologicalSpace F] [IsTopologicalAddGroup F] [Module 𝕜₂ F] + [Semiring R] [PartialOrder R] + [Module R F] [ContinuousConstSMul R F] [LocallyConvexSpace R F] [SMulCommClass 𝕜₂ R F] + +instance : LocallyConvexSpace R (E →SLₚₜ[σ] F) := + UniformConvergenceCLM.locallyConvexSpace R {(s : Set E) | Set.Finite s} ⟨∅, Set.finite_empty⟩ + (directedOn_of_sup_mem fun _ _ => Set.Finite.union) + +end IsTopologicalAddGroup + +end PointwiseConvergenceCLM diff --git a/Mathlib/Analysis/LocallyConvex/Polar.lean b/Mathlib/Analysis/LocallyConvex/Polar.lean index 4db8e4f614fa4e..b61178221ef35e 100644 --- a/Mathlib/Analysis/LocallyConvex/Polar.lean +++ b/Mathlib/Analysis/LocallyConvex/Polar.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Kalle Kytölä -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.SesquilinearForm.Basic -import Mathlib.Topology.Algebra.Module.WeakBilin +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic +public import Mathlib.Topology.Algebra.Module.WeakBilin /-! # Polar set @@ -34,6 +36,8 @@ any bilinear form `B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜`, where `𝕜` is a no polar -/ +@[expose] public section + variable {𝕜 E F : Type*} open Topology diff --git a/Mathlib/Analysis/LocallyConvex/SeparatingDual.lean b/Mathlib/Analysis/LocallyConvex/SeparatingDual.lean index 653aac18905aa4..1153908f9abe68 100644 --- a/Mathlib/Analysis/LocallyConvex/SeparatingDual.lean +++ b/Mathlib/Analysis/LocallyConvex/SeparatingDual.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.Central.Defs -import Mathlib.Analysis.LocallyConvex.Separation -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.LinearAlgebra.Dual.Lemmas +module + +public import Mathlib.Algebra.Central.Defs +public import Mathlib.Analysis.LocallyConvex.Separation +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.LinearAlgebra.Dual.Lemmas /-! # Spaces with separating dual @@ -31,6 +33,8 @@ Under the assumption `SeparatingDual R V`, we show in `SeparatingDual.exists_continuousLinearEquiv_apply_eq` that the group of continuous linear equivalences acts transitively on the set of nonzero vectors. -/ + +@[expose] public section /-- When `E` is a topological module over a topological ring `R`, the class `SeparatingDual R E` registers that continuous linear forms on `E` separate points of `E`. -/ @[mk_iff separatingDual_def] diff --git a/Mathlib/Analysis/LocallyConvex/Separation.lean b/Mathlib/Analysis/LocallyConvex/Separation.lean index 90152a94a55729..7a1aa356d2f444 100644 --- a/Mathlib/Analysis/LocallyConvex/Separation.lean +++ b/Mathlib/Analysis/LocallyConvex/Separation.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Yaël Dillies -/ -import Mathlib.Analysis.Convex.Cone.Extension -import Mathlib.Analysis.Convex.Gauge -import Mathlib.Analysis.RCLike.Extend -import Mathlib.Topology.Algebra.Module.FiniteDimension -import Mathlib.Topology.Algebra.Module.LocallyConvex +module + +public import Mathlib.Analysis.Convex.Cone.Extension +public import Mathlib.Analysis.Convex.Gauge +public import Mathlib.Analysis.RCLike.Extend +public import Mathlib.Topology.Algebra.Module.FiniteDimension +public import Mathlib.Topology.Algebra.Module.LocallyConvex /-! # Separation Hahn-Banach theorem @@ -33,6 +35,8 @@ We provide many variations to stricten the result under more assumptions on the * `Convex ℝ s → interior (closure s) ⊆ s` -/ +@[expose] public section + assert_not_exists ContinuousLinearMap.hasOpNorm open Set diff --git a/Mathlib/Analysis/LocallyConvex/StrongTopology.lean b/Mathlib/Analysis/LocallyConvex/StrongTopology.lean index fe682099c93160..a0c98da987e8bb 100644 --- a/Mathlib/Analysis/LocallyConvex/StrongTopology.lean +++ b/Mathlib/Analysis/LocallyConvex/StrongTopology.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Topology.Algebra.Module.StrongTopology -import Mathlib.Topology.Algebra.Module.LocallyConvex +module + +public import Mathlib.Topology.Algebra.Module.StrongTopology +public import Mathlib.Topology.Algebra.Module.LocallyConvex /-! # Local convexity of the strong topology @@ -25,6 +27,8 @@ locally convex. locally convex, bounded convergence -/ +@[expose] public section + open Topology UniformConvergence diff --git a/Mathlib/Analysis/LocallyConvex/WeakDual.lean b/Mathlib/Analysis/LocallyConvex/WeakDual.lean index c668dc4e0a3455..646f85cdb6c389 100644 --- a/Mathlib/Analysis/LocallyConvex/WeakDual.lean +++ b/Mathlib/Analysis/LocallyConvex/WeakDual.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.Finsupp.Span -import Mathlib.Topology.Algebra.Module.WeakBilin +module + +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.Finsupp.Span +public import Mathlib.Topology.Algebra.Module.WeakBilin /-! # Weak Dual in Topological Vector Spaces @@ -40,6 +42,8 @@ convex and we explicitly give a neighborhood basis in terms of the family of sem weak dual, seminorm -/ +@[expose] public section + variable {𝕜 E F : Type*} diff --git a/Mathlib/Analysis/LocallyConvex/WeakOperatorTopology.lean b/Mathlib/Analysis/LocallyConvex/WeakOperatorTopology.lean index d13297b4716278..a053cd526b01cd 100644 --- a/Mathlib/Analysis/LocallyConvex/WeakOperatorTopology.lean +++ b/Mathlib/Analysis/LocallyConvex/WeakOperatorTopology.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.LocallyConvex.SeparatingDual -import Mathlib.Topology.Algebra.Module.StrongTopology +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.LocallyConvex.SeparatingDual +public import Mathlib.Topology.Algebra.Module.StrongTopology /-! # The weak operator topology @@ -48,6 +49,8 @@ In most of the literature, the WOT is defined on maps between Banach spaces. Her that the domain and codomains are topological vector spaces over a normed field. -/ +@[expose] public section + open Topology /-- The type copy of `E →L[𝕜] F` endowed with the weak operator topology, denoted as diff --git a/Mathlib/Analysis/LocallyConvex/WeakSpace.lean b/Mathlib/Analysis/LocallyConvex/WeakSpace.lean index b61d71965f7698..dfdffc80d264a3 100644 --- a/Mathlib/Analysis/LocallyConvex/WeakSpace.lean +++ b/Mathlib/Analysis/LocallyConvex/WeakSpace.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.LocallyConvex.Separation -import Mathlib.LinearAlgebra.Dual.Defs -import Mathlib.Topology.Algebra.Module.WeakDual +module + +public import Mathlib.Analysis.LocallyConvex.Separation +public import Mathlib.LinearAlgebra.Dual.Defs +public import Mathlib.Topology.Algebra.Module.WeakDual /-! # Closures of convex sets in locally convex spaces @@ -17,6 +19,8 @@ Of course, we phrase this in terms of linear maps between locally convex spaces, creating two separate topologies on the same space. -/ +@[expose] public section + variable {𝕜 E F : Type*} variable [RCLike 𝕜] [AddCommGroup E] [Module 𝕜 E] [AddCommGroup F] [Module 𝕜 F] variable [Module ℝ E] [IsScalarTower ℝ 𝕜 E] [Module ℝ F] [IsScalarTower ℝ 𝕜 F] diff --git a/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean b/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean index 24abfe1b3f4f1c..4e54a2caa53aee 100644 --- a/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean +++ b/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Anatole Dedecker -/ -import Mathlib.Analysis.LocallyConvex.Bounded -import Mathlib.Analysis.Seminorm -import Mathlib.Data.Real.Sqrt -import Mathlib.Topology.Algebra.Equicontinuity -import Mathlib.Topology.MetricSpace.Equicontinuity -import Mathlib.Topology.Algebra.FilterBasis -import Mathlib.Topology.Algebra.Module.LocallyConvex +module + +public import Mathlib.Analysis.LocallyConvex.Bounded +public import Mathlib.Analysis.Seminorm +public import Mathlib.Data.Real.Sqrt +public import Mathlib.Topology.Algebra.Equicontinuity +public import Mathlib.Topology.MetricSpace.Equicontinuity +public import Mathlib.Topology.Algebra.FilterBasis +public import Mathlib.Topology.Algebra.Module.LocallyConvex /-! # Topology induced by a family of seminorms @@ -48,6 +50,8 @@ Neumann boundedness in terms of that seminorm family. Together with seminorm, locally convex -/ +@[expose] public section + open NormedField Set Seminorm TopologicalSpace Filter List Bornology @@ -771,11 +775,13 @@ variable [NontriviallyNormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {p : SeminormFamily 𝕜 E ι} /-- In a semi-`NormedSpace`, a continuous seminorm is zero on elements of norm `0`. -/ -lemma map_eq_zero_of_norm_zero (q : Seminorm 𝕜 F) +lemma map_eq_zero_of_norm_eq_zero (q : Seminorm 𝕜 F) (hq : Continuous q) {x : F} (hx : ‖x‖ = 0) : q x = 0 := (map_zero q) ▸ ((specializes_iff_mem_closure.mpr <| mem_closure_zero_iff_norm.mpr hx).map hq).eq.symm +@[deprecated (since := "2025-11-15")] alias map_eq_zero_of_norm_zero := map_eq_zero_of_norm_eq_zero + /-- Let `F` be a semi-`NormedSpace` over a `NontriviallyNormedField`, and let `q` be a seminorm on `F`. If `q` is continuous, then it is uniformly controlled by the norm, that is there is some `C > 0` such that `∀ x, q x ≤ C * ‖x‖`. @@ -792,7 +798,7 @@ lemma bound_of_continuous_normedSpace (q : Seminorm 𝕜 F) refine ⟨‖c‖ / ε, this, fun x ↦ ?_⟩ by_cases hx : ‖x‖ = 0 · rw [hx, mul_zero] - exact le_of_eq (map_eq_zero_of_norm_zero q hq hx) + exact le_of_eq (map_eq_zero_of_norm_eq_zero q hq hx) · refine (normSeminorm 𝕜 F).bound_of_shell q ε_pos hc (fun x hle hlt ↦ ?_) hx refine (le_of_lt <| show q x < _ from hε hlt).trans ?_ rwa [← div_le_iff₀' this, one_div_div] diff --git a/Mathlib/Analysis/Matrix.lean b/Mathlib/Analysis/Matrix.lean index 942f8036874b4e..32b6b4e8fcd27c 100644 --- a/Mathlib/Analysis/Matrix.lean +++ b/Mathlib/Analysis/Matrix.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Matrix.Normed +module + +public import Mathlib.Analysis.Matrix.Normed deprecated_module (since := "2025-11-03") diff --git a/Mathlib/Analysis/Matrix/Hermitian.lean b/Mathlib/Analysis/Matrix/Hermitian.lean new file mode 100644 index 00000000000000..830cec67f3d73b --- /dev/null +++ b/Mathlib/Analysis/Matrix/Hermitian.lean @@ -0,0 +1,59 @@ +/- +Copyright (c) 2022 Alexander Bentkamp. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Alexander Bentkamp +-/ +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.LinearAlgebra.Matrix.Hermitian + +/-! +# Hermitian matrices over ℝ and ℂ + +This file proves that Hermitian matrices over ℝ and ℂ are exactly the ones whose corresponding +linear map is self-adjoint. + +## Tags + +self-adjoint matrix, hermitian matrix +-/ + +@[expose] public section + +-- TODO: +-- assert_not_exists MonoidAlgebra + +open RCLike + +namespace Matrix + +variable {𝕜 m n : Type*} {A : Matrix n n 𝕜} [RCLike 𝕜] + +/-- The diagonal elements of a complex Hermitian matrix are real. -/ +lemma IsHermitian.coe_re_apply_self (h : A.IsHermitian) (i : n) : (re (A i i) : 𝕜) = A i i := by + rw [← conj_eq_iff_re, ← star_def, ← conjTranspose_apply, h.eq] + +/-- The diagonal elements of a complex Hermitian matrix are real. -/ +lemma IsHermitian.coe_re_diag (h : A.IsHermitian) : (fun i => (re (A.diag i) : 𝕜)) = A.diag := + funext h.coe_re_apply_self + +/-- A matrix is Hermitian iff the corresponding linear map is self adjoint. -/ +lemma isHermitian_iff_isSymmetric [Fintype n] [DecidableEq n] : + IsHermitian A ↔ A.toEuclideanLin.IsSymmetric := by + rw [LinearMap.IsSymmetric, (WithLp.toLp_surjective _).forall₂] + simp only [toEuclideanLin_toLp, Matrix.toLin'_apply, EuclideanSpace.inner_eq_star_dotProduct, + star_mulVec] + constructor + · rintro (h : Aᴴ = A) x y + rw [dotProduct_comm, ← dotProduct_mulVec, h, dotProduct_comm] + · intro h + ext i j + simpa [(Pi.single_star i 1).symm] using h (Pi.single i 1) (Pi.single j 1) + +lemma IsHermitian.im_star_dotProduct_mulVec_self [Fintype n] (hA : A.IsHermitian) (x : n → 𝕜) : + RCLike.im (star x ⬝ᵥ A *ᵥ x) = 0 := by + classical + simpa [dotProduct_comm] using (isHermitian_iff_isSymmetric.mp hA).im_inner_self_apply _ + +end Matrix diff --git a/Mathlib/Analysis/Matrix/HermitianFunctionalCalculus.lean b/Mathlib/Analysis/Matrix/HermitianFunctionalCalculus.lean new file mode 100644 index 00000000000000..504460349f9f21 --- /dev/null +++ b/Mathlib/Analysis/Matrix/HermitianFunctionalCalculus.lean @@ -0,0 +1,149 @@ +/- +Copyright (c) 2024 Jon Bannon. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Jon Bannon, Jireh Loreaux +-/ +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Analysis.Matrix.Spectrum +public import Mathlib.Topology.ContinuousMap.Units + +/-! +# Continuous Functional Calculus for Hermitian Matrices + +This file defines an instance of the continuous functional calculus for Hermitian matrices over an +`RCLike` field `𝕜`. + +## Main Results + +- `Matrix.IsHermitian.cfc` : Realization of the functional calculus for a Hermitian matrix + as the triple product `U * diagonal (RCLike.ofReal ∘ f ∘ hA.eigenvalues) * star U` with + `U = eigenvectorUnitary hA`. + +- `cfc_eq` : Proof that the above agrees with the continuous functional calculus. + +- `Matrix.IsHermitian.instContinuousFunctionalCalculus` : Instance of the continuous functional + calculus for a Hermitian matrix `A` over `𝕜`. + +## Tags + +spectral theorem, diagonalization theorem, continuous functional calculus +-/ + +@[expose] public section + +open Topology Unitary + +namespace Matrix + +variable {n 𝕜 : Type*} [RCLike 𝕜] [Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} + +namespace IsHermitian + +variable (hA : IsHermitian A) + +/-- The star algebra homomorphism underlying the instance of the continuous functional +calculus of a Hermitian matrix. This is an auxiliary definition and is not intended +for use outside of this file. -/ +@[simps] +noncomputable def cfcAux : C(spectrum ℝ A, ℝ) →⋆ₐ[ℝ] (Matrix n n 𝕜) where + toFun := fun g => conjStarAlgAut ℝ _ hA.eigenvectorUnitary <| + diagonal (RCLike.ofReal ∘ g ∘ (fun i ↦ ⟨hA.eigenvalues i, hA.eigenvalues_mem_spectrum_real i⟩)) + map_zero' := by simp [Pi.zero_def, Function.comp_def] + map_one' := by simp [Pi.one_def, Function.comp_def] + map_mul' f g := by + simp only [ContinuousMap.coe_mul, ← map_mul, diagonal_mul_diagonal, Function.comp_apply] + rfl + map_add' f g := by + simp only [ContinuousMap.coe_add, ← map_add, diagonal_add, Function.comp_apply] + rfl + commutes' r := by + simp only [Function.comp_def, algebraMap_apply, smul_eq_mul, mul_one] + rw [← mul_one (algebraMap _ _ _), ← coe_mul_star_self hA.eigenvectorUnitary, + ← Algebra.left_comm, coe_star, ← mul_assoc, conjStarAlgAut_apply] + rfl + map_star' f := by + simp only [star_trivial, ← map_star, star_eq_conjTranspose, diagonal_conjTranspose, Pi.star_def, + Function.comp_apply, RCLike.star_def, RCLike.conj_ofReal] + rfl + +lemma isClosedEmbedding_cfcAux : IsClosedEmbedding hA.cfcAux := by + have h0 : FiniteDimensional ℝ C(spectrum ℝ A, ℝ) := + FiniteDimensional.of_injective (ContinuousMap.coeFnLinearMap ℝ (M := ℝ)) DFunLike.coe_injective + refine LinearMap.isClosedEmbedding_of_injective (𝕜 := ℝ) (E := C(spectrum ℝ A, ℝ)) + (F := Matrix n n 𝕜) (f := hA.cfcAux) <| LinearMap.ker_eq_bot'.mpr fun f hf ↦ ?_ + have h2 : + diagonal (RCLike.ofReal ∘ f ∘ fun i ↦ ⟨hA.eigenvalues i, hA.eigenvalues_mem_spectrum_real i⟩) + = (0 : Matrix n n 𝕜) := by + simp only [LinearMap.coe_coe, cfcAux_apply, conjStarAlgAut_apply] at hf + replace hf := congr($hf * (hA.eigenvectorUnitary : Matrix n n 𝕜)) + simp only [mul_assoc, SetLike.coe_mem, Unitary.star_mul_self_of_mem, mul_one, zero_mul] at hf + simpa [← mul_assoc] using congr((star hA.eigenvectorUnitary : Matrix n n 𝕜) * $hf) + ext x + simp only [ContinuousMap.zero_apply] + obtain ⟨x, hx⟩ := x + obtain ⟨i, rfl⟩ := hA.spectrum_real_eq_range_eigenvalues ▸ hx + rw [← diagonal_zero] at h2 + have := (diagonal_eq_diagonal_iff).mp h2 + exact RCLike.ofReal_eq_zero.mp (this i) + +lemma cfcAux_id : hA.cfcAux (.restrict (spectrum ℝ A) (.id ℝ)) = A := by + conv_rhs => rw [hA.spectral_theorem] + rfl + +/-- Instance of the continuous functional calculus for a Hermitian matrix over `𝕜` with +`RCLike 𝕜`. -/ +instance instContinuousFunctionalCalculus : + ContinuousFunctionalCalculus ℝ (Matrix n n 𝕜) IsSelfAdjoint where + exists_cfc_of_predicate a ha := by + replace ha : IsHermitian a := ha + refine ⟨ha.cfcAux, ha.isClosedEmbedding_cfcAux, ha.cfcAux_id, fun f ↦ ?map_spec, + fun f ↦ ?hermitian⟩ + case map_spec => + apply Set.eq_of_subset_of_subset + · rw [← ContinuousMap.spectrum_eq_range f] + apply AlgHom.spectrum_apply_subset + · rw [cfcAux_apply, conjStarAlgAut_apply, Unitary.spectrum_star_right_conjugate] + rintro - ⟨x, rfl⟩ + apply spectrum.of_algebraMap_mem 𝕜 + simp only [Function.comp_apply, Set.mem_range, spectrum_diagonal] + obtain ⟨x, hx⟩ := x + obtain ⟨i, rfl⟩ := ha.spectrum_real_eq_range_eigenvalues ▸ hx + exact ⟨i, rfl⟩ + case hermitian => + simp only [isSelfAdjoint_iff, cfcAux_apply, ← map_star] + rw [star_eq_conjTranspose, diagonal_conjTranspose] + congr! + simp [Pi.star_def, Function.comp_def] + spectrum_nonempty a ha := by + obtain (h | h) := isEmpty_or_nonempty n + · obtain ⟨x, y, hxy⟩ := exists_pair_ne (Matrix n n 𝕜) + exact False.elim <| Matrix.of.symm.injective.ne hxy <| Subsingleton.elim _ _ + · exact spectrum_real_eq_range_eigenvalues ha ▸ Set.range_nonempty _ + predicate_zero := .zero _ + +/-- The continuous functional calculus of a Hermitian matrix as a triple product using the +spectral theorem. Note that this actually operates on bare functions since every function is +continuous on the spectrum of a matrix, since the spectrum is finite. This is shown to be equal to +the generic continuous functional calculus API in `Matrix.IsHermitian.cfc_eq`. In general, users +should prefer the generic API, especially because it will make rewriting easier. -/ +protected noncomputable def cfc (f : ℝ → ℝ) : Matrix n n 𝕜 := + conjStarAlgAut ℝ _ hA.eigenvectorUnitary (diagonal (RCLike.ofReal ∘ f ∘ hA.eigenvalues)) + +lemma cfc_eq (f : ℝ → ℝ) : cfc f A = hA.cfc f := by + have hA' : IsSelfAdjoint A := hA + have := cfcHom_eq_of_continuous_of_map_id hA' hA.cfcAux hA.isClosedEmbedding_cfcAux.continuous + hA.cfcAux_id + rw [cfc_apply f A hA' (by rw [continuousOn_iff_continuous_restrict]; fun_prop), this] + simp only [cfcAux_apply, ContinuousMap.coe_mk, Function.comp_def, Set.restrict_apply, + IsHermitian.cfc] + +open Polynomial in +lemma charpoly_cfc_eq (f : ℝ → ℝ) : + (cfc f A).charpoly = ∏ i, (X - C (f (hA.eigenvalues i) : 𝕜)) := by + rw [cfc_eq hA f, IsHermitian.cfc, conjStarAlgAut_apply, charpoly_mul_comm, ← mul_assoc] + simp [charpoly_diagonal] + +end IsHermitian +end Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/LDL.lean b/Mathlib/Analysis/Matrix/LDL.lean similarity index 77% rename from Mathlib/LinearAlgebra/Matrix/LDL.lean rename to Mathlib/Analysis/Matrix/LDL.lean index 20451e092e560f..f9e34f9e8eec95 100644 --- a/Mathlib/LinearAlgebra/Matrix/LDL.lean +++ b/Mathlib/Analysis/Matrix/LDL.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho -import Mathlib.LinearAlgebra.Matrix.PosDef +module + +public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho +public import Mathlib.Analysis.Matrix.PosDef /-! # LDL decomposition @@ -27,6 +29,8 @@ decomposed as `S = LDLᴴ` where `L` is a lower-triangular matrix and `D` is a d -/ +@[expose] public section + open Module variable {𝕜 : Type*} [RCLike 𝕜] @@ -47,16 +51,16 @@ variable {S : Matrix n n 𝕜} [Fintype n] (hS : S.PosDef) applying Gram-Schmidt-Orthogonalization w.r.t. the inner product induced by `Sᵀ` on the standard basis vectors `Pi.basisFun`. -/ noncomputable def LDL.lowerInv : Matrix n n 𝕜 := - @gramSchmidt 𝕜 (n → 𝕜) _ (_ :) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ - (Pi.basisFun 𝕜 n) + @gramSchmidt 𝕜 (n → 𝕜) _ (Sᵀ.toNormedAddCommGroup hS.transpose) + (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) n _ _ _ (Pi.basisFun 𝕜 n) theorem LDL.lowerInv_eq_gramSchmidtBasis : LDL.lowerInv hS = ((Pi.basisFun 𝕜 n).toMatrix - (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ :) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ - (Pi.basisFun 𝕜 n)))ᵀ := by - letI := NormedAddCommGroup.ofMatrix hS.transpose - letI := InnerProductSpace.ofMatrix hS.transpose + (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (Sᵀ.toNormedAddCommGroup hS.transpose) + (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) n _ _ _ (Pi.basisFun 𝕜 n)))ᵀ := by + letI := (Sᵀ.toNormedAddCommGroup hS.transpose) + letI := (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) ext i j rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis] rfl @@ -65,13 +69,14 @@ noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) := rw [LDL.lowerInv_eq_gramSchmidtBasis] haveI := Basis.invertibleToMatrix (Pi.basisFun 𝕜 n) - (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ :) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ - (Pi.basisFun 𝕜 n)) + (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (Sᵀ.toNormedAddCommGroup hS.transpose) + (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) n _ _ _ (Pi.basisFun 𝕜 n)) infer_instance theorem LDL.lowerInv_orthogonal {i j : n} (h₀ : i ≠ j) : ⟪LDL.lowerInv hS i, Sᵀ *ᵥ LDL.lowerInv hS j⟫ₑ = 0 := - @gramSchmidt_orthogonal 𝕜 _ _ (_ :) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ h₀ + @gramSchmidt_orthogonal 𝕜 _ _ (Sᵀ.toNormedAddCommGroup hS.transpose) + (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) _ _ _ _ _ _ _ h₀ /-- The entries of the diagonal matrix `D` of the LDL decomposition. -/ noncomputable def LDL.diagEntries : n → 𝕜 := fun i => @@ -82,9 +87,8 @@ noncomputable def LDL.diag : Matrix n n 𝕜 := Matrix.diagonal (LDL.diagEntries hS) theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j = 0 := by - rw [← - @gramSchmidt_triangular 𝕜 (n → 𝕜) _ (_ :) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ - i j hij (Pi.basisFun 𝕜 n), + rw [← @gramSchmidt_triangular 𝕜 (n → 𝕜) _ (Sᵀ.toNormedAddCommGroup hS.transpose) + (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) n _ _ _ i j hij (Pi.basisFun 𝕜 n), Pi.basisFun_repr, LDL.lowerInv] /-- Inverse statement of **LDL decomposition**: we can conjugate a positive definite matrix diff --git a/Mathlib/Analysis/Matrix/Normed.lean b/Mathlib/Analysis/Matrix/Normed.lean index da9ce3a49b4dd1..598cdff15ef282 100644 --- a/Mathlib/Analysis/Matrix/Normed.lean +++ b/Mathlib/Analysis/Matrix/Normed.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth, Eric Wieser -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # Matrices as a normed space @@ -50,6 +52,8 @@ The norm induced by the identification of `Matrix m n 𝕜` with It is separated to avoid extraneous imports in this file. -/ +@[expose] public section + noncomputable section open WithLp diff --git a/Mathlib/Analysis/Matrix/Order.lean b/Mathlib/Analysis/Matrix/Order.lean index 06175939e309ed..5402bf93e2eb67 100644 --- a/Mathlib/Analysis/Matrix/Order.lean +++ b/Mathlib/Analysis/Matrix/Order.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances -import Mathlib.Analysis.Matrix.PosDef -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -import Mathlib.LinearAlgebra.Matrix.HermitianFunctionalCalculus +module + +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +public import Mathlib.Analysis.Matrix.HermitianFunctionalCalculus +public import Mathlib.Analysis.Matrix.PosDef +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic /-! # The partial order on matrices @@ -19,8 +21,8 @@ This allows us to use more general results from C⋆-algebras, like `CFC.sqrt`. * `Matrix.instPartialOrder`: the partial order on matrices given by `x ≤ y := (y - x).PosSemidef`. * `Matrix.PosSemidef.dotProduct_mulVec_zero_iff`: for a positive semi-definite matrix `A`, we have `x⋆ A x = 0` iff `A x = 0`. -* `Matrix.PosDef.matrixInnerProductSpace`: the inner product on matrices induced by a -positive definite matrix `M`: `⟪x, y⟫ = (y * M * xᴴ).trace`. +* `Matrix.toMatrixInnerProductSpace`: the inner product on matrices induced by a +positive semi-definite matrix `M`: `⟪x, y⟫ = (y * M * xᴴ).trace`. ## Implementation notes @@ -28,6 +30,8 @@ Note that the partial order instance is scoped to `MatrixOrder`. Please `open scoped MatrixOrder` to use this. -/ +@[expose] public section + variable {𝕜 n : Type*} [RCLike 𝕜] [Fintype n] open scoped ComplexOrder @@ -263,34 +267,52 @@ lemma posDef_iff_eq_conjTranspose_mul_self [DecidableEq n] {A : Matrix n n 𝕜} @[deprecated (since := "2025-08-07")] alias PosDef.posDef_iff_eq_conjTranspose_mul_self := CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self +/-- The pre-inner product space structure implementation. Only an auxiliary for +`Matrix.toMatrixSeminormedAddCommGroup`, `Matrix.toMatrixNormedAddCommGroup`, +and `Matrix.toMatrixInnerProductSpace`. -/ +private abbrev PosSemidef.matrixPreInnerProductSpace {M : Matrix n n 𝕜} (hM : M.PosSemidef) : + PreInnerProductSpace.Core 𝕜 (Matrix n n 𝕜) where + inner x y := (y * M * xᴴ).trace + conj_inner_symm _ _ := by + simp only [mul_assoc, starRingEnd_apply, ← trace_conjTranspose, conjTranspose_mul, + conjTranspose_conjTranspose, hM.isHermitian.eq] + re_inner_nonneg x := RCLike.nonneg_iff.mp (hM.mul_mul_conjTranspose_same x).trace_nonneg |>.1 + add_left := by simp [mul_add] + smul_left := by simp + +/-- A positive definite matrix `M` induces a norm on `Matrix n n 𝕜` +`‖x‖ = sqrt (x * M * xᴴ).trace`. -/ +noncomputable def toMatrixSeminormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosSemidef) : + SeminormedAddCommGroup (Matrix n n 𝕜) := + @InnerProductSpace.Core.toSeminormedAddCommGroup _ _ _ _ _ hM.matrixPreInnerProductSpace + /-- A positive definite matrix `M` induces a norm on `Matrix n n 𝕜`: `‖x‖ = sqrt (x * M * xᴴ).trace`. -/ -noncomputable def PosDef.matrixNormedAddCommGroup {M : Matrix n n 𝕜} (hM : M.PosDef) : +noncomputable def toMatrixNormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosDef) : NormedAddCommGroup (Matrix n n 𝕜) := letI : InnerProductSpace.Core 𝕜 (Matrix n n 𝕜) := - { inner x y := (y * M * xᴴ).trace - conj_inner_symm _ _ := by - simp only [mul_assoc, starRingEnd_apply, ← trace_conjTranspose, conjTranspose_mul, - conjTranspose_conjTranspose, hM.isHermitian.eq] - re_inner_nonneg x := RCLike.nonneg_iff.mp - (hM.posSemidef.mul_mul_conjTranspose_same x).trace_nonneg |>.1 - add_left := by simp [mul_add] - smul_left := by simp + { __ := hM.posSemidef.matrixPreInnerProductSpace definite x hx := by classical obtain ⟨y, hy, rfl⟩ := CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self.mp hM.isStrictlyPositive + simp only at hx rw [← mul_assoc, ← conjTranspose_conjTranspose x, star_eq_conjTranspose, ← conjTranspose_mul, conjTranspose_conjTranspose, mul_assoc, trace_conjTranspose_mul_self_eq_zero_iff] at hx lift y to (Matrix n n 𝕜)ˣ using hy simpa [← mul_assoc] using congr(y⁻¹ * $hx) } this.toNormedAddCommGroup -/-- A positive definite matrix `M` induces an inner product on `Matrix n n 𝕜`: +/-- A positive semi-definite matrix `M` induces an inner product on `Matrix n n 𝕜`: `⟪x, y⟫ = (y * M * xᴴ).trace`. -/ -def PosDef.matrixInnerProductSpace {M : Matrix n n 𝕜} (hM : M.PosDef) : - letI : NormedAddCommGroup (Matrix n n 𝕜) := hM.matrixNormedAddCommGroup +def toMatrixInnerProductSpace (M : Matrix n n 𝕜) (hM : M.PosSemidef) : + letI : SeminormedAddCommGroup (Matrix n n 𝕜) := M.toMatrixSeminormedAddCommGroup hM InnerProductSpace 𝕜 (Matrix n n 𝕜) := InnerProductSpace.ofCore _ +@[deprecated (since := "2025-11-18")] alias PosDef.matrixNormedAddCommGroup := + toMatrixNormedAddCommGroup +@[deprecated (since := "2025-11-12")] alias PosDef.matrixInnerProductSpace := + toMatrixInnerProductSpace + end Matrix diff --git a/Mathlib/Analysis/Matrix/PosDef.lean b/Mathlib/Analysis/Matrix/PosDef.lean index 778a78c40a4391..f8085392a7f29f 100644 --- a/Mathlib/Analysis/Matrix/PosDef.lean +++ b/Mathlib/Analysis/Matrix/PosDef.lean @@ -3,26 +3,36 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Mohanad Ahmed -/ -import Mathlib.Analysis.Matrix.Spectrum -import Mathlib.LinearAlgebra.Matrix.PosDef +module + +public import Mathlib.Analysis.Matrix.Spectrum +public import Mathlib.LinearAlgebra.Matrix.PosDef /-! -# Spectrum of positive definite matrices +# Spectrum of positive (semi)definite matrices This file proves that eigenvalues of positive (semi)definite matrices are (nonnegative) positive. + +## Main definitions + +* `Matrix.toInnerProductSpace`: the pre-inner product space on `n → 𝕜` induced by a + positive semi-definite matrix `M`, and is given by `⟪x, y⟫ = xᴴMy`. + -/ +@[expose] public section + open WithLp Matrix Unitary open scoped ComplexOrder namespace Matrix -variable {m n 𝕜 : Type*} [Fintype m] [Fintype n] [RCLike 𝕜] +variable {m n 𝕜 : Type*} [Fintype m] [Fintype n] [RCLike 𝕜] {A : Matrix n n 𝕜} /-! ### Positive semidefinite matrices -/ /-- A Hermitian matrix is positive semi-definite if and only if its eigenvalues are non-negative. -/ -lemma IsHermitian.posSemidef_iff_eigenvalues_nonneg [DecidableEq n] {A : Matrix n n 𝕜} - (hA : IsHermitian A) : PosSemidef A ↔ 0 ≤ hA.eigenvalues := by +lemma IsHermitian.posSemidef_iff_eigenvalues_nonneg [DecidableEq n] (hA : IsHermitian A) : + PosSemidef A ↔ 0 ≤ hA.eigenvalues := by conv_lhs => rw [hA.spectral_theorem] simp [isUnit_coe.posSemidef_star_right_conjugate_iff, posSemidef_diagonal_iff, Pi.le_def] @@ -32,17 +42,17 @@ lemma IsHermitian.posSemidef_iff_eigenvalues_nonneg [DecidableEq n] {A : Matrix namespace PosSemidef /-- The eigenvalues of a positive semi-definite matrix are non-negative -/ -lemma eigenvalues_nonneg [DecidableEq n] {A : Matrix n n 𝕜} - (hA : Matrix.PosSemidef A) (i : n) : 0 ≤ hA.1.eigenvalues i := +lemma eigenvalues_nonneg [DecidableEq n] (hA : A.PosSemidef) (i : n) : 0 ≤ hA.1.eigenvalues i := hA.isHermitian.posSemidef_iff_eigenvalues_nonneg.mp hA _ -lemma det_nonneg [DecidableEq n] {M : Matrix n n 𝕜} (hM : M.PosSemidef) : - 0 ≤ M.det := by - rw [hM.isHermitian.det_eq_prod_eigenvalues] - exact Finset.prod_nonneg fun i _ ↦ by simpa using hM.eigenvalues_nonneg i +lemma re_dotProduct_nonneg (hA : A.PosSemidef) (x : n → 𝕜) : 0 ≤ RCLike.re (star x ⬝ᵥ (A *ᵥ x)) := + RCLike.nonneg_iff.mp (hA.2 _) |>.1 -lemma trace_eq_zero_iff {A : Matrix n n 𝕜} (hA : A.PosSemidef) : - A.trace = 0 ↔ A = 0 := by +lemma det_nonneg [DecidableEq n] (hA : A.PosSemidef) : 0 ≤ A.det := by + rw [hA.isHermitian.det_eq_prod_eigenvalues] + exact Finset.prod_nonneg fun i _ ↦ by simpa using hA.eigenvalues_nonneg i + +lemma trace_eq_zero_iff (hA : A.PosSemidef) : A.trace = 0 ↔ A = 0 := by classical conv_lhs => rw [hA.1.spectral_theorem, conjStarAlgAut_apply, trace_mul_cycle, coe_star_mul_self, one_mul, trace_diagonal, Finset.sum_eq_zero_iff_of_nonneg (by simp [hA.eigenvalues_nonneg])] @@ -61,23 +71,61 @@ lemma eigenvalues_self_mul_conjTranspose_nonneg (A : Matrix m n 𝕜) [Decidable /-! ### Positive definite matrices -/ /-- A Hermitian matrix is positive-definite if and only if its eigenvalues are positive. -/ -lemma IsHermitian.posDef_iff_eigenvalues_pos [DecidableEq n] {A : Matrix n n 𝕜} - (hA : A.IsHermitian) : A.PosDef ↔ ∀ i, 0 < hA.eigenvalues i := by +lemma IsHermitian.posDef_iff_eigenvalues_pos [DecidableEq n] (hA : A.IsHermitian) : + A.PosDef ↔ ∀ i, 0 < hA.eigenvalues i := by conv_lhs => rw [hA.spectral_theorem] simp [isUnit_coe.posDef_star_right_conjugate_iff] namespace PosDef +lemma re_dotProduct_pos (hA : A.PosDef) {x : n → 𝕜} (hx : x ≠ 0) : + 0 < RCLike.re (star x ⬝ᵥ (A *ᵥ x)) := RCLike.pos_iff.mp (hA.2 _ hx) |>.1 + /-- The eigenvalues of a positive definite matrix are positive. -/ -lemma eigenvalues_pos [DecidableEq n] {A : Matrix n n 𝕜} - (hA : Matrix.PosDef A) (i : n) : 0 < hA.1.eigenvalues i := +lemma eigenvalues_pos [DecidableEq n] (hA : A.PosDef) (i : n) : 0 < hA.1.eigenvalues i := hA.isHermitian.posDef_iff_eigenvalues_pos.mp hA i -lemma det_pos [DecidableEq n] {M : Matrix n n 𝕜} (hM : M.PosDef) : 0 < det M := by - rw [hM.isHermitian.det_eq_prod_eigenvalues] +lemma det_pos [DecidableEq n] (hA : A.PosDef) : 0 < det A := by + rw [hA.isHermitian.det_eq_prod_eigenvalues] apply Finset.prod_pos intro i _ - simpa using hM.eigenvalues_pos i + simpa using hA.eigenvalues_pos i end PosDef + +/-- The pre-inner product space structure implementation. Only an auxiliary for +`Matrix.toSeminormedAddCommGroup`, `Matrix.toNormedAddCommGroup`, +and `Matrix.toInnerProductSpace`. -/ +private def PosSemidef.preInnerProductSpace {M : Matrix n n 𝕜} (hM : M.PosSemidef) : + PreInnerProductSpace.Core 𝕜 (n → 𝕜) where + inner x y := (M *ᵥ y) ⬝ᵥ star x + conj_inner_symm x y := by + rw [dotProduct_comm, star_dotProduct, starRingEnd_apply, star_star, + star_mulVec, dotProduct_comm (M *ᵥ y), dotProduct_mulVec, hM.isHermitian.eq] + re_inner_nonneg x := dotProduct_comm _ (star x) ▸ hM.re_dotProduct_nonneg x + add_left := by simp only [star_add, dotProduct_add, forall_const] + smul_left _ _ _ := by rw [← smul_eq_mul, ← dotProduct_smul, starRingEnd_apply, ← star_smul] + +/-- A positive semi-definite matrix `M` induces a norm `‖x‖ = sqrt (re xᴴMx)`. -/ +noncomputable abbrev toSeminormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosSemidef) : + SeminormedAddCommGroup (n → 𝕜) := + @InnerProductSpace.Core.toSeminormedAddCommGroup _ _ _ _ _ hM.preInnerProductSpace + +/-- A positive definite matrix `M` induces a norm `‖x‖ = sqrt (re xᴴMx)`. -/ +noncomputable abbrev toNormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosDef) : + NormedAddCommGroup (n → 𝕜) := + @InnerProductSpace.Core.toNormedAddCommGroup _ _ _ _ _ + { __ := hM.posSemidef.preInnerProductSpace + definite x (hx : _ ⬝ᵥ _ = 0) := by + by_contra! h + simpa [hx, lt_irrefl, dotProduct_comm] using hM.re_dotProduct_pos h } + +/-- A positive semi-definite matrix `M` induces an inner product `⟪x, y⟫ = xᴴMy`. -/ +def toInnerProductSpace (M : Matrix n n 𝕜) (hM : M.PosSemidef) : + @InnerProductSpace 𝕜 (n → 𝕜) _ (M.toSeminormedAddCommGroup hM) := + InnerProductSpace.ofCore _ + +@[deprecated (since := "2025-10-26")] alias NormedAddCommGroup.ofMatrix := toNormedAddCommGroup +@[deprecated (since := "2025-10-26")] alias InnerProductSpace.ofMatrix := toInnerProductSpace + end Matrix diff --git a/Mathlib/Analysis/Matrix/Spectrum.lean b/Mathlib/Analysis/Matrix/Spectrum.lean index f715cdc8555795..7b2a9f7b74cbf3 100644 --- a/Mathlib/Analysis/Matrix/Spectrum.lean +++ b/Mathlib/Analysis/Matrix/Spectrum.lean @@ -3,14 +3,14 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.Algebra.Star.UnitaryStarAlgAut -import Mathlib.Analysis.InnerProductSpace.Spectrum -import Mathlib.LinearAlgebra.Eigenspace.Matrix -import Mathlib.LinearAlgebra.Matrix.Charpoly.Eigs -import Mathlib.LinearAlgebra.Matrix.Diagonal -import Mathlib.LinearAlgebra.Matrix.Hermitian -import Mathlib.LinearAlgebra.Matrix.Rank -import Mathlib.Topology.Algebra.Module.FiniteDimension +module + +public import Mathlib.Algebra.Star.UnitaryStarAlgAut +public import Mathlib.Analysis.InnerProductSpace.Spectrum +public import Mathlib.Analysis.Matrix.Hermitian +public import Mathlib.LinearAlgebra.Eigenspace.Matrix +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Eigs +public import Mathlib.LinearAlgebra.Matrix.Rank /-! # Spectral theory of Hermitian matrices @@ -21,6 +21,8 @@ the spectral theorem for linear maps (`LinearMap.IsSymmetric.eigenvectorBasis_ap spectral theorem, diagonalization theorem -/ +@[expose] public section + open WithLp namespace Matrix diff --git a/Mathlib/Analysis/MeanInequalities.lean b/Mathlib/Analysis/MeanInequalities.lean index 170f074b8fe221..6207a61ef2f23b 100644 --- a/Mathlib/Analysis/MeanInequalities.lean +++ b/Mathlib/Analysis/MeanInequalities.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.Algebra.BigOperators.Expect -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.Convex.Jensen -import Mathlib.Analysis.Convex.SpecificFunctions.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.Data.Real.ConjExponents +module + +public import Mathlib.Algebra.BigOperators.Expect +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.Convex.Jensen +public import Mathlib.Analysis.Convex.SpecificFunctions.Basic +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.Data.Real.ConjExponents /-! # Mean value inequalities @@ -104,6 +106,8 @@ less than or equal to the sum of the maximum values of the summands. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Analysis/MeanInequalitiesPow.lean b/Mathlib/Analysis/MeanInequalitiesPow.lean index f623a2193a644d..85ca59088a6cc4 100644 --- a/Mathlib/Analysis/MeanInequalitiesPow.lean +++ b/Mathlib/Analysis/MeanInequalitiesPow.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.Analysis.Convex.Jensen -import Mathlib.Analysis.Convex.Mul -import Mathlib.Analysis.Convex.SpecificFunctions.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +module + +public import Mathlib.Analysis.Convex.Jensen +public import Mathlib.Analysis.Convex.Mul +public import Mathlib.Analysis.Convex.SpecificFunctions.Basic +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal /-! # Mean value inequalities @@ -40,6 +42,8 @@ in order to avoid using real exponents. For real exponents we prove both this an -/ +@[expose] public section + universe u v diff --git a/Mathlib/Analysis/MellinInversion.lean b/Mathlib/Analysis/MellinInversion.lean index 2777604f85df29..985e7903ac11f9 100644 --- a/Mathlib/Analysis/MellinInversion.lean +++ b/Mathlib/Analysis/MellinInversion.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Lawrence Wu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lawrence Wu -/ -import Mathlib.Analysis.Fourier.Inversion -import Mathlib.Analysis.MellinTransform +module + +public import Mathlib.Analysis.Fourier.Inversion +public import Mathlib.Analysis.MellinTransform /-! # Mellin inversion formula @@ -15,6 +17,8 @@ We derive the Mellin inversion formula as a consequence of the Fourier inversion - `mellin_inversion`: The inverse Mellin transform of the Mellin transform applied to `x > 0` is x. -/ +@[expose] public section + open Real Complex Set MeasureTheory variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] @@ -42,7 +46,7 @@ private theorem rexp_cexp_aux (x : ℝ) (s : ℂ) (f : E) : Complex.log_exp (by simp [pi_pos]) (by simpa using pi_nonneg)] ring_nf -theorem mellin_eq_fourierIntegral (f : ℝ → E) {s : ℂ} : +theorem mellin_eq_fourier (f : ℝ → E) {s : ℂ} : mellin f s = 𝓕 (fun (u : ℝ) ↦ (Real.exp (-s.re * u) • f (Real.exp (-u)))) (s.im / (2 * π)) := calc mellin f s @@ -63,9 +67,12 @@ theorem mellin_eq_fourierIntegral (f : ℝ → E) {s : ℂ} : congr simp [field] _ = 𝓕 (fun (u : ℝ) ↦ (Real.exp (-s.re * u) • f (Real.exp (-u)))) (s.im / (2 * π)) := by - simp [fourierIntegral_eq', mul_comm (_ / _)] + simp [fourier_eq', mul_comm (_ / _)] + +@[deprecated (since := "2025-11-16")] +alias mellin_eq_fourierIntegral := mellin_eq_fourier -theorem mellinInv_eq_fourierIntegralInv (σ : ℝ) (f : ℂ → E) {x : ℝ} (hx : 0 < x) : +theorem mellinInv_eq_fourierInv (σ : ℝ) (f : ℂ → E) {x : ℝ} (hx : 0 < x) : mellinInv σ f x = (x : ℂ) ^ (-σ : ℂ) • 𝓕⁻ (fun (y : ℝ) ↦ f (σ + 2 * π * y * I)) (-Real.log x) := calc mellinInv σ f x @@ -80,12 +87,15 @@ theorem mellinInv_eq_fourierIntegralInv (σ : ℝ) (f : ℂ → E) {x : ℝ} (hx push_cast ring_nf _ = (x : ℂ) ^ (-σ : ℂ) • 𝓕⁻ (fun (y : ℝ) ↦ f (σ + 2 * π * y * I)) (-Real.log x) := by - simp [fourierIntegralInv_eq', mul_comm (Real.log _)] + simp [fourierInv_eq', mul_comm (Real.log _)] + +@[deprecated (since := "2025-11-16")] +alias mellinInv_eq_fourierIntegralInv := mellinInv_eq_fourierInv variable [CompleteSpace E] /-- The inverse Mellin transform of the Mellin transform applied to `x > 0` is x. -/ -theorem mellin_inversion (σ : ℝ) (f : ℝ → E) {x : ℝ} (hx : 0 < x) (hf : MellinConvergent f σ) +theorem mellinInv_mellin_eq (σ : ℝ) (f : ℝ → E) {x : ℝ} (hx : 0 < x) (hf : MellinConvergent f σ) (hFf : VerticalIntegrable (mellin f) σ) (hfx : ContinuousAt f x) : mellinInv σ (mellin f) x = f x := by let g := fun (u : ℝ) => Real.exp (-σ * u) • f (Real.exp (-u)) @@ -98,7 +108,7 @@ theorem mellin_inversion (σ : ℝ) (f : ℝ → E) {x : ℝ} (hx : 0 < x) (hf : replace hFf : Integrable (𝓕 g) := by have h2π : 2 * π ≠ 0 := by simp have : Integrable (𝓕 (fun u ↦ rexp (-(σ * u)) • f (rexp (-u)))) := by - simpa [mellin_eq_fourierIntegral, mul_div_cancel_right₀ _ h2π] using hFf.comp_mul_right' h2π + simpa [mellin_eq_fourier, mul_div_cancel_right₀ _ h2π] using hFf.comp_mul_right' h2π simp_rw [neg_mul_eq_neg_mul] at this exact this replace hfx : ContinuousAt g (-Real.log x) := by @@ -107,9 +117,9 @@ theorem mellin_inversion (σ : ℝ) (f : ℝ → E) {x : ℝ} (hx : 0 < x) (hf : calc mellinInv σ (mellin f) x = mellinInv σ (fun s ↦ 𝓕 g (s.im / (2 * π))) x := by - simp [g, mellinInv, mellin_eq_fourierIntegral] + simp [g, mellinInv, mellin_eq_fourier] _ = (x : ℂ) ^ (-σ : ℂ) • g (-Real.log x) := by - rw [mellinInv_eq_fourierIntegralInv _ _ hx, ← hf.fourier_inversion hFf hfx] + rw [mellinInv_eq_fourierInv _ _ hx, ← hf.fourierInv_fourier_eq hFf hfx] simp [mul_div_cancel_left₀ _ (show 2 * π ≠ 0 by simp)] _ = (x : ℂ) ^ (-σ : ℂ) • rexp (σ * Real.log x) • f (rexp (Real.log x)) := by simp [g] _ = f x := by @@ -118,3 +128,6 @@ theorem mellin_inversion (σ : ℝ) (f : ℝ → E) {x : ℝ} (hx : 0 < x) (hf : norm_cast rw [← smul_assoc, smul_eq_mul, Real.rpow_neg hx.le, inv_mul_cancel₀ (ne_of_gt (rpow_pos_of_pos hx σ)), one_smul] + +@[deprecated (since := "2025-11-16")] +alias mellin_inversion := mellinInv_mellin_eq diff --git a/Mathlib/Analysis/MellinTransform.lean b/Mathlib/Analysis/MellinTransform.lean index 961f018ce46005..6c15d996f06990 100644 --- a/Mathlib/Analysis/MellinTransform.lean +++ b/Mathlib/Analysis/MellinTransform.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals -import Mathlib.Analysis.Calculus.ParametricIntegral -import Mathlib.MeasureTheory.Measure.Haar.NormedSpace +module + +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +public import Mathlib.Analysis.Calculus.ParametricIntegral +public import Mathlib.MeasureTheory.Measure.Haar.NormedSpace /-! # The Mellin transform @@ -23,6 +25,8 @@ differentiable in a suitable vertical strip. -/ +@[expose] public section + open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real diff --git a/Mathlib/Analysis/Meromorphic/Basic.lean b/Mathlib/Analysis/Meromorphic/Basic.lean index badf583ebcc87d..a739d495a2d64c 100644 --- a/Mathlib/Analysis/Meromorphic/Basic.lean +++ b/Mathlib/Analysis/Meromorphic/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler, Stefan Kebekus -/ -import Mathlib.Analysis.Analytic.IsolatedZeros +module + +public import Mathlib.Analysis.Analytic.IsolatedZeros /-! # Meromorphic functions @@ -16,6 +18,8 @@ Main statements: and `g` analytic at `z₀`. -/ +@[expose] public section + open Filter open scoped Topology diff --git a/Mathlib/Analysis/Meromorphic/Complex.lean b/Mathlib/Analysis/Meromorphic/Complex.lean index e2521ec9ba4419..520ea2adedcdba 100644 --- a/Mathlib/Analysis/Meromorphic/Complex.lean +++ b/Mathlib/Analysis/Meromorphic/Complex.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Miyahara Kō. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Miyahara Kō -/ -import Mathlib.Analysis.Meromorphic.NormalForm -import Mathlib.Analysis.SpecialFunctions.Gamma.Beta +module + +public import Mathlib.Analysis.Meromorphic.NormalForm +public import Mathlib.Analysis.SpecialFunctions.Gamma.Beta /-! # The Gamma function is meromorphic -/ +@[expose] public section + open Set Complex lemma MeromorphicNFOn.Gamma : MeromorphicNFOn Gamma univ := diff --git a/Mathlib/Analysis/Meromorphic/Divisor.lean b/Mathlib/Analysis/Meromorphic/Divisor.lean index a987d23d3df31b..50cbdc38068101 100644 --- a/Mathlib/Analysis/Meromorphic/Divisor.lean +++ b/Mathlib/Analysis/Meromorphic/Divisor.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Algebra.Order.WithTop.Untop0 -import Mathlib.Analysis.Meromorphic.Order -import Mathlib.Topology.LocallyFinsupp +module + +public import Mathlib.Algebra.Order.WithTop.Untop0 +public import Mathlib.Analysis.Meromorphic.Order +public import Mathlib.Topology.LocallyFinsupp /-! # The Divisor of a meromorphic function @@ -15,6 +17,8 @@ divisors. The lemma `MeromorphicOn.divisor_restrict` guarantees compatibility be of divisors and of meromorphic functions to subsets of their domain of definition. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {U : Set 𝕜} {z : 𝕜} {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] @@ -305,4 +309,22 @@ theorem negPart_divisor_add_of_analyticNhdOn_left {f₁ f₂ : 𝕜 → E} (hf rw [add_comm] exact negPart_divisor_add_of_analyticNhdOn_right hf₂ hf₁ +open WithTop in +/-- The divisor of the function `z ↦ z - z₀` at `x` is `0` if `x ≠ z₀`. -/ +lemma divisor_sub_const_of_ne {U : Set 𝕜} {z₀ x : 𝕜} (hx : x ≠ z₀) : divisor (· - z₀) U x = 0 := by + by_cases hu : x ∈ U + · rw [divisor_apply (show MeromorphicOn (· - z₀) U from fun_sub id <| const z₀) hu, + ← untop₀_coe 0] + congr + exact (meromorphicOrderAt_eq_int_iff (by fun_prop)).mpr + ⟨(· - z₀), analyticAt_id.fun_sub analyticAt_const, by simp [sub_ne_zero_of_ne hx]⟩ + · exact Function.locallyFinsuppWithin.apply_eq_zero_of_notMem _ hu + +open WithTop in +/-- The divisor of the function `z ↦ z - z₀` at `z₀` is `1`. -/ +lemma divisor_sub_const_self {z₀ : 𝕜} {U : Set 𝕜} (h : z₀ ∈ U) : divisor (· - z₀) U z₀ = 1 := by + rw [divisor_apply (show MeromorphicOn (· - z₀) U from fun_sub id <| const z₀) h, ← untop₀_coe 1] + congr + exact (meromorphicOrderAt_eq_int_iff (by fun_prop)).mpr ⟨fun _ ↦ 1, analyticAt_const, by simp⟩ + end MeromorphicOn diff --git a/Mathlib/Analysis/Meromorphic/FactorizedRational.lean b/Mathlib/Analysis/Meromorphic/FactorizedRational.lean index de49a2e2da995b..7dfda91136c7de 100644 --- a/Mathlib/Analysis/Meromorphic/FactorizedRational.lean +++ b/Mathlib/Analysis/Meromorphic/FactorizedRational.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Meromorphic.Divisor -import Mathlib.Analysis.Meromorphic.IsolatedZeros -import Mathlib.Analysis.Meromorphic.NormalForm -import Mathlib.Analysis.Meromorphic.TrailingCoefficient -import Mathlib.Analysis.SpecialFunctions.Log.Basic +module + +public import Mathlib.Analysis.Meromorphic.Divisor +public import Mathlib.Analysis.Meromorphic.IsolatedZeros +public import Mathlib.Analysis.Meromorphic.NormalForm +public import Mathlib.Analysis.Meromorphic.TrailingCoefficient +public import Mathlib.Analysis.SpecialFunctions.Log.Basic /-! # Factorized Rational Functions @@ -28,6 +30,8 @@ There are elementary examples of functions `d` where `∏ᶠ u, (· - u) ^ d u` `fun x ↦ ∏ᶠ u, (x - u) ^ d u` is not continuous. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] @@ -213,7 +217,7 @@ theorem meromorphicTrailingCoeffAt_factorizedRational {d : 𝕜 → ℤ} {x : by_cases hxy : x = y · rw [hxy, meromorphicTrailingCoeffAt_id_sub_const] simp_all - · grind [Function.update_of_ne, meromorphicTrailingCoeffAt_id_sub_const] + · grind [meromorphicTrailingCoeffAt_id_sub_const] /-- Variant of `meromorphicTrailingCoeffAt_factorizedRational`: Compute the trailing coefficient of the diff --git a/Mathlib/Analysis/Meromorphic/IsolatedZeros.lean b/Mathlib/Analysis/Meromorphic/IsolatedZeros.lean index d1d4f6eb92e92d..7185d7d1d91c8a 100644 --- a/Mathlib/Analysis/Meromorphic/IsolatedZeros.lean +++ b/Mathlib/Analysis/Meromorphic/IsolatedZeros.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Meromorphic.Basic +module + +public import Mathlib.Analysis.Meromorphic.Basic /-! # Principles of Isolated Zeros and Identity Principles for Meromorphic Functions @@ -17,6 +19,8 @@ complicated to state. This is because meromorphic functions can be modified at w subsets and still remain meromorphic. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] diff --git a/Mathlib/Analysis/Meromorphic/NormalForm.lean b/Mathlib/Analysis/Meromorphic/NormalForm.lean index ec103adc9e61e9..b1d7fb88b29cfb 100644 --- a/Mathlib/Analysis/Meromorphic/NormalForm.lean +++ b/Mathlib/Analysis/Meromorphic/NormalForm.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Meromorphic.Divisor +module + +public import Mathlib.Analysis.Meromorphic.Divisor /-! # Normal form of meromorphic functions and continuous extension @@ -21,6 +23,8 @@ The relevant notions are `MeromorphicNFAt` and `MeromorphicNFOn`; these guarante form at a single point and along a set, respectively. -/ +@[expose] public section + open Topology WithTop variable diff --git a/Mathlib/Analysis/Meromorphic/Order.lean b/Mathlib/Analysis/Meromorphic/Order.lean index 45ec7f8db4b2d6..7989086cede5ba 100644 --- a/Mathlib/Analysis/Meromorphic/Order.lean +++ b/Mathlib/Analysis/Meromorphic/Order.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler, Stefan Kebekus -/ -import Mathlib.Algebra.Order.WithTop.Untop0 -import Mathlib.Analysis.Analytic.Order -import Mathlib.Analysis.Meromorphic.Basic +module + +public import Mathlib.Algebra.Order.WithTop.Untop0 +public import Mathlib.Analysis.Analytic.Order +public import Mathlib.Analysis.Meromorphic.Basic /-! # Orders of Meromorphic Functions @@ -21,6 +23,8 @@ to infinity, resp. a nonzero constant, resp. zero. Uniformize API between analytic and meromorphic functions -/ +@[expose] public section + open Filter Set WithTop.LinearOrderedAddCommGroup open scoped Topology diff --git a/Mathlib/Analysis/Meromorphic/TrailingCoefficient.lean b/Mathlib/Analysis/Meromorphic/TrailingCoefficient.lean index de7fec7dc73f75..1c1c25db13296d 100644 --- a/Mathlib/Analysis/Meromorphic/TrailingCoefficient.lean +++ b/Mathlib/Analysis/Meromorphic/TrailingCoefficient.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Meromorphic.Order +module + +public import Mathlib.Analysis.Meromorphic.Order /-! # The Trailing Coefficient of a Meromorphic Function @@ -16,6 +18,8 @@ The lemma `MeromorphicAt.tendsto_nhds_meromorphicTrailingCoeffAt` expresses the as a limit. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] diff --git a/Mathlib/Analysis/Normed/Affine/AddTorsor.lean b/Mathlib/Analysis/Normed/Affine/AddTorsor.lean index 1bdde4fd84dc6d..0beb28f923ee47 100644 --- a/Mathlib/Analysis/Normed/Affine/AddTorsor.lean +++ b/Mathlib/Analysis/Normed/Affine/AddTorsor.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Yury Kudryashov -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic -import Mathlib.LinearAlgebra.AffineSpace.Midpoint -import Mathlib.Topology.Instances.RealVectorSpace +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Midpoint +public import Mathlib.Topology.Instances.RealVectorSpace /-! @@ -17,6 +19,8 @@ import Mathlib.Topology.Instances.RealVectorSpace This file contains lemmas about normed additive torsors over normed spaces. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean b/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean index 78175eb4b74fa9..78a10a46a110d2 100644 --- a/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean +++ b/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +module + +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional /-! # Bases in normed affine spaces. @@ -20,6 +22,8 @@ This file contains results about bases in normed affine spaces. * `interior_convexHull_nonempty_iff_affineSpan_eq_top` -/ +@[expose] public section + assert_not_exists HasFDerivAt section Barycentric diff --git a/Mathlib/Analysis/Normed/Affine/AsymptoticCone.lean b/Mathlib/Analysis/Normed/Affine/AsymptoticCone.lean index aee36803e34c22..0f1fb4222da00f 100644 --- a/Mathlib/Analysis/Normed/Affine/AsymptoticCone.lean +++ b/Mathlib/Analysis/Normed/Affine/AsymptoticCone.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Attila Gáspár. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Attila Gáspár -/ -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Topology.Algebra.AsymptoticCone +module + +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Topology.Algebra.AsymptoticCone /-! # Asymptotic cones in normed spaces @@ -13,6 +15,8 @@ In this file, we prove that the asymptotic cone of a set is non-trivial if and o unbounded. -/ +@[expose] public section + open AffineSpace Bornology Filter Topology variable diff --git a/Mathlib/Analysis/Normed/Affine/ContinuousAffineMap.lean b/Mathlib/Analysis/Normed/Affine/ContinuousAffineMap.lean index cf0d5fed8fada5..dc78000f9075b0 100644 --- a/Mathlib/Analysis/Normed/Affine/ContinuousAffineMap.lean +++ b/Mathlib/Analysis/Normed/Affine/ContinuousAffineMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Topology.Algebra.ContinuousAffineMap -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Analysis.Normed.Group.AddTorsor +module + +public import Mathlib.Topology.Algebra.ContinuousAffineMap +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.Normed.Group.AddTorsor /-! # Norm on the continuous affine maps between normed vector spaces. @@ -33,6 +35,8 @@ submultiplicative: for a composition of maps, we have only `‖f.comp g‖ ≤ -/ +@[expose] public section + namespace ContinuousAffineMap diff --git a/Mathlib/Analysis/Normed/Affine/Convex.lean b/Mathlib/Analysis/Normed/Affine/Convex.lean index 745014b5e04ef3..d7c09aa81b7935 100644 --- a/Mathlib/Analysis/Normed/Affine/Convex.lean +++ b/Mathlib/Analysis/Normed/Affine/Convex.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Between -import Mathlib.Analysis.Normed.Affine.AddTorsor -import Mathlib.Analysis.Normed.Affine.AddTorsorBases -import Mathlib.Analysis.Normed.Module.Convex +module + +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Analysis.Normed.Affine.AddTorsor +public import Mathlib.Analysis.Normed.Affine.AddTorsorBases +public import Mathlib.Analysis.Normed.Module.Convex /-! # Simplices in normed affine spaces @@ -18,6 +20,8 @@ We prove the following facts: polytope between a compact convex set and one of its neighborhoods. -/ +@[expose] public section + variable {E P : Type*} open AffineBasis Module Metric Set diff --git a/Mathlib/Analysis/Normed/Affine/Isometry.lean b/Mathlib/Analysis/Normed/Affine/Isometry.lean index 961beb8fee4142..94d73fa9279494 100644 --- a/Mathlib/Analysis/Normed/Affine/Isometry.lean +++ b/Mathlib/Analysis/Normed/Affine/Isometry.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.AffineSpace.Midpoint -import Mathlib.LinearAlgebra.AffineSpace.Restrict -import Mathlib.Tactic.FailIfNoProgress +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Midpoint +public import Mathlib.LinearAlgebra.AffineSpace.Restrict +public import Mathlib.Tactic.FailIfNoProgress /-! # Affine isometries @@ -34,6 +36,8 @@ algebra-homomorphisms.) -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Analysis/Normed/Affine/MazurUlam.lean b/Mathlib/Analysis/Normed/Affine/MazurUlam.lean index b8b957fd1b0b21..88a4d97fab0cd3 100644 --- a/Mathlib/Analysis/Normed/Affine/MazurUlam.lean +++ b/Mathlib/Analysis/Normed/Affine/MazurUlam.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Topology.Instances.RealVectorSpace -import Mathlib.Analysis.Normed.Affine.Isometry +module + +public import Mathlib.Topology.Instances.RealVectorSpace +public import Mathlib.Analysis.Normed.Affine.Isometry /-! # Mazur-Ulam Theorem @@ -26,6 +28,8 @@ The formalization is based on [Jussi Väisälä, *A Proof of the Mazur-Ulam Theo isometry, affine map, linear map -/ +@[expose] public section + variable {E PE F PF : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MetricSpace PE] [NormedAddTorsor E PE] [NormedAddCommGroup F] [NormedSpace ℝ F] [MetricSpace PF] diff --git a/Mathlib/Analysis/Normed/Affine/Simplex.lean b/Mathlib/Analysis/Normed/Affine/Simplex.lean index 6ecd3b5fb22fc8..92350ab08b485b 100644 --- a/Mathlib/Analysis/Normed/Affine/Simplex.lean +++ b/Mathlib/Analysis/Normed/Affine/Simplex.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic +module + +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic /-! # Simplices in torsors over normed spaces. @@ -19,6 +21,8 @@ This file defines properties of simplices in a `NormedAddTorsor`. -/ +@[expose] public section + namespace Affine diff --git a/Mathlib/Analysis/Normed/Algebra/Basic.lean b/Mathlib/Analysis/Normed/Algebra/Basic.lean index ca664ac73d598e..c18e31db0036e1 100644 --- a/Mathlib/Analysis/Normed/Algebra/Basic.lean +++ b/Mathlib/Analysis/Normed/Algebra/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Topology.Algebra.Module.CharacterSpace -import Mathlib.Analysis.Normed.Module.WeakDual -import Mathlib.Analysis.Normed.Algebra.Spectrum +module + +public import Mathlib.Topology.Algebra.Module.CharacterSpace +public import Mathlib.Analysis.Normed.Module.WeakDual +public import Mathlib.Analysis.Normed.Algebra.Spectrum /-! # Normed algebras @@ -26,6 +28,8 @@ normed algebra, character space, continuous functional calculus -/ +@[expose] public section + variable {𝕜 : Type*} {A : Type*} diff --git a/Mathlib/Analysis/Normed/Algebra/DualNumber.lean b/Mathlib/Analysis/Normed/Algebra/DualNumber.lean index de4a83e7a7b247..8856668e0f29c9 100644 --- a/Mathlib/Analysis/Normed/Algebra/DualNumber.lean +++ b/Mathlib/Analysis/Normed/Algebra/DualNumber.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.DualNumber -import Mathlib.Analysis.Normed.Algebra.TrivSqZeroExt +module + +public import Mathlib.Algebra.DualNumber +public import Mathlib.Analysis.Normed.Algebra.TrivSqZeroExt /-! # Results on `DualNumber R` related to the norm @@ -17,6 +19,8 @@ These are just restatements of similar statements about `TrivSqZeroExt R M`. -/ +@[expose] public section + open NormedSpace -- For `NormedSpace.exp`. namespace DualNumber diff --git a/Mathlib/Analysis/Normed/Algebra/Exponential.lean b/Mathlib/Analysis/Normed/Algebra/Exponential.lean index 98e6efc98bf6b4..e984ed993906ad 100644 --- a/Mathlib/Analysis/Normed/Algebra/Exponential.lean +++ b/Mathlib/Analysis/Normed/Algebra/Exponential.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Eric Wieser -/ -import Mathlib.Algebra.Ring.Action.ConjAct -import Mathlib.Analysis.Analytic.ChangeOrigin -import Mathlib.Analysis.Complex.Basic -import Mathlib.Data.Nat.Choose.Cast -import Mathlib.Analysis.Analytic.OfScalars +module + +public import Mathlib.Algebra.Ring.Action.ConjAct +public import Mathlib.Analysis.Analytic.ChangeOrigin +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.Data.Nat.Choose.Cast +public import Mathlib.Analysis.Analytic.OfScalars /-! # Exponential in a Banach algebra @@ -85,6 +87,8 @@ In the long term is may be possible to replace `Real.exp` and `Complex.exp` with -/ +@[expose] public section + namespace NormedSpace diff --git a/Mathlib/Analysis/Normed/Algebra/GelfandFormula.lean b/Mathlib/Analysis/Normed/Algebra/GelfandFormula.lean index 7be54887f103e4..ad5f38bcbcb54b 100644 --- a/Mathlib/Analysis/Normed/Algebra/GelfandFormula.lean +++ b/Mathlib/Analysis/Normed/Algebra/GelfandFormula.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Analytic.RadiusLiminf -import Mathlib.Analysis.Complex.Liouville -import Mathlib.Analysis.Complex.Polynomial.Basic -import Mathlib.Analysis.Normed.Algebra.Spectrum +module + +public import Mathlib.Analysis.Analytic.RadiusLiminf +public import Mathlib.Analysis.Complex.Liouville +public import Mathlib.Analysis.Complex.Polynomial.Basic +public import Mathlib.Analysis.Normed.Algebra.Spectrum /-! # Gelfand's formula and other results on the spectrum in complex Banach algebras @@ -27,6 +29,8 @@ complex Banach algebra has nonempty spectrum. -/ +@[expose] public section + variable {𝕜 A : Type*} open scoped NNReal Topology diff --git a/Mathlib/Analysis/Normed/Algebra/GelfandMazur.lean b/Mathlib/Analysis/Normed/Algebra/GelfandMazur.lean index 53d52f785f4bd1..dc242832c6f6c1 100644 --- a/Mathlib/Analysis/Normed/Algebra/GelfandMazur.lean +++ b/Mathlib/Analysis/Normed/Algebra/GelfandMazur.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Polynomial.Factorization +module + +public import Mathlib.Analysis.Polynomial.Factorization /-! # A (new?) proof of the Gelfand-Mazur Theorem @@ -109,6 +111,8 @@ which is bounded by `(M ^ n + c ^ n) / M ^ (n - 1) = M * (1 + (c / M) ^ n)`, whe `M ≤ ‖x ^ 2 - a' • x + b' • 1‖ ≤ M`, as desired. -/ +@[expose] public section + /-! ### Auxiliary results used in both cases -/ diff --git a/Mathlib/Analysis/Normed/Algebra/MatrixExponential.lean b/Mathlib/Analysis/Normed/Algebra/MatrixExponential.lean index 680294d0ebe5ce..857d09a40866c1 100644 --- a/Mathlib/Analysis/Normed/Algebra/MatrixExponential.lean +++ b/Mathlib/Analysis/Normed/Algebra/MatrixExponential.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Normed.Algebra.Exponential -import Mathlib.Analysis.Matrix.Normed -import Mathlib.LinearAlgebra.Matrix.ZPow -import Mathlib.LinearAlgebra.Matrix.Hermitian -import Mathlib.LinearAlgebra.Matrix.Symmetric -import Mathlib.Topology.UniformSpace.Matrix +module + +public import Mathlib.Analysis.Normed.Algebra.Exponential +public import Mathlib.Analysis.Matrix.Normed +public import Mathlib.LinearAlgebra.Matrix.ZPow +public import Mathlib.LinearAlgebra.Matrix.Hermitian +public import Mathlib.LinearAlgebra.Matrix.Symmetric +public import Mathlib.Topology.UniformSpace.Matrix /-! # Lemmas about the matrix exponential @@ -59,6 +61,8 @@ results for general rings are instead stated about `Ring.inverse`: * https://en.wikipedia.org/wiki/Matrix_exponential -/ +@[expose] public section + open scoped Matrix open NormedSpace -- For `exp`. diff --git a/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean b/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean index 75c272718a012c..6904a8f0b299e7 100644 --- a/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean +++ b/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Quaternion -import Mathlib.Analysis.Normed.Algebra.Exponential -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Series +module + +public import Mathlib.Analysis.Quaternion +public import Mathlib.Analysis.Normed.Algebra.Exponential +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Series /-! # Lemmas about `NormedSpace.exp` on `Quaternion`s @@ -22,6 +24,8 @@ This file contains results about `NormedSpace.exp` on `Quaternion ℝ`. -/ +@[expose] public section + open scoped Quaternion Nat open NormedSpace diff --git a/Mathlib/Analysis/Normed/Algebra/Spectrum.lean b/Mathlib/Analysis/Normed/Algebra/Spectrum.lean index f5f60246df9d9e..a6b96059341b4e 100644 --- a/Mathlib/Analysis/Normed/Algebra/Spectrum.lean +++ b/Mathlib/Analysis/Normed/Algebra/Spectrum.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Analysis.Real.Spectrum -import Mathlib.Analysis.Normed.Algebra.Exponential -import Mathlib.Analysis.Normed.Algebra.UnitizationL1 -import Mathlib.Analysis.Normed.Ring.Units -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.FieldTheory.IsAlgClosed.Spectrum -import Mathlib.Topology.Algebra.Module.CharacterSpace +module + +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Analysis.Real.Spectrum +public import Mathlib.Analysis.Normed.Algebra.Exponential +public import Mathlib.Analysis.Normed.Algebra.UnitizationL1 +public import Mathlib.Analysis.Normed.Ring.Units +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.FieldTheory.IsAlgClosed.Spectrum +public import Mathlib.Topology.Algebra.Module.CharacterSpace /-! # The spectrum of elements in a complete normed algebra @@ -34,6 +36,8 @@ Theorems specific to *complex* Banach algebras, such as *Gelfand's formula* can -/ +@[expose] public section + assert_not_exists ProbabilityTheory.cond assert_not_exists HasFDerivAt diff --git a/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean b/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean index c25fcbd58f9ef2..b5299c0d55fca5 100644 --- a/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean +++ b/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Normed.Algebra.Exponential -import Mathlib.Analysis.Normed.Lp.ProdLp -import Mathlib.Topology.Instances.TrivSqZeroExt +module + +public import Mathlib.Analysis.Normed.Algebra.Exponential +public import Mathlib.Analysis.Normed.Lp.ProdLp +public import Mathlib.Topology.Instances.TrivSqZeroExt /-! # Results on `TrivSqZeroExt R M` related to the norm @@ -47,6 +49,8 @@ we could keep the collection of instances behind an `open scoped`. -/ +@[expose] public section + variable (𝕜 : Type*) {S R M : Type*} diff --git a/Mathlib/Analysis/Normed/Algebra/Ultra.lean b/Mathlib/Analysis/Normed/Algebra/Ultra.lean index a39c2617fb5905..794211ca027f42 100644 --- a/Mathlib/Analysis/Normed/Algebra/Ultra.lean +++ b/Mathlib/Analysis/Normed/Algebra/Ultra.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang -/ +module -import Mathlib.Analysis.Normed.Field.Ultra -import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Field.Ultra +public import Mathlib.Analysis.Normed.Module.Basic /-! # Normed algebra preserves ultrametricity @@ -13,6 +14,8 @@ import Mathlib.Analysis.Normed.Module.Basic This file contains the proof that a normed division ring over an ultrametric field is ultrametric. -/ +@[expose] public section + variable {K L : Type*} [NormedField K] variable (L) in diff --git a/Mathlib/Analysis/Normed/Algebra/Unitization.lean b/Mathlib/Analysis/Normed/Algebra/Unitization.lean index 78407bab62d593..f88af78b74ddc7 100644 --- a/Mathlib/Analysis/Normed/Algebra/Unitization.lean +++ b/Mathlib/Analysis/Normed/Algebra/Unitization.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Algebra.Algebra.Unitization -import Mathlib.Analysis.Normed.Operator.Mul +public import Mathlib.Algebra.Algebra.Unitization +public import Mathlib.Analysis.Normed.Operator.Mul /-! # Unitization norms @@ -58,6 +59,8 @@ bornology. -/ +@[expose] public section + suppress_compilation variable (𝕜 A : Type*) [NontriviallyNormedField 𝕜] [NonUnitalNormedRing A] diff --git a/Mathlib/Analysis/Normed/Algebra/UnitizationL1.lean b/Mathlib/Analysis/Normed/Algebra/UnitizationL1.lean index b44ed624bb8ed6..e3cc0644f909ef 100644 --- a/Mathlib/Analysis/Normed/Algebra/UnitizationL1.lean +++ b/Mathlib/Analysis/Normed/Algebra/UnitizationL1.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.TransferInstance -import Mathlib.Algebra.Algebra.Unitization -import Mathlib.Analysis.Normed.Lp.ProdLp +module + +public import Mathlib.Algebra.Algebra.TransferInstance +public import Mathlib.Algebra.Algebra.Unitization +public import Mathlib.Analysis.Normed.Lp.ProdLp /-! # Unitization equipped with the $L^1$ norm @@ -24,6 +26,8 @@ One application of this is a straightforward proof that the quasispectrum of an non-unital Banach algebra is compact, which can be established by passing to the unitization. -/ +@[expose] public section + variable (𝕜 A : Type*) [NormedField 𝕜] [NonUnitalNormedRing A] variable [NormedSpace 𝕜 A] diff --git a/Mathlib/Analysis/Normed/Field/Basic.lean b/Mathlib/Analysis/Normed/Field/Basic.lean index 2ab2a35a6e6ca5..98c3f83969057c 100644 --- a/Mathlib/Analysis/Normed/Field/Basic.lean +++ b/Mathlib/Analysis/Normed/Field/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.Algebra.Field.Subfield.Defs -import Mathlib.Algebra.Order.Group.Pointwise.Interval -import Mathlib.Analysis.Normed.Ring.Basic +module + +public import Mathlib.Algebra.Field.Subfield.Defs +public import Mathlib.Algebra.Order.Group.Pointwise.Interval +public import Mathlib.Analysis.Normed.Ring.Basic /-! # Normed division rings and fields @@ -21,6 +23,8 @@ given in: * AbsoluteValue.toNormedField -/ +@[expose] public section + -- Guard against import creep. assert_not_exists AddChar comap_norm_atTop DilationEquiv Finset.sup_mul_le_mul_sup_of_nonneg IsOfFinOrder Isometry.norm_map_of_map_one NNReal.isOpen_Ico_zero Rat.norm_cast_real diff --git a/Mathlib/Analysis/Normed/Field/Instances.lean b/Mathlib/Analysis/Normed/Field/Instances.lean index c21f60d220def9..c0ce3b3088287d 100644 --- a/Mathlib/Analysis/Normed/Field/Instances.lean +++ b/Mathlib/Analysis/Normed/Field/Instances.lean @@ -3,15 +3,19 @@ Copyright (c) 2025 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll, Patrick Massot, Anatole Dedecker -/ -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.Analysis.Normed.Ring.Lemmas -import Mathlib.Order.Filter.IsBounded -import Mathlib.Topology.Algebra.UniformField +module + +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.Analysis.Normed.Ring.Lemmas +public import Mathlib.Order.Filter.IsBounded +public import Mathlib.Topology.Algebra.UniformField /-! # A normed field is a completable topological field -/ +@[expose] public section + open SeminormedAddGroup IsUniformAddGroup Filter variable {F : Type*} [NormedField F] diff --git a/Mathlib/Analysis/Normed/Field/Lemmas.lean b/Mathlib/Analysis/Normed/Field/Lemmas.lean index f25db8d0f2ba06..b955fbd72b118b 100644 --- a/Mathlib/Analysis/Normed/Field/Lemmas.lean +++ b/Mathlib/Analysis/Normed/Field/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.Analysis.Normed.Group.Rat -import Mathlib.Analysis.Normed.Ring.Lemmas -import Mathlib.Topology.MetricSpace.DilationEquiv +module + +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.Analysis.Normed.Group.Rat +public import Mathlib.Analysis.Normed.Ring.Lemmas +public import Mathlib.Topology.MetricSpace.DilationEquiv /-! # Normed fields @@ -19,6 +21,8 @@ Some useful results that relate the topology of the normed field to the discrete -/ +@[expose] public section + -- Guard against import creep. assert_not_exists RestrictScalars diff --git a/Mathlib/Analysis/Normed/Field/ProperSpace.lean b/Mathlib/Analysis/Normed/Field/ProperSpace.lean index 7be8f34008d02e..1735c3cd03fc4b 100644 --- a/Mathlib/Analysis/Normed/Field/ProperSpace.lean +++ b/Mathlib/Analysis/Normed/Field/ProperSpace.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ +module -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Topology.MetricSpace.ProperSpace +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Topology.MetricSpace.ProperSpace /-! # Proper nontrivially normed fields @@ -24,6 +25,8 @@ This is a special case of `ProperSpace.of_locallyCompactSpace` from with a proof that requires fewer imports. -/ +@[expose] public section + assert_not_exists FiniteDimensional open Metric Filter diff --git a/Mathlib/Analysis/Normed/Field/Ultra.lean b/Mathlib/Analysis/Normed/Field/Ultra.lean index fb529438ac4eb6..9f0e0bdf10c600 100644 --- a/Mathlib/Analysis/Normed/Field/Ultra.lean +++ b/Mathlib/Analysis/Normed/Field/Ultra.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.Analysis.Normed.Ring.Ultra -import Mathlib.Data.Nat.Choose.Sum +module + +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.Analysis.Normed.Ring.Ultra +public import Mathlib.Data.Nat.Choose.Sum /-! ## Conditions to have an ultrametric norm on a division ring @@ -30,6 +32,8 @@ to be able to be applied in noncommutative division rings. ultrametric, nonarchimedean -/ + +@[expose] public section open Metric NNReal namespace IsUltrametricDist diff --git a/Mathlib/Analysis/Normed/Field/UnitBall.lean b/Mathlib/Analysis/Normed/Field/UnitBall.lean index 17c45039fa73a9..2c5a2c818e2617 100644 --- a/Mathlib/Analysis/Normed/Field/UnitBall.lean +++ b/Mathlib/Analysis/Normed/Field/UnitBall.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Heather Macbeth -/ -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Analysis.Normed.Group.BallSphere +module + +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Analysis.Normed.Group.BallSphere /-! # Algebraic structures on unit balls and spheres @@ -15,6 +17,8 @@ In this file we define algebraic structures (`Semigroup`, `CommSemigroup`, `Mono from `NonUnitalSeminormedRing` to `NormedField`. -/ +@[expose] public section + open Set Metric diff --git a/Mathlib/Analysis/Normed/Field/WithAbs.lean b/Mathlib/Analysis/Normed/Field/WithAbs.lean index 4a9d6cc41f3f23..f2b9e89fc2dd8e 100644 --- a/Mathlib/Analysis/Normed/Field/WithAbs.lean +++ b/Mathlib/Analysis/Normed/Field/WithAbs.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Salvatore Mercuri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Salvatore Mercuri -/ -import Mathlib.Analysis.Normed.Module.Completion -import Mathlib.Analysis.Normed.Ring.WithAbs -import Mathlib.FieldTheory.Separable +module + +public import Mathlib.Analysis.Normed.Module.Completion +public import Mathlib.Analysis.Normed.Ring.WithAbs +public import Mathlib.FieldTheory.Separable /-! # WithAbs for fields @@ -16,6 +18,8 @@ on an absolute value. This is useful when dealing with several absolute values o In particular this allows us to define the completion of a field at a given absolute value. -/ +@[expose] public section + open Topology noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/AddCircle.lean b/Mathlib/Analysis/Normed/Group/AddCircle.lean index 601c90fcffd9b6..ec76e0758b3af7 100644 --- a/Mathlib/Analysis/Normed/Group/AddCircle.lean +++ b/Mathlib/Analysis/Normed/Group/AddCircle.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Analysis.Normed.Group.Quotient -import Mathlib.Analysis.Normed.Module.Ball.Pointwise -import Mathlib.Topology.Instances.AddCircle.Real +module + +public import Mathlib.Analysis.Normed.Group.Quotient +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise +public import Mathlib.Topology.Instances.AddCircle.Real /-! # The additive circle as a normed group @@ -23,6 +25,8 @@ We define the normed group structure on `AddCircle p`, for `p : ℝ`. For exampl -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/AddTorsor.lean b/Mathlib/Analysis/Normed/Group/AddTorsor.lean index 41589470988daf..239f91e12c6503 100644 --- a/Mathlib/Analysis/Normed/Group/AddTorsor.lean +++ b/Mathlib/Analysis/Normed/Group/AddTorsor.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Group.Constructions -import Mathlib.Analysis.Normed.Group.Submodule -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic -import Mathlib.Topology.Algebra.Group.AddTorsor -import Mathlib.Topology.MetricSpace.IsometricSMul +module + +public import Mathlib.Analysis.Normed.Group.Constructions +public import Mathlib.Analysis.Normed.Group.Submodule +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic +public import Mathlib.Topology.Algebra.Group.AddTorsor +public import Mathlib.Topology.MetricSpace.IsometricSMul /-! # Torsors of additive normed group actions. @@ -17,6 +19,8 @@ metric space structure. The motivating case is Euclidean affine spaces. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/BallSphere.lean b/Mathlib/Analysis/Normed/Group/BallSphere.lean index fac6c5a5cc1c69..41cbd1e7cba847 100644 --- a/Mathlib/Analysis/Normed/Group/BallSphere.lean +++ b/Mathlib/Analysis/Normed/Group/BallSphere.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Heather Macbeth -/ -import Mathlib.Analysis.Normed.Group.Uniform +module + +public import Mathlib.Analysis.Normed.Group.Uniform /-! # Negation on spheres and balls @@ -12,6 +14,8 @@ In this file we define `InvolutiveNeg` and `ContinuousNeg` instances for spheres closed balls in a seminormed group. -/ +@[expose] public section + open Metric Set Topology variable {E : Type*} [i : SeminormedAddCommGroup E] {r : ℝ} diff --git a/Mathlib/Analysis/Normed/Group/Basic.lean b/Mathlib/Analysis/Normed/Group/Basic.lean index 27ba5185121441..4a6ec70e357cf7 100644 --- a/Mathlib/Analysis/Normed/Group/Basic.lean +++ b/Mathlib/Analysis/Normed/Group/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Group.Seminorm -import Mathlib.Data.NNReal.Basic -import Mathlib.Topology.Algebra.Support -import Mathlib.Topology.MetricSpace.Basic -import Mathlib.Topology.Order.Real +module + +public import Mathlib.Analysis.Normed.Group.Seminorm +public import Mathlib.Data.NNReal.Basic +public import Mathlib.Topology.Algebra.Support +public import Mathlib.Topology.MetricSpace.Basic +public import Mathlib.Topology.Order.Real /-! # Normed (semi)groups @@ -39,6 +41,8 @@ to for performance concerns. normed group -/ +@[expose] public section + variable {𝓕 α ι κ E F G : Type*} @@ -1391,7 +1395,7 @@ open Lean Meta Qq Function /-- Extension for the `positivity` tactic: multiplicative norms are always nonnegative, and positive on non-one inputs. -/ @[positivity ‖_‖] -def evalMulNorm : PositivityExt where eval {u α} _ _ e := do +meta def evalMulNorm : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(@Norm.norm $E $_n $a) => let _seminormedGroup_E ← synthInstanceQ q(SeminormedGroup $E) @@ -1413,7 +1417,7 @@ def evalMulNorm : PositivityExt where eval {u α} _ _ e := do /-- Extension for the `positivity` tactic: additive norms are always nonnegative, and positive on non-zero inputs. -/ @[positivity ‖_‖] -def evalAddNorm : PositivityExt where eval {u α} _ _ e := do +meta def evalAddNorm : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(@Norm.norm $E $_n $a) => let _seminormedAddGroup_E ← synthInstanceQ q(SeminormedAddGroup $E) diff --git a/Mathlib/Analysis/Normed/Group/Bounded.lean b/Mathlib/Analysis/Normed/Group/Bounded.lean index 082628d5e73cef..257d477281ea33 100644 --- a/Mathlib/Analysis/Normed/Group/Bounded.lean +++ b/Mathlib/Analysis/Normed/Group/Bounded.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Group.Continuity -import Mathlib.Topology.MetricSpace.Bounded -import Mathlib.Order.Filter.Pointwise +module + +public import Mathlib.Analysis.Normed.Group.Continuity +public import Mathlib.Topology.MetricSpace.Bounded +public import Mathlib.Order.Filter.Pointwise /-! # Boundedness in normed groups @@ -17,6 +19,8 @@ This file rephrases metric boundedness in terms of norms. normed group -/ +@[expose] public section + open Filter Metric Bornology open scoped Pointwise Topology diff --git a/Mathlib/Analysis/Normed/Group/CocompactMap.lean b/Mathlib/Analysis/Normed/Group/CocompactMap.lean index b2eecc42561661..10d921d3d5db8f 100644 --- a/Mathlib/Analysis/Normed/Group/CocompactMap.lean +++ b/Mathlib/Analysis/Normed/Group/CocompactMap.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ +module -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Topology.ContinuousMap.CocompactMap -import Mathlib.Topology.MetricSpace.Bounded +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Topology.ContinuousMap.CocompactMap +public import Mathlib.Topology.MetricSpace.Bounded /-! # Cocompact maps in normed groups @@ -21,6 +22,8 @@ This file gives a characterization of cocompact maps in terms of norm estimates. -/ +@[expose] public section + open Filter Metric variable {𝕜 E F 𝓕 : Type*} diff --git a/Mathlib/Analysis/Normed/Group/Completeness.lean b/Mathlib/Analysis/Normed/Group/Completeness.lean index 53e1fb845af6ad..f49298aa014457 100644 --- a/Mathlib/Analysis/Normed/Group/Completeness.lean +++ b/Mathlib/Analysis/Normed/Group/Completeness.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Completeness of normed groups @@ -29,6 +30,8 @@ series. CompleteSpace, CauchySeq -/ +@[expose] public section + open scoped Topology open Filter Finset diff --git a/Mathlib/Analysis/Normed/Group/Completion.lean b/Mathlib/Analysis/Normed/Group/Completion.lean index 20db58aa839b30..35750448e479cb 100644 --- a/Mathlib/Analysis/Normed/Group/Completion.lean +++ b/Mathlib/Analysis/Normed/Group/Completion.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Topology.Algebra.GroupCompletion -import Mathlib.Topology.MetricSpace.Completion +module + +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Topology.Algebra.GroupCompletion +public import Mathlib.Topology.MetricSpace.Completion /-! # Completion of a normed group @@ -17,6 +19,8 @@ In this file we prove that the completion of a (semi)normed group is a normed gr normed group, completion -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/Constructions.lean b/Mathlib/Analysis/Normed/Group/Constructions.lean index 66f7987c24123a..3ac973e7d9db28 100644 --- a/Mathlib/Analysis/Normed/Group/Constructions.lean +++ b/Mathlib/Analysis/Normed/Group/Constructions.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Algebra.Group.PUnit -import Mathlib.Algebra.Group.ULift -import Mathlib.Analysis.Normed.Group.Basic +module + +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.Algebra.Group.ULift +public import Mathlib.Analysis.Normed.Group.Basic /-! # Product of normed groups and other constructions @@ -14,6 +16,8 @@ This file constructs the infinity norm on finite products of normed groups and p for type synonyms. -/ +@[expose] public section + open NNReal variable {ι E F : Type*} {G : ι → Type*} diff --git a/Mathlib/Analysis/Normed/Group/Continuity.lean b/Mathlib/Analysis/Normed/Group/Continuity.lean index 734cf555ca1c6c..cf10d0da9d4826 100644 --- a/Mathlib/Analysis/Normed/Group/Continuity.lean +++ b/Mathlib/Analysis/Normed/Group/Continuity.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Topology.Algebra.Ring.Real -import Mathlib.Topology.Metrizable.Uniformity -import Mathlib.Topology.Sequences +module + +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Topology.Algebra.Ring.Real +public import Mathlib.Topology.Metrizable.Uniformity +public import Mathlib.Topology.Sequences /-! # Continuity of the norm on (semi)groups @@ -16,6 +18,8 @@ import Mathlib.Topology.Sequences normed group -/ +@[expose] public section + variable {𝓕 α ι κ E F G : Type*} open Filter Function Metric Bornology ENNReal NNReal Uniformity Pointwise Topology diff --git a/Mathlib/Analysis/Normed/Group/ControlledClosure.lean b/Mathlib/Analysis/Normed/Group/ControlledClosure.lean index 7f4ebed430ec92..549cc64a8c3145 100644 --- a/Mathlib/Analysis/Normed/Group/ControlledClosure.lean +++ b/Mathlib/Analysis/Normed/Group/ControlledClosure.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot -/ -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.Analysis.SpecificLimits.Normed +module + +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.Analysis.SpecificLimits.Normed /-! # Extending a backward bound on a normed group homomorphism from a dense set @@ -14,6 +16,8 @@ Possible TODO (from the PR's review, https://github.com/leanprover-community/mat lemmas in this file]." -/ +@[expose] public section + open Filter Finset diff --git a/Mathlib/Analysis/Normed/Group/FunctionSeries.lean b/Mathlib/Analysis/Normed/Group/FunctionSeries.lean index 2f82ad592b5476..6747698328b383 100644 --- a/Mathlib/Analysis/Normed/Group/FunctionSeries.lean +++ b/Mathlib/Analysis/Normed/Group/FunctionSeries.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Group.InfiniteSum -import Mathlib.Topology.Instances.ENNReal.Lemmas +module + +public import Mathlib.Analysis.Normed.Group.InfiniteSum +public import Mathlib.Topology.Instances.ENNReal.Lemmas /-! # Continuity of series of functions @@ -18,6 +20,8 @@ TODO: update this to use `SummableUniformlyOn`. -/ +@[expose] public section + open Set Metric TopologicalSpace Function Filter open scoped Topology NNReal diff --git a/Mathlib/Analysis/Normed/Group/Hom.lean b/Mathlib/Analysis/Normed/Group/Hom.lean index aba90b431de98e..df1bce37f79068 100644 --- a/Mathlib/Analysis/Normed/Group/Hom.lean +++ b/Mathlib/Analysis/Normed/Group/Hom.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Analysis.Normed.Group.Int -import Mathlib.Analysis.Normed.Group.Subgroup -import Mathlib.Analysis.Normed.Group.Uniform +module + +public import Mathlib.Analysis.Normed.Group.Int +public import Mathlib.Analysis.Normed.Group.Subgroup +public import Mathlib.Analysis.Normed.Group.Uniform /-! # Normed groups homomorphisms @@ -25,6 +27,8 @@ Since a lot of elementary properties don't require `‖x‖ = 0 → x = 0` we st theory of `SeminormedAddGroupHom` and we specialize to `NormedAddGroupHom` when needed. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/HomCompletion.lean b/Mathlib/Analysis/Normed/Group/HomCompletion.lean index 8c1e0ab1cdc774..bfcc5aeb567978 100644 --- a/Mathlib/Analysis/Normed/Group/HomCompletion.lean +++ b/Mathlib/Analysis/Normed/Group/HomCompletion.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot -/ -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.Analysis.Normed.Group.Completion +module + +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.Analysis.Normed.Group.Completion /-! # Completion of normed group homs @@ -46,6 +48,8 @@ The vertical maps in the above diagrams are also normed group homs constructed i `f : NormedAddGroupHom G H` to a `NormedAddGroupHom (completion G) H`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/Indicator.lean b/Mathlib/Analysis/Normed/Group/Indicator.lean index 8356e8d66b2736..589471f86710e8 100644 --- a/Mathlib/Analysis/Normed/Group/Indicator.lean +++ b/Mathlib/Analysis/Normed/Group/Indicator.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.Indicator -import Mathlib.Algebra.Order.Pi -import Mathlib.Analysis.Normed.Group.Basic +module + +public import Mathlib.Algebra.Order.Group.Indicator +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Analysis.Normed.Group.Basic /-! # Indicator function and (e)norm @@ -16,6 +18,8 @@ This file contains a few simple lemmas about `Set.indicator`, `norm` and `enorm` indicator, norm -/ +@[expose] public section + open Set section ESeminormedAddMonoid diff --git a/Mathlib/Analysis/Normed/Group/InfiniteSum.lean b/Mathlib/Analysis/Normed/Group/InfiniteSum.lean index 4a6f426c5d46e6..acdc118ed1f9e9 100644 --- a/Mathlib/Analysis/Normed/Group/InfiniteSum.lean +++ b/Mathlib/Analysis/Normed/Group/InfiniteSum.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Heather Macbeth, Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Topology.Instances.NNReal.Lemmas -import Mathlib.Topology.Instances.ENNReal.Lemmas +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Topology.Instances.NNReal.Lemmas +public import Mathlib.Topology.Instances.ENNReal.Lemmas /-! # Infinite sums in (semi)normed groups @@ -31,6 +33,8 @@ In a complete (semi)normed group, infinite series, absolute convergence, normed group -/ +@[expose] public section + open Topology ENNReal NNReal open Finset Filter Metric diff --git a/Mathlib/Analysis/Normed/Group/Int.lean b/Mathlib/Analysis/Normed/Group/Int.lean index 3bf3b3861fe7a4..dc4cfbf35ca4bb 100644 --- a/Mathlib/Analysis/Normed/Group/Int.lean +++ b/Mathlib/Analysis/Normed/Group/Int.lean @@ -3,12 +3,15 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ +module -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Topology.Instances.Int +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Topology.Instances.Int /-! # ℤ as a normed group -/ +@[expose] public section + open NNReal variable {α : Type*} diff --git a/Mathlib/Analysis/Normed/Group/Lemmas.lean b/Mathlib/Analysis/Normed/Group/Lemmas.lean index d59da9ba860151..3dc670e0949217 100644 --- a/Mathlib/Analysis/Normed/Group/Lemmas.lean +++ b/Mathlib/Analysis/Normed/Group/Lemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot -/ -import Mathlib.Analysis.Normed.Group.Uniform +module + +public import Mathlib.Analysis.Normed.Group.Uniform /-! # Further lemmas about normed groups @@ -17,6 +19,8 @@ This file contains further lemmas about normed groups, requiring heavier imports -/ +@[expose] public section + variable {E : Type*} [SeminormedAddCommGroup E] open NNReal Topology diff --git a/Mathlib/Analysis/Normed/Group/NullSubmodule.lean b/Mathlib/Analysis/Normed/Group/NullSubmodule.lean index 38e44125c29d3b..732b933098ff31 100644 --- a/Mathlib/Analysis/Normed/Group/NullSubmodule.lean +++ b/Mathlib/Analysis/Normed/Group/NullSubmodule.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yoh Tanimoto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yoh Tanimoto -/ -import Mathlib.Analysis.Normed.Group.Continuity -import Mathlib.Analysis.Normed.MulAction +module + +public import Mathlib.Analysis.Normed.Group.Continuity +public import Mathlib.Analysis.Normed.MulAction /-! # The null subgroup in a seminormed commutative group @@ -26,6 +28,8 @@ subspace as a submodule of `E`. -/ +@[expose] public section + variable {M : Type*} [SeminormedCommGroup M] variable (M) in diff --git a/Mathlib/Analysis/Normed/Group/Pointwise.lean b/Mathlib/Analysis/Normed/Group/Pointwise.lean index 6826233f621f6a..08ef01ed18e79e 100644 --- a/Mathlib/Analysis/Normed/Group/Pointwise.lean +++ b/Mathlib/Analysis/Normed/Group/Pointwise.lean @@ -3,10 +3,11 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yaël Dillies -/ +module -import Mathlib.Analysis.Normed.Group.Bounded -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Topology.MetricSpace.Thickening +public import Mathlib.Analysis.Normed.Group.Bounded +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Topology.MetricSpace.Thickening /-! # Properties of pointwise addition of sets in normed groups @@ -15,6 +16,8 @@ We explore the relationships between pointwise addition of sets in normed groups Notably, we show that the sum of bounded sets remain bounded. -/ +@[expose] public section + open Metric Set Pointwise Topology diff --git a/Mathlib/Analysis/Normed/Group/Quotient.lean b/Mathlib/Analysis/Normed/Group/Quotient.lean index 0b55e72cba6b3e..53b898fa9d810a 100644 --- a/Mathlib/Analysis/Normed/Group/Quotient.lean +++ b/Mathlib/Analysis/Normed/Group/Quotient.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Riccardo Brasca -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.Topology.MetricSpace.HausdorffDistance +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.Topology.MetricSpace.HausdorffDistance /-! # Quotients of seminormed groups @@ -92,6 +94,8 @@ the previous paragraph kicks in. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Group/Rat.lean b/Mathlib/Analysis/Normed/Group/Rat.lean index 2af37ebf7d48c7..af3bd0dd4f7531 100644 --- a/Mathlib/Analysis/Normed/Group/Rat.lean +++ b/Mathlib/Analysis/Normed/Group/Rat.lean @@ -3,12 +3,15 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ +module -import Mathlib.Analysis.Normed.Group.Int -import Mathlib.Topology.Instances.Rat +public import Mathlib.Analysis.Normed.Group.Int +public import Mathlib.Topology.Instances.Rat /-! # ℚ as a normed group -/ +@[expose] public section + namespace Rat instance instNormedAddCommGroup : NormedAddCommGroup ℚ where diff --git a/Mathlib/Analysis/Normed/Group/SemiNormedGrp.lean b/Mathlib/Analysis/Normed/Group/SemiNormedGrp.lean index 52358980885db1..7f9451ef70052b 100644 --- a/Mathlib/Analysis/Normed/Group/SemiNormedGrp.lean +++ b/Mathlib/Analysis/Normed/Group/SemiNormedGrp.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Riccardo Brasca -/ -import Mathlib.Analysis.Normed.Group.Constructions -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms -import Mathlib.CategoryTheory.Elementwise +module + +public import Mathlib.Analysis.Normed.Group.Constructions +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +public import Mathlib.CategoryTheory.Elementwise /-! # The category of seminormed groups @@ -15,6 +17,8 @@ We define `SemiNormedGrp`, the category of seminormed groups and normed group ho them, as well as `SemiNormedGrp₁`, the subcategory of norm non-increasing morphisms. -/ +@[expose] public section + noncomputable section @@ -24,6 +28,8 @@ open CategoryTheory /-- The category of seminormed abelian groups and bounded group homomorphisms. -/ structure SemiNormedGrp : Type (u + 1) where + /-- Construct a bundled `SemiNormedGrp` from the underlying type and typeclass. -/ + of :: /-- The underlying seminormed abelian group. -/ carrier : Type u [str : SeminormedAddCommGroup carrier] @@ -35,10 +41,6 @@ namespace SemiNormedGrp instance : CoeSort SemiNormedGrp Type* where coe X := X.carrier -/-- Construct a bundled `SemiNormedGrp` from the underlying type and typeclass. -/ -abbrev of (M : Type u) [SeminormedAddCommGroup M] : SemiNormedGrp where - carrier := M - /-- The type of morphisms in `SemiNormedGrp` -/ @[ext] structure Hom (M N : SemiNormedGrp.{u}) where @@ -209,6 +211,8 @@ end SemiNormedGrp which we shall equip with the category structure consisting only of the norm non-increasing maps. -/ structure SemiNormedGrp₁ : Type (u + 1) where + /-- Construct a bundled `SemiNormedGrp₁` from the underlying type and typeclass. -/ + of :: /-- The underlying seminormed abelian group. -/ carrier : Type u [str : SeminormedAddCommGroup carrier] @@ -220,10 +224,6 @@ namespace SemiNormedGrp₁ instance : CoeSort SemiNormedGrp₁ Type* where coe X := X.carrier -/-- Construct a bundled `SemiNormedGrp₁` from the underlying type and typeclass. -/ -abbrev of (M : Type u) [SeminormedAddCommGroup M] : SemiNormedGrp₁ where - carrier := M - /-- The type of morphisms in `SemiNormedGrp₁` -/ @[ext] structure Hom (M N : SemiNormedGrp₁.{u}) where diff --git a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Completion.lean b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Completion.lean index 2225b8e1dcd482..1ee7202bea5b46 100644 --- a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Completion.lean +++ b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Completion.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Johan Commelin -/ -import Mathlib.Analysis.Normed.Group.SemiNormedGrp -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.Analysis.Normed.Group.HomCompletion +module + +public import Mathlib.Analysis.Normed.Group.SemiNormedGrp +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.Analysis.Normed.Group.HomCompletion /-! # Completions of normed groups @@ -30,6 +32,8 @@ objects and morphisms). -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean index f2e37582cea063..0f42a1058091fc 100644 --- a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean +++ b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Johan Commelin, Kim Morrison -/ -import Mathlib.Analysis.Normed.Group.SemiNormedGrp -import Mathlib.Analysis.Normed.Group.Quotient -import Mathlib.CategoryTheory.Limits.Shapes.Kernels +module + +public import Mathlib.Analysis.Normed.Group.SemiNormedGrp +public import Mathlib.Analysis.Normed.Group.Quotient +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! # Kernels and cokernels in SemiNormedGrp₁ and SemiNormedGrp @@ -23,6 +25,8 @@ and in `SemiNormedGrp` one can always take a cokernel and rescale its norm -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits diff --git a/Mathlib/Analysis/Normed/Group/Seminorm.lean b/Mathlib/Analysis/Normed/Group/Seminorm.lean index df9489fe2684fb..31284d6dab0717 100644 --- a/Mathlib/Analysis/Normed/Group/Seminorm.lean +++ b/Mathlib/Analysis/Normed/Group/Seminorm.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 María Inés de Frutos-Fernández, Yaël Dillies. All rights Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Yaël Dillies -/ -import Mathlib.Data.NNReal.Defs -import Mathlib.Order.ConditionallyCompleteLattice.Group +module + +public import Mathlib.Data.NNReal.Defs +public import Mathlib.Order.ConditionallyCompleteLattice.Group /-! # Group seminorms @@ -43,6 +45,8 @@ having a superfluous `add_le'` field in the resulting structure. The same applie norm, seminorm -/ +@[expose] public section + assert_not_exists Finset open Set diff --git a/Mathlib/Analysis/Normed/Group/SeparationQuotient.lean b/Mathlib/Analysis/Normed/Group/SeparationQuotient.lean index 72d45634366a45..d1cfc557f2df6e 100644 --- a/Mathlib/Analysis/Normed/Group/SeparationQuotient.lean +++ b/Mathlib/Analysis/Normed/Group/SeparationQuotient.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yoh Tanimoto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yoh Tanimoto -/ -import Mathlib.Analysis.Normed.Group.Hom -import Mathlib.Topology.Algebra.SeparationQuotient.Hom +module + +public import Mathlib.Analysis.Normed.Group.Hom +public import Mathlib.Topology.Algebra.SeparationQuotient.Hom /-! # Lifts of maps to separation quotients of seminormed groups @@ -28,11 +30,13 @@ All the following definitions are in the `SeparationQuotient` namespace. Hence w ## Main results -* `norm_normedMk_eq_one : the operator norm of the projection is `1` if the subspace is not `⊤`. +* `norm_normedMk_eq_one` : the operator norm of the projection is `1` if the subspace is not `⊤`. * `norm_liftNormedAddGroupHom_le` : `‖liftNormedAddGroupHom f hf‖ ≤ ‖f‖`. -/ +@[expose] public section + section open SeparationQuotient NNReal diff --git a/Mathlib/Analysis/Normed/Group/Subgroup.lean b/Mathlib/Analysis/Normed/Group/Subgroup.lean index d8d365f6171b45..de640b93cfcaff 100644 --- a/Mathlib/Analysis/Normed/Group/Subgroup.lean +++ b/Mathlib/Analysis/Normed/Group/Subgroup.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Analysis.Normed.Group.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Analysis.Normed.Group.Basic /-! # Subgroups of normed (semi)groups @@ -16,6 +18,8 @@ In this file, we prove that subgroups of a normed (semi)group are also normed (s normed group -/ +@[expose] public section + open Filter Function Metric Bornology open ENNReal Filter NNReal Uniformity Pointwise Topology diff --git a/Mathlib/Analysis/Normed/Group/Submodule.lean b/Mathlib/Analysis/Normed/Group/Submodule.lean index 701063e400a28d..e0f832a68cc37d 100644 --- a/Mathlib/Analysis/Normed/Group/Submodule.lean +++ b/Mathlib/Analysis/Normed/Group/Submodule.lean @@ -3,12 +3,15 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ +module -import Mathlib.Algebra.Module.Submodule.LinearMap -import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Algebra.Module.Submodule.LinearMap +public import Mathlib.Analysis.Normed.Group.Basic /-! # Submodules of normed groups -/ +@[expose] public section + variable {𝕜 E : Type*} namespace Submodule diff --git a/Mathlib/Analysis/Normed/Group/Tannery.lean b/Mathlib/Analysis/Normed/Group/Tannery.lean index e896cb9eccefe2..e6d191342e4a72 100644 --- a/Mathlib/Analysis/Normed/Group/Tannery.lean +++ b/Mathlib/Analysis/Normed/Group/Tannery.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Analysis.Normed.Group.InfiniteSum +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Analysis.Normed.Group.InfiniteSum /-! # Tannery's theorem @@ -18,6 +19,8 @@ order to avoid some unnecessary hypotheses that appear when specialising the gen measure-theoretic result. -/ +@[expose] public section + open Filter Topology /-- **Tannery's theorem**: topological sums commute with termwise limits, when the norms of the diff --git a/Mathlib/Analysis/Normed/Group/Ultra.lean b/Mathlib/Analysis/Normed/Group/Ultra.lean index dc78b3e23876a2..368f141b7112b3 100644 --- a/Mathlib/Analysis/Normed/Group/Ultra.lean +++ b/Mathlib/Analysis/Normed/Group/Ultra.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky, David Loeffler -/ -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Topology.Algebra.Nonarchimedean.Basic -import Mathlib.Topology.MetricSpace.Ultra.Basic -import Mathlib.Topology.Algebra.InfiniteSum.Group -import Mathlib.Topology.Order.LiminfLimsup +module + +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Topology.Algebra.Nonarchimedean.Basic +public import Mathlib.Topology.MetricSpace.Ultra.Basic +public import Mathlib.Topology.Algebra.InfiniteSum.Group +public import Mathlib.Topology.Order.LiminfLimsup /-! # Ultrametric norms @@ -31,6 +33,8 @@ in `NNReal` is 0, so easier to make statements about maxima of empty sets. ultrametric, nonarchimedean -/ + +@[expose] public section open Metric NNReal namespace IsUltrametricDist diff --git a/Mathlib/Analysis/Normed/Group/Uniform.lean b/Mathlib/Analysis/Normed/Group/Uniform.lean index 3bcb9bc511128f..178cddb54c1190 100644 --- a/Mathlib/Analysis/Normed/Group/Uniform.lean +++ b/Mathlib/Analysis/Normed/Group/Uniform.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Group.Continuity -import Mathlib.Topology.Algebra.IsUniformGroup.Basic -import Mathlib.Topology.MetricSpace.Algebra -import Mathlib.Topology.MetricSpace.IsometricSMul +module + +public import Mathlib.Analysis.Normed.Group.Continuity +public import Mathlib.Topology.Algebra.IsUniformGroup.Basic +public import Mathlib.Topology.MetricSpace.Algebra +public import Mathlib.Topology.MetricSpace.IsometricSMul /-! # Normed groups are uniform groups @@ -15,6 +17,8 @@ This file proves lipschitzness of normed group operations and shows that normed groups. -/ +@[expose] public section + variable {𝓕 E F : Type*} open Filter Function Metric Bornology diff --git a/Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean b/Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean index 038ec722593e9c..728309a8db2198 100644 --- a/Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean +++ b/Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ +module -import Mathlib.Topology.ContinuousMap.ZeroAtInfty +public import Mathlib.Topology.ContinuousMap.ZeroAtInfty /-! # ZeroAtInftyContinuousMapClass in normed additive groups @@ -15,6 +16,8 @@ for every `ε > 0` there exists a `r : ℝ` such that for all `x : E` with `r < `‖f x‖ < ε`. -/ +@[expose] public section + open Topology Filter variable {E F 𝓕 : Type*} diff --git a/Mathlib/Analysis/Normed/Lp/LpEquiv.lean b/Mathlib/Analysis/Normed/Lp/LpEquiv.lean index de7333dabed7cc..5410e6760cbc89 100644 --- a/Mathlib/Analysis/Normed/Lp/LpEquiv.lean +++ b/Mathlib/Analysis/Normed/Lp/LpEquiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Normed.Lp.PiLp -import Mathlib.Analysis.Normed.Lp.lpSpace -import Mathlib.Topology.ContinuousMap.Bounded.Normed +module + +public import Mathlib.Analysis.Normed.Lp.PiLp +public import Mathlib.Analysis.Normed.Lp.lpSpace +public import Mathlib.Topology.ContinuousMap.Bounded.Normed /-! # Equivalences among $L^p$ spaces @@ -35,6 +37,8 @@ the subtype of `PreLp` satisfying `Memℓp`. -/ +@[expose] public section + open WithLp open scoped ENNReal diff --git a/Mathlib/Analysis/Normed/Lp/MeasurableSpace.lean b/Mathlib/Analysis/Normed/Lp/MeasurableSpace.lean index eb6963386d99ed..fc332ff74f0999 100644 --- a/Mathlib/Analysis/Normed/Lp/MeasurableSpace.lean +++ b/Mathlib/Analysis/Normed/Lp/MeasurableSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Analysis.Normed.Lp.PiLp -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +module + +public import Mathlib.Analysis.Normed.Lp.PiLp +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic /-! # Measurable space structure on `WithLp` @@ -13,6 +15,8 @@ If `X` is a measurable space, we set the measurable space structure on `WithLp p same as the one on `X`. -/ +@[expose] public section + open scoped ENNReal variable (p : ℝ≥0∞) (X : Type*) [MeasurableSpace X] diff --git a/Mathlib/Analysis/Normed/Lp/PiLp.lean b/Mathlib/Analysis/Normed/Lp/PiLp.lean index 2ae8c6411b8440..a163c8cdf3ada2 100644 --- a/Mathlib/Analysis/Normed/Lp/PiLp.lean +++ b/Mathlib/Analysis/Normed/Lp/PiLp.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Jireh Loreaux -/ -import Mathlib.Analysis.MeanInequalities -import Mathlib.Data.Fintype.Order -import Mathlib.LinearAlgebra.Matrix.Basis -import Mathlib.Analysis.Normed.Lp.ProdLp +module + +public import Mathlib.Analysis.MeanInequalities +public import Mathlib.Data.Fintype.Order +public import Mathlib.LinearAlgebra.Matrix.Basis +public import Mathlib.Analysis.Normed.Lp.ProdLp /-! # `L^p` distance on finite products of metric spaces @@ -69,6 +71,8 @@ TODO: the results about uniformity and bornology in the `Aux` section should be the only remaining results are about `Lipschitz` and `Antilipschitz`. -/ +@[expose] public section + open Module Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal WithLp noncomputable section diff --git a/Mathlib/Analysis/Normed/Lp/ProdLp.lean b/Mathlib/Analysis/Normed/Lp/ProdLp.lean index 1fb1f7fda643d1..636036e3cebdea 100644 --- a/Mathlib/Analysis/Normed/Lp/ProdLp.lean +++ b/Mathlib/Analysis/Normed/Lp/ProdLp.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Sébastien Gouëzel, Jireh Loreaux -/ -import Mathlib.Analysis.MeanInequalities -import Mathlib.Analysis.Normed.Lp.WithLp +module + +public import Mathlib.Analysis.MeanInequalities +public import Mathlib.Analysis.Normed.Lp.WithLp /-! # `L^p` distance on products of two metric spaces @@ -45,6 +47,8 @@ the only remaining results are about `Lipschitz` and `Antilipschitz`. -/ +@[expose] public section + open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section @@ -110,6 +114,22 @@ theorem smul_fst : (c • x).fst = c • x.fst := theorem smul_snd : (c • x).snd = c • x.snd := rfl +variable (p 𝕜 α β) + +/-- `WithLp.fst` as a linear map. -/ +@[simps] +def fstₗ : WithLp p (α × β) →ₗ[𝕜] α where + toFun := WithLp.fst + map_add' _ _ := rfl + map_smul' _ _ := rfl + +/-- `WithLp.snd` as a linear map. -/ +@[simps] +def sndₗ : WithLp p (α × β) →ₗ[𝕜] β where + toFun := WithLp.snd + map_add' _ _ := rfl + map_smul' _ _ := rfl + end algebra /-! Note that the unapplied versions of these lemmas are deliberately omitted, as they break @@ -469,6 +489,14 @@ def homeomorphProd : WithLp p (α × β) ≃ₜ α × β where @[simp] lemma toEquiv_homeomorphProd : (homeomorphProd p α β).toEquiv = WithLp.equiv p (α × β) := rfl +@[fun_prop] +protected lemma continuous_fst : Continuous (@WithLp.fst p α β) := + continuous_fst.comp <| prod_continuous_ofLp .. + +@[fun_prop] +protected lemma continuous_snd : Continuous (@WithLp.snd p α β) := + continuous_snd.comp <| prod_continuous_ofLp .. + variable [T0Space α] [T0Space β] instance instProdT0Space : T0Space (WithLp p (α × β)) := @@ -532,6 +560,18 @@ def prodContinuousLinearEquiv : WithLp p (α × β) ≃L[𝕜] α × β where lemma prodContinuousLinearEquiv_symm_apply (x : α × β) : (prodContinuousLinearEquiv p 𝕜 α β).symm x = toLp p x := rfl +/-- `WithLp.fst` as a continuous linear map. -/ +@[simps! coe apply] +def fstL : WithLp p (α × β) →L[𝕜] α where + __ := fstₗ .. + cont := WithLp.continuous_fst .. + +/-- `WithLp.snd` as a continuous linear map. -/ +@[simps! coe apply] +def sndL : WithLp p (α × β) →L[𝕜] β where + __ := sndₗ .. + cont := WithLp.continuous_snd .. + end ContinuousLinearEquiv /-! Throughout the rest of the file, we assume `1 ≤ p`. -/ diff --git a/Mathlib/Analysis/Normed/Lp/WithLp.lean b/Mathlib/Analysis/Normed/Lp/WithLp.lean index 2d2098d9bf75fa..9596e473db5899 100644 --- a/Mathlib/Analysis/Normed/Lp/WithLp.lean +++ b/Mathlib/Analysis/Normed/Lp/WithLp.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Module.TransferInstance -import Mathlib.Data.ENNReal.Basic -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Algebra.Module.TransferInstance +public import Mathlib.Data.ENNReal.Basic +public import Mathlib.RingTheory.Finiteness.Basic /-! # The `WithLp` type synonym @@ -37,6 +39,8 @@ TODO: is it safe to copy across the topology and uniform space structure too for choices of `V`? -/ +@[expose] public section + open scoped ENNReal @@ -57,7 +61,7 @@ open Lean.PrettyPrinter.Delaborator /-- This prevents `toLp p x` being printed as `{ ofLp := x }` by `delabStructureInstance`. -/ @[app_delab WithLp.toLp] -def WithLp.delabToLp : Delab := delabApp +meta def WithLp.delabToLp : Delab := delabApp end Notation diff --git a/Mathlib/Analysis/Normed/Lp/lpSpace.lean b/Mathlib/Analysis/Normed/Lp/lpSpace.lean index f79c483d1d35fb..36810867706097 100644 --- a/Mathlib/Analysis/Normed/Lp/lpSpace.lean +++ b/Mathlib/Analysis/Normed/Lp/lpSpace.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.MeanInequalities -import Mathlib.Analysis.MeanInequalitiesPow -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Data.Set.Image -import Mathlib.Topology.Algebra.ContinuousMonoidHom +module + +public import Mathlib.Analysis.MeanInequalities +public import Mathlib.Analysis.MeanInequalitiesPow +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Data.Set.Image +public import Mathlib.Topology.Algebra.ContinuousMonoidHom /-! # ℓp space @@ -54,6 +56,8 @@ say that `‖-f‖ = ‖f‖`, instead of the non-working `f.norm_neg`. -/ +@[expose] public section + noncomputable section open scoped NNReal ENNReal Function diff --git a/Mathlib/Analysis/Normed/Module/Ball/Action.lean b/Mathlib/Analysis/Normed/Module/Ball/Action.lean index 5942d467665fa5..104f037f8edbdf 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/Action.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/Action.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Heather Macbeth -/ -import Mathlib.Analysis.Normed.Field.UnitBall -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Analysis.Normed.Field.UnitBall +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # Multiplicative actions of/on balls and spheres @@ -17,6 +19,8 @@ multiplicative actions. - The unit sphere in `𝕜` acts on open balls, closed balls, and spheres centered at `0` in `E`. -/ +@[expose] public section + open Metric Set diff --git a/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean b/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean index 51d44d889f1042..b2b5aa32e9cdc7 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Oliver Nash -/ -import Mathlib.Topology.OpenPartialHomeomorph -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Analysis.Normed.Module.Ball.Pointwise -import Mathlib.Data.Real.Sqrt +module + +public import Mathlib.Topology.OpenPartialHomeomorph +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise +public import Mathlib.Data.Real.Sqrt /-! # (Local) homeomorphism between a normed space and a ball @@ -30,6 +32,8 @@ to a ball of positive radius in an affine space over `E`, see `OpenPartialHomeom homeomorphism, ball -/ +@[expose] public section + open Set Metric Pointwise variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] diff --git a/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean b/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean index efbfd60f3b828d..85ad52d40410f6 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Group.Pointwise -import Mathlib.Analysis.Normed.Module.RCLike.Real +module + +public import Mathlib.Analysis.Normed.Group.Pointwise +public import Mathlib.Analysis.Normed.Module.RCLike.Real /-! # Properties of pointwise scalar multiplication of sets in normed spaces. @@ -14,6 +16,8 @@ Notably, we express arbitrary balls as rescaling of other balls, and we show tha multiplication of bounded sets remain bounded. -/ +@[expose] public section + open Metric Set diff --git a/Mathlib/Analysis/Normed/Module/Ball/RadialEquiv.lean b/Mathlib/Analysis/Normed/Module/Ball/RadialEquiv.lean index 210aacfe665a6e..c3e33873a45033 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/RadialEquiv.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/RadialEquiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # Homeomorphism between a normed space and sphere times `(0, +∞)` @@ -14,6 +16,8 @@ and `Metric.sphere (0 : E) 1 × Set.Ioi (0 : ℝ)`. One may think about it as generalization of polar coordinates to any normed space. -/ +@[expose] public section + variable (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] open Set Metric diff --git a/Mathlib/Analysis/Normed/Module/Basic.lean b/Mathlib/Analysis/Normed/Module/Basic.lean index 30fd39d8af5835..b10cf7922794f9 100644 --- a/Mathlib/Analysis/Normed/Module/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.Algebra.Module.Rat -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Analysis.Normed.MulAction +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Analysis.Normed.MulAction /-! # Normed spaces @@ -18,6 +20,8 @@ In this file we define (semi)normed spaces and algebras. We also prove some theo about these definitions. -/ +@[expose] public section + variable {𝕜 𝕜' E F α : Type*} diff --git a/Mathlib/Analysis/Normed/Module/Complemented.lean b/Mathlib/Analysis/Normed/Module/Complemented.lean index 8d5e7f2cb0077c..5afd999e299f6d 100644 --- a/Mathlib/Analysis/Normed/Module/Complemented.lean +++ b/Mathlib/Analysis/Normed/Module/Complemented.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Operator.Banach -import Mathlib.Topology.Algebra.Module.FiniteDimension +module + +public import Mathlib.Analysis.Normed.Operator.Banach +public import Mathlib.Topology.Algebra.Module.FiniteDimension /-! # Complemented subspaces of normed vector spaces @@ -20,6 +22,8 @@ is always a complemented subspace. complemented subspace, normed vector space -/ +@[expose] public section + variable {𝕜 E F G : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] [NormedAddCommGroup G] [NormedSpace 𝕜 G] diff --git a/Mathlib/Analysis/Normed/Module/Completion.lean b/Mathlib/Analysis/Normed/Module/Completion.lean index f0e374c0452e5b..2cd3de425642b8 100644 --- a/Mathlib/Analysis/Normed/Module/Completion.lean +++ b/Mathlib/Analysis/Normed/Module/Completion.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Group.Completion -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Topology.Algebra.UniformRing -import Mathlib.Topology.Algebra.UniformField +module + +public import Mathlib.Analysis.Normed.Group.Completion +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Topology.Algebra.UniformRing +public import Mathlib.Topology.Algebra.UniformField /-! # Normed space structure on the completion of a normed space @@ -20,6 +22,8 @@ We also show that if `A` is a normed algebra over `𝕜`, then so is `UniformSpa TODO: Generalise the results here from the concrete `completion` to any `AbstractCompletion`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Module/Convex.lean b/Mathlib/Analysis/Normed/Module/Convex.lean index 182fb092438148..7d2d32ba6ace43 100644 --- a/Mathlib/Analysis/Normed/Module/Convex.lean +++ b/Mathlib/Analysis/Normed/Module/Convex.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Jensen -import Mathlib.Analysis.Convex.PathConnected -import Mathlib.Analysis.Convex.Topology -import Mathlib.Analysis.Normed.Group.Pointwise -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Module.RCLike.Real +module + +public import Mathlib.Analysis.Convex.Jensen +public import Mathlib.Analysis.Convex.PathConnected +public import Mathlib.Analysis.Convex.Topology +public import Mathlib.Analysis.Normed.Group.Pointwise +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Module.RCLike.Real /-! # Metric properties of convex sets in normed spaces @@ -25,6 +27,8 @@ We prove the following facts: is bounded. -/ +@[expose] public section + -- TODO assert_not_exists Cardinal variable {E : Type*} diff --git a/Mathlib/Analysis/Normed/Module/Dual.lean b/Mathlib/Analysis/Normed/Module/Dual.lean index 3ec875cfc1f0f8..e218def4e5e321 100644 --- a/Mathlib/Analysis/Normed/Module/Dual.lean +++ b/Mathlib/Analysis/Normed/Module/Dual.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.LocallyConvex.Polar -import Mathlib.Analysis.Normed.Module.HahnBanach -import Mathlib.Analysis.Normed.Module.RCLike.Basic -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.Analysis.LocallyConvex.AbsConvex -import Mathlib.Analysis.Normed.Module.Convex +module + +public import Mathlib.Analysis.LocallyConvex.Polar +public import Mathlib.Analysis.Normed.Module.HahnBanach +public import Mathlib.Analysis.Normed.Module.RCLike.Basic +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.Analysis.LocallyConvex.AbsConvex +public import Mathlib.Analysis.Normed.Module.Convex /-! # The strong dual of a normed space @@ -40,6 +42,8 @@ theory for `SeminormedAddCommGroup` and we specialize to `NormedAddCommGroup` wh strong dual, polar -/ +@[expose] public section + noncomputable section open Topology Bornology diff --git a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean index 7e22f92c6f7d3d..71754f635d77fc 100644 --- a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean +++ b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean @@ -3,19 +3,21 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.Normed.Group.Lemmas -import Mathlib.Analysis.Normed.Affine.Isometry -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Analysis.NormedSpace.RieszLemma -import Mathlib.Analysis.Normed.Module.Ball.Pointwise -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.Logic.Encodable.Pi -import Mathlib.Topology.Algebra.AffineSubspace -import Mathlib.Topology.Algebra.Module.FiniteDimension -import Mathlib.Topology.Algebra.InfiniteSum.Module -import Mathlib.Topology.Instances.Matrix -import Mathlib.LinearAlgebra.Dimension.LinearMap +module + +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.Normed.Group.Lemmas +public import Mathlib.Analysis.Normed.Affine.Isometry +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.NormedSpace.RieszLemma +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.Logic.Encodable.Pi +public import Mathlib.Topology.Algebra.AffineSubspace +public import Mathlib.Topology.Algebra.Module.FiniteDimension +public import Mathlib.Topology.Algebra.InfiniteSum.Module +public import Mathlib.Topology.Instances.Matrix +public import Mathlib.LinearAlgebra.Dimension.LinearMap /-! @@ -48,6 +50,8 @@ then the identities from `E` to `E'` and from `E'`to `E` are continuous thanks t `LinearMap.continuous_of_finiteDimensional`. This gives the desired norm equivalence. -/ +@[expose] public section + universe u v w x noncomputable section @@ -151,7 +155,7 @@ theorem ContinuousLinearMap.continuous_det : Continuous fun f : E →L[𝕜] E = -- TODO: this could be easier with `det_cases` by_cases h : ∃ s : Finset E, Nonempty (Basis (↥s) 𝕜 E) · rcases h with ⟨s, ⟨b⟩⟩ - haveI : FiniteDimensional 𝕜 E := FiniteDimensional.of_fintype_basis b + haveI : FiniteDimensional 𝕜 E := b.finiteDimensional_of_finite classical simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ diff --git a/Mathlib/Analysis/Normed/Module/HahnBanach.lean b/Mathlib/Analysis/Normed/Module/HahnBanach.lean index d07cdcb34fcb8e..b91a468fb55724 100644 --- a/Mathlib/Analysis/Normed/Module/HahnBanach.lean +++ b/Mathlib/Analysis/Normed/Module/HahnBanach.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Heather Macbeth -/ -import Mathlib.Analysis.Convex.Cone.Extension -import Mathlib.Analysis.Normed.Module.RCLike.Extend -import Mathlib.Analysis.RCLike.Lemmas +module + +public import Mathlib.Analysis.Convex.Cone.Extension +public import Mathlib.Analysis.Normed.Module.RCLike.Extend +public import Mathlib.Analysis.RCLike.Lemmas /-! # Extension Hahn-Banach theorem @@ -27,6 +29,8 @@ linear form `g` of norm `1` with `g x = ‖x‖` (where the norm has to be inter of `𝕜`). -/ +@[expose] public section + universe u v diff --git a/Mathlib/Analysis/Normed/Module/RCLike/Basic.lean b/Mathlib/Analysis/Normed/Module/RCLike/Basic.lean index 50f289662d37f0..977e4eddd962d5 100644 --- a/Mathlib/Analysis/Normed/Module/RCLike/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/RCLike/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Analysis.Normed.Module.RCLike.Real -import Mathlib.Analysis.Normed.Operator.Basic +module + +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Analysis.Normed.Module.RCLike.Real +public import Mathlib.Analysis.Normed.Operator.Basic /-! # Normed spaces over R or C @@ -26,6 +28,8 @@ None. This file exists mainly to avoid importing `RCLike` in the main normed space theory files. -/ +@[expose] public section + open Metric diff --git a/Mathlib/Analysis/Normed/Module/RCLike/Extend.lean b/Mathlib/Analysis/Normed/Module/RCLike/Extend.lean index b08ab8fa08e3cd..dbad073106a7b7 100644 --- a/Mathlib/Analysis/Normed/Module/RCLike/Extend.lean +++ b/Mathlib/Analysis/Normed/Module/RCLike/Extend.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Ruben Van de Velde. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ruben Van de Velde -/ -import Mathlib.Analysis.RCLike.Extend -import Mathlib.Analysis.Normed.Operator.Basic +module + +public import Mathlib.Analysis.RCLike.Extend +public import Mathlib.Analysis.Normed.Operator.Basic /-! # Norm properties of the extension of continuous `ℝ`-linear functionals to `𝕜`-linear functionals @@ -12,6 +14,8 @@ import Mathlib.Analysis.Normed.Operator.Basic This file shows that `ContinuousLinearMap.extendTo𝕜` preserves the norm of the functional. -/ +@[expose] public section + open RCLike open scoped ComplexConjugate diff --git a/Mathlib/Analysis/Normed/Module/RCLike/Real.lean b/Mathlib/Analysis/Normed/Module/RCLike/Real.lean index 0f9b801451a87e..690770c8af9e22 100644 --- a/Mathlib/Analysis/Normed/Module/RCLike/Real.lean +++ b/Mathlib/Analysis/Normed/Module/RCLike/Real.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Eric Wieser, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # Basic facts about real (semi)normed spaces @@ -21,6 +23,8 @@ In this file we prove some theorems about (semi)normed spaces over real numberes similar lemmas assuming that the ambient space is separated and nontrivial instead of `r ≠ 0`. -/ +@[expose] public section + open Metric Set Function Filter open scoped NNReal Topology diff --git a/Mathlib/Analysis/Normed/Module/Ray.lean b/Mathlib/Analysis/Normed/Module/Ray.lean index f6f5090339757c..eaefdeb73cdf51 100644 --- a/Mathlib/Analysis/Normed/Module/Ray.lean +++ b/Mathlib/Analysis/Normed/Module/Ray.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Yaël Dillies -/ -import Mathlib.LinearAlgebra.Ray -import Mathlib.Analysis.Normed.Module.RCLike.Real -import Mathlib.Algebra.Ring.Regular +module + +public import Mathlib.LinearAlgebra.Ray +public import Mathlib.Analysis.Normed.Module.RCLike.Real +public import Mathlib.Algebra.Ring.Regular /-! # Rays in a real normed vector space @@ -15,6 +17,8 @@ this case, for two vectors `x y` in the same ray, the norm of their sum is equal norms and `‖y‖ • x = ‖x‖ • y`. -/ +@[expose] public section + open Real diff --git a/Mathlib/Analysis/Normed/Module/Span.lean b/Mathlib/Analysis/Normed/Module/Span.lean index 770006500bec90..1d8b073c53a63d 100644 --- a/Mathlib/Analysis/Normed/Module/Span.lean +++ b/Mathlib/Analysis/Normed/Module/Span.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ +module -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # The span of a single vector @@ -24,6 +25,8 @@ isometry. -/ +@[expose] public section + variable {𝕜 E : Type*} namespace LinearMap diff --git a/Mathlib/Analysis/Normed/Module/WeakDual.lean b/Mathlib/Analysis/Normed/Module/WeakDual.lean index 78223d7b75899c..035dbd065d67dd 100644 --- a/Mathlib/Analysis/Normed/Module/WeakDual.lean +++ b/Mathlib/Analysis/Normed/Module/WeakDual.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.Dual -import Mathlib.Analysis.Normed.Operator.Completeness -import Mathlib.Topology.Algebra.Module.WeakDual +module + +public import Mathlib.Analysis.Normed.Module.Dual +public import Mathlib.Analysis.Normed.Operator.Completeness +public import Mathlib.Topology.Algebra.Module.WeakDual /-! # Weak dual of normed space @@ -80,6 +82,8 @@ weak-star, weak dual -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/MulAction.lean b/Mathlib/Analysis/Normed/MulAction.lean index 382bca8cbb837f..2363f5f518abd5 100644 --- a/Mathlib/Analysis/Normed/MulAction.lean +++ b/Mathlib/Analysis/Normed/MulAction.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.Data.ENNReal.Action -import Mathlib.Topology.Algebra.UniformMulAction -import Mathlib.Topology.MetricSpace.Algebra +module + +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.Data.ENNReal.Action +public import Mathlib.Topology.Algebra.UniformMulAction +public import Mathlib.Topology.MetricSpace.Algebra /-! # Lemmas for `IsBoundedSMul` over normed additive groups @@ -18,6 +20,8 @@ multiplication. This allows downstream files to write general results about `IsB then deduce `const_mul` and `mul_const` results as an immediate corollary. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Analysis/Normed/Operator/Asymptotics.lean b/Mathlib/Analysis/Normed/Operator/Asymptotics.lean index 88b8d1059ac76e..144027669645de 100644 --- a/Mathlib/Analysis/Normed/Operator/Asymptotics.lean +++ b/Mathlib/Analysis/Normed/Operator/Asymptotics.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Operator.Basic -import Mathlib.Analysis.Asymptotics.Defs +module + +public import Mathlib.Analysis.Normed.Operator.Basic +public import Mathlib.Analysis.Asymptotics.Defs /-! # Asymptotic statements about the operator norm @@ -12,6 +14,8 @@ This file contains lemmas about how operator norm on continuous linear maps inte -/ +@[expose] public section + open Asymptotics diff --git a/Mathlib/Analysis/Normed/Operator/Banach.lean b/Mathlib/Analysis/Normed/Operator/Banach.lean index ea786ce3c4f544..c99deb9b8c3b06 100644 --- a/Mathlib/Analysis/Normed/Operator/Banach.lean +++ b/Mathlib/Analysis/Normed/Operator/Banach.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Topology.Baire.Lemmas -import Mathlib.Topology.Baire.CompleteMetrizable -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Analysis.Normed.Group.InfiniteSum -import Mathlib.Analysis.Normed.Group.AddTorsor +module + +public import Mathlib.Topology.Baire.Lemmas +public import Mathlib.Topology.Baire.CompleteMetrizable +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.Normed.Group.InfiniteSum +public import Mathlib.Analysis.Normed.Group.AddTorsor /-! # Banach open mapping theorem @@ -16,6 +18,8 @@ This file contains the Banach open mapping theorem, i.e., the fact that a biject bounded linear map between Banach spaces has a bounded inverse. -/ +@[expose] public section + open Function Metric Set Filter Finset Topology NNReal open LinearMap (range ker) diff --git a/Mathlib/Analysis/Normed/Operator/BanachSteinhaus.lean b/Mathlib/Analysis/Normed/Operator/BanachSteinhaus.lean index 6d1a4259862011..92cf0ca1752954 100644 --- a/Mathlib/Analysis/Normed/Operator/BanachSteinhaus.lean +++ b/Mathlib/Analysis/Normed/Operator/BanachSteinhaus.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Analysis.LocallyConvex.Barrelled -import Mathlib.Topology.Baire.CompleteMetrizable +module + +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.LocallyConvex.Barrelled +public import Mathlib.Topology.Baire.CompleteMetrizable /-! # The Banach-Steinhaus theorem: Uniform Boundedness Principle @@ -18,6 +20,8 @@ Note that we prove the more general version about barrelled spaces in more general setup. -/ +@[expose] public section + open Set variable {E F 𝕜 𝕜₂ : Type*} [SeminormedAddCommGroup E] [SeminormedAddCommGroup F] diff --git a/Mathlib/Analysis/Normed/Operator/Basic.lean b/Mathlib/Analysis/Normed/Operator/Basic.lean index 3d47718b8dd932..02f3553cac5a48 100644 --- a/Mathlib/Analysis/Normed/Operator/Basic.lean +++ b/Mathlib/Analysis/Normed/Operator/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Topology.Algebra.Module.StrongTopology -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Topology.Algebra.Module.StrongTopology +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap +public import Mathlib.Tactic.SuppressCompilation /-! # Operator norm on the space of continuous linear maps @@ -31,6 +33,8 @@ is isometric, as expressed by the typeclass `[RingHomIsometric σ]`. -/ +@[expose] public section + suppress_compilation open Bornology Metric @@ -87,11 +91,13 @@ theorem sphere_subset_range_iff_surjective [RingHomSurjective τ] {f : 𝓕'} {x end /-- If `‖x‖ = 0` and `f` is continuous then `‖f x‖ = 0`. -/ -theorem norm_image_of_norm_zero [SemilinearMapClass 𝓕 σ₁₂ E F] (f : 𝓕) (hf : Continuous f) {x : E} - (hx : ‖x‖ = 0) : ‖f x‖ = 0 := by +theorem norm_image_of_norm_eq_zero [SemilinearMapClass 𝓕 σ₁₂ E F] (f : 𝓕) (hf : Continuous f) + {x : E} (hx : ‖x‖ = 0) : ‖f x‖ = 0 := by rw [← mem_closure_zero_iff_norm, ← specializes_iff_mem_closure, ← map_zero f] at * exact hx.map hf +@[deprecated (since := "2025-11-15")] alias norm_image_of_norm_zero := norm_image_of_norm_eq_zero + section variable [RingHomIsometric σ₁₂] @@ -203,7 +209,7 @@ theorem opNorm_le_bound' (f : E →SL[σ₁₂] F) {M : ℝ} (hMp : 0 ≤ M) (hM : ∀ x, ‖x‖ ≠ 0 → ‖f x‖ ≤ M * ‖x‖) : ‖f‖ ≤ M := opNorm_le_bound f hMp fun x => (ne_or_eq ‖x‖ 0).elim (hM x) fun h => by - simp only [h, mul_zero, norm_image_of_norm_zero f f.2 h, le_refl] + simp only [h, mul_zero, norm_image_of_norm_eq_zero f f.2 h, le_refl] theorem opNorm_eq_of_bounds {φ : E →SL[σ₁₂] F} {M : ℝ} (M_nonneg : 0 ≤ M) diff --git a/Mathlib/Analysis/Normed/Operator/Bilinear.lean b/Mathlib/Analysis/Normed/Operator/Bilinear.lean index 51b4e6ffc7f581..534edc3e29c36b 100644 --- a/Mathlib/Analysis/Normed/Operator/Bilinear.lean +++ b/Mathlib/Analysis/Normed/Operator/Bilinear.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Operator.Basic -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap +module + +public import Mathlib.Analysis.Normed.Operator.Basic +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap /-! # Operator norm: bilinear maps @@ -15,6 +17,8 @@ interpreted as linear maps `E → F → G` as usual (and similarly for semilinea -/ +@[expose] public section + suppress_compilation open Bornology @@ -402,6 +406,7 @@ theorem nnnorm_smulRight_apply (c : StrongDual 𝕜 E) (f : Fₗ) : ‖smulRight variable (𝕜 E Fₗ) in /-- `ContinuousLinearMap.smulRight` as a continuous trilinear map: `smulRightL (c : StrongDual 𝕜 E) (f : F) (x : E) = c x • f`. -/ +@[simps! apply_apply] def smulRightL : StrongDual 𝕜 E →L[𝕜] Fₗ →L[𝕜] E →L[𝕜] Fₗ := LinearMap.mkContinuous₂ { toFun := smulRightₗ @@ -416,10 +421,10 @@ def smulRightL : StrongDual 𝕜 E →L[𝕜] Fₗ →L[𝕜] E →L[𝕜] Fₗ simp only [coe_smulRightₗ, one_mul, norm_smulRight_apply, LinearMap.coe_mk, AddHom.coe_mk, le_refl] - -@[simp] -theorem norm_smulRightL_apply (c : StrongDual 𝕜 E) (f : Fₗ) : ‖smulRightL 𝕜 E Fₗ c f‖ = ‖c‖ * ‖f‖ := - norm_smulRight_apply c f +@[deprecated norm_smulRight_apply (since := "2025-11-12")] +theorem norm_smulRightL_apply (c : StrongDual 𝕜 E) (f : Fₗ) : + ‖smulRightL 𝕜 E Fₗ c f‖ = ‖c‖ * ‖f‖ := by + simp end ContinuousLinearMap diff --git a/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean b/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean index c3d476c4ecee0b..14a13658d2ceb7 100644 --- a/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean +++ b/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.Analysis.NormedSpace.Multilinear.Basic -import Mathlib.Analysis.Normed.Ring.Units -import Mathlib.Analysis.Normed.Operator.Mul +module + +public import Mathlib.Analysis.NormedSpace.Multilinear.Basic +public import Mathlib.Analysis.Normed.Ring.Units +public import Mathlib.Analysis.Normed.Operator.Mul /-! # Bounded linear maps @@ -49,6 +51,8 @@ in `Topology.Algebra.Module.Basic`, theory over normed spaces developed in artifact, really. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Operator/Compact.lean b/Mathlib/Analysis/Normed/Operator/Compact.lean index 01faafb6489eb8..0cf19647a6050a 100644 --- a/Mathlib/Analysis/Normed/Operator/Compact.lean +++ b/Mathlib/Analysis/Normed/Operator/Compact.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.LocallyConvex.Bounded -import Mathlib.Topology.Algebra.Module.StrongTopology +module + +public import Mathlib.Analysis.LocallyConvex.Bounded +public import Mathlib.Topology.Algebra.Module.StrongTopology /-! # Compact operators @@ -47,6 +49,8 @@ coercing from continuous linear maps to linear maps often needs type ascriptions Compact operator -/ +@[expose] public section + open Function Set Filter Bornology Metric Pointwise Topology diff --git a/Mathlib/Analysis/Normed/Operator/CompleteCodomain.lean b/Mathlib/Analysis/Normed/Operator/CompleteCodomain.lean index 1c4e575c79abac..7aab50131a03ea 100644 --- a/Mathlib/Analysis/Normed/Operator/CompleteCodomain.lean +++ b/Mathlib/Analysis/Normed/Operator/CompleteCodomain.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.Central.Defs -import Mathlib.Analysis.LocallyConvex.SeparatingDual -import Mathlib.Analysis.NormedSpace.Multilinear.Basic -import Mathlib.LinearAlgebra.Dual.Lemmas +module + +public import Mathlib.Algebra.Central.Defs +public import Mathlib.Analysis.LocallyConvex.SeparatingDual +public import Mathlib.Analysis.NormedSpace.Multilinear.Basic +public import Mathlib.LinearAlgebra.Dual.Lemmas /-! # Completeness of spaces of linear and multilinear maps @@ -17,6 +19,8 @@ linear maps from `E` to `F` is equivalent to the completeness of `F`. A similar statement holds for spaces of continuous multilinear maps -/ +@[expose] public section + open Filter open scoped Topology diff --git a/Mathlib/Analysis/Normed/Operator/Completeness.lean b/Mathlib/Analysis/Normed/Operator/Completeness.lean index 6eea30583069f3..1cf154cf2b0a70 100644 --- a/Mathlib/Analysis/Normed/Operator/Completeness.lean +++ b/Mathlib/Analysis/Normed/Operator/Completeness.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Operator.Bilinear -import Mathlib.Analysis.Normed.Operator.NNNorm +module + +public import Mathlib.Analysis.Normed.Operator.Bilinear +public import Mathlib.Analysis.Normed.Operator.NNNorm /-! # Operators on complete normed spaces @@ -13,6 +15,8 @@ This file contains statements about norms of operators on complete normed spaces version of the Banach-Alaoglu theorem (`ContinuousLinearMap.isCompact_image_coe_closedBall`). -/ +@[expose] public section + suppress_compilation open Bornology Metric Set Real diff --git a/Mathlib/Analysis/Normed/Operator/Conformal.lean b/Mathlib/Analysis/Normed/Operator/Conformal.lean index 560a7e590ac683..26d6161af28a33 100644 --- a/Mathlib/Analysis/Normed/Operator/Conformal.lean +++ b/Mathlib/Analysis/Normed/Operator/Conformal.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Operator.LinearIsometry -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Operator.LinearIsometry +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # Conformal Linear Maps @@ -37,6 +39,8 @@ conformal The definition of conformality in this file does NOT require the maps to be orientation-preserving. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean b/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean index 881277d0bd52f9..5eaecf831a2ed2 100644 --- a/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean +++ b/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Analysis.Normed.MulAction -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.Topology.Algebra.Module.Equiv +module + +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Analysis.Normed.MulAction +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.Topology.Algebra.Module.Equiv /-! # Constructions of continuous linear maps between (semi-)normed spaces @@ -28,6 +30,8 @@ This file is meant to be lightweight (it is imported by much of the analysis lib before adding imports! -/ +@[expose] public section + open Metric ContinuousLinearMap open Set Real diff --git a/Mathlib/Analysis/Normed/Operator/Extend.lean b/Mathlib/Analysis/Normed/Operator/Extend.lean index fc8959be4761f4..27a252a82fbac3 100644 --- a/Mathlib/Analysis/Normed/Operator/Extend.lean +++ b/Mathlib/Analysis/Normed/Operator/Extend.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Zhouhang Zhou -/ -import Mathlib.Analysis.Normed.Operator.Basic +module + +public import Mathlib.Analysis.Normed.Operator.Basic /-! @@ -18,6 +20,8 @@ injection into the domain and using a norm estimate. -/ +@[expose] public section + suppress_compilation open scoped NNReal diff --git a/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean b/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean index 9a63f5a90579bb..0e4609759b9417 100644 --- a/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean +++ b/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Star.Basic -import Mathlib.Analysis.Normed.Group.Constructions -import Mathlib.Analysis.Normed.Group.Submodule -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.Topology.Algebra.Module.Equiv +module + +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Analysis.Normed.Group.Constructions +public import Mathlib.Analysis.Normed.Group.Submodule +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.Topology.Algebra.Module.Equiv /-! # (Semi-)linear isometries @@ -26,6 +28,8 @@ Since a lot of elementary properties don't require `‖x‖ = 0 → x = 0` we st theory for `SeminormedAddCommGroup` and we specialize to `NormedAddCommGroup` when needed. -/ +@[expose] public section + open Function Set Topology variable {R R₂ R₃ R₄ E E₂ E₃ E₄ F 𝓕 : Type*} [Semiring R] [Semiring R₂] [Semiring R₃] [Semiring R₄] diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index 768ddf4bb52c25..a5558bc2136ae4 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Analysis.Normed.Operator.NormedSpace +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Analysis.Normed.Operator.NormedSpace /-! # Results about operator norms in normed algebras @@ -13,6 +15,8 @@ This file (split off from `OperatorNorm.lean`) contains results about the operat of multiplication and scalar-multiplication operations in normed algebras and normed modules. -/ +@[expose] public section + suppress_compilation open Metric diff --git a/Mathlib/Analysis/Normed/Operator/NNNorm.lean b/Mathlib/Analysis/Normed/Operator/NNNorm.lean index ea03637f4d253c..b9fe30a7668b15 100644 --- a/Mathlib/Analysis/Normed/Operator/NNNorm.lean +++ b/Mathlib/Analysis/Normed/Operator/NNNorm.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Operator.Basic -import Mathlib.Analysis.Normed.Module.RCLike.Real +module + +public import Mathlib.Analysis.Normed.Operator.Basic +public import Mathlib.Analysis.Normed.Module.RCLike.Real /-! # Operator norm as an `NNNorm` @@ -13,6 +15,8 @@ Operator norm as an `NNNorm`, i.e. taking values in non-negative reals. -/ +@[expose] public section + suppress_compilation open Bornology diff --git a/Mathlib/Analysis/Normed/Operator/NormedSpace.lean b/Mathlib/Analysis/Normed/Operator/NormedSpace.lean index 0d8934950cc082..a2a2b09f4aad48 100644 --- a/Mathlib/Analysis/Normed/Operator/NormedSpace.lean +++ b/Mathlib/Analysis/Normed/Operator/NormedSpace.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Module.Span -import Mathlib.Analysis.Normed.Operator.Bilinear -import Mathlib.Analysis.Normed.Operator.NNNorm +module + +public import Mathlib.Analysis.Normed.Module.Span +public import Mathlib.Analysis.Normed.Operator.Bilinear +public import Mathlib.Analysis.Normed.Operator.NNNorm /-! # Operator norm for maps on normed spaces @@ -14,6 +16,8 @@ This file contains statements about operator norm for which it really matters th underlying space has a norm (rather than just a seminorm). -/ +@[expose] public section + suppress_compilation open Topology diff --git a/Mathlib/Analysis/Normed/Operator/Prod.lean b/Mathlib/Analysis/Normed/Operator/Prod.lean index bc522e837421f3..9546ca3fbdacea 100644 --- a/Mathlib/Analysis/Normed/Operator/Prod.lean +++ b/Mathlib/Analysis/Normed/Operator/Prod.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Jan-David Salchow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo -/ -import Mathlib.Analysis.Normed.Operator.Bilinear +module + +public import Mathlib.Analysis.Normed.Operator.Bilinear /-! # Operator norm: Cartesian products @@ -11,6 +13,8 @@ import Mathlib.Analysis.Normed.Operator.Bilinear Interaction of operator norm with Cartesian products. -/ +@[expose] public section + variable {𝕜 E F G : Type*} [NontriviallyNormedField 𝕜] open Set Real Metric ContinuousLinearMap diff --git a/Mathlib/Analysis/Normed/Order/Basic.lean b/Mathlib/Analysis/Normed/Order/Basic.lean index 0afec6fa22d336..3b0e31a3c27b41 100644 --- a/Mathlib/Analysis/Normed/Order/Basic.lean +++ b/Mathlib/Analysis/Normed/Order/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Yaël Dillies -/ -import Mathlib.Analysis.Normed.Group.Basic +module + +public import Mathlib.Analysis.Normed.Group.Basic /-! # Ordered normed spaces @@ -12,6 +14,8 @@ In this file, we define classes for fields and groups that are both normed and o These are mostly useful to avoid diamonds during type class inference. -/ +@[expose] public section + open Filter Set diff --git a/Mathlib/Analysis/Normed/Order/Hom/Basic.lean b/Mathlib/Analysis/Normed/Order/Hom/Basic.lean index 85991f83f7d3bf..1d6dd1ae5e6255 100644 --- a/Mathlib/Analysis/Normed/Order/Hom/Basic.lean +++ b/Mathlib/Analysis/Normed/Order/Hom/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Order.Hom.Basic -import Mathlib.Analysis.Normed.Group.Basic +module + +public import Mathlib.Algebra.Order.Hom.Basic +public import Mathlib.Analysis.Normed.Group.Basic /-! # Constructing (semi)normed groups from (semi)normed homs @@ -16,6 +18,8 @@ See `Mathlib/Analysis/Normed/Order/Hom/Ultra.lean` for further upgrades to nonar groups. -/ +@[expose] public section + variable {F α : Type*} [FunLike F α ℝ] /-- Constructs a `SeminormedGroup` structure from a `GroupSeminormClass` on a `Group`. -/ diff --git a/Mathlib/Analysis/Normed/Order/Hom/Ultra.lean b/Mathlib/Analysis/Normed/Order/Hom/Ultra.lean index 37f55025acaf73..3581fdd5df2a1e 100644 --- a/Mathlib/Analysis/Normed/Order/Hom/Ultra.lean +++ b/Mathlib/Analysis/Normed/Order/Hom/Ultra.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Analysis.Normed.Order.Hom.Basic -import Mathlib.Topology.MetricSpace.Ultra.Basic +module + +public import Mathlib.Analysis.Normed.Order.Hom.Basic +public import Mathlib.Topology.MetricSpace.Ultra.Basic /-! # Constructing nonarchimedean (ultrametric) normed groups from nonarchimedean normed homs @@ -20,6 +22,8 @@ hom-based `AddGroupSeminormClass.toSeminormedAddGroup f` construction. To help a the argument is an autoparam that resolves by definitional equality when using these constructions. -/ +@[expose] public section + variable {F α : Type*} [FunLike F α ℝ] /-- Proves that when a `SeminormedAddGroup` structure is constructed from an diff --git a/Mathlib/Analysis/Normed/Order/Lattice.lean b/Mathlib/Analysis/Normed/Order/Lattice.lean index 928ffb1e705c3f..e618cc261d4b19 100644 --- a/Mathlib/Analysis/Normed/Order/Lattice.lean +++ b/Mathlib/Analysis/Normed/Order/Lattice.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Analysis.Normed.Group.Constructions -import Mathlib.Analysis.Normed.Group.Rat -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Topology.Order.Lattice +module + +public import Mathlib.Analysis.Normed.Group.Constructions +public import Mathlib.Analysis.Normed.Group.Rat +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Topology.Order.Lattice /-! # Normed lattice ordered groups @@ -28,6 +30,8 @@ topology. normed, lattice, ordered, group -/ +@[expose] public section + /-! ### Normed lattice ordered groups diff --git a/Mathlib/Analysis/Normed/Order/UpperLower.lean b/Mathlib/Analysis/Normed/Order/UpperLower.lean index 89bf012ca607b2..77f48db0693b7a 100644 --- a/Mathlib/Analysis/Normed/Order/UpperLower.lean +++ b/Mathlib/Analysis/Normed/Order/UpperLower.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Field.Pi -import Mathlib.Algebra.Order.Pi -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.Analysis.Normed.Group.Pointwise -import Mathlib.Topology.Algebra.Order.UpperLower -import Mathlib.Topology.MetricSpace.Sequences +module + +public import Mathlib.Algebra.Order.Field.Pi +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.Analysis.Normed.Group.Pointwise +public import Mathlib.Topology.Algebra.Order.UpperLower +public import Mathlib.Topology.MetricSpace.Sequences /-! # Upper/lower/order-connected sets in normed groups @@ -28,6 +30,8 @@ from the other possible lemmas, but we will want there to be a single set of lem situations. -/ +@[expose] public section + open Bornology Function Metric Set open scoped Pointwise diff --git a/Mathlib/Analysis/Normed/Ring/Basic.lean b/Mathlib/Analysis/Normed/Ring/Basic.lean index 1b77b9f20575cf..8f40e8d81462c9 100644 --- a/Mathlib/Analysis/Normed/Ring/Basic.lean +++ b/Mathlib/Analysis/Normed/Ring/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Analysis.Normed.Group.Constructions -import Mathlib.Analysis.Normed.Group.Subgroup -import Mathlib.Analysis.Normed.Group.Submodule +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Analysis.Normed.Group.Constructions +public import Mathlib.Analysis.Normed.Group.Subgroup +public import Mathlib.Analysis.Normed.Group.Submodule /-! # Normed rings @@ -17,6 +19,8 @@ A normed ring instance can be constructed from a given real absolute value on a `AbsoluteValue.toNormedRing`. -/ +@[expose] public section + -- Guard against import creep. assert_not_exists AddChar comap_norm_atTop DilationEquiv Finset.sup_mul_le_mul_sup_of_nonneg IsOfFinOrder Isometry.norm_map_of_map_one NNReal.isOpen_Ico_zero Rat.norm_cast_real diff --git a/Mathlib/Analysis/Normed/Ring/Finite.lean b/Mathlib/Analysis/Normed/Ring/Finite.lean index bfe6e0b249afb4..decf73da8bd972 100644 --- a/Mathlib/Analysis/Normed/Ring/Finite.lean +++ b/Mathlib/Analysis/Normed/Ring/Finite.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.Algebra.Group.AddChar -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.Analysis.Normed.Ring.Basic +module + +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.Analysis.Normed.Ring.Basic /-! @@ -18,6 +20,8 @@ The values of additive characters on finite cancellative monoids have norm 1. -/ +@[expose] public section + variable {α β : Type*} section NormedRing diff --git a/Mathlib/Analysis/Normed/Ring/InfiniteSum.lean b/Mathlib/Analysis/Normed/Ring/InfiniteSum.lean index 6b4d4a00924656..3dfea978819e06 100644 --- a/Mathlib/Analysis/Normed/Ring/InfiniteSum.lean +++ b/Mathlib/Analysis/Normed/Ring/InfiniteSum.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Analysis.Normed.Group.InfiniteSum -import Mathlib.Topology.Algebra.InfiniteSum.Real -import Mathlib.Analysis.Normed.Ring.Lemmas +module + +public import Mathlib.Analysis.Normed.Group.InfiniteSum +public import Mathlib.Topology.Algebra.InfiniteSum.Real +public import Mathlib.Analysis.Normed.Ring.Lemmas /-! # Multiplying two infinite sums in a normed ring @@ -18,6 +20,8 @@ We first establish results about arbitrary index types, `ι` and `ι'`, and then (see `tsum_mul_tsum_eq_tsum_sum_antidiagonal_of_summable_norm`). -/ +@[expose] public section + variable {R : Type*} {ι : Type*} {ι' : Type*} [NormedRing R] diff --git a/Mathlib/Analysis/Normed/Ring/Int.lean b/Mathlib/Analysis/Normed/Ring/Int.lean index 5e87f05b81186b..3822bd1514b37b 100644 --- a/Mathlib/Analysis/Normed/Ring/Int.lean +++ b/Mathlib/Analysis/Normed/Ring/Int.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Analysis.Normed.Ring.Lemmas +module + +public import Mathlib.Analysis.Normed.Ring.Lemmas /-! # The integers as normed ring @@ -16,6 +18,8 @@ to obtain a term of type `NNReal` (the nonnegative real numbers). The resulting nonnegative real number is denoted by `‖n‖₊`. -/ +@[expose] public section + namespace Int diff --git a/Mathlib/Analysis/Normed/Ring/Lemmas.lean b/Mathlib/Analysis/Normed/Ring/Lemmas.lean index 5752f0bbbf16d8..c9058ab26ea7bb 100644 --- a/Mathlib/Analysis/Normed/Ring/Lemmas.lean +++ b/Mathlib/Analysis/Normed/Ring/Lemmas.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ -import Mathlib.Algebra.Order.GroupWithZero.Finset -import Mathlib.Analysis.Normed.Group.Bounded -import Mathlib.Analysis.Normed.Group.Int -import Mathlib.Analysis.Normed.Group.Uniform -import Mathlib.Analysis.Normed.Ring.Basic -import Mathlib.Topology.MetricSpace.Dilation +module + +public import Mathlib.Algebra.Order.GroupWithZero.Finset +public import Mathlib.Analysis.Normed.Group.Bounded +public import Mathlib.Analysis.Normed.Group.Int +public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Analysis.Normed.Ring.Basic +public import Mathlib.Topology.MetricSpace.Dilation /-! # Normed rings @@ -16,6 +18,8 @@ import Mathlib.Topology.MetricSpace.Dilation In this file we continue building the theory of (semi)normed rings. -/ +@[expose] public section + variable {α : Type*} {β : Type*} {ι : Type*} open Filter Bornology diff --git a/Mathlib/Analysis/Normed/Ring/Ultra.lean b/Mathlib/Analysis/Normed/Ring/Ultra.lean index de7c1f8ea839cc..20ff754f65370b 100644 --- a/Mathlib/Analysis/Normed/Ring/Ultra.lean +++ b/Mathlib/Analysis/Normed/Ring/Ultra.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Analysis.Normed.Ring.Basic -import Mathlib.Analysis.Normed.Group.Ultra +module + +public import Mathlib.Analysis.Normed.Ring.Basic +public import Mathlib.Analysis.Normed.Group.Ultra /-! # Ultrametric norms on rings where the norm of one is one @@ -35,6 +37,8 @@ Instead, we use weakest pre-existing typeclass that implies both ultrametric, nonarchimedean -/ + +@[expose] public section open Metric NNReal namespace IsUltrametricDist diff --git a/Mathlib/Analysis/Normed/Ring/Units.lean b/Mathlib/Analysis/Normed/Ring/Units.lean index e1982a32a5780e..397d2551aa0927 100644 --- a/Mathlib/Analysis/Normed/Ring/Units.lean +++ b/Mathlib/Analysis/Normed/Ring/Units.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.Topology.Algebra.Ring.Ideal -import Mathlib.RingTheory.Ideal.Nonunits +module + +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.Topology.Algebra.Ring.Ideal +public import Mathlib.RingTheory.Ideal.Nonunits /-! # The group of units of a complete normed ring @@ -28,6 +30,8 @@ unit and `0` if not. The other major results of this file (notably `NormedRing. properties of `Ring.inverse (x + t)` as `t → 0`. -/ +@[expose] public section + noncomputable section open Topology diff --git a/Mathlib/Analysis/Normed/Ring/WithAbs.lean b/Mathlib/Analysis/Normed/Ring/WithAbs.lean index ce1b3fbe291929..6f39812a98de2d 100644 --- a/Mathlib/Analysis/Normed/Ring/WithAbs.lean +++ b/Mathlib/Analysis/Normed/Ring/WithAbs.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Salvatore Mercuri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Salvatore Mercuri -/ -import Mathlib.Analysis.Normed.Ring.Basic -import Mathlib.Topology.Algebra.Ring.Basic +module + +public import Mathlib.Analysis.Normed.Ring.Basic +public import Mathlib.Topology.Algebra.Ring.Basic /-! # WithAbs @@ -21,6 +23,8 @@ arise from absolute values. - `WithAbs.ringEquiv v` : The canonical ring equivalence between `WithAbs v` and `R`. -/ +@[expose] public section + open Topology noncomputable section diff --git a/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean b/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean index 87c702303763e0..0b4348e2a9ef67 100644 --- a/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Unbundled.RingSeminorm -import Mathlib.Analysis.Seminorm +module + +public import Mathlib.Analysis.Normed.Unbundled.RingSeminorm +public import Mathlib.Analysis.Seminorm /-! # Algebra norms @@ -22,6 +24,8 @@ We define algebra norms and multiplicative algebra norms. norm, algebra norm -/ +@[expose] public section + /-- An algebra norm on an `R`-algebra `S` is a ring norm on `S` compatible with the action of `R`. -/ structure AlgebraNorm (R : Type*) [SeminormedCommRing R] (S : Type*) [Ring S] [Algebra R S] extends diff --git a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean index 4e44760b0e81ec..20dd397e50e662 100644 --- a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean +++ b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Unbundled.AlgebraNorm -import Mathlib.Analysis.Normed.Unbundled.SeminormFromBounded -import Mathlib.Analysis.Normed.Unbundled.SmoothingSeminorm -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.LinearAlgebra.Finsupp.VectorSpace +module + +public import Mathlib.Analysis.Normed.Unbundled.AlgebraNorm +public import Mathlib.Analysis.Normed.Unbundled.SeminormFromBounded +public import Mathlib.Analysis.Normed.Unbundled.SmoothingSeminorm +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace /-! @@ -38,6 +40,8 @@ at least one power-multiplicative `K`-algebra norm on `L` extending the norm on Basis.norm, nonarchimedean -/ +@[expose] public section + noncomputable section open Finset Module diff --git a/Mathlib/Analysis/Normed/Unbundled/InvariantExtension.lean b/Mathlib/Analysis/Normed/Unbundled/InvariantExtension.lean index 763145aad78c38..5a16a8b9c96989 100644 --- a/Mathlib/Analysis/Normed/Unbundled/InvariantExtension.lean +++ b/Mathlib/Analysis/Normed/Unbundled/InvariantExtension.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Group.Ultra -import Mathlib.Analysis.Normed.Unbundled.FiniteExtension -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +module + +public import Mathlib.Analysis.Normed.Group.Ultra +public import Mathlib.Analysis.Normed.Unbundled.FiniteExtension +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # algNormOfAlgEquiv and invariantExtension @@ -36,6 +38,8 @@ Let `K` be a nonarchimedean normed field and `L/K` be a finite algebraic extensi algNormOfAlgEquiv, invariantExtension, norm, nonarchimedean -/ +@[expose] public section + open scoped NNReal noncomputable section diff --git a/Mathlib/Analysis/Normed/Unbundled/IsPowMulFaithful.lean b/Mathlib/Analysis/Normed/Unbundled/IsPowMulFaithful.lean index 7b7795b83dc49e..40e4096a936d76 100644 --- a/Mathlib/Analysis/Normed/Unbundled/IsPowMulFaithful.lean +++ b/Mathlib/Analysis/Normed/Unbundled/IsPowMulFaithful.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Unbundled.AlgebraNorm -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +module + +public import Mathlib.Analysis.Normed.Unbundled.AlgebraNorm +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity /-! # Equivalent power-multiplicative norms @@ -24,6 +26,8 @@ commutative ring and `f₁` and `f₂` are two power-multiplicative `R`-algebra norm, equivalent, power-multiplicative -/ +@[expose] public section + open Filter Real open scoped Topology diff --git a/Mathlib/Analysis/Normed/Unbundled/RingSeminorm.lean b/Mathlib/Analysis/Normed/Unbundled/RingSeminorm.lean index 21456b48609cc2..bc0771c74ad0df 100644 --- a/Mathlib/Analysis/Normed/Unbundled/RingSeminorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/RingSeminorm.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Yaël Dillies -/ -import Mathlib.Algebra.Order.Ring.IsNonarchimedean -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Analysis.SpecialFunctions.Pow.Real +module + +public import Mathlib.Algebra.Order.Ring.IsNonarchimedean +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! # Seminorms and norms on rings @@ -39,6 +41,8 @@ absolute values. ring_seminorm, ring_norm -/ +@[expose] public section + open NNReal @@ -172,9 +176,7 @@ theorem map_pow_le_pow {F α : Type*} [Ring α] [FunLike F α ℝ] [RingSeminorm | 1, _ => by simp only [pow_one, le_refl] | n + 2, _ => by simp only [pow_succ _ (n + 1)] - exact - le_trans (map_mul_le_mul f _ a) - (mul_le_mul_of_nonneg_right (map_pow_le_pow _ _ n.succ_ne_zero) (apply_nonneg f a)) + grw [map_mul_le_mul, map_pow_le_pow _ _ n.succ_ne_zero] /-- If `f` is a ring seminorm on `a` with `f 1 ≤ 1`, then `∀ (n : ℕ), f (a ^ n) ≤ f a ^ n`. -/ theorem map_pow_le_pow' {F α : Type*} [Ring α] [FunLike F α ℝ] [RingSeminormClass F α ℝ] {f : F} @@ -201,18 +203,15 @@ theorem isBoundedUnder (hp : p 1 ≤ 1) {s : ℕ → ℕ} (hs_le : ∀ n : ℕ, have h_le : ∀ m : ℕ, p (x ^ s (ψ m)) ^ (1 / (ψ m : ℝ)) ≤ p x ^ ((s (ψ m) : ℝ) / (ψ m : ℝ)) := by intro m rw [← mul_one_div (s (ψ m) : ℝ), rpow_mul (apply_nonneg p x), rpow_natCast] - exact rpow_le_rpow (apply_nonneg _ _) (map_pow_le_pow' hp x _) - (one_div_nonneg.mpr (cast_nonneg _)) + grw [map_pow_le_pow' hp x] apply isBoundedUnder_of - by_cases! hfx : p x ≤ 1 - · use 1, fun m => le_trans (h_le m) - (rpow_le_one (apply_nonneg _ _) hfx (div_nonneg (cast_nonneg _) (cast_nonneg _))) - · use p x - intro m - apply le_trans (h_le m) - conv_rhs => rw [← rpow_one (p x)] - exact rpow_le_rpow_of_exponent_le hfx.le - (div_le_one_of_le₀ (cast_le.mpr (hs_le _)) (cast_nonneg _)) + cases le_or_gt (p x) 1 with + | inl hfx => + use 1, fun m ↦ le_trans (h_le m) (rpow_le_one (by positivity) hfx (by positivity)) + | inr hfx => + use p x + refine fun m ↦ le_trans (h_le m) <| rpow_le_self_of_one_le hfx.le ?_ + exact div_le_one_of_le₀ (mod_cast hs_le _) (cast_nonneg _) end RingSeminorm diff --git a/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean b/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean index cbbc467c103fd2..5ccc037b2a1bce 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Unbundled.RingSeminorm +module + +public import Mathlib.Analysis.Normed.Unbundled.RingSeminorm /-! # seminormFromBounded @@ -41,6 +43,8 @@ this condition holds. seminormFromBounded, RingSeminorm, Nonarchimedean -/ +@[expose] public section + noncomputable section open scoped Topology NNReal diff --git a/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean b/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean index 506fd98aa23a85..6f41fd47a7ed4c 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Unbundled.RingSeminorm +module + +public import Mathlib.Analysis.Normed.Unbundled.RingSeminorm /-! # SeminormFromConst @@ -36,6 +38,8 @@ power-multiplicative seminorm for which `c` is multiplicative. SeminormFromConst, Seminorm, Nonarchimedean -/ +@[expose] public section + noncomputable section open Filter diff --git a/Mathlib/Analysis/Normed/Unbundled/SmoothingSeminorm.lean b/Mathlib/Analysis/Normed/Unbundled/SmoothingSeminorm.lean index 06c5efe61bc746..b1b6168dd1403b 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SmoothingSeminorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SmoothingSeminorm.lean @@ -3,17 +3,19 @@ Copyright (c) 2024 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Algebra.Order.GroupWithZero.Bounds -import Mathlib.Analysis.Normed.Unbundled.RingSeminorm -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Topology.MetricSpace.Sequences -import Mathlib.Topology.UnitInterval -import Mathlib.Topology.Algebra.Order.LiminfLimsup +module + +public import Mathlib.Algebra.Order.GroupWithZero.Bounds +public import Mathlib.Analysis.Normed.Unbundled.RingSeminorm +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Topology.MetricSpace.Sequences +public import Mathlib.Topology.UnitInterval +public import Mathlib.Topology.Algebra.Order.LiminfLimsup /-! # smoothingSeminorm -In this file, we prove [BGR, Proposition 1.3.2/1][bosch-guntzer-remmert] : if `μ` is a -nonarchimedean seminorm on a commutative ring `R`, then ` +In this file, we prove [BGR, Proposition 1.3.2/1][bosch-guntzer-remmert]: if `μ` is a +nonarchimedean seminorm on a commutative ring `R`, then `iInf (fun (n : PNat), (μ(x ^ (n : ℕ))) ^ (1 / (n : ℝ)))` is a power-multiplicative nonarchimedean seminorm on `R`. @@ -40,6 +42,8 @@ seminorm on `R`. smoothingSeminorm, seminorm, nonarchimedean -/ +@[expose] public section + noncomputable section open Filter Nat Real diff --git a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean index 8fa8dbf5527ac0..3fc731b6a94ae5 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean @@ -3,14 +3,16 @@ Copyright (c) 2025 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps -import Mathlib.Analysis.Normed.Unbundled.InvariantExtension -import Mathlib.Analysis.Normed.Unbundled.IsPowMulFaithful -import Mathlib.Analysis.Normed.Unbundled.SeminormFromConst -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.FieldTheory.Normal.Closure -import Mathlib.RingTheory.Polynomial.Vieta -import Mathlib.Topology.Algebra.Module.FiniteDimension +module + +public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +public import Mathlib.Analysis.Normed.Unbundled.InvariantExtension +public import Mathlib.Analysis.Normed.Unbundled.IsPowMulFaithful +public import Mathlib.Analysis.Normed.Unbundled.SeminormFromConst +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.FieldTheory.Normal.Closure +public import Mathlib.RingTheory.Polynomial.Vieta +public import Mathlib.Topology.Algebra.Module.FiniteDimension /-! # The spectral norm and the norm extension theorem @@ -75,6 +77,8 @@ As a prerequisite, we formalize the proof of [S. Bosch, U. Güntzer, R. Remmert, spectral, spectral norm, spectral value, seminorm, norm, nonarchimedean -/ +@[expose] public section + open Polynomial open scoped Polynomial diff --git a/Mathlib/Analysis/NormedSpace/Alternating/Basic.lean b/Mathlib/Analysis/NormedSpace/Alternating/Basic.lean index 4b579720e0c0b1..b01da9acd0bc66 100644 --- a/Mathlib/Analysis/NormedSpace/Alternating/Basic.lean +++ b/Mathlib/Analysis/NormedSpace/Alternating/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov, Heather Macbeth, Patrick Massot -/ -import Mathlib.Topology.Algebra.Module.Alternating.Topology -import Mathlib.Analysis.NormedSpace.Multilinear.Basic +module + +public import Mathlib.Topology.Algebra.Module.Alternating.Topology +public import Mathlib.Analysis.NormedSpace.Multilinear.Basic /-! # Operator norm on the space of continuous alternating maps @@ -17,6 +19,8 @@ and define bundled versions of some operations on continuous alternating maps. Most proofs just invoke the corresponding fact about continuous multilinear maps. -/ +@[expose] public section + noncomputable section open scoped BigOperators NNReal diff --git a/Mathlib/Analysis/NormedSpace/Alternating/Curry.lean b/Mathlib/Analysis/NormedSpace/Alternating/Curry.lean index 0da6b265d7c4ca..3e40de376c86b9 100644 --- a/Mathlib/Analysis/NormedSpace/Alternating/Curry.lean +++ b/Mathlib/Analysis/NormedSpace/Alternating/Curry.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Eric Wieser -/ -import Mathlib.LinearAlgebra.Alternating.Curry -import Mathlib.Analysis.NormedSpace.Alternating.Basic -import Mathlib.Analysis.NormedSpace.Multilinear.Curry +module + +public import Mathlib.LinearAlgebra.Alternating.Curry +public import Mathlib.Analysis.NormedSpace.Alternating.Basic +public import Mathlib.Analysis.NormedSpace.Multilinear.Curry /-! # Currying continuous alternating forms @@ -16,6 +18,8 @@ as a continuous linear map in the 0th variable taking values in the continuous alternating maps in `n` variables. -/ +@[expose] public section + variable {𝕜 E F G : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] diff --git a/Mathlib/Analysis/NormedSpace/Alternating/Uncurry/Fin.lean b/Mathlib/Analysis/NormedSpace/Alternating/Uncurry/Fin.lean index 607017e82a4a6c..296fe1b252e75e 100644 --- a/Mathlib/Analysis/NormedSpace/Alternating/Uncurry/Fin.lean +++ b/Mathlib/Analysis/NormedSpace/Alternating/Uncurry/Fin.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.NormedSpace.Alternating.Curry -import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin +module + +public import Mathlib.Analysis.NormedSpace.Alternating.Curry +public import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin /-! # Uncurrying continuous alternating maps @@ -41,6 +43,8 @@ The latter theorem will be used to prove that the second exterior derivative of a differential form is zero. -/ +@[expose] public section + open Fin Function namespace ContinuousAlternatingMap diff --git a/Mathlib/Analysis/NormedSpace/BallAction.lean b/Mathlib/Analysis/NormedSpace/BallAction.lean index c0d630f609b7c1..e231367f4abe3d 100644 --- a/Mathlib/Analysis/NormedSpace/BallAction.lean +++ b/Mathlib/Analysis/NormedSpace/BallAction.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.Ball.Action +module + +public import Mathlib.Analysis.Normed.Module.Ball.Action deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean b/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean index c8954cb6f208ea..4b92bc787969c4 100644 --- a/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean +++ b/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Conformal +module + +public import Mathlib.Analysis.Normed.Operator.Conformal deprecated_module (since := "2025-09-16") diff --git a/Mathlib/Analysis/NormedSpace/Connected.lean b/Mathlib/Analysis/NormedSpace/Connected.lean index ee7181d19dbbc8..cec580a5666af6 100644 --- a/Mathlib/Analysis/NormedSpace/Connected.lean +++ b/Mathlib/Analysis/NormedSpace/Connected.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Convex.Contractible -import Mathlib.Analysis.Convex.Topology -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.Topology.Algebra.Module.Cardinality +module + +public import Mathlib.Analysis.Convex.Contractible +public import Mathlib.Analysis.Convex.Topology +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.Topology.Algebra.Module.Cardinality /-! # Connectedness of subsets of vector spaces @@ -24,6 +26,8 @@ We show several results related to the (path)-connectedness of subsets of real v Statements with connectedness instead of path-connectedness are also given. -/ +@[expose] public section + assert_not_exists Subgroup.index Nat.divisors -- TODO assert_not_exists Cardinal diff --git a/Mathlib/Analysis/NormedSpace/DualNumber.lean b/Mathlib/Analysis/NormedSpace/DualNumber.lean index 07e2bfb0844915..56b96cd03c8bd4 100644 --- a/Mathlib/Analysis/NormedSpace/DualNumber.lean +++ b/Mathlib/Analysis/NormedSpace/DualNumber.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Algebra.DualNumber +module + +public import Mathlib.Analysis.Normed.Algebra.DualNumber deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/ENormedSpace.lean b/Mathlib/Analysis/NormedSpace/ENormedSpace.lean index c0b782e45d2ebc..a8f4feb4b825d9 100644 --- a/Mathlib/Analysis/NormedSpace/ENormedSpace.lean +++ b/Mathlib/Analysis/NormedSpace/ENormedSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # Extended norm @@ -37,6 +39,8 @@ We do not define extended normed groups. They can be added to the chain once som normed space, extended norm -/ +@[expose] public section + noncomputable section @@ -156,23 +160,19 @@ theorem top_map {x : V} (hx : x ≠ 0) : (⊤ : ENormedSpace 𝕜 V) x = ⊤ := if_neg hx noncomputable instance : OrderTop (ENormedSpace 𝕜 V) where - top := ⊤ le_top e x := by obtain h | h := eq_or_ne x 0 <;> simp [top_map, h] -noncomputable instance : SemilatticeSup (ENormedSpace 𝕜 V) := - { ENormedSpace.partialOrder with - le := (· ≤ ·) - lt := (· < ·) - sup := fun e₁ e₂ => - { toFun := fun x => max (e₁ x) (e₂ x) - eq_zero' := fun _ h => e₁.eq_zero_iff.1 (ENNReal.max_eq_zero_iff.1 h).1 - map_add_le' := fun _ _ => - max_le (le_trans (e₁.map_add_le _ _) <| add_le_add (le_max_left _ _) (le_max_left _ _)) - (le_trans (e₂.map_add_le _ _) <| add_le_add (le_max_right _ _) (le_max_right _ _)) - map_smul_le' := fun c x => le_of_eq <| by simp only [map_smul, mul_max] } - le_sup_left := fun _ _ _ => le_max_left _ _ - le_sup_right := fun _ _ _ => le_max_right _ _ - sup_le := fun _ _ _ h₁ h₂ x => max_le (h₁ x) (h₂ x) } +noncomputable instance : SemilatticeSup (ENormedSpace 𝕜 V) where + sup := fun e₁ e₂ => + { toFun := fun x => max (e₁ x) (e₂ x) + eq_zero' := fun _ h => e₁.eq_zero_iff.1 (ENNReal.max_eq_zero_iff.1 h).1 + map_add_le' := fun _ _ => + max_le (le_trans (e₁.map_add_le _ _) <| add_le_add (le_max_left _ _) (le_max_left _ _)) + (le_trans (e₂.map_add_le _ _) <| add_le_add (le_max_right _ _) (le_max_right _ _)) + map_smul_le' := fun c x => le_of_eq <| by simp only [map_smul, mul_max] } + le_sup_left := fun _ _ _ => le_max_left _ _ + le_sup_right := fun _ _ _ => le_max_right _ _ + sup_le := fun _ _ _ h₁ h₂ x => max_le (h₁ x) (h₂ x) @[deprecated "Use ENormedAddCommMonoid or talk to the Carleson project" (since := "2025-05-07"), simp, norm_cast] diff --git a/Mathlib/Analysis/NormedSpace/Extend.lean b/Mathlib/Analysis/NormedSpace/Extend.lean index 7259302df45da4..25efc47554a22f 100644 --- a/Mathlib/Analysis/NormedSpace/Extend.lean +++ b/Mathlib/Analysis/NormedSpace/Extend.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.RCLike.Extend +module + +public import Mathlib.Analysis.Normed.Module.RCLike.Extend deprecated_module (since := "2025-09-18") diff --git a/Mathlib/Analysis/NormedSpace/Extr.lean b/Mathlib/Analysis/NormedSpace/Extr.lean index 24d425cec7ef6e..5bef23175b9774 100644 --- a/Mathlib/Analysis/NormedSpace/Extr.lean +++ b/Mathlib/Analysis/NormedSpace/Extr.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.Ray -import Mathlib.Topology.Order.LocalExtr +module + +public import Mathlib.Analysis.Normed.Module.Ray +public import Mathlib.Topology.Order.LocalExtr /-! # (Local) maximums in a normed space @@ -21,6 +23,8 @@ Then we specialize it to the case `y = f c` and to different special cases of `I local maximum, normed space -/ +@[expose] public section + variable {α X E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] [TopologicalSpace X] diff --git a/Mathlib/Analysis/NormedSpace/FunctionSeries.lean b/Mathlib/Analysis/NormedSpace/FunctionSeries.lean index 838e3afb0b4e22..b855fb5c95afec 100644 --- a/Mathlib/Analysis/NormedSpace/FunctionSeries.lean +++ b/Mathlib/Analysis/NormedSpace/FunctionSeries.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Group.FunctionSeries +module + +public import Mathlib.Analysis.Normed.Group.FunctionSeries deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/HomeomorphBall.lean b/Mathlib/Analysis/NormedSpace/HomeomorphBall.lean index e74ed6c395e153..81877a20e333e6 100644 --- a/Mathlib/Analysis/NormedSpace/HomeomorphBall.lean +++ b/Mathlib/Analysis/NormedSpace/HomeomorphBall.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.Ball.Homeomorph +module + +public import Mathlib.Analysis.Normed.Module.Ball.Homeomorph deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/IndicatorFunction.lean b/Mathlib/Analysis/NormedSpace/IndicatorFunction.lean index e7122dc00a860a..77e37830b8684f 100644 --- a/Mathlib/Analysis/NormedSpace/IndicatorFunction.lean +++ b/Mathlib/Analysis/NormedSpace/IndicatorFunction.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Group.Indicator +module + +public import Mathlib.Analysis.Normed.Group.Indicator deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/Int.lean b/Mathlib/Analysis/NormedSpace/Int.lean index 2a358e9d1c29c0..4ccf3347d85258 100644 --- a/Mathlib/Analysis/NormedSpace/Int.lean +++ b/Mathlib/Analysis/NormedSpace/Int.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Ring.Int +module + +public import Mathlib.Analysis.Normed.Ring.Int deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/MStructure.lean b/Mathlib/Analysis/NormedSpace/MStructure.lean index 223b5ff7892c80..fb161dd98cba57 100644 --- a/Mathlib/Analysis/NormedSpace/MStructure.lean +++ b/Mathlib/Analysis/NormedSpace/MStructure.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.Ring.Idempotent -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Order.Basic -import Mathlib.Tactic.NoncommRing +module + +public import Mathlib.Algebra.Ring.Idempotent +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Order.Basic +public import Mathlib.Tactic.NoncommRing /-! # M-structure @@ -59,6 +61,8 @@ M-summand, M-projection, L-summand, L-projection, M-ideal, M-structure -/ +@[expose] public section + variable (X : Type*) [NormedAddCommGroup X] variable {M : Type*} [Ring M] [Module M X] diff --git a/Mathlib/Analysis/NormedSpace/Multilinear/Basic.lean b/Mathlib/Analysis/NormedSpace/Multilinear/Basic.lean index 94f417ca261864..6c02a0825b8a1f 100644 --- a/Mathlib/Analysis/NormedSpace/Multilinear/Basic.lean +++ b/Mathlib/Analysis/NormedSpace/Multilinear/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Sophie Morel, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.Logic.Embedding.Basic -import Mathlib.Data.Fintype.CardEmbedding -import Mathlib.Topology.Algebra.MetricSpace.Lipschitz -import Mathlib.Topology.Algebra.Module.Multilinear.Topology +module + +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Logic.Embedding.Basic +public import Mathlib.Data.Fintype.CardEmbedding +public import Mathlib.Topology.Algebra.MetricSpace.Lipschitz +public import Mathlib.Topology.Algebra.Module.Multilinear.Topology /-! # Operator norm on the space of continuous multilinear maps @@ -44,6 +46,8 @@ the final result is independent of the order. While everything could be done fol approach, it turns out that direct proofs are easier and more efficient. -/ +@[expose] public section + suppress_compilation noncomputable section diff --git a/Mathlib/Analysis/NormedSpace/Multilinear/Curry.lean b/Mathlib/Analysis/NormedSpace/Multilinear/Curry.lean index 64415e985ab767..21183b826203f4 100644 --- a/Mathlib/Analysis/NormedSpace/Multilinear/Curry.lean +++ b/Mathlib/Analysis/NormedSpace/Multilinear/Curry.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.NormedSpace.Multilinear.Basic -import Mathlib.LinearAlgebra.Multilinear.Curry +module + +public import Mathlib.Analysis.NormedSpace.Multilinear.Basic +public import Mathlib.LinearAlgebra.Multilinear.Curry /-! # Currying and uncurrying continuous multilinear maps @@ -28,6 +30,8 @@ We also register continuous linear equiv versions of these correspondences, in `ContinuousMultilinearMap.curryMidEquiv` -/ +@[expose] public section + suppress_compilation noncomputable section diff --git a/Mathlib/Analysis/NormedSpace/MultipliableUniformlyOn.lean b/Mathlib/Analysis/NormedSpace/MultipliableUniformlyOn.lean index 39ec90386c1fa2..7e10b380ec9c69 100644 --- a/Mathlib/Analysis/NormedSpace/MultipliableUniformlyOn.lean +++ b/Mathlib/Analysis/NormedSpace/MultipliableUniformlyOn.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Normed.Group.FunctionSeries -import Mathlib.Analysis.SpecialFunctions.Log.Summable -import Mathlib.Topology.Algebra.InfiniteSum.UniformOn -import Mathlib.Topology.Algebra.IsUniformGroup.Order +module + +public import Mathlib.Analysis.Normed.Group.FunctionSeries +public import Mathlib.Analysis.SpecialFunctions.Log.Summable +public import Mathlib.Topology.Algebra.InfiniteSum.UniformOn +public import Mathlib.Topology.Algebra.IsUniformGroup.Order /-! # Uniform convergence of products of functions @@ -15,6 +17,8 @@ We gather some results about the uniform convergence of infinite products, in pa the form `∏' i, (1 + f i x)` for a sequence `f` of complex-valued functions. -/ +@[expose] public section + open Filter Function Complex Finset Topology variable {α ι : Type*} {𝔖 : Set (Set α)} {K : Set α} {u : ι → ℝ} diff --git a/Mathlib/Analysis/NormedSpace/Normalize.lean b/Mathlib/Analysis/NormedSpace/Normalize.lean index ad566d855290ff..6b8680375ba4c4 100644 --- a/Mathlib/Analysis/NormedSpace/Normalize.lean +++ b/Mathlib/Analysis/NormedSpace/Normalize.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Ilmārs Cīrulis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ilmārs Cīrulis, Alex Meiburg -/ -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Data.Sign.Defs +module + +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Data.Sign.Defs /-! # Normalized vector @@ -14,6 +16,8 @@ Function that returns unit length vector that points in the same direction (if the given vector is zero vector). -/ +@[expose] public section + variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- For a nonzero vector `x`, `normalize x` is the unit-length vector that points diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/Asymptotics.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/Asymptotics.lean index dd2b4b467c8da0..c5758a44f3659b 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/Asymptotics.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/Asymptotics.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Asymptotics +module + +public import Mathlib.Analysis.Normed.Operator.Asymptotics deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/Basic.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/Basic.lean index 0711cefa48b98a..aca699e7377be7 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/Basic.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/Basic.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Basic +module + +public import Mathlib.Analysis.Normed.Operator.Basic deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/Bilinear.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/Bilinear.lean index f557c2fbc0f2b1..cf29dd8fd21eea 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/Bilinear.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/Bilinear.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Bilinear +module + +public import Mathlib.Analysis.Normed.Operator.Bilinear deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/Completeness.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/Completeness.lean index 7bf28e8cc74fc6..39d2e5204c6948 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/Completeness.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/Completeness.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Completeness +module + +public import Mathlib.Analysis.Normed.Operator.Completeness deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/Mul.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/Mul.lean index 5e90d105954924..5b2203665ed03f 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/Mul.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/Mul.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Mul +module + +public import Mathlib.Analysis.Normed.Operator.Mul deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/NNNorm.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/NNNorm.lean index be8d68044605b0..8434c866f655ff 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/NNNorm.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/NNNorm.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.NNNorm +module + +public import Mathlib.Analysis.Normed.Operator.NNNorm deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/NormedSpace.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/NormedSpace.lean index c19c1ad5615e03..768740b94d391b 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/NormedSpace.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/NormedSpace.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.NormedSpace +module + +public import Mathlib.Analysis.Normed.Operator.NormedSpace deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/OperatorNorm/Prod.lean b/Mathlib/Analysis/NormedSpace/OperatorNorm/Prod.lean index 610c6dc47ca806..09dacbcc276218 100644 --- a/Mathlib/Analysis/NormedSpace/OperatorNorm/Prod.lean +++ b/Mathlib/Analysis/NormedSpace/OperatorNorm/Prod.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Operator.Prod +module + +public import Mathlib.Analysis.Normed.Operator.Prod deprecated_module (since := "2025-09-03") diff --git a/Mathlib/Analysis/NormedSpace/PiTensorProduct/InjectiveSeminorm.lean b/Mathlib/Analysis/NormedSpace/PiTensorProduct/InjectiveSeminorm.lean index 103e245c82354f..52c3764dd14caf 100644 --- a/Mathlib/Analysis/NormedSpace/PiTensorProduct/InjectiveSeminorm.lean +++ b/Mathlib/Analysis/NormedSpace/PiTensorProduct/InjectiveSeminorm.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Analysis.NormedSpace.PiTensorProduct.ProjectiveSeminorm -import Mathlib.LinearAlgebra.Isomorphisms +module + +public import Mathlib.Analysis.NormedSpace.PiTensorProduct.ProjectiveSeminorm +public import Mathlib.LinearAlgebra.Isomorphisms /-! # Injective seminorm on the tensor of a finite family of normed spaces. @@ -74,6 +76,8 @@ space. -/ +@[expose] public section + universe uι u𝕜 uE uF variable {ι : Type uι} [Fintype ι] @@ -394,9 +398,7 @@ private theorem mapL_add_smul_aux {ι : Type uι} [DecidableEq ι] (i : ι) (u : E i →L[𝕜] E' i) : (fun j ↦ (update f i u j).toLinearMap) = update (fun j ↦ (f j).toLinearMap) i u.toLinearMap := by - symm - rw [update_eq_iff] - grind [Function.update_of_ne, Function.update_self] + grind open Function in protected theorem mapL_add [DecidableEq ι] (i : ι) (u v : E i →L[𝕜] E' i) : diff --git a/Mathlib/Analysis/NormedSpace/PiTensorProduct/ProjectiveSeminorm.lean b/Mathlib/Analysis/NormedSpace/PiTensorProduct/ProjectiveSeminorm.lean index 75e9cb9c3d70f9..6b9e4710e7dd60 100644 --- a/Mathlib/Analysis/NormedSpace/PiTensorProduct/ProjectiveSeminorm.lean +++ b/Mathlib/Analysis/NormedSpace/PiTensorProduct/ProjectiveSeminorm.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Analysis.NormedSpace.Multilinear.Basic -import Mathlib.LinearAlgebra.PiTensorProduct +module + +public import Mathlib.Analysis.NormedSpace.Multilinear.Basic +public import Mathlib.LinearAlgebra.PiTensorProduct /-! # Projective seminorm on the tensor of a finite family of normed spaces. @@ -35,6 +37,8 @@ for every `m` in `Π i, Eᵢ` is bounded above by the projective seminorm. -/ +@[expose] public section + universe uι u𝕜 uE uF variable {ι : Type uι} [Fintype ι] diff --git a/Mathlib/Analysis/NormedSpace/Pointwise.lean b/Mathlib/Analysis/NormedSpace/Pointwise.lean index 2d15fbac2e159e..53aa892f1b0c95 100644 --- a/Mathlib/Analysis/NormedSpace/Pointwise.lean +++ b/Mathlib/Analysis/NormedSpace/Pointwise.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.Ball.Pointwise +module + +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/RCLike.lean b/Mathlib/Analysis/NormedSpace/RCLike.lean index 007e2eac4db46e..7615740fa43f28 100644 --- a/Mathlib/Analysis/NormedSpace/RCLike.lean +++ b/Mathlib/Analysis/NormedSpace/RCLike.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.RCLike.Basic +module + +public import Mathlib.Analysis.Normed.Module.RCLike.Basic deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/Real.lean b/Mathlib/Analysis/NormedSpace/Real.lean index 3ee2025d61872a..95dd4305447356 100644 --- a/Mathlib/Analysis/NormedSpace/Real.lean +++ b/Mathlib/Analysis/NormedSpace/Real.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.RCLike.Real +module + +public import Mathlib.Analysis.Normed.Module.RCLike.Real deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/NormedSpace/RieszLemma.lean b/Mathlib/Analysis/NormedSpace/RieszLemma.lean index 9d33c1e3ff1182..297c387469a2ff 100644 --- a/Mathlib/Analysis/NormedSpace/RieszLemma.lean +++ b/Mathlib/Analysis/NormedSpace/RieszLemma.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Jean Lo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jean Lo, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.RCLike.Real -import Mathlib.Analysis.Seminorm -import Mathlib.Topology.MetricSpace.HausdorffDistance +module + +public import Mathlib.Analysis.Normed.Module.RCLike.Real +public import Mathlib.Analysis.Seminorm +public import Mathlib.Topology.MetricSpace.HausdorffDistance /-! # Applications of the Hausdorff distance in normed spaces @@ -21,6 +23,8 @@ A further lemma, `Metric.closedBall_infDist_compl_subset_closure`, finds a *clos the closure of a set `s` of optimal distance from a point in `x` to the frontier of `s`. -/ +@[expose] public section + open Set Metric diff --git a/Mathlib/Analysis/NormedSpace/SphereNormEquiv.lean b/Mathlib/Analysis/NormedSpace/SphereNormEquiv.lean index 5613db6377ef65..8774680edaa18e 100644 --- a/Mathlib/Analysis/NormedSpace/SphereNormEquiv.lean +++ b/Mathlib/Analysis/NormedSpace/SphereNormEquiv.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Normed.Module.Ball.RadialEquiv +module + +public import Mathlib.Analysis.Normed.Module.Ball.RadialEquiv deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Analysis/ODE/Gronwall.lean b/Mathlib/Analysis/ODE/Gronwall.lean index 2e391496b394df..3f5c210b4d02dc 100644 --- a/Mathlib/Analysis/ODE/Gronwall.lean +++ b/Mathlib/Analysis/ODE/Gronwall.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.ExpDeriv +module + +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv /-! # Grönwall's inequality @@ -27,6 +29,8 @@ Sec. 4.5][HubbardWest-ode], where `norm_le_gronwallBound_of_norm_deriv_right_le` of `K x` and `f x`. -/ +@[expose] public section + open Metric Set Asymptotics Filter Real open scoped Topology NNReal diff --git a/Mathlib/Analysis/ODE/PicardLindelof.lean b/Mathlib/Analysis/ODE/PicardLindelof.lean index 6e1a642f480a7c..fb7d02aa9e4c94 100644 --- a/Mathlib/Analysis/ODE/PicardLindelof.lean +++ b/Mathlib/Analysis/ODE/PicardLindelof.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Winston Yin -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Topology.Algebra.Order.Floor -import Mathlib.Topology.MetricSpace.Contracting +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Topology.Algebra.Order.Floor +public import Mathlib.Topology.MetricSpace.Contracting /-! # Picard-Lindelöf (Cauchy-Lipschitz) Theorem @@ -66,6 +68,8 @@ Cauchy-Lipschitz theorem -/ +@[expose] public section + open Function intervalIntegral MeasureTheory Metric Set open scoped Nat NNReal Topology diff --git a/Mathlib/Analysis/Oscillation.lean b/Mathlib/Analysis/Oscillation.lean index e4411bfde2e57d..32e9d82425e6ef 100644 --- a/Mathlib/Analysis/Oscillation.lean +++ b/Mathlib/Analysis/Oscillation.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 James Sundstrom. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: James Sundstrom -/ -import Mathlib.Data.ENNReal.Real -import Mathlib.Order.WellFoundedSet -import Mathlib.Topology.EMetricSpace.Diam +module + +public import Mathlib.Data.ENNReal.Real +public import Mathlib.Order.WellFoundedSet +public import Mathlib.Topology.EMetricSpace.Diam /-! # Oscillation @@ -24,6 +26,8 @@ at `x` is 0 if and only if `f` is continuous at `x`, with versions for both `osc oscillation, oscillationWithin -/ +@[expose] public section + open Topology EMetric Set ENNReal universe u v diff --git a/Mathlib/Analysis/PSeries.lean b/Mathlib/Analysis/PSeries.lean index 1f51d6406fd80b..57e33070b9b839 100644 --- a/Mathlib/Analysis/PSeries.lean +++ b/Mathlib/Analysis/PSeries.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Analysis.SumOverResidueClass +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Analysis.SumOverResidueClass /-! # Convergence of `p`-series @@ -22,6 +24,8 @@ converges if and only if so does `∑ k, 2 ^ k f (2 ^ k)`. We prove this test in p-series, Cauchy condensation test -/ +@[expose] public section + /-! ### Schlömilch's generalization of the Cauchy condensation test diff --git a/Mathlib/Analysis/PSeriesComplex.lean b/Mathlib/Analysis/PSeriesComplex.lean index 8b17c9f1d83749..0e68619fa88c8d 100644 --- a/Mathlib/Analysis/PSeriesComplex.lean +++ b/Mathlib/Analysis/PSeriesComplex.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Analysis.PSeries -import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Analysis.PSeries +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional /-! # Convergence of `p`-series (complex case) @@ -19,6 +20,8 @@ rather than in `Analysis.PSeries` in order to keep the prerequisites of the form p-series, Cauchy condensation test -/ +@[expose] public section + lemma Complex.summable_one_div_nat_cpow {p : ℂ} : Summable (fun n : ℕ ↦ 1 / (n : ℂ) ^ p) ↔ 1 < re p := by rw [← Real.summable_one_div_nat_rpow, ← summable_nat_add_iff 1 (G := ℝ), diff --git a/Mathlib/Analysis/Polynomial/Basic.lean b/Mathlib/Analysis/Polynomial/Basic.lean index ce8ff298f94d38..d4075f72e8d321 100644 --- a/Mathlib/Analysis/Polynomial/Basic.lean +++ b/Mathlib/Analysis/Polynomial/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Devon Tuma -/ -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +module + +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.Asymptotics.SpecificAsymptotics /-! # Limits related to polynomial and rational functions @@ -20,6 +22,8 @@ functions, depending on the degrees and leading coefficients of the considered polynomials. -/ +@[expose] public section + open Filter Finset Asymptotics diff --git a/Mathlib/Analysis/Polynomial/CauchyBound.lean b/Mathlib/Analysis/Polynomial/CauchyBound.lean index 7f6a1b2506c808..9b46c66f8d7605 100644 --- a/Mathlib/Analysis/Polynomial/CauchyBound.lean +++ b/Mathlib/Analysis/Polynomial/CauchyBound.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ -import Mathlib.Algebra.Order.Field.GeomSum -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.Analysis.Normed.Field.Basic +module + +public import Mathlib.Algebra.Order.Field.GeomSum +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.Analysis.Normed.Field.Basic /-! # Cauchy's bound on polynomial roots. @@ -16,6 +18,8 @@ The bound is given by `Polynomial.cauchyBound`, which for `a_n x^n + a_(n-1) x^( The theorem that this gives a bound to polynomial roots is `Polynomial.IsRoot.norm_lt_cauchyBound`. -/ +@[expose] public section + variable {K : Type*} [NormedDivisionRing K] namespace Polynomial diff --git a/Mathlib/Analysis/Polynomial/Factorization.lean b/Mathlib/Analysis/Polynomial/Factorization.lean index b398e4814cb341..4cbb0ec3eb80fd 100644 --- a/Mathlib/Analysis/Polynomial/Factorization.lean +++ b/Mathlib/Analysis/Polynomial/Factorization.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.Polynomial.Degree.IsMonicOfDegree -import Mathlib.Analysis.Complex.Polynomial.Basic +module + +public import Mathlib.Algebra.Polynomial.Degree.IsMonicOfDegree +public import Mathlib.Analysis.Complex.Polynomial.Basic /-! # Factorization of monic polynomials of given degree @@ -20,6 +22,8 @@ This file contains two main results: a monic polynomial of degree two times another monic factor. -/ +@[expose] public section + namespace Polynomial.IsMonicOfDegree /-- If `f : F[X]` is monic of degree `≥ 1` and `F` is an algebraically closed field, diff --git a/Mathlib/Analysis/Polynomial/MahlerMeasure.lean b/Mathlib/Analysis/Polynomial/MahlerMeasure.lean index a0f458219a05ed..1ec38593814eb4 100644 --- a/Mathlib/Analysis/Polynomial/MahlerMeasure.lean +++ b/Mathlib/Analysis/Polynomial/MahlerMeasure.lean @@ -3,11 +3,11 @@ Copyright (c) 2025 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ +module -import Mathlib.Analysis.Analytic.Polynomial -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic -import Mathlib.MeasureTheory.Integral.CircleAverage +public import Mathlib.Analysis.Analytic.Polynomial +public import Mathlib.Analysis.Complex.JensenFormula +public import Mathlib.Analysis.Complex.Polynomial.Basic /-! # Mahler measure of complex polynomials @@ -26,8 +26,13 @@ properties. - `Polynomial.mahlerMeasure_mul`: the Mahler measure of the product of two polynomials is the product of their Mahler measures. +- `mahlerMeasure_eq_leadingCoeff_mul_prod_roots`: the Mahler measure of a polynomial is the absolute + value of its leading coefficient times the product of the absolute values of its roots lying + outside the unit disk. -/ +@[expose] public section + namespace Polynomial open Real @@ -137,8 +142,119 @@ theorem prod_mahlerMeasure_eq_mahlerMeasure_prod (s : Multiset ℂ[X]) : | empty => simp | cons _ _ ih => simp [mahlerMeasure_mul, ih] -theorem logMahlerMeasure_mul_eq_add_logMahelerMeasure {p q : ℂ[X]} (hpq : p * q ≠ 0) : +theorem logMahlerMeasure_mul_eq_add_logMahlerMeasure {p q : ℂ[X]} (hpq : p * q ≠ 0) : (p * q).logMahlerMeasure = p.logMahlerMeasure + q.logMahlerMeasure := by simp_all [logMahlerMeasure_eq_log_MahlerMeasure, mahlerMeasure_mul, log_mul] +theorem logMahlerMeasure_C_mul {a : ℂ} (ha : a ≠ 0) {p : ℂ[X]} (hp : p ≠ 0) : + (C a * p).logMahlerMeasure = log ‖a‖ + p.logMahlerMeasure := by + rw [logMahlerMeasure_mul_eq_add_logMahlerMeasure (by simp [ha, hp]), logMahlerMeasure_const] + +open MeromorphicOn Metric in +/-- The logarithmic Mahler measure of `X - C z` is the `log⁺` of the absolute value of `z`. -/ +@[simp] +theorem logMahlerMeasure_X_sub_C (z : ℂ) : (X - C z).logMahlerMeasure = log⁺ ‖z‖ := by + rcases eq_or_ne z 0 with rfl | hz₀ + · simp + have hmeroOnB : MeromorphicOn (· - z) (closedBall 0 |1|) := id.sub <| const z + simp_rw [logMahlerMeasure_def, eval_sub, eval_X, eval_C] + rw [circleAverage_log_norm one_ne_zero hmeroOnB, abs_one, + -- get rid of the `meromorphicTrailingCoeffAt` + AnalyticAt.meromorphicTrailingCoeffAt_of_ne_zero (by fun_prop) (by simp [hz₀]), + ← finsum_mem_support] + set B := closedBall (0 : ℂ) 1 + -- separate cases depending on whether z is in the open `ball 0 1` or not + by_cases hzBall : z ∈ ball 0 1 + · have hzdiv1 := divisor_sub_const_self (show z ∈ B by grind [ball_subset_closedBall]) + suffices (fun u ↦ -(divisor (· - z) B u * log ‖u‖)).support = {z} by + simp [this, hzdiv1, posLog_def] + grind [mem_ball_zero_iff, log_nonpos, norm_nonneg] + rw [Function.support_eq_iff] + constructor + · simp_rw [Set.mem_singleton_iff] + intro _ rfl + rw [hzdiv1] + grind [log_eq_zero, norm_eq_zero, mem_ball_zero_iff, norm_nonneg] + · intro _ hu + rw [Set.mem_singleton_iff] at hu + simp [divisor_sub_const_of_ne hu] + · have h1lez : 1 ≤ ‖z‖ := by grind [mem_ball_zero_iff] + suffices (fun u ↦ -(divisor (· - z) B u * log ‖u‖)).support = ∅ by + simp [this, posLog_eq_log_max_one <| norm_nonneg z, h1lez] + rw [Function.support_eq_empty_iff] + ext x + rcases eq_or_ne x z with rfl | hx + · by_cases hB : x ∈ B + · rw [Pi.zero_apply] + grind [log_eq_zero, mem_closedBall_zero_iff] + · simpa using .inl <| Function.locallyFinsuppWithin.apply_eq_zero_of_notMem _ hB + simpa using .inl <| divisor_sub_const_of_ne hx + +@[simp] +theorem logMahlerMeasure_X_add_C (z : ℂ) : (X + C z).logMahlerMeasure = log⁺ ‖z‖ := by + simp [← sub_neg_eq_add, ← map_neg] + +theorem logMahlerMeasure_C_mul_X_add_C {a : ℂ} (ha : a ≠ 0) (b : ℂ) : + (C a * X + C b).logMahlerMeasure = log ‖a‖ + log⁺ ‖a⁻¹ * b‖ := by + rw [show C a * X + C b = C a * (X + C (a⁻¹ * b)) by simp [mul_add, ← map_mul, ha], + logMahlerMeasure_C_mul ha (X_add_C_ne_zero (a⁻¹ * b)), logMahlerMeasure_X_add_C] + +theorem logMahlerMeasure_of_degree_eq_one {p : ℂ[X]} (h : p.degree = 1) : p.logMahlerMeasure = + log ‖p.coeff 1‖ + log⁺ ‖(p.coeff 1)⁻¹ * p.coeff 0‖ := by + rw [eq_X_add_C_of_degree_le_one (le_of_eq h)] + simp [logMahlerMeasure_C_mul_X_add_C (show p.coeff 1 ≠ 0 by exact coeff_ne_zero_of_eq_degree h)] + +/-- The Mahler measure of `X - C z` equals `max 1 ‖z‖`. -/ +@[simp] +theorem mahlerMeasure_X_sub_C (z : ℂ) : (X - C z).mahlerMeasure = max 1 ‖z‖ := by + have := logMahlerMeasure_X_sub_C z + rw [logMahlerMeasure_eq_log_MahlerMeasure] at this + apply_fun exp at this + rwa [posLog_eq_log_max_one (norm_nonneg z), + exp_log (mahlerMeasure_pos_of_ne_zero <| X_sub_C_ne_zero z), + exp_log (lt_of_lt_of_le zero_lt_one <| le_max_left 1 ‖z‖)] at this + +@[simp] +theorem mahlerMeasure_X_add_C (z : ℂ) : (X + C z).mahlerMeasure = max 1 ‖z‖ := by + simp [← sub_neg_eq_add, ← map_neg] + +@[simp] +theorem mahlerMeasure_C_mul_X_add_C {a : ℂ} (ha : a ≠ 0) (b : ℂ) : + (C a * X + C b).mahlerMeasure = max ‖a‖ ‖b‖ := by + simp only [show C a * X + C b = C a * (X + C (a⁻¹ * b)) by simp [mul_add, ← map_mul, ha], + mahlerMeasure_mul, mahlerMeasure_const, ← coe_nnnorm, mahlerMeasure_X_add_C] + norm_cast + simp [mul_max, ha] + +theorem mahlerMeasure_of_degree_eq_one {p : ℂ[X]} (h : p.degree = 1) : + p.mahlerMeasure = max ‖p.coeff 1‖ ‖p.coeff 0‖ := by + rw [eq_X_add_C_of_degree_le_one (le_of_eq h)] + simp [mahlerMeasure_C_mul_X_add_C (show p.coeff 1 ≠ 0 by exact coeff_ne_zero_of_eq_degree h)] + +/-- The logarithmic Mahler measure of a polynomial is the `log` of the absolute value of its leading + coefficient plus the sum of the `log`s of the absolute values of its roots lying outside the unit + disk. -/ +theorem logMahlerMeasure_eq_log_leadingCoeff_add_sum_log_roots (p : ℂ[X]) : p.logMahlerMeasure = + log ‖p.leadingCoeff‖ + (p.roots.map (fun a ↦ log⁺ ‖a‖)).sum := by + by_cases hp : p = 0 + · simp [hp] + have : ∀ x ∈ Multiset.map (fun x ↦ max 1 ‖x‖) p.roots, x ≠ 0 := by grind [Multiset.mem_map] + nth_rw 1 [eq_prod_roots_of_splits_id (IsAlgClosed.splits p)] + rw [logMahlerMeasure_mul_eq_add_logMahlerMeasure (by simp [hp, X_sub_C_ne_zero])] + simp [posLog_eq_log_max_one, logMahlerMeasure_eq_log_MahlerMeasure, + prod_mahlerMeasure_eq_mahlerMeasure_prod, log_multiset_prod this] + +/-- The Mahler measure of a polynomial is the absolute value of its leading coefficient times + the product of the absolute values of its roots lying outside the unit disk. -/ +theorem mahlerMeasure_eq_leadingCoeff_mul_prod_roots (p : ℂ[X]) : p.mahlerMeasure = + ‖p.leadingCoeff‖ * (p.roots.map (fun a ↦ max 1 ‖a‖)).prod := by + by_cases hp : p = 0; + · simp [hp] + have := logMahlerMeasure_eq_log_leadingCoeff_add_sum_log_roots p + rw [logMahlerMeasure_eq_log_MahlerMeasure] at this + apply_fun exp at this + rw [exp_add, exp_log <| mahlerMeasure_pos_of_ne_zero hp, + exp_log <|norm_pos_iff.mpr <| leadingCoeff_ne_zero.mpr hp] at this + simp [this, exp_multiset_sum, posLog_eq_log_max_one, exp_log] + end Polynomial diff --git a/Mathlib/Analysis/Quaternion.lean b/Mathlib/Analysis/Quaternion.lean index 8a36bcb63fefc4..56048a23b1d5e5 100644 --- a/Mathlib/Analysis/Quaternion.lean +++ b/Mathlib/Analysis/Quaternion.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Eric Wieser -/ -import Mathlib.Algebra.Quaternion -import Mathlib.Analysis.InnerProductSpace.Continuous -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Topology.Algebra.Algebra +module + +public import Mathlib.Algebra.Quaternion +public import Mathlib.Analysis.InnerProductSpace.Continuous +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Topology.Algebra.Algebra /-! # Quaternions as a normed algebra @@ -30,6 +32,8 @@ The following notation is available with `open Quaternion` or `open scoped Quate quaternion, normed ring, normed space, normed algebra -/ +@[expose] public section + @[inherit_doc] scoped[Quaternion] notation "ℍ" => Quaternion ℝ @@ -82,7 +86,7 @@ theorem nnnorm_star (a : ℍ) : ‖star a‖₊ = ‖a‖₊ := noncomputable instance : NormedDivisionRing ℍ where dist_eq _ _ := rfl - norm_mul _ _ := by simp [norm_eq_sqrt_real_inner, inner_self] + norm_mul _ _ := by simp_rw [norm_eq_sqrt_real_inner, inner_self]; simp noncomputable instance : NormedAlgebra ℝ ℍ where norm_smul_le := norm_smul_le diff --git a/Mathlib/Analysis/RCLike/Basic.lean b/Mathlib/Analysis/RCLike/Basic.lean index 89fb197c674c81..1d69edd6538d5d 100644 --- a/Mathlib/Analysis/RCLike/Basic.lean +++ b/Mathlib/Analysis/RCLike/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Algebra.Algebra.IsSimpleRing -import Mathlib.Algebra.BigOperators.Balance -import Mathlib.Algebra.Order.BigOperators.Expect -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Analysis.CStarAlgebra.Basic -import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap -import Mathlib.Analysis.Normed.Ring.Finite -import Mathlib.Data.Real.Sqrt +module + +public import Mathlib.Algebra.Algebra.IsSimpleRing +public import Mathlib.Algebra.BigOperators.Balance +public import Mathlib.Algebra.Order.BigOperators.Expect +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Analysis.CStarAlgebra.Basic +public import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap +public import Mathlib.Analysis.Normed.Ring.Finite +public import Mathlib.Data.Real.Sqrt /-! # `RCLike`: a typeclass for ℝ or ℂ @@ -42,6 +44,8 @@ their counterparts in `Mathlib/Analysis/Complex/Basic.lean` (which causes linter A few lemmas requiring heavier imports are in `Mathlib/Analysis/RCLike/Lemmas.lean`. -/ +@[expose] public section + open Fintype open scoped BigOperators ComplexConjugate @@ -235,6 +239,14 @@ theorem smul_im (r : ℝ) (z : K) : im (r • z) = r * im z := by theorem norm_ofReal (r : ℝ) : ‖(r : K)‖ = |r| := norm_algebraMap' K r +@[simp] +theorem re_ofReal_pow (a : ℝ) (n : ℕ) : re ((a : K) ^ n) = a ^ n := by + rw [← ofReal_pow, @ofReal_re] + +@[simp] +theorem im_ofReal_pow (a : ℝ) (n : ℕ) : im ((a : K) ^ n) = 0 := by + rw [← @ofReal_pow, @ofReal_im_ax] + /-! ### Characteristic zero -/ -- see Note [lower instance priority] diff --git a/Mathlib/Analysis/RCLike/BoundedContinuous.lean b/Mathlib/Analysis/RCLike/BoundedContinuous.lean index 41f4bdd58acfef..c1eb9b3c29f0a6 100644 --- a/Mathlib/Analysis/RCLike/BoundedContinuous.lean +++ b/Mathlib/Analysis/RCLike/BoundedContinuous.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Jakob Stiefel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Stiefel -/ -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Analysis.Normed.Operator.NNNorm -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Topology.ContinuousMap.Bounded.Star +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Analysis.Normed.Operator.NNNorm +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Topology.ContinuousMap.Bounded.Star /-! # Results on bounded continuous functions with `RCLike` values -/ +@[expose] public section + open Filter Real RCLike BoundedContinuousFunction open scoped Topology diff --git a/Mathlib/Analysis/RCLike/Extend.lean b/Mathlib/Analysis/RCLike/Extend.lean index 0c2ac58851cd84..efceb11de8aeb5 100644 --- a/Mathlib/Analysis/RCLike/Extend.lean +++ b/Mathlib/Analysis/RCLike/Extend.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Ruben Van de Velde. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ruben Van de Velde -/ -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.Analysis.RCLike.Basic -import Mathlib.LinearAlgebra.Dual.Defs +module + +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.LinearAlgebra.Dual.Defs /-! # Extending an `ℝ`-linear functional to a `𝕜`-linear functional @@ -34,6 +36,8 @@ Alternate forms which operate on `[IsScalarTower ℝ 𝕜 F]` instead are provid -/ +@[expose] public section + open RCLike diff --git a/Mathlib/Analysis/RCLike/Inner.lean b/Mathlib/Analysis/RCLike/Inner.lean index e8a50a7f71832b..884407b3dd4ede 100644 --- a/Mathlib/Analysis/RCLike/Inner.lean +++ b/Mathlib/Analysis/RCLike/Inner.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dilies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dilies -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # L2 inner product of finite sequences @@ -21,6 +23,8 @@ from `RCLike.innerProductSpace`. convention, similarly to `MeasureTheory.average`? -/ +@[expose] public section + open Finset Function Real WithLp open scoped BigOperators ComplexConjugate ComplexOrder InnerProductSpace diff --git a/Mathlib/Analysis/RCLike/Lemmas.lean b/Mathlib/Analysis/RCLike/Lemmas.lean index 98d687d5980574..16a34794faafee 100644 --- a/Mathlib/Analysis/RCLike/Lemmas.lean +++ b/Mathlib/Analysis/RCLike/Lemmas.lean @@ -3,12 +3,16 @@ Copyright (c) 2020 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Topology.Instances.RealVectorSpace +module + +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Topology.Instances.RealVectorSpace /-! # Further lemmas about `RCLike` -/ +@[expose] public section + open scoped Finset variable {K E : Type*} [RCLike K] diff --git a/Mathlib/Analysis/RCLike/TangentCone.lean b/Mathlib/Analysis/RCLike/TangentCone.lean index 131b8aea0303a5..ce6d8a71a021ba 100644 --- a/Mathlib/Analysis/RCLike/TangentCone.lean +++ b/Mathlib/Analysis/RCLike/TangentCone.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Topology.Instances.RealVectorSpace -import Mathlib.Analysis.Calculus.TangentCone.Real +module + +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Topology.Instances.RealVectorSpace +public import Mathlib.Analysis.Calculus.TangentCone.Real /-! # Relationships between unique differentiability over `ℝ` and `ℂ` @@ -13,6 +15,8 @@ A set of unique differentiability for `ℝ` is also a set of unique differentiab (or for a general field satisfying `IsRCLikeNormedField 𝕜`). -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [h𝕜 : IsRCLikeNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedSpace ℝ E] {s : Set E} {x : E} diff --git a/Mathlib/Analysis/Real/Cardinality.lean b/Mathlib/Analysis/Real/Cardinality.lean index 360599d273a755..7286396fa4e0cf 100644 --- a/Mathlib/Analysis/Real/Cardinality.lean +++ b/Mathlib/Analysis/Real/Cardinality.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.Group.Pointwise.Interval -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Data.Rat.Cardinal -import Mathlib.SetTheory.Cardinal.Continuum +module + +public import Mathlib.Algebra.Order.Group.Pointwise.Interval +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Data.Rat.Cardinal +public import Mathlib.SetTheory.Cardinal.Continuum /-! # The cardinality of the reals @@ -40,6 +42,8 @@ We conclude that all intervals with distinct endpoints have cardinality continuu continuum, cardinality, reals, cardinality of the reals -/ +@[expose] public section + open Nat Set diff --git a/Mathlib/Analysis/Real/Hyperreal.lean b/Mathlib/Analysis/Real/Hyperreal.lean index 7e94310d5f9712..ae951382bc6516 100644 --- a/Mathlib/Analysis/Real/Hyperreal.lean +++ b/Mathlib/Analysis/Real/Hyperreal.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Abhimanyu Pallavi Sudhir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Abhimanyu Pallavi Sudhir -/ -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Order.Filter.FilterProduct +module + +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Order.Filter.FilterProduct /-! # Construction of the hyperreal numbers as an ultraproduct of real sequences. -/ +@[expose] public section + open Filter Germ Topology diff --git a/Mathlib/Analysis/Real/OfDigits.lean b/Mathlib/Analysis/Real/OfDigits.lean index b1205f08e43e8e..b68451e2f170ec 100644 --- a/Mathlib/Analysis/Real/OfDigits.lean +++ b/Mathlib/Analysis/Real/OfDigits.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Vasilii Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasilii Nesterov -/ -import Mathlib.Algebra.Order.Floor.Semifield -import Mathlib.Analysis.Normed.Group.FunctionSeries -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.Tactic.Rify +module + +public import Mathlib.Algebra.Order.Floor.Semifield +public import Mathlib.Analysis.Normed.Group.FunctionSeries +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.Tactic.Rify /-! # Representation of reals in positional system @@ -25,6 +27,8 @@ representations of reals as sequences of digits in positional system. * `ofDigits_digits` states that `ofDigits (digits x b) = x`. -/ +@[expose] public section + namespace Real /-- `ofDigits` takes a sequence of digits `(d₀, d₁, ...)` in base `b` and returns the @@ -155,6 +159,30 @@ theorem ofDigits_digits {b : ℕ} [NeZero b] {x : ℝ} (hb : 1 < b) (hx : x ∈ · exact hasSum_ofDigitsTerm_digits x hb hx · exact summable_ofDigitsTerm +/-- A generalization of the identity `0.(9) = 1` to arbitrary positional numeral systems. -/ +theorem ofDigits_const_last_eq_one {b : ℕ} (hb : 1 < b) : + ofDigits (fun _ ↦ (⟨b - 1, Nat.sub_one_lt_of_lt hb⟩ : Fin b)) = 1 := by + simp only [ofDigits, ofDigitsTerm, ← inv_pow] + rw [Summable.tsum_mul_left] + · rw [geom_series_succ _ (by simp [inv_lt_one_iff₀, hb]), + tsum_geometric_of_lt_one (by positivity) (by simp [inv_lt_one_iff₀, hb])] + push_cast [hb] + have : 0 < (b : ℝ) - 1 := by rify at hb; linarith + field_simp + ring + · rw [summable_nat_add_iff (f := fun n ↦ (b : ℝ)⁻¹ ^ n) 1] + apply summable_geometric_of_lt_one (by positivity) (by simp [inv_lt_one_iff₀, hb]) + +theorem ofDigits_SurjOn {b : ℕ} (hb : 1 < b) : + Set.SurjOn (ofDigits (b := b)) Set.univ (Set.Icc 0 1) := by + have : NeZero b := ⟨by grind⟩ + intro y hy + by_cases hy' : y ∈ Set.Ico 0 1 + · use digits y b + simp [ofDigits_digits hb hy'] + · simp only [Set.image_univ, show y = 1 by grind, Set.mem_range] + exact ⟨_, ofDigits_const_last_eq_one hb⟩ + theorem continuous_ofDigits {b : ℕ} : Continuous (@ofDigits b) := by match b with | 0 => fun_prop diff --git a/Mathlib/Analysis/Real/Pi/Bounds.lean b/Mathlib/Analysis/Real/Pi/Bounds.lean index 0e668c3e213d34..cfc3dd60c8d9f0 100644 --- a/Mathlib/Analysis/Real/Pi/Bounds.lean +++ b/Mathlib/Analysis/Real/Pi/Bounds.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Mario Carneiro -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds /-! # Pi @@ -17,6 +19,8 @@ See also `Mathlib/Analysis/Real/Pi/Leibniz.lean` and `Mathlib/Analysis/Real/Pi/W infinite formulas for `π`. -/ +@[expose] public section + open scoped Real namespace Real diff --git a/Mathlib/Analysis/Real/Pi/Chudnovsky.lean b/Mathlib/Analysis/Real/Pi/Chudnovsky.lean index c89a847c9300f6..fc5adf441ecb6c 100644 --- a/Mathlib/Analysis/Real/Pi/Chudnovsky.lean +++ b/Mathlib/Analysis/Real/Pi/Chudnovsky.lean @@ -3,8 +3,11 @@ Copyright (c) 2025 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Batteries.Data.Rat.Float +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Batteries.Data.Rat.Float +meta import Batteries.Data.Rat.Float -- for `#eval` sanity check /-! # Chudnovsky's formula for π @@ -32,6 +35,8 @@ but at present we are a long way off. -/ +@[expose] public section + open scoped Real BigOperators open Nat diff --git a/Mathlib/Analysis/Real/Pi/Irrational.lean b/Mathlib/Analysis/Real/Pi/Irrational.lean index e41aaa481c6483..b394017d516ee3 100644 --- a/Mathlib/Analysis/Real/Pi/Irrational.lean +++ b/Mathlib/Analysis/Real/Pi/Irrational.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Topology.Algebra.Order.Floor -import Mathlib.NumberTheory.Real.Irrational +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Topology.Algebra.Order.Floor +public import Mathlib.NumberTheory.Real.Irrational /-! # `Real.pi` is irrational @@ -32,6 +34,8 @@ The proof idea is as follows. -/ +@[expose] public section + noncomputable section open intervalIntegral MeasureTheory.MeasureSpace Set Polynomial Real diff --git a/Mathlib/Analysis/Real/Pi/Leibniz.lean b/Mathlib/Analysis/Real/Pi/Leibniz.lean index 49bca40fef1c83..53786498ef18ca 100644 --- a/Mathlib/Analysis/Real/Pi/Leibniz.lean +++ b/Mathlib/Analysis/Real/Pi/Leibniz.lean @@ -3,11 +3,15 @@ Copyright (c) 2020 Benjamin Davidson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Benjamin Davidson, Jeremy Tan -/ -import Mathlib.Analysis.Complex.AbelLimit -import Mathlib.Analysis.SpecialFunctions.Complex.Arctan +module + +public import Mathlib.Analysis.Complex.AbelLimit +public import Mathlib.Analysis.SpecialFunctions.Complex.Arctan /-! ### Leibniz's series for `π` -/ +@[expose] public section + namespace Real open Filter Finset diff --git a/Mathlib/Analysis/Real/Pi/Wallis.lean b/Mathlib/Analysis/Real/Pi/Wallis.lean index c0586d8c24b022..b55c4a8e3d704a 100644 --- a/Mathlib/Analysis/Real/Pi/Wallis.lean +++ b/Mathlib/Analysis/Real/Pi/Wallis.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Hanting Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hanting Zhang -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic /-! # The Wallis formula for Pi @@ -29,6 +31,8 @@ algebraic manipulation. * `Real.tendsto_prod_pi_div_two`: the Wallis product formula. -/ +@[expose] public section + open scoped Real Topology Nat diff --git a/Mathlib/Analysis/Real/Spectrum.lean b/Mathlib/Analysis/Real/Spectrum.lean index e8a7bcc11a121a..f674953723a910 100644 --- a/Mathlib/Analysis/Real/Spectrum.lean +++ b/Mathlib/Analysis/Real/Spectrum.lean @@ -3,15 +3,19 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.Topology.Instances.NNReal.Lemmas -import Mathlib.Tactic.ContinuousFunctionalCalculus +module + +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.Topology.Instances.NNReal.Lemmas +public import Mathlib.Tactic.ContinuousFunctionalCalculus /-! # Some lemmas on the spectrum and quasispectrum of elements and positivity -/ +@[expose] public section + namespace SpectrumRestricts open NNReal ENNReal diff --git a/Mathlib/Analysis/Seminorm.lean b/Mathlib/Analysis/Seminorm.lean index 96ede417a4a09f..c553bd746c7030 100644 --- a/Mathlib/Analysis/Seminorm.lean +++ b/Mathlib/Analysis/Seminorm.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Jean Lo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jean Lo, Yaël Dillies, Moritz Doll -/ -import Mathlib.Algebra.Order.Pi -import Mathlib.Analysis.Convex.Function -import Mathlib.Analysis.LocallyConvex.Basic -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Data.Real.Pointwise +module + +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Analysis.Convex.Function +public import Mathlib.Analysis.LocallyConvex.Basic +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Data.Real.Pointwise /-! # Seminorms @@ -34,6 +36,8 @@ For a module over a normed ring: seminorm, locally convex, LCTVS -/ +@[expose] public section + assert_not_exists balancedCore open NormedField Set Filter diff --git a/Mathlib/Analysis/SpecialFunctions/Arsinh.lean b/Mathlib/Analysis/SpecialFunctions/Arsinh.lean index 6421ddebd8668d..cd451706540dba 100644 --- a/Mathlib/Analysis/SpecialFunctions/Arsinh.lean +++ b/Mathlib/Analysis/SpecialFunctions/Arsinh.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 James Arthur. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: James Arthur, Chris Hughes, Shing Tak Lam -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv -import Mathlib.Analysis.SpecialFunctions.Log.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +public import Mathlib.Analysis.SpecialFunctions.Log.Basic /-! # Inverse of the sinh function @@ -35,6 +37,8 @@ inverse, arsinh. arsinh, arcsinh, argsinh, asinh, sinh injective, sinh bijective, sinh surjective -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Bernstein.lean b/Mathlib/Analysis/SpecialFunctions/Bernstein.lean index c925804d78ca75..54784039bfc4f9 100644 --- a/Mathlib/Analysis/SpecialFunctions/Bernstein.lean +++ b/Mathlib/Analysis/SpecialFunctions/Bernstein.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.Convex.Gauge -import Mathlib.Analysis.Normed.Order.Lattice -import Mathlib.RingTheory.Polynomial.Bernstein -import Mathlib.Topology.Algebra.Module.LocallyConvex -import Mathlib.Topology.ContinuousMap.Polynomial +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.Convex.Gauge +public import Mathlib.Analysis.Normed.Order.Lattice +public import Mathlib.RingTheory.Polynomial.Bernstein +public import Mathlib.Topology.Algebra.Module.LocallyConvex +public import Mathlib.Topology.ContinuousMap.Polynomial /-! # Bernstein approximations and Weierstrass' theorem @@ -48,6 +50,8 @@ This result proves Weierstrass' theorem that polynomials are dense in `C([0,1], although we defer an abstract statement of this until later. -/ +@[expose] public section + noncomputable section open Filter @@ -76,7 +80,7 @@ open Lean Meta Qq Function /-- Extension of the `positivity` tactic for Bernstein polynomials: they are always non-negative. -/ @[positivity DFunLike.coe (bernstein _ _) _] -def evalBernstein : PositivityExt where eval {_ _} _zα _pα e := do +meta def evalBernstein : PositivityExt where eval {_ _} _zα _pα e := do let .app (.app _coe (.app (.app _ n) ν)) x ← whnfR e | throwError "not bernstein polynomial" let p ← mkAppOptM ``bernstein_nonneg #[n, ν, x] pure (.nonnegative p) diff --git a/Mathlib/Analysis/SpecialFunctions/BinaryEntropy.lean b/Mathlib/Analysis/SpecialFunctions/BinaryEntropy.lean index f91b953b5b54b9..a2616df355a611 100644 --- a/Mathlib/Analysis/SpecialFunctions/BinaryEntropy.lean +++ b/Mathlib/Analysis/SpecialFunctions/BinaryEntropy.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Adomas Baliuka. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adomas Baliuka -/ -import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog -import Mathlib.Analysis.Convex.SpecificFunctions.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +public import Mathlib.Analysis.Convex.SpecificFunctions.Basic /-! # Properties of Shannon q-ary entropy and binary entropy functions @@ -48,6 +50,8 @@ The functions are also defined outside the interval `Icc 0 1` due to `log x = lo entropy, Shannon, binary, nit, nepit -/ +@[expose] public section + namespace Real variable {q : ℕ} {p : ℝ} diff --git a/Mathlib/Analysis/SpecialFunctions/Choose.lean b/Mathlib/Analysis/SpecialFunctions/Choose.lean index 5d937359db4045..d438efd5f1ef40 100644 --- a/Mathlib/Analysis/SpecialFunctions/Choose.lean +++ b/Mathlib/Analysis/SpecialFunctions/Choose.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Horner -/ -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Data.Nat.Cast.Field +module + +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Data.Nat.Cast.Field /-! # Binomial coefficients and factorial variants @@ -19,6 +21,8 @@ This file proves asymptotic theorems for binomial coefficients and factorial var * `isTheta_choose` is the proof that `n.choose k = Θ(n^k)` as `n → ∞`. -/ +@[expose] public section + open Asymptotics Filter Nat Topology diff --git a/Mathlib/Analysis/SpecialFunctions/CompareExp.lean b/Mathlib/Analysis/SpecialFunctions/CompareExp.lean index ebcb15116c75bf..cb01447d2d7215 100644 --- a/Mathlib/Analysis/SpecialFunctions/CompareExp.lean +++ b/Mathlib/Analysis/SpecialFunctions/CompareExp.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.Asymptotics.SpecificAsymptotics /-! # Growth estimates on `x ^ y` for complex `x`, `y` @@ -26,6 +28,8 @@ stronger assumptions (e.g., `im z` is bounded from below and from above) are not -/ +@[expose] public section + open Asymptotics Filter Function open scoped Topology diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean index 708d78cdedd9e8..6d04e30f76edda 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Geoffrey Irving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Geoffrey Irving -/ -import Mathlib.Analysis.Analytic.Composition -import Mathlib.Analysis.Analytic.Constructions -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv +module + +public import Mathlib.Analysis.Analytic.Composition +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv /-! # Various complex special functions are analytic @@ -14,6 +16,8 @@ import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv `log`, and `cpow` are analytic, since they are differentiable. -/ +@[expose] public section + open Complex Set open scoped Topology diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean index 135e9bbfd0448b..8ce18f55323ac2 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds /-! # Complex arctangent @@ -15,6 +17,8 @@ $$\arctan z = \frac{(-1)^n}{2n + 1} z^{2n + 1},\ |z|<1$$ is proved in `Complex.hasSum_arctan`. -/ +@[expose] public section + namespace Complex diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean index 6a40527ee5558a..3035a84a8a719b 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse /-! # The argument of a complex number. @@ -14,6 +16,8 @@ such that for `x ≠ 0`, `sin (arg x) = x.im / x.abs` and `cos (arg x) = x.re / while `arg 0` defaults to `0` -/ +@[expose] public section + open Filter Metric Set open scoped ComplexConjugate Real Topology diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean index cfd84fd9a57c0e..23c7f4b39911a9 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.Circle -import Mathlib.Analysis.SpecialFunctions.Complex.Log +module + +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.Analysis.SpecialFunctions.Complex.Log /-! # Maps on the unit circle @@ -14,6 +16,8 @@ to the unit circle. These two maps define a partial equivalence between `circle` `circle.argPartialEquiv` and `circle.argEquiv`, that sends the whole circle to `(-π, π]`. -/ +@[expose] public section + open Complex Function Set diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean b/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean index a9be43269fcb43..5c18b8b42b1462 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Circle -import Mathlib.NumberTheory.LegendreSymbol.AddCharacter -import Mathlib.RingTheory.RootsOfUnity.AlgebraicallyClosed -import Mathlib.Topology.Instances.AddCircle.Real +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.Circle +public import Mathlib.NumberTheory.LegendreSymbol.AddCharacter +public import Mathlib.RingTheory.RootsOfUnity.AlgebraicallyClosed +public import Mathlib.Topology.Instances.AddCircle.Real /-! # Additive characters valued in the unit circle @@ -19,6 +21,8 @@ These results are separate from `Analysis.SpecialFunctions.Complex.Circle` in or the imports of that file. -/ +@[expose] public section + open Complex Function open scoped Real diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/CircleMap.lean b/Mathlib/Analysis/SpecialFunctions/Complex/CircleMap.lean index 8808d217a8d212..4d35c33da0170e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/CircleMap.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/CircleMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Fabrizio Barroero, Christopher Hoskin -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Log -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.Log +public import Mathlib.Order.Interval.Set.Defs /-! # circleMap @@ -18,6 +20,8 @@ This file defines the circle map $θ ↦ c + R e^{θi}$, a parametrization of a ## Tags -/ + +@[expose] public section noncomputable section circleMap open Complex Function Metric Real diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Log.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Log.lean index 794362be12a5ab..53e00d0ff9c689 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Log.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Log.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Arg -import Mathlib.Analysis.SpecialFunctions.Log.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.Arg +public import Mathlib.Analysis.SpecialFunctions.Log.Basic /-! # The complex `log` function @@ -12,6 +14,8 @@ import Mathlib.Analysis.SpecialFunctions.Log.Basic Basic properties, relationship with `exp`. -/ +@[expose] public section + noncomputable section namespace Complex diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean b/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean index e04d259c5cf417..f4c0dcaafd3939 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Complex.Convex -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Analysis.Calculus.Deriv.Shift -import Mathlib.Analysis.SpecificLimits.RCLike +module + +public import Mathlib.Analysis.Complex.Convex +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Analysis.Calculus.Deriv.Shift +public import Mathlib.Analysis.SpecificLimits.RCLike /-! # Estimates for the complex logarithm @@ -23,6 +25,8 @@ over the unit interval (`Complex.log_eq_integral`) and introduce notation Refactor using general Taylor series theory, once this exists in Mathlib. -/ +@[expose] public section + namespace Complex /-! diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/LogDeriv.lean b/Mathlib/Analysis/SpecialFunctions/Complex/LogDeriv.lean index 67ff5e27fc2972..534dc978d17e83 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/LogDeriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/LogDeriv.lean @@ -3,16 +3,20 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv -import Mathlib.Analysis.Calculus.LogDeriv -import Mathlib.Analysis.SpecialFunctions.Complex.Log -import Mathlib.Analysis.SpecialFunctions.ExpDeriv +module + +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv +public import Mathlib.Analysis.Calculus.LogDeriv +public import Mathlib.Analysis.SpecialFunctions.Complex.Log +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv /-! # Differentiability of the complex `log` function -/ +@[expose] public section + assert_not_exists IsConformalMap Conformal open Set Filter diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Abs.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Abs.lean index 06a6594c3e1abf..c0727ca09adde9 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Abs.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Abs.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Jon Bannon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Bannon, Jireh Loreaux -/ +module -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Commute +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Commute /-! @@ -21,6 +22,8 @@ and provides basic API. -/ +@[expose] public section + variable {𝕜 A : Type*} open scoped NNReal diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog.lean index 052ae68f94b587..487dea251a6209 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog.lean @@ -3,173 +3,8 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.SpecialFunctions.Exponential -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Topology.ContinuousMap.ContinuousSqrt -import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog.Basic -/-! -# The exponential and logarithm based on the continuous functional calculus - -This file defines the logarithm via the continuous functional calculus (CFC) and builds its API. -This allows one to take logs of matrices, operators, elements of a C⋆-algebra, etc. - -It also shows that exponentials defined via the continuous functional calculus are equal to -`NormedSpace.exp` (defined via power series) whenever the former are not junk values. - -## Main declarations - -+ `CFC.log`: the real log function based on the CFC, i.e. `cfc Real.log` -+ `CFC.exp_eq_normedSpace_exp`: exponentials based on the CFC are equal to exponentials based - on power series. -+ `CFC.log_exp` and `CFC.exp_log`: `CFC.log` and `NormedSpace.exp ℝ` are inverses of each other. - -## Implementation notes - -Since `cfc Real.exp` and `cfc Complex.exp` are strictly less general than `NormedSpace.exp` -(defined via power series), we only give minimal API for these here in order to relate -`NormedSpace.exp` to functions defined via the CFC. In particular, we don't give separate -definitions for them. - -## TODO - -+ Show that `log (a * b) = log a + log b` whenever `a` and `b` commute (and the same for indexed - products). -+ Relate `CFC.log` to `rpow`, `zpow`, `sqrt`, `inv`. --/ - -open NormedSpace - -section general_exponential -variable {𝕜 : Type*} {α : Type*} [RCLike 𝕜] [TopologicalSpace α] [CompactSpace α] - -lemma NormedSpace.exp_continuousMap_eq (f : C(α, 𝕜)) : - exp 𝕜 f = (⟨exp 𝕜 ∘ f, exp_continuous.comp f.continuous⟩ : C(α, 𝕜)) := by - ext a - simp only [NormedSpace.exp, FormalMultilinearSeries.sum] - have h_sum := NormedSpace.expSeries_summable (𝕂 := 𝕜) f - simp_rw [← ContinuousMap.tsum_apply h_sum a, NormedSpace.expSeries_apply_eq] - simp [NormedSpace.exp_eq_tsum] - -end general_exponential - -namespace CFC -section RCLikeNormed - -variable {𝕜 : Type*} {A : Type*} [RCLike 𝕜] {p : A → Prop} [NormedRing A] - [StarRing A] [IsTopologicalRing A] [NormedAlgebra 𝕜 A] [ContinuousFunctionalCalculus 𝕜 A p] - -open scoped ContinuousFunctionalCalculus in -lemma exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) : - cfc (exp 𝕜 : 𝕜 → 𝕜) a = exp 𝕜 a := by - conv_rhs => rw [← cfc_id 𝕜 a ha, cfc_apply id a ha] - have h := (cfcHom_isClosedEmbedding (R := 𝕜) (show p a from ha)).continuous - have _ : ContinuousOn (exp 𝕜) (spectrum 𝕜 a) := exp_continuous.continuousOn - simp_rw [← map_exp 𝕜 _ h, cfc_apply (exp 𝕜) a ha] - congr 1 - ext - simp [exp_continuousMap_eq] - -end RCLikeNormed - -section RealNormed - -variable {A : Type*} [NormedRing A] [StarRing A] - [IsTopologicalRing A] [NormedAlgebra ℝ A] - [ContinuousFunctionalCalculus ℝ A IsSelfAdjoint] - -lemma real_exp_eq_normedSpace_exp {a : A} (ha : IsSelfAdjoint a := by cfc_tac) : - cfc Real.exp a = exp ℝ a := - Real.exp_eq_exp_ℝ ▸ exp_eq_normedSpace_exp ha - -@[aesop safe apply (rule_sets := [CStarAlgebra])] -lemma _root_.IsSelfAdjoint.exp_nonneg {𝕜 : Type*} [Field 𝕜] [Algebra 𝕜 A] - [PartialOrder A] [StarOrderedRing A] {a : A} (ha : IsSelfAdjoint a) : - 0 ≤ exp 𝕜 a := by - rw [exp_eq_exp 𝕜 ℝ, ← real_exp_eq_normedSpace_exp] - exact cfc_nonneg fun x _ => Real.exp_nonneg x - -end RealNormed - -section ComplexNormed - -variable {A : Type*} {p : A → Prop} [NormedRing A] [StarRing A] - [NormedAlgebra ℂ A] [ContinuousFunctionalCalculus ℂ A p] - -lemma complex_exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) : - cfc Complex.exp a = exp ℂ a := - Complex.exp_eq_exp_ℂ ▸ exp_eq_normedSpace_exp ha - -end ComplexNormed - - -section real_log - -open scoped ComplexOrder - -variable {A : Type*} [NormedRing A] [StarRing A] [NormedAlgebra ℝ A] - [ContinuousFunctionalCalculus ℝ A IsSelfAdjoint] - -/-- The real logarithm, defined via the continuous functional calculus. This can be used on -matrices, operators on a Hilbert space, elements of a C⋆-algebra, etc. -/ -noncomputable def log (a : A) : A := cfc Real.log a - -@[simp, grind =>] -protected lemma _root_.IsSelfAdjoint.log {a : A} : IsSelfAdjoint (log a) := cfc_predicate _ a - -@[simp, grind =] lemma log_zero : log (0 : A) = 0 := by simp [log] - -@[simp, grind =] lemma log_one : log (1 : A) = 0 := by simp [log] - -@[simp, grind =] -lemma log_algebraMap {r : ℝ} : log (algebraMap ℝ A r) = algebraMap ℝ A (Real.log r) := by - simp [log] - -lemma log_smul {r : ℝ} (a : A) (ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0) (hr : r ≠ 0) - (ha₁ : IsSelfAdjoint a := by cfc_tac) : - log (r • a) = algebraMap ℝ A (Real.log r) + log a := by - rw [log, ← cfc_smul_id (R := ℝ) r a, ← cfc_comp Real.log (r • ·) a, log] - calc - _ = cfc (fun z => Real.log r + Real.log z) a := - cfc_congr (Real.log_mul hr <| ha₂ · ·) - _ = _ := by rw [cfc_const_add _ _ _] - -@[grind =] -lemma log_smul' [PartialOrder A] [StarOrderedRing A] [NonnegSpectrumClass ℝ A] {r : ℝ} (a : A) - (hr : 0 < r) (ha : IsStrictlyPositive a := by cfc_tac) : - log (r • a) = algebraMap ℝ A (Real.log r) + log a := by - grind [log_smul] - -lemma log_pow (n : ℕ) (a : A) (ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0) - (ha₁ : IsSelfAdjoint a := by cfc_tac) : log (a ^ n) = n • log a := by - have ha₂' : ContinuousOn Real.log (spectrum ℝ a) := by fun_prop (disch := assumption) - have ha₂'' : ContinuousOn Real.log ((· ^ n) '' spectrum ℝ a) := by fun_prop (disch := aesop) - rw [log, ← cfc_pow_id (R := ℝ) a n ha₁, ← cfc_comp' Real.log (· ^ n) a ha₂'', log] - simp_rw [Real.log_pow, ← Nat.cast_smul_eq_nsmul ℝ n, cfc_const_mul (n : ℝ) Real.log a ha₂'] - -@[grind =] -lemma log_pow' [PartialOrder A] [StarOrderedRing A] [NonnegSpectrumClass ℝ A] (n : ℕ) (a : A) - (ha : IsStrictlyPositive a := by cfc_tac) : - log (a ^ n) = n • log a := by - grind [log_pow] - -open NormedSpace in -@[grind =] -lemma log_exp (a : A) (ha : IsSelfAdjoint a := by cfc_tac) : log (exp ℝ a) = a := by - have hcont : ContinuousOn Real.log (Real.exp '' spectrum ℝ a) := by fun_prop (disch := simp) - rw [log, ← real_exp_eq_normedSpace_exp, ← cfc_comp' Real.log Real.exp a hcont] - simp [cfc_id' (R := ℝ) a] - -open NormedSpace in -@[grind =] -lemma exp_log [PartialOrder A] [StarOrderedRing A] [NonnegSpectrumClass ℝ A] (a : A) - (ha : IsStrictlyPositive a := by cfc_tac) : exp ℝ (log a) = a := by - have ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0 := by grind - rw [← real_exp_eq_normedSpace_exp .log, log, ← cfc_comp' Real.exp Real.log a (by fun_prop)] - conv_rhs => rw [← cfc_id (R := ℝ) a] - refine cfc_congr fun x hx => ?_ - grind [Real.exp_log] - -end real_log -end CFC +deprecated_module (since := "2025-11-15") diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Basic.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Basic.lean new file mode 100644 index 00000000000000..8bafd04d15589a --- /dev/null +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Basic.lean @@ -0,0 +1,178 @@ +/- +Copyright (c) 2024 Frédéric Dupuis. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Frédéric Dupuis +-/ +module + +public import Mathlib.Analysis.SpecialFunctions.Exponential +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Topology.ContinuousMap.ContinuousSqrt +public import Mathlib.Analysis.SpecialFunctions.Log.Basic + +/-! +# The exponential and logarithm based on the continuous functional calculus + +This file defines the logarithm via the continuous functional calculus (CFC) and builds its API. +This allows one to take logs of matrices, operators, elements of a C⋆-algebra, etc. + +It also shows that exponentials defined via the continuous functional calculus are equal to +`NormedSpace.exp` (defined via power series) whenever the former are not junk values. + +## Main declarations + ++ `CFC.log`: the real log function based on the CFC, i.e. `cfc Real.log` ++ `CFC.exp_eq_normedSpace_exp`: exponentials based on the CFC are equal to exponentials based + on power series. ++ `CFC.log_exp` and `CFC.exp_log`: `CFC.log` and `NormedSpace.exp ℝ` are inverses of each other. + +## Implementation notes + +Since `cfc Real.exp` and `cfc Complex.exp` are strictly less general than `NormedSpace.exp` +(defined via power series), we only give minimal API for these here in order to relate +`NormedSpace.exp` to functions defined via the CFC. In particular, we don't give separate +definitions for them. + +## TODO + ++ Show that `log (a * b) = log a + log b` whenever `a` and `b` commute (and the same for indexed + products). ++ Relate `CFC.log` to `rpow`, `zpow`, `sqrt`, `inv`. +-/ + +@[expose] public section + +open NormedSpace + +section general_exponential +variable {𝕜 : Type*} {α : Type*} [RCLike 𝕜] [TopologicalSpace α] [CompactSpace α] + +lemma NormedSpace.exp_continuousMap_eq (f : C(α, 𝕜)) : + exp 𝕜 f = (⟨exp 𝕜 ∘ f, exp_continuous.comp f.continuous⟩ : C(α, 𝕜)) := by + ext a + simp only [NormedSpace.exp, FormalMultilinearSeries.sum] + have h_sum := NormedSpace.expSeries_summable (𝕂 := 𝕜) f + simp_rw [← ContinuousMap.tsum_apply h_sum a, NormedSpace.expSeries_apply_eq] + simp [NormedSpace.exp_eq_tsum] + +end general_exponential + +namespace CFC +section RCLikeNormed + +variable {𝕜 : Type*} {A : Type*} [RCLike 𝕜] {p : A → Prop} [NormedRing A] + [StarRing A] [IsTopologicalRing A] [NormedAlgebra 𝕜 A] [ContinuousFunctionalCalculus 𝕜 A p] + +open scoped ContinuousFunctionalCalculus in +lemma exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) : + cfc (exp 𝕜 : 𝕜 → 𝕜) a = exp 𝕜 a := by + conv_rhs => rw [← cfc_id 𝕜 a ha, cfc_apply id a ha] + have h := (cfcHom_isClosedEmbedding (R := 𝕜) (show p a from ha)).continuous + have _ : ContinuousOn (exp 𝕜) (spectrum 𝕜 a) := exp_continuous.continuousOn + simp_rw [← map_exp 𝕜 _ h, cfc_apply (exp 𝕜) a ha] + congr 1 + ext + simp [exp_continuousMap_eq] + +end RCLikeNormed + +section RealNormed + +variable {A : Type*} [NormedRing A] [StarRing A] + [IsTopologicalRing A] [NormedAlgebra ℝ A] + [ContinuousFunctionalCalculus ℝ A IsSelfAdjoint] + +lemma real_exp_eq_normedSpace_exp {a : A} (ha : IsSelfAdjoint a := by cfc_tac) : + cfc Real.exp a = exp ℝ a := + Real.exp_eq_exp_ℝ ▸ exp_eq_normedSpace_exp ha + +@[aesop safe apply (rule_sets := [CStarAlgebra])] +lemma _root_.IsSelfAdjoint.exp_nonneg {𝕜 : Type*} [Field 𝕜] [Algebra 𝕜 A] + [PartialOrder A] [StarOrderedRing A] {a : A} (ha : IsSelfAdjoint a) : + 0 ≤ exp 𝕜 a := by + rw [exp_eq_exp 𝕜 ℝ, ← real_exp_eq_normedSpace_exp] + exact cfc_nonneg fun x _ => Real.exp_nonneg x + +end RealNormed + +section ComplexNormed + +variable {A : Type*} {p : A → Prop} [NormedRing A] [StarRing A] + [NormedAlgebra ℂ A] [ContinuousFunctionalCalculus ℂ A p] + +lemma complex_exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) : + cfc Complex.exp a = exp ℂ a := + Complex.exp_eq_exp_ℂ ▸ exp_eq_normedSpace_exp ha + +end ComplexNormed + + +section real_log + +open scoped ComplexOrder + +variable {A : Type*} [NormedRing A] [StarRing A] [NormedAlgebra ℝ A] + [ContinuousFunctionalCalculus ℝ A IsSelfAdjoint] + +/-- The real logarithm, defined via the continuous functional calculus. This can be used on +matrices, operators on a Hilbert space, elements of a C⋆-algebra, etc. -/ +noncomputable def log (a : A) : A := cfc Real.log a + +@[simp, grind =>] +protected lemma _root_.IsSelfAdjoint.log {a : A} : IsSelfAdjoint (log a) := cfc_predicate _ a + +@[simp, grind =] lemma log_zero : log (0 : A) = 0 := by simp [log] + +@[simp, grind =] lemma log_one : log (1 : A) = 0 := by simp [log] + +@[simp, grind =] +lemma log_algebraMap {r : ℝ} : log (algebraMap ℝ A r) = algebraMap ℝ A (Real.log r) := by + simp [log] + +lemma log_smul {r : ℝ} (a : A) (ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0) (hr : r ≠ 0) + (ha₁ : IsSelfAdjoint a := by cfc_tac) : + log (r • a) = algebraMap ℝ A (Real.log r) + log a := by + rw [log, ← cfc_smul_id (R := ℝ) r a, ← cfc_comp Real.log (r • ·) a, log] + calc + _ = cfc (fun z => Real.log r + Real.log z) a := + cfc_congr (Real.log_mul hr <| ha₂ · ·) + _ = _ := by rw [cfc_const_add _ _ _] + +@[grind =] +lemma log_smul' [PartialOrder A] [StarOrderedRing A] [NonnegSpectrumClass ℝ A] {r : ℝ} (a : A) + (hr : 0 < r) (ha : IsStrictlyPositive a := by cfc_tac) : + log (r • a) = algebraMap ℝ A (Real.log r) + log a := by + grind [log_smul] + +lemma log_pow (n : ℕ) (a : A) (ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0) + (ha₁ : IsSelfAdjoint a := by cfc_tac) : log (a ^ n) = n • log a := by + have ha₂' : ContinuousOn Real.log (spectrum ℝ a) := by fun_prop (disch := assumption) + have ha₂'' : ContinuousOn Real.log ((· ^ n) '' spectrum ℝ a) := by fun_prop (disch := aesop) + rw [log, ← cfc_pow_id (R := ℝ) a n ha₁, ← cfc_comp' Real.log (· ^ n) a ha₂'', log] + simp_rw [Real.log_pow, ← Nat.cast_smul_eq_nsmul ℝ n, cfc_const_mul (n : ℝ) Real.log a ha₂'] + +@[grind =] +lemma log_pow' [PartialOrder A] [StarOrderedRing A] [NonnegSpectrumClass ℝ A] (n : ℕ) (a : A) + (ha : IsStrictlyPositive a := by cfc_tac) : + log (a ^ n) = n • log a := by + grind [log_pow] + +open NormedSpace in +@[grind =] +lemma log_exp (a : A) (ha : IsSelfAdjoint a := by cfc_tac) : log (exp ℝ a) = a := by + have hcont : ContinuousOn Real.log (Real.exp '' spectrum ℝ a) := by fun_prop (disch := simp) + rw [log, ← real_exp_eq_normedSpace_exp, ← cfc_comp' Real.log Real.exp a hcont] + simp [cfc_id' (R := ℝ) a] + +open NormedSpace in +@[grind =] +lemma exp_log [PartialOrder A] [StarOrderedRing A] [NonnegSpectrumClass ℝ A] (a : A) + (ha : IsStrictlyPositive a := by cfc_tac) : exp ℝ (log a) = a := by + have ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0 := by grind + rw [← real_exp_eq_normedSpace_exp .log, log, ← cfc_comp' Real.exp Real.log a (by fun_prop)] + conv_rhs => rw [← cfc_id (R := ℝ) a] + refine cfc_congr fun x hx => ?_ + grind [Real.exp_log] + +end real_log +end CFC diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Basic.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Basic.lean index a35176e34459c2..0b197183a2a652 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Basic.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Topology.ContinuousMap.ContinuousSqrt -import Mathlib.Topology.ContinuousMap.StoneWeierstrass +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Topology.ContinuousMap.ContinuousSqrt +public import Mathlib.Topology.ContinuousMap.StoneWeierstrass /-! # The positive (and negative) parts of a selfadjoint element in a C⋆-algebra @@ -15,6 +16,8 @@ the continuous functional calculus and develops the basic API, including the uni positive and negative parts. -/ +@[expose] public section + open scoped NNReal section NonUnital diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Isometric.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Isometric.lean index 0b624d5ada687a..5d6cd39ffdbd53 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Isometric.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/PosPart/Isometric.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric /-! # Facts about `CFC.posPart` and `CFC.negPart` involving norms @@ -19,6 +20,8 @@ C⋆-algebra that involve the norm. respectively. -/ +@[expose] public section + variable {A : Type*} [NonUnitalNormedRing A] [NormedSpace ℝ A] [SMulCommClass ℝ A A] [IsScalarTower ℝ A A] [StarRing A] [NonUnitalIsometricContinuousFunctionalCalculus ℝ A IsSelfAdjoint] diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Basic.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Basic.lean index 8c465349e06ac9..bbd88fc3a6f52e 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Basic.lean @@ -3,15 +3,16 @@ Copyright (c) 2024 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Algebra.Order.Star.Prod -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Pi -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Topology.ContinuousMap.ContinuousSqrt +public import Mathlib.Algebra.Order.Star.Prod +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Pi +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Topology.ContinuousMap.ContinuousSqrt /-! # Real powers defined via the continuous functional calculus @@ -49,6 +50,8 @@ only makes sense for nonnegative exponents, and hence we define it such that the + Prove the order properties (operator monotonicity and concavity/convexity) -/ +@[expose] public section + open scoped NNReal namespace NNReal diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean index bd4fbda450e4f6..980f64da01c503 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Integral -import Mathlib.Analysis.CStarAlgebra.ApproximateUnit +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Integral +public import Mathlib.Analysis.CStarAlgebra.ApproximateUnit /-! # Integral representations of `rpow` @@ -47,6 +48,8 @@ relevant in applications, and would needlessly complicate the proof. (see Lemma 2.8) -/ +@[expose] public section + open MeasureTheory Set Filter open scoped NNReal Topology diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Isometric.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Isometric.lean index a8f85ed872431a..1d9858f507035a 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Isometric.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/Isometric.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric /-! # Properties of `rpow` and `sqrt` over an algebra with an isometric CFC @@ -21,6 +22,8 @@ rely on an isometric continuous functional calculus. continuous functional calculus, rpow, sqrt -/ +@[expose] public section + open scoped NNReal namespace CFC diff --git a/Mathlib/Analysis/SpecialFunctions/Exp.lean b/Mathlib/Analysis/SpecialFunctions/Exp.lean index c7731c3da53760..da06263a94c43c 100644 --- a/Mathlib/Analysis/SpecialFunctions/Exp.lean +++ b/Mathlib/Analysis/SpecialFunctions/Exp.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne -/ -import Mathlib.Analysis.Complex.Asymptotics -import Mathlib.Analysis.Complex.Trigonometric -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.Topology.Algebra.MetricSpace.Lipschitz +module + +public import Mathlib.Analysis.Complex.Asymptotics +public import Mathlib.Analysis.Complex.Trigonometric +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.Topology.Algebra.MetricSpace.Lipschitz /-! # Complex and real exponential @@ -19,6 +21,8 @@ limits of `Real.exp` at infinity. exp -/ +@[expose] public section + noncomputable section open Asymptotics Bornology Finset Filter Function Metric Set Topology diff --git a/Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean b/Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean index 6e82e586ab9b60..0cc7441166435c 100644 --- a/Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne -/ -import Mathlib.Analysis.Calculus.ContDiff.RCLike -import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas -import Mathlib.Analysis.Complex.RealDeriv -import Mathlib.Analysis.SpecialFunctions.Exp -import Mathlib.Analysis.SpecialFunctions.Exponential +module + +public import Mathlib.Analysis.Calculus.ContDiff.RCLike +public import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas +public import Mathlib.Analysis.Complex.RealDeriv +public import Mathlib.Analysis.SpecialFunctions.Exp +public import Mathlib.Analysis.SpecialFunctions.Exponential /-! # Complex and real exponential @@ -19,6 +21,8 @@ In this file we prove that `Complex.exp` and `Real.exp` are analytic functions. exp, derivative -/ +@[expose] public section + assert_not_exists IsConformalMap Conformal noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Exponential.lean b/Mathlib/Analysis/SpecialFunctions/Exponential.lean index ab4d9338e34a4d..06b575eb7a19ec 100644 --- a/Mathlib/Analysis/SpecialFunctions/Exponential.lean +++ b/Mathlib/Analysis/SpecialFunctions/Exponential.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Eric Wieser -/ -import Mathlib.Analysis.Normed.Algebra.Exponential -import Mathlib.Analysis.Calculus.FDeriv.Analytic -import Mathlib.Analysis.Complex.Exponential -import Mathlib.Topology.MetricSpace.CauSeqFilter +module + +public import Mathlib.Analysis.Normed.Algebra.Exponential +public import Mathlib.Analysis.Calculus.FDeriv.Analytic +public import Mathlib.Analysis.Complex.Exponential +public import Mathlib.Topology.MetricSpace.CauSeqFilter /-! # Calculus results on exponential in a Banach algebra @@ -53,6 +55,8 @@ We prove most results for an arbitrary field `𝕂`, and then specialize to ` -/ +@[expose] public section + open Filter RCLike ContinuousMultilinearMap NormedField NormedSpace Asymptotics diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean index fd9ea14c8ea680..d0ae2cfb91f551 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals -import Mathlib.MeasureTheory.Integral.ExpDecay +module + +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +public import Mathlib.MeasureTheory.Integral.ExpDecay /-! # The Gamma function @@ -36,6 +38,8 @@ set it to be `0` by convention.) Gamma -/ +@[expose] public section + noncomputable section @@ -482,7 +486,7 @@ lemma integral_rpow_mul_exp_neg_mul_Ioi {a r : ℝ} (ha : 0 < a) (hr : 0 < r) : open Lean.Meta Qq Mathlib.Meta.Positivity in /-- The `positivity` extension which identifies expressions of the form `Gamma a`. -/ @[positivity Gamma (_ : ℝ)] -def _root_.Mathlib.Meta.Positivity.evalGamma : PositivityExt where eval {u α} _zα _pα e := do +meta def _root_.Mathlib.Meta.Positivity.evalGamma : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(Gamma $a) => match ← core q(inferInstance) q(inferInstance) a with diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean index 23af652312838e..40196170f81f0b 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Convolution -import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds -import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd -import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup -import Mathlib.Analysis.Analytic.IsolatedZeros -import Mathlib.Analysis.Complex.CauchyIntegral +module + +public import Mathlib.Analysis.Convolution +public import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd +public import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup +public import Mathlib.Analysis.Analytic.IsolatedZeros +public import Mathlib.Analysis.Complex.CauchyIntegral /-! # The Beta function, and further properties of the Gamma function @@ -37,6 +39,8 @@ refined properties of the Gamma function using these relations. `Real.Gamma_mul_Gamma_one_sub`, `Real.Gamma_mul_Gamma_add_half`: real versions of the above. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean index c57d3586010813..dfe1c2a348e738 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Gamma.Deriv -import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral +module + +public import Mathlib.Analysis.SpecialFunctions.Gamma.Deriv +public import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral /-! # Convexity properties of the Gamma function @@ -36,6 +38,8 @@ to a constant, and it should be possible to deduce the value of this constant us formula). -/ +@[expose] public section + noncomputable section @@ -344,6 +348,10 @@ theorem Gamma_three_div_two_lt_one : Gamma (3 / 2) < 1 := by exp_log] <;> norm_num +theorem Gamma_strictAntiOn_Ioc : StrictAntiOn Gamma (Ioc 0 1) := + convexOn_Gamma.strictAntiOn (by simp) (by norm_num) <| + Gamma_one.symm ▸ Gamma_three_div_two_lt_one + theorem Gamma_strictMonoOn_Ici : StrictMonoOn Gamma (Ici 2) := by convert convexOn_Gamma.strictMonoOn (by simp : (0 : ℝ) < 3 / 2) diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/Deligne.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/Deligne.lean index a14623526fdd85..7e71177f5459ec 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/Deligne.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/Deligne.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.SpecialFunctions.Gamma.Beta +public import Mathlib.Analysis.SpecialFunctions.Gamma.Beta /-! # Deligne's archimedean Gamma-factors @@ -28,6 +29,8 @@ This file defines these functions, and proves some elementary properties, includ formula which is an important input in functional equations of (un-completed) Dirichlet L-functions. -/ +@[expose] public section + open Filter Topology Asymptotics Real Set MeasureTheory open Complex diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/Deriv.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/Deriv.lean index 5ba91bd05ca8dc..fa19fefa3e21d9 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/Deriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/Deriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.MellinTransform -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +module + +public import Mathlib.Analysis.MellinTransform +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic /-! # Derivative of the Gamma function @@ -24,6 +26,8 @@ This file shows that the (complex) `Γ` function is complex-differentiable at al Gamma -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean index 13aa2a1ab9a958..635aa38d28c7f0 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.MeasureTheory.Integral.Pi -import Mathlib.Analysis.Fourier.FourierTransform +module + +public import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.MeasureTheory.Integral.Pi +public import Mathlib.Analysis.Fourier.FourierTransform /-! # Fourier transform of the Gaussian @@ -24,6 +26,8 @@ We also give versions of these formulas in finite-dimensional inner product spac -/ +@[expose] public section + /-! ## Fourier integral of Gaussian functions -/ @@ -210,14 +214,14 @@ theorem _root_.fourierIntegral_gaussian (hb : 0 < b.re) (t : ℂ) : rw [integral_cexp_quadratic (show (-b).re < 0 by rwa [neg_re, neg_lt_zero]), neg_neg, zero_sub, mul_neg, div_neg, neg_neg, mul_pow, I_sq, neg_one_mul, mul_comm] -theorem _root_.fourierIntegral_gaussian_pi' (hb : 0 < b.re) (c : ℂ) : +theorem _root_.fourier_gaussian_pi' (hb : 0 < b.re) (c : ℂ) : (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2 + 2 * π * c * x)) = fun t : ℝ => 1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t + I * c) ^ 2) := by haveI : b ≠ 0 := by contrapose! hb; rw [hb, zero_re] have h : (-↑π * b).re < 0 := by simpa only [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos hb ext1 t - simp_rw [fourierIntegral_real_eq_integral_exp_smul, smul_eq_mul, ← Complex.exp_add, ← add_assoc] + simp_rw [fourier_real_eq_integral_exp_smul, smul_eq_mul, ← Complex.exp_add, ← add_assoc] have (x : ℝ) : ↑(-2 * π * x * t) * I + -π * b * x ^ 2 + 2 * π * c * x = -π * b * x ^ 2 + (-2 * π * I * t + 2 * π * c) * x + 0 := by push_cast; ring simp_rw [this, integral_cexp_quadratic h, neg_mul, neg_neg] @@ -230,10 +234,16 @@ theorem _root_.fourierIntegral_gaussian_pi' (hb : 0 < b.re) (c : ℂ) : simp only [I_sq] ring -theorem _root_.fourierIntegral_gaussian_pi (hb : 0 < b.re) : +@[deprecated (since := "2025-11-16")] +alias _root_.fourierIntegral_gaussian_pi' := _root_.fourier_gaussian_pi' + +theorem _root_.fourier_gaussian_pi (hb : 0 < b.re) : (𝓕 fun (x : ℝ) ↦ cexp (-π * b * x ^ 2)) = fun t : ℝ ↦ 1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) := by - simpa only [mul_zero, zero_mul, add_zero] using fourierIntegral_gaussian_pi' hb 0 + simpa only [mul_zero, zero_mul, add_zero] using fourier_gaussian_pi' hb 0 + +@[deprecated (since := "2025-11-16")] +alias _root_.fourierIntegral_gaussian_pi := _root_.fourier_gaussian_pi section InnerProductSpace @@ -340,10 +350,10 @@ theorem integral_rexp_neg_mul_sq_norm {b : ℝ} (hb : 0 < b) : · rw [← ofReal_div, ofReal_cpow (by positivity)] simp -theorem _root_.fourierIntegral_gaussian_innerProductSpace' (hb : 0 < b.re) (x w : V) : +theorem _root_.fourier_gaussian_innerProductSpace' (hb : 0 < b.re) (x w : V) : 𝓕 (fun v ↦ cexp (-b * ‖v‖ ^ 2 + 2 * π * Complex.I * ⟪x, v⟫)) w = (π / b) ^ (Module.finrank ℝ V / 2 : ℂ) * cexp (-π ^ 2 * ‖x - w‖ ^ 2 / b) := by - simp only [neg_mul, fourierIntegral_eq', ofReal_neg, ofReal_mul, ofReal_ofNat, + simp only [neg_mul, fourier_eq', ofReal_neg, ofReal_mul, ofReal_ofNat, smul_eq_mul, ← Complex.exp_add, real_inner_comm w] convert integral_cexp_neg_mul_sq_norm_add hb (2 * π * Complex.I) (x - w) using 3 with v · congr 1 @@ -353,10 +363,18 @@ theorem _root_.fourierIntegral_gaussian_innerProductSpace' (hb : 0 < b.re) (x w simp [mul_pow] ring -theorem _root_.fourierIntegral_gaussian_innerProductSpace (hb : 0 < b.re) (w : V) : +@[deprecated (since := "2025-11-16")] +alias _root_.fourierIntegral_gaussian_innerProductSpace' := + _root_.fourier_gaussian_innerProductSpace' + +theorem _root_.fourier_gaussian_innerProductSpace (hb : 0 < b.re) (w : V) : 𝓕 (fun (v : V) ↦ cexp (-b * ‖v‖ ^ 2)) w = (π / b) ^ (Module.finrank ℝ V / 2 : ℂ) * cexp (-π ^ 2 * ‖w‖ ^ 2 / b) := by - simpa using fourierIntegral_gaussian_innerProductSpace' hb 0 w + simpa using fourier_gaussian_innerProductSpace' hb 0 w + +@[deprecated (since := "2025-11-16")] +alias _root_.fourierIntegral_gaussian_innerProductSpace := + _root_.fourier_gaussian_innerProductSpace end InnerProductSpace diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean index 61047340377dc1..eec7c00571eee7 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Analysis.SpecialFunctions.PolarCoord -import Mathlib.Analysis.Complex.Convex -import Mathlib.Data.Nat.Factorial.DoubleFactorial +module + +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +public import Mathlib.Analysis.SpecialFunctions.PolarCoord +public import Mathlib.Analysis.Complex.Convex +public import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # Gaussian integral @@ -19,6 +21,8 @@ We prove various versions of the formula for the Gaussian integral: * `Complex.Gamma_one_half_eq`: the formula `Γ (1 / 2) = √π`. -/ +@[expose] public section + noncomputable section open Real Set MeasureTheory Filter Asymptotics diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean index 0286093fa3e3cf..665e3c642c9e95 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform -import Mathlib.Analysis.Fourier.PoissonSummation +public import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform +public import Mathlib.Analysis.Fourier.PoissonSummation /-! # Poisson summation applied to the Gaussian @@ -19,6 +20,8 @@ for positive real `a`, or complex `a` with positive real part. (See also `NumberTheory.ModularForms.JacobiTheta`.) -/ +@[expose] public section + open Real Set MeasureTheory Filter Asymptotics intervalIntegral open scoped Real Topology FourierTransform RealInnerProductSpace @@ -90,7 +93,7 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) : · exact continuous_const.mul (Complex.continuous_ofReal.pow 2) · exact continuous_const.mul Complex.continuous_ofReal have hFf : 𝓕 f = fun x : ℝ ↦ 1 / a ^ (1 / 2 : ℂ) * cexp (-π / a * (x + I * b) ^ 2) := - fourierIntegral_gaussian_pi' ha b + fourier_gaussian_pi' ha b have h1 : 0 < (↑π * a).re := by rw [re_ofReal_mul] exact mul_pos pi_pos ha @@ -112,7 +115,7 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) : refine ((cexp_neg_quadratic_isLittleO_abs_rpow_cocompact (?_) (-2 * ↑π * I * b / a) (-2)).isBigO.const_mul_left _).const_mul_left _ rwa [neg_div, neg_re, neg_lt_zero] - convert Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay hCf one_lt_two f_bd Ff_bd 0 using 1 + convert Real.tsum_eq_tsum_fourier_of_rpow_decay hCf one_lt_two f_bd Ff_bd 0 using 1 · simp only [f, zero_add, ofReal_intCast] · rw [← tsum_mul_left] simp only [QuotientAddGroup.mk_zero, fourier_eval_zero, mul_one, hFf, ofReal_intCast] diff --git a/Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean b/Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean index f8e48b78f4c01c..a7a5a8a2d16a4b 100644 --- a/Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean +++ b/Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.JapaneseBracket -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Integral.IntegralEqImproper -import Mathlib.MeasureTheory.Measure.Lebesgue.Integral +module + +public import Mathlib.Analysis.SpecialFunctions.JapaneseBracket +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper +public import Mathlib.MeasureTheory.Measure.Lebesgue.Integral /-! # Evaluation of specific improper integrals @@ -25,6 +27,8 @@ mathlib's conventions for integrals over finite intervals (see `intervalIntegral - `Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean`-- integrability of `(1+‖x‖)^(-r)`. -/ +@[expose] public section + open Real Set Filter MeasureTheory intervalIntegral diff --git a/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean index f9358047cffedc..5cae4d73fc95bb 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Benjamin Davidson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog -import Mathlib.Analysis.SpecialFunctions.NonIntegrable -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +module + +public import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +public import Mathlib.Analysis.SpecialFunctions.NonIntegrable +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv /-! # Integrability of Special Functions @@ -14,6 +16,8 @@ This file establishes basic facts about the interval integrability of special fu powers and the logarithm. -/ +@[expose] public section + open Interval MeasureTheory Real Set variable {a b c d : ℝ} (n : ℕ) {f : ℝ → ℝ} {μ : Measure ℝ} [IsLocallyFiniteMeasure μ] diff --git a/Mathlib/Analysis/SpecialFunctions/Integrability/LogMeromorphic.lean b/Mathlib/Analysis/SpecialFunctions/Integrability/LogMeromorphic.lean index 7151b0f00b2026..dfa9dec96524c4 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrability/LogMeromorphic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrability/LogMeromorphic.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Meromorphic.FactorizedRational -import Mathlib.Analysis.NormedSpace.Connected -import Mathlib.Analysis.SpecialFunctions.Integrability.Basic -import Mathlib.Analysis.SpecialFunctions.Log.PosLog -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.MeasureTheory.Integral.CircleIntegral +module + +public import Mathlib.Analysis.Meromorphic.FactorizedRational +public import Mathlib.Analysis.NormedSpace.Connected +public import Mathlib.Analysis.SpecialFunctions.Integrability.Basic +public import Mathlib.Analysis.SpecialFunctions.Log.PosLog +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.MeasureTheory.Integral.CircleIntegral /-! # Integrability for Logarithms of Meromorphic Functions @@ -19,6 +21,8 @@ that logarithms of trigonometric functions are interval integrable. In the compl functions are circle integrable over every circle in the complex plane. -/ +@[expose] public section + open Filter Interval MeasureTheory MeromorphicOn Metric Real /-! diff --git a/Mathlib/Analysis/SpecialFunctions/Integrals/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Integrals/Basic.lean index 9ab75997185249..5aa06e1cfee599 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrals/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrals/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Benjamin Davidson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog -import Mathlib.Analysis.SpecialFunctions.NonIntegrable -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv -import Mathlib.Analysis.SpecialFunctions.Integrability.Basic -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Sinc -import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +module + +public import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +public import Mathlib.Analysis.SpecialFunctions.NonIntegrable +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.Analysis.SpecialFunctions.Integrability.Basic +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Sinc +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts /-! # Integration of specific interval integrals @@ -31,6 +33,8 @@ This file is still being developed. integrate, integration, integrable -/ +@[expose] public section + open Real Set Finset diff --git a/Mathlib/Analysis/SpecialFunctions/Integrals/LogTrigonometric.lean b/Mathlib/Analysis/SpecialFunctions/Integrals/LogTrigonometric.lean index 0363d8ddb915ad..c2ccb6de609299 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrals/LogTrigonometric.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrals/LogTrigonometric.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic +module + +public import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic /-! # Integral of `log ∘ sin` @@ -12,6 +14,8 @@ This file computes special values of the integral of `log ∘ sin`. Given that t involves the dilogarithm, this can be seen as computing special values of `Li₂`. -/ +@[expose] public section + open Filter Interval Real /- diff --git a/Mathlib/Analysis/SpecialFunctions/Integrals/PosLogEqCircleAverage.lean b/Mathlib/Analysis/SpecialFunctions/Integrals/PosLogEqCircleAverage.lean index a1e4c975c8cc14..c9947123ca9cf4 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrals/PosLogEqCircleAverage.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrals/PosLogEqCircleAverage.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.Complex.Harmonic.MeanValue -import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Analysis.SpecialFunctions.Integrals.LogTrigonometric -import Mathlib.MeasureTheory.Integral.CircleAverage +module + +public import Mathlib.Analysis.Complex.Harmonic.MeanValue +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Analysis.SpecialFunctions.Integrals.LogTrigonometric +public import Mathlib.MeasureTheory.Integral.CircleAverage /-! # Representation of `log⁺` as a Circle Average @@ -16,6 +18,8 @@ If `a` is any complex number, `circleAverage_log_norm_sub_const_eq_posLog` repre the circle average of `log ‖· - a‖` over the unit circle. -/ +@[expose] public section + open Filter Interval intervalIntegral MeasureTheory Metric Real variable {a c : ℂ} {R : ℝ} diff --git a/Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean b/Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean index eaea2ccc3615d1..56c66185a15b35 100644 --- a/Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean +++ b/Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.Analysis.SpecialFunctions.Integrability.Basic -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.MeasureTheory.Integral.Layercake +module + +public import Mathlib.Analysis.SpecialFunctions.Integrability.Basic +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.MeasureTheory.Integral.Layercake /-! # Japanese Bracket @@ -22,6 +24,8 @@ than the dimension. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Base.lean b/Mathlib/Analysis/SpecialFunctions/Log/Base.lean index ff38285eda2b92..1042d42b317873 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Base.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Base.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey, Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Data.Int.Log +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Data.Int.Log /-! # Real logarithm base `b` @@ -22,6 +24,8 @@ We prove some basic properties of this function and its relation to `rpow`. logarithm, continuity -/ +@[expose] public section + open Set Filter Function diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean index badc1ef350b0e4..3b32838345dfc0 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne -/ -import Mathlib.Analysis.SpecialFunctions.Exp -import Mathlib.Data.Nat.Factorization.Defs -import Mathlib.Analysis.Normed.Module.RCLike.Real -import Mathlib.Data.Rat.Cast.CharZero +module + +public import Mathlib.Analysis.SpecialFunctions.Exp +public import Mathlib.Data.Nat.Factorization.Defs +public import Mathlib.Analysis.Normed.Module.RCLike.Real +public import Mathlib.Data.Rat.Cast.CharZero /-! # Real logarithm @@ -22,6 +24,8 @@ We prove some basic properties of this function and show that it is continuous. logarithm, continuity -/ +@[expose] public section + open Set Filter Function open Topology @@ -540,7 +544,7 @@ lemma log_nz_of_isRat_neg {n : ℤ} : (NormNum.IsRat e n d) → (decide (n / d < /-- Extension for the `positivity` tactic: `Real.log` of a natural number is always nonnegative. -/ @[positivity Real.log (Nat.cast _)] -def evalLogNatCast : PositivityExt where eval {u α} _zα _pα e := do +meta def evalLogNatCast : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.log (Nat.cast $a)) => assertInstancesCommute @@ -549,7 +553,7 @@ def evalLogNatCast : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for the `positivity` tactic: `Real.log` of an integer is always nonnegative. -/ @[positivity Real.log (Int.cast _)] -def evalLogIntCast : PositivityExt where eval {u α} _zα _pα e := do +meta def evalLogIntCast : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.log (Int.cast $a)) => assertInstancesCommute @@ -558,7 +562,7 @@ def evalLogIntCast : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for the `positivity` tactic: `Real.log` of a numeric literal. -/ @[positivity Real.log _] -def evalLogNatLit : PositivityExt where eval {u α} _ _ e := do +meta def evalLogNatLit : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.log $a) => match ← NormNum.derive a with diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Deriv.lean b/Mathlib/Analysis/SpecialFunctions/Log/Deriv.lean index 4469bf5444c740..bad51954f54583 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Deriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Deriv.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne -/ -import Mathlib.Analysis.Calculus.Deriv.Pow -import Mathlib.Analysis.Calculus.LogDeriv -import Mathlib.Analysis.SpecialFunctions.Log.Basic -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Analysis.Calculus.Deriv.Pow +public import Mathlib.Analysis.Calculus.LogDeriv +public import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Tactic.AdaptationNote /-! # Derivative and series expansion of real logarithm @@ -21,6 +23,8 @@ that the series `∑' n : ℕ, x ^ (n + 1) / (n + 1)` converges to `(-Real.log ( logarithm, derivative -/ +@[expose] public section + open Filter Finset Set diff --git a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean index 54ffe684267f79..45ce3354c9b47e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine, Pietro Monticone, Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.Data.EReal.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.Data.EReal.Basic /-! # Extended Nonnegative Real Logarithm @@ -27,6 +29,8 @@ the identities `log (x * y) = log x + log y` and `log (x ^ y) = y * log x` ## Tags ENNReal, EReal, logarithm -/ + +@[expose] public section namespace ENNReal open scoped NNReal diff --git a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean index 1c752cb1ad42a2..cf9155257cb938 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine, Pietro Monticone, Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Analysis.SpecialFunctions.Log.ERealExp -import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.Topology.MetricSpace.Polish +module + +public import Mathlib.Analysis.SpecialFunctions.Log.ERealExp +public import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.Topology.MetricSpace.Polish /-! # Properties of the extended logarithm and exponential @@ -30,6 +32,8 @@ and `exp (x * y) = (exp x) ^ y`. ENNReal, EReal, logarithm, exponential -/ +@[expose] public section + open EReal ENNReal Topology section LogExp diff --git a/Mathlib/Analysis/SpecialFunctions/Log/ERealExp.lean b/Mathlib/Analysis/SpecialFunctions/Log/ERealExp.lean index 065f9bbf169877..3fc968b3addc3e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/ERealExp.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/ERealExp.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pietro Monticone, Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Analysis.Complex.Exponential -import Mathlib.Data.EReal.Basic +module + +public import Mathlib.Analysis.Complex.Exponential +public import Mathlib.Data.EReal.Basic /-! # Extended Nonnegative Real Exponential @@ -24,6 +26,8 @@ the identities `exp (-x) = (exp x)⁻¹` and `exp (x + y) = exp x * exp y`. ## Tags ENNReal, EReal, exponential -/ + +@[expose] public section namespace EReal open scoped ENNReal diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean b/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean index 670c41a6d07d56..0e2a0815adcd54 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Real +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! # Logarithm Tonality @@ -16,6 +18,8 @@ form `x ^ a`. logarithm, tonality -/ +@[expose] public section + open Set Filter Function diff --git a/Mathlib/Analysis/SpecialFunctions/Log/NegMulLog.lean b/Mathlib/Analysis/SpecialFunctions/Log/NegMulLog.lean index 88aeb5e8634c1e..e68f9196563e48 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/NegMulLog.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/NegMulLog.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics -import Mathlib.Analysis.Convex.Deriv +module + +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +public import Mathlib.Analysis.Convex.Deriv /-! # The function `x ↦ - x * log x` @@ -19,6 +21,8 @@ which is notably used in the theory of Shannon entropy. -/ +@[expose] public section + open scoped Topology namespace Real diff --git a/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean b/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean index bf89711241799d..0a0c7010c21441 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.Analysis.SpecialFunctions.Log.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Log.Basic /-! # The Positive Part of the Logarithm @@ -20,6 +22,8 @@ See `Mathlib/Analysis/SpecialFunctions/Integrals/PosLogEqCircleAverage.lean` for `log⁺` as a Circle Average. -/ +@[expose] public section + namespace Real variable {x y : ℝ} diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean b/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean index 968355844e3d16..82f182bd13172c 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds -import Mathlib.Topology.Algebra.InfiniteSum.Field +public import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds +public import Mathlib.Topology.Algebra.InfiniteSum.Field /-! # Summability of logarithms @@ -15,6 +16,8 @@ to relate summability of `f` to multipliability of `1 + f`. -/ +@[expose] public section + variable {ι : Type*} open Filter Topology NNReal SummationFilter diff --git a/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSq.lean b/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSq.lean index e1df2b065ee20b..f1e62fd7fd53b5 100644 --- a/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSq.lean +++ b/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSq.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jakob Stiefel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Stiefel -/ -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Log.Basic -import Mathlib.Topology.ContinuousMap.Bounded.Normed +module + +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.Topology.ContinuousMap.Bounded.Normed /-! # Definition of `mulExpNegMulSq` and properties @@ -27,6 +29,8 @@ boundedness and convergence properties. `mulExpNegMulSq ε ∘ g` is bounded by `norm g`, uniformly in `ε ≥ 0`; -/ +@[expose] public section + open NNReal ENNReal BoundedContinuousFunction Filter open scoped Topology @@ -120,7 +124,7 @@ theorem mulExpNegMulSq_eq_sqrt_mul_mulExpNegMulSq_one (hε : 0 < ε) (x : ℝ) : mulExpNegMulSq ε x = (√ε)⁻¹ * mulExpNegMulSq 1 (sqrt ε * x) := by grind [mulExpNegMulSq] -/-- For fixed `ε > 0`, the mapping `x ↦ mulExpNegMulSq ε x` is bounded by `(√ε)⁻¹ -/ +/-- For fixed `ε > 0`, the mapping `x ↦ mulExpNegMulSq ε x` is bounded by `(√ε)⁻¹`. -/ theorem abs_mulExpNegMulSq_le (hε : 0 < ε) {x : ℝ} : |mulExpNegMulSq ε x| ≤ (√ε)⁻¹ := by rw [mulExpNegMulSq_eq_sqrt_mul_mulExpNegMulSq_one hε x, abs_mul, abs_of_pos (by positivity)] apply mul_le_of_le_one_right diff --git a/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean b/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean index 915cc10205766c..5a0837f20ef18a 100644 --- a/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean +++ b/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Jakob Stiefel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Stiefel -/ -import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSq -import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds -import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.MeasureTheory.Measure.RegularityCompacts -import Mathlib.Topology.ContinuousMap.StoneWeierstrass +module + +public import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSq +public import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds +public import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Measure.RegularityCompacts +public import Mathlib.Topology.ContinuousMap.StoneWeierstrass /-! # Properties of the integral of `mulExpNegMulSq` @@ -37,6 +39,8 @@ This is a key ingredient in the proof of theorem `ext_of_forall_mem_subalgebra_i it is shown that a subalgebra of functions that separates points separates finite measures. -/ +@[expose] public section + open MeasureTheory Real NNReal ENNReal BoundedContinuousFunction Filter open scoped Topology diff --git a/Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean b/Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean index 5891b0e9a84801..128795c651fa93 100644 --- a/Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean +++ b/Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +module + +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus /-! # Non-integrable functions @@ -36,6 +38,8 @@ latter lemma to prove that the function `fun x => x⁻¹` is integrable on `a..b integrable function -/ +@[expose] public section + open scoped MeasureTheory Topology Interval NNReal ENNReal diff --git a/Mathlib/Analysis/SpecialFunctions/OrdinaryHypergeometric.lean b/Mathlib/Analysis/SpecialFunctions/OrdinaryHypergeometric.lean index cc48209a8b909f..6c9c3fc6e8f558 100644 --- a/Mathlib/Analysis/SpecialFunctions/OrdinaryHypergeometric.lean +++ b/Mathlib/Analysis/SpecialFunctions/OrdinaryHypergeometric.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Edward Watine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Edward Watine -/ -import Mathlib.Analysis.Analytic.OfScalars -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.Analysis.Analytic.OfScalars +public import Mathlib.Analysis.RCLike.Basic /-! # Ordinary hypergeometric function in a Banach algebra @@ -49,6 +51,8 @@ See . hypergeometric, gaussian, ordinary -/ +@[expose] public section + open Nat FormalMultilinearSeries section Field diff --git a/Mathlib/Analysis/SpecialFunctions/Pochhammer.lean b/Mathlib/Analysis/SpecialFunctions/Pochhammer.lean index ef196e341e9a66..ccd2fb6cbedee3 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pochhammer.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pochhammer.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Horner -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.Convex.Deriv -import Mathlib.Analysis.Convex.Piecewise -import Mathlib.Analysis.Convex.Jensen +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.Convex.Deriv +public import Mathlib.Analysis.Convex.Piecewise +public import Mathlib.Analysis.Convex.Jensen /-! # Pochhammer polynomials @@ -28,6 +30,8 @@ This file proves analysis theorems for Pochhammer polynomials. for `Nat.choose`. -/ +@[expose] public section + section DescPochhammer diff --git a/Mathlib/Analysis/SpecialFunctions/PolarCoord.lean b/Mathlib/Analysis/SpecialFunctions/PolarCoord.lean index f8a7d7c9e9ae66..873c85e9fb7c9e 100644 --- a/Mathlib/Analysis/SpecialFunctions/PolarCoord.lean +++ b/Mathlib/Analysis/SpecialFunctions/PolarCoord.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Function.Jacobian -import Mathlib.MeasureTheory.Measure.Lebesgue.Complex -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +module + +public import Mathlib.MeasureTheory.Function.Jacobian +public import Mathlib.MeasureTheory.Measure.Lebesgue.Complex +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv /-! # Polar coordinates @@ -18,6 +20,8 @@ It satisfies the following change of variables formula (see `integral_comp_polar -/ +@[expose] public section + noncomputable section Real open Real Set MeasureTheory diff --git a/Mathlib/Analysis/SpecialFunctions/PolynomialExp.lean b/Mathlib/Analysis/SpecialFunctions/PolynomialExp.lean index 4a471bc1af1142..3f663062d1a88c 100644 --- a/Mathlib/Analysis/SpecialFunctions/PolynomialExp.lean +++ b/Mathlib/Analysis/SpecialFunctions/PolynomialExp.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Exp +module + +public import Mathlib.Analysis.SpecialFunctions.Exp /-! # Limits of `P(x) / e ^ x` for a polynomial `P` @@ -19,6 +21,8 @@ Add more similar lemmas: limit at `-∞`, versions with $e^{cx}$ etc. polynomial, limit, exponential -/ +@[expose] public section + open Filter Topology Real namespace Polynomial diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean index 03e77e736a33f7..a4d6eed504ebc3 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean @@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal /-! # Limits and asymptotics of power functions at `+∞` @@ -14,6 +16,8 @@ some results on asymptotics as `x → 0` (those which are not just continuity st located here. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean index 616cf96b8095dd..67af1099ddb412 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean @@ -4,13 +4,17 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Log +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.Log /-! # Power function on `ℂ` We construct the power functions `x ^ y`, where `x` and `y` are complex numbers. -/ +@[expose] public section + open Real Topology Filter ComplexConjugate Finset Set namespace Complex diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean index 2b3cab5a2e8f14..98d88e3e26dba8 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean @@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics /-! # Continuity of power functions @@ -12,6 +14,8 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics This file contains lemmas about continuity of the power functions on `ℂ`, `ℝ`, `ℝ≥0`, and `ℝ≥0∞`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean index c44b7cc1dec25a..d3ac4fd2004c50 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean @@ -4,12 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv -import Mathlib.Analysis.Calculus.FDeriv.Extend -import Mathlib.Analysis.Calculus.Deriv.Prod -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv +public import Mathlib.Analysis.Calculus.FDeriv.Extend +public import Mathlib.Analysis.Calculus.Deriv.Prod +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv /-! # Derivatives of power function on `ℂ`, `ℝ`, `ℝ≥0`, and `ℝ≥0∞` @@ -17,6 +19,8 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv We also prove differentiability and provide derivatives for the power functions `x ^ y`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean index 569240ee025073..0d69407cd9f8cc 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.MeasureTheory.Integral.Layercake +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.MeasureTheory.Integral.Layercake /-! # The integral of the real power of a nonnegative function @@ -22,13 +24,15 @@ A variant of the formula with measures of sets of the form `{ω | f(ω) > t}` in `MeasureTheory.lintegral_rpow_eq_lintegral_meas_lt_mul`: other common special cases of the layer cake formulas, stating that for a nonnegative function `f` and `p > 0`, we have `∫ f(ω)ᵖ ∂μ(ω) = p * ∫ μ {ω | f(ω) ≥ t} * tᵖ⁻¹ dt` and - `∫ f(ω)ᵖ ∂μ(ω) = p * ∫ μ {ω | f(ω) > t} * tᵖ⁻¹ dt, respectively. + `∫ f(ω)ᵖ ∂μ(ω) = p * ∫ μ {ω | f(ω) > t} * tᵖ⁻¹ dt`, respectively. ## Tags layer cake representation, Cavalieri's principle, tail probability formula -/ +@[expose] public section + open Set namespace MeasureTheory diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean b/Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean index ceb9e6c5b31e63..5e77ad962f1c0a 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean @@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Real +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! # Power function on `ℝ≥0` and `ℝ≥0∞` @@ -16,6 +18,8 @@ We construct the power functions `x ^ y` where We also prove basic properties of these functions. -/ +@[expose] public section + noncomputable section open Real NNReal ENNReal ComplexConjugate Finset Function Set @@ -1076,7 +1080,7 @@ open Lean Meta Qq the base is nonnegative and positive when the base is positive. This is the `NNReal` analogue of `evalRpow` for `Real`. -/ @[positivity (_ : ℝ≥0) ^ (_ : ℝ)] -def evalNNRealRpow : PositivityExt where eval {u α} _ _ e := do +meta def evalNNRealRpow : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ≥0), ~q($a ^ (0 : ℝ)) => assertInstancesCommute @@ -1090,7 +1094,7 @@ def evalNNRealRpow : PositivityExt where eval {u α} _ _ e := do | _ => pure (.nonnegative q(zero_le $e)) | _, _, _ => throwError "not NNReal.rpow" -private def isFiniteM? (x : Q(ℝ≥0∞)) : MetaM (Option Q($x ≠ (⊤ : ℝ≥0∞))) := do +private meta def isFiniteM? (x : Q(ℝ≥0∞)) : MetaM (Option Q($x ≠ (⊤ : ℝ≥0∞))) := do let mvar ← mkFreshExprMVar q($x ≠ (⊤ : ℝ≥0∞)) let save ← saveState let (goals, _) ← Elab.runTactic mvar.mvarId! <|← `(tactic| finiteness) @@ -1104,7 +1108,7 @@ private def isFiniteM? (x : Q(ℝ≥0∞)) : MetaM (Option Q($x ≠ (⊤ : ℝ the base is nonnegative and positive when the base is positive. This is the `ENNReal` analogue of `evalRpow` for `Real`. -/ @[positivity (_ : ℝ≥0∞) ^ (_ : ℝ)] -def evalENNRealRpow : PositivityExt where eval {u α} _ _ e := do +meta def evalENNRealRpow : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ≥0∞), ~q($a ^ (0 : ℝ)) => assertInstancesCommute diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/NthRootLemmas.lean b/Mathlib/Analysis/SpecialFunctions/Pow/NthRootLemmas.lean index aef13173e6c38b..07d4a8a76c0beb 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/NthRootLemmas.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/NthRootLemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Concordance Inc. dba Harmonic. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Floor.Semifield -import Mathlib.Analysis.MeanInequalities -import Mathlib.Data.Nat.NthRoot.Defs -import Mathlib.Tactic.Rify +module + +public import Mathlib.Algebra.Order.Floor.Semifield +public import Mathlib.Analysis.MeanInequalities +public import Mathlib.Data.Nat.NthRoot.Defs +public import Mathlib.Tactic.Rify /-! # Lemmas about `Nat.nthRoot` @@ -19,6 +21,8 @@ Rewrite the proof of `Nat.nthRoot.lt_pow_go_succ_aux` to avoid dependencies on r so that we can move this file to `Mathlib/Data/Nat/NthRoot`, then to Batteries. -/ +@[expose] public section + namespace Nat variable {m n a b guess fuel : ℕ} diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Real.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Real.lean index bda8460c37fd09..72305b6637bede 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Real.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Real.lean @@ -4,15 +4,19 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Complex -import Mathlib.Data.Nat.NthRoot.Defs -import Qq +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Complex +public meta import Mathlib.Data.Nat.NthRoot.Defs +public import Qq /-! # Power function on `ℝ` We construct the power functions `x ^ y`, where `x` and `y` are real numbers. -/ +@[expose] public section + noncomputable section @@ -362,7 +366,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: exponentiation by a real number is positive (namely 1) when the exponent is zero. The other cases are done in `evalRpow`. -/ @[positivity (_ : ℝ) ^ (0 : ℝ)] -def evalRpowZero : PositivityExt where eval {u α} _ _ e := do +meta def evalRpowZero : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q($a ^ (0 : ℝ)) => assertInstancesCommute @@ -372,7 +376,7 @@ def evalRpowZero : PositivityExt where eval {u α} _ _ e := do /-- Extension for the `positivity` tactic: exponentiation by a real number is nonnegative when the base is nonnegative and positive when the base is positive. -/ @[positivity (_ : ℝ) ^ (_ : ℝ)] -def evalRpow : PositivityExt where eval {u α} _zα _pα e := do +meta def evalRpow : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q($a ^ ($b : ℝ)) => let ra ← core q(inferInstance) q(inferInstance) a @@ -1128,7 +1132,7 @@ returns a tuple of Fails if `na` is not a `db`th power of a natural number. -/ -def proveIsNatRPowIsNNRat +meta def proveIsNatRPowIsNNRat (a : Q(ℝ)) (na : Q(ℕ)) (pa : Q(IsNat $a $na)) (b : Q(ℝ)) (nb db : Q(ℕ)) (pb : Q(IsNNRat $b $nb $db)) : MetaM (ℕ × Σ r : Q(ℕ), Q(IsNat ($a ^ $b) $r)) := do @@ -1148,7 +1152,7 @@ except for the case `a < 0`, `b` isn't integer. TODO: simplify terms like `(-a : ℝ) ^ (b / 3 : ℝ)` and `(-a : ℝ) ^ (b / 2 : ℝ)` too, possibly after first considering changing the junk value. -/ @[norm_num (_ : ℝ) ^ (_ : ℝ)] -def evalRPow : NormNumExt where eval {u αR} e := do +meta def evalRPow : NormNumExt where eval {u αR} e := do match u, αR, e with | 0, ~q(ℝ), ~q(($a : ℝ)^($b : ℝ)) => match ← derive b with diff --git a/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean b/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean index d7125a9ac60cdd..5620b98e4de691 100644 --- a/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean +++ b/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Gaëtan Serré. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gaëtan Serré, Rémy Degenne -/ -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Log.Basic -import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal -import Mathlib.Topology.Algebra.Module.ModuleTopology +module + +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal +public import Mathlib.Topology.Algebra.Module.ModuleTopology /-! # Sigmoid function @@ -53,6 +55,8 @@ that the composition of this embedding with the measurable embedding from a stan sigmoid, embedding, measurable embedding, topological embedding -/ +@[expose] public section + namespace Real /-- The sigmoid function from `ℝ` to `ℝ`. -/ diff --git a/Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean b/Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean index 7fa2b21bf95c5d..69e97fc5ebcaf6 100644 --- a/Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean +++ b/Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.PolynomialExp +module + +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.SpecialFunctions.PolynomialExp /-! # Infinitely smooth transition function @@ -21,6 +23,8 @@ cannot have: by `expNegInvGlue x / (expNegInvGlue x + expNegInvGlue (1 - x))`; -/ +@[expose] public section + noncomputable section open scoped Topology diff --git a/Mathlib/Analysis/SpecialFunctions/Sqrt.lean b/Mathlib/Analysis/SpecialFunctions/Sqrt.lean index bd3083820833fa..a0eae871db9c63 100644 --- a/Mathlib/Analysis/SpecialFunctions/Sqrt.lean +++ b/Mathlib/Analysis/SpecialFunctions/Sqrt.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Calculus.Deriv.Pow +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.Deriv.Pow /-! # Smoothness of `Real.sqrt` @@ -17,6 +19,8 @@ dot-notation lemmas. sqrt, differentiable -/ +@[expose] public section + open Set diff --git a/Mathlib/Analysis/SpecialFunctions/Stirling.lean b/Mathlib/Analysis/SpecialFunctions/Stirling.lean index ed07f9a26a1099..899b4e0d8b3b65 100644 --- a/Mathlib/Analysis/SpecialFunctions/Stirling.lean +++ b/Mathlib/Analysis/SpecialFunctions/Stirling.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Firsching, Fabian Kruse, Nikolas Kuhn -/ -import Mathlib.Analysis.PSeries -import Mathlib.Analysis.Real.Pi.Wallis -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Analysis.PSeries +public import Mathlib.Analysis.Real.Pi.Wallis +public import Mathlib.Tactic.AdaptationNote /-! # Stirling's formula @@ -32,6 +34,8 @@ and prove that $a = \sqrt{\pi}$. Here the main ingredient is the convergence of formula for `π`. -/ +@[expose] public section + open scoped Topology Real Nat Asymptotics diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean index 9d36be49cb3405..0527dcc16cc1c2 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -import Mathlib.Analysis.Normed.Group.AddCircle -import Mathlib.Algebra.CharZero.Quotient -import Mathlib.Topology.Instances.Sign +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.Analysis.Normed.Group.AddCircle +public import Mathlib.Algebra.CharZero.Quotient +public import Mathlib.Topology.Instances.Sign /-! # The type of angles @@ -15,6 +17,8 @@ In this file we define `Real.Angle` to be the quotient group `ℝ/2πℤ` and pr about trigonometric functions and angles. -/ +@[expose] public section + open Real diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean index 226a554edb3f18..f5f7e5305be42c 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex /-! # The `arctan` function. @@ -18,6 +20,8 @@ The result of `arctan x + arctan y` is given by `arctan_add`, `arctan_add_eq_add `four_mul_arctan_inv_5_sub_arctan_inv_239`. -/ +@[expose] public section + noncomputable section @@ -386,7 +390,7 @@ open Lean Meta Qq /-- Extension for `Real.arctan`. -/ @[positivity Real.arctan _] -def evalRealArctan : PositivityExt where eval {u α} z p e := do +meta def evalRealArctan : PositivityExt where eval {u α} z p e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.arctan $a) => let ra ← core z p a @@ -400,7 +404,7 @@ def evalRealArctan : PositivityExt where eval {u α} z p e := do /-- Extension for `Real.cos (Real.arctan _)`. -/ @[positivity Real.cos (Real.arctan _)] -def evalRealCosArctan : PositivityExt where eval {u α} _ _ e := do +meta def evalRealCosArctan : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.cos (Real.arctan $a)) => assumeInstancesCommute @@ -409,7 +413,7 @@ def evalRealCosArctan : PositivityExt where eval {u α} _ _ e := do /-- Extension for `Real.sin (Real.arctan _)`. -/ @[positivity Real.sin (Real.arctan _)] -def evalRealSinArctan : PositivityExt where eval {u α} z p e := do +meta def evalRealSinArctan : PositivityExt where eval {u α} z p e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.sin (Real.arctan $a)) => assumeInstancesCommute diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/ArctanDeriv.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/ArctanDeriv.lean index e844768a69a1b4..80f4de6eb60c7c 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/ArctanDeriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/ArctanDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan -import Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv /-! # Derivatives of the `tan` and `arctan` functions. @@ -12,6 +14,8 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv Continuity and derivatives of the tangent and arctangent functions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean index 64d202ba87e0b4..5a97e71c96b278 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Algebra.Field.NegOnePow -import Mathlib.Algebra.Field.Periodic -import Mathlib.Algebra.QuadraticDiscriminant -import Mathlib.Analysis.SpecialFunctions.Exp +module + +public import Mathlib.Algebra.Field.NegOnePow +public import Mathlib.Algebra.Field.Periodic +public import Mathlib.Algebra.QuadraticDiscriminant +public import Mathlib.Analysis.SpecialFunctions.Exp /-! # Trigonometric functions @@ -41,6 +43,8 @@ in terms of Chebyshev polynomials. sin, cos, tan, angle -/ +@[expose] public section + noncomputable section @@ -172,7 +176,7 @@ open Lean.Meta Qq /-- Extension for the `positivity` tactic: `π` is always positive. -/ @[positivity Real.pi] -def evalRealPi : PositivityExt where eval {u α} _zα _pα e := do +meta def evalRealPi : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(Real.pi) => assertInstancesCommute diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Bounds.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Bounds.lean index 2f3d2758183919..bb8ea63b1cf06e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Bounds.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Bounds.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler, Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Convex.SpecificFunctions.Deriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv +module + +public import Mathlib.Analysis.Convex.SpecificFunctions.Deriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv /-! # Polynomial bounds for trigonometric functions @@ -29,6 +31,8 @@ Here we prove the following: sin, cos, tan, angle -/ +@[expose] public section + open Set namespace Real diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean index e05f5f903bad16..c84f01c8e5f43e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Analysis.Complex.Trigonometric -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.RingTheory.Polynomial.Chebyshev +module + +public import Mathlib.Analysis.Complex.Trigonometric +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.RingTheory.Polynomial.Chebyshev /-! # Multiple angle formulas in terms of Chebyshev polynomials @@ -15,6 +17,8 @@ This file gives the trigonometric characterizations of Chebyshev polynomials, fo (`Complex.cosh`) hyperbolic cosine. -/ +@[expose] public section + namespace Polynomial.Chebyshev diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean index eb139d799bed61..3e6848a962de1e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Algebra.QuadraticDiscriminant -import Mathlib.Analysis.SpecialFunctions.Pow.Complex +module + +public import Mathlib.Algebra.QuadraticDiscriminant +public import Mathlib.Analysis.SpecialFunctions.Pow.Complex /-! # Complex trigonometric functions @@ -17,6 +19,8 @@ as they are most easily proved by appealing to the corresponding fact for comple functions, or require additional imports which are not available in that file. -/ +@[expose] public section + noncomputable section @@ -178,6 +182,35 @@ theorem tan_eq {z : ℂ} tan z = (tan z.re + tanh z.im * I) / (1 - tan z.re * tanh z.im * I) := by convert tan_add_mul_I h; exact (re_add_im z).symm +/-- `tan x` takes the junk value `0` when `cos x = 0` -/ +lemma tan_eq_zero_of_cos_eq_zero {x} (h : cos x = 0) : tan x = 0 := by + obtain ⟨k, hxk⟩ := cos_eq_zero_iff.mp h + exact tan_eq_zero_iff.mpr ⟨2 * k + 1, by simp [hxk]⟩ + +-- tangent half-angle substitution formulas + +theorem cos_eq_two_mul_tan_half_div_one_sub_tan_half_sq (x : ℂ) (h : cos x ≠ -1) : + cos x = (1 - tan (x / 2) ^ 2) / (1 + tan (x / 2) ^ 2) := by + conv_lhs => rw [← mul_div_cancel₀ x two_ne_zero, cos_two_mul'] + have : cos (x / 2) ≠ 0 := by grind [cos_ne_zero_iff, cos_eq_neg_one_iff] + rw [div_eq_mul_inv (1 - tan (x / 2) ^ 2) (1 + tan (x / 2) ^ 2), inv_one_add_tan_sq this, + ← tan_mul_cos this] + ring + +/-- `tan (x / 2)` takes the junk value `0` when `sin x = 0` so this always holds. -/ +theorem sin_eq_two_mul_tan_half_div_one_add_tan_half_sq (x : ℂ) : + sin x = (2 * tan (x / 2)) / (1 + tan (x / 2) ^ 2) := by + conv_lhs => rw [← mul_div_cancel₀ x two_ne_zero, sin_two_mul] + by_cases h : cos (x / 2) = 0 + · simp [h, tan_eq_zero_of_cos_eq_zero] + · rw [div_eq_mul_inv (2 * tan (x / 2)) (1 + tan (x / 2) ^ 2), inv_one_add_tan_sq h, + ← tan_mul_cos h] + ring + +theorem tan_eq_one_sub_tan_half_sq_div_one_add_tan_half_sq (x : ℂ) : + tan x = (2 * tan (x / 2)) / (1 - tan (x / 2) ^ 2) := by + conv_lhs => rw [← mul_div_cancel₀ x two_ne_zero, tan_two_mul] + open scoped Topology theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0} := @@ -257,4 +290,23 @@ theorem tan_eq_zero_iff' {θ : ℝ} (hθ : cos θ ≠ 0) : tan θ = 0 ↔ ∃ k theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, k * π / 2 ≠ θ := mod_cast @Complex.tan_ne_zero_iff θ +/-- `tan x` takes the junk value `0` when `cos x = 0` -/ +lemma tan_eq_zero_of_cos_eq_zero {x} (h : cos x = 0) : tan x = 0 := + mod_cast @Complex.tan_eq_zero_of_cos_eq_zero x (mod_cast h) + +-- tangent half-angle substitution formulas + +theorem cos_eq_two_mul_tan_half_div_one_sub_tan_half_sq (x : ℝ) (h : cos x ≠ -1) : + cos x = (1 - tan (x / 2) ^ 2) / (1 + tan (x / 2) ^ 2) := + mod_cast @Complex.cos_eq_two_mul_tan_half_div_one_sub_tan_half_sq x (mod_cast h) + +/-- `tan (x / 2)` takes the junk value `0` when `sin x = 0` so this always holds. -/ +theorem sin_eq_two_mul_tan_half_div_one_add_tan_half_sq (x : ℝ) : + sin x = (2 * tan (x / 2)) / (1 + tan (x / 2) ^ 2) := + mod_cast @Complex.sin_eq_two_mul_tan_half_div_one_add_tan_half_sq x + +theorem tan_eq_one_sub_tan_half_sq_div_one_add_tan_half_sq (x : ℝ) : + tan x = (2 * tan (x / 2)) / (1 - tan (x / 2) ^ 2) := + mod_cast @Complex.tan_eq_one_sub_tan_half_sq_div_one_add_tan_half_sq x + end Real diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean index a5f38eee297114..00d2fa36ea9bd0 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv /-! # Complex trigonometric functions @@ -12,6 +14,8 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv Basic facts and derivatives for the complex trigonometric functions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Cotangent.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Cotangent.lean index 8a8d1a6a71e2d1..c389abb801d65d 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Cotangent.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Cotangent.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Calculus.IteratedDeriv.WithinZpow -import Mathlib.Analysis.Complex.UpperHalfPlane.Exp -import Mathlib.Analysis.Complex.IntegerCompl -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.Analysis.PSeries -import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable -import Mathlib.Topology.Algebra.InfiniteSum.TsumUniformlyOn +module + +public import Mathlib.Analysis.Calculus.IteratedDeriv.WithinZpow +public import Mathlib.Analysis.Complex.UpperHalfPlane.Exp +public import Mathlib.Analysis.Complex.IntegerCompl +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.Analysis.PSeries +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd +public import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable +public import Mathlib.Topology.Algebra.InfiniteSum.TsumUniformlyOn /-! # Cotangent @@ -23,6 +25,8 @@ as well as the infinite sum representation of cotangent (also known as the Mitta expansion): `π * cot (π * z) = 1 / z + ∑' n : ℕ+, (1 / (z - n) + 1 / (z + n))`. -/ +@[expose] public section + open Real Complex open scoped UpperHalfPlane diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Deriv.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Deriv.lean index 23e1c489d28b6a..2cbb74253eb641 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Deriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Deriv.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Order.Monotone.Odd -import Mathlib.Analysis.Calculus.LogDeriv -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -import Mathlib.Analysis.Calculus.Deriv.MeanValue +module + +public import Mathlib.Order.Monotone.Odd +public import Mathlib.Analysis.Calculus.LogDeriv +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.Analysis.Calculus.Deriv.MeanValue /-! # Differentiability of trigonometric functions @@ -22,6 +24,8 @@ computed. sin, cos, tan, angle -/ +@[expose] public section + noncomputable section open scoped Asymptotics Topology Filter @@ -1463,7 +1467,7 @@ private alias ⟨_, sinh_ne_zero_of_ne_zero⟩ := Real.sinh_ne_zero /-- Extension for the `positivity` tactic: `Real.sinh` is positive/nonnegative/nonzero if its input is. -/ @[positivity Real.sinh _] -def evalSinh : PositivityExt where eval {u α} _ _ e := do +meta def evalSinh : PositivityExt where eval {u α} _ _ e := do let zα : Q(Zero ℝ) := q(inferInstance) let pα : Q(PartialOrder ℝ) := q(inferInstance) match u, α, e with diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean index d6acb4a5be0da2..297d477d19e2c5 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.MeasureTheory.Integral.PeakFunction +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.MeasureTheory.Integral.PeakFunction /-! # Euler's infinite product for the sine function @@ -18,6 +20,8 @@ is to prove a recurrence relation for the integrals `∫ x in 0..π/2, cos 2 z x generalising the arguments used to prove Wallis' limit formula for `π`. -/ +@[expose] public section + open scoped Real Topology open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean index 2ca7f21a104ccb..d64c63165a0ae2 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -import Mathlib.Topology.Order.ProjIcc +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.Topology.Order.ProjIcc /-! # Inverse trigonometric functions. @@ -15,6 +17,8 @@ See also `Analysis.SpecialFunctions.Trigonometric.Arctan` for the inverse tan fu Basic inequalities on trigonometric functions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/InverseDeriv.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/InverseDeriv.lean index 5502519e1cf07f..edb923adc61005 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/InverseDeriv.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/InverseDeriv.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv /-! # derivatives of the inverse trigonometric functions @@ -12,6 +14,8 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv Derivatives of `arcsin` and `arccos`. -/ +@[expose] public section + noncomputable section open scoped Topology Filter Real ContDiff diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Series.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Series.lean index 1b4bd178aab5dd..9f5b91a0ed1edd 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Series.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Series.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Yaël Dillies -/ -import Mathlib.Analysis.Complex.Trigonometric -import Mathlib.Analysis.SpecialFunctions.Exponential +module + +public import Mathlib.Analysis.Complex.Trigonometric +public import Mathlib.Analysis.SpecialFunctions.Exponential /-! # Trigonometric functions as sums of infinite series @@ -19,6 +21,8 @@ In this file we express trigonometric functions in terms of their series expansi * `Real.hasSum_sin`, `Real.sin_eq_tsum`: `Real.sin` as the sum of an infinite series. -/ +@[expose] public section + open NormedSpace open scoped Nat diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Sinc.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Sinc.lean index 58b6de4ab0d2a3..b338262c7656fa 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Sinc.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Sinc.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds -import Mathlib.Analysis.Calculus.DSlope +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds +public import Mathlib.Analysis.Calculus.DSlope /-! # Sinc function @@ -22,6 +24,8 @@ This file contains the definition of the sinc function and some of its propertie -/ +@[expose] public section + open Filter open scoped Topology diff --git a/Mathlib/Analysis/SpecificLimits/ArithmeticGeometric.lean b/Mathlib/Analysis/SpecificLimits/ArithmeticGeometric.lean index 98034c55e82863..a415bae61f70c5 100644 --- a/Mathlib/Analysis/SpecificLimits/ArithmeticGeometric.lean +++ b/Mathlib/Analysis/SpecificLimits/ArithmeticGeometric.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.SpecificLimits.Basic +module + +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Arithmetic-geometric sequences @@ -28,6 +30,8 @@ An arithmetic-geometric sequence is a sequence defined by the recurrence relatio -/ +@[expose] public section + open Filter Topology variable {R : Type*} {a b u₀ : R} diff --git a/Mathlib/Analysis/SpecificLimits/Basic.lean b/Mathlib/Analysis/SpecificLimits/Basic.lean index ba684af67bd822..26b40c5ac2e3ce 100644 --- a/Mathlib/Analysis/SpecificLimits/Basic.lean +++ b/Mathlib/Analysis/SpecificLimits/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Johannes Hölzl, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Algebra.Field.GeomSum -import Mathlib.Data.Nat.Factorial.BigOperators -import Mathlib.Order.Filter.AtTopBot.Archimedean -import Mathlib.Order.Iterate -import Mathlib.Topology.Algebra.Algebra -import Mathlib.Topology.Algebra.InfiniteSum.Real -import Mathlib.Topology.Instances.EReal.Lemmas -import Mathlib.Topology.Instances.Rat +module + +public import Mathlib.Algebra.Field.GeomSum +public import Mathlib.Data.Nat.Factorial.BigOperators +public import Mathlib.Order.Filter.AtTopBot.Archimedean +public import Mathlib.Order.Iterate +public import Mathlib.Topology.Algebra.Algebra +public import Mathlib.Topology.Algebra.InfiniteSum.Real +public import Mathlib.Topology.Instances.EReal.Lemmas +public import Mathlib.Topology.Instances.Rat /-! # A collection of specific limit computations @@ -20,6 +22,8 @@ important specific limit computations in metric spaces, in ordered rings/fields, instances of these such as `ℝ`, `ℝ≥0` and `ℝ≥0∞`. -/ +@[expose] public section + assert_not_exists Module.Basis NormedSpace noncomputable section diff --git a/Mathlib/Analysis/SpecificLimits/Fibonacci.lean b/Mathlib/Analysis/SpecificLimits/Fibonacci.lean index c909eff4ecfeac..75211b4e82ad12 100644 --- a/Mathlib/Analysis/SpecificLimits/Fibonacci.lean +++ b/Mathlib/Analysis/SpecificLimits/Fibonacci.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Snir Broshi. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Snir Broshi -/ -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.NumberTheory.Real.GoldenRatio +module + +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.NumberTheory.Real.GoldenRatio /-! # The ratio of consecutive Fibonacci numbers @@ -12,6 +14,8 @@ import Mathlib.NumberTheory.Real.GoldenRatio We prove that the ratio of consecutive Fibonacci numbers tends to the golden ratio. -/ +@[expose] public section + open Nat Real Filter Tendsto open scoped Topology goldenRatio diff --git a/Mathlib/Analysis/SpecificLimits/FloorPow.lean b/Mathlib/Analysis/SpecificLimits/FloorPow.lean index 4177fd21a869c2..fd0955d28583ca 100644 --- a/Mathlib/Analysis/SpecificLimits/FloorPow.lean +++ b/Mathlib/Analysis/SpecificLimits/FloorPow.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.Order.Field.GeomSum -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.Real +module + +public import Mathlib.Algebra.Order.Field.GeomSum +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! # Results on discretized exponentials @@ -18,6 +20,8 @@ We state several auxiliary results pertaining to sequences of the form `⌊c^n to `1/j^2`, up to a multiplicative constant. -/ +@[expose] public section + open Filter Finset open Topology diff --git a/Mathlib/Analysis/SpecificLimits/Normed.lean b/Mathlib/Analysis/SpecificLimits/Normed.lean index 37190af7e0506c..a559ef17cc43cd 100644 --- a/Mathlib/Analysis/SpecificLimits/Normed.lean +++ b/Mathlib/Analysis/SpecificLimits/Normed.lean @@ -3,19 +3,21 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Sébastien Gouëzel, Yury Kudryashov, Dylan MacKenzie, Patrick Massot -/ -import Mathlib.Algebra.BigOperators.Module -import Mathlib.Algebra.Order.Field.Power -import Mathlib.Algebra.Polynomial.Monic -import Mathlib.Analysis.Asymptotics.Lemmas -import Mathlib.Analysis.Normed.Ring.InfiniteSum -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.Analysis.Normed.Order.Lattice -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Data.List.TFAE -import Mathlib.Data.Nat.Choose.Bounds -import Mathlib.Order.Filter.AtTopBot.ModEq -import Mathlib.RingTheory.Polynomial.Pochhammer -import Mathlib.Tactic.NoncommRing +module + +public import Mathlib.Algebra.BigOperators.Module +public import Mathlib.Algebra.Order.Field.Power +public import Mathlib.Algebra.Polynomial.Monic +public import Mathlib.Analysis.Asymptotics.Lemmas +public import Mathlib.Analysis.Normed.Ring.InfiniteSum +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.Analysis.Normed.Order.Lattice +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Data.List.TFAE +public import Mathlib.Data.Nat.Choose.Bounds +public import Mathlib.Order.Filter.AtTopBot.ModEq +public import Mathlib.RingTheory.Polynomial.Pochhammer +public import Mathlib.Tactic.NoncommRing /-! # A collection of specific limit computations @@ -24,6 +26,8 @@ This file contains important specific limit computations in (semi-)normed groups well as such computations in `ℝ` when the natural proof passes through a fact about normed spaces. -/ +@[expose] public section + noncomputable section open Set Function Filter Finset Metric Asymptotics Topology Nat NNReal ENNReal diff --git a/Mathlib/Analysis/SpecificLimits/RCLike.lean b/Mathlib/Analysis/SpecificLimits/RCLike.lean index 963f86000379d8..ad75e64b6688c2 100644 --- a/Mathlib/Analysis/SpecificLimits/RCLike.lean +++ b/Mathlib/Analysis/SpecificLimits/RCLike.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Xavier Généreux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Généreux, Patrick Massot -/ -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Analysis.RCLike.Basic /-! # A collection of specific limit computations for `RCLike` -/ +@[expose] public section + open Set Algebra Filter open scoped Topology diff --git a/Mathlib/Analysis/Subadditive.lean b/Mathlib/Analysis/Subadditive.lean index 66a34d30b65f52..29766b5d76f23f 100644 --- a/Mathlib/Analysis/Subadditive.lean +++ b/Mathlib/Analysis/Subadditive.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Order.Filter.AtTopBot.Archimedean -import Mathlib.Order.Filter.AtTopBot.Finite -import Mathlib.Order.Filter.AtTopBot.Prod -import Mathlib.Topology.Algebra.Ring.Real +module + +public import Mathlib.Order.Filter.AtTopBot.Archimedean +public import Mathlib.Order.Filter.AtTopBot.Finite +public import Mathlib.Order.Filter.AtTopBot.Prod +public import Mathlib.Topology.Algebra.Ring.Real /-! # Convergence of subadditive sequences @@ -21,6 +23,8 @@ convenience). This result is known as Fekete's lemma in the literature. Define a bundled `SubadditiveHom`, use it. -/ +@[expose] public section + noncomputable section open Set Filter Topology diff --git a/Mathlib/Analysis/SumIntegralComparisons.lean b/Mathlib/Analysis/SumIntegralComparisons.lean index 2a51eded87183d..0203731f436d63 100644 --- a/Mathlib/Analysis/SumIntegralComparisons.lean +++ b/Mathlib/Analysis/SumIntegralComparisons.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kevin H. Wilson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin H. Wilson -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.Data.Set.Function +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.Data.Set.Function /-! # Comparing sums and integrals @@ -40,6 +42,8 @@ At the moment it contains several lemmas in this direction, for antitone or mono analysis, comparison, asymptotics -/ +@[expose] public section + open Set MeasureTheory MeasureSpace diff --git a/Mathlib/Analysis/SumOverResidueClass.lean b/Mathlib/Analysis/SumOverResidueClass.lean index a20212cce403c1..606f6a45f77b0f 100644 --- a/Mathlib/Analysis/SumOverResidueClass.lean +++ b/Mathlib/Analysis/SumOverResidueClass.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.Data.ZMod.Basic -import Mathlib.Topology.Instances.ENNReal.Lemmas +module + +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Data.ZMod.Basic +public import Mathlib.Topology.Instances.ENNReal.Lemmas /-! # Sums over residue classes @@ -17,6 +19,8 @@ decreasing, then the sum over `f` restricted to any residue class mod `m ≠ 0` converges if and only if the sum over all of `ℕ` converges. -/ +@[expose] public section + lemma Finset.sum_indicator_mod {R : Type*} [AddCommMonoid R] (m : ℕ) [NeZero m] (f : ℕ → R) : f = ∑ a : ZMod m, {n : ℕ | (n : ZMod m) = a}.indicator f := by diff --git a/Mathlib/Analysis/VonNeumannAlgebra/Basic.lean b/Mathlib/Analysis/VonNeumannAlgebra/Basic.lean index 1e24b4b7e15352..7a0d78ce8d821c 100644 --- a/Mathlib/Analysis/VonNeumannAlgebra/Basic.lean +++ b/Mathlib/Analysis/VonNeumannAlgebra/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Analysis.CStarAlgebra.Classes -import Mathlib.Analysis.InnerProductSpace.Adjoint +module + +public import Mathlib.Analysis.CStarAlgebra.Classes +public import Mathlib.Analysis.InnerProductSpace.Adjoint /-! # Von Neumann algebras @@ -22,6 +24,8 @@ We'll also need to prove the von Neumann double commutant theorem, that the concrete definition is equivalent to a *-closed subalgebra which is weakly closed. -/ +@[expose] public section + universe u v diff --git a/Mathlib/CategoryTheory/Abelian/Basic.lean b/Mathlib/CategoryTheory/Abelian/Basic.lean index 05015aa3cfdbe2..6f4bd507279d26 100644 --- a/Mathlib/CategoryTheory/Abelian/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Johan Commelin, Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Constructions.Pullbacks -import Mathlib.CategoryTheory.Preadditive.Biproducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Abelian.NonPreadditive +module + +public import Mathlib.CategoryTheory.Limits.Constructions.Pullbacks +public import Mathlib.CategoryTheory.Preadditive.Biproducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Abelian.NonPreadditive /-! # Abelian categories @@ -80,6 +82,8 @@ convention: -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/CommSq.lean b/Mathlib/CategoryTheory/Abelian/CommSq.lean index 0979f6fb10a110..c9d439be3317aa 100644 --- a/Mathlib/CategoryTheory/Abelian/CommSq.lean +++ b/Mathlib/CategoryTheory/Abelian/CommSq.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.Refinements -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.Algebra.Homology.CommSq +module + +public import Mathlib.CategoryTheory.Abelian.Refinements +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.Algebra.Homology.CommSq /-! # The exact sequence attached to a pushout square @@ -23,6 +25,8 @@ We study the associated exact sequence `X₁ ⟶ X₂ ⊞ X₃ ⟶ X₄ ⟶ 0`. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/DiagramLemmas/Four.lean b/Mathlib/CategoryTheory/Abelian/DiagramLemmas/Four.lean index fc443c76cb081a..cd4d2f6dd5bb9a 100644 --- a/Mathlib/CategoryTheory/Abelian/DiagramLemmas/Four.lean +++ b/Mathlib/CategoryTheory/Abelian/DiagramLemmas/Four.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Joël Riou -/ -import Mathlib.Algebra.Homology.ExactSequence -import Mathlib.CategoryTheory.Abelian.Refinements +module + +public import Mathlib.Algebra.Homology.ExactSequence +public import Mathlib.CategoryTheory.Abelian.Refinements /-! # The four and five lemmas @@ -42,6 +44,8 @@ using duality, but this would require lengthy API developments for `ComposableAr four lemma, five lemma, diagram lemma, diagram chase -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean b/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean index c969ed44621948..f1275b4cd5b229 100644 --- a/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean +++ b/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma +module + +public import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma /-! # Long exact sequence for the kernel and cokernel of a composition @@ -32,6 +34,8 @@ to obtain isomorphisms `ker φ ≅ ker (f ≫ g)` and `coker φ ≅ coker (f ⋙ -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean b/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean index 5e3fd85640926d..5738ba3102d1b3 100644 --- a/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean +++ b/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Epimorphisms with an injective kernel @@ -18,6 +20,8 @@ degreewise. -/ +@[expose] public section + namespace CategoryTheory open Category Limits ZeroObject Preadditive diff --git a/Mathlib/CategoryTheory/Abelian/Exact.lean b/Mathlib/CategoryTheory/Abelian/Exact.lean index 93e6d822bc0258..35602ada423335 100644 --- a/Mathlib/CategoryTheory/Abelian/Exact.lean +++ b/Mathlib/CategoryTheory/Abelian/Exact.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Adam Topaz, Johan Commelin, Jakob von Raumer -/ -import Mathlib.Algebra.Homology.ImageToKernel -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.CategoryTheory.Abelian.Opposite -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Algebra.Homology.ImageToKernel +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.CategoryTheory.Abelian.Opposite +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.Tactic.TFAE /-! # Exact sequences in abelian categories @@ -31,6 +33,8 @@ true in more general settings. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Ext.lean b/Mathlib/CategoryTheory/Abelian/Ext.lean index fee524c6c7d4ee..3a256e84825227 100644 --- a/Mathlib/CategoryTheory/Abelian/Ext.lean +++ b/Mathlib/CategoryTheory/Abelian/Ext.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Adam Topaz -/ -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.Algebra.Homology.Opposite -import Mathlib.CategoryTheory.Abelian.LeftDerived -import Mathlib.CategoryTheory.Abelian.Opposite -import Mathlib.CategoryTheory.Abelian.Projective.Resolution -import Mathlib.CategoryTheory.Linear.Yoneda +module + +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Homology.Opposite +public import Mathlib.CategoryTheory.Abelian.LeftDerived +public import Mathlib.CategoryTheory.Abelian.Opposite +public import Mathlib.CategoryTheory.Abelian.Projective.Resolution +public import Mathlib.CategoryTheory.Linear.Yoneda /-! # Ext @@ -24,6 +26,8 @@ compute `Ext` using both projective or injective resolutions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/FreydMitchell.lean b/Mathlib/CategoryTheory/Abelian/FreydMitchell.lean index 6bc13c935f341e..1df183e77c56f8 100644 --- a/Mathlib/CategoryTheory/Abelian/FreydMitchell.lean +++ b/Mathlib/CategoryTheory/Abelian/FreydMitchell.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.Opposite -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Indization +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.Opposite +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Indization /-! # The Freyd-Mitchell embedding theorem @@ -72,6 +74,8 @@ small category, then this does not change anything. * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Section 9.6 -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Abelian/FunctorCategory.lean b/Mathlib/CategoryTheory/Abelian/FunctorCategory.lean index def26589382f51..1ecedce04b7e79 100644 --- a/Mathlib/CategoryTheory/Abelian/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Abelian/FunctorCategory.lean @@ -3,16 +3,20 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Abelian.Basic -import Mathlib.CategoryTheory.Preadditive.FunctorCategory -import Mathlib.CategoryTheory.Limits.FunctorCategory.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +module + +public import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels /-! # If `D` is abelian, then the functor category `C ⥤ D` is also abelian. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean index c5fb2401762352..91884b492d1f3c 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Isaac Hernando, Coleton Kotch, Adam Topaz -/ -import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor -import Mathlib.CategoryTheory.Abelian.FunctorCategory -import Mathlib.CategoryTheory.Limits.Constructions.Filtered -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Limits.Shapes.Countable -import Mathlib.Logic.Equiv.List +module + +public import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor +public import Mathlib.CategoryTheory.Abelian.FunctorCategory +public import Mathlib.CategoryTheory.Limits.Constructions.Filtered +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Limits.Shapes.Countable +public import Mathlib.Logic.Equiv.List /-! # Grothendieck Axioms @@ -47,6 +49,8 @@ individual axioms. An `AB4` category is an _abelian_ category satisfying `AB4`, -/ +@[expose] public section + namespace CategoryTheory open Limits Functor diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Colim.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Colim.lean index cf7569dde4ae19..df3854c5d21cd6 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Colim.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Colim.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Filtered.Final -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +module + +public import Mathlib.CategoryTheory.Filtered.Final +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic /-! # Exactness of colimits @@ -22,6 +24,8 @@ is filtered and `C` satisfies AB5). -/ +@[expose] public section + universe v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Connected.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Connected.lean index 135a2773a46f3f..78d1a34dda635b 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Connected.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Connected.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Pullbacks +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Pullbacks /-! # Pulling back connected colimits @@ -25,6 +27,8 @@ let `f : ℤ → ℤ ⊕ ℤ` be the diagonal map, and let `g := 𝟙 (ℤ ⊕ -/ +@[expose] public section + universe w' w v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/FunctorCategory.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/FunctorCategory.lean index 38ce82e5aefa39..7540ad71bc25ec 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/FunctorCategory.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic /-! # AB axioms in functor categories @@ -12,6 +14,8 @@ This file proves that, when the relevant limits and colimits exist, exactness of colimits carries over from `A` to the functor category `C ⥤ A` -/ +@[expose] public section + namespace CategoryTheory open CategoryTheory Limits Opposite diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Indization.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Indization.lean index 2b9ce592d9cd13..8e82b048b1042c 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Indization.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Indization.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Types -import Mathlib.CategoryTheory.Abelian.Indization -import Mathlib.CategoryTheory.Limits.Indization.Category -import Mathlib.CategoryTheory.Generator.Indization -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Types +public import Mathlib.CategoryTheory.Abelian.Indization +public import Mathlib.CategoryTheory.Limits.Indization.Category +public import Mathlib.CategoryTheory.Generator.Indization +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic /-! # AB axioms in the category of ind-objects @@ -17,6 +19,8 @@ We show that `Ind C` satisfies Grothendieck's axiom AB5 if `C` has finite limits `Ind C` is Grothendieck abelian if `C` is small and abelian. -/ +@[expose] public section + universe v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Sheaf.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Sheaf.lean index 530425726ca148..fb7553e81aa706 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Sheaf.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Sheaf.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic -import Mathlib.CategoryTheory.Generator.Sheaf -import Mathlib.CategoryTheory.Sites.Abelian -import Mathlib.CategoryTheory.Sites.Equivalence +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +public import Mathlib.CategoryTheory.Generator.Sheaf +public import Mathlib.CategoryTheory.Sites.Abelian +public import Mathlib.CategoryTheory.Sites.Equivalence /-! @@ -19,6 +21,8 @@ then `Sheaf J A` is a Grothendieck abelian category. -/ +@[expose] public section + universe v v₁ v₂ u u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Types.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Types.lean index 2389b7ce3f3ca7..f898a538cefc81 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Types.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Types.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +module + +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic /-! # The category of types satisfies Grothendieck's AB5 axiom @@ -13,6 +15,8 @@ This is of course just the well-known fact that filtered colimits commute with f the category of types. -/ +@[expose] public section + universe v namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Basic.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Basic.lean index 9c22d04e1ff75a..673439171e21b8 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Basic.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Paul Reichert. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Reichert -/ +module -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic -import Mathlib.CategoryTheory.Abelian.Subobject -import Mathlib.CategoryTheory.Abelian.Transfer -import Mathlib.CategoryTheory.Adjunction.AdjointFunctorTheorems -import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic +public import Mathlib.CategoryTheory.Abelian.Subobject +public import Mathlib.CategoryTheory.Abelian.Transfer +public import Mathlib.CategoryTheory.Adjunction.AdjointFunctorTheorems +public import Mathlib.CategoryTheory.Limits.HasLimits /-! @@ -42,6 +43,8 @@ Relevant implications of `IsGrothendieckAbelian` are established in -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean index 3bc41c0552be9f..891fb2dcdca338 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Subobject -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Subobject +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Morphisms to a colimit in a Grothendieck abelian category @@ -26,6 +28,8 @@ additional assumption that for any map `f : j ⟶ j'` in `J`, -/ +@[expose] public section + universe w v u namespace CategoryTheory @@ -91,7 +95,7 @@ lemma epi_f [IsFiltered J] : Epi (f y) := by (fun j ↦ by simpa using hf y j) (fun _ ↦ by simpa using hy.symm)).epi_f rfl -/-- The kernel of `g y` gives a family of subobjects of `X` indexed by `Under j`0`, and +/-- The kernel of `g y` gives a family of subobjects of `X` indexed by `Under j₀`, and we consider it as a functor `Under j₀ ⥤ MonoOver X`. -/ @[simps] noncomputable def F : Under j₀ ⥤ MonoOver X where diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Coseparator.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Coseparator.lean index 7862b6f667470f..3f887bcc6aa7a9 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Coseparator.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Coseparator.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.EnoughInjectives -import Mathlib.CategoryTheory.Generator.Abelian +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.EnoughInjectives +public import Mathlib.CategoryTheory.Generator.Abelian /-! # Grothendieck categories have a coseparator -/ +@[expose] public section + universe w v u namespace CategoryTheory.IsGrothendieckAbelian diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean index e77a92718d942b..3b7baf6881e526 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean @@ -3,14 +3,16 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.CommSq -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ColimCoyoneda -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Monomorphisms -import Mathlib.CategoryTheory.Abelian.Monomorphisms -import Mathlib.CategoryTheory.Preadditive.Injective.LiftingProperties -import Mathlib.CategoryTheory.SmallObject.Basic -import Mathlib.CategoryTheory.Subobject.HasCardinalLT -import Mathlib.Order.TransfiniteIteration +module + +public import Mathlib.CategoryTheory.Abelian.CommSq +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ColimCoyoneda +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Monomorphisms +public import Mathlib.CategoryTheory.Abelian.Monomorphisms +public import Mathlib.CategoryTheory.Preadditive.Injective.LiftingProperties +public import Mathlib.CategoryTheory.SmallObject.Basic +public import Mathlib.CategoryTheory.Subobject.HasCardinalLT +public import Mathlib.Order.TransfiniteIteration /-! # Grothendieck abelian categories have enough injectives @@ -59,6 +61,8 @@ Here, we split the argument into two separate facts: -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean index 1a99e5b1c10c09..a31f27576ab1e4 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.ModuleCat.Injective -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Connected -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Coseparator -import Mathlib.CategoryTheory.Preadditive.Injective.Preserves -import Mathlib.CategoryTheory.Preadditive.LiftToFinset -import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits +module + +public import Mathlib.Algebra.Category.ModuleCat.Injective +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Connected +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Coseparator +public import Mathlib.CategoryTheory.Preadditive.Injective.Preserves +public import Mathlib.CategoryTheory.Preadditive.LiftToFinset +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits /-! # The Gabriel-Popescu theorem @@ -31,6 +33,8 @@ The theorem as stated here implies that `C` is a Serre quotient of `ModuleCat (E * [Barry Mitchell, *A quick proof of the Gabriel-Popesco theorem*][mitchell1981] -/ +@[expose] public section + universe v u open CategoryTheory Limits Abelian diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/Opposite.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/Opposite.lean index ce1966b6be9187..85b1c1cd396922 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/Opposite.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/Opposite.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.Yoneda -import Mathlib.CategoryTheory.Generator.Abelian -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.EnoughInjectives +module + +public import Mathlib.CategoryTheory.Abelian.Yoneda +public import Mathlib.CategoryTheory.Generator.Abelian +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.EnoughInjectives /-! # Embedding opposites of Grothendieck categories @@ -15,6 +17,8 @@ an object `G : Cᵒᵖ` such that `preadditiveCoyonedaObj G : Cᵒᵖ ⥤ Module and exact and its precomposition with `F` is full if `F` is. -/ +@[expose] public section + universe v u open CategoryTheory Limits Opposite ZeroObject diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Monomorphisms.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Monomorphisms.lean index fef8b67f3934a7..62e9ccef8a7a8a 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Monomorphisms.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Monomorphisms.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Colim -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Colim +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition /-! # Monomorphisms in Grothendieck abelian categories @@ -15,6 +17,8 @@ monomorphisms are stable under transfinite composition. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean index acdf897e03763f..0beb5f65750c44 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Colim -import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic -import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered -import Mathlib.CategoryTheory.Subobject.Lattice +module + +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Colim +public import Mathlib.CategoryTheory.Abelian.GrothendieckCategory.Basic +public import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered +public import Mathlib.CategoryTheory.Subobject.Lattice /-! # Subobjects in Grothendieck abelian categories @@ -20,6 +22,8 @@ in the image of `F`. -/ +@[expose] public section + universe w v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Images.lean b/Mathlib/CategoryTheory/Abelian/Images.lean index 88b65f5fdbe98c..d5d83a3243edcd 100644 --- a/Mathlib/CategoryTheory/Abelian/Images.lean +++ b/Mathlib/CategoryTheory/Abelian/Images.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.Kernels +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! # The abelian image and coimage. @@ -21,6 +23,8 @@ and conversely a category with (co)kernels and finite products in which this mor is always an isomorphism is an abelian category. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Indization.lean b/Mathlib/CategoryTheory/Abelian/Indization.lean index b1598059f0fa8d..254be5c1f21580 100644 --- a/Mathlib/CategoryTheory/Abelian/Indization.lean +++ b/Mathlib/CategoryTheory/Abelian/Indization.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Preadditive.Indization -import Mathlib.CategoryTheory.Abelian.FunctorCategory -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages +module + +public import Mathlib.CategoryTheory.Preadditive.Indization +public import Mathlib.CategoryTheory.Abelian.FunctorCategory +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages /-! # The category of ind-objects is abelian @@ -16,6 +18,8 @@ In the file `Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Indization.lean`, this situation `Ind C` is in fact Grothendieck abelian. -/ +@[expose] public section + universe v open CategoryTheory.Abelian diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean b/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean index 5df5121b4d04fd..dfaea8068c9200 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Abelian.Exact -import Mathlib.CategoryTheory.Preadditive.Injective.Basic -import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits -import Mathlib.CategoryTheory.Preadditive.Yoneda.Injective -import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor +module + +public import Mathlib.CategoryTheory.Abelian.Exact +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Injective +public import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor /-! # Injective objects in abelian categories @@ -16,6 +18,8 @@ import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor on them preserves finite colimits. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean b/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean index 81be139f200016..8deaa5c9e38680 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughInjectives -import Mathlib.CategoryTheory.Abelian.Exact -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughInjectives +public import Mathlib.CategoryTheory.Abelian.Exact +public import Mathlib.Data.ENat.Lattice /-! # Injective dimension @@ -24,6 +26,8 @@ We also define the Injective dimension in `WithBot ℕ∞` as `injectiveDimensio -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean b/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean index 8cbfada80a8a16..397810ffcf3792 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.Injective.Resolution -import Mathlib.Algebra.Homology.HomotopyCategory -import Mathlib.Data.Set.Subsingleton -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.CategoryTheory.Preadditive.Injective.Resolution +public import Mathlib.Algebra.Homology.HomotopyCategory +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Tactic.AdaptationNote /-! # Abelian categories with enough injectives have injective resolutions @@ -28,6 +30,8 @@ When the underlying category is abelian: is injective, we can apply `Injective.d` repeatedly to obtain an injective resolution of `X`. -/ +@[expose] public section + noncomputable section open CategoryTheory Category Limits diff --git a/Mathlib/CategoryTheory/Abelian/LeftDerived.lean b/Mathlib/CategoryTheory/Abelian/LeftDerived.lean index 1ab2e59a7383cb..aad4cadd690b5f 100644 --- a/Mathlib/CategoryTheory/Abelian/LeftDerived.lean +++ b/Mathlib/CategoryTheory/Abelian/LeftDerived.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Riccardo Brasca, Adam Topaz, Jujian Zhang, Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.CategoryTheory.Abelian.Projective.Resolution +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.CategoryTheory.Abelian.Projective.Resolution /-! # Left-derived functors @@ -46,6 +48,8 @@ and show how to compute the components. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Monomorphisms.lean b/Mathlib/CategoryTheory/Abelian/Monomorphisms.lean index dba716b56683f3..1a74e6a3bb623b 100644 --- a/Mathlib/CategoryTheory/Abelian/Monomorphisms.lean +++ b/Mathlib/CategoryTheory/Abelian/Monomorphisms.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.Abelian.Basic +module + +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.Abelian.Basic /-! # Monomorphisms are stable under cobase change @@ -15,6 +17,8 @@ In an abelian category `C`, the class of morphism -/ +@[expose] public section + universe v u namespace CategoryTheory.Abelian diff --git a/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean b/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean index b6dcce09fec15d..22df52c700e339 100644 --- a/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean +++ b/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Equalizers -import Mathlib.CategoryTheory.Abelian.Images -import Mathlib.CategoryTheory.Preadditive.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Equalizers +public import Mathlib.CategoryTheory.Abelian.Images +public import Mathlib.CategoryTheory.Preadditive.Basic /-! # Every NonPreadditiveAbelian category is preadditive @@ -48,6 +50,8 @@ reconstruct any natural preadditive structure the category may have. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Opposite.lean b/Mathlib/CategoryTheory/Abelian/Opposite.lean index b121d934c269da..5acb6d22299d62 100644 --- a/Mathlib/CategoryTheory/Abelian/Opposite.lean +++ b/Mathlib/CategoryTheory/Abelian/Opposite.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Abelian.Basic -import Mathlib.CategoryTheory.Preadditive.Opposite -import Mathlib.CategoryTheory.Limits.Opposites +module + +public import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.CategoryTheory.Preadditive.Opposite +public import Mathlib.CategoryTheory.Limits.Opposites /-! # The opposite of an abelian category is abelian. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean b/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean index 7bb49658baa6b1..cd1f4b0abb7b69 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Abelian.Exact -import Mathlib.CategoryTheory.Preadditive.Yoneda.Projective -import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor +module + +public import Mathlib.CategoryTheory.Abelian.Exact +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Projective +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor /-! # Projective objects in abelian categories @@ -17,6 +19,8 @@ In an abelian category, an object `P` is projective iff the functor -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean b/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean index e4d443626bead2..998c5577f932bc 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Nailin Guan -/ -import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives -import Mathlib.CategoryTheory.Abelian.Exact -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives +public import Mathlib.CategoryTheory.Abelian.Exact +public import Mathlib.Data.ENat.Lattice /-! # Projective dimension @@ -24,6 +26,8 @@ We also define the projective dimension in `WithBot ℕ∞` as `projectiveDimens -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean b/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean index 0c9f658877cbee..62255508e386ee 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison, Jakob von Raumer, Joël Riou -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Resolution -import Mathlib.Algebra.Homology.HomotopyCategory -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Resolution +public import Mathlib.Algebra.Homology.HomotopyCategory +public import Mathlib.Tactic.SuppressCompilation /-! # Abelian categories with enough projectives have projective resolutions @@ -27,6 +29,8 @@ When the underlying category is abelian: is projective, we can apply `Projective.d` repeatedly to obtain a projective resolution of `X`. -/ +@[expose] public section + suppress_compilation noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean b/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean index 742cd3e609e3de..12fc779d10a10c 100644 --- a/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean +++ b/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.Exact -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.Algebra.Category.ModuleCat.EpiMono +module + +public import Mathlib.CategoryTheory.Abelian.Exact +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.Algebra.Category.ModuleCat.EpiMono /-! # Pseudoelements in abelian categories @@ -72,6 +74,8 @@ writing `g a` raises a "function expected" error. This error can be fixed by wri * [F. Borceux, *Handbook of Categorical Algebra 2*][borceux-vol2] -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Refinements.lean b/Mathlib/CategoryTheory/Abelian/Refinements.lean index 723557e6166c02..27299f28f7a7df 100644 --- a/Mathlib/CategoryTheory/Abelian/Refinements.lean +++ b/Mathlib/CategoryTheory/Abelian/Refinements.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Exact +module + +public import Mathlib.Algebra.Homology.ShortComplex.Exact /-! # Refinements @@ -68,6 +70,8 @@ these morphisms and sometimes introducing an auxiliary epimorphism `A' ⟶ A`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/Abelian/RightDerived.lean b/Mathlib/CategoryTheory/Abelian/RightDerived.lean index 10032e16d33492..e8c641d52e051a 100644 --- a/Mathlib/CategoryTheory/Abelian/RightDerived.lean +++ b/Mathlib/CategoryTheory/Abelian/RightDerived.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.CategoryTheory.Abelian.Injective.Resolution +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.CategoryTheory.Abelian.Injective.Resolution /-! # Right-derived functors @@ -46,6 +48,8 @@ and show how to compute the components. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/SerreClass/Basic.lean b/Mathlib/CategoryTheory/Abelian/SerreClass/Basic.lean index 1c92e5ded37d7e..f29adfaf522fdc 100644 --- a/Mathlib/CategoryTheory/Abelian/SerreClass/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/SerreClass/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.Basic -import Mathlib.CategoryTheory.ObjectProperty.ContainsZero -import Mathlib.CategoryTheory.ObjectProperty.EpiMono -import Mathlib.CategoryTheory.ObjectProperty.Extensions -import Mathlib.Algebra.Homology.ShortComplex.ShortExact +module + +public import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.CategoryTheory.ObjectProperty.ContainsZero +public import Mathlib.CategoryTheory.ObjectProperty.EpiMono +public import Mathlib.CategoryTheory.ObjectProperty.Extensions +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact /-! # Serre classes @@ -27,6 +29,8 @@ and is closed under subobjects, quotients and extensions. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/SerreClass/Bousfield.lean b/Mathlib/CategoryTheory/Abelian/SerreClass/Bousfield.lean index 0d9f4cc9a106e5..e6cacb328d8f4e 100644 --- a/Mathlib/CategoryTheory/Abelian/SerreClass/Bousfield.lean +++ b/Mathlib/CategoryTheory/Abelian/SerreClass/Bousfield.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.SerreClass.MorphismProperty -import Mathlib.CategoryTheory.Localization.Bousfield +module + +public import Mathlib.CategoryTheory.Abelian.SerreClass.MorphismProperty +public import Mathlib.CategoryTheory.Localization.Bousfield /-! # Bousfield localizations with respect to Serre classes @@ -20,6 +22,8 @@ that are sent to a zero object by `G`. -/ +@[expose] public section + namespace CategoryTheory open Localization Limits MorphismProperty diff --git a/Mathlib/CategoryTheory/Abelian/SerreClass/MorphismProperty.lean b/Mathlib/CategoryTheory/Abelian/SerreClass/MorphismProperty.lean index a0ee7867ffea2a..0a2034687217ad 100644 --- a/Mathlib/CategoryTheory/Abelian/SerreClass/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/Abelian/SerreClass/MorphismProperty.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.SerreClass.Basic -import Mathlib.CategoryTheory.Abelian.DiagramLemmas.KernelCokernelComp -import Mathlib.CategoryTheory.MorphismProperty.Composition -import Mathlib.CategoryTheory.MorphismProperty.Retract -import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy +module + +public import Mathlib.CategoryTheory.Abelian.SerreClass.Basic +public import Mathlib.CategoryTheory.Abelian.DiagramLemmas.KernelCokernelComp +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.MorphismProperty.Retract +public import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy /-! # The class of isomorphisms modulo a Serre class @@ -25,6 +27,8 @@ of three property and is stable under retracts. (Similarly, we define -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Abelian/Subobject.lean b/Mathlib/CategoryTheory/Abelian/Subobject.lean index 804b5c0346d52c..cafb3f80e3d4e6 100644 --- a/Mathlib/CategoryTheory/Abelian/Subobject.lean +++ b/Mathlib/CategoryTheory/Abelian/Subobject.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Subobject.Limits -import Mathlib.CategoryTheory.Abelian.Basic +module + +public import Mathlib.CategoryTheory.Subobject.Limits +public import Mathlib.CategoryTheory.Abelian.Basic /-! # Equivalence between subobjects and quotients in an abelian category -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits Opposite diff --git a/Mathlib/CategoryTheory/Abelian/Transfer.lean b/Mathlib/CategoryTheory/Abelian/Transfer.lean index 2e47f540badd52..08c628dd780828 100644 --- a/Mathlib/CategoryTheory/Abelian/Transfer.lean +++ b/Mathlib/CategoryTheory/Abelian/Transfer.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Abelian.Basic -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages -import Mathlib.CategoryTheory.Preadditive.Transfer +module + +public import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.AbelianImages +public import Mathlib.CategoryTheory.Preadditive.Transfer /-! # Transferring "abelian-ness" across a functor @@ -34,6 +36,8 @@ Someone may like to formalize that lemma, and restate this theorem in terms of ` (That lemma has a nice string diagrammatic proof that holds in any bicategory.) -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Abelian/Yoneda.lean b/Mathlib/CategoryTheory/Abelian/Yoneda.lean index aebb6467243b94..ea94d6680ce8a4 100644 --- a/Mathlib/CategoryTheory/Abelian/Yoneda.lean +++ b/Mathlib/CategoryTheory/Abelian/Yoneda.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four -import Mathlib.CategoryTheory.Abelian.Projective.Basic -import Mathlib.CategoryTheory.Generator.Preadditive -import Mathlib.CategoryTheory.Limits.Preserves.Opposites +module + +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four +public import Mathlib.CategoryTheory.Abelian.Projective.Basic +public import Mathlib.CategoryTheory.Generator.Preadditive +public import Mathlib.CategoryTheory.Limits.Preserves.Opposites /-! # Fullness of restrictions of `preadditiveCoyonedaObj` @@ -17,6 +19,8 @@ In this file we give a sufficient criterion for a restriction of the functor is a projective separator such that every object in the relevant subcategory is a quotient of `G`. -/ +@[expose] public section + open CategoryTheory Opposite Limits universe v v' u u' diff --git a/Mathlib/CategoryTheory/Action.lean b/Mathlib/CategoryTheory/Action.lean index 3c455e01aa98d1..4afaa22f964262 100644 --- a/Mathlib/CategoryTheory/Action.lean +++ b/Mathlib/CategoryTheory/Action.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.CategoryTheory.Elements -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.SingleObj -import Mathlib.GroupTheory.GroupAction.Quotient -import Mathlib.GroupTheory.SemidirectProduct +module + +public import Mathlib.CategoryTheory.Elements +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.SingleObj +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.GroupTheory.SemidirectProduct /-! # Actions as functors and as categories @@ -20,6 +22,8 @@ A morphism `x ⟶ y` in this category is simply a scalar `m : M` such that `m where M is a group, this category is a groupoid -- the *action groupoid*. -/ +@[expose] public section + open MulAction SemidirectProduct diff --git a/Mathlib/CategoryTheory/Action/Basic.lean b/Mathlib/CategoryTheory/Action/Basic.lean index 28b4bc0e096a37..f3d9c0fc2b335a 100644 --- a/Mathlib/CategoryTheory/Action/Basic.lean +++ b/Mathlib/CategoryTheory/Action/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.Grp.Basic -import Mathlib.Algebra.Ring.PUnit -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Conj -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.SingleObj -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Algebra.Category.Grp.Basic +public import Mathlib.Algebra.Ring.PUnit +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Conj +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.SingleObj +public import Mathlib.Tactic.ApplyFun /-! # `Action V G`, the category of actions of a monoid `G` inside some category `V`. @@ -23,6 +25,8 @@ and construct the restriction functors `res {G H} [Monoid G] [Monoid H] (f : G →* H) : Action V H ⥤ Action V G`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/CategoryTheory/Action/Concrete.lean b/Mathlib/CategoryTheory/Action/Concrete.lean index 994300c2ecfed6..2aa8c98228a2d7 100644 --- a/Mathlib/CategoryTheory/Action/Concrete.lean +++ b/Mathlib/CategoryTheory/Action/Concrete.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.CategoryTheory.Action.Basic -import Mathlib.CategoryTheory.FintypeCat -import Mathlib.GroupTheory.GroupAction.Quotient -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.CategoryTheory.Action.Basic +public import Mathlib.CategoryTheory.FintypeCat +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # Constructors for `Action V G` for some concrete categories @@ -16,6 +18,8 @@ import Mathlib.GroupTheory.QuotientGroup.Defs We construct `Action (Type*) G` from a `[MulAction G X]` instance and give some applications. -/ +@[expose] public section + assert_not_exists Field universe u v diff --git a/Mathlib/CategoryTheory/Action/Continuous.lean b/Mathlib/CategoryTheory/Action/Continuous.lean index c6f49091a05612..b917ae4e5d719c 100644 --- a/Mathlib/CategoryTheory/Action/Continuous.lean +++ b/Mathlib/CategoryTheory/Action/Continuous.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Action.Basic -import Mathlib.Topology.Algebra.MulAction -import Mathlib.Topology.Category.TopCat.Basic -import Mathlib.Topology.Algebra.ContinuousMonoidHom +module + +public import Mathlib.CategoryTheory.Action.Basic +public import Mathlib.Topology.Algebra.MulAction +public import Mathlib.Topology.Category.TopCat.Basic +public import Mathlib.Topology.Algebra.ContinuousMonoidHom /-! @@ -25,6 +27,8 @@ of `HasForget₂` instances. -/ +@[expose] public section + open CategoryTheory Limits variable (V : Type*) [Category V] [HasForget V] [HasForget₂ V TopCat] diff --git a/Mathlib/CategoryTheory/Action/Limits.lean b/Mathlib/CategoryTheory/Action/Limits.lean index 1dcff63f2792e8..47a7839f1a1c1d 100644 --- a/Mathlib/CategoryTheory/Action/Limits.lean +++ b/Mathlib/CategoryTheory/Action/Limits.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Abelian.FunctorCategory -import Mathlib.CategoryTheory.Abelian.Transfer -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.CategoryTheory.Linear.FunctorCategory -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Action.Basic +module + +public import Mathlib.CategoryTheory.Abelian.FunctorCategory +public import Mathlib.CategoryTheory.Abelian.Transfer +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.CategoryTheory.Linear.FunctorCategory +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Action.Basic /-! # Categorical properties of `Action V G` @@ -19,6 +21,8 @@ We show: * When `V` is preadditive, linear, or abelian so is `Action V G`. -/ +@[expose] public section + universe u v w₁ w₂ t₁ t₂ open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Action/Monoidal.lean b/Mathlib/CategoryTheory/Action/Monoidal.lean index 6791b18adfe965..16c72260c7965c 100644 --- a/Mathlib/CategoryTheory/Action/Monoidal.lean +++ b/Mathlib/CategoryTheory/Action/Monoidal.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.CategoryTheory.Monoidal.Linear -import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.CategoryTheory.Monoidal.Types.Basic -import Mathlib.CategoryTheory.Action.Concrete -import Mathlib.CategoryTheory.Action.Limits +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.CategoryTheory.Monoidal.Linear +public import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.CategoryTheory.Monoidal.Types.Basic +public import Mathlib.CategoryTheory.Action.Concrete +public import Mathlib.CategoryTheory.Action.Limits /-! # Induced monoidal structure on `Action V G` @@ -20,6 +22,8 @@ We show: * When `V` is monoidal, braided, or symmetric, so is `Action V G`. -/ +@[expose] public section + universe u open CategoryTheory Limits MonoidalCategory diff --git a/Mathlib/CategoryTheory/Adhesive.lean b/Mathlib/CategoryTheory/Adhesive.lean index a6c717b27ed278..0ace24dfdf43fa 100644 --- a/Mathlib/CategoryTheory/Adhesive.lean +++ b/Mathlib/CategoryTheory/Adhesive.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Extensive -import Mathlib.CategoryTheory.Limits.Shapes.KernelPair -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +module + +public import Mathlib.CategoryTheory.Extensive +public import Mathlib.CategoryTheory.Limits.Shapes.KernelPair +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono /-! @@ -34,6 +36,8 @@ import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -/ +@[expose] public section + namespace CategoryTheory @@ -93,10 +97,7 @@ theorem IsPushout.isVanKampen_iff (H : IsPushout f g h i) : · dsimp; simp only [Functor.map_id, Category.comp_id, Category.id_comp] exacts [hf.w, hg.w] · ext (_ | _ | _) - · dsimp - rw [PushoutCocone.condition_zero, Category.assoc] - erw [hh.w] - rw [hf.w_assoc] + · simp [hh.w, hf.w_assoc] exacts [hh.w.symm, hi.w.symm] · rintro i _ (_ | _ | _) · dsimp; simp_rw [Functor.map_id] diff --git a/Mathlib/CategoryTheory/Adjunction/Additive.lean b/Mathlib/CategoryTheory/Adjunction/Additive.lean index 014fe49044ce04..1e842e8d5756e5 100644 --- a/Mathlib/CategoryTheory/Adjunction/Additive.lean +++ b/Mathlib/CategoryTheory/Adjunction/Additive.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel, Joël Riou -/ -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic /-! # Adjunctions between additive functors. @@ -18,6 +20,8 @@ preadditive categories: -/ +@[expose] public section + universe u₁ u₂ v₁ v₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/AdjointFunctorTheorems.lean b/Mathlib/CategoryTheory/Adjunction/AdjointFunctorTheorems.lean index 6bbeeda6b4528f..aab8e4963c3b29 100644 --- a/Mathlib/CategoryTheory/Adjunction/AdjointFunctorTheorems.lean +++ b/Mathlib/CategoryTheory/Adjunction/AdjointFunctorTheorems.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Small -import Mathlib.CategoryTheory.Generator.Basic -import Mathlib.CategoryTheory.Limits.ConeCategory -import Mathlib.CategoryTheory.Limits.Constructions.WeaklyInitial -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Subobject.Comma +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Small +public import Mathlib.CategoryTheory.Generator.Basic +public import Mathlib.CategoryTheory.Limits.ConeCategory +public import Mathlib.CategoryTheory.Limits.Constructions.WeaklyInitial +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Subobject.Comma /-! # Adjoint functor theorem @@ -37,6 +39,8 @@ Finally, we prove the following corollaries of the special adjoint functor theor -/ +@[expose] public section + universe v u u' diff --git a/Mathlib/CategoryTheory/Adjunction/Basic.lean b/Mathlib/CategoryTheory/Adjunction/Basic.lean index 1306de9679fba8..3531852af53763 100644 --- a/Mathlib/CategoryTheory/Adjunction/Basic.lean +++ b/Mathlib/CategoryTheory/Adjunction/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Johan Commelin, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Equivalence -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.CategoryTheory.Yoneda /-! # Adjunctions between functors @@ -72,6 +74,8 @@ Conversely `Equivalence.toAdjunction` recovers the underlying adjunction from an `L ⋙ R ≅ 𝟭 C`, the unit is an isomorphism, and similarly for the counit. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Comma.lean b/Mathlib/CategoryTheory/Adjunction/Comma.lean index 1901fe5f63d0f5..aa30ed4e6750fa 100644 --- a/Mathlib/CategoryTheory/Adjunction/Comma.lean +++ b/Mathlib/CategoryTheory/Adjunction/Comma.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.PUnit +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.PUnit /-! # Properties of comma categories relating to adjunctions @@ -21,6 +23,8 @@ provided a left adjoint. The duals are also shown. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Adjunction/CompositionIso.lean b/Mathlib/CategoryTheory/Adjunction/CompositionIso.lean index 8854b6c01fff3d..3c87068d451d4f 100644 --- a/Mathlib/CategoryTheory/Adjunction/CompositionIso.lean +++ b/Mathlib/CategoryTheory/Adjunction/CompositionIso.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Mates +module + +public import Mathlib.CategoryTheory.Adjunction.Mates /-! # Compatibilities for left adjoints from compatibilities satisfied by right adjoints @@ -14,13 +16,15 @@ and show that the left adjoint functors satisfy properties similar to the left/r unitality and the associativity of pseudofunctors if the right adjoint functors satisfy the corresponding properties. -This shall be used to study the behaviour with respect to composition of -the pullback functors on presheaves of modules, by reducing these definitions and -properties to the (obvious) case of the pushforward functors. Similar results shall -be obtained for sheaves of modules (TODO). +This is used in `Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback` to study +the behaviour with respect to composition of the pullback functors on presheaves +of modules, by reducing these definitions and properties to the (obvious) case of the +pushforward functors. Similar results shall be obtained for sheaves of modules (TODO). -/ +@[expose] public section + namespace CategoryTheory variable {C₀ C₁ C₂ C₃ : Type*} [Category C₀] [Category C₁] [Category C₂] [Category C₃] diff --git a/Mathlib/CategoryTheory/Adjunction/Evaluation.lean b/Mathlib/CategoryTheory/Adjunction/Evaluation.lean index 42b89af0d5fccf..1595e15532a6a6 100644 --- a/Mathlib/CategoryTheory/Adjunction/Evaluation.lean +++ b/Mathlib/CategoryTheory/Adjunction/Evaluation.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Functor.EpiMono +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Functor.EpiMono /-! @@ -14,6 +16,8 @@ We show that evaluation of functors have adjoints, given the existence of (co)pr -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/FullyFaithful.lean b/Mathlib/CategoryTheory/Adjunction/FullyFaithful.lean index 5540a84c13a713..8e17c4d49be708 100644 --- a/Mathlib/CategoryTheory/Adjunction/FullyFaithful.lean +++ b/Mathlib/CategoryTheory/Adjunction/FullyFaithful.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.MorphismProperty.Basic -import Mathlib.CategoryTheory.EpiMono +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Basic +public import Mathlib.CategoryTheory.EpiMono /-! # Adjoints of fully faithful functors @@ -29,6 +31,8 @@ See `CategoryTheory.Adjunction.isIso_unit_of_iso` and `CategoryTheory.Adjunction.isIso_counit_of_iso`. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Lifting/Left.lean b/Mathlib/CategoryTheory/Adjunction/Lifting/Left.lean index e7583ca320731a..e20362a7fc9a5b 100644 --- a/Mathlib/CategoryTheory/Adjunction/Lifting/Left.lean +++ b/Mathlib/CategoryTheory/Adjunction/Lifting/Left.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Monad.Adjunction -import Mathlib.CategoryTheory.Monad.Coequalizer +module + +public import Mathlib.CategoryTheory.Monad.Adjunction +public import Mathlib.CategoryTheory.Monad.Coequalizer /-! # Adjoint lifting @@ -55,6 +57,8 @@ Please try to keep them in sync. * A unified approach to the lifting of adjoints (AJ Power, 1988) -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Lifting/Right.lean b/Mathlib/CategoryTheory/Adjunction/Lifting/Right.lean index 6bbc1c0285549e..b4880768efc306 100644 --- a/Mathlib/CategoryTheory/Adjunction/Lifting/Right.lean +++ b/Mathlib/CategoryTheory/Adjunction/Lifting/Right.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Monad.Adjunction -import Mathlib.CategoryTheory.Monad.Equalizer +module + +public import Mathlib.CategoryTheory.Monad.Adjunction +public import Mathlib.CategoryTheory.Monad.Equalizer /-! # Adjoint lifting @@ -56,6 +58,8 @@ Please try to keep them in sync. * A unified approach to the lifting of adjoints (AJ Power, 1988) -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Limits.lean b/Mathlib/CategoryTheory/Adjunction/Limits.lean index 26aeba610a5809..cc938fc0b10dee 100644 --- a/Mathlib/CategoryTheory/Adjunction/Limits.lean +++ b/Mathlib/CategoryTheory/Adjunction/Limits.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Johan Commelin -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Limits.Creates +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Limits.Creates /-! # Adjunctions and limits @@ -25,6 +27,8 @@ is naturally isomorphic to the functor associating to each `Y` the cocones over `K` with cone point `G.obj Y`. -/ +@[expose] public section + open Opposite diff --git a/Mathlib/CategoryTheory/Adjunction/Mates.lean b/Mathlib/CategoryTheory/Adjunction/Mates.lean index b3a57f898e4fec..0e3ec8eb32467b 100644 --- a/Mathlib/CategoryTheory/Adjunction/Mates.lean +++ b/Mathlib/CategoryTheory/Adjunction/Mates.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Emily Riehl, Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Functor.TwoSquare -import Mathlib.CategoryTheory.HomCongr -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Functor.TwoSquare +public import Mathlib.CategoryTheory.HomCongr +public import Mathlib.Tactic.ApplyFun /-! # Mate of natural transformations @@ -40,6 +42,8 @@ This also relates to Grothendieck's yoga of six operations, though this is not s mathlib: https://ncatlab.org/nlab/show/six+operations. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ v₆ v₇ v₈ v₉ u₁ u₂ u₃ u₄ u₅ u₆ u₇ u₈ u₉ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Opposites.lean b/Mathlib/CategoryTheory/Adjunction/Opposites.lean index b071d7e251756f..e31028ec0637f8 100644 --- a/Mathlib/CategoryTheory/Adjunction/Opposites.lean +++ b/Mathlib/CategoryTheory/Adjunction/Opposites.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Thomas Read, Andrew Yang -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Yoneda -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Yoneda +public import Mathlib.CategoryTheory.Opposites /-! # Opposite adjunctions @@ -17,6 +19,8 @@ opposites. adjunction, opposite, uniqueness -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Parametrized.lean b/Mathlib/CategoryTheory/Adjunction/Parametrized.lean index 4f1744be454117..873a932f619d60 100644 --- a/Mathlib/CategoryTheory/Adjunction/Parametrized.lean +++ b/Mathlib/CategoryTheory/Adjunction/Parametrized.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.CategoryTheory.Adjunction.Basic /-! # Adjunctions with a parameter @@ -33,6 +35,8 @@ left adjoints). -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/PartialAdjoint.lean b/Mathlib/CategoryTheory/Adjunction/PartialAdjoint.lean index 80ee4697e1fe80..1392c52625ccad 100644 --- a/Mathlib/CategoryTheory/Adjunction/PartialAdjoint.lean +++ b/Mathlib/CategoryTheory/Adjunction/PartialAdjoint.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Yoneda +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Yoneda /-! # Domain of definition of the partial left adjoint @@ -32,6 +33,8 @@ the predicate `F.LeftAdjointObjIsDefined` is stable under colimits indexed by `J -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Adjunction/Quadruple.lean b/Mathlib/CategoryTheory/Adjunction/Quadruple.lean index fb17ace7915fc8..fde522c657a711 100644 --- a/Mathlib/CategoryTheory/Adjunction/Quadruple.lean +++ b/Mathlib/CategoryTheory/Adjunction/Quadruple.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Ben Eltschig. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ben Eltschig -/ -import Mathlib.CategoryTheory.Adjunction.Triple -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +module + +public import Mathlib.CategoryTheory.Adjunction.Triple +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono /-! # Adjoint quadruples @@ -29,6 +31,8 @@ needed for the theorem statements, so some lemmas require only e.g. `F` to be fu really this means `F` and `R` both must be. -/ +@[expose] public section + open CategoryTheory Limits Functor Adjunction Triple universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Adjunction/Reflective.lean b/Mathlib/CategoryTheory/Adjunction/Reflective.lean index c002bdb97cb056..02223e7556c4ff 100644 --- a/Mathlib/CategoryTheory/Adjunction/Reflective.lean +++ b/Mathlib/CategoryTheory/Adjunction/Reflective.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Functor.EpiMono -import Mathlib.CategoryTheory.HomCongr +module + +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Functor.EpiMono +public import Mathlib.CategoryTheory.HomCongr /-! # Reflective functors @@ -16,6 +18,8 @@ Note properties of reflective functors relating to limits and colimits are inclu `Mathlib/CategoryTheory/Monad/Limits.lean`. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Adjunction/Restrict.lean b/Mathlib/CategoryTheory/Adjunction/Restrict.lean index 2bc3f50a92d6bf..189de01ea1e763 100644 --- a/Mathlib/CategoryTheory/Adjunction/Restrict.lean +++ b/Mathlib/CategoryTheory/Adjunction/Restrict.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.HomCongr +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.HomCongr /-! # Restricting adjunctions @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.HomCongr inclusions. -/ +@[expose] public section + namespace CategoryTheory.Adjunction universe v₁ v₂ u₁ u₂ v₃ v₄ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Adjunction/Triple.lean b/Mathlib/CategoryTheory/Adjunction/Triple.lean index 837ff738a52c96..3141535a396bf4 100644 --- a/Mathlib/CategoryTheory/Adjunction/Triple.lean +++ b/Mathlib/CategoryTheory/Adjunction/Triple.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Ben Eltschig -/ -import Mathlib.CategoryTheory.Adjunction.Opposites -import Mathlib.CategoryTheory.Adjunction.Unique -import Mathlib.CategoryTheory.Monad.Adjunction +module + +public import Mathlib.CategoryTheory.Adjunction.Opposites +public import Mathlib.CategoryTheory.Adjunction.Unique +public import Mathlib.CategoryTheory.Monad.Adjunction /-! # Adjoint triples @@ -43,6 +45,8 @@ bundle the adjunctions in a structure `Triple F G H`. `adj₁.counit ≫ adj₂.unit : G ⋙ F ⟶ G ⋙ H` is. -/ +@[expose] public section + open CategoryTheory Functor variable {C D : Type*} [Category C] [Category D] diff --git a/Mathlib/CategoryTheory/Adjunction/Unique.lean b/Mathlib/CategoryTheory/Adjunction/Unique.lean index d5ec98ea735da4..813ac528352108 100644 --- a/Mathlib/CategoryTheory/Adjunction/Unique.lean +++ b/Mathlib/CategoryTheory/Adjunction/Unique.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Thomas Read, Andrew Yang, Dagur Asgeirsson, Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Mates +module + +public import Mathlib.CategoryTheory.Adjunction.Mates /-! # Uniqueness of adjoints @@ -20,6 +22,8 @@ This file shows that adjoints are unique up to natural isomorphism. -/ +@[expose] public section + open CategoryTheory Functor variable {C D : Type*} [Category C] [Category D] diff --git a/Mathlib/CategoryTheory/Adjunction/Whiskering.lean b/Mathlib/CategoryTheory/Adjunction/Whiskering.lean index 4f8bea3b422b46..4ec887c80f7391 100644 --- a/Mathlib/CategoryTheory/Adjunction/Whiskering.lean +++ b/Mathlib/CategoryTheory/Adjunction/Whiskering.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Whiskering -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.CategoryTheory.Adjunction.Basic /-! @@ -14,6 +16,8 @@ and the functor categories `E ⥤ C` and `D ⥤ C`. -/ +@[expose] public section + namespace CategoryTheory.Adjunction diff --git a/Mathlib/CategoryTheory/Balanced.lean b/Mathlib/CategoryTheory/Balanced.lean index 25b0bc6904b01f..5db6a74ee55dc0 100644 --- a/Mathlib/CategoryTheory/Balanced.lean +++ b/Mathlib/CategoryTheory/Balanced.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.EpiMono +module + +public import Mathlib.CategoryTheory.EpiMono /-! # Balanced categories @@ -16,6 +18,8 @@ as the category of types. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Bicategory/Adjunction/Adj.lean b/Mathlib/CategoryTheory/Bicategory/Adjunction/Adj.lean index b2fddff65c56ef..1ca27cb897093a 100644 --- a/Mathlib/CategoryTheory/Bicategory/Adjunction/Adj.lean +++ b/Mathlib/CategoryTheory/Bicategory/Adjunction/Adj.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Bicategory.Adjunction.Mate -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Bicategory.Adjunction.Mate +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor /-! # The bicategory of adjunctions in a bicategory @@ -27,6 +29,8 @@ both pullback and pushforward functors. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/Adjunction/Basic.lean b/Mathlib/CategoryTheory/Bicategory/Adjunction/Basic.lean index e86110dd8a4d34..4f84bda5c3ccbd 100644 --- a/Mathlib/CategoryTheory/Bicategory/Adjunction/Basic.lean +++ b/Mathlib/CategoryTheory/Bicategory/Adjunction/Basic.lean @@ -3,7 +3,10 @@ Copyright (c) 2023 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Bicategory.Basic +module + +public import Mathlib.Tactic.CategoryTheory.Bicategory.Basic +public import Mathlib.Tactic.CategoryTheory.BicategoricalComp /-! # Adjunctions in bicategories @@ -25,6 +28,8 @@ identities. The 2-morphism `η` is called the unit and `ε` is called the counit `η : 𝟙 a ≅ f ≫ g` and `ε : g ≫ f ≅ 𝟙 b`, by upgrading `η` to a unit. -/ +@[expose] public section + namespace CategoryTheory namespace Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Adjunction/Mate.lean b/Mathlib/CategoryTheory/Bicategory/Adjunction/Mate.lean index 1792ac49f06087..d4f640e4e2a315 100644 --- a/Mathlib/CategoryTheory/Bicategory/Adjunction/Mate.lean +++ b/Mathlib/CategoryTheory/Bicategory/Adjunction/Mate.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Joël Riou -/ -import Mathlib.CategoryTheory.Bicategory.Adjunction.Basic -import Mathlib.CategoryTheory.HomCongr +module + +public import Mathlib.CategoryTheory.Bicategory.Adjunction.Basic +public import Mathlib.CategoryTheory.HomCongr /-! # Mates in bicategories @@ -42,6 +44,8 @@ polymorphic, so they are not simple specializations of the definitions in this f -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/Basic.lean b/Mathlib/CategoryTheory/Bicategory/Basic.lean index e90224e61ec79b..315cbf742b6fee 100644 --- a/Mathlib/CategoryTheory/Bicategory/Basic.lean +++ b/Mathlib/CategoryTheory/Bicategory/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.NatIso +module + +public import Mathlib.CategoryTheory.NatIso /-! # Bicategories @@ -37,6 +39,8 @@ between 1-morphisms `f g : a ⟶ b` and a 1-morphism `f : b ⟶ c`, there is a 2 which is required as an axiom in the definition here. -/ +@[expose] public section + namespace CategoryTheory universe w v u diff --git a/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean b/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean index 4a6f3ce2ae1a86..e912ce8d2f7301 100644 --- a/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean +++ b/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat -import Mathlib.CategoryTheory.Enriched.Basic -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat +public import Mathlib.CategoryTheory.Enriched.Basic +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic /-! # The strict bicategory associated to a Cat-enriched category @@ -31,6 +33,8 @@ structure extending the category structure provided by the given instance `Categ -/ +@[expose] public section + universe u v u' v' namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/Bicategory/Coherence.lean b/Mathlib/CategoryTheory/Bicategory/Coherence.lean index 534c62536a66f6..195d66bf4852d4 100644 --- a/Mathlib/CategoryTheory/Bicategory/Coherence.lean +++ b/Mathlib/CategoryTheory/Bicategory/Coherence.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Junyan Xu -/ -import Mathlib.CategoryTheory.PathCategory.Basic -import Mathlib.CategoryTheory.Functor.FullyFaithful -import Mathlib.CategoryTheory.Bicategory.Free -import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete +module + +public import Mathlib.CategoryTheory.PathCategory.Basic +public import Mathlib.CategoryTheory.Functor.FullyFaithful +public import Mathlib.CategoryTheory.Bicategory.Free +public import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete /-! # The coherence theorem for bicategories @@ -34,6 +36,8 @@ theorem follows immediately from this fact. proof of normalization for monoids][beylin1996] -/ +@[expose] public section + open Quiver (Path) diff --git a/Mathlib/CategoryTheory/Bicategory/End.lean b/Mathlib/CategoryTheory/Bicategory/End.lean index 3051addccc8bcf..8ec8c9997cf48e 100644 --- a/Mathlib/CategoryTheory/Bicategory/End.lean +++ b/Mathlib/CategoryTheory/Bicategory/End.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Bicategory.Basic -import Mathlib.CategoryTheory.Monoidal.Category +module + +public import Mathlib.CategoryTheory.Bicategory.Basic +public import Mathlib.CategoryTheory.Monoidal.Category /-! # Endomorphisms of an object in a bicategory, as a monoidal category. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/EqToHom.lean b/Mathlib/CategoryTheory/Bicategory/EqToHom.lean index 02bc87d61c6eb7..5a527eb757acc6 100644 --- a/Mathlib/CategoryTheory/Bicategory/EqToHom.lean +++ b/Mathlib/CategoryTheory/Bicategory/EqToHom.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Bicategory.Basic +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Bicategory.Basic /-! # `eqToHom` in bicategories @@ -32,6 +34,8 @@ well under `eqToHom`s. objects. -/ +@[expose] public section + universe w v u namespace CategoryTheory.Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Extension.lean b/Mathlib/CategoryTheory/Bicategory/Extension.lean index bbbbdd14a7769f..94d158108d0366 100644 --- a/Mathlib/CategoryTheory/Bicategory/Extension.lean +++ b/Mathlib/CategoryTheory/Bicategory/Extension.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Basic -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +module + +public import Mathlib.CategoryTheory.Bicategory.Basic +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic /-! # Extensions and lifts in bicategories @@ -27,6 +29,8 @@ is an alias for `Comma.right`. -/ +@[expose] public section + namespace CategoryTheory namespace Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Free.lean b/Mathlib/CategoryTheory/Bicategory/Free.lean index 5a4d6f80f487f1..8261ab62136a4e 100644 --- a/Mathlib/CategoryTheory/Bicategory/Free.lean +++ b/Mathlib/CategoryTheory/Bicategory/Free.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor /-! # Free bicategories @@ -20,6 +22,8 @@ axioms of a bicategory. prefunctor `F` from `B` to `C`. -/ +@[expose] public section + universe w w₁ w₂ v v₁ v₂ u u₁ u₂ diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Cat.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Cat.lean index e15c40777530e3..2f20f2c873d878 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Cat.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Cat.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Christian Merten -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor /-! # Pseudofunctors to Cat @@ -13,6 +15,8 @@ for pseudofunctors to `Cat`. -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Lax.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Lax.lean index 52d0719b0c20bf..03eb8817b885aa 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Lax.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Lax.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ +module -import Mathlib.CategoryTheory.Bicategory.Functor.Prelax -import Mathlib.Tactic.CategoryTheory.Slice -import Mathlib.Tactic.CategoryTheory.ToApp +public import Mathlib.CategoryTheory.Bicategory.Functor.Prelax +public import Mathlib.Tactic.CategoryTheory.Slice +public import Mathlib.Tactic.CategoryTheory.ToApp /-! # Lax functors @@ -35,6 +36,8 @@ be to mirror these constructions for lax functors. -/ +@[expose] public section + namespace CategoryTheory open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/LocallyDiscrete.lean b/Mathlib/CategoryTheory/Bicategory/Functor/LocallyDiscrete.lean index 54a8a5ce132fca..14a057275bc2c0 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/LocallyDiscrete.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/LocallyDiscrete.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor -import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +public import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete /-! # Pseudofunctors from locally discrete bicategories @@ -26,6 +28,8 @@ to a pseudofunctor (or oplax functor) (`Functor.toPseudofunctor`) with domain -/ +@[expose] public section + namespace CategoryTheory open Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Oplax.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Oplax.lean index cfd7d98fe1871e..3818528e503955 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Oplax.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Oplax.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Prelax -import Mathlib.Tactic.CategoryTheory.ToApp +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Prelax +public import Mathlib.Tactic.CategoryTheory.ToApp /-! # Oplax functors @@ -25,6 +27,8 @@ An oplax functor `F` between bicategories `B` and `C` consists of -/ +@[expose] public section + namespace CategoryTheory open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Prelax.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Prelax.lean index cabb223fc99a92..cfc3cbfcb6aab3 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Prelax.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Prelax.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Calle Sönne -/ +module -import Mathlib.CategoryTheory.Bicategory.Basic -import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Bicategory.Basic +public import Mathlib.CategoryTheory.EqToHom /-! @@ -38,6 +39,8 @@ corresponding hom types. -/ +@[expose] public section + namespace CategoryTheory open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Pseudofunctor.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Pseudofunctor.lean index 36034c11f076e6..f9b84d4f95cdd5 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Pseudofunctor.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Pseudofunctor.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Calle Sönne -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Oplax -import Mathlib.CategoryTheory.Bicategory.Functor.Lax -import Mathlib.Tactic.CategoryTheory.ToApp +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Oplax +public import Mathlib.CategoryTheory.Bicategory.Functor.Lax +public import Mathlib.Tactic.CategoryTheory.ToApp /-! # Pseudofunctors @@ -31,6 +33,8 @@ We provide several constructors for pseudofunctors: -/ +@[expose] public section + namespace CategoryTheory open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean index ffa352d0c0f45c..e203ae2c37bb11 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor deprecated_module (since := "2025-10-02") diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/StrictlyUnitary.lean b/Mathlib/CategoryTheory/Bicategory/Functor/StrictlyUnitary.lean index ae190e190c8c4f..8d859b9ca52b6e 100644 --- a/Mathlib/CategoryTheory/Bicategory/Functor/StrictlyUnitary.lean +++ b/Mathlib/CategoryTheory/Bicategory/Functor/StrictlyUnitary.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor /-! # Strictly unitary lax functors and pseudofunctors @@ -34,6 +36,8 @@ bicategories, strictly unitary pseudofunctors and icons. -/ +@[expose] public section + namespace CategoryTheory open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Oplax.lean b/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Oplax.lean index 7e46444d8281d4..02b0cfc4b8bb4f 100644 --- a/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Oplax.lean +++ b/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Oplax.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Modification.Oplax +module + +public import Mathlib.CategoryTheory.Bicategory.Modification.Oplax /-! # The bicategory of oplax functors between two bicategories @@ -14,6 +16,8 @@ Given bicategories `B` and `C`, we give a bicategory structure on `B ⥤ᵒᵖ * 2-morphisms are modifications. -/ +@[expose] public section + namespace CategoryTheory.Oplax diff --git a/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean b/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean index e4e7084bc22d27..0ade6a8966d031 100644 --- a/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean @@ -1,11 +1,12 @@ /- Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Calle Sönne +Authors: Calle Sönne, Joseph Hua -/ +module -import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Pseudo +public import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Pseudo /-! # The Grothendieck and CoGrothendieck constructions @@ -26,14 +27,14 @@ given by projecting to the first factors, i.e. ## The CoGrothendieck construction -Given a category `𝒮` and any pseudofunctor `F` from `𝒮ᵒᵖ` to `Cat`, we associate to it a category -`∫ᶜ F` (TODO: promote `CategoryStruct` to `Category` instance), defined as follows: +Given a category `𝒮` and any pseudofunctor `F` from `𝒮ᵒᵖ` to `Cat`, +we associate to it a category `∫ᶜ F`, defined as follows: * Objects: pairs `(S, a)` where `S` is an object of the base category and `a` is an object of the category `F(S)`. * Morphisms: morphisms `(R, b) ⟶ (S, a)` are defined as pairs `(f, h)` where `f : R ⟶ S` is a morphism in `𝒮` and `h : b ⟶ F(f)(a)` -The category `∫ᶜ F` is equipped with a functor `∫ᶜ F ⥤ 𝒮` (TODO: define this functor), +The category `∫ᶜ F` is equipped with a functor `∫ᶜ F ⥤ 𝒮`, given by projecting to the first factors, i.e. * On objects, it sends `(S, a)` to `S` * On morphisms, it sends `(f, h)` to `f` @@ -51,7 +52,6 @@ This is consistent with the convention for the Grothendieck construction on 1-fu pseudofunctor from `LocallyDiscrete 𝒮 ⥤ᵖ Catᵒᵖ` to `Cat`. 2. Deduce the results in `CategoryTheory.Grothendieck` as a specialization of `Pseudofunctor.Grothendieck`. -3. Dualize all `CoGrothendieck` results to `Grothendieck`. ## References [Vistoli2008] "Notes on Grothendieck Topologies, Fibered Categories and Descent Theory" by @@ -59,6 +59,8 @@ Angelo Vistoli -/ +@[expose] public section + namespace CategoryTheory.Pseudofunctor universe w v₁ v₂ v₃ u₁ u₂ u₃ @@ -106,6 +108,115 @@ instance categoryStruct : CategoryStruct (∫ F) where instance (X : ∫ F) : Inhabited (Hom X X) := ⟨𝟙 X⟩ +section + +variable {a b : ∫ F} + +@[ext (iff := false)] +lemma Hom.ext (f g : a ⟶ b) (hfg₁ : f.base = g.base) + (hfg₂ : eqToHom (hfg₁ ▸ rfl) ≫ f.fiber = g.fiber) : f = g := by + cases f; cases g + dsimp at hfg₁ hfg₂ + cat_disch + +lemma Hom.ext_iff (f g : a ⟶ b) : + f = g ↔ ∃ (hfg : f.base = g.base), eqToHom (hfg ▸ rfl) ≫ f.fiber = g.fiber where + mp hfg := by subst hfg; simp + mpr := fun ⟨hfg₁, hfg₂⟩ => Hom.ext f g hfg₁ hfg₂ + +lemma Hom.congr {a b : ∫ F} {f g : a ⟶ b} (h : f = g) : + f.fiber = eqToHom (h ▸ rfl) ≫ g.fiber := by + subst h + simp + +end + +attribute [local simp] PrelaxFunctor.map₂_eqToHom in +/-- The category structure on `∫ F`. -/ +instance category : Category (∫ F) where + toCategoryStruct := Pseudofunctor.Grothendieck.categoryStruct + id_comp {a b} f := by + ext + · simp + · simp [F.mapComp_id_left_hom_app, Strict.leftUnitor_eqToIso, ← Functor.map_comp_assoc] + comp_id {a b} f := by + ext + · simp + · simp [F.mapComp_id_right_hom_app, Strict.rightUnitor_eqToIso] + assoc f g h := by + ext + · simp + · simp [mapComp_assoc_right_hom_app_assoc, Strict.associator_eqToIso] + +variable (F) + +/-- The projection `∫ F ⥤ 𝒮` given by projecting both objects and homs to the first factor. -/ +@[simps] +def forget (F : Pseudofunctor (LocallyDiscrete 𝒮) Cat.{v₂, u₂}) : ∫ F ⥤ 𝒮 where + obj X := X.base + map f := f.base + +section + +attribute [local simp] + Strict.leftUnitor_eqToIso Strict.rightUnitor_eqToIso Strict.associator_eqToIso + +variable {F} {G : Pseudofunctor (LocallyDiscrete 𝒮) Cat.{v₂, u₂}} + {H : Pseudofunctor (LocallyDiscrete 𝒮) Cat.{v₂, u₂}} + +/-- The Grothendieck construction is functorial: a strong natural transformation `α : F ⟶ G` +induces a functor `Grothendieck.map : ∫ F ⥤ ∫ G`. -/ +@[simps!] +def map (α : F ⟶ G) : ∫ F ⥤ ∫ G where + obj a := { + base := a.base + fiber := (α.app ⟨a.base⟩).obj a.fiber } + map {a b} f := { + base := f.1 + fiber := (α.naturality f.1.toLoc).inv.app a.fiber ≫ (α.app ⟨b.base⟩).map f.2 } + map_id a := by + ext + · dsimp + · simp [StrongTrans.naturality_id_inv_app, ← map_comp] + map_comp {a b c} f g := by + ext + · dsimp + · dsimp + simp only [map_comp, assoc, ← Cat.comp_map, NatTrans.naturality_assoc] + simp [naturality_comp_inv_app, ← map_comp] + +@[simp] +lemma map_id_map {x y : ∫ F} (f : x ⟶ y) : (map (𝟙 F)).map f = f := by + ext <;> simp + +@[simp] +theorem map_comp_forget (α : F ⟶ G) : map α ⋙ forget G = forget F := rfl + +section + +variable (F) + +/-- The natural isomorphism witnessing the pseudo-unity constraint of `Grothendieck.map`. -/ +def mapIdIso : map (𝟙 F) ≅ 𝟭 (∫ F) := + NatIso.ofComponents (fun _ ↦ eqToIso (by cat_disch)) + +lemma map_id_eq : map (𝟙 F) = 𝟭 (∫ F) := + Functor.ext_of_iso (mapIdIso F) (fun x ↦ by simp [map]) (fun x ↦ by simp [mapIdIso]) + +end + +/-- The natural isomorphism witnessing the pseudo-functoriality of `Grothendieck.map`. -/ +def mapCompIso (α : F ⟶ G) (β : G ⟶ H) : map (α ≫ β) ≅ map α ⋙ map β := + NatIso.ofComponents (fun _ ↦ eqToIso (by cat_disch)) (fun f ↦ by + dsimp + simp only [comp_id, id_comp] + ext <;> simp) + +lemma map_comp_eq (α : F ⟶ G) (β : G ⟶ H) : map (α ≫ β) = map α ⋙ map β := + Functor.ext_of_iso (mapCompIso α β) (fun _ ↦ by simp [map]) (fun _ ↦ by simp [mapCompIso]) + +end + end Grothendieck /-- The type of objects in the fibered category associated to a contravariant @@ -144,6 +255,9 @@ instance categoryStruct : CategoryStruct (∫ᶜ F) where fiber := f.fiber ≫ (F.map f.base.op.toLoc).map g.fiber ≫ (F.mapComp g.base.op.toLoc f.base.op.toLoc).inv.app Z.fiber } +instance (X : ∫ᶜ F) : Inhabited (Hom X X) := + ⟨𝟙 X⟩ + section variable {a b : ∫ᶜ F} @@ -152,10 +266,8 @@ variable {a b : ∫ᶜ F} lemma Hom.ext (f g : a ⟶ b) (hfg₁ : f.base = g.base) (hfg₂ : f.fiber = g.fiber ≫ eqToHom (hfg₁ ▸ rfl)) : f = g := by cases f; cases g - congr dsimp at hfg₁ - rw [← conj_eqToHom_iff_heq _ _ rfl (hfg₁ ▸ rfl)] - simpa only [eqToHom_refl, id_comp] using hfg₂ + cat_disch lemma Hom.ext_iff (f g : a ⟶ b) : f = g ↔ ∃ (hfg : f.base = g.base), f.fiber = g.fiber ≫ eqToHom (hfg ▸ rfl) where @@ -187,8 +299,7 @@ instance category : Category (∫ᶜ F) where variable (F) -/-- The projection `∫ᶜ F ⥤ 𝒮` given by projecting both objects and homs to the first -factor. -/ +/-- The projection `∫ᶜ F ⥤ 𝒮` given by projecting both objects and homs to the first factor. -/ @[simps] def forget (F : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat.{v₂, u₂}) : ∫ᶜ F ⥤ 𝒮 where obj X := X.base diff --git a/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean b/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean index 990891b4cbcc48..d2d257ae733164 100644 --- a/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean +++ b/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Kan.HasKan -import Mathlib.CategoryTheory.Bicategory.Adjunction.Basic -import Mathlib.Tactic.TFAE +module + +public import Mathlib.CategoryTheory.Bicategory.Kan.HasKan +public import Mathlib.CategoryTheory.Bicategory.Adjunction.Basic +public import Mathlib.Tactic.TFAE /-! # Adjunctions as Kan extensions @@ -27,6 +29,8 @@ similar results for right Kan extensions and right Kan lifts. -/ +@[expose] public section + namespace CategoryTheory namespace Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Kan/HasKan.lean b/Mathlib/CategoryTheory/Bicategory/Kan/HasKan.lean index 55308b04fc6dbd..06d656e4b9cc6d 100644 --- a/Mathlib/CategoryTheory/Bicategory/Kan/HasKan.lean +++ b/Mathlib/CategoryTheory/Bicategory/Kan/HasKan.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Bicategory.Kan.IsKan +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Bicategory.Kan.IsKan /-! # Existence of Kan extensions and Kan lifts in bicategories @@ -29,6 +31,8 @@ These notations are inspired by -/ +@[expose] public section + noncomputable section namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/Kan/IsKan.lean b/Mathlib/CategoryTheory/Bicategory/Kan/IsKan.lean index 0a4db2bd51c9a8..98d9793e7e2c65 100644 --- a/Mathlib/CategoryTheory/Bicategory/Kan/IsKan.lean +++ b/Mathlib/CategoryTheory/Bicategory/Kan/IsKan.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Extension +module + +public import Mathlib.CategoryTheory.Bicategory.Extension /-! # Kan extensions and Kan lifts in bicategories @@ -36,6 +38,8 @@ https://ncatlab.org/nlab/show/Kan+extension -/ +@[expose] public section + namespace CategoryTheory namespace Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/LocallyDiscrete.lean b/Mathlib/CategoryTheory/Bicategory/LocallyDiscrete.lean index 1009eb05222bd9..c9e7c96a9b157c 100644 --- a/Mathlib/CategoryTheory/Bicategory/LocallyDiscrete.lean +++ b/Mathlib/CategoryTheory/Bicategory/LocallyDiscrete.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Calle Sönne -/ -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Bicategory.Strict.Basic +module + +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Bicategory.Strict.Basic /-! # Locally discrete bicategories @@ -16,6 +18,8 @@ other words, the category consisting of the 1-morphisms between each pair of obj in `LocallyDiscrete C` is defined as the discrete category associated with the type `X ⟶ Y`. -/ +@[expose] public section + namespace CategoryTheory open Bicategory Discrete @@ -141,7 +145,7 @@ def toLoc {a b : C} (f : a ⟶ b) : LocallyDiscrete.mk a ⟶ LocallyDiscrete.mk lemma id_toLoc (a : C) : (𝟙 a).toLoc = 𝟙 (LocallyDiscrete.mk a) := rfl -@[simp] +@[simp, grind _=_] lemma comp_toLoc {a b c : C} (f : a ⟶ b) (g : b ⟶ c) : (f ≫ g).toLoc = f.toLoc ≫ g.toLoc := rfl diff --git a/Mathlib/CategoryTheory/Bicategory/Modification/Oplax.lean b/Mathlib/CategoryTheory/Bicategory/Modification/Oplax.lean index 476756071499be..a587774896cc99 100644 --- a/Mathlib/CategoryTheory/Bicategory/Modification/Oplax.lean +++ b/Mathlib/CategoryTheory/Bicategory/Modification/Oplax.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Calle Sönne -/ +module -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax /-! # Modifications between oplax transformations @@ -23,6 +24,8 @@ A modification `Γ` between oplax transformations `η` and `θ` consists of a fa -/ +@[expose] public section + namespace CategoryTheory.Oplax.OplaxTrans open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean b/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean index 7b9b9aab998060..a9839fb35dc7f5 100644 --- a/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean +++ b/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete -import Mathlib.CategoryTheory.Bicategory.FunctorBicategory.Oplax -import Mathlib.CategoryTheory.Bicategory.End -import Mathlib.CategoryTheory.Monoidal.Comon_ +module + +public import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete +public import Mathlib.CategoryTheory.Bicategory.FunctorBicategory.Oplax +public import Mathlib.CategoryTheory.Bicategory.End +public import Mathlib.CategoryTheory.Monoidal.Comon_ /-! # Comonads in a bicategory @@ -22,6 +24,8 @@ structure on the set of lax functors at this point, which is needed to show that bicategory. -/ +@[expose] public section + namespace CategoryTheory namespace Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Lax.lean b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Lax.lean new file mode 100644 index 00000000000000..8129da0f03edab --- /dev/null +++ b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Lax.lean @@ -0,0 +1,287 @@ +/- +Copyright (c) 2025 Robin Carlier. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Yuma Mizuno, Calle Sönne, Robin Carlier +-/ +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Lax +public import Mathlib.Tactic.CategoryTheory.Bicategory.Basic + +/-! +# Transformations between lax functors + +Just as there are natural transformations between functors, there are transformations +between lax functors. The equality in the naturality condition of a natural transformation gets +replaced by a specified 2-morphism. Now, there are three possible types of transformations (between +lax functors): +* Lax natural transformations; +* OpLax natural transformations; +* Strong natural transformations. +These differ in the direction (and invertibility) of the 2-morphisms involved in the naturality +condition. + +## Main definitions + +* `Lax.LaxTrans F G`: lax transformations between lax functors `F` and `G`. The naturality + condition is given by a 2-morphism `app a ≫ G.map f ⟶ F.map f ≫ app b` for each 1-morphism + `f : a ⟶ b`. +* `Lax.StrongTrans F G`: Strong transformations between lax functors `F` and `G`. + +Using these, we define two `CategoryStruct` (scoped) instances on `B ⥤ᴸ C`, one in the +`Lax.LaxTrans` namespace and one in the `Lax.StrongTrans` namespace. The arrows in these +CategoryStruct's are given by lax transformations and strong transformations respectively. + +We also provide API for going between lax transformations and strong transformations: +* `Lax.StrongCore F G`: a structure on an lax transformation between lax functors that +promotes it to a strong transformation. +* `Lax.mkOfLax η η'`: given an lax transformation `η` such that each component + 2-morphism is an isomorphism, `mkOfLax` gives the corresponding strong transformation. + +# TODO +This file could also include oplax transformations between lax functors. + +## References +* [Niles Johnson, Donald Yau, *2-Dimensional Categories*](https://arxiv.org/abs/2002.06055), +section 4.2. + +-/ + +@[expose] public section + +namespace CategoryTheory.Lax + +open Category Bicategory + +universe w₁ w₂ v₁ v₂ u₁ u₂ + +variable {B : Type u₁} [Bicategory.{w₁, v₁} B] {C : Type u₂} [Bicategory.{w₂, v₂} C] + +/-- If `η` is an lax transformation between `F` and `G`, we have a 1-morphism +`η.app a : F.obj a ⟶ G.obj a` for each object `a : B`. We also have a 2-morphism +`η.naturality f : app a ≫ G.map f ⟶ F.map f ≫ app b` for each 1-morphism `f : a ⟶ b`. +These 2-morphisms satisfies the naturality condition, and preserve the identities and +the compositions modulo some adjustments of domains and codomains of 2-morphisms. +-/ +structure LaxTrans (F G : B ⥤ᴸ C) where + /-- The component 1-morphisms of an lax transformation. -/ + app (a : B) : F.obj a ⟶ G.obj a + /-- The 2-morphisms underlying the lax naturality constraint. -/ + naturality {a b : B} (f : a ⟶ b) : app a ≫ G.map f ⟶ F.map f ≫ app b + /-- Naturality of the lax naturality constraint. -/ + naturality_naturality {a b : B} {f g : a ⟶ b} (η : f ⟶ g) : + naturality f ≫ F.map₂ η ▷ app b = app a ◁ G.map₂ η ≫ naturality g := by + cat_disch + /-- Lax unity. -/ + naturality_id (a : B) : + app a ◁ G.mapId a ≫ naturality (𝟙 a) = + (ρ_ (app a)).hom ≫ (λ_ (app a)).inv ≫ F.mapId a ▷ app a := by + cat_disch + /-- Lax functoriality. -/ + naturality_comp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : + app a ◁ G.mapComp f g ≫ naturality (f ≫ g) = + (α_ _ _ _).inv ≫ naturality f ▷ G.map g ≫ (α_ _ _ _).hom ≫ + F.map f ◁ naturality g ≫ (α_ _ _ _).inv ≫ F.mapComp f g ▷ app c := by + cat_disch + +attribute [reassoc (attr := simp)] LaxTrans.naturality_naturality LaxTrans.naturality_id + LaxTrans.naturality_comp + +namespace LaxTrans + +variable {F G H : B ⥤ᴸ C} (η : LaxTrans F G) (θ : LaxTrans G H) + +variable (F) in +/-- The identity lax transformation. -/ +def id : LaxTrans F F where + app a := 𝟙 (F.obj a) + naturality {_ _} f := (λ_ (F.map f)).hom ≫ (ρ_ (F.map f)).inv + +instance : Inhabited (LaxTrans F F) := + ⟨id F⟩ + +/-- Auxiliary definition for `vComp`. -/ +abbrev vCompApp (a : B) : F.obj a ⟶ H.obj a := + η.app a ≫ θ.app a + +/-- Auxiliary definition for `vComp`. -/ +abbrev vCompNaturality {a b : B} (f : a ⟶ b) : + (η.app a ≫ θ.app a) ≫ H.map f ⟶ F.map f ≫ η.app b ≫ θ.app b := + (α_ _ _ _).hom ≫ η.app a ◁ θ.naturality f ≫ (α_ _ _ _).inv ≫ + η.naturality f ▷ θ.app b ≫ (α_ _ _ _).hom + +theorem vComp_naturality_naturality {a b : B} {f g : a ⟶ b} (β : f ⟶ g) : + η.vCompNaturality θ f ≫ F.map₂ β ▷ η.vCompApp θ b = + η.vCompApp θ a ◁ H.map₂ β ≫ η.vCompNaturality θ g := + calc + _ = 𝟙 _ ⊗≫ η.app a ◁ θ.naturality f ⊗≫ + (η.naturality f ≫ F.map₂ β ▷ η.app b) ▷ θ.app b ⊗≫ 𝟙 _ := by + bicategory + _ = 𝟙 _ ⊗≫ η.app a ◁ (θ.naturality f ≫ G.map₂ β ▷ θ.app b) ⊗≫ + η.naturality g ▷ θ.app b ⊗≫ 𝟙 _ := by + rw [naturality_naturality] + bicategory + _ = _ := by + rw [naturality_naturality] + bicategory + +theorem vComp_naturality_id (a : B) : + η.vCompApp θ a ◁ H.mapId a ≫ η.vCompNaturality θ (𝟙 a) = + (ρ_ (η.vCompApp θ a)).hom ≫ (λ_ (η.vCompApp θ a)).inv ≫ F.mapId a ▷ η.vCompApp θ a := + calc + _ = 𝟙 _ ⊗≫ η.app a ◁ (θ.app a ◁ H.mapId a ≫ θ.naturality (𝟙 a)) ⊗≫ + η.naturality (𝟙 a) ▷ θ.app a ⊗≫ 𝟙 _ := by + bicategory + _ = 𝟙 _ ⊗≫ (η.app a ◁ G.mapId a ≫ η.naturality (𝟙 a)) ▷ θ.app a ⊗≫ 𝟙 _ := by + rw [naturality_id] + bicategory + _ = _ := by + rw [naturality_id] + bicategory + +theorem vComp_naturality_comp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : + η.vCompApp θ a ◁ H.mapComp f g ≫ η.vCompNaturality θ (f ≫ g) = + (α_ (η.vCompApp θ a) (H.map f) (H.map g)).inv ≫ + η.vCompNaturality θ f ▷ H.map g ≫ + (α_ (F.map f) (η.vCompApp θ b) (H.map g)).hom ≫ + F.map f ◁ η.vCompNaturality θ g ≫ + (α_ (F.map f) (F.map g) (η.vCompApp θ c)).inv ≫ F.mapComp f g ▷ η.vCompApp θ c := + calc + _ = 𝟙 _ ⊗≫ η.app a ◁ (θ.app a ◁ H.mapComp f g ≫ θ.naturality (f ≫ g)) ⊗≫ + η.naturality (f ≫ g) ▷ θ.app c ⊗≫ 𝟙 _ := by + bicategory + _ = 𝟙 _ ⊗≫ η.app a ◁ (θ.naturality f ▷ (H.map g) ⊗≫ G.map f ◁ θ.naturality g) ⊗≫ + (η.app a ◁ G.mapComp f g ≫ η.naturality (f ≫ g)) ▷ θ.app c ⊗≫ 𝟙 _ := by + rw [naturality_comp θ] + bicategory + _ = 𝟙 _ ⊗≫ η.app a ◁ θ.naturality f ▷ H.map g ⊗≫ + ((η.app a ≫ G.map f) ◁ θ.naturality g ≫ η.naturality f ▷ (G.map g ≫ θ.app c)) ⊗≫ + F.map f ◁ η.naturality g ▷ θ.app c ⊗≫ + F.mapComp f g ▷ η.app c ▷ θ.app c ⊗≫ 𝟙 _ := by + rw [naturality_comp η] + bicategory + _ = _ := by + rw [whisker_exchange] + bicategory + +/-- Vertical composition of lax transformations. -/ +@[simps] +def vComp (η : LaxTrans F G) (θ : LaxTrans G H) : LaxTrans F H where + app a := vCompApp η θ a + naturality := vCompNaturality η θ + naturality_naturality := vComp_naturality_naturality η θ + naturality_id := vComp_naturality_id η θ + naturality_comp := vComp_naturality_comp η θ + +/-- `CategoryStruct` on `B ⥤ᴸ C` where the (1-)morphisms are given by lax +transformations. -/ +@[simps! id_app id_naturality comp_app comp_naturality] +scoped instance : CategoryStruct (B ⥤ᴸ C) where + Hom := LaxTrans + id := LaxTrans.id + comp := LaxTrans.vComp + +end LaxTrans + +/-- A strong natural transformation between lax functors `F` and `G` is a natural transformation +that is "natural up to 2-isomorphisms". + +More precisely, it consists of the following: +* a 1-morphism `η.app a : F.obj a ⟶ G.obj a` for each object `a : B`. +* a 2-isomorphism `η.naturality f : app a ≫ G.map f ≅ F.map f ≫ app b` for each 1-morphism +`f : a ⟶ b`. +* These 2-isomorphisms satisfy the naturality condition, and preserve the identities and the + compositions modulo some adjustments of domains and codomains of 2-morphisms. +-/ +structure StrongTrans (F G : B ⥤ᴸ C) where + app (a : B) : F.obj a ⟶ G.obj a + naturality {a b : B} (f : a ⟶ b) : app a ≫ G.map f ≅ F.map f ≫ app b + naturality_naturality {a b : B} {f g : a ⟶ b} (η : f ⟶ g) : + (naturality f).hom ≫ F.map₂ η ▷ app b = app a ◁ G.map₂ η ≫ (naturality g).hom := by + cat_disch + /-- Lax unity. -/ + naturality_id (a : B) : + app a ◁ G.mapId a ≫ (naturality (𝟙 a)).hom = + (ρ_ (app a)).hom ≫ (λ_ (app a)).inv ≫ F.mapId a ▷ app a := by + cat_disch + /-- Lax functoriality. -/ + naturality_comp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : + app a ◁ G.mapComp f g ≫ (naturality (f ≫ g)).hom = + (α_ _ _ _).inv ≫ (naturality f).hom ▷ G.map g ≫ (α_ _ _ _).hom ≫ + F.map f ◁ (naturality g).hom ≫ (α_ _ _ _).inv ≫ F.mapComp f g ▷ app c := by + cat_disch + +attribute [nolint docBlame] CategoryTheory.Lax.StrongTrans.app + CategoryTheory.Lax.StrongTrans.naturality + +attribute [reassoc (attr := simp)] StrongTrans.naturality_naturality + StrongTrans.naturality_id StrongTrans.naturality_comp + +/-- A structure on an lax transformation that promotes it to a strong transformation. + +See `Pseudofunctor.StrongTrans.mkOfLax`. -/ +structure LaxTrans.StrongCore {F G : B ⥤ᴸ C} (η : F ⟶ G) where + /-- The underlying 2-isomorphisms of the naturality constraint. -/ + naturality {a b : B} (f : a ⟶ b) : η.app a ≫ G.map f ≅ F.map f ≫ η.app b + /-- The 2-isomorphisms agree with the underlying 2-morphism of the lax transformation. -/ + naturality_hom {a b : B} (f : a ⟶ b) : (naturality f).hom = η.naturality f := by cat_disch + +attribute [simp] LaxTrans.StrongCore.naturality_hom + +namespace StrongTrans + +/-- The underlying lax natural transformation of a strong natural transformation. -/ +@[simps] +def toLax {F G : B ⥤ᴸ C} (η : StrongTrans F G) : LaxTrans F G where + app := η.app + naturality f := (η.naturality f).hom + +/-- Construct a strong natural transformation from an lax natural transformation whose +naturality 2-morphism is an isomorphism. -/ +def mkOfLax {F G : B ⥤ᴸ C} (η : LaxTrans F G) (η' : LaxTrans.StrongCore η) : + StrongTrans F G where + app := η.app + naturality := η'.naturality + +/-- Construct a strong natural transformation from an lax natural transformation whose +naturality 2-morphism is an isomorphism. -/ +noncomputable def mkOfLax' {F G : B ⥤ᴸ C} (η : LaxTrans F G) + [∀ a b (f : a ⟶ b), IsIso (η.naturality f)] : StrongTrans F G where + app := η.app + naturality _ := asIso (η.naturality _) + +variable (F : B ⥤ᴸ C) + +/-- The identity strong natural transformation. -/ +@[simps!] +def id : StrongTrans F F := + mkOfLax (LaxTrans.id F) { naturality := fun f ↦ (λ_ (F.map f)) ≪≫ (ρ_ (F.map f)).symm } + +@[simp] +lemma id.toLax : (id F).toLax = LaxTrans.id F := + rfl + +instance : Inhabited (StrongTrans F F) := + ⟨id F⟩ + +variable {F} {G H : B ⥤ᴸ C} (η : StrongTrans F G) (θ : StrongTrans G H) + +/-- Vertical composition of strong natural transformations. -/ +@[simps!] +def vComp : StrongTrans F H := + mkOfLax (LaxTrans.vComp η.toLax θ.toLax) + { naturality := fun {a b} f ↦ + (α_ _ _ _) ≪≫ whiskerLeftIso (η.app a) (θ.naturality f) ≪≫ (α_ _ _ _).symm ≪≫ + whiskerRightIso (η.naturality f) (θ.app b) ≪≫ (α_ _ _ _) } + +/-- `CategoryStruct` on `B ⥤ᴸ C` where the (1-)morphisms are given by strong +transformations. -/ +@[simps! id_app id_naturality comp_app comp_naturality] +scoped instance categoryStruct : CategoryStruct (B ⥤ᴸ C) where + Hom := StrongTrans + id := StrongTrans.id + comp := StrongTrans.vComp + +end StrongTrans + +end CategoryTheory.Lax diff --git a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Oplax.lean b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Oplax.lean index 5ff2e3d251b636..be2be51f15915d 100644 --- a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Oplax.lean +++ b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Oplax.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno, Calle Sönne -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Oplax +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Oplax /-! # Transformations between oplax functors @@ -43,6 +45,8 @@ This file could also include lax transformations between oplax functors. -/ +@[expose] public section + namespace CategoryTheory.Oplax open Category Bicategory diff --git a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean index aa5c0e39c7f67f..40101e4e321512 100644 --- a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean +++ b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ +module -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax /-! @@ -33,6 +34,8 @@ strong transformations. See `Pseudofunctor.categoryStruct`. -/ +@[expose] public section + namespace CategoryTheory.Pseudofunctor open Category Bicategory Oplax diff --git a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Strong.lean b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Strong.lean index 5c495b39b9f392..ea3cf2c3439cab 100644 --- a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Strong.lean +++ b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Strong.lean @@ -1,4 +1,6 @@ -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor -import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Oplax deprecated_module (since := "2025-05-11") diff --git a/Mathlib/CategoryTheory/Bicategory/Opposites.lean b/Mathlib/CategoryTheory/Bicategory/Opposites.lean index 930bb57d25908e..470123c503af8d 100644 --- a/Mathlib/CategoryTheory/Bicategory/Opposites.lean +++ b/Mathlib/CategoryTheory/Bicategory/Opposites.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ +module -import Mathlib.CategoryTheory.Bicategory.Basic -import Mathlib.CategoryTheory.Opposites +public import Mathlib.CategoryTheory.Bicategory.Basic +public import Mathlib.CategoryTheory.Opposites /-! # Opposite bicategories @@ -32,6 +33,8 @@ Note: `Cᶜᵒᵒᵖ` is WIP by Christian Merten. -/ +@[expose] public section + universe w v u open CategoryTheory Bicategory Opposite diff --git a/Mathlib/CategoryTheory/Bicategory/SingleObj.lean b/Mathlib/CategoryTheory/Bicategory/SingleObj.lean index 5a7770ac3be91d..4c3ba9e9ffa3ee 100644 --- a/Mathlib/CategoryTheory/Bicategory/SingleObj.lean +++ b/Mathlib/CategoryTheory/Bicategory/SingleObj.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Bicategory.End -import Mathlib.CategoryTheory.Monoidal.Functor +module + +public import Mathlib.CategoryTheory.Bicategory.End +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # Promoting a monoidal category to a single object bicategory. @@ -25,6 +27,8 @@ is equivalent to the bicategory consisting of * (oplax) natural transformations `η` such that `η.app Unit.unit = 𝟙 _`. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/Strict.lean b/Mathlib/CategoryTheory/Bicategory/Strict.lean index d533337606a1e0..8bb046c7d1620c 100644 --- a/Mathlib/CategoryTheory/Bicategory/Strict.lean +++ b/Mathlib/CategoryTheory/Bicategory/Strict.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Bicategory.Strict.Basic +module + +public import Mathlib.CategoryTheory.Bicategory.Strict.Basic deprecated_module (since := "2025-10-02") diff --git a/Mathlib/CategoryTheory/Bicategory/Strict/Basic.lean b/Mathlib/CategoryTheory/Bicategory/Strict/Basic.lean index 0dcb07b760cd85..ff7a1b2c48836a 100644 --- a/Mathlib/CategoryTheory/Bicategory/Strict/Basic.lean +++ b/Mathlib/CategoryTheory/Bicategory/Strict/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Bicategory.Basic +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Bicategory.Basic /-! # Strict bicategories @@ -21,6 +23,8 @@ For this reason, we use `eqToIso`, which gives isomorphisms from equalities, ins identities. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Bicategory/Strict/Pseudofunctor.lean b/Mathlib/CategoryTheory/Bicategory/Strict/Pseudofunctor.lean index e03bf5144f487b..0f24cd8c70805d 100644 --- a/Mathlib/CategoryTheory/Bicategory/Strict/Pseudofunctor.lean +++ b/Mathlib/CategoryTheory/Bicategory/Strict/Pseudofunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Christian Merten -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor -import Mathlib.CategoryTheory.CommSq +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +public import Mathlib.CategoryTheory.CommSq /-! # Pseudofunctors from strict bicategory @@ -22,6 +24,8 @@ isomorphism `F.map t ≫ F.map r ≅ F.map l ≫ F.map b` -/ +@[expose] public section + namespace CategoryTheory universe w₁ w₂ v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/CatCommSq.lean b/Mathlib/CategoryTheory/CatCommSq.lean index e75bec689b7a95..5cda6561784823 100644 --- a/Mathlib/CategoryTheory/CatCommSq.lean +++ b/Mathlib/CategoryTheory/CatCommSq.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Equivalence +module + +public import Mathlib.CategoryTheory.Equivalence /-! # 2-commutative squares of functors @@ -19,6 +21,8 @@ Future work: using this notion in the development of the localization of categor -/ +@[expose] public section + namespace CategoryTheory open Category Functor diff --git a/Mathlib/CategoryTheory/Category/Basic.lean b/Mathlib/CategoryTheory/Category/Basic.lean index 240d6334d2c990..0c6198bde0d54c 100644 --- a/Mathlib/CategoryTheory/Category/Basic.lean +++ b/Mathlib/CategoryTheory/Category/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison, Johannes Hölzl, Reid Barton -/ -import Mathlib.CategoryTheory.Category.Init -import Mathlib.Combinatorics.Quiver.Basic -import Mathlib.Tactic.PPWithUniv -import Mathlib.Tactic.Common -import Mathlib.Tactic.StacksAttribute -import Mathlib.Tactic.TryThis +module + +public import Mathlib.CategoryTheory.Category.Init +public import Mathlib.Combinatorics.Quiver.Basic +public import Mathlib.Tactic.PPWithUniv +public import Mathlib.Tactic.Common +public import Mathlib.Tactic.StacksAttribute +public import Mathlib.Tactic.TryThis /-! # Categories @@ -29,6 +31,8 @@ local notation:80 g " ⊚ " f:80 => CategoryTheory.CategoryStruct.comp f g -- -/ +@[expose] public section + library_note2 «category theory universes» /-- @@ -100,7 +104,7 @@ scoped infixr:80 " ≫ " => CategoryStruct.comp -- type as \gg syntax (name := sorryIfSorry) "sorry_if_sorry" : tactic open Lean Meta Elab.Tactic in -@[tactic sorryIfSorry, inherit_doc sorryIfSorry] def evalSorryIfSorry : Tactic := fun _ => do +@[tactic sorryIfSorry, inherit_doc sorryIfSorry] meta def evalSorryIfSorry : Tactic := fun _ => do let goalType ← getMainTarget if goalType.hasSorry then closeMainGoal `sorry_if_sorry (← mkSorry goalType true) @@ -165,7 +169,7 @@ open Lean Elab Tactic in Currently this defaults to the `aesop_cat` wrapper around `aesop`, but by setting the option `mathlib.tactic.category.grind` to `true`, it will use the `grind` tactic instead. -/ -def categoryTheoryDischarger : TacticM Unit := do +meta def categoryTheoryDischarger : TacticM Unit := do if ← getBoolOption `mathlib.tactic.category.grind then if ← getBoolOption `mathlib.tactic.category.log_grind then logInfo "Category theory discharger using `grind`." diff --git a/Mathlib/CategoryTheory/Category/Bipointed.lean b/Mathlib/CategoryTheory/Category/Bipointed.lean index aa1c056363b75d..cc68bc1d4d2c97 100644 --- a/Mathlib/CategoryTheory/Category/Bipointed.lean +++ b/Mathlib/CategoryTheory/Category/Bipointed.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.Category.Pointed +module + +public import Mathlib.CategoryTheory.Category.Pointed /-! # The category of bipointed types @@ -15,6 +17,8 @@ This defines `Bipointed`, the category of bipointed types. Monoidal structure -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/Cat.lean b/Mathlib/CategoryTheory/Category/Cat.lean index b14ff4444242fe..8be4b25829be4e 100644 --- a/Mathlib/CategoryTheory/Category/Cat.lean +++ b/Mathlib/CategoryTheory/Category/Cat.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.CategoryTheory.Bicategory.Strict.Basic -import Mathlib.CategoryTheory.ConcreteCategory.Bundled -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Types.Basic +module + +public import Mathlib.CategoryTheory.Bicategory.Strict.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.Bundled +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Types.Basic /-! # Category of categories @@ -21,6 +23,8 @@ Though `Cat` is not a concrete category, we use `bundled` to define its carrier type. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean b/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean index ebd52996135743..3c3d61bb0704de 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Nicolas Rolland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolas Rolland -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.ConnectedComponents +module + +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.ConnectedComponents /-! # Adjunctions related to Cat, the category of categories @@ -21,6 +23,8 @@ All this could be made with 2-functors -/ +@[expose] public section + universe v u namespace CategoryTheory.Cat diff --git a/Mathlib/CategoryTheory/Category/Cat/AsSmall.lean b/Mathlib/CategoryTheory/Category/Cat/AsSmall.lean index f65cd41c8bb6d3..6d9a8671aa2f67 100644 --- a/Mathlib/CategoryTheory/Category/Cat/AsSmall.lean +++ b/Mathlib/CategoryTheory/Category/Cat/AsSmall.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Category.ULift +module + +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Category.ULift /-! # Functorially embedding `Cat` into the category of small categories @@ -17,6 +19,8 @@ any larger category of small categories. Show that `asSmallFunctor` is faithful. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/Cat/CartesianClosed.lean b/Mathlib/CategoryTheory/Category/Cat/CartesianClosed.lean index aa14732f379a87..8e4a5aa7f00bc8 100644 --- a/Mathlib/CategoryTheory/Category/Cat/CartesianClosed.lean +++ b/Mathlib/CategoryTheory/Category/Cat/CartesianClosed.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Emily Riehl -/ -import Mathlib.CategoryTheory.Closed.Cartesian -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat +module + +public import Mathlib.CategoryTheory.Closed.Cartesian +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat /-! # Cartesian closed structure on `Cat` @@ -22,6 +24,8 @@ definitional equalities but may have to be phrased using `eqToIso`. -/ +@[expose] public section + universe v u v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/Cat/Colimit.lean b/Mathlib/CategoryTheory/Category/Cat/Colimit.lean index 0c9afe75866dd4..99f6b96338a3c5 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Colimit.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Colimit.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Mario Carneiro and Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl -/ -import Mathlib.AlgebraicTopology.SimplicialSet.NerveAdjunction -import Mathlib.CategoryTheory.Monad.Limits +module + +public import Mathlib.AlgebraicTopology.SimplicialSet.NerveAdjunction +public import Mathlib.CategoryTheory.Monad.Limits /-! @@ -17,6 +19,8 @@ of simplicial sets (see `AlgebraicTopology.SimplicialSet.NerveAdjunction`), so t homotopy category functor `SSet ⥤ Cat`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Category/Cat/Limit.lean b/Mathlib/CategoryTheory/Category/Cat/Limit.lean index d443e586705da7..91bcbe8ef1ccc7 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Limit.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Limit.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # The category of small categories has all small limits. @@ -19,6 +21,8 @@ which are carried to one another by the action on morphisms of the functors in t Can the indexing category live in a lower universe? -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Category/Cat/Op.lean b/Mathlib/CategoryTheory/Category/Cat/Op.lean index f70525315d3042..f6ebba4a38eca6 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Op.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Op.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Opposites /-! # The dualizing functor on `Cat` @@ -14,6 +16,8 @@ categories. We then show that this functor is strictly involutive and that it in equivalence on `Cat`. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/Cat/Terminal.lean b/Mathlib/CategoryTheory/Category/Cat/Terminal.lean index c15d60d16ed8b1..1260138cc5b02c 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Terminal.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Terminal.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier, Emily Riehl -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Terminal categories @@ -20,6 +22,8 @@ with a unique object. -/ +@[expose] public section + universe v u v' u' open CategoryTheory Limits Functor diff --git a/Mathlib/CategoryTheory/Category/Factorisation.lean b/Mathlib/CategoryTheory/Category/Factorisation.lean index 8e76cab8187f7f..3418d29490a219 100644 --- a/Mathlib/CategoryTheory/Category/Factorisation.lean +++ b/Mathlib/CategoryTheory/Category/Factorisation.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # The Factorisation Category of a Category @@ -19,6 +21,8 @@ TODO: Show that `Factorisation f` is isomorphic to a comma category in two ways. TODO: Make `MonoFactorisation f` a special case of a `Factorisation f`. -/ +@[expose] public section + namespace CategoryTheory universe v u diff --git a/Mathlib/CategoryTheory/Category/GaloisConnection.lean b/Mathlib/CategoryTheory/Category/GaloisConnection.lean index 7f4fd4fb17e44d..e44c989e87fe9e 100644 --- a/Mathlib/CategoryTheory/Category/GaloisConnection.lean +++ b/Mathlib/CategoryTheory/Category/GaloisConnection.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison, Johannes Hölzl, Reid Barton -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.Order.GaloisConnection.Defs +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.Order.GaloisConnection.Defs /-! @@ -15,6 +17,8 @@ import Mathlib.Order.GaloisConnection.Defs -/ +@[expose] public section + universe u v diff --git a/Mathlib/CategoryTheory/Category/Grpd.lean b/Mathlib/CategoryTheory/Category/Grpd.lean index 94808881b98ad8..568e819d706d76 100644 --- a/Mathlib/CategoryTheory/Category/Grpd.lean +++ b/Mathlib/CategoryTheory/Category/Grpd.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.CategoryTheory.SingleObj -import Mathlib.CategoryTheory.Limits.Shapes.Products +module + +public import Mathlib.CategoryTheory.SingleObj +public import Mathlib.CategoryTheory.Limits.Shapes.Products /-! # Category of groupoids @@ -22,6 +24,8 @@ Though `Grpd` is not a concrete category, we use `Bundled` to define its carrier type. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe v u @@ -74,6 +78,8 @@ def forgetToCat : Grpd.{v, u} ⥤ Cat.{v, u} where obj C := Cat.of C map := id +instance (X : Grpd) : Groupoid (Grpd.forgetToCat.obj X) := inferInstanceAs (Groupoid X) + instance forgetToCat_full : forgetToCat.Full where map_surjective f := ⟨f, rfl⟩ instance forgetToCat_faithful : forgetToCat.Faithful where diff --git a/Mathlib/CategoryTheory/Category/Init.lean b/Mathlib/CategoryTheory/Category/Init.lean index 204de941af056e..6110d0ecf6f4db 100644 --- a/Mathlib/CategoryTheory/Category/Init.lean +++ b/Mathlib/CategoryTheory/Category/Init.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ +module -import Mathlib.Init -import Aesop +public import Mathlib.Init +public import Aesop /-! # Category Theory Rule Set @@ -15,23 +16,25 @@ This module defines the `CategoryTheory` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ +@[expose] public section + declare_aesop_rule_sets [CategoryTheory] /-- Option to control whether the category theory library should use `grind` or `aesop` in the `cat_disch` tactic, which is widely used as an autoparameter. -/ -register_option mathlib.tactic.category.grind : Bool := { +meta register_option mathlib.tactic.category.grind : Bool := { defValue := false descr := "The category theory library should use `grind` instead of `aesop`." } /-- Log a message whenever the category theory discharger uses `grind`. -/ -register_option mathlib.tactic.category.log_grind : Bool := { +meta register_option mathlib.tactic.category.log_grind : Bool := { defValue := false descr := "Log a message whenever the category theory discharger uses `grind`." } /-- Log a message whenever the category theory discharger uses `aesop`. -/ -register_option mathlib.tactic.category.log_aesop : Bool := { +meta register_option mathlib.tactic.category.log_aesop : Bool := { defValue := false descr := "Log a message whenever the category theory discharger uses `aesop`." } diff --git a/Mathlib/CategoryTheory/Category/KleisliCat.lean b/Mathlib/CategoryTheory/Category/KleisliCat.lean index 6972e4be1c3716..f33b82e8203ecc 100644 --- a/Mathlib/CategoryTheory/Category/KleisliCat.lean +++ b/Mathlib/CategoryTheory/Category/KleisliCat.lean @@ -3,8 +3,9 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ +module -import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.CategoryTheory.Category.Basic /-! # The Kleisli construction on the Type category @@ -18,6 +19,8 @@ the equivalence between the two. Generalise this to work with CategoryTheory.Monad -/ +@[expose] public section + universe u v diff --git a/Mathlib/CategoryTheory/Category/Pairwise.lean b/Mathlib/CategoryTheory/Category/Pairwise.lean index aca744a04cfec2..24e0739f8af82f 100644 --- a/Mathlib/CategoryTheory/Category/Pairwise.lean +++ b/Mathlib/CategoryTheory/Category/Pairwise.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Limits.IsLimit -import Mathlib.Order.CompleteLattice.Basic +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Limits.IsLimit +public import Mathlib.Order.CompleteLattice.Basic /-! # The category of "pairwise intersections". @@ -22,6 +24,8 @@ we produce a functor `Pairwise ι ⥤ α` in the obvious way, and show that `iSup U` provides a colimit cocone over this functor. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Category/PartialFun.lean b/Mathlib/CategoryTheory/Category/PartialFun.lean index 2d41033894fbb7..5860c1505ffcf0 100644 --- a/Mathlib/CategoryTheory/Category/PartialFun.lean +++ b/Mathlib/CategoryTheory/Category/PartialFun.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.Category.Pointed -import Mathlib.Data.PFun +module + +public import Mathlib.CategoryTheory.Category.Pointed +public import Mathlib.Data.PFun /-! # The category of types with partial functions @@ -26,6 +28,8 @@ constructive. (https://ncatlab.org/nlab/show/partial+function) -/ +@[expose] public section + open CategoryTheory Option universe u diff --git a/Mathlib/CategoryTheory/Category/Pointed.lean b/Mathlib/CategoryTheory/Category/Pointed.lean index 4a63d6f542da10..e5a57dd4443708 100644 --- a/Mathlib/CategoryTheory/Category/Pointed.lean +++ b/Mathlib/CategoryTheory/Category/Pointed.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Adjunction.Basic /-! # The category of pointed types @@ -17,6 +19,8 @@ This defines `Pointed`, the category of pointed types. * Upgrade `typeToPointed` to an equivalence -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/Preorder.lean b/Mathlib/CategoryTheory/Category/Preorder.lean index 1504f53b9e454f..596a718de18942 100644 --- a/Mathlib/CategoryTheory/Category/Preorder.lean +++ b/Mathlib/CategoryTheory/Category/Preorder.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison, Johannes Hölzl, Reid Barton -/ -import Mathlib.CategoryTheory.Equivalence -import Mathlib.CategoryTheory.EqToHom -import Mathlib.Order.Hom.Basic -import Mathlib.Data.ULift +module + +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.Order.Hom.Basic +public import Mathlib.Data.ULift /-! @@ -26,6 +28,8 @@ categories. -/ +@[expose] public section + universe u v diff --git a/Mathlib/CategoryTheory/Category/Quiv.lean b/Mathlib/CategoryTheory/Category/Quiv.lean index 31b6d6e9f7e26d..4191fb15b65208 100644 --- a/Mathlib/CategoryTheory/Category/Quiv.lean +++ b/Mathlib/CategoryTheory/Category/Quiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Emily Riehl, Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.PathCategory.MorphismProperty +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.PathCategory.MorphismProperty /-! # The category of quivers @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.PathCategory.MorphismProperty The category of (bundled) quivers, and the free/forgetful adjunction between `Cat` and `Quiv`. -/ +@[expose] public section + universe v u v₁ v₂ v₃ u₁ u₂ u₃ w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/ReflQuiv.lean b/Mathlib/CategoryTheory/Category/ReflQuiv.lean index c5bc92b56e7e7e..fe3ee3accb79e0 100644 --- a/Mathlib/CategoryTheory/Category/ReflQuiv.lean +++ b/Mathlib/CategoryTheory/Category/ReflQuiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Mario Carneiro and Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl -/ -import Mathlib.Combinatorics.Quiver.ReflQuiver -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Category.Quiv +module + +public import Mathlib.Combinatorics.Quiver.ReflQuiver +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Category.Quiv /-! # The category of refl quivers @@ -14,6 +16,8 @@ The category `ReflQuiv` of (bundled) reflexive quivers, and the free/forgetful `Cat` and `ReflQuiv`. -/ +@[expose] public section + namespace CategoryTheory universe v u v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Category/RelCat.lean b/Mathlib/CategoryTheory/Category/RelCat.lean index 207d7ab4346b29..ec9a1e380fed6d 100644 --- a/Mathlib/CategoryTheory/Category/RelCat.lean +++ b/Mathlib/CategoryTheory/Category/RelCat.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Uni Marx -/ -import Mathlib.CategoryTheory.EssentialImage -import Mathlib.CategoryTheory.Iso -import Mathlib.CategoryTheory.Opposites -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Data.Rel +module + +public import Mathlib.CategoryTheory.EssentialImage +public import Mathlib.CategoryTheory.Iso +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Data.Rel /-! # Basics on the category of relations @@ -21,6 +23,8 @@ By flipping the arguments to a relation, we construct an equivalence `opEquivale `RelCat` and its opposite. -/ +@[expose] public section + open SetRel namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Category/TwoP.lean b/Mathlib/CategoryTheory/Category/TwoP.lean index 6606e537f2f80d..f6ab4bef8352ed 100644 --- a/Mathlib/CategoryTheory/Category/TwoP.lean +++ b/Mathlib/CategoryTheory/Category/TwoP.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.Category.Bipointed -import Mathlib.Data.TwoPointing +module + +public import Mathlib.CategoryTheory.Category.Bipointed +public import Mathlib.Data.TwoPointing /-! # The category of two-pointed types @@ -17,6 +19,8 @@ This defines `TwoP`, the category of two-pointed types. (https://ncatlab.org/nlab/show/coalgebra+of+the+real+interval) -/ +@[expose] public section + open CategoryTheory Option diff --git a/Mathlib/CategoryTheory/Category/ULift.lean b/Mathlib/CategoryTheory/Category/ULift.lean index ec200df99a4a3c..0e65ca96fe99e8 100644 --- a/Mathlib/CategoryTheory/Category/ULift.lean +++ b/Mathlib/CategoryTheory/Category/ULift.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.CategoryTheory.Equivalence -import Mathlib.CategoryTheory.EqToHom -import Mathlib.Data.ULift +module + +public import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.Data.ULift /-! # Basic API for ULift @@ -38,6 +40,8 @@ The forward direction of the equivalence, `C ⥤ AsSmall C`, is denoted `AsSmall and the backward direction is `AsSmall.down`. The equivalence itself is `AsSmall.equiv`. -/ +@[expose] public section + universe w₁ v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Center/Basic.lean b/Mathlib/CategoryTheory/Center/Basic.lean index b67f80b8107075..805a1d2bd9f1d0 100644 --- a/Mathlib/CategoryTheory/Center/Basic.lean +++ b/Mathlib/CategoryTheory/Center/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Endomorphism +module + +public import Mathlib.CategoryTheory.Endomorphism /-! # The center of a category @@ -16,6 +18,8 @@ type of endomorphisms of the identity functor of `C`. * https://ncatlab.org/nlab/show/center+of+a+category -/ + +@[expose] public section universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Center/Linear.lean b/Mathlib/CategoryTheory/Center/Linear.lean index 516a72b0db4845..0570bf96d6f587 100644 --- a/Mathlib/CategoryTheory/Center/Linear.lean +++ b/Mathlib/CategoryTheory/Center/Linear.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Preadditive.FunctorCategory -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.CategoryTheory.Center.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.CategoryTheory.Center.Basic /-! # Center of a linear category @@ -16,6 +18,8 @@ is a ring morphism, we define a `R`-linear structure on `C` attached to `φ`. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Center/Localization.lean b/Mathlib/CategoryTheory/Center/Localization.lean index f303534478d072..bd412411cdf312 100644 --- a/Mathlib/CategoryTheory/Center/Localization.lean +++ b/Mathlib/CategoryTheory/Center/Localization.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Center.Basic -import Mathlib.CategoryTheory.Localization.Predicate -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Center.Basic +public import Mathlib.CategoryTheory.Localization.Predicate +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # Localization of the center of a category @@ -17,6 +19,8 @@ categories, we promote this to a ring morphism `CatCenter C →+* CatCenter D`. -/ +@[expose] public section + universe w v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ChosenFiniteProducts.lean b/Mathlib/CategoryTheory/ChosenFiniteProducts.lean index e14bc49150345a..d94e7cebf3d8c6 100644 --- a/Mathlib/CategoryTheory/ChosenFiniteProducts.lean +++ b/Mathlib/CategoryTheory/ChosenFiniteProducts.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic deprecated_module (since := "2025-05-15") diff --git a/Mathlib/CategoryTheory/ChosenFiniteProducts/Cat.lean b/Mathlib/CategoryTheory/ChosenFiniteProducts/Cat.lean index 9d72ad20549bc1..20473ed510efaa 100644 --- a/Mathlib/CategoryTheory/ChosenFiniteProducts/Cat.lean +++ b/Mathlib/CategoryTheory/ChosenFiniteProducts/Cat.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Cat deprecated_module (since := "2025-05-15") diff --git a/Mathlib/CategoryTheory/ChosenFiniteProducts/FunctorCategory.lean b/Mathlib/CategoryTheory/ChosenFiniteProducts/FunctorCategory.lean index b8ff237de34a54..17a5c0f2128e19 100644 --- a/Mathlib/CategoryTheory/ChosenFiniteProducts/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/ChosenFiniteProducts/FunctorCategory.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory deprecated_module (since := "2025-05-15") diff --git a/Mathlib/CategoryTheory/ChosenFiniteProducts/InfSemilattice.lean b/Mathlib/CategoryTheory/ChosenFiniteProducts/InfSemilattice.lean index dc0e34c388c322..f52aa178f9fbe8 100644 --- a/Mathlib/CategoryTheory/ChosenFiniteProducts/InfSemilattice.lean +++ b/Mathlib/CategoryTheory/ChosenFiniteProducts/InfSemilattice.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.InfSemilattice +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.InfSemilattice deprecated_module (since := "2025-05-15") diff --git a/Mathlib/CategoryTheory/ChosenFiniteProducts/Over.lean b/Mathlib/CategoryTheory/ChosenFiniteProducts/Over.lean index 2c9a7cf8bd4908..6e637b45a0491a 100644 --- a/Mathlib/CategoryTheory/ChosenFiniteProducts/Over.lean +++ b/Mathlib/CategoryTheory/ChosenFiniteProducts/Over.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Over +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Over deprecated_module (since := "2025-05-15") diff --git a/Mathlib/CategoryTheory/Closed/Cartesian.lean b/Mathlib/CategoryTheory/Closed/Cartesian.lean index eb3b2a985462dc..ca2c4a9ecfeeb9 100644 --- a/Mathlib/CategoryTheory/Closed/Cartesian.lean +++ b/Mathlib/CategoryTheory/Closed/Cartesian.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta, Edward Ayers, Thomas Read. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Edward Ayers, Thomas Read -/ -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic /-! # Cartesian closed categories @@ -29,6 +31,8 @@ Some of the results here are true more generally for closed objects and for closed monoidal categories, and these could be generalised. -/ +@[expose] public section + universe v v₂ u u₂ @@ -99,7 +103,7 @@ notation:20 A " ⟹ " B:19 => (exp A).obj B open Lean PrettyPrinter.Delaborator SubExpr in /-- Delaborator for `Functor.obj` -/ @[app_delab Functor.obj] -def delabFunctorObjExp : Delab := whenPPOption getPPNotation <| withOverApp 6 <| do +meta def delabFunctorObjExp : Delab := whenPPOption getPPNotation <| withOverApp 6 do let e ← getExpr guard <| e.isAppOfArity' ``Functor.obj 6 let A ← withNaryArg 4 do diff --git a/Mathlib/CategoryTheory/Closed/Enrichment.lean b/Mathlib/CategoryTheory/Closed/Enrichment.lean index 2be0d7fbce929d..d71c798788829e 100644 --- a/Mathlib/CategoryTheory/Closed/Enrichment.lean +++ b/Mathlib/CategoryTheory/Closed/Enrichment.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Daniel Carranza. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Carranza, Joël Riou -/ -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic -import Mathlib.CategoryTheory.Closed.Monoidal +module + +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +public import Mathlib.CategoryTheory.Closed.Monoidal /-! # A closed monoidal category is enriched in itself @@ -21,6 +23,8 @@ All structure field values are defined in `Mathlib/CategoryTheory/Closed/Monoida -/ +@[expose] public section + universe u v namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Closed/Functor.lean b/Mathlib/CategoryTheory/Closed/Functor.lean index a385f6e107cfc7..b682de08f46e13 100644 --- a/Mathlib/CategoryTheory/Closed/Functor.lean +++ b/Mathlib/CategoryTheory/Closed/Functor.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Closed.Cartesian -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Adjunction.FullyFaithful +module + +public import Mathlib.CategoryTheory.Closed.Cartesian +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful /-! # Cartesian closed functors @@ -29,6 +31,8 @@ Frobenius reciprocity, Cartesian closed functor -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Closed/FunctorCategory/Basic.lean b/Mathlib/CategoryTheory/Closed/FunctorCategory/Basic.lean index 5a8a9488794a65..c984b44bd7d3b3 100644 --- a/Mathlib/CategoryTheory/Closed/FunctorCategory/Basic.lean +++ b/Mathlib/CategoryTheory/Closed/FunctorCategory/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Closed.Enrichment -import Mathlib.CategoryTheory.Enriched.FunctorCategory +module + +public import Mathlib.CategoryTheory.Closed.Enrichment +public import Mathlib.CategoryTheory.Enriched.FunctorCategory /-! # Functor categories are monoidal closed @@ -15,6 +17,8 @@ limits. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Closed/FunctorCategory/Complete.lean b/Mathlib/CategoryTheory/Closed/FunctorCategory/Complete.lean index 41c13c797d0bea..44770adbd41e4b 100644 --- a/Mathlib/CategoryTheory/Closed/FunctorCategory/Complete.lean +++ b/Mathlib/CategoryTheory/Closed/FunctorCategory/Complete.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Adjunction.Lifting.Right -import Mathlib.CategoryTheory.Closed.FunctorCategory.Groupoid -import Mathlib.CategoryTheory.Groupoid.Discrete -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Monad.Comonadicity +module + +public import Mathlib.CategoryTheory.Adjunction.Lifting.Right +public import Mathlib.CategoryTheory.Closed.FunctorCategory.Groupoid +public import Mathlib.CategoryTheory.Groupoid.Discrete +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Monad.Comonadicity /-! # Functors into a complete monoidal closed category form a monoidal closed category. @@ -16,6 +18,8 @@ TODO (in progress by Joël Riou): make a more explicit construction of the inter categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ open CategoryTheory MonoidalCategory MonoidalClosed Limits diff --git a/Mathlib/CategoryTheory/Closed/FunctorCategory/Groupoid.lean b/Mathlib/CategoryTheory/Closed/FunctorCategory/Groupoid.lean index 16828b2e30c695..1bab7cbe4af928 100644 --- a/Mathlib/CategoryTheory/Closed/FunctorCategory/Groupoid.lean +++ b/Mathlib/CategoryTheory/Closed/FunctorCategory/Groupoid.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Antoine Labelle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle -/ -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Monoidal.FunctorCategory +module + +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory /-! # Functors from a groupoid into a monoidal closed category form a monoidal closed category. @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Monoidal.FunctorCategory (Using the pointwise monoidal structure on the functor category.) -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Closed/FunctorToTypes.lean b/Mathlib/CategoryTheory/Closed/FunctorToTypes.lean index 6235f313687ab4..3e1848f87c65c9 100644 --- a/Mathlib/CategoryTheory/Closed/FunctorToTypes.lean +++ b/Mathlib/CategoryTheory/Closed/FunctorToTypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Functor.FunctorHom -import Mathlib.CategoryTheory.Closed.Monoidal +module + +public import Mathlib.CategoryTheory.Functor.FunctorHom +public import Mathlib.CategoryTheory.Closed.Monoidal /-! # Functors to Type are closed. @@ -17,6 +19,8 @@ It should be shown that `C ⥤ Type max w v u` is Cartesian closed. -/ +@[expose] public section + universe w v' v u u' diff --git a/Mathlib/CategoryTheory/Closed/Ideal.lean b/Mathlib/CategoryTheory/Closed/Ideal.lean index e28b1a16c0ef8a..0101c4dd3df224 100644 --- a/Mathlib/CategoryTheory/Closed/Ideal.lean +++ b/Mathlib/CategoryTheory/Closed/Ideal.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts -import Mathlib.CategoryTheory.Monad.Limits -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Adjunction.Reflective -import Mathlib.CategoryTheory.Closed.Cartesian -import Mathlib.CategoryTheory.Subterminal +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +public import Mathlib.CategoryTheory.Monad.Limits +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Closed.Cartesian +public import Mathlib.CategoryTheory.Subterminal /-! # Exponential ideals @@ -27,6 +29,8 @@ following are equivalent. * `i` is an exponential ideal. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Closed/Monoidal.lean b/Mathlib/CategoryTheory/Closed/Monoidal.lean index 2066dbddfc91db..555d5fb67b2af1 100644 --- a/Mathlib/CategoryTheory/Closed/Monoidal.lean +++ b/Mathlib/CategoryTheory/Closed/Monoidal.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta, Daniel Carranza, Joël Riou -/ -import Mathlib.CategoryTheory.Monoidal.Functor -import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Adjunction.Mates -import Mathlib.CategoryTheory.Adjunction.Parametrized +module + +public import Mathlib.CategoryTheory.Monoidal.Functor +public import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Adjunction.Mates +public import Mathlib.CategoryTheory.Adjunction.Parametrized /-! # Closed monoidal categories @@ -19,6 +21,8 @@ Some of the theorems proved about Cartesian closed categories should be generalised and moved to this file. -/ +@[expose] public section + universe v u u₂ v₂ diff --git a/Mathlib/CategoryTheory/Closed/Types.lean b/Mathlib/CategoryTheory/Closed/Types.lean index bda13857281d96..c02ad42861b551 100644 --- a/Mathlib/CategoryTheory/Closed/Types.lean +++ b/Mathlib/CategoryTheory/Closed/Types.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Closed.Cartesian -import Mathlib.CategoryTheory.Limits.Presheaf -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Types.Basic +module + +public import Mathlib.CategoryTheory.Closed.Cartesian +public import Mathlib.CategoryTheory.Limits.Presheaf +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Types.Basic /-! # Cartesian closure of Type @@ -16,6 +18,8 @@ category in `Type u₁`. Note this implies that the category of presheaves on a small category `C` is Cartesian closed. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Closed/Zero.lean b/Mathlib/CategoryTheory/Closed/Zero.lean index 3d66182e809370..2ddca1cfe82fc3 100644 --- a/Mathlib/CategoryTheory/Closed/Zero.lean +++ b/Mathlib/CategoryTheory/Closed/Zero.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Closed.Cartesian -import Mathlib.CategoryTheory.PUnit -import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects +module + +public import Mathlib.CategoryTheory.Closed.Cartesian +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects /-! # A Cartesian closed category with zero object is trivial @@ -19,6 +21,8 @@ object and one morphism. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/CodiscreteCategory.lean b/Mathlib/CategoryTheory/CodiscreteCategory.lean index d7b9d001b1306a..0f3f1ac77acc18 100644 --- a/Mathlib/CategoryTheory/CodiscreteCategory.lean +++ b/Mathlib/CategoryTheory/CodiscreteCategory.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Alvaro Belmonte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alvaro Belmonte, Joël Riou -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Pi.Basic -import Mathlib.Data.ULift -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Pi.Basic +public import Mathlib.Data.ULift +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Adjunction.Basic /-! # Codiscrete categories @@ -25,6 +27,8 @@ or `I`-indexed families of isomorphisms to natural transformations or natural is We define `functorToCat : Type u ⥤ Cat.{0,u}` which sends a type to the codiscrete category and show it is right adjoint to `Cat.objects.` -/ + +@[expose] public section namespace CategoryTheory universe u v w diff --git a/Mathlib/CategoryTheory/CofilteredSystem.lean b/Mathlib/CategoryTheory/CofilteredSystem.lean index 621cfe2a14a597..036f6ea7c6e9ff 100644 --- a/Mathlib/CategoryTheory/CofilteredSystem.lean +++ b/Mathlib/CategoryTheory/CofilteredSystem.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kyle Miller, Adam Topaz, Rémi Bottinelli, Junyan Xu. All rig Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Adam Topaz, Rémi Bottinelli, Junyan Xu -/ -import Mathlib.Topology.Category.TopCat.Limits.Konig +module + +public import Mathlib.Topology.Category.TopCat.Limits.Konig /-! # Cofiltered systems @@ -49,6 +51,8 @@ Mittag-Leffler, surjective, eventual range, inverse system, -/ +@[expose] public section + universe u v w diff --git a/Mathlib/CategoryTheory/CommSq.lean b/Mathlib/CategoryTheory/CommSq.lean index 5cb4684680e698..57f3467414c1c5 100644 --- a/Mathlib/CategoryTheory/CommSq.lean +++ b/Mathlib/CategoryTheory/CommSq.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.CategoryTheory.Comma.Arrow +module + +public import Mathlib.CategoryTheory.Comma.Arrow /-! # Commutative squares @@ -22,6 +24,8 @@ Refactor `LiftStruct` from `Arrow.lean` and lifting properties using `CommSq.lea -/ +@[expose] public section + namespace CategoryTheory @@ -217,7 +221,6 @@ instance subsingleton_liftStruct_of_mono (sq : CommSq f i p g) [Mono p] : variable (sq : CommSq f i p g) - /-- The assertion that a square has a `LiftStruct`. -/ class HasLift : Prop where /-- Square has a `LiftStruct`. -/ diff --git a/Mathlib/CategoryTheory/Comma/Arrow.lean b/Mathlib/CategoryTheory/Comma/Arrow.lean index a2f3c8ff964c71..1deec687bab42d 100644 --- a/Mathlib/CategoryTheory/Comma/Arrow.lean +++ b/Mathlib/CategoryTheory/Comma/Arrow.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Comma.Basic +module + +public import Mathlib.CategoryTheory.Comma.Basic /-! # The category of arrows @@ -17,6 +19,8 @@ where `L` and `R` are both the identity functor. comma, arrow -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/Basic.lean b/Mathlib/CategoryTheory/Comma/Basic.lean index 9a0b6c4d609842..6d4faf9ab73480 100644 --- a/Mathlib/CategoryTheory/Comma/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Iso -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Products.Unitor +module + +public import Mathlib.CategoryTheory.Iso +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Products.Unitor /-! # Comma categories @@ -44,6 +46,8 @@ respectively. comma, slice, coslice, over, under, arrow -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean index 0d4e57798f5bd5..87d917fd7e56c3 100644 --- a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean +++ b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.CategoryTheory.EssentiallySmall -import Mathlib.Data.Set.Finite.Basic -import Mathlib.SetTheory.Cardinal.HasCardinalLT +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.SetTheory.Cardinal.HasCardinalLT /-! # Cardinal of Arrow @@ -18,6 +19,8 @@ If `A` is a (small) category, `Arrow C` is finite iff `FinCategory C` holds. -/ +@[expose] public section + universe w w' v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/Final.lean b/Mathlib/CategoryTheory/Comma/Final.lean index 4bd72ccfaef910..dc599725763317 100644 --- a/Mathlib/CategoryTheory/Comma/Final.lean +++ b/Mathlib/CategoryTheory/Comma/Final.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Limits.IsConnected -import Mathlib.CategoryTheory.Limits.Sifted -import Mathlib.CategoryTheory.Filtered.Final -import Mathlib.CategoryTheory.Filtered.Flat -import Mathlib.CategoryTheory.Grothendieck -import Mathlib.CategoryTheory.Comma.StructuredArrow.CommaMap +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Limits.IsConnected +public import Mathlib.CategoryTheory.Limits.Sifted +public import Mathlib.CategoryTheory.Filtered.Final +public import Mathlib.CategoryTheory.Filtered.Flat +public import Mathlib.CategoryTheory.Grothendieck +public import Mathlib.CategoryTheory.Comma.StructuredArrow.CommaMap /-! # Finality of Projections in Comma Categories @@ -29,6 +31,8 @@ and `A` and `B` are filtered. * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Lemma 3.4.3 -- 3.4.5 -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ v₆ u₁ u₂ u₃ u₄ u₅ u₆ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/LocallySmall.lean b/Mathlib/CategoryTheory/Comma/LocallySmall.lean index 3169d9f7eb7808..7f1e6131e24336 100644 --- a/Mathlib/CategoryTheory/Comma/LocallySmall.lean +++ b/Mathlib/CategoryTheory/Comma/LocallySmall.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.EssentiallySmall /-! # Comma categories are locally small @@ -17,6 +18,8 @@ involved are locally small. -/ +@[expose] public section + universe w v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/Over/Basic.lean b/Mathlib/CategoryTheory/Comma/Over/Basic.lean index 36c3205877edb2..f2ce40de98c61e 100644 --- a/Mathlib/CategoryTheory/Comma/Over/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/Over/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.Category.Cat +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.Category.Cat /-! # Over and under categories @@ -20,6 +22,8 @@ Over (and under) categories are special cases of comma categories. Comma, Slice, Coslice, Over, Under -/ +@[expose] public section + namespace CategoryTheory @@ -210,8 +214,8 @@ theorem mapId_eq (Y : T) : map (𝟙 Y) = 𝟭 _ := by /-- The natural isomorphism arising from `mapForget_eq`. -/ @[simps!] -def mapId (Y : T) : map (𝟙 Y) ≅ 𝟭 _ := eqToIso (mapId_eq Y) --- NatIso.ofComponents fun X => isoMk (Iso.refl _) +def mapId (Y : T) : map (𝟙 Y) ≅ 𝟭 _ := + NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) /-- Mapping by `f` and then forgetting is the same as forgetting. -/ theorem mapForget_eq {X Y : T} (f : X ⟶ Y) : @@ -238,13 +242,18 @@ theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : /-- The natural isomorphism arising from `mapComp_eq`. -/ @[simps!] def mapComp {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : - map (f ≫ g) ≅ (map f) ⋙ (map g) := eqToIso (mapComp_eq f g) + map (f ≫ g) ≅ map f ⋙ map g := + NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) /-- If `f = g`, then `map f` is naturally isomorphic to `map g`. -/ @[simps!] def mapCongr {X Y : T} (f g : X ⟶ Y) (h : f = g) : map f ≅ map g := - NatIso.ofComponents (fun A ↦ eqToIso (by rw [h])) + NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) + +@[simp] +lemma mapCongr_rfl {X Y : T} (f : X ⟶ Y) : + mapCongr f f rfl = Iso.refl _ := rfl variable (T) in /-- The functor defined by the over categories -/ diff --git a/Mathlib/CategoryTheory/Comma/Over/OverClass.lean b/Mathlib/CategoryTheory/Comma/Over/OverClass.lean index f45723c3a3c3b3..78d391cf07a7a8 100644 --- a/Mathlib/CategoryTheory/Comma/Over/OverClass.lean +++ b/Mathlib/CategoryTheory/Comma/Over/OverClass.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Tactic.CategoryTheory.Reassoc -import Mathlib.CategoryTheory.Comma.Over.Basic +module + +public import Mathlib.Tactic.CategoryTheory.Reassoc +public import Mathlib.CategoryTheory.Comma.Over.Basic /-! # Typeclasses for `S`-objects and `S`-morphisms @@ -25,6 +27,8 @@ For other applications use unbundled arrows or `CategoryTheory.Over`. -/ +@[expose] public section + namespace CategoryTheory universe v u diff --git a/Mathlib/CategoryTheory/Comma/Over/Pullback.lean b/Mathlib/CategoryTheory/Comma/Over/Pullback.lean index 7471cd3d8866ae..51e4ba3d60cb20 100644 --- a/Mathlib/CategoryTheory/Comma/Over/Pullback.lean +++ b/Mathlib/CategoryTheory/Comma/Over/Pullback.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Andrew Yang -/ -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Adjunction.Mates -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.CategoryTheory.Monad.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Pasting -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso +module + +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Adjunction.Mates +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.CategoryTheory.Monad.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Pasting +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso /-! # Adjunctions related to the over category @@ -31,6 +33,8 @@ In a category with binary products, for any object `X` the functor Show `star X` itself has a right adjoint provided `C` is Cartesian closed and has pullbacks. -/ +@[expose] public section + noncomputable section universe v v₂ u u₂ diff --git a/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean b/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean index 59ecdb6afbb158..ba1fc365dea6a7 100644 --- a/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.HomCongr -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.Tactic.CategoryTheory.Elementwise +module + +public import Mathlib.CategoryTheory.HomCongr +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.Tactic.CategoryTheory.Elementwise /-! # Computation of `Over A` for a presheaf `A` @@ -63,6 +65,8 @@ presheaf, over category, coyoneda -/ +@[expose] public section + namespace CategoryTheory open Category Opposite diff --git a/Mathlib/CategoryTheory/Comma/Presheaf/Colimit.lean b/Mathlib/CategoryTheory/Comma/Presheaf/Colimit.lean index 8272771231498f..7d4726f06c8f61 100644 --- a/Mathlib/CategoryTheory/Comma/Presheaf/Colimit.lean +++ b/Mathlib/CategoryTheory/Comma/Presheaf/Colimit.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Comma.Presheaf.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Yoneda -import Mathlib.CategoryTheory.Limits.Over +module + +public import Mathlib.CategoryTheory.Comma.Presheaf.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Yoneda +public import Mathlib.CategoryTheory.Limits.Over /-! # Relative Yoneda preserves certain colimits @@ -15,6 +17,8 @@ In this file we turn the statement `yonedaYonedaColimit` from about families of presheaves over `A`, i.e., functors `F : J ⥤ Over A`. -/ +@[expose] public section + namespace CategoryTheory open Category Opposite Limits diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean index 12a1c108136e52..c4066b0c2fe258 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Kim Morrison -/ -import Mathlib.CategoryTheory.Comma.Basic -import Mathlib.CategoryTheory.PUnit -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal -import Mathlib.CategoryTheory.Functor.EpiMono +module + +public import Mathlib.CategoryTheory.Comma.Basic +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +public import Mathlib.CategoryTheory.Functor.EpiMono /-! # The category of "structured arrows" @@ -19,6 +21,8 @@ These form a category with morphisms `g : Y ⟶ Y'` making the obvious diagram c We prove that `𝟙 (T.obj Y)` is the initial object in `T`-structured objects with source `T.obj Y`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean index bad40f9edb078f..e7dad4ed610dec 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic /-! # Structured arrow categories on `Comma.map` @@ -12,6 +14,8 @@ We characterize structured arrow categories on arbitrary instances of `Comma.map comma category itself. -/ +@[expose] public section + namespace CategoryTheory namespace StructuredArrow diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/Final.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/Final.lean index 58bc792bea2c1a..ef50893ee34cc5 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/Final.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/Final.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Limits.Final /-! # Finality on Costructured Arrow categories @@ -14,6 +16,8 @@ import Mathlib.CategoryTheory.Limits.Final * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Proposition 3.1.8(i) -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/Functor.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/Functor.lean index 51ac3c4a23938a..0c98fce4757204 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/Functor.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/Functor.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.Grothendieck +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.Grothendieck /-! # Structured Arrow Categories as strict functor to Cat @@ -15,6 +17,8 @@ that, in the dual case, we can precompose it with another functor `L : E ⥤ D` equivalent to `Comma L T`. -/ +@[expose] public section + namespace CategoryTheory universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/Small.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/Small.lean index 92e7574cea778f..d89971aac9d308 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/Small.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/Small.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.EssentiallySmall -import Mathlib.CategoryTheory.ObjectProperty.Small +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.ObjectProperty.Small /-! # Small sets in the category of structured arrows @@ -14,6 +16,8 @@ Here we prove a technical result about small sets in the category of structured be used in the proof of the Special Adjoint Functor Theorem. -/ +@[expose] public section + namespace CategoryTheory -- morphism levels before object levels. See note [category theory universes]. diff --git a/Mathlib/CategoryTheory/ComposableArrows.lean b/Mathlib/CategoryTheory/ComposableArrows/Basic.lean similarity index 98% rename from Mathlib/CategoryTheory/ComposableArrows.lean rename to Mathlib/CategoryTheory/ComposableArrows/Basic.lean index 53c354ad10fe04..d3986b00cff171 100644 --- a/Mathlib/CategoryTheory/ComposableArrows.lean +++ b/Mathlib/CategoryTheory/ComposableArrows/Basic.lean @@ -3,12 +3,15 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.EpiMono -import Mathlib.Data.Fintype.Basic -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.SuppressCompilation +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.SuppressCompilation /-! # Composable arrows @@ -37,6 +40,8 @@ TODO (@joelriou): -/ +@[expose] public section + /-! New `simprocs` that run even in `dsimp` have caused breakages in this file. @@ -275,6 +280,14 @@ lemma ext₁ {F G : ComposableArrows C 1} lemma mk₁_surjective (X : ComposableArrows C 1) : ∃ (X₀ X₁ : C) (f : X₀ ⟶ X₁), X = mk₁ f := ⟨_, _, X.map' 0 1, ext₁ rfl rfl (by simp)⟩ +/-- The bijection between `ComposableArrows C 1` and `Arrow C`. -/ +@[simps] +def arrowEquiv : ComposableArrows C 1 ≃ Arrow C where + toFun F := Arrow.mk F.hom + invFun f := mk₁ f.hom + left_inv F := ComposableArrows.ext₁ rfl rfl (by simp) + right_inv _ := rfl + variable (F) namespace Precomp diff --git a/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean b/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean index f183d03557bf67..f6cd08d4030c09 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johannes Hölzl, Reid Barton, Sean Leather, Yury Kudryashov -/ -import Mathlib.CategoryTheory.Types.Basic +module + +public import Mathlib.CategoryTheory.Types.Basic /-! # Concrete categories @@ -23,10 +25,6 @@ has a functor `forget₂ C D : C ⥤ D` such that `(forget₂ C D) ⋙ (forget D `forget₂.map` agree with the equality above; then `forget₂` will satisfy the functor laws automatically, see `HasForget₂.mk'`. -Two classes helping construct concrete categories in the two most -common cases are provided in the files `BundledHom` and -`UnbundledHom`, see their documentation for details. - ## Implementation notes We are currently switching over from `HasForget` to a new class `ConcreteCategory`, @@ -55,6 +53,8 @@ See [Ahrens and Lumsdaine, *Displayed Categories*][ahrens2017] for related work. -/ +@[expose] public section + assert_not_exists CategoryTheory.CommSq CategoryTheory.Adjunction diff --git a/Mathlib/CategoryTheory/ConcreteCategory/Bundled.lean b/Mathlib/CategoryTheory/ConcreteCategory/Bundled.lean index 875403ebcf0f46..7d0f7f96309320 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/Bundled.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/Bundled.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johannes Hölzl, Reid Barton, Sean Leather -/ -import Mathlib.Init -import Batteries.Tactic.Lint.Misc +module + +public import Mathlib.Init +public import Batteries.Tactic.Lint.Misc /-! # Bundled types @@ -16,8 +18,14 @@ We provide `Category` instances for these in (for categories with unbundled homs, e.g. topological spaces) and in `Mathlib/CategoryTheory/HasForget/BundledHom.lean` (for categories with bundled homs, e.g. monoids). + +Note: this structure will be deprecated in the future in favor of defining the category manually +and then providing the `ConcreteCategory` instance on top of this. See `ConcreteCategory/Basic.lean` +for more details. -/ +@[expose] public section + universe u v namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ConcreteCategory/BundledHom.lean b/Mathlib/CategoryTheory/ConcreteCategory/BundledHom.lean index a99147acd92729..2921d7d9494b76 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/BundledHom.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/BundledHom.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Yury Kudryashov -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.ConcreteCategory.Bundled +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.Bundled /-! # Category instances for algebraic structures that use bundled homs. @@ -16,6 +18,8 @@ This file provides a basic infrastructure to define concrete categories using bu define forgetful functors between them. -/ +@[expose] public section + universe u @@ -25,6 +29,9 @@ variable {c : Type u → Type u} (hom : ∀ ⦃α β : Type u⦄ (_ : c α) (_ : /-- Class for bundled homs. Note that the arguments order follows that of lemmas for `MonoidHom`. This way we can use `⟨@MonoidHom.toFun, @MonoidHom.id ...⟩` in an instance. -/ +@[deprecated "The prefered method for talking about concrete categories is to implement the \ +category manually and then provide the `ConcreteCategory` instance on top of this. See \ +`ConcreteCategory/Basic.lean`" (since := "2025-11-17")] structure BundledHom where /-- the underlying map of a bundled morphism -/ toFun : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), hom Iα Iβ → α → β @@ -49,6 +56,8 @@ attribute [simp] BundledHom.id_toFun BundledHom.comp_toFun namespace BundledHom +set_option linter.deprecated false + variable [𝒞 : BundledHom hom] set_option synthInstance.checkSynthOrder false in diff --git a/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean b/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean index c45051f6641529..8919dacb3698f4 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean @@ -3,15 +3,22 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Tactic.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.ConcreteCategory.Basic +module + +public import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +import all Mathlib.CategoryTheory.Limits.Cones +import all Mathlib.CategoryTheory.Limits.HasLimits +import all Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! In this file we provide various simp lemmas in its elementwise form via `Tactic.Elementwise`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/ConcreteCategory/EpiMono.lean b/Mathlib/CategoryTheory/ConcreteCategory/EpiMono.lean index 61959f96fb74bd..afa600cf0b9bbd 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/EpiMono.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/EpiMono.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.MorphismProperty.Concrete -import Mathlib.CategoryTheory.Types.Basic +module + +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.MorphismProperty.Concrete +public import Mathlib.CategoryTheory.Types.Basic /-! # Epi and mono in concrete categories @@ -21,6 +23,8 @@ by an injective morphism. -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean b/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean index fbd6a8fab48bee..de3859a12e7b55 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! A `forget₂ C D` forgetful functor between concrete categories `C` and `D` whose forgetful functors both reflect isomorphisms, itself reflects isomorphisms. -/ +@[expose] public section + universe u diff --git a/Mathlib/CategoryTheory/ConcreteCategory/UnbundledHom.lean b/Mathlib/CategoryTheory/ConcreteCategory/UnbundledHom.lean index 8d8b18204cf3ce..e4dfffece5601d 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/UnbundledHom.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/UnbundledHom.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.CategoryTheory.ConcreteCategory.BundledHom +module + +public import Mathlib.CategoryTheory.ConcreteCategory.BundledHom /-! # Category instances for structures that use unbundled homs @@ -14,6 +16,8 @@ define forgetful functors between them (see `UnbundledHom.mkHasForget₂`). -/ +@[expose] public section + universe v u @@ -22,6 +26,9 @@ namespace CategoryTheory /-- A class for unbundled homs used to define a category. `hom` must take two types `α`, `β` and instances of the corresponding structures, and return a predicate on `α → β`. -/ +@[deprecated "The prefered method for talking about concrete categories is to implement the \ +category manually and then provide the `ConcreteCategory` instance on top of this. See \ +`ConcreteCategory/Basic.lean`" (since := "2025-11-17")] class UnbundledHom {c : Type u → Type u} (hom : ∀ ⦃α β⦄, c α → c β → (α → β) → Prop) : Prop where hom_id : ∀ {α} (ia : c α), hom ia ia id hom_comp : ∀ {α β γ} {Iα : c α} {Iβ : c β} {Iγ : c γ} {g : β → γ} {f : α → β} (_ : hom Iβ Iγ g) @@ -29,6 +36,8 @@ class UnbundledHom {c : Type u → Type u} (hom : ∀ ⦃α β⦄, c α → c β namespace UnbundledHom +set_option linter.deprecated false + variable (c : Type u → Type u) (hom : ∀ ⦃α β⦄, c α → c β → (α → β) → Prop) [𝒞 : UnbundledHom hom] instance bundledHom : BundledHom fun α β (Iα : c α) (Iβ : c β) => Subtype (hom Iα Iβ) where diff --git a/Mathlib/CategoryTheory/Conj.lean b/Mathlib/CategoryTheory/Conj.lean index 9722bde431ab3f..aff428ee743b30 100644 --- a/Mathlib/CategoryTheory/Conj.lean +++ b/Mathlib/CategoryTheory/Conj.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.CategoryTheory.HomCongr +module + +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.CategoryTheory.HomCongr /-! # Conjugate morphisms by isomorphisms @@ -21,6 +23,8 @@ and `CategoryTheory.Iso.isoCongr : (f : X₁ ≅ X₂) → (g : Y₁ ≅ Y₂) which are defined in `CategoryTheory.HomCongr`. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ConnectedComponents.lean b/Mathlib/CategoryTheory/ConnectedComponents.lean index f8f1a1eed9d331..8c3a6b6b634566 100644 --- a/Mathlib/CategoryTheory/ConnectedComponents.lean +++ b/Mathlib/CategoryTheory/ConnectedComponents.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Data.List.Chain -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Sigma.Basic -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +module + +public import Mathlib.Data.List.Chain +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Sigma.Basic +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory /-! # Connected components of a category @@ -20,6 +22,8 @@ particular `Decomposed J` is the category (definitionally) given by the sigma-ty components of `J`, and it is shown that this is equivalent to `J`. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/CopyDiscardCategory/Basic.lean b/Mathlib/CategoryTheory/CopyDiscardCategory/Basic.lean index 6a7165b3ee0928..2ecf1177c81594 100644 --- a/Mathlib/CategoryTheory/CopyDiscardCategory/Basic.lean +++ b/Mathlib/CategoryTheory/CopyDiscardCategory/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Jacob Reinhold. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jacob Reinhold -/ -import Mathlib.CategoryTheory.Monoidal.Comon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Comon_ /-! # Copy-Discard Categories @@ -36,6 +38,8 @@ The key axioms ensure tensor products respect the comonoid structure. copy-discard, comonoid, symmetric monoidal -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/CopyDiscardCategory/Cartesian.lean b/Mathlib/CategoryTheory/CopyDiscardCategory/Cartesian.lean index 03699a0780d139..4f13db2b025f3a 100644 --- a/Mathlib/CategoryTheory/CopyDiscardCategory/Cartesian.lean +++ b/Mathlib/CategoryTheory/CopyDiscardCategory/Cartesian.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Jacob Reinhold. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jacob Reinhold -/ -import Mathlib.CategoryTheory.CopyDiscardCategory.Basic -import Mathlib.CategoryTheory.CopyDiscardCategory.Deterministic -import Mathlib.CategoryTheory.Monoidal.Cartesian.Comon_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.CopyDiscardCategory.Basic +public import Mathlib.CategoryTheory.CopyDiscardCategory.Deterministic +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Comon_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic /-! # Cartesian Categories as Copy-Discard Categories @@ -25,6 +27,8 @@ Every cartesian monoidal category is a copy-discard category where: cartesian, copy-discard, comonoid, symmetric monoidal -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/CopyDiscardCategory/Deterministic.lean b/Mathlib/CategoryTheory/CopyDiscardCategory/Deterministic.lean index 7167b46e7c898e..c816a2f21ec612 100644 --- a/Mathlib/CategoryTheory/CopyDiscardCategory/Deterministic.lean +++ b/Mathlib/CategoryTheory/CopyDiscardCategory/Deterministic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Jacob Reinhold. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jacob Reinhold -/ -import Mathlib.CategoryTheory.CopyDiscardCategory.Basic +module + +public import Mathlib.CategoryTheory.CopyDiscardCategory.Basic /-! # Deterministic Morphisms in Copy-Discard Categories @@ -30,6 +32,8 @@ morphisms are deterministic. deterministic, copy-discard category, comonoid morphism -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Core.lean b/Mathlib/CategoryTheory/Core.lean index a7ffebd4a93f10..76929bdafac224 100644 --- a/Mathlib/CategoryTheory/Core.lean +++ b/Mathlib/CategoryTheory/Core.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Robin Carlier -/ -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.CategoryTheory.Whiskering -import Mathlib.Control.EquivFunctor +module + +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.Control.EquivFunctor /-! # The core of a category @@ -21,6 +23,8 @@ Any functor `F` from a groupoid `G` into `C` factors through `CategoryTheory.Cor but this is not functorial with respect to `F`. -/ +@[expose] public section + namespace CategoryTheory open Functor diff --git a/Mathlib/CategoryTheory/Countable.lean b/Mathlib/CategoryTheory/Countable.lean index 959cc80be0c5de..0dee10dce04abd 100644 --- a/Mathlib/CategoryTheory/Countable.lean +++ b/Mathlib/CategoryTheory/Countable.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EssentiallySmall -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Countable.Small +module + +public import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Countable.Small /-! # Countable categories @@ -14,6 +16,8 @@ A category is countable in this sense if it has countably many objects and count -/ +@[expose] public section + universe w v u noncomputable section diff --git a/Mathlib/CategoryTheory/Dialectica/Basic.lean b/Mathlib/CategoryTheory/Dialectica/Basic.lean index 87161e4eeac92b..0c77b3ba862da5 100644 --- a/Mathlib/CategoryTheory/Dialectica/Basic.lean +++ b/Mathlib/CategoryTheory/Dialectica/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.CategoryTheory.Subobject.Basic -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.CategoryTheory.Subobject.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! # Dialectica category @@ -36,6 +38,8 @@ in Set Theory, state in imperative programming, and others, see [Dialectica Cate -/ +@[expose] public section + noncomputable section namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Dialectica/Monoidal.lean b/Mathlib/CategoryTheory/Dialectica/Monoidal.lean index 86c4f905ee0a47..643bd1d7f66a0f 100644 --- a/Mathlib/CategoryTheory/Dialectica/Monoidal.lean +++ b/Mathlib/CategoryTheory/Dialectica/Monoidal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Dialectica.Basic +module + +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Dialectica.Basic /-! # The Dialectica category is symmetric monoidal @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Dialectica.Basic We show that the category `Dial` has a symmetric monoidal category structure. -/ +@[expose] public section + noncomputable section namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/DifferentialObject.lean b/Mathlib/CategoryTheory/DifferentialObject.lean index 7db7d0f8e0650f..95e87b81a7950c 100644 --- a/Mathlib/CategoryTheory/DifferentialObject.lean +++ b/Mathlib/CategoryTheory/DifferentialObject.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Data.Int.Cast.Defs -import Mathlib.CategoryTheory.Shift.Basic -import Mathlib.CategoryTheory.ConcreteCategory.Basic +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Data.Int.Cast.Defs +public import Mathlib.CategoryTheory.Shift.Basic +public import Mathlib.CategoryTheory.ConcreteCategory.Basic /-! # Differential objects in a category. @@ -20,6 +22,8 @@ such as the forgetful functor, zero morphisms and zero objects, and the shift fu on differential objects. -/ +@[expose] public section + open CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/DinatTrans.lean b/Mathlib/CategoryTheory/DinatTrans.lean index e02aea17103579..1924ec1fe102c7 100644 --- a/Mathlib/CategoryTheory/DinatTrans.lean +++ b/Mathlib/CategoryTheory/DinatTrans.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Andrea Laretto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrea Laretto, Fernando Chu -/ -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.Opposites /-! # Dinatural transformations @@ -21,6 +23,8 @@ ordinary natural transformations. * -/ +@[expose] public section + namespace CategoryTheory universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Discrete/Basic.lean b/Mathlib/CategoryTheory/Discrete/Basic.lean index 77649795436b3b..c1317df2fdbfc6 100644 --- a/Mathlib/CategoryTheory/Discrete/Basic.lean +++ b/Mathlib/CategoryTheory/Discrete/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Pi.Basic -import Mathlib.Data.ULift +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Pi.Basic +public import Mathlib.Data.ULift /-! # Discrete categories @@ -32,6 +34,8 @@ We show equivalences of types are the same as (categorical) equivalences of the discrete categories. -/ +@[expose] public section + namespace CategoryTheory -- morphism levels before object levels. See note [category theory universes]. @@ -106,7 +110,7 @@ attribute [local aesop safe tactic (rule_sets := [CategoryTheory])] to locally give `cat_disch` the ability to call `cases` on `Discrete` and `(_ : Discrete _) ⟶ (_ : Discrete _)` hypotheses. -/ -def discreteCases : TacticM Unit := do +meta def discreteCases : TacticM Unit := do evalTactic (← `(tactic| discrete_cases)) -- TODO: investigate turning on either diff --git a/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean b/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean index 262284c78cd67b..7c89ec25368558 100644 --- a/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean +++ b/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +module + +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic /-! # Structured arrows when the target category is discrete @@ -16,6 +18,8 @@ if `F : C ⥤ Discrete T`, then the categories -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Discrete/SumsProducts.lean b/Mathlib/CategoryTheory/Discrete/SumsProducts.lean index 7216a66725111f..9ec867d8be7e48 100644 --- a/Mathlib/CategoryTheory/Discrete/SumsProducts.lean +++ b/Mathlib/CategoryTheory/Discrete/SumsProducts.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Sums.Basic -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Sums.Basic +public import Mathlib.CategoryTheory.Products.Basic /-! # Sums and products of discrete categories. @@ -24,6 +26,8 @@ are also discrete, both in the form of explicit equivalences and through the -/ +@[expose] public section + namespace CategoryTheory namespace Discrete diff --git a/Mathlib/CategoryTheory/Distributive/Cartesian.lean b/Mathlib/CategoryTheory/Distributive/Cartesian.lean index bb3457e95e4754..04c0b6d6f661f6 100644 --- a/Mathlib/CategoryTheory/Distributive/Cartesian.lean +++ b/Mathlib/CategoryTheory/Distributive/Cartesian.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Sina Hazratpour. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sina Hazratpour -/ -import Mathlib.CategoryTheory.Distributive.Monoidal -import Mathlib.CategoryTheory.Limits.MonoCoprod -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Distributive.Monoidal +public import Mathlib.CategoryTheory.Limits.MonoCoprod +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic /-! @@ -40,6 +42,8 @@ monoidal distributive. - [Carboni et al, Introduction to extensive and distributive categories][CARBONI1993145] -/ +@[expose] public section + universe v v₂ u u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Distributive/Monoidal.lean b/Mathlib/CategoryTheory/Distributive/Monoidal.lean index 7a63c65fe671e5..6c99b4abb889db 100644 --- a/Mathlib/CategoryTheory/Distributive/Monoidal.lean +++ b/Mathlib/CategoryTheory/Distributive/Monoidal.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Sina Hazratpour. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sina Hazratpour -/ -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.End -import Mathlib.CategoryTheory.Monoidal.Preadditive +module + +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.End +public import Mathlib.CategoryTheory.Monoidal.Preadditive /-! # Distributive monoidal categories @@ -55,6 +57,8 @@ pointed types and the coproduct given by the wedge sum is distributive. -/ +@[expose] public section + universe v v₂ u u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Basic.lean b/Mathlib/CategoryTheory/EffectiveEpi/Basic.lean index 0487a6aadf92f3..abf41d0106cb50 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Basic.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products /-! # Effective epimorphisms @@ -33,6 +35,8 @@ our notion of `EffectiveEpi` is often called "strict epi" in the literature. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Comp.lean b/Mathlib/CategoryTheory/EffectiveEpi/Comp.lean index 2f44ee8ae3c89b..a7fe97ac241143 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Comp.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Comp.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Basic +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Basic /-! # Composition of effective epimorphisms @@ -12,6 +14,8 @@ This file provides `EffectiveEpi` instances for certain compositions. -/ +@[expose] public section + namespace CategoryTheory open Limits Category diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean b/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean index 87c5560d945e1f..ea0de47b008991 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.Tactic.ApplyFun /-! # Effective epimorphic families and coproducts @@ -15,6 +17,8 @@ the coproduct exists, and the converse under some more conditions on the coprodu interacts well with pullbacks). -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Enough.lean b/Mathlib/CategoryTheory/EffectiveEpi/Enough.lean index dc7f679ddd6fbf..fa8d586be9daf5 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Enough.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Enough.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Basic +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Basic /-! # Effectively enough objects in the image of a functor @@ -12,6 +14,8 @@ We define the class `F.EffectivelyEnough` on a functor `F : C ⥤ D` which says in `D`, there exists an effective epi to it from an object in the image of `F`. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Extensive.lean b/Mathlib/CategoryTheory/EffectiveEpi/Extensive.lean index d8020b5b961d37..9748b27c8cc3d9 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Extensive.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Extensive.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Preserves -import Mathlib.CategoryTheory.EffectiveEpi.Coproduct -import Mathlib.CategoryTheory.Extensive -import Mathlib.CategoryTheory.Limits.Preserves.Finite +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Preserves +public import Mathlib.CategoryTheory.EffectiveEpi.Coproduct +public import Mathlib.CategoryTheory.Extensive +public import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Preserving and reflecting effective epis on extensive categories @@ -15,6 +17,8 @@ We prove that a functor between `FinitaryPreExtensive` categories preserves (res effective epi families if it preserves (resp. reflects) effective epis. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean b/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean index cba9657d21df36..9a56b3d811190f 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Comp -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Comp +public import Mathlib.Data.Fintype.EquivFin /-! # Functors preserving effective epimorphisms @@ -17,6 +19,8 @@ epimorphic families. effective epis, similar to `CategoryTheory.preserves_epi_of_preservesColimit`. -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/EffectiveEpi/RegularEpi.lean b/Mathlib/CategoryTheory/EffectiveEpi/RegularEpi.lean index 9272c878d3ca11..bdb1c11386b65d 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/RegularEpi.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/RegularEpi.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.CategoryTheory.EffectiveEpi.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.CategoryTheory.EffectiveEpi.Basic /-! # The relationship between effective and regular epimorphisms. @@ -13,6 +15,8 @@ This file proves that the notions of regular epi and effective epi are equivalen kernel pairs, and that regular epi implies effective epi in general. -/ +@[expose] public section + namespace CategoryTheory open Limits RegularEpi diff --git a/Mathlib/CategoryTheory/Elements.lean b/Mathlib/CategoryTheory/Elements.lean index 2745d34d13775b..89e2d5e74678ee 100644 --- a/Mathlib/CategoryTheory/Elements.lean +++ b/Mathlib/CategoryTheory/Elements.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.Category.Cat +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.Category.Cat /-! # The category of elements @@ -30,6 +32,8 @@ more convenient API. We prove the equivalence in category of elements, Grothendieck construction, comma category -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Elementwise.lean b/Mathlib/CategoryTheory/Elementwise.lean index 06fe4ef41ec18b..8ebd6b8dda9b55 100644 --- a/Mathlib/CategoryTheory/Elementwise.lean +++ b/Mathlib/CategoryTheory/Elementwise.lean @@ -3,8 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Tactic.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.ConcreteCategory.Basic +module + +public import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +import all Mathlib.CategoryTheory.Iso -- for accessing proofs /-! # Use the `elementwise` attribute to create applied versions of lemmas. @@ -14,6 +17,8 @@ however some early parts of the category theory library are imported by `Tactic. so we need to add the attribute after the fact. -/ +@[expose] public section + /-! We now add some `elementwise` attributes to lemmas that were proved earlier. -/ diff --git a/Mathlib/CategoryTheory/Endofunctor/Algebra.lean b/Mathlib/CategoryTheory/Endofunctor/Algebra.lean index e4c7944d4018d7..bcc4e0526f59bd 100644 --- a/Mathlib/CategoryTheory/Endofunctor/Algebra.lean +++ b/Mathlib/CategoryTheory/Endofunctor/Algebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joseph Hua. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta, Johan Commelin, Reid Barton, Robert Y. Lewis, Joseph Hua -/ -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal -import Mathlib.CategoryTheory.Functor.EpiMono +module + +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +public import Mathlib.CategoryTheory.Functor.EpiMono /-! @@ -22,6 +24,8 @@ coalgebras over `G`. algebras over the endofunctor coincide with algebras over the free monad on the endofunctor. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Endomorphism.lean b/Mathlib/CategoryTheory/Endomorphism.lean index 156af226c20e27..817eb68c947f20 100644 --- a/Mathlib/CategoryTheory/Endomorphism.lean +++ b/Mathlib/CategoryTheory/Endomorphism.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Kim Morrison, Simon Hudon -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Group.Units.Hom -import Mathlib.CategoryTheory.Groupoid +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Group.Units.Hom +public import Mathlib.CategoryTheory.Groupoid /-! # Endomorphisms @@ -18,6 +20,8 @@ For each `X : C`, we provide `CategoryTheory.End X := X ⟶ X` with a monoid str and `CategoryTheory.Aut X := X ≅ X` with a group structure. -/ +@[expose] public section + universe v v' u u' diff --git a/Mathlib/CategoryTheory/Enriched/Basic.lean b/Mathlib/CategoryTheory/Enriched/Basic.lean index 24c931e1cf90b6..fad82c039fd3ae 100644 --- a/Mathlib/CategoryTheory/Enriched/Basic.lean +++ b/Mathlib/CategoryTheory/Enriched/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda -import Mathlib.CategoryTheory.Monoidal.Center -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda +public import Mathlib.CategoryTheory.Monoidal.Center +public import Mathlib.Tactic.ApplyFun /-! # Enriched categories @@ -33,6 +35,8 @@ We verify that when `V = Type v`, all these notion reduce to the usual ones. [morrison-penney-enriched] -/ +@[expose] public section + universe w w' v v' u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean b/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean index 2681322943bbed..90b0ae0c1bd6c4 100644 --- a/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean +++ b/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Enriched.Basic -import Mathlib.CategoryTheory.Bicategory.Basic +module + +public import Mathlib.CategoryTheory.Enriched.Basic +public import Mathlib.CategoryTheory.Bicategory.Basic /-! # The bicategory of `V`-enriched categories @@ -18,6 +20,8 @@ category `V`. * Define the bicategory of enriched ordinary categories. -/ +@[expose] public section + universe w v u u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean b/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean index f4e8650186a4a2..94ad3f59d4d5a6 100644 --- a/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Monoidal.FunctorCategory -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Limits.Shapes.End +module + +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Limits.Shapes.End /-! # Functor categories are enriched @@ -26,6 +28,8 @@ The definition `isLimitConeFunctorEnrichedHom` shows that -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory.Enriched.FunctorCategory diff --git a/Mathlib/CategoryTheory/Enriched/HomCongr.lean b/Mathlib/CategoryTheory/Enriched/HomCongr.lean index 9536a0d158544b..eadaa8bcd1f097 100644 --- a/Mathlib/CategoryTheory/Enriched/HomCongr.lean +++ b/Mathlib/CategoryTheory/Enriched/HomCongr.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Nick Ward. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nick Ward -/ -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +module + +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic /-! # Congruence of enriched homs @@ -24,6 +26,8 @@ they construct equivalences between `Type`s and `Sort`s, respectively, while in this file we construct isomorphisms between objects in `V`. -/ +@[expose] public section + universe v' v u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalLimits.lean b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalLimits.lean index 44194be9a5dc35..66541098a7cdc7 100644 --- a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalLimits.lean +++ b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalLimits.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Eugster, Dagur Asgeirsson, Emily Riehl -/ -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +public import Mathlib.CategoryTheory.Limits.Final /-! # Existence of conical limits @@ -33,6 +35,8 @@ However, it is not fully clear yet whether this could lead to potential issues, if there are multiple `MonoidalCategory _` instances in scope. -/ +@[expose] public section + universe v₁ u₁ v₂ u₂ w v' v u u' namespace CategoryTheory.Enriched diff --git a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalProducts.lean b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalProducts.lean index 3daad82ef77c0d..e7f13f0b1435cf 100644 --- a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalProducts.lean +++ b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalProducts.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Jon Eugster, Emily Riehl -/ -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits +module + +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits /-! # Existence of conical products -/ +@[expose] public section + universe w v' v u u' namespace CategoryTheory.Enriched diff --git a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalPullbacks.lean b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalPullbacks.lean index a2116ffb248b91..5ea2bdf3a76237 100644 --- a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalPullbacks.lean +++ b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalPullbacks.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Jon Eugster, Emily Riehl -/ -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits +module + +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits /-! # Existence of conical pullbacks -/ +@[expose] public section + universe w v' v u u' namespace CategoryTheory.Enriched diff --git a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalTerminal.lean b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalTerminal.lean index 728144d0b1c4af..235f05252382db 100644 --- a/Mathlib/CategoryTheory/Enriched/Limits/HasConicalTerminal.lean +++ b/Mathlib/CategoryTheory/Enriched/Limits/HasConicalTerminal.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Jon Eugster. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Jon Eugster, Emily Riehl -/ -import Mathlib.CategoryTheory.Enriched.Limits.HasConicalProducts +module + +public import Mathlib.CategoryTheory.Enriched.Limits.HasConicalProducts /-! # Existence of conical terminal objects -/ +@[expose] public section + universe w v' v u u' namespace CategoryTheory.Enriched diff --git a/Mathlib/CategoryTheory/Enriched/Opposite.lean b/Mathlib/CategoryTheory/Enriched/Opposite.lean index d626e11db20cda..654560724c0f43 100644 --- a/Mathlib/CategoryTheory/Enriched/Opposite.lean +++ b/Mathlib/CategoryTheory/Enriched/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Daniel Carranza. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Carranza -/ -import Mathlib.CategoryTheory.Enriched.Ordinary.Basic -import Mathlib.CategoryTheory.Monoidal.Braided.Basic +module + +public import Mathlib.CategoryTheory.Enriched.Ordinary.Basic +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic /-! @@ -23,6 +25,8 @@ an enriched ordinary category. -/ +@[expose] public section + universe v₁ u₁ v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean b/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean index aa0059898ffa5c..232c1c3301414c 100644 --- a/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean +++ b/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Enriched.Basic -import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda +module + +public import Mathlib.CategoryTheory.Enriched.Basic +public import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda /-! # Enriched ordinary categories @@ -24,6 +26,8 @@ using an abbreviation for `EnrichedOrdinaryCategory SSet C`. -/ +@[expose] public section + universe v' v v'' u u' u'' open CategoryTheory Category MonoidalCategory Opposite diff --git a/Mathlib/CategoryTheory/EpiMono.lean b/Mathlib/CategoryTheory/EpiMono.lean index e52523b284ee8f..75901d37ce6208 100644 --- a/Mathlib/CategoryTheory/EpiMono.lean +++ b/Mathlib/CategoryTheory/EpiMono.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Kim Morrison -/ -import Mathlib.CategoryTheory.Opposites -import Mathlib.CategoryTheory.Groupoid +module + +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.CategoryTheory.Groupoid /-! # Facts about epimorphisms and monomorphisms. @@ -13,6 +15,8 @@ The definitions of `Epi` and `Mono` are in `CategoryTheory.Category`, since they are used by some lemmas for `Iso`, which is used everywhere. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/EqToHom.lean b/Mathlib/CategoryTheory/EqToHom.lean index 7d4f3c9add894b..2f9d6c14d35c3a 100644 --- a/Mathlib/CategoryTheory/EqToHom.lean +++ b/Mathlib/CategoryTheory/EqToHom.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Kim Morrison -/ -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.Opposites /-! # Morphisms from equations between objects. @@ -24,6 +26,8 @@ This file introduces various `simp` lemmas which in favourable circumstances result in the various `eqToHom` morphisms to drop out at the appropriate moment! -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ -- morphism levels before object levels. See note [category theory universes]. diff --git a/Mathlib/CategoryTheory/Equivalence.lean b/Mathlib/CategoryTheory/Equivalence.lean index b0eba38536da94..cbc94f27d6221a 100644 --- a/Mathlib/CategoryTheory/Equivalence.lean +++ b/Mathlib/CategoryTheory/Equivalence.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tim Baumann, Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Functor.FullyFaithful -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory -import Mathlib.CategoryTheory.Whiskering -import Mathlib.CategoryTheory.EssentialImage -import Mathlib.Tactic.CategoryTheory.Slice +module + +public import Mathlib.CategoryTheory.Functor.FullyFaithful +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.CategoryTheory.EssentialImage +public import Mathlib.Tactic.CategoryTheory.Slice /-! # Equivalence of categories @@ -55,6 +57,8 @@ We write `C ≌ D` (`\backcong`, not to be confused with `≅`/`\cong`) for a bu -/ +@[expose] public section + namespace CategoryTheory open CategoryTheory.Functor NatIso Category diff --git a/Mathlib/CategoryTheory/Equivalence/Symmetry.lean b/Mathlib/CategoryTheory/Equivalence/Symmetry.lean index ddffbec62737a6..aa57f52a015674 100644 --- a/Mathlib/CategoryTheory/Equivalence/Symmetry.lean +++ b/Mathlib/CategoryTheory/Equivalence/Symmetry.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Equivalence -import Mathlib.CategoryTheory.Adjunction.Mates +module + +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.CategoryTheory.Adjunction.Mates /-! # Functoriality of the symmetry of equivalences @@ -23,6 +25,8 @@ and provides the definition of the functor that takes an equivalence to its inve -/ +@[expose] public section + namespace CategoryTheory open CategoryTheory.Functor NatIso Category @@ -83,7 +87,7 @@ lemma inverseFunctorMapIso_symm_eq_isoInverseOfIsoFunctor {e f : C ≌ D} (α : Iso.isoInverseOfIsoFunctor ((functorFunctor _ _).mapIso α) := by cat_disch -/-- An "unopped" version of the equivalence `inverseFunctorObj'. -/ +/-- An "unopped" version of the equivalence `inverseFunctorObj'`. -/ @[simps!] def inverseFunctorObj' (e : C ≌ D) : Opposite.unop ((inverseFunctor C D).obj e) ≅ e.inverse := diff --git a/Mathlib/CategoryTheory/EssentialImage.lean b/Mathlib/CategoryTheory/EssentialImage.lean index bd10526ebac9b2..de3871d98fd0c8 100644 --- a/Mathlib/CategoryTheory/EssentialImage.lean +++ b/Mathlib/CategoryTheory/EssentialImage.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.NatIso -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +module + +public import Mathlib.CategoryTheory.NatIso +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory /-! # Essential image of a functor @@ -21,6 +23,8 @@ a functor decomposes into an essentially surjective functor and a fully faithful (TODO: show that this decomposition forms an orthogonal factorisation system). -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/EssentiallySmall.lean b/Mathlib/CategoryTheory/EssentiallySmall.lean index 7b3b6436476c97..1b03cc6a090014 100644 --- a/Mathlib/CategoryTheory/EssentiallySmall.lean +++ b/Mathlib/CategoryTheory/EssentiallySmall.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Category.ULift -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Skeletal -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.Logic.UnivLE -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.CategoryTheory.Category.ULift +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Skeletal +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.Logic.UnivLE +public import Mathlib.Logic.Small.Basic /-! # Essentially small categories. @@ -23,6 +25,8 @@ The main theorem here is that a category is `w`-essentially small iff the type `Skeleton C` is `w`-small, and `C` is `w`-locally small. -/ +@[expose] public section + universe w w' v v' u u' diff --git a/Mathlib/CategoryTheory/Extensive.lean b/Mathlib/CategoryTheory/Extensive.lean index e388f97de22042..08cd775d027d0e 100644 --- a/Mathlib/CategoryTheory/Extensive.lean +++ b/Mathlib/CategoryTheory/Extensive.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.Topology.Category.TopCat.Limits.Pullbacks -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts -import Mathlib.CategoryTheory.Limits.VanKampen +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial +public import Mathlib.CategoryTheory.Limits.Types.Coproducts +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.CategoryTheory.Limits.Types.Pullbacks +public import Mathlib.Topology.Category.TopCat.Limits.Pullbacks +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +public import Mathlib.CategoryTheory.Limits.VanKampen /-! @@ -45,6 +49,8 @@ Show that the following are finitary extensive: -/ +@[expose] public section + open CategoryTheory.Limits Topology namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ExtremalEpi.lean b/Mathlib/CategoryTheory/ExtremalEpi.lean index 53fc71bd5269c7..5d414c6fe84c8b 100644 --- a/Mathlib/CategoryTheory/ExtremalEpi.lean +++ b/Mathlib/CategoryTheory/ExtremalEpi.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi +module + +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi /-! # Extremal epimorphisms @@ -23,6 +25,8 @@ the category has pullbacks. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean b/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean index 6f7138f3a305c2..9083e329f34f01 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Calle Sönne -/ +module -import Mathlib.CategoryTheory.FiberedCategory.HomLift -import Mathlib.CategoryTheory.Bicategory.Strict.Basic -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.FiberedCategory.HomLift +public import Mathlib.CategoryTheory.Bicategory.Strict.Basic +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # The bicategory of based categories @@ -25,6 +26,8 @@ Natural transformations between based functors `F G : 𝒳 ⥤ᵇ 𝒴 ` are giv underlying `F` and `G` such that `α.app a` lifts `𝟙 S` whenever `𝒳.p.obj a = S`. -/ +@[expose] public section + universe v₅ u₅ v₄ u₄ v₃ u₃ v₂ u₂ v₁ u₁ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean b/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean index b446d23e8582a4..5097bef20775de 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Calle Sönne -/ +module -import Mathlib.CategoryTheory.FiberedCategory.HomLift +public import Mathlib.CategoryTheory.FiberedCategory.HomLift /-! # Cartesian morphisms @@ -37,6 +38,8 @@ equalities. * [Stacks: Fibred Categories](https://stacks.math.columbia.edu/tag/02XJ) -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ open CategoryTheory Functor Category IsHomLift diff --git a/Mathlib/CategoryTheory/FiberedCategory/Cocartesian.lean b/Mathlib/CategoryTheory/FiberedCategory/Cocartesian.lean index 2b2c6962621e20..3e40ddd5580744 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Cocartesian.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Cocartesian.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ +module -import Mathlib.CategoryTheory.FiberedCategory.HomLift +public import Mathlib.CategoryTheory.FiberedCategory.HomLift /-! # Co-Cartesian morphisms @@ -34,6 +35,8 @@ equalities. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ open CategoryTheory Functor Category IsHomLift diff --git a/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean b/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean index 7a6ee8fdcd7a8a..b35dc7b3207eb5 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne, Paul Lezeau -/ +module -import Mathlib.CategoryTheory.FiberedCategory.HomLift -import Mathlib.CategoryTheory.Functor.Const +public import Mathlib.CategoryTheory.FiberedCategory.HomLift +public import Mathlib.CategoryTheory.Functor.Const /-! @@ -20,6 +21,8 @@ For any category `C` equipped with a functor `F : C ⥤ 𝒳` such that `F ⋙ p we define a functor `inducedFunctor : C ⥤ Fiber p S` that `F` factors through. -/ +@[expose] public section + universe v₁ u₁ v₂ u₂ v₃ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/FiberedCategory/Fibered.lean b/Mathlib/CategoryTheory/FiberedCategory/Fibered.lean index a398906fcc2c6a..ad194ce737a6be 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Fibered.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Fibered.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Calle Sönne -/ +module -import Mathlib.CategoryTheory.FiberedCategory.Cartesian +public import Mathlib.CategoryTheory.FiberedCategory.Cartesian /-! @@ -38,6 +39,8 @@ equalities. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean b/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean index 565a118dfb5b83..5095c14e99b03c 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne, Fernando Chu, Christian Merten -/ +module -import Mathlib.CategoryTheory.Bicategory.Grothendieck -import Mathlib.CategoryTheory.FiberedCategory.HasFibers +public import Mathlib.CategoryTheory.Bicategory.Grothendieck +public import Mathlib.CategoryTheory.FiberedCategory.HasFibers /-! # The Grothendieck construction gives a fibered category @@ -22,6 +23,8 @@ Angelo Vistoli -/ +@[expose] public section + namespace CategoryTheory.Pseudofunctor.CoGrothendieck open Functor Opposite Bicategory Fiber diff --git a/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean b/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean index 9ba24eeb3ccb21..3fa751c8c3cc4d 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne, Paul Lezeau -/ -import Mathlib.CategoryTheory.FiberedCategory.Fiber -import Mathlib.CategoryTheory.FiberedCategory.Fibered +module + +public import Mathlib.CategoryTheory.FiberedCategory.Fiber +public import Mathlib.CategoryTheory.FiberedCategory.Fibered /-! @@ -12,7 +14,7 @@ import Mathlib.CategoryTheory.FiberedCategory.Fibered In this file we introduce a typeclass `HasFibers` for a functor `p : 𝒳 ⥤ 𝒮`, consisting of: - A collection of categories `Fib S` for every `S` in `𝒮` (the fiber categories) -- Functors `ι : Fib S ⥤ 𝒳` such that `ι ⋙ p = const (Fib S) S +- Functors `ι : Fib S ⥤ 𝒳` such that `ι ⋙ p = const (Fib S) S` - The induced functor `Fib S ⥤ Fiber p S` is an equivalence. We also provide a canonical `HasFibers` instance, which uses the standard fibers `Fiber p S` @@ -48,6 +50,8 @@ analogously to the standard fibers. -/ +@[expose] public section + universe v₃ u₃ v₂ u₂ v₁ u₁ open CategoryTheory Functor Category IsCartesian IsHomLift Fiber diff --git a/Mathlib/CategoryTheory/FiberedCategory/HomLift.lean b/Mathlib/CategoryTheory/FiberedCategory/HomLift.lean index 5724be6d7eecd7..c494e30cc230a8 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/HomLift.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/HomLift.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Calle Sönne -/ +module -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.CommSq +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.CommSq /-! @@ -31,6 +32,8 @@ The class `IsHomLift` is defined as an inductive with the single constructor -/ +@[expose] public section + universe u₁ v₁ u₂ v₂ open CategoryTheory Category diff --git a/Mathlib/CategoryTheory/Filtered/Basic.lean b/Mathlib/CategoryTheory/Filtered/Basic.lean index 58cbf1d27c2681..1c5d75cc612b37 100644 --- a/Mathlib/CategoryTheory/Filtered/Basic.lean +++ b/Mathlib/CategoryTheory/Filtered/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +module + +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits /-! # Filtered categories @@ -50,6 +52,8 @@ This is shown in `CategoryTheory.Limits.Filtered`. -/ +@[expose] public section + open Function @@ -245,7 +249,6 @@ theorem sup_exists : · subst hf apply coeq_condition · rw [@w' _ _ mX mY f'] - simp only [Finset.mem_insert, PSigma.mk.injEq, heq_eq_eq, true_and] at mf' grind · rw [@w' _ _ mX' mY' f' _] apply Finset.mem_of_mem_insert_of_ne mf' diff --git a/Mathlib/CategoryTheory/Filtered/Connected.lean b/Mathlib/CategoryTheory/Filtered/Connected.lean index ae77abe25db5b1..72535b13b648cf 100644 --- a/Mathlib/CategoryTheory/Filtered/Connected.lean +++ b/Mathlib/CategoryTheory/Filtered/Connected.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.IsConnected +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.IsConnected /-! # Filtered categories are connected -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean b/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean index 60313b9ecf393c..2f29b72d7ca2fa 100644 --- a/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean +++ b/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Filtered.OfColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Limits.Preserves.Grothendieck -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Filtered.OfColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Limits.Preserves.Grothendieck +public import Mathlib.CategoryTheory.Limits.Final /-! # Inferring Filteredness from Filteredness of Costructured Arrow Categories @@ -18,6 +20,8 @@ import Mathlib.CategoryTheory.Limits.Final -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Filtered/Final.lean b/Mathlib/CategoryTheory/Filtered/Final.lean index 7afa74b99eabfa..c4435490c4e5ef 100644 --- a/Mathlib/CategoryTheory/Filtered/Final.lean +++ b/Mathlib/CategoryTheory/Filtered/Final.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Filtered.Connected -import Mathlib.CategoryTheory.Limits.Final.Connected -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.Limits.Sifted +module + +public import Mathlib.CategoryTheory.Filtered.Connected +public import Mathlib.CategoryTheory.Limits.Final.Connected +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Limits.Sifted /-! # Final functors with filtered (co)domain @@ -34,6 +36,8 @@ final can be restated. We show: -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory @@ -374,7 +378,7 @@ instance StructuredArrow.final_map₂_id [IsFiltered C] {E : Type u₃} [Categor (T ⋙ S).final_iff_isFiltered_structuredArrow.mp inferInstance e apply final_of_natIso (map₂IsoPreEquivalenceInverseCompProj d e u α).symm -/-- `StructuredArrow.map` is final if the functor `T` is final` and its domain is filtered. -/ +/-- `StructuredArrow.map` is final if the functor `T` is final and its domain is filtered. -/ instance StructuredArrow.final_map [IsFiltered C] {S S' : D} (f : S ⟶ S') (T : C ⥤ D) [T.Final] : Final (map (T := T) f) := by haveI := NatIso.isIso_of_isIso_app (𝟙 T) diff --git a/Mathlib/CategoryTheory/Filtered/Flat.lean b/Mathlib/CategoryTheory/Filtered/Flat.lean index f4ca7ef2b7bb2f..99316f7ec7f2b1 100644 --- a/Mathlib/CategoryTheory/Filtered/Flat.lean +++ b/Mathlib/CategoryTheory/Filtered/Flat.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Filtered.CostructuredArrow -import Mathlib.CategoryTheory.Functor.Flat +module + +public import Mathlib.CategoryTheory.Filtered.CostructuredArrow +public import Mathlib.CategoryTheory.Functor.Flat /-! # Pulling back filteredness along representably flat functors @@ -18,6 +20,8 @@ Transferring (co)filteredness *along* representably (co)flat functors is given b representably coflat functor is initial. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Filtered/Grothendieck.lean b/Mathlib/CategoryTheory/Filtered/Grothendieck.lean index d4d3ea8c1f4cd5..a8d759b227a1a8 100644 --- a/Mathlib/CategoryTheory/Filtered/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Filtered/Grothendieck.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Grothendieck +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Grothendieck /-! # Filteredness of Grothendieck construction @@ -13,6 +15,8 @@ We show that if `F : C ⥤ Cat` is such that `C` is filtered and `F.obj c` is fi `c : C`, then `Grothendieck F` is filtered. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Filtered/OfColimitCommutesFiniteLimit.lean b/Mathlib/CategoryTheory/Filtered/OfColimitCommutesFiniteLimit.lean index 64a0c5121aacf6..f219ea173cdb8a 100644 --- a/Mathlib/CategoryTheory/Filtered/OfColimitCommutesFiniteLimit.lean +++ b/Mathlib/CategoryTheory/Filtered/OfColimitCommutesFiniteLimit.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Limits.Filtered -import Mathlib.CategoryTheory.Limits.Yoneda +module + +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Limits.Filtered +public import Mathlib.CategoryTheory.Limits.Yoneda /-! # If colimits of shape `K` commute with finite limits, then `K` is filtered. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Filtered/Small.lean b/Mathlib/CategoryTheory/Filtered/Small.lean index 93d892fc684efa..82cfaf2abc2931 100644 --- a/Mathlib/CategoryTheory/Filtered/Small.lean +++ b/Mathlib/CategoryTheory/Filtered/Small.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.EssentiallySmall -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.Tactic.DepRewrite +module + +public import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.Tactic.DepRewrite /-! # A functor from a small category to a filtered category factors through a small filtered category @@ -16,6 +18,8 @@ This is occasionally useful, for example in the proof of the recognition theorem (Proposition 6.1.5 in [Kashiwara2006]). -/ +@[expose] public section + universe w v v₁ u u₁ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/FinCategory/AsType.lean b/Mathlib/CategoryTheory/FinCategory/AsType.lean index 1751f035b3940b..5ce0272ee58254 100644 --- a/Mathlib/CategoryTheory/FinCategory/AsType.lean +++ b/Mathlib/CategoryTheory/FinCategory/AsType.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.Data.Fintype.EquivFin /-! # Finite categories are equivalent to category in `Type 0`. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/FinCategory/Basic.lean b/Mathlib/CategoryTheory/FinCategory/Basic.lean index 6aed0befde0a9a..6195c2dd37cda2 100644 --- a/Mathlib/CategoryTheory/FinCategory/Basic.lean +++ b/Mathlib/CategoryTheory/FinCategory/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Fintype.Basic -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Opposites -import Mathlib.CategoryTheory.Category.ULift +module + +public import Mathlib.Data.Fintype.Basic +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.CategoryTheory.Category.ULift /-! # Finite categories @@ -20,6 +22,8 @@ so we have removed these requirements to avoid having to supply instances or delay with non-defeq conflicts between instances. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/FintypeCat.lean b/Mathlib/CategoryTheory/FintypeCat.lean index d31d83311202ce..c6c040bd92b36e 100644 --- a/Mathlib/CategoryTheory/FintypeCat.lean +++ b/Mathlib/CategoryTheory/FintypeCat.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Adam Topaz -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.CategoryTheory.Skeletal -import Mathlib.Data.Finite.Prod +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.CategoryTheory.Skeletal +public import Mathlib.Data.Finite.Prod /-! # The category of finite types. @@ -21,10 +23,14 @@ are `Fin n` for `n : ℕ`. We prove that the obvious inclusion functor We prove that `FintypeCat.Skeleton` is a skeleton of `FintypeCat` in `FintypeCat.isSkeleton`. -/ +@[expose] public section + open CategoryTheory /-- The category of finite types. -/ structure FintypeCat where + /-- Construct a bundled `FintypeCat` from the underlying type and typeclass. -/ + of :: /-- The underlying type. -/ carrier : Type* [str : Fintype carrier] @@ -36,10 +42,6 @@ namespace FintypeCat instance instCoeSort : CoeSort FintypeCat Type* := ⟨carrier⟩ -/-- Construct a bundled `FintypeCat` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [Fintype X] : FintypeCat where - carrier := X - instance : Inhabited FintypeCat := ⟨of PEmpty⟩ diff --git a/Mathlib/CategoryTheory/FullSubcategory.lean b/Mathlib/CategoryTheory/FullSubcategory.lean index ecc9c0ee8cc739..658920b596cbee 100644 --- a/Mathlib/CategoryTheory/FullSubcategory.lean +++ b/Mathlib/CategoryTheory/FullSubcategory.lean @@ -3,6 +3,8 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton -/ -import Mathlib.CategoryTheory.Functor.FullyFaithful +module + +public import Mathlib.CategoryTheory.Functor.FullyFaithful deprecated_module "Auto-generated deprecation" (since := "2025-04-23") diff --git a/Mathlib/CategoryTheory/Functor/Basic.lean b/Mathlib/CategoryTheory/Functor/Basic.lean index 12d135b78567ca..50e922ea8a8fc0 100644 --- a/Mathlib/CategoryTheory/Functor/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tim Baumann, Stephen Morgan, Kim Morrison -/ -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.Combinatorics.Quiver.Prefunctor -import Mathlib.Tactic.CategoryTheory.CheckCompositions +module + +public import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.Combinatorics.Quiver.Prefunctor +public import Mathlib.Tactic.CategoryTheory.CheckCompositions /-! # Functors @@ -18,6 +20,8 @@ from `C` to `D`, `𝟭` for the identity functor and `⋙` for functor compositi TODO: Switch to using the `⇒` arrow. -/ +@[expose] public section + set_option mathlib.tactic.category.grind true namespace CategoryTheory @@ -137,6 +141,14 @@ theorem map_dite (F : C ⥤ D) {X Y : C} {P : Prop} [Decidable P] theorem toPrefunctor_comp (F : C ⥤ D) (G : D ⥤ E) : F.toPrefunctor.comp G.toPrefunctor = (F ⋙ G).toPrefunctor := rfl +lemma toPrefunctor_injective {F G : C ⥤ D} (h : F.toPrefunctor = G.toPrefunctor) : + F = G := by + obtain ⟨obj, map, _, _⟩ := F + obtain ⟨obj', map', _, _⟩ := G + obtain rfl : obj = obj' := congr_arg Prefunctor.obj h + obtain rfl : @map = @map' := by simpa [Functor.toPrefunctor] using h + rfl + end end Functor diff --git a/Mathlib/CategoryTheory/Functor/Category.lean b/Mathlib/CategoryTheory/Functor/Category.lean index e7bf61b588032d..0c4b1d6633e2c8 100644 --- a/Mathlib/CategoryTheory/Functor/Category.lean +++ b/Mathlib/CategoryTheory/Functor/Category.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tim Baumann, Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.NatTrans -import Mathlib.CategoryTheory.Iso +module + +public import Mathlib.CategoryTheory.NatTrans +public import Mathlib.CategoryTheory.Iso /-! # The category of functors and natural transformations between two fixed categories. @@ -24,6 +26,8 @@ However if `C` and `D` are both large categories at the same universe level, this is a small category at the next higher level. -/ +@[expose] public section + set_option mathlib.tactic.category.grind true namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Functor/Const.lean b/Mathlib/CategoryTheory/Functor/Const.lean index 4a1c70e129bc25..904a6aaa29d6c7 100644 --- a/Mathlib/CategoryTheory/Functor/Const.lean +++ b/Mathlib/CategoryTheory/Functor/Const.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.Opposites /-! # The constant functor @@ -16,6 +18,8 @@ When `J` is nonempty, `const` is faithful. We have `(const J).obj X ⋙ F ≅ (const J).obj (F.obj X)` for any `F : C ⥤ D`. -/ +@[expose] public section + -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Functor/Currying.lean b/Mathlib/CategoryTheory/Functor/Currying.lean index 95aa7ee5d59cfe..e9d92ec6cdba22 100644 --- a/Mathlib/CategoryTheory/Functor/Currying.lean +++ b/Mathlib/CategoryTheory/Functor/Currying.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Products.Basic /-! # Curry and uncurry, as functors. @@ -17,6 +19,8 @@ This is used in `CategoryTheory.Category.Cat.CartesianClosed` to equip the categ categories `Cat.{u, u}` with a Cartesian closed structure. -/ +@[expose] public section + namespace CategoryTheory namespace Functor diff --git a/Mathlib/CategoryTheory/Functor/CurryingThree.lean b/Mathlib/CategoryTheory/Functor/CurryingThree.lean index 751c360bfc22b4..9d0b2b3308f711 100644 --- a/Mathlib/CategoryTheory/Functor/CurryingThree.lean +++ b/Mathlib/CategoryTheory/Functor/CurryingThree.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Functor.Trifunctor -import Mathlib.CategoryTheory.Products.Associator +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Functor.Trifunctor +public import Mathlib.CategoryTheory.Products.Associator /-! # Currying of functors in three variables @@ -16,6 +17,8 @@ We study the equivalence of categories -/ +@[expose] public section + namespace CategoryTheory namespace Functor diff --git a/Mathlib/CategoryTheory/Functor/Derived/Adjunction.lean b/Mathlib/CategoryTheory/Functor/Derived/Adjunction.lean index 5801c659420c01..1bb6525117b405 100644 --- a/Mathlib/CategoryTheory/Functor/Derived/Adjunction.lean +++ b/Mathlib/CategoryTheory/Functor/Derived/Adjunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.Derived.LeftDerived -import Mathlib.CategoryTheory.Functor.Derived.RightDerived +module + +public import Mathlib.CategoryTheory.Functor.Derived.LeftDerived +public import Mathlib.CategoryTheory.Functor.Derived.RightDerived /-! # Derived adjunction @@ -29,6 +31,8 @@ foncteurs dérivés, revisité*][Maltsiniotis2007] -/ +@[expose] public section + namespace CategoryTheory variable {C₁ C₂ D₁ D₂ : Type*} [Category C₁] [Category C₂] [Category D₁] [Category D₂] diff --git a/Mathlib/CategoryTheory/Functor/Derived/LeftDerived.lean b/Mathlib/CategoryTheory/Functor/Derived/LeftDerived.lean index 606e7a0a19a5ce..535a4e94a05f1c 100644 --- a/Mathlib/CategoryTheory/Functor/Derived/LeftDerived.lean +++ b/Mathlib/CategoryTheory/Functor/Derived/LeftDerived.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Basic -import Mathlib.CategoryTheory.Localization.Predicate +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Basic +public import Mathlib.CategoryTheory.Localization.Predicate /-! # Left derived functors @@ -31,6 +33,8 @@ along the localization functor `L`. -/ +@[expose] public section + namespace CategoryTheory namespace Functor diff --git a/Mathlib/CategoryTheory/Functor/Derived/PointwiseRightDerived.lean b/Mathlib/CategoryTheory/Functor/Derived/PointwiseRightDerived.lean index 7a7e32262c0e0a..056c60352cf393 100644 --- a/Mathlib/CategoryTheory/Functor/Derived/PointwiseRightDerived.lean +++ b/Mathlib/CategoryTheory/Functor/Derived/PointwiseRightDerived.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.Derived.RightDerived -import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise -import Mathlib.CategoryTheory.Localization.StructuredArrow +module + +public import Mathlib.CategoryTheory.Functor.Derived.RightDerived +public import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise +public import Mathlib.CategoryTheory.Localization.StructuredArrow /-! # Pointwise right derived functors @@ -18,6 +20,8 @@ then it has a pointwise right derived functor. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory @@ -161,6 +165,34 @@ lemma hasPointwiseRightDerivedFunctor_of_inverts exact (isPointwiseLeftKanExtensionOfIsoOfIsLocalization W (Localization.fac F hF W.Q).symm).hasPointwiseLeftKanExtension _ +lemma isRightDerivedFunctor_of_inverts + [L.IsLocalization W] (F' : D ⥤ H) (e : L ⋙ F' ≅ F) : + F'.IsRightDerivedFunctor e.inv W where + isLeftKanExtension := + (isPointwiseLeftKanExtensionOfIsoOfIsLocalization W e.symm).isLeftKanExtension + +instance [L.IsLocalization W] (hF : W.IsInvertedBy F) : + (Localization.lift F hF L).IsRightDerivedFunctor (Localization.fac F hF L).inv W := + isRightDerivedFunctor_of_inverts W _ _ + +variable {W} in +lemma isIso_of_isRightDerivedFunctor_of_inverts [L.IsLocalization W] + {F : C ⥤ H} (RF : D ⥤ H) (α : F ⟶ L ⋙ RF) + (hF : W.IsInvertedBy F) [RF.IsRightDerivedFunctor α W] : + IsIso α := by + have : α = (Localization.fac F hF L).inv ≫ + whiskerLeft _ (rightDerivedUnique _ _ (Localization.fac F hF L).inv α W).hom := by simp + rw [this] + infer_instance + +variable {W} in +lemma isRightDerivedFunctor_iff_of_inverts [L.IsLocalization W] + {F : C ⥤ H} (RF : D ⥤ H) (α : F ⟶ L ⋙ RF) + (hF : W.IsInvertedBy F) : + RF.IsRightDerivedFunctor α W ↔ IsIso α := + ⟨fun _ ↦ isIso_of_isRightDerivedFunctor_of_inverts RF α hF, fun _ ↦ + isRightDerivedFunctor_of_inverts W RF (asIso α).symm⟩ + end end Functor diff --git a/Mathlib/CategoryTheory/Functor/Derived/RightDerived.lean b/Mathlib/CategoryTheory/Functor/Derived/RightDerived.lean index 52027e9922e56e..4352536880186a 100644 --- a/Mathlib/CategoryTheory/Functor/Derived/RightDerived.lean +++ b/Mathlib/CategoryTheory/Functor/Derived/RightDerived.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Basic -import Mathlib.CategoryTheory.Localization.Predicate +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Basic +public import Mathlib.CategoryTheory.Localization.Predicate /-! # Right derived functors @@ -34,6 +36,8 @@ structures, existence of derived functors from derivability structures. -/ +@[expose] public section + namespace CategoryTheory namespace Functor @@ -184,7 +188,7 @@ lemma HasRightDerivedFunctor.mk' [RF.IsRightDerivedFunctor α W] : section -variable [F.HasRightDerivedFunctor W] (L W) +variable (F) [F.HasRightDerivedFunctor W] (L W) /-- Given a functor `F : C ⥤ H`, and a localization functor `L : D ⥤ H` for `W`, this is the right derived functor `D ⥤ H` of `F`, i.e. the left Kan extension diff --git a/Mathlib/CategoryTheory/Functor/EpiMono.lean b/Mathlib/CategoryTheory/Functor/EpiMono.lean index f10b37d05ae725..a007bd0cf1e495 100644 --- a/Mathlib/CategoryTheory/Functor/EpiMono.lean +++ b/Mathlib/CategoryTheory/Functor/EpiMono.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.EpiMono -import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi -import Mathlib.CategoryTheory.LiftingProperties.Adjunction +module + +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi +public import Mathlib.CategoryTheory.LiftingProperties.Adjunction /-! # Preservation and reflection of monomorphisms and epimorphisms @@ -14,6 +16,8 @@ We provide typeclasses that state that a functor preserves or reflects monomorph epimorphisms. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Functor/Flat.lean b/Mathlib/CategoryTheory/Functor/Flat.lean index 5fb4f3b4469483..59b2ba75ca01b6 100644 --- a/Mathlib/CategoryTheory/Functor/Flat.lean +++ b/Mathlib/CategoryTheory/Functor/Flat.lean @@ -3,16 +3,18 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Filtered.Connected -import Mathlib.CategoryTheory.Limits.ConeCategory -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Limits.Preserves.Filtered -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Limits.Bicones -import Mathlib.CategoryTheory.Limits.Comma -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Opposites -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +module + +public import Mathlib.CategoryTheory.Filtered.Connected +public import Mathlib.CategoryTheory.Limits.ConeCategory +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Limits.Preserves.Filtered +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Limits.Bicones +public import Mathlib.CategoryTheory.Limits.Comma +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Opposites +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits /-! # Representably flat functors @@ -42,6 +44,8 @@ This definition is equivalent to left exact functors (functors that preserves fi -/ +@[expose] public section + universe w v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Functor/FullyFaithful.lean b/Mathlib/CategoryTheory/Functor/FullyFaithful.lean index 123540981cb357..847cad21870db6 100644 --- a/Mathlib/CategoryTheory/Functor/FullyFaithful.lean +++ b/Mathlib/CategoryTheory/Functor/FullyFaithful.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.NatIso -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.CategoryTheory.NatIso +public import Mathlib.Logic.Equiv.Defs /-! # Full and faithful functors @@ -26,6 +28,8 @@ equivalence if and only if it is fully faithful and essentially surjective. -/ +@[expose] public section + -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe v₁ v₂ v₃ u₁ u₂ u₃ @@ -50,6 +54,7 @@ class Faithful (F : C ⥤ D) : Prop where variable {X Y : C} +@[grind inj] theorem map_injective (F : C ⥤ D) [Faithful F] : Function.Injective <| (F.map : (X ⟶ Y) → (F.obj X ⟶ F.obj Y)) := Faithful.map_injective @@ -301,15 +306,8 @@ protected def Faithful.div (F : C ⥤ E) (G : D ⥤ E) [G.Faithful] (obj : C → map_id := by intro X apply G.map_injective - apply eq_of_heq - trans F.map (𝟙 X) - · exact h_map - · rw [F.map_id, G.map_id, h_obj X] - map_comp := by - intro X Y Z f g - refine G.map_injective <| eq_of_heq <| h_map.trans ?_ - simp only [Functor.map_comp] - grind } + grind + map_comp := by grind } -- This follows immediately from `Functor.hext` (`Functor.hext h_obj @h_map`), -- but importing `CategoryTheory.EqToHom` causes an import loop: diff --git a/Mathlib/CategoryTheory/Functor/FunctorHom.lean b/Mathlib/CategoryTheory/Functor/FunctorHom.lean index 94ddf38debbdde..5db1bd9007c516 100644 --- a/Mathlib/CategoryTheory/Functor/FunctorHom.lean +++ b/Mathlib/CategoryTheory/Functor/FunctorHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen, Joël Riou -/ -import Mathlib.CategoryTheory.Monoidal.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Types.Basic -import Mathlib.CategoryTheory.Enriched.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Types.Basic +public import Mathlib.CategoryTheory.Enriched.Basic /-! # Internal hom in functor categories @@ -19,6 +21,8 @@ See `Mathlib/CategoryTheory/Closed/FunctorToTypes.lean`. -/ +@[expose] public section + universe w v' v u u' diff --git a/Mathlib/CategoryTheory/Functor/Functorial.lean b/Mathlib/CategoryTheory/Functor/Functorial.lean index 4b11d40eada12c..cf4bf44c4c3ae5 100644 --- a/Mathlib/CategoryTheory/Functor/Functorial.lean +++ b/Mathlib/CategoryTheory/Functor/Functorial.lean @@ -3,12 +3,16 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Functor.Basic +module + +public import Mathlib.CategoryTheory.Functor.Basic /-! # Unbundled functors, as a typeclass decorating the object-level function. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Functor/Hom.lean b/Mathlib/CategoryTheory/Functor/Hom.lean index aec763b3a05d8e..e9c84a045d56e2 100644 --- a/Mathlib/CategoryTheory/Functor/Hom.lean +++ b/Mathlib/CategoryTheory/Functor/Hom.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Kim Morrison -/ -import Mathlib.CategoryTheory.Products.Basic -import Mathlib.CategoryTheory.Types.Basic +module + +public import Mathlib.CategoryTheory.Products.Basic +public import Mathlib.CategoryTheory.Types.Basic /-! The hom functor, sending `(X, Y)` to the type `X ⟶ Y`. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean index 72e5ae92103b37..3042b9aceba0d6 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise -import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck -import Mathlib.CategoryTheory.Comma.StructuredArrow.Functor +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise +public import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Functor /-! # The Kan extension functor @@ -22,6 +24,8 @@ right Kan extension along `L`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean index baa68375758e74..6c8922a6bc464f 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Equivalence -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Equivalence +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal /-! # Kan extensions @@ -30,6 +32,8 @@ are obtained as `leftKanExtension L F` and `rightKanExtension L F`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits Functor diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Dense.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Dense.lean new file mode 100644 index 00000000000000..cf71c9cdc70a4f --- /dev/null +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Dense.lean @@ -0,0 +1,129 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.DenseAt +public import Mathlib.CategoryTheory.Limits.Presheaf +public import Mathlib.CategoryTheory.Generator.StrongGenerator + +/-! +# Dense functors + +A functor `F : C ⥤ D` is dense (`F.IsDense`) if `𝟭 D` is a pointwise +left Kan extension of `F` along itself, i.e. any `Y : D` is the +colimit of all `F.obj X` for all morphisms `F.obj X ⟶ Y` (which +is the condition `F.DenseAt Y`). +When `F` is full, we show that this +is equivalent to saying that the restricted Yoneda functor +`D ⥤ Cᵒᵖ ⥤ Type _` is fully faithful (see the lemma +`Functor.isDense_iff_fullyFaithful_restrictedULiftYoneda`). + +We also show that the range of a dense functor is a strong +generator (see `Functor.isStrongGenerator_of_isDense`). + +## References + +* https://ncatlab.org/nlab/show/dense+subcategory + +-/ + +@[expose] public section + +universe w v₁ v₂ u₁ u₂ + +namespace CategoryTheory + +open Limits Opposite Presheaf + +variable {C : Type u₁} {D : Type u₂} [Category.{v₁} C] [Category.{v₂} D] + +namespace Functor + +/-- A functor `F : C ⥤ D` is dense if any `Y : D` is a canonical colimit +relatively to `F`. -/ +class IsDense (F : C ⥤ D) : Prop where + isDenseAt (F) (Y : D) : F.isDenseAt Y + +/-- This is a choice of structure `F.DenseAt Y` when `F : C ⥤ D` +is dense, and `Y : D`. -/ +noncomputable def denseAt (F : C ⥤ D) [F.IsDense] (Y : D) : F.DenseAt Y := + (IsDense.isDenseAt F Y).some + +lemma isDense_iff_nonempty_isPointwiseLeftKanExtension (F : C ⥤ D) : + F.IsDense ↔ + Nonempty ((LeftExtension.mk _ (rightUnitor F).inv).IsPointwiseLeftKanExtension) := + ⟨fun _ ↦ ⟨fun _ ↦ F.denseAt _⟩, fun ⟨h⟩ ↦ ⟨fun _ ↦ ⟨h _⟩⟩⟩ + +variable (F : C ⥤ D) + +instance [F.IsDense] : (restrictedULiftYoneda.{w} F).Faithful where + map_injective h := + (F.denseAt _).hom_ext' (fun X p ↦ by + simpa using ULift.up_injective (congr_fun (NatTrans.congr_app h (op X)) (ULift.up p))) + +instance [F.IsDense] : (restrictedULiftYoneda.{w} F).Full where + map_surjective {Y Z} f := by + let c : Cocone (CostructuredArrow.proj F Y ⋙ F) := + { pt := Z + ι := + { app g := ((f.app (op g.left)) (ULift.up g.hom)).down + naturality g₁ g₂ φ := by + simpa [uliftFunctor, uliftYoneda, + restrictedULiftYoneda, ← ULift.down_inj] using + (congr_fun (f.naturality φ.left.op) (ULift.up g₂.hom)).symm }} + refine ⟨(F.denseAt Y).desc c, ?_⟩ + ext ⟨X⟩ ⟨x⟩ + have := (F.denseAt Y).fac c (.mk x) + dsimp [c] at this + simpa using ULift.down_injective this + +variable {F} in +lemma IsDense.of_fullyFaithful_restrictedULiftYoneda [F.Full] + (h : (restrictedULiftYoneda.{w} F).FullyFaithful) : + F.IsDense where + isDenseAt Y := by + let φ (s : Cocone (CostructuredArrow.proj F Y ⋙ F)) : + (restrictedULiftYoneda.{w} F).obj Y ⟶ (restrictedULiftYoneda F).obj s.pt := + { app := fun ⟨X⟩ ⟨x⟩ ↦ ULift.up (s.ι.app (.mk x)) + naturality := by + rintro ⟨X₁⟩ ⟨X₂⟩ ⟨f⟩ + ext ⟨x⟩ + let α : CostructuredArrow.mk (F.map f ≫ x) ⟶ CostructuredArrow.mk x := + CostructuredArrow.homMk f + simp [uliftYoneda, ← s.w α, α] } + have hφ (s) (j) : (restrictedULiftYoneda F).map j.hom ≫ φ s = + (restrictedULiftYoneda F).map (s.ι.app j) := by + ext ⟨X⟩ ⟨x⟩ + let α : .mk (x ≫ j.hom) ⟶ j := CostructuredArrow.homMk (F.preimage x) + have := s.w α + dsimp [uliftYoneda, φ, α] at this ⊢ + rw [← this, map_preimage] + exact + ⟨{desc s := (h.preimage (φ s)) + fac s j := h.map_injective (by simp [hφ]) + uniq s m hm := h.map_injective (by + ext ⟨X⟩ ⟨x⟩ + simp [uliftYoneda, φ, ← hm])}⟩ + +lemma isDense_iff_fullyFaithful_restrictedULiftYoneda [F.Full] : + F.IsDense ↔ Nonempty (restrictedULiftYoneda.{w} F).FullyFaithful := + ⟨fun _ ↦ ⟨FullyFaithful.ofFullyFaithful _⟩, + fun ⟨h⟩ ↦ IsDense.of_fullyFaithful_restrictedULiftYoneda h⟩ + +open ObjectProperty in +lemma isStrongGenerator_of_isDense [F.IsDense] : + IsStrongGenerator (.ofObj F.obj) := + (IsStrongGenerator.mk_of_exists_colimitsOfShape.{max u₁ u₂ v₁ v₂, + max u₁ v₁ v₂} (fun Y ↦ ⟨_, _, ⟨{ + ι := _ + diag := _ + isColimit := (IsColimit.whiskerEquivalence (F.denseAt Y) + ((ShrinkHoms.equivalence _).symm.trans ((Shrink.equivalence _)).symm)) + prop_diag_obj := by simp }⟩⟩)) + +end Functor + +end CategoryTheory diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean b/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean index 188f066f4bc176..f0e10caca925b5 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise /-! # Canonical colimits, or functors that are dense at an object @@ -27,6 +29,8 @@ to the Yoneda embedding -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean index 29b8daae15e5cb..78b20a6b0374a7 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Basic +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Basic /-! # Pointwise Kan extensions @@ -27,6 +29,8 @@ A dual API for pointwise right Kan extension is also formalized. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean index 8d5fad6039603b..52a62cab745584 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preservation of Kan extensions @@ -20,6 +22,8 @@ We introduce the dual typeclass `G.PreservesRightKanExtension`. -/ +@[expose] public section + namespace CategoryTheory.Functor variable {A B C D : Type*} [Category A] [Category B] [Category C] [Category D] diff --git a/Mathlib/CategoryTheory/Functor/OfSequence.lean b/Mathlib/CategoryTheory/Functor/OfSequence.lean index fefe95b532864f..3fd0c10e550215 100644 --- a/Mathlib/CategoryTheory/Functor/OfSequence.lean +++ b/Mathlib/CategoryTheory/Functor/OfSequence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.EqToHom +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.EqToHom /-! # Functors from the category of the ordered set `ℕ` @@ -22,6 +24,8 @@ The duals of the above for functors `ℕᵒᵖ ⥤ C` are given by `Functor.ofOp -/ +@[expose] public section + namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean b/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean index cae0dc763a5047..4957c648718776 100644 --- a/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean +++ b/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Robin Carlier -/ -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic -import Mathlib.CategoryTheory.Balanced -import Mathlib.CategoryTheory.Functor.EpiMono +module + +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.Balanced +public import Mathlib.CategoryTheory.Functor.EpiMono /-! # Balanced categories and functors reflecting isomorphisms @@ -17,6 +19,8 @@ and `PreservesMonomorphisms` are balanced. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Functor namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean b/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean index 7f3c01eb572ff8..89c794316fb44b 100644 --- a/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Whiskering -import Mathlib.CategoryTheory.Iso -import Mathlib.CategoryTheory.Functor.FullyFaithful +module + +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.CategoryTheory.Iso +public import Mathlib.CategoryTheory.Functor.FullyFaithful /-! # Functors which reflect isomorphisms @@ -17,6 +19,8 @@ It is formalized as a `Prop`-valued typeclass `ReflectsIsomorphisms F`. Any fully faithful functor reflects isomorphisms. -/ +@[expose] public section + namespace CategoryTheory open Functor diff --git a/Mathlib/CategoryTheory/Functor/Trifunctor.lean b/Mathlib/CategoryTheory/Functor/Trifunctor.lean index 0548f4dadccdbc..20faf1ed9f2edb 100644 --- a/Mathlib/CategoryTheory/Functor/Trifunctor.lean +++ b/Mathlib/CategoryTheory/Functor/Trifunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.Category +module + +public import Mathlib.CategoryTheory.Functor.Category /-! # Trifunctors obtained by composition of bifunctors @@ -17,6 +19,8 @@ objects `X₁ : C₁`, `X₂ : C₂` and `X₃ : C₃` to `(F.obj X₁).obj ((G -/ +@[expose] public section + namespace CategoryTheory variable {C₁ C₂ C₃ C₄ C₁₂ C₂₃ : Type*} [Category C₁] [Category C₂] [Category C₃] diff --git a/Mathlib/CategoryTheory/Functor/TwoSquare.lean b/Mathlib/CategoryTheory/Functor/TwoSquare.lean index 7c6100b3d0289f..08f8e5ed6d93ba 100644 --- a/Mathlib/CategoryTheory/Functor/TwoSquare.lean +++ b/Mathlib/CategoryTheory/Functor/TwoSquare.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Whiskering -import Mathlib.CategoryTheory.Opposites -import Mathlib.Tactic.CategoryTheory.Slice +module + +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.Tactic.CategoryTheory.Slice /-! # 2-squares of functors @@ -30,6 +32,8 @@ Generalize all of this to double categories. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ v₆ v₇ v₈ v₉ u₁ u₂ u₃ u₄ u₅ u₆ u₇ u₈ u₉ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Action.lean b/Mathlib/CategoryTheory/Galois/Action.lean index 5a67e99b52a764..bad735d2df8109 100644 --- a/Mathlib/CategoryTheory/Galois/Action.lean +++ b/Mathlib/CategoryTheory/Galois/Action.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Examples -import Mathlib.CategoryTheory.Galois.Prorepresentability +module + +public import Mathlib.CategoryTheory.Galois.Examples +public import Mathlib.CategoryTheory.Galois.Prorepresentability /-! @@ -18,6 +20,8 @@ See `Mathlib/CategoryTheory/Galois/Full.lean` for the proof that `H` is (faithfu -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Basic.lean b/Mathlib/CategoryTheory/Galois/Basic.lean index dd9dc0cd6d1e98..ccf63807bb05b3 100644 --- a/Mathlib/CategoryTheory/Galois/Basic.lean +++ b/Mathlib/CategoryTheory/Galois/Basic.lean @@ -3,14 +3,17 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Limits.FintypeCat -import Mathlib.CategoryTheory.Limits.MonoCoprod -import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory -import Mathlib.CategoryTheory.Limits.Shapes.Diagonal -import Mathlib.CategoryTheory.SingleObj -import Mathlib.Data.Finite.Card +module + +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Limits.FintypeCat +public import Mathlib.CategoryTheory.Limits.MonoCoprod +public import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory +public import Mathlib.CategoryTheory.Limits.Shapes.Diagonal +public import Mathlib.CategoryTheory.Limits.Types.Equalizers +public import Mathlib.CategoryTheory.SingleObj +public import Mathlib.Data.Finite.Card /-! # Definition and basic properties of Galois categories @@ -42,6 +45,8 @@ as this is not needed for the proof of the fundamental theorem on Galois categor -/ +@[expose] public section + universe u₁ u₂ v₁ v₂ w t namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Decomposition.lean b/Mathlib/CategoryTheory/Galois/Decomposition.lean index b5f7eca387bed3..628c9517d2b717 100644 --- a/Mathlib/CategoryTheory/Galois/Decomposition.lean +++ b/Mathlib/CategoryTheory/Galois/Decomposition.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.GaloisObjects -import Mathlib.CategoryTheory.Limits.Shapes.CombinedProducts -import Mathlib.Data.Finite.Sum +module + +public import Mathlib.CategoryTheory.Galois.GaloisObjects +public import Mathlib.CategoryTheory.Limits.Shapes.CombinedProducts +public import Mathlib.Data.Finite.Sum /-! # Decomposition of objects into connected components and applications @@ -31,6 +33,8 @@ is represented by a Galois object. -/ +@[expose] public section + universe u₁ u₂ w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Equivalence.lean b/Mathlib/CategoryTheory/Galois/Equivalence.lean index 59a6c97d21235b..f37637299249c9 100644 --- a/Mathlib/CategoryTheory/Galois/Equivalence.lean +++ b/Mathlib/CategoryTheory/Galois/Equivalence.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.EssSurj -import Mathlib.CategoryTheory.Action.Continuous -import Mathlib.Topology.Category.FinTopCat +module + +public import Mathlib.CategoryTheory.Galois.EssSurj +public import Mathlib.CategoryTheory.Action.Continuous +public import Mathlib.Topology.Category.FinTopCat /-! # Fiber functors induce an equivalence of categories @@ -16,6 +18,8 @@ In this file we conclude that the induced functor from `C` to the category of fi discrete `Aut F`-sets is an equivalence of categories. -/ +@[expose] public section + universe u₂ u₁ w open CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/EssSurj.lean b/Mathlib/CategoryTheory/Galois/EssSurj.lean index e2d8ce581a6a42..92e96670f452bc 100644 --- a/Mathlib/CategoryTheory/Galois/EssSurj.lean +++ b/Mathlib/CategoryTheory/Galois/EssSurj.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Full -import Mathlib.CategoryTheory.Galois.Topology -import Mathlib.Topology.Algebra.OpenSubgroup +module + +public import Mathlib.CategoryTheory.Galois.Full +public import Mathlib.CategoryTheory.Galois.Topology +public import Mathlib.Topology.Algebra.OpenSubgroup /-! @@ -35,6 +37,8 @@ For the case `Y = Aut F ⧸ U` we closely follow the second part of Stacks Proje -/ +@[expose] public section + noncomputable section universe u₁ u₂ diff --git a/Mathlib/CategoryTheory/Galois/Examples.lean b/Mathlib/CategoryTheory/Galois/Examples.lean index 82ffe3c2f0ae4e..aea30d8b551b82 100644 --- a/Mathlib/CategoryTheory/Galois/Examples.lean +++ b/Mathlib/CategoryTheory/Galois/Examples.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Basic -import Mathlib.CategoryTheory.Action.Concrete -import Mathlib.CategoryTheory.Action.Limits +module + +public import Mathlib.CategoryTheory.Galois.Basic +public import Mathlib.CategoryTheory.Action.Concrete +public import Mathlib.CategoryTheory.Action.Limits /-! # Examples of Galois categories and fiber functors @@ -17,6 +19,8 @@ The connected finite `G`-sets are precisely the ones with transitive `G`-action. -/ +@[expose] public section + universe u v w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Full.lean b/Mathlib/CategoryTheory/Galois/Full.lean index aa5d827161db33..795ad3e0921fa2 100644 --- a/Mathlib/CategoryTheory/Galois/Full.lean +++ b/Mathlib/CategoryTheory/Galois/Full.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Action +module + +public import Mathlib.CategoryTheory.Galois.Action /-! @@ -26,6 +28,8 @@ the fibers of connected objects. -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/GaloisObjects.lean b/Mathlib/CategoryTheory/Galois/GaloisObjects.lean index d374f4fddb7e53..94779e525c6a86 100644 --- a/Mathlib/CategoryTheory/Galois/GaloisObjects.lean +++ b/Mathlib/CategoryTheory/Galois/GaloisObjects.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Basic -import Mathlib.CategoryTheory.Limits.FintypeCat -import Mathlib.CategoryTheory.Limits.Preserves.Limits -import Mathlib.CategoryTheory.Limits.Shapes.SingleObj -import Mathlib.GroupTheory.GroupAction.Basic +module + +public import Mathlib.CategoryTheory.Galois.Basic +public import Mathlib.CategoryTheory.Limits.FintypeCat +public import Mathlib.CategoryTheory.Limits.Preserves.Limits +public import Mathlib.CategoryTheory.Limits.Shapes.SingleObj +public import Mathlib.GroupTheory.GroupAction.Basic /-! # Galois objects in Galois categories @@ -25,6 +27,8 @@ way and show equivalent characterisations. acts transitively on `F.obj X` for a fiber functor `F`. -/ + +@[expose] public section universe u₁ u₂ v₁ v₂ v w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean b/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean index 8c84a56091c865..b20065ec57ebe2 100644 --- a/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean +++ b/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Basic -import Mathlib.CategoryTheory.Galois.Topology -import Mathlib.CategoryTheory.Galois.Prorepresentability -import Mathlib.Topology.Algebra.OpenSubgroup +module + +public import Mathlib.CategoryTheory.Galois.Basic +public import Mathlib.CategoryTheory.Galois.Topology +public import Mathlib.CategoryTheory.Galois.Prorepresentability +public import Mathlib.Topology.Algebra.OpenSubgroup /-! @@ -30,7 +32,7 @@ Given a compact, topological group `G` with an action on `F.obj X` on each `X`, - `transitive_of_isGalois`: `G` acts transitively on `F.obj X` for all Galois objects `X : C` - `continuous_smul`: the action of `G` on `F.obj X` is continuous if `F.obj X` is equipped with the discrete topology for all `X : C`. -- `non_trivial': if `g : G` acts trivial on all `F.obj X`, then `g = 1`. +- `non_trivial'`: if `g : G` acts trivially on all `F.obj X`, then `g = 1`. Given this data, we define `toAut F G : G →* Aut F` in the natural way. @@ -45,6 +47,8 @@ Given this data, we define `toAut F G : G →* Aut F` in the natural way. `G` being a `T2Space`. -/ + +@[expose] public section universe u₁ u₂ w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Prorepresentability.lean b/Mathlib/CategoryTheory/Galois/Prorepresentability.lean index 5a398989d6c8c3..5448dfc2b7ef20 100644 --- a/Mathlib/CategoryTheory/Galois/Prorepresentability.lean +++ b/Mathlib/CategoryTheory/Galois/Prorepresentability.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.CategoryTheory.CofilteredSystem -import Mathlib.CategoryTheory.Galois.Decomposition -import Mathlib.CategoryTheory.Limits.IndYoneda -import Mathlib.CategoryTheory.Limits.Preserves.Ulift +module + +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.CategoryTheory.CofilteredSystem +public import Mathlib.CategoryTheory.Galois.Decomposition +public import Mathlib.CategoryTheory.Limits.IndYoneda +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift /-! # Pro-Representability of fiber functors @@ -53,6 +55,8 @@ an arbitrary `FintypeCat.{w}`. -/ +@[expose] public section + universe u₁ u₂ w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Galois/Topology.lean b/Mathlib/CategoryTheory/Galois/Topology.lean index efe9a71225ae30..2d495d8725dfa7 100644 --- a/Mathlib/CategoryTheory/Galois/Topology.lean +++ b/Mathlib/CategoryTheory/Galois/Topology.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Galois.Prorepresentability -import Mathlib.Topology.Algebra.ContinuousMonoidHom -import Mathlib.Topology.Algebra.Group.Basic +module + +public import Mathlib.CategoryTheory.Galois.Prorepresentability +public import Mathlib.Topology.Algebra.ContinuousMonoidHom +public import Mathlib.Topology.Algebra.Group.Basic /-! @@ -22,6 +24,8 @@ embedding of `Aut F` into `∀ X, Aut (F.obj X)` where -/ +@[expose] public section + open Topology universe u₁ u₂ v₁ v₂ v w diff --git a/Mathlib/CategoryTheory/Generator/Abelian.lean b/Mathlib/CategoryTheory/Generator/Abelian.lean index 4e5163ea86b440..e0a75283a27c1b 100644 --- a/Mathlib/CategoryTheory/Generator/Abelian.lean +++ b/Mathlib/CategoryTheory/Generator/Abelian.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.Subobject -import Mathlib.CategoryTheory.Limits.EssentiallySmall -import Mathlib.CategoryTheory.Preadditive.Injective.Basic -import Mathlib.CategoryTheory.Generator.Preadditive -import Mathlib.CategoryTheory.Abelian.Opposite +module + +public import Mathlib.CategoryTheory.Abelian.Subobject +public import Mathlib.CategoryTheory.Limits.EssentiallySmall +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic +public import Mathlib.CategoryTheory.Generator.Preadditive +public import Mathlib.CategoryTheory.Abelian.Opposite /-! # A complete abelian category with enough injectives and a separator has an injective coseparator @@ -21,6 +23,8 @@ import Mathlib.CategoryTheory.Abelian.Opposite -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits Opposite diff --git a/Mathlib/CategoryTheory/Generator/Basic.lean b/Mathlib/CategoryTheory/Generator/Basic.lean index 7505d6edb81e62..6ddd7af5057332 100644 --- a/Mathlib/CategoryTheory/Generator/Basic.lean +++ b/Mathlib/CategoryTheory/Generator/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.EssentiallySmall -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Equalizers -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.CategoryTheory.ObjectProperty.Small -import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape -import Mathlib.CategoryTheory.Comma.StructuredArrow.Small +module + +public import Mathlib.CategoryTheory.Limits.EssentiallySmall +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Equalizers +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.CategoryTheory.ObjectProperty.Small +public import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Small /-! # Separating and detecting sets @@ -56,6 +58,8 @@ See the files `CategoryTheory.Generator.Presheaf` and `CategoryTheory.Generator. -/ +@[expose] public section + universe w' w v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Generator/HomologicalComplex.lean b/Mathlib/CategoryTheory/Generator/HomologicalComplex.lean index 0c99e234af2548..571bcb82e72ef9 100644 --- a/Mathlib/CategoryTheory/Generator/HomologicalComplex.lean +++ b/Mathlib/CategoryTheory/Generator/HomologicalComplex.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Double -import Mathlib.Algebra.Homology.HomologicalComplexLimits -import Mathlib.CategoryTheory.Generator.Basic +module + +public import Mathlib.Algebra.Homology.Double +public import Mathlib.Algebra.Homology.HomologicalComplexLimits +public import Mathlib.CategoryTheory.Generator.Basic /-! # Generators of the category of homological complexes @@ -16,6 +18,8 @@ has a separating family, and a separator when suitable coproducts exist. -/ +@[expose] public section + universe t w v u open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Generator/Indization.lean b/Mathlib/CategoryTheory/Generator/Indization.lean index 21a5ad8435b28c..bc992d261322de 100644 --- a/Mathlib/CategoryTheory/Generator/Indization.lean +++ b/Mathlib/CategoryTheory/Generator/Indization.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Generator.Basic -import Mathlib.CategoryTheory.Limits.Indization.Category -import Mathlib.CategoryTheory.Preadditive.Indization +module + +public import Mathlib.CategoryTheory.Generator.Basic +public import Mathlib.CategoryTheory.Limits.Indization.Category +public import Mathlib.CategoryTheory.Preadditive.Indization /-! # Separating set in the category of ind-objects @@ -15,6 +17,8 @@ and additive, then `Ind C` has a separator. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Generator/Preadditive.lean b/Mathlib/CategoryTheory/Generator/Preadditive.lean index c948742f130c8f..ed35e64974f31d 100644 --- a/Mathlib/CategoryTheory/Generator/Preadditive.lean +++ b/Mathlib/CategoryTheory/Generator/Preadditive.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Generator.Basic -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +module + +public import Mathlib.CategoryTheory.Generator.Basic +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic /-! # Separators in preadditive categories @@ -14,6 +16,8 @@ preadditive categories. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Generator/Presheaf.lean b/Mathlib/CategoryTheory/Generator/Presheaf.lean index 8fc01993932da9..cdd1e18f27da63 100644 --- a/Mathlib/CategoryTheory/Generator/Presheaf.lean +++ b/Mathlib/CategoryTheory/Generator/Presheaf.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Generator.Basic -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Generator.Basic +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic /-! # Generators in the category of presheaves @@ -16,6 +17,8 @@ presheaves `Cᵒᵖ ⥤ A` also has a separator. -/ +@[expose] public section + universe w v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Generator/Sheaf.lean b/Mathlib/CategoryTheory/Generator/Sheaf.lean index bd7f0862ce4c53..016ffdda01a56a 100644 --- a/Mathlib/CategoryTheory/Generator/Sheaf.lean +++ b/Mathlib/CategoryTheory/Generator/Sheaf.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Generator.Presheaf -import Mathlib.CategoryTheory.Sites.Sheafification -import Mathlib.CategoryTheory.Sites.Limits +public import Mathlib.CategoryTheory.Generator.Presheaf +public import Mathlib.CategoryTheory.Sites.Sheafification +public import Mathlib.CategoryTheory.Sites.Limits /-! # Generators in the category of sheaves @@ -16,6 +17,8 @@ category which has a separator (and suitable coproducts), then `Sheaf J A` has a -/ +@[expose] public section + universe w v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Generator/StrongGenerator.lean b/Mathlib/CategoryTheory/Generator/StrongGenerator.lean index 02ca4a86d88619..65deaa164f1f95 100644 --- a/Mathlib/CategoryTheory/Generator/StrongGenerator.lean +++ b/Mathlib/CategoryTheory/Generator/StrongGenerator.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ExtremalEpi -import Mathlib.CategoryTheory.Generator.Basic -import Mathlib.CategoryTheory.Limits.Presentation +module + +public import Mathlib.CategoryTheory.ExtremalEpi +public import Mathlib.CategoryTheory.Generator.Basic +public import Mathlib.CategoryTheory.Limits.Presentation /-! # Strong generators @@ -29,6 +31,8 @@ then `S` is a strong generator. -/ +@[expose] public section + universe w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GlueData.lean b/Mathlib/CategoryTheory/GlueData.lean index 407a3d7f8f7fbd..1fd78796bf9ff3 100644 --- a/Mathlib/CategoryTheory/GlueData.lean +++ b/Mathlib/CategoryTheory/GlueData.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Tactic.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.Preserves.Limits -import Mathlib.CategoryTheory.Limits.Types.Shapes +module + +public import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Preserves.Limits +public import Mathlib.CategoryTheory.Limits.Types.Coproducts /-! # Gluing data @@ -18,6 +20,8 @@ interaction with a functor that preserves certain pullbacks. -/ +@[expose] public section + noncomputable section @@ -239,15 +243,7 @@ def diagramIso : D.diagram.multispan ⋙ F ≅ (D.mapGlueData F).diagram.multisp | WalkingMultispan.left _ => Iso.refl _ | WalkingMultispan.right _ => Iso.refl _) (by - rintro (⟨_, _⟩ | _) _ (_ | _ | _) - · erw [Category.comp_id, Category.id_comp, Functor.map_id] - rfl - · erw [Category.comp_id, Category.id_comp] - rfl - · erw [Category.comp_id, Category.id_comp, Functor.map_comp] - rfl - · erw [Category.comp_id, Category.id_comp, Functor.map_id] - rfl) + rintro (⟨_, _⟩ | _) _ (_ | _ | _) <;> simp) @[simp] theorem diagramIso_app_left (i : D.J × D.J) : diff --git a/Mathlib/CategoryTheory/GradedObject.lean b/Mathlib/CategoryTheory/GradedObject.lean index 30fb5b8d5c8219..51f89bbd4fcb2d 100644 --- a/Mathlib/CategoryTheory/GradedObject.lean +++ b/Mathlib/CategoryTheory/GradedObject.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Shift.Basic -import Mathlib.Data.Set.Subsingleton -import Mathlib.Algebra.Group.Int.Defs +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Shift.Basic +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Algebra.Group.Int.Defs /-! # The category of graded objects @@ -30,6 +32,8 @@ have a functor `map : GradedObject I C ⥤ GradedObject J C`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/GradedObject/Associator.lean b/Mathlib/CategoryTheory/GradedObject/Associator.lean index c607584c3bce41..997682af2af07f 100644 --- a/Mathlib/CategoryTheory/GradedObject/Associator.lean +++ b/Mathlib/CategoryTheory/GradedObject/Associator.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject.Trifunctor +module + +public import Mathlib.CategoryTheory.GradedObject.Trifunctor /-! # The associator for actions of bifunctors on graded objects @@ -26,6 +28,8 @@ on graded objects indexed by an additive monoid. -/ +@[expose] public section + namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean b/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean index 039b2b51e837d3..ca01b8ef89042b 100644 --- a/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean +++ b/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject +module + +public import Mathlib.CategoryTheory.GradedObject /-! # The action of bifunctors on graded objects @@ -19,6 +21,8 @@ on `GradedObject I C` (TODO @joelriou). -/ +@[expose] public section + namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/GradedObject/Braiding.lean b/Mathlib/CategoryTheory/GradedObject/Braiding.lean index 10bd083b5b4f7b..70ea73cde14437 100644 --- a/Mathlib/CategoryTheory/GradedObject/Braiding.lean +++ b/Mathlib/CategoryTheory/GradedObject/Braiding.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject.Monoidal -import Mathlib.CategoryTheory.Monoidal.Braided.Basic +module + +public import Mathlib.CategoryTheory.GradedObject.Monoidal +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic /-! # The braided and symmetric category structures on graded objects @@ -18,6 +20,8 @@ structure on `GradedObject I C` and show that it is symmetric if `C` is symmetri -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/GradedObject/Monoidal.lean b/Mathlib/CategoryTheory/GradedObject/Monoidal.lean index 812dfba12c52ca..ae1cb184b964aa 100644 --- a/Mathlib/CategoryTheory/GradedObject/Monoidal.lean +++ b/Mathlib/CategoryTheory/GradedObject/Monoidal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Kim Morrison -/ -import Mathlib.CategoryTheory.GradedObject.Unitor -import Mathlib.Data.Fintype.Prod +module + +public import Mathlib.CategoryTheory.GradedObject.Unitor +public import Mathlib.Data.Fintype.Prod /-! # The monoidal category structures on graded objects @@ -23,6 +25,8 @@ product commutes, we obtain a monoidal category structure on `GradedObject ℕ C -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GradedObject/Single.lean b/Mathlib/CategoryTheory/GradedObject/Single.lean index e5add88c366ef0..9f7b33437eab12 100644 --- a/Mathlib/CategoryTheory/GradedObject/Single.lean +++ b/Mathlib/CategoryTheory/GradedObject/Single.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject +module + +public import Mathlib.CategoryTheory.GradedObject /-! # The graded object in a single degree @@ -14,6 +16,8 @@ the initial object of `C` in other degrees. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean b/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean index eeca58fa2732da..1dba007b372d8b 100644 --- a/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean +++ b/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject.Bifunctor -import Mathlib.CategoryTheory.Functor.Trifunctor +module + +public import Mathlib.CategoryTheory.GradedObject.Bifunctor +public import Mathlib.CategoryTheory.Functor.Trifunctor /-! # The action of trifunctors on graded objects @@ -23,6 +25,8 @@ an additive monoid structure on `I` (TODO @joelriou). -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/GradedObject/Unitor.lean b/Mathlib/CategoryTheory/GradedObject/Unitor.lean index b3491e4f57a7d6..67069189b77c05 100644 --- a/Mathlib/CategoryTheory/GradedObject/Unitor.lean +++ b/Mathlib/CategoryTheory/GradedObject/Unitor.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GradedObject.Associator -import Mathlib.CategoryTheory.GradedObject.Single +module + +public import Mathlib.CategoryTheory.GradedObject.Associator +public import Mathlib.CategoryTheory.GradedObject.Single /-! # The left and right unitors @@ -19,6 +21,8 @@ to a triangle identity for the induced functors on graded objects. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/Grothendieck.lean b/Mathlib/CategoryTheory/Grothendieck.lean index e891d76584f457..e33890a0816547 100644 --- a/Mathlib/CategoryTheory/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Grothendieck.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Sina Hazratpour -/ -import Mathlib.CategoryTheory.Category.Cat.AsSmall -import Mathlib.CategoryTheory.Elements -import Mathlib.CategoryTheory.Comma.Over.Basic +module + +public import Mathlib.CategoryTheory.Category.Cat.AsSmall +public import Mathlib.CategoryTheory.Elements +public import Mathlib.CategoryTheory.Comma.Over.Basic /-! # The Grothendieck construction @@ -47,6 +49,8 @@ See also `CategoryTheory.Functor.Elements` for the category of elements of funct -/ +@[expose] public section + universe w u v u₁ v₁ u₂ v₂ diff --git a/Mathlib/CategoryTheory/Groupoid.lean b/Mathlib/CategoryTheory/Groupoid.lean index 05566184d48e8b..555e87c0489935 100644 --- a/Mathlib/CategoryTheory/Groupoid.lean +++ b/Mathlib/CategoryTheory/Groupoid.lean @@ -3,12 +3,15 @@ Copyright (c) 2018 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Kim Morrison, David Wärn -/ -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory -import Mathlib.CategoryTheory.Products.Basic -import Mathlib.CategoryTheory.Pi.Basic -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.Combinatorics.Quiver.Symmetric -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +public import Mathlib.CategoryTheory.Products.Basic +public import Mathlib.CategoryTheory.Pi.Basic +public import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.Combinatorics.Quiver.Symmetric +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Groupoids @@ -30,6 +33,8 @@ with `IsIso f` for every `f`. See also `CategoryTheory.Core` for the groupoid of isomorphisms in a category. -/ +@[expose] public section + namespace CategoryTheory @@ -186,4 +191,15 @@ instance isGroupoidProd {α : Type u} {β : Type u₂} [Category.{v} α] [Catego end +open MorphismProperty in +lemma isGroupoid_iff_isomorphisms_eq_top (C : Type*) [Category C] : + IsGroupoid C ↔ isomorphisms C = ⊤ := by + constructor + · rw [eq_top_iff] + intro _ _ + simp only [isomorphisms.iff, top_apply] + infer_instance + · intro h + exact ⟨of_eq_top h⟩ + end CategoryTheory diff --git a/Mathlib/CategoryTheory/Groupoid/Basic.lean b/Mathlib/CategoryTheory/Groupoid/Basic.lean index 19cca460b0c346..40e3094a1d7a21 100644 --- a/Mathlib/CategoryTheory/Groupoid/Basic.lean +++ b/Mathlib/CategoryTheory/Groupoid/Basic.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémi Bottinelli -/ -import Mathlib.CategoryTheory.Groupoid -import Mathlib.Combinatorics.Quiver.Basic +module + +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.Combinatorics.Quiver.Basic /-! This file defines a few basic properties of groupoids. -/ +@[expose] public section + namespace CategoryTheory namespace Groupoid diff --git a/Mathlib/CategoryTheory/Groupoid/Discrete.lean b/Mathlib/CategoryTheory/Groupoid/Discrete.lean index 1ff05508909a92..669b9fe0bb5fcb 100644 --- a/Mathlib/CategoryTheory/Groupoid/Discrete.lean +++ b/Mathlib/CategoryTheory/Groupoid/Discrete.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.Discrete.Basic +module + +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.Discrete.Basic /-! # Discrete categories are groupoids -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} diff --git a/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean b/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean index af90eb513047d5..ca451160bc957f 100644 --- a/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean +++ b/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémi Bottinelli -/ -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.PathCategory.Basic +module + +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.PathCategory.Basic /-! # Free groupoid on a quiver @@ -16,10 +18,10 @@ extension as a functor from the free groupoid, and proves uniqueness of this ext Given the type `V` and a quiver instance on `V`: -- `FreeGroupoid V`: a type synonym for `V`. -- `FreeGroupoid.instGroupoid`: the `Groupoid` instance on `FreeGroupoid V`. +- `Quiver.FreeGroupoid V`: a type synonym for `V`. +- `Quiver.FreeGroupoid.instGroupoid`: the `Groupoid` instance on `Quiver.FreeGroupoid V`. - `lift`: the lifting of a prefunctor from `V` to `V'` where `V'` is a groupoid, to a functor. - `FreeGroupoid V ⥤ V'`. + `Quiver.FreeGroupoid V ⥤ V'`. - `lift_spec` and `lift_unique`: the proofs that, respectively, `lift` indeed is a lifting and is the unique one. @@ -30,6 +32,8 @@ and finally quotienting by the reducibility relation. -/ +@[expose] public section + open Set Function namespace Quiver @@ -56,16 +60,14 @@ inductive FreeGroupoid.redStep : HomRel (Paths (Quiver.Symmetrify V)) redStep (𝟙 ((Paths.of (Quiver.Symmetrify V)).obj X)) (f.toPath ≫ (Quiver.reverse f).toPath) /-- The underlying vertices of the free groupoid -/ -def FreeGroupoid (V) [Q : Quiver V] := +protected def FreeGroupoid (V) [Q : Quiver V] := CategoryTheory.Quotient (@FreeGroupoid.redStep V Q) -@[deprecated (since := "2025-10-02")] alias _root_.CategoryTheory.FreeGroupoid := FreeGroupoid - namespace FreeGroupoid open Quiver -instance {V} [Quiver V] [Nonempty V] : Nonempty (FreeGroupoid V) := by +instance {V} [Quiver V] [Nonempty V] : Nonempty (Quiver.FreeGroupoid V) := by inhabit V; exact ⟨⟨@default V _⟩⟩ theorem congr_reverse {X Y : Paths <| Quiver.Symmetrify V} (p q : X ⟶ Y) : @@ -113,21 +115,21 @@ theorem congr_reverse_comp {X Y : Paths <| Quiver.Symmetrify V} (p : X ⟶ Y) : nth_rw 2 [← Quiver.Path.reverse_reverse p] apply congr_comp_reverse -instance : Category (FreeGroupoid V) := +instance : Category (Quiver.FreeGroupoid V) := Quotient.category redStep /-- The inverse of an arrow in the free groupoid -/ -def quotInv {X Y : FreeGroupoid V} (f : X ⟶ Y) : Y ⟶ X := +def quotInv {X Y : Quiver.FreeGroupoid V} (f : X ⟶ Y) : Y ⟶ X := Quot.liftOn f (fun pp => Quot.mk _ <| pp.reverse) fun pp qq con => Quot.sound <| congr_reverse pp qq con -instance instGroupoid : Groupoid (FreeGroupoid V) where +instance instGroupoid : Groupoid (Quiver.FreeGroupoid V) where inv := quotInv inv_comp p := Quot.inductionOn p fun pp => congr_reverse_comp pp comp_inv p := Quot.inductionOn p fun pp => congr_comp_reverse pp /-- The inclusion of the quiver on `V` to the underlying quiver on `FreeGroupoid V` -/ -def of (V) [Quiver V] : V ⥤q FreeGroupoid V where +def of (V) [Quiver V] : V ⥤q Quiver.FreeGroupoid V where obj X := ⟨X⟩ map f := Quot.mk _ f.toPosPath @@ -140,7 +142,7 @@ section UniversalProperty variable {V' : Type u'} [Groupoid V'] /-- The lift of a prefunctor to a groupoid, to a functor from `FreeGroupoid V` -/ -def lift (φ : V ⥤q V') : FreeGroupoid V ⥤ V' := +def lift (φ : V ⥤q V') : Quiver.FreeGroupoid V ⥤ V' := CategoryTheory.Quotient.lift _ (Paths.lift <| Quiver.Symmetrify.lift φ) <| by rintro _ _ _ _ ⟨X, Y, f⟩ -- Porting note: `simp` does not work, so manually `rewrite` @@ -154,8 +156,8 @@ theorem lift_spec (φ : V ⥤q V') : of V ⋙q (lift φ).toPrefunctor = φ := by dsimp [lift] rw [Quotient.lift_spec, Paths.lift_spec, Quiver.Symmetrify.lift_spec] -theorem lift_unique (φ : V ⥤q V') (Φ : FreeGroupoid V ⥤ V') (hΦ : of V ⋙q Φ.toPrefunctor = φ) : - Φ = lift φ := by +theorem lift_unique (φ : V ⥤q V') (Φ : Quiver.FreeGroupoid V ⥤ V') + (hΦ : of V ⋙q Φ.toPrefunctor = φ) : Φ = lift φ := by apply Quotient.lift_unique apply Paths.lift_unique fapply @Quiver.Symmetrify.lift_unique _ _ _ _ _ _ _ _ _ @@ -179,11 +181,11 @@ open FreeGroupoid variable {V' : Type u'} [Quiver.{v' + 1} V'] {V'' : Type u''} [Quiver.{v'' + 1} V''] /-- The functor of free groupoid induced by a prefunctor of quivers -/ -def freeGroupoidFunctor (φ : V ⥤q V') : FreeGroupoid V ⥤ FreeGroupoid V' := +def freeGroupoidFunctor (φ : V ⥤q V') : Quiver.FreeGroupoid V ⥤ Quiver.FreeGroupoid V' := lift (φ ⋙q of V') theorem freeGroupoidFunctor_id : - freeGroupoidFunctor (Prefunctor.id V) = Functor.id (FreeGroupoid V) := by + freeGroupoidFunctor (Prefunctor.id V) = Functor.id (Quiver.FreeGroupoid V) := by dsimp only [freeGroupoidFunctor]; symm apply lift_unique; rfl diff --git a/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean b/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean new file mode 100644 index 00000000000000..5045927b3a37a2 --- /dev/null +++ b/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean @@ -0,0 +1,308 @@ +/- +Copyright (c) 2025 Joseph Hua. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joseph Hua +-/ +module + +public import Mathlib.CategoryTheory.Groupoid.FreeGroupoid +public import Mathlib.CategoryTheory.Category.Grpd +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Localization.Predicate + +/-! +# Free groupoid on a category + +This file defines the free groupoid on a category, the lifting of a functor to its unique +extension as a functor from the free groupoid, and proves uniqueness of this extension. + +## Main results + +Given a type `C` and a category instance on `C`: + +- `CategoryTheory.FreeGroupoid C`: the underlying type of the free groupoid on `C`. +- `CategoryTheory.FreeGroupoid.instGroupoid`: the `Groupoid` instance on `FreeGroupoid C`. +- `CategoryTheory.FreeGroupoid.lift`: the lifting of a functor `C ⥤ G` where `G` is a + groupoid, to a functor `CategoryTheory.FreeGroupoid C ⥤ G`. +- `CategoryTheory.FreeGroupoid.lift_spec` and + `CategoryTheory.FreeGroupoid.lift_unique`: + the proofs that, respectively, `CategoryTheory.FreeGroupoid.lift` indeed is a lifting + and is the unique one. +- `CategoryTheory.Grpd.free`: the free functor from `Grpd` to `Cat` +- `CategoryTheory.Grpd.freeForgetAdjunction`: that `free` is left adjoint to + `Grpd.forgetToCat`. + +## Implementation notes + +The free groupoid on a category `C` is first defined by taking the free groupoid `G` +on the underlying *quiver* of `C`. Then the free groupoid on the *category* `C` is defined as +the quotient of `G` by the relation that makes the inclusion prefunctor `C ⥤q G` a functor. + +-/ + +@[expose] public section + +noncomputable section + +namespace CategoryTheory + +universe v u v₁ u₁ v₂ u₂ + +variable (C : Type u) [Category.{v} C] + +open Quiver in +/-- The relation on the free groupoid on the underlying *quiver* of C that +promotes the prefunctor `C ⥤q FreeGroupoid C` into a functor +`C ⥤ Quotient (FreeGroupoid.homRel C)`. -/ +inductive FreeGroupoid.homRel : HomRel (Quiver.FreeGroupoid C) where +| map_id (X : C) : homRel ((FreeGroupoid.of C).map (𝟙 X)) (𝟙 ((FreeGroupoid.of C).obj X)) +| map_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : homRel ((FreeGroupoid.of C).map (f ≫ g)) + ((FreeGroupoid.of C).map f ≫ (FreeGroupoid.of C).map g) + +/-- The underlying type of the free groupoid on a category, +defined by quotienting the free groupoid on the underlying quiver of `C` +by the relation that promotes the prefunctor `C ⥤q FreeGroupoid C` into a functor +`C ⥤ Quotient (FreeGroupoid.homRel C)`. -/ +def FreeGroupoid := Quotient (FreeGroupoid.homRel C) + +instance [Nonempty C] : Nonempty (FreeGroupoid C) := + ⟨Quotient.mk (Quotient.mk ((Paths.of _).obj (Classical.arbitrary C)))⟩ + +instance : Groupoid (FreeGroupoid C) := + Quotient.groupoid (FreeGroupoid.homRel C) + +namespace FreeGroupoid + +/-- The localization functor from the category `C` to the groupoid `FreeGroupoid C` -/ +def of : C ⥤ FreeGroupoid C where + __ := Quiver.FreeGroupoid.of C ⋙q (Quotient.functor (FreeGroupoid.homRel C)).toPrefunctor + map_id X := Quotient.sound _ (FreeGroupoid.homRel.map_id X) + map_comp f g := Quotient.sound _ (FreeGroupoid.homRel.map_comp f g) + +variable {C} + +/-- Construct an object in the free groupoid on `C` by providing an object in `C`. -/ +abbrev mk (X : C) : FreeGroupoid C := (of C).obj X + +/-- Construct a morphism in the free groupoid on `C` by providing a morphism in `C`. -/ +abbrev homMk {X Y : C} (f : X ⟶ Y) : mk X ⟶ mk Y := (of C).map f + +lemma eq_mk (X : FreeGroupoid C) : X = .mk (X.as.as) := rfl + +lemma of_obj_bijective : Function.Bijective (of C).obj where + left _ _ h := by cases h; rfl + right X := ⟨X.as.as, rfl⟩ + +section UniversalProperty + +variable {G : Type u₁} [Groupoid.{v₁} G] + +/-- The lift of a functor from `C` to a groupoid to a functor from +`FreeGroupoid C` to the groupoid -/ +def lift (φ : C ⥤ G) : FreeGroupoid C ⥤ G := + Quotient.lift (FreeGroupoid.homRel C) (Quiver.FreeGroupoid.lift φ.toPrefunctor) + (fun _ _ f g r ↦ by + have {X Y : C} (f : X ⟶ Y) := + Prefunctor.congr_hom (Quiver.FreeGroupoid.lift_spec φ.toPrefunctor) f + induction r <;> cat_disch) + +theorem lift_spec (φ : C ⥤ G) : of C ⋙ lift φ = φ := + Functor.toPrefunctor_injective (by + change Quiver.FreeGroupoid.of C ⋙q + (Quotient.functor (FreeGroupoid.homRel C)).toPrefunctor ⋙q + (lift φ).toPrefunctor = φ.toPrefunctor + simp [lift, Quotient.lift_spec, Quiver.FreeGroupoid.lift_spec]) + +@[simp] +lemma lift_obj_mk {E : Type u₂} [Groupoid.{v₂} E] (φ : C ⥤ E) (X : C) : + (lift φ).obj (mk X) = φ.obj X := rfl + +@[simp] +lemma lift_map_homMk {E : Type u₂} [Groupoid.{v₂} E] (φ : C ⥤ E) {X Y : C} (f : X ⟶ Y) : + (lift φ).map (homMk f) = φ.map f := by + simpa using Functor.congr_hom (lift_spec φ) f + +theorem lift_unique (φ : C ⥤ G) (Φ : FreeGroupoid C ⥤ G) (hΦ : of C ⋙ Φ = φ) : + Φ = lift φ := by + apply Quotient.lift_unique + apply Quiver.FreeGroupoid.lift_unique + exact congr_arg Functor.toPrefunctor hΦ + +theorem lift_id_comp_of : lift (𝟭 G) ⋙ of G = 𝟭 _ := by + rw [lift_unique (of G) (lift (𝟭 G) ⋙ of G) (by rw [← Functor.assoc, lift_spec, Functor.id_comp])] + symm; apply lift_unique + rw [Functor.comp_id] + +theorem lift_comp {H : Type u₂} [Groupoid.{v₂} H] (φ : C ⥤ G) (ψ : G ⥤ H) : + lift (φ ⋙ ψ) = lift φ ⋙ ψ := by + symm + apply lift_unique + rw [← Functor.assoc, lift_spec] + +/-- The universal property of the free groupoid. -/ +def strictUniversalPropertyFixedTarget : + Localization.StrictUniversalPropertyFixedTarget (of C) ⊤ G where + inverts _ := inferInstance + lift F _ := lift F + fac _ _ := lift_spec .. + uniq F G h := by rw [lift_unique (of C ⋙ G) F h, ← lift_unique (of C ⋙ G) G rfl] + +attribute [local instance] Localization.groupoid + +instance : (of C).IsLocalization ⊤ := + .mk' _ _ strictUniversalPropertyFixedTarget strictUniversalPropertyFixedTarget + +/-- In order to define a natural isomorphism `F ≅ G` with `F G : FreeGroupoid ⥤ D`, +it suffices to do so after precomposing with `FreeGroupoid.of C`. -/ +def liftNatIso (F₁ F₂ : FreeGroupoid C ⥤ G) (τ : of C ⋙ F₁ ≅ of C ⋙ F₂) : F₁ ≅ F₂ := + Localization.liftNatIso (of C) ⊤ (of C ⋙ F₁) (of C ⋙ F₂) _ _ τ + +@[simp] +lemma liftNatIso_hom_app (F₁ F₂ : FreeGroupoid C ⥤ G) (τ : of C ⋙ F₁ ≅ of C ⋙ F₂) (X) : + (liftNatIso F₁ F₂ τ).hom.app (mk X) = τ.hom.app X := by + simp [liftNatIso] + +@[simp] +lemma liftNatIso_inv_app (F₁ F₂ : FreeGroupoid C ⥤ G) (τ : of C ⋙ F₁ ≅ of C ⋙ F₂) (X) : + (liftNatIso F₁ F₂ τ).inv.app (mk X) = τ.inv.app X := by + simp [liftNatIso] + +end UniversalProperty + +section Functoriality + +variable {D : Type u₁} [Category.{v₁} D] {E : Type u₂} [Category.{v₂} E] + +/-- The functor between free groupoids induced by a functor between categories. -/ +def map (φ : C ⥤ D) : FreeGroupoid C ⥤ FreeGroupoid D := + lift (φ ⋙ of D) + +lemma of_comp_map (F : C ⥤ D) : of C ⋙ map F = F ⋙ of D := rfl + +/-- The operation `of` is natural. -/ +def ofCompMapIso (F : C ⥤ D) : of C ⋙ map F ≅ F ⋙ of D := Iso.refl _ + +variable (C) in +/-- The functor induced by the identity is the identity. -/ +def mapId : map (𝟭 C) ≅ 𝟭 (FreeGroupoid C) := + liftNatIso _ _ (Iso.refl _) + +@[simp] +lemma mapId_hom_app (X) : (mapId C).hom.app X = 𝟙 X := + liftNatIso_hom_app .. + +@[simp] +lemma mapId_inv_app (X) : (mapId C).inv.app X = 𝟙 X := + liftNatIso_inv_app .. + +variable (C) in +theorem map_id : map (𝟭 C) = 𝟭 (FreeGroupoid C) := by + symm; apply lift_unique; rfl + +/-- The functor induced by a composition is the composition of the functors they induce. -/ +def mapComp (φ : C ⥤ D) (φ' : D ⥤ E) : map (φ ⋙ φ') ≅ map φ ⋙ map φ':= + liftNatIso _ _ (Iso.refl _) + +@[simp] +lemma mapComp_hom_app (φ : C ⥤ D) (φ' : D ⥤ E) (X) : (mapComp φ φ').hom.app X = 𝟙 _ := + liftNatIso_hom_app .. + +@[simp] +lemma mapComp_inv_app (φ : C ⥤ D) (φ' : D ⥤ E) (X) : (mapComp φ φ').inv.app X = 𝟙 _ := + liftNatIso_inv_app .. + +theorem map_comp (φ : C ⥤ D) (φ' : D ⥤ E) : map (φ ⋙ φ') = map φ ⋙ map φ' := by + symm; apply lift_unique; rfl + +@[simp] +lemma map_obj_mk (φ : C ⥤ D) (X : C) : (map φ).obj (mk X) = mk (φ.obj X) := rfl + +@[simp] +lemma map_map_homMk (φ : C ⥤ D) {X Y : C} (f : X ⟶ Y) : + (map φ).map (homMk f) = homMk (φ.map f) := rfl + +variable {E : Type u₂} [Groupoid.{v₂} E] + +lemma map_comp_lift (F : C ⥤ D) (G : D ⥤ E) : map F ⋙ lift G = lift (F ⋙ G) := by + apply lift_unique + rw [← Functor.assoc, of_comp_map, Functor.assoc, lift_spec G] + +/-- The operation `lift` is natural. -/ +def mapCompLift (F : C ⥤ D) (G : D ⥤ E) : map F ⋙ lift G ≅ lift (F ⋙ G) := + liftNatIso _ _ (Iso.refl _) + +@[simp] +lemma mapCompLift_hom_app (F : C ⥤ D) (G : D ⥤ E) (X) : (mapCompLift F G).hom.app X = 𝟙 _ := + liftNatIso_hom_app .. + +@[simp] +lemma mapCompLift_inv_app (F : C ⥤ D) (G : D ⥤ E) (X) : (mapCompLift F G).inv.app X = 𝟙 _ := + liftNatIso_inv_app .. + +end Functoriality + +/-- Functors out of the free groupoid biject with functors out of the original category. -/ +@[simps] +def functorEquiv {D : Type*} [Groupoid D] : (FreeGroupoid C ⥤ D) ≃ (C ⥤ D) where + toFun G := of C ⋙ G + invFun F := lift F + right_inv := lift_spec + left_inv _ := (lift_unique _ _ rfl).symm + +end FreeGroupoid + +namespace Grpd + +open FreeGroupoid + +/-- The free groupoid construction on a category as a functor. -/ +def free : Cat.{u, u} ⥤ Grpd.{u, u} where + obj C := Grpd.of <| FreeGroupoid C + map {C D} F := map F + map_id C := by simp [Grpd.id_eq_id, map_id, Cat.id_eq_id] + map_comp F G := by simp [Grpd.comp_eq_comp, map_comp, Cat.comp_eq_comp] + +@[simp] +lemma free_obj (C : Cat.{u, u}) : free.obj C = FreeGroupoid C := + rfl + +@[simp] +lemma free_map {C D : Cat.{u, u}} (F : C ⟶ D) : free.map F = map F := + rfl + +/-- The free-forgetful adjunction between `Grpd` and `Cat`. -/ +def freeForgetAdjunction : free ⊣ Grpd.forgetToCat := + Adjunction.mkOfHomEquiv + { homEquiv _ _ := FreeGroupoid.functorEquiv + homEquiv_naturality_left_symm _ _ := (FreeGroupoid.map_comp_lift _ _).symm + homEquiv_naturality_right _ _ := rfl } + +variable {C : Type u} [Category.{u} C] {D : Type u} [Groupoid.{u} D] + +@[simp] +lemma freeForgetAdjunction_homEquiv_apply (F : FreeGroupoid C ⥤ D) : + freeForgetAdjunction.homEquiv (Cat.of C) (Grpd.of D) F = FreeGroupoid.of C ⋙ F := + rfl + +@[simp] +lemma freeForgetAdjunction_homEquiv_symm_apply (F : C ⥤ D) : + (freeForgetAdjunction.homEquiv (Cat.of C) (Grpd.of D)).symm F = map F ⋙ lift (𝟭 D) := + rfl + +@[simp] +lemma freeForgetAdjunction_unit_app : + freeForgetAdjunction.unit.app (Cat.of C) = FreeGroupoid.of C := + rfl + +@[simp] +lemma freeForgetAdjunction_counit_app : + freeForgetAdjunction.counit.app (Grpd.of D) = lift (𝟭 D) := + rfl + +instance : Reflective Grpd.forgetToCat where + L := free + adj := freeForgetAdjunction + +end Grpd +end CategoryTheory +end diff --git a/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean b/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean index 8519789957fa5d..050ce8a504074d 100644 --- a/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean +++ b/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémi Bottinelli, Junyan Xu -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.CategoryTheory.Groupoid.VertexGroup -import Mathlib.CategoryTheory.Groupoid.Basic -import Mathlib.CategoryTheory.Groupoid -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.CategoryTheory.Groupoid.VertexGroup +public import Mathlib.CategoryTheory.Groupoid.Basic +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.Data.Set.Lattice /-! # Subgroupoid @@ -53,6 +55,8 @@ and `Mathlib/Combinatorics/SimpleGraph/Subgraph.lean`. category theory, groupoid, subgroupoid -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Groupoid/VertexGroup.lean b/Mathlib/CategoryTheory/Groupoid/VertexGroup.lean index 9add7e6426c4d7..ddbde07f0184a7 100644 --- a/Mathlib/CategoryTheory/Groupoid/VertexGroup.lean +++ b/Mathlib/CategoryTheory/Groupoid/VertexGroup.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémi Bottinelli -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.PathCategory.Basic -import Mathlib.Combinatorics.Quiver.Path +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.PathCategory.Basic +public import Mathlib.Combinatorics.Quiver.Path /-! # Vertex group @@ -26,6 +28,8 @@ This file defines the vertex group (*aka* isotropy group) of a groupoid at a ver isotropy, vertex group, groupoid -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GuitartExact/Basic.lean b/Mathlib/CategoryTheory/GuitartExact/Basic.lean index 6fbd4398e5491e..1bc78ca02fe5db 100644 --- a/Mathlib/CategoryTheory/GuitartExact/Basic.lean +++ b/Mathlib/CategoryTheory/GuitartExact/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Functor.TwoSquare +module + +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Functor.TwoSquare /-! # Guitart exact squares @@ -46,6 +48,8 @@ and construct (pointwise) derived functors using this notion -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean b/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean index 10a8c7ebd19cd1..30b86785dd267a 100644 --- a/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean +++ b/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GuitartExact.Basic -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +module + +public import Mathlib.CategoryTheory.GuitartExact.Basic +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction /-! # Guitart exact squares and Kan extensions @@ -34,6 +36,8 @@ induced by a Guitart exact square `w` is an isomorphism. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GuitartExact/Opposite.lean b/Mathlib/CategoryTheory/GuitartExact/Opposite.lean index 5126b8b93804fe..0f8beee5f3586b 100644 --- a/Mathlib/CategoryTheory/GuitartExact/Opposite.lean +++ b/Mathlib/CategoryTheory/GuitartExact/Opposite.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GuitartExact.VerticalComposition +module + +public import Mathlib.CategoryTheory.GuitartExact.VerticalComposition /-! # The opposite of a Guitart exact square @@ -13,6 +15,8 @@ is Guitart exact. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GuitartExact/Over.lean b/Mathlib/CategoryTheory/GuitartExact/Over.lean index 96e32e64dbb1ba..34ca1b1eb1766d 100644 --- a/Mathlib/CategoryTheory/GuitartExact/Over.lean +++ b/Mathlib/CategoryTheory/GuitartExact/Over.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.GuitartExact.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +module + +public import Mathlib.CategoryTheory.GuitartExact.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts /-! # Guitart exact squares involving `Over` categories @@ -25,6 +27,8 @@ exists and `F` commutes with it. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean b/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean index c8779b30e82b3a..f9aee53c9840a6 100644 --- a/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean +++ b/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.CatCommSq -import Mathlib.CategoryTheory.GuitartExact.Basic +module + +public import Mathlib.CategoryTheory.CatCommSq +public import Mathlib.CategoryTheory.GuitartExact.Basic /-! # Vertical composition of Guitart exact squares @@ -14,6 +16,8 @@ is Guitart exact. -/ +@[expose] public section + namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/HomCongr.lean b/Mathlib/CategoryTheory/HomCongr.lean index 475e64d0f50226..743a0cf2f261e5 100644 --- a/Mathlib/CategoryTheory/HomCongr.lean +++ b/Mathlib/CategoryTheory/HomCongr.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.CategoryTheory.Iso +module + +public import Mathlib.CategoryTheory.Iso /-! # Conjugate morphisms by isomorphisms @@ -21,6 +23,8 @@ As corollaries, an isomorphism `α : X ≅ Y` defines which can be found in `CategoryTheory.Conj`. -/ +@[expose] public section + set_option mathlib.tactic.category.grind true diff --git a/Mathlib/CategoryTheory/Idempotents/Basic.lean b/Mathlib/CategoryTheory/Idempotents/Basic.lean index 5eca8158345ceb..40b726b3dce724 100644 --- a/Mathlib/CategoryTheory/Idempotents/Basic.lean +++ b/Mathlib/CategoryTheory/Idempotents/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Abelian.Basic +module + +public import Mathlib.CategoryTheory.Abelian.Basic /-! # Idempotent complete categories @@ -30,6 +32,8 @@ iff `C` is. -/ +@[expose] public section + open CategoryTheory @@ -70,7 +74,7 @@ theorem isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent : intro s refine ⟨s.ι ≫ e, ?_⟩ constructor - · erw [assoc, h₂, ← Limits.Fork.condition s, comp_id] + · simp [h₂, ← Limits.Fork.condition s] · intro m hm rw [Fork.ι_ofι] at hm rw [← hm] diff --git a/Mathlib/CategoryTheory/Idempotents/Biproducts.lean b/Mathlib/CategoryTheory/Idempotents/Biproducts.lean index 4add68f3005c7c..40f415b1cb54d9 100644 --- a/Mathlib/CategoryTheory/Idempotents/Biproducts.lean +++ b/Mathlib/CategoryTheory/Idempotents/Biproducts.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Idempotents.Karoubi +module + +public import Mathlib.CategoryTheory.Idempotents.Karoubi /-! @@ -19,6 +21,8 @@ the idempotent endomorphism `𝟙 P.X - P.p`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean b/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean index 868dcf10987a1d..9a60f9d874adb5 100644 --- a/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean +++ b/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Idempotents.Karoubi +module + +public import Mathlib.CategoryTheory.Idempotents.Karoubi /-! # Idempotent completeness and functor categories @@ -17,6 +19,8 @@ We also provide a fully faithful functor -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean b/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean index a4ca673c71d453..5cbf3faacf4858 100644 --- a/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean +++ b/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Idempotents.Karoubi +module + +public import Mathlib.CategoryTheory.Idempotents.Karoubi /-! # Extension of functors to the idempotent completion @@ -20,6 +22,8 @@ and `karoubiUniversal C D : C ⥤ D ≌ Karoubi C ⥤ D`. -/ +@[expose] public section + namespace CategoryTheory namespace Idempotents @@ -243,6 +247,29 @@ theorem whiskeringLeft_obj_preimage_app {F G : Karoubi C ⥤ D} end IsIdempotentComplete +variable {C D} in +/-- The precomposition of functors with `toKaroubi C` is fully faithful. -/ +def whiskeringLeftObjToKaroubiFullyFaithful : + ((Functor.whiskeringLeft C (Karoubi C) D).obj (toKaroubi C)).FullyFaithful where + preimage {F G} τ := + { app P := F.map P.decompId_i ≫ τ.app P.X ≫ G.map P.decompId_p + naturality X Y f := by + dsimp at τ ⊢ + have h₁ : f ≫ Y.decompId_i = X.decompId_i ≫ (toKaroubi C).map f.f := by simp + have h₂ := τ.naturality f.f + have h₃ : X.decompId_p ≫ f = (toKaroubi C).map f.f ≫ Y.decompId_p := by simp + dsimp at h₂ + rw [Category.assoc, Category.assoc, ← F.map_comp_assoc, + h₁, F.map_comp_assoc, reassoc_of% h₂, ← G.map_comp, ← h₃, G.map_comp] } + preimage_map {F G} τ := by ext X; exact (natTrans_eq _ _).symm + map_preimage {F G} τ := by + ext X + dsimp + rw [Karoubi.decompId_i_toKaroubi, Karoubi.decompId_p_toKaroubi, + Functor.map_id, Category.id_comp] + change _ ≫ G.map (𝟙 _) = _ + simp + end Idempotents end CategoryTheory diff --git a/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean b/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean index adaa2f18c9a302..c2f9daa5af1aaa 100644 --- a/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean +++ b/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.Additive -import Mathlib.CategoryTheory.Idempotents.Karoubi +module + +public import Mathlib.Algebra.Homology.Additive +public import Mathlib.CategoryTheory.Idempotents.Karoubi /-! # Idempotent completeness and homological complexes @@ -18,6 +20,8 @@ When the category `C` is idempotent complete, it is shown that -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Idempotents/Karoubi.lean b/Mathlib/CategoryTheory/Idempotents/Karoubi.lean index 4cd5e4e417a7db..927f9552a5ca52 100644 --- a/Mathlib/CategoryTheory/Idempotents/Karoubi.lean +++ b/Mathlib/CategoryTheory/Idempotents/Karoubi.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Idempotents.Basic -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Equivalence +module + +public import Mathlib.CategoryTheory.Idempotents.Basic +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Equivalence /-! # The Karoubi envelope of a category @@ -21,6 +23,8 @@ complete category. It is also preadditive when `C` is preadditive. -/ +@[expose] public section + noncomputable section open CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.Limits @@ -275,8 +279,26 @@ theorem decompId_p_naturality {P Q : Karoubi C} (f : P ⟶ Q) : theorem zsmul_hom [Preadditive C] {P Q : Karoubi C} (n : ℤ) (f : P ⟶ Q) : (n • f).f = n • f.f := map_zsmul (inclusionHom P Q) n f +/-- If `X : Karoubi C`, then `X` is a retract of `((toKaroubi C).obj X.X)`. -/ +@[simps] +def retract (X : Karoubi C) : Retract X ((toKaroubi C).obj X.X) where + i := ⟨X.p, by simp⟩ + r := ⟨X.p, by simp⟩ + end Karoubi +instance : (toKaroubi C).PreservesEpimorphisms where + preserves f _ := ⟨fun g h eq ↦ by + ext + rw [← cancel_epi f] + simpa using eq⟩ + +instance : (toKaroubi C).PreservesMonomorphisms where + preserves f _ := ⟨fun g h eq ↦ by + ext + rw [← cancel_mono f] + simpa using eq⟩ + end Idempotents end CategoryTheory diff --git a/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean b/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean index 96d0a3af8993e9..e04b729c59eb9a 100644 --- a/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean +++ b/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Idempotents.Karoubi +module + +public import Mathlib.CategoryTheory.Idempotents.Karoubi /-! # Idempotence of the Karoubi envelope @@ -13,6 +15,8 @@ In this file, we construct the equivalence of categories -/ +@[expose] public section + open CategoryTheory.Category diff --git a/Mathlib/CategoryTheory/Idempotents/SimplicialObject.lean b/Mathlib/CategoryTheory/Idempotents/SimplicialObject.lean index 0a46ade1890899..7d3395f7a71776 100644 --- a/Mathlib/CategoryTheory/Idempotents/SimplicialObject.lean +++ b/Mathlib/CategoryTheory/Idempotents/SimplicialObject.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.AlgebraicTopology.SimplicialObject.Basic -import Mathlib.CategoryTheory.Idempotents.FunctorCategories +module + +public import Mathlib.AlgebraicTopology.SimplicialObject.Basic +public import Mathlib.CategoryTheory.Idempotents.FunctorCategories /-! @@ -16,6 +18,8 @@ category `C` is. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/InducedCategory.lean b/Mathlib/CategoryTheory/InducedCategory.lean index 2b5f29c7d5077e..065b1664f5b1ed 100644 --- a/Mathlib/CategoryTheory/InducedCategory.lean +++ b/Mathlib/CategoryTheory/InducedCategory.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton -/ -import Mathlib.CategoryTheory.Functor.FullyFaithful +module + +public import Mathlib.CategoryTheory.Functor.FullyFaithful /-! # Induced categories and full subcategories @@ -27,6 +29,8 @@ form of `D`. This is used to set up several algebraic categories like -- even though `MonCat = Bundled Monoid`! -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/IsConnected.lean b/Mathlib/CategoryTheory/IsConnected.lean index 8b4edb7e6bff6e..5d0b9f4587ede9 100644 --- a/Mathlib/CategoryTheory/IsConnected.lean +++ b/Mathlib/CategoryTheory/IsConnected.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Jakob von Raumer -/ -import Mathlib.Data.List.Chain -import Mathlib.CategoryTheory.PUnit -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.Category.ULift +module + +public import Mathlib.Data.List.Chain +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.Category.ULift /-! # Connected category @@ -41,6 +43,8 @@ connected limit. That is, any limit of shape `J` where `J` is a connected category is preserved by the functor `(X × -)`. This appears in `CategoryTheory.Limits.Connected`. -/ +@[expose] public section + universe w₁ w₂ v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Iso.lean b/Mathlib/CategoryTheory/Iso.lean index 2ff449fc989743..7c575795b57963 100644 --- a/Mathlib/CategoryTheory/Iso.lean +++ b/Mathlib/CategoryTheory/Iso.lean @@ -3,7 +3,10 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tim Baumann, Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.Tactic.CategoryTheory.Reassoc +module + +public import Mathlib.Tactic.CategoryTheory.Reassoc +import Mathlib.Logic.Equiv.Defs /-! # Isomorphisms @@ -31,6 +34,8 @@ This file defines isomorphisms between objects of a category. category, category theory, isomorphism -/ +@[expose] public section + set_option mathlib.tactic.category.grind true universe v u diff --git a/Mathlib/CategoryTheory/IsomorphismClasses.lean b/Mathlib/CategoryTheory/IsomorphismClasses.lean index 17d906987bef63..483b76b3a44c19 100644 --- a/Mathlib/CategoryTheory/IsomorphismClasses.lean +++ b/Mathlib/CategoryTheory/IsomorphismClasses.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Groupoid -import Mathlib.CategoryTheory.Types.Basic +module + +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Groupoid +public import Mathlib.CategoryTheory.Types.Basic /-! # Objects of a category up to an isomorphism @@ -14,6 +16,8 @@ import Mathlib.CategoryTheory.Types.Basic The quotient with respect to this relation defines a functor from our category to `Type`. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Join/Basic.lean b/Mathlib/CategoryTheory/Join/Basic.lean index 0e743a155fbc97..16910fec5ca8e6 100644 --- a/Mathlib/CategoryTheory/Join/Basic.lean +++ b/Mathlib/CategoryTheory/Join/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Products.Basic /-! # Joins of categories @@ -33,6 +35,8 @@ there is a unique morphism `c ⟶ d` in `C ⋆ D`. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ v₆ u₁ u₂ u₃ u₄ u₅ u₆ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Join/Final.lean b/Mathlib/CategoryTheory/Join/Final.lean index bedb22e96810b6..edc5dec387fef6 100644 --- a/Mathlib/CategoryTheory/Join/Final.lean +++ b/Mathlib/CategoryTheory/Join/Final.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Join.Basic -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Limits.IsConnected +module + +public import Mathlib.CategoryTheory.Join.Basic +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Limits.IsConnected /-! # (Co)Finality of the inclusions in joins of categories @@ -15,6 +17,8 @@ Dually, `inclRight : C ⥤ C ⋆ D` is final if `D` is connected. -/ +@[expose] public section + namespace CategoryTheory.Join variable (C D : Type*) [Category C] [Category D] diff --git a/Mathlib/CategoryTheory/Join/Opposites.lean b/Mathlib/CategoryTheory/Join/Opposites.lean index f65df261ed0ecd..1a674169d6e479 100644 --- a/Mathlib/CategoryTheory/Join/Opposites.lean +++ b/Mathlib/CategoryTheory/Join/Opposites.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Join.Basic -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.Join.Basic +public import Mathlib.CategoryTheory.Opposites /-! # Opposites of joins of categories @@ -14,6 +16,8 @@ This equivalence is characterized in both directions. -/ +@[expose] public section + namespace CategoryTheory.Join open Opposite Functor diff --git a/Mathlib/CategoryTheory/Join/Pseudofunctor.lean b/Mathlib/CategoryTheory/Join/Pseudofunctor.lean index 0550f45de40436..2f8b5da8d970cf 100644 --- a/Mathlib/CategoryTheory/Join/Pseudofunctor.lean +++ b/Mathlib/CategoryTheory/Join/Pseudofunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Join.Basic -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Join.Basic +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor /-! # Pseudofunctoriality of categorical joins @@ -15,6 +17,8 @@ each variable. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory.Join diff --git a/Mathlib/CategoryTheory/Join/Sum.lean b/Mathlib/CategoryTheory/Join/Sum.lean index 284a724049e61a..2bf98979993be2 100644 --- a/Mathlib/CategoryTheory/Join/Sum.lean +++ b/Mathlib/CategoryTheory/Join/Sum.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Join.Basic -import Mathlib.CategoryTheory.Sums.Basic +module + +public import Mathlib.CategoryTheory.Join.Basic +public import Mathlib.CategoryTheory.Sums.Basic /-! # Embedding of `C ⊕ D` into `C ⋆ D` @@ -15,6 +17,8 @@ We also provide `Faithful` and `EssSurj` instances on this functor. -/ +@[expose] public section + namespace CategoryTheory.Join variable (C D : Type*) [Category C] [Category D] diff --git a/Mathlib/CategoryTheory/LiftingProperties/Adjunction.lean b/Mathlib/CategoryTheory/LiftingProperties/Adjunction.lean index 6c359d396dd995..9af878dade03ab 100644 --- a/Mathlib/CategoryTheory/LiftingProperties/Adjunction.lean +++ b/Mathlib/CategoryTheory/LiftingProperties/Adjunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.LiftingProperties.Basic -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.CategoryTheory.LiftingProperties.Basic +public import Mathlib.CategoryTheory.Adjunction.Basic /-! @@ -18,6 +20,8 @@ has the left lifting property in `C` with respect to `F.map p`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/LiftingProperties/Basic.lean b/Mathlib/CategoryTheory/LiftingProperties/Basic.lean index 1d32a8e3c4736c..bc2f76b5f42079 100644 --- a/Mathlib/CategoryTheory/LiftingProperties/Basic.lean +++ b/Mathlib/CategoryTheory/LiftingProperties/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Jakob Scholbach. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Scholbach, Joël Riou -/ -import Mathlib.CategoryTheory.CommSq -import Mathlib.CategoryTheory.Retract +module + +public import Mathlib.CategoryTheory.CommSq +public import Mathlib.CategoryTheory.Retract /-! # Lifting properties @@ -23,6 +25,8 @@ lifting property -/ +@[expose] public section + universe v diff --git a/Mathlib/CategoryTheory/LiftingProperties/Limits.lean b/Mathlib/CategoryTheory/LiftingProperties/Limits.lean index fb1c478cdd17dd..95f38fb58c8e5e 100644 --- a/Mathlib/CategoryTheory/LiftingProperties/Limits.lean +++ b/Mathlib/CategoryTheory/LiftingProperties/Limits.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq /-! # Lifting properties and (co)limits @@ -13,6 +15,8 @@ certain (co)limits. -/ +@[expose] public section + universe v namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/LiftingProperties/Over.lean b/Mathlib/CategoryTheory/LiftingProperties/Over.lean new file mode 100644 index 00000000000000..c58e4df69f8066 --- /dev/null +++ b/Mathlib/CategoryTheory/LiftingProperties/Over.lean @@ -0,0 +1,56 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.LiftingProperties.Basic +public import Mathlib.CategoryTheory.Comma.Over.Basic + +/-! +# Lifting properties in Over categories + +In this file, we show that if `sq` is a commutative square in +a category `Over S` for `S : C`, there is a lift for `sq` +if there is a lift for the underlying commutative square +in the category `C`. It follows that if `i` and `p` are +morphisms in `Over S`, then `i` has the left lifting +property with respect to `p` when `i.left` has +the left lifting property with respect to `p.left`. + +-/ + +@[expose] public section + +universe v u + +namespace CategoryTheory + +variable {C : Type u} [Category.{v} C] {S : C} + +namespace CommSq.HasLift + +lemma over {X₁ X₂ X₃ X₄ : Over S} + {t : X₁ ⟶ X₂} {l : X₁ ⟶ X₃} {r : X₂ ⟶ X₄} {b : X₃ ⟶ X₄} {sq : CommSq t l r b} + [CommSq.HasLift (f := t.left) (i := l.left) (p := r.left) (g := b.left) + (sq.map (Over.forget _))] : + sq.HasLift := by + let sq' := sq.map (Over.forget _) + dsimp at sq' + exact ⟨⟨{ + l := Over.homMk sq'.lift + (by rw [← Over.w b, ← sq'.fac_right_assoc, Over.w r]) + }⟩⟩ + +end CommSq.HasLift + +namespace HasLiftingProperty + +lemma over {A B X Y : Over S} + (i : A ⟶ B) (p : X ⟶ Y) [HasLiftingProperty i.left p.left] : + HasLiftingProperty i p := ⟨fun _ ↦ .over⟩ + +end HasLiftingProperty + +end CategoryTheory diff --git a/Mathlib/CategoryTheory/LiftingProperties/ParametrizedAdjunction.lean b/Mathlib/CategoryTheory/LiftingProperties/ParametrizedAdjunction.lean index 5a58c2d521b602..e38afcd0c80724 100644 --- a/Mathlib/CategoryTheory/LiftingProperties/ParametrizedAdjunction.lean +++ b/Mathlib/CategoryTheory/LiftingProperties/ParametrizedAdjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.LiftingProperties.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Adjunction.Parametrized +module + +public import Mathlib.CategoryTheory.LiftingProperties.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Adjunction.Parametrized /-! # Lifting properties and parametrized adjunctions @@ -33,6 +35,8 @@ to `sq₁₃.π`: this is the lemma `ParametrizedAdjunction.hasLiftingProperty_i -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Bicones.lean b/Mathlib/CategoryTheory/Limits/Bicones.lean index 14c399d0df288b..478dfdd0ed1eda 100644 --- a/Mathlib/CategoryTheory/Limits/Bicones.lean +++ b/Mathlib/CategoryTheory/Limits/Bicones.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Cones -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.Data.Finset.Lattice.Lemmas +module + +public import Mathlib.CategoryTheory.Limits.Cones +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.Data.Finset.Lattice.Lemmas /-! # Bicones @@ -21,6 +23,8 @@ Given a diagram `F : J ⥤ C` and two `Cone F`s, we can join them into a diagram This is used in `CategoryTheory.Functor.Flat`. -/ +@[expose] public section + universe v₁ u₁ diff --git a/Mathlib/CategoryTheory/Limits/ColimitLimit.lean b/Mathlib/CategoryTheory/Limits/ColimitLimit.lean index 698fb628a1f062..b691bb69083326 100644 --- a/Mathlib/CategoryTheory/Limits/ColimitLimit.lean +++ b/Mathlib/CategoryTheory/Limits/ColimitLimit.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +module + +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic /-! # The morphism comparing a colimit of limits with the corresponding limit of colimits. @@ -23,6 +25,8 @@ is that when `C = Type`, filtered colimits commute with finite limits. * [Stacks: Filtered colimits](https://stacks.math.columbia.edu/tag/002W) -/ +@[expose] public section + universe v₁ v₂ v u₁ u₂ u diff --git a/Mathlib/CategoryTheory/Limits/Comma.lean b/Mathlib/CategoryTheory/Limits/Comma.lean index c05e5123196be7..d2751897425425 100644 --- a/Mathlib/CategoryTheory/Limits/Comma.lean +++ b/Mathlib/CategoryTheory/Limits/Comma.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Unit +module + +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Unit /-! # Limits and colimits in comma categories @@ -20,6 +22,8 @@ category, and show that the appropriate forgetful functors create limits. The duals of all the above are also given. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/ConcreteCategory/Basic.lean b/Mathlib/CategoryTheory/Limits/ConcreteCategory/Basic.lean index 88cbd053776e63..2940bfa2b420fa 100644 --- a/Mathlib/CategoryTheory/Limits/ConcreteCategory/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/ConcreteCategory/Basic.lean @@ -3,17 +3,21 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Adam Topaz -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Limits.Types.Images -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.Limits.Yoneda +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Limits.Types.Images +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Limits.Yoneda /-! # Facts about (co)limits of functors into concrete categories -/ +@[expose] public section + universe s t w v u r diff --git a/Mathlib/CategoryTheory/Limits/ConcreteCategory/WithAlgebraicStructures.lean b/Mathlib/CategoryTheory/Limits/ConcreteCategory/WithAlgebraicStructures.lean index 75c0aee9149ae1..afa53551b8e8d8 100644 --- a/Mathlib/CategoryTheory/Limits/ConcreteCategory/WithAlgebraicStructures.lean +++ b/Mathlib/CategoryTheory/Limits/ConcreteCategory/WithAlgebraicStructures.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.Tactic.CategoryTheory.Elementwise +module + +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.Tactic.CategoryTheory.Elementwise /-! # Colimits in ModuleCat @@ -31,6 +33,8 @@ In the future they might be generalized by assuming a `HasForget₂ C (ModuleCat plus assertions that the module structures induced by `HasForget₂` coincide. -/ +@[expose] public section + universe t w v u r open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/ConeCategory.lean b/Mathlib/CategoryTheory/Limits/ConeCategory.lean index 6ed032bc3a2043..72fac2df7fcac0 100644 --- a/Mathlib/CategoryTheory/Limits/ConeCategory.lean +++ b/Mathlib/CategoryTheory/Limits/ConeCategory.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Adjunction.Comma -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Shapes.Equivalence +module + +public import Mathlib.CategoryTheory.Adjunction.Comma +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Shapes.Equivalence /-! # Limits and the category of (co)cones @@ -22,6 +24,8 @@ instance of `Cone`, please refer to `CategoryTheory/Limits/Cones.lean`. -/ +@[expose] public section + namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Cones.lean b/Mathlib/CategoryTheory/Limits/Cones.lean index 7e76f9cdf34862..ce4c348434d4dc 100644 --- a/Mathlib/CategoryTheory/Limits/Cones.lean +++ b/Mathlib/CategoryTheory/Limits/Cones.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Functor.Const -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Yoneda -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.CategoryTheory.Functor.Const +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Yoneda +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # Cones and cocones @@ -33,6 +35,8 @@ And, of course, we dualise all this to cocones as well. For more results about the category of cones, see `cone_category.lean`. -/ +@[expose] public section + -- morphism levels before object levels. See note [category theory universes]. universe v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ @@ -424,7 +428,7 @@ def functoriality : Cone F ⥤ Cone (F ⋙ G) where { pt := G.obj A.pt π := { app := fun j => G.map (A.π.app j) - naturality := by intros; erw [← G.map_comp]; simp } } + naturality := by simp [← G.map_comp] } } map f := { hom := G.map f.hom w := ConeMorphism.map_w f G } diff --git a/Mathlib/CategoryTheory/Limits/Connected.lean b/Mathlib/CategoryTheory/Limits/Connected.lean index c781306e20a48a..2cdafc463942cb 100644 --- a/Mathlib/CategoryTheory/Limits/Connected.lean +++ b/Mathlib/CategoryTheory/Limits/Connected.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Connected limits @@ -26,6 +28,8 @@ That is, any limit of shape `J` where `J` is a connected category is preserved by the functor `(X × -)`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Constructions/BinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Constructions/BinaryProducts.lean index 99c278ec80ed6a..43383bbcef9ee3 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/BinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/BinaryProducts.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal /-! # Constructing binary product from pullbacks and terminal object. @@ -17,6 +19,8 @@ has pullbacks and a terminal object, then it has binary products. We also provide the dual. -/ +@[expose] public section + universe v v' u u' diff --git a/Mathlib/CategoryTheory/Limits/Constructions/EpiMono.lean b/Mathlib/CategoryTheory/Limits/Constructions/EpiMono.lean index 474c957079d867..f12ef9267d8910 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/EpiMono.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/EpiMono.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks /-! # Relating monomorphisms and epimorphisms to limits and colimits @@ -16,6 +18,8 @@ We also provide the dual version for epimorphisms. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Constructions/Equalizers.lean index 40d3d65963e909..0c43312549ca25 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Equalizers.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts /-! # Constructing equalizers from pullbacks and binary products. @@ -16,6 +18,8 @@ If a category has pullbacks and binary products, then it has equalizers. TODO: generalize universe -/ +@[expose] public section + noncomputable section @@ -66,7 +70,7 @@ def equalizerConeIsLimit (F : WalkingParallelPair ⥤ C) : IsLimit (equalizerCon have J0 := J WalkingParallelPair.zero; simp at J0 apply pullback.hom_ext · rwa [limit.lift_π] - · erw [limit.lift_π, ← J0, pullbackFst_eq_pullback_snd] + · simp [← J0, pullbackFst_eq_pullback_snd] end HasEqualizersOfHasPullbacksAndBinaryProducts diff --git a/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean b/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean index 2a16377f44cde4..0149517e74005c 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # Limits of eventually constant functors @@ -20,6 +22,8 @@ the dual results for filtered categories and colimits are also obtained. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Filtered.lean b/Mathlib/CategoryTheory/Limits/Constructions/Filtered.lean index e0fda90d8e8e77..c688b05b70ddb6 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Filtered.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Filtered -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products +module + +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Filtered +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products /-! # Constructing colimits from finite colimits and filtered colimits @@ -20,6 +22,8 @@ diagram of all coproducts of finite subsets of `α`. We also deduce the dual statement by invoking the original statement in `Cᵒᵖ`. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean index 3998895967b5aa..edf2d80db49e99 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products /-! # Constructing finite products from binary products and terminal. @@ -19,6 +21,8 @@ Provide the dual results. Show the analogous results for functors which reflect or create (co)limits. -/ +@[expose] public section + universe v v' u u' diff --git a/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean b/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean index fa0db20f2ecb84..6b2ea1b0ef0882 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean @@ -3,15 +3,17 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Constructions.BinaryProducts -import Mathlib.CategoryTheory.Limits.Constructions.Equalizers -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Creates.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Sigma +module + +public import Mathlib.CategoryTheory.Limits.Constructions.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Constructions.Equalizers +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Creates.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Sigma /-! # Constructing limits from products and equalizers. @@ -28,6 +30,8 @@ Provide the dual results. Show the analogous results for functors which reflect or create (co)limits. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Over/Basic.lean b/Mathlib/CategoryTheory/Limits/Constructions/Over/Basic.lean index f9512af4a4ba07..dffa5d9d8e6c02 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Over/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Over/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Reid Barton, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Limits.Constructions.Over.Products -import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Limits.Constructions.Equalizers +module + +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Products +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Limits.Constructions.Equalizers /-! # Limits in the over category @@ -16,6 +18,8 @@ Declare instances for limits in the over category: If `C` has finite wide pullba finite limits, and if `C` has arbitrary wide pullbacks then `Over B` has limits. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean b/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean index 6ea304667a6ddf..752053c21b806c 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Reid Barton, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Filtered.Final +module + +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Filtered.Final /-! # Connected limits in the over category @@ -18,6 +20,8 @@ In particular, `CostructuredArrow K B` has any connected limit which `C` has. From this we deduce the corresponding results for the over category. -/ +@[expose] public section + universe v' u' v u -- morphism levels before object levels. See note [category theory universes]. diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean b/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean index cf58ba25e7fb3e..7d4c8703f642f9 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Reid Barton, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq /-! # Products in the over category @@ -21,6 +23,8 @@ category. * Dualise to get the `Under X` results. -/ +@[expose] public section + universe w v u -- morphism levels before object levels. See note [category_theory universes]. diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Constructions/Pullbacks.lean index 20397d8eae0f86..623ffe02fcc23a 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Pullbacks.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback /-! # Constructing pullbacks from binary products and equalizers @@ -14,6 +16,8 @@ If a category as binary products and equalizers, then it has pullbacks. Also, if a category has binary coproducts and coequalizers, then it has pushouts -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean b/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean index 6834fbca42835e..cff666f1dca096 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Constructions related to weakly initial objects @@ -18,6 +20,8 @@ This file gives constructions related to weakly initial objects, namely: These are primarily useful to show the General Adjoint Functor Theorem. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean b/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean index d66bcc7266931a..e726cf0ac3f417 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms -import Mathlib.CategoryTheory.Limits.Constructions.BinaryProducts +module + +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +public import Mathlib.CategoryTheory.Limits.Constructions.BinaryProducts /-! # Limits involving zero objects @@ -13,6 +15,8 @@ Binary products and coproducts with a zero object always exist, and pullbacks/pushouts over a zero object are products/coproducts. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Creates.lean b/Mathlib/CategoryTheory/Limits/Creates.lean index 0d3646419281e4..7f2a6184ac46e9 100644 --- a/Mathlib/CategoryTheory/Limits/Creates.lean +++ b/Mathlib/CategoryTheory/Limits/Creates.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Creating (co)limits @@ -14,6 +16,8 @@ We say that `F` creates limits of `K` if, given any limit cone `c` for `K ⋙ F` limits for `K`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits CategoryTheory.Functor diff --git a/Mathlib/CategoryTheory/Limits/Elements.lean b/Mathlib/CategoryTheory/Limits/Elements.lean index 33be62e9fd4a99..e55723f43c74c8 100644 --- a/Mathlib/CategoryTheory/Limits/Elements.lean +++ b/Mathlib/CategoryTheory/Limits/Elements.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Elements -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Preserves.Limits +module + +public import Mathlib.CategoryTheory.Elements +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Preserves.Limits /-! # Limits in the category of elements @@ -17,6 +19,8 @@ the category of elements of `A` has limits of shape `I` and the forgetful functo -/ +@[expose] public section + universe w v₁ v u₁ u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/EpiMono.lean b/Mathlib/CategoryTheory/Limits/EpiMono.lean index bc10f364086dd9..f63bae109b5122 100644 --- a/Mathlib/CategoryTheory/Limits/EpiMono.lean +++ b/Mathlib/CategoryTheory/Limits/EpiMono.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq /-! # Relation between mono/epi and pullback/pushout squares @@ -25,6 +27,8 @@ is a pullback square. -/ +@[expose] public section + namespace CategoryTheory open Category Limits diff --git a/Mathlib/CategoryTheory/Limits/EssentiallySmall.lean b/Mathlib/CategoryTheory/Limits/EssentiallySmall.lean index 25b33da226c85a..2b4cb437e98d9c 100644 --- a/Mathlib/CategoryTheory/Limits/EssentiallySmall.lean +++ b/Mathlib/CategoryTheory/Limits/EssentiallySmall.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.EssentiallySmall +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.EssentiallySmall /-! # Limits over essentially small indexing categories @@ -15,6 +17,8 @@ See also the file `FinallySmall.lean` for more general results. -/ +@[expose] public section + universe w₁ w₂ v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/ExactFunctor.lean b/Mathlib/CategoryTheory/Limits/ExactFunctor.lean index 914f91890b273b..43d1532a0f3f65 100644 --- a/Mathlib/CategoryTheory/Limits/ExactFunctor.lean +++ b/Mathlib/CategoryTheory/Limits/ExactFunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Preserves.Finite +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Bundled exact functors @@ -15,6 +17,8 @@ In this file, we define the categories of bundled left exact, right exact and ex -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Limits/Filtered.lean b/Mathlib/CategoryTheory/Limits/Filtered.lean index 8ed157461b6d8d..124ebb4a36426a 100644 --- a/Mathlib/CategoryTheory/Limits/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Filtered.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.Types.Yoneda +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.Types.Yoneda /-! # Filtered categories and limits @@ -16,6 +18,8 @@ finite category there is some `X : C` such that `lim Hom(F·, X)` is nonempty. Furthermore, we define the type classes `HasCofilteredLimitsOfSize` and `HasFilteredColimitsOfSize`. -/ +@[expose] public section + universe w' w w₂' w₂ v u diff --git a/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesFiniteLimit.lean b/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesFiniteLimit.lean index a67fb68a261f6c..fad822927a1b88 100644 --- a/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesFiniteLimit.lean +++ b/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesFiniteLimit.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.ColimitLimit -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Products.Bifunctor -import Mathlib.Data.Countable.Small +module + +public import Mathlib.CategoryTheory.Limits.ColimitLimit +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Products.Bifunctor +public import Mathlib.Data.Countable.Small /-! # Filtered colimits commute with finite limits. @@ -26,6 +28,8 @@ colimit (over `K`) of the limits (over `J`) with the limit of the colimits is an * [Stacks: Filtered colimits](https://stacks.math.columbia.edu/tag/002W) -/ +@[expose] public section + -- Various pieces of algebra that have previously been spuriously imported here: assert_not_exists map_ne_zero MonoidWithZero diff --git a/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesProduct.lean b/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesProduct.lean index 3386b2a52e974e..223cfc41fe4274 100644 --- a/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesProduct.lean +++ b/Mathlib/CategoryTheory/Limits/FilteredColimitCommutesProduct.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Filtered -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Filtered +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Limits.Types.Products /-! # The IPC property @@ -30,6 +32,8 @@ does the category of Ind-objects of `C`. * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], 3.1.10, 3.1.11, 3.1.12. -/ +@[expose] public section + universe w v v₁ v₂ u u₁ u₂ namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Final.lean b/Mathlib/CategoryTheory/Limits/Final.lean index f527d5944767d4..75592f8aeb295c 100644 --- a/Mathlib/CategoryTheory/Limits/Final.lean +++ b/Mathlib/CategoryTheory/Limits/Final.lean @@ -3,16 +3,18 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Category.Cat.AsSmall -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Limits.Yoneda -import Mathlib.CategoryTheory.PUnit -import Mathlib.CategoryTheory.Grothendieck +module + +public import Mathlib.CategoryTheory.Category.Cat.AsSmall +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Limits.Yoneda +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.CategoryTheory.Grothendieck /-! # Final and initial functors @@ -67,6 +69,8 @@ Dualise condition 3 above and the implications 2 ⇒ 3 and 3 ⇒ 1 to initial fu (Note he reverses the roles of definition and main result relative to here!) -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Final/Connected.lean b/Mathlib/CategoryTheory/Limits/Final/Connected.lean index acbf44a6093277..a928090292afb2 100644 --- a/Mathlib/CategoryTheory/Limits/Final/Connected.lean +++ b/Mathlib/CategoryTheory/Limits/Final/Connected.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Discrete.StructuredArrow +module + +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Discrete.StructuredArrow /-! # Characterization of connected categories using initial/final functors @@ -16,6 +18,8 @@ We deduce that the projection `C × D ⥤ C` is final (or initial) if `D` is con -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Final/ParallelPair.lean b/Mathlib/CategoryTheory/Limits/Final/ParallelPair.lean index 199b3da8d1d7ee..a6ab880bc8759e 100644 --- a/Mathlib/CategoryTheory/Limits/Final/ParallelPair.lean +++ b/Mathlib/CategoryTheory/Limits/Final/ParallelPair.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Limits.Final /-! # Conditions for `parallelPair` to be initial @@ -16,6 +18,8 @@ parallel morphisms out of `X` factor through the parallel pair `f`, `g` (`h₂ : ∀ ⦃Z : C⦄ (i j : X ⟶ Z), ∃ (a : Y ⟶ Z), i = f ≫ a ∧ j = g ≫ a`). -/ +@[expose] public section + namespace CategoryTheory.Limits variable {C : Type*} [Category C] diff --git a/Mathlib/CategoryTheory/Limits/Final/Type.lean b/Mathlib/CategoryTheory/Limits/Final/Type.lean index 7ad492d6c7f635..58f35a11902223 100644 --- a/Mathlib/CategoryTheory/Limits/Final/Type.lean +++ b/Mathlib/CategoryTheory/Limits/Final/Type.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Limits.Final /-! # Action of an initial functor on sections @@ -22,6 +24,8 @@ is a bijection. -/ +@[expose] public section + universe w v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/FinallySmall.lean b/Mathlib/CategoryTheory/Limits/FinallySmall.lean index 0d9f164e36af4c..2332a4221d064c 100644 --- a/Mathlib/CategoryTheory/Limits/FinallySmall.lean +++ b/Mathlib/CategoryTheory/Limits/FinallySmall.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Logic.Small.Set -import Mathlib.CategoryTheory.Filtered.Final +module + +public import Mathlib.Logic.Small.Set +public import Mathlib.CategoryTheory.Filtered.Final /-! # Finally small categories @@ -24,6 +26,8 @@ objects such that from every object there a morphism to a member of `s`. We also converse holds if `J` is filtered. -/ +@[expose] public section + universe w v v₁ u u₁ open CategoryTheory Functor diff --git a/Mathlib/CategoryTheory/Limits/FintypeCat.lean b/Mathlib/CategoryTheory/Limits/FintypeCat.lean index 6d4cf35146d5c8..5c3b463522d22c 100644 --- a/Mathlib/CategoryTheory/Limits/FintypeCat.lean +++ b/Mathlib/CategoryTheory/Limits/FintypeCat.lean @@ -3,12 +3,17 @@ Copyright (c) 2023 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.FintypeCat -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Finite.Sigma +module + +public import Mathlib.CategoryTheory.FintypeCat +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Finite.Sigma /-! # (Co)limits in the category of finite types @@ -17,6 +22,8 @@ We show that finite (co)limits exist in `FintypeCat` and that they are preserved inclusion `FintypeCat.incl`. -/ +@[expose] public section + open CategoryTheory Limits Functor universe u diff --git a/Mathlib/CategoryTheory/Limits/FormalCoproducts.lean b/Mathlib/CategoryTheory/Limits/FormalCoproducts.lean index bcb226cc31ba44..1bc029eb2143a3 100644 --- a/Mathlib/CategoryTheory/Limits/FormalCoproducts.lean +++ b/Mathlib/CategoryTheory/Limits/FormalCoproducts.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Kenny Lau -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Formal Coproducts @@ -29,6 +31,8 @@ In this file we construct the category of formal coproducts given a category. -/ +@[expose] public section + universe w w₁ w₂ w₃ v v₁ v₂ v₃ u u₁ u₂ u₃ open Opposite CategoryTheory Functor diff --git a/Mathlib/CategoryTheory/Limits/Fubini.lean b/Mathlib/CategoryTheory/Limits/Fubini.lean index 631af3e0db55a0..a9b3cf14b7f7b5 100644 --- a/Mathlib/CategoryTheory/Limits/Fubini.lean +++ b/Mathlib/CategoryTheory/Limits/Fubini.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Products.Basic -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Products.Bifunctor +module + +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Products.Basic +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Products.Bifunctor /-! # A Fubini theorem for categorical (co)limits @@ -34,6 +36,8 @@ in terms of the uncurried functor. All statements have their counterpart for colimits. -/ +@[expose] public section + open CategoryTheory Functor diff --git a/Mathlib/CategoryTheory/Limits/FullSubcategory.lean b/Mathlib/CategoryTheory/Limits/FullSubcategory.lean index ea9bde3a8f25e9..01769a06ab91f2 100644 --- a/Mathlib/CategoryTheory/Limits/FullSubcategory.lean +++ b/Mathlib/CategoryTheory/Limits/FullSubcategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape -import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape +module + +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +public import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape /-! # Limits in full subcategories @@ -15,6 +17,8 @@ More precisely, the inclusion creates such limits. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean index 1dee66c466175d..f948a393425930 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Limits.Preserves.Limits +module + +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Limits.Preserves.Limits /-! # (Co)limits in functor categories. @@ -20,6 +22,8 @@ We also show that `F : D ⥤ K ⥤ C` preserves (co)limits if it does so for eac `CategoryTheory.Limits.preservesColimits_of_evaluation`). -/ +@[expose] public section + open CategoryTheory CategoryTheory.Category CategoryTheory.Functor diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/EpiMono.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/EpiMono.lean index f98cf65579d0f4..bdd612638afbc9 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/EpiMono.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/EpiMono.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +module + +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic /-! # Monomorphisms and epimorphisms in functor categories @@ -16,6 +18,8 @@ see `NatTrans.mono_iff_mono_app` and `NatTrans.epi_iff_epi_app`. -/ +@[expose] public section + universe v v' v'' u u' u'' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Filtered.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Filtered.lean index d86c3c9fd36f2a..34578fa64c9416 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Filtered.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Filtered +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Filtered /-! # Functor categories have filtered colimits when the target category does @@ -13,6 +15,8 @@ These declarations cannot be in `Mathlib/CategoryTheory/Limits/FunctorCategory.l that file shouldn't import `Mathlib/CategoryTheory/Limits/Filtered.lean`. -/ +@[expose] public section + universe w' w v₁ v₂ u₁ u₂ namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Finite.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Finite.lean index 108829c108e7c0..771a17890d1848 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Finite.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! # Functor categories have finite limits when the target category does @@ -13,6 +15,8 @@ These declarations cannot be in `Mathlib/CategoryTheory/Limits/FunctorCategory.l that file shouldn't import `Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean`. -/ +@[expose] public section + namespace CategoryTheory.Limits variable {C : Type*} [Category C] {K : Type*} [Category K] diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Kernels.lean index 2c149eee806e6e..55fcdd64d65364 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Kernels.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Yaël Dillies, Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Joël Riou -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels /-! # (Co)kernels in functor categories -/ +@[expose] public section + namespace CategoryTheory.Limits universe u variable (C : Type*) [Category.{u} C] [HasZeroMorphisms C] diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Products.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Products.lean index afd43b87c38543..9f9e8bf157256e 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Products.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Products.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Products /-! # (Co)products in functor categories @@ -14,6 +16,8 @@ Given `f : α → D ⥤ C`, we prove the isomorphisms -/ +@[expose] public section + universe w v v₁ v₂ u u₁ u₂ namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean index 4a51e0715062cf..4cfa43e2e12dd3 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback /-! # Pullbacks in functor categories @@ -13,6 +15,8 @@ We prove the isomorphism `(pullback f g).obj d ≅ pullback (f.app d) (g.app d)` -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/FunctorToTypes.lean b/Mathlib/CategoryTheory/Limits/FunctorToTypes.lean index 70c1894237edce..a69e82de0e6016 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorToTypes.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorToTypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Types.Colimits +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Types.Colimits /-! # Concrete description of (co)limits in functor categories @@ -13,6 +15,8 @@ Some of the concrete descriptions of (co)limits in `Type v` extend to (co)limits category `K ⥤ Type v`. -/ +@[expose] public section + namespace CategoryTheory.FunctorToTypes open CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/HasLimits.lean b/Mathlib/CategoryTheory/Limits/HasLimits.lean index c77d7d3129c6a0..be2eb951982c95 100644 --- a/Mathlib/CategoryTheory/Limits/HasLimits.lean +++ b/Mathlib/CategoryTheory/Limits/HasLimits.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Mario Carneiro, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.IsLimit -import Mathlib.CategoryTheory.Category.ULift -import Mathlib.CategoryTheory.EssentiallySmall -import Mathlib.CategoryTheory.Functor.EpiMono -import Mathlib.Logic.Equiv.Basic +module + +public import Mathlib.CategoryTheory.Limits.IsLimit +public import Mathlib.CategoryTheory.Category.ULift +public import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.Functor.EpiMono +public import Mathlib.Logic.Equiv.Basic /-! # Existence of limits and colimits @@ -55,6 +57,8 @@ e.g. a `@[dualize]` attribute that behaves similarly to `@[to_additive]`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/IndYoneda.lean b/Mathlib/CategoryTheory/Limits/IndYoneda.lean index a61648b0e4429d..babd18cc8b2344 100644 --- a/Mathlib/CategoryTheory/Limits/IndYoneda.lean +++ b/Mathlib/CategoryTheory/Limits/IndYoneda.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Preserves.Limits -import Mathlib.CategoryTheory.Limits.Yoneda +module + +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Preserves.Limits +public import Mathlib.CategoryTheory.Limits.Yoneda /-! @@ -24,6 +26,8 @@ Notation: categories `C`, `I` and functors `D : Iᵒᵖ ⥤ C`, `F : C ⥤ Type` -/ +@[expose] public section + universe u₁ u₂ v₁ v₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Indization/Category.lean b/Mathlib/CategoryTheory/Limits/Indization/Category.lean index be927c9efe41f9..928c85d7ddb61e 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/Category.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/Category.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Constructions.Filtered -import Mathlib.CategoryTheory.Limits.FullSubcategory -import Mathlib.CategoryTheory.Limits.ExactFunctor -import Mathlib.CategoryTheory.Limits.Indization.Equalizers -import Mathlib.CategoryTheory.Limits.Indization.LocallySmall -import Mathlib.CategoryTheory.Limits.Indization.Products -import Mathlib.CategoryTheory.Limits.Preserves.Presheaf +module + +public import Mathlib.CategoryTheory.Limits.Constructions.Filtered +public import Mathlib.CategoryTheory.Limits.FullSubcategory +public import Mathlib.CategoryTheory.Limits.ExactFunctor +public import Mathlib.CategoryTheory.Limits.Indization.Equalizers +public import Mathlib.CategoryTheory.Limits.Indization.LocallySmall +public import Mathlib.CategoryTheory.Limits.Indization.Products +public import Mathlib.CategoryTheory.Limits.Preserves.Presheaf /-! # The category of Ind-objects @@ -53,6 +55,8 @@ Note that: * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Chapter 6 -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Indization/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Indization/Equalizers.lean index 21a6123e725975..06010f834e0a8f 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/Equalizers.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits -import Mathlib.CategoryTheory.Limits.Indization.ParallelPair -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +module + +public import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits +public import Mathlib.CategoryTheory.Limits.Indization.ParallelPair +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape /-! # Equalizers of ind-objects @@ -16,6 +18,8 @@ We show that if a category `C` has equalizers, then ind-objects are closed under * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Section 6.1 -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Indization/FilteredColimits.lean b/Mathlib/CategoryTheory/Limits/Indization/FilteredColimits.lean index 8da0bfb766d0a5..49c5ceb91b8159 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/FilteredColimits.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/FilteredColimits.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Comma.Presheaf.Colimit -import Mathlib.CategoryTheory.Limits.Filtered -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Limits.FunctorToTypes -import Mathlib.CategoryTheory.Limits.Indization.IndObject -import Mathlib.Logic.Small.Set +module + +public import Mathlib.CategoryTheory.Comma.Presheaf.Colimit +public import Mathlib.CategoryTheory.Limits.Filtered +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Limits.FunctorToTypes +public import Mathlib.CategoryTheory.Limits.Indization.IndObject +public import Mathlib.Logic.Small.Set /-! # Ind-objects are closed under filtered colimits @@ -22,6 +24,8 @@ Our proof is a slight variant of the proof given in Kashiwara-Schapira. * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Theorem 6.1.8 -/ +@[expose] public section + universe v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Indization/IndObject.lean b/Mathlib/CategoryTheory/Limits/Indization/IndObject.lean index 874cdbe899c36c..022742fd28396f 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/IndObject.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/IndObject.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FinallySmall -import Mathlib.CategoryTheory.Limits.Presheaf -import Mathlib.CategoryTheory.Filtered.Small -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Presheaf +module + +public import Mathlib.CategoryTheory.Limits.FinallySmall +public import Mathlib.CategoryTheory.Limits.Presheaf +public import Mathlib.CategoryTheory.Filtered.Small +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Presheaf /-! # Ind-objects @@ -40,6 +42,8 @@ The recommended alternative is to consider ind-objects over `ULiftHom.{w} C` ins * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Chapter 6 -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean b/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean index 9f515bafd86479..13a82f705f0a2f 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Limits.IndYoneda -import Mathlib.CategoryTheory.Limits.Indization.IndObject +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Limits.IndYoneda +public import Mathlib.CategoryTheory.Limits.Indization.IndObject /-! # There are only `v`-many natural transformations between Ind-objects @@ -19,6 +21,8 @@ The equivalence established here serves as the basis for a well-known calculatio ind-objects as a limit of a colimit. -/ +@[expose] public section + open CategoryTheory Limits Opposite universe v v₁ v₂ u u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Indization/ParallelPair.lean b/Mathlib/CategoryTheory/Limits/Indization/ParallelPair.lean index b15c661e1e3622..13576ded9485ab 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/ParallelPair.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/ParallelPair.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Comma.Final -import Mathlib.CategoryTheory.Limits.Indization.IndObject +module + +public import Mathlib.CategoryTheory.Comma.Final +public import Mathlib.CategoryTheory.Limits.Indization.IndObject /-! # Parallel pairs of natural transformations between ind-objects @@ -19,6 +21,8 @@ commonly presented by diagrams and natural transformations in `I ⥤ C`. our proof is more direct). -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Indization/Products.lean b/Mathlib/CategoryTheory/Limits/Indization/Products.lean index ba9c97fd879ee3..3c2e7e446dc595 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/Products.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesProduct -import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits +module + +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesProduct +public import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits /-! # Ind-objects are closed under products @@ -17,6 +19,8 @@ creates products indexed by `α` and that the functor `C ⥤ Ind C` preserves th * [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Prop. 6.1.16(ii) -/ +@[expose] public section + universe v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/IsConnected.lean b/Mathlib/CategoryTheory/Limits/IsConnected.lean index c07ba59e9ecb49..52bf9148b78f9b 100644 --- a/Mathlib/CategoryTheory/Limits/IsConnected.lean +++ b/Mathlib/CategoryTheory/Limits/IsConnected.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Paul Reichert. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Reichert -/ -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.HomCongr +module + +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.HomCongr /-! # Colimits of connected index categories @@ -37,6 +39,8 @@ its codomain is connected. unit-valued, singleton, colimit -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/IsLimit.lean b/Mathlib/CategoryTheory/Limits/IsLimit.lean index 56d5ac865bdd87..2991e993011237 100644 --- a/Mathlib/CategoryTheory/Limits/IsLimit.lean +++ b/Mathlib/CategoryTheory/Limits/IsLimit.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Mario Carneiro, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Limits.Cones -import Batteries.Tactic.Congr +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Limits.Cones +public import Batteries.Tactic.Congr /-! # Limits and colimits @@ -31,6 +33,8 @@ e.g. a `@[dualize]` attribute that behaves similarly to `@[to_additive]`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Lattice.lean b/Mathlib/CategoryTheory/Limits/Lattice.lean index 26aa73dca43aed..ff4b356212872c 100644 --- a/Mathlib/CategoryTheory/Limits/Lattice.lean +++ b/Mathlib/CategoryTheory/Limits/Lattice.lean @@ -3,15 +3,19 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Justus Springer -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.Data.Finset.Lattice.Fold /-! # Limits in lattice categories are given by infimums and supremums. -/ +@[expose] public section + universe w w' u diff --git a/Mathlib/CategoryTheory/Limits/MonoCoprod.lean b/Mathlib/CategoryTheory/Limits/MonoCoprod.lean index 21c4232229c1a4..d60ad0c8241ac8 100644 --- a/Mathlib/CategoryTheory/Limits/MonoCoprod.lean +++ b/Mathlib/CategoryTheory/Limits/MonoCoprod.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms /-! @@ -28,6 +30,8 @@ TODO: define distributive categories, and show that they satisfy `MonoCoprod`, s -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/MorphismProperty.lean b/Mathlib/CategoryTheory/Limits/MorphismProperty.lean index 35815858c8a409..22161431176a38 100644 --- a/Mathlib/CategoryTheory/Limits/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/Limits/MorphismProperty.lean @@ -3,18 +3,22 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Comma -import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic -import Mathlib.CategoryTheory.MorphismProperty.Comma -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +module + +public import Mathlib.CategoryTheory.Limits.Comma +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape /-! # (Co)limits in subcategories of comma categories defined by morphism properties -/ +@[expose] public section + namespace CategoryTheory open Limits MorphismProperty.Comma diff --git a/Mathlib/CategoryTheory/Limits/Opposites.lean b/Mathlib/CategoryTheory/Limits/Opposites.lean index ecdf5478059ccb..3364d6e13e2d51 100644 --- a/Mathlib/CategoryTheory/Limits/Opposites.lean +++ b/Mathlib/CategoryTheory/Limits/Opposites.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +module + +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits /-! # Limits in `C` give colimits in `Cᵒᵖ`. @@ -13,6 +15,8 @@ We construct limits and colimits in the opposite categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Over.lean b/Mathlib/CategoryTheory/Limits/Over.lean index fffc525411e685..88e4d72fcdabca 100644 --- a/Mathlib/CategoryTheory/Limits/Over.lean +++ b/Mathlib/CategoryTheory/Limits/Over.lean @@ -3,11 +3,14 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Reid Barton, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Limits.Comma -import Mathlib.CategoryTheory.Limits.ConeCategory -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Limits.Comma +public import Mathlib.CategoryTheory.Limits.ConeCategory +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits /-! # Limits and colimits in the over and under categories @@ -20,6 +23,8 @@ Note that the folder `CategoryTheory.Limits.Shapes.Constructions.Over` further s `Over X` has `J`-indexed products if `C` has `J`-indexed wide pullbacks. -/ +@[expose] public section + noncomputable section @@ -40,6 +45,9 @@ instance hasColimit_of_hasColimit_comp_forget (F : J ⥤ Over X) [i : HasColimit instance [HasColimitsOfShape J C] : HasColimitsOfShape J (Over X) where +instance [HasFiniteColimits C] : HasFiniteColimits (Over X) where + out _ _ _ := inferInstance + instance [HasColimits C] : HasColimits (Over X) := ⟨inferInstance⟩ diff --git a/Mathlib/CategoryTheory/Limits/Pi.lean b/Mathlib/CategoryTheory/Limits/Pi.lean index de6cc54975ede4..b19a6e6dfa1c2b 100644 --- a/Mathlib/CategoryTheory/Limits/Pi.lean +++ b/Mathlib/CategoryTheory/Limits/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Pi.Basic -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.Pi.Basic +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # Limits in the category of indexed families of objects. @@ -16,6 +18,8 @@ Given a functor `F : J ⥤ Π i, C i` into a category of indexed families, `HasLimit F` instance -/ +@[expose] public section + open CategoryTheory @@ -129,7 +133,7 @@ As an example, we can use this to construct particular shapes of limits in a category of indexed families. With the addition of -`import CategoryTheory.Limits.Types.Shapes` +`import CategoryTheory.Limits.Types.Products` we can use: ``` attribute [local instance] hasLimit_of_hasLimit_comp_eval diff --git a/Mathlib/CategoryTheory/Limits/Preorder.lean b/Mathlib/CategoryTheory/Limits/Preorder.lean index 22686761512780..33f75a82656c6b 100644 --- a/Mathlib/CategoryTheory/Limits/Preorder.lean +++ b/Mathlib/CategoryTheory/Limits/Preorder.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Sina Hazratpour. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sina Hazratpour, Joël Riou, Fernando Chu -/ +module -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.Order.Bounds.Defs +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.Order.Bounds.Defs /-! # (Co)limits in a preorder category @@ -17,6 +18,8 @@ We provide basic results about (co)limits in the associated category of a preord -/ +@[expose] public section + universe v u u' open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Limits/Presentation.lean b/Mathlib/CategoryTheory/Limits/Presentation.lean index d792373672e5f9..b3261e5e2c65ca 100644 --- a/Mathlib/CategoryTheory/Limits/Presentation.lean +++ b/Mathlib/CategoryTheory/Limits/Presentation.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Limits.Final /-! # (Co)limit presentations @@ -27,6 +29,8 @@ presentation of a colimit of objects that are equipped with presentations.) - Refactor `TransfiniteCompositionOfShape` so that it extends `ColimitPresentation`. -/ +@[expose] public section + universe s t w v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean b/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean index 816159a4daa240..518f3172485155 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton, Bhavik Mehta, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # Preservation and reflection of (co)limits. @@ -32,6 +34,8 @@ vacuously satisfied when K does not admit a limit, which is consistent with the above definition of "preserves limits". -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean b/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean index 2a737c994cd950..4d260bb90bf3bf 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier, Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Fubini -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Fubini +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preservations of limits for bifunctors @@ -19,6 +21,8 @@ out of this typeclass. -/ +@[expose] public section + namespace CategoryTheory open Category Limits Functor diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean index fda74e9903499c..ff916aa665b18d 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.FinCategory.AsType +module + +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.FinCategory.AsType /-! # Creation of finite limits @@ -15,6 +17,8 @@ This file defines the classes `CreatesFiniteLimits`, `CreatesFiniteColimits`, `CreatesFiniteProducts` and `CreatesFiniteCoproducts`. -/ +@[expose] public section + namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Pullbacks.lean index 3019ac34340b3c..3d77403c377fb7 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Pullbacks.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +module + +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback /-! # Creation of limits and pullbacks @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback We show some lemmas relating creation of (co)limits and pullbacks (resp. pushouts). -/ +@[expose] public section + namespace CategoryTheory.Limits variable {C : Type*} [Category C] {D : Type*} [Category D] diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean b/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean index 8819acce37a281..5dbe5d9344c0f9 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Justus Springer -/ -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Filtered.Basic +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Filtered.Basic /-! # Preservation of filtered colimits and cofiltered limits. @@ -13,6 +15,8 @@ Typically forgetful functors from algebraic categories preserve filtered colimit -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean b/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean index 7c6bfc41fb8f3c..597cde8dd74ed2 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! # Preservation of finite (co)limits. @@ -21,6 +23,8 @@ involved are abelian, or more generally, finitely (co)complete. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Preserves/FunctorCategory.lean b/Mathlib/CategoryTheory/Limits/Preserves/FunctorCategory.lean index d8d6641075c7fd..26b79ebb21f005 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/FunctorCategory.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Limits.Presheaf -import Mathlib.CategoryTheory.Limits.Yoneda +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Limits.Presheaf +public import Mathlib.CategoryTheory.Limits.Yoneda /-! # Preservation of (co)limits in the functor category @@ -28,6 +30,8 @@ https://ncatlab.org/nlab/show/commutativity+of+limits+and+colimits#preservation_ -/ +@[expose] public section + universe w w' v v₁ v₂ v₃ u u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean b/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean index d16e4710af1d5d..a9d83ad702c643 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck /-! # Colimits on Grothendieck constructions preserving limits @@ -13,6 +15,8 @@ We characterize the condition in which colimits on Grothendieck constructions pr preserving limits on the Grothendieck construction's base category as well as on each of its fibers. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Limits.lean b/Mathlib/CategoryTheory/Limits/Preserves/Limits.lean index 8ae1d1c651c205..3f5a55d2c385ab 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Limits.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Limits.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Isomorphisms about functors which preserve (co)limits @@ -17,6 +19,8 @@ The duals of these are also given. For functors which preserve (co)limits of spe `preserves/shapes.lean`. -/ +@[expose] public section + universe w' w v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Opposites.lean b/Mathlib/CategoryTheory/Limits/Preserves/Opposites.lean index c33b931f099c72..1129477a03eebe 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Opposites.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Opposites.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Preserves.Finite +module + +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limit preservation properties of `Functor.op` and related constructions @@ -14,6 +16,8 @@ preserve certain (co)limits and vice versa. -/ +@[expose] public section + universe w w' v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Over.lean b/Mathlib/CategoryTheory/Limits/Preserves/Over.lean index 66dba78a8ed99b..829771958c7ebb 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Over.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Over.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Preserves.Filtered +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Filtered /-! @@ -14,6 +16,8 @@ See `Mathlib/CategoryTheory/Adjunction/Over.lean` -/ +@[expose] public section + namespace CategoryTheory.Limits variable {C : Type*} [Category C] diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Presheaf.lean b/Mathlib/CategoryTheory/Limits/Preserves/Presheaf.lean index 116993172721c0..66897fab472a40 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Presheaf.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Presheaf.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Limits.Elements +module + +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Limits.Elements /-! # Finite-limit-preserving presheaves @@ -39,6 +41,8 @@ is small, we leave this as a TODO. * [F. Borceux, *Handbook of Categorical Algebra 1*][borceux-vol1], Proposition 6.1.2 -/ +@[expose] public section + open CategoryTheory Limits Functor universe v u diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/AbelianImages.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/AbelianImages.lean index 867eb7e0797133..218f270732ada0 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/AbelianImages.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/AbelianImages.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Abelian.Images -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +module + +public import Mathlib.CategoryTheory.Abelian.Images +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels /-! # Preservation of coimage-image comparisons @@ -13,6 +15,8 @@ If a functor preserves kernels and cokernels, then it preserves abelian images, and coimage-image comparisons. -/ +@[expose] public section + noncomputable section universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean index 9ab57eaea3a384..39fddc76555ca7 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preserving binary products @@ -16,6 +18,8 @@ In particular, we show that `ProdComparison G X Y` is an isomorphism iff `G` pre the product of `X` and `Y`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean index fa0f731f12dcba..8eae308ad9619f 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero /-! # Preservation of biproducts @@ -20,6 +22,8 @@ classes `PreservesBiproduct` and `PreservesBinaryBiproduct`. We then -/ +@[expose] public section + universe w₁ w₂ v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean index 3e3b781aeb0d85..2cede1c0a12fae 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer -import Mathlib.CategoryTheory.Limits.Shapes.SplitEqualizer -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer +public import Mathlib.CategoryTheory.Limits.Shapes.SplitEqualizer +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preserving (co)equalizers @@ -17,6 +19,8 @@ In particular, we show that `equalizerComparison f g G` is an isomorphism iff `G the limit of the parallel pair `f,g`, as well as the dual result. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean index 80af135123f835..f242a80a130928 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono /-! # Preserving images @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Limits.Constructions.EpiMono In this file, we show that if a functor preserves span and cospan, then it preserves images. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean index c55036875c9edb..b0c0aa418843ee 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero /-! # Preserving (co)kernels @@ -16,6 +18,8 @@ In particular, we show that `kernel_comparison f g G` is an isomorphism iff `G` the limit of the parallel pair `f,0`, as well as the dual result. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean index 8d125431931def..75cf77c7adb026 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer /-! # Preservation of multicoequalizers @@ -20,6 +22,8 @@ then `c.map F` also is (see `Multicofork.isColimitMapOfPreserves`). -/ +@[expose] public section + universe w w' v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean index 2433639a02566a..01cd3136516539 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yaël Dillies, Moisés Herradón Cueto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Moisés Herradón Cueto -/ -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.WithTerminal.FinCategory -import Mathlib.CategoryTheory.WithTerminal.Cone +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.WithTerminal.FinCategory +public import Mathlib.CategoryTheory.WithTerminal.Cone /-! # If a functor preserves limits, so does the induced functor in the `Over` or `Under` category @@ -18,6 +20,8 @@ As a corollary, if `F` preserves finite limits, or limits of a certain size, so Dually, if `F` preserves certain colimits, `Under.post F` will preserve certain colimits as well. -/ +@[expose] public section + namespace CategoryTheory.Limits universe w w' v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Preorder.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Preorder.lean index bd1ad9480d2414..8226316e6b8979 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Preorder.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Preorder.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.HasIterationOfShape -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.HasIterationOfShape +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preservation of well order continuous functors @@ -18,6 +20,8 @@ for any limit element `j : J`. It follows that if -/ +@[expose] public section + universe w w' v v' v'' u' u u'' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean index 0c165580a43a92..4211f67cdbdc38 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preserving products @@ -16,6 +18,8 @@ In particular, we show that `piComparison G f` is an isomorphism iff `G` preserv the limit of `f`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean index dcece9540b9223..888310ba3b6aff 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Pullbacks -import Mathlib.CategoryTheory.Limits.Yoneda +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Pullbacks +public import Mathlib.CategoryTheory.Limits.Yoneda /-! # Preserving pullbacks @@ -25,6 +27,8 @@ The dual is also given. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean index 3ed3c0339f3a5f..5025ef9cacd651 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Square -import Mathlib.CategoryTheory.Limits.Yoneda -import Mathlib.CategoryTheory.Limits.Preserves.Ulift +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Square +public import Mathlib.CategoryTheory.Limits.Yoneda +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift /-! # Preservations of pullback/pushout squares @@ -23,6 +25,8 @@ functor `yoneda.obj X` for all `X : C`. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean index ffc04af8b2fc4f..e5f61fbbd735ea 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Preserving terminal object @@ -16,6 +18,8 @@ In particular, we show that `terminalComparison G` is an isomorphism iff `G` pre objects. -/ +@[expose] public section + universe w v v₁ v₂ u u₁ u₂ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Zero.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Zero.lean index f3d30af89b0492..117cb01b716f4e 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Zero.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Zero.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms /-! # Preservation of zero objects and zero morphisms @@ -22,6 +24,8 @@ We provide the following results: -/ +@[expose] public section + universe v u v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Ulift.lean b/Mathlib/CategoryTheory/Limits/Preserves/Ulift.lean index f5062587e751dc..34e2c7e0fc3f88 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Ulift.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Ulift.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Junyan Xu, Sophie Morel -/ -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.Data.Set.Subsingleton /-! # `ULift` creates small (co)limits @@ -20,6 +22,8 @@ colimits. -/ +@[expose] public section + universe v w w' u namespace CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Yoneda.lean b/Mathlib/CategoryTheory/Limits/Preserves/Yoneda.lean index bdd576179c4ed1..5c310d41e96281 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Yoneda.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Yoneda.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Limits.FunctorToTypes +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Limits.FunctorToTypes /-! # Yoneda preserves certain colimits @@ -27,6 +29,8 @@ There is also a relative version of this statement where `F : J ⥤ Over A` for -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Presheaf.lean b/Mathlib/CategoryTheory/Limits/Presheaf.lean index 5578329dc9e733..020a8c4ed4ae1a 100644 --- a/Mathlib/CategoryTheory/Limits/Presheaf.lean +++ b/Mathlib/CategoryTheory/Limits/Presheaf.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Joël Riou -/ -import Mathlib.CategoryTheory.Comma.Presheaf.Basic -import Mathlib.CategoryTheory.Elements -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Limits.Over +module + +public import Mathlib.CategoryTheory.Comma.Presheaf.Basic +public import Mathlib.CategoryTheory.Elements +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Limits.Over /-! # Colimit of representables @@ -49,6 +51,8 @@ colimit, representable, presheaf, free cocompletion * https://ncatlab.org/nlab/show/Yoneda+extension -/ +@[expose] public section + namespace CategoryTheory open Category Limits Opposite diff --git a/Mathlib/CategoryTheory/Limits/Set.lean b/Mathlib/CategoryTheory/Limits/Set.lean index 47a1de19155798..6480001bfb1186 100644 --- a/Mathlib/CategoryTheory/Limits/Set.lean +++ b/Mathlib/CategoryTheory/Limits/Set.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Lattice -import Mathlib.CategoryTheory.Limits.Preserves.Basic -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.Types.Set +module + +public import Mathlib.CategoryTheory.Limits.Lattice +public import Mathlib.CategoryTheory.Limits.Preserves.Basic +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Types.Set /-! # The functor from `Set X` to types preserves filtered colimits @@ -16,6 +18,8 @@ which sends `A : Set X` to its underlying type preserves filtered colimits. -/ +@[expose] public section + universe w w' u open CategoryTheory Limits CompleteLattice diff --git a/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean index 28e2d891443781..5ef100f1a7c33c 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Biproducts +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Biproducts /-! # Binary biproducts @@ -27,6 +29,8 @@ cocone. -/ +@[expose] public section + noncomputable section universe w w' v u diff --git a/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean index 82628dd21699bc..a50ed1d209593d 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.EpiMono -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Binary (co)products @@ -28,6 +30,8 @@ braiding and associating isomorphisms, and the product comparison morphism. * [Stacks: coproducts of pairs](https://stacks.math.columbia.edu/tag/04AN) -/ +@[expose] public section + universe v v₁ u u₁ u₂ open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean index 4faea9a216cdc5..12325c600c3f85 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts -import Mathlib.CategoryTheory.Limits.Shapes.Kernels +module + +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! # Biproducts and binary biproducts @@ -37,6 +39,8 @@ and occasional cost we made everything classical. -/ +@[expose] public section + noncomputable section universe w w' v u diff --git a/Mathlib/CategoryTheory/Limits/Shapes/CombinedProducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/CombinedProducts.lean index 4563605f05c242..642073cfb5a837 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/CombinedProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/CombinedProducts.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts /-! # Constructors for combining (co)fans @@ -17,6 +19,8 @@ We provide constructors for combining (co)fans and show their (co)limit properti -/ +@[expose] public section + universe u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean b/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean index bd25a77f354b9f..b7d322c4d0bee5 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Kim Morrison, Adam Topaz -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +module + +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +public import Mathlib.CategoryTheory.Limits.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Types.Coproducts +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.CategoryTheory.Limits.Types.Pullbacks /-! # Limits in concrete categories @@ -31,6 +35,8 @@ wide-pullbacks, wide-pushouts, multiequalizers and cokernels. -/ +@[expose] public section + universe s w w' v u t r namespace CategoryTheory.Limits.Concrete diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Connected.lean b/Mathlib/CategoryTheory/Limits/Shapes/Connected.lean index 48984477077f72..4d88bd544fa4d0 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Connected.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Connected.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.IsConnected -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +module + +public import Mathlib.CategoryTheory.IsConnected +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks /-! @@ -14,6 +16,8 @@ In this file we prove that various shapes are connected. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Countable.lean b/Mathlib/CategoryTheory/Limits/Shapes/Countable.lean index 13ebec531e66a9..0c36c9cebcc945 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Countable.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Countable.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts -import Mathlib.CategoryTheory.Countable -import Mathlib.Data.Countable.Defs +module + +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +public import Mathlib.CategoryTheory.Countable +public import Mathlib.Data.Countable.Defs /-! # Countable limits and colimits @@ -24,6 +26,8 @@ limits, see `sequentialFunctor_initial`. -/ +@[expose] public section + open CategoryTheory Opposite CountableCategory variable (C : Type*) [Category C] (J : Type*) [Countable J] diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Diagonal.lean b/Mathlib/CategoryTheory/Limits/Shapes/Diagonal.lean index 908685f046f838..4e36fa17446c27 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Diagonal.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Diagonal.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Comma.Over.Pullback -import Mathlib.CategoryTheory.Limits.Shapes.KernelPair -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Assoc +module + +public import Mathlib.CategoryTheory.Comma.Over.Pullback +public import Mathlib.CategoryTheory.Limits.Shapes.KernelPair +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Assoc /-! # The diagonal object of a morphism. @@ -16,6 +18,8 @@ of a morphism `f : X ⟶ Y`. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/DisjointCoproduct.lean b/Mathlib/CategoryTheory/Limits/Shapes/DisjointCoproduct.lean index 79d1489719833b..e563f54c59902f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/DisjointCoproduct.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/DisjointCoproduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.CategoryTheory.Limits.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.CategoryTheory.Limits.Shapes.Products /-! # Disjoint coproducts @@ -23,6 +25,8 @@ Shows that a category with disjoint coproducts is `InitialMonoClass`. * Define coherent categories and use this to define positive coherent categories. -/ +@[expose] public section + universe v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/End.lean b/Mathlib/CategoryTheory/Limits/Shapes/End.lean index 87ba84d16b44fe..83a3b7afafb08b 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/End.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/End.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer /-! # Ends and coends @@ -20,6 +22,8 @@ We also introduce `coend F` as multicoequalizers of -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean index c9f2591f18fbb5..0e5e49c7146369 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Markus Himmel -/ -import Mathlib.CategoryTheory.EpiMono -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # Equalizers and coequalizers @@ -43,6 +45,8 @@ general limits can be used. * [F. Borceux, *Handbook of Categorical Algebra 1*][borceux-vol1] -/ +@[expose] public section + section open CategoryTheory Opposite @@ -464,7 +468,7 @@ def Fork.IsLimit.mk (t : Fork f g) (lift : ∀ s : Fork f g, s.pt ⟶ t.pt) { lift fac := fun s j => WalkingParallelPair.casesOn j (fac s) <| by - erw [← s.w left, ← t.w left, ← Category.assoc, fac]; rfl + simp [← Category.assoc, fac] uniq := fun s m j => by aesop} /-- This is another convenient method to verify that a fork is a limit cone. It diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Equivalence.lean b/Mathlib/CategoryTheory/Limits/Shapes/Equivalence.lean index 141f35905ca55b..c4676a278d0d5d 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Equivalence.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Equivalence.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Transporting existence of specific limits across equivalences @@ -13,6 +15,8 @@ For now, we only treat the case of initial and terminal objects, but other speci added in the future. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean b/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean index 6d5038cc2c0bba..17a28b9d38e711 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.FinCategory.AsType -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.Data.Fintype.Option +module + +public import Mathlib.CategoryTheory.FinCategory.AsType +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.Data.Fintype.Option /-! # Categories with finite limits. @@ -16,6 +18,8 @@ import Mathlib.Data.Fintype.Option A typeclass for categories with all finite (co)limits. -/ +@[expose] public section + universe w' w v' u' v u diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean index 6f362de226ad64..b79c8464a5cf2f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean @@ -3,14 +3,19 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.Tactic.DeriveFintype +module + +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.Tactic.DeriveFintype +import Mathlib.Data.Fintype.Sum /-! # Finiteness instances on multi-spans -/ +@[expose] public section + namespace CategoryTheory.Limits namespace WalkingMulticospan diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean index 9ed25f4df97cd1..a29a93b7b8fa82 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Shapes.Products /-! # Categories with finite (co)products @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Limits.Shapes.Products Typeclasses representing categories with (co)products over finite indexing types. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean b/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean index 05b2ed572481f0..e85d19b7960906 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Limits.Types.Colimits +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Types.Colimits /-! # Binary (co)products of type-valued functors @@ -16,6 +18,8 @@ Defines an explicit construction of binary products and coproducts of type-value Also defines isomorphisms to the categorical product and coproduct, respectively. -/ +@[expose] public section + open CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Grothendieck.lean b/Mathlib/CategoryTheory/Limits/Shapes/Grothendieck.lean index 5b95f4a9ed3342..6d24aae97c2f01 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Grothendieck.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.CategoryTheory.Grothendieck -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.Grothendieck +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # (Co)limits on the (strict) Grothendieck Construction @@ -20,6 +22,8 @@ import Mathlib.CategoryTheory.Limits.HasLimits -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean index 4faf8607eb0780..6011fbb1bb6d2e 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono -import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi -import Mathlib.CategoryTheory.MorphismProperty.Factorization +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono +public import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi +public import Mathlib.CategoryTheory.MorphismProperty.Factorization /-! # Categorical images @@ -52,6 +54,8 @@ so that `m` factors through the `m'` in any other such factorisation. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean b/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean index d973ed53dc0c3f..0a4e4e61c2728f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.PEmpty -import Mathlib.CategoryTheory.Limits.IsLimit -import Mathlib.CategoryTheory.EpiMono -import Mathlib.CategoryTheory.Category.Preorder +module + +public import Mathlib.CategoryTheory.PEmpty +public import Mathlib.CategoryTheory.Limits.IsLimit +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.CategoryTheory.Category.Preorder /-! # Initial and terminal objects in a category. @@ -21,6 +23,8 @@ objects are defined in `Terminal.lean`. * [Stacks: Initial and final objects](https://stacks.math.columbia.edu/tag/002B) -/ +@[expose] public section + assert_not_exists CategoryTheory.Limits.HasLimit noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean b/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean index b39cc589d728c0..23d61a8d0a30cf 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono /-! # Kernel pairs @@ -30,6 +32,8 @@ is developed here. -/ +@[expose] public section + universe v u u₂ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean index 38b787f034060f..31492f83becf01 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero /-! # Kernels and cokernels @@ -45,6 +47,8 @@ general limits can be used. * [F. Borceux, *Handbook of Categorical Algebra 2*][borceux-vol2] -/ +@[expose] public section + noncomputable section @@ -682,7 +686,7 @@ def CokernelCofork.isColimitOfIsColimitOfIff {X Y : C} {f : X ⟶ Y} {c : Cokern (fun s hs ↦ by simp) (fun s hs m hm ↦ Cofork.IsColimit.hom_ext hc (by simpa [← cancel_epi e.hom] using hm)) -/-- If `c` is a colimit cokernel cofork for `f : X ⟶ Y`, and `f' : X' ⟶ Y is another +/-- If `c` is a colimit cokernel cofork for `f : X ⟶ Y`, and `f' : X' ⟶ Y` is another morphism, then there is a colimit cokernel cofork for `f'` with the same point as `c` if for any morphism `φ : Y ⟶ W`, there is an equivalence `f ≫ φ = 0 ↔ f' ≫ φ = 0`. -/ def CokernelCofork.isColimitOfIsColimitOfIff' {X Y : C} {f : X ⟶ Y} {c : CokernelCofork f} diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean index 9603cb981d8367..c4cbed4f89f55f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.ConeCategory +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.ConeCategory /-! @@ -26,6 +28,8 @@ Prove that the limit of any diagram is a multiequalizer (and similarly for colim -/ +@[expose] public section + namespace CategoryTheory.Limits @@ -184,6 +188,31 @@ lemma Hom.id_eq_id (X : WalkingMultispan J) : Hom.id X = 𝟙 X := rfl lemma Hom.comp_eq_comp {X Y Z : WalkingMultispan J} (f : X ⟶ Y) (g : Y ⟶ Z) : Hom.comp f g = f ≫ g := rfl +variable (J) in +/-- The bijection `WalkingMultispan J ≃ J.L ⊕ J.R`. -/ +def equiv : WalkingMultispan J ≃ J.L ⊕ J.R where + toFun x := match x with + | left a => Sum.inl a + | right b => Sum.inr b + invFun := Sum.elim left right + left_inv := by rintro (_ | _) <;> rfl + right_inv := by rintro (_ | _) <;> rfl + +variable (J) in +/-- The bijection `Arrow (WalkingMultispan J) ≃ WalkingMultispan J ⊕ J.R ⊕ J.R`. -/ +def arrowEquiv : + Arrow (WalkingMultispan J) ≃ WalkingMultispan J ⊕ J.L ⊕ J.L where + toFun f := match f.hom with + | .id x => Sum.inl x + | .fst a => Sum.inr (Sum.inl a) + | .snd a => Sum.inr (Sum.inr a) + invFun := + Sum.elim (fun X ↦ Arrow.mk (𝟙 X)) + (Sum.elim (fun a ↦ Arrow.mk (Hom.fst a : left _ ⟶ right _)) + (fun a ↦ Arrow.mk (Hom.snd a : left _ ⟶ right _))) + left_inv := by rintro ⟨_, _, (_ | _ | _)⟩ <;> rfl + right_inv := by rintro (_ | _ | _) <;> rfl + end WalkingMultispan /-- This is a structure encapsulating the data necessary to define a `Multicospan`. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/MultiequalizerPullback.lean b/Mathlib/CategoryTheory/Limits/Shapes/MultiequalizerPullback.lean index 5dc3a5ec7dac50..2f358ab52d472d 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/MultiequalizerPullback.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/MultiequalizerPullback.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq /-! # Multicoequalizers that are pushouts @@ -15,6 +17,8 @@ a pushout when `ι` has exactly two elements. -/ +@[expose] public section + namespace CategoryTheory.Limits.Multicofork.IsColimit variable {C : Type*} [Category C] {J : MultispanShape} [Unique J.L] diff --git a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean index 23d9b37aa008ed..98189188f51dd0 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Definitions and basic properties of normal monomorphisms and epimorphisms. @@ -23,6 +25,8 @@ every monomorphism or epimorphism is normal, and deduce that these categories ar -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Equalizers.lean index 7f6ae92651e3c0..4601d722945e6d 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Equalizers.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Basic -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.CategoryTheory.Limits.Shapes.NormalMono.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! # Normal mono categories with finite products and kernels have all equalizers. @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts This, and the dual result, are used in the development of abelian categories. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean index 18c7c555db37de..06205ef4ed66d0 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Pullbacks +module + +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Pullbacks /-! # Equalizers and coequalizers in `C` and `Cᵒᵖ` @@ -14,6 +16,8 @@ We construct equalizers and coequalizers in the opposite categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Filtered.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Filtered.lean index d2cdc837ce9647..dee91773b5bb8e 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Filtered.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Filtered +module + +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Filtered /-! # Filered colimits and cofilered limits in `C` and `Cᵒᵖ` @@ -13,6 +15,8 @@ We construct filered colimits and cofilered limits in the opposite categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Kernels.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Kernels.lean index d9843c85cc5cfa..caa58e523e4089 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Kernels.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.Shapes.Kernels +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels /-! # Kernels and cokernels in `C` and `Cᵒᵖ` @@ -12,6 +14,8 @@ We construct kernels and cokernels in the opposite categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean index a889208810ad7e..3775561dc1b517 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! # Products and coproducts in `C` and `Cᵒᵖ` @@ -13,6 +15,8 @@ We construct products and coproducts in the opposite categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean index cebeb69c6b37fd..839e2e9f57f7e7 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Limits.Opposites -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +module + +public import Mathlib.CategoryTheory.Limits.Opposites +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback /-! # Pullbacks and pushouts in `C` and `Cᵒᵖ` @@ -13,6 +15,8 @@ We construct pullbacks and pushouts in the opposite categories. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/PiProd.lean b/Mathlib/CategoryTheory/Limits/Shapes/PiProd.lean index 29b8803b951b7e..9f66f88d93bbb3 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/PiProd.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/PiProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Products +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Products /-! # A product as a binary product @@ -14,6 +16,8 @@ and its complement. -/ +@[expose] public section + namespace CategoryTheory.Limits variable {C I : Type*} [Category C] {X Y : I → C} diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Basic.lean b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Basic.lean index 759be56f3e234e..d73db48fecabf1 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Preorder +module + +public import Mathlib.CategoryTheory.Limits.Preorder /-! # Limits and colimits indexed by preorders @@ -15,6 +17,8 @@ about limits and colimits indexed by a preordered type `J`: -/ +@[expose] public section + universe v v' u u' w open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Fin.lean b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Fin.lean index 6acfad730d22f7..f6ce83b452aac5 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Fin.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/Fin.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal -import Mathlib.Order.Fin.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +public import Mathlib.Order.Fin.Basic /-! # Limits and colimits indexed by `Fin` @@ -17,6 +19,8 @@ in the file `Limits.Shapes.IsTerminal`. -/ +@[expose] public section + universe v v' u u' w open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/HasIterationOfShape.lean b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/HasIterationOfShape.lean index 450ac8a08f5935..02cddc875d0f95 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/HasIterationOfShape.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/HasIterationOfShape.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Comma -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.Basic -import Mathlib.Order.SuccPred.Limit -import Mathlib.Order.Interval.Set.InitialSeg +module + +public import Mathlib.CategoryTheory.Limits.Comma +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.Basic +public import Mathlib.Order.SuccPred.Limit +public import Mathlib.Order.Interval.Set.InitialSeg /-! # An assumption for constructions by transfinite induction @@ -18,6 +20,8 @@ a well-ordered type `J` in a category `C` (see `CategoryTheory.SmallObject`). -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean index 7e11189dcddf13..011b87d43205f2 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.InitialSeg -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Limits.Cones +module + +public import Mathlib.Order.InitialSeg +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Limits.Cones /-! # Cocones associated to principal segments @@ -16,6 +18,8 @@ the point of which is `F.obj f.top`. -/ +@[expose] public section + open CategoryTheory Category Limits /-- When `f : α IsRegularMono f + +@[simp] +theorem MorphismProperty.regularMono_iff (f : X ⟶ Y) : + (MorphismProperty.regularMono C) f ↔ IsRegularMono f := + Iff.rfl + +instance MorphismProperty.regularMono.containsIdentities : + (MorphismProperty.regularMono C).ContainsIdentities where + id_mem _ := ⟨RegularMono.ofIso <| Iso.refl _⟩ + +instance MorphismProperty.regularMono.respectsIso : + (MorphismProperty.regularMono C).RespectsIso := + RespectsIso.of_respects_arrow_iso _ (fun _ _ e h ↦ ⟨.ofArrowIso e (h := h.some)⟩) + +instance isRegularMono_of_regularMono (f : X ⟶ Y) [h : RegularMono f] : IsRegularMono f := ⟨h⟩ + +/-- Given `IsRegularMono f`, a choice of data for `RegularMono f`. -/ +def regularMonoOfIsRegularMono (f : X ⟶ Y) [h : IsRegularMono f] : + RegularMono f := + h.some + instance equalizerRegular (g h : X ⟶ Y) [HasLimit (parallelPair g h)] : RegularMono (equalizer.ι g h) where Z := Y @@ -109,8 +169,8 @@ def regularOfIsPullbackSndOfRegular {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h have z : m ≫ g = p ≫ g := w.trans hp₂.symm apply t.hom_ext apply (PullbackCone.mk f g comm).equalizer_ext - · erw [← cancel_mono h, Category.assoc, Category.assoc, comm] - simp only [← Category.assoc, eq_whisker z] + · simp only [PullbackCone.mk_π_app, ← cancel_mono h] + grind [Fork.ι_ofι] · exact z /-- The first leg of a pullback cone is a regular monomorphism if the left component is too. @@ -145,20 +205,20 @@ variable (C) /-- A regular mono category is a category in which every monomorphism is regular. -/ class IsRegularMonoCategory : Prop where /-- Every monomorphism is a regular monomorphism -/ - regularMonoOfMono : ∀ {X Y : C} (f : X ⟶ Y) [Mono f], Nonempty (RegularMono f) + regularMonoOfMono : ∀ {X Y : C} (f : X ⟶ Y) [Mono f], IsRegularMono f end /-- In a category in which every monomorphism is regular, we can express every monomorphism as an equalizer. This is not an instance because it would create an instance loop. -/ def regularMonoOfMono [IsRegularMonoCategory C] (f : X ⟶ Y) [Mono f] : RegularMono f := - (IsRegularMonoCategory.regularMonoOfMono _).some + regularMonoOfIsRegularMono f (h := IsRegularMonoCategory.regularMonoOfMono f) instance (priority := 100) regularMonoCategoryOfSplitMonoCategory [SplitMonoCategory C] : IsRegularMonoCategory C where - regularMonoOfMono f _ := ⟨by + regularMonoOfMono f _ := by haveI := isSplitMono_of_mono f - infer_instance⟩ + infer_instance instance (priority := 100) strongMonoCategory_of_regularMonoCategory [IsRegularMonoCategory C] : StrongMonoCategory C where @@ -183,6 +243,54 @@ attribute [reassoc] RegularEpi.w instance (priority := 100) RegularEpi.epi (f : X ⟶ Y) [RegularEpi f] : Epi f := epi_of_isColimit_cofork RegularEpi.isColimit +/-- Every isomorphism is a regular epimorphism. -/ +def RegularEpi.ofIso (e : X ≅ Y) : RegularEpi e.hom where + W := X + left := 𝟙 X + right := 𝟙 X + isColimit := Cofork.IsColimit.mk _ (fun s ↦ e.inv ≫ s.π) (by simp) fun s m w ↦ by + simp [← w] + +/-- Regular epimorphisms are preserved by isomorphisms in the arrow category. -/ +def RegularEpi.ofArrowIso {X'} {Y'} {f : X ⟶ Y} {g : X' ⟶ Y'} + (e : Arrow.mk f ≅ Arrow.mk g) [h : RegularEpi f] : + RegularEpi g where + W := h.W + left := h.left ≫ e.hom.left + right := h.right ≫ e.hom.left + w := by + simp only [Category.assoc, Arrow.w_mk_right, Arrow.mk_hom] + rw [reassoc_of% h.w] + isColimit := Cofork.isColimitOfIsos _ h.isColimit _ + (Iso.refl _) (Arrow.leftFunc.mapIso e) (Arrow.rightFunc.mapIso e) + +/-- `IsRegularEpi f` is the assertion that `f` is a regular epimorphism. -/ +abbrev IsRegularEpi {X Y : C} (f : X ⟶ Y) : Prop := Nonempty (RegularEpi f) + +variable (C) in +/-- The `MorphismProperty C` satisfied by regular epimorphisms in `C`. -/ +def MorphismProperty.regularEpi : MorphismProperty C := fun _ _ f => IsRegularEpi f + +@[simp] +theorem MorphismProperty.regularEpi_iff (f : X ⟶ Y) : + (MorphismProperty.regularEpi C) f ↔ IsRegularEpi f := + Iff.rfl + +instance MorphismProperty.regularEpi.containsIdentities : + (MorphismProperty.regularEpi C).ContainsIdentities where + id_mem _ := ⟨RegularEpi.ofIso <| Iso.refl _⟩ + +instance MorphismProperty.regularEpi.respectsIso : + (MorphismProperty.regularEpi C).RespectsIso := + RespectsIso.of_respects_arrow_iso _ (fun _ _ e h ↦ ⟨.ofArrowIso e (h := h.some)⟩) + +instance isRegularEpi_of_regularEpi (f : X ⟶ Y) [h : RegularEpi f] : IsRegularEpi f := ⟨h⟩ + +/-- Given `IsRegularEpi f`, a choice of data for `RegularEpi f`. -/ +def regularEpiOfIsRegularEpi (f : X ⟶ Y) [h : IsRegularEpi f] : + RegularEpi f := + h.some + instance coequalizerRegular (g h : X ⟶ Y) [HasColimit (parallelPair g h)] : RegularEpi (coequalizer.π g h) where W := X @@ -281,20 +389,20 @@ variable (C) /-- A regular epi category is a category in which every epimorphism is regular. -/ class IsRegularEpiCategory : Prop where /-- Everyone epimorphism is a regular epimorphism -/ - regularEpiOfEpi : ∀ {X Y : C} (f : X ⟶ Y) [Epi f], Nonempty (RegularEpi f) + regularEpiOfEpi : ∀ {X Y : C} (f : X ⟶ Y) [Epi f], IsRegularEpi f end /-- In a category in which every epimorphism is regular, we can express every epimorphism as a coequalizer. This is not an instance because it would create an instance loop. -/ def regularEpiOfEpi [IsRegularEpiCategory C] (f : X ⟶ Y) [Epi f] : RegularEpi f := - (IsRegularEpiCategory.regularEpiOfEpi _).some + regularEpiOfIsRegularEpi f (h := IsRegularEpiCategory.regularEpiOfEpi f) instance (priority := 100) regularEpiCategoryOfSplitEpiCategory [SplitEpiCategory C] : IsRegularEpiCategory C where - regularEpiOfEpi f _ := ⟨by + regularEpiOfEpi f _ := by haveI := isSplitEpi_of_epi f - infer_instance⟩ + infer_instance instance (priority := 100) strongEpiCategory_of_regularEpiCategory [IsRegularEpiCategory C] : StrongEpiCategory C where diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean b/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean index b14afccd199356..d42841fcbc226b 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Functor.OfSequence -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.CategoryTheory.Limits.Shapes.Countable -import Mathlib.CategoryTheory.Limits.Shapes.PiProd -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.CategoryTheory.Functor.OfSequence +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.CategoryTheory.Limits.Shapes.Countable +public import Mathlib.CategoryTheory.Limits.Shapes.PiProd +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.Order.Interval.Finset.Nat /-! # ℕ-indexed products as sequential limits @@ -24,6 +26,8 @@ Further, we prove that the transition maps in this tower are epimorphisms, in th `f n` is an epimorphism and `C` has finite biproducts. -/ +@[expose] public section + namespace CategoryTheory.Limits.SequentialProduct variable {C : Type*} {M N : ℕ → C} diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean b/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean index 681a148325ded9..c31f64b5004514 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.SingleObj -import Mathlib.Data.Setoid.Basic -import Mathlib.GroupTheory.GroupAction.Defs +module + +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.SingleObj +public import Mathlib.Data.Setoid.Basic +public import Mathlib.GroupTheory.GroupAction.Defs /-! # (Co)limits of functors out of `SingleObj M` @@ -24,6 +26,8 @@ We characterise (co)limits of shape `SingleObj M`. Currently only in the categor -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u v diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean index 1bbb53d9a46e91..569c4781e6b28c 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers /-! # Split coequalizers @@ -27,6 +29,8 @@ to keep them in sync. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean index 98f729de88c7fd..d09cac69bd9331 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers /-! # Split Equalizers @@ -27,6 +29,8 @@ to keep them in sync. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean b/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean index db4b578e3fdfa5..5a02a7bea1143f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts /-! # Strict initial objects @@ -36,6 +38,8 @@ The dual notion (strict terminal objects) occurs much less frequently in practic * https://ncatlab.org/nlab/show/strict+initial+object -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Limits/Shapes/StrongEpi.lean b/Mathlib/CategoryTheory/Limits/Shapes/StrongEpi.lean index e5f5d8bc1363bd..d3a245156019b1 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/StrongEpi.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/StrongEpi.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Balanced -import Mathlib.CategoryTheory.LiftingProperties.Basic +module + +public import Mathlib.CategoryTheory.Balanced +public import Mathlib.CategoryTheory.LiftingProperties.Basic /-! # Strong epimorphisms @@ -33,6 +35,8 @@ Show that the dual of a strong epimorphism is a strong monomorphism, and vice ve * [F. Borceux, *Handbook of Categorical Algebra 1*][borceux-vol1] -/ +@[expose] public section + universe v u @@ -86,14 +90,14 @@ section variable {R : C} (f : P ⟶ Q) (g : Q ⟶ R) /-- The composition of two strong epimorphisms is a strong epimorphism. -/ -theorem strongEpi_comp [StrongEpi f] [StrongEpi g] : StrongEpi (f ≫ g) := +instance strongEpi_comp [StrongEpi f] [StrongEpi g] : StrongEpi (f ≫ g) := { epi := epi_comp _ _ llp := by intros infer_instance } /-- The composition of two strong monomorphisms is a strong monomorphism. -/ -theorem strongMono_comp [StrongMono f] [StrongMono g] : StrongMono (f ≫ g) := +instance strongMono_comp [StrongMono f] [StrongMono g] : StrongMono (f ≫ g) := { mono := mono_comp _ _ rlp := by intros diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean b/Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean index 2aa949bc9f5c05..4681a467b14798 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # Initial and terminal objects in a category. @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.Limits.HasLimits * [Stacks: Initial and final objects](https://stacks.math.columbia.edu/tag/002B) -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean index 5047310075331d..7d96b42ca3ba11 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +module + +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers /-! # Wide equalizers and wide coequalizers @@ -41,6 +43,8 @@ general limits can be used. * [F. Borceux, *Handbook of Categorical Algebra 1*][borceux-vol1] -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean b/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean index 14452b4a76957d..2dd591264d3c1b 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Thin +module + +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Thin /-! # Wide pullbacks @@ -24,6 +26,8 @@ Typeclasses `HasWidePullbacks` and `HasFiniteWidePullbacks` assert the existence pullbacks and finite wide pullbacks. -/ +@[expose] public section + universe w w' v u open CategoryTheory CategoryTheory.Limits Opposite diff --git a/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean b/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean index 4d949e3691581f..c31cbba938c329 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.IsomorphismClasses -import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects +module + +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.IsomorphismClasses +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects /-! # Zero morphisms and zero objects @@ -25,6 +27,8 @@ zero object provides zero morphisms, as the unique morphisms factoring through t * [F. Borceux, *Handbook of Categorical Algebra 2*][borceux-vol2] -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Shapes/ZeroObjects.lean b/Mathlib/CategoryTheory/Limits/Shapes/ZeroObjects.lean index ea819c3e8e74b2..58b24c6ea0abee 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/ZeroObjects.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/ZeroObjects.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin -/ -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # Zero objects @@ -17,6 +19,8 @@ see `CategoryTheory.Limits.Shapes.ZeroMorphisms`. * [F. Borceux, *Handbook of Categorical Algebra 2*][borceux-vol2] -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Limits/Sifted.lean b/Mathlib/CategoryTheory/Limits/Sifted.lean index 12abab0e78f5bc..aed71c795ea010 100644 --- a/Mathlib/CategoryTheory/Limits/Sifted.lean +++ b/Mathlib/CategoryTheory/Limits/Sifted.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic -import Mathlib.CategoryTheory.Closed.Types -import Mathlib.CategoryTheory.Monoidal.Limits.Preserves -import Mathlib.CategoryTheory.Limits.Preserves.Bifunctor -import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory -import Mathlib.CategoryTheory.Limits.IsConnected +module + +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic +public import Mathlib.CategoryTheory.Closed.Types +public import Mathlib.CategoryTheory.Monoidal.Limits.Preserves +public import Mathlib.CategoryTheory.Limits.Preserves.Bifunctor +public import Mathlib.CategoryTheory.Limits.Preserves.FunctorCategory +public import Mathlib.CategoryTheory.Limits.IsConnected /-! # Sifted categories @@ -32,6 +34,8 @@ preserves finite products. We achieve this characterization in this file. - [*Algebraic Theories*, Chapter 2.][Adamek_Rosicky_Vitale_2010] -/ +@[expose] public section + universe w v v₁ v₂ u u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Skeleton.lean b/Mathlib/CategoryTheory/Limits/Skeleton.lean index 14fa185b160277..77f000966a0913 100644 --- a/Mathlib/CategoryTheory/Limits/Skeleton.lean +++ b/Mathlib/CategoryTheory/Limits/Skeleton.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Fernando Chu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fernando Chu -/ -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Skeletal +module + +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Skeletal /-! # (Co)limits of the skeleton of a category @@ -19,6 +21,8 @@ If this is something we really want, we should consider changing the category in `ThinSkeleton C`. -/ +@[expose] public section + noncomputable section open CategoryTheory ThinSkeleton diff --git a/Mathlib/CategoryTheory/Limits/SmallComplete.lean b/Mathlib/CategoryTheory/Limits/SmallComplete.lean index 75d9b71ea91d59..aa20fbe7eb38ac 100644 --- a/Mathlib/CategoryTheory/Limits/SmallComplete.lean +++ b/Mathlib/CategoryTheory/Limits/SmallComplete.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.SetTheory.Cardinal.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.SetTheory.Cardinal.Basic /-! # Any small complete category is a preorder @@ -24,6 +26,8 @@ we instead show that the homsets are subsingleton. small complete, preorder, Freyd -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Types/Coequalizers.lean b/Mathlib/CategoryTheory/Limits/Types/Coequalizers.lean new file mode 100644 index 00000000000000..654c2ab21d57b8 --- /dev/null +++ b/Mathlib/CategoryTheory/Limits/Types/Coequalizers.lean @@ -0,0 +1,83 @@ +/- +Copyright (c) 2020 Kim Morrison. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Kim Morrison +-/ +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.Logic.Function.Coequalizer +public import Mathlib.Tactic.CategoryTheory.Elementwise + +/-! +# Coequalizers in Type + +The coequalizer of a pair of maps `(f, g)` from `X` to `Y` +is the quotient of `Y` by `∀ x : Y, f x ~ g x` + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory Limits + +namespace CategoryTheory.Limits.Types + +variable {X Y Z : Type u} (f g : X ⟶ Y) + +/-- Show that the quotient by the relation generated by `f(x) ~ g(x)` +is a coequalizer for the pair `(f, g)`. +-/ +def coequalizerColimit : Limits.ColimitCocone (parallelPair f g) where + cocone := + Cofork.ofπ (Function.Coequalizer.mk f g) (funext fun x => Function.Coequalizer.condition f g x) + isColimit := + Cofork.IsColimit.mk _ + (fun s ↦ Function.Coequalizer.desc f g s.π s.condition) + (fun _ ↦ rfl) + (fun _ _ hm ↦ funext (fun x ↦ Quot.inductionOn x (congr_fun hm))) + +/-- If `π : Y ⟶ Z` is an coequalizer for `(f, g)`, and `U ⊆ Y` such that `f ⁻¹' U = g ⁻¹' U`, +then `π ⁻¹' (π '' U) = U`. +-/ +theorem coequalizer_preimage_image_eq_of_preimage_eq (π : Y ⟶ Z) (e : f ≫ π = g ≫ π) + (h : IsColimit (Cofork.ofπ π e)) (U : Set Y) (H : f ⁻¹' U = g ⁻¹' U) : π ⁻¹' (π '' U) = U := by + have lem : ∀ x y, Function.Coequalizer.Rel f g x y → (x ∈ U ↔ y ∈ U) := by + rintro _ _ ⟨x⟩ + change x ∈ f ⁻¹' U ↔ x ∈ g ⁻¹' U + rw [H] + have eqv : _root_.Equivalence fun x y => x ∈ U ↔ y ∈ U := by + aesop (add safe constructors _root_.Equivalence) + ext + constructor + · rw [← + show _ = π from + h.comp_coconePointUniqueUpToIso_inv (coequalizerColimit f g).2 + WalkingParallelPair.one] + rintro ⟨y, hy, e'⟩ + dsimp at e' + replace e' := + (mono_iff_injective + (h.coconePointUniqueUpToIso (coequalizerColimit f g).isColimit).inv).mp + inferInstance e' + exact (eqv.eqvGen_iff.mp (Relation.EqvGen.mono lem (Quot.eqvGen_exact e'))).mp hy + · exact fun hx => ⟨_, hx, rfl⟩ + +/-- The categorical coequalizer in `Type u` is the quotient by `f g ~ g x`. -/ +noncomputable def coequalizerIso : coequalizer f g ≅ Function.Coequalizer f g := + colimit.isoColimitCocone (coequalizerColimit f g) + +@[elementwise (attr := simp)] +theorem coequalizerIso_π_comp_hom : + coequalizer.π f g ≫ (coequalizerIso f g).hom = Function.Coequalizer.mk f g := + colimit.isoColimitCocone_ι_hom (coequalizerColimit f g) WalkingParallelPair.one + +@[elementwise (attr := simp)] +theorem coequalizerIso_quot_comp_inv : + ↾Function.Coequalizer.mk f g ≫ (coequalizerIso f g).inv = coequalizer.π f g := + rfl + +end CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/ColimitType.lean b/Mathlib/CategoryTheory/Limits/Types/ColimitType.lean index 396394076ba8da..181c15ed4176f4 100644 --- a/Mathlib/CategoryTheory/Limits/Types/ColimitType.lean +++ b/Mathlib/CategoryTheory/Limits/Types/ColimitType.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.Basic -import Mathlib.CategoryTheory.Types.Basic +module + +public import Mathlib.CategoryTheory.Functor.Basic +public import Mathlib.CategoryTheory.Types.Basic /-! # The colimit type of a functor to types @@ -32,6 +34,8 @@ in a categorical sense is a colimit. -/ +@[expose] public section + universe w₃ w₂ w₁ w₀ w₀' v u assert_not_exists CategoryTheory.Limits.Cocone diff --git a/Mathlib/CategoryTheory/Limits/Types/ColimitTypeFiltered.lean b/Mathlib/CategoryTheory/Limits/Types/ColimitTypeFiltered.lean index f6dfe1d8d96f3a..3a204b013c1d61 100644 --- a/Mathlib/CategoryTheory/Limits/Types/ColimitTypeFiltered.lean +++ b/Mathlib/CategoryTheory/Limits/Types/ColimitTypeFiltered.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Limits.Types.ColimitType +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Limits.Types.ColimitType /-! # Filtered colimits of types @@ -20,6 +22,8 @@ important step when proving `c.IsColimit`. -/ +@[expose] public section + universe w₁ w₀ v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Types/Colimits.lean b/Mathlib/CategoryTheory/Limits/Types/Colimits.lean index ae3c4fa255cb93..74fb1af7517e6f 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Colimits.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Colimits.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton, Joël Riou -/ -import Mathlib.Logic.UnivLE -import Mathlib.CategoryTheory.Limits.HasLimits -import Mathlib.CategoryTheory.Limits.Types.ColimitType +module + +public import Mathlib.Logic.UnivLE +public import Mathlib.CategoryTheory.Limits.HasLimits +public import Mathlib.CategoryTheory.Limits.Types.ColimitType /-! # Colimits in the category of types @@ -14,6 +16,8 @@ We show that the category of types has all colimits, by providing the usual conc -/ +@[expose] public section + universe u' v u w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Types/Coproducts.lean b/Mathlib/CategoryTheory/Limits/Types/Coproducts.lean new file mode 100644 index 00000000000000..b1fdcc951ad92b --- /dev/null +++ b/Mathlib/CategoryTheory/Limits/Types/Coproducts.lean @@ -0,0 +1,190 @@ +/- +Copyright (c) 2020 Kim Morrison. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Kim Morrison +-/ +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.Tactic.CategoryTheory.Elementwise + +/-! +# Coproducts in `Type` + +If `F : J → Type max v u` (with `J : Type v`), we show that the coproduct +of `F` exists in `Type max v u` and identifies to the sigma type `Σ j, F j`. +Similarly, the binary coproduct of two types `X` and `Y` identifies to +`X ⊕ Y`, and the initial object of `Type u` if `PEmpty`. + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory Limits + +namespace CategoryTheory.Limits.Types + +/-- The category of types has `PEmpty` as an initial object. -/ +def initialColimitCocone : Limits.ColimitCocone (Functor.empty (Type u)) where + -- Porting note: tidy was able to fill the structure automatically + cocone := + { pt := PEmpty + ι := (Functor.uniqueFromEmpty _).inv } + isColimit := + { desc := fun _ => by rintro ⟨⟩ + fac := fun _ => by rintro ⟨⟨⟩⟩ + uniq := fun _ _ _ => by funext x; cases x } + +/-- The initial object in `Type u` is `PEmpty`. -/ +noncomputable def initialIso : ⊥_ Type u ≅ PEmpty := + colimit.isoColimitCocone initialColimitCocone.{u, 0} + +/-- The initial object in `Type u` is `PEmpty`. -/ +noncomputable def isInitialPunit : IsInitial (PEmpty : Type u) := + initialIsInitial.ofIso initialIso + +/-- An object in `Type u` is initial if and only if it is empty. -/ +lemma initial_iff_empty (X : Type u) : Nonempty (IsInitial X) ↔ IsEmpty X := by + constructor + · intro ⟨h⟩ + exact Function.isEmpty (IsInitial.to h PEmpty) + · intro h + exact ⟨IsInitial.ofIso Types.isInitialPunit <| Equiv.toIso <| Equiv.equivOfIsEmpty PEmpty X⟩ + + +/-- The sum type `X ⊕ Y` forms a cocone for the binary coproduct of `X` and `Y`. -/ +@[simps!] +def binaryCoproductCocone (X Y : Type u) : Cocone (pair X Y) := + BinaryCofan.mk Sum.inl Sum.inr + +open CategoryTheory.Limits.WalkingPair + +/-- The sum type `X ⊕ Y` is a binary coproduct for `X` and `Y`. -/ +@[simps] +def binaryCoproductColimit (X Y : Type u) : IsColimit (binaryCoproductCocone X Y) where + desc := fun s : BinaryCofan X Y => Sum.elim s.inl s.inr + fac _ j := Discrete.recOn j fun j => WalkingPair.casesOn j rfl rfl + uniq _ _ w := funext fun x => Sum.casesOn x (congr_fun (w ⟨left⟩)) (congr_fun (w ⟨right⟩)) + +/-- The category of types has `X ⊕ Y`, +as the binary coproduct of `X` and `Y`. +-/ +def binaryCoproductColimitCocone (X Y : Type u) : Limits.ColimitCocone (pair X Y) := + ⟨_, binaryCoproductColimit X Y⟩ + +/-- The categorical binary coproduct in `Type u` is the sum `X ⊕ Y`. -/ +noncomputable def binaryCoproductIso (X Y : Type u) : Limits.coprod X Y ≅ X ⊕ Y := + colimit.isoColimitCocone (binaryCoproductColimitCocone X Y) + +--open CategoryTheory.Type + +@[elementwise (attr := simp)] +theorem binaryCoproductIso_inl_comp_hom (X Y : Type u) : + Limits.coprod.inl ≫ (binaryCoproductIso X Y).hom = Sum.inl := + colimit.isoColimitCocone_ι_hom (binaryCoproductColimitCocone X Y) ⟨WalkingPair.left⟩ + +@[elementwise (attr := simp)] +theorem binaryCoproductIso_inr_comp_hom (X Y : Type u) : + Limits.coprod.inr ≫ (binaryCoproductIso X Y).hom = Sum.inr := + colimit.isoColimitCocone_ι_hom (binaryCoproductColimitCocone X Y) ⟨WalkingPair.right⟩ + +@[elementwise (attr := simp)] +theorem binaryCoproductIso_inl_comp_inv (X Y : Type u) : + ↾(Sum.inl : X ⟶ X ⊕ Y) ≫ (binaryCoproductIso X Y).inv = Limits.coprod.inl := + colimit.isoColimitCocone_ι_inv (binaryCoproductColimitCocone X Y) ⟨WalkingPair.left⟩ + +@[elementwise (attr := simp)] +theorem binaryCoproductIso_inr_comp_inv (X Y : Type u) : + ↾(Sum.inr : Y ⟶ X ⊕ Y) ≫ (binaryCoproductIso X Y).inv = Limits.coprod.inr := + colimit.isoColimitCocone_ι_inv (binaryCoproductColimitCocone X Y) ⟨WalkingPair.right⟩ + +open Function (Injective) + +theorem binaryCofan_isColimit_iff {X Y : Type u} (c : BinaryCofan X Y) : + Nonempty (IsColimit c) ↔ + Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by + classical + constructor + · rintro ⟨h⟩ + rw [← show _ = c.inl from + h.comp_coconePointUniqueUpToIso_inv (binaryCoproductColimit X Y) ⟨WalkingPair.left⟩, + ← show _ = c.inr from + h.comp_coconePointUniqueUpToIso_inv (binaryCoproductColimit X Y) ⟨WalkingPair.right⟩] + dsimp [binaryCoproductCocone] + refine + ⟨(h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.injective.comp + Sum.inl_injective, + (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.injective.comp + Sum.inr_injective, ?_⟩ + rw [types_comp, Set.range_comp, ← eq_compl_iff_isCompl, types_comp, Set.range_comp _ Sum.inr] + erw [← Set.image_compl_eq + (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.bijective] + simp + · rintro ⟨h₁, h₂, h₃⟩ + have : ∀ x, x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr := by + rw [eq_compl_iff_isCompl.mpr h₃.symm] + exact fun _ => or_not + refine ⟨BinaryCofan.IsColimit.mk _ ?_ ?_ ?_ ?_⟩ + · intro T f g x + exact + if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective _ h₁).symm ⟨x, h⟩) + else g ((Equiv.ofInjective _ h₂).symm ⟨x, (this x).resolve_left h⟩) + · intro T f g + funext x + simp [h₁.eq_iff] + · intro T f g + funext x + dsimp + simp only [Set.mem_range, Equiv.ofInjective_symm_apply, + dite_eq_right_iff, forall_exists_index] + intro y e + have : c.inr x ∈ Set.range c.inl ⊓ Set.range c.inr := ⟨⟨_, e⟩, ⟨_, rfl⟩⟩ + rw [disjoint_iff.mp h₃.1] at this + exact this.elim + · rintro T _ _ m rfl rfl + funext x + dsimp + split_ifs <;> exact congr_arg _ (Equiv.apply_ofInjective_symm _ ⟨_, _⟩).symm + +/-- Any monomorphism in `Type` is a coproduct injection. -/ +noncomputable def isCoprodOfMono {X Y : Type u} (f : X ⟶ Y) [Mono f] : + IsColimit (BinaryCofan.mk f (Subtype.val : ↑(Set.range f)ᶜ → Y)) := by + apply Nonempty.some + rw [binaryCofan_isColimit_iff] + refine ⟨(mono_iff_injective f).mp inferInstance, Subtype.val_injective, ?_⟩ + symm + rw [← eq_compl_iff_isCompl] + exact Subtype.range_val + +/-- The category of types has `Σ j, f j` as the coproduct of a type family `f : J → Type`. +-/ +def coproductColimitCocone {J : Type v} (F : J → Type max v u) : + Limits.ColimitCocone (Discrete.functor F) where + cocone := + { pt := Σ j, F j + ι := Discrete.natTrans (fun ⟨j⟩ x => ⟨j, x⟩)} + isColimit := + { desc := fun s x => s.ι.app ⟨x.1⟩ x.2 + uniq := fun s m w => by + funext ⟨j, x⟩ + exact congr_fun (w ⟨j⟩) x } + +/-- The categorical coproduct in `Type u` is the type-theoretic coproduct `Σ j, F j`. -/ +noncomputable def coproductIso {J : Type v} (F : J → Type max v u) : ∐ F ≅ Σ j, F j := + colimit.isoColimitCocone (coproductColimitCocone F) + +@[elementwise (attr := simp)] +theorem coproductIso_ι_comp_hom {J : Type v} (F : J → Type max v u) (j : J) : + Sigma.ι F j ≫ (coproductIso F).hom = fun x : F j => (⟨j, x⟩ : Σ j, F j) := + colimit.isoColimitCocone_ι_hom (coproductColimitCocone F) ⟨j⟩ + +@[elementwise (attr := simp)] +theorem coproductIso_mk_comp_inv {J : Type v} (F : J → Type max v u) (j : J) : + (↾fun x : F j => (⟨j, x⟩ : Σ j, F j)) ≫ (coproductIso F).inv = Sigma.ι F j := + rfl + +end CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Types/Equalizers.lean new file mode 100644 index 00000000000000..56afaade65828c --- /dev/null +++ b/Mathlib/CategoryTheory/Limits/Types/Equalizers.lean @@ -0,0 +1,86 @@ +/- +Copyright (c) 2020 Kim Morrison. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Kim Morrison +-/ +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.Tactic.CategoryTheory.Elementwise + +/-! +# Equalizers in Type + +The equalizer of a pair of maps `(g, h)` from `X` to `Y` is the subtype `{x : Y // g x = h x}`. + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory Limits + +namespace CategoryTheory.Limits.Types + +variable {X Y Z : Type u} (f : X ⟶ Y) {g h : Y ⟶ Z} (w : f ≫ g = f ≫ h) + +/-- +Show the given fork in `Type u` is an equalizer given that any element in the "difference kernel" +comes from `X`. +The converse of `unique_of_type_equalizer`. +-/ +noncomputable def typeEqualizerOfUnique (t : ∀ y : Y, g y = h y → ∃! x : X, f x = y) : + IsLimit (Fork.ofι _ w) := + Fork.IsLimit.mk' _ fun s => by + refine ⟨fun i => ?_, ?_, ?_⟩ + · apply Classical.choose (t (s.ι i) _) + apply congr_fun s.condition i + · funext i + exact (Classical.choose_spec (t (s.ι i) (congr_fun s.condition i))).1 + · intro m hm + funext i + exact (Classical.choose_spec (t (s.ι i) (congr_fun s.condition i))).2 _ (congr_fun hm i) + +/-- The converse of `type_equalizer_of_unique`. -/ +theorem unique_of_type_equalizer (t : IsLimit (Fork.ofι _ w)) (y : Y) (hy : g y = h y) : + ∃! x : X, f x = y := by + let y' : PUnit ⟶ Y := fun _ => y + have hy' : y' ≫ g = y' ≫ h := funext fun _ => hy + refine ⟨(Fork.IsLimit.lift' t _ hy').1 ⟨⟩, congr_fun (Fork.IsLimit.lift' t y' _).2 ⟨⟩, ?_⟩ + intro x' hx' + suffices (fun _ : PUnit => x') = (Fork.IsLimit.lift' t y' hy').1 by + rw [← this] + apply Fork.IsLimit.hom_ext t + funext ⟨⟩ + apply hx'.trans (congr_fun (Fork.IsLimit.lift' t _ hy').2 ⟨⟩).symm + +theorem type_equalizer_iff_unique : + Nonempty (IsLimit (Fork.ofι _ w)) ↔ ∀ y : Y, g y = h y → ∃! x : X, f x = y := + ⟨fun i => unique_of_type_equalizer _ _ (Classical.choice i), fun k => + ⟨typeEqualizerOfUnique f w k⟩⟩ + +/-- Show that the subtype `{x : Y // g x = h x}` is an equalizer for the pair `(g,h)`. -/ +def equalizerLimit : Limits.LimitCone (parallelPair g h) where + cone := Fork.ofι (Subtype.val : { x : Y // g x = h x } → Y) (funext Subtype.prop) + isLimit := + Fork.IsLimit.mk' _ fun s => + ⟨fun i => ⟨s.ι i, by apply congr_fun s.condition i⟩, rfl, fun hm => + funext fun x => Subtype.ext (congr_fun hm x)⟩ + +variable (g h) + +/-- The categorical equalizer in `Type u` is `{x : Y // g x = h x}`. -/ +noncomputable def equalizerIso : equalizer g h ≅ { x : Y // g x = h x } := + limit.isoLimitCone equalizerLimit + +@[elementwise (attr := simp)] +theorem equalizerIso_hom_comp_subtype : (equalizerIso g h).hom ≫ Subtype.val = equalizer.ι g h := by + rfl + +@[elementwise (attr := simp)] +theorem equalizerIso_inv_comp_ι : (equalizerIso g h).inv ≫ equalizer.ι g h = Subtype.val := + limit.isoLimitCone_inv_π equalizerLimit WalkingParallelPair.zero + +end CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Filtered.lean b/Mathlib/CategoryTheory/Limits/Types/Filtered.lean index aeabaeef779d3b..ecd64276ef404c 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Filtered.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton -/ -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Filtered.Basic +module + +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Filtered.Basic /-! # Filtered colimits in the category of types. @@ -15,6 +17,8 @@ lemma `CategoryTheory.Limits.Types.FilteredColimit.colimit_eq_iff`: -/ +@[expose] public section + open CategoryTheory CategoryTheory.Limits universe v u w @@ -152,4 +156,14 @@ theorem colimit_eq_iff [HasColimit F] {i j : J} {xi : F.obj i} {xj : F.obj j} : ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f xi = F.map g xj := isColimit_eq_iff _ (colimit.isColimit F) +open IsFiltered in +variable {F} in +lemma jointly_surjective_of_isColimit₂ + {t : Cocone F} (ht : IsColimit t) (x₁ x₂ : t.pt) : + ∃ (j : J) (x₁' x₂' : F.obj j), t.ι.app j x₁' = x₁ ∧ t.ι.app j x₂' = x₂ := by + obtain ⟨j₁, x₁, rfl⟩ := Types.jointly_surjective_of_isColimit ht x₁ + obtain ⟨j₂, x₂, rfl⟩ := Types.jointly_surjective_of_isColimit ht x₂ + exact ⟨max j₁ j₂, F.map (leftToMax _ _) x₁, F.map (rightToMax _ _) x₂, + congr_fun (t.w (leftToMax j₁ j₂)) x₁, congr_fun (t.w (rightToMax j₁ j₂)) x₂⟩ + end CategoryTheory.Limits.Types.FilteredColimit diff --git a/Mathlib/CategoryTheory/Limits/Types/Images.lean b/Mathlib/CategoryTheory/Limits/Types/Images.lean index e60999fd1feef7..703024617d06e5 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Images.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton -/ -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.CategoryTheory.Limits.Shapes.Images +module + +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.CategoryTheory.Limits.Shapes.Images /-! # Images in the category of types @@ -14,6 +16,8 @@ and that these agree with the range of a function. -/ +@[expose] public section + universe v u namespace CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Limits.lean b/Mathlib/CategoryTheory/Limits/Types/Limits.lean index aa47272f8cfdf9..7cc50bb0aec5cd 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Limits.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Limits.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton -/ -import Mathlib.Logic.UnivLE -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.Logic.UnivLE +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # Limits in the category of types. @@ -13,6 +15,8 @@ We show that the category of types has all limits, by providing the usual concre -/ +@[expose] public section + universe u' v u w namespace CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean b/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean index 98b4649d763215..c357362bed4cc9 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Types.Set -import Mathlib.Data.Set.BooleanAlgebra -import Mathlib.Order.CompleteLattice.MulticoequalizerDiagram +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Types.Colimits +public import Mathlib.CategoryTheory.Types.Set +public import Mathlib.Data.Set.BooleanAlgebra +public import Mathlib.Order.CompleteLattice.MulticoequalizerDiagram /-! # Multicoequalizers in the category of types @@ -24,6 +26,8 @@ a multicoequalizer in the category of types. -/ +@[expose] public section + universe w w' u namespace CategoryTheory.Functor.CoconeTypes diff --git a/Mathlib/CategoryTheory/Limits/Types/Multiequalizer.lean b/Mathlib/CategoryTheory/Limits/Types/Multiequalizer.lean new file mode 100644 index 00000000000000..c6c10126533459 --- /dev/null +++ b/Mathlib/CategoryTheory/Limits/Types/Multiequalizer.lean @@ -0,0 +1,103 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Types.Limits + +/-! +# Multiequalizers in Type + +Given `J : MulticospanShape` and `I : MulticospanIndex J (Type u)`, +we define a type `I.sections`. When `c : Multifork I`, we show +that `c` is a limit iff the canonical map +`c.toSections : c.pt → I.sections` is a bijection. + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory Limits + +namespace CategoryTheory.Limits + +variable {J : MulticospanShape} (I : MulticospanIndex J (Type u)) + +/-- Given `I : MulticospanIndex J (Type u)`, this is a type which identifies +to the sections of the functor `I.multicospan`. -/ +@[ext] +structure MulticospanIndex.sections where + /-- The data of an element in `I.left i` for each `i : J.L`. -/ + val (i : J.L) : I.left i + property (r : J.R) : I.fst r (val _) = I.snd r (val _) + +/-- The bijection `I.sections ≃ I.multicospan.sections` when `I : MulticospanIndex (Type u)` +is a multiequalizer diagram in the category of types. -/ +@[simps] +def MulticospanIndex.sectionsEquiv : + I.sections ≃ I.multicospan.sections where + toFun s := + { val := fun i ↦ match i with + | .left i => s.val i + | .right j => I.fst j (s.val _) + property := by + rintro _ _ (_ | _ | r) + · rfl + · rfl + · exact (s.property r).symm } + invFun s := + { val := fun i ↦ s.val (.left i) + property := fun r ↦ (s.property (.fst r)).trans (s.property (.snd r)).symm } + right_inv s := by + ext (_ | r) + · rfl + · exact s.property (.fst r) + +namespace Multifork + +variable {I} +variable (c : Multifork I) + +/-- Given a multiequalizer diagram `I : MulticospanIndex (Type u)` in the category of +types and `c` a multifork for `I`, this is the canonical map `c.pt → I.sections`. -/ +@[simps] +def toSections (x : c.pt) : I.sections where + val i := c.ι i x + property r := congr_fun (c.condition r) x + +lemma toSections_fac : I.sectionsEquiv.symm ∘ Types.sectionOfCone c = c.toSections := rfl + +/-- A multifork `c : Multifork I` in the category of types is limit iff the +map `c.toSections : c.pt → I.sections` is a bijection. -/ +lemma isLimit_types_iff : Nonempty (IsLimit c) ↔ Function.Bijective c.toSections := by + rw [Types.isLimit_iff_bijective_sectionOfCone, ← toSections_fac, EquivLike.comp_bijective] + +namespace IsLimit + +variable {c} (hc : IsLimit c) + +/-- The bijection `I.sections ≃ c.pt` when `c : Multifork I` is a limit multifork +in the category of types. -/ +noncomputable def sectionsEquiv : I.sections ≃ c.pt := + (Equiv.ofBijective _ (c.isLimit_types_iff.1 ⟨hc⟩)).symm + +@[simp] +lemma sectionsEquiv_symm_apply_val (x : c.pt) (i : J.L) : + ((sectionsEquiv hc).symm x).val i = c.ι i x := rfl + +@[simp] +lemma sectionsEquiv_apply_val (s : I.sections) (i : J.L) : + c.ι i (sectionsEquiv hc s) = s.val i := by + obtain ⟨x, rfl⟩ := (sectionsEquiv hc).symm.surjective s + simp + +end IsLimit + +end Multifork + +end CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Types/Products.lean b/Mathlib/CategoryTheory/Limits/Types/Products.lean new file mode 100644 index 00000000000000..a100fc970f8835 --- /dev/null +++ b/Mathlib/CategoryTheory/Limits/Types/Products.lean @@ -0,0 +1,244 @@ +/- +Copyright (c) 2020 Kim Morrison. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Kim Morrison +-/ +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Types.Limits +public import Mathlib.Tactic.CategoryTheory.Elementwise + +/-! +# Products in `Type` + +We describe arbitrary products in the category of types, as well as binary products, +and the terminal object. + +-/ + +@[expose] public section + +universe v u + +open CategoryTheory Limits + +namespace CategoryTheory.Limits.Types + +example : HasProducts.{v} (Type v) := inferInstance +example [UnivLE.{v, u}] : HasProducts.{v} (Type u) := inferInstance + +-- This shortcut instance is required in `Mathlib/CategoryTheory/Closed/Types.lean`, +-- although I don't understand why, and wish it wasn't. +instance : HasProducts.{v} (Type v) := inferInstance + +/-- A restatement of `Types.Limit.lift_π_apply` that uses `Pi.π` and `Pi.lift`. -/ +-- The increased `@[simp]` priority here results in a minor speed up in +-- `Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean`. +@[simp 1001] +theorem pi_lift_π_apply {β : Type v} [Small.{u} β] (f : β → Type u) {P : Type u} + (s : ∀ b, P ⟶ f b) (b : β) (x : P) : + (Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x := + congr_fun (limit.lift_π (Fan.mk P s) ⟨b⟩) x + +/-- A restatement of `Types.Limit.lift_π_apply` that uses `Pi.π` and `Pi.lift`, +with specialized universes. -/ +theorem pi_lift_π_apply' {β : Type v} (f : β → Type v) {P : Type v} + (s : ∀ b, P ⟶ f b) (b : β) (x : P) : + (Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x := by + simp + +/-- A restatement of `Types.Limit.map_π_apply` that uses `Pi.π` and `Pi.map`. -/ +-- Not `@[simp]` since `simp` can prove it. +theorem pi_map_π_apply {β : Type v} [Small.{u} β] {f g : β → Type u} + (α : ∀ j, f j ⟶ g j) (b : β) (x) : + (Pi.π g b : ∏ᶜ g → g b) (Pi.map α x) = α b ((Pi.π f b : ∏ᶜ f → f b) x) := + Limit.map_π_apply.{v, u} _ _ _ + +/-- A restatement of `Types.Limit.map_π_apply` that uses `Pi.π` and `Pi.map`, +with specialized universes. -/ +theorem pi_map_π_apply' {β : Type v} {f g : β → Type v} (α : ∀ j, f j ⟶ g j) (b : β) (x) : + (Pi.π g b : ∏ᶜ g → g b) (Pi.map α x) = α b ((Pi.π f b : ∏ᶜ f → f b) x) := by + simp + +/-- The category of types has `PUnit` as a terminal object. -/ +def terminalLimitCone : Limits.LimitCone (Functor.empty (Type u)) where + -- Porting note: tidy was able to fill the structure automatically + cone := + { pt := PUnit + π := (Functor.uniqueFromEmpty _).hom } + isLimit := + { lift := fun _ _ => PUnit.unit + fac := fun _ => by rintro ⟨⟨⟩⟩ } + +/-- The terminal object in `Type u` is `PUnit`. -/ +noncomputable def terminalIso : ⊤_ Type u ≅ PUnit := + limit.isoLimitCone terminalLimitCone.{u, 0} + +/-- The terminal object in `Type u` is `PUnit`. -/ +noncomputable def isTerminalPunit : IsTerminal (PUnit : Type u) := + terminalIsTerminal.ofIso terminalIso + +noncomputable instance : Inhabited (⊤_ (Type u)) := + ⟨@terminal.from (Type u) _ _ (ULift (Fin 1)) (ULift.up 0)⟩ + +instance : Subsingleton (⊤_ (Type u)) := ⟨fun a b => + congr_fun (@Subsingleton.elim (_ ⟶ ⊤_ (Type u)) _ + (fun _ => a) (fun _ => b)) (ULift.up (0 : Fin 1))⟩ + +noncomputable instance : Unique (⊤_ (Type u)) := Unique.mk' _ + +/-- A type is terminal if and only if it contains exactly one element. -/ +noncomputable def isTerminalEquivUnique (X : Type u) : IsTerminal X ≃ Unique X := + equivOfSubsingletonOfSubsingleton + (fun h => ((Iso.toEquiv (terminalIsoIsTerminal h).symm).unique)) + (fun _ => IsTerminal.ofIso terminalIsTerminal (Equiv.toIso (Equiv.ofUnique _ _))) + +/-- A type is terminal if and only if it is isomorphic to `PUnit`. -/ +noncomputable def isTerminalEquivIsoPUnit (X : Type u) : IsTerminal X ≃ (X ≅ PUnit) := by + calc + IsTerminal X ≃ Unique X := isTerminalEquivUnique _ + _ ≃ (X ≃ PUnit.{u + 1}) := uniqueEquivEquivUnique _ _ + _ ≃ (X ≅ PUnit) := equivEquivIso + +open CategoryTheory.Limits.WalkingPair + +-- We manually generate the other projection lemmas since the simp-normal form for the legs is +-- otherwise not created correctly. +/-- The product type `X × Y` forms a cone for the binary product of `X` and `Y`. -/ +@[simps! pt] +def binaryProductCone (X Y : Type u) : BinaryFan X Y := + BinaryFan.mk _root_.Prod.fst _root_.Prod.snd + +@[simp] +theorem binaryProductCone_fst (X Y : Type u) : (binaryProductCone X Y).fst = _root_.Prod.fst := + rfl + +@[simp] +theorem binaryProductCone_snd (X Y : Type u) : (binaryProductCone X Y).snd = _root_.Prod.snd := + rfl + +/-- The product type `X × Y` is a binary product for `X` and `Y`. -/ +@[simps] +def binaryProductLimit (X Y : Type u) : IsLimit (binaryProductCone X Y) where + lift (s : BinaryFan X Y) x := (s.fst x, s.snd x) + fac _ j := Discrete.recOn j fun j => WalkingPair.casesOn j rfl rfl + uniq _ _ w := funext fun x => Prod.ext (congr_fun (w ⟨left⟩) x) (congr_fun (w ⟨right⟩) x) + +/-- The category of types has `X × Y`, the usual Cartesian product, +as the binary product of `X` and `Y`. +-/ +@[simps] +def binaryProductLimitCone (X Y : Type u) : Limits.LimitCone (pair X Y) := + ⟨_, binaryProductLimit X Y⟩ + +/-- The categorical binary product in `Type u` is Cartesian product. -/ +noncomputable def binaryProductIso (X Y : Type u) : Limits.prod X Y ≅ X × Y := + limit.isoLimitCone (binaryProductLimitCone X Y) + +@[elementwise (attr := simp)] +theorem binaryProductIso_hom_comp_fst (X Y : Type u) : + (binaryProductIso X Y).hom ≫ _root_.Prod.fst = Limits.prod.fst := + limit.isoLimitCone_hom_π (binaryProductLimitCone X Y) ⟨WalkingPair.left⟩ + +@[elementwise (attr := simp)] +theorem binaryProductIso_hom_comp_snd (X Y : Type u) : + (binaryProductIso X Y).hom ≫ _root_.Prod.snd = Limits.prod.snd := + limit.isoLimitCone_hom_π (binaryProductLimitCone X Y) ⟨WalkingPair.right⟩ + +@[elementwise (attr := simp)] +theorem binaryProductIso_inv_comp_fst (X Y : Type u) : + (binaryProductIso X Y).inv ≫ Limits.prod.fst = _root_.Prod.fst := + limit.isoLimitCone_inv_π (binaryProductLimitCone X Y) ⟨WalkingPair.left⟩ + +@[elementwise (attr := simp)] +theorem binaryProductIso_inv_comp_snd (X Y : Type u) : + (binaryProductIso X Y).inv ≫ Limits.prod.snd = _root_.Prod.snd := + limit.isoLimitCone_inv_π (binaryProductLimitCone X Y) ⟨WalkingPair.right⟩ + +/-- The functor which sends `X, Y` to the product type `X × Y`. -/ +@[simps] +def binaryProductFunctor : Type u ⥤ Type u ⥤ Type u where + obj X := + { obj := fun Y => X × Y + map := fun { _ Y₂} f => (binaryProductLimit X Y₂).lift + (BinaryFan.mk _root_.Prod.fst (_root_.Prod.snd ≫ f)) } + map {X₁ X₂} f := + { app := fun Y => + (binaryProductLimit X₂ Y).lift (BinaryFan.mk (_root_.Prod.fst ≫ f) _root_.Prod.snd) } + +/-- The product functor given by the instance `HasBinaryProducts (Type u)` is isomorphic to the +explicit binary product functor given by the product type. +-/ +noncomputable def binaryProductIsoProd : binaryProductFunctor ≅ (prod.functor : Type u ⥤ _) := by + refine NatIso.ofComponents (fun X => ?_) (fun _ => ?_) + · refine NatIso.ofComponents (fun Y => ?_) (fun _ => ?_) + · exact ((limit.isLimit _).conePointUniqueUpToIso (binaryProductLimit X Y)).symm + · apply Limits.prod.hom_ext <;> simp <;> rfl + · ext : 2 + apply Limits.prod.hom_ext <;> simp <;> rfl + +/-- +The category of types has `Π j, f j` as the product of a type family `f : J → Type max v u`. +-/ +def productLimitCone {J : Type v} (F : J → Type max v u) : + Limits.LimitCone (Discrete.functor F) where + cone := + { pt := ∀ j, F j + π := Discrete.natTrans (fun ⟨j⟩ f => f j) } + isLimit := + { lift := fun s x j => s.π.app ⟨j⟩ x + uniq := fun _ _ w => funext fun x => funext fun j => (congr_fun (w ⟨j⟩) x :) } + +/-- The categorical product in `Type max v u` is the type-theoretic product `Π j, F j`. -/ +noncomputable def productIso {J : Type v} (F : J → Type max v u) : ∏ᶜ F ≅ ∀ j, F j := + limit.isoLimitCone (productLimitCone.{v, u} F) + +@[simp, elementwise (attr := simp)] +theorem productIso_hom_comp_eval {J : Type v} (F : J → Type max v u) (j : J) : + ((productIso.{v, u} F).hom ≫ fun f => f j) = Pi.π F j := + rfl + +@[elementwise (attr := simp)] +theorem productIso_inv_comp_π {J : Type v} (F : J → Type max v u) (j : J) : + (productIso.{v, u} F).inv ≫ Pi.π F j = fun f => f j := + limit.isoLimitCone_inv_π (productLimitCone.{v, u} F) ⟨j⟩ + +namespace Small + +variable {J : Type v} (F : J → Type u) [Small.{u} J] + +/-- +A variant of `productLimitCone` using a `Small` hypothesis rather than a function to `Type`. +-/ +noncomputable def productLimitCone : + Limits.LimitCone (Discrete.functor F) where + cone := + { pt := Shrink (∀ j, F j) + π := Discrete.natTrans (fun ⟨j⟩ f => (equivShrink (∀ j, F j)).symm f j) } + isLimit := + have : Small.{u} (∀ j, F j) := inferInstance + { lift := fun s x => (equivShrink _) (fun j => s.π.app ⟨j⟩ x) + uniq := fun s m w => funext fun x => Shrink.ext <| funext fun j => by + simpa using (congr_fun (w ⟨j⟩) x :) } + +/-- The categorical product in `Type u` indexed in `Type v` +is the type-theoretic product `Π j, F j`, after shrinking back to `Type u`. -/ +noncomputable def productIso : + (∏ᶜ F : Type u) ≅ Shrink.{u} (∀ j, F j) := + limit.isoLimitCone (productLimitCone.{v, u} F) + +@[elementwise (attr := simp)] +theorem productIso_hom_comp_eval (j : J) : + ((productIso.{v, u} F).hom ≫ fun f => (equivShrink (∀ j, F j)).symm f j) = Pi.π F j := + limit.isoLimitCone_hom_π (productLimitCone.{v, u} F) ⟨j⟩ + +@[elementwise (attr := simp)] +theorem productIso_inv_comp_π (j : J) : + (productIso.{v, u} F).inv ≫ Pi.π F j = fun f => ((equivShrink (∀ j, F j)).symm f) j := + limit.isoLimitCone_inv_π (productLimitCone.{v, u} F) ⟨j⟩ + +end Small + +end CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Types/Pullbacks.lean index f92560d6def599..f9fe77cc95d857 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Pullbacks.lean @@ -1,18 +1,176 @@ /- -Copyright (c) 2025 Christian Merten. All rights reserved. +Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Christian Merten +Authors: Kim Morrison, Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Types.Shapes +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq /-! -# Lemmas on pullbacks in the category of types +# Pullbacks in the category of types +In `Type*`, the pullback of `f : X ⟶ Z` and `g : Y ⟶ Z` is the +subtype `{ p : X × Y // f p.1 = g p.2 }` of the product. We show some additional lemmas for pullbacks in the category of types. -/ -universe u +@[expose] public section + +universe v u + +open CategoryTheory Limits + +namespace CategoryTheory.Limits.Types + +-- #synth HasPullbacks.{u} (Type u) +instance : HasPullbacks.{u} (Type u) := + -- FIXME does not work via `inferInstance` despite `#synth HasPullbacks.{u} (Type u)` succeeding. + -- https://github.com/leanprover-community/mathlib4/issues/5752 + -- inferInstance + hasPullbacks_of_hasWidePullbacks.{u} (Type u) + +variable {X Y Z : Type u} {X' Y' Z' : Type v} +variable (f : X ⟶ Z) (g : Y ⟶ Z) (f' : X' ⟶ Z') (g' : Y' ⟶ Z') + +/-- The usual explicit pullback in the category of types, as a subtype of the product. +The full `LimitCone` data is bundled as `pullbackLimitCone f g`. +-/ +abbrev PullbackObj : Type u := + { p : X × Y // f p.1 = g p.2 } + +-- `PullbackObj f g` comes with a coercion to the product type `X × Y`. +example (p : PullbackObj f g) : X × Y := + p + +/-- The explicit pullback cone on `PullbackObj f g`. +This is bundled with the `IsLimit` data as `pullbackLimitCone f g`. +-/ +abbrev pullbackCone : Limits.PullbackCone f g := + PullbackCone.mk (fun p : PullbackObj f g => p.1.1) (fun p => p.1.2) (funext fun p => p.2) + +/-- The explicit pullback in the category of types, bundled up as a `LimitCone` +for given `f` and `g`. +-/ +@[simps] +def pullbackLimitCone (f : X ⟶ Z) (g : Y ⟶ Z) : Limits.LimitCone (cospan f g) where + cone := pullbackCone f g + isLimit := + PullbackCone.isLimitAux _ (fun s x => ⟨⟨s.fst x, s.snd x⟩, congr_fun s.condition x⟩) + (by aesop) (by aesop) fun _ _ w => + funext fun x => + Subtype.ext <| + Prod.ext (congr_fun (w WalkingCospan.left) x) (congr_fun (w WalkingCospan.right) x) + +end Types + +namespace PullbackCone + +variable {X Y S : Type v} {f : X ⟶ S} {g : Y ⟶ S} {c : PullbackCone f g} + +namespace IsLimit + +variable (hc : IsLimit c) + +/-- A limit pullback cone in the category of types identifies to the explicit pullback. -/ +noncomputable def equivPullbackObj : c.pt ≃ Types.PullbackObj f g := + (IsLimit.conePointUniqueUpToIso hc (Types.pullbackLimitCone f g).isLimit).toEquiv + +@[simp] +lemma equivPullbackObj_apply_fst (x : c.pt) : (equivPullbackObj hc x).1.1 = c.fst x := + congr_fun (IsLimit.conePointUniqueUpToIso_hom_comp hc + (Types.pullbackLimitCone f g).isLimit .left) x + +@[simp] +lemma equivPullbackObj_apply_snd (x : c.pt) : (equivPullbackObj hc x).1.2 = c.snd x := + congr_fun (IsLimit.conePointUniqueUpToIso_hom_comp hc + (Types.pullbackLimitCone f g).isLimit .right) x + +@[simp] +lemma equivPullbackObj_symm_apply_fst (x : Types.PullbackObj f g) : + c.fst ((equivPullbackObj hc).symm x) = x.1.1 := by + obtain ⟨x, rfl⟩ := (equivPullbackObj hc).surjective x + simp + +@[simp] +lemma equivPullbackObj_symm_apply_snd (x : Types.PullbackObj f g) : + c.snd ((equivPullbackObj hc).symm x) = x.1.2 := by + obtain ⟨x, rfl⟩ := (equivPullbackObj hc).surjective x + simp + +include hc in +lemma type_ext {x y : c.pt} (h₁ : c.fst x = c.fst y) (h₂ : c.snd x = c.snd y) : x = y := + (equivPullbackObj hc).injective (by ext <;> assumption) + +end IsLimit + +variable (c) + +/-- Given `c : PullbackCone f g` in the category of types, this is +the canonical map `c.pt → Types.PullbackObj f g`. -/ +@[simps coe_fst coe_snd] +def toPullbackObj (x : c.pt) : Types.PullbackObj f g := + ⟨⟨c.fst x, c.snd x⟩, congr_fun c.condition x⟩ + +/-- A pullback cone `c` in the category of types is limit iff the +map `c.toPullbackObj : c.pt → Types.PullbackObj f g` is a bijection. -/ +noncomputable def isLimitEquivBijective : + IsLimit c ≃ Function.Bijective c.toPullbackObj where + toFun h := (IsLimit.equivPullbackObj h).bijective + invFun h := IsLimit.ofIsoLimit (Types.pullbackLimitCone f g).isLimit + (Iso.symm (PullbackCone.ext (Equiv.ofBijective _ h).toIso)) + left_inv _ := Subsingleton.elim _ _ + +end PullbackCone + +namespace Types + +section Pullback + +open CategoryTheory.Limits.WalkingCospan + +variable {W X Y Z : Type u} (f : X ⟶ Z) (g : Y ⟶ Z) + +/-- The pullback given by the instance `HasPullbacks (Type u)` is isomorphic to the +explicit pullback object given by `PullbackObj`. +-/ +noncomputable def pullbackIsoPullback : pullback f g ≅ PullbackObj f g := + (PullbackCone.IsLimit.equivPullbackObj (pullbackIsPullback f g)).toIso + +@[simp] +theorem pullbackIsoPullback_hom_fst (p : pullback f g) : + ((pullbackIsoPullback f g).hom p : X × Y).fst = (pullback.fst f g) p := + PullbackCone.IsLimit.equivPullbackObj_apply_fst (pullbackIsPullback f g) p + +@[simp] +theorem pullbackIsoPullback_hom_snd (p : pullback f g) : + ((pullbackIsoPullback f g).hom p : X × Y).snd = (pullback.snd f g) p := + PullbackCone.IsLimit.equivPullbackObj_apply_snd (pullbackIsPullback f g) p + +@[simp] +theorem pullbackIsoPullback_inv_fst_apply (x : (Types.pullbackCone f g).pt) : + (pullback.fst f g) ((pullbackIsoPullback f g).inv x) = (fun p => (p.1 : X × Y).fst) x := + PullbackCone.IsLimit.equivPullbackObj_symm_apply_fst (pullbackIsPullback f g) x + +@[simp] +theorem pullbackIsoPullback_inv_snd_apply (x : (Types.pullbackCone f g).pt) : + (pullback.snd f g) ((pullbackIsoPullback f g).inv x) = (fun p => (p.1 : X × Y).snd) x := + PullbackCone.IsLimit.equivPullbackObj_symm_apply_snd (pullbackIsPullback f g) x + +@[simp] +theorem pullbackIsoPullback_inv_fst : + (pullbackIsoPullback f g).inv ≫ pullback.fst _ _ = fun p => (p.1 : X × Y).fst := by aesop + +@[simp] +theorem pullbackIsoPullback_inv_snd : + (pullbackIsoPullback f g).inv ≫ pullback.snd _ _ = fun p => (p.1 : X × Y).snd := by aesop + +end Pullback + +end Types + +end CategoryTheory.Limits + namespace CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Pushouts.lean b/Mathlib/CategoryTheory/Limits/Types/Pushouts.lean new file mode 100644 index 00000000000000..b6b6f3803ac621 --- /dev/null +++ b/Mathlib/CategoryTheory/Limits/Types/Pushouts.lean @@ -0,0 +1,261 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.CategoryTheory.Limits.Types.Colimits + + +/-! +# Pushouts in `Type` + +We describe the pushout of two maps `f : S ⟶ X₁` and `g : S ⟶ X₂` +in the category of types at the quotient of `X₁ ⊕ X₂` by the +equivalence relation generated by a relation. We also study +the particular case when `f` is injective (in the file +`CategoryTheory.Types.Monomorphisms`, it is deduced that monomorphisms +are stable under cobase change in the category of types). + +-/ + +@[expose] public section + +universe u + +namespace CategoryTheory.Limits.Types + +instance : HasPushouts.{u} (Type u) := + hasPushouts_of_hasWidePushouts.{u} (Type u) + +section Pushout + +variable {S X₁ X₂ : Type u} (f : S ⟶ X₁) (g : S ⟶ X₂) + +/-- The pushout of two maps `f : S ⟶ X₁` and `g : S ⟶ X₂` is the quotient +by the equivalence relation on `X₁ ⊕ X₂` generated by this relation. -/ +inductive Pushout.Rel (f : S ⟶ X₁) (g : S ⟶ X₂) : X₁ ⊕ X₂ → X₁ ⊕ X₂ → Prop + | inl_inr (s : S) : Pushout.Rel f g (Sum.inl (f s)) (Sum.inr (g s)) + +/-- Construction of the pushout in the category of types, as a quotient of `X₁ ⊕ X₂`. -/ +def Pushout : Type u := _root_.Quot (Pushout.Rel f g) + +/-- In case `f : S ⟶ X₁` is a monomorphism, this relation is the equivalence relation +generated by `Pushout.Rel f g`. -/ +inductive Pushout.Rel' : X₁ ⊕ X₂ → X₁ ⊕ X₂ → Prop + | refl (x : X₁ ⊕ X₂) : Rel' x x + | inl_inl (x₀ y₀ : S) (h : g x₀ = g y₀) : Rel' (Sum.inl (f x₀)) (Sum.inl (f y₀)) + | inl_inr (s : S) : Rel' (Sum.inl (f s)) (Sum.inr (g s)) + | inr_inl (s : S) : Rel' (Sum.inr (g s)) (Sum.inl (f s)) + +/-- The quotient of `X₁ ⊕ X₂` by the relation `PushoutRel' f g`. -/ +def Pushout' : Type u := _root_.Quot (Pushout.Rel' f g) + +namespace Pushout + +/-- The left inclusion in the constructed pushout `Pushout f g`. -/ +@[simp] +def inl : X₁ ⟶ Pushout f g := fun x => Quot.mk _ (Sum.inl x) + +/-- The right inclusion in the constructed pushout `Pushout f g`. -/ +@[simp] +def inr : X₂ ⟶ Pushout f g := fun x => Quot.mk _ (Sum.inr x) + +lemma condition : f ≫ inl f g = g ≫ inr f g := by + ext x + exact Quot.sound (Rel.inl_inr x) + +/-- The constructed pushout cocone in the category of types. -/ +@[simps!] +def cocone : PushoutCocone f g := PushoutCocone.mk _ _ (condition f g) + +/-- The cocone `cocone f g` is colimit. -/ +def isColimitCocone : IsColimit (cocone f g) := + PushoutCocone.IsColimit.mk _ (fun s => Quot.lift (fun x => match x with + | Sum.inl x₁ => s.inl x₁ + | Sum.inr x₂ => s.inr x₂) (by + rintro _ _ ⟨t⟩ + exact congr_fun s.condition t)) (fun _ => rfl) (fun _ => rfl) (fun s m h₁ h₂ => by + ext ⟨x₁ | x₂⟩ + · exact congr_fun h₁ x₁ + · exact congr_fun h₂ x₂) + +@[simp] +lemma inl_rel'_inl_iff (x₁ y₁ : X₁) : + Rel' f g (Sum.inl x₁) (Sum.inl y₁) ↔ x₁ = y₁ ∨ + ∃ (x₀ y₀ : S) (_ : g x₀ = g y₀), x₁ = f x₀ ∧ y₁ = f y₀ := by + constructor + · rintro (_ | ⟨_, _, h⟩) + · exact Or.inl rfl + · exact Or.inr ⟨_, _, h, rfl, rfl⟩ + · rintro (rfl | ⟨_, _, h, rfl, rfl⟩) + · apply Rel'.refl + · exact Rel'.inl_inl _ _ h + +@[simp] +lemma inl_rel'_inr_iff (x₁ : X₁) (x₂ : X₂) : + Rel' f g (Sum.inl x₁) (Sum.inr x₂) ↔ + ∃ (s : S), x₁ = f s ∧ x₂ = g s := by + constructor + · rintro ⟨_⟩ + exact ⟨_, rfl, rfl⟩ + · rintro ⟨s, rfl, rfl⟩ + exact Rel'.inl_inr _ + +@[simp] +lemma inr_rel'_inr_iff (x₂ y₂ : X₂) : + Rel' f g (Sum.inr x₂) (Sum.inr y₂) ↔ x₂ = y₂ := by + constructor + · rintro ⟨_⟩ + rfl + · rintro rfl + apply Rel'.refl + +variable {f g} + +lemma Rel'.symm {x y : X₁ ⊕ X₂} (h : Rel' f g x y) : + Rel' f g y x := by + obtain _ | ⟨_, _, h⟩ | _ | _ := h + · apply Rel'.refl + · exact Rel'.inl_inl _ _ h.symm + · exact Rel'.inr_inl _ + · exact Rel'.inl_inr _ + +variable (f g) + +lemma equivalence_rel' [Mono f] : _root_.Equivalence (Rel' f g) where + refl := Rel'.refl + symm h := h.symm + trans := by + rintro x y z (_ | ⟨_, _, h⟩ | s | _) hyz + · exact hyz + · obtain z₁ | z₂ := z + · rw [inl_rel'_inl_iff] at hyz + obtain rfl | ⟨_, _, h', h'', rfl⟩ := hyz + · exact Rel'.inl_inl _ _ h + · obtain rfl := (mono_iff_injective f).1 inferInstance h'' + exact Rel'.inl_inl _ _ (h.trans h') + · rw [inl_rel'_inr_iff] at hyz + obtain ⟨s, hs, rfl⟩ := hyz + obtain rfl := (mono_iff_injective f).1 inferInstance hs + rw [← h] + apply Rel'.inl_inr + · obtain z₁ | z₂ := z + · replace hyz := hyz.symm + rw [inl_rel'_inr_iff] at hyz + obtain ⟨s', rfl, hs'⟩ := hyz + exact Rel'.inl_inl _ _ hs' + · rw [inr_rel'_inr_iff] at hyz + subst hyz + apply Rel'.inl_inr + · obtain z₁ | z₂ := z + · rw [inl_rel'_inl_iff] at hyz + obtain rfl | ⟨_, _, h, h', rfl⟩ := hyz + · apply Rel'.inr_inl + · obtain rfl := (mono_iff_injective f).1 inferInstance h' + rw [h] + apply Rel'.inr_inl + · rw [inl_rel'_inr_iff] at hyz + obtain ⟨s, hs, rfl⟩ := hyz + obtain rfl := (mono_iff_injective f).1 inferInstance hs + apply Rel'.refl + +/-- The obvious equivalence `Pushout f g ≃ Pushout' f g`. -/ +def equivPushout' : Pushout f g ≃ Pushout' f g where + toFun := Quot.lift (Quot.mk _) (by + rintro _ _ ⟨⟩ + apply Quot.sound + apply Rel'.inl_inr) + invFun := Quot.lift (Quot.mk _) (by + rintro a b (_ | ⟨x₀, y₀, h⟩ | _ | _) + · rfl + · have h₀ : Rel f g _ _ := Rel.inl_inr x₀ + rw [Quot.sound h₀, h] + symm + apply Quot.sound + apply Rel.inl_inr + · apply Quot.sound + apply Rel.inl_inr + · symm + apply Quot.sound + apply Rel.inl_inr) + left_inv := by rintro ⟨x⟩; rfl + right_inv := by rintro ⟨x⟩; rfl + +lemma quot_mk_eq_iff [Mono f] (a b : X₁ ⊕ X₂) : + (Quot.mk _ a : Pushout f g) = Quot.mk _ b ↔ Rel' f g a b := by + rw [← (equivalence_rel' f g).quot_mk_eq_iff] + exact ⟨fun h => (equivPushout' f g).symm.injective h, + fun h => (equivPushout' f g).injective h⟩ + +lemma inl_eq_inr_iff [Mono f] (x₁ : X₁) (x₂ : X₂) : + (inl f g x₁ = inr f g x₂) ↔ + ∃ (s : S), f s = x₁ ∧ g s = x₂ := by + refine (Pushout.quot_mk_eq_iff f g (Sum.inl x₁) (Sum.inr x₂)).trans ?_ + constructor + · rintro ⟨⟩ + exact ⟨_, rfl, rfl⟩ + · rintro ⟨s, rfl, rfl⟩ + apply Rel'.inl_inr + +instance mono_inr [Mono f] : Mono (inr f g) := by + rw [mono_iff_injective] + intro x₂ y₂ h + simpa using (Pushout.quot_mk_eq_iff f g (Sum.inr x₂) (Sum.inr y₂)).1 h + +end Pushout + +variable {f g} + +lemma pushoutCocone_inl_eq_inr_imp_of_iso {c c' : PushoutCocone f g} (e : c ≅ c') + (x₁ : X₁) (x₂ : X₂) (h : c.inl x₁ = c.inr x₂) : + c'.inl x₁ = c'.inr x₂ := by + convert congr_arg e.hom.hom h + · exact congr_fun (e.hom.w WalkingSpan.left).symm x₁ + · exact congr_fun (e.hom.w WalkingSpan.right).symm x₂ + +lemma pushoutCocone_inl_eq_inr_iff_of_iso {c c' : PushoutCocone f g} (e : c ≅ c') + (x₁ : X₁) (x₂ : X₂) : + c.inl x₁ = c.inr x₂ ↔ c'.inl x₁ = c'.inr x₂ := by + constructor + · apply pushoutCocone_inl_eq_inr_imp_of_iso e + · apply pushoutCocone_inl_eq_inr_imp_of_iso e.symm + +lemma pushoutCocone_inl_eq_inr_iff_of_isColimit {c : PushoutCocone f g} (hc : IsColimit c) + (h₁ : Function.Injective f) (x₁ : X₁) (x₂ : X₂) : + c.inl x₁ = c.inr x₂ ↔ ∃ (s : S), f s = x₁ ∧ g s = x₂ := by + rw [pushoutCocone_inl_eq_inr_iff_of_iso + (Cocones.ext (IsColimit.coconePointUniqueUpToIso hc (Pushout.isColimitCocone f g)) + (by simp))] + have := (mono_iff_injective f).2 h₁ + apply Pushout.inl_eq_inr_iff + +lemma pushoutCocone_inr_mono_of_isColimit {c : PushoutCocone f g} (hc : IsColimit c) + [Mono f] : Mono c.inr := by + change Mono ((Pushout.inr f g) ≫ + ((Cocones.forget _).mapIso + (Cocones.ext (IsColimit.coconePointUniqueUpToIso hc + (Pushout.isColimitCocone f g)) (by simp))).inv) + infer_instance + +lemma pushoutCocone_inr_injective_of_isColimit {c : PushoutCocone f g} (hc : IsColimit c) + (h₁ : Function.Injective f) : Function.Injective c.inr := by + rw [← mono_iff_injective] at h₁ ⊢ + exact pushoutCocone_inr_mono_of_isColimit hc + +instance mono_inl [Mono g] : Mono (Pushout.inl f g) := + pushoutCocone_inr_mono_of_isColimit + (PushoutCocone.flipIsColimit (Pushout.isColimitCocone f g)) + +instance [Mono f] : Mono (pushout.inr f g) := + (pushoutCocone_inr_mono_of_isColimit (pushoutIsPushout f g):) + +instance [Mono g] : Mono (pushout.inl f g) := + pushoutCocone_inr_mono_of_isColimit + (PushoutCocone.flipIsColimit (pushoutIsPushout f g)) + +end Pushout + +end CategoryTheory.Limits.Types diff --git a/Mathlib/CategoryTheory/Limits/Types/Shapes.lean b/Mathlib/CategoryTheory/Limits/Types/Shapes.lean index 93f0608928c90e..6e7a4687cf3aa0 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Shapes.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Shapes.lean @@ -3,1002 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.CategoryTheory.Limits.Types.Colimits -import Mathlib.CategoryTheory.Limits.Types.Limits -import Mathlib.Logic.Function.Coequalizer -import Mathlib.Tactic.CategoryTheory.Elementwise +module -/-! -# Special shapes for limits in `Type`. +public import Mathlib.CategoryTheory.Limits.Types.Coequalizers +public import Mathlib.CategoryTheory.Limits.Types.Coproducts +public import Mathlib.CategoryTheory.Limits.Types.Equalizers +public import Mathlib.CategoryTheory.Limits.Types.Multiequalizer +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.CategoryTheory.Limits.Types.Pullbacks +public import Mathlib.CategoryTheory.Limits.Types.Pushouts -The general shape (co)limits defined in `CategoryTheory.Limits.Types` -are intended for use through the limits API, -and the actual implementation should mostly be considered "sealed". - -In this file, we provide definitions of the "standard" special shapes of limits in `Type`, -giving the expected definitional implementation: -* the terminal object is `PUnit` -* the binary product of `X` and `Y` is `X × Y` -* the product of a family `f : J → Type` is `Π j, f j` -* the coproduct of a family `f : J → Type` is `Σ j, f j` -* the binary coproduct of `X` and `Y` is the sum type `X ⊕ Y` -* the equalizer of a pair of maps `(g, h)` is the subtype `{x : Y // g x = h x}` -* the coequalizer of a pair of maps `(f, g)` is the quotient of `Y` by `∀ x : Y, f x ~ g x` -* the pullback of `f : X ⟶ Z` and `g : Y ⟶ Z` is the subtype `{ p : X × Y // f p.1 = g p.2 }` - of the product -* multiequalizers - -We first construct terms of `IsLimit` and `LimitCone`, and then provide isomorphisms with the -types generated by the `HasLimit` API. - -As an example, when setting up the monoidal category structure on `Type` -we use the `Types.terminalLimitCone` and `Types.binaryProductLimitCone` definitions. --/ - - -universe v u - -open CategoryTheory Limits - -namespace CategoryTheory.Limits.Types - -example : HasProducts.{v} (Type v) := inferInstance -example [UnivLE.{v, u}] : HasProducts.{v} (Type u) := inferInstance - --- This shortcut instance is required in `Mathlib/CategoryTheory/Closed/Types.lean`, --- although I don't understand why, and wish it wasn't. -instance : HasProducts.{v} (Type v) := inferInstance - -/-- A restatement of `Types.Limit.lift_π_apply` that uses `Pi.π` and `Pi.lift`. -/ --- The increased `@[simp]` priority here results in a minor speed up in --- `Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean`. -@[simp 1001] -theorem pi_lift_π_apply {β : Type v} [Small.{u} β] (f : β → Type u) {P : Type u} - (s : ∀ b, P ⟶ f b) (b : β) (x : P) : - (Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x := - congr_fun (limit.lift_π (Fan.mk P s) ⟨b⟩) x - -/-- A restatement of `Types.Limit.lift_π_apply` that uses `Pi.π` and `Pi.lift`, -with specialized universes. -/ -theorem pi_lift_π_apply' {β : Type v} (f : β → Type v) {P : Type v} - (s : ∀ b, P ⟶ f b) (b : β) (x : P) : - (Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x := by - simp - -/-- A restatement of `Types.Limit.map_π_apply` that uses `Pi.π` and `Pi.map`. -/ --- Not `@[simp]` since `simp` can prove it. -theorem pi_map_π_apply {β : Type v} [Small.{u} β] {f g : β → Type u} - (α : ∀ j, f j ⟶ g j) (b : β) (x) : - (Pi.π g b : ∏ᶜ g → g b) (Pi.map α x) = α b ((Pi.π f b : ∏ᶜ f → f b) x) := - Limit.map_π_apply.{v, u} _ _ _ - -/-- A restatement of `Types.Limit.map_π_apply` that uses `Pi.π` and `Pi.map`, -with specialized universes. -/ -theorem pi_map_π_apply' {β : Type v} {f g : β → Type v} (α : ∀ j, f j ⟶ g j) (b : β) (x) : - (Pi.π g b : ∏ᶜ g → g b) (Pi.map α x) = α b ((Pi.π f b : ∏ᶜ f → f b) x) := by - simp - -/-- The category of types has `PUnit` as a terminal object. -/ -def terminalLimitCone : Limits.LimitCone (Functor.empty (Type u)) where - -- Porting note: tidy was able to fill the structure automatically - cone := - { pt := PUnit - π := (Functor.uniqueFromEmpty _).hom } - isLimit := - { lift := fun _ _ => PUnit.unit - fac := fun _ => by rintro ⟨⟨⟩⟩ } - -/-- The terminal object in `Type u` is `PUnit`. -/ -noncomputable def terminalIso : ⊤_ Type u ≅ PUnit := - limit.isoLimitCone terminalLimitCone.{u, 0} - -/-- The terminal object in `Type u` is `PUnit`. -/ -noncomputable def isTerminalPunit : IsTerminal (PUnit : Type u) := - terminalIsTerminal.ofIso terminalIso - -noncomputable instance : Inhabited (⊤_ (Type u)) := - ⟨@terminal.from (Type u) _ _ (ULift (Fin 1)) (ULift.up 0)⟩ - -instance : Subsingleton (⊤_ (Type u)) := ⟨fun a b => - congr_fun (@Subsingleton.elim (_ ⟶ ⊤_ (Type u)) _ - (fun _ => a) (fun _ => b)) (ULift.up (0 : Fin 1))⟩ - -noncomputable instance : Unique (⊤_ (Type u)) := Unique.mk' _ - -/-- A type is terminal if and only if it contains exactly one element. -/ -noncomputable def isTerminalEquivUnique (X : Type u) : IsTerminal X ≃ Unique X := - equivOfSubsingletonOfSubsingleton - (fun h => ((Iso.toEquiv (terminalIsoIsTerminal h).symm).unique)) - (fun _ => IsTerminal.ofIso terminalIsTerminal (Equiv.toIso (Equiv.ofUnique _ _))) - -/-- A type is terminal if and only if it is isomorphic to `PUnit`. -/ -noncomputable def isTerminalEquivIsoPUnit (X : Type u) : IsTerminal X ≃ (X ≅ PUnit) := by - calc - IsTerminal X ≃ Unique X := isTerminalEquivUnique _ - _ ≃ (X ≃ PUnit.{u + 1}) := uniqueEquivEquivUnique _ _ - _ ≃ (X ≅ PUnit) := equivEquivIso - -/-- The category of types has `PEmpty` as an initial object. -/ -def initialColimitCocone : Limits.ColimitCocone (Functor.empty (Type u)) where - -- Porting note: tidy was able to fill the structure automatically - cocone := - { pt := PEmpty - ι := (Functor.uniqueFromEmpty _).inv } - isColimit := - { desc := fun _ => by rintro ⟨⟩ - fac := fun _ => by rintro ⟨⟨⟩⟩ - uniq := fun _ _ _ => by funext x; cases x } - -/-- The initial object in `Type u` is `PEmpty`. -/ -noncomputable def initialIso : ⊥_ Type u ≅ PEmpty := - colimit.isoColimitCocone initialColimitCocone.{u, 0} - -/-- The initial object in `Type u` is `PEmpty`. -/ -noncomputable def isInitialPunit : IsInitial (PEmpty : Type u) := - initialIsInitial.ofIso initialIso - -/-- An object in `Type u` is initial if and only if it is empty. -/ -lemma initial_iff_empty (X : Type u) : Nonempty (IsInitial X) ↔ IsEmpty X := by - constructor - · intro ⟨h⟩ - exact Function.isEmpty (IsInitial.to h PEmpty) - · intro h - exact ⟨IsInitial.ofIso Types.isInitialPunit <| Equiv.toIso <| Equiv.equivOfIsEmpty PEmpty X⟩ - -open CategoryTheory.Limits.WalkingPair - --- We manually generate the other projection lemmas since the simp-normal form for the legs is --- otherwise not created correctly. -/-- The product type `X × Y` forms a cone for the binary product of `X` and `Y`. -/ -@[simps! pt] -def binaryProductCone (X Y : Type u) : BinaryFan X Y := - BinaryFan.mk _root_.Prod.fst _root_.Prod.snd - -@[simp] -theorem binaryProductCone_fst (X Y : Type u) : (binaryProductCone X Y).fst = _root_.Prod.fst := - rfl - -@[simp] -theorem binaryProductCone_snd (X Y : Type u) : (binaryProductCone X Y).snd = _root_.Prod.snd := - rfl - -/-- The product type `X × Y` is a binary product for `X` and `Y`. -/ -@[simps] -def binaryProductLimit (X Y : Type u) : IsLimit (binaryProductCone X Y) where - lift (s : BinaryFan X Y) x := (s.fst x, s.snd x) - fac _ j := Discrete.recOn j fun j => WalkingPair.casesOn j rfl rfl - uniq _ _ w := funext fun x => Prod.ext (congr_fun (w ⟨left⟩) x) (congr_fun (w ⟨right⟩) x) - -/-- The category of types has `X × Y`, the usual Cartesian product, -as the binary product of `X` and `Y`. --/ -@[simps] -def binaryProductLimitCone (X Y : Type u) : Limits.LimitCone (pair X Y) := - ⟨_, binaryProductLimit X Y⟩ - -/-- The categorical binary product in `Type u` is Cartesian product. -/ -noncomputable def binaryProductIso (X Y : Type u) : Limits.prod X Y ≅ X × Y := - limit.isoLimitCone (binaryProductLimitCone X Y) - -@[elementwise (attr := simp)] -theorem binaryProductIso_hom_comp_fst (X Y : Type u) : - (binaryProductIso X Y).hom ≫ _root_.Prod.fst = Limits.prod.fst := - limit.isoLimitCone_hom_π (binaryProductLimitCone X Y) ⟨WalkingPair.left⟩ - -@[elementwise (attr := simp)] -theorem binaryProductIso_hom_comp_snd (X Y : Type u) : - (binaryProductIso X Y).hom ≫ _root_.Prod.snd = Limits.prod.snd := - limit.isoLimitCone_hom_π (binaryProductLimitCone X Y) ⟨WalkingPair.right⟩ - -@[elementwise (attr := simp)] -theorem binaryProductIso_inv_comp_fst (X Y : Type u) : - (binaryProductIso X Y).inv ≫ Limits.prod.fst = _root_.Prod.fst := - limit.isoLimitCone_inv_π (binaryProductLimitCone X Y) ⟨WalkingPair.left⟩ - -@[elementwise (attr := simp)] -theorem binaryProductIso_inv_comp_snd (X Y : Type u) : - (binaryProductIso X Y).inv ≫ Limits.prod.snd = _root_.Prod.snd := - limit.isoLimitCone_inv_π (binaryProductLimitCone X Y) ⟨WalkingPair.right⟩ - -/-- The functor which sends `X, Y` to the product type `X × Y`. -/ -@[simps] -def binaryProductFunctor : Type u ⥤ Type u ⥤ Type u where - obj X := - { obj := fun Y => X × Y - map := fun { _ Y₂} f => (binaryProductLimit X Y₂).lift - (BinaryFan.mk _root_.Prod.fst (_root_.Prod.snd ≫ f)) } - map {X₁ X₂} f := - { app := fun Y => - (binaryProductLimit X₂ Y).lift (BinaryFan.mk (_root_.Prod.fst ≫ f) _root_.Prod.snd) } - -/-- The product functor given by the instance `HasBinaryProducts (Type u)` is isomorphic to the -explicit binary product functor given by the product type. --/ -noncomputable def binaryProductIsoProd : binaryProductFunctor ≅ (prod.functor : Type u ⥤ _) := by - refine NatIso.ofComponents (fun X => ?_) (fun _ => ?_) - · refine NatIso.ofComponents (fun Y => ?_) (fun _ => ?_) - · exact ((limit.isLimit _).conePointUniqueUpToIso (binaryProductLimit X Y)).symm - · apply Limits.prod.hom_ext <;> simp <;> rfl - · ext : 2 - apply Limits.prod.hom_ext <;> simp <;> rfl - -/-- The sum type `X ⊕ Y` forms a cocone for the binary coproduct of `X` and `Y`. -/ -@[simps!] -def binaryCoproductCocone (X Y : Type u) : Cocone (pair X Y) := - BinaryCofan.mk Sum.inl Sum.inr - -/-- The sum type `X ⊕ Y` is a binary coproduct for `X` and `Y`. -/ -@[simps] -def binaryCoproductColimit (X Y : Type u) : IsColimit (binaryCoproductCocone X Y) where - desc := fun s : BinaryCofan X Y => Sum.elim s.inl s.inr - fac _ j := Discrete.recOn j fun j => WalkingPair.casesOn j rfl rfl - uniq _ _ w := funext fun x => Sum.casesOn x (congr_fun (w ⟨left⟩)) (congr_fun (w ⟨right⟩)) - -/-- The category of types has `X ⊕ Y`, -as the binary coproduct of `X` and `Y`. --/ -def binaryCoproductColimitCocone (X Y : Type u) : Limits.ColimitCocone (pair X Y) := - ⟨_, binaryCoproductColimit X Y⟩ - -/-- The categorical binary coproduct in `Type u` is the sum `X ⊕ Y`. -/ -noncomputable def binaryCoproductIso (X Y : Type u) : Limits.coprod X Y ≅ X ⊕ Y := - colimit.isoColimitCocone (binaryCoproductColimitCocone X Y) - ---open CategoryTheory.Type - -@[elementwise (attr := simp)] -theorem binaryCoproductIso_inl_comp_hom (X Y : Type u) : - Limits.coprod.inl ≫ (binaryCoproductIso X Y).hom = Sum.inl := - colimit.isoColimitCocone_ι_hom (binaryCoproductColimitCocone X Y) ⟨WalkingPair.left⟩ - -@[elementwise (attr := simp)] -theorem binaryCoproductIso_inr_comp_hom (X Y : Type u) : - Limits.coprod.inr ≫ (binaryCoproductIso X Y).hom = Sum.inr := - colimit.isoColimitCocone_ι_hom (binaryCoproductColimitCocone X Y) ⟨WalkingPair.right⟩ - -@[elementwise (attr := simp)] -theorem binaryCoproductIso_inl_comp_inv (X Y : Type u) : - ↾(Sum.inl : X ⟶ X ⊕ Y) ≫ (binaryCoproductIso X Y).inv = Limits.coprod.inl := - colimit.isoColimitCocone_ι_inv (binaryCoproductColimitCocone X Y) ⟨WalkingPair.left⟩ - -@[elementwise (attr := simp)] -theorem binaryCoproductIso_inr_comp_inv (X Y : Type u) : - ↾(Sum.inr : Y ⟶ X ⊕ Y) ≫ (binaryCoproductIso X Y).inv = Limits.coprod.inr := - colimit.isoColimitCocone_ι_inv (binaryCoproductColimitCocone X Y) ⟨WalkingPair.right⟩ - -open Function (Injective) - -theorem binaryCofan_isColimit_iff {X Y : Type u} (c : BinaryCofan X Y) : - Nonempty (IsColimit c) ↔ - Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by - classical - constructor - · rintro ⟨h⟩ - rw [← show _ = c.inl from - h.comp_coconePointUniqueUpToIso_inv (binaryCoproductColimit X Y) ⟨WalkingPair.left⟩, - ← show _ = c.inr from - h.comp_coconePointUniqueUpToIso_inv (binaryCoproductColimit X Y) ⟨WalkingPair.right⟩] - dsimp [binaryCoproductCocone] - refine - ⟨(h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.injective.comp - Sum.inl_injective, - (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.injective.comp - Sum.inr_injective, ?_⟩ - rw [types_comp, Set.range_comp, ← eq_compl_iff_isCompl, types_comp, Set.range_comp _ Sum.inr] - erw [← Set.image_compl_eq - (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.bijective] - simp - · rintro ⟨h₁, h₂, h₃⟩ - have : ∀ x, x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr := by - rw [eq_compl_iff_isCompl.mpr h₃.symm] - exact fun _ => or_not - refine ⟨BinaryCofan.IsColimit.mk _ ?_ ?_ ?_ ?_⟩ - · intro T f g x - exact - if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective _ h₁).symm ⟨x, h⟩) - else g ((Equiv.ofInjective _ h₂).symm ⟨x, (this x).resolve_left h⟩) - · intro T f g - funext x - simp [h₁.eq_iff] - · intro T f g - funext x - dsimp - simp only [Set.mem_range, Equiv.ofInjective_symm_apply, - dite_eq_right_iff, forall_exists_index] - intro y e - have : c.inr x ∈ Set.range c.inl ⊓ Set.range c.inr := ⟨⟨_, e⟩, ⟨_, rfl⟩⟩ - rw [disjoint_iff.mp h₃.1] at this - exact this.elim - · rintro T _ _ m rfl rfl - funext x - dsimp - split_ifs <;> exact congr_arg _ (Equiv.apply_ofInjective_symm _ ⟨_, _⟩).symm - -/-- Any monomorphism in `Type` is a coproduct injection. -/ -noncomputable def isCoprodOfMono {X Y : Type u} (f : X ⟶ Y) [Mono f] : - IsColimit (BinaryCofan.mk f (Subtype.val : ↑(Set.range f)ᶜ → Y)) := by - apply Nonempty.some - rw [binaryCofan_isColimit_iff] - refine ⟨(mono_iff_injective f).mp inferInstance, Subtype.val_injective, ?_⟩ - symm - rw [← eq_compl_iff_isCompl] - exact Subtype.range_val - -/-- -The category of types has `Π j, f j` as the product of a type family `f : J → Type max v u`. --/ -def productLimitCone {J : Type v} (F : J → Type max v u) : - Limits.LimitCone (Discrete.functor F) where - cone := - { pt := ∀ j, F j - π := Discrete.natTrans (fun ⟨j⟩ f => f j) } - isLimit := - { lift := fun s x j => s.π.app ⟨j⟩ x - uniq := fun _ _ w => funext fun x => funext fun j => (congr_fun (w ⟨j⟩) x :) } - -/-- The categorical product in `Type max v u` is the type-theoretic product `Π j, F j`. -/ -noncomputable def productIso {J : Type v} (F : J → Type max v u) : ∏ᶜ F ≅ ∀ j, F j := - limit.isoLimitCone (productLimitCone.{v, u} F) - -@[simp, elementwise (attr := simp)] -theorem productIso_hom_comp_eval {J : Type v} (F : J → Type max v u) (j : J) : - ((productIso.{v, u} F).hom ≫ fun f => f j) = Pi.π F j := - rfl - -@[elementwise (attr := simp)] -theorem productIso_inv_comp_π {J : Type v} (F : J → Type max v u) (j : J) : - (productIso.{v, u} F).inv ≫ Pi.π F j = fun f => f j := - limit.isoLimitCone_inv_π (productLimitCone.{v, u} F) ⟨j⟩ - -namespace Small - -variable {J : Type v} (F : J → Type u) [Small.{u} J] - -/-- -A variant of `productLimitCone` using a `Small` hypothesis rather than a function to `Type`. --/ -noncomputable def productLimitCone : - Limits.LimitCone (Discrete.functor F) where - cone := - { pt := Shrink (∀ j, F j) - π := Discrete.natTrans (fun ⟨j⟩ f => (equivShrink (∀ j, F j)).symm f j) } - isLimit := - have : Small.{u} (∀ j, F j) := inferInstance - { lift := fun s x => (equivShrink _) (fun j => s.π.app ⟨j⟩ x) - uniq := fun s m w => funext fun x => Shrink.ext <| funext fun j => by - simpa using (congr_fun (w ⟨j⟩) x :) } - -/-- The categorical product in `Type u` indexed in `Type v` -is the type-theoretic product `Π j, F j`, after shrinking back to `Type u`. -/ -noncomputable def productIso : - (∏ᶜ F : Type u) ≅ Shrink.{u} (∀ j, F j) := - limit.isoLimitCone (productLimitCone.{v, u} F) - -@[elementwise (attr := simp)] -theorem productIso_hom_comp_eval (j : J) : - ((productIso.{v, u} F).hom ≫ fun f => (equivShrink (∀ j, F j)).symm f j) = Pi.π F j := - limit.isoLimitCone_hom_π (productLimitCone.{v, u} F) ⟨j⟩ - -@[elementwise (attr := simp)] -theorem productIso_inv_comp_π (j : J) : - (productIso.{v, u} F).inv ≫ Pi.π F j = fun f => ((equivShrink (∀ j, F j)).symm f) j := - limit.isoLimitCone_inv_π (productLimitCone.{v, u} F) ⟨j⟩ - -end Small - -/-- The category of types has `Σ j, f j` as the coproduct of a type family `f : J → Type`. --/ -def coproductColimitCocone {J : Type v} (F : J → Type max v u) : - Limits.ColimitCocone (Discrete.functor F) where - cocone := - { pt := Σ j, F j - ι := Discrete.natTrans (fun ⟨j⟩ x => ⟨j, x⟩)} - isColimit := - { desc := fun s x => s.ι.app ⟨x.1⟩ x.2 - uniq := fun s m w => by - funext ⟨j, x⟩ - exact congr_fun (w ⟨j⟩) x } - -/-- The categorical coproduct in `Type u` is the type-theoretic coproduct `Σ j, F j`. -/ -noncomputable def coproductIso {J : Type v} (F : J → Type max v u) : ∐ F ≅ Σ j, F j := - colimit.isoColimitCocone (coproductColimitCocone F) - -@[elementwise (attr := simp)] -theorem coproductIso_ι_comp_hom {J : Type v} (F : J → Type max v u) (j : J) : - Sigma.ι F j ≫ (coproductIso F).hom = fun x : F j => (⟨j, x⟩ : Σ j, F j) := - colimit.isoColimitCocone_ι_hom (coproductColimitCocone F) ⟨j⟩ - -@[elementwise (attr := simp)] -theorem coproductIso_mk_comp_inv {J : Type v} (F : J → Type max v u) (j : J) : - (↾fun x : F j => (⟨j, x⟩ : Σ j, F j)) ≫ (coproductIso F).inv = Sigma.ι F j := - rfl - -section Fork - -variable {X Y Z : Type u} (f : X ⟶ Y) {g h : Y ⟶ Z} (w : f ≫ g = f ≫ h) - -/-- -Show the given fork in `Type u` is an equalizer given that any element in the "difference kernel" -comes from `X`. -The converse of `unique_of_type_equalizer`. --/ -noncomputable def typeEqualizerOfUnique (t : ∀ y : Y, g y = h y → ∃! x : X, f x = y) : - IsLimit (Fork.ofι _ w) := - Fork.IsLimit.mk' _ fun s => by - refine ⟨fun i => ?_, ?_, ?_⟩ - · apply Classical.choose (t (s.ι i) _) - apply congr_fun s.condition i - · funext i - exact (Classical.choose_spec (t (s.ι i) (congr_fun s.condition i))).1 - · intro m hm - funext i - exact (Classical.choose_spec (t (s.ι i) (congr_fun s.condition i))).2 _ (congr_fun hm i) - -/-- The converse of `type_equalizer_of_unique`. -/ -theorem unique_of_type_equalizer (t : IsLimit (Fork.ofι _ w)) (y : Y) (hy : g y = h y) : - ∃! x : X, f x = y := by - let y' : PUnit ⟶ Y := fun _ => y - have hy' : y' ≫ g = y' ≫ h := funext fun _ => hy - refine ⟨(Fork.IsLimit.lift' t _ hy').1 ⟨⟩, congr_fun (Fork.IsLimit.lift' t y' _).2 ⟨⟩, ?_⟩ - intro x' hx' - suffices (fun _ : PUnit => x') = (Fork.IsLimit.lift' t y' hy').1 by - rw [← this] - apply Fork.IsLimit.hom_ext t - funext ⟨⟩ - apply hx'.trans (congr_fun (Fork.IsLimit.lift' t _ hy').2 ⟨⟩).symm - -theorem type_equalizer_iff_unique : - Nonempty (IsLimit (Fork.ofι _ w)) ↔ ∀ y : Y, g y = h y → ∃! x : X, f x = y := - ⟨fun i => unique_of_type_equalizer _ _ (Classical.choice i), fun k => - ⟨typeEqualizerOfUnique f w k⟩⟩ - -/-- Show that the subtype `{x : Y // g x = h x}` is an equalizer for the pair `(g,h)`. -/ -def equalizerLimit : Limits.LimitCone (parallelPair g h) where - cone := Fork.ofι (Subtype.val : { x : Y // g x = h x } → Y) (funext Subtype.prop) - isLimit := - Fork.IsLimit.mk' _ fun s => - ⟨fun i => ⟨s.ι i, by apply congr_fun s.condition i⟩, rfl, fun hm => - funext fun x => Subtype.ext (congr_fun hm x)⟩ - -variable (g h) - -/-- The categorical equalizer in `Type u` is `{x : Y // g x = h x}`. -/ -noncomputable def equalizerIso : equalizer g h ≅ { x : Y // g x = h x } := - limit.isoLimitCone equalizerLimit - -@[elementwise (attr := simp)] -theorem equalizerIso_hom_comp_subtype : (equalizerIso g h).hom ≫ Subtype.val = equalizer.ι g h := by - rfl - -@[elementwise (attr := simp)] -theorem equalizerIso_inv_comp_ι : (equalizerIso g h).inv ≫ equalizer.ι g h = Subtype.val := - limit.isoLimitCone_inv_π equalizerLimit WalkingParallelPair.zero - -end Fork - -section Cofork - -variable {X Y Z : Type u} (f g : X ⟶ Y) - -/-- Show that the quotient by the relation generated by `f(x) ~ g(x)` -is a coequalizer for the pair `(f, g)`. --/ -def coequalizerColimit : Limits.ColimitCocone (parallelPair f g) where - cocone := - Cofork.ofπ (Function.Coequalizer.mk f g) (funext fun x => Function.Coequalizer.condition f g x) - isColimit := - Cofork.IsColimit.mk _ - (fun s ↦ Function.Coequalizer.desc f g s.π s.condition) - (fun _ ↦ rfl) - (fun _ _ hm ↦ funext (fun x ↦ Quot.inductionOn x (congr_fun hm))) - -/-- If `π : Y ⟶ Z` is an coequalizer for `(f, g)`, and `U ⊆ Y` such that `f ⁻¹' U = g ⁻¹' U`, -then `π ⁻¹' (π '' U) = U`. --/ -theorem coequalizer_preimage_image_eq_of_preimage_eq (π : Y ⟶ Z) (e : f ≫ π = g ≫ π) - (h : IsColimit (Cofork.ofπ π e)) (U : Set Y) (H : f ⁻¹' U = g ⁻¹' U) : π ⁻¹' (π '' U) = U := by - have lem : ∀ x y, Function.Coequalizer.Rel f g x y → (x ∈ U ↔ y ∈ U) := by - rintro _ _ ⟨x⟩ - change x ∈ f ⁻¹' U ↔ x ∈ g ⁻¹' U - rw [H] - have eqv : _root_.Equivalence fun x y => x ∈ U ↔ y ∈ U := by - aesop (add safe constructors _root_.Equivalence) - ext - constructor - · rw [← - show _ = π from - h.comp_coconePointUniqueUpToIso_inv (coequalizerColimit f g).2 - WalkingParallelPair.one] - rintro ⟨y, hy, e'⟩ - dsimp at e' - replace e' := - (mono_iff_injective - (h.coconePointUniqueUpToIso (coequalizerColimit f g).isColimit).inv).mp - inferInstance e' - exact (eqv.eqvGen_iff.mp (Relation.EqvGen.mono lem (Quot.eqvGen_exact e'))).mp hy - · exact fun hx => ⟨_, hx, rfl⟩ - -/-- The categorical coequalizer in `Type u` is the quotient by `f g ~ g x`. -/ -noncomputable def coequalizerIso : coequalizer f g ≅ Function.Coequalizer f g := - colimit.isoColimitCocone (coequalizerColimit f g) - -@[elementwise (attr := simp)] -theorem coequalizerIso_π_comp_hom : - coequalizer.π f g ≫ (coequalizerIso f g).hom = Function.Coequalizer.mk f g := - colimit.isoColimitCocone_ι_hom (coequalizerColimit f g) WalkingParallelPair.one - -@[elementwise (attr := simp)] -theorem coequalizerIso_quot_comp_inv : - ↾Function.Coequalizer.mk f g ≫ (coequalizerIso f g).inv = coequalizer.π f g := - rfl - -end Cofork - -section Pullback - --- #synth HasPullbacks.{u} (Type u) -instance : HasPullbacks.{u} (Type u) := - -- FIXME does not work via `inferInstance` despite `#synth HasPullbacks.{u} (Type u)` succeeding. - -- https://github.com/leanprover-community/mathlib4/issues/5752 - -- inferInstance - hasPullbacks_of_hasWidePullbacks.{u} (Type u) - -instance : HasPushouts.{u} (Type u) := - hasPushouts_of_hasWidePushouts.{u} (Type u) - -variable {X Y Z : Type u} {X' Y' Z' : Type v} -variable (f : X ⟶ Z) (g : Y ⟶ Z) (f' : X' ⟶ Z') (g' : Y' ⟶ Z') - -/-- The usual explicit pullback in the category of types, as a subtype of the product. -The full `LimitCone` data is bundled as `pullbackLimitCone f g`. --/ -abbrev PullbackObj : Type u := - { p : X × Y // f p.1 = g p.2 } - --- `PullbackObj f g` comes with a coercion to the product type `X × Y`. -example (p : PullbackObj f g) : X × Y := - p - -/-- The explicit pullback cone on `PullbackObj f g`. -This is bundled with the `IsLimit` data as `pullbackLimitCone f g`. --/ -abbrev pullbackCone : Limits.PullbackCone f g := - PullbackCone.mk (fun p : PullbackObj f g => p.1.1) (fun p => p.1.2) (funext fun p => p.2) - -/-- The explicit pullback in the category of types, bundled up as a `LimitCone` -for given `f` and `g`. --/ -@[simps] -def pullbackLimitCone (f : X ⟶ Z) (g : Y ⟶ Z) : Limits.LimitCone (cospan f g) where - cone := pullbackCone f g - isLimit := - PullbackCone.isLimitAux _ (fun s x => ⟨⟨s.fst x, s.snd x⟩, congr_fun s.condition x⟩) - (by aesop) (by aesop) fun _ _ w => - funext fun x => - Subtype.ext <| - Prod.ext (congr_fun (w WalkingCospan.left) x) (congr_fun (w WalkingCospan.right) x) - -end Pullback - -end Types - -section Pullback - -variable {X Y S : Type v} {f : X ⟶ S} {g : Y ⟶ S} {c : PullbackCone f g} - -namespace PullbackCone - -namespace IsLimit - -variable (hc : IsLimit c) - -/-- A limit pullback cone in the category of types identifies to the explicit pullback. -/ -noncomputable def equivPullbackObj : c.pt ≃ Types.PullbackObj f g := - (IsLimit.conePointUniqueUpToIso hc (Types.pullbackLimitCone f g).isLimit).toEquiv - -@[simp] -lemma equivPullbackObj_apply_fst (x : c.pt) : (equivPullbackObj hc x).1.1 = c.fst x := - congr_fun (IsLimit.conePointUniqueUpToIso_hom_comp hc - (Types.pullbackLimitCone f g).isLimit .left) x - -@[simp] -lemma equivPullbackObj_apply_snd (x : c.pt) : (equivPullbackObj hc x).1.2 = c.snd x := - congr_fun (IsLimit.conePointUniqueUpToIso_hom_comp hc - (Types.pullbackLimitCone f g).isLimit .right) x - -@[simp] -lemma equivPullbackObj_symm_apply_fst (x : Types.PullbackObj f g) : - c.fst ((equivPullbackObj hc).symm x) = x.1.1 := by - obtain ⟨x, rfl⟩ := (equivPullbackObj hc).surjective x - simp - -@[simp] -lemma equivPullbackObj_symm_apply_snd (x : Types.PullbackObj f g) : - c.snd ((equivPullbackObj hc).symm x) = x.1.2 := by - obtain ⟨x, rfl⟩ := (equivPullbackObj hc).surjective x - simp - -include hc in -lemma type_ext {x y : c.pt} (h₁ : c.fst x = c.fst y) (h₂ : c.snd x = c.snd y) : x = y := - (equivPullbackObj hc).injective (by ext <;> assumption) - -end IsLimit - -variable (c) - -/-- Given `c : PullbackCone f g` in the category of types, this is -the canonical map `c.pt → Types.PullbackObj f g`. -/ -@[simps coe_fst coe_snd] -def toPullbackObj (x : c.pt) : Types.PullbackObj f g := - ⟨⟨c.fst x, c.snd x⟩, congr_fun c.condition x⟩ - -/-- A pullback cone `c` in the category of types is limit iff the -map `c.toPullbackObj : c.pt → Types.PullbackObj f g` is a bijection. -/ -noncomputable def isLimitEquivBijective : - IsLimit c ≃ Function.Bijective c.toPullbackObj where - toFun h := (IsLimit.equivPullbackObj h).bijective - invFun h := IsLimit.ofIsoLimit (Types.pullbackLimitCone f g).isLimit - (Iso.symm (PullbackCone.ext (Equiv.ofBijective _ h).toIso)) - left_inv _ := Subsingleton.elim _ _ - -end PullbackCone - -end Pullback - -namespace Types - -section Pullback - -open CategoryTheory.Limits.WalkingCospan - -variable {W X Y Z : Type u} -variable (f : X ⟶ Z) (g : Y ⟶ Z) - -/-- The pullback given by the instance `HasPullbacks (Type u)` is isomorphic to the -explicit pullback object given by `PullbackObj`. --/ -noncomputable def pullbackIsoPullback : pullback f g ≅ PullbackObj f g := - (PullbackCone.IsLimit.equivPullbackObj (pullbackIsPullback f g)).toIso - -@[simp] -theorem pullbackIsoPullback_hom_fst (p : pullback f g) : - ((pullbackIsoPullback f g).hom p : X × Y).fst = (pullback.fst f g) p := - PullbackCone.IsLimit.equivPullbackObj_apply_fst (pullbackIsPullback f g) p - -@[simp] -theorem pullbackIsoPullback_hom_snd (p : pullback f g) : - ((pullbackIsoPullback f g).hom p : X × Y).snd = (pullback.snd f g) p := - PullbackCone.IsLimit.equivPullbackObj_apply_snd (pullbackIsPullback f g) p - -@[simp] -theorem pullbackIsoPullback_inv_fst_apply (x : (Types.pullbackCone f g).pt) : - (pullback.fst f g) ((pullbackIsoPullback f g).inv x) = (fun p => (p.1 : X × Y).fst) x := - PullbackCone.IsLimit.equivPullbackObj_symm_apply_fst (pullbackIsPullback f g) x - -@[simp] -theorem pullbackIsoPullback_inv_snd_apply (x : (Types.pullbackCone f g).pt) : - (pullback.snd f g) ((pullbackIsoPullback f g).inv x) = (fun p => (p.1 : X × Y).snd) x := - PullbackCone.IsLimit.equivPullbackObj_symm_apply_snd (pullbackIsPullback f g) x - -@[simp] -theorem pullbackIsoPullback_inv_fst : - (pullbackIsoPullback f g).inv ≫ pullback.fst _ _ = fun p => (p.1 : X × Y).fst := by aesop - -@[simp] -theorem pullbackIsoPullback_inv_snd : - (pullbackIsoPullback f g).inv ≫ pullback.snd _ _ = fun p => (p.1 : X × Y).snd := by aesop - -end Pullback - -section Pushout - -variable {S X₁ X₂ : Type u} (f : S ⟶ X₁) (g : S ⟶ X₂) - -/-- The pushout of two maps `f : S ⟶ X₁` and `g : S ⟶ X₂` is the quotient -by the equivalence relation on `X₁ ⊕ X₂` generated by this relation. -/ -inductive Pushout.Rel (f : S ⟶ X₁) (g : S ⟶ X₂) : X₁ ⊕ X₂ → X₁ ⊕ X₂ → Prop - | inl_inr (s : S) : Pushout.Rel f g (Sum.inl (f s)) (Sum.inr (g s)) - -/-- Construction of the pushout in the category of types, as a quotient of `X₁ ⊕ X₂`. -/ -def Pushout : Type u := _root_.Quot (Pushout.Rel f g) - -/-- In case `f : S ⟶ X₁` is a monomorphism, this relation is the equivalence relation -generated by `Pushout.Rel f g`. -/ -inductive Pushout.Rel' : X₁ ⊕ X₂ → X₁ ⊕ X₂ → Prop - | refl (x : X₁ ⊕ X₂) : Rel' x x - | inl_inl (x₀ y₀ : S) (h : g x₀ = g y₀) : Rel' (Sum.inl (f x₀)) (Sum.inl (f y₀)) - | inl_inr (s : S) : Rel' (Sum.inl (f s)) (Sum.inr (g s)) - | inr_inl (s : S) : Rel' (Sum.inr (g s)) (Sum.inl (f s)) - -/-- The quotient of `X₁ ⊕ X₂` by the relation `PushoutRel' f g`. -/ -def Pushout' : Type u := _root_.Quot (Pushout.Rel' f g) - -namespace Pushout - -/-- The left inclusion in the constructed pushout `Pushout f g`. -/ -@[simp] -def inl : X₁ ⟶ Pushout f g := fun x => Quot.mk _ (Sum.inl x) - -/-- The right inclusion in the constructed pushout `Pushout f g`. -/ -@[simp] -def inr : X₂ ⟶ Pushout f g := fun x => Quot.mk _ (Sum.inr x) - -lemma condition : f ≫ inl f g = g ≫ inr f g := by - ext x - exact Quot.sound (Rel.inl_inr x) - -/-- The constructed pushout cocone in the category of types. -/ -@[simps!] -def cocone : PushoutCocone f g := PushoutCocone.mk _ _ (condition f g) - -/-- The cocone `cocone f g` is colimit. -/ -def isColimitCocone : IsColimit (cocone f g) := - PushoutCocone.IsColimit.mk _ (fun s => Quot.lift (fun x => match x with - | Sum.inl x₁ => s.inl x₁ - | Sum.inr x₂ => s.inr x₂) (by - rintro _ _ ⟨t⟩ - exact congr_fun s.condition t)) (fun _ => rfl) (fun _ => rfl) (fun s m h₁ h₂ => by - ext ⟨x₁ | x₂⟩ - · exact congr_fun h₁ x₁ - · exact congr_fun h₂ x₂) - -@[simp] -lemma inl_rel'_inl_iff (x₁ y₁ : X₁) : - Rel' f g (Sum.inl x₁) (Sum.inl y₁) ↔ x₁ = y₁ ∨ - ∃ (x₀ y₀ : S) (_ : g x₀ = g y₀), x₁ = f x₀ ∧ y₁ = f y₀ := by - constructor - · rintro (_ | ⟨_, _, h⟩) - · exact Or.inl rfl - · exact Or.inr ⟨_, _, h, rfl, rfl⟩ - · rintro (rfl | ⟨_, _, h, rfl, rfl⟩) - · apply Rel'.refl - · exact Rel'.inl_inl _ _ h - -@[simp] -lemma inl_rel'_inr_iff (x₁ : X₁) (x₂ : X₂) : - Rel' f g (Sum.inl x₁) (Sum.inr x₂) ↔ - ∃ (s : S), x₁ = f s ∧ x₂ = g s := by - constructor - · rintro ⟨_⟩ - exact ⟨_, rfl, rfl⟩ - · rintro ⟨s, rfl, rfl⟩ - exact Rel'.inl_inr _ - -@[simp] -lemma inr_rel'_inr_iff (x₂ y₂ : X₂) : - Rel' f g (Sum.inr x₂) (Sum.inr y₂) ↔ x₂ = y₂ := by - constructor - · rintro ⟨_⟩ - rfl - · rintro rfl - apply Rel'.refl - -variable {f g} - -lemma Rel'.symm {x y : X₁ ⊕ X₂} (h : Rel' f g x y) : - Rel' f g y x := by - obtain _ | ⟨_, _, h⟩ | _ | _ := h - · apply Rel'.refl - · exact Rel'.inl_inl _ _ h.symm - · exact Rel'.inr_inl _ - · exact Rel'.inl_inr _ - -variable (f g) - -lemma equivalence_rel' [Mono f] : _root_.Equivalence (Rel' f g) where - refl := Rel'.refl - symm h := h.symm - trans := by - rintro x y z (_ | ⟨_, _, h⟩ | s | _) hyz - · exact hyz - · obtain z₁ | z₂ := z - · rw [inl_rel'_inl_iff] at hyz - obtain rfl | ⟨_, _, h', h'', rfl⟩ := hyz - · exact Rel'.inl_inl _ _ h - · obtain rfl := (mono_iff_injective f).1 inferInstance h'' - exact Rel'.inl_inl _ _ (h.trans h') - · rw [inl_rel'_inr_iff] at hyz - obtain ⟨s, hs, rfl⟩ := hyz - obtain rfl := (mono_iff_injective f).1 inferInstance hs - rw [← h] - apply Rel'.inl_inr - · obtain z₁ | z₂ := z - · replace hyz := hyz.symm - rw [inl_rel'_inr_iff] at hyz - obtain ⟨s', rfl, hs'⟩ := hyz - exact Rel'.inl_inl _ _ hs' - · rw [inr_rel'_inr_iff] at hyz - subst hyz - apply Rel'.inl_inr - · obtain z₁ | z₂ := z - · rw [inl_rel'_inl_iff] at hyz - obtain rfl | ⟨_, _, h, h', rfl⟩ := hyz - · apply Rel'.inr_inl - · obtain rfl := (mono_iff_injective f).1 inferInstance h' - rw [h] - apply Rel'.inr_inl - · rw [inl_rel'_inr_iff] at hyz - obtain ⟨s, hs, rfl⟩ := hyz - obtain rfl := (mono_iff_injective f).1 inferInstance hs - apply Rel'.refl - -/-- The obvious equivalence `Pushout f g ≃ Pushout' f g`. -/ -def equivPushout' : Pushout f g ≃ Pushout' f g where - toFun := Quot.lift (Quot.mk _) (by - rintro _ _ ⟨⟩ - apply Quot.sound - apply Rel'.inl_inr) - invFun := Quot.lift (Quot.mk _) (by - rintro a b (_ | ⟨x₀, y₀, h⟩ | _ | _) - · rfl - · have h₀ : Rel f g _ _ := Rel.inl_inr x₀ - rw [Quot.sound h₀, h] - symm - apply Quot.sound - apply Rel.inl_inr - · apply Quot.sound - apply Rel.inl_inr - · symm - apply Quot.sound - apply Rel.inl_inr) - left_inv := by rintro ⟨x⟩; rfl - right_inv := by rintro ⟨x⟩; rfl - -lemma quot_mk_eq_iff [Mono f] (a b : X₁ ⊕ X₂) : - (Quot.mk _ a : Pushout f g) = Quot.mk _ b ↔ Rel' f g a b := by - rw [← (equivalence_rel' f g).quot_mk_eq_iff] - exact ⟨fun h => (equivPushout' f g).symm.injective h, - fun h => (equivPushout' f g).injective h⟩ - -lemma inl_eq_inr_iff [Mono f] (x₁ : X₁) (x₂ : X₂) : - (inl f g x₁ = inr f g x₂) ↔ - ∃ (s : S), f s = x₁ ∧ g s = x₂ := by - refine (Pushout.quot_mk_eq_iff f g (Sum.inl x₁) (Sum.inr x₂)).trans ?_ - constructor - · rintro ⟨⟩ - exact ⟨_, rfl, rfl⟩ - · rintro ⟨s, rfl, rfl⟩ - apply Rel'.inl_inr - -instance mono_inr [Mono f] : Mono (inr f g) := by - rw [mono_iff_injective] - intro x₂ y₂ h - simpa using (Pushout.quot_mk_eq_iff f g (Sum.inr x₂) (Sum.inr y₂)).1 h - -end Pushout - -variable {f g} - -lemma pushoutCocone_inl_eq_inr_imp_of_iso {c c' : PushoutCocone f g} (e : c ≅ c') - (x₁ : X₁) (x₂ : X₂) (h : c.inl x₁ = c.inr x₂) : - c'.inl x₁ = c'.inr x₂ := by - convert congr_arg e.hom.hom h - · exact congr_fun (e.hom.w WalkingSpan.left).symm x₁ - · exact congr_fun (e.hom.w WalkingSpan.right).symm x₂ - -lemma pushoutCocone_inl_eq_inr_iff_of_iso {c c' : PushoutCocone f g} (e : c ≅ c') - (x₁ : X₁) (x₂ : X₂) : - c.inl x₁ = c.inr x₂ ↔ c'.inl x₁ = c'.inr x₂ := by - constructor - · apply pushoutCocone_inl_eq_inr_imp_of_iso e - · apply pushoutCocone_inl_eq_inr_imp_of_iso e.symm - -lemma pushoutCocone_inl_eq_inr_iff_of_isColimit {c : PushoutCocone f g} (hc : IsColimit c) - (h₁ : Function.Injective f) (x₁ : X₁) (x₂ : X₂) : - c.inl x₁ = c.inr x₂ ↔ ∃ (s : S), f s = x₁ ∧ g s = x₂ := by - rw [pushoutCocone_inl_eq_inr_iff_of_iso - (Cocones.ext (IsColimit.coconePointUniqueUpToIso hc (Pushout.isColimitCocone f g)) - (by simp))] - have := (mono_iff_injective f).2 h₁ - apply Pushout.inl_eq_inr_iff - -lemma pushoutCocone_inr_mono_of_isColimit {c : PushoutCocone f g} (hc : IsColimit c) - [Mono f] : Mono c.inr := by - change Mono ((Pushout.inr f g) ≫ - ((Cocones.forget _).mapIso - (Cocones.ext (IsColimit.coconePointUniqueUpToIso hc - (Pushout.isColimitCocone f g)) (by simp))).inv) - infer_instance - -lemma pushoutCocone_inr_injective_of_isColimit {c : PushoutCocone f g} (hc : IsColimit c) - (h₁ : Function.Injective f) : Function.Injective c.inr := by - rw [← mono_iff_injective] at h₁ ⊢ - exact pushoutCocone_inr_mono_of_isColimit hc - -instance mono_inl [Mono g] : Mono (Pushout.inl f g) := - pushoutCocone_inr_mono_of_isColimit - (PushoutCocone.flipIsColimit (Pushout.isColimitCocone f g)) - -instance [Mono f] : Mono (pushout.inr f g) := - (pushoutCocone_inr_mono_of_isColimit (pushoutIsPushout f g):) - -instance [Mono g] : Mono (pushout.inl f g) := - pushoutCocone_inr_mono_of_isColimit - (PushoutCocone.flipIsColimit (pushoutIsPushout f g)) - -end Pushout - -end Types - -section Multiequalizer - -variable {J : MulticospanShape} (I : MulticospanIndex J (Type u)) - -/-- Given `I : MulticospanIndex J (Type u)`, this is a type which identifies -to the sections of the functor `I.multicospan`. -/ -@[ext] -structure MulticospanIndex.sections where - /-- The data of an element in `I.left i` for each `i : J.L`. -/ - val (i : J.L) : I.left i - property (r : J.R) : I.fst r (val _) = I.snd r (val _) - -/-- The bijection `I.sections ≃ I.multicospan.sections` when `I : MulticospanIndex (Type u)` -is a multiequalizer diagram in the category of types. -/ -@[simps] -def MulticospanIndex.sectionsEquiv : - I.sections ≃ I.multicospan.sections where - toFun s := - { val := fun i ↦ match i with - | .left i => s.val i - | .right j => I.fst j (s.val _) - property := by - rintro _ _ (_ | _ | r) - · rfl - · rfl - · exact (s.property r).symm } - invFun s := - { val := fun i ↦ s.val (.left i) - property := fun r ↦ (s.property (.fst r)).trans (s.property (.snd r)).symm } - right_inv s := by - ext (_ | r) - · rfl - · exact s.property (.fst r) - -namespace Multifork - -variable {I} -variable (c : Multifork I) - -/-- Given a multiequalizer diagram `I : MulticospanIndex (Type u)` in the category of -types and `c` a multifork for `I`, this is the canonical map `c.pt → I.sections`. -/ -@[simps] -def toSections (x : c.pt) : I.sections where - val i := c.ι i x - property r := congr_fun (c.condition r) x - -lemma toSections_fac : I.sectionsEquiv.symm ∘ Types.sectionOfCone c = c.toSections := rfl - -/-- A multifork `c : Multifork I` in the category of types is limit iff the -map `c.toSections : c.pt → I.sections` is a bijection. -/ -lemma isLimit_types_iff : Nonempty (IsLimit c) ↔ Function.Bijective c.toSections := by - rw [Types.isLimit_iff_bijective_sectionOfCone, ← toSections_fac, EquivLike.comp_bijective] - -namespace IsLimit - -variable {c} (hc : IsLimit c) - -/-- The bijection `I.sections ≃ c.pt` when `c : Multifork I` is a limit multifork -in the category of types. -/ -noncomputable def sectionsEquiv : I.sections ≃ c.pt := - (Equiv.ofBijective _ (c.isLimit_types_iff.1 ⟨hc⟩)).symm - -@[simp] -lemma sectionsEquiv_symm_apply_val (x : c.pt) (i : J.L) : - ((sectionsEquiv hc).symm x).val i = c.ι i x := rfl - -@[simp] -lemma sectionsEquiv_apply_val (s : I.sections) (i : J.L) : - c.ι i (sectionsEquiv hc s) = s.val i := by - obtain ⟨x, rfl⟩ := (sectionsEquiv hc).symm.surjective s - simp - -end IsLimit - -end Multifork - -end Multiequalizer - -end CategoryTheory.Limits +deprecated_module (since := "2025-11-04") diff --git a/Mathlib/CategoryTheory/Limits/Types/Yoneda.lean b/Mathlib/CategoryTheory/Limits/Types/Yoneda.lean index 4d3692aedb4e0f..4df2aee1386fa5 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Yoneda.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Yoneda.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton -/ -import Mathlib.CategoryTheory.Limits.Types.Limits +module + +public import Mathlib.CategoryTheory.Limits.Types.Limits /-! # Cones and limits @@ -14,6 +16,8 @@ and the type `lim Hom(F·, X)`. -/ +@[expose] public section + universe v u namespace CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Limits/Unit.lean b/Mathlib/CategoryTheory/Limits/Unit.lean index 21e52a45493b75..439cb2cf8c7f0f 100644 --- a/Mathlib/CategoryTheory/Limits/Unit.lean +++ b/Mathlib/CategoryTheory/Limits/Unit.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.PUnit -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.PUnit +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # `Discrete PUnit` has limits and colimits @@ -14,6 +16,8 @@ are (co)limit (co)cones. We also show that such (co)cones exist, and that `Discr (co)limits. -/ +@[expose] public section + universe v' v diff --git a/Mathlib/CategoryTheory/Limits/VanKampen.lean b/Mathlib/CategoryTheory/Limits/VanKampen.lean index 0a7317a3a70f76..dd620efa46b379 100644 --- a/Mathlib/CategoryTheory/Limits/VanKampen.lean +++ b/Mathlib/CategoryTheory/Limits/VanKampen.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +module + +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts /-! @@ -27,6 +29,8 @@ import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProduct -/ +@[expose] public section + open CategoryTheory.Limits CategoryTheory.Functor diff --git a/Mathlib/CategoryTheory/Limits/Yoneda.lean b/Mathlib/CategoryTheory/Limits/Yoneda.lean index fa8a755edf6f07..4cd6042dd309c0 100644 --- a/Mathlib/CategoryTheory/Limits/Yoneda.lean +++ b/Mathlib/CategoryTheory/Limits/Yoneda.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Types.Yoneda -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.Util.AssertExists +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Types.Yoneda +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.Util.AssertExists /-! # Limit properties relating to the (co)yoneda embedding. @@ -17,6 +19,8 @@ We calculate the colimit of `Y ↦ (X ⟶ Y)`, which is just `PUnit`. We also show the (co)yoneda embeddings preserve limits and jointly reflect them. -/ +@[expose] public section + assert_not_exists AddCommMonoid open Opposite CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Linear/Basic.lean b/Mathlib/CategoryTheory/Linear/Basic.lean index 59aa09130f9603..072740ddf02934 100644 --- a/Mathlib/CategoryTheory/Linear/Basic.lean +++ b/Mathlib/CategoryTheory/Linear/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Group.Invertible.Defs -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.CategoryTheory.Preadditive.Basic +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Group.Invertible.Defs +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.CategoryTheory.Preadditive.Basic /-! # Linear categories @@ -30,6 +32,8 @@ a category enriched in `Module R`. -/ +@[expose] public section + universe w v u open CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Linear/FunctorCategory.lean b/Mathlib/CategoryTheory/Linear/FunctorCategory.lean index 2796d5a4a8b9bc..fec36cb4afa305 100644 --- a/Mathlib/CategoryTheory/Linear/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Linear/FunctorCategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.FunctorCategory -import Mathlib.CategoryTheory.Linear.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory +public import Mathlib.CategoryTheory.Linear.Basic /-! # Linear structure on functor categories @@ -14,6 +16,8 @@ then `C ⥤ D` is also `R`-linear. -/ +@[expose] public section + namespace CategoryTheory open CategoryTheory.Limits Linear diff --git a/Mathlib/CategoryTheory/Linear/LinearFunctor.lean b/Mathlib/CategoryTheory/Linear/LinearFunctor.lean index bee56f8d450b47..559f9cdcd30a7b 100644 --- a/Mathlib/CategoryTheory/Linear/LinearFunctor.lean +++ b/Mathlib/CategoryTheory/Linear/LinearFunctor.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.Algebra.Module.LinearMap.Rat +module + +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.Algebra.Module.LinearMap.Rat /-! # Linear Functors @@ -21,6 +23,8 @@ for every two objects `X` and `Y`, the map -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Linear/Yoneda.lean b/Mathlib/CategoryTheory/Linear/Yoneda.lean index 7b8b9d7dcc4fb7..bf381ce9fefd97 100644 --- a/Mathlib/CategoryTheory/Linear/Yoneda.lean +++ b/Mathlib/CategoryTheory/Linear/Yoneda.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic /-! # The Yoneda embedding for `R`-linear categories @@ -18,6 +20,8 @@ TODO: `linearYoneda R C` is `R`-linear. TODO: In fact, `linearYoneda` itself is additive and `R`-linear. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Localization/Adjunction.lean b/Mathlib/CategoryTheory/Localization/Adjunction.lean index f3007debcd0003..8268e8889a82df 100644 --- a/Mathlib/CategoryTheory/Localization/Adjunction.lean +++ b/Mathlib/CategoryTheory/Localization/Adjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.CatCommSq -import Mathlib.CategoryTheory.Localization.Predicate -import Mathlib.CategoryTheory.Adjunction.FullyFaithful +module + +public import Mathlib.CategoryTheory.CatCommSq +public import Mathlib.CategoryTheory.Localization.Predicate +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful /-! # Localization of adjunctions @@ -20,6 +22,8 @@ induced adjunction `Adjunction.localization L₁ W₁ L₂ W₂ G' F' : G' ⊣ F -/ +@[expose] public section + namespace CategoryTheory open Localization Category Functor diff --git a/Mathlib/CategoryTheory/Localization/Bifunctor.lean b/Mathlib/CategoryTheory/Localization/Bifunctor.lean index fdd9a5119cb3dc..381a8b3be34186 100644 --- a/Mathlib/CategoryTheory/Localization/Bifunctor.lean +++ b/Mathlib/CategoryTheory/Localization/Bifunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Prod -import Mathlib.CategoryTheory.Functor.Currying +module + +public import Mathlib.CategoryTheory.Localization.Prod +public import Mathlib.CategoryTheory.Functor.Currying /-! # Lifting of bifunctors @@ -27,6 +29,8 @@ which lifts `F`. -/ +@[expose] public section + namespace CategoryTheory open Category Functor @@ -128,6 +132,23 @@ end section +variable (L₁ : C₁ ⥤ D₁) (L₂ : C₂ ⥤ D₂) + (W₁ : MorphismProperty C₁) (W₂ : MorphismProperty C₂) + [L₁.IsLocalization W₁] [L₂.IsLocalization W₂] + [W₁.ContainsIdentities] [W₂.ContainsIdentities] + (F : C₁ ⥤ C₂ ⥤ E) (F' : D₁ ⥤ D₂ ⥤ E) + [Lifting₂ L₁ L₂ W₁ W₂ F F'] + +noncomputable instance Lifting₂.compRight {E' : Type*} [Category E'] (G : E ⥤ E') : + Lifting₂ L₁ L₂ W₁ W₂ + (F ⋙ (whiskeringRight _ _ _).obj G) + (F' ⋙ (whiskeringRight _ _ _).obj G) := + ⟨isoWhiskerRight (iso L₁ L₂ W₁ W₂ F F') ((whiskeringRight _ _ _).obj G)⟩ + +end + +section + variable (L₁ : C₁ ⥤ D₁) (L₂ : C₂ ⥤ D₂) (W₁ : MorphismProperty C₁) (W₂ : MorphismProperty C₂) [L₁.IsLocalization W₁] [L₂.IsLocalization W₂] @@ -162,6 +183,7 @@ theorem natTrans₂_ext {τ τ' : F₁' ⟶ F₂'} /-- The natural isomorphism `F₁' ≅ F₂'` of bifunctors induced by a natural isomorphism `e : F₁ ≅ F₂` when `Lifting₂ L₁ L₂ W₁ W₂ F₁ F₁'` and `Lifting₂ L₁ L₂ W₁ W₂ F₂ F₂'` hold. -/ +@[simps] noncomputable def lift₂NatIso (e : F₁ ≅ F₂) : F₁' ≅ F₂' where hom := lift₂NatTrans L₁ L₂ W₁ W₂ F₁ F₂ F₁' F₂' e.hom inv := lift₂NatTrans L₁ L₂ W₁ W₂ F₂ F₁ F₂' F₁' e.inv diff --git a/Mathlib/CategoryTheory/Localization/Bousfield.lean b/Mathlib/CategoryTheory/Localization/Bousfield.lean index 8deb4c2538cd94..8d3de95c616ce1 100644 --- a/Mathlib/CategoryTheory/Localization/Bousfield.lean +++ b/Mathlib/CategoryTheory/Localization/Bousfield.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.Local -import Mathlib.CategoryTheory.MorphismProperty.Composition -import Mathlib.CategoryTheory.Localization.Adjunction +module + +public import Mathlib.CategoryTheory.ObjectProperty.Local +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.Localization.Adjunction /-! # Bousfield localization @@ -30,6 +32,8 @@ isomorphisms in `C`. -/ +@[expose] public section + namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/Localization/BousfieldTransfiniteComposition.lean b/Mathlib/CategoryTheory/Localization/BousfieldTransfiniteComposition.lean index 09b7aef1560251..b06bcf29207d01 100644 --- a/Mathlib/CategoryTheory/Localization/BousfieldTransfiniteComposition.lean +++ b/Mathlib/CategoryTheory/Localization/BousfieldTransfiniteComposition.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Bousfield -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition -import Mathlib.CategoryTheory.SmallObject.WellOrderInductionData +module + +public import Mathlib.CategoryTheory.Localization.Bousfield +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +public import Mathlib.CategoryTheory.SmallObject.WellOrderInductionData /-! # LeftBousfield.W is stable under transfinite compositions @@ -15,6 +17,8 @@ is stable under transfinite compositions. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean index 325ebea5fa6da2..06f2aa1ce6dbf5 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Opposite +module + +public import Mathlib.CategoryTheory.Localization.Opposite /-! # Calculus of fractions @@ -26,6 +28,8 @@ Similar results are obtained when `W` has a right calculus of fractions. -/ +@[expose] public section + namespace CategoryTheory variable {C D : Type*} [Category C] [Category D] diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/ComposableArrows.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/ComposableArrows.lean index 844829cbc59736..cbafed27b72e9d 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/ComposableArrows.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/ComposableArrows.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Andrew Yang -/ -import Mathlib.CategoryTheory.ComposableArrows -import Mathlib.CategoryTheory.Localization.CalculusOfFractions +module + +public import Mathlib.CategoryTheory.ComposableArrows.Basic +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions /-! # Essential surjectivity of the functor induced on composable arrows @@ -15,6 +17,8 @@ is essentially surjective for any `n : ℕ`. -/ +@[expose] public section + namespace CategoryTheory namespace Localization diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Fractions.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Fractions.lean index 465d603552c31f..ed93198ed314f9 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Fractions.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Fractions.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.CalculusOfFractions +module + +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions /-! # Lemmas on fractions @@ -30,6 +32,8 @@ Many definitions have been made reducible so as to ease rewrites when this API i -/ +@[expose] public section + namespace CategoryTheory variable {C D : Type*} [Category C] [Category D] (L : C ⥤ D) (W : MorphismProperty C) diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/OfAdjunction.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/OfAdjunction.lean index 4d032bcd8ebd5c..573d19b00a1ae6 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/OfAdjunction.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/OfAdjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Opposites -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Localization.CalculusOfFractions +module + +public import Mathlib.CategoryTheory.Adjunction.Opposites +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions /-! # The calculus of fractions deduced from an adjunction @@ -23,6 +25,8 @@ the class of isomorphisms by `G`. -/ +@[expose] public section + namespace CategoryTheory open MorphismProperty diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean index 08c6e48e29b16d..ff49d9d2c56e59 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Fractions -import Mathlib.CategoryTheory.Localization.HasLocalization -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Fractions +public import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # The preadditive category structure on the localized category @@ -31,6 +33,8 @@ a preadditive structure, but only one of these two constructions can be made an -/ +@[expose] public section + namespace CategoryTheory open MorphismProperty Preadditive Limits Category diff --git a/Mathlib/CategoryTheory/Localization/Composition.lean b/Mathlib/CategoryTheory/Localization/Composition.lean index f89ab36957e4e6..07aa9b5132f41f 100644 --- a/Mathlib/CategoryTheory/Localization/Composition.lean +++ b/Mathlib/CategoryTheory/Localization/Composition.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.LocalizerMorphism -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.CategoryTheory.Localization.LocalizerMorphism +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # Composition of localization functors @@ -20,6 +22,8 @@ The two implications are the lemmas `Functor.IsLocalization.comp` and -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/Construction.lean b/Mathlib/CategoryTheory/Localization/Construction.lean index a2bfe542cbb58d..dee4c6542e24fe 100644 --- a/Mathlib/CategoryTheory/Localization/Construction.lean +++ b/Mathlib/CategoryTheory/Localization/Construction.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Composition -import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy -import Mathlib.CategoryTheory.Category.Quiv +module + +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy +public import Mathlib.CategoryTheory.Category.Quiv /-! @@ -35,6 +37,8 @@ uniqueness is expressed by `uniq`. -/ +@[expose] public section + noncomputable section @@ -191,7 +195,7 @@ def objEquiv : C ≃ W.Localization where morphisms in the localized category if it contains the image of the morphisms in the original category, the inverses of the morphisms in `W` and if it is stable under composition -/ -theorem morphismProperty_is_top (P : MorphismProperty W.Localization) +theorem morphismProperty_eq_top (P : MorphismProperty W.Localization) [P.IsStableUnderComposition] (hP₁ : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), P (W.Q.map f)) (hP₂ : ∀ ⦃X Y : C⦄ (w : X ⟶ Y) (hw : W w), P (wInv w hw)) : P = ⊤ := by @@ -218,14 +222,18 @@ theorem morphismProperty_is_top (P : MorphismProperty W.Localization) · apply hP₁ · apply hP₂ +@[deprecated (since := "2025-10-21")] alias morphismProperty_is_top := morphismProperty_eq_top + /-- A `MorphismProperty` in `W.Localization` is satisfied by all morphisms in the localized category if it contains the image of the morphisms in the original category, if is stable under composition and if the property is stable by passing to inverses. -/ -theorem morphismProperty_is_top' (P : MorphismProperty W.Localization) +theorem morphismProperty_eq_top' (P : MorphismProperty W.Localization) [P.IsStableUnderComposition] (hP₁ : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), P (W.Q.map f)) (hP₂ : ∀ ⦃X Y : W.Localization⦄ (e : X ≅ Y) (_ : P e.hom), P e.inv) : P = ⊤ := - morphismProperty_is_top P hP₁ (fun _ _ w _ => hP₂ _ (hP₁ w)) + morphismProperty_eq_top P hP₁ (fun _ _ w _ => hP₂ _ (hP₁ w)) + +@[deprecated (since := "2025-10-21")] alias morphismProperty_is_top' := morphismProperty_eq_top' namespace NatTransExtension @@ -254,7 +262,7 @@ def natTransExtension {F₁ F₂ : W.Localization ⥤ D} (τ : W.Q ⋙ F₁ ⟶ suffices MorphismProperty.naturalityProperty (NatTransExtension.app τ) = ⊤ by intro X Y f simpa only [← this] using MorphismProperty.top_apply f - refine morphismProperty_is_top' + refine morphismProperty_eq_top' (MorphismProperty.naturalityProperty (NatTransExtension.app τ)) ?_ (MorphismProperty.naturalityProperty.stableUnderInverse _) intro X Y f diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Basic.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Basic.lean index cfbd0d43e75467..b58e8be4b59e65 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Basic.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Resolution -import Mathlib.CategoryTheory.Localization.Opposite -import Mathlib.CategoryTheory.GuitartExact.Opposite +module + +public import Mathlib.CategoryTheory.Localization.Resolution +public import Mathlib.CategoryTheory.Localization.Opposite +public import Mathlib.CategoryTheory.GuitartExact.Opposite /-! # Derivability structures @@ -52,6 +54,8 @@ not depend of the choice of the localization functors. * [Bruno Kahn and Georges Maltsiniotis, *Structures de dérivabilité*][KahnMaltsiniotis2008] -/ + +@[expose] public section universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean index dfb05a1632a3b9..0de4e3bdba04e5 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Basic +module + +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Basic /-! # Constructor for derivability structures @@ -29,6 +31,8 @@ This statement is essentially Lemme 6.5 in -/ +@[expose] public section + namespace CategoryTheory open Category Localization diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Derives.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Derives.lean new file mode 100644 index 00000000000000..bdaf1b2a64e966 --- /dev/null +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Derives.lean @@ -0,0 +1,106 @@ +/- +Copyright (c) 2024 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.PointwiseRightDerived + +/-! +# Deriving functors using a derivability structure + +Let `Φ : LocalizerMorphism W₁ W₂` be a localizer morphism between classes +of morphisms on categories `C₁` and `C₂`. Let `F : C₂ ⥤ H`. +When `Φ` is a left or right derivability structure, it allows to derive +the functor `F` (with respect to `W₂`) when `Φ.functor ⋙ F : C₁ ⥤ H` +inverts `W₁` (this is the most favorable case when we can apply the lemma +`hasPointwiseRightDerivedFunctor_iff_of_isRightDerivabilityStructure`). +We define `Φ.Derives F` as an abbreviation for `W₁.IsInvertedBy (Φ.functor ⋙ F)`. + +When `h : Φ.Derives F` holds and `Φ` is a right derivability structure, +we show that `F` has a right derived functor with respect to `W₂`. +Under this assumption, if `L₂ : C₂ ⥤ D₂` is a localization functor +for `W₂`, then a functor `RF : D₂ ⥤ H` equipped with a natural +transformation `α : F ⟶ L₂ ⋙ RF` is the right derived functor of `F` iff +for any `X₁ : C₁`, the map `α.app (Φ.functor.obj X₁)` is an isomorphism. + +-/ + +@[expose] public section + +universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ + +namespace CategoryTheory + +open Limits Category + +variable {C₁ : Type u₁} {C₂ : Type u₂} {H : Type u₃} + [Category.{v₁} C₁] [Category.{v₂} C₂] [Category.{v₃} H] + {D₂ : Type u₄} [Category.{v₄} D₂] + {W₁ : MorphismProperty C₁} {W₂ : MorphismProperty C₂} + +namespace LocalizerMorphism + +variable (Φ : LocalizerMorphism W₁ W₂) (F : C₂ ⥤ H) + +/-- Given a localizer morphism `Φ : LocalizerMorphism W₁ W₂` between +morphism properties on `C₁` and `C₂`, and a functor `C₂ ⥤ H`, this +is the property that `W₁` is inverted by `Φ.functor ⋙ F`. +In case `Φ` is a (left/right) derivability structure, this allows +the construction of a derived functor for `F` relatively to `W₂`. -/ +abbrev Derives : Prop := W₁.IsInvertedBy (Φ.functor ⋙ F) + +namespace Derives + +variable {Φ F} (h : Φ.Derives F) [Φ.IsRightDerivabilityStructure] + +include h + +lemma hasPointwiseRightDerivedFunctor : F.HasPointwiseRightDerivedFunctor W₂ := by + rw [hasPointwiseRightDerivedFunctor_iff_of_isRightDerivabilityStructure Φ F] + exact Functor.hasPointwiseRightDerivedFunctor_of_inverts _ h + +section + +variable {L₂ : C₂ ⥤ D₂} [L₂.IsLocalization W₂] {RF : D₂ ⥤ H} (α : F ⟶ L₂ ⋙ RF) + +lemma isIso (X₁ : C₁) [RF.IsRightDerivedFunctor α W₂] : + IsIso (α.app (Φ.functor.obj X₁)) := by + let G : W₁.Localization ⥤ H := Localization.lift (Φ.functor ⋙ F) h W₁.Q + let eG := Localization.Lifting.iso W₁.Q W₁ (Φ.functor ⋙ F) G + have := Functor.isRightDerivedFunctor_of_inverts W₁ G eG + have := (Φ.functor ⋙ F).hasPointwiseRightDerivedFunctor_of_inverts h + rw [← Φ.isIso_iff_of_isRightDerivabilityStructure W₁.Q L₂ F G eG.inv RF α] + infer_instance + +lemma isRightDerivedFunctor_of_isIso (hα : ∀ (X₁ : C₁), IsIso (α.app (Φ.functor.obj X₁))) : + RF.IsRightDerivedFunctor α W₂ := by + have := h.hasPointwiseRightDerivedFunctor + have := h.isIso (F.totalRightDerivedUnit L₂ W₂) + have := Φ.essSurj_of_hasRightResolutions L₂ + let φ := (F.totalRightDerived L₂ W₂).rightDerivedDesc (F.totalRightDerivedUnit L₂ W₂) W₂ RF α + have hφ : F.totalRightDerivedUnit L₂ W₂ ≫ Functor.whiskerLeft L₂ φ = α := + (F.totalRightDerived L₂ W₂).rightDerived_fac (F.totalRightDerivedUnit L₂ W₂) W₂ RF α + have : IsIso φ := by + rw [NatTrans.isIso_iff_isIso_app] + intro Y₂ + rw [NatTrans.isIso_app_iff_of_iso φ ((Φ.functor ⋙ L₂).objObjPreimageIso Y₂).symm] + dsimp + simp only [← hφ, NatTrans.comp_app, Functor.whiskerLeft_app, isIso_comp_left_iff] at hα + infer_instance + rw [← Functor.isRightDerivedFunctor_iff_of_iso (F.totalRightDerivedUnit L₂ W₂) α W₂ + (asIso φ) (by cat_disch)] + infer_instance + +lemma isRightDerivedFunctor_iff_isIso : + RF.IsRightDerivedFunctor α W₂ ↔ ∀ (X₁ : C₁), IsIso (α.app (Φ.functor.obj X₁)) := + ⟨fun _ _ ↦ h.isIso α _, h.isRightDerivedFunctor_of_isIso α⟩ + +end + +end Derives + +end LocalizerMorphism + +end CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfFunctorialResolutions.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfFunctorialResolutions.lean index bf85a425ec1acb..d65d90cea4fbde 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfFunctorialResolutions.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfFunctorialResolutions.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Constructor +module + +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Constructor /-! # Functorial resolutions give derivability structures @@ -18,6 +20,8 @@ the two out of three property, then `Φ` is a right derivability structure. -/ +@[expose] public section + namespace CategoryTheory variable {C₁ C₂ : Type*} [Category C₁] [Category C₂] diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean index cb1f247038e416..98c04f7c126d9b 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Basic -import Mathlib.CategoryTheory.Functor.Derived.PointwiseRightDerived -import Mathlib.CategoryTheory.GuitartExact.KanExtension -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Localization.DerivabilityStructure.Basic +public import Mathlib.CategoryTheory.Functor.Derived.PointwiseRightDerived +public import Mathlib.CategoryTheory.GuitartExact.KanExtension +public import Mathlib.CategoryTheory.Limits.Final /-! # Existence of pointwise right derived functors via derivability structures @@ -30,6 +32,8 @@ right derived functor of `F` with respect to `W₂` exists. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ namespace CategoryTheory @@ -115,12 +119,15 @@ instance : IsIso (Φ.rightDerivedFunctorComparison L₁ L₂ F F₁ α₁ F₂ exact ((F₂.isPointwiseLeftKanExtensionOfHasPointwiseRightDerivedFunctor α₂ W₂).compTwoSquare ((Φ.catCommSq L₁ L₂).iso).hom).isLeftKanExtension -lemma isIso_α_iff_of_isRightDerivabilityStructure (X : C₁) : +lemma isIso_iff_of_isRightDerivabilityStructure (X : C₁) : IsIso (α₁.app X) ↔ IsIso (α₂.app (Φ.functor.obj X)) := by rw [← isIso_comp_right_iff (α₁.app X) ((Φ.rightDerivedFunctorComparison L₁ L₂ F F₁ α₁ F₂ α₂).app (L₁.obj X)), rightDerivedFunctorComparison_fac_app, isIso_comp_right_iff] +@[deprecated (since := "2025-11-16")] alias isIso_α_iff_of_isRightDerivabilityStructure := + isIso_iff_of_isRightDerivabilityStructure + end end LocalizerMorphism diff --git a/Mathlib/CategoryTheory/Localization/Equivalence.lean b/Mathlib/CategoryTheory/Localization/Equivalence.lean index 3f76b0aaa237e8..11369610fda0af 100644 --- a/Mathlib/CategoryTheory/Localization/Equivalence.lean +++ b/Mathlib/CategoryTheory/Localization/Equivalence.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Predicate -import Mathlib.CategoryTheory.CatCommSq +module + +public import Mathlib.CategoryTheory.Localization.Predicate +public import Mathlib.CategoryTheory.CatCommSq /-! # Localization functors are preserved through equivalences @@ -20,6 +22,8 @@ that a functor between localized categories is an equivalence. -/ +@[expose] public section + namespace CategoryTheory open Category Localization diff --git a/Mathlib/CategoryTheory/Localization/FiniteProducts.lean b/Mathlib/CategoryTheory/Localization/FiniteProducts.lean index 6d9a6e22f797b7..164c18ee0b9433 100644 --- a/Mathlib/CategoryTheory/Localization/FiniteProducts.lean +++ b/Mathlib/CategoryTheory/Localization/FiniteProducts.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.ConeCategory -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Localization.Adjunction -import Mathlib.CategoryTheory.Localization.HasLocalization -import Mathlib.CategoryTheory.Localization.Pi -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.Limits.ConeCategory +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Localization.Adjunction +public import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.CategoryTheory.Localization.Pi +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! The localized category has finite products @@ -19,6 +21,8 @@ products, and `L` preserves finite products. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/HasLocalization.lean b/Mathlib/CategoryTheory/Localization/HasLocalization.lean index 76deb68f57da1d..1a38fd5348d12a 100644 --- a/Mathlib/CategoryTheory/Localization/HasLocalization.lean +++ b/Mathlib/CategoryTheory/Localization/HasLocalization.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Predicate +module + +public import Mathlib.CategoryTheory.Localization.Predicate /-! Morphism properties equipped with a localized category @@ -36,6 +38,8 @@ assumption, but one may use -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/HomEquiv.lean b/Mathlib/CategoryTheory/Localization/HomEquiv.lean index e18e3ea59b3c6d..722ebf6d785b8c 100644 --- a/Mathlib/CategoryTheory/Localization/HomEquiv.lean +++ b/Mathlib/CategoryTheory/Localization/HomEquiv.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Localization.LocalizerMorphism -import Mathlib.CategoryTheory.HomCongr +public import Mathlib.CategoryTheory.Localization.LocalizerMorphism +public import Mathlib.CategoryTheory.HomCongr /-! # Bijections between morphisms in two localized categories @@ -22,6 +23,8 @@ to the identity localizer morphism. -/ +@[expose] public section + namespace CategoryTheory open Category diff --git a/Mathlib/CategoryTheory/Localization/Linear.lean b/Mathlib/CategoryTheory/Localization/Linear.lean index c052fcbb3036d2..e3a2e7bf6bebce 100644 --- a/Mathlib/CategoryTheory/Localization/Linear.lean +++ b/Mathlib/CategoryTheory/Localization/Linear.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.HasLocalization -import Mathlib.CategoryTheory.Center.Localization -import Mathlib.CategoryTheory.Center.Linear -import Mathlib.CategoryTheory.Linear.LinearFunctor +module + +public import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.CategoryTheory.Center.Localization +public import Mathlib.CategoryTheory.Center.Linear +public import Mathlib.CategoryTheory.Linear.LinearFunctor /-! # Localization of linear categories @@ -17,6 +19,8 @@ structure such that `L` is a `R`-linear functor. -/ +@[expose] public section + universe w v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean b/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean index 5df2df541dd4e2..58e994da0ff9bf 100644 --- a/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean +++ b/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Equivalence +module + +public import Mathlib.CategoryTheory.Localization.Equivalence /-! # Morphisms of localizers @@ -24,6 +26,8 @@ localized categories. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₄' v₅ v₅' v₆ u₁ u₂ u₃ u₄ u₄' u₅ u₅' u₆ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/LocallySmall.lean b/Mathlib/CategoryTheory/Localization/LocallySmall.lean index 526689343f8c0d..b6d143755c8d1c 100644 --- a/Mathlib/CategoryTheory/Localization/LocallySmall.lean +++ b/Mathlib/CategoryTheory/Localization/LocallySmall.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Localization.HasLocalization -import Mathlib.CategoryTheory.EssentiallySmall +public import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.CategoryTheory.EssentiallySmall /-! # Locally small localizations @@ -17,6 +18,8 @@ the category `D` is locally `w`-small. -/ +@[expose] public section + universe w v₁ v₂ u₁ u₂ open CategoryTheory.Functor diff --git a/Mathlib/CategoryTheory/Localization/Monoidal.lean b/Mathlib/CategoryTheory/Localization/Monoidal.lean index 391b79aae1c479..6b53c28d538475 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal.lean @@ -3,6 +3,8 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Localization.Monoidal.Basic +module + +public import Mathlib.CategoryTheory.Localization.Monoidal.Basic deprecated_module (since := "2025-10-20") diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean index 1974a48b98375e..af5f03e35a0fc6 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Localization.Trifunctor -import Mathlib.CategoryTheory.Monoidal.Functor +module + +public import Mathlib.CategoryTheory.Localization.Trifunctor +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # Localization of monoidal categories @@ -24,6 +26,8 @@ The symmetric case is considered in the file `Mathlib.CategoryTheory.Localizatio -/ +@[expose] public section + namespace CategoryTheory open Category MonoidalCategory @@ -40,6 +44,14 @@ class IsMonoidal : Prop extends W.IsMultiplicative where whiskerLeft (X : C) {Y₁ Y₂ : C} (g : Y₁ ⟶ Y₂) (hg : W g) : W (X ◁ g) whiskerRight {X₁ X₂ : C} (f : X₁ ⟶ X₂) (hf : W f) (Y : C) : W (f ▷ Y) +/-- Alternative constructor for `W.IsMonoidal` given that `W` is multiplicative and stable under +tensoring morphisms. -/ +lemma IsMonoidal.mk' [W.IsMultiplicative] + (h : ∀ {X₁ X₂ Y₁ Y₂ : C} (f : X₁ ⟶ X₂) (g : Y₁ ⟶ Y₂) (_ : W f) (_ : W g), W (f ⊗ₘ g)) : + W.IsMonoidal where + whiskerLeft X _ _ g hg := by simpa using h (𝟙 X) g (W.id_mem _) hg + whiskerRight f hf Y := by simpa using h f (𝟙 Y) hf (W.id_mem _) + variable [W.IsMonoidal] lemma whiskerLeft_mem (X : C) {Y₁ Y₂ : C} (g : Y₁ ⟶ Y₂) (hg : W g) : W (X ◁ g) := @@ -53,6 +65,16 @@ lemma tensorHom_mem {X₁ X₂ : C} (f : X₁ ⟶ X₂) {Y₁ Y₂ : C} (g : Y rw [tensorHom_def] exact comp_mem _ _ _ (whiskerRight_mem _ _ hf _) (whiskerLeft_mem _ _ _ hg) +/-- The inverse image under a monoidal functor of a monoidal morphism property which respects +isomorphisms is monoidal. -/ +instance {C' : Type*} [Category C'] [MonoidalCategory C'] (F : C' ⥤ C) [F.Monoidal] + [W.RespectsIso] : (W.inverseImage F).IsMonoidal := .mk' _ fun f g hf hg ↦ by + simp only [inverseImage_iff] at hf hg ⊢ + rw [Functor.Monoidal.map_tensor _ f g] + apply MorphismProperty.RespectsIso.precomp + apply MorphismProperty.RespectsIso.postcomp + exact tensorHom_mem _ _ _ hf hg + end MorphismProperty /-- Given a monoidal category `C`, a localization functor `L : C ⥤ D` with respect diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean index 5a95696fef2cdc..815034bcce5e47 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Localization.Monoidal.Basic -import Mathlib.CategoryTheory.Monoidal.Braided.Multifunctor +module + +public import Mathlib.CategoryTheory.Localization.Monoidal.Basic +public import Mathlib.CategoryTheory.Monoidal.Braided.Multifunctor /-! @@ -20,6 +22,8 @@ braided, in such a way that the localization functor is braided. If `C` is symme the monoidal structure on `D` is also symmetric. -/ +@[expose] public section + open CategoryTheory Category MonoidalCategory BraidedCategory Functor namespace CategoryTheory.Localization.Monoidal diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean new file mode 100644 index 00000000000000..f892854958ddea --- /dev/null +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean @@ -0,0 +1,156 @@ +/- +Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Dagur Asgeirsson +-/ +module + +public import Mathlib.CategoryTheory.Localization.Trifunctor +public import Mathlib.CategoryTheory.Monoidal.Multifunctor +public import Mathlib.CategoryTheory.Monoidal.NaturalTransformation +public import Mathlib.Tactic.CategoryTheory.Coherence + +/-! + +# Universal property of localized monoidal categories + +This file proves that, given a monoidal localization functor `L : C ⥤ D`, and a functor +`F : D ⥤ E` to a monoidal category, such that `F` lifts along `L` to a monoidal functor `G`, +then `F` is monoidal. See `CategoryTheory.Localization.Monoidal.functorMonoidalOfComp`. +-/ + +@[expose] public section + +universe u + +namespace CategoryTheory + +open CategoryTheory MonoidalCategory Functor Monoidal LaxMonoidal OplaxMonoidal + +namespace Localization.Monoidal + +variable {C D E : Type*} [Category C] [Category D] [Category E] + [MonoidalCategory C] [MonoidalCategory D] [MonoidalCategory E] + (L : C ⥤ D) (W : MorphismProperty C) [L.IsLocalization W] [L.Monoidal] + (F : D ⥤ E) (G : C ⥤ E) [G.Monoidal] [W.ContainsIdentities] [Lifting L W G F] + +@[simps] +instance lifting₂CurriedTensorPre : + Lifting₂ L L W W (curriedTensorPre G) (curriedTensorPre F) where + iso := curriedTensorPreFunctor.mapIso (Lifting.iso L W G F) + +@[simps] +instance lifting₂CurriedTensorPost : + Lifting₂ L L W W (curriedTensorPost G) (curriedTensorPost F) where + iso := (postcompose₂.obj F).mapIso (curriedTensorPreIsoPost L) ≪≫ + curriedTensorPostFunctor.mapIso (Lifting.iso L W G F) + +/-- +The natural isomorphism of bifunctors `F - ⊗ F - ≅ F (- ⊗ -)`, given that `F` lifts along `L` +to a monoidal functor `G`, where `L` is a monoidal localization functor. +-/ +noncomputable def curriedTensorPreIsoPost : curriedTensorPre F ≅ curriedTensorPost F := + lift₂NatIso L L W W (curriedTensorPre G) (curriedTensorPost G) _ _ + (Functor.curriedTensorPreIsoPost G) + +@[reassoc] +lemma curriedTensorPreIsoPost_hom_app_app (X₁ X₂ : C) : + letI e := Lifting.iso L W G F + ((curriedTensorPreIsoPost L W F G).hom.app (L.obj X₁)).app (L.obj X₂) = + (e.hom.app _ ⊗ₘ e.hom.app _) ≫ LaxMonoidal.μ G X₁ X₂ ≫ e.inv.app _ ≫ + F.map (OplaxMonoidal.δ L _ _) := by + simp [curriedTensorPreIsoPost] + +lemma curriedTensorPreIsoPost_hom_app_app' {X₁ X₂ : C} {Y₁ Y₂ : D} + (e₁ : Y₁ ≅ L.obj X₁) (e₂ : Y₂ ≅ L.obj X₂) : + letI e := Lifting.iso L W G F + ((curriedTensorPreIsoPost L W F G).hom.app Y₁).app Y₂ = + ((F.map e₁.hom ≫ e.hom.app _) ⊗ₘ (F.map e₂.hom ≫ e.hom.app _)) ≫ + LaxMonoidal.μ G X₁ X₂ ≫ e.inv.app _ ≫ + F.map (OplaxMonoidal.δ L _ _≫ (e₁.inv ⊗ₘ e₂.inv)) := by + have h₁ := ((curriedTensorPreIsoPost L W F G).hom.app Y₁).naturality e₂.hom + have h₂ := congr_app ((curriedTensorPreIsoPost L W F G).hom.naturality e₁.hom) + dsimp at h₁ h₂ ⊢ + rw [← cancel_mono (F.map (Y₁ ◁ e₂.hom)), ← h₁, ← cancel_mono (F.map (e₁.hom ▷ L.obj X₂)), + Category.assoc, ← h₂, curriedTensorPreIsoPost_hom_app_app, Category.assoc, Category.assoc, + Category.assoc, Category.assoc, ← tensorHom_def'_assoc, tensorHom_comp_tensorHom_assoc, + ← Functor.map_comp, ← tensorHom_def', ← Functor.map_comp, Category.assoc, + tensorHom_comp_tensorHom, Iso.inv_hom_id, Iso.inv_hom_id, tensorHom_id, id_whiskerRight, + Category.comp_id] + +/-- +Monoidal structure on `F`, given that `F` lifts along `L` to a monoidal functor `G`, +where `L` is a monoidal localization functor. +-/ +@[simps!] +noncomputable def functorCoreMonoidalOfComp : F.CoreMonoidal := by + letI e := Lifting.iso L W G F + refine Functor.CoreMonoidal.ofBifunctor + (εIso G ≪≫ e.symm.app _ ≪≫ F.mapIso (εIso L).symm) (curriedTensorPreIsoPost L W F G) ?_ ?_ ?_ + · refine natTrans₃_ext L L L W W W (fun X₁ X₂ X₃ ↦ ?_) + dsimp [e] + rw [curriedTensorPreIsoPost_hom_app_app, curriedTensorPreIsoPost_hom_app_app, + curriedTensorPreIsoPost_hom_app_app' L W F G (μIso L _ _) (Iso.refl _), + curriedTensorPreIsoPost_hom_app_app' L W F G (Iso.refl _) (μIso L _ _)] + monoidal_simps + /- + The following `simp only` block was generated by: + ``` + simp? [← comp_whiskerRight_assoc, -comp_whiskerRight, whisker_exchange_assoc, + ← MonoidalCategory.whiskerLeft_comp_assoc, -MonoidalCategory.whiskerLeft_comp] + ``` + -/ + simp only [comp_obj, μIso_hom, Iso.refl_hom, map_id, Category.id_comp, μIso_inv, Iso.refl_inv, + MonoidalCategory.whiskerLeft_id, Category.comp_id, map_comp, Category.assoc, + ← comp_whiskerRight_assoc, map_δ_μ_assoc, Iso.inv_hom_id_app, id_whiskerRight, + whisker_exchange_assoc, ← MonoidalCategory.whiskerLeft_comp_assoc, whiskerRight_tensor] + simp [← whisker_exchange_assoc, tensor_whiskerLeft_symm, -tensor_whiskerLeft, + ← LaxMonoidal.associativity_assoc G, ← Functor.map_comp] + · refine natTrans_ext L W (fun X₂ ↦ ?_) + have := NatTrans.congr_app ((curriedTensorPreIsoPost L W F G).hom.naturality (εIso L).inv) + (L.obj X₂) + dsimp [e] at this ⊢ + monoidal_simps + simp [reassoc_of% this, curriedTensorPreIsoPost_hom_app_app, ← comp_whiskerRight_assoc, + -comp_whiskerRight, tensorHom_def, ← whisker_exchange_assoc, ← map_comp] + · refine natTrans_ext L W (fun X₁ ↦ ?_) + have := ((curriedTensorPreIsoPost L W F G).hom.app (L.obj X₁)).naturality (εIso L).inv + dsimp [e] at this ⊢ + monoidal_simps + simp [reassoc_of% this, curriedTensorPreIsoPost_hom_app_app, tensorHom_def, + whisker_exchange_assoc, ← MonoidalCategory.whiskerLeft_comp_assoc, ← map_comp] + +/-- +Monoidal structure on `F`, given that `F` lifts along `L` to a monoidal functor `G`, +where `L` is a monoidal localization functor. +-/ +noncomputable def functorMonoidalOfComp : F.Monoidal := + (functorCoreMonoidalOfComp L W F G).toMonoidal + +@[reassoc] +lemma functorMonoidalOfComp_ε : letI := functorMonoidalOfComp L W F G + letI e := Lifting.iso L W G F + ε F = ε G ≫ e.inv.app _ ≫ F.map (η L) := + rfl + +@[reassoc] +lemma functorMonoidalOfComp_μ (X Y : C) : letI := functorMonoidalOfComp L W F G + letI e := Lifting.iso L W G F + μ F (L.obj X) (L.obj Y) = (e.hom.app _ ⊗ₘ e.hom.app _) ≫ μ G X Y ≫ e.inv.app _ ≫ + F.map (δ L _ _) := by + simp [Functor.CoreMonoidal.toLaxMonoidal_μ, curriedTensorPreIsoPost_hom_app_app] + +/-- +When `F` is given the monoidal structure `functorMonoidalOfComp` that is obtained by lifting along +a monoidal localization functor `L`, then the lifting isomorphism is a monoidal natural +transformation. +-/ +instance lifting_isMonoidal : + letI : F.Monoidal := functorMonoidalOfComp L W F G + (Lifting.iso L W G F).hom.IsMonoidal := by + letI : F.Monoidal := functorMonoidalOfComp L W F G + refine ⟨?_, fun _ _ ↦ ?_⟩ + · simp [functorMonoidalOfComp_ε] + · simp [functorMonoidalOfComp_μ] + +end CategoryTheory.Localization.Monoidal diff --git a/Mathlib/CategoryTheory/Localization/Opposite.lean b/Mathlib/CategoryTheory/Localization/Opposite.lean index 3d00afbca9c348..2334a5d80146d8 100644 --- a/Mathlib/CategoryTheory/Localization/Opposite.lean +++ b/Mathlib/CategoryTheory/Localization/Opposite.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Equivalence +module + +public import Mathlib.CategoryTheory.Localization.Equivalence /-! @@ -14,6 +16,8 @@ is shown in this file that `L.op : Cᵒᵖ ⥤ Dᵒᵖ` is also a localization f -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Localization/Pi.lean b/Mathlib/CategoryTheory/Localization/Pi.lean index 61de4a544f75af..45d30f78990085 100644 --- a/Mathlib/CategoryTheory/Localization/Pi.lean +++ b/Mathlib/CategoryTheory/Localization/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Prod -import Mathlib.CategoryTheory.Localization.Equivalence -import Mathlib.Data.Fintype.Option +module + +public import Mathlib.CategoryTheory.Localization.Prod +public import Mathlib.CategoryTheory.Localization.Equivalence +public import Mathlib.Data.Fintype.Option /-! # Localization of product categories @@ -20,6 +22,8 @@ main result of the file `Mathlib/CategoryTheory/Localization/Prod.lean`. -/ +@[expose] public section + universe w v₁ v₂ u₁ u₂ namespace CategoryTheory.Functor.IsLocalization diff --git a/Mathlib/CategoryTheory/Localization/Preadditive.lean b/Mathlib/CategoryTheory/Localization/Preadditive.lean index 99d9af471ca789..0b7ddb9a95732e 100644 --- a/Mathlib/CategoryTheory/Localization/Preadditive.lean +++ b/Mathlib/CategoryTheory/Localization/Preadditive.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Predicate -import Mathlib.CategoryTheory.Preadditive.FunctorCategory +module + +public import Mathlib.CategoryTheory.Localization.Predicate +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory /-! # Localization of natural transformations to preadditive categories -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Localization/Predicate.lean b/Mathlib/CategoryTheory/Localization/Predicate.lean index 271bb44b0a4e95..b9aaff35af41d2 100644 --- a/Mathlib/CategoryTheory/Localization/Predicate.lean +++ b/Mathlib/CategoryTheory/Localization/Predicate.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Construction +module + +public import Mathlib.CategoryTheory.Localization.Construction /-! @@ -30,6 +32,8 @@ and natural isomorphisms between functors. -/ +@[expose] public section + noncomputable section @@ -199,7 +203,7 @@ theorem essSurj (W) [L.IsLocalization W] : L.EssSurj := (equivalenceFromModel L W).counitIso.app X)⟩⟩ /-- The functor `(D ⥤ E) ⥤ W.functors_inverting E` induced by the composition -with a localization functor `L : C ⥤ D` with respect to `W : morphism_property C`. -/ +with a localization functor `L : C ⥤ D` with respect to `W : MorphismProperty C`. -/ def whiskeringLeftFunctor : (D ⥤ E) ⥤ W.FunctorsInverting E := ObjectProperty.lift _ ((whiskeringLeft _ _ E).obj L) (MorphismProperty.IsInvertedBy.of_comp W L (inverts L W)) @@ -452,6 +456,39 @@ def isoUniqFunctor (F : D₁ ⥤ D₂) (e : L₁ ⋙ F ≅ L₂) : letI : Lifting L₁ W' L₂ F := ⟨e⟩ liftNatIso L₁ W' L₂ L₂ F (uniq L₁ L₂ W').functor (Iso.refl L₂) +lemma morphismProperty_eq_top [L.IsLocalization W] (P : MorphismProperty D) [P.RespectsIso] + [P.IsMultiplicative] (h₁ : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), P (L.map f)) + (h₂ : ∀ ⦃X Y : C⦄ (f : X ⟶ Y) (hf : W f), P (isoOfHom L W f hf).inv) : + P = ⊤ := by + let e := compUniqFunctor W.Q L W + have hP : P.inverseImage (uniq W.Q L W).functor = ⊤ := + Construction.morphismProperty_eq_top _ + (fun _ _ f ↦ (P.arrow_mk_iso_iff + (((Functor.mapArrowFunctor _ _).mapIso e).app (Arrow.mk f))).2 (h₁ f)) + (fun X Y f hf ↦ by + refine (P.arrow_mk_iso_iff (Arrow.isoMk (e.app _) (e.app _) ?_)).2 (h₂ f hf) + dsimp + rw [Construction.wInv_eq_isoOfHom_inv, ← cancel_mono (isoOfHom L W f hf).hom, + assoc, assoc, Iso.inv_hom_id, comp_id, isoOfHom_hom, ← NatTrans.naturality, + Functor.comp_map, ← Functor.map_comp_assoc, + isoOfHom_inv_hom_id, map_id, id_comp]) + rw [← P.map_inverseImage_eq_of_isEquivalence (uniq W.Q L W).functor, hP, + MorphismProperty.map_top_eq_top_of_essSurj_of_full] + +lemma isGroupoid [L.IsLocalization ⊤] : + IsGroupoid D := by + rw [isGroupoid_iff_isomorphisms_eq_top] + exact morphismProperty_eq_top L ⊤ _ + (fun _ _ f ↦ inverts L ⊤ _ (by simp)) + (fun _ _ f hf ↦ Iso.isIso_inv _) + +instance : IsGroupoid (⊤ : MorphismProperty C).Localization := + isGroupoid <| MorphismProperty.Q ⊤ + +/-- Localization of a category with respect to all morphisms results in a groupoid. -/ +def groupoid : Groupoid (⊤ : MorphismProperty C).Localization := + Groupoid.ofIsGroupoid + end Localization section diff --git a/Mathlib/CategoryTheory/Localization/Prod.lean b/Mathlib/CategoryTheory/Localization/Prod.lean index 152eddf4eaebc9..8668c963f58658 100644 --- a/Mathlib/CategoryTheory/Localization/Prod.lean +++ b/Mathlib/CategoryTheory/Localization/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Localization.Predicate -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Localization.Predicate +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Localization of product categories @@ -25,6 +27,8 @@ case follows by transporting this result through equivalences of categories. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/Quotient.lean b/Mathlib/CategoryTheory/Localization/Quotient.lean index a438ab9a417477..16da896d6e424d 100644 --- a/Mathlib/CategoryTheory/Localization/Quotient.lean +++ b/Mathlib/CategoryTheory/Localization/Quotient.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.LocalizerMorphism -import Mathlib.CategoryTheory.Quotient +module + +public import Mathlib.CategoryTheory.Localization.LocalizerMorphism +public import Mathlib.CategoryTheory.Quotient /-! # Localization of quotient categories @@ -21,6 +23,8 @@ induces an equivalence on localized categories. -/ +@[expose] public section + namespace HomRel open CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/Resolution.lean b/Mathlib/CategoryTheory/Localization/Resolution.lean index dd1f51d48798fa..a4b9454ee7456f 100644 --- a/Mathlib/CategoryTheory/Localization/Resolution.lean +++ b/Mathlib/CategoryTheory/Localization/Resolution.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.LocalizerMorphism +module + +public import Mathlib.CategoryTheory.Localization.LocalizerMorphism /-! # Resolutions for a morphism of localizers @@ -33,6 +35,8 @@ Similar definitions are done for left resolutions. -/ +@[expose] public section + universe v₁ v₂ v₂' u₁ u₂ u₂' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/SmallHom.lean b/Mathlib/CategoryTheory/Localization/SmallHom.lean index be3bf979901ad4..c53584d46ceed8 100644 --- a/Mathlib/CategoryTheory/Localization/SmallHom.lean +++ b/Mathlib/CategoryTheory/Localization/SmallHom.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.HomEquiv -import Mathlib.Logic.Small.Defs +module + +public import Mathlib.CategoryTheory.Localization.HomEquiv +public import Mathlib.Logic.Small.Defs /-! # Shrinking morphisms in localized categories @@ -20,6 +22,8 @@ with the composition of morphisms. -/ +@[expose] public section + universe w'' w w' v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/SmallShiftedHom.lean b/Mathlib/CategoryTheory/Localization/SmallShiftedHom.lean index f30a1d0b929057..7a12d7324cb1ce 100644 --- a/Mathlib/CategoryTheory/Localization/SmallShiftedHom.lean +++ b/Mathlib/CategoryTheory/Localization/SmallShiftedHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.SmallHom -import Mathlib.CategoryTheory.Shift.ShiftedHom -import Mathlib.CategoryTheory.Shift.Localization +module + +public import Mathlib.CategoryTheory.Localization.SmallHom +public import Mathlib.CategoryTheory.Shift.ShiftedHom +public import Mathlib.CategoryTheory.Shift.Localization /-! # Shrinking morphisms in localized categories equipped with shifts @@ -22,6 +24,8 @@ any localization functor for `W`. -/ +@[expose] public section + universe w'' w w' v₁ v₂ v₁' v₂' u₁ u₂ u₁' u₂' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/StructuredArrow.lean b/Mathlib/CategoryTheory/Localization/StructuredArrow.lean index 466b769c65b5b4..38e2c82411fe21 100644 --- a/Mathlib/CategoryTheory/Localization/StructuredArrow.lean +++ b/Mathlib/CategoryTheory/Localization/StructuredArrow.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.HomEquiv -import Mathlib.CategoryTheory.Localization.Opposite -import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic +module + +public import Mathlib.CategoryTheory.Localization.HomEquiv +public import Mathlib.CategoryTheory.Localization.Opposite +public import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic /-! # Induction principles for structured and costructured arrows @@ -22,6 +24,8 @@ costructured arrows. -/ +@[expose] public section + namespace CategoryTheory open Opposite diff --git a/Mathlib/CategoryTheory/Localization/Triangulated.lean b/Mathlib/CategoryTheory/Localization/Triangulated.lean index 2eb7f2c3d97ad2..aa7a266ce1b37f 100644 --- a/Mathlib/CategoryTheory/Localization/Triangulated.lean +++ b/Mathlib/CategoryTheory/Localization/Triangulated.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.ComposableArrows -import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Preadditive -import Mathlib.CategoryTheory.Triangulated.Functor -import Mathlib.CategoryTheory.Shift.Localization +module + +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.ComposableArrows +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions.Preadditive +public import Mathlib.CategoryTheory.Triangulated.Functor +public import Mathlib.CategoryTheory.Shift.Localization /-! # Localization of triangulated categories @@ -20,6 +22,8 @@ and that it is triangulated. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Localization/Trifunctor.lean b/Mathlib/CategoryTheory/Localization/Trifunctor.lean index 503c1d961a61ee..ff7b62ff71fa28 100644 --- a/Mathlib/CategoryTheory/Localization/Trifunctor.lean +++ b/Mathlib/CategoryTheory/Localization/Trifunctor.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Bifunctor -import Mathlib.CategoryTheory.Functor.CurryingThree -import Mathlib.CategoryTheory.Products.Associator +module + +public import Mathlib.CategoryTheory.Localization.Bifunctor +public import Mathlib.CategoryTheory.Functor.CurryingThree +public import Mathlib.CategoryTheory.Products.Associator /-! # Lifting of trifunctors @@ -18,6 +20,8 @@ The main result in this file is that we can localize "associator" isomorphisms -/ +@[expose] public section + namespace CategoryTheory open Functor diff --git a/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean b/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean index df2b47b30c59c1..42da42953810f4 100644 --- a/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean +++ b/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Sina Hazratpour. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sina Hazratpour -/ -import Mathlib.CategoryTheory.Comma.Over.Pullback -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Adjunction.Unique +module + +public import Mathlib.CategoryTheory.Comma.Over.Pullback +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Adjunction.Unique /-! # Chosen pullbacks along a morphism @@ -33,6 +35,8 @@ import Mathlib.CategoryTheory.Adjunction.Unique -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/LocallyDirected.lean b/Mathlib/CategoryTheory/LocallyDirected.lean index 9d91d02855c701..929312b5e37cfa 100644 --- a/Mathlib/CategoryTheory/LocallyDirected.lean +++ b/Mathlib/CategoryTheory/LocallyDirected.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +module + +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks /-! ## Locally directed gluing @@ -16,6 +18,8 @@ This is the condition needed to show that a colimit (in `TopCat`) of open embedd gluing of the open sets. See `Mathlib/AlgebraicGeometry/Gluing.lean` for an actual application. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/MarkovCategory/Basic.lean b/Mathlib/CategoryTheory/MarkovCategory/Basic.lean index 638215a24fecbc..52e599884fc98c 100644 --- a/Mathlib/CategoryTheory/MarkovCategory/Basic.lean +++ b/Mathlib/CategoryTheory/MarkovCategory/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jacob Reinhold. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jacob Reinhold -/ -import Mathlib.CategoryTheory.CopyDiscardCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +module + +public import Mathlib.CategoryTheory.CopyDiscardCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal /-! # Markov Categories @@ -39,6 +41,8 @@ morphism, a distinguishing feature of Markov categories in categorical probabili Markov category, probability, categorical probability -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Adjunction.lean b/Mathlib/CategoryTheory/Monad/Adjunction.lean index 447442b06dbba0..532a9117b7d08a 100644 --- a/Mathlib/CategoryTheory/Monad/Adjunction.lean +++ b/Mathlib/CategoryTheory/Monad/Adjunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Adjunction.Reflective -import Mathlib.CategoryTheory.Monad.Algebra +module + +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Monad.Algebra /-! # Adjunctions and (co)monads @@ -24,6 +26,8 @@ Finally we prove that reflective functors are `MonadicRightAdjoint` and coreflec `ComonadicLeftAdjoint`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Algebra.lean b/Mathlib/CategoryTheory/Monad/Algebra.lean index 7b42ce7a4b3864..6ecf4bdec72069 100644 --- a/Mathlib/CategoryTheory/Monad/Algebra.lean +++ b/Mathlib/CategoryTheory/Monad/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Monad.Basic -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Functor.EpiMono +module + +public import Mathlib.CategoryTheory.Monad.Basic +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Functor.EpiMono /-! # Eilenberg-Moore (co)algebras for a (co)monad @@ -21,6 +23,8 @@ cofree functors, respectively from and to the original category. * [Riehl, *Category theory in context*, Section 5.2.4][riehl2017] -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Basic.lean b/Mathlib/CategoryTheory/Monad/Basic.lean index fee9511e97e4be..cacd59d0533710 100644 --- a/Mathlib/CategoryTheory/Monad/Basic.lean +++ b/Mathlib/CategoryTheory/Monad/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta, Adam Topaz -/ -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Functor.FullyFaithful -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic -import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi +module + +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Functor.FullyFaithful +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi /-! # Monads @@ -20,6 +22,8 @@ For the fact that monads are "just" monoids in the category of endofunctors, see `CategoryTheory.Monad.EquivMon`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Coequalizer.lean b/Mathlib/CategoryTheory/Monad/Coequalizer.lean index 5af539a9d3260d..062c948ee0413b 100644 --- a/Mathlib/CategoryTheory/Monad/Coequalizer.lean +++ b/Mathlib/CategoryTheory/Monad/Coequalizer.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.Reflexive -import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer -import Mathlib.CategoryTheory.Monad.Algebra +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Reflexive +public import Mathlib.CategoryTheory.Limits.Shapes.SplitCoequalizer +public import Mathlib.CategoryTheory.Monad.Algebra /-! # Special coequalizers associated to a monad @@ -22,6 +24,8 @@ Please try to keep them in sync. -/ +@[expose] public section + universe v₁ u₁ diff --git a/Mathlib/CategoryTheory/Monad/Comonadicity.lean b/Mathlib/CategoryTheory/Monad/Comonadicity.lean index bf0ebba519a3f1..a0da29e5fbb6fc 100644 --- a/Mathlib/CategoryTheory/Monad/Comonadicity.lean +++ b/Mathlib/CategoryTheory/Monad/Comonadicity.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Reflexive -import Mathlib.CategoryTheory.Monad.Equalizer -import Mathlib.CategoryTheory.Monad.Limits +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Reflexive +public import Mathlib.CategoryTheory.Monad.Equalizer +public import Mathlib.CategoryTheory.Monad.Limits /-! # Comonadicity theorems @@ -37,6 +39,8 @@ Beck, comonadicity, descent -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Equalizer.lean b/Mathlib/CategoryTheory/Monad/Equalizer.lean index 8168c607b8729a..8bc8b0303aeb0b 100644 --- a/Mathlib/CategoryTheory/Monad/Equalizer.lean +++ b/Mathlib/CategoryTheory/Monad/Equalizer.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Limits.Shapes.Reflexive -import Mathlib.CategoryTheory.Limits.Shapes.SplitEqualizer -import Mathlib.CategoryTheory.Monad.Algebra +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Reflexive +public import Mathlib.CategoryTheory.Limits.Shapes.SplitEqualizer +public import Mathlib.CategoryTheory.Monad.Algebra /-! # Special equalizers associated to a comonad @@ -22,6 +24,8 @@ Please try to keep them in sync. -/ +@[expose] public section + universe v₁ u₁ diff --git a/Mathlib/CategoryTheory/Monad/EquivMon.lean b/Mathlib/CategoryTheory/Monad/EquivMon.lean index 16af8468481ad0..9c65f546dd97fd 100644 --- a/Mathlib/CategoryTheory/Monad/EquivMon.lean +++ b/Mathlib/CategoryTheory/Monad/EquivMon.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Monad.Basic -import Mathlib.CategoryTheory.Monoidal.End -import Mathlib.CategoryTheory.Monoidal.Mon_ +module + +public import Mathlib.CategoryTheory.Monad.Basic +public import Mathlib.CategoryTheory.Monoidal.End +public import Mathlib.CategoryTheory.Monoidal.Mon_ /-! @@ -22,6 +24,8 @@ A monad "is just" a monoid in the category of endofunctors. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Kleisli.lean b/Mathlib/CategoryTheory/Monad/Kleisli.lean index 32eacf6b43451a..2adc8367c5b4c2 100644 --- a/Mathlib/CategoryTheory/Monad/Kleisli.lean +++ b/Mathlib/CategoryTheory/Monad/Kleisli.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Wojciech Nawrocki. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wojciech Nawrocki, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Monad.Basic +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Monad.Basic /-! # Kleisli category on a (co)monad @@ -17,6 +19,8 @@ the monad `(T, η_ T, μ_ T)` as well as the co-Kleisli adjunction which gives r * [Riehl, *Category theory in context*, Definition 5.2.9][riehl2017] -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Limits.lean b/Mathlib/CategoryTheory/Monad/Limits.lean index 0d43b7f3f389ec..5df36123a69965 100644 --- a/Mathlib/CategoryTheory/Monad/Limits.lean +++ b/Mathlib/CategoryTheory/Monad/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta, Jack McKoen -/ -import Mathlib.CategoryTheory.Monad.Adjunction -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +module + +public import Mathlib.CategoryTheory.Monad.Adjunction +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal /-! # Limits and colimits in the category of (co)algebras @@ -23,6 +25,8 @@ and `T` preserves. This is generalised to the case of a comonadic functor `D ⥤ C`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Monadicity.lean b/Mathlib/CategoryTheory/Monad/Monadicity.lean index 99d8a746108bb3..42fa3872e2037b 100644 --- a/Mathlib/CategoryTheory/Monad/Monadicity.lean +++ b/Mathlib/CategoryTheory/Monad/Monadicity.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Shapes.Reflexive -import Mathlib.CategoryTheory.Monad.Coequalizer -import Mathlib.CategoryTheory.Monad.Limits +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Shapes.Reflexive +public import Mathlib.CategoryTheory.Monad.Coequalizer +public import Mathlib.CategoryTheory.Monad.Limits /-! # Monadicity theorems @@ -36,6 +38,8 @@ Beck, monadicity, descent -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monad/Products.lean b/Mathlib/CategoryTheory/Monad/Products.lean index 5e7f380b8225f4..99c658d4c701bf 100644 --- a/Mathlib/CategoryTheory/Monad/Products.lean +++ b/Mathlib/CategoryTheory/Monad/Products.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Monad.Algebra +module + +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Monad.Algebra /-! # Algebras for the coproduct monad @@ -20,6 +22,8 @@ Show that `Over.forget X : Over X ⥤ C` is a comonadic left adjoint and `Under. is a monadic right adjoint. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Monad/Types.lean b/Mathlib/CategoryTheory/Monad/Types.lean index eb7e3df4d802ab..0ade345fcbfc0a 100644 --- a/Mathlib/CategoryTheory/Monad/Types.lean +++ b/Mathlib/CategoryTheory/Monad/Types.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Category.KleisliCat -import Mathlib.CategoryTheory.Monad.Basic -import Mathlib.CategoryTheory.Monad.Kleisli -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Control.Basic +module + +public import Mathlib.CategoryTheory.Category.KleisliCat +public import Mathlib.CategoryTheory.Monad.Basic +public import Mathlib.CategoryTheory.Monad.Kleisli +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Control.Basic /-! @@ -17,6 +19,8 @@ This allows us to use these monads in category theory. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean index d014229ac5d919..a18c6a4426f3a4 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Category -import Mathlib.CategoryTheory.Functor.Trifunctor +module + +public import Mathlib.CategoryTheory.Monoidal.Category +public import Mathlib.CategoryTheory.Functor.Trifunctor /-! @@ -36,6 +38,8 @@ on `d` is `d ⊙ᵣ c`, and the structure isomorphisms are of the form -/ +@[expose] public section + namespace CategoryTheory.MonoidalCategory variable (C D : Type*) @@ -48,12 +52,12 @@ class MonoidalLeftActionStruct [MonoidalCategoryStruct C] where actionObj : C → D → D /-- The left action of a map `f : c ⟶ c'` in `C` on an object `d` in `D`. If we are to consider the action as a functor `Α : C ⥤ D ⥤ D`, - this is (Α.map f).app d`. This is denoted `f ⊵ₗ d` -/ + this is `(Α.map f).app d`. This is denoted `f ⊵ₗ d`. -/ actionHomLeft {c c' : C} (f : c ⟶ c') (d : D) : actionObj c d ⟶ actionObj c' d /-- The action of an object `c : C` on a map `f : d ⟶ d'` in `D`. If we are to consider the action as a functor `Α : C ⥤ D ⥤ D`, - this is (Α.obj c).map f`. This is denoted `c ⊴ₗ f`. -/ + this is `(Α.obj c).map f`. This is denoted `c ⊴ₗ f`. -/ actionHomRight (c : C) {d d' : D} (f : d ⟶ d') : actionObj c d ⟶ actionObj c d' /-- The action of a pair of maps `f : c ⟶ c'` and `d ⟶ d'`. By default, @@ -362,12 +366,12 @@ class MonoidalRightActionStruct [MonoidalCategoryStruct C] where actionObj : D → C → D /-- The right action of a map `f : c ⟶ c'` in `C` on an object `d` in `D`. If we are to consider the action as a functor `Α : C ⥤ D ⥤ D`, - this is (Α.map f).app d`. This is denoted `d ⊴ᵣ f` -/ + this is `(Α.map f).app d`. This is denoted `d ⊴ᵣ f`. -/ actionHomRight (d : D) {c c' : C} (f : c ⟶ c') : actionObj d c ⟶ actionObj d c' /-- The action of an object `c : C` on a map `f : d ⟶ d'` in `D`. If we are to consider the action as a functor `Α : C ⥤ D ⥤ D`, - this is (Α.obj c).map f`. This is denoted `f ⊵ᵣ c`. -/ + this is `(Α.obj c).map f`. This is denoted `f ⊵ᵣ c`. -/ actionHomLeft {d d' : D} (f : d ⟶ d') (c : C) : actionObj d c ⟶ actionObj d' c /-- The action of a pair of maps `f : c ⟶ c'` and `d ⟶ d'`. By default, diff --git a/Mathlib/CategoryTheory/Monoidal/Action/End.lean b/Mathlib/CategoryTheory/Monoidal/Action/End.lean index dd4d2dd5ae1d95..57e80a52e217d0 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/End.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/End.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Action.Basic -import Mathlib.CategoryTheory.Monoidal.End -import Mathlib.CategoryTheory.Monoidal.Opposite +module + +public import Mathlib.CategoryTheory.Monoidal.Action.Basic +public import Mathlib.CategoryTheory.Monoidal.End +public import Mathlib.CategoryTheory.Monoidal.Opposite /-! # Actions as monoidal functors to endofunctor categories @@ -23,6 +25,8 @@ functor `C ⥤ (D ⥤ D)ᴹᵒᵖ`. -/ +@[expose] public section + namespace CategoryTheory.MonoidalCategory variable (C D : Type*) diff --git a/Mathlib/CategoryTheory/Monoidal/Action/LinearFunctor.lean b/Mathlib/CategoryTheory/Monoidal/Action/LinearFunctor.lean index 917003342d0106..537b2ea98c03b7 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/LinearFunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/LinearFunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Action.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Action.Basic /-! # Functors that are linear with respect to an action @@ -27,6 +29,8 @@ express compatibility of `F` with the action of `C`: -/ +@[expose] public section + namespace CategoryTheory.Functor variable {D D' : Type*} [Category D] [Category D'] diff --git a/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean b/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean index a12615ce1d6865..678f3b1f072ad6 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Action.Basic -import Mathlib.CategoryTheory.Monoidal.Opposite +module + +public import Mathlib.CategoryTheory.Monoidal.Action.Basic +public import Mathlib.CategoryTheory.Monoidal.Opposite /-! @@ -24,6 +26,8 @@ you should bring them as local instances if you intend to use them. -/ +@[expose] public section + namespace CategoryTheory.MonoidalCategory variable (C D : Type*) diff --git a/Mathlib/CategoryTheory/Monoidal/Bimod.lean b/Mathlib/CategoryTheory/Monoidal/Bimod.lean index 493c1788e4a128..3571587a958606 100644 --- a/Mathlib/CategoryTheory/Monoidal/Bimod.lean +++ b/Mathlib/CategoryTheory/Monoidal/Bimod.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Oleksandr Manzyuk -/ -import Mathlib.CategoryTheory.Bicategory.Basic -import Mathlib.CategoryTheory.Monoidal.Mon_ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers +module + +public import Mathlib.CategoryTheory.Bicategory.Basic +public import Mathlib.CategoryTheory.Monoidal.Mon_ +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers /-! # The category of bimodule objects over a pair of monoid objects. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Monoidal/Bimon_.lean b/Mathlib/CategoryTheory/Monoidal/Bimon_.lean index af74e9e9327b88..a418ac0590dd74 100644 --- a/Mathlib/CategoryTheory/Monoidal/Bimon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Bimon_.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Lean FRO LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Comon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Comon_ /-! # The category of bimonoids in a braided monoidal category. @@ -23,6 +25,8 @@ We verify that this is equivalent to the monoid objects in the category of comon `C` is monoidally equivalent to the modules over that bimonoid. -/ +@[expose] public section + noncomputable section universe v₁ v₂ u₁ u₂ u diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean index bd429e4a04e612..d98b55c5611cf7 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Discrete -import Mathlib.CategoryTheory.Monoidal.NaturalTransformation -import Mathlib.CategoryTheory.Monoidal.Opposite -import Mathlib.Tactic.CategoryTheory.Monoidal.Basic -import Mathlib.CategoryTheory.CommSq +module + +public import Mathlib.CategoryTheory.Monoidal.Discrete +public import Mathlib.CategoryTheory.Monoidal.NaturalTransformation +public import Mathlib.CategoryTheory.Monoidal.Opposite +public import Mathlib.Tactic.CategoryTheory.Monoidal.Basic +public import Mathlib.CategoryTheory.CommSq /-! # Braided and symmetric monoidal categories @@ -31,6 +33,8 @@ The rationale is that we are not carrying any additional data, just requiring a -/ +@[expose] public section + universe v v₁ v₂ v₃ u u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean index 41577c1d3fb14a..770896953c2a35 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Functor.CurryingThree +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Functor.CurryingThree /-! @@ -17,6 +19,8 @@ phrased as equalities of natural transformations between trifunctors -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] [MonoidalCategory C] @@ -29,43 +33,43 @@ namespace Hexagon variable (C) -/-- The trifunctor `X₁ X₂ X₃ ↦ (X₁ ⊗ X₂) ⊗ X₃ -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ (X₁ ⊗ X₂) ⊗ X₃` -/ @[simps!] def functor₁₂₃ : C ⥤ C ⥤ C ⥤ C := bifunctorComp₁₂ (curriedTensor C) (curriedTensor C) -/-- The trifunctor `X₁ X₂ X₃ ↦ X₁ ⊗ (X₂ ⊗ X₃) -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ X₁ ⊗ (X₂ ⊗ X₃)` -/ @[simps!] def functor₁₂₃' : C ⥤ C ⥤ C ⥤ C := bifunctorComp₂₃ (curriedTensor C) (curriedTensor C) -/-- The trifunctor `X₁ X₂ X₃ ↦ (X₂ ⊗ X₃) ⊗ X₁ -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ (X₂ ⊗ X₃) ⊗ X₁` -/ @[simps!] def functor₂₃₁ : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₂₃ (curriedTensor C).flip (curriedTensor C)) -/-- The trifunctor `X₁ X₂ X₃ ↦ X₂ ⊗ (X₃ ⊗ X₁) -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ X₂ ⊗ (X₃ ⊗ X₁)` -/ @[simps!] def functor₂₃₁' : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₂₃ (curriedTensor C) (curriedTensor C)).flip.flip₁₃ -/-- The trifunctor `X₁ X₂ X₃ ↦ (X₂ ⊗ X₁) ⊗ X₃ -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ (X₂ ⊗ X₁) ⊗ X₃` -/ @[simps!] def functor₂₁₃ : C ⥤ C ⥤ C ⥤ C := bifunctorComp₁₂ (curriedTensor C).flip (curriedTensor C) -/-- The trifunctor `X₁ X₂ X₃ ↦ X₂ ⊗ (X₁ ⊗ X₃) -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ X₂ ⊗ (X₁ ⊗ X₃)` -/ @[simps!] def functor₂₁₃' : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₂₃ (curriedTensor C) (curriedTensor C)).flip -/-- The trifunctor `X₁ X₂ X₃ ↦ X₃ ⊗ (X₁ ⊗ X₂) -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ X₃ ⊗ (X₁ ⊗ X₂)` -/ @[simps!] def functor₃₁₂' : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₂₃ (curriedTensor C) (curriedTensor C)).flip.flip₂₃ -/-- The trifunctor `X₁ X₂ X₃ ↦ (X₃ ⊗ X₁) ⊗ X₂ -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ (X₃ ⊗ X₁) ⊗ X₂` -/ @[simps!] def functor₃₁₂ : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₁₂ (curriedTensor C) (curriedTensor C)).flip.flip₂₃ -/-- The trifunctor `X₁ X₂ X₃ ↦ X₁ ⊗ (X₃ ⊗ X₂) -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ X₁ ⊗ (X₃ ⊗ X₂)` -/ @[simps!] def functor₁₃₂' : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₂₃ (curriedTensor C) (curriedTensor C).flip) -/-- The trifunctor `X₁ X₂ X₃ ↦ (X₁ ⊗ X₃) ⊗ X₂ -/ +/-- The trifunctor `X₁ X₂ X₃ ↦ (X₁ ⊗ X₃) ⊗ X₂` -/ @[simps!] def functor₁₃₂ : C ⥤ C ⥤ C ⥤ C := (bifunctorComp₁₂ (curriedTensor C) (curriedTensor C)).flip₂₃ diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Opposite.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Opposite.lean index c0a0419df79233..2467daecaabd9c 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Opposite.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Lean FRO LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.Opposite +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.Opposite /-! # If `C` is braided, so is `Cᵒᵖ`. @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Monoidal.Opposite Todo: we should also do `Cᵐᵒᵖ`. -/ +@[expose] public section + open CategoryTheory MonoidalCategory BraidedCategory Opposite variable {C : Type*} [Category C] [MonoidalCategory C] [BraidedCategory C] diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean index 0007719cfb518b..8f2c4ff7a9fe20 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Adjunction.Restrict -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Monad.Adjunction -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.Tactic.TFAE +module + +public import Mathlib.CategoryTheory.Adjunction.Restrict +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Monad.Adjunction +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.Tactic.TFAE /-! # Day's reflection theorem @@ -26,6 +28,8 @@ apply Day's reflection theorem to prove that `C` is also closed monoidal. - The original paper is [day1972] *A reflection theorem for closed categories*, by Day, 1972. -/ +@[expose] public section + namespace CategoryTheory.Monoidal.Reflective open Category MonoidalCategory MonoidalClosed BraidedCategory Functor diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Transport.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Transport.lean index e57bb3613dd9a7..c97137756b984f 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Transport.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Transport.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.Transport +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.Transport /-! # Transport a symmetric monoidal structure along an equivalence of categories -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ open CategoryTheory Category Monoidal MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean index 61bc954d265efd..535067c2a7ac2b 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison, Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Simon Hudon, Adam Topaz, Robin Carlier -/ -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts -import Mathlib.CategoryTheory.Limits.FullSubcategory -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal -import Mathlib.CategoryTheory.Monoidal.Braided.Basic +module + +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +public import Mathlib.CategoryTheory.Limits.FullSubcategory +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic /-! # Categories with chosen finite products @@ -39,6 +41,8 @@ instead turn on the corresponding `ofChosenFiniteProducts` declaration for that -/ +@[expose] public section + namespace CategoryTheory universe v v₁ v₂ v₃ u u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean index f4e19b23065b06..1e429560721325 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Nicolas Rolland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolas Rolland -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic /-! # Chosen finite products in `Cat` @@ -11,6 +13,8 @@ This file proves that the Cartesian product of a pair of categories agrees with product in `Cat`, and provides the associated `CartesianMonoidalCategory` instance. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean index 9e1f7f6c682bcb..8b07cb9a148092 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.CommMon_ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Grp_ -import Mathlib.CategoryTheory.Monoidal.CommGrp_ +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.CommMon_ +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Grp_ +public import Mathlib.CategoryTheory.Monoidal.CommGrp_ /-! # Yoneda embedding of `CommGrp C` -/ +@[expose] public section + assert_not_exists Field open CategoryTheory MonoidalCategory Limits Opposite CartesianMonoidalCategory MonObj diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean index 343005d36ac810..d7408634828455 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ /-! # Yoneda embedding of `CommMon C` -/ +@[expose] public section + assert_not_exists MonoidWithZero open CategoryTheory MonoidalCategory Limits Opposite CartesianMonoidalCategory MonObj diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Comon_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Comon_.lean index 9fbdfacb02af9c..861297a70f8fa2 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Comon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Comon_.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Lean FRO LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Monoidal.Comon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Monoidal.Comon_ /-! # Comonoid objects in a Cartesian monoidal category. @@ -13,6 +15,8 @@ The category of comonoid objects in a Cartesian monoidal category is equivalent to the category itself, via the forgetful functor. -/ +@[expose] public section + open CategoryTheory MonoidalCategory CartesianMonoidalCategory Limits ComonObj universe v u diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean index 891372ba1551d2..e18f28a9897e35 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Monoidal.Types.Basic +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Monoidal.Types.Basic /-! # Functor categories have chosen finite products @@ -14,6 +16,8 @@ If `C` is a category with chosen finite products, then so is `J ⥤ C`. -/ +@[expose] public section + namespace CategoryTheory open Limits MonoidalCategory Category CartesianMonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp_.lean index 7939e710639fea..e36c72cbb8ee20 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp_.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Category.Grp.Limits -import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ -import Mathlib.CategoryTheory.Monoidal.Grp_ +module + +public import Mathlib.Algebra.Category.Grp.Limits +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ +public import Mathlib.CategoryTheory.Monoidal.Grp_ /-! # Yoneda embedding of `Grp C` @@ -15,6 +17,8 @@ by constructing the yoneda embedding `Grp C ⥤ Cᵒᵖ ⥤ GrpCat.{v}` and showing that it is fully faithful and its (essential) image is the representable functors. -/ +@[expose] public section + assert_not_exists Field open CategoryTheory MonoidalCategory Limits Opposite CartesianMonoidalCategory MonObj diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/InfSemilattice.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/InfSemilattice.lean index f73c6b0eaf58dc..e724b9e777fa98 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/InfSemilattice.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/InfSemilattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Sina Hazratpour. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sina Hazratpour -/ -import Mathlib.CategoryTheory.Limits.Preorder -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Limits.Preorder +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic /-! # The preorder category of a meet-semilattice with a greatest element is Cartesian monoidal @@ -15,6 +17,8 @@ A symmetric monoidal structure on the preorder category is automatically provide instance and `CartesianMonoidalCategory.toSymmetricCategory`. -/ +@[expose] public section + namespace CategoryTheory open Category MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mod_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mod_.lean index a58d5d24c87bc4..5cc9a79765a261 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mod_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mod_.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Monoidal.Mod_ +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Monoidal.Mod_ /-! # Additional results about module objects in Cartesian monoidal categories -/ +@[expose] public section + open CategoryTheory MonoidalCategory CartesianMonoidalCategory namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon_.lean index 0872b7b02e9414..c08c66b3e3a868 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon_.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Andrew Yang -/ -import Mathlib.Algebra.Category.MonCat.Limits -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Monoidal.Mon_ +module + +public import Mathlib.Algebra.Category.MonCat.Limits +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Monoidal.Mon_ /-! # Yoneda embedding of `Mon C` @@ -15,6 +17,8 @@ is a presheaf of monoids, by constructing the yoneda embedding `Mon C ⥤ Cᵒ showing that it is fully faithful and its (essential) image is the representable functors. -/ +@[expose] public section + open CategoryTheory MonoidalCategory Limits Opposite CartesianMonoidalCategory MonObj namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean index ac5b7bafa00156..a51f38e585e969 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Limits.Constructions.Over.Products +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Products /-! @@ -15,6 +17,8 @@ for the induced `MonoidalCategory (Over X)` instance. -/ +@[expose] public section + namespace CategoryTheory.Over open Limits CartesianMonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Category.lean b/Mathlib/CategoryTheory/Monoidal/Category.lean index f8ab3a9ae8576e..e4b28751af6908 100644 --- a/Mathlib/CategoryTheory/Monoidal/Category.lean +++ b/Mathlib/CategoryTheory/Monoidal/Category.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Michael Jendrusch. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Jendrusch, Kim Morrison, Bhavik Mehta, Jakob von Raumer -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Functor.Trifunctor -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Functor.Trifunctor +public import Mathlib.CategoryTheory.Products.Basic /-! # Monoidal categories @@ -68,6 +70,8 @@ respectively, since it requires a huge refactoring. We hope to add these simp le * . -/ +@[expose] public section + universe v u open CategoryTheory.Category diff --git a/Mathlib/CategoryTheory/Monoidal/Center.lean b/Mathlib/CategoryTheory/Monoidal/Center.lean index ea425fe42a1305..c52ee2c73e928d 100644 --- a/Mathlib/CategoryTheory/Monoidal/Center.lean +++ b/Mathlib/CategoryTheory/Monoidal/Center.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # Half braidings and the Drinfeld center of a monoidal category @@ -29,6 +31,8 @@ In this file, we take the second approach using the monoidal composition `⊗≫ `coherence` tactic. -/ +@[expose] public section + universe v v₁ v₂ v₃ u u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Monoidal/CoherenceLemmas.lean b/Mathlib/CategoryTheory/Monoidal/CoherenceLemmas.lean index cb21acf57e325f..db431d3ce6a225 100644 --- a/Mathlib/CategoryTheory/Monoidal/CoherenceLemmas.lean +++ b/Mathlib/CategoryTheory/Monoidal/CoherenceLemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Michael Jendrusch. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Jendrusch, Kim Morrison, Bhavik Mehta, Jakob von Raumer -/ -import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence +module + +public import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence /-! # Lemmas which are consequences of monoidal coherence @@ -15,6 +17,8 @@ Investigate whether these lemmas are really needed, or if they can be replaced by use of the `coherence` tactic. -/ +@[expose] public section + open CategoryTheory Category Iso diff --git a/Mathlib/CategoryTheory/Monoidal/CommComon_.lean b/Mathlib/CategoryTheory/Monoidal/CommComon_.lean index dd22383a73dad0..5885cd0cc1cab8 100644 --- a/Mathlib/CategoryTheory/Monoidal/CommComon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/CommComon_.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jacob Reinhold. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jacob Reinhold -/ -import Mathlib.CategoryTheory.Monoidal.Comon_ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas +module + +public import Mathlib.CategoryTheory.Monoidal.Comon_ +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas /-! # The category of commutative comonoids in a braided monoidal category. @@ -21,6 +23,8 @@ We define the category of commutative comonoid objects in a braided monoidal cat comonoid, commutative, braided -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean b/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean index 088e24f0bffd1d..2f8bf335853f49 100644 --- a/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.Grp_ -import Mathlib.CategoryTheory.Monoidal.CommMon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Grp_ +public import Mathlib.CategoryTheory.Monoidal.CommMon_ /-! # The category of commutative groups in a Cartesian monoidal category -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ open CategoryTheory Category Limits MonoidalCategory CartesianMonoidalCategory Mon Grp CommMon diff --git a/Mathlib/CategoryTheory/Monoidal/CommMon_.lean b/Mathlib/CategoryTheory/Monoidal/CommMon_.lean index c186e4a709b5ef..5506396c564e7c 100644 --- a/Mathlib/CategoryTheory/Monoidal/CommMon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/CommMon_.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.Mon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.Mon_ /-! # The category of commutative monoids in a braided monoidal category. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ u open CategoryTheory MonoidalCategory MonObj diff --git a/Mathlib/CategoryTheory/Monoidal/Comon_.lean b/Mathlib/CategoryTheory/Monoidal/Comon_.lean index 9db464fe8bf6b8..0599f42c6bf62c 100644 --- a/Mathlib/CategoryTheory/Monoidal/Comon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Comon_.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Lean FRO LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Mon_ -import Mathlib.CategoryTheory.Monoidal.Braided.Opposite -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Monoidal.Mon_ +public import Mathlib.CategoryTheory.Monoidal.Braided.Opposite +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # The category of comonoids in a monoidal category. @@ -25,6 +27,8 @@ That is, a oplax monoidal functor `F : C ⥤ D` induces a functor `Comon C ⥤ C oplax monoidal functors from the trivial monoidal category to `C`. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ u open CategoryTheory MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Conv.lean b/Mathlib/CategoryTheory/Monoidal/Conv.lean index 92eeae0d4e6142..f01b4a383b2d0c 100644 --- a/Mathlib/CategoryTheory/Monoidal/Conv.lean +++ b/Mathlib/CategoryTheory/Monoidal/Conv.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Lean FRO LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Comon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Comon_ /-! # The convolution monoid. @@ -11,6 +13,8 @@ import Mathlib.CategoryTheory.Monoidal.Comon_ When `M : Comon C` and `N : Mon C`, the morphisms `M.X ⟶ N.X` form a monoid (in Type). -/ +@[expose] public section + universe v₁ u₁ namespace CategoryTheory open MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean index 0739b843cf2da1..3259aa90c0bcaf 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.ExternalProduct.KanExtension -import Mathlib.CategoryTheory.Products.Associator +module + +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct.KanExtension +public import Mathlib.CategoryTheory.Products.Associator /-! # Day convolution monoidal structure @@ -42,6 +44,8 @@ a monoidal structure. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ namespace CategoryTheory.MonoidalCategory @@ -814,7 +818,7 @@ lemma ι_map_associator_hom_eq_associator_hom (d d' d'') exact associator_hom_unit_unit V _ _ _ _ _ _ /-- In a `LawfulDayConvolutionMonoidalCategoryStruct`, `ι.obj (𝟙_ D)` -is a Day convolution unit`. -/ +is a Day convolution unit. -/ def convolutionUnit : DayConvolutionUnit (ι C V D|>.obj <| 𝟙_ D) where can := unitUnit _ _ _ isPointwiseLeftKanExtensionCan := isPointwiseLeftKanExtensionUnitUnit _ _ _ diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean index 88cf289d734afd..6f0fa4ca422277 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.DayConvolution +module + +public import Mathlib.CategoryTheory.Monoidal.DayConvolution /-! # Braidings for Day convolution @@ -18,6 +20,8 @@ Furthermore, we show that when both `C` and `V` are symmetric monoidal categories, then the Day convolution monoidal structure is symmetric as well. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ v₅ u₁ u₂ u₃ u₄ u₅ namespace CategoryTheory.MonoidalCategory.DayConvolution diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution/Closed.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution/Closed.lean index 25dbde689b8d0d..7b0e49169d0355 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution/Closed.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution/Closed.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.DayConvolution -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.Limits.Shapes.End +module + +public import Mathlib.CategoryTheory.Monoidal.DayConvolution +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.Limits.Shapes.End /-! # Internal homs for day convolution @@ -22,6 +24,8 @@ the Day convolution monoidal structure. constructions here to produce actual `CategoryTheory.MonoidalClosed` instances. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory.MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean index f17506fc97e000..2dd2c54d6db02b 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.DayConvolution +module + +public import Mathlib.CategoryTheory.Monoidal.DayConvolution /-! # Day functors @@ -24,6 +26,8 @@ colimit-preserving monoidal functors `(Cᵒᵖ ⊛⥤ Type u) ⥤ W` are equival to monoidal functors `C ⥤ W`. Show that the Yoneda embedding is monoidal. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory.MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Discrete.lean b/Mathlib/CategoryTheory/Monoidal/Discrete.lean index 10911373f42e8f..539828de261f73 100644 --- a/Mathlib/CategoryTheory/Monoidal/Discrete.lean +++ b/Mathlib/CategoryTheory/Monoidal/Discrete.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.CategoryTheory.Discrete.Basic -import Mathlib.CategoryTheory.Monoidal.NaturalTransformation +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.CategoryTheory.Discrete.Basic +public import Mathlib.CategoryTheory.Monoidal.NaturalTransformation /-! # Monoids as discrete monoidal categories @@ -14,6 +16,8 @@ The discrete category on a monoid is a monoidal category. Multiplicative morphisms induced monoidal functors. -/ +@[expose] public section + universe u u' diff --git a/Mathlib/CategoryTheory/Monoidal/End.lean b/Mathlib/CategoryTheory/Monoidal/End.lean index f6c18d3dacc0c6..04c16bd8c60f04 100644 --- a/Mathlib/CategoryTheory/Monoidal/End.lean +++ b/Mathlib/CategoryTheory/Monoidal/End.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Andrew Yang -/ -import Mathlib.CategoryTheory.Monoidal.Functor +module + +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # Endofunctors as a monoidal category. @@ -17,6 +19,8 @@ Can we use this to show coherence results, e.g. a cheap proof that `λ_ (𝟙_ C I suspect this is harder than is usually made out. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Monoidal/ExternalProduct.lean b/Mathlib/CategoryTheory/Monoidal/ExternalProduct.lean index d1879cae1d313b..d370a18b3f3510 100644 --- a/Mathlib/CategoryTheory/Monoidal/ExternalProduct.lean +++ b/Mathlib/CategoryTheory/Monoidal/ExternalProduct.lean @@ -3,6 +3,8 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic deprecated_module (since := "2025-06-19") diff --git a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean index 7f839dd779bdef..a91befbe602297 100644 --- a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.FunctorCategory -import Mathlib.CategoryTheory.Functor.Currying +module + +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory +public import Mathlib.CategoryTheory.Functor.Currying /-! # External product of diagrams in a monoidal category @@ -14,6 +16,8 @@ introduce the external product `K₁ ⊠ K₂ : J₁ × J₂ ⥤ C` as the bifun The notation `- ⊠ -` is scoped to `MonoidalCategory.ExternalProduct`. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory.MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean index ceafdaf47f882b..dfb692121eb1b3 100644 --- a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean +++ b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic -import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise -import Mathlib.CategoryTheory.Limits.Final +module + +public import Mathlib.CategoryTheory.Monoidal.ExternalProduct.Basic +public import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise +public import Mathlib.CategoryTheory.Limits.Final /-! # Preservation of pointwise left Kan extensions by external products @@ -19,6 +21,8 @@ of `H ⊠ K` along `L.prod (𝟭 E)`. We also prove a similar criterion to establish that `K ⊠ H'` is a pointwise left Kan extension of `K ⊠ H` along `(𝟭 E).prod L`. -/ + +@[expose] public section universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ namespace CategoryTheory.MonoidalCategory.ExternalProduct diff --git a/Mathlib/CategoryTheory/Monoidal/Free/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Free/Basic.lean index f963c344700ada..234a09c357f1d9 100644 --- a/Mathlib/CategoryTheory/Monoidal/Free/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Free/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.Functor +module + +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # The free monoidal category over a type @@ -22,6 +24,8 @@ theorem. Both of these properties are proved in the file `Coherence.lean`. -/ +@[expose] public section + universe v' u u' diff --git a/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean b/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean index ae8b65f1c4d51e..d52e93dbdadbca 100644 --- a/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean +++ b/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.Free.Basic -import Mathlib.CategoryTheory.Discrete.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Free.Basic +public import Mathlib.CategoryTheory.Discrete.Basic /-! # The monoidal coherence theorem @@ -33,6 +35,8 @@ is thin. -/ +@[expose] public section + universe u diff --git a/Mathlib/CategoryTheory/Monoidal/Functor.lean b/Mathlib/CategoryTheory/Monoidal/Functor.lean index 00582976e1b087..98c65e6f5c48a1 100644 --- a/Mathlib/CategoryTheory/Monoidal/Functor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Functor.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Michael Jendrusch. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Jendrusch, Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Monoidal.Category -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Category +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Products.Basic /-! # (Lax) monoidal functors @@ -36,6 +38,8 @@ to monoid objects. See . -/ +@[expose] public section + universe v₁ v₂ v₃ v₁' u₁ u₂ u₃ u₁' @@ -465,6 +469,21 @@ theorem map_associator_inv (X Y Z : C) : whiskerRight_δ_μ_assoc, δ_μ, comp_id, LaxMonoidal.associativity_inv, Iso.hom_inv_id_assoc, whiskerRight_δ_μ_assoc, δ_μ] +@[reassoc] +theorem map_associator' (X Y Z : C) : + (α_ (F.obj X) (F.obj Y) (F.obj Z)).hom = + μ F X Y ▷ F.obj Z ≫ μ F (X ⊗ Y) Z ≫ F.map (α_ X Y Z).hom ≫ + δ F X (Y ⊗ Z) ≫ F.obj X ◁ δ F Y Z := by + simp + +@[reassoc] +theorem map_associator_inv' (X Y Z : C) : + (α_ (F.obj X) (F.obj Y) (F.obj Z)).inv = + F.obj X ◁ μ F Y Z ≫ μ F X (Y ⊗ Z) ≫ F.map (α_ X Y Z).inv ≫ + δ F (X ⊗ Y) Z ≫ δ F X Y ▷ F.obj Z := by + rw [← cancel_epi (α_ (F.obj X) (F.obj Y) (F.obj Z)).hom, map_associator'] + simp + @[reassoc] theorem map_leftUnitor (X : C) : F.map (λ_ X).hom = δ F (𝟙_ C) X ≫ η F ▷ F.obj X ≫ (λ_ (F.obj X)).hom := by simp @@ -913,9 +932,9 @@ def rightAdjointLaxMonoidal : G.LaxMonoidal where this typeclass expresses compatibilities between the adjunction and the (op)lax monoidal structures. -/ class IsMonoidal [G.LaxMonoidal] : Prop where - leftAdjoint_ε : ε G = adj.homEquiv _ _ (η F) := by cat_disch - leftAdjoint_μ (X Y : D) : - μ G X Y = adj.homEquiv _ _ (δ F _ _ ≫ (adj.counit.app X ⊗ₘ adj.counit.app Y)) := by cat_disch + leftAdjoint_ε : ε G = adj.unit.app _ ≫ G.map (η F) := by cat_disch + leftAdjoint_μ (X Y : D) : μ G X Y = + adj.unit.app _ ≫ G.map (δ F _ _ ≫ (adj.counit.app X ⊗ₘ adj.counit.app Y)) := by cat_disch instance : letI := adj.rightAdjointLaxMonoidal @@ -935,44 +954,31 @@ lemma unit_app_unit_comp_map_η : adj.unit.app (𝟙_ C) ≫ G.map (η F) = ε G @[reassoc] lemma unit_app_tensor_comp_map_δ (X Y : C) : adj.unit.app (X ⊗ Y) ≫ G.map (δ F X Y) = (adj.unit.app X ⊗ₘ adj.unit.app Y) ≫ μ G _ _ := by - rw [IsMonoidal.leftAdjoint_μ (adj := adj), homEquiv_unit] - dsimp - simp [← adj.unit_naturality_assoc, ← Functor.map_comp, ← δ_natural_assoc] + simp [IsMonoidal.leftAdjoint_μ (adj := adj), ← adj.unit_naturality_assoc, + ← Functor.map_comp, ← δ_natural_assoc] @[reassoc] lemma map_ε_comp_counit_app_unit : F.map (ε G) ≫ adj.counit.app (𝟙_ D) = η F := by - rw [IsMonoidal.leftAdjoint_ε (adj := adj), homEquiv_unit, map_comp, - assoc, counit_naturality, left_triangle_components_assoc] + simp [IsMonoidal.leftAdjoint_ε (adj := adj)] @[reassoc] lemma map_μ_comp_counit_app_tensor (X Y : D) : F.map (μ G X Y) ≫ adj.counit.app (X ⊗ Y) = δ F _ _ ≫ (adj.counit.app X ⊗ₘ adj.counit.app Y) := by - rw [IsMonoidal.leftAdjoint_μ (adj := adj), homEquiv_unit] - simp + simp [IsMonoidal.leftAdjoint_μ (adj := adj)] instance : (Adjunction.id (C := C)).IsMonoidal where - leftAdjoint_ε := by simp [id, homEquiv] - leftAdjoint_μ := by simp [id, homEquiv] instance isMonoidal_comp {F' : D ⥤ E} {G' : E ⥤ D} (adj' : F' ⊣ G') [F'.OplaxMonoidal] [G'.LaxMonoidal] [adj'.IsMonoidal] : (adj.comp adj').IsMonoidal where leftAdjoint_ε := by - dsimp [homEquiv] - rw [← adj.unit_app_unit_comp_map_η, ← adj'.unit_app_unit_comp_map_η, - assoc, comp_unit_app, assoc, ← Functor.map_comp, - ← adj'.unit_naturality_assoc, ← map_comp, ← map_comp] + simp [IsMonoidal.leftAdjoint_ε (adj := adj'), IsMonoidal.leftAdjoint_ε (adj := adj), + ← map_comp, ← adj'.unit_naturality_assoc] leftAdjoint_μ X Y := by - apply ((adj.comp adj').homEquiv _ _).symm.injective - dsimp only [comp_obj, comp_μ, id_obj, comp_δ] - rw [Equiv.symm_apply_apply] - dsimp [homEquiv] - rw [comp_counit_app, comp_counit_app, comp_counit_app, assoc, ← tensorHom_comp_tensorHom, - δ_natural_assoc] - dsimp - rw [← adj'.map_μ_comp_counit_app_tensor, ← map_comp_assoc, ← map_comp_assoc, - ← map_comp_assoc, ← adj.map_μ_comp_counit_app_tensor, assoc, - F.map_comp_assoc, counit_naturality] + simp only [comp_obj, comp_μ, IsMonoidal.leftAdjoint_μ (adj := adj), id_obj, + IsMonoidal.leftAdjoint_μ (adj := adj'), assoc, ← map_comp, comp_unit_app, comp_δ, + comp_counit_app, ← tensorHom_comp_tensorHom, δ_natural_assoc, Functor.comp_map] + simp end LaxMonoidal @@ -1110,11 +1116,11 @@ instance isMonoidal_refl : (Equivalence.refl (C := C)).IsMonoidal := instance isMonoidal_symm [e.inverse.Monoidal] [e.IsMonoidal] : e.symm.IsMonoidal where leftAdjoint_ε := by - simp only [toAdjunction, Adjunction.homEquiv_unit] + simp only [toAdjunction] dsimp [symm] rw [counitIso_inv_app_comp_functor_map_η_inverse] leftAdjoint_μ X Y := by - simp only [toAdjunction, Adjunction.homEquiv_unit] + simp only [toAdjunction] dsimp [symm] rw [map_comp, counitIso_inv_app_tensor_comp_functor_map_δ_inverse_assoc] simp [← map_comp] @@ -1233,4 +1239,44 @@ lemma transport_δ {F G : C ⥤ D} [F.Monoidal] (i : F ≅ G) (X Y : C) : letI : end Functor.Monoidal +namespace Equivalence + +variable {C D} + +/-- +Given a functor `F` and an equivalence of categories `e` such that `e.inverse` and `e.functor ⋙ F` +are monoidal functors, `F` is monoidal as well. +-/ +def monoidalOfPrecompFunctor (e : C ≌ D) (F : D ⥤ E) {F' : C ⥤ E} (i : e.functor ⋙ F ≅ F') + [e.inverse.Monoidal] [F'.Monoidal] : F.Monoidal := + letI : (e.functor ⋙ F).Monoidal := .transport i.symm + .transport (e.invFunIdAssoc F) + +/-- +Given a functor `F` and an equivalence of categories `e` such that `e.functor` and `e.inverse ⋙ F` +are monoidal functors, `F` is monoidal as well. +-/ +def monoidalOfPrecompInverse (e : C ≌ D) (F : C ⥤ E) {F' : D ⥤ E} (i : e.inverse ⋙ F ≅ F') + [e.functor.Monoidal] [F'.Monoidal] : F.Monoidal := + e.symm.monoidalOfPrecompFunctor F i + +/-- +Given a functor `F` and an equivalence of categories `e` such that `e.functor` and `F ⋙ e.inverse` +are monoidal functors, `F` is monoidal as well. +-/ +def monoidalOfPostcompInverse (e : C ≌ D) (F : E ⥤ D) {F' : E ⥤ C} (i : F ⋙ e.inverse ≅ F') + [e.functor.Monoidal] [F'.Monoidal] : F.Monoidal := + .transport (Functor.isoWhiskerRight i.symm e.functor ≪≫ Functor.associator _ _ _ ≪≫ + Functor.isoWhiskerLeft _ e.counitIso ≪≫ F.rightUnitor) + +/-- +Given a functor `F` and an equivalence of categories `e` such that `e.inverse` and `F ⋙ e.functor` +are monoidal functors, `F` is monoidal as well. +-/ +def monoidalOfPostcompFunctor (e : C ≌ D) (F : E ⥤ C) {F' : E ⥤ D} (i : F ⋙ e.functor ≅ F') + [e.inverse.Monoidal] [F'.Monoidal] : F.Monoidal := + e.symm.monoidalOfPostcompInverse _ i + +end Equivalence + end CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Functor/Types.lean b/Mathlib/CategoryTheory/Monoidal/Functor/Types.lean index e2f4844efdb3c8..9823f4e2defd00 100644 --- a/Mathlib/CategoryTheory/Monoidal/Functor/Types.lean +++ b/Mathlib/CategoryTheory/Monoidal/Functor/Types.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Vilim Lendvaj. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vilim Lendvaj -/ -import Mathlib.CategoryTheory.Monoidal.Functor -import Mathlib.CategoryTheory.Monoidal.Types.Basic -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Tactic.Simps.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Functor +public import Mathlib.CategoryTheory.Monoidal.Types.Basic +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Tactic.Simps.Basic /-! # Convert from `Applicative` to `CategoryTheory.Functor.LaxMonoidal` @@ -15,6 +17,8 @@ This allows us to use Lean's `Type`-based applicative functors in category theor -/ +@[expose] public section + namespace CategoryTheory section diff --git a/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean index 90ed67b1cc8c27..76e27a5d9daf37 100644 --- a/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Functor.Const +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Functor.Const /-! # Monoidal structure on `C ⥤ D` when `D` is monoidal. @@ -16,6 +18,8 @@ there is a natural "pointwise" monoidal structure on `C ⥤ D`. The initial intended application is tensor product of presheaves. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ @@ -23,11 +27,13 @@ open CategoryTheory open CategoryTheory.MonoidalCategory -namespace CategoryTheory.Monoidal +namespace CategoryTheory variable {C : Type u₁} [Category.{v₁} C] variable {D : Type u₂} [Category.{v₂} D] [MonoidalCategory.{v₂} D] +namespace Monoidal + namespace FunctorCategory variable (F G F' G' : C ⥤ D) @@ -190,15 +196,19 @@ instance functorCategorySymmetric : SymmetricCategory (C ⥤ D) where end SymmetricCategory +end Monoidal + @[simps] -instance {C D E : Type*} [Category C] [Category D] [Category E] [MonoidalCategory D] +instance Functor.LaxMonoidal.whiskeringRight + {C D E : Type*} [Category C] [Category D] [Category E] [MonoidalCategory D] [MonoidalCategory E] (L : D ⥤ E) [L.LaxMonoidal] : ((Functor.whiskeringRight C D E).obj L).LaxMonoidal where ε := { app X := Functor.LaxMonoidal.ε L } μ F G := { app X := Functor.LaxMonoidal.μ L (F.obj X) (G.obj X) } @[simps] -instance {C D E : Type*} [Category C] [Category D] [Category E] [MonoidalCategory D] +instance Functor.OplaxMonoidal.whiskeringRight + {C D E : Type*} [Category C] [Category D] [Category E] [MonoidalCategory D] [MonoidalCategory E] (L : D ⥤ E) [L.OplaxMonoidal] : ((Functor.whiskeringRight C D E).obj L).OplaxMonoidal where η := { app X := Functor.OplaxMonoidal.η L } @@ -210,4 +220,18 @@ instance {C D E : Type*} [Category C] [Category D] [Category E] [MonoidalCategor [MonoidalCategory E] (L : D ⥤ E) [L.Monoidal] : ((Functor.whiskeringRight C D E).obj L).Monoidal where -end CategoryTheory.Monoidal +@[deprecated (since := "2025-11-06")] alias instLaxMonoidalFunctorObjWhiskeringRight := + Functor.LaxMonoidal.whiskeringRight +@[deprecated (since := "2025-11-06")] alias instOplaxMonoidalFunctorObjWhiskeringRight := + Functor.OplaxMonoidal.whiskeringRight +@[deprecated (since := "2025-11-06")] alias ε_app := Functor.LaxMonoidal.whiskeringRight_ε_app +@[deprecated (since := "2025-11-06")] alias μ_app := Functor.LaxMonoidal.whiskeringRight_μ_app +@[deprecated (since := "2025-11-06")] alias η_app := Functor.OplaxMonoidal.whiskeringRight_η_app +@[deprecated (since := "2025-11-06")] alias δ_app := Functor.OplaxMonoidal.whiskeringRight_δ_app + +@[simps!] +instance Functor.Monoidal.whiskeringLeft (E : Type*) [Category E] [MonoidalCategory E] (F : C ⥤ D) : + ((whiskeringLeft _ _ E).obj F).Monoidal := + CoreMonoidal.toMonoidal { εIso := Iso.refl _, μIso _ _ := Iso.refl _ } + +end CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Grp_.lean b/Mathlib/CategoryTheory/Monoidal/Grp_.lean index e89bd65d34da43..bf94bd7c122a4d 100644 --- a/Mathlib/CategoryTheory/Monoidal/Grp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Grp_.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.ExactFunctor +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.ExactFunctor /-! # The category of groups in a Cartesian monoidal category @@ -18,6 +20,8 @@ morphisms of group objects commute with taking inverses. We show that a finite-product-preserving functor takes group objects to group objects. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ u open CategoryTheory Category Limits MonoidalCategory CartesianMonoidalCategory Mon MonObj diff --git a/Mathlib/CategoryTheory/Monoidal/Hopf_.lean b/Mathlib/CategoryTheory/Monoidal/Hopf_.lean index 0c610bf8d285fa..6a62c97fd7b11f 100644 --- a/Mathlib/CategoryTheory/Monoidal/Hopf_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Hopf_.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Lean FRO LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Bimon_ -import Mathlib.CategoryTheory.Monoidal.Conv +module + +public import Mathlib.CategoryTheory.Monoidal.Bimon_ +public import Mathlib.CategoryTheory.Monoidal.Conv /-! # The category of Hopf monoids in a braided monoidal category. @@ -16,6 +18,8 @@ import Mathlib.CategoryTheory.Monoidal.Conv * Show that `Hopf (ModuleCat R) ≌ HopfAlgCat R`. -/ +@[expose] public section + noncomputable section universe v₁ v₂ u₁ u₂ u diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean index b817b447924320..7d368a053a789c 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.CommMon_ -import Mathlib.CategoryTheory.Monoidal.Comon_ -import Mathlib.CategoryTheory.Monoidal.FunctorCategory +module + +public import Mathlib.CategoryTheory.Monoidal.CommMon_ +public import Mathlib.CategoryTheory.Monoidal.Comon_ +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory /-! # `Mon (C ⥤ D) ≌ C ⥤ Mon D` @@ -26,6 +28,8 @@ and could be generalised to any internal algebraic objects, if the appropriate framework was available. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean index 801dea8288b9fd..d54013266cd130 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Internal.FunctorCategory -import Mathlib.CategoryTheory.Monoidal.Limits.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Internal.FunctorCategory +public import Mathlib.CategoryTheory.Monoidal.Limits.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Basic /-! # Limits of monoid objects. @@ -17,6 +19,8 @@ and the forgetful functor preserves these limits. in particular `MonCat`, `SemiRingCat`, `RingCat`, and `AlgCat R`.) -/ +@[expose] public section + open CategoryTheory Limits Monoidal MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean index 62dd486f715e6a..c7bf0d0e47f642 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic -import Mathlib.Algebra.Category.AlgCat.Basic -import Mathlib.CategoryTheory.Monoidal.Mon_ +module + +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +public import Mathlib.Algebra.Category.AlgCat.Basic +public import Mathlib.CategoryTheory.Monoidal.Mon_ /-! # `Mon (ModuleCat R) ≌ AlgCat R` @@ -16,6 +18,8 @@ is equivalent to the category of "native" bundled `R`-algebras. Moreover, this equivalence is compatible with the forgetful functors to `ModuleCat R`. -/ +@[expose] public section + suppress_compilation diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Types/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Types/Basic.lean index 13eb231f379145..99135e745d0c57 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Types/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Types/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.CategoryTheory.Monoidal.CommMon_ -import Mathlib.CategoryTheory.Monoidal.Types.Basic +module + +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.CategoryTheory.Monoidal.CommMon_ +public import Mathlib.CategoryTheory.Monoidal.Types.Basic /-! # `Mon (Type u) ≌ MonCat.{u}` @@ -16,6 +18,8 @@ is equivalent to the category of "native" bundled monoids. Moreover, this equivalence is compatible with the forgetful functors to `Type`. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe v u diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Types/CommGrp_.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Types/CommGrp_.lean index 7ff7666eaeb6da..99507a17c05f68 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Types/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Types/CommGrp_.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.Internal.Types.Grp_ -import Mathlib.CategoryTheory.Monoidal.CommGrp_ +module + +public import Mathlib.CategoryTheory.Monoidal.Internal.Types.Grp_ +public import Mathlib.CategoryTheory.Monoidal.CommGrp_ /-! # `CommGrp (Type u) ≌ CommGrpCat.{u}` @@ -15,6 +17,8 @@ is equivalent to the category of "native" bundled commutative groups. Moreover, this equivalence is compatible with the forgetful functors to `Type`. -/ +@[expose] public section + assert_not_exists Field universe v u diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Types/Grp_.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Types/Grp_.lean index 6e15a810ce022b..95a4665ef66cd3 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Types/Grp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Types/Grp_.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.Internal.Types.Basic -import Mathlib.CategoryTheory.Monoidal.Grp_ -import Mathlib.Algebra.Category.Grp.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Internal.Types.Basic +public import Mathlib.CategoryTheory.Monoidal.Grp_ +public import Mathlib.Algebra.Category.Grp.Basic /-! # `Grp (Type u) ≌ GrpCat.{u}` @@ -16,6 +18,8 @@ is equivalent to the category of "native" bundled groups. Moreover, this equivalence is compatible with the forgetful functors to `Type`. -/ +@[expose] public section + assert_not_exists Field universe v u diff --git a/Mathlib/CategoryTheory/Monoidal/Limits.lean b/Mathlib/CategoryTheory/Monoidal/Limits.lean index 68d1a49470e9e2..29f5cf34ba10d7 100644 --- a/Mathlib/CategoryTheory/Monoidal/Limits.lean +++ b/Mathlib/CategoryTheory/Monoidal/Limits.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Limits.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Limits.Basic deprecated_module (since := "2025-08-13") diff --git a/Mathlib/CategoryTheory/Monoidal/Limits/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Limits/Basic.lean index 660630ebf4f51c..68be092e015897 100644 --- a/Mathlib/CategoryTheory/Monoidal/Limits/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Limits/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.FunctorCategory -import Mathlib.CategoryTheory.Limits.HasLimits +module + +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory +public import Mathlib.CategoryTheory.Limits.HasLimits /-! # `lim : (J ⥤ C) ⥤ C` is lax monoidal when `C` is a monoidal category. @@ -19,6 +21,8 @@ satisfying the laws of a lax monoidal functor. Now that we have oplax monoidal functors, assemble `Limits.colim` into an oplax monoidal functor. -/ +@[expose] public section + namespace CategoryTheory.Limits open MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Limits/Preserves.lean b/Mathlib/CategoryTheory/Monoidal/Limits/Preserves.lean index e3102ab6d934bc..7f487a3944aebd 100644 --- a/Mathlib/CategoryTheory/Monoidal/Limits/Preserves.lean +++ b/Mathlib/CategoryTheory/Monoidal/Limits/Preserves.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic /-! # Miscellany about preservations of (co)limits in monoidal categories This file records some `PreservesColimits` instance on tensors products on monoidal categories. -/ +@[expose] public section + namespace CategoryTheory.MonoidalCategory.Limits open _root_.CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Monoidal/Linear.lean b/Mathlib/CategoryTheory/Monoidal/Linear.lean index 347cf099447dcd..32b45c0c889a9e 100644 --- a/Mathlib/CategoryTheory/Monoidal/Linear.lean +++ b/Mathlib/CategoryTheory/Monoidal/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.CategoryTheory.Monoidal.Preadditive +module + +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.CategoryTheory.Monoidal.Preadditive /-! # Linear monoidal categories @@ -13,6 +15,8 @@ A monoidal category is `MonoidalLinear R` if it is monoidal preadditive and tensor product of morphisms is `R`-linear in both factors. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Mod_.lean b/Mathlib/CategoryTheory/Monoidal/Mod_.lean index e18a9b602c63d7..f7a74b2694ea93 100644 --- a/Mathlib/CategoryTheory/Monoidal/Mod_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Mod_.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Paul Lezeau, Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Mon_ -import Mathlib.CategoryTheory.Monoidal.Action.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Mon_ +public import Mathlib.CategoryTheory.Monoidal.Action.Basic /-! # The category of module objects over a monoid object. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ open CategoryTheory MonoidalCategory MonObj diff --git a/Mathlib/CategoryTheory/Monoidal/Mon_.lean b/Mathlib/CategoryTheory/Monoidal/Mon_.lean index d4bf486a194c79..dc24c3611f74ab 100644 --- a/Mathlib/CategoryTheory/Monoidal/Mon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Mon_.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.PUnit -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas -import Mathlib.CategoryTheory.Monoidal.Discrete -import Mathlib.CategoryTheory.Limits.Shapes.Terminal +module + +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas +public import Mathlib.CategoryTheory.Monoidal.Discrete +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal /-! # The category of monoids in a monoidal category. @@ -38,6 +40,8 @@ Please read the documentation in `Mathlib/Tactic/Attr/Register.lean` for full de How does it compare to the "native" one? -/ +@[expose] public section + universe w v₁ v₂ v₃ u₁ u₂ u₃ u open Function CategoryTheory MonoidalCategory Functor.LaxMonoidal Functor.OplaxMonoidal diff --git a/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean b/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean index bb82acbd03033c..a7beb676325fea 100644 --- a/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Monoidal.Functor +module + +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # Constructing monoidal functors from natural transformations between multifunctors @@ -18,6 +20,8 @@ Once we have more API for quadrifunctors, we can add constructors for monoidal c by phrasing the pentagon axiom as an equality of natural transformations between quadrifunctors. -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] [MonoidalCategory C] @@ -67,6 +71,28 @@ abbrev curriedTensorPostPost (F : C ⥤ D) : C ⥤ C ⥤ C ⥤ D := abbrev curriedTensorPostPost' (F : C ⥤ D) : C ⥤ C ⥤ C ⥤ D := bifunctorComp₂₃ (curriedTensorPost F) (curriedTensor C) +/-- The natural isomorphism of bifunctors `F - ⊗ F - ≅ F (- ⊗ -)`, given a monoidal functor `F`. -/ +@[simps!] +def Functor.curriedTensorPreIsoPost (F : C ⥤ D) [F.Monoidal] : + curriedTensorPre F ≅ curriedTensorPost F := + NatIso.ofComponents (fun _ ↦ NatIso.ofComponents (fun _ ↦ Monoidal.μIso F _ _)) + +/-- The functor which associates to a functor `F` the bifunctor `F - ⊗ F -`. -/ +@[simps] +def curriedTensorPreFunctor : (C ⥤ D) ⥤ C ⥤ C ⥤ D where + obj F := curriedTensorPre F + map {F₁ F₂} f := + { app X₁ := + { app X₂ := f.app _ ⊗ₘ f.app _ + naturality := by simp [← id_tensorHom] } + naturality _ _ _ := by + ext + simp [← tensorHom_id] } + +/-- The functor which associates to a functor `F` the bifunctor `F (- ⊗ -)`. -/ +abbrev curriedTensorPostFunctor : (C ⥤ D) ⥤ C ⥤ C ⥤ D := + Functor.postcompose₂.flip.obj (curriedTensor C) + end MonoidalCategory open MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean b/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean index 1af1856cf5a1df..b26b837efd5c68 100644 --- a/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean +++ b/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Monoidal.Functor -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +module + +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Monoidal.Functor +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory /-! # Monoidal natural transformations @@ -16,6 +18,8 @@ an additional compatibility relation with the tensorators: -/ +@[expose] public section + open CategoryTheory universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Basic.lean b/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Basic.lean index 7619a9e7efeb61..37d55023a3f1ad 100644 --- a/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Basic.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic deprecated_module (since := "2025-05-08") diff --git a/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Symmetric.lean b/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Symmetric.lean index 7619a9e7efeb61..37d55023a3f1ad 100644 --- a/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Symmetric.lean +++ b/Mathlib/CategoryTheory/Monoidal/OfChosenFiniteProducts/Symmetric.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic deprecated_module (since := "2025-05-08") diff --git a/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean b/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean index f37b3fe07074da..3b4c2f5e5f554b 100644 --- a/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean +++ b/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Simon Hudon -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal /-! # The natural monoidal structure on any category with finite (co)products. @@ -21,10 +23,12 @@ we don't set up either construct as an instance. ## TODO -Replace `monoidalOfHasFiniteProducts` and `symmetricOfHasFiniteProducts` -with `CartesianMonoidalCategory.ofHasFiniteProducts`. +Once we have cocartesian-monoidal categories, replace `monoidalOfHasFiniteCoproducts` and +`symmetricOfHasFiniteCoproducts` with `CocartesianMonoidalCategory.ofHasFiniteCoproducts`. -/ +@[expose] public section + universe v u @@ -39,21 +43,11 @@ open CategoryTheory.Limits section /-- A category with a terminal object and binary products has a natural monoidal structure. -/ +@[deprecated CartesianMonoidalCategory.ofHasFiniteProducts (since := "2025-10-19")] def monoidalOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : MonoidalCategory C := - letI : MonoidalCategoryStruct C := { - tensorObj := fun X Y ↦ X ⨯ Y - whiskerLeft := fun _ _ _ g ↦ Limits.prod.map (𝟙 _) g - whiskerRight := fun {_ _} f _ ↦ Limits.prod.map f (𝟙 _) - tensorHom := fun f g ↦ Limits.prod.map f g - tensorUnit := ⊤_ C - associator := prod.associator - leftUnitor := fun P ↦ Limits.prod.leftUnitor P - rightUnitor := fun P ↦ Limits.prod.rightUnitor P - } - .ofTensorHom - (pentagon := prod.pentagon) - (triangle := prod.triangle) - (associator_naturality := @prod.associator_naturality _ _ _) + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + let +nondep : CartesianMonoidalCategory C := .ofHasFiniteProducts + inferInstance end @@ -65,76 +59,72 @@ attribute [local instance] monoidalOfHasFiniteProducts open scoped MonoidalCategory -@[ext] theorem unit_ext {X : C} (f g : X ⟶ 𝟙_ C) : f = g := terminal.hom_ext f g +@[deprecated CartesianMonoidalCategory.toUnit_unique (since := "2025-10-19")] +theorem unit_ext {X : C} (f g : X ⟶ 𝟙_ C) : f = g := terminal.hom_ext f g -@[ext] theorem tensor_ext {X Y Z : C} (f g : X ⟶ Y ⊗ Z) +@[deprecated CartesianMonoidalCategory.hom_ext (since := "2025-10-19")] +theorem tensor_ext {X Y Z : C} (f g : X ⟶ Y ⊗ Z) (w₁ : f ≫ prod.fst = g ≫ prod.fst) (w₂ : f ≫ prod.snd = g ≫ prod.snd) : f = g := Limits.prod.hom_ext w₁ w₂ -@[simp] theorem tensorUnit : 𝟙_ C = ⊤_ C := rfl +@[deprecated "This is an implementation detail." (since := "2025-10-19"), simp] +theorem tensorUnit : 𝟙_ C = ⊤_ C := rfl -@[simp] +@[deprecated "This is an implementation detail." (since := "2025-10-19"), simp] theorem tensorObj (X Y : C) : X ⊗ Y = (X ⨯ Y) := rfl -@[simp] -theorem tensorHom {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) : f ⊗ₘ g = Limits.prod.map f g := - rfl - -@[simp] -theorem whiskerLeft (X : C) {Y Z : C} (f : Y ⟶ Z) : X ◁ f = Limits.prod.map (𝟙 X) f := - rfl - -@[simp] -theorem whiskerRight {X Y : C} (f : X ⟶ Y) (Z : C) : f ▷ Z = Limits.prod.map f (𝟙 Z) := - rfl - -@[simp] +@[deprecated CartesianMonoidalCategory.leftUnitor_hom (since := "2025-10-19"), simp] theorem leftUnitor_hom (X : C) : (λ_ X).hom = Limits.prod.snd := rfl -@[simp] -theorem leftUnitor_inv (X : C) : (λ_ X).inv = prod.lift (terminal.from X) (𝟙 _) := - rfl - -@[simp] +@[deprecated CartesianMonoidalCategory.rightUnitor_hom (since := "2025-10-19"), simp] theorem rightUnitor_hom (X : C) : (ρ_ X).hom = Limits.prod.fst := rfl -@[simp] -theorem rightUnitor_inv (X : C) : (ρ_ X).inv = prod.lift (𝟙 _) (terminal.from X) := - rfl - --- We don't mark this as a simp lemma, even though in many particular --- categories the right-hand side will simplify significantly further. --- For now, we'll plan to create specialised simp lemmas in each particular category. +@[deprecated "Use the `CartesianMonoidalCategory.associator_hom_...` lemmas" + (since := "2025-10-19"), simp] theorem associator_hom (X Y Z : C) : (α_ X Y Z).hom = prod.lift (Limits.prod.fst ≫ Limits.prod.fst) (prod.lift (Limits.prod.fst ≫ Limits.prod.snd) Limits.prod.snd) := rfl +@[deprecated "Use the `CartesianMonoidalCategory.associator_inv_...` lemmas" + (since := "2025-10-19")] theorem associator_inv (X Y Z : C) : (α_ X Y Z).inv = prod.lift (prod.lift prod.fst (prod.snd ≫ prod.fst)) (prod.snd ≫ prod.snd) := rfl -@[reassoc] theorem associator_hom_fst (X Y Z : C) : +set_option linter.deprecated false in +@[deprecated CartesianMonoidalCategory.associator_hom_fst (since := "2025-10-19")] +theorem associator_hom_fst (X Y Z : C) : (α_ X Y Z).hom ≫ prod.fst = prod.fst ≫ prod.fst := by simp [associator_hom] -@[reassoc] theorem associator_hom_snd_fst (X Y Z : C) : +set_option linter.deprecated false in +@[deprecated CartesianMonoidalCategory.associator_hom_snd_fst (since := "2025-10-19")] +theorem associator_hom_snd_fst (X Y Z : C) : (α_ X Y Z).hom ≫ prod.snd ≫ prod.fst = prod.fst ≫ prod.snd := by simp [associator_hom] -@[reassoc] theorem associator_hom_snd_snd (X Y Z : C) : +set_option linter.deprecated false in +@[deprecated CartesianMonoidalCategory.associator_hom_snd_snd (since := "2025-10-19")] +theorem associator_hom_snd_snd (X Y Z : C) : (α_ X Y Z).hom ≫ prod.snd ≫ prod.snd = prod.snd := by simp [associator_hom] -@[reassoc] theorem associator_inv_fst_fst (X Y Z : C) : +set_option linter.deprecated false in +@[deprecated CartesianMonoidalCategory.associator_inv_fst_fst (since := "2025-10-19")] +theorem associator_inv_fst_fst (X Y Z : C) : (α_ X Y Z).inv ≫ prod.fst ≫ prod.fst = prod.fst := by simp [associator_inv] -@[reassoc] theorem associator_inv_fst_snd (X Y Z : C) : +set_option linter.deprecated false in +@[deprecated CartesianMonoidalCategory.associator_inv_fst_snd (since := "2025-10-19")] +theorem associator_inv_fst_snd (X Y Z : C) : (α_ X Y Z).inv ≫ prod.fst ≫ prod.snd = prod.snd ≫ prod.fst := by simp [associator_inv] -@[reassoc] theorem associator_inv_snd (X Y Z : C) : +set_option linter.deprecated false in +@[deprecated CartesianMonoidalCategory.associator_inv_snd (since := "2025-10-19")] +theorem associator_inv_snd (X Y Z : C) : (α_ X Y Z).inv ≫ prod.snd = prod.snd ≫ prod.snd := by simp [associator_inv] end monoidalOfHasFiniteProducts @@ -145,16 +135,15 @@ attribute [local instance] monoidalOfHasFiniteProducts open MonoidalCategory +set_option linter.deprecated false in /-- The monoidal structure coming from finite products is symmetric. -/ -@[simps] -def symmetricOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : SymmetricCategory C where - braiding X Y := Limits.prod.braiding X Y - braiding_naturality_left f X := by simp - braiding_naturality_right X _ _ f := by simp - hexagon_forward X Y Z := by dsimp [monoidalOfHasFiniteProducts.associator_hom]; simp - hexagon_reverse X Y Z := by dsimp [monoidalOfHasFiniteProducts.associator_inv]; simp - symmetry X Y := by simp +@[deprecated CartesianMonoidalCategory.toSymmetricCategory (since := "2025-10-19"), simps!] +def symmetricOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : SymmetricCategory C := + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let +nondep : BraidedCategory C := .ofCartesianMonoidalCategory + inferInstance end @@ -256,54 +245,69 @@ end namespace monoidalOfHasFiniteProducts -attribute [local instance] monoidalOfHasFiniteProducts - variable {C} variable {D : Type*} [Category D] (F : C ⥤ D) [HasTerminal C] [HasBinaryProducts C] [HasTerminal D] [HasBinaryProducts D] +set_option linter.deprecated false in attribute [local simp] associator_hom_fst -instance : F.OplaxMonoidal where - η := terminalComparison F - δ X Y := prodComparison F X Y - δ_natural_left _ _ := by simp [prodComparison_natural] - δ_natural_right _ _ := by simp [prodComparison_natural] - oplax_associativity _ _ _ := by - dsimp - ext - · dsimp - simp only [Category.assoc, prod.map_fst, Category.comp_id, prodComparison_fst, ← - Functor.map_comp] - erw [associator_hom_fst, associator_hom_fst] - simp - · dsimp - simp only [Category.assoc, prod.map_snd, prodComparison_snd_assoc, prodComparison_fst, - ← Functor.map_comp] - erw [associator_hom_snd_fst, associator_hom_snd_fst] - simp - · dsimp - simp only [Category.assoc, prod.map_snd, prodComparison_snd_assoc, prodComparison_snd, ← - Functor.map_comp] - erw [associator_hom_snd_snd, associator_hom_snd_snd] - simp - oplax_left_unitality _ := by ext; simp [← Functor.map_comp] - oplax_right_unitality _ := by ext; simp [← Functor.map_comp] +@[deprecated Functor.OplaxMonoidal.ofChosenFiniteProducts (since := "2025-10-19")] +instance : + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let : CartesianMonoidalCategory D := .ofHasFiniteProducts + F.OplaxMonoidal := by extract_lets; exact .ofChosenFiniteProducts F open Functor.OplaxMonoidal -lemma η_eq : η F = terminalComparison F := rfl -lemma δ_eq (X Y : C) : δ F X Y = prodComparison F X Y := rfl +@[deprecated "No replacement" (since := "2025-10-19")] +lemma η_eq : + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let : CartesianMonoidalCategory D := .ofHasFiniteProducts + η F = terminalComparison F := rfl + +@[deprecated "No replacement" (since := "2025-10-19")] +lemma δ_eq (X Y : C) : + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let : CartesianMonoidalCategory D := .ofHasFiniteProducts + δ F X Y = prodComparison F X Y := rfl variable [PreservesLimit (Functor.empty.{0} C) F] [PreservesLimitsOfShape (Discrete WalkingPair) F] -instance : IsIso (η F) := by dsimp [η_eq]; infer_instance -instance (X Y : C) : IsIso (δ F X Y) := by dsimp [δ_eq]; infer_instance +set_option linter.deprecated false in +@[deprecated inferInstance (since := "2025-10-19")] +instance : + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let : CartesianMonoidalCategory D := .ofHasFiniteProducts + IsIso (η F) := by dsimp [η_eq]; infer_instance + +set_option linter.deprecated false in +@[deprecated inferInstance (since := "2025-10-19")] +instance (X Y : C) : + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let : CartesianMonoidalCategory D := .ofHasFiniteProducts + IsIso (δ F X Y) := by dsimp [δ_eq]; infer_instance /-- Promote a functor that preserves finite products to a monoidal functor between categories equipped with the monoidal category structure given by finite products. -/ -instance : F.Monoidal := .ofOplaxMonoidal F +@[deprecated Functor.Monoidal.ofChosenFiniteProducts (since := "2025-10-19")] +instance : + have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal + have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal + let : CartesianMonoidalCategory C := .ofHasFiniteProducts + let : CartesianMonoidalCategory D := .ofHasFiniteProducts + F.Monoidal := by extract_lets; exact .ofOplaxMonoidal F end monoidalOfHasFiniteProducts diff --git a/Mathlib/CategoryTheory/Monoidal/Opposite.lean b/Mathlib/CategoryTheory/Monoidal/Opposite.lean index 63c103738a3dc6..c13c6d7d4a8e91 100644 --- a/Mathlib/CategoryTheory/Monoidal/Opposite.lean +++ b/Mathlib/CategoryTheory/Monoidal/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Functor -import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence +module + +public import Mathlib.CategoryTheory.Monoidal.Functor +public import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence /-! # Monoidal opposites @@ -12,6 +14,8 @@ import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence We write `Cᵐᵒᵖ` for the monoidal opposite of a monoidal category `C`. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ @@ -350,9 +354,9 @@ instance MonoidalOpposite.mopMopEquivalenceInverseMonoidal : instance : (mopMopEquivalence C).IsMonoidal where leftAdjoint_ε := by - simp [ε, η, Adjunction.homEquiv, mopMopEquivalence, Equivalence.trans, unmopEquiv, ε] + simp [ε, η, mopMopEquivalence, Equivalence.trans, unmopEquiv, ε] leftAdjoint_μ X Y := by - simp [μ, δ, Adjunction.homEquiv, mopMopEquivalence, Equivalence.trans, unmopEquiv, μ] + simp [μ, δ, mopMopEquivalence, Equivalence.trans, unmopEquiv, μ] /-- The identification `mop X ⊗ mop Y = mop (Y ⊗ X)` as a natural isomorphism. -/ @[simps!] @@ -434,7 +438,7 @@ instance : (opOpEquivalence C).inverse.Monoidal := monoidalOpOp @[deprecated (since := "2025-06-08")] alias unopUnop_δ := monoidalUnopUnop_δ instance : (opOpEquivalence C).IsMonoidal where - leftAdjoint_ε := by simp [Adjunction.homEquiv, opOpEquivalence] - leftAdjoint_μ := by simp [Adjunction.homEquiv, opOpEquivalence] + leftAdjoint_ε := by simp [opOpEquivalence] + leftAdjoint_μ := by simp [opOpEquivalence] end CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Opposite/Mon_.lean b/Mathlib/CategoryTheory/Monoidal/Opposite/Mon_.lean index cac3a6563fce1a..2604c95a87845b 100644 --- a/Mathlib/CategoryTheory/Monoidal/Opposite/Mon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Opposite/Mon_.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Opposite -import Mathlib.CategoryTheory.Monoidal.Mon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Opposite +public import Mathlib.CategoryTheory.Monoidal.Mon_ /-! # Monoid objects internal to monoidal opposites @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Monoidal.Mon_ In this file, we record the equivalence between `Mon C` and `Mon Cᴹᵒᵖ`. -/ +@[expose] public section + namespace MonObj open CategoryTheory MonoidalCategory MonoidalOpposite diff --git a/Mathlib/CategoryTheory/Monoidal/Preadditive.lean b/Mathlib/CategoryTheory/Monoidal/Preadditive.lean index c210bb68e7da7e..443fb11534b633 100644 --- a/Mathlib/CategoryTheory/Monoidal/Preadditive.lean +++ b/Mathlib/CategoryTheory/Monoidal/Preadditive.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Monoidal.Functor +module + +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # Preadditive monoidal categories @@ -13,6 +15,8 @@ A monoidal category is `MonoidalPreadditive` if it is preadditive and tensor pro is linear in both factors. -/ +@[expose] public section + noncomputable section namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean index e71c9460962a00..18fb3e15a4aa7d 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.Tactic.CategoryTheory.Monoidal.Basic -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Tactic.CategoryTheory.Monoidal.Basic +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.Tactic.ApplyFun /-! # Rigid (autonomous) monoidal categories @@ -57,6 +59,8 @@ rigid category, monoidal category -/ +@[expose] public section + open CategoryTheory MonoidalCategory diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean index 5125630395a5a6..4a47f05eecd610 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Gareth Ma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gareth Ma -/ -import Mathlib.CategoryTheory.Monoidal.Rigid.Basic -import Mathlib.CategoryTheory.Monoidal.Braided.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Rigid.Basic +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic /-! # Deriving `RigidCategory` instance for braided and left/right rigid categories. -/ +@[expose] public section + open CategoryTheory Category BraidedCategory MonoidalCategory variable {C : Type*} [Category C] [MonoidalCategory C] [BraidedCategory C] {X Y : C} diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/FunctorCategory.lean index 8a8ee6af31c944..ecbae9248345ff 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/FunctorCategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Rigid.Basic -import Mathlib.CategoryTheory.Monoidal.FunctorCategory +module + +public import Mathlib.CategoryTheory.Monoidal.Rigid.Basic +public import Mathlib.CategoryTheory.Monoidal.FunctorCategory /-! # Functors from a groupoid into a right/left rigid category form a right/left rigid category. @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Monoidal.FunctorCategory (Using the pointwise monoidal structure on the functor category.) -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean index 238dfb98f19469..28941d935edff5 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Rigid.Basic +module + +public import Mathlib.CategoryTheory.Monoidal.Rigid.Basic /-! # Transport rigid structures over a monoidal equivalence. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Skeleton.lean b/Mathlib/CategoryTheory/Monoidal/Skeleton.lean index 5258d6b87584dc..8c9f59bd1ba85b 100644 --- a/Mathlib/CategoryTheory/Monoidal/Skeleton.lean +++ b/Mathlib/CategoryTheory/Monoidal/Skeleton.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.CategoryTheory.Skeletal +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.CategoryTheory.Skeletal /-! # The monoid on the skeleton of a monoidal category @@ -19,6 +21,8 @@ The skeleton of a monoidal category is a monoid. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Subcategory.lean b/Mathlib/CategoryTheory/Monoidal/Subcategory.lean index 4e0aca15f4e093..29db051866754b 100644 --- a/Mathlib/CategoryTheory/Monoidal/Subcategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Subcategory.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Antoine Labelle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle -/ -import Mathlib.CategoryTheory.Monoidal.Braided.Basic -import Mathlib.CategoryTheory.Monoidal.Linear -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.CategoryTheory.Closed.Monoidal +module + +public import Mathlib.CategoryTheory.Monoidal.Braided.Basic +public import Mathlib.CategoryTheory.Monoidal.Linear +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.CategoryTheory.Closed.Monoidal /-! # Full monoidal subcategories @@ -25,6 +27,8 @@ braided/symmetric structure. * Add monoidal/braided versions of `ObjectProperty.Lift` -/ +@[expose] public section + universe u v diff --git a/Mathlib/CategoryTheory/Monoidal/Tor.lean b/Mathlib/CategoryTheory/Monoidal/Tor.lean index d74c94b26afa97..a0b666f28de363 100644 --- a/Mathlib/CategoryTheory/Monoidal/Tor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Tor.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Abelian.LeftDerived -import Mathlib.CategoryTheory.Monoidal.Preadditive +module + +public import Mathlib.CategoryTheory.Abelian.LeftDerived +public import Mathlib.CategoryTheory.Monoidal.Preadditive /-! # Tor, the left-derived functor of tensor product @@ -21,6 +23,8 @@ Possibly it's best to axiomatize delta functors, and obtain a unique characteris -/ +@[expose] public section + assert_not_exists ModuleCat.abelian diff --git a/Mathlib/CategoryTheory/Monoidal/Transport.lean b/Mathlib/CategoryTheory/Monoidal/Transport.lean index 275c540420186c..4a5af2021199e3 100644 --- a/Mathlib/CategoryTheory/Monoidal/Transport.lean +++ b/Mathlib/CategoryTheory/Monoidal/Transport.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.NaturalTransformation +module + +public import Mathlib.CategoryTheory.Monoidal.NaturalTransformation /-! # Transport a monoidal structure along an equivalence. @@ -21,6 +23,8 @@ We then upgrade the original functor and its inverse to monoidal functors with respect to the new monoidal structure on `D`. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Monoidal/Types/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Types/Basic.lean index f690c0d6221065..be9ea4ae9fa63f 100644 --- a/Mathlib/CategoryTheory/Monoidal/Types/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Types/Basic.lean @@ -3,18 +3,19 @@ Copyright (c) 2018 Michael Jendrusch. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Jendrusch, Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic -import Mathlib.CategoryTheory.Monoidal.Functor -import Mathlib.CategoryTheory.Limits.Types.Shapes +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic +public import Mathlib.CategoryTheory.Monoidal.Functor /-! # The category of types is a (symmetric) monoidal category -/ +@[expose] public section -open CategoryTheory Limits MonoidalCategory -open Tactic +open CategoryTheory Limits MonoidalCategory universe v u diff --git a/Mathlib/CategoryTheory/Monoidal/Types/Coyoneda.lean b/Mathlib/CategoryTheory/Monoidal/Types/Coyoneda.lean index ccf1bb5e76a124..9ff9bba30a0e83 100644 --- a/Mathlib/CategoryTheory/Monoidal/Types/Coyoneda.lean +++ b/Mathlib/CategoryTheory/Monoidal/Types/Coyoneda.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Michael Jendrusch. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Jendrusch, Kim Morrison -/ -import Mathlib.CategoryTheory.Monoidal.Types.Basic -import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas +module + +public import Mathlib.CategoryTheory.Monoidal.Types.Basic +public import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas /-! # `(𝟙_ C ⟶ -)` is a lax monoidal functor to `Type` -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Monoidal/Yoneda.lean b/Mathlib/CategoryTheory/Monoidal/Yoneda.lean index fc804404967b0c..63790b50b145f2 100644 --- a/Mathlib/CategoryTheory/Monoidal/Yoneda.lean +++ b/Mathlib/CategoryTheory/Monoidal/Yoneda.lean @@ -1,3 +1,5 @@ -import Mathlib.CategoryTheory.Monoidal.Mon_ +module + +public import Mathlib.CategoryTheory.Monoidal.Mon_ deprecated_module (since := "2025-05-11") diff --git a/Mathlib/CategoryTheory/MorphismProperty/Basic.lean b/Mathlib/CategoryTheory/MorphismProperty/Basic.lean index 77d45f0447dc20..1fcd08d2e3bfae 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Basic.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.Order.CompleteBooleanAlgebra +module + +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.Order.CompleteBooleanAlgebra /-! # Properties of morphisms @@ -20,6 +22,8 @@ The following meta-property is defined -/ +@[expose] public section + universe w v v' u u' @@ -29,28 +33,30 @@ noncomputable section namespace CategoryTheory -variable (C : Type u) [Category.{v} C] {D : Type*} [Category D] - /-- A `MorphismProperty C` is a class of morphisms between objects in `C`. -/ -def MorphismProperty := +def MorphismProperty (C : Type u) [CategoryStruct.{v} C] := ∀ ⦃X Y : C⦄ (_ : X ⟶ Y), Prop +namespace MorphismProperty + +section + +variable (C : Type u) [CategoryStruct.{v} C] + instance : CompleteBooleanAlgebra (MorphismProperty C) where le P₁ P₂ := ∀ ⦃X Y : C⦄ (f : X ⟶ Y), P₁ f → P₂ f __ := inferInstanceAs (CompleteBooleanAlgebra (∀ ⦃X Y : C⦄ (_ : X ⟶ Y), Prop)) -lemma MorphismProperty.le_def {P Q : MorphismProperty C} : +lemma le_def {P Q : MorphismProperty C} : P ≤ Q ↔ ∀ {X Y : C} (f : X ⟶ Y), P f → Q f := Iff.rfl instance : Inhabited (MorphismProperty C) := ⟨⊤⟩ -lemma MorphismProperty.top_eq : (⊤ : MorphismProperty C) = fun _ _ _ => True := rfl +lemma top_eq : (⊤ : MorphismProperty C) = fun _ _ _ => True := rfl variable {C} -namespace MorphismProperty - @[ext] lemma ext (W W' : MorphismProperty C) (h : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), W f ↔ W' f) : W = W' := by @@ -98,6 +104,12 @@ theorem unop_op (P : MorphismProperty C) : P.op.unop = P := theorem op_unop (P : MorphismProperty Cᵒᵖ) : P.unop.op = P := rfl +end + +section + +variable {C : Type u} [Category.{v} C] {D : Type*} [Category D] + /-- The inverse image of a `MorphismProperty D` by a functor `C ⥤ D` -/ def inverseImage (P : MorphismProperty D) (F : C ⥤ D) : MorphismProperty C := fun _ _ f => P (F.map f) @@ -118,6 +130,16 @@ lemma monotone_map (F : C ⥤ D) : intro P Q h X Y f ⟨X', Y', f', hf', ⟨e⟩⟩ exact ⟨X', Y', f', h _ hf', ⟨e⟩⟩ +@[simp] +lemma map_top_eq_top_of_essSurj_of_full (F : C ⥤ D) [F.EssSurj] [F.Full] : + (⊤ : MorphismProperty C).map F = ⊤ := by + rw [eq_top_iff] + intro X Y f _ + refine ⟨F.objPreimage X, F.objPreimage Y, F.preimage ?_, ⟨⟨⟩, ⟨?_⟩⟩⟩ + · exact (Functor.objObjPreimageIso F X).hom ≫ f ≫ (Functor.objObjPreimageIso F Y).inv + · exact Arrow.isoMk' _ _ (Functor.objObjPreimageIso F X) (Functor.objObjPreimageIso F Y) + (by simp) + section variable (P : MorphismProperty C) @@ -171,6 +193,12 @@ lemma ofHoms_homFamily (P : MorphismProperty C) : ofHoms P.homFamily = P := by · intro hf exact ⟨(⟨f, hf⟩ : P.toSet)⟩ +end + +section + +variable {C : Type u} [CategoryStruct.{v} C] + /-- A morphism property `P` satisfies `P.RespectsRight Q` if it is stable under post-composition with morphisms satisfying `Q`, i.e. whenever `P` holds for `f` and `Q` holds for `i` then `P` holds for `f ≫ i`. -/ @@ -203,7 +231,11 @@ instance RespectsRight.inf (P₁ P₂ Q : MorphismProperty C) [P₁.RespectsRigh [P₂.RespectsRight Q] : (P₁ ⊓ P₂).RespectsRight Q where postcomp i hi f hf := ⟨postcomp i hi f hf.left, postcomp i hi f hf.right⟩ -variable (C) +end + +section + +variable (C : Type u) [Category.{v} C] /-- The `MorphismProperty C` satisfied by isomorphisms in `C`. -/ def isomorphisms : MorphismProperty C := fun _ _ f => IsIso f @@ -320,6 +352,10 @@ lemma isoClosure_le_iff (P Q : MorphismProperty C) [Q.RespectsIso] : · intro h exact (monotone_isoClosure h).trans (by rw [Q.isoClosure_eq_self]) +section + +variable {D : Type*} [Category D] + instance map_respectsIso (P : MorphismProperty C) (F : C ⥤ D) : (P.map F).RespectsIso := by apply RespectsIso.of_respects_arrow_iso @@ -412,6 +448,8 @@ lemma inverseImage_map_eq_of_isEquivalence end +end + section variable {C} @@ -463,9 +501,11 @@ instance RespectsIso.isomorphisms : RespectsIso (isomorphisms C) := by intro exact IsIso.comp_isIso +end + /-- If `W₁` and `W₂` are morphism properties on two categories `C₁` and `C₂`, this is the induced morphism property on `C₁ × C₂`. -/ -def prod {C₁ C₂ : Type*} [Category C₁] [Category C₂] +def prod {C₁ C₂ : Type*} [CategoryStruct C₁] [CategoryStruct C₂] (W₁ : MorphismProperty C₁) (W₂ : MorphismProperty C₂) : MorphismProperty (C₁ × C₂) := fun _ _ f => W₁ f.1 ∧ W₂ f.2 @@ -476,7 +516,7 @@ def pi {J : Type w} {C : J → Type u} [∀ j, Category.{v} (C j)] (W : ∀ j, MorphismProperty (C j)) : MorphismProperty (∀ j, C j) := fun _ _ f => ∀ j, (W j) (f j) -variable {C} +variable {C} [Category.{v} C] /-- The morphism property on `J ⥤ C` which is defined objectwise from `W : MorphismProperty C`. -/ @@ -494,6 +534,8 @@ end MorphismProperty namespace NatTrans +variable {C : Type u} [Category.{v} C] {D : Type*} [Category D] + lemma isIso_app_iff_of_iso {F G : C ⥤ D} (α : F ⟶ G) {X Y : C} (e : X ≅ Y) : IsIso (α.app X) ↔ IsIso (α.app Y) := (MorphismProperty.isomorphisms D).arrow_mk_iso_iff diff --git a/Mathlib/CategoryTheory/MorphismProperty/Comma.lean b/Mathlib/CategoryTheory/MorphismProperty/Comma.lean index b1a1590659ac47..ef1eec6fa1958e 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Comma.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Comma.lean @@ -3,14 +3,17 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.MorphismProperty.Factorization /-! # Subcategories of comma categories defined by morphism properties Given functors `L : A ⥤ T` and `R : B ⥤ T` and morphism properties `P`, `Q` and `W` -on `T`, A` and `B` respectively, we define the subcategory `P.Comma L R Q W` of +on `T`, `A` and `B` respectively, we define the subcategory `P.Comma L R Q W` of `Comma L R` where - objects are objects of `Comma L R` with the structural morphism satisfying `P`, and @@ -32,6 +35,8 @@ over a base `X`. Here `Q = ⊤`. -/ +@[expose] public section + namespace CategoryTheory.MorphismProperty open Limits @@ -88,11 +93,17 @@ instance [W.RespectsIso] : (W.structuredArrowObj L (X := X)).IsClosedUnderIsomor /-- The morphism property on `Over X` induced by a morphism property on `C`. -/ def over (W : MorphismProperty T) {X : T} : MorphismProperty (Over X) := fun _ _ f ↦ W f.left +lemma over_eq_inverseImage (W : MorphismProperty T) (X : T) : + W.over = W.inverseImage (Over.forget X) := rfl + @[simp] lemma over_iff {Y Z : Over X} (f : Y ⟶ Z) : W.over f ↔ W f.left := .rfl /-- The morphism property on `Under X` induced by a morphism property on `C`. -/ def under (W : MorphismProperty T) {X : T} : MorphismProperty (Under X) := fun _ _ f ↦ W f.right +lemma under_eq_inverseImage (W : MorphismProperty T) (X : T) : + W.under = W.inverseImage (Under.forget X) := rfl + @[simp] lemma under_iff {Y Z : Under X} (f : Y ⟶ Z) : W.under f ↔ W f.right := .rfl /-- The object property on `Over X` induced by a morphism property. -/ @@ -482,4 +493,18 @@ lemma Under.w {A B : P.Under Q X} (f : A ⟶ B) : end Under +instance HasFactorization.over + {C : Type*} [Category C] (W₁ W₂ : MorphismProperty C) + [W₁.HasFactorization W₂] (S : C) : + (W₁.over (X := S)).HasFactorization W₂.over where + nonempty_mapFactorizationData {X Y} f := by + let hf := W₁.factorizationData W₂ f.left + exact ⟨{ + Z := .mk (hf.p ≫ Y.hom) + i := CategoryTheory.Over.homMk hf.i + p := CategoryTheory.Over.homMk hf.p + hi := hf.hi + hp := hf.hp + }⟩ + end CategoryTheory.MorphismProperty diff --git a/Mathlib/CategoryTheory/MorphismProperty/Composition.lean b/Mathlib/CategoryTheory/MorphismProperty/Composition.lean index e08e37f1ce5c32..12abff4911e5d8 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Composition.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Composition.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Compatibilities of properties of morphisms with respect to composition @@ -14,6 +16,8 @@ which means that `P f → P g → P (f ≫ g)`. We also introduce the type class -/ +@[expose] public section + universe w v v' u u' diff --git a/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean b/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean index 36b4f7ef4bc365..837e2295f75c61 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.CategoryTheory.MorphismProperty.Composition -import Mathlib.CategoryTheory.MorphismProperty.Factorization +module + +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Composition +public import Mathlib.CategoryTheory.MorphismProperty.Factorization /-! # Morphism properties defined in concrete categories @@ -21,6 +23,8 @@ followed by an injective map. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/Descent.lean b/Mathlib/CategoryTheory/MorphismProperty/Descent.lean index 6171552299a248..5c87e48d75ad2e 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Descent.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Descent.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Descent of morphism properties @@ -13,6 +15,8 @@ if whenever `Q` holds for `X ⟶ Z`, `P` holds for `X ×[Z] Y ⟶ X` implies `P` Dually, we define `P.CodescendsAlong Q`. -/ +@[expose] public section + namespace CategoryTheory.MorphismProperty open Limits diff --git a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean index 4f7b6040a6324d..f93ae2fb42a393 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # The factorization axiom @@ -31,6 +33,8 @@ is `MorphismProperty.comp_eq_top_iff`). -/ +@[expose] public section + namespace CategoryTheory namespace MorphismProperty diff --git a/Mathlib/CategoryTheory/MorphismProperty/FunctorCategory.lean b/Mathlib/CategoryTheory/MorphismProperty/FunctorCategory.lean index cdf866749ef1e3..6051005bebf553 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/FunctorCategory.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono -import Mathlib.CategoryTheory.MorphismProperty.Retract -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +module + +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +public import Mathlib.CategoryTheory.MorphismProperty.Retract +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition /-! # Stability properties of morphism properties on functor categories @@ -20,6 +22,8 @@ holds in the category `J ⥤ C`. -/ +@[expose] public section + universe v v' v'' u u' u'' namespace CategoryTheory @@ -33,7 +37,7 @@ variable {C : Type u} [Category.{v} C] (W : MorphismProperty C) instance [W.IsStableUnderRetracts] (J : Type u'') [Category.{v''} J] : (W.functorCategory J).IsStableUnderRetracts where of_retract hfg hg j := - W.of_retract (hfg.map ((evaluation _ _).obj j).mapArrow) (hg j) + W.of_retract (hfg.map ((evaluation _ _).obj j)) (hg j) variable {W} diff --git a/Mathlib/CategoryTheory/MorphismProperty/Ind.lean b/Mathlib/CategoryTheory/MorphismProperty/Ind.lean index 88632c3f74f193..0f088be6593e3d 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Ind.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Ind.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Comma.LocallySmall -import Mathlib.CategoryTheory.Limits.Preserves.Over -import Mathlib.CategoryTheory.MorphismProperty.Comma -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.ObjectProperty.Ind +module + +public import Mathlib.CategoryTheory.Comma.LocallySmall +public import Mathlib.CategoryTheory.Limits.Preserves.Over +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.ObjectProperty.Ind /-! # Ind and pro-properties @@ -33,6 +35,8 @@ We show that `ind P` inherits stability properties from `P`. - Show `ind P` is stable under composition if `P` spreads out (Christian). -/ +@[expose] public section + universe w v u namespace CategoryTheory.MorphismProperty diff --git a/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean b/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean index e68e6813a7da16..f5c180e276bff4 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Morphism properties that are inverted by a functor @@ -17,6 +19,8 @@ This is used in the localization of categories API (folder `CategoryTheory.Local -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean b/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean index 0b361867a8f940..bbb73d9a63bff0 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Basic -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.CategoryTheory.MorphismProperty.Basic +public import Mathlib.Logic.Small.Basic /-! # Small classes of morphisms @@ -14,6 +16,8 @@ if the corresponding set in `Set (Arrow C)` is. -/ +@[expose] public section + universe w t v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/LiftingProperty.lean b/Mathlib/CategoryTheory/MorphismProperty/LiftingProperty.lean index 5002b763c118fb..936af363ac772c 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/LiftingProperty.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/LiftingProperty.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen, Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.MorphismProperty.Retract -import Mathlib.CategoryTheory.LiftingProperties.Limits -import Mathlib.Order.GaloisConnection.Defs +module + +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.MorphismProperty.Retract +public import Mathlib.CategoryTheory.LiftingProperties.Limits +public import Mathlib.Order.GaloisConnection.Defs /-! # Left and right lifting properties @@ -18,6 +20,8 @@ and composition, with dual statements for the right lifting property. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean index 6c5f27dce1b72d..8e92383fad99d9 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Final -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Filtered.Connected -import Mathlib.CategoryTheory.Limits.Shapes.Diagonal -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.CategoryTheory.Limits.Final +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Filtered.Connected +public import Mathlib.CategoryTheory.Limits.Shapes.Diagonal +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Relation of morphism properties with limits @@ -25,6 +27,8 @@ We also introduce properties `IsStableUnderProductsOfShape`, `IsStableUnderLimit -/ +@[expose] public section + universe w w' v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/Local.lean b/Mathlib/CategoryTheory/MorphismProperty/Local.lean index 95a50ffebe12ba..47d3309fbf17a6 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Local.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Local.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Andrew Yang -/ -import Mathlib.CategoryTheory.Sites.Hypercover.Zero -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.Sites.Hypercover.Zero +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Locality conditions on morphism properties @@ -29,6 +31,8 @@ The covers appearing in the definitions have index type in the morphism universe - Define source and target local closure of a morphism property. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean b/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean index 8b81fd648d05d0..1c820c4c600fa6 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.MorphismProperty.Comma -import Mathlib.CategoryTheory.Comma.Over.Pullback -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.MorphismProperty.Comma +public import Mathlib.CategoryTheory.Comma.Over.Pullback +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Adjunction of pushforward and pullback in `P.Over Q X` @@ -19,6 +21,8 @@ a morphism `f : X ⟶ Y` defines two functors: such that `Over.map` is the left adjoint to `Over.pullback`. -/ +@[expose] public section + namespace CategoryTheory.MorphismProperty open Limits diff --git a/Mathlib/CategoryTheory/MorphismProperty/Representable.lean b/Mathlib/CategoryTheory/MorphismProperty/Representable.lean index ce54ad62d0f588..d8f4d5be97dff0 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Representable.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Representable.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne, Joël Riou, Ravi Vakil -/ +module -import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! @@ -78,6 +79,8 @@ as possible is phrased internally to `C`. -/ +@[expose] public section + namespace CategoryTheory open Category Limits MorphismProperty diff --git a/Mathlib/CategoryTheory/MorphismProperty/Retract.lean b/Mathlib/CategoryTheory/MorphismProperty/Retract.lean index 93f78e00cb3230..97de8c91c011db 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Retract.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Retract.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Retract -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.CategoryTheory.Retract +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Stability under retracts @@ -14,6 +16,8 @@ is the property that `P` is stable under retracts. -/ +@[expose] public section + universe v u namespace CategoryTheory @@ -32,6 +36,11 @@ lemma of_retract {P : MorphismProperty C} [P.IsStableUnderRetracts] {X Y Z W : C} {f : X ⟶ Y} {g : Z ⟶ W} (h : RetractArrow f g) (hg : P g) : P f := IsStableUnderRetracts.of_retract h hg +instance {D : Type*} [Category D] (F : C ⥤ D) (P : MorphismProperty D) + [P.IsStableUnderRetracts] : + (P.inverseImage F).IsStableUnderRetracts where + of_retract h₁ h₂ := of_retract (P := P) (h₁.map F) h₂ + instance IsStableUnderRetracts.monomorphisms : (monomorphisms C).IsStableUnderRetracts where of_retract {_ _ _ _ f g} h (hg : Mono g) := ⟨fun α β w ↦ by rw [← cancel_mono h.i.left, ← cancel_mono g, Category.assoc, Category.assoc, diff --git a/Mathlib/CategoryTheory/MorphismProperty/RetractArgument.lean b/Mathlib/CategoryTheory/MorphismProperty/RetractArgument.lean index a3b6c705ceb249..a608a11c93c8d2 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/RetractArgument.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/RetractArgument.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Factorization -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +module + +public import Mathlib.CategoryTheory.MorphismProperty.Factorization +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty /-! # The retract argument @@ -22,6 +24,8 @@ and `W₁.rlp = W₂` if `W₂` is. -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] diff --git a/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean b/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean index 0732c4a4c2a1ef..99f398cebba75a 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.TransfiniteCompositionOfShape -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.Order.Interval.Set.SuccOrder -import Mathlib.Order.Shrink +module + +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.TransfiniteCompositionOfShape +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.Order.Interval.Set.SuccOrder +public import Mathlib.Order.Shrink /-! # Classes of morphisms that are stable under transfinite composition @@ -27,6 +29,8 @@ holds for any well-ordered type `J` in a certain universe `w`. -/ +@[expose] public section + universe w w' v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/MorphismProperty/WeakFactorizationSystem.lean b/Mathlib/CategoryTheory/MorphismProperty/WeakFactorizationSystem.lean index cef63b3332f960..d634c95e16c4b3 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/WeakFactorizationSystem.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/WeakFactorizationSystem.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.RetractArgument +module + +public import Mathlib.CategoryTheory.MorphismProperty.RetractArgument /-! # Weak factorization systems @@ -19,6 +21,8 @@ and any morphism in `C` can be factored a `i ≫ p` with `W₁ i` and `W₂ p`. -/ +@[expose] public section + universe v u namespace CategoryTheory.MorphismProperty diff --git a/Mathlib/CategoryTheory/NatIso.lean b/Mathlib/CategoryTheory/NatIso.lean index da80a14c8e7a85..7320111c44c6c6 100644 --- a/Mathlib/CategoryTheory/NatIso.lean +++ b/Mathlib/CategoryTheory/NatIso.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tim Baumann, Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Iso +module + +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Iso /-! # Natural isomorphisms @@ -30,6 +32,8 @@ we put some declarations that are specifically about natural isomorphisms in the namespace so that they are available using dot notation. -/ +@[expose] public section + set_option mathlib.tactic.category.grind true -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation diff --git a/Mathlib/CategoryTheory/NatTrans.lean b/Mathlib/CategoryTheory/NatTrans.lean index 5ad6dc1b7461e8..c4acce220d9a17 100644 --- a/Mathlib/CategoryTheory/NatTrans.lean +++ b/Mathlib/CategoryTheory/NatTrans.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tim Baumann, Stephen Morgan, Kim Morrison, Floris van Doorn -/ -import Mathlib.Tactic.CategoryTheory.Reassoc +module + +public import Mathlib.Tactic.CategoryTheory.Reassoc /-! # Natural transformations @@ -29,6 +31,8 @@ Introduces notations -/ +@[expose] public section + set_option mathlib.tactic.category.grind true namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Noetherian.lean b/Mathlib/CategoryTheory/Noetherian.lean index af734ec897f476..1829d3921fadf9 100644 --- a/Mathlib/CategoryTheory/Noetherian.lean +++ b/Mathlib/CategoryTheory/Noetherian.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.ArtinianObject -import Mathlib.CategoryTheory.Subobject.NoetherianObject +module + +public import Mathlib.CategoryTheory.Subobject.ArtinianObject +public import Mathlib.CategoryTheory.Subobject.NoetherianObject /-! # Artinian and Noetherian categories @@ -22,6 +24,8 @@ it is shown that any nonzero Artinian object has a simple subobject. The Jordan-Hölder theorem, following https://stacks.math.columbia.edu/tag/0FCK. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/Basic.lean b/Mathlib/CategoryTheory/ObjectProperty/Basic.lean index 01c6f8ab89f8a2..af25370ed68bbc 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Basic.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.CategoryTheory.Functor.Basic -import Mathlib.CategoryTheory.Iso -import Mathlib.Order.Basic +module + +public import Mathlib.CategoryTheory.Category.Basic +public import Mathlib.CategoryTheory.Functor.Basic +public import Mathlib.CategoryTheory.Iso +public import Mathlib.Order.Basic /-! # Properties of objects in a category @@ -23,51 +25,26 @@ for predicates `C → Prop`. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory /-- A property of objects in a category `C` is a predicate `C → Prop`. -/ @[nolint unusedArguments] -abbrev ObjectProperty (C : Type u) [Category.{v} C] : Type u := C → Prop +abbrev ObjectProperty (C : Type u) [CategoryStruct.{v} C] : Type u := C → Prop namespace ObjectProperty -variable {C : Type u} {D : Type u'} [Category.{v} C] [Category.{v'} D] - -lemma le_def {P Q : ObjectProperty C} : - P ≤ Q ↔ ∀ (X : C), P X → Q X := Iff.rfl - -/-- The inverse image of a property of objects by a functor. -/ -def inverseImage (P : ObjectProperty D) (F : C ⥤ D) : ObjectProperty C := - fun X ↦ P (F.obj X) - -@[simp] -lemma prop_inverseImage_iff (P : ObjectProperty D) (F : C ⥤ D) (X : C) : - P.inverseImage F X ↔ P (F.obj X) := Iff.rfl - -/-- The essential image of a property of objects by a functor. -/ -def map (P : ObjectProperty C) (F : C ⥤ D) : ObjectProperty D := - fun Y ↦ ∃ (X : C), P X ∧ Nonempty (F.obj X ≅ Y) - -lemma prop_map_iff (P : ObjectProperty C) (F : C ⥤ D) (Y : D) : - P.map F Y ↔ ∃ (X : C), P X ∧ Nonempty (F.obj X ≅ Y) := Iff.rfl - -lemma prop_map_obj (P : ObjectProperty C) (F : C ⥤ D) {X : C} (hX : P X) : - P.map F (F.obj X) := - ⟨X, hX, ⟨Iso.refl _⟩⟩ +variable {C : Type u} {D : Type u'} -/-- The strict image of a property of objects by a functor. -/ -inductive strictMap (P : ObjectProperty C) (F : C ⥤ D) : ObjectProperty D - | mk (X : C) (hX : P X) : strictMap P F (F.obj X) +section -lemma strictMap_iff (P : ObjectProperty C) (F : C ⥤ D) (Y : D) : - P.strictMap F Y ↔ ∃ (X : C), P X ∧ F.obj X = Y := - ⟨by rintro ⟨X, hX⟩; exact ⟨X, hX, rfl⟩, by rintro ⟨X, hX, rfl⟩; exact ⟨X, hX⟩⟩ +variable [CategoryStruct.{v} C] [CategoryStruct.{v'} D] -lemma strictMap_obj (P : ObjectProperty C) (F : C ⥤ D) {X : C} (hX : P X) : - P.strictMap F (F.obj X) := - ⟨X, hX⟩ +lemma le_def {P Q : ObjectProperty C} : + P ≤ Q ↔ ∀ (X : C), P X → Q X := Iff.rfl /-- The typeclass associated to `P : ObjectProperty C`. -/ @[mk_iff] @@ -101,12 +78,6 @@ lemma ofObj_le_iff (P : ObjectProperty C) : ofObj X ≤ P ↔ ∀ i, P (X i) := ⟨fun h i ↦ h _ (by simp), fun h ↦ by rintro _ ⟨i⟩; exact h i⟩ -@[simp] -lemma strictMap_ofObj (F : C ⥤ D) : - (ofObj X).strictMap F = ofObj (F.obj ∘ X) := by - ext Y - simp [ofObj_iff, strictMap_iff] - end /-- The property of objects in a category that is satisfied by a single object `X : C`. -/ @@ -120,12 +91,6 @@ lemma singleton_le_iff {X : C} {P : ObjectProperty C} : singleton X ≤ P ↔ P X := by simp [ofObj_le_iff] -@[simp high] -lemma strictMap_singleton (X : C) (F : C ⥤ D) : - (singleton X).strictMap F = singleton (F.obj X) := by - ext - simp [strictMap_iff] - /-- The property of objects in a category that is satisfied by `X : C` and `Y : C`. -/ def pair (X Y : C) : ObjectProperty C := ofObj (Sum.elim (fun (_ : Unit) ↦ X) (fun (_ : Unit) ↦ Y)) @@ -137,6 +102,57 @@ lemma pair_iff (X Y Z : C) : · rintro ⟨_ | _⟩ <;> tauto · rintro (rfl | rfl); exacts [⟨Sum.inl .unit⟩, ⟨Sum.inr .unit⟩] +end + +section + +variable [Category.{v} C] [Category.{v'} D] + +/-- The inverse image of a property of objects by a functor. -/ +def inverseImage (P : ObjectProperty D) (F : C ⥤ D) : ObjectProperty C := + fun X ↦ P (F.obj X) + +@[simp] +lemma prop_inverseImage_iff (P : ObjectProperty D) (F : C ⥤ D) (X : C) : + P.inverseImage F X ↔ P (F.obj X) := Iff.rfl + +/-- The essential image of a property of objects by a functor. -/ +def map (P : ObjectProperty C) (F : C ⥤ D) : ObjectProperty D := + fun Y ↦ ∃ (X : C), P X ∧ Nonempty (F.obj X ≅ Y) + +lemma prop_map_iff (P : ObjectProperty C) (F : C ⥤ D) (Y : D) : + P.map F Y ↔ ∃ (X : C), P X ∧ Nonempty (F.obj X ≅ Y) := Iff.rfl + +lemma prop_map_obj (P : ObjectProperty C) (F : C ⥤ D) {X : C} (hX : P X) : + P.map F (F.obj X) := + ⟨X, hX, ⟨Iso.refl _⟩⟩ + +/-- The strict image of a property of objects by a functor. -/ +inductive strictMap (P : ObjectProperty C) (F : C ⥤ D) : ObjectProperty D + | mk (X : C) (hX : P X) : strictMap P F (F.obj X) + +lemma strictMap_iff (P : ObjectProperty C) (F : C ⥤ D) (Y : D) : + P.strictMap F Y ↔ ∃ (X : C), P X ∧ F.obj X = Y := + ⟨by rintro ⟨X, hX⟩; exact ⟨X, hX, rfl⟩, by rintro ⟨X, hX, rfl⟩; exact ⟨X, hX⟩⟩ + +lemma strictMap_obj (P : ObjectProperty C) (F : C ⥤ D) {X : C} (hX : P X) : + P.strictMap F (F.obj X) := + ⟨X, hX⟩ + +@[simp] +lemma strictMap_ofObj {ι : Type u'} (X : ι → C) (F : C ⥤ D) : + (ofObj X).strictMap F = ofObj (F.obj ∘ X) := by + ext Y + simp [ofObj_iff, strictMap_iff] + +@[simp high] +lemma strictMap_singleton (X : C) (F : C ⥤ D) : + (singleton X).strictMap F = singleton (F.obj X) := by + ext + simp [strictMap_iff] + +end + end ObjectProperty end CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/ClosedUnderIsomorphisms.lean b/Mathlib/CategoryTheory/ObjectProperty/ClosedUnderIsomorphisms.lean index 63c33f6e234eda..bc5c1e5dfe9cdb 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/ClosedUnderIsomorphisms.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/ClosedUnderIsomorphisms.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Iso -import Mathlib.CategoryTheory.ObjectProperty.Basic -import Mathlib.Order.Basic +module + +public import Mathlib.CategoryTheory.Iso +public import Mathlib.CategoryTheory.ObjectProperty.Basic +public import Mathlib.Order.Basic /-! # Properties of objects which are closed under isomorphisms @@ -14,6 +16,8 @@ this file introduces the type class `P.IsClosedUnderIsomorphisms`. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/ColimitsClosure.lean b/Mathlib/CategoryTheory/ObjectProperty/ColimitsClosure.lean index 8049c08ab5fd8f..0bf8d51d83150d 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/ColimitsClosure.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/ColimitsClosure.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.LimitsClosure -import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape +module + +public import Mathlib.CategoryTheory.ObjectProperty.LimitsClosure +public import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape /-! # Closure of a property of objects under colimits of certain shapes @@ -19,6 +21,8 @@ results in the file `ObjectProperty.LimitsClosure`.) -/ +@[expose] public section + universe w w' t v' u' v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/ColimitsOfShape.lean b/Mathlib/CategoryTheory/ObjectProperty/ColimitsOfShape.lean index fdc8e3456daf00..ff53f73310e39e 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/ColimitsOfShape.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/ColimitsOfShape.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.Small -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape -import Mathlib.CategoryTheory.Limits.Presentation +module + +public import Mathlib.CategoryTheory.ObjectProperty.Small +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +public import Mathlib.CategoryTheory.Limits.Presentation /-! # Objects that are colimits of objects satisfying a certain property @@ -41,6 +43,8 @@ that is bounded by a certain regular cardinal (@joelriou) -/ +@[expose] public section + universe w v'' v' u'' u' v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/CompleteLattice.lean b/Mathlib/CategoryTheory/ObjectProperty/CompleteLattice.lean index 4009739895be12..b6ec54d9e626b5 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/CompleteLattice.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/CompleteLattice.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.Order.CompleteLattice.Basic +module + +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.Order.CompleteLattice.Basic /-! # ObjectProperty is a complete lattice -/ +@[expose] public section + universe v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/ContainsZero.lean b/Mathlib/CategoryTheory/ObjectProperty/ContainsZero.lean index 91ae6a863b7327..beb03fb547ef4e 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/ContainsZero.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/ContainsZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +module + +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero /-! # Properties of objects which hold for a zero object @@ -16,6 +18,8 @@ that `P` holds for all zero objects, as in some applications (e.g. triangulated -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/EpiMono.lean b/Mathlib/CategoryTheory/ObjectProperty/EpiMono.lean index 44dbdfb1df5fce..c5d2f9e6128488 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/EpiMono.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/EpiMono.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.Algebra.Homology.ShortComplex.ShortExact +module + +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact /-! # Properties of objects that are closed under subobjects and quotients @@ -15,6 +17,8 @@ that `P` is closed under subobjects (resp. quotients). -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/Extensions.lean b/Mathlib/CategoryTheory/ObjectProperty/Extensions.lean index 1678cb5744d883..e1856b063c3441 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Extensions.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Extensions.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.CategoryTheory.ObjectProperty.Basic +module + +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.CategoryTheory.ObjectProperty.Basic /-! # Properties of objects that are closed under extensions @@ -15,6 +17,8 @@ is closed under extensions. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean b/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean index 1fda2f0357a16d..29b6e034acfdad 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton, Joël Riou -/ -import Mathlib.CategoryTheory.InducedCategory -import Mathlib.CategoryTheory.ObjectProperty.Basic +module + +public import Mathlib.CategoryTheory.InducedCategory +public import Mathlib.CategoryTheory.ObjectProperty.Basic /-! # The full subcategory associated to a property of objects @@ -15,6 +17,8 @@ of objects in `C` satisfying `P`. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/Ind.lean b/Mathlib/CategoryTheory/ObjectProperty/Ind.lean index 0a4d5efc16050e..7e8fe65dc9f014 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Ind.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Ind.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Presentable.ColimitPresentation +module + +public import Mathlib.CategoryTheory.Presentable.ColimitPresentation /-! # Ind and pro-properties @@ -26,6 +28,8 @@ Given an object property `P`, we define an object property `ind P` that is satis - Dualise to obtain `CategoryTheory.ObjectProperty.pro`. -/ +@[expose] public section + universe w v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean b/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean index 7b3d7259af95dc..7362d9a31677d7 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape -import Mathlib.CategoryTheory.ObjectProperty.CompleteLattice -import Mathlib.Order.TransfiniteIteration -import Mathlib.SetTheory.Cardinal.HasCardinalLT +module + +public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape +public import Mathlib.CategoryTheory.ObjectProperty.CompleteLattice +public import Mathlib.Order.TransfiniteIteration +public import Mathlib.SetTheory.Cardinal.HasCardinalLT /-! # Closure of a property of objects under limits of certain shapes @@ -18,6 +20,8 @@ and under certain smallness assumptions, we show that its essentially small. -/ +@[expose] public section + universe w w' t v' u' v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean b/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean index c6122df7aa5da5..319aae58ae3830 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.Small -import Mathlib.CategoryTheory.Limits.Presentation +module + +public import Mathlib.CategoryTheory.ObjectProperty.Small +public import Mathlib.CategoryTheory.Limits.Presentation /-! # Objects that are limits of objects satisfying a certain property @@ -35,6 +37,8 @@ that is bounded by a certain regular cardinal (@joelriou) -/ +@[expose] public section + universe w v'' v' u'' u' v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/Local.lean b/Mathlib/CategoryTheory/ObjectProperty/Local.lean index 79ff81047c117a..8380475dbe6882 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Local.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Local.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.MorphismProperty.Basic +module + +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.MorphismProperty.Basic /-! # Objects that are local with respect to a property of morphisms @@ -18,6 +20,8 @@ part of a Galois connection, with "dual" construction -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean b/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean index d0de958f69c5d2..178a4365f58e80 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean @@ -3,21 +3,29 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.Opposites +module + +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.Opposites /-! # The opposite of a property of objects -/ +@[expose] public section + universe v u namespace CategoryTheory.ObjectProperty open Opposite -variable {C : Type u} [Category.{v} C] +variable {C : Type u} + +section + +variable [CategoryStruct.{v} C] /-- The property of objects of `Cᵒᵖ` corresponding to `P : ObjectProperty C`. -/ protected def op (P : ObjectProperty C) : ObjectProperty Cᵒᵖ := @@ -69,24 +77,6 @@ lemma op_monotone_iff {P Q : ObjectProperty C} : P.op ≤ Q.op ↔ P ≤ Q := lemma unop_monotone_iff {P Q : ObjectProperty Cᵒᵖ} : P.unop ≤ Q.unop ↔ P ≤ Q := ⟨op_monotone, unop_monotone⟩ -instance (P : ObjectProperty C) [P.IsClosedUnderIsomorphisms] : - P.op.IsClosedUnderIsomorphisms where - of_iso e hX := P.prop_of_iso e.symm.unop hX - -instance (P : ObjectProperty Cᵒᵖ) [P.IsClosedUnderIsomorphisms] : - P.unop.IsClosedUnderIsomorphisms where - of_iso e hX := P.prop_of_iso e.symm.op hX - -lemma op_isoClosure (P : ObjectProperty C) : - P.isoClosure.op = P.op.isoClosure := by - ext ⟨X⟩ - exact ⟨fun ⟨Y, h, ⟨e⟩⟩ ↦ ⟨op Y, h, ⟨e.op.symm⟩⟩, - fun ⟨Y, h, ⟨e⟩⟩ ↦ ⟨Y.unop, h, ⟨e.unop.symm⟩⟩⟩ - -lemma unop_isoClosure (P : ObjectProperty Cᵒᵖ) : - P.isoClosure.unop = P.unop.isoClosure := by - rw [← op_injective_iff, P.unop.op_isoClosure, op_unop, op_unop] - /-- The bijection `Subtype P.op ≃ Subtype P` for `P : ObjectProperty C`. -/ def subtypeOpEquiv (P : ObjectProperty C) : Subtype P.op ≃ Subtype P where @@ -117,4 +107,30 @@ lemma unop_singleton (X : Cᵒᵖ) : (singleton X).unop = singleton X.unop := by simp +end + +section + +variable [Category.{v} C] + +instance (P : ObjectProperty C) [P.IsClosedUnderIsomorphisms] : + P.op.IsClosedUnderIsomorphisms where + of_iso e hX := P.prop_of_iso e.symm.unop hX + +instance (P : ObjectProperty Cᵒᵖ) [P.IsClosedUnderIsomorphisms] : + P.unop.IsClosedUnderIsomorphisms where + of_iso e hX := P.prop_of_iso e.symm.op hX + +lemma op_isoClosure (P : ObjectProperty C) : + P.isoClosure.op = P.op.isoClosure := by + ext ⟨X⟩ + exact ⟨fun ⟨Y, h, ⟨e⟩⟩ ↦ ⟨op Y, h, ⟨e.op.symm⟩⟩, + fun ⟨Y, h, ⟨e⟩⟩ ↦ ⟨Y.unop, h, ⟨e.unop.symm⟩⟩⟩ + +lemma unop_isoClosure (P : ObjectProperty Cᵒᵖ) : + P.isoClosure.unop = P.unop.isoClosure := by + rw [← op_injective_iff, P.unop.op_isoClosure, op_unop, op_unop] + +end + end CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/Retract.lean b/Mathlib/CategoryTheory/ObjectProperty/Retract.lean index d4fd3345668b72..7569a78108d0cb 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Retract.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Retract.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.ObjectProperty.Basic -import Mathlib.CategoryTheory.Retract +module + +public import Mathlib.CategoryTheory.ObjectProperty.Basic +public import Mathlib.CategoryTheory.Retract /-! # Properties of objects which are stable under retracts @@ -12,6 +14,8 @@ Given a category `C` and `P : ObjectProperty C` (i.e. `P : C → Prop`), this file introduces the type class `P.IsStableUnderRetracts`. -/ +@[expose] public section + namespace CategoryTheory.ObjectProperty variable {C : Type*} [Category C] (P : ObjectProperty C) diff --git a/Mathlib/CategoryTheory/ObjectProperty/Shift.lean b/Mathlib/CategoryTheory/ObjectProperty/Shift.lean index 537c7fe67e4150..f764c46ab67224 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Shift.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Shift.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms -import Mathlib.CategoryTheory.Shift.Basic +module + +public import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms +public import Mathlib.CategoryTheory.Shift.Basic /-! # Properties of objects on categories equipped with shift @@ -16,6 +18,8 @@ implies `P (X⟦a⟧)` for all `a : A`. -/ +@[expose] public section + open CategoryTheory Category namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/ObjectProperty/Small.lean b/Mathlib/CategoryTheory/ObjectProperty/Small.lean index 5d672ede77de6d..4439e3f262fd04 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Small.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Small.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.CompleteLattice -import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory -import Mathlib.CategoryTheory.ObjectProperty.Opposite -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.CategoryTheory.ObjectProperty.CompleteLattice +public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory +public import Mathlib.CategoryTheory.ObjectProperty.Opposite +public import Mathlib.Logic.Small.Basic /-! # Smallness of a property of objects @@ -16,6 +18,8 @@ In this file, given `P : ObjectProperty C`, we define -/ +@[expose] public section + universe w v u namespace CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/Opposites.lean b/Mathlib/CategoryTheory/Opposites.lean index 51fcafcdd0f620..3ed6ccd37e5853 100644 --- a/Mathlib/CategoryTheory/Opposites.lean +++ b/Mathlib/CategoryTheory/Opposites.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison -/ -import Mathlib.CategoryTheory.Equivalence +module + +public import Mathlib.CategoryTheory.Equivalence /-! # Opposite categories @@ -21,6 +23,8 @@ Unfortunately, because we do not have a definitional equality `op (op X) = X`, there are quite a few variations that are needed in practice. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ -- morphism levels before object levels. See note [category theory universes]. @@ -75,7 +79,7 @@ theorem unop_id {X : Cᵒᵖ} : (𝟙 X).unop = 𝟙 (unop X) := theorem op_id_unop {X : Cᵒᵖ} : (𝟙 (unop X)).op = 𝟙 X := rfl -@[simp] +@[simp, grind _=_] theorem op_comp {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g).op = g.op ≫ f.op := rfl diff --git a/Mathlib/CategoryTheory/PEmpty.lean b/Mathlib/CategoryTheory/PEmpty.lean index 42756849683eb3..f20d4cdefe2c96 100644 --- a/Mathlib/CategoryTheory/PEmpty.lean +++ b/Mathlib/CategoryTheory/PEmpty.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Discrete.Basic +module + +public import Mathlib.CategoryTheory.Discrete.Basic /-! # The empty category @@ -11,6 +13,8 @@ import Mathlib.CategoryTheory.Discrete.Basic Defines a category structure on `PEmpty`, and the unique functor `PEmpty ⥤ C` for any category `C`. -/ +@[expose] public section + universe w v v' u u' -- morphism levels before object levels. See note [category theory universes]. namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/PUnit.lean b/Mathlib/CategoryTheory/PUnit.lean index 6e27800b273707..982fb7f1a56bc9 100644 --- a/Mathlib/CategoryTheory/PUnit.lean +++ b/Mathlib/CategoryTheory/PUnit.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Functor.Const -import Mathlib.CategoryTheory.Discrete.Basic +module + +public import Mathlib.CategoryTheory.Functor.Const +public import Mathlib.CategoryTheory.Discrete.Basic /-! # The category `Discrete PUnit` @@ -14,6 +16,8 @@ show that any two functors to `Discrete PUnit` are naturally isomorphic, and construct the equivalence `(Discrete PUnit ⥤ C) ≌ C`. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/PathCategory/Basic.lean b/Mathlib/CategoryTheory/PathCategory/Basic.lean index 3b9f559af26244..21075ea2dd876d 100644 --- a/Mathlib/CategoryTheory/PathCategory/Basic.lean +++ b/Mathlib/CategoryTheory/PathCategory/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Robin Carlier -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Quotient -import Mathlib.Combinatorics.Quiver.Path +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Quotient +public import Mathlib.Combinatorics.Quiver.Path /-! # The category paths on a quiver. @@ -18,6 +20,8 @@ We check that the quotient of the path category of a category by the canonical r (paths are related if they compose to the same path) is equivalent to the original category. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean b/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean index 1d251616d2c48b..dc2f60156c3925 100644 --- a/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.PathCategory.Basic -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.CategoryTheory.PathCategory.Basic +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Properties of morphisms in a path category. @@ -13,6 +15,8 @@ We provide a formulation of induction principles for morphisms in a path categor `MorphismProperty`. This file is separate from `CategoryTheory.PathCategory.Basic` in order to reduce transitive imports. -/ +@[expose] public section + universe v₁ u₁ diff --git a/Mathlib/CategoryTheory/Pi/Basic.lean b/Mathlib/CategoryTheory/Pi/Basic.lean index 9b66a5b811a2ed..eeebb9aa4bae80 100644 --- a/Mathlib/CategoryTheory/Pi/Basic.lean +++ b/Mathlib/CategoryTheory/Pi/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Kim Morrison -/ -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.NatIso -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.NatIso +public import Mathlib.CategoryTheory.Products.Basic /-! # Categories of indexed families of objects. @@ -15,6 +17,8 @@ We define the pointwise category structure on indexed families of objects in a c -/ +@[expose] public section + namespace CategoryTheory open Functor diff --git a/Mathlib/CategoryTheory/Preadditive/AdditiveFunctor.lean b/Mathlib/CategoryTheory/Preadditive/AdditiveFunctor.lean index 85467c11813c1f..7809f72b0b8c3f 100644 --- a/Mathlib/CategoryTheory/Preadditive/AdditiveFunctor.lean +++ b/Mathlib/CategoryTheory/Preadditive/AdditiveFunctor.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.ExactFunctor -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Preadditive.Biproducts -import Mathlib.CategoryTheory.Preadditive.FunctorCategory +module + +public import Mathlib.CategoryTheory.Limits.ExactFunctor +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Preadditive.Biproducts +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory /-! # Additive Functors @@ -28,6 +30,8 @@ We also define the category of bundled additive functors. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Preadditive/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Basic.lean index eae1d4d5ebcfe5..0dc92d83e43ac8 100644 --- a/Mathlib/CategoryTheory/Preadditive/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Jakob von Raumer -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Action.Units -import Mathlib.Algebra.Module.End -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Action.Units +public import Mathlib.Algebra.Module.End +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! # Preadditive categories @@ -43,6 +45,8 @@ is simplified to `f ≫ g`. additive, preadditive, Hom group, Ab-category, Ab-enriched -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Preadditive/Biproducts.lean b/Mathlib/CategoryTheory/Preadditive/Biproducts.lean index cc225a63b618af..a4e2e9676adc29 100644 --- a/Mathlib/CategoryTheory/Preadditive/Biproducts.lean +++ b/Mathlib/CategoryTheory/Preadditive/Biproducts.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.Group.Ext -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Biproducts -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.Group.Ext +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Biproducts +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.Tactic.Abel /-! # Basic facts about biproducts in preadditive categories. @@ -52,6 +54,8 @@ and `Matrix.invertibleOfFromBlocks₁₁Invertible` are all closely related. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean b/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean index b0e6990c8dbb5c..be19e63a5306dc 100644 --- a/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Monoidal.CommGrp_ -import Mathlib.CategoryTheory.Preadditive.Biproducts +module + +public import Mathlib.CategoryTheory.Monoidal.CommGrp_ +public import Mathlib.CategoryTheory.Preadditive.Biproducts /-! # Commutative group objects in additive categories. @@ -15,6 +17,8 @@ This looks slightly strange because the additive structure of `C` maps to the mu structure of the commutative group objects. -/ +@[expose] public section + universe v u namespace CategoryTheory.Preadditive diff --git a/Mathlib/CategoryTheory/Preadditive/EilenbergMoore.lean b/Mathlib/CategoryTheory/Preadditive/EilenbergMoore.lean index f4bd1fe186cd56..df97c18ee5a1b5 100644 --- a/Mathlib/CategoryTheory/Preadditive/EilenbergMoore.lean +++ b/Mathlib/CategoryTheory/Preadditive/EilenbergMoore.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.CategoryTheory.Monad.Algebra -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.CategoryTheory.Monad.Algebra +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # Preadditive structure on algebras over a monad @@ -15,6 +17,8 @@ preadditive. Dually, if `U` is an additive comonad on `C` then `Coalgebra U` is -/ +@[expose] public section + universe v₁ u₁ diff --git a/Mathlib/CategoryTheory/Preadditive/EndoFunctor.lean b/Mathlib/CategoryTheory/Preadditive/EndoFunctor.lean index a252c396b7c4ca..8023be602238e5 100644 --- a/Mathlib/CategoryTheory/Preadditive/EndoFunctor.lean +++ b/Mathlib/CategoryTheory/Preadditive/EndoFunctor.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.CategoryTheory.Endofunctor.Algebra -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.CategoryTheory.Endofunctor.Algebra +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # Preadditive structure on algebras over a monad @@ -14,6 +16,8 @@ If `C` is a preadditive category and `F` is an additive endofunctor on `C` then also preadditive. Dually, the category `Coalgebra F` is also preadditive. -/ +@[expose] public section + universe v₁ u₁ diff --git a/Mathlib/CategoryTheory/Preadditive/FunctorCategory.lean b/Mathlib/CategoryTheory/Preadditive/FunctorCategory.lean index f93e6627bda6fc..883398ef2e9462 100644 --- a/Mathlib/CategoryTheory/Preadditive/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Preadditive/FunctorCategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Preadditive structure on functor categories @@ -14,6 +16,8 @@ then `C ⥤ D` is also preadditive. -/ +@[expose] public section + namespace CategoryTheory open CategoryTheory.Limits Preadditive diff --git a/Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean b/Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean index 9ddcf009c26c91..8afc6bb088d2d1 100644 --- a/Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean +++ b/Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.CategoryTheory.Preadditive.Biproducts -import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.CategoryTheory.Preadditive.Biproducts +public import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber +public import Mathlib.Data.Set.Subsingleton /-! # Hom orthogonal families. @@ -35,6 +37,8 @@ theorem HomOrthogonal.equiv_of_iso (o : HomOrthogonal s) {f : α → ι} {g : β This is preliminary to defining semisimple categories. -/ +@[expose] public section + open Matrix CategoryTheory.Limits diff --git a/Mathlib/CategoryTheory/Preadditive/Indization.lean b/Mathlib/CategoryTheory/Preadditive/Indization.lean index 02f73940beb426..6c59657ff37e4a 100644 --- a/Mathlib/CategoryTheory/Preadditive/Indization.lean +++ b/Mathlib/CategoryTheory/Preadditive/Indization.lean @@ -3,15 +3,19 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Indization.Category -import Mathlib.CategoryTheory.Preadditive.Transfer -import Mathlib.CategoryTheory.Preadditive.Opposite -import Mathlib.Algebra.Category.Grp.LeftExactFunctor +module + +public import Mathlib.CategoryTheory.Limits.Indization.Category +public import Mathlib.CategoryTheory.Preadditive.Transfer +public import Mathlib.CategoryTheory.Preadditive.Opposite +public import Mathlib.Algebra.Category.Grp.LeftExactFunctor /-! # The category of ind-objects is preadditive -/ +@[expose] public section + universe v u open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean index f81dba991406b5..4805b3d93b3115 100644 --- a/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Kevin Buzzard -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic /-! # Injective objects and categories with enough injectives @@ -11,6 +13,8 @@ import Mathlib.CategoryTheory.Preadditive.Projective.Basic An object `J` is injective iff every morphism into `J` can be obtained by extending a monomorphism. -/ +@[expose] public section + noncomputable section @@ -30,6 +34,10 @@ class Injective (J : C) : Prop where attribute [inherit_doc Injective] Injective.factors +variable (C) in +/-- The `ObjectProperty C` corresponding to the notion of injective objects in `C`. -/ +abbrev isInjective : ObjectProperty C := Injective + lemma Limits.IsZero.injective {X : C} (h : IsZero X) : Injective X where factors _ _ _ := ⟨h.from_ _, h.eq_of_tgt _ _⟩ diff --git a/Mathlib/CategoryTheory/Preadditive/Injective/LiftingProperties.lean b/Mathlib/CategoryTheory/Preadditive/Injective/LiftingProperties.lean index 8a3df179f793ff..c38ae30620631d 100644 --- a/Mathlib/CategoryTheory/Preadditive/Injective/LiftingProperties.lean +++ b/Mathlib/CategoryTheory/Preadditive/Injective/LiftingProperties.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Preadditive.Injective.Basic -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +module + +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty /-! # Characterization of injective objects in terms of lifting properties @@ -15,6 +17,8 @@ right lifting property with respect to monomorphisms, -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/Injective/Preserves.lean b/Mathlib/CategoryTheory/Preadditive/Injective/Preserves.lean index 6ba790a00361fa..5c81096759b108 100644 --- a/Mathlib/CategoryTheory/Preadditive/Injective/Preserves.lean +++ b/Mathlib/CategoryTheory/Preadditive/Injective/Preserves.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Preadditive.Injective.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic /-! # Preservation of injective objects @@ -15,6 +17,8 @@ then `G` preserves injective objects. We show that the converse is true if the c enough injectives. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/Injective/Resolution.lean b/Mathlib/CategoryTheory/Preadditive/Injective/Resolution.lean index ad3484b6f8c2d8..1c057058d355a6 100644 --- a/Mathlib/CategoryTheory/Preadditive/Injective/Resolution.lean +++ b/Mathlib/CategoryTheory/Preadditive/Injective/Resolution.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Homology.QuasiIso -import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex -import Mathlib.Algebra.Homology.SingleHomology -import Mathlib.CategoryTheory.Preadditive.Injective.Basic +module + +public import Mathlib.Algebra.Homology.QuasiIso +public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex +public import Mathlib.Algebra.Homology.SingleHomology +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic /-! # Injective resolutions @@ -24,6 +26,8 @@ I⁰ ---> I¹ ---> ... ----> Iⁿ ---> ... ``` -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Preadditive/LeftExact.lean b/Mathlib/CategoryTheory/Preadditive/LeftExact.lean index 67766a6a59f1f7..26c651009c14a2 100644 --- a/Mathlib/CategoryTheory/Preadditive/LeftExact.lean +++ b/Mathlib/CategoryTheory/Preadditive/LeftExact.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Jakob von Raumer -/ -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # Left exactness of functors between preadditive categories @@ -22,6 +24,8 @@ preserves kernels. The dual result holds for right exact functors and cokernels. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Preadditive/LiftToFinset.lean b/Mathlib/CategoryTheory/Preadditive/LiftToFinset.lean index 711b96a6d00acb..4c953f22f1f40c 100644 --- a/Mathlib/CategoryTheory/Preadditive/LiftToFinset.lean +++ b/Mathlib/CategoryTheory/Preadditive/LiftToFinset.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Constructions.Filtered -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.CategoryTheory.Limits.Constructions.Filtered +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Additional results about the `liftToFinset` construction @@ -16,6 +18,8 @@ is preadditive, then we can describe the legs of this cocone as finite sums of p by inclusions. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Preadditive/Mat.lean b/Mathlib/CategoryTheory/Preadditive/Mat.lean index c07c23ed8b97de..529781d9b3c9f7 100644 --- a/Mathlib/CategoryTheory/Preadditive/Mat.lean +++ b/Mathlib/CategoryTheory/Preadditive/Mat.lean @@ -3,17 +3,19 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Pi -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Opposites -import Mathlib.Algebra.Ring.Opposite -import Mathlib.CategoryTheory.FintypeCat -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.CategoryTheory.Preadditive.SingleObj -import Mathlib.Data.Matrix.DMatrix -import Mathlib.Data.Matrix.Mul +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Pi +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Opposites +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.CategoryTheory.FintypeCat +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.CategoryTheory.Preadditive.SingleObj +public import Mathlib.Data.Matrix.DMatrix +public import Mathlib.Data.Matrix.Mul /-! # Matrices over a category. @@ -48,6 +50,8 @@ Ideally this would conveniently interact with both `Mat_` and `Matrix`. -/ +@[expose] public section + open CategoryTheory CategoryTheory.Preadditive diff --git a/Mathlib/CategoryTheory/Preadditive/OfBiproducts.lean b/Mathlib/CategoryTheory/Preadditive/OfBiproducts.lean index 7a7f9f92a4d009..fec5162fada2a2 100644 --- a/Mathlib/CategoryTheory/Preadditive/OfBiproducts.lean +++ b/Mathlib/CategoryTheory/Preadditive/OfBiproducts.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.GroupTheory.EckmannHilton -import Mathlib.Tactic.CategoryTheory.Reassoc +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.GroupTheory.EckmannHilton +public import Mathlib.Tactic.CategoryTheory.Reassoc /-! # Constructing a semiadditive structure from binary biproducts @@ -14,6 +16,8 @@ of commutative monoids. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Preadditive/Opposite.lean b/Mathlib/CategoryTheory/Preadditive/Opposite.lean index ef62a205946769..7df9c3083bdab5 100644 --- a/Mathlib/CategoryTheory/Preadditive/Opposite.lean +++ b/Mathlib/CategoryTheory/Preadditive/Opposite.lean @@ -3,16 +3,20 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Adam Topaz, Johan Commelin, Joël Riou -/ -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Opposite -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # If `C` is preadditive, `Cᵒᵖ` has a natural preadditive structure. -/ +@[expose] public section + open Opposite diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean index d0123cf9620d81..94a8b269fab0e4 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +module + +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts /-! # Projective objects and categories with enough projectives @@ -27,6 +29,8 @@ Given a morphism `f : X ⟶ Y`, `CategoryTheory.Projective.left f` is a projecti -/ +@[expose] public section + noncomputable section @@ -44,6 +48,10 @@ An object `P` is called *projective* if every morphism out of `P` factors throug class Projective (P : C) : Prop where factors : ∀ {E X : C} (f : P ⟶ X) (e : E ⟶ X) [Epi e], ∃ f', f' ≫ e = f +variable (C) in +/-- The `ObjectProperty C` corresponding to the notion of projective objects in `C`. -/ +abbrev isProjective : ObjectProperty C := Projective + lemma Limits.IsZero.projective {X : C} (h : IsZero X) : Projective X where factors _ _ _ := ⟨h.to_ _, h.eq_of_src _ _⟩ diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/Internal.lean b/Mathlib/CategoryTheory/Preadditive/Projective/Internal.lean index 38b33572854611..a76e0de127379a 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/Internal.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/Internal.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Jonas van der Schaaf -/ -import Mathlib.CategoryTheory.Closed.Monoidal -import Mathlib.CategoryTheory.ObjectProperty.Retract +module + +public import Mathlib.CategoryTheory.Closed.Monoidal +public import Mathlib.CategoryTheory.ObjectProperty.Retract /-! @@ -20,6 +22,8 @@ the solid theory (see the lecture series on analytic stacks: https://www.youtube.com/playlist?list=PLx5f8IelFRgGmu6gmL-Kf_Rl_6Mm7juZO). -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/LiftingProperties.lean b/Mathlib/CategoryTheory/Preadditive/Projective/LiftingProperties.lean index 746d825685a9a6..27059589707202 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/LiftingProperties.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/LiftingProperties.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Basic -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty /-! # Characterization of projective objects in terms of lifting properties @@ -15,6 +17,8 @@ left lifting property with respect to epimorphisms, -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/Preserves.lean b/Mathlib/CategoryTheory/Preadditive/Projective/Preserves.lean index b6c365ce67e21c..5047645117fdb3 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/Preserves.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/Preserves.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic /-! # Preservation of projective objects @@ -15,6 +17,8 @@ then `F` preserves projective objects. We show that the converse is true if the enough projectives. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean b/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean index cc802ddaa97ad9..d64066133ae8dd 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Joël Riou -/ -import Mathlib.Algebra.Homology.QuasiIso -import Mathlib.Algebra.Homology.SingleHomology -import Mathlib.CategoryTheory.Preadditive.Projective.Preserves +module + +public import Mathlib.Algebra.Homology.QuasiIso +public import Mathlib.Algebra.Homology.SingleHomology +public import Mathlib.CategoryTheory.Preadditive.Projective.Preserves /-! # Projective resolutions @@ -17,6 +19,8 @@ of `Z` in degree zero. -/ +@[expose] public section + universe v u v' u' diff --git a/Mathlib/CategoryTheory/Preadditive/Schur.lean b/Mathlib/CategoryTheory/Preadditive/Schur.lean index a9692a6b9fd4e0..8f7eb4b50125f2 100644 --- a/Mathlib/CategoryTheory/Preadditive/Schur.lean +++ b/Mathlib/CategoryTheory/Preadditive/Schur.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.Algebra.Group.Ext -import Mathlib.CategoryTheory.Simple -import Mathlib.CategoryTheory.Linear.Basic -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.FieldTheory.IsAlgClosed.Spectrum +module + +public import Mathlib.Algebra.Group.Ext +public import Mathlib.CategoryTheory.Simple +public import Mathlib.CategoryTheory.Linear.Basic +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.FieldTheory.IsAlgClosed.Spectrum /-! # Schur's lemma @@ -21,6 +23,8 @@ the hom space `X ⟶ Y` between simple objects `X` and `Y` is at most one dimens and is 1-dimensional iff `X` and `Y` are isomorphic. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/SingleObj.lean b/Mathlib/CategoryTheory/Preadditive/SingleObj.lean index a2b5d1a38ddafa..414fe728f5a5ec 100644 --- a/Mathlib/CategoryTheory/Preadditive/SingleObj.lean +++ b/Mathlib/CategoryTheory/Preadditive/SingleObj.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.Basic -import Mathlib.CategoryTheory.SingleObj +module + +public import Mathlib.CategoryTheory.Preadditive.Basic +public import Mathlib.CategoryTheory.SingleObj /-! # `SingleObj α` is preadditive when `α` is a ring. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Preadditive/Transfer.lean b/Mathlib/CategoryTheory/Preadditive/Transfer.lean index c7e0a581d5dfc4..bc46d472b8fcd8 100644 --- a/Mathlib/CategoryTheory/Preadditive/Transfer.lean +++ b/Mathlib/CategoryTheory/Preadditive/Transfer.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # Pulling back a preadditive structure along a fully faithful functor @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor A preadditive structure on a category `D` transfers to a preadditive structure on `C` for a given fully faithful functor `F : C ⥤ D`. -/ + +@[expose] public section namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean index e4a964f234fa69..93a3609a5e4f23 100644 --- a/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Preadditive.Opposite -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.Algebra.Category.Grp.Preadditive -import Mathlib.Algebra.Category.Grp.Yoneda +module + +public import Mathlib.CategoryTheory.Preadditive.Opposite +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.Algebra.Category.Grp.Preadditive +public import Mathlib.Algebra.Category.Grp.Yoneda /-! # The Yoneda embedding for preadditive categories @@ -23,6 +25,8 @@ embedding in the expected way and deduce that the preadditive Yoneda embedding i -/ +@[expose] public section + universe v u u₁ diff --git a/Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean b/Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean index 810634eb84d79f..ba001452b9617f 100644 --- a/Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean +++ b/Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic -import Mathlib.CategoryTheory.Preadditive.Injective.Basic -import Mathlib.Algebra.Category.Grp.EpiMono -import Mathlib.Algebra.Category.ModuleCat.EpiMono +module + +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +public import Mathlib.CategoryTheory.Preadditive.Injective.Basic +public import Mathlib.Algebra.Category.Grp.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.EpiMono /-! An object is injective iff the preadditive yoneda functor on it preserves epimorphisms. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Preadditive/Yoneda/Limits.lean b/Mathlib/CategoryTheory/Preadditive/Yoneda/Limits.lean index be0f842d918af0..108b4b6420661b 100644 --- a/Mathlib/CategoryTheory/Preadditive/Yoneda/Limits.lean +++ b/Mathlib/CategoryTheory/Preadditive/Yoneda/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.CategoryTheory.Limits.Yoneda +module + +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.CategoryTheory.Limits.Yoneda /-! # The Yoneda embedding for preadditive categories preserves limits @@ -19,6 +21,8 @@ This is in a separate file to avoid having to import the development of the abel -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Preadditive/Yoneda/Projective.lean b/Mathlib/CategoryTheory/Preadditive/Yoneda/Projective.lean index b33a3bf51259be..bc2ce22906ba92 100644 --- a/Mathlib/CategoryTheory/Preadditive/Yoneda/Projective.lean +++ b/Mathlib/CategoryTheory/Preadditive/Yoneda/Projective.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic -import Mathlib.CategoryTheory.Preadditive.Projective.Basic -import Mathlib.Algebra.Category.Grp.EpiMono -import Mathlib.Algebra.Category.ModuleCat.EpiMono +module + +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic +public import Mathlib.Algebra.Category.Grp.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.EpiMono /-! An object is projective iff the preadditive coyoneda functor on it preserves epimorphisms. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Presentable/Basic.lean b/Mathlib/CategoryTheory/Presentable/Basic.lean index eead4b228e6558..b985429572d9ea 100644 --- a/Mathlib/CategoryTheory/Presentable/Basic.lean +++ b/Mathlib/CategoryTheory/Presentable/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered -import Mathlib.SetTheory.Cardinal.HasCardinalLT +module + +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered +public import Mathlib.SetTheory.Cardinal.HasCardinalLT /-! # Presentable objects @@ -25,6 +27,8 @@ Similar as for accessible functors, we define a type class `IsAccessible`. -/ +@[expose] public section + universe w w' v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory @@ -106,6 +110,13 @@ when the functor `Hom(X, _)` preserves colimits indexed by `κ`-filtered categories. -/ abbrev IsCardinalPresentable : Prop := (coyoneda.obj (op X)).IsCardinalAccessible κ +variable (C) in +/-- The property of objects that are `κ`-presentable. -/ +def isCardinalPresentable : ObjectProperty C := fun X ↦ IsCardinalPresentable X κ + +lemma isCardinalPresentable_iff (X : C) : + isCardinalPresentable C κ X ↔ IsCardinalPresentable X κ := Iff.rfl + lemma preservesColimitsOfShape_of_isCardinalPresentable [IsCardinalPresentable X κ] (J : Type w) [SmallCategory.{w} J] [IsCardinalFiltered J κ] : PreservesColimitsOfShape J (coyoneda.obj (op X)) := @@ -123,11 +134,23 @@ lemma isCardinalPresentable_of_le [IsCardinalPresentable X κ] IsCardinalPresentable X κ' := (coyoneda.obj (op X)).isCardinalAccessible_of_le h +variable (C) {κ} in +lemma isCardinalPresentable_monotone {κ' : Cardinal.{w}} [Fact κ'.IsRegular] (h : κ ≤ κ') : + isCardinalPresentable C κ ≤ isCardinalPresentable C κ' := by + intro X hX + rw [isCardinalPresentable_iff] at hX ⊢ + exact isCardinalPresentable_of_le _ h + include e in variable {X Y} in lemma isCardinalPresentable_of_iso [IsCardinalPresentable X κ] : IsCardinalPresentable Y κ := Functor.isCardinalAccessible_of_natIso (coyoneda.mapIso e.symm.op) κ +instance : (isCardinalPresentable C κ).IsClosedUnderIsomorphisms where + of_iso e hX := by + rw [isCardinalPresentable_iff] at hX ⊢ + exact isCardinalPresentable_of_iso e _ + lemma isCardinalPresentable_of_equivalence {C' : Type u₃} [Category.{v₃} C'] [IsCardinalPresentable X κ] (e : C ≌ C') : IsCardinalPresentable (e.functor.obj X) κ := by diff --git a/Mathlib/CategoryTheory/Presentable/CardinalFilteredPresentation.lean b/Mathlib/CategoryTheory/Presentable/CardinalFilteredPresentation.lean index bca172a5eff5f2..54a672939d989b 100644 --- a/Mathlib/CategoryTheory/Presentable/CardinalFilteredPresentation.lean +++ b/Mathlib/CategoryTheory/Presentable/CardinalFilteredPresentation.lean @@ -3,33 +3,35 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Presentable.Limits -import Mathlib.CategoryTheory.Generator.StrongGenerator +module + +public import Mathlib.CategoryTheory.ObjectProperty.Small +public import Mathlib.CategoryTheory.Presentable.Limits +public import Mathlib.CategoryTheory.Generator.StrongGenerator /-! # Presentable generators -Let `C` be a category, `G : ι → C` a family of objects and `κ` a regular cardinal -(with `ι` and `κ` both in the same universe `w`). In this file, we -introduce a property `h : AreCardinalFilteredGenerators G κ`: -this property says that the objects `G i` are all `κ`-presentable and that -any object in `C` identifies as a `κ`-filtered colimit of these objects. -We show in the lemma `AreCardinalFilteredGenerators.presentable` that it -follows that any object `X` is presentable (relatively to a possibly -larger regular cardinal `κ'`). The lemma `AreCardinalFilteredGenerators.isStrongGenerator` -shows that the objects `G i` form a strong generator of the category `C`. - -Finally, we define a typeclass `HasCardinalFilteredGenerators C κ` saying -that `C` is locally `w`-small and that there exists a family `G : ι → C` -indexed by `ι : Type w` such that `AreCardinalFilteredGenerators G κ` holds. -This is used in the definition of locally presentable and accessible -categories in the file `CategoryTheory.Presentable.LocallyPresentable`. +Let `C` be a category, a regular cardinal `κ` and `P : ObjectProperty C`. +We define a predicate `P.IsCardinalFilteredGenerator κ` saying that +`P` consists of `κ`-presentable objects and that any object in `C` +is a `κ`-filtered colimit of objects satisfying `P`. +We show that if this condition is satisfied, then `P` is a strong generator +(see `IsCardinalFilteredGenerator.isStrongGenerator`). Moreover, +if `C` is locally small, we show that any object in `C` is presentable +(see `IsCardinalFilteredGenerator.presentable`). + +Finally, we define a typeclass `HasCardinalFilteredGenerator C κ` saying +that `C` is locally `w`-small and that there exists an (essentially) small `P` +such that `P.IsCardinalFilteredGenerator κ` holds. ## References * [Adámek, J. and Rosický, J., *Locally presentable and accessible categories*][Adamek_Rosicky_1994] -/ +@[expose] public section + universe w v u namespace CategoryTheory @@ -51,91 +53,108 @@ end Limits.ColimitPresentation open Limits -section - -variable {ι : Type w} (G : ι → C) (κ : Cardinal.{w}) [Fact κ.IsRegular] - -/-- Given a regular cardinal `κ`, this is the property that a family -of objects `G : ι → C` consists of `κ`-presentable objects and that any -object in `C` identifies to a `κ`-filtered colimit of these objects. -/ -structure AreCardinalFilteredGenerators : Prop where - isCardinalPresentable (i : ι) : IsCardinalPresentable (G i) κ - exists_colimitPresentation (X : C) : - ∃ (J : Type w) (_ : SmallCategory J) (_ : IsCardinalFiltered J κ) - (p : ColimitPresentation J X), - ∀ (j : J), ∃ (i : ι), Nonempty (p.diag.obj j ≅ G i) +namespace ObjectProperty -namespace AreCardinalFilteredGenerators +variable {P : ObjectProperty C} -variable {G κ} (h : AreCardinalFilteredGenerators G κ) (X : C) - -/-- When `G : ι → C` is a family of objects such that `AreCardinalFilteredGenerators G κ` -holds, and `X : C`, this is the index category of a presentation of `X` -as a `κ`-filtered colimit of objects in the family `G`. -/ -def J : Type w := (h.exists_colimitPresentation X).choose +lemma ColimitOfShape.isCardinalPresentable {X : C} {J : Type w} [SmallCategory J] + (p : P.ColimitOfShape J X) {κ : Cardinal.{w}} [Fact κ.IsRegular] + (hP : P ≤ isCardinalPresentable C κ) [LocallySmall.{w} C] + (κ' : Cardinal.{w}) [Fact κ'.IsRegular] (h : κ ≤ κ') + (hJ : HasCardinalLT (Arrow J) κ') : + IsCardinalPresentable X κ' := + p.toColimitPresentation.isCardinalPresentable κ + (fun j ↦ hP _ (p.prop_diag_obj j)) _ h hJ -noncomputable instance : SmallCategory (h.J X) := - (h.exists_colimitPresentation X).choose_spec.choose +variable {κ : Cardinal.{w}} [Fact κ.IsRegular] -noncomputable instance : IsCardinalFiltered (h.J X) κ := - (h.exists_colimitPresentation X).choose_spec.choose_spec.choose +variable (P κ) in +/-- The condition that `P : ObjectProperty C` consists of `κ`-presentable objects +and that any object of `C` is a `κ`-filtered colimit of objects satisfying `P`. +(This notion is particularly relevant when `C` is locally `w`-small and `P` is +essentially `w`-small, see `HasCardinalFilteredGenerators`, which appears in +the definitions of locally presentable and accessible categories.) -/ +structure IsCardinalFilteredGenerator : Prop where + le_isCardinalPresentable : P ≤ isCardinalPresentable C κ + exists_colimitsOfShape (X : C) : + ∃ (J : Type w) (_ : SmallCategory J) (_ : IsCardinalFiltered J κ), + P.colimitsOfShape J X -/-- A choice of a presentation of an object `X` in a category `C` -as a `κ`-filtered colimit of objects in the family `G : ι → C` -when `h : AreCardinalFilteredGenerators G κ`. -/ -noncomputable def colimitPresentation : ColimitPresentation (h.J X) X := - (h.exists_colimitPresentation X).choose_spec.choose_spec.choose_spec.choose +namespace IsCardinalFilteredGenerator -lemma exists_colimitPresentation_diag_obj_iso (j : h.J X) : - ∃ (i : ι), Nonempty ((h.colimitPresentation X).diag.obj j ≅ G i) := - (h.exists_colimitPresentation X).choose_spec.choose_spec.choose_spec.choose_spec j +variable (h : P.IsCardinalFilteredGenerator κ) (X : C) -instance (j : h.J X) : - IsCardinalPresentable.{w} ((h.colimitPresentation X).diag.obj j) κ := by - obtain ⟨i, ⟨e⟩⟩ := h.exists_colimitPresentation_diag_obj_iso X j - have := h.isCardinalPresentable - exact isCardinalPresentable_of_iso e.symm κ +include h in +lemma of_le_isoClosure {P' : ObjectProperty C} (h₁ : P ≤ P'.isoClosure) + (h₂ : P' ≤ isCardinalPresentable C κ) : + P'.IsCardinalFilteredGenerator κ where + le_isCardinalPresentable := h₂ + exists_colimitsOfShape X := by + obtain ⟨J, _, _, hX⟩ := h.exists_colimitsOfShape X + exact ⟨J, inferInstance, inferInstance, by + simpa only [colimitsOfShape_isoClosure] using colimitsOfShape_monotone J h₁ _ hX⟩ include h in -lemma isPresentable (i : ι) : IsPresentable.{w} (G i) := - have := h.isCardinalPresentable - isPresentable_of_isCardinalPresentable _ κ +lemma isoClosure : P.isoClosure.IsCardinalFilteredGenerator κ := + h.of_le_isoClosure (P.le_isoClosure.trans P.isoClosure.le_isoClosure) + (by simpa only [ObjectProperty.isoClosure_le_iff] using h.le_isCardinalPresentable) -instance (j : h.J X) : IsPresentable.{w} ((h.colimitPresentation X).diag.obj j) := - isPresentable_of_isCardinalPresentable _ κ +lemma isoClosure_iff : + P.isoClosure.IsCardinalFilteredGenerator κ ↔ P.IsCardinalFilteredGenerator κ := + ⟨fun h ↦ h.of_le_isoClosure (by rfl) (P.le_isoClosure.trans h.le_isCardinalPresentable), + isoClosure⟩ include h in -lemma presentable [LocallySmall.{w} C] (X : C) : IsPresentable.{w} X := by +lemma presentable [LocallySmall.{w} C] (X : C) : + IsPresentable.{w} X := by + obtain ⟨J, _, _, ⟨hX⟩⟩ := h.exists_colimitsOfShape X obtain ⟨κ', _, le, hκ'⟩ : ∃ (κ' : Cardinal.{w}) (_ : Fact κ'.IsRegular) (_ : κ ≤ κ'), - HasCardinalLT (Arrow (h.J X)) κ' := by + HasCardinalLT (Arrow J) κ' := by obtain ⟨κ', h₁, h₂⟩ := HasCardinalLT.exists_regular_cardinal_forall.{w} - (Sum.elim (fun (_ : Unit) ↦ Arrow (h.J X)) (fun (_ : Unit) ↦ κ.ord.toType)) + (Sum.elim (fun (_ : Unit) ↦ Arrow J) (fun (_ : Unit) ↦ κ.ord.toType)) exact ⟨κ', ⟨h₁⟩, le_of_lt (by simpa [hasCardinalLT_iff_cardinal_mk_lt] using h₂ (Sum.inr ⟨⟩)), h₂ (Sum.inl ⟨⟩)⟩ - have := (h.colimitPresentation X).isCardinalPresentable κ (by infer_instance) κ' le hκ' + have := hX.isCardinalPresentable h.le_isCardinalPresentable _ le hκ' exact isPresentable_of_isCardinalPresentable _ κ' --- TODO: Move `AreCardinalFilteredGenerators` to the `ObjectProperty` namespace include h in -lemma isStrongGenerator : - ObjectProperty.IsStrongGenerator (.ofObj G) := - .mk_of_exists_colimitsOfShape (fun X ↦ ⟨h.J X, inferInstance, by - rw [← ObjectProperty.colimitsOfShape_isoClosure] - refine ⟨h.colimitPresentation X, fun j ↦ ?_⟩ - obtain ⟨i, e⟩ := h.exists_colimitPresentation_diag_obj_iso X j - exact ⟨_, .mk i, e⟩⟩) +lemma isStrongGenerator : P.IsStrongGenerator := + IsStrongGenerator.mk_of_exists_colimitsOfShape.{w} (fun X ↦ by + obtain ⟨_, _, _, hX⟩ := h.exists_colimitsOfShape X + exact ⟨_, _, hX⟩) -end AreCardinalFilteredGenerators +end IsCardinalFilteredGenerator -end +end ObjectProperty /-- The property that a category `C` and a regular cardinal `κ` -satisfy `AreCardinalFilteredGenerators G κ` for a suitable family -of objects `G : ι → C`. -/ -class HasCardinalFilteredGenerators (C : Type u) [hC : Category.{v} C] +satisfy `P.IsCardinalFilteredGenerators κ` for an suitable essentially +small `P : ObjectProperty C`. -/ +class HasCardinalFilteredGenerator (C : Type u) [hC : Category.{v} C] (κ : Cardinal.{w}) [hκ : Fact κ.IsRegular] : Prop extends LocallySmall.{w} C where - exists_generators (C κ) [hC] [hκ] : ∃ (ι : Type w) (G : ι → C), - AreCardinalFilteredGenerators G κ + exists_generator (C κ) [hC] [hκ] : + ∃ (P : ObjectProperty C) (_ : ObjectProperty.EssentiallySmall.{w} P), + P.IsCardinalFilteredGenerator κ + +lemma ObjectProperty.IsCardinalFilteredGenerator.hasCardinalFilteredGenerator + {P : ObjectProperty C} [ObjectProperty.EssentiallySmall.{w} P] + [LocallySmall.{w} C] {κ : Cardinal.{w}} [hκ : Fact κ.IsRegular] + (hP : P.IsCardinalFilteredGenerator κ) : + HasCardinalFilteredGenerator C κ where + exists_generator := ⟨P, inferInstance, hP⟩ + +lemma HasCardinalFilteredGenerator.exists_small_generator (C : Type u) [Category.{v} C] + (κ : Cardinal.{w}) [Fact κ.IsRegular] [HasCardinalFilteredGenerator C κ] : + ∃ (P : ObjectProperty C) (_ : ObjectProperty.Small.{w} P), + P.IsCardinalFilteredGenerator κ := by + obtain ⟨P, _, hP⟩ := HasCardinalFilteredGenerator.exists_generator C κ + obtain ⟨Q, _, h₁, h₂⟩ := ObjectProperty.EssentiallySmall.exists_small_le P + exact ⟨Q, inferInstance, hP.of_le_isoClosure h₂ (h₁.trans hP.le_isCardinalPresentable)⟩ + +@[deprecated (since := "2025-10-12")] alias AreCardinalFilteredGenerators := + ObjectProperty.IsCardinalFilteredGenerator +@[deprecated (since := "2025-10-12")] alias HasCardinalFilteredGenerators := + HasCardinalFilteredGenerator end CategoryTheory diff --git a/Mathlib/CategoryTheory/Presentable/ColimitPresentation.lean b/Mathlib/CategoryTheory/Presentable/ColimitPresentation.lean index 078c4c992b3b2f..5f8ec0255cb117 100644 --- a/Mathlib/CategoryTheory/Presentable/ColimitPresentation.lean +++ b/Mathlib/CategoryTheory/Presentable/ColimitPresentation.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Presentation -import Mathlib.CategoryTheory.Presentable.Finite +module + +public import Mathlib.CategoryTheory.Limits.Presentation +public import Mathlib.CategoryTheory.Presentable.Finite /-! # Presentation of a colimit of objects equipped with a presentation @@ -15,6 +17,8 @@ import Mathlib.CategoryTheory.Presentable.Finite -/ +@[expose] public section + universe s t w v u namespace CategoryTheory.Limits.ColimitPresentation diff --git a/Mathlib/CategoryTheory/Presentable/Finite.lean b/Mathlib/CategoryTheory/Presentable/Finite.lean index fbe5db49218f86..63ecd91a1f5f79 100644 --- a/Mathlib/CategoryTheory/Presentable/Finite.lean +++ b/Mathlib/CategoryTheory/Presentable/Finite.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Limits.Filtered -import Mathlib.CategoryTheory.Limits.Preserves.Filtered -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.MorphismProperty.Basic -import Mathlib.CategoryTheory.Presentable.Basic +module + +public import Mathlib.CategoryTheory.Limits.Filtered +public import Mathlib.CategoryTheory.Limits.Preserves.Filtered +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.MorphismProperty.Basic +public import Mathlib.CategoryTheory.Presentable.Basic /-! # Finitely Presentable Objects @@ -17,6 +19,8 @@ and link this definition with the preservation of filtered colimits. -/ +@[expose] public section + universe w v' v u' u diff --git a/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean b/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean index 8d9fac795324dd..e98188f3909f18 100644 --- a/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean +++ b/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers -import Mathlib.CategoryTheory.Comma.CardinalArrow -import Mathlib.SetTheory.Cardinal.Cofinality -import Mathlib.SetTheory.Cardinal.HasCardinalLT -import Mathlib.SetTheory.Cardinal.Arithmetic +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers +public import Mathlib.CategoryTheory.Comma.CardinalArrow +public import Mathlib.SetTheory.Cardinal.Cofinality +public import Mathlib.SetTheory.Cardinal.HasCardinalLT +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! # κ-filtered category @@ -27,6 +29,8 @@ if any subset of `J` of cardinality `< κ` has an upper bound. -/ +@[expose] public section + universe w v' v u' u namespace CategoryTheory @@ -302,4 +306,14 @@ lemma IsCardinalFiltered.multicoequalizer (fun i ↦ IsFiltered.coeqHom (f₁ i) (f₂ i)) hι exact ⟨l, b, fun i ↦ by rw [← h i, IsFiltered.coeq_condition_assoc]⟩ +lemma Limits.IsTerminal.isCardinalFiltered {J : Type u} [Category.{v} J] + {X : J} (hX : IsTerminal X) (κ : Cardinal.{w}) [Fact κ.IsRegular] : + IsCardinalFiltered J κ where + nonempty_cocone _ _ := ⟨{ pt := X, ι.app _ := hX.from _ }⟩ + +lemma isCardinalFiltered_of_hasTerminal (J : Type u) [Category.{v} J] + [HasTerminal J] (κ : Cardinal.{w}) [Fact κ.IsRegular] : + IsCardinalFiltered J κ := + terminalIsTerminal.isCardinalFiltered _ + end CategoryTheory diff --git a/Mathlib/CategoryTheory/Presentable/Limits.lean b/Mathlib/CategoryTheory/Presentable/Limits.lean index e8e31e89af85a8..0fae62d158fb1d 100644 --- a/Mathlib/CategoryTheory/Presentable/Limits.lean +++ b/Mathlib/CategoryTheory/Presentable/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.Limits.Yoneda -import Mathlib.CategoryTheory.Presentable.Basic +module + +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Limits.Yoneda +public import Mathlib.CategoryTheory.Presentable.Basic /-! # Colimits of presentable objects @@ -18,6 +20,8 @@ by a category `K` such that `HasCardinalLT (Arrow K) κ`. -/ +@[expose] public section + universe w w' v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Presentable/LocallyPresentable.lean b/Mathlib/CategoryTheory/Presentable/LocallyPresentable.lean index 0af2bca046cdad..c1a953eed029a3 100644 --- a/Mathlib/CategoryTheory/Presentable/LocallyPresentable.lean +++ b/Mathlib/CategoryTheory/Presentable/LocallyPresentable.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Presentable.CardinalFilteredPresentation +module + +public import Mathlib.CategoryTheory.Presentable.CardinalFilteredPresentation /-! # Locally presentable and accessible categories @@ -21,6 +23,8 @@ accessible category, any object is presentable. -/ +@[expose] public section + universe w v u namespace CategoryTheory @@ -35,13 +39,13 @@ variable (C : Type u) [Category.{v} C] (κ : Cardinal.{w}) [Fact κ.IsRegular] if it is cocomplete and admits a (small) family `G : ι → C` of `κ`-presentable objects such that any object identifies as a `κ`-filtered colimit of these objects. -/ class IsCardinalLocallyPresentable : Prop - extends HasCardinalFilteredGenerators C κ, HasColimitsOfSize.{w, w} C where + extends HasCardinalFilteredGenerator C κ, HasColimitsOfSize.{w, w} C where /-- Given a regular cardinal `κ`, a category `C` is `κ`-accessible if it has `κ`-filtered colimits and admits a (small) family `G : ι → C` of `κ`-presentable objects such that any object identifies as a `κ`-filtered colimit of these objects. -/ class IsCardinalAccessibleCategory : Prop - extends HasCardinalFilteredGenerators C κ, HasCardinalFilteredColimits.{w} C κ where + extends HasCardinalFilteredGenerator C κ, HasCardinalFilteredColimits.{w} C κ where instance [IsCardinalLocallyPresentable C κ] : IsCardinalAccessibleCategory C κ where @@ -72,9 +76,11 @@ instance [IsLocallyPresentable.{w} C] : IsAccessibleCategory.{w} C where instance [IsAccessibleCategory.{w} C] (X : C) : IsPresentable.{w} X := by obtain ⟨κ, _, _⟩ := IsAccessibleCategory.exists_cardinal C - obtain ⟨ι, G, h⟩ := HasCardinalFilteredGenerators.exists_generators C κ + obtain ⟨_, _, h⟩ := HasCardinalFilteredGenerator.exists_generator C κ apply h.presentable +example [IsLocallyPresentable.{w} C] (X : C) : IsPresentable.{w} X := inferInstance + end end CategoryTheory diff --git a/Mathlib/CategoryTheory/Presentable/OrthogonalReflection.lean b/Mathlib/CategoryTheory/Presentable/OrthogonalReflection.lean index 18b1a12abdd342..179da90ea95393 100644 --- a/Mathlib/CategoryTheory/Presentable/OrthogonalReflection.lean +++ b/Mathlib/CategoryTheory/Presentable/OrthogonalReflection.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Localization.Bousfield -import Mathlib.CategoryTheory.SmallObject.Iteration.Basic +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Localization.Bousfield +public import Mathlib.CategoryTheory.SmallObject.Iteration.Basic /-! # The Orthogonal-reflection construction @@ -44,6 +46,8 @@ suitable assumptions (TODO). -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Presentable/Type.lean b/Mathlib/CategoryTheory/Presentable/Type.lean new file mode 100644 index 00000000000000..9a0efd58fb1292 --- /dev/null +++ b/Mathlib/CategoryTheory/Presentable/Type.lean @@ -0,0 +1,143 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.Presentable.Basic +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Types.Set + +/-! +# Presentable objects in Type + +In this file, we show that if `κ : Cardinal.{u}` is a regular cardinal, +then `X : Type u` is `κ`-presentable in the category of types iff +`HasCardinalLT X κ` holds, i.e. the cardinal number of `X` is less than `κ`. + +-/ + +@[expose] public section + +universe u + +open CategoryTheory Limits Opposite + +namespace HasCardinalLT + +variable (X : Type u) (κ : Cardinal.{u}) + +variable {X κ} in +lemma isCardinalPresentable (hX : HasCardinalLT X κ) [Fact κ.IsRegular] : + IsCardinalPresentable X κ where + preservesColimitOfShape J _ _ := + ⟨fun {F} ↦ ⟨fun {c} hc ↦ ⟨by + have := isFiltered_of_isCardinalFiltered J κ + refine Types.FilteredColimit.isColimitOf' _ _ (fun f ↦ ?_) (fun j f g h ↦ ?_) + · choose j g hg using fun x ↦ Types.jointly_surjective_of_isColimit hc (f x) + refine ⟨IsCardinalFiltered.max j hX, + fun x ↦ F.map (IsCardinalFiltered.toMax j hX x) (g x), ?_⟩ + dsimp + ext x + dsimp at j g hg x ⊢ + rw [← hg] + exact congr_fun (c.w (IsCardinalFiltered.toMax j hX x)).symm (g x) + · choose k a hk using fun x ↦ + (Types.FilteredColimit.isColimit_eq_iff' hc _ _).1 (congr_fun h x) + dsimp at f g h k a hk ⊢ + obtain ⟨l, b, c, hl⟩ : ∃ (l : J) (c : j ⟶ l) (b : ∀ x, k x ⟶ l), + ∀ x, a x ≫ b x = c := by + let φ (x : X) : j ⟶ IsCardinalFiltered.max k hX := + a x ≫ IsCardinalFiltered.toMax k hX x + exact ⟨IsCardinalFiltered.coeq φ hX, + IsCardinalFiltered.toCoeq φ hX, + fun x ↦ IsCardinalFiltered.toMax k hX x ≫ IsCardinalFiltered.coeqHom φ hX, + fun x ↦ by simpa [φ] using IsCardinalFiltered.coeq_condition φ hX x⟩ + exact ⟨l, b, by ext x; simp [← hl x, hk]⟩⟩⟩⟩ + +/-- Given `X : Type u` and `κ : Cardinal.{u} X`, this is the preordered type +of subsets of `X` of cardinality `< κ`. -/ +protected abbrev Set := { A : Set X // HasCardinalLT A κ } + +namespace Set + +instance [Fact κ.IsRegular] : + IsCardinalFiltered (HasCardinalLT.Set X κ) κ := + isCardinalFiltered_preorder _ _ + (fun ι A hι ↦ ⟨⟨⋃ (i : ι), (A i).val, + hasCardinalLT_iUnion _ + (by rwa [hasCardinalLT_iff_cardinal_mk_lt]) (fun i ↦ (A i).prop)⟩, + le_iSup (fun i ↦ (A i).1)⟩) + +instance [Fact κ.IsRegular] : + IsFiltered (HasCardinalLT.Set X κ) := + isFiltered_of_isCardinalFiltered _ κ + +lemma isFiltered_of_aleph0_le (hκ : Cardinal.aleph0 ≤ κ) : + IsFiltered (HasCardinalLT.Set X κ) where + nonempty := ⟨⟨∅, hasCardinalLT_of_finite _ _ hκ⟩⟩ + toIsFilteredOrEmpty := by + have : IsDirected (HasCardinalLT.Set X κ) (· ≤ ·) := + ⟨fun A B ↦ ⟨⟨A.val ∪ B.val, hasCardinalLT_union hκ A.prop B.prop⟩, + Set.subset_union_left, Set.subset_union_right⟩⟩ + exact isFilteredOrEmpty_of_directed_le _ + +/-- The functor `HasCardinalLT.Set X κ ⥤ Type u` which sends a subset of `X` +of cardinality `κ` to the corresponding subtype. -/ +@[simps!] +def functor : HasCardinalLT.Set X κ ⥤ Type u := + Monotone.functor (f := Subtype.val) (by tauto) ⋙ Set.functorToTypes (X := X) + +/-- The cocone for `Set.functor X κ : HasCardinalLT.Set X κ ⥤ Type u` with point `X`. -/ +@[simps] +def cocone : Cocone (Set.functor X κ) where + pt := X + ι.app _ := Subtype.val + +/-- Any type `X` is the (filtered) colimit of its subsets of cardinality `< κ` +when `κ` is an infinite cardinal. (This colimit is `κ`-filtered when `κ` is +a regular cardinal.) -/ +noncomputable def isColimitCocone + (hκ : Cardinal.aleph0 ≤ κ) : IsColimit (cocone X κ) := by + have := isFiltered_of_aleph0_le X κ hκ + refine Types.FilteredColimit.isColimitOf' _ _ (fun x ↦ ?_) ?_ + · exact ⟨⟨{x}, hasCardinalLT_of_finite _ _ hκ⟩, ⟨x, by simp⟩, rfl⟩ + · rintro A ⟨x, hx⟩ ⟨y, hy⟩ rfl + exact ⟨A, 𝟙 _, rfl⟩ + +end Set + +end HasCardinalLT + +namespace CategoryTheory + +namespace Types + +variable {X : Type u} + +lemma isCardinalPresentable_iff (κ : Cardinal.{u}) [Fact κ.IsRegular] : + IsCardinalPresentable X κ ↔ HasCardinalLT X κ := by + refine ⟨fun _ ↦ ?_, fun hX ↦ hX.isCardinalPresentable⟩ + have := preservesColimitsOfShape_of_isCardinalPresentable X κ + obtain ⟨⟨A, hA⟩, f, hf⟩ := Types.jointly_surjective_of_isColimit + (isColimitOfPreserves (coyoneda.obj (op X)) + (HasCardinalLT.Set.isColimitCocone X κ + (Cardinal.IsRegular.aleph0_le Fact.out))) (𝟙 X) + obtain rfl : A = .univ := by + ext x + have := congr_fun hf x + dsimp at this + rw [← this] + simp + exact (hasCardinalLT_iff_of_equiv (Equiv.Set.univ X) _).1 hA + +instance (X : Type u) : IsPresentable.{u} X := by + obtain ⟨κ, hκ, hX⟩ := HasCardinalLT.exists_regular_cardinal.{u} X + have : Fact κ.IsRegular := ⟨hκ⟩ + have := hX.isCardinalPresentable + exact isPresentable_of_isCardinalPresentable X κ + +end Types + +end CategoryTheory diff --git a/Mathlib/CategoryTheory/Products/Associator.lean b/Mathlib/CategoryTheory/Products/Associator.lean index 4c74587aaeb973..2c1a85e5f045ce 100644 --- a/Mathlib/CategoryTheory/Products/Associator.lean +++ b/Mathlib/CategoryTheory/Products/Associator.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison -/ -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.Products.Basic /-! The associator functor `((C × D) × E) ⥤ (C × (D × E))` and its inverse form an equivalence. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Products/Basic.lean b/Mathlib/CategoryTheory/Products/Basic.lean index 166b3b07a453c4..abc54cae0645e4 100644 --- a/Mathlib/CategoryTheory/Products/Basic.lean +++ b/Mathlib/CategoryTheory/Products/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison -/ -import Mathlib.CategoryTheory.Functor.Const -import Mathlib.CategoryTheory.Opposites -import Mathlib.Data.Prod.Basic +module + +public import Mathlib.CategoryTheory.Functor.Const +public import Mathlib.CategoryTheory.Opposites +public import Mathlib.Data.Prod.Basic /-! # Cartesian products of categories @@ -24,6 +26,8 @@ We further define `evaluation : C ⥤ (C ⥤ D) ⥤ D` and `evaluationUncurried and products of functors and natural transformations, written `F.prod G` and `α.prod β`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Products/Bifunctor.lean b/Mathlib/CategoryTheory/Products/Bifunctor.lean index 4dab8f71887ca5..de505c3f17f2f3 100644 --- a/Mathlib/CategoryTheory/Products/Bifunctor.lean +++ b/Mathlib/CategoryTheory/Products/Bifunctor.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison -/ -import Mathlib.CategoryTheory.Products.Basic +module + +public import Mathlib.CategoryTheory.Products.Basic /-! # Lemmas about functors out of product categories. -/ +@[expose] public section + open CategoryTheory diff --git a/Mathlib/CategoryTheory/Products/Unitor.lean b/Mathlib/CategoryTheory/Products/Unitor.lean index cdeddad89863fc..baff723cfa5bf2 100644 --- a/Mathlib/CategoryTheory/Products/Unitor.lean +++ b/Mathlib/CategoryTheory/Products/Unitor.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Shanghe Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shanghe Chen -/ -import Mathlib.CategoryTheory.Products.Basic -import Mathlib.CategoryTheory.Discrete.Basic +module + +public import Mathlib.CategoryTheory.Products.Basic +public import Mathlib.CategoryTheory.Discrete.Basic /-! # The left/right unitor equivalences `1 × C ≌ C` and `C × 1 ≌ C`. -/ +@[expose] public section + universe w v u open CategoryTheory diff --git a/Mathlib/CategoryTheory/Quotient.lean b/Mathlib/CategoryTheory/Quotient.lean index db486b6a00acf5..e6680489738317 100644 --- a/Mathlib/CategoryTheory/Quotient.lean +++ b/Mathlib/CategoryTheory/Quotient.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.CategoryTheory.NatIso -import Mathlib.CategoryTheory.EqToHom -import Mathlib.CategoryTheory.Groupoid +module + +public import Mathlib.CategoryTheory.NatIso +public import Mathlib.CategoryTheory.EqToHom +public import Mathlib.CategoryTheory.Groupoid /-! # Quotient category @@ -18,6 +20,8 @@ than 'the quotient of a group by a normal subgroup'. When taking the quotient by relation, `functor_map_eq_iff` says that no unnecessary identifications have been made. -/ +@[expose] public section + /-- A `HomRel` on `C` consists of a relation on every hom-set. -/ def HomRel (C) [Quiver C] := diff --git a/Mathlib/CategoryTheory/Quotient/Linear.lean b/Mathlib/CategoryTheory/Quotient/Linear.lean index a62eb2040d0724..142293f79d8268 100644 --- a/Mathlib/CategoryTheory/Quotient/Linear.lean +++ b/Mathlib/CategoryTheory/Quotient/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Quotient -import Mathlib.CategoryTheory.Linear.LinearFunctor +module + +public import Mathlib.CategoryTheory.Quotient +public import Mathlib.CategoryTheory.Linear.LinearFunctor /-! # The quotient category is linear @@ -19,6 +21,8 @@ is a `R`-linear functor. -/ +@[expose] public section + namespace CategoryTheory namespace Quotient diff --git a/Mathlib/CategoryTheory/Quotient/Preadditive.lean b/Mathlib/CategoryTheory/Quotient/Preadditive.lean index db607b900b1d4b..438eb3ebfea3e5 100644 --- a/Mathlib/CategoryTheory/Quotient/Preadditive.lean +++ b/Mathlib/CategoryTheory/Quotient/Preadditive.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Quotient -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Quotient +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # The quotient category is preadditive @@ -15,6 +17,8 @@ preadditive. -/ +@[expose] public section + namespace CategoryTheory namespace Quotient diff --git a/Mathlib/CategoryTheory/Retract.lean b/Mathlib/CategoryTheory/Retract.lean index 2dd581222248db..adf2b0b477d44f 100644 --- a/Mathlib/CategoryTheory/Retract.lean +++ b/Mathlib/CategoryTheory/Retract.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jack McKoen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jack McKoen -/ -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.EpiMono +module + +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.EpiMono /-! # Retracts @@ -13,6 +15,8 @@ Defines retracts of objects and morphisms. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory @@ -128,6 +132,12 @@ instance : IsSplitMono h.i.left := ⟨⟨h.left.splitMono⟩⟩ instance : IsSplitMono h.i.right := ⟨⟨h.right.splitMono⟩⟩ +/-- If a morphism `f` is a retract of `g`, +then `F.map f` is a retract of `F.map g` for any functor `F`. -/ +@[simps!] +def map (F : C ⥤ D) : RetractArrow (F.map f) (F.map g) := + Retract.map h F.mapArrow + /-- If a morphism `f` is a retract of `g`, then `f.op` is a retract of `g.op`. -/ @[simps] def op : RetractArrow f.op g.op where @@ -164,4 +174,13 @@ def retract {X Y : C} (e : X ≅ Y) : Retract X Y where end Iso +/-- If `X` is a retract of `Y`, then for any natural transformation `τ`, +the natural transformation `τ.app X` is a retract of `τ.app Y`. -/ +@[simps] +def NatTrans.retractArrowApp {F G : C ⥤ D} + (τ : F ⟶ G) {X Y : C} (h : Retract X Y) : RetractArrow (τ.app X) (τ.app Y) where + i := Arrow.homMk (F.map h.i) (G.map h.i) (by simp) + r := Arrow.homMk (F.map h.r) (G.map h.r) (by simp) + retract := by ext <;> simp [← Functor.map_comp] + end CategoryTheory diff --git a/Mathlib/CategoryTheory/Shift/Adjunction.lean b/Mathlib/CategoryTheory/Shift/Adjunction.lean index 718615edf69d4a..49bd906596356b 100644 --- a/Mathlib/CategoryTheory/Shift/Adjunction.lean +++ b/Mathlib/CategoryTheory/Shift/Adjunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel, Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift -import Mathlib.CategoryTheory.Adjunction.Mates +module + +public import Mathlib.CategoryTheory.Shift.CommShift +public import Mathlib.CategoryTheory.Adjunction.Mates /-! # Adjoints commute with shifts @@ -43,6 +45,8 @@ statements for the commutation isomorphisms for `G`. -/ +@[expose] public section + namespace CategoryTheory open Category @@ -227,7 +231,7 @@ namespace CommShift /-- Constructor for `Adjunction.CommShift`. -/ -lemma mk' (h : NatTrans.CommShift adj.unit A) : +lemma mk' (_ : NatTrans.CommShift adj.unit A) : adj.CommShift A where commShift_counit := ⟨fun a ↦ by ext @@ -235,9 +239,7 @@ lemma mk' (h : NatTrans.CommShift adj.unit A) : Functor.commShiftIso_comp_hom_app, Functor.whiskerRight_app, assoc, Functor.whiskerLeft_app, Functor.commShiftIso_id_hom_app, comp_id] refine (compatibilityCounit_of_compatibilityUnit adj _ _ (fun X ↦ ?_) _).symm - simpa only [NatTrans.comp_app, - Functor.commShiftIso_id_hom_app, Functor.whiskerRight_app, id_comp, - Functor.commShiftIso_comp_hom_app] using congr_app (h.shift_comm a) X⟩ + simpa [Functor.commShiftIso_comp_hom_app] using NatTrans.shift_app_comm adj.unit a X⟩ variable [adj.CommShift A] @@ -370,15 +372,15 @@ open RightAdjointCommShift in Given an adjunction `F ⊣ G` and a `CommShift` structure on `F`, this constructs the unique compatible `CommShift` structure on `G`. -/ -@[simps] +@[simps -isSimp] noncomputable def rightAdjointCommShift [F.CommShift A] : G.CommShift A where - iso a := iso adj a - zero := by + commShiftIso a := iso adj a + commShiftIso_zero := by refine CommShift.compatibilityUnit_unique_right adj (F.commShiftIso 0) _ _ (compatibilityUnit_iso adj 0) ?_ rw [F.commShiftIso_zero] exact CommShift.compatibilityUnit_isoZero adj - add a b := by + commShiftIso_add a b := by refine CommShift.compatibilityUnit_unique_right adj (F.commShiftIso (a + b)) _ _ (compatibilityUnit_iso adj (a + b)) ?_ rw [F.commShiftIso_add] @@ -454,15 +456,15 @@ open LeftAdjointCommShift in Given an adjunction `F ⊣ G` and a `CommShift` structure on `G`, this constructs the unique compatible `CommShift` structure on `F`. -/ -@[simps] +@[simps -isSimp] noncomputable def leftAdjointCommShift [G.CommShift A] : F.CommShift A where - iso a := iso adj a - zero := by + commShiftIso a := iso adj a + commShiftIso_zero := by refine CommShift.compatibilityUnit_unique_left adj _ _ (G.commShiftIso 0) (compatibilityUnit_iso adj 0) ?_ rw [G.commShiftIso_zero] exact CommShift.compatibilityUnit_isoZero adj - add a b := by + commShiftIso_add a b := by refine CommShift.compatibilityUnit_unique_left adj _ _ (G.commShiftIso (a + b)) (compatibilityUnit_iso adj (a + b)) ?_ rw [G.commShiftIso_add] diff --git a/Mathlib/CategoryTheory/Shift/Basic.lean b/Mathlib/CategoryTheory/Shift/Basic.lean index 2c77d0fe9dc920..254b22dd4a6b12 100644 --- a/Mathlib/CategoryTheory/Shift/Basic.lean +++ b/Mathlib/CategoryTheory/Shift/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin, Andrew Yang, Joël Riou -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero -import Mathlib.CategoryTheory.Monoidal.End -import Mathlib.CategoryTheory.Monoidal.Discrete +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero +public import Mathlib.CategoryTheory.Monoidal.End +public import Mathlib.CategoryTheory.Monoidal.Discrete /-! # Shift @@ -36,6 +38,8 @@ which are stated in lemmas like `shiftFunctorAdd'_assoc`, `shiftFunctorAdd'_zero -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Shift/CommShift.lean b/Mathlib/CategoryTheory/Shift/CommShift.lean index d665f0269b291f..e343af600c0983 100644 --- a/Mathlib/CategoryTheory/Shift/CommShift.lean +++ b/Mathlib/CategoryTheory/Shift/CommShift.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Shift.Basic +public import Mathlib.CategoryTheory.Shift.Basic /-! # Functors which commute with shifts @@ -26,6 +27,8 @@ shift functors.) -/ +@[expose] public section + namespace CategoryTheory open Category @@ -104,24 +107,25 @@ end CommShift /-- A functor `F` commutes with the shift by a monoid `A` if it is equipped with commutation isomorphisms with the shifts by all `a : A`, and these isomorphisms satisfy coherence properties with respect to `0 : A` and the addition in `A`. -/ -class CommShift where +class CommShift (F : C ⥤ D) (A : Type*) [AddMonoid A] [HasShift C A] [HasShift D A] where /-- The commutation isomorphisms for all `a`-shifts this functor is equipped with -/ - iso (a : A) : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a - zero : iso 0 = CommShift.isoZero F A := by cat_disch - add (a b : A) : iso (a + b) = CommShift.isoAdd (iso a) (iso b) := by cat_disch + commShiftIso (F) (a : A) : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a + commShiftIso_zero (F) (A) : commShiftIso 0 = CommShift.isoZero F A := by cat_disch + commShiftIso_add (F) (a b : A) : + commShiftIso (a + b) = CommShift.isoAdd (commShiftIso a) (commShiftIso b) := by cat_disch variable {A} +export CommShift (commShiftIso commShiftIso_zero commShiftIso_add) + +@[deprecated (since := "2025-11-11")] alias CommShift.iso := commShiftIso +@[deprecated (since := "2025-11-11")] alias CommShift.zero := commShiftIso_zero +@[deprecated (since := "2025-11-11")] alias CommShift.add := commShiftIso_add + section variable [F.CommShift A] -/-- If a functor `F` commutes with the shift by `A` (i.e. `[F.CommShift A]`), then -`F.commShiftIso a` is the given isomorphism `shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a`. -/ -def commShiftIso (a : A) : - shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a := - CommShift.iso a - -- Note: The following two lemmas are introduced in order to have more proofs work `by simp`. -- Indeed, `simp only [(F.commShiftIso a).hom.naturality f]` would almost never work because -- of the compositions of functors which appear in both the source and target of @@ -139,23 +143,12 @@ lemma commShiftIso_inv_naturality {X Y : C} (f : X ⟶ Y) (a : A) : (F.commShiftIso a).inv.app X ≫ F.map (f⟦a⟧') := (F.commShiftIso a).inv.naturality f -variable (A) - -lemma commShiftIso_zero : - F.commShiftIso (0 : A) = CommShift.isoZero F A := - CommShift.zero - +variable (A) in set_option linter.docPrime false in lemma commShiftIso_zero' (a : A) (h : a = 0) : F.commShiftIso a = CommShift.isoZero' F A a h := by subst h; rw [CommShift.isoZero'_eq_isoZero, commShiftIso_zero] -variable {A} - -lemma commShiftIso_add (a b : A) : - F.commShiftIso (a + b) = CommShift.isoAdd (F.commShiftIso a) (F.commShiftIso b) := - CommShift.add a b - lemma commShiftIso_add' {a b c : A} (h : a + b = c) : F.commShiftIso c = CommShift.isoAdd' h (F.commShiftIso a) (F.commShiftIso b) := by subst h @@ -166,19 +159,21 @@ end namespace CommShift variable (C) in +@[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app] instance id : CommShift (𝟭 C) A where - iso := fun _ => rightUnitor _ ≪≫ (leftUnitor _).symm + commShiftIso := fun _ => rightUnitor _ ≪≫ (leftUnitor _).symm +@[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app] instance comp [F.CommShift A] [G.CommShift A] : (F ⋙ G).CommShift A where - iso a := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (F.commShiftIso a) _ ≪≫ + commShiftIso a := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (F.commShiftIso a) _ ≪≫ Functor.associator _ _ _ ≪≫ isoWhiskerLeft _ (G.commShiftIso a) ≪≫ (Functor.associator _ _ _).symm - zero := by + commShiftIso_zero := by ext X dsimp simp only [id_comp, comp_id, commShiftIso_zero, isoZero_hom_app, ← Functor.map_comp_assoc, assoc, Iso.inv_hom_id_app, id_obj, comp_map, comp_obj] - add := fun a b => by + commShiftIso_add := fun a b => by ext X dsimp simp only [commShiftIso_add, isoAdd_hom_app] @@ -188,23 +183,12 @@ instance comp [F.CommShift A] [G.CommShift A] : (F ⋙ G).CommShift A where end CommShift -@[simp] -lemma commShiftIso_id_hom_app (a : A) (X : C) : - (commShiftIso (𝟭 C) a).hom.app X = 𝟙 _ := comp_id _ +alias commShiftIso_id_hom_app := CommShift.id_commShiftIso_hom_app +alias commShiftIso_id_inv_app := CommShift.id_commShiftIso_inv_app +alias commShiftIso_comp_hom_app := CommShift.comp_commShiftIso_hom_app +alias commShiftIso_comp_inv_app := CommShift.comp_commShiftIso_inv_app -@[simp] -lemma commShiftIso_id_inv_app (a : A) (X : C) : - (commShiftIso (𝟭 C) a).inv.app X = 𝟙 _ := comp_id _ - -lemma commShiftIso_comp_hom_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) : - (commShiftIso (F ⋙ G) a).hom.app X = - G.map ((commShiftIso F a).hom.app X) ≫ (commShiftIso G a).hom.app (F.obj X) := by - simp [commShiftIso, CommShift.iso] - -lemma commShiftIso_comp_inv_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) : - (commShiftIso (F ⋙ G) a).inv.app X = - (commShiftIso G a).inv.app (F.obj X) ≫ G.map ((commShiftIso F a).inv.app X) := by - simp [commShiftIso, CommShift.iso] +attribute [simp] commShiftIso_id_hom_app commShiftIso_id_inv_app variable {B} @@ -354,16 +338,13 @@ variable {C D E : Type*} [Category C] [Category D] /-- If `e : F ≅ G` is an isomorphism of functors and if `F` commutes with the shift, then `G` also commutes with the shift. -/ +@[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app] def ofIso : G.CommShift A where - iso a := isoWhiskerLeft _ e.symm ≪≫ F.commShiftIso a ≪≫ isoWhiskerRight e _ - zero := by + commShiftIso a := isoWhiskerLeft _ e.symm ≪≫ F.commShiftIso a ≪≫ isoWhiskerRight e _ + commShiftIso_zero := by ext X - simp only [comp_obj, F.commShiftIso_zero A, Iso.trans_hom, isoWhiskerLeft_hom, - Iso.symm_hom, isoWhiskerRight_hom, NatTrans.comp_app, whiskerLeft_app, - isoZero_hom_app, whiskerRight_app, assoc] - erw [← e.inv.naturality_assoc, ← NatTrans.naturality, - e.inv_hom_id_app_assoc] - add a b := by + simp [F.commShiftIso_zero, ← NatTrans.naturality] + commShiftIso_add a b := by ext X simp only [comp_obj, F.commShiftIso_add, Iso.trans_hom, isoWhiskerLeft_hom, Iso.symm_hom, isoWhiskerRight_hom, NatTrans.comp_app, whiskerLeft_app, @@ -376,9 +357,7 @@ lemma ofIso_compatibility : letI := ofIso e A NatTrans.CommShift e.hom A := by letI := ofIso e A - refine ⟨fun a => ?_⟩ - dsimp [commShiftIso, ofIso] - rw [← whiskerLeft_comp_assoc, e.hom_inv_id, whiskerLeft_id', id_comp] + exact ⟨fun a => by ext; simp [ofIso_commShiftIso_hom_app]⟩ end CommShift diff --git a/Mathlib/CategoryTheory/Shift/Induced.lean b/Mathlib/CategoryTheory/Shift/Induced.lean index 70c4821748447d..9d85d048f6d983 100644 --- a/Mathlib/CategoryTheory/Shift/Induced.lean +++ b/Mathlib/CategoryTheory/Shift/Induced.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift +module + +public import Mathlib.CategoryTheory.Shift.CommShift /-! # Shift induced from a category to another @@ -23,6 +25,8 @@ used for both quotient and localized shifts. -/ +@[expose] public section + namespace CategoryTheory open Functor @@ -209,20 +213,21 @@ noncomputable def Functor.CommShift.ofInduced : F.CommShift A := by letI := HasShift.induced F A s i exact - { iso := fun a => (i a).symm - zero := by + { commShiftIso := fun a => (i a).symm + commShiftIso_zero := by ext X dsimp simp only [isoZero_hom_app, shiftFunctorZero_inv_app_obj_of_induced, ← F.map_comp_assoc, Iso.hom_inv_id_app, F.map_id, Category.id_comp] - add := fun a b => by + commShiftIso_add := fun a b => by ext X dsimp simp only [isoAdd_hom_app, Iso.symm_hom, shiftFunctorAdd_inv_app_obj_of_induced, shiftFunctor_of_induced] - erw [← Functor.map_comp_assoc, Iso.inv_hom_id_app, Functor.map_id, - Category.id_comp, Iso.inv_hom_id_app_assoc, ← F.map_comp_assoc, Iso.hom_inv_id_app, - F.map_id, Category.id_comp] } + rw [← Functor.map_comp_assoc, Iso.inv_hom_id_app] + dsimp + rw [Functor.map_id, Category.id_comp, Iso.inv_hom_id_app_assoc, + ← F.map_comp_assoc, Iso.hom_inv_id_app, F.map_id, Category.id_comp] } lemma Functor.commShiftIso_eq_ofInduced (a : A) : letI := HasShift.induced F A s i diff --git a/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean b/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean index cf29123b03d5c0..e18cd376b8d590 100644 --- a/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean +++ b/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift -import Mathlib.CategoryTheory.Shift.ShiftSequence +module + +public import Mathlib.CategoryTheory.Shift.CommShift +public import Mathlib.CategoryTheory.Shift.ShiftSequence /-! # Induced shift sequences @@ -26,6 +28,8 @@ homotopy category of cochain complexes (TODO), and also on the derived category -/ +@[expose] public section + open CategoryTheory Category Functor namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Shift/Linear.lean b/Mathlib/CategoryTheory/Shift/Linear.lean index 332be978bac2fa..74c95be73cc69a 100644 --- a/Mathlib/CategoryTheory/Shift/Linear.lean +++ b/Mathlib/CategoryTheory/Shift/Linear.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift -import Mathlib.CategoryTheory.Localization.Linear +module + +public import Mathlib.CategoryTheory.Shift.CommShift +public import Mathlib.CategoryTheory.Localization.Linear /-! # Localization of the linearity of the shift functors @@ -16,6 +18,8 @@ then the shift functors on `D` are `R`-linear. -/ +@[expose] public section + namespace CategoryTheory namespace Shift diff --git a/Mathlib/CategoryTheory/Shift/Localization.lean b/Mathlib/CategoryTheory/Shift/Localization.lean index 88c07069f381ef..5dc0b3f503c16d 100644 --- a/Mathlib/CategoryTheory/Shift/Localization.lean +++ b/Mathlib/CategoryTheory/Shift/Localization.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.Induced -import Mathlib.CategoryTheory.Localization.HasLocalization -import Mathlib.CategoryTheory.Localization.LocalizerMorphism +module + +public import Mathlib.CategoryTheory.Shift.Induced +public import Mathlib.CategoryTheory.Localization.HasLocalization +public import Mathlib.CategoryTheory.Localization.LocalizerMorphism /-! # The shift induced on a localized category @@ -18,6 +20,8 @@ a shift by `A`, and the localization functor is compatible with the shift. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ w namespace CategoryTheory @@ -167,8 +171,8 @@ end commShiftOfLocalization is induced by a functor which commutes with the shift, then this functor commutes with the shift. -/ noncomputable def commShiftOfLocalization : F'.CommShift A where - iso := commShiftOfLocalization.iso L W F F' - zero := by + commShiftIso := commShiftOfLocalization.iso L W F F' + commShiftIso_zero := by ext1 apply natTrans_ext L W intro X @@ -179,7 +183,7 @@ noncomputable def commShiftOfLocalization : F'.CommShift A where dsimp simp only [← Functor.map_comp_assoc, ← Functor.map_comp, Iso.inv_hom_id_app, id_obj, map_id, Category.id_comp, Iso.hom_inv_id_app_assoc] - add a b := by + commShiftIso_add a b := by ext1 apply natTrans_ext L W intro X diff --git a/Mathlib/CategoryTheory/Shift/Opposite.lean b/Mathlib/CategoryTheory/Shift/Opposite.lean index 08f7b6242dc60d..3fef25a145c31b 100644 --- a/Mathlib/CategoryTheory/Shift/Opposite.lean +++ b/Mathlib/CategoryTheory/Shift/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.Adjunction -import Mathlib.CategoryTheory.Preadditive.Opposite +module + +public import Mathlib.CategoryTheory.Shift.Adjunction +public import Mathlib.CategoryTheory.Preadditive.Opposite /-! # The (naive) shift on the opposite category @@ -46,6 +48,8 @@ We also prove that, if an adjunction `F ⊣ G` is compatible with `CommShift` st -/ +@[expose] public section + namespace CategoryTheory open Limits Category @@ -77,9 +81,7 @@ with the naive shift: `shiftFunctor (OppositeShift C A) n` is `(shiftFunctor C n @[nolint unusedArguments] def OppositeShift (A : Type*) [AddMonoid A] [HasShift C A] := Cᵒᵖ -instance : Category (OppositeShift C A) := by - dsimp only [OppositeShift] - infer_instance +instance : Category (OppositeShift C A) := inferInstanceAs (Category Cᵒᵖ) noncomputable instance : HasShift (OppositeShift C A) A := hasShiftMk Cᵒᵖ A (HasShift.mkShiftCoreOp C A) @@ -88,9 +90,8 @@ instance [HasZeroObject C] : HasZeroObject (OppositeShift C A) := by dsimp only [OppositeShift] infer_instance -instance [Preadditive C] : Preadditive (OppositeShift C A) := by - dsimp only [OppositeShift] - infer_instance +instance [Preadditive C] : Preadditive (OppositeShift C A) := + inferInstanceAs (Preadditive Cᵒᵖ) instance [Preadditive C] (n : A) [(shiftFunctor C n).Additive] : (shiftFunctor (OppositeShift C A) n).Additive := by @@ -166,15 +167,15 @@ Given a `CommShift` structure on `F`, this is the corresponding `CommShift` stru -/ noncomputable instance commShiftOp [CommShift F A] : CommShift (OppositeShift.functor A F) A where - iso a := (NatIso.op (F.commShiftIso a)).symm - zero := by + commShiftIso a := (NatIso.op (F.commShiftIso a)).symm + commShiftIso_zero := by rw [commShiftIso_zero] ext simp only [op_obj, comp_obj, Iso.symm_hom, NatIso.op_inv, NatTrans.op_app, CommShift.isoZero_inv_app, op_comp, CommShift.isoZero_hom_app] erw [oppositeShiftFunctorZero_inv_app, oppositeShiftFunctorZero_hom_app] rfl - add a b := by + commShiftIso_add a b := by rw [commShiftIso_add] ext simp only [op_obj, comp_obj, Iso.symm_hom, NatIso.op_inv, NatTrans.op_app, @@ -189,18 +190,18 @@ lemma commShiftOp_iso_eq [CommShift F A] (a : A) : Given a `CommShift` structure on `OppositeShift.functor F` (for the naive shifts on the opposite categories), this is the corresponding `CommShift` structure on `F`. -/ -@[simps] +@[simps -isSimp] noncomputable def commShiftUnop [CommShift (OppositeShift.functor A F) A] : CommShift F A where - iso a := NatIso.removeOp ((OppositeShift.functor A F).commShiftIso a).symm - zero := by + commShiftIso a := NatIso.removeOp ((OppositeShift.functor A F).commShiftIso a).symm + commShiftIso_zero := by rw [commShiftIso_zero] ext simp only [comp_obj, NatIso.removeOp_hom, Iso.symm_hom, NatTrans.removeOp_app, op_obj, CommShift.isoZero_inv_app, unop_comp, CommShift.isoZero_hom_app] erw [oppositeShiftFunctorZero_hom_app, oppositeShiftFunctorZero_inv_app] rfl - add a b := by + commShiftIso_add a b := by rw [commShiftIso_add] ext simp only [comp_obj, NatIso.removeOp_hom, Iso.symm_hom, NatTrans.removeOp_app, op_obj, @@ -244,7 +245,7 @@ instance : NatTrans.CommShift (OppositeShift.natIsoId C A).hom A where shift_comm _ := by ext dsimp [OppositeShift.natIsoId, Functor.commShiftOp_iso_eq] - simp only [Functor.commShiftIso_id_hom_app, Functor.comp_obj, Functor.id_obj, Functor.map_id, + simp only [Functor.commShiftIso_id_hom_app, Functor.map_id, comp_id, Functor.commShiftIso_id_inv_app, CategoryTheory.op_id, id_comp] rfl diff --git a/Mathlib/CategoryTheory/Shift/Pullback.lean b/Mathlib/CategoryTheory/Shift/Pullback.lean index 677561904d108a..d099a14cb48a49 100644 --- a/Mathlib/CategoryTheory/Shift/Pullback.lean +++ b/Mathlib/CategoryTheory/Shift/Pullback.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.Adjunction -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Shift.Adjunction +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # The pullback of a shift by a monoid morphism @@ -30,6 +32,8 @@ on `F` and `G`, then `PullbackShift.adjunction adj φ` iis also compatible with `CommShift` structures. -/ +@[expose] public section + namespace CategoryTheory open Limits Category @@ -161,16 +165,16 @@ namespace Functor commutes with their pullbacks by an additive map `φ`. -/ noncomputable instance commShiftPullback : (PullbackShift.functor φ F).CommShift A where - iso a := isoWhiskerRight (pullbackShiftIso C φ a (φ a) rfl) F ≪≫ + commShiftIso a := isoWhiskerRight (pullbackShiftIso C φ a (φ a) rfl) F ≪≫ F.commShiftIso (φ a) ≪≫ isoWhiskerLeft _ (pullbackShiftIso D φ a (φ a) rfl).symm - zero := by + commShiftIso_zero := by ext dsimp simp only [F.commShiftIso_zero' (A := B) (φ 0) (by rw [map_zero]), CommShift.isoZero'_hom_app, assoc, CommShift.isoZero_hom_app, pullbackShiftFunctorZero'_hom_app, map_comp, pullbackShiftFunctorZero'_inv_app] rfl - add _ _ := by + commShiftIso_add _ _ := by ext simp only [PullbackShift.functor, comp_obj, Iso.trans_hom, isoWhiskerRight_hom, isoWhiskerLeft_hom, Iso.symm_hom, NatTrans.comp_app, whiskerRight_app, whiskerLeft_app, diff --git a/Mathlib/CategoryTheory/Shift/Quotient.lean b/Mathlib/CategoryTheory/Shift/Quotient.lean index 9b1b81e8133894..bc989a94a6d6b0 100644 --- a/Mathlib/CategoryTheory/Shift/Quotient.lean +++ b/Mathlib/CategoryTheory/Shift/Quotient.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift -import Mathlib.CategoryTheory.Shift.Induced -import Mathlib.CategoryTheory.Quotient +module + +public import Mathlib.CategoryTheory.Shift.CommShift +public import Mathlib.CategoryTheory.Shift.Induced +public import Mathlib.CategoryTheory.Quotient /-! # The shift on a quotient category @@ -21,6 +23,8 @@ the shift can be automatically inferred on the quotient category. -/ +@[expose] public section + universe v v' u u' w open CategoryTheory Category @@ -101,10 +105,11 @@ end LiftCommShift /-- When `r : HomRel C` is compatible with the shift by an additive monoid, and `F : C ⥤ D` is a functor which commutes with the shift and is compatible with `r`, then the induced functor `Quotient.lift r F _ : Quotient r ⥤ D` also commutes with the shift. -/ +@[simps -isSimp commShiftIso] noncomputable instance liftCommShift : (Quotient.lift r F hF).CommShift A where - iso := LiftCommShift.iso F r hF - zero := by + commShiftIso := LiftCommShift.iso F r hF + commShiftIso_zero := by ext1 apply natTrans_ext ext X @@ -115,7 +120,7 @@ noncomputable instance liftCommShift : lift_map_functor_map, ← F.map_comp_assoc, Iso.inv_hom_id_app] dsimp [lift_obj_functor_obj] rw [F.map_id, id_comp] - add a b := by + commShiftIso_add a b := by ext1 apply natTrans_ext ext X @@ -139,10 +144,9 @@ instance liftCommShift_compatibility : shift_comm a := by ext X dsimp - erw [Functor.map_id, id_comp, comp_id] - rw [Functor.commShiftIso_comp_hom_app] - erw [LiftCommShift.iso_hom_app] - rw [← Functor.map_comp_assoc, Iso.hom_inv_id_app, Functor.map_id, id_comp] + rw [Functor.commShiftIso_comp_hom_app, liftCommShift_commShiftIso, + LiftCommShift.iso_hom_app, ← Functor.map_comp_assoc, Iso.hom_inv_id_app] + simp [lift, Quotient.functor] end Quotient diff --git a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean index a66f6f7674f49f..760bc2df704477 100644 --- a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean +++ b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.Basic -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +module + +public import Mathlib.CategoryTheory.Shift.Basic +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! Sequences of functors from a category equipped with a shift @@ -25,6 +27,8 @@ in degree `n`. -/ +@[expose] public section + open CategoryTheory Category ZeroObject Limits variable {C A : Type*} [Category C] [Category A] (F : C ⥤ A) diff --git a/Mathlib/CategoryTheory/Shift/ShiftedHom.lean b/Mathlib/CategoryTheory/Shift/ShiftedHom.lean index 3de826c060300d..73a4831225601e 100644 --- a/Mathlib/CategoryTheory/Shift/ShiftedHom.lean +++ b/Mathlib/CategoryTheory/Shift/ShiftedHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Linear.LinearFunctor +module + +public import Mathlib.CategoryTheory.Shift.CommShift +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Linear.LinearFunctor /-! Shifted morphisms @@ -16,6 +18,8 @@ shifted hom. -/ +@[expose] public section + namespace CategoryTheory open Category @@ -165,7 +169,7 @@ lemma map_mk₀ (m₀ : M) (hm₀ : m₀ = 0) (f : X ⟶ Y) (F : C ⥤ D) [F.Com @[simp] lemma id_map {a : M} (f : ShiftedHom X Y a) : f.map (𝟭 C) = f := by - simp [map, Functor.commShiftIso, Functor.CommShift.iso] + simp [map] lemma comp_map {a : M} (f : ShiftedHom X Y a) (F : C ⥤ D) [F.CommShift M] (G : D ⥤ E) [G.CommShift M] : f.map (F ⋙ G) = (f.map F).map G := by diff --git a/Mathlib/CategoryTheory/Shift/ShiftedHomOpposite.lean b/Mathlib/CategoryTheory/Shift/ShiftedHomOpposite.lean index 23e2054b9f7b6b..3b103ff4af1389 100644 --- a/Mathlib/CategoryTheory/Shift/ShiftedHomOpposite.lean +++ b/Mathlib/CategoryTheory/Shift/ShiftedHomOpposite.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Triangulated.Opposite.Basic -import Mathlib.CategoryTheory.Shift.ShiftedHom +public import Mathlib.CategoryTheory.Triangulated.Opposite.Basic +public import Mathlib.CategoryTheory.Shift.ShiftedHom /-! Shifted morphisms in the opposite category @@ -20,6 +21,8 @@ in a pretriangulated category `C`. -/ +@[expose] public section + namespace CategoryTheory open Category Pretriangulated.Opposite Pretriangulated diff --git a/Mathlib/CategoryTheory/Shift/SingleFunctors.lean b/Mathlib/CategoryTheory/Shift/SingleFunctors.lean index 662c600c0da8ee..7b457b637bbe9c 100644 --- a/Mathlib/CategoryTheory/Shift/SingleFunctors.lean +++ b/Mathlib/CategoryTheory/Shift/SingleFunctors.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Shift.CommShift +module + +public import Mathlib.CategoryTheory.Shift.CommShift /-! # Functors from a category to a category with a shift @@ -25,6 +27,8 @@ which sends an object `X : C` to a complex where `X` sits in a single degree. -/ +@[expose] public section + open CategoryTheory Category ZeroObject Limits Functor variable (C D E E' : Type*) [Category C] [Category D] [Category E] [Category E'] diff --git a/Mathlib/CategoryTheory/Sigma/Basic.lean b/Mathlib/CategoryTheory/Sigma/Basic.lean index c816f6f1265a13..fb43d27f103eb9 100644 --- a/Mathlib/CategoryTheory/Sigma/Basic.lean +++ b/Mathlib/CategoryTheory/Sigma/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Whiskering -import Mathlib.CategoryTheory.Functor.FullyFaithful -import Mathlib.CategoryTheory.NatIso +module + +public import Mathlib.CategoryTheory.Whiskering +public import Mathlib.CategoryTheory.Functor.FullyFaithful +public import Mathlib.CategoryTheory.NatIso /-! # Disjoint union of categories @@ -13,6 +15,8 @@ import Mathlib.CategoryTheory.NatIso We define the category structure on a sigma-type (disjoint union) of categories. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Simple.lean b/Mathlib/CategoryTheory/Simple.lean index 97cce7648ca759..f5d5a61543dab2 100644 --- a/Mathlib/CategoryTheory/Simple.lean +++ b/Mathlib/CategoryTheory/Simple.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms -import Mathlib.CategoryTheory.Limits.Shapes.Kernels -import Mathlib.CategoryTheory.Abelian.Basic -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.Order.Atoms +module + +public import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms +public import Mathlib.CategoryTheory.Limits.Shapes.Kernels +public import Mathlib.CategoryTheory.Abelian.Basic +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.Order.Atoms /-! # Simple objects @@ -31,6 +33,8 @@ and any nonzero morphism into a simple object has trivial cokernel. We show that any simple object is indecomposable. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/SingleObj.lean b/Mathlib/CategoryTheory/SingleObj.lean index 47ffafb8beb33f..99203f8d286b28 100644 --- a/Mathlib/CategoryTheory/SingleObj.lean +++ b/Mathlib/CategoryTheory/SingleObj.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.Algebra.Category.MonCat.Basic -import Mathlib.Combinatorics.Quiver.SingleObj -import Mathlib.Algebra.Group.Units.Equiv +module + +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.Algebra.Category.MonCat.Basic +public import Mathlib.Combinatorics.Quiver.SingleObj +public import Mathlib.Algebra.Group.Units.Equiv /-! # Single-object category @@ -37,6 +39,8 @@ An element `x : M` can be reinterpreted as an element of `End (SingleObj.star M) `CategoryTheory.SingleObj`, so we give all names explicitly. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u v w diff --git a/Mathlib/CategoryTheory/Sites/Abelian.lean b/Mathlib/CategoryTheory/Sites/Abelian.lean index 5f9997debde44d..edfc6a7effd26f 100644 --- a/Mathlib/CategoryTheory/Sites/Abelian.lean +++ b/Mathlib/CategoryTheory/Sites/Abelian.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Jujian Zhang -/ -import Mathlib.CategoryTheory.Abelian.FunctorCategory -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Abelian.Transfer -import Mathlib.CategoryTheory.Sites.Limits +module + +public import Mathlib.CategoryTheory.Abelian.FunctorCategory +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Abelian.Transfer +public import Mathlib.CategoryTheory.Sites.Limits /-! # Category of sheaves is abelian @@ -17,6 +19,8 @@ Hence, `presheafToSheaf` is an additive functor (`presheafToSheaf_additive`). -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Sites/Adjunction.lean b/Mathlib/CategoryTheory/Sites/Adjunction.lean index 678c85c3a700d4..8a6d27fecdf6f8 100644 --- a/Mathlib/CategoryTheory/Sites/Adjunction.lean +++ b/Mathlib/CategoryTheory/Sites/Adjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Restrict -import Mathlib.CategoryTheory.Adjunction.Whiskering -import Mathlib.CategoryTheory.Sites.PreservesSheafification +module + +public import Mathlib.CategoryTheory.Adjunction.Restrict +public import Mathlib.CategoryTheory.Adjunction.Whiskering +public import Mathlib.CategoryTheory.Sites.PreservesSheafification /-! @@ -14,6 +16,8 @@ categories of sheaves. We also show that `G` preserves sheafification. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Canonical.lean b/Mathlib/CategoryTheory/Sites/Canonical.lean index c48d982896c053..38a05b0fa9e03d 100644 --- a/Mathlib/CategoryTheory/Sites/Canonical.lean +++ b/Mathlib/CategoryTheory/Sites/Canonical.lean @@ -3,7 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.Sheaf +module + +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # The canonical topology on a category @@ -31,8 +34,10 @@ equivalently it is subcanonical iff every representable presheaf is a sheaf. * https://math.stackexchange.com/a/358709/ -/ +@[expose] public section + -universe v u +universe w v u namespace CategoryTheory @@ -241,6 +246,14 @@ def yoneda [J.Subcanonical] : C ⥤ Sheaf J (Type v) where apply Subcanonical.isSheaf_of_isRepresentable⟩ map f := ⟨CategoryTheory.yoneda.map f⟩ +/-- Variant of the Yoneda embedding which allows a raise in the universe level +for the category of types. -/ +@[pp_with_univ, simps!] +def uliftYoneda [J.Subcanonical] : C ⥤ Sheaf J (Type max v w) := + J.yoneda ⋙ sheafCompose J uliftFunctor.{w} + +@[deprecated (since := "2025-11-10")] alias yonedaULift := uliftYoneda + variable [Subcanonical J] /-- diff --git a/Mathlib/CategoryTheory/Sites/CartesianClosed.lean b/Mathlib/CategoryTheory/Sites/CartesianClosed.lean index 1a5d6d9f2c4f97..60d109808dd726 100644 --- a/Mathlib/CategoryTheory/Sites/CartesianClosed.lean +++ b/Mathlib/CategoryTheory/Sites/CartesianClosed.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Closed.Ideal -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory -import Mathlib.CategoryTheory.Sites.CartesianMonoidal -import Mathlib.CategoryTheory.Sites.Sheafification +module + +public import Mathlib.CategoryTheory.Closed.Ideal +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +public import Mathlib.CategoryTheory.Sites.CartesianMonoidal +public import Mathlib.CategoryTheory.Sites.Sheafification /-! # Sheaf categories are Cartesian closed @@ -15,6 +17,8 @@ import Mathlib.CategoryTheory.Sites.Sheafification (chosen) finite products, and there exists a sheafification functor. -/ +@[expose] public section + noncomputable section open CategoryTheory Presheaf diff --git a/Mathlib/CategoryTheory/Sites/CartesianMonoidal.lean b/Mathlib/CategoryTheory/Sites/CartesianMonoidal.lean index 3d9f4b0e28dfd7..53caa80f131f47 100644 --- a/Mathlib/CategoryTheory/Sites/CartesianMonoidal.lean +++ b/Mathlib/CategoryTheory/Sites/CartesianMonoidal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory -import Mathlib.CategoryTheory.Sites.Limits +module + +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +public import Mathlib.CategoryTheory.Sites.Limits /-! # Chosen finite products on sheaves @@ -13,6 +15,8 @@ In this file, we put a `CartesianMonoidalCategory` instance on `A`-valued sheave `GrothendieckTopology` whenever `A` has a `CartesianMonoidalCategory` instance. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/ChosenFiniteProducts.lean b/Mathlib/CategoryTheory/Sites/ChosenFiniteProducts.lean index 07f5c67f0283a7..d4c28c145abaf9 100644 --- a/Mathlib/CategoryTheory/Sites/ChosenFiniteProducts.lean +++ b/Mathlib/CategoryTheory/Sites/ChosenFiniteProducts.lean @@ -1,4 +1,6 @@ -import Mathlib.CategoryTheory.Sites.Limits -import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory +module + +public import Mathlib.CategoryTheory.Sites.Limits +public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory deprecated_module (since := "2025-05-11") diff --git a/Mathlib/CategoryTheory/Sites/Closed.lean b/Mathlib/CategoryTheory/Sites/Closed.lean index 3a89591fb3042e..727cb57551beef 100644 --- a/Mathlib/CategoryTheory/Sites/Closed.lean +++ b/Mathlib/CategoryTheory/Sites/Closed.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.SheafOfTypes -import Mathlib.Order.Closure +module + +public import Mathlib.CategoryTheory.Sites.SheafOfTypes +public import Mathlib.Order.Closure /-! # Closed sieves @@ -44,6 +46,8 @@ closed sieve, closure, Grothendieck topology * [S. MacLane, I. Moerdijk, *Sheaves in Geometry and Logic*][MM92] -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Sites/Coherent/Basic.lean b/Mathlib/CategoryTheory/Sites/Coherent/Basic.lean index d19f53305f9b27..a32d13ed2775cd 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/Basic.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca -/ -import Mathlib.CategoryTheory.Extensive -import Mathlib.CategoryTheory.Sites.Coverage -import Mathlib.CategoryTheory.EffectiveEpi.Basic +module + +public import Mathlib.CategoryTheory.Extensive +public import Mathlib.CategoryTheory.Sites.Coverage +public import Mathlib.CategoryTheory.EffectiveEpi.Basic /-! # The Coherent, Regular and Extensive Grothendieck Topologies @@ -39,6 +41,8 @@ from the coproduct to the target. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Sites/Coherent/CoherentSheaves.lean b/Mathlib/CategoryTheory/Sites/Coherent/CoherentSheaves.lean index 3ebbc093655965..7cf343362d4487 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/CoherentSheaves.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/CoherentSheaves.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Canonical -import Mathlib.CategoryTheory.Sites.Coherent.Basic -import Mathlib.CategoryTheory.Sites.EffectiveEpimorphic +module + +public import Mathlib.CategoryTheory.Sites.Canonical +public import Mathlib.CategoryTheory.Sites.Coherent.Basic +public import Mathlib.CategoryTheory.Sites.EffectiveEpimorphic /-! # Sheaves for the coherent topology @@ -19,6 +21,8 @@ This file characterises sheaves for the coherent topology effective epimorphic family. -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] [Precoherent C] diff --git a/Mathlib/CategoryTheory/Sites/Coherent/CoherentTopology.lean b/Mathlib/CategoryTheory/Sites/Coherent/CoherentTopology.lean index 58b3cf6c0432ae..8d456061763d4f 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/CoherentTopology.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/CoherentTopology.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Nikolas Kuhn -/ -import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves -import Mathlib.Data.Finite.Sigma +module + +public import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves +public import Mathlib.Data.Finite.Sigma /-! # Description of the covering sieves of the coherent topology @@ -18,6 +20,8 @@ This file characterises the covering sieves of the coherent topology. -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] [Precoherent C] {X : C} diff --git a/Mathlib/CategoryTheory/Sites/Coherent/Comparison.lean b/Mathlib/CategoryTheory/Sites/Coherent/Comparison.lean index 36cd316574b556..d91192c0315eda 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/Comparison.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/Comparison.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.Basic -import Mathlib.CategoryTheory.EffectiveEpi.Comp -import Mathlib.CategoryTheory.EffectiveEpi.Extensive +module + +public import Mathlib.CategoryTheory.Sites.Coherent.Basic +public import Mathlib.CategoryTheory.EffectiveEpi.Comp +public import Mathlib.CategoryTheory.EffectiveEpi.Extensive /-! # Connections between the regular, extensive and coherent topologies @@ -20,6 +22,8 @@ This file compares the regular, extensive and coherent topologies. generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular. -/ +@[expose] public section + namespace CategoryTheory open Limits GrothendieckTopology Sieve diff --git a/Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean b/Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean index b8cb9cbef069e1..d9e5fb67e2522d 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison -import Mathlib.CategoryTheory.Sites.Equivalence +module + +public import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison +public import Mathlib.CategoryTheory.Sites.Equivalence /-! # Coherence and equivalence of categories @@ -13,6 +15,8 @@ This file proves that the coherent and regular topologies transfer nicely along categories. -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] diff --git a/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveColimits.lean b/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveColimits.lean index 6461e1b24938c5..035e50b2923309 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveColimits.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveColimits.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Preadditive.Biproducts -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveSheaves -import Mathlib.CategoryTheory.Sites.Limits +module + +public import Mathlib.CategoryTheory.Preadditive.Biproducts +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveSheaves +public import Mathlib.CategoryTheory.Sites.Limits /-! # Colimits in categories of extensive sheaves @@ -19,6 +21,8 @@ This can also easily be applied to filtered `J` in the case when `A` is a catego eventually to sifted `J` once that API is developed. -/ +@[expose] public section + namespace CategoryTheory open Limits Sheaf GrothendieckTopology Opposite diff --git a/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean b/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean index d73b2562568c57..5194380708713f 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca -/ -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Sites.Canonical -import Mathlib.CategoryTheory.Sites.Coherent.Basic -import Mathlib.CategoryTheory.Sites.Preserves +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Sites.Canonical +public import Mathlib.CategoryTheory.Sites.Coherent.Basic +public import Mathlib.CategoryTheory.Sites.Preserves /-! # Sheaves for the extensive topology @@ -19,6 +21,8 @@ This file characterises sheaves for the extensive topology. extensive topology are precisely those preserving finite products. -/ +@[expose] public section + universe w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveTopology.lean b/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveTopology.lean index 129318abaa8713..c59574a962f595 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveTopology.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/ExtensiveTopology.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.Basic -import Mathlib.Data.Finite.Sigma +module + +public import Mathlib.CategoryTheory.Sites.Coherent.Basic +public import Mathlib.Data.Finite.Sigma /-! # Description of the covering sieves of the extensive topology @@ -18,6 +20,8 @@ This file characterises the covering sieves of the extensive topology. exhibiting the target as a coproduct of the sources. -/ +@[expose] public section + open CategoryTheory Limits variable {C : Type*} [Category C] [FinitaryPreExtensive C] diff --git a/Mathlib/CategoryTheory/Sites/Coherent/LocallySurjective.lean b/Mathlib/CategoryTheory/Sites/Coherent/LocallySurjective.lean index bd8fd66d94ac3a..543576ea843b5e 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/LocallySurjective.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/LocallySurjective.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveTopology -import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison -import Mathlib.CategoryTheory.Sites.LocallySurjective +module + +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveTopology +public import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison +public import Mathlib.CategoryTheory.Sites.LocallySurjective /-! # Locally surjective morphisms of coherent sheaves @@ -27,6 +29,8 @@ and extensive topologies. finitary extensive category is locally surjective iff it is objectwise surjective. -/ +@[expose] public section + universe w open CategoryTheory Sheaf Limits Opposite diff --git a/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPrecoherent.lean b/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPrecoherent.lean index 54bc130f05abbb..83dfd3fdb01e17 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPrecoherent.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPrecoherent.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Enough -import Mathlib.CategoryTheory.EffectiveEpi.Preserves -import Mathlib.CategoryTheory.Sites.Coherent.CoherentTopology +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Enough +public import Mathlib.CategoryTheory.EffectiveEpi.Preserves +public import Mathlib.CategoryTheory.Sites.Coherent.CoherentTopology /-! # Reflecting the property of being precoherent @@ -15,6 +17,8 @@ effective epimorphic families, such that for every object `X` of `D` there exist `C` with an effective epi `π : F.obj W ⟶ X`, the category `C` is `Precoherent` whenever `D` is. -/ +@[expose] public section + namespace CategoryTheory variable {C D : Type*} [Category C] [Category D] (F : C ⥤ D) diff --git a/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPreregular.lean b/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPreregular.lean index 58eef6dd8e4c38..34aa2387be44f6 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPreregular.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/ReflectsPreregular.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.EffectiveEpi.Enough -import Mathlib.CategoryTheory.EffectiveEpi.Preserves -import Mathlib.CategoryTheory.Sites.Coherent.RegularTopology +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Enough +public import Mathlib.CategoryTheory.EffectiveEpi.Preserves +public import Mathlib.CategoryTheory.Sites.Coherent.RegularTopology /-! # Reflecting the property of being preregular @@ -15,6 +17,8 @@ object `X` of `D` there exists an object `W` of `C` with an effective epi `π : category `C` is `Preregular`. -/ +@[expose] public section + namespace CategoryTheory variable {C D : Type*} [Category C] [Category D] (F : C ⥤ D) diff --git a/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean b/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean index 3e1cc2354100ac..aa6facac0cd70e 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca -/ -import Mathlib.CategoryTheory.EffectiveEpi.Preserves -import Mathlib.CategoryTheory.Limits.Final.ParallelPair -import Mathlib.CategoryTheory.Preadditive.Projective.Basic -import Mathlib.CategoryTheory.Sites.Canonical -import Mathlib.CategoryTheory.Sites.Coherent.Basic -import Mathlib.CategoryTheory.Sites.EffectiveEpimorphic +module + +public import Mathlib.CategoryTheory.EffectiveEpi.Preserves +public import Mathlib.CategoryTheory.Limits.Final.ParallelPair +public import Mathlib.CategoryTheory.Preadditive.Projective.Basic +public import Mathlib.CategoryTheory.Sites.Canonical +public import Mathlib.CategoryTheory.Sites.Coherent.Basic +public import Mathlib.CategoryTheory.Sites.EffectiveEpimorphic /-! # Sheaves for the regular topology @@ -25,6 +27,8 @@ This file characterises sheaves for the regular topology. presheaf is a sheaf for the regular topology. -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Sites/Coherent/RegularTopology.lean b/Mathlib/CategoryTheory/Sites/Coherent/RegularTopology.lean index 0aaecb81cc3084..252fb6a59122f4 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/RegularTopology.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/RegularTopology.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.RegularSheaves +module + +public import Mathlib.CategoryTheory.Sites.Coherent.RegularSheaves /-! # Description of the covering sieves of the regular topology @@ -16,6 +18,8 @@ This file characterises the covering sieves of the regular topology. regular topology if and only if it contains an effective epi. -/ +@[expose] public section + namespace CategoryTheory.regularTopology open Limits diff --git a/Mathlib/CategoryTheory/Sites/Coherent/SequentialLimit.lean b/Mathlib/CategoryTheory/Sites/Coherent/SequentialLimit.lean index 029ffebbcbd38f..b6c0b24b2faea4 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/SequentialLimit.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/SequentialLimit.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Functor.OfSequence -import Mathlib.CategoryTheory.Sites.Coherent.LocallySurjective -import Mathlib.CategoryTheory.Sites.EpiMono -import Mathlib.CategoryTheory.Sites.Subcanonical +module + +public import Mathlib.CategoryTheory.Functor.OfSequence +public import Mathlib.CategoryTheory.Sites.Coherent.LocallySurjective +public import Mathlib.CategoryTheory.Sites.EpiMono +public import Mathlib.CategoryTheory.Sites.Subcanonical /-! # Limits of epimorphisms in coherent topoi @@ -25,6 +27,8 @@ This is deduced from the corresponding statement about locally surjective morphi (see `coherentTopology.isLocallySurjective_π_app_zero_of_isLocallySurjective_map`). -/ +@[expose] public section + universe w v u open CategoryTheory Limits Opposite diff --git a/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean b/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean index 7b0f66b36d43ed..d7810f8ae20339 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.Comparison -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveSheaves -import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPrecoherent -import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular -import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology -import Mathlib.CategoryTheory.Sites.Whiskering +module + +public import Mathlib.CategoryTheory.Sites.Coherent.Comparison +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveSheaves +public import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPrecoherent +public import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular +public import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # Categories of coherent sheaves @@ -26,6 +28,8 @@ We give the corresponding result for the regular topology as well (see `CategoryTheory.regularTopology.equivalence`). -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ diff --git a/Mathlib/CategoryTheory/Sites/CompatiblePlus.lean b/Mathlib/CategoryTheory/Sites/CompatiblePlus.lean index a28f8dd41d62d9..b282b337680ac5 100644 --- a/Mathlib/CategoryTheory/Sites/CompatiblePlus.lean +++ b/Mathlib/CategoryTheory/Sites/CompatiblePlus.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Whiskering -import Mathlib.CategoryTheory.Sites.Plus +module + +public import Mathlib.CategoryTheory.Sites.Whiskering +public import Mathlib.CategoryTheory.Sites.Plus /-! @@ -16,6 +18,8 @@ of sheafification, which follows easily from the content in this file. -/ +@[expose] public section + noncomputable section namespace CategoryTheory.GrothendieckTopology diff --git a/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean b/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean index 6bb0017512fda6..a68684a7291c25 100644 --- a/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.CompatiblePlus -import Mathlib.CategoryTheory.Sites.ConcreteSheafification +module + +public import Mathlib.CategoryTheory.Sites.CompatiblePlus +public import Mathlib.CategoryTheory.Sites.ConcreteSheafification /-! @@ -13,6 +15,8 @@ preserve the correct limits and colimits. -/ +@[expose] public section + namespace CategoryTheory.GrothendieckTopology diff --git a/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean b/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean index 2d605ecb4e35fb..63a82682aa8f2b 100644 --- a/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Plus -import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory +module + +public import Mathlib.CategoryTheory.Sites.Plus +public import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory /-! @@ -18,6 +20,8 @@ We generally follow the approach of https://stacks.math.columbia.edu/tag/00W1 -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/ConstantSheaf.lean b/Mathlib/CategoryTheory/Sites/ConstantSheaf.lean index 18c84612a007b7..63d589647a9de1 100644 --- a/Mathlib/CategoryTheory/Sites/ConstantSheaf.lean +++ b/Mathlib/CategoryTheory/Sites/ConstantSheaf.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Sheafification -import Mathlib.CategoryTheory.Sites.DenseSubsite.SheafEquiv +module + +public import Mathlib.CategoryTheory.Sites.Sheafification +public import Mathlib.CategoryTheory.Sites.DenseSubsite.SheafEquiv /-! # The constant sheaf @@ -29,6 +31,8 @@ essential image of the constant sheaf functor. constant if and only if the sheaf given by postcomposition with `U` is constant. -/ +@[expose] public section + namespace CategoryTheory open Limits Opposite Category Functor Sheaf Adjunction diff --git a/Mathlib/CategoryTheory/Sites/Continuous.lean b/Mathlib/CategoryTheory/Sites/Continuous.lean index 64d79feaad9088..66ff8b8cd8f022 100644 --- a/Mathlib/CategoryTheory/Sites/Continuous.lean +++ b/Mathlib/CategoryTheory/Sites/Continuous.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Andrew Yang -/ -import Mathlib.CategoryTheory.Sites.Hypercover.IsSheaf +module + +public import Mathlib.CategoryTheory.Sites.Hypercover.IsSheaf /-! # Continuous functors between sites. @@ -38,6 +40,8 @@ category). -/ +@[expose] public section + universe w t v₁ v₂ v₃ u₁ u₂ u₃ u namespace CategoryTheory @@ -104,8 +108,10 @@ end GrothendieckTopology namespace Functor -variable (F : C ⥤ D) {A : Type u} [Category.{t} A] - (J : GrothendieckTopology C) (K : GrothendieckTopology D) +variable (F F' : C ⥤ D) (τ : F ⟶ F') (e : F ≅ F') (G : D ⥤ E) + {F'' : C ⥤ C} (eF'' : F'' ≅ 𝟭 C) {FG : C ⥤ E} (eFG : F ⋙ G ≅ FG) + {A : Type u} [Category.{t} A] + (J : GrothendieckTopology C) (K : GrothendieckTopology D) (L : GrothendieckTopology E) /-- The condition that a functor `F : C ⥤ D` sends 1-hypercovers for `J : GrothendieckTopology C` to 1-hypercovers for `K : GrothendieckTopology D`. -/ @@ -194,6 +200,57 @@ def sheafPushforwardContinuousCompSheafToPresheafIso : F.sheafPushforwardContinuous A J K ⋙ sheafToPresheaf J A ≅ sheafToPresheaf K A ⋙ (whiskeringLeft _ _ _).obj F.op := Iso.refl _ +/-- The functor `sheafPushforwardContinuous` corresponding to the identity functor +identifies to the identity functor. -/ +@[simps!] +def sheafPushforwardContinuousId : + sheafPushforwardContinuous (𝟭 C) A J J ≅ 𝟭 _ := Iso.refl _ + +/-- The composition of two pushforward functors on sheaves identifies to +the pushforward for the composition of the two functors. -/ +@[simps!] +def sheafPushforwardContinuousComp [IsContinuous.{t} G K L] : + letI := isContinuous_comp F G J K L + sheafPushforwardContinuous G A K L ⋙ sheafPushforwardContinuous F A J K ≅ + sheafPushforwardContinuous (F ⋙ G) A J L := Iso.refl _ + +variable {F F'} in +/-- The action of a natural transformation on pushforward functors of sheaves. -/ +@[simps] +def sheafPushforwardContinuousNatTrans [IsContinuous.{t} F' J K] : + sheafPushforwardContinuous F' A J K ⟶ sheafPushforwardContinuous F A J K where + app M := ⟨whiskerRight (NatTrans.op τ) _⟩ + +variable {F F'} in +/-- The action of a natural isomorphism on pushforward functors of sheaves. -/ +@[simps] +def sheafPushforwardContinuousIso [IsContinuous.{t} F' J K] : + sheafPushforwardContinuous F A J K ≅ sheafPushforwardContinuous F' A J K where + hom := sheafPushforwardContinuousNatTrans e.inv _ _ _ + inv := sheafPushforwardContinuousNatTrans e.hom _ _ _ + hom_inv_id := by ext; simp [← Functor.map_comp, ← op_comp] + inv_hom_id := by ext; simp [← Functor.map_comp, ← op_comp] + +/-- If a continuous functor between sites is isomorphic to the identity functor, +then the corresponding pushforward functor on sheaves identifies to the +identity functor. -/ +@[simps!] +def sheafPushforwardContinuousId' [IsContinuous.{t} F'' J J] : + sheafPushforwardContinuous F'' A J J ≅ 𝟭 _ := + sheafPushforwardContinuousIso eF'' _ _ _ ≪≫ sheafPushforwardContinuousId _ _ + +variable {F G} in +/-- When we have an isomorphism `F ⋙ G ≅ FG` between continuous functors +between sites, the composition of the pushforward functors for +`G` and `F` identifies to the pushforward functor for `FG`. -/ +@[simps!] +def sheafPushforwardContinuousComp' + [IsContinuous.{t} G K L] [IsContinuous.{t} FG J L] : + sheafPushforwardContinuous G A K L ⋙ sheafPushforwardContinuous F A J K ≅ + sheafPushforwardContinuous FG A J L := + letI := isContinuous_comp F G J K L + sheafPushforwardContinuousComp _ _ _ _ _ _ ≪≫ sheafPushforwardContinuousIso eFG _ _ _ + end Functor end CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/CoverLifting.lean b/Mathlib/CategoryTheory/Sites/CoverLifting.lean index 3e762c4999521f..2f81588f56b61b 100644 --- a/Mathlib/CategoryTheory/Sites/CoverLifting.lean +++ b/Mathlib/CategoryTheory/Sites/CoverLifting.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Joël Riou -/ -import Mathlib.CategoryTheory.Adjunction.Restrict -import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction -import Mathlib.CategoryTheory.Sites.Continuous -import Mathlib.CategoryTheory.Sites.Sheafification +module + +public import Mathlib.CategoryTheory.Adjunction.Restrict +public import Mathlib.CategoryTheory.Functor.KanExtension.Adjunction +public import Mathlib.CategoryTheory.Sites.Continuous +public import Mathlib.CategoryTheory.Sites.Sheafification /-! # Cocontinuous functors between sites. @@ -40,6 +42,8 @@ small colimits. -/ +@[expose] public section + universe w' w v v₁ v₂ v₃ u u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Sites/CoverPreserving.lean b/Mathlib/CategoryTheory/Sites/CoverPreserving.lean index c0d478a4e4b88d..619fbc53b9928b 100644 --- a/Mathlib/CategoryTheory/Sites/CoverPreserving.lean +++ b/Mathlib/CategoryTheory/Sites/CoverPreserving.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Functor.Flat -import Mathlib.CategoryTheory.Sites.Continuous -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.CategoryTheory.Functor.Flat +public import Mathlib.CategoryTheory.Sites.Continuous +public import Mathlib.Tactic.ApplyFun /-! # Cover-preserving functors between sites. @@ -33,6 +35,8 @@ i.e. `G.op ⋙ -` as a functor `(Dᵒᵖ ⥤ A) ⥤ (Cᵒᵖ ⥤ A)` of presheav -/ +@[expose] public section + universe w v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Sites/Coverage.lean b/Mathlib/CategoryTheory/Sites/Coverage.lean index 6b0e65a4f37743..ef5a7a645145f7 100644 --- a/Mathlib/CategoryTheory/Sites/Coverage.lean +++ b/Mathlib/CategoryTheory/Sites/Coverage.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Precoverage -import Mathlib.CategoryTheory.Sites.Sheaf +module + +public import Mathlib.CategoryTheory.Sites.Precoverage +public import Mathlib.CategoryTheory.Sites.Sheaf /-! @@ -46,6 +48,8 @@ the following sources: - [nLab, *Coverage*](https://ncatlab.org/nlab/show/coverage) -/ +@[expose] public section + namespace CategoryTheory universe w w' diff --git a/Mathlib/CategoryTheory/Sites/CoversTop.lean b/Mathlib/CategoryTheory/Sites/CoversTop.lean index facff40d2ef86e..0851369e91c959 100644 --- a/Mathlib/CategoryTheory/Sites/CoversTop.lean +++ b/Mathlib/CategoryTheory/Sites/CoversTop.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.Sheaf +module + +public import Mathlib.CategoryTheory.Sites.Sheaf /-! Objects which cover the terminal object @@ -21,6 +23,8 @@ a section of this presheaf. -/ +@[expose] public section + universe w v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean b/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean index 2f5dd34407182f..da877baa0ef32c 100644 --- a/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean +++ b/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.CategoryTheory.Sites.CoverLifting -import Mathlib.CategoryTheory.Sites.CoverPreserving -import Mathlib.CategoryTheory.Adjunction.FullyFaithful -import Mathlib.CategoryTheory.Sites.LocallyFullyFaithful +module + +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.CategoryTheory.Sites.CoverLifting +public import Mathlib.CategoryTheory.Sites.CoverPreserving +public import Mathlib.CategoryTheory.Adjunction.FullyFaithful +public import Mathlib.CategoryTheory.Sites.LocallyFullyFaithful /-! # Dense subsites @@ -38,6 +40,8 @@ that factors through images of the functor for each object in `D`. -/ +@[expose] public section + universe w v u namespace CategoryTheory @@ -473,7 +477,7 @@ instance faithful_sheafPushforwardContinuous [G.IsContinuous J K] : end IsCoverDense /-- If `G : C ⥤ D` is cover dense and full, then the -map `(P ⟶ Q) → (G.op ⋙ P ⟶ G.op ⋙ Q)` is bijective when `Q` is a sheaf`. -/ +map `(P ⟶ Q) → (G.op ⋙ P ⟶ G.op ⋙ Q)` is bijective when `Q` is a sheaf. -/ lemma whiskerLeft_obj_map_bijective_of_isCoverDense (G : C ⥤ D) [G.IsCoverDense K] [G.IsLocallyFull K] {A : Type*} [Category A] (P Q : Dᵒᵖ ⥤ A) (hQ : Presheaf.IsSheaf K Q) : diff --git a/Mathlib/CategoryTheory/Sites/DenseSubsite/InducedTopology.lean b/Mathlib/CategoryTheory/Sites/DenseSubsite/InducedTopology.lean index f394e90f15e28b..b7fd89a08d1bd0 100644 --- a/Mathlib/CategoryTheory/Sites/DenseSubsite/InducedTopology.lean +++ b/Mathlib/CategoryTheory/Sites/DenseSubsite/InducedTopology.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Sites.DenseSubsite.SheafEquiv +module + +public import Mathlib.CategoryTheory.Sites.DenseSubsite.SheafEquiv /-! # Induced Topology @@ -29,6 +31,8 @@ Given a fully faithful cover-dense functor `G : C ⥤ (D, K)` between small site -/ +@[expose] public section + namespace CategoryTheory universe v u diff --git a/Mathlib/CategoryTheory/Sites/DenseSubsite/SheafEquiv.lean b/Mathlib/CategoryTheory/Sites/DenseSubsite/SheafEquiv.lean index 4c4b3e30736e3c..9e3d62f89d0629 100644 --- a/Mathlib/CategoryTheory/Sites/DenseSubsite/SheafEquiv.lean +++ b/Mathlib/CategoryTheory/Sites/DenseSubsite/SheafEquiv.lean @@ -3,8 +3,9 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ +module -import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic +public import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic /-! # The equivalence of categories of sheaves of a dense subsite @@ -21,6 +22,8 @@ import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic -/ +@[expose] public section + universe w v u w' namespace CategoryTheory.Functor.IsDenseSubsite @@ -49,8 +52,7 @@ lemma isIso_ranCounit_app_of_isDenseSubsite (Y : Sheaf J A) (U X) : simp only [comp_obj, yoneda_map_app, Category.assoc, comp_map, ← NatTrans.naturality, op_obj, op_map, Quiver.Hom.unop_op, ← map_comp_assoc, ← op_comp, ← e'] at this ⊢ - erw [← NatTrans.naturality] at this - exact this + simpa [← NatTrans.naturality] using this · intro f have (X Y Z) (f : X ⟶ Y) (g : G.obj Y ⟶ G.obj Z) (hf : G.imageSieve g f) : Exists _ := hf choose l hl using this diff --git a/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean b/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean index 61769c5af0c303..26a0fe9589dd1e 100644 --- a/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean +++ b/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Christian Merten -/ -import Mathlib.CategoryTheory.Bicategory.Functor.Cat -import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete -import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.CategoryTheory.Sites.Over +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.Cat +public import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete +public import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.CategoryTheory.Sites.Over /-! # Prestacks: descent of morphisms @@ -45,6 +47,8 @@ by saying that the functors mentioned above are essentially surjective. -/ +@[expose] public section + universe v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/EffectiveEpimorphic.lean b/Mathlib/CategoryTheory/Sites/EffectiveEpimorphic.lean index 3167d314393ef8..e90b4ad9ac7428 100644 --- a/Mathlib/CategoryTheory/Sites/EffectiveEpimorphic.lean +++ b/Mathlib/CategoryTheory/Sites/EffectiveEpimorphic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Sieves -import Mathlib.CategoryTheory.EffectiveEpi.Basic +module + +public import Mathlib.CategoryTheory.Sites.Sieves +public import Mathlib.CategoryTheory.EffectiveEpi.Basic /-! # Effective epimorphic sieves @@ -19,6 +21,8 @@ The analogous statement for a family of morphisms is in the theorem -/ +@[expose] public section + namespace CategoryTheory open Limits diff --git a/Mathlib/CategoryTheory/Sites/EpiMono.lean b/Mathlib/CategoryTheory/Sites/EpiMono.lean index 02a91121121a14..9336dc10049ff1 100644 --- a/Mathlib/CategoryTheory/Sites/EpiMono.lean +++ b/Mathlib/CategoryTheory/Sites/EpiMono.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.MorphismProperty.Concrete -import Mathlib.CategoryTheory.Sites.LocallyBijective +module + +public import Mathlib.CategoryTheory.MorphismProperty.Concrete +public import Mathlib.CategoryTheory.Sites.LocallyBijective /-! # Morphisms of sheaves factor as a locally surjective followed by a locally injective morphism @@ -19,6 +21,8 @@ Moreover, if we assume that the category of sheaves `Sheaf J A` is balanced -/ +@[expose] public section + universe w v' u' v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean b/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean index 5a95aff9eb5a19..8f007429c431cf 100644 --- a/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean +++ b/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean @@ -3,9 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.IsSheafFor -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.CategoryTheory.Limits.Types.Equalizers +public import Mathlib.CategoryTheory.Limits.Types.Products +public import Mathlib.CategoryTheory.Sites.IsSheafFor +public import Mathlib.Tactic.ApplyFun /-! # The equalizer diagram sheaf condition for a presieve @@ -29,6 +32,8 @@ equalizer diagrams. -/ +@[expose] public section + universe t w v u diff --git a/Mathlib/CategoryTheory/Sites/Equivalence.lean b/Mathlib/CategoryTheory/Sites/Equivalence.lean index 9be6073a58fa7d..0b89c56cd0c473 100644 --- a/Mathlib/CategoryTheory/Sites/Equivalence.lean +++ b/Mathlib/CategoryTheory/Sites/Equivalence.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology -import Mathlib.CategoryTheory.Sites.LocallyBijective -import Mathlib.CategoryTheory.Sites.PreservesLocallyBijective -import Mathlib.CategoryTheory.Sites.Whiskering +module + +public import Mathlib.CategoryTheory.Sites.DenseSubsite.InducedTopology +public import Mathlib.CategoryTheory.Sites.LocallyBijective +public import Mathlib.CategoryTheory.Sites.PreservesLocallyBijective +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # Equivalences of sheaf categories @@ -36,6 +38,8 @@ sufficiently small limits in the sheaf category on the essentially small site. -/ +@[expose] public section + universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Finite.lean b/Mathlib/CategoryTheory/Sites/Finite.lean index 500847796be102..e6a46cf3c6821c 100644 --- a/Mathlib/CategoryTheory/Sites/Finite.lean +++ b/Mathlib/CategoryTheory/Sites/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.CategoryTheory.Sites.Pretopology -import Mathlib.Data.Set.Finite.Lattice +module + +public import Mathlib.CategoryTheory.Sites.Pretopology +public import Mathlib.Data.Set.Finite.Lattice /-! # The Finite Pretopology @@ -17,6 +19,8 @@ contain only finitely many arrows. - `CategoryTheory.Pretopology.finite`: The finite pretopology on a category. -/ +@[expose] public section + universe v v₁ u u₁ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/GlobalSections.lean b/Mathlib/CategoryTheory/Sites/GlobalSections.lean index 9fb30c38b48386..5cf132535223f4 100644 --- a/Mathlib/CategoryTheory/Sites/GlobalSections.lean +++ b/Mathlib/CategoryTheory/Sites/GlobalSections.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Ben Eltschig. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ben Eltschig -/ -import Mathlib.CategoryTheory.Sites.ConstantSheaf +module + +public import Mathlib.CategoryTheory.Sites.ConstantSheaf /-! # Global sections of sheaves @@ -42,6 +44,8 @@ on a terminal object and `Functor.sectionsFunctor`. -/ +@[expose] public section + universe u v w u₂ v₂ open CategoryTheory Limits Sheaf Opposite GrothendieckTopology diff --git a/Mathlib/CategoryTheory/Sites/Grothendieck.lean b/Mathlib/CategoryTheory/Sites/Grothendieck.lean index 5fdbc7aff8a8f2..64e1af1ff4dce6 100644 --- a/Mathlib/CategoryTheory/Sites/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Sites/Grothendieck.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Bhavik Mehta, Edward Ayers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Edward Ayers -/ -import Mathlib.CategoryTheory.Sites.Sieves -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.Order.Copy -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.CategoryTheory.Sites.Sieves +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.Order.Copy +public import Mathlib.Data.Set.Subsingleton /-! # Grothendieck topologies @@ -49,6 +51,8 @@ small category and Lawvere-Tierney topologies on its presheaf topos, as well as between Grothendieck topoi and left exact reflective subcategories of presheaf toposes. -/ +@[expose] public section + universe v₁ u₁ v u diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean b/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean index 639780fa1be1f9..a4701b0388e4ff 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Quotient -import Mathlib.CategoryTheory.Sites.Hypercover.One -import Mathlib.CategoryTheory.Filtered.Basic +module + +public import Mathlib.CategoryTheory.Quotient +public import Mathlib.CategoryTheory.Sites.Hypercover.One +public import Mathlib.CategoryTheory.Filtered.Basic /-! # The category of `1`-hypercovers up to homotopy @@ -26,6 +28,8 @@ In this file we define the category of `1`-hypercovers up to homotopy. This is t category of `1`-hypercovers up to homotopy is cofiltered if `C` has pullbacks. -/ +@[expose] public section + universe w'' w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean b/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean index 147b0a11333758..f4ab21681399bd 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.Hypercover.One +module + +public import Mathlib.CategoryTheory.Sites.Hypercover.One /-! # Characterization of sheaves using 1-hypercovers @@ -32,6 +34,8 @@ that if `C : Type u` and `Category.{v} C`, then -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/One.lean b/Mathlib/CategoryTheory/Sites/Hypercover/One.lean index eb26ba44ad4fd6..97c098eb8a426e 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/One.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/One.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.Coverage -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.CategoryTheory.Sites.Hypercover.Zero +module + +public import Mathlib.CategoryTheory.Sites.Coverage +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.CategoryTheory.Sites.Hypercover.Zero /-! # 1-hypercovers @@ -24,6 +26,8 @@ identifies to the multiequalizer of suitable maps -/ +@[expose] public section + universe w'' w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean b/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean index d10baac9346f3a..5abd6f27bebff7 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Sites.Precoverage +module + +public import Mathlib.CategoryTheory.Sites.Precoverage /-! # 0-hypercovers @@ -16,6 +18,8 @@ We define this with respect to a coverage and not to a Grothendieck topology, be yields more control over the components of the cover. -/ +@[expose] public section + universe w'' w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/ZeroFamily.lean b/Mathlib/CategoryTheory/Sites/Hypercover/ZeroFamily.lean index 91aad51a676cb1..32c06bc5630fd5 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/ZeroFamily.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/ZeroFamily.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Sites.Hypercover.Zero +module + +public import Mathlib.CategoryTheory.Sites.Hypercover.Zero /-! # Defining precoverages via pre-`0`-hypercovers @@ -14,6 +16,8 @@ for every object is a pre-`0`-hypercover family if these conditions are invariant under deduplication. -/ +@[expose] public section + universe w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/IsSheafFor.lean b/Mathlib/CategoryTheory/Sites/IsSheafFor.lean index 0dcdb333e2b9ef..efd906d28509c4 100644 --- a/Mathlib/CategoryTheory/Sites/IsSheafFor.lean +++ b/Mathlib/CategoryTheory/Sites/IsSheafFor.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.Sieves -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono +module + +public import Mathlib.CategoryTheory.Sites.Sieves +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono /-! # The sheaf condition for a presieve @@ -64,6 +66,8 @@ which can be convenient. -/ +@[expose] public section + universe w w' v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Sites/JointlySurjective.lean b/Mathlib/CategoryTheory/Sites/JointlySurjective.lean index d5f5f6b6026c84..5a3122105cbc81 100644 --- a/Mathlib/CategoryTheory/Sites/JointlySurjective.lean +++ b/Mathlib/CategoryTheory/Sites/JointlySurjective.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Sites.Precoverage -import Mathlib.CategoryTheory.Limits.Types.Pullbacks +module + +public import Mathlib.CategoryTheory.Sites.Precoverage +public import Mathlib.CategoryTheory.Limits.Types.Pullbacks /-! # The jointly surjective precoverage @@ -18,6 +20,8 @@ See `Mathlib/CategoryTheory/Sites/Types.lean` for the Grothendieck topology of j covers. -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/LeftExact.lean b/Mathlib/CategoryTheory/Sites/LeftExact.lean index 341934a7fccd78..4cd94f0cb959ec 100644 --- a/Mathlib/CategoryTheory/Sites/LeftExact.lean +++ b/Mathlib/CategoryTheory/Sites/LeftExact.lean @@ -3,16 +3,20 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Limits -import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit -import Mathlib.CategoryTheory.Adhesive -import Mathlib.CategoryTheory.Sites.ConcreteSheafification +module + +public import Mathlib.CategoryTheory.Sites.Limits +public import Mathlib.CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit +public import Mathlib.CategoryTheory.Adhesive +public import Mathlib.CategoryTheory.Sites.ConcreteSheafification /-! # Left exactness of sheafification In this file we show that sheafification commutes with finite limits. -/ +@[expose] public section + open CategoryTheory Limits Opposite diff --git a/Mathlib/CategoryTheory/Sites/Limits.lean b/Mathlib/CategoryTheory/Sites/Limits.lean index 5d65b6842a42ea..449110dcebbde0 100644 --- a/Mathlib/CategoryTheory/Sites/Limits.lean +++ b/Mathlib/CategoryTheory/Sites/Limits.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Limits.Creates -import Mathlib.CategoryTheory.Sites.Sheafification -import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts +module + +public import Mathlib.CategoryTheory.Limits.Creates +public import Mathlib.CategoryTheory.Sites.Sheafification +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts /-! @@ -27,6 +29,8 @@ This allows us to show that `Sheaf J D` has colimits (of a certain shape) as soo -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Localization.lean b/Mathlib/CategoryTheory/Sites/Localization.lean index af7c51ac5104ef..bee36d7c7d8883 100644 --- a/Mathlib/CategoryTheory/Sites/Localization.lean +++ b/Mathlib/CategoryTheory/Sites/Localization.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.Bousfield -import Mathlib.CategoryTheory.Sites.Sheafification +module + +public import Mathlib.CategoryTheory.Localization.Bousfield +public import Mathlib.CategoryTheory.Sites.Sheafification /-! # The sheaf category as a localized category @@ -15,6 +17,8 @@ of presheaves which become isomorphisms after applying the sheafification functo -/ +@[expose] public section + namespace CategoryTheory open Localization diff --git a/Mathlib/CategoryTheory/Sites/LocallyBijective.lean b/Mathlib/CategoryTheory/Sites/LocallyBijective.lean index aa8ce43f4d887b..f969a410fe7b46 100644 --- a/Mathlib/CategoryTheory/Sites/LocallyBijective.lean +++ b/Mathlib/CategoryTheory/Sites/LocallyBijective.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.LocallySurjective -import Mathlib.CategoryTheory.Sites.Localization +module + +public import Mathlib.CategoryTheory.Sites.LocallySurjective +public import Mathlib.CategoryTheory.Sites.Localization /-! # Locally bijective morphisms of presheaves @@ -20,6 +22,8 @@ We show that this holds under certain universe assumptions. -/ +@[expose] public section + universe w' w v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/LocallyFullyFaithful.lean b/Mathlib/CategoryTheory/Sites/LocallyFullyFaithful.lean index 455fe42f78e070..b2ef5f6ae2d365 100644 --- a/Mathlib/CategoryTheory/Sites/LocallyFullyFaithful.lean +++ b/Mathlib/CategoryTheory/Sites/LocallyFullyFaithful.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Sites.LocallySurjective +module + +public import Mathlib.CategoryTheory.Sites.LocallySurjective /-! # Locally fully faithful functors into sites @@ -25,6 +27,8 @@ import Mathlib.CategoryTheory.Sites.LocallySurjective -/ +@[expose] public section + universe w vC vD uC uD namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/LocallyInjective.lean b/Mathlib/CategoryTheory/Sites/LocallyInjective.lean index 5f2cee7cf6d08c..69c297290cab9f 100644 --- a/Mathlib/CategoryTheory/Sites/LocallyInjective.lean +++ b/Mathlib/CategoryTheory/Sites/LocallyInjective.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.LeftExact -import Mathlib.CategoryTheory.Sites.PreservesSheafification -import Mathlib.CategoryTheory.Sites.Subsheaf -import Mathlib.CategoryTheory.Sites.Whiskering +module + +public import Mathlib.CategoryTheory.Sites.LeftExact +public import Mathlib.CategoryTheory.Sites.PreservesSheafification +public import Mathlib.CategoryTheory.Sites.Subsheaf +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # Locally injective morphisms of (pre)sheaves @@ -22,6 +24,8 @@ by the maps of a covering sieve. -/ +@[expose] public section + universe w v' v u' u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/LocallySurjective.lean b/Mathlib/CategoryTheory/Sites/LocallySurjective.lean index cb5e4fd6ba3ba0..7a6369dc1c2c0f 100644 --- a/Mathlib/CategoryTheory/Sites/LocallySurjective.lean +++ b/Mathlib/CategoryTheory/Sites/LocallySurjective.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Joël Riou -/ -import Mathlib.CategoryTheory.Sites.Subsheaf -import Mathlib.CategoryTheory.Sites.CompatibleSheafification -import Mathlib.CategoryTheory.Sites.LocallyInjective +module + +public import Mathlib.CategoryTheory.Sites.Subsheaf +public import Mathlib.CategoryTheory.Sites.CompatibleSheafification +public import Mathlib.CategoryTheory.Sites.LocallyInjective /-! # Locally surjective morphisms @@ -24,6 +26,8 @@ import Mathlib.CategoryTheory.Sites.LocallyInjective -/ +@[expose] public section + universe v u w v' u' w' diff --git a/Mathlib/CategoryTheory/Sites/MayerVietorisSquare.lean b/Mathlib/CategoryTheory/Sites/MayerVietorisSquare.lean index ae34bc9b85bd2c..1df4e61f9ed094 100644 --- a/Mathlib/CategoryTheory/Sites/MayerVietorisSquare.lean +++ b/Mathlib/CategoryTheory/Sites/MayerVietorisSquare.lean @@ -3,16 +3,17 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.Algebra.Category.Grp.Adjunctions -import Mathlib.Algebra.Homology.ShortComplex.ShortExact -import Mathlib.Algebra.Homology.Square -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Square -import Mathlib.CategoryTheory.Limits.Types.Shapes -import Mathlib.CategoryTheory.Sites.Abelian -import Mathlib.CategoryTheory.Sites.Adjunction -import Mathlib.CategoryTheory.Sites.Sheafification +module + +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.Algebra.Category.Grp.Adjunctions +public import Mathlib.Algebra.Homology.ShortComplex.ShortExact +public import Mathlib.Algebra.Homology.Square +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Square +public import Mathlib.CategoryTheory.Sites.Abelian +public import Mathlib.CategoryTheory.Sites.Adjunction +public import Mathlib.CategoryTheory.Sites.Sheafification /-! # Mayer-Vietoris squares @@ -50,6 +51,8 @@ that it is indeed satisfied by sheaves. * https://stacks.math.columbia.edu/tag/08GL -/ + +@[expose] public section universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Monoidal.lean b/Mathlib/CategoryTheory/Sites/Monoidal.lean index 14cde30b728327..e099f8e415e700 100644 --- a/Mathlib/CategoryTheory/Sites/Monoidal.lean +++ b/Mathlib/CategoryTheory/Sites/Monoidal.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Closed.FunctorCategory.Basic -import Mathlib.CategoryTheory.Localization.Monoidal.Braided -import Mathlib.CategoryTheory.Sites.Localization -import Mathlib.CategoryTheory.Sites.SheafHom +public import Mathlib.CategoryTheory.Closed.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Localization.Monoidal.Braided +public import Mathlib.CategoryTheory.Sites.Equivalence +public import Mathlib.CategoryTheory.Sites.SheafHom /-! # Monoidal category structure on categories of sheaves @@ -29,12 +30,14 @@ chosen finite products. -/ -universe v v' u u' +@[expose] public section + +universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory -variable {C : Type u'} [Category.{v'} C] {J : GrothendieckTopology C} - {A : Type u} [Category.{v} A] [MonoidalCategory A] +variable {C : Type u₁} [Category.{v₁} C] {J : GrothendieckTopology C} + {A : Type u₃} [Category.{v₃} A] [MonoidalCategory A] open Opposite Limits MonoidalCategory MonoidalClosed Enriched.FunctorCategory @@ -107,12 +110,20 @@ end Presheaf namespace GrothendieckTopology +namespace W + +variable (J A) in +lemma transport_isMonoidal {D : Type u₂} [Category.{v₂} D] (K : GrothendieckTopology D) + (G : D ⥤ C) [G.IsCoverDense J] [G.Full] [G.IsContinuous K J] + [(G.sheafPushforwardContinuous A K J).EssSurj] [(K.W (A := A)).IsMonoidal] : + (J.W (A := A)).IsMonoidal := by + rw [← J.W_inverseImage_whiskeringLeft K G] + infer_instance + variable [MonoidalClosed A] [∀ (F₁ F₂ : Cᵒᵖ ⥤ A), HasFunctorEnrichedHom A F₁ F₂] [∀ (F₁ F₂ : Cᵒᵖ ⥤ A), HasEnrichedHom A F₁ F₂] -namespace W - open MonoidalClosed.FunctorCategory lemma whiskerLeft {G₁ G₂ : Cᵒᵖ ⥤ A} {g : G₁ ⟶ G₂} (hg : J.W g) (F : Cᵒᵖ ⥤ A) : diff --git a/Mathlib/CategoryTheory/Sites/MorphismProperty.lean b/Mathlib/CategoryTheory/Sites/MorphismProperty.lean index cbfcaa7bd9d44b..967dca26eb2b7e 100644 --- a/Mathlib/CategoryTheory/Sites/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/Sites/MorphismProperty.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.CategoryTheory.Sites.Pretopology -import Mathlib.CategoryTheory.Sites.Coverage -import Mathlib.CategoryTheory.Sites.Hypercover.Zero +module + +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.CategoryTheory.Sites.Pretopology +public import Mathlib.CategoryTheory.Sites.Coverage +public import Mathlib.CategoryTheory.Sites.Hypercover.Zero /-! # The site induced by a morphism property @@ -20,6 +22,8 @@ this construction by intersecting with the pretopology of surjective families. -/ +@[expose] public section + universe w namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/NonabelianCohomology/H1.lean b/Mathlib/CategoryTheory/Sites/NonabelianCohomology/H1.lean index 8b6feec246dbef..669e49403f82d3 100644 --- a/Mathlib/CategoryTheory/Sites/NonabelianCohomology/H1.lean +++ b/Mathlib/CategoryTheory/Sites/NonabelianCohomology/H1.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.Grp.Basic +module + +public import Mathlib.Algebra.Category.Grp.Basic /-! The cohomology of a sheaf of groups in degree 1 @@ -40,6 +42,8 @@ case, it would be a particular case of Čech cohomology (TODO). -/ +@[expose] public section + universe w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Over.lean b/Mathlib/CategoryTheory/Sites/Over.lean index 2a2801899b18e5..fb00ccbccda299 100644 --- a/Mathlib/CategoryTheory/Sites/Over.lean +++ b/Mathlib/CategoryTheory/Sites/Over.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.CoverLifting -import Mathlib.CategoryTheory.Sites.CoverPreserving -import Mathlib.CategoryTheory.Sites.Coverage -import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected -import Mathlib.CategoryTheory.Limits.Shapes.Connected +module + +public import Mathlib.CategoryTheory.Sites.CoverLifting +public import Mathlib.CategoryTheory.Sites.CoverPreserving +public import Mathlib.CategoryTheory.Sites.Coverage +public import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected +public import Mathlib.CategoryTheory.Limits.Shapes.Connected /-! Localization @@ -21,6 +23,8 @@ is covering for `J`. As a result, the forgetful functor -/ +@[expose] public section + universe v' v u' u namespace CategoryTheory @@ -235,12 +239,89 @@ instance {X Y : C} (f : X ⟶ Y) : (Over.map f).IsContinuous (J.over X) (J.over (over_map_compatiblePreserving J f) (over_map_coverPreserving J f) +section + +variable (A : Type u') [Category.{v'} A] + /-- The pullback functor `Sheaf (J.over Y) A ⥤ Sheaf (J.over X) A` induced by a morphism `f : X ⟶ Y`. -/ -abbrev overMapPullback (A : Type u') [Category.{v'} A] {X Y : C} (f : X ⟶ Y) : +abbrev overMapPullback {X Y : C} (f : X ⟶ Y) : Sheaf (J.over Y) A ⥤ Sheaf (J.over X) A := (Over.map f).sheafPushforwardContinuous _ _ _ +section + +variable {X Y : C} {f g : X ⟶ Y} (h : f = g) + +/-- Two identical morphisms give isomorphic `overMapPullback` functors on sheaves. -/ +@[simps!] +def overMapPullbackCongr : + J.overMapPullback A f ≅ J.overMapPullback A g := + Functor.sheafPushforwardContinuousIso (Over.mapCongr _ _ h) _ _ _ + +lemma overMapPullbackCongr_eq_eqToIso : + J.overMapPullbackCongr A h = eqToIso (by subst h; rfl) := by + aesop + +end + +/-- Applying `overMapPullback` to the identity map gives the identity functor. -/ +@[simps!] +def overMapPullbackId (X : C) : + J.overMapPullback A (𝟙 X) ≅ 𝟭 _ := + Functor.sheafPushforwardContinuousId' (Over.mapId X) _ _ + +/-- The composition of two `overMapPullback` functors identifies to +`overMapPullback` for the composition. -/ +@[simps!] +def overMapPullbackComp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : + J.overMapPullback A g ⋙ J.overMapPullback A f ≅ + J.overMapPullback A (f ≫ g) := + Functor.sheafPushforwardContinuousComp' (Over.mapComp f g).symm _ _ _ _ + +@[reassoc] +lemma overMapPullback_comp_id {X Y : C} (f : X ⟶ Y) : + (J.overMapPullbackComp A f (𝟙 Y)).inv ≫ + Functor.whiskerRight (J.overMapPullbackId A Y).hom _ ≫ (Functor.leftUnitor _).hom = + (overMapPullbackCongr _ _ (by simp)).hom := by + ext + dsimp + simp only [overMapPullbackComp_inv_app_val_app, overMapPullbackId_hom_app_val_app, comp_id, + ← Functor.map_comp, ← op_comp] + congr + cat_disch + +@[reassoc] +lemma overMapPullback_id_comp {X Y : C} (f : X ⟶ Y) : + (J.overMapPullbackComp A (𝟙 X) f).inv ≫ + Functor.whiskerLeft _ (J.overMapPullbackId A X).hom ≫ (Functor.rightUnitor _).hom = + (overMapPullbackCongr _ _ (by simp)).hom := by + ext + dsimp + simp only [overMapPullbackComp_inv_app_val_app, overMapPullbackId_hom_app_val_app, + Functor.sheafPushforwardContinuous_obj_val_map, Quiver.Hom.unop_op, comp_id, + ← Functor.map_comp, ← op_comp] + congr + cat_disch + +@[reassoc] +lemma overMapPullback_assoc {X Y Z T : C} (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ T) : + (J.overMapPullbackComp A f (g ≫ h)).inv ≫ + Functor.whiskerRight (J.overMapPullbackComp A g h).inv _ ≫ + (Functor.associator _ _ _).hom ≫ + Functor.whiskerLeft _ (J.overMapPullbackComp A f g).hom ≫ + (J.overMapPullbackComp A (f ≫ g) h).hom = + (overMapPullbackCongr _ _ (by simp)).hom := by + ext + dsimp + simp only [overMapPullbackComp_inv_app_val_app, overMapPullbackComp_hom_app_val_app, + Functor.sheafPushforwardContinuous_obj_val_map, Quiver.Hom.unop_op, ← Functor.map_comp, + ← op_comp, id_comp, assoc] + congr + cat_disch + +end + end GrothendieckTopology variable {J} diff --git a/Mathlib/CategoryTheory/Sites/Plus.lean b/Mathlib/CategoryTheory/Sites/Plus.lean index 268086547ea59f..9004da2361924b 100644 --- a/Mathlib/CategoryTheory/Sites/Plus.lean +++ b/Mathlib/CategoryTheory/Sites/Plus.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Sheaf +module + +public import Mathlib.CategoryTheory.Sites.Sheaf /-! @@ -16,6 +18,8 @@ See for details. -/ +@[expose] public section + namespace CategoryTheory.GrothendieckTopology diff --git a/Mathlib/CategoryTheory/Sites/Precoverage.lean b/Mathlib/CategoryTheory/Sites/Precoverage.lean index 4a4818ada86652..9b7c81be7ccb4c 100644 --- a/Mathlib/CategoryTheory/Sites/Precoverage.lean +++ b/Mathlib/CategoryTheory/Sites/Precoverage.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Limits.Preserves.Creates.Pullbacks -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Sites.Sieves -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Creates.Pullbacks +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Sites.Sieves +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! @@ -32,6 +34,8 @@ These two are defined in later files. For precoverages, we define stability cond -/ +@[expose] public section + universe w w' v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Preserves.lean b/Mathlib/CategoryTheory/Sites/Preserves.lean index 2f4faa8e592af2..b459519ff8ca71 100644 --- a/Mathlib/CategoryTheory/Sites/Preserves.lean +++ b/Mathlib/CategoryTheory/Sites/Preserves.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition /-! # Sheaves preserve products @@ -31,6 +33,8 @@ See `preservesProductOfIsSheafFor`. See `isSheafFor_of_preservesProduct`. -/ +@[expose] public section + universe v u w namespace CategoryTheory.Presieve diff --git a/Mathlib/CategoryTheory/Sites/PreservesLocallyBijective.lean b/Mathlib/CategoryTheory/Sites/PreservesLocallyBijective.lean index 6125dbc30427e7..3735b92490276a 100644 --- a/Mathlib/CategoryTheory/Sites/PreservesLocallyBijective.lean +++ b/Mathlib/CategoryTheory/Sites/PreservesLocallyBijective.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic -import Mathlib.CategoryTheory.Sites.LocallySurjective +module + +public import Mathlib.CategoryTheory.Sites.DenseSubsite.Basic +public import Mathlib.CategoryTheory.Sites.LocallySurjective /-! # Preserving and reflecting local injectivity and surjectivity @@ -14,6 +16,8 @@ surjectivity of morphisms of presheaves, and that precomposition with a cover-pr cover-dense functor reflects the same properties. -/ +@[expose] public section + open CategoryTheory Functor variable {C D A : Type*} [Category C] [Category D] [Category A] diff --git a/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean b/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean index 94dedc21c7c505..9f6ffbcfa1b941 100644 --- a/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Sites.Localization -import Mathlib.CategoryTheory.Sites.CompatibleSheafification -import Mathlib.CategoryTheory.Sites.Whiskering -import Mathlib.CategoryTheory.Sites.Sheafification +module + +public import Mathlib.CategoryTheory.Sites.Localization +public import Mathlib.CategoryTheory.Sites.CompatibleSheafification +public import Mathlib.CategoryTheory.Sites.Whiskering +public import Mathlib.CategoryTheory.Sites.Sheafification /-! # Functors which preserve sheafification @@ -39,6 +41,8 @@ suitable limits and colimits. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Pretopology.lean b/Mathlib/CategoryTheory/Sites/Pretopology.lean index 015472e0011592..9ff54504f61c61 100644 --- a/Mathlib/CategoryTheory/Sites/Pretopology.lean +++ b/Mathlib/CategoryTheory/Sites/Pretopology.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.Grothendieck -import Mathlib.CategoryTheory.Sites.Precoverage +module + +public import Mathlib.CategoryTheory.Sites.Grothendieck +public import Mathlib.CategoryTheory.Sites.Precoverage /-! # Grothendieck pretopologies @@ -29,6 +31,8 @@ coverage, pretopology, site * [Stacks, *00VG*](https://stacks.math.columbia.edu/tag/00VG) -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean b/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean new file mode 100644 index 00000000000000..67768a6515e88c --- /dev/null +++ b/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean @@ -0,0 +1,52 @@ +/- +Copyright (c) 2025 Joël Riou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joël Riou +-/ +module + +public import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete +public import Mathlib.CategoryTheory.Sites.Over + +/-! +# Sheaves on Over categories, as a pseudofunctor + +Given a Grothendieck topology `J` on a category `C` and +a category `A`, we define the pseudofunctor +`J.pseudofunctorOver A : Pseudofunctor (LocallyDiscrete Cᵒᵖ) Cat` +which sends `X : C` to the category of sheaves on `Over X` +with values in `A`. + +-/ + +@[expose] public section + +universe v' v u' u + +namespace CategoryTheory + +namespace GrothendieckTopology + +variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) + (A : Type u') [Category.{v'} A] + +/-- Given a Grothendieck topology `J` on a category `C` and a category `A`, +this is the pseudofunctor which sends `X : C` to the categories of +sheaves on `Over X` with values in `A`. -/ +@[simps!] +def pseudofunctorOver : Pseudofunctor (LocallyDiscrete Cᵒᵖ) Cat := + LocallyDiscrete.mkPseudofunctor + (fun X ↦ Cat.of (Sheaf (J.over X.unop) A)) + (fun f ↦ J.overMapPullback A f.unop) + (fun X ↦ J.overMapPullbackId A X.unop) + (fun f g ↦ (J.overMapPullbackComp A g.unop f.unop).symm) + (fun f g h ↦ by simpa [overMapPullbackCongr_eq_eqToIso] using + J.overMapPullback_assoc A h.unop g.unop f.unop) + (fun f ↦ by simpa [overMapPullbackCongr_eq_eqToIso] using + J.overMapPullback_comp_id A f.unop) + (fun f ↦ by simpa [overMapPullbackCongr_eq_eqToIso] using + J.overMapPullback_id_comp A f.unop) + +end GrothendieckTopology + +end CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Pullback.lean b/Mathlib/CategoryTheory/Sites/Pullback.lean index 2466b158c6cb32..02bd9cf3bf1e5e 100644 --- a/Mathlib/CategoryTheory/Sites/Pullback.lean +++ b/Mathlib/CategoryTheory/Sites/Pullback.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Adjunction.Restrict -import Mathlib.CategoryTheory.Functor.Flat -import Mathlib.CategoryTheory.Sites.Continuous -import Mathlib.CategoryTheory.Sites.LeftExact +module + +public import Mathlib.CategoryTheory.Adjunction.Restrict +public import Mathlib.CategoryTheory.Functor.Flat +public import Mathlib.CategoryTheory.Sites.Continuous +public import Mathlib.CategoryTheory.Sites.LeftExact /-! # Pullback of sheaves @@ -26,6 +28,8 @@ import Mathlib.CategoryTheory.Sites.LeftExact -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Sites/Sheaf.lean b/Mathlib/CategoryTheory/Sites/Sheaf.lean index 45e8ace91e26cc..8a0632ee8c11e6 100644 --- a/Mathlib/CategoryTheory/Sites/Sheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Sheaf.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kevin Buzzard, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Yoneda -import Mathlib.CategoryTheory.Preadditive.FunctorCategory -import Mathlib.CategoryTheory.Sites.SheafOfTypes -import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition -import Mathlib.CategoryTheory.Limits.Constructions.EpiMono +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Yoneda +public import Mathlib.CategoryTheory.Preadditive.FunctorCategory +public import Mathlib.CategoryTheory.Sites.SheafOfTypes +public import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition +public import Mathlib.CategoryTheory.Limits.Constructions.EpiMono /-! # Sheaves taking values in a category @@ -51,6 +53,8 @@ inequalities this can be changed. -/ +@[expose] public section + universe w v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Sites/SheafCohomology/Basic.lean b/Mathlib/CategoryTheory/Sites/SheafCohomology/Basic.lean index 640face9d8915a..f8cc614b31cedf 100644 --- a/Mathlib/CategoryTheory/Sites/SheafCohomology/Basic.lean +++ b/Mathlib/CategoryTheory/Sites/SheafCohomology/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Category.Grp.Abelian -import Mathlib.Algebra.Category.Grp.Adjunctions -import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic -import Mathlib.CategoryTheory.Sites.Abelian -import Mathlib.CategoryTheory.Sites.ConstantSheaf +module + +public import Mathlib.Algebra.Category.Grp.Abelian +public import Mathlib.Algebra.Category.Grp.Adjunctions +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Basic +public import Mathlib.CategoryTheory.Sites.Abelian +public import Mathlib.CategoryTheory.Sites.ConstantSheaf /-! # Sheaf cohomology @@ -31,6 +33,8 @@ of sets `yoneda.obj U` to `F`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe w' w v u diff --git a/Mathlib/CategoryTheory/Sites/SheafHom.lean b/Mathlib/CategoryTheory/Sites/SheafHom.lean index afc19244507618..0c2f08d0a7ad30 100644 --- a/Mathlib/CategoryTheory/Sites/SheafHom.lean +++ b/Mathlib/CategoryTheory/Sites/SheafHom.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Sites.Over +public import Mathlib.CategoryTheory.Sites.Over /-! Internal hom of sheaves @@ -25,6 +26,8 @@ natural bijection `(X ⨯ F ⟶ Y) ≃ (X ⟶ sheafHom F Y)`. -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean b/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean index 04f5beedc10296..ab43c7164574cf 100644 --- a/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean +++ b/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.Pretopology -import Mathlib.CategoryTheory.Sites.IsSheafFor +module + +public import Mathlib.CategoryTheory.Sites.Pretopology +public import Mathlib.CategoryTheory.Sites.IsSheafFor /-! # Sheaves of types on a Grothendieck topology @@ -46,6 +48,8 @@ We also provide equivalent conditions to satisfy alternate definitions given in -/ +@[expose] public section + universe w w' v u diff --git a/Mathlib/CategoryTheory/Sites/Sheafification.lean b/Mathlib/CategoryTheory/Sites/Sheafification.lean index af27ee18044c19..139904457b9949 100644 --- a/Mathlib/CategoryTheory/Sites/Sheafification.lean +++ b/Mathlib/CategoryTheory/Sites/Sheafification.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Adjunction.Unique -import Mathlib.CategoryTheory.Adjunction.Reflective -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.CategoryTheory.Limits.Preserves.Finite +module + +public import Mathlib.CategoryTheory.Adjunction.Unique +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Sheafification @@ -18,6 +20,8 @@ Note: to access the `HasSheafify` instance for suitable concrete categories, imp `Mathlib/CategoryTheory/Sites/LeftExact.lean`. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sites/Sieves.lean b/Mathlib/CategoryTheory/Sites/Sieves.lean index 7ad34ae3b784ac..6572e6e734da71 100644 --- a/Mathlib/CategoryTheory/Sites/Sieves.lean +++ b/Mathlib/CategoryTheory/Sites/Sieves.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Edward Ayers -/ -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.Data.Set.BooleanAlgebra +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.Data.Set.BooleanAlgebra /-! # Theory of sieves @@ -21,6 +23,8 @@ import Mathlib.Data.Set.BooleanAlgebra sieve, pullback -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Sites/Spaces.lean b/Mathlib/CategoryTheory/Sites/Spaces.lean index 1db57e41a1235c..9b82c6d5fa8bd3 100644 --- a/Mathlib/CategoryTheory/Sites/Spaces.lean +++ b/Mathlib/CategoryTheory/Sites/Spaces.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Sites.Grothendieck -import Mathlib.CategoryTheory.Sites.Pretopology -import Mathlib.CategoryTheory.Limits.Lattice -import Mathlib.Topology.Sets.Opens +module + +public import Mathlib.CategoryTheory.Sites.Grothendieck +public import Mathlib.CategoryTheory.Sites.Pretopology +public import Mathlib.CategoryTheory.Limits.Lattice +public import Mathlib.Topology.Sets.Opens /-! # Grothendieck topology on a topological space @@ -31,6 +33,8 @@ We define the two separately, rather than defining the Grothendieck topology as by the pretopology for the purpose of having nice definitional properties for the sieves. -/ +@[expose] public section + universe u diff --git a/Mathlib/CategoryTheory/Sites/Subcanonical.lean b/Mathlib/CategoryTheory/Sites/Subcanonical.lean index 780b4a773ed8e6..1b055f59699325 100644 --- a/Mathlib/CategoryTheory/Sites/Subcanonical.lean +++ b/Mathlib/CategoryTheory/Sites/Subcanonical.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Sites.Canonical -import Mathlib.CategoryTheory.Sites.Whiskering +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Sites.Canonical +public import Mathlib.CategoryTheory.Sites.Whiskering /-! # Subcanonical Grothendieck topologies @@ -14,6 +16,8 @@ This file provides some API for the Yoneda embedding into the category of sheave subcanonical Grothendieck topology. -/ +@[expose] public section + universe v' v u namespace CategoryTheory.GrothendieckTopology @@ -103,94 +107,120 @@ lemma hom_ext_yoneda {P Q : Sheaf J (Type v)} {f g : P ⟶ Q} simpa only [yonedaEquiv_comp, Equiv.apply_symm_apply] using congr_arg (J.yonedaEquiv) (h _ (J.yonedaEquiv.symm x)) -/-- -The Yoneda embedding into a category of sheaves taking values in sets possibly larger than the -morphisms in the defining site. --/ -@[pp_with_univ] -def yonedaULift : C ⥤ Sheaf J (Type (max v v')) := J.yoneda ⋙ sheafCompose J uliftFunctor.{v'} +/-- A version of `yonedaEquiv` for `uliftYoneda`. -/ +def uliftYonedaEquiv {X : C} {F : Sheaf J (Type (max v v'))} : + ((uliftYoneda.{v'} J).obj X ⟶ F) ≃ F.val.obj (op X) := + (fullyFaithfulSheafToPresheaf _ _).homEquiv.trans CategoryTheory.uliftYonedaEquiv -/-- A version of `yonedaEquiv` for `yonedaULift`. -/ -def yonedaULiftEquiv {X : C} {F : Sheaf J (Type (max v v'))} : - ((yonedaULift.{v'} J).obj X ⟶ F) ≃ F.val.obj (op X) := - (fullyFaithfulSheafToPresheaf _ _).homEquiv.trans uliftYonedaEquiv +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv := uliftYonedaEquiv -theorem yonedaULiftEquiv_apply {X : C} {F : Sheaf J (Type (max v v'))} - (f : J.yonedaULift.obj X ⟶ F) : yonedaULiftEquiv.{v'} J f = f.val.app (op X) ⟨𝟙 X⟩ := +theorem uliftYonedaEquiv_apply {X : C} {F : Sheaf J (Type (max v v'))} + (f : J.uliftYoneda.obj X ⟶ F) : uliftYonedaEquiv.{v'} J f = f.val.app (op X) ⟨𝟙 X⟩ := rfl +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_apply := uliftYonedaEquiv_apply + @[simp] -theorem yonedaULiftEquiv_symm_app_apply {X : C} {F : Sheaf J (Type (max v v'))} +theorem uliftYonedaEquiv_symm_app_apply {X : C} {F : Sheaf J (Type (max v v'))} (x : F.val.obj (op X)) (Y : Cᵒᵖ) (f : Y.unop ⟶ X) : - (J.yonedaULiftEquiv.symm x).val.app Y ⟨f⟩ = F.val.map f.op x := + (J.uliftYonedaEquiv.symm x).val.app Y ⟨f⟩ = F.val.map f.op x := rfl -/-- See also `yonedaEquiv_naturality'` for a more general version. -/ -lemma yonedaULiftEquiv_naturality {X Y : C} {F : Sheaf J (Type (max v v'))} - (f : J.yonedaULift.obj X ⟶ F) (g : Y ⟶ X) : - F.val.map g.op (J.yonedaULiftEquiv f) = J.yonedaULiftEquiv (J.yonedaULift.map g ≫ f) := by +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_symm_app_apply := + uliftYonedaEquiv_symm_app_apply + +/-- See also `uliftYonedaEquiv_naturality'` for a more general version. -/ +lemma uliftYonedaEquiv_naturality {X Y : C} {F : Sheaf J (Type (max v v'))} + (f : J.uliftYoneda.obj X ⟶ F) (g : Y ⟶ X) : + F.val.map g.op (J.uliftYonedaEquiv f) = J.uliftYonedaEquiv (J.uliftYoneda.map g ≫ f) := by change (f.val.app (op X) ≫ F.val.map g.op) ⟨𝟙 X⟩ = f.val.app (op Y) ⟨𝟙 Y ≫ g⟩ rw [← f.val.naturality] - simp [yonedaULift] + simp [uliftYoneda] -/-- Variant of `yonedaEquiv_naturality` with general `g`. This is technically strictly more general -than `yonedaEquiv_naturality`, but `yonedaEquiv_naturality` is sometimes preferable because it -can avoid the "motive is not type correct" error. -/ -lemma yonedaULiftEquiv_naturality' {X Y : Cᵒᵖ} {F : Sheaf J (Type (max v v'))} - (f : J.yonedaULift.obj (unop X) ⟶ F) (g : X ⟶ Y) : - F.val.map g (J.yonedaULiftEquiv f) = J.yonedaULiftEquiv (J.yonedaULift.map g.unop ≫ f) := - J.yonedaULiftEquiv_naturality _ _ +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_naturality := + uliftYonedaEquiv_naturality + +/-- Variant of `uliftYonedaEquiv_naturality` with general `g`. This is technically strictly more +general than `uliftYonedaEquiv_naturality`, but `uliftYonedaEquiv_naturality` is sometimes +preferable because it can avoid the "motive is not type correct" error. -/ +lemma uliftYonedaEquiv_naturality' {X Y : Cᵒᵖ} {F : Sheaf J (Type (max v v'))} + (f : J.uliftYoneda.obj (unop X) ⟶ F) (g : X ⟶ Y) : + F.val.map g (J.uliftYonedaEquiv f) = J.uliftYonedaEquiv (J.uliftYoneda.map g.unop ≫ f) := + J.uliftYonedaEquiv_naturality _ _ + +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_naturality' := + uliftYonedaEquiv_naturality' -lemma yonedaULiftEquiv_comp {X : C} {F G : Sheaf J (Type (max v v'))} (α : J.yonedaULift.obj X ⟶ F) - (β : F ⟶ G) : J.yonedaULiftEquiv (α ≫ β) = β.val.app _ (J.yonedaULiftEquiv α) := +lemma uliftYonedaEquiv_comp {X : C} {F G : Sheaf J (Type (max v v'))} (α : J.uliftYoneda.obj X ⟶ F) + (β : F ⟶ G) : J.uliftYonedaEquiv (α ≫ β) = β.val.app _ (J.uliftYonedaEquiv α) := rfl -lemma yonedaULiftEquiv_yonedaULift_map {X Y : C} (f : X ⟶ Y) : - (yonedaULiftEquiv.{v'} J) (J.yonedaULift.map f) = ⟨f⟩ := by - rw [yonedaULiftEquiv_apply] - simp [yonedaULift] +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_comp := uliftYonedaEquiv_comp -lemma yonedaULiftEquiv_symm_naturality_left {X X' : C} (f : X' ⟶ X) (F : Sheaf J (Type (max v v'))) - (x : F.val.obj ⟨X⟩) : J.yonedaULift.map f ≫ J.yonedaULiftEquiv.symm x = J.yonedaULiftEquiv.symm - ((F.val.map f.op) x) := by - apply J.yonedaULiftEquiv.injective - simp only [yonedaULiftEquiv_comp, Equiv.apply_symm_apply] - rw [yonedaULiftEquiv_yonedaULift_map] +lemma uliftYonedaEquiv_uliftYoneda_map {X Y : C} (f : X ⟶ Y) : + (uliftYonedaEquiv.{v'} J) (J.uliftYoneda.map f) = ⟨f⟩ := by + rw [uliftYonedaEquiv_apply] + simp [uliftYoneda] + +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_yonedaULift_map := + uliftYonedaEquiv_uliftYoneda_map + +lemma uliftYonedaEquiv_symm_naturality_left {X X' : C} (f : X' ⟶ X) (F : Sheaf J (Type (max v v'))) + (x : F.val.obj ⟨X⟩) : + J.uliftYoneda.map f ≫ J.uliftYonedaEquiv.symm x = + J.uliftYonedaEquiv.symm ((F.val.map f.op) x) := by + apply J.uliftYonedaEquiv.injective + simp only [uliftYonedaEquiv_comp, Equiv.apply_symm_apply] + rw [uliftYonedaEquiv_uliftYoneda_map] rfl -lemma yonedaULiftEquiv_symm_naturality_right (X : C) {F F' : Sheaf J (Type (max v v'))} +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_symm_naturality_left := + uliftYonedaEquiv_symm_naturality_left + +lemma uliftYonedaEquiv_symm_naturality_right (X : C) {F F' : Sheaf J (Type (max v v'))} (f : F ⟶ F') (x : F.val.obj ⟨X⟩) : - J.yonedaULiftEquiv.symm x ≫ f = J.yonedaULiftEquiv.symm (f.val.app ⟨X⟩ x) := by - apply J.yonedaULiftEquiv.injective - simp [yonedaULiftEquiv_comp] + J.uliftYonedaEquiv.symm x ≫ f = J.uliftYonedaEquiv.symm (f.val.app ⟨X⟩ x) := by + apply J.uliftYonedaEquiv.injective + simp [uliftYonedaEquiv_comp] + +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_symm_naturality_right := + uliftYonedaEquiv_symm_naturality_right /-- See also `map_yonedaEquiv'` for a more general version. -/ -lemma map_yonedaULiftEquiv {X Y : C} {F : Sheaf J (Type (max v v'))} - (f : J.yonedaULift.obj X ⟶ F) (g : Y ⟶ X) : - F.val.map g.op (J.yonedaULiftEquiv f) = f.val.app (op Y) ⟨g⟩ := by - rw [yonedaULiftEquiv_naturality, yonedaULiftEquiv_comp, yonedaULiftEquiv_yonedaULift_map] +lemma map_uliftYonedaEquiv {X Y : C} {F : Sheaf J (Type (max v v'))} + (f : J.uliftYoneda.obj X ⟶ F) (g : Y ⟶ X) : + F.val.map g.op (J.uliftYonedaEquiv f) = f.val.app (op Y) ⟨g⟩ := by + rw [uliftYonedaEquiv_naturality, uliftYonedaEquiv_comp, uliftYonedaEquiv_uliftYoneda_map] -/-- Variant of `map_yonedaEquiv` with general `g`. This is technically strictly more general -than `map_yonedaEquiv`, but `map_yonedaEquiv` is sometimes preferable because it +@[deprecated (since := "2025-11-10")] alias map_yonedaULiftEquiv := map_uliftYonedaEquiv + +/-- Variant of `map_uliftYonedaEquiv` with general `g`. This is technically strictly more general +than `map_uliftYonedaEquiv`, but `map_uliftYonedaEquiv` is sometimes preferable because it can avoid the "motive is not type correct" error. -/ -lemma map_yonedaULiftEquiv' {X Y : Cᵒᵖ} {F : Sheaf J (Type (max v v'))} - (f : J.yonedaULift.obj (unop X) ⟶ F) - (g : X ⟶ Y) : F.val.map g (J.yonedaULiftEquiv f) = f.val.app Y ⟨g.unop⟩ := by - rw [yonedaULiftEquiv_naturality', yonedaULiftEquiv_comp, yonedaULiftEquiv_yonedaULift_map] +lemma map_uliftYonedaEquiv' {X Y : Cᵒᵖ} {F : Sheaf J (Type (max v v'))} + (f : J.uliftYoneda.obj (unop X) ⟶ F) (g : X ⟶ Y) : + F.val.map g (J.uliftYonedaEquiv f) = f.val.app Y ⟨g.unop⟩ := by + rw [uliftYonedaEquiv_naturality', uliftYonedaEquiv_comp, uliftYonedaEquiv_uliftYoneda_map] + +@[deprecated (since := "2025-11-10")] alias map_yonedaULiftEquiv' := map_uliftYonedaEquiv' -lemma yonedaULeftEquiv_symm_map {X Y : Cᵒᵖ} (f : X ⟶ Y) {F : Sheaf J (Type (max v v'))} - (t : F.val.obj X) : J.yonedaULiftEquiv.symm (F.val.map f t) = - J.yonedaULift.map f.unop ≫ J.yonedaULiftEquiv.symm t := by - obtain ⟨u, rfl⟩ := J.yonedaULiftEquiv.surjective t - rw [yonedaULiftEquiv_naturality', Equiv.symm_apply_apply, Equiv.symm_apply_apply] +lemma uliftYonedaEquiv_symm_map {X Y : Cᵒᵖ} (f : X ⟶ Y) {F : Sheaf J (Type (max v v'))} + (t : F.val.obj X) : J.uliftYonedaEquiv.symm (F.val.map f t) = + J.uliftYoneda.map f.unop ≫ J.uliftYonedaEquiv.symm t := by + obtain ⟨u, rfl⟩ := J.uliftYonedaEquiv.surjective t + rw [uliftYonedaEquiv_naturality', Equiv.symm_apply_apply, Equiv.symm_apply_apply] + +@[deprecated (since := "2025-11-10")] alias yonedaULiftEquiv_symm_map := uliftYonedaEquiv_symm_map /-- Two morphisms of sheaves of types `P ⟶ Q` coincide if the precompositions -with morphisms `yoneda.obj X ⟶ P` agree. -/ -lemma hom_ext_yonedaULift {P Q : Sheaf J (Type (max v v'))} {f g : P ⟶ Q} - (h : ∀ (X : C) (p : J.yonedaULift.obj X ⟶ P), p ≫ f = p ≫ g) : +with morphisms `uliftYoneda.obj X ⟶ P` agree. -/ +lemma hom_ext_uliftYoneda {P Q : Sheaf J (Type (max v v'))} {f g : P ⟶ Q} + (h : ∀ (X : C) (p : J.uliftYoneda.obj X ⟶ P), p ≫ f = p ≫ g) : f = g := by ext X x - simpa only [yonedaULiftEquiv_comp, Equiv.apply_symm_apply] - using congr_arg (J.yonedaULiftEquiv) (h _ (J.yonedaULiftEquiv.symm x)) + simpa only [uliftYonedaEquiv_comp, Equiv.apply_symm_apply] + using congr_arg (J.uliftYonedaEquiv) (h _ (J.uliftYonedaEquiv.symm x)) + +@[deprecated (since := "2025-11-10")] alias hom_ext_yonedaULift := hom_ext_uliftYoneda end CategoryTheory.GrothendieckTopology diff --git a/Mathlib/CategoryTheory/Sites/Subsheaf.lean b/Mathlib/CategoryTheory/Sites/Subsheaf.lean index d0f485adfbf23c..999bdf58c2c424 100644 --- a/Mathlib/CategoryTheory/Sites/Subsheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Subsheaf.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono -import Mathlib.Tactic.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Sites.ConcreteSheafification -import Mathlib.CategoryTheory.Subpresheaf.Image -import Mathlib.CategoryTheory.Subpresheaf.Sieves +module + +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +public import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Sites.ConcreteSheafification +public import Mathlib.CategoryTheory.Subpresheaf.Image +public import Mathlib.CategoryTheory.Subpresheaf.Sieves /-! @@ -32,6 +34,8 @@ We define the sub(pre)sheaf of a type-valued presheaf. `Limits.imageFactorization`. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Sites/Types.lean b/Mathlib/CategoryTheory/Sites/Types.lean index 56ca7ef9a4e342..9f7b3de7eec7e7 100644 --- a/Mathlib/CategoryTheory/Sites/Types.lean +++ b/Mathlib/CategoryTheory/Sites/Types.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.CategoryTheory.Sites.Canonical +module + +public import Mathlib.CategoryTheory.Sites.Canonical /-! # Grothendieck Topology and Sheaves on the Category of Types @@ -15,6 +17,8 @@ the category of types, and make this an equivalence of categories. Then we prove that the topology defined is the canonical topology. -/ +@[expose] public section + universe u diff --git a/Mathlib/CategoryTheory/Sites/Whiskering.lean b/Mathlib/CategoryTheory/Sites/Whiskering.lean index f17277de73d98d..c698ef292d2535 100644 --- a/Mathlib/CategoryTheory/Sites/Whiskering.lean +++ b/Mathlib/CategoryTheory/Sites/Whiskering.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.CategoryTheory.Sites.Sheaf +module + +public import Mathlib.CategoryTheory.Sites.Sheaf /-! @@ -20,6 +22,8 @@ Given a natural transformation `η : F ⟶ G`, we obtain a natural transformatio -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Skeletal.lean b/Mathlib/CategoryTheory/Skeletal.lean index 10a7f463e7a925..d1bdc00beb4965 100644 --- a/Mathlib/CategoryTheory/Skeletal.lean +++ b/Mathlib/CategoryTheory/Skeletal.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Adjunction.Basic -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.IsomorphismClasses -import Mathlib.CategoryTheory.Thin +module + +public import Mathlib.CategoryTheory.Adjunction.Basic +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.IsomorphismClasses +public import Mathlib.CategoryTheory.Thin /-! # Skeleton of a category @@ -23,6 +25,8 @@ subobject lattice. In addition, some of the commutative diagrams about the funct definitionally on the nose which is convenient in practice. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/SmallObject/Basic.lean b/Mathlib/CategoryTheory/SmallObject/Basic.lean index 894f8aa4e2c0f1..51a7b2acf87c8a 100644 --- a/Mathlib/CategoryTheory/SmallObject/Basic.lean +++ b/Mathlib/CategoryTheory/SmallObject/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.SmallObject.IsCardinalForSmallObjectArgument +module + +public import Mathlib.CategoryTheory.SmallObject.IsCardinalForSmallObjectArgument /-! # The small object argument @@ -67,6 +69,8 @@ the file `Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean` -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/Construction.lean b/Mathlib/CategoryTheory/SmallObject/Construction.lean index 6c0e542b01d70a..fb89e695094bd4 100644 --- a/Mathlib/CategoryTheory/SmallObject/Construction.lean +++ b/Mathlib/CategoryTheory/SmallObject/Construction.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback -import Mathlib.AlgebraicTopology.RelativeCellComplex.AttachCells +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +public import Mathlib.AlgebraicTopology.RelativeCellComplex.AttachCells /-! # Construction for the small object argument @@ -46,6 +48,8 @@ provides a tautological morphism `B i ⟶ functorObj f πX` - https://ncatlab.org/nlab/show/small+object+argument -/ + +@[expose] public section universe t w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean index ad7b02ac5da33c..d9b3c13817fce2 100644 --- a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean +++ b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.SmallObject.Construction -import Mathlib.CategoryTheory.SmallObject.TransfiniteIteration -import Mathlib.CategoryTheory.SmallObject.TransfiniteCompositionLifting -import Mathlib.CategoryTheory.MorphismProperty.IsSmall -import Mathlib.AlgebraicTopology.RelativeCellComplex.Basic -import Mathlib.SetTheory.Cardinal.Regular +module + +public import Mathlib.CategoryTheory.SmallObject.Construction +public import Mathlib.CategoryTheory.SmallObject.TransfiniteIteration +public import Mathlib.CategoryTheory.SmallObject.TransfiniteCompositionLifting +public import Mathlib.CategoryTheory.MorphismProperty.IsSmall +public import Mathlib.AlgebraicTopology.RelativeCellComplex.Basic +public import Mathlib.SetTheory.Cardinal.Regular /-! # Cardinals that are suitable for the small object argument @@ -54,6 +56,8 @@ pushouts of coproducts of morphisms in `I`. -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean b/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean index 5016a9a2d80fa2..7fecc4b00f0062 100644 --- a/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean +++ b/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.HasIterationOfShape -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.PrincipalSeg -import Mathlib.CategoryTheory.Limits.Comma -import Mathlib.CategoryTheory.MorphismProperty.Basic -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.SuccPred.Limit -import Mathlib.Order.Interval.Set.InitialSeg +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.HasIterationOfShape +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.PrincipalSeg +public import Mathlib.CategoryTheory.Limits.Comma +public import Mathlib.CategoryTheory.MorphismProperty.Basic +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.SuccPred.Limit +public import Mathlib.Order.Interval.Set.InitialSeg /-! # Transfinite iterations of a successor structure @@ -64,6 +66,8 @@ topological spaces. -/ +@[expose] public section + universe w v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/Iteration/ExtendToSucc.lean b/Mathlib/CategoryTheory/SmallObject/Iteration/ExtendToSucc.lean index 730a42b41c6792..7f748221bd35f5 100644 --- a/Mathlib/CategoryTheory/SmallObject/Iteration/ExtendToSucc.lean +++ b/Mathlib/CategoryTheory/SmallObject/Iteration/ExtendToSucc.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.SmallObject.Iteration.Basic +public import Mathlib.CategoryTheory.SmallObject.Iteration.Basic /-! # Extension of a functor from `Set.Iic j` to `Set.Iic (Order.succ j)` @@ -16,6 +17,8 @@ functor `Set.Iic (Order.succ j) ⥤ C` when an object `X : C` and a morphism -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/Iteration/FunctorOfCocone.lean b/Mathlib/CategoryTheory/SmallObject/Iteration/FunctorOfCocone.lean index 7a094d1bc2e011..1ee837cd3a4605 100644 --- a/Mathlib/CategoryTheory/SmallObject/Iteration/FunctorOfCocone.lean +++ b/Mathlib/CategoryTheory/SmallObject/Iteration/FunctorOfCocone.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.SmallObject.Iteration.Basic +public import Mathlib.CategoryTheory.SmallObject.Iteration.Basic /-! # The functor from `Set.Iic j` deduced from a cocone @@ -15,6 +16,8 @@ the top element is mapped to `c.pt`. -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean b/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean index 74e09521ff4e75..69d49cc40226c4 100644 --- a/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean +++ b/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.SmallObject.Iteration.Basic -import Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc -import Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone +module + +public import Mathlib.CategoryTheory.SmallObject.Iteration.Basic +public import Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc +public import Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone /-! # Existence of the iteration of a successor structure @@ -16,6 +18,8 @@ the type `Φ.Iteration j` is nonempty. -/ +@[expose] public section + universe u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean b/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean index bb9e255e5955b9..448584cb7b2499 100644 --- a/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean +++ b/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.SmallObject.WellOrderInductionData -import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous +module + +public import Mathlib.CategoryTheory.SmallObject.WellOrderInductionData +public import Mathlib.CategoryTheory.MorphismProperty.LiftingProperty +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous /-! # The left lifting property is stable under transfinite composition @@ -50,6 +52,8 @@ This is constructed by transfinite induction on `j`: -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean b/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean index ead09d34aad48e..2ca138d2c82525 100644 --- a/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean +++ b/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty -import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition -import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous +module + +public import Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty +public import Mathlib.CategoryTheory.MorphismProperty.TransfiniteComposition +public import Mathlib.CategoryTheory.Limits.Shapes.Preorder.WellOrderContinuous /-! # The transfinite iteration of a successor structure @@ -16,6 +18,8 @@ defined as the colimit of a functor `Φ.iterationFunctor J : J ⥤ C`. -/ +@[expose] public section + universe w v u namespace CategoryTheory.SmallObject.SuccStruct diff --git a/Mathlib/CategoryTheory/SmallObject/WellOrderInductionData.lean b/Mathlib/CategoryTheory/SmallObject/WellOrderInductionData.lean index dcf398ab42691b..d98e7a3d7fe882 100644 --- a/Mathlib/CategoryTheory/SmallObject/WellOrderInductionData.lean +++ b/Mathlib/CategoryTheory/SmallObject/WellOrderInductionData.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Order.SuccPred.Limit +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Order.SuccPred.Limit /-! # Limits of inverse systems indexed by well-ordered types @@ -27,6 +28,8 @@ which restricts to `val₀`. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/SmallRepresentatives.lean b/Mathlib/CategoryTheory/SmallRepresentatives.lean index ab753163a30e4a..c202f51afbaeb6 100644 --- a/Mathlib/CategoryTheory/SmallRepresentatives.lean +++ b/Mathlib/CategoryTheory/SmallRepresentatives.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Equivalence -import Mathlib.SetTheory.Cardinal.Order +module + +public import Mathlib.CategoryTheory.Equivalence +public import Mathlib.SetTheory.Cardinal.Order /-! # Representatives of small categories @@ -21,6 +23,8 @@ that of `Ω` (see `SmallCategoryOfSet.exists_equivalence`). -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Square.lean b/Mathlib/CategoryTheory/Square.lean index d563ad16af7eef..90c489f7e46713 100644 --- a/Mathlib/CategoryTheory/Square.lean +++ b/Mathlib/CategoryTheory/Square.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Comma.Arrow -import Mathlib.CategoryTheory.CommSq +module + +public import Mathlib.CategoryTheory.Comma.Arrow +public import Mathlib.CategoryTheory.CommSq /-! # The category of commutative squares @@ -31,6 +33,8 @@ maps (`arrowArrowEquivalence'`). -/ +@[expose] public section + universe v v' u u' namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean b/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean index e68fa82f0a277b..82096c5067aaa5 100644 --- a/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean +++ b/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.CategoryTheory.ObjectProperty.ContainsZero -import Mathlib.CategoryTheory.ObjectProperty.EpiMono -import Mathlib.CategoryTheory.Limits.Constructions.EventuallyConstant -import Mathlib.Order.OrderIsoNat -import Mathlib.CategoryTheory.Simple +module + +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.CategoryTheory.ObjectProperty.ContainsZero +public import Mathlib.CategoryTheory.ObjectProperty.EpiMono +public import Mathlib.CategoryTheory.Limits.Constructions.EventuallyConstant +public import Mathlib.Order.OrderIsoNat +public import Mathlib.CategoryTheory.Simple /-! # Artinian objects @@ -26,6 +28,8 @@ with `IsNoetherianObject` in `Cᵒᵖ`. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subobject/Basic.lean b/Mathlib/CategoryTheory/Subobject/Basic.lean index b1a2b5f3db273a..e80479cf396d31 100644 --- a/Mathlib/CategoryTheory/Subobject/Basic.lean +++ b/Mathlib/CategoryTheory/Subobject/Basic.lean @@ -3,13 +3,14 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ +module -import Mathlib.CategoryTheory.Limits.Skeleton -import Mathlib.CategoryTheory.Subobject.MonoOver -import Mathlib.CategoryTheory.Skeletal -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.Tactic.ApplyFun -import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Limits.Skeleton +public import Mathlib.CategoryTheory.Subobject.MonoOver +public import Mathlib.CategoryTheory.Skeletal +public import Mathlib.CategoryTheory.ConcreteCategory.Basic +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Tactic.CategoryTheory.Elementwise /-! # Subobjects @@ -70,6 +71,8 @@ In fact, in an abelian category (I'm not sure in what generality beyond that), -/ +@[expose] public section + universe w' w v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Subobject/Comma.lean b/Mathlib/CategoryTheory/Subobject/Comma.lean index 66dc0d5b501c4e..342e2fde425dcd 100644 --- a/Mathlib/CategoryTheory/Subobject/Comma.lean +++ b/Mathlib/CategoryTheory/Subobject/Comma.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.CategoryTheory.Subobject.WellPowered -import Mathlib.CategoryTheory.Comma.LocallySmall -import Mathlib.CategoryTheory.Limits.Preserves.Finite -import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits -import Mathlib.CategoryTheory.Limits.Comma +module + +public import Mathlib.CategoryTheory.Subobject.WellPowered +public import Mathlib.CategoryTheory.Comma.LocallySmall +public import Mathlib.CategoryTheory.Limits.Preserves.Finite +public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits +public import Mathlib.CategoryTheory.Limits.Comma /-! # Subobjects in the category of structured arrows @@ -30,6 +32,8 @@ We also provide the dual results. As usual, we use `Subobject (op A)` for the qu -/ +@[expose] public section + noncomputable section open CategoryTheory.Limits Opposite diff --git a/Mathlib/CategoryTheory/Subobject/FactorThru.lean b/Mathlib/CategoryTheory/Subobject/FactorThru.lean index 8ace4d7e770683..38f169085c3a0a 100644 --- a/Mathlib/CategoryTheory/Subobject/FactorThru.lean +++ b/Mathlib/CategoryTheory/Subobject/FactorThru.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.Basic -import Mathlib.CategoryTheory.Preadditive.Basic +module + +public import Mathlib.CategoryTheory.Subobject.Basic +public import Mathlib.CategoryTheory.Preadditive.Basic /-! # Factoring through subobjects @@ -14,6 +16,8 @@ asserts the existence of some `P.factorThru f : X ⟶ (P : C)` making the obviou -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Subobject/HasCardinalLT.lean b/Mathlib/CategoryTheory/Subobject/HasCardinalLT.lean index fc4f0484adfc39..98b0f9e67dbcac 100644 --- a/Mathlib/CategoryTheory/Subobject/HasCardinalLT.lean +++ b/Mathlib/CategoryTheory/Subobject/HasCardinalLT.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Subobject.Basic -import Mathlib.SetTheory.Cardinal.HasCardinalLT +module + +public import Mathlib.CategoryTheory.Subobject.Basic +public import Mathlib.SetTheory.Cardinal.HasCardinalLT /-! # Cardinality of Subobject @@ -14,6 +16,8 @@ is `< κ`, then the cardinality of `Subobject X` is also `< κ`. -/ +@[expose] public section + universe w v u namespace CategoryTheory.Subobject diff --git a/Mathlib/CategoryTheory/Subobject/Lattice.lean b/Mathlib/CategoryTheory/Subobject/Lattice.lean index f2d2d6cd81757f..6e3e0eee9792f9 100644 --- a/Mathlib/CategoryTheory/Subobject/Lattice.lean +++ b/Mathlib/CategoryTheory/Subobject/Lattice.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ -import Mathlib.CategoryTheory.Functor.Currying -import Mathlib.CategoryTheory.Subobject.FactorThru -import Mathlib.CategoryTheory.Subobject.WellPowered -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.CategoryTheory.Functor.Currying +public import Mathlib.CategoryTheory.Subobject.FactorThru +public import Mathlib.CategoryTheory.Subobject.WellPowered +public import Mathlib.Data.Finset.Lattice.Fold /-! # The lattice of subobjects @@ -15,6 +17,8 @@ We provide the `SemilatticeInf` with `OrderTop (Subobject X)` instance when `[Ha and the `SemilatticeSup (Subobject X)` instance when `[HasImages C] [HasBinaryCoproducts C]`. -/ +@[expose] public section + universe w v₁ v₂ u₁ u₂ @@ -154,7 +158,7 @@ def leInf {A : C} (f g h : MonoOver A) : (h ⟶ f) → (h ⟶ g) → (h ⟶ (inf intro k₁ k₂ refine homMk (pullback.lift k₂.left k₁.left ?_) ?_ · rw [w k₁, w k₂] - · erw [pullback.lift_snd_assoc, w k₁] + · simp [w k₁] end Inf diff --git a/Mathlib/CategoryTheory/Subobject/Limits.lean b/Mathlib/CategoryTheory/Subobject/Limits.lean index 0db4d02a46ac81..dbfb07ee8f54a0 100644 --- a/Mathlib/CategoryTheory/Subobject/Limits.lean +++ b/Mathlib/CategoryTheory/Subobject/Limits.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.Lattice +module + +public import Mathlib.CategoryTheory.Subobject.Lattice /-! # Specific subobjects @@ -17,6 +19,8 @@ TODO: an iff characterisation of `(imageSubobject f).Factors h` -/ +@[expose] public section + universe v u noncomputable section diff --git a/Mathlib/CategoryTheory/Subobject/MonoOver.lean b/Mathlib/CategoryTheory/Subobject/MonoOver.lean index 16ffd6248c678b..f0b9005b65d7c9 100644 --- a/Mathlib/CategoryTheory/Subobject/MonoOver.lean +++ b/Mathlib/CategoryTheory/Subobject/MonoOver.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ -import Mathlib.CategoryTheory.Comma.Over.Pullback -import Mathlib.CategoryTheory.Adjunction.Reflective -import Mathlib.CategoryTheory.Adjunction.Restrict -import Mathlib.CategoryTheory.Limits.FullSubcategory -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic -import Mathlib.CategoryTheory.WithTerminal.Cone +module + +public import Mathlib.CategoryTheory.Comma.Over.Pullback +public import Mathlib.CategoryTheory.Adjunction.Reflective +public import Mathlib.CategoryTheory.Adjunction.Restrict +public import Mathlib.CategoryTheory.Limits.FullSubcategory +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic +public import Mathlib.CategoryTheory.WithTerminal.Cone /-! # Monomorphisms over a fixed object @@ -37,6 +39,8 @@ and was ported to mathlib by Kim Morrison. -/ +@[expose] public section + universe w' w v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean b/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean index 7fea9d407129d8..5de46fa18570c6 100644 --- a/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean +++ b/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Subobject.Lattice -import Mathlib.CategoryTheory.ObjectProperty.ContainsZero -import Mathlib.CategoryTheory.ObjectProperty.EpiMono -import Mathlib.CategoryTheory.Limits.Constructions.EventuallyConstant -import Mathlib.Order.OrderIsoNat +module + +public import Mathlib.CategoryTheory.Subobject.Lattice +public import Mathlib.CategoryTheory.ObjectProperty.ContainsZero +public import Mathlib.CategoryTheory.ObjectProperty.EpiMono +public import Mathlib.CategoryTheory.Limits.Constructions.EventuallyConstant +public import Mathlib.Order.OrderIsoNat /-! # Noetherian objects @@ -25,6 +27,8 @@ closed under subobjects. -/ +@[expose] public section + universe v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subobject/Presheaf.lean b/Mathlib/CategoryTheory/Subobject/Presheaf.lean index 6a2b00bb4bbe92..a4338a4ff76ebc 100644 --- a/Mathlib/CategoryTheory/Subobject/Presheaf.lean +++ b/Mathlib/CategoryTheory/Subobject/Presheaf.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Pablo Donato. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pablo Donato -/ -import Mathlib.CategoryTheory.Subobject.Basic -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback +module + +public import Mathlib.CategoryTheory.Subobject.Basic +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback /-! # Subobjects presheaf @@ -30,6 +32,8 @@ Let `C` refer to a category with pullbacks. subobject, representable functor, presheaf, topos theory -/ +@[expose] public section + open CategoryTheory Subobject namespace Subobject diff --git a/Mathlib/CategoryTheory/Subobject/Types.lean b/Mathlib/CategoryTheory/Subobject/Types.lean index cb5372457a83ae..3a3361410e7010 100644 --- a/Mathlib/CategoryTheory/Subobject/Types.lean +++ b/Mathlib/CategoryTheory/Subobject/Types.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.WellPowered -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.CategoryTheory.Subobject.WellPowered +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Data.Set.Subsingleton /-! # `Type u` is well-powered @@ -21,6 +23,8 @@ This may be possible using Lawvere theories, but it remains to be seen whether this just pushes lumps around in the carpet. -/ +@[expose] public section + universe u diff --git a/Mathlib/CategoryTheory/Subobject/WellPowered.lean b/Mathlib/CategoryTheory/Subobject/WellPowered.lean index 98ea901dcb3e2f..e9ca57c630a372 100644 --- a/Mathlib/CategoryTheory/Subobject/WellPowered.lean +++ b/Mathlib/CategoryTheory/Subobject/WellPowered.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Subobject.Basic -import Mathlib.CategoryTheory.EssentiallySmall +module + +public import Mathlib.CategoryTheory.Subobject.Basic +public import Mathlib.CategoryTheory.EssentiallySmall /-! # Well-powered categories @@ -26,6 +28,8 @@ and `equivShrink (Subobject X) : Subobject X ≃ Shrink (subobject X)`. -/ +@[expose] public section + universe w v v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Subpresheaf/Basic.lean b/Mathlib/CategoryTheory/Subpresheaf/Basic.lean index d7dffd9a451f99..4a3e42f8070c15 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/Basic.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Joël Riou -/ -import Mathlib.CategoryTheory.Elementwise -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.Data.Set.Lattice.Image /-! @@ -19,6 +21,8 @@ We define the subpresheaf of a type-valued presheaf. -/ +@[expose] public section + universe w v u diff --git a/Mathlib/CategoryTheory/Subpresheaf/Equalizer.lean b/Mathlib/CategoryTheory/Subpresheaf/Equalizer.lean index 5a477b1c954cda..a9c61832336a22 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/Equalizer.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/Equalizer.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Subpresheaf.Image +module + +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Subpresheaf.Image /-! # The equalizer of two morphisms of presheaves, as a subpresheaf @@ -16,6 +18,8 @@ where `f` and `g` coincide. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subpresheaf/Finite.lean b/Mathlib/CategoryTheory/Subpresheaf/Finite.lean index 60532115918502..17df1b4fbc6f3e 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/Finite.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/Finite.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Subpresheaf.OfSection +module + +public import Mathlib.CategoryTheory.Subpresheaf.OfSection /-! # Subpresheaves that are generated by finitely many sections @@ -16,6 +18,8 @@ class `G.IsFinite`. -/ +@[expose] public section + universe w'' w' w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subpresheaf/Image.lean b/Mathlib/CategoryTheory/Subpresheaf/Image.lean index 1ee16c46f92218..29d1b400c55d04 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/Image.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/Image.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Joël Riou -/ -import Mathlib.CategoryTheory.Subpresheaf.Basic -import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono -import Mathlib.CategoryTheory.Limits.Types.Colimits +module + +public import Mathlib.CategoryTheory.Subpresheaf.Basic +public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono +public import Mathlib.CategoryTheory.Limits.Types.Colimits /-! # The image of a subpresheaf @@ -17,6 +19,8 @@ if `G : Subpresheaf F`, we define its preimage `G.preimage f : Subpresheaf F'`. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subpresheaf/OfSection.lean b/Mathlib/CategoryTheory/Subpresheaf/OfSection.lean index 2e8b31063ae989..7b946d0782d4bb 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/OfSection.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/OfSection.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Subpresheaf.Image -import Mathlib.CategoryTheory.Yoneda +module + +public import Mathlib.CategoryTheory.Subpresheaf.Image +public import Mathlib.CategoryTheory.Yoneda /-! # The subpresheaf generated by a section @@ -15,6 +17,8 @@ of `F` generated by `x`. -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subpresheaf/Sieves.lean b/Mathlib/CategoryTheory/Subpresheaf/Sieves.lean index 7c84f551edcd18..ab5884581748a4 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/Sieves.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/Sieves.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.CategoryTheory.Subpresheaf.Basic -import Mathlib.CategoryTheory.Sites.IsSheafFor +module + +public import Mathlib.CategoryTheory.Subpresheaf.Basic +public import Mathlib.CategoryTheory.Sites.IsSheafFor /-! # Sieves attached to subpresheaves @@ -15,6 +17,8 @@ and the associated compatible family of elements with values in `G.toPresheaf`. -/ +@[expose] public section + universe w v u namespace CategoryTheory.Subpresheaf diff --git a/Mathlib/CategoryTheory/Subpresheaf/Subobject.lean b/Mathlib/CategoryTheory/Subpresheaf/Subobject.lean index 7f8fc2c047907b..1e7ecbc15b5632 100644 --- a/Mathlib/CategoryTheory/Subpresheaf/Subobject.lean +++ b/Mathlib/CategoryTheory/Subpresheaf/Subobject.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Subpresheaf.Image -import Mathlib.CategoryTheory.Subobject.Basic +module + +public import Mathlib.CategoryTheory.Subpresheaf.Image +public import Mathlib.CategoryTheory.Subobject.Basic /-! # Comparison between `Subpresheaf`, `MonoOver` and `Subobject` @@ -15,6 +17,8 @@ and an order isomorphism `Subpresheaf.orderIsoSubject F : Subpresheaf F ≃o Sub -/ +@[expose] public section + universe w v u namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Subterminal.lean b/Mathlib/CategoryTheory/Subterminal.lean index 801249907cb2c6..e61c2d4a717f3f 100644 --- a/Mathlib/CategoryTheory/Subterminal.lean +++ b/Mathlib/CategoryTheory/Subterminal.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Subobject.MonoOver +module + +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Subobject.MonoOver /-! # Subterminal objects @@ -26,6 +28,8 @@ We also construct the subcategory of subterminal objects. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Sums/Associator.lean b/Mathlib/CategoryTheory/Sums/Associator.lean index 9f7effc855e5f4..35cf4e6da94692 100644 --- a/Mathlib/CategoryTheory/Sums/Associator.lean +++ b/Mathlib/CategoryTheory/Sums/Associator.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Robin Carlier -/ -import Mathlib.CategoryTheory.Sums.Basic +module + +public import Mathlib.CategoryTheory.Sums.Basic /-! # Associator for binary disjoint union of categories. @@ -11,6 +13,8 @@ import Mathlib.CategoryTheory.Sums.Basic The associator functor `((C ⊕ D) ⊕ E) ⥤ (C ⊕ (D ⊕ E))` and its inverse form an equivalence. -/ +@[expose] public section + universe v₁ v₂ v₃ u₁ u₂ u₃ diff --git a/Mathlib/CategoryTheory/Sums/Basic.lean b/Mathlib/CategoryTheory/Sums/Basic.lean index 9d36d6fca0e968..3c08ac1c57f8dc 100644 --- a/Mathlib/CategoryTheory/Sums/Basic.lean +++ b/Mathlib/CategoryTheory/Sums/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Robin Carlier -/ -import Mathlib.CategoryTheory.Equivalence +module + +public import Mathlib.CategoryTheory.Equivalence /-! # Binary disjoint unions of categories @@ -33,6 +35,8 @@ to construct isomorphisms between functors out of a sum. We further define sums of functors and natural transformations, written `F.sum G` and `α.sum β`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Sums/Products.lean b/Mathlib/CategoryTheory/Sums/Products.lean index 529812c0b40237..d2d414dc09961a 100644 --- a/Mathlib/CategoryTheory/Sums/Products.lean +++ b/Mathlib/CategoryTheory/Sums/Products.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Sums.Associator -import Mathlib.CategoryTheory.Products.Associator +module + +public import Mathlib.CategoryTheory.Sums.Associator +public import Mathlib.CategoryTheory.Products.Associator /-! # Functors out of sums of categories. @@ -16,6 +18,8 @@ the product side. -/ +@[expose] public section + namespace CategoryTheory open Functor diff --git a/Mathlib/CategoryTheory/Thin.lean b/Mathlib/CategoryTheory/Thin.lean index a2c9cb1099b9cf..9b29158c69822a 100644 --- a/Mathlib/CategoryTheory/Thin.lean +++ b/Mathlib/CategoryTheory/Thin.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Bhavik Mehta -/ -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Iso +module + +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Iso /-! # Thin categories @@ -19,6 +21,8 @@ Further, to show two objects are isomorphic in a thin category, it suffices only in each direction. -/ +@[expose] public section + universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/Topos/Classifier.lean b/Mathlib/CategoryTheory/Topos/Classifier.lean index fceb5b45d7ee45..51001a1fa5935f 100644 --- a/Mathlib/CategoryTheory/Topos/Classifier.lean +++ b/Mathlib/CategoryTheory/Topos/Classifier.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Charlie Conneen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Charlie Conneen, Pablo Donato, Klaus Gy -/ -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq -import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced -import Mathlib.CategoryTheory.Subobject.Presheaf +module + +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced +public import Mathlib.CategoryTheory.Subobject.Presheaf /-! @@ -51,6 +53,8 @@ Let `C` refer to a category with a terminal object. -/ +@[expose] public section + universe u v u₀ v₀ namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Triangulated/Adjunction.lean b/Mathlib/CategoryTheory/Triangulated/Adjunction.lean index 9b0cd35f8851ab..c880eaee55eb8f 100644 --- a/Mathlib/CategoryTheory/Triangulated/Adjunction.lean +++ b/Mathlib/CategoryTheory/Triangulated/Adjunction.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Sophie Morel -/ -import Mathlib.CategoryTheory.Triangulated.Functor -import Mathlib.CategoryTheory.Shift.Adjunction -import Mathlib.CategoryTheory.Adjunction.Additive -import Mathlib.CategoryTheory.Adjunction.Opposites -import Mathlib.CategoryTheory.Triangulated.Opposite.Functor +module + +public import Mathlib.CategoryTheory.Triangulated.Functor +public import Mathlib.CategoryTheory.Shift.Adjunction +public import Mathlib.CategoryTheory.Adjunction.Additive +public import Mathlib.CategoryTheory.Adjunction.Opposites +public import Mathlib.CategoryTheory.Triangulated.Opposite.Functor /-! # The adjoint functor is triangulated @@ -31,6 +33,8 @@ if `E : C ≌ D` is an equivalence of pretriangulated categories, then -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Triangulated/Basic.lean b/Mathlib/CategoryTheory/Triangulated/Basic.lean index fc703305b1e2ef..463da75a38789d 100644 --- a/Mathlib/CategoryTheory/Triangulated/Basic.lean +++ b/Mathlib/CategoryTheory/Triangulated/Basic.lean @@ -3,10 +3,13 @@ Copyright (c) 2021 Luke Kershaw. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Luke Kershaw -/ -import Mathlib.CategoryTheory.Adjunction.Limits -import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts -import Mathlib.CategoryTheory.Shift.Basic +module + +public import Mathlib.CategoryTheory.Adjunction.Limits +public import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.BinaryBiproducts +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.CategoryTheory.Shift.Basic /-! # Triangles @@ -17,6 +20,8 @@ It also defines morphisms between these triangles. TODO: generalise this to n-angles in n-angulated categories as in https://arxiv.org/abs/1006.4592 -/ +@[expose] public section + noncomputable section @@ -230,6 +235,96 @@ lemma Triangle.eqToHom_hom₂ {A B : Triangle C} (h : A = B) : lemma Triangle.eqToHom_hom₃ {A B : Triangle C} (h : A = B) : (eqToHom h).hom₃ = eqToHom (by subst h; rfl) := by subst h; rfl +namespace Triangle + +section Preadditive + +variable [Preadditive C] [∀ (n : ℤ), (shiftFunctor C n).Additive] + +@[simps (attr := grind =)] +instance : Zero (T₁ ⟶ T₂) where + zero := + { hom₁ := 0 + hom₂ := 0 + hom₃ := 0 } + +@[simps (attr := grind =)] +instance : Add (T₁ ⟶ T₂) where + add f g := + { hom₁ := f.hom₁ + g.hom₁ + hom₂ := f.hom₂ + g.hom₂ + hom₃ := f.hom₃ + g.hom₃ } + +@[simps (attr := grind =)] +instance : Neg (T₁ ⟶ T₂) where + neg f := + { hom₁ := -f.hom₁ + hom₂ := -f.hom₂ + hom₃ := -f.hom₃ } + +@[simps (attr := grind =)] +instance : Sub (T₁ ⟶ T₂) where + sub f g := + { hom₁ := f.hom₁ - g.hom₁ + hom₂ := f.hom₂ - g.hom₂ + hom₃ := f.hom₃ - g.hom₃ } + +section + +variable {R : Type*} [Semiring R] [Linear R C] + [∀ (n : ℤ), Functor.Linear R (shiftFunctor C n)] + +@[simps (attr := grind =)] +instance : SMul R (T₁ ⟶ T₂) where + smul n f := + { hom₁ := n • f.hom₁ + hom₂ := n • f.hom₂ + hom₃ := n • f.hom₃ } + +omit [∀ (n : ℤ), (shiftFunctor C n).Additive] + +end + +instance : AddCommGroup (T₁ ⟶ T₂) where + zero_add f := by ext <;> apply zero_add + add_assoc f g h := by ext <;> apply add_assoc + add_zero f := by ext <;> apply add_zero + add_comm f g := by ext <;> apply add_comm + neg_add_cancel f := by ext <;> apply neg_add_cancel + sub_eq_add_neg f g := by ext <;> apply sub_eq_add_neg + nsmul n f := n • f + nsmul_zero f := by cat_disch + nsmul_succ n f := by ext <;> apply AddMonoid.nsmul_succ + zsmul n f := n • f + zsmul_zero' := by cat_disch + zsmul_succ' n f := by ext <;> apply SubNegMonoid.zsmul_succ' + zsmul_neg' n f := by ext <;> apply SubNegMonoid.zsmul_neg' + +instance : Preadditive (Triangle C) where + +end Preadditive + +section Linear + +variable [Preadditive C] {R : Type*} [Semiring R] [Linear R C] + [∀ (n : ℤ), (shiftFunctor C n).Additive] + [∀ (n : ℤ), Functor.Linear R (shiftFunctor C n)] + +attribute [local simp] mul_smul add_smul in +instance : Module R (T₁ ⟶ T₂) where + one_smul := by aesop + mul_smul := by aesop + smul_zero := by aesop + smul_add := by aesop + add_smul := by aesop + zero_smul := by aesop + +instance : Linear R (Triangle C) where + +end Linear + +end Triangle + /-- The obvious triangle `X₁ ⟶ X₁ ⊞ X₂ ⟶ X₂ ⟶ X₁⟦1⟧`. -/ @[simps!] def binaryBiproductTriangle (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryBiproduct X₁ X₂] : diff --git a/Mathlib/CategoryTheory/Triangulated/Functor.lean b/Mathlib/CategoryTheory/Triangulated/Functor.lean index dcff9c2d062cfc..1d2747be0bd170 100644 --- a/Mathlib/CategoryTheory/Triangulated/Functor.lean +++ b/Mathlib/CategoryTheory/Triangulated/Functor.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Triangulated.Triangulated -import Mathlib.CategoryTheory.ComposableArrows -import Mathlib.CategoryTheory.Shift.CommShift +module + +public import Mathlib.CategoryTheory.Triangulated.Triangulated +public import Mathlib.CategoryTheory.ComposableArrows.Basic +public import Mathlib.CategoryTheory.Shift.CommShift /-! # Triangulated functors @@ -19,6 +21,8 @@ distinguished triangles: this defines the typeclass `Functor.IsTriangulated`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory @@ -103,8 +107,8 @@ private theorem mapTriangleCommShiftIso_add noncomputable instance [∀ (n : ℤ), (shiftFunctor C n).Additive] [∀ (n : ℤ), (shiftFunctor D n).Additive] : (F.mapTriangle).CommShift ℤ where - iso := F.mapTriangleCommShiftIso - add _ _ := mapTriangleCommShiftIso_add .. + commShiftIso := F.mapTriangleCommShiftIso + commShiftIso_add _ _ := mapTriangleCommShiftIso_add .. /-- `F.mapTriangle` commutes with the rotation of triangles. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean b/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean index 556c171f4c99c1..d97ffa10b15ad1 100644 --- a/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean +++ b/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Exact -import Mathlib.CategoryTheory.Shift.ShiftSequence -import Mathlib.CategoryTheory.Triangulated.Functor -import Mathlib.CategoryTheory.Triangulated.Subcategory -import Mathlib.Algebra.Homology.ExactSequence +module + +public import Mathlib.Algebra.Homology.ShortComplex.Exact +public import Mathlib.CategoryTheory.Shift.ShiftSequence +public import Mathlib.CategoryTheory.Triangulated.Functor +public import Mathlib.CategoryTheory.Triangulated.Subcategory +public import Mathlib.Algebra.Homology.ExactSequence /-! # Homological functors @@ -44,6 +46,8 @@ for "contravariant" functors (i.e. functors `Cᵒᵖ ⥤ A`). -/ +@[expose] public section + namespace CategoryTheory open Category Limits Pretriangulated ZeroObject Preadditive diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean index e19436bc914280..dd1a626e4880ad 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Pullback +module + +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.CategoryTheory.Shift.Opposite +public import Mathlib.CategoryTheory.Shift.Pullback /-! # The shift on the opposite category of a pretriangulated category @@ -32,6 +34,8 @@ functor is `shiftFunctor Cᵒᵖ n` and whose inverse functor is `(shiftFunctor -/ +@[expose] public section + namespace CategoryTheory open Category Limits Preadditive ZeroObject diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean index 75de49aa48c2ab..fe25aaeebb7dd8 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated -import Mathlib.CategoryTheory.Adjunction.Opposites +module + +public import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated +public import Mathlib.CategoryTheory.Adjunction.Opposites /-! # Opposites of functors between pretriangulated categories, @@ -20,6 +22,8 @@ given by `CategoryTheory.Pretriangulated.triangleOpEquivalence`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory @@ -169,13 +173,8 @@ with the equivalences `Pretriangulated.triangleOpEquivalence` on `C` and `D`. noncomputable def mapTriangleOpCompTriangleOpEquivalenceFunctorApp (T : Triangle C) : (triangleOpEquivalence D).functor.obj (op (F.mapTriangle.obj T)) ≅ F.op.mapTriangle.obj ((triangleOpEquivalence C).functor.obj (op T)) := - Triangle.isoMk _ _ (Iso.refl _) (Iso.refl _) (Iso.refl _) - (by simp) (by simp) (by - dsimp - simp only [map_comp, shift_map_op, map_id, comp_id, op_comp, op_unop, - map_opShiftFunctorEquivalence_counitIso_inv_app_unop, - opShiftFunctorEquivalence_inverse, opShiftFunctorEquivalence_functor, - Quiver.Hom.op_unop, assoc, id_comp]) + Triangle.isoMk _ _ (Iso.refl _) (Iso.refl _) (Iso.refl _) (by simp) (by simp) + (by simp [shift_map_op, map_opShiftFunctorEquivalence_counitIso_inv_app_unop]) /-- If `F : C ⥤ D` commutes with shifts, this expresses the compatibility of `F.mapTriangle` @@ -186,7 +185,7 @@ noncomputable def mapTriangleOpCompTriangleOpEquivalenceFunctor : (triangleOpEquivalence C).functor ⋙ F.op.mapTriangle := NatIso.ofComponents (fun T ↦ F.mapTriangleOpCompTriangleOpEquivalenceFunctorApp T.unop) - (by intros; ext <;> dsimp <;> simp only [comp_id, id_comp]) + (by intros; ext <;> dsimp <;> simp only [id_comp, comp_id]) /-- If `F : C ⥤ D` commutes with shifts, this is the 2-commutative square of categories diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Pretriangulated.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Pretriangulated.lean index cc82cbb68a9c2f..6b7f8bdf0f8c8d 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Pretriangulated.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Pretriangulated.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Triangulated.Opposite.Triangle -import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor +module + +public import Mathlib.CategoryTheory.Triangulated.Opposite.Triangle +public import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor /-! # The (pre)triangulated structure on the opposite category @@ -12,7 +14,7 @@ import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor In this file, we shall construct the (pre)triangulated structure on the opposite category `Cᵒᵖ` of a (pre)triangulated category `C`. -The shift on `Cᵒᵖ` was constructed in ``CategoryTheory.Triangulated.Opposite.Basic`, +The shift on `Cᵒᵖ` was constructed in `CategoryTheory.Triangulated.Opposite.Basic`, and is such that shifting by `n : ℤ` on `Cᵒᵖ` corresponds to the shift by `-n` on `C`. In `CategoryTheory.Triangulated.Opposite.Triangle`, we constructed an equivalence `(Triangle C)ᵒᵖ ≌ Triangle Cᵒᵖ`, called @@ -31,6 +33,8 @@ in [Verdiers's thesis, p. 96][verdier1996] which would require that the triangle -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean index fb5d284e2f4289..559443e16fc8ae 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Triangulated.Basic -import Mathlib.CategoryTheory.Triangulated.Opposite.Basic +module + +public import Mathlib.CategoryTheory.Triangulated.Basic +public import Mathlib.CategoryTheory.Triangulated.Opposite.Basic /-! # Triangles in the opposite category of a (pre)triangulated category @@ -23,6 +25,8 @@ between `(Triangle C)ᵒᵖ` and `Triangle Cᵒᵖ`, called -/ +@[expose] public section + namespace CategoryTheory.Pretriangulated open Category Limits Preadditive ZeroObject Opposite diff --git a/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean b/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean index ab2aa9892717f1..7234d7b6e1770c 100644 --- a/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean +++ b/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Luke Kershaw. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Luke Kershaw, Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Basic -import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts -import Mathlib.CategoryTheory.Triangulated.TriangleShift +module + +public import Mathlib.Algebra.Homology.ShortComplex.Basic +public import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts +public import Mathlib.CategoryTheory.Triangulated.TriangleShift /-! # Pretriangulated Categories @@ -21,6 +23,8 @@ but not necessarily additive categories, as is assumed in some sources. TODO: generalise this to n-angulated categories as in https://arxiv.org/abs/1006.4592 -/ +@[expose] public section + assert_not_exists TwoSidedIdeal noncomputable section diff --git a/Mathlib/CategoryTheory/Triangulated/Rotate.lean b/Mathlib/CategoryTheory/Triangulated/Rotate.lean index cb16745146e066..c2b6431d0e6c79 100644 --- a/Mathlib/CategoryTheory/Triangulated/Rotate.lean +++ b/Mathlib/CategoryTheory/Triangulated/Rotate.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Luke Kershaw. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Luke Kershaw -/ -import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor -import Mathlib.CategoryTheory.Triangulated.Basic +module + +public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor +public import Mathlib.CategoryTheory.Triangulated.Basic /-! # Rotate @@ -14,6 +16,8 @@ It also shows that rotation gives an equivalence on the category of triangles. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/CategoryTheory/Triangulated/Subcategory.lean b/Mathlib/CategoryTheory/Triangulated/Subcategory.lean index 1dc76e4cc1af00..67e2b69526118b 100644 --- a/Mathlib/CategoryTheory/Triangulated/Subcategory.lean +++ b/Mathlib/CategoryTheory/Triangulated/Subcategory.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Localization.CalculusOfFractions -import Mathlib.CategoryTheory.Localization.Triangulated -import Mathlib.CategoryTheory.ObjectProperty.ContainsZero -import Mathlib.CategoryTheory.ObjectProperty.Shift -import Mathlib.CategoryTheory.Shift.Localization +module + +public import Mathlib.CategoryTheory.Localization.CalculusOfFractions +public import Mathlib.CategoryTheory.Localization.Triangulated +public import Mathlib.CategoryTheory.ObjectProperty.ContainsZero +public import Mathlib.CategoryTheory.ObjectProperty.Shift +public import Mathlib.CategoryTheory.Shift.Localization /-! # Triangulated subcategories @@ -38,6 +40,8 @@ of an additive category is not closed under isomorphisms. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean index 6bfe27c5ac7ce7..0c37e453f18797 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.ObjectProperty.Shift -import Mathlib.CategoryTheory.Triangulated.Pretriangulated +module + +public import Mathlib.CategoryTheory.ObjectProperty.Shift +public import Mathlib.CategoryTheory.Triangulated.Pretriangulated /-! # t-structures on triangulated categories @@ -38,6 +40,8 @@ use depending on the context. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace CategoryTheory @@ -173,6 +177,66 @@ lemma isLE_of_iso {X Y : C} (e : X ≅ Y) (n : ℤ) [t.IsLE X n] : t.IsLE Y n wh lemma isGE_of_iso {X Y : C} (e : X ≅ Y) (n : ℤ) [t.IsGE X n] : t.IsGE Y n where ge := (t.ge n).prop_of_iso e (t.ge_of_isGE X n) +lemma isLE_of_LE (X : C) (p q : ℤ) (hpq : p ≤ q := by cutsat) [t.IsLE X p] : t.IsLE X q where + le := le_monotone t hpq _ (t.le_of_isLE X p) + +lemma isGE_of_GE (X : C) (p q : ℤ) (hpq : p ≤ q := by cutsat) [t.IsGE X q] : t.IsGE X p where + ge := ge_antitone t hpq _ (t.ge_of_isGE X q) + +lemma isLE_shift (X : C) (n a n' : ℤ) (hn' : a + n' = n := by cutsat) [t.IsLE X n] : + t.IsLE (X⟦a⟧) n' := + ⟨t.le_shift n a n' hn' X (t.le_of_isLE X n)⟩ + +lemma isGE_shift (X : C) (n a n' : ℤ) (hn' : a + n' = n := by cutsat) [t.IsGE X n] : + t.IsGE (X⟦a⟧) n' := + ⟨t.ge_shift n a n' hn' X (t.ge_of_isGE X n)⟩ + +lemma isLE_of_shift (X : C) (n a n' : ℤ) (hn' : a + n' = n := by cutsat) [t.IsLE (X⟦a⟧) n'] : + t.IsLE X n := by + have h := t.isLE_shift (X⟦a⟧) n' (-a) n + exact t.isLE_of_iso (show X⟦a⟧⟦-a⟧ ≅ X from (shiftEquiv C a).unitIso.symm.app X) n + +lemma isGE_of_shift (X : C) (n a n' : ℤ) (hn' : a + n' = n := by cutsat) [t.IsGE (X⟦a⟧) n'] : + t.IsGE X n := by + have h := t.isGE_shift (X⟦a⟧) n' (-a) n + exact t.isGE_of_iso (show X⟦a⟧⟦-a⟧ ≅ X from (shiftEquiv C a).unitIso.symm.app X) n + +lemma isLE_shift_iff (X : C) (n a n' : ℤ) (hn' : a + n' = n := by cutsat) : + t.IsLE (X⟦a⟧) n' ↔ t.IsLE X n := by + constructor + · intro + exact t.isLE_of_shift X n a n' hn' + · intro + exact t.isLE_shift X n a n' hn' + +lemma isGE_shift_iff (X : C) (n a n' : ℤ) (hn' : a + n' = n := by cutsat) : + t.IsGE (X⟦a⟧) n' ↔ t.IsGE X n := by + constructor + · intro + exact t.isGE_of_shift X n a n' hn' + · intro + exact t.isGE_shift X n a n' hn' + +lemma zero {X Y : C} (f : X ⟶ Y) (n₀ n₁ : ℤ) (h : n₀ < n₁ := by cutsat) + [t.IsLE X n₀] [t.IsGE Y n₁] : f = 0 := by + have := t.isLE_shift X n₀ n₀ 0 (add_zero n₀) + have := t.isGE_shift Y n₁ n₀ (n₁-n₀) + have := t.isGE_of_GE (Y⟦n₀⟧) 1 (n₁-n₀) + apply (shiftFunctor C n₀).map_injective + simp only [Functor.map_zero] + apply t.zero' + · apply t.le_of_isLE + · apply t.ge_of_isGE + +lemma zero_of_isLE_of_isGE {X Y : C} (f : X ⟶ Y) (n₀ n₁ : ℤ) (h : n₀ < n₁) + (_ : t.IsLE X n₀) (_ : t.IsGE Y n₁) : f = 0 := + t.zero f n₀ n₁ h + +lemma isZero (X : C) (n₀ n₁ : ℤ) (h : n₀ < n₁ := by cutsat) + [t.IsLE X n₀] [t.IsGE X n₁] : IsZero X := by + rw [IsZero.iff_id_eq_zero] + exact t.zero _ n₀ n₁ h + end TStructure end Triangulated diff --git a/Mathlib/CategoryTheory/Triangulated/TriangleShift.lean b/Mathlib/CategoryTheory/Triangulated/TriangleShift.lean index 2ef81f0f7fdab4..353cdb955b3961 100644 --- a/Mathlib/CategoryTheory/Triangulated/TriangleShift.lean +++ b/Mathlib/CategoryTheory/Triangulated/TriangleShift.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.CategoryTheory.Triangulated.Rotate -import Mathlib.Algebra.Ring.NegOnePow +module + +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.CategoryTheory.Triangulated.Rotate +public import Mathlib.Algebra.Ring.NegOnePow /-! # The shift on the category of triangles @@ -20,6 +22,8 @@ Johan Commelin and Andrew Yang during the Liquid Tensor Experiment. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal universe v u diff --git a/Mathlib/CategoryTheory/Triangulated/Triangulated.lean b/Mathlib/CategoryTheory/Triangulated/Triangulated.lean index d2a25cb782aa34..9f5ac21fe8b74c 100644 --- a/Mathlib/CategoryTheory/Triangulated/Triangulated.lean +++ b/Mathlib/CategoryTheory/Triangulated/Triangulated.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Triangulated.Pretriangulated +module + +public import Mathlib.CategoryTheory.Triangulated.Pretriangulated /-! # Triangulated Categories @@ -13,6 +15,8 @@ pretriangulated categories which satisfy the octahedron axiom. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal noncomputable section diff --git a/Mathlib/CategoryTheory/Triangulated/Yoneda.lean b/Mathlib/CategoryTheory/Triangulated/Yoneda.lean index 66b6c93a89e04d..990ca0e6ff5244 100644 --- a/Mathlib/CategoryTheory/Triangulated/Yoneda.lean +++ b/Mathlib/CategoryTheory/Triangulated/Yoneda.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.Ab -import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic -import Mathlib.CategoryTheory.Shift.ShiftedHomOpposite -import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor -import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated +module + +public import Mathlib.Algebra.Homology.ShortComplex.Ab +public import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic +public import Mathlib.CategoryTheory.Shift.ShiftedHomOpposite +public import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor +public import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated /-! # The Yoneda functors are homological @@ -18,6 +20,8 @@ functors `preadditiveCoyoneda.obj A : C ⥤ AddCommGrpCat` for `A : Cᵒᵖ` and -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open CategoryTheory Limits diff --git a/Mathlib/CategoryTheory/Types/Basic.lean b/Mathlib/CategoryTheory/Types/Basic.lean index e40c975ed7a8d7..ad9f6cd71c8500 100644 --- a/Mathlib/CategoryTheory/Types/Basic.lean +++ b/Mathlib/CategoryTheory/Types/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stephen Morgan, Kim Morrison, Johannes Hölzl -/ -import Mathlib.CategoryTheory.EpiMono -import Mathlib.Data.Set.CoeSort -import Mathlib.Tactic.PPWithUniv -import Mathlib.Tactic.ToAdditive +module + +public import Mathlib.CategoryTheory.EpiMono +public import Mathlib.Data.Set.CoeSort +public import Mathlib.Tactic.PPWithUniv +public import Mathlib.Tactic.ToAdditive /-! # The category `Type`. @@ -30,6 +32,8 @@ We prove some basic facts about the category `Type`: (the corresponding fact about monads is in `Mathlib/CategoryTheory/Monad/Types.lean`). -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Types/Monomorphisms.lean b/Mathlib/CategoryTheory/Types/Monomorphisms.lean index 7d7bbf942a0a7f..7a97ee45a3db2f 100644 --- a/Mathlib/CategoryTheory/Types/Monomorphisms.lean +++ b/Mathlib/CategoryTheory/Types/Monomorphisms.lean @@ -3,9 +3,12 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Limits.Connected -import Mathlib.CategoryTheory.Limits.Types.Filtered -import Mathlib.CategoryTheory.MorphismProperty.Limits +module + +public import Mathlib.CategoryTheory.Limits.Connected +public import Mathlib.CategoryTheory.Limits.Types.Filtered +public import Mathlib.CategoryTheory.Limits.Types.Pushouts +public import Mathlib.CategoryTheory.MorphismProperty.Limits /-! # Stability properties of monomorphisms in `Type` @@ -21,6 +24,8 @@ in the file `Mathlib/CategoryTheory/MorphismProperty/Retract.lean`.) -/ +@[expose] public section + universe v' u' u namespace CategoryTheory.Types diff --git a/Mathlib/CategoryTheory/Types/Set.lean b/Mathlib/CategoryTheory/Types/Set.lean index 73cdd5af2f14f3..41c4e8b3e29b87 100644 --- a/Mathlib/CategoryTheory/Types/Set.lean +++ b/Mathlib/CategoryTheory/Types/Set.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Data.Set.Basic +module + +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Data.Set.Basic /-! # The functor from `Set X` to types @@ -15,6 +17,8 @@ which sends `A : Set X` to its underlying type. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/CategoryTheory/UnivLE.lean b/Mathlib/CategoryTheory/UnivLE.lean index ee77ed93a1fc3d..df78e72fe05a02 100644 --- a/Mathlib/CategoryTheory/UnivLE.lean +++ b/Mathlib/CategoryTheory/UnivLE.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.EssentialImage -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Logic.UnivLE +module + +public import Mathlib.CategoryTheory.EssentialImage +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Logic.UnivLE /-! # Universe inequalities and essential surjectivity of `uliftFunctor`. @@ -13,6 +15,8 @@ import Mathlib.Logic.UnivLE We show `UnivLE.{max u v, v} ↔ EssSurj (uliftFunctor.{u, v} : Type v ⥤ Type max u v)`. -/ +@[expose] public section + open CategoryTheory universe u v diff --git a/Mathlib/CategoryTheory/Whiskering.lean b/Mathlib/CategoryTheory/Whiskering.lean index 41ef11798c7557..63b16cfbf46b16 100644 --- a/Mathlib/CategoryTheory/Whiskering.lean +++ b/Mathlib/CategoryTheory/Whiskering.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Tactic.CategoryTheory.IsoReassoc -import Mathlib.CategoryTheory.Functor.Category -import Mathlib.CategoryTheory.Functor.FullyFaithful +module + +public import Mathlib.Tactic.CategoryTheory.IsoReassoc +public import Mathlib.CategoryTheory.Functor.Category +public import Mathlib.CategoryTheory.Functor.FullyFaithful /-! # Whiskering @@ -25,6 +27,8 @@ We show the associators an unitor natural isomorphisms satisfy the triangle and identities. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/Widesubcategory.lean b/Mathlib/CategoryTheory/Widesubcategory.lean index 4a9779b92eb3b7..836072885375ae 100644 --- a/Mathlib/CategoryTheory/Widesubcategory.lean +++ b/Mathlib/CategoryTheory/Widesubcategory.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sina Hazratpour. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sina Hazratpour -/ -import Mathlib.CategoryTheory.Functor.FullyFaithful -import Mathlib.CategoryTheory.MorphismProperty.Composition +module + +public import Mathlib.CategoryTheory.Functor.FullyFaithful +public import Mathlib.CategoryTheory.MorphismProperty.Composition /-! # Wide subcategories @@ -24,6 +26,8 @@ whose objects are the objects of `C` and morphisms are the morphisms in `C` whic property `P`. -/ +@[expose] public section + namespace CategoryTheory universe v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/WithTerminal.lean b/Mathlib/CategoryTheory/WithTerminal.lean index d48cfd80da53ad..70e67006949612 100644 --- a/Mathlib/CategoryTheory/WithTerminal.lean +++ b/Mathlib/CategoryTheory/WithTerminal.lean @@ -3,6 +3,8 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith, Adam Topaz -/ -import Mathlib.CategoryTheory.WithTerminal.Basic +module + +public import Mathlib.CategoryTheory.WithTerminal.Basic deprecated_module (since := "2025-04-10") diff --git a/Mathlib/CategoryTheory/WithTerminal/Basic.lean b/Mathlib/CategoryTheory/WithTerminal/Basic.lean index 2f560b76fa9948..6f2ab61553b721 100644 --- a/Mathlib/CategoryTheory/WithTerminal/Basic.lean +++ b/Mathlib/CategoryTheory/WithTerminal/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith, Adam Topaz -/ -import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal -import Mathlib.CategoryTheory.Limits.Shapes.Terminal -import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks -import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +module + +public import Mathlib.CategoryTheory.Limits.Shapes.IsTerminal +public import Mathlib.CategoryTheory.Limits.Shapes.Terminal +public import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks +public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor /-! @@ -38,6 +40,8 @@ from `Cat` to `Cat`. -/ +@[expose] public section + namespace CategoryTheory diff --git a/Mathlib/CategoryTheory/WithTerminal/Cone.lean b/Mathlib/CategoryTheory/WithTerminal/Cone.lean index 44db425efeb726..00cd4421e3d66b 100644 --- a/Mathlib/CategoryTheory/WithTerminal/Cone.lean +++ b/Mathlib/CategoryTheory/WithTerminal/Cone.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Moisés Herradón Cueto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moisés Herradón Cueto -/ -import Mathlib.CategoryTheory.Comma.Over.Basic -import Mathlib.CategoryTheory.WithTerminal.Basic +module + +public import Mathlib.CategoryTheory.Comma.Over.Basic +public import Mathlib.CategoryTheory.WithTerminal.Basic /-! # Relations between `Cone`, `WithTerminal` and `Over` @@ -15,6 +17,8 @@ object to `X`. These two functors have equivalent categories of cones (`coneEqui As a corollary, the limit of `K` is the limit of `liftFromOver K`, and vice-versa. -/ +@[expose] public section + open CategoryTheory Limits universe w w' v₁ v₂ u₁ u₂ diff --git a/Mathlib/CategoryTheory/WithTerminal/FinCategory.lean b/Mathlib/CategoryTheory/WithTerminal/FinCategory.lean index deb092646fa530..69d652bbfc1ff7 100644 --- a/Mathlib/CategoryTheory/WithTerminal/FinCategory.lean +++ b/Mathlib/CategoryTheory/WithTerminal/FinCategory.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Moisés Herradón Cueto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moisés Herradón Cueto -/ -import Mathlib.CategoryTheory.FinCategory.Basic -import Mathlib.CategoryTheory.WithTerminal.Basic -import Mathlib.Data.Fintype.Option +module + +public import Mathlib.CategoryTheory.FinCategory.Basic +public import Mathlib.CategoryTheory.WithTerminal.Basic +public import Mathlib.Data.Fintype.Option /-! @@ -16,6 +18,8 @@ and likewise if `C` has finitely many morphisms as well. -/ +@[expose] public section + universe v u diff --git a/Mathlib/CategoryTheory/WithTerminal/Lemmas.lean b/Mathlib/CategoryTheory/WithTerminal/Lemmas.lean index d3b01f6a83314f..56aa8efb50c219 100644 --- a/Mathlib/CategoryTheory/WithTerminal/Lemmas.lean +++ b/Mathlib/CategoryTheory/WithTerminal/Lemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.CategoryTheory.Filtered.Basic -import Mathlib.CategoryTheory.WithTerminal.Basic +module + +public import Mathlib.CategoryTheory.Filtered.Basic +public import Mathlib.CategoryTheory.WithTerminal.Basic /-! # Further lemmas on `WithTerminal` @@ -12,6 +14,8 @@ import Mathlib.CategoryTheory.WithTerminal.Basic These lemmas and instances need more imports. -/ +@[expose] public section + namespace CategoryTheory variable {C : Type*} [Category C] diff --git a/Mathlib/CategoryTheory/Yoneda.lean b/Mathlib/CategoryTheory/Yoneda.lean index 04b19bbdc8e9a7..95b2535e61ca5a 100644 --- a/Mathlib/CategoryTheory/Yoneda.lean +++ b/Mathlib/CategoryTheory/Yoneda.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Functor.Hom -import Mathlib.CategoryTheory.Products.Basic -import Mathlib.Data.ULift -import Mathlib.Logic.Function.ULift +module + +public import Mathlib.CategoryTheory.Functor.Hom +public import Mathlib.CategoryTheory.Products.Basic +public import Mathlib.Data.ULift +public import Mathlib.Logic.Function.ULift /-! # The Yoneda embedding @@ -20,6 +22,8 @@ Also the Yoneda lemma, `yonedaLemma : (yoneda_pairing C) ≅ (yoneda_evaluation * [Stacks: Opposite Categories and the Yoneda Lemma](https://stacks.math.columbia.edu/tag/001L) -/ +@[expose] public section + namespace CategoryTheory open Opposite Functor diff --git a/Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean b/Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean index e9b313d7b77f64..cbaf33471d07e0 100644 --- a/Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean +++ b/Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Analysis.Complex.ExponentialBounds -import Mathlib.Analysis.InnerProductSpace.Convex -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Combinatorics.Additive.AP.Three.Defs -import Mathlib.Combinatorics.Pigeonhole +module + +public import Mathlib.Analysis.Complex.ExponentialBounds +public import Mathlib.Analysis.InnerProductSpace.Convex +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Combinatorics.Additive.AP.Three.Defs +public import Mathlib.Combinatorics.Pigeonhole /-! # Behrend's bound on Roth numbers @@ -43,6 +45,8 @@ integer points on that sphere and map them onto `ℕ` in a way that preserves ar 3AP-free, Salem-Spencer, Behrend construction, arithmetic progression, sphere, strictly convex -/ +@[expose] public section + assert_not_exists IsConformalMap Conformal open Nat hiding log diff --git a/Mathlib/Combinatorics/Additive/AP/Three/Defs.lean b/Mathlib/Combinatorics/Additive/AP/Three/Defs.lean index 786a805d3967e5..13653f140f09e7 100644 --- a/Mathlib/Combinatorics/Additive/AP/Three/Defs.lean +++ b/Mathlib/Combinatorics/Additive/AP/Three/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Order.Interval.Finset.Basic -import Mathlib.Combinatorics.Additive.FreimanHom -import Mathlib.Order.Interval.Finset.Fin -import Mathlib.Algebra.Group.Pointwise.Set.Scalar +module + +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Order.Interval.Finset.Basic +public import Mathlib.Combinatorics.Additive.FreimanHom +public import Mathlib.Order.Interval.Finset.Fin +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar /-! # Sets without arithmetic progressions of length three and Roth numbers @@ -44,6 +46,8 @@ the size of the biggest 3AP-free subset of `{0, ..., n - 1}`. 3AP-free, Salem-Spencer, Roth, arithmetic progression, average, three-free -/ +@[expose] public section + assert_not_exists Field Ideal TwoSidedIdeal open Finset Function diff --git a/Mathlib/Combinatorics/Additive/ApproximateSubgroup.lean b/Mathlib/Combinatorics/Additive/ApproximateSubgroup.lean index 3549d9d5b44e95..5342a61c6264ad 100644 --- a/Mathlib/Combinatorics/Additive/ApproximateSubgroup.lean +++ b/Mathlib/Combinatorics/Additive/ApproximateSubgroup.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Combinatorics.Additive.CovBySMul -import Mathlib.Combinatorics.Additive.RuzsaCovering -import Mathlib.Combinatorics.Additive.SmallTripling +module + +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Combinatorics.Additive.CovBySMul +public import Mathlib.Combinatorics.Additive.RuzsaCovering +public import Mathlib.Combinatorics.Additive.SmallTripling /-! # Approximate subgroups @@ -34,6 +36,8 @@ It can be readily confirmed that approximate subgroups are a weakening of subgro * `isApproximateSubgroup_one`: A 1-approximate subgroup is the same thing as a subgroup. -/ +@[expose] public section + open scoped Finset Pointwise variable {G : Type*} [Group G] {A B : Set G} {K L : ℝ} {m n : ℕ} diff --git a/Mathlib/Combinatorics/Additive/CauchyDavenport.lean b/Mathlib/Combinatorics/Additive/CauchyDavenport.lean index 6c1cc09b7737d6..b043c2ebb4ad4a 100644 --- a/Mathlib/Combinatorics/Additive/CauchyDavenport.lean +++ b/Mathlib/Combinatorics/Additive/CauchyDavenport.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.Additive.ETransform -import Mathlib.GroupTheory.Order.Min +module + +public import Mathlib.Combinatorics.Additive.ETransform +public import Mathlib.GroupTheory.Order.Min /-! # The Cauchy-Davenport theorem @@ -49,6 +51,8 @@ Version for `circle`. additive combinatorics, number theory, sumset, cauchy-davenport -/ +@[expose] public section + open Finset Function Monoid MulOpposite Subgroup open scoped Pointwise diff --git a/Mathlib/Combinatorics/Additive/Convolution.lean b/Mathlib/Combinatorics/Additive/Convolution.lean index 6ac99fa45924d1..ad78b7cb197fbf 100644 --- a/Mathlib/Combinatorics/Additive/Convolution.lean +++ b/Mathlib/Combinatorics/Additive/Convolution.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yaël Dillies, Strahinja Gvozdić, Bhavik Mehta. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Strahinja Gvozdić, Bhavik Mehta -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset /-! # Convolution @@ -14,6 +16,8 @@ that maps `x ∈ G` to the number of distinct representations of `x` in the form well as under the left and right actions on `A`, `B`, and the function argument. -/ +@[expose] public section + open MulOpposite MulAction open scoped Pointwise RightActions diff --git a/Mathlib/Combinatorics/Additive/Corner/Defs.lean b/Mathlib/Combinatorics/Additive/Corner/Defs.lean index 327af7bb763c0b..6909ddc9e24dcc 100644 --- a/Mathlib/Combinatorics/Additive/Corner/Defs.lean +++ b/Mathlib/Combinatorics/Additive/Corner/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.Additive.FreimanHom +module + +public import Mathlib.Combinatorics.Additive.FreimanHom /-! # Corners @@ -17,6 +19,8 @@ property of being corner-free. * [Wikipedia, *Corners theorem*](https://en.wikipedia.org/wiki/Corners_theorem) -/ +@[expose] public section + assert_not_exists Field Ideal TwoSidedIdeal open Set diff --git a/Mathlib/Combinatorics/Additive/Corner/Roth.lean b/Mathlib/Combinatorics/Additive/Corner/Roth.lean index 98f7d0c73f75b7..1766df6c0a6170 100644 --- a/Mathlib/Combinatorics/Additive/Corner/Roth.lean +++ b/Mathlib/Combinatorics/Additive/Corner/Roth.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.Additive.AP.Three.Defs -import Mathlib.Combinatorics.Additive.Corner.Defs -import Mathlib.Combinatorics.SimpleGraph.Triangle.Removal -import Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite +module + +public import Mathlib.Combinatorics.Additive.AP.Three.Defs +public import Mathlib.Combinatorics.Additive.Corner.Defs +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Removal +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite /-! # The corners theorem and Roth's theorem @@ -19,6 +21,8 @@ This file proves the corners theorem and Roth's theorem on arithmetic progressio * [Wikipedia, *Corners theorem*](https://en.wikipedia.org/wiki/Corners_theorem) -/ +@[expose] public section + open Finset SimpleGraph TripartiteFromTriangles open Function hiding graph open Fintype (card) diff --git a/Mathlib/Combinatorics/Additive/CovBySMul.lean b/Mathlib/Combinatorics/Additive/CovBySMul.lean index 024ae57dd9ff3f..9ea817ab4b8f27 100644 --- a/Mathlib/Combinatorics/Additive/CovBySMul.lean +++ b/Mathlib/Combinatorics/Additive/CovBySMul.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.Data.Real.Basic -import Mathlib.Tactic.Positivity.Basic +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.Data.Real.Basic +public import Mathlib.Tactic.Positivity.Basic /-! # Relation of covering by cosets @@ -16,6 +18,8 @@ This file defines a predicate for a set to be covered by at most `K` cosets of a This is a fundamental relation to study in additive combinatorics. -/ +@[expose] public section + open scoped Finset Pointwise variable {M N X : Type*} [Monoid M] [Monoid N] [MulAction M X] [MulAction N X] {K L : ℝ} diff --git a/Mathlib/Combinatorics/Additive/Dissociation.lean b/Mathlib/Combinatorics/Additive/Dissociation.lean index fa1025d5f1ac47..a390f48b66451b 100644 --- a/Mathlib/Combinatorics/Additive/Dissociation.lean +++ b/Mathlib/Combinatorics/Additive/Dissociation.lean @@ -3,13 +3,15 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.Group.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Fintype.Pi -import Mathlib.Order.Preorder.Finite +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Order.Preorder.Finite /-! # Dissociation and span @@ -24,6 +26,8 @@ independence and linear span of sets in a vector space but where the scalars are * `Finset.mulSpan`/`Finset.addSpan`: Span of a finset. -/ +@[expose] public section + variable {α β : Type*} [CommGroup α] [CommGroup β] section dissociation diff --git a/Mathlib/Combinatorics/Additive/DoublingConst.lean b/Mathlib/Combinatorics/Additive/DoublingConst.lean index f3a8e74c484ca0..e10a6b1d546b1e 100644 --- a/Mathlib/Combinatorics/Additive/DoublingConst.lean +++ b/Mathlib/Combinatorics/Additive/DoublingConst.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.Additive.PluenneckeRuzsa -import Mathlib.Data.Finset.Density +module + +public import Mathlib.Combinatorics.Additive.PluenneckeRuzsa +public import Mathlib.Data.Finset.Density /-! # Doubling and difference constants @@ -12,6 +14,8 @@ import Mathlib.Data.Finset.Density This file defines the doubling and difference constants of two finsets in a group. -/ +@[expose] public section + open Finset open scoped Pointwise diff --git a/Mathlib/Combinatorics/Additive/ETransform.lean b/Mathlib/Combinatorics/Additive/ETransform.lean index d9d0d295864602..2ff6e9822a0d3a 100644 --- a/Mathlib/Combinatorics/Additive/ETransform.lean +++ b/Mathlib/Combinatorics/Additive/ETransform.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.Algebra.Ring.Nat +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.Algebra.Ring.Nat /-! # e-transforms @@ -28,6 +30,8 @@ as internals of other proofs. Prove the invariance property of the Dyson e-transform. -/ +@[expose] public section + open MulOpposite diff --git a/Mathlib/Combinatorics/Additive/Energy.lean b/Mathlib/Combinatorics/Additive/Energy.lean index a8f17fa5c708a4..6855c49ce56e28 100644 --- a/Mathlib/Combinatorics/Additive/Energy.lean +++ b/Mathlib/Combinatorics/Additive/Energy.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies, Ella Yu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Ella Yu -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Data.Finset.Prod -import Mathlib.Data.Fintype.Prod -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Additive energy @@ -34,6 +36,8 @@ It's possibly interesting to have (whose `card` is `mulEnergy s t`) as a standalone definition. -/ +@[expose] public section + open scoped Pointwise variable {α : Type*} [DecidableEq α] diff --git a/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean b/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean index 1a3a3bd032caa4..96d5447d6a7614 100644 --- a/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean +++ b/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Data.Multiset.Fintype -import Mathlib.FieldTheory.ChevalleyWarning +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Data.Multiset.Fintype +public import Mathlib.FieldTheory.ChevalleyWarning /-! # The Erdős–Ginzburg–Ziv theorem @@ -20,6 +22,8 @@ elements of sum zero. * `ZMod.erdos_ginzburg_ziv`: The Erdős–Ginzburg–Ziv theorem stated using sequences in `ZMod n` -/ +@[expose] public section + open Finset MvPolynomial variable {ι : Type*} diff --git a/Mathlib/Combinatorics/Additive/FreimanHom.lean b/Mathlib/Combinatorics/Additive/FreimanHom.lean index 23d2d97e56ef4d..b3e3d1ac397335 100644 --- a/Mathlib/Combinatorics/Additive/FreimanHom.lean +++ b/Mathlib/Combinatorics/Additive/FreimanHom.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.CharP.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.Order.BigOperators.Group.Multiset -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Data.ZMod.Defs +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.Order.BigOperators.Group.Multiset +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Data.ZMod.Defs /-! # Freiman homomorphisms @@ -60,6 +62,8 @@ an `AddMonoid`/`Monoid` instead of the `AddMonoid`/`Monoid` itself. * Affine maps are Freiman homomorphisms. -/ +@[expose] public section + assert_not_exists Field Ideal TwoSidedIdeal open Multiset Set diff --git a/Mathlib/Combinatorics/Additive/PluenneckeRuzsa.lean b/Mathlib/Combinatorics/Additive/PluenneckeRuzsa.lean index 13db6ff7506309..54ac39babe7439 100644 --- a/Mathlib/Combinatorics/Additive/PluenneckeRuzsa.lean +++ b/Mathlib/Combinatorics/Additive/PluenneckeRuzsa.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Yaël Dillies, George Shakan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, George Shakan -/ -import Mathlib.Algebra.Order.Field.Rat -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Ring -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Order.Field.Rat +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Ring +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # The Plünnecke-Ruzsa inequality @@ -35,6 +37,8 @@ In general non-abelian groups, small doubling doesn't imply small powers anymore does. See `Mathlib/Combinatorics/Additive/SmallTripling.lean`. -/ +@[expose] public section + open MulOpposite Nat open scoped Pointwise namespace Finset diff --git a/Mathlib/Combinatorics/Additive/Randomisation.lean b/Mathlib/Combinatorics/Additive/Randomisation.lean index 11ebcf188813bc..fd34aecc0c186e 100644 --- a/Mathlib/Combinatorics/Additive/Randomisation.lean +++ b/Mathlib/Combinatorics/Additive/Randomisation.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality -import Mathlib.Combinatorics.Additive.Dissociation +module + +public import Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality +public import Mathlib.Combinatorics.Additive.Dissociation /-! # Randomising by a function of dissociated support @@ -17,6 +19,8 @@ Precisely, for `G` a finite abelian group and two functions `c : AddChar G ℂ the same as the average over `a` of the product of the `c ψ + Re (d ψ * ψ a)`. -/ +@[expose] public section + open Finset open scoped BigOperators ComplexConjugate diff --git a/Mathlib/Combinatorics/Additive/RuzsaCovering.lean b/Mathlib/Combinatorics/Additive/RuzsaCovering.lean index 5a4057cd0cbc2c..61c623427c3ee1 100644 --- a/Mathlib/Combinatorics/Additive/RuzsaCovering.lean +++ b/Mathlib/Combinatorics/Additive/RuzsaCovering.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.Data.Real.Basic -import Mathlib.Order.Preorder.Finite -import Mathlib.SetTheory.Cardinal.Finite -import Mathlib.Tactic.Positivity.Finset +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.Data.Real.Basic +public import Mathlib.Order.Preorder.Finite +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.Tactic.Positivity.Finset /-! # Ruzsa's covering lemma @@ -16,6 +18,8 @@ This file proves the Ruzsa covering lemma. This says that, for `A`, `B` finsets, with at most `#(A + B) / #B` copies of `B - B`. -/ +@[expose] public section + open scoped Pointwise variable {G : Type*} [Group G] {K : ℝ} diff --git a/Mathlib/Combinatorics/Additive/SmallTripling.lean b/Mathlib/Combinatorics/Additive/SmallTripling.lean index c75720341ee415..8b0bea7941f124 100644 --- a/Mathlib/Combinatorics/Additive/SmallTripling.lean +++ b/Mathlib/Combinatorics/Additive/SmallTripling.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.Additive.PluenneckeRuzsa -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.Real.Basic -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.Positivity.Finset -import Mathlib.Tactic.Ring +module + +public import Mathlib.Combinatorics.Additive.PluenneckeRuzsa +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.Real.Basic +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.Positivity.Finset +public import Mathlib.Tactic.Ring /-! # Small tripling implies small powers @@ -23,6 +25,8 @@ In abelian groups, the Plünnecke-Ruzsa inequality is the stronger statement tha implies small powers. See `Mathlib/Combinatorics/Additive/PluenneckeRuzsa.lean`. -/ +@[expose] public section + open Fin MulOpposite open List hiding tail open scoped Pointwise diff --git a/Mathlib/Combinatorics/Additive/VerySmallDoubling.lean b/Mathlib/Combinatorics/Additive/VerySmallDoubling.lean index 158e1749ab464d..7eaca93561b33d 100644 --- a/Mathlib/Combinatorics/Additive/VerySmallDoubling.lean +++ b/Mathlib/Combinatorics/Additive/VerySmallDoubling.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Yaël Dillies, Patrick Luo, Bhavik Mehta. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Patrick Luo, Bhavik Mehta -/ -import Mathlib.Algebra.Pointwise.Stabilizer -import Mathlib.Combinatorics.Additive.Convolution -import Mathlib.NumberTheory.Real.GoldenRatio -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Qify +module + +public import Mathlib.Algebra.Pointwise.Stabilizer +public import Mathlib.Combinatorics.Additive.Convolution +public import Mathlib.NumberTheory.Real.GoldenRatio +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Qify /-! # Sets with very small doubling @@ -34,6 +36,8 @@ For a finset `A` in a group, its *doubling* is `#(A * A) / #A`. This file charac * [*Introduction to approximate groups*, Matthew Tointon][tointon2020] -/ +@[expose] public section + open MulOpposite MulAction open scoped Pointwise RightActions diff --git a/Mathlib/Combinatorics/Colex.lean b/Mathlib/Combinatorics/Colex.lean index 6f58ec91d38f11..a935748ace08db 100644 --- a/Mathlib/Combinatorics/Colex.lean +++ b/Mathlib/Combinatorics/Colex.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Alena Gusakov, Yaël Dillies -/ -import Mathlib.Algebra.Order.Ring.GeomSum -import Mathlib.Data.Finset.Slice -import Mathlib.Data.Nat.BitIndices -import Mathlib.Order.SupClosed -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Algebra.Order.Ring.GeomSum +public import Mathlib.Data.Finset.Slice +public import Mathlib.Data.Nat.BitIndices +public import Mathlib.Order.SupClosed +public import Mathlib.Order.UpperLower.Closure /-! # Colexigraphic order @@ -57,6 +59,8 @@ Related files are: colex, colexicographic, binary -/ +@[expose] public section + open Function variable {α β : Type*} diff --git a/Mathlib/Combinatorics/Configuration.lean b/Mathlib/Combinatorics/Configuration.lean index e0bc24f9acc5f0..604d27f4a6161e 100644 --- a/Mathlib/Combinatorics/Configuration.lean +++ b/Mathlib/Combinatorics/Configuration.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Combinatorics.Hall.Basic -import Mathlib.LinearAlgebra.Matrix.Rank -import Mathlib.LinearAlgebra.Projectivization.Constructions +module + +public import Mathlib.Combinatorics.Hall.Basic +public import Mathlib.LinearAlgebra.Matrix.Rank +public import Mathlib.LinearAlgebra.Projectivization.Constructions /-! # Configurations of Points and lines @@ -31,6 +33,8 @@ Together, these four statements say that any two of the following properties imp -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/Derangements/Basic.lean b/Mathlib/Combinatorics/Derangements/Basic.lean index 936e5c7409b4a5..5840b26313c3f1 100644 --- a/Mathlib/Combinatorics/Derangements/Basic.lean +++ b/Mathlib/Combinatorics/Derangements/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Henry Swanson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Henry Swanson -/ -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.GroupTheory.Perm.Option -import Mathlib.Logic.Equiv.Defs -import Mathlib.Logic.Equiv.Option -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.GroupTheory.Perm.Option +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Logic.Equiv.Option +public import Mathlib.Tactic.ApplyFun /-! # Derangements on types @@ -25,6 +27,8 @@ In order to prove the above, we also prove some results about the effect of `Equ on derangements: `RemoveNone.fiber_none` and `RemoveNone.fiber_some`. -/ +@[expose] public section + open Equiv Function diff --git a/Mathlib/Combinatorics/Derangements/Exponential.lean b/Mathlib/Combinatorics/Derangements/Exponential.lean index 7a2c11b53362c0..4b4531ac47bba9 100644 --- a/Mathlib/Combinatorics/Derangements/Exponential.lean +++ b/Mathlib/Combinatorics/Derangements/Exponential.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Henry Swanson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Henry Swanson, Patrick Massot -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.SpecialFunctions.Exponential -import Mathlib.Combinatorics.Derangements.Finite -import Mathlib.Data.Nat.Cast.Field +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.SpecialFunctions.Exponential +public import Mathlib.Combinatorics.Derangements.Finite +public import Mathlib.Data.Nat.Cast.Field /-! # Derangement exponential series @@ -15,6 +17,8 @@ This file proves that the probability of a permutation on n elements being a der The specific lemma is `numDerangements_tendsto_inv_e`. -/ +@[expose] public section + open Filter NormedSpace diff --git a/Mathlib/Combinatorics/Derangements/Finite.lean b/Mathlib/Combinatorics/Derangements/Finite.lean index 113dd205e0eccd..ae587f3df18aaa 100644 --- a/Mathlib/Combinatorics/Derangements/Finite.lean +++ b/Mathlib/Combinatorics/Derangements/Finite.lean @@ -3,17 +3,19 @@ Copyright (c) 2021 Henry Swanson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Henry Swanson -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Combinatorics.Derangements.Basic -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Combinatorics.Derangements.Basic +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Tactic.Ring /-! # Derangements on fintypes This file contains lemmas that describe the cardinality of `derangements α` when `α` is a fintype. -# Main definitions +## Main definitions * `card_derangements_invariant`: A lemma stating that the number of derangements on a type `α` depends only on the cardinality of `α`. @@ -25,6 +27,8 @@ This file contains lemmas that describe the cardinality of `derangements α` whe factorials. -/ +@[expose] public section + open derangements Equiv Fintype diff --git a/Mathlib/Combinatorics/Digraph/Basic.lean b/Mathlib/Combinatorics/Digraph/Basic.lean index 14e1132be0ae73..bf91a2ae3595c9 100644 --- a/Mathlib/Combinatorics/Digraph/Basic.lean +++ b/Mathlib/Combinatorics/Digraph/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Kyle Miller, Jack Cheverton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Jack Cheverton, Jeremy Tan -/ -import Mathlib.Order.CompleteBooleanAlgebra -import Mathlib.Data.Fintype.Pi +module + +public import Mathlib.Order.CompleteBooleanAlgebra +public import Mathlib.Data.Fintype.Pi /-! # Digraphs @@ -32,6 +34,8 @@ of digraphs on `V`. of the complete graph. -/ +@[expose] public section + open Finset Function /-- @@ -167,29 +171,20 @@ instance distribLattice : DistribLattice (Digraph V) := { adj_injective.distribLattice Digraph.Adj (fun _ _ ↦ rfl) fun _ _ ↦ rfl with le := fun G H ↦ ∀ ⦃a b⦄, G.Adj a b → H.Adj a b } -instance completeAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (Digraph V) := - { Digraph.distribLattice with - le := (· ≤ ·) - sup := (· ⊔ ·) - inf := (· ⊓ ·) - compl := HasCompl.compl - sdiff := (· \ ·) - top := Digraph.completeDigraph V - bot := Digraph.emptyDigraph V - le_top := fun _ _ _ _ ↦ trivial - bot_le := fun _ _ _ h ↦ h.elim - sdiff_eq := fun _ _ ↦ rfl - inf_compl_le_bot := fun _ _ _ h ↦ absurd h.1 h.2 - top_le_sup_compl := fun G v w _ ↦ by tauto - sSup := sSup - le_sSup := fun _ G hG _ _ hab ↦ ⟨G, hG, hab⟩ - sSup_le := fun s G hG a b ↦ by - rintro ⟨H, hH, hab⟩ - exact hG _ hH hab - sInf := sInf - sInf_le := fun _ _ hG _ _ hab ↦ hab hG - le_sInf := fun _ _ hG _ _ hab ↦ fun _ hH ↦ hG _ hH hab - iInf_iSup_eq := fun f ↦ by ext; simp [Classical.skolem] } +instance completeAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (Digraph V) where + top := Digraph.completeDigraph V + bot := Digraph.emptyDigraph V + le_top _ _ _ _ := trivial + bot_le _ _ _ h := h.elim + inf_compl_le_bot _ _ _ h := absurd h.1 h.2 + top_le_sup_compl G v w _ := by tauto + le_sSup _ G hG _ _ hab := ⟨G, hG, hab⟩ + sSup_le s G hG a b := by + rintro ⟨H, hH, hab⟩ + exact hG _ hH hab + sInf_le _ _ hG _ _ hab := hab hG + le_sInf _ _ hG _ _ hab _ hH := hG _ hH hab + iInf_iSup_eq f := by ext; simp [Classical.skolem] @[simp] theorem top_adj (v w : V) : (⊤ : Digraph V).Adj v w := trivial diff --git a/Mathlib/Combinatorics/Digraph/Orientation.lean b/Mathlib/Combinatorics/Digraph/Orientation.lean index 817e2110374826..8c37df8edf1bf5 100644 --- a/Mathlib/Combinatorics/Digraph/Orientation.lean +++ b/Mathlib/Combinatorics/Digraph/Orientation.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rida Hamadani. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rida Hamadani -/ -import Mathlib.Combinatorics.Digraph.Basic -import Mathlib.Combinatorics.SimpleGraph.Basic +module + +public import Mathlib.Combinatorics.Digraph.Basic +public import Mathlib.Combinatorics.SimpleGraph.Basic /-! @@ -32,6 +34,8 @@ the edge orientations of `Digraph`. digraph, simple graph, oriented graphs -/ +@[expose] public section + variable {V : Type*} namespace Digraph diff --git a/Mathlib/Combinatorics/Enumerative/Bell.lean b/Mathlib/Combinatorics/Enumerative/Bell.lean index 2c27d91fa0e1ab..fd926e2d244f3f 100644 --- a/Mathlib/Combinatorics/Enumerative/Bell.lean +++ b/Mathlib/Combinatorics/Enumerative/Bell.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Antoine Chambert-Loir & María-Inés de Frutos—Fernández. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María-Inés de Frutos—Fernández, Yu Shao, Beibei Xiong, Weijie Jiang -/ +module -import Mathlib.Data.Nat.Choose.Multinomial -import Mathlib.Data.Nat.Choose.Mul +public import Mathlib.Data.Nat.Choose.Multinomial +public import Mathlib.Data.Nat.Choose.Mul /-! # Bell numbers for multisets @@ -41,6 +42,8 @@ Prove that it actually counts the number of partitions as indicated. -/ +@[expose] public section + open Multiset Nat namespace Multiset diff --git a/Mathlib/Combinatorics/Enumerative/Catalan.lean b/Mathlib/Combinatorics/Enumerative/Catalan.lean index f115edc6bf017d..284ff41d381e28 100644 --- a/Mathlib/Combinatorics/Enumerative/Catalan.lean +++ b/Mathlib/Combinatorics/Enumerative/Catalan.lean @@ -3,12 +3,15 @@ Copyright (c) 2022 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.BigOperators.NatAntidiagonal -import Mathlib.Data.Nat.Choose.Central -import Mathlib.Tactic.Field -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.Positivity +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.BigOperators.NatAntidiagonal +public import Mathlib.Data.Nat.Choose.Central +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.Positivity +import Mathlib.Data.Tree.Basic /-! # Catalan numbers @@ -42,6 +45,8 @@ The proof of `catalan_eq_centralBinom_div` follows https://math.stackexchange.co -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/Enumerative/Composition.lean b/Mathlib/Combinatorics/Enumerative/Composition.lean index ec7cc3923fd38e..8796e1c6c3837f 100644 --- a/Mathlib/Combinatorics/Enumerative/Composition.lean +++ b/Mathlib/Combinatorics/Enumerative/Composition.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Data.Finset.Sort +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Data.Finset.Sort /-! # Compositions @@ -86,6 +88,8 @@ Composition, partition -/ +@[expose] public section + assert_not_exists Field open List diff --git a/Mathlib/Combinatorics/Enumerative/DoubleCounting.lean b/Mathlib/Combinatorics/Enumerative/DoubleCounting.lean index 373b6c93202dc2..dc327d09ae8c28 100644 --- a/Mathlib/Combinatorics/Enumerative/DoubleCounting.lean +++ b/Mathlib/Combinatorics/Enumerative/DoubleCounting.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Ring.Nat +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Ring.Nat /-! # Double countings @@ -33,6 +35,8 @@ For the formulation of double-counting arguments where a bipartite graph is cons bipartite simple graph `G : SimpleGraph V`, see `Mathlib/Combinatorics/SimpleGraph/Bipartite.lean`. -/ +@[expose] public section + assert_not_exists Field open Finset Function Relator diff --git a/Mathlib/Combinatorics/Enumerative/DyckWord.lean b/Mathlib/Combinatorics/Enumerative/DyckWord.lean index a8b07d3062dc34..cf90f9af24eeb2 100644 --- a/Mathlib/Combinatorics/Enumerative/DyckWord.lean +++ b/Mathlib/Combinatorics/Enumerative/DyckWord.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Batteries.Data.List.Count -import Mathlib.Combinatorics.Enumerative.Catalan -import Mathlib.Tactic.Positivity +module + +public import Batteries.Data.List.Count +public import Mathlib.Combinatorics.Enumerative.Catalan +public import Mathlib.Tactic.Positivity +import Mathlib.Data.Tree.Basic /-! # Dyck words @@ -41,6 +44,8 @@ While any two-valued type could have been used for `DyckStep`, a new enumerated to emphasise that the definition of a Dyck word does not depend on that underlying type. -/ +@[expose] public section + open List /-- A `DyckStep` is either `U` or `D`, corresponding to `(` and `)` respectively. -/ @@ -563,7 +568,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: `p.firstReturn` is positive if `p` is nonzero. -/ @[positivity DyckWord.firstReturn _] -def evalDyckWordFirstReturn : PositivityExt where eval {u α} _zα _pα e := do +meta def evalDyckWordFirstReturn : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℕ), ~q(DyckWord.firstReturn $a) => let ra ← core q(inferInstance) q(inferInstance) a diff --git a/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean b/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean index e630afe65a7900..afab13dc476e14 100644 --- a/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean +++ b/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Alex J. Best, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Yaël Dillies -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite /-! # Incidence algebras @@ -67,6 +69,8 @@ Here are some additions to this file that could be made in the future: * [Kung, Rota, Yan, *Combinatorics: The Rota Way, Chapter 3*][kung_rota_yan2009] -/ +@[expose] public section + open Finset OrderDual variable {F 𝕜 𝕝 𝕞 α β : Type*} diff --git a/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean b/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean index f339eacda9f5f2..35492cb58cadcf 100644 --- a/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean +++ b/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Module.BigOperators +module + +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Module.BigOperators /-! # Inclusion-exclusion principle @@ -41,6 +43,8 @@ See also `MeasureTheory.integral_biUnion_eq_sum_powerset` for the version with i * Prove that truncating the series alternatively gives an upper/lower bound to the true value. -/ +@[expose] public section + assert_not_exists Field namespace Finset diff --git a/Mathlib/Combinatorics/Enumerative/Partition.lean b/Mathlib/Combinatorics/Enumerative/Partition.lean index e5e42cc2f1cbcb..ccbf84cb6c4fef 100644 --- a/Mathlib/Combinatorics/Enumerative/Partition.lean +++ b/Mathlib/Combinatorics/Enumerative/Partition.lean @@ -1,179 +1,5 @@ -/- -Copyright (c) 2020 Bhavik Mehta. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Bhavik Mehta --/ -import Mathlib.Combinatorics.Enumerative.Composition -import Mathlib.Tactic.ApplyFun +module -/-! -# Partitions +public import Mathlib.Combinatorics.Enumerative.Partition.Basic -A partition of a natural number `n` is a way of writing `n` as a sum of positive integers, where the -order does not matter: two sums that differ only in the order of their summands are considered the -same partition. This notion is closely related to that of a composition of `n`, but in a composition -of `n` the order does matter. -A summand of the partition is called a part. - -## Main functions - -* `p : Partition n` is a structure, made of a multiset of integers which are all positive and - add up to `n`. - -## Implementation details - -The main motivation for this structure and its API is to show Euler's partition theorem, and -related results. - -The representation of a partition as a multiset is very handy as multisets are very flexible and -already have a well-developed API. - -## TODO - -Link this to Young diagrams. - -## Tags - -Partition - -## References - - --/ - -assert_not_exists Field - -open Multiset - -namespace Nat - -/-- A partition of `n` is a multiset of positive integers summing to `n`. -/ -@[ext] -structure Partition (n : ℕ) where - /-- positive integers summing to `n` -/ - parts : Multiset ℕ - /-- proof that the `parts` are positive -/ - parts_pos : ∀ {i}, i ∈ parts → 0 < i - /-- proof that the `parts` sum to `n` -/ - parts_sum : parts.sum = n -deriving DecidableEq - -namespace Partition - -/-- A composition induces a partition (just convert the list to a multiset). -/ -@[simps] -def ofComposition (n : ℕ) (c : Composition n) : Partition n where - parts := c.blocks - parts_pos hi := c.blocks_pos hi - parts_sum := by rw [Multiset.sum_coe, c.blocks_sum] - -theorem ofComposition_surj {n : ℕ} : Function.Surjective (ofComposition n) := by - rintro ⟨b, hb₁, hb₂⟩ - induction b using Quotient.inductionOn with | _ b => ?_ - exact ⟨⟨b, hb₁, by simpa using hb₂⟩, Partition.ext rfl⟩ - --- The argument `n` is kept explicit here since it is useful in tactic mode proofs to generate the --- proof obligation `l.sum = n`. -/-- Given a multiset which sums to `n`, construct a partition of `n` with the same multiset, but -without the zeros. --/ -@[simps] -def ofSums (n : ℕ) (l : Multiset ℕ) (hl : l.sum = n) : Partition n where - parts := l.filter (· ≠ 0) - parts_pos hi := (of_mem_filter hi).bot_lt - parts_sum := by - have lz : (l.filter (· = 0)).sum = 0 := by simp [sum_eq_zero_iff] - rwa [← filter_add_not (· = 0) l, sum_add, lz, zero_add] at hl - -/-- A `Multiset ℕ` induces a partition on its sum. -/ -@[simps!] -def ofMultiset (l : Multiset ℕ) : Partition l.sum := ofSums _ l rfl - -/-- An element `s` of `Sym σ n` induces a partition given by its multiplicities. -/ -def ofSym {n : ℕ} {σ : Type*} (s : Sym σ n) [DecidableEq σ] : n.Partition where - parts := s.1.dedup.map s.1.count - parts_pos := by simp [Multiset.count_pos] - parts_sum := by - change ∑ a ∈ s.1.toFinset, count a s.1 = n - rw [toFinset_sum_count_eq] - exact s.2 - -variable {n : ℕ} {σ τ : Type*} [DecidableEq σ] [DecidableEq τ] - -@[simp] lemma ofSym_map (e : σ ≃ τ) (s : Sym σ n) : - ofSym (s.map e) = ofSym s := by - simp only [ofSym, Sym.val_eq_coe, Sym.coe_map, mk.injEq] - rw [Multiset.dedup_map_of_injective e.injective] - simp only [map_map, Function.comp_apply] - congr; funext i - rw [← Multiset.count_map_eq_count' e _ e.injective] - -/-- An equivalence between `σ` and `τ` induces an equivalence between the subtypes of `Sym σ n` and -`Sym τ n` corresponding to a given partition. -/ -def ofSymShapeEquiv (μ : Partition n) (e : σ ≃ τ) : - {x : Sym σ n // ofSym x = μ} ≃ {x : Sym τ n // ofSym x = μ} where - toFun := fun x => ⟨Sym.equivCongr e x, by simp [ofSym_map, x.2]⟩ - invFun := fun x => ⟨Sym.equivCongr e.symm x, by simp [ofSym_map, x.2]⟩ - left_inv := by intro x; simp - right_inv := by intro x; simp - -/-- The partition of exactly one part. -/ -def indiscrete (n : ℕ) : Partition n := ofSums n {n} rfl - -instance {n : ℕ} : Inhabited (Partition n) := ⟨indiscrete n⟩ - -@[simp] lemma indiscrete_parts {n : ℕ} (hn : n ≠ 0) : (indiscrete n).parts = {n} := by - simp [indiscrete, filter_eq_self, hn] - -@[simp] lemma partition_zero_parts (p : Partition 0) : p.parts = 0 := - eq_zero_of_forall_notMem fun _ h => (p.parts_pos h).ne' <| sum_eq_zero_iff.1 p.parts_sum _ h - -instance UniquePartitionZero : Unique (Partition 0) where - uniq _ := Partition.ext <| by simp - -@[simp] lemma partition_one_parts (p : Partition 1) : p.parts = {1} := by - have h : p.parts = replicate (card p.parts) 1 := eq_replicate_card.2 fun x hx => - ((le_sum_of_mem hx).trans_eq p.parts_sum).antisymm (p.parts_pos hx) - have h' : card p.parts = 1 := by simpa using (congrArg sum h.symm).trans p.parts_sum - rw [h, h', replicate_one] - -instance UniquePartitionOne : Unique (Partition 1) where - uniq _ := Partition.ext <| by simp - -@[simp] lemma ofSym_one (s : Sym σ 1) : ofSym s = indiscrete 1 := by - ext; simp - -/-- The number of times a positive integer `i` appears in the partition `ofSums n l hl` is the same -as the number of times it appears in the multiset `l`. -(For `i = 0`, `Partition.non_zero` combined with `Multiset.count_eq_zero_of_notMem` gives that -this is `0` instead.) --/ -theorem count_ofSums_of_ne_zero {n : ℕ} {l : Multiset ℕ} (hl : l.sum = n) {i : ℕ} (hi : i ≠ 0) : - (ofSums n l hl).parts.count i = l.count i := - count_filter_of_pos hi - -theorem count_ofSums_zero {n : ℕ} {l : Multiset ℕ} (hl : l.sum = n) : - (ofSums n l hl).parts.count 0 = 0 := - count_filter_of_neg fun h => h rfl - -/-- Show there are finitely many partitions by considering the surjection from compositions to -partitions. --/ -instance (n : ℕ) : Fintype (Partition n) := - Fintype.ofSurjective (ofComposition n) ofComposition_surj - -/-- The finset of those partitions in which every part is odd. -/ -def odds (n : ℕ) : Finset (Partition n) := - Finset.univ.filter fun c => ∀ i ∈ c.parts, ¬Even i - -/-- The finset of those partitions in which each part is used at most once. -/ -def distincts (n : ℕ) : Finset (Partition n) := - Finset.univ.filter fun c => c.parts.Nodup - -/-- The finset of those partitions in which every part is odd and used at most once. -/ -def oddDistincts (n : ℕ) : Finset (Partition n) := - odds n ∩ distincts n - -end Partition - -end Nat +deprecated_module (since := "2025-11-15") diff --git a/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean b/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean new file mode 100644 index 00000000000000..906c9432dfbe3e --- /dev/null +++ b/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean @@ -0,0 +1,222 @@ +/- +Copyright (c) 2020 Bhavik Mehta. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Bhavik Mehta +-/ +module + +public import Mathlib.Algebra.Order.Antidiag.Finsupp +public import Mathlib.Combinatorics.Enumerative.Composition +public import Mathlib.Tactic.ApplyFun + +/-! +# Partitions + +A partition of a natural number `n` is a way of writing `n` as a sum of positive integers, where the +order does not matter: two sums that differ only in the order of their summands are considered the +same partition. This notion is closely related to that of a composition of `n`, but in a composition +of `n` the order does matter. +A summand of the partition is called a part. + +## Main functions + +* `p : Partition n` is a structure, made of a multiset of integers which are all positive and + add up to `n`. + +## Implementation details + +The main motivation for this structure and its API is to show Euler's partition theorem, and +related results. + +The representation of a partition as a multiset is very handy as multisets are very flexible and +already have a well-developed API. + +## TODO + +Link this to Young diagrams. + +## Tags + +Partition + +## References + + +-/ + +@[expose] public section + +assert_not_exists Field + +open Multiset + +namespace Nat + +/-- A partition of `n` is a multiset of positive integers summing to `n`. -/ +@[ext] +structure Partition (n : ℕ) where + /-- positive integers summing to `n` -/ + parts : Multiset ℕ + /-- proof that the `parts` are positive -/ + parts_pos : ∀ {i}, i ∈ parts → 0 < i + /-- proof that the `parts` sum to `n` -/ + parts_sum : parts.sum = n +deriving DecidableEq + +namespace Partition + +attribute [grind →] parts_pos + +@[grind →] +theorem le_of_mem_parts {n : ℕ} {p : Partition n} {m : ℕ} (h : m ∈ p.parts) : m ≤ n := by + simpa [p.parts_sum] using Multiset.le_sum_of_mem h + +/-- A composition induces a partition (just convert the list to a multiset). -/ +@[simps] +def ofComposition (n : ℕ) (c : Composition n) : Partition n where + parts := c.blocks + parts_pos hi := c.blocks_pos hi + parts_sum := by rw [Multiset.sum_coe, c.blocks_sum] + +theorem ofComposition_surj {n : ℕ} : Function.Surjective (ofComposition n) := by + rintro ⟨b, hb₁, hb₂⟩ + induction b using Quotient.inductionOn with | _ b => ?_ + exact ⟨⟨b, hb₁, by simpa using hb₂⟩, Partition.ext rfl⟩ + +-- The argument `n` is kept explicit here since it is useful in tactic mode proofs to generate the +-- proof obligation `l.sum = n`. +/-- Given a multiset which sums to `n`, construct a partition of `n` with the same multiset, but +without the zeros. +-/ +@[simps] +def ofSums (n : ℕ) (l : Multiset ℕ) (hl : l.sum = n) : Partition n where + parts := l.filter (· ≠ 0) + parts_pos hi := (of_mem_filter hi).bot_lt + parts_sum := by + have lz : (l.filter (· = 0)).sum = 0 := by simp [sum_eq_zero_iff] + rwa [← filter_add_not (· = 0) l, sum_add, lz, zero_add] at hl + +/-- A `Multiset ℕ` induces a partition on its sum. -/ +@[simps!] +def ofMultiset (l : Multiset ℕ) : Partition l.sum := ofSums _ l rfl + +/-- An element `s` of `Sym σ n` induces a partition given by its multiplicities. -/ +def ofSym {n : ℕ} {σ : Type*} (s : Sym σ n) [DecidableEq σ] : n.Partition where + parts := s.1.dedup.map s.1.count + parts_pos := by simp [Multiset.count_pos] + parts_sum := by + change ∑ a ∈ s.1.toFinset, count a s.1 = n + rw [toFinset_sum_count_eq] + exact s.2 + +variable {n : ℕ} {σ τ : Type*} [DecidableEq σ] [DecidableEq τ] + +@[simp] lemma ofSym_map (e : σ ≃ τ) (s : Sym σ n) : + ofSym (s.map e) = ofSym s := by + simp only [ofSym, Sym.val_eq_coe, Sym.coe_map, mk.injEq] + rw [Multiset.dedup_map_of_injective e.injective] + simp only [map_map, Function.comp_apply] + congr; funext i + rw [← Multiset.count_map_eq_count' e _ e.injective] + +/-- An equivalence between `σ` and `τ` induces an equivalence between the subtypes of `Sym σ n` and +`Sym τ n` corresponding to a given partition. -/ +def ofSymShapeEquiv (μ : Partition n) (e : σ ≃ τ) : + {x : Sym σ n // ofSym x = μ} ≃ {x : Sym τ n // ofSym x = μ} where + toFun := fun x => ⟨Sym.equivCongr e x, by simp [ofSym_map, x.2]⟩ + invFun := fun x => ⟨Sym.equivCongr e.symm x, by simp [ofSym_map, x.2]⟩ + left_inv := by intro x; simp + right_inv := by intro x; simp + +/-- Convert a `Partition n` to a member of `(Finset.Icc 1 n).finsuppAntidiag n` +(see `Nat.Partition.toFinsuppAntidiag_mem_finsuppAntidiag` for the proof). +`p.toFinsuppAntidiag i` is defined as `i` times the number of occurrence of `i` in `p`. -/ +def toFinsuppAntidiag {n : ℕ} (p : Partition n) : ℕ →₀ ℕ where + toFun m := p.parts.count m * m + support := p.parts.toFinset + mem_support_toFun m := by + suffices m ∈ p.parts → m ≠ 0 by simpa + grind + +theorem toFinsuppAntidiag_injective (n : ℕ) : Function.Injective (toFinsuppAntidiag (n := n)) := by + unfold toFinsuppAntidiag + intro p q h + rw [Finsupp.mk.injEq] at h + obtain ⟨hfinset, hcount⟩ := h + rw [Nat.Partition.ext_iff, Multiset.ext] + intro m + obtain rfl | h0 := Nat.eq_zero_or_pos m + · grind [Multiset.count_eq_zero] + · exact Nat.eq_of_mul_eq_mul_right h0 <| funext_iff.mp hcount m + +theorem toFinsuppAntidiag_mem_finsuppAntidiag {n : ℕ} (p : Partition n) : + p.toFinsuppAntidiag ∈ (Finset.Icc 1 n).finsuppAntidiag n := by + have hp : p.parts.toFinset ⊆ Finset.Icc 1 n := by + grind [Multiset.mem_toFinset, Finset.mem_Icc] + suffices ∑ m ∈ Finset.Icc 1 n, Multiset.count m p.parts * m = n by simpa [toFinsuppAntidiag, hp] + convert ← p.parts_sum + rw [Finset.sum_multiset_count] + apply Finset.sum_subset hp + suffices ∀ (x : ℕ), 1 ≤ x → x ≤ n → x ∉ p.parts → x ∉ p.parts ∨ x = 0 by simpa + grind + +/-- The partition of exactly one part. -/ +def indiscrete (n : ℕ) : Partition n := ofSums n {n} rfl + +instance {n : ℕ} : Inhabited (Partition n) := ⟨indiscrete n⟩ + +@[simp] lemma indiscrete_parts {n : ℕ} (hn : n ≠ 0) : (indiscrete n).parts = {n} := by + simp [indiscrete, filter_eq_self, hn] + +@[simp] lemma partition_zero_parts (p : Partition 0) : p.parts = 0 := + eq_zero_of_forall_notMem fun _ h => (p.parts_pos h).ne' <| sum_eq_zero_iff.1 p.parts_sum _ h + +instance UniquePartitionZero : Unique (Partition 0) where + uniq _ := Partition.ext <| by simp + +@[simp] lemma partition_one_parts (p : Partition 1) : p.parts = {1} := by + have h : p.parts = replicate (card p.parts) 1 := eq_replicate_card.2 fun x hx => + ((le_sum_of_mem hx).trans_eq p.parts_sum).antisymm (p.parts_pos hx) + have h' : card p.parts = 1 := by simpa using (congrArg sum h.symm).trans p.parts_sum + rw [h, h', replicate_one] + +instance UniquePartitionOne : Unique (Partition 1) where + uniq _ := Partition.ext <| by simp + +@[simp] lemma ofSym_one (s : Sym σ 1) : ofSym s = indiscrete 1 := by + ext; simp + +/-- The number of times a positive integer `i` appears in the partition `ofSums n l hl` is the same +as the number of times it appears in the multiset `l`. +(For `i = 0`, `Partition.non_zero` combined with `Multiset.count_eq_zero_of_notMem` gives that +this is `0` instead.) +-/ +theorem count_ofSums_of_ne_zero {n : ℕ} {l : Multiset ℕ} (hl : l.sum = n) {i : ℕ} (hi : i ≠ 0) : + (ofSums n l hl).parts.count i = l.count i := + count_filter_of_pos hi + +theorem count_ofSums_zero {n : ℕ} {l : Multiset ℕ} (hl : l.sum = n) : + (ofSums n l hl).parts.count 0 = 0 := + count_filter_of_neg fun h => h rfl + +/-- Show there are finitely many partitions by considering the surjection from compositions to +partitions. +-/ +instance (n : ℕ) : Fintype (Partition n) := + Fintype.ofSurjective (ofComposition n) ofComposition_surj + +/-- The finset of those partitions in which every part is odd. -/ +def odds (n : ℕ) : Finset (Partition n) := + Finset.univ.filter fun c => ∀ i ∈ c.parts, ¬Even i + +/-- The finset of those partitions in which each part is used at most once. -/ +def distincts (n : ℕ) : Finset (Partition n) := + Finset.univ.filter fun c => c.parts.Nodup + +/-- The finset of those partitions in which every part is odd and used at most once. -/ +def oddDistincts (n : ℕ) : Finset (Partition n) := + odds n ∩ distincts n + +end Partition + +end Nat diff --git a/Mathlib/Combinatorics/Enumerative/Partition/GenFun.lean b/Mathlib/Combinatorics/Enumerative/Partition/GenFun.lean new file mode 100644 index 00000000000000..523c85ea703f33 --- /dev/null +++ b/Mathlib/Combinatorics/Enumerative/Partition/GenFun.lean @@ -0,0 +1,187 @@ +/- +Copyright (c) 2025 Weiyi Wang. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Weiyi Wang +-/ +module + +public import Mathlib.Combinatorics.Enumerative.Partition.Basic +public import Mathlib.RingTheory.PowerSeries.PiTopology + +/-! +# Generating functions for partitions + +This file defines generating functions related to partitions. Given a character function $f(i, c)$ +of a part $i$ and the number of occurrences of the part $c$, the related generating function is +$$ +G_f(X) = \sum_{n = 0}^{\infty} \left(\sum_{p \in P_{n}} \prod_{i \in p} f(i, \#i)\right) X^n += \prod_{i = 1}^{\infty}\left(1 + \sum_{j = 1}^{\infty} f(i, j) X^{ij}\right) +$$ +where $P_n$ is all partitions of $n$, $\#i$ is the count of $i$ in the partition $p$. +We give the definition `Nat.Partition.genFun` using the first equation, and prove the second +equation in `Nat.Partition.hasProd_genFun` (with shifted indices). + +This generating function can be specialized to +* When $f(i, c) = 1$, this is the generating function for partition function $p(n)$. +* When $f(i, 1) = 1$ and $f(i, c) = 0$ for $c > 1$, this is the generating function for + `#(Nat.Partition.distincts n)`. +* When $f(i, c) = 1$ for odd $i$ and $f(i, c) = 0$ for even $i$, this is the generating function for + `#(Nat.Partition.odds n)`. +(TODO: prove these) + +The definition of `Nat.Partition.genFun` ignores the value of $f(0, c)$ and $f(i, 0)$. The formula +can be interpreted as assuming $f(i, 0) = 1$ and $f(0, c) = 0$ for $c \ne 0$. In theory we could +respect the actual value of $f(0, c)$ and $f(i, 0)$, but it makes the otherwise finite sum and +product potentially infinite. +-/ + +@[expose] public section + +open Finset PowerSeries +open scoped PowerSeries.WithPiTopology + +namespace Nat.Partition +variable {R : Type*} [CommSemiring R] + +/-- Generating function associated with character $f(i, c)$ for partition functions, where $i$ is a +part of the partition, and $c$ is the count of that part in the partition. The character function is +multiplied within one `n.Partition`, and summed among all `n.Partition` for a fixed `n`. This way, +each `n` is assigned a value, which we use as the coefficients of the power series. + +See the module docstring of `Combinatorics.Enumerative.Partition.GenFun` for more details. -/ +def genFun (f : ℕ → ℕ → R) : R⟦X⟧ := + PowerSeries.mk fun n ↦ ∑ p : n.Partition, p.parts.toFinsupp.prod f + +@[simp] +lemma coeff_genFun (f : ℕ → ℕ → R) (n : ℕ) : + (genFun f).coeff n = ∑ p : n.Partition, p.parts.toFinsupp.prod f := + PowerSeries.coeff_mk _ _ + +variable [TopologicalSpace R] + +/-- The infinite sum in the formula `Nat.Partition.hasProd_genFun` always converges. -/ +theorem summable_genFun_term (f : ℕ → ℕ → R) (i : ℕ) : + Summable fun j ↦ f (i + 1) (j + 1) • (X : R⟦X⟧) ^ ((i + 1) * (j + 1)) := by + nontriviality R + apply WithPiTopology.summable_of_tendsto_order_atTop_nhds_top + refine ENat.tendsto_nhds_top_iff_natCast_lt.mpr (fun n ↦ Filter.eventually_atTop.mpr ⟨n, ?_⟩) + intro m hm + grw [PowerSeries.smul_eq_C_mul, ← le_order_mul] + refine lt_add_of_nonneg_of_lt (by simp) ?_ + rw [order_X_pow] + norm_cast + grind + +/-- Alternative form of `summable_genFun_term` that unshifts the first index. -/ +theorem summable_genFun_term' (f : ℕ → ℕ → R) {i : ℕ} (hi : i ≠ 0) : + Summable fun j ↦ f i (j + 1) • (X : R⟦X⟧) ^ (i * (j + 1)) := by + obtain ⟨a, rfl⟩ := Nat.exists_eq_add_one_of_ne_zero hi + apply summable_genFun_term + +variable [T2Space R] + +private theorem aux_dvd_of_coeff_ne_zero {f : ℕ → ℕ → R} {d : ℕ} {s : Finset ℕ} (hs0 : 0 ∉ s) + {g : ℕ →₀ ℕ} (hg : g ∈ s.finsuppAntidiag d) + (hprod : ∀ i ∈ s, (coeff (g i)) (1 + ∑' j, f i (j + 1) • X ^ (i * (j + 1))) ≠ (0 : R)) (x : ℕ) : + x ∣ g x := by + by_cases hx : x ∈ s + · specialize hprod x hx + contrapose! hprod + have hx0 : x ≠ 0 := fun h ↦ hs0 (h ▸ hx) + rw [map_add, (summable_genFun_term' f hx0).map_tsum _ (WithPiTopology.continuous_coeff _ _)] + rw [show (0 : R) = 0 + ∑' (i : ℕ), 0 by simp] + congrm (?_ + ∑' (i : ℕ), ?_) + · suffices g x ≠ 0 by simp [this] + contrapose! hprod + simp [hprod] + · rw [map_smul, coeff_X_pow] + apply smul_eq_zero_of_right + suffices g x ≠ x * (i + 1) by simp [this] + contrapose! hprod + simp [hprod] + · suffices g x = 0 by simp [this] + contrapose! hx + exact mem_of_subset (mem_finsuppAntidiag.mp hg).2 <| by simpa using hx + +private theorem aux_prod_coeff_eq_zero_of_notMem_range (f : ℕ → ℕ → R) {d : ℕ} {s : Finset ℕ} + (hs0 : 0 ∉ s) {g : ℕ →₀ ℕ} (hg : g ∈ s.finsuppAntidiag d) + (hg' : g ∉ Set.range (toFinsuppAntidiag (n := d))) : + ∏ i ∈ s, (coeff (g i)) (1 + ∑' j, f i (j + 1) • X ^ (i * (j + 1)) : R⟦X⟧) = 0 := by + suffices ∃ i ∈ s, (coeff (g i)) ((1 : R⟦X⟧) + ∑' j, f i (j + 1) • X ^ (i * (j + 1))) = 0 by + obtain ⟨i, hi, hi'⟩ := this + apply prod_eq_zero hi hi' + contrapose! hg' with hprod + rw [Set.mem_range] + have hgne0 (i : ℕ) : g i ≠ 0 ↔ i ≠ 0 ∧ i ≤ g i := by + refine ⟨fun h ↦ ⟨?_, ?_⟩, by grind⟩ + · contrapose! hs0 with rfl + exact mem_of_subset (mem_finsuppAntidiag.mp hg).2 (by simpa using h) + · exact Nat.le_of_dvd (Nat.pos_of_ne_zero h) <| aux_dvd_of_coeff_ne_zero hs0 hg hprod _ + refine ⟨Nat.Partition.mk (Finsupp.mk g.support (fun i ↦ g i / i) ?_).toMultiset ?_ ?_, ?_⟩ + · simpa using hgne0 + · suffices ∀ i, g i ≠ 0 → i ≠ 0 by simpa [Nat.pos_iff_ne_zero] + exact fun i h ↦ ((hgne0 i).mp h).1 + · obtain ⟨h1, h2⟩ := mem_finsuppAntidiag.mp hg + refine Eq.trans ?_ h1 + suffices ∑ x ∈ g.support, g x / x * x = ∑ x ∈ s, g x by simpa [Finsupp.sum] + apply sum_subset_zero_on_sdiff h2 (by simp) + exact fun x hx ↦ Nat.div_mul_cancel <| aux_dvd_of_coeff_ne_zero hs0 hg hprod x + · ext x + simpa [toFinsuppAntidiag] using Nat.div_mul_cancel <| aux_dvd_of_coeff_ne_zero hs0 hg hprod x + +private theorem aux_prod_f_eq_prod_coeff (f : ℕ → ℕ → R) {n : ℕ} (p : Partition n) {s : Finset ℕ} + (hs : Icc 1 n ⊆ s) (hs0 : 0 ∉ s) : + p.parts.toFinsupp.prod f = + ∏ i ∈ s, coeff (p.toFinsuppAntidiag i) (1 + ∑' j, f i (j + 1) • X ^ (i * (j + 1))) := by + simp_rw [Finsupp.prod, Multiset.toFinsupp_support, Multiset.toFinsupp_apply] + apply prod_subset_one_on_sdiff + · grind [Multiset.mem_toFinset, mem_Icc] + · intro x hx + rw [mem_sdiff, Multiset.mem_toFinset] at hx + have hx0 : x ≠ 0 := fun h ↦ hs0 (h ▸ hx.1) + have hsum := (summable_genFun_term' f hx0).map_tsum _ + (WithPiTopology.continuous_constantCoeff R) + simp [toFinsuppAntidiag, hsum, hx.2, hx0] + · intro i hi + rw [Multiset.mem_toFinset] at hi + have hi0 : i ≠ 0 := (p.parts_pos hi).ne.symm + rw [map_add, (summable_genFun_term' f hi0).map_tsum _ (WithPiTopology.continuous_coeff _ _)] + suffices f i (Multiset.count i p.parts) = + ∑' j, if Multiset.count i p.parts * i = i * (j + 1) then f i (j + 1) else 0 by + simpa [toFinsuppAntidiag, hi, hi0, coeff_X_pow] + rw [tsum_eq_single (Multiset.count i p.parts - 1) ?_] + · rw [mul_comm] + simp [Nat.sub_add_cancel (Multiset.one_le_count_iff_mem.mpr hi)] + intro b hb + suffices Multiset.count i p.parts * i ≠ i * (b + 1) by simp [this] + rw [mul_comm i, (mul_left_inj' (Nat.ne_zero_of_lt (p.parts_pos hi))).ne] + grind + +theorem hasProd_genFun (f : ℕ → ℕ → R) : + HasProd (fun i ↦ 1 + ∑' j, f (i + 1) (j + 1) • X ^ ((i + 1) * (j + 1))) (genFun f) := by + rw [HasProd, WithPiTopology.tendsto_iff_coeff_tendsto] + refine fun d ↦ tendsto_atTop_of_eventually_const (fun s (hs : s ≥ range d) ↦ ?_) + have : ∏ i ∈ s, ((1 : R⟦X⟧) + ∑' j, f (i + 1) (j + 1) • X ^ ((i + 1) * (j + 1))) + = ∏ i ∈ s.map (addRightEmbedding 1), (1 + ∑' j, f i (j + 1) • X ^ (i * (j + 1))) := by simp + rw [this] + have hs : Icc 1 d ⊆ s.map (addRightEmbedding 1) := by + intro i + suffices 1 ≤ i → i ≤ d → ∃ a ∈ s, a + 1 = i by simpa + intro h1 h2 + refine ⟨i - 1, mem_of_subset hs ?_, ?_⟩ <;> grind + rw [coeff_genFun, coeff_prod] + refine (sum_of_injOn toFinsuppAntidiag (toFinsuppAntidiag_injective d).injOn ?_ ?_ ?_).symm + · intro p _ + exact mem_of_subset (finsuppAntidiag_mono hs.le _) p.toFinsuppAntidiag_mem_finsuppAntidiag + · exact fun g hg hg' ↦ aux_prod_coeff_eq_zero_of_notMem_range f (by simp) hg (by simpa using hg') + · exact fun p _ ↦ aux_prod_f_eq_prod_coeff f p hs.le (by simp) + +theorem multipliable_genFun (f : ℕ → ℕ → R) : + Multipliable fun i ↦ (1 : R⟦X⟧) + ∑' j, f (i + 1) (j + 1) • X ^ ((i + 1) * (j + 1)) := + (hasProd_genFun f).multipliable + +theorem genFun_eq_tprod (f : ℕ → ℕ → R) : + genFun f = ∏' i, (1 + ∑' j, f (i + 1) (j + 1) • X ^ ((i + 1) * (j + 1))) := + (hasProd_genFun f).tprod_eq.symm + +end Nat.Partition diff --git a/Mathlib/Combinatorics/Enumerative/Stirling.lean b/Mathlib/Combinatorics/Enumerative/Stirling.lean index 4d32f513ecf09c..91d355bddfd3df 100644 --- a/Mathlib/Combinatorics/Enumerative/Stirling.lean +++ b/Mathlib/Combinatorics/Enumerative/Stirling.lean @@ -3,29 +3,29 @@ Copyright (c) 2025 Beibei Xiong. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Beibei Xiong, Yu Shao, Weijie Jiang, Zhengfeng Yang -/ -import Mathlib.Tactic.Ring -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Data.Nat.Choose.Basic +module + +public import Mathlib.Tactic.Ring +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.Nat.Choose.Basic /-! # Stirling Numbers This file defines Stirling numbers of the first and second kinds, proves their fundamental recurrence relations, and establishes some of their key properties and identities. --/ -/-! -# The Stirling numbers of the first kind +## The Stirling numbers of the first kind The unsigned Stirling numbers of the first kind, represent the number of ways to partition `n` distinct elements into `k` non-empty cycles. -# The Stirling numbers of the second kind +## The Stirling numbers of the second kind The Stirling numbers of the second kind, represent the number of ways to partition `n` distinct elements into `k` non-empty subsets. -# Main definitions +## Main definitions * `Nat.stirlingFirst`: the number of ways to partition `n` distinct elements into `k` non-empty cycles, defined by the recursive relationship it satisfies. @@ -37,6 +37,8 @@ The Stirling numbers of the second kind, represent the number of ways to partiti * [Knuth, *The Art of Computer Programming*, Volume 1, §1.2.6][knuth1997] -/ +@[expose] public section + open Nat namespace Nat diff --git a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean index e1ee27bf4abd95..b4e4c5247700d6 100644 --- a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean +++ b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.Additive.AP.Three.Behrend -import Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite -import Mathlib.Tactic.Rify +module + +public import Mathlib.Combinatorics.Additive.AP.Three.Behrend +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite +public import Mathlib.Tactic.Rify /-! # The Ruzsa-Szemerédi problem @@ -25,6 +27,8 @@ original set. `Ω((n ^ 2 * exp (-4 * √(log n))))` edges such that each edge belongs to exactly one triangle. -/ +@[expose] public section + open Finset Nat Real SimpleGraph Sum3 SimpleGraph.TripartiteFromTriangles open Fintype (card) open scoped Pointwise diff --git a/Mathlib/Combinatorics/Graph/Basic.lean b/Mathlib/Combinatorics/Graph/Basic.lean index 0301ed60ecd02f..161b4c1da48630 100644 --- a/Mathlib/Combinatorics/Graph/Basic.lean +++ b/Mathlib/Combinatorics/Graph/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson, Jun Kwon -/ -import Mathlib.Data.Set.Basic -import Mathlib.Data.Sym.Sym2 +module + +public import Mathlib.Data.Set.Basic +public import Mathlib.Data.Sym.Sym2 /-! # Multigraphs @@ -61,6 +63,8 @@ refer to the `vertexSet` and `edgeSet` of `G : Graph α β`. If `G.IsLink e x y` then we refer to `e` as `edge` and `x` and `y` as `left` and `right` in names. -/ +@[expose] public section + variable {α β : Type*} {x y z u v w : α} {e f : β} open Set diff --git a/Mathlib/Combinatorics/HalesJewett.lean b/Mathlib/Combinatorics/HalesJewett.lean index 8c7a7c3785d5f1..ee3affbca30bfc 100644 --- a/Mathlib/Combinatorics/HalesJewett.lean +++ b/Mathlib/Combinatorics/HalesJewett.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.Data.Fintype.Option -import Mathlib.Data.Fintype.Shrink -import Mathlib.Data.Fintype.Sum -import Mathlib.Data.Finite.Prod -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Fintype.Option +public import Mathlib.Data.Fintype.Shrink +public import Mathlib.Data.Fintype.Sum +public import Mathlib.Data.Finite.Prod +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # The Hales-Jewett theorem @@ -64,6 +66,8 @@ combinatorial line, Ramsey theory, arithmetic progression -/ +@[expose] public section + open Function open scoped Finset diff --git a/Mathlib/Combinatorics/Hall/Basic.lean b/Mathlib/Combinatorics/Hall/Basic.lean index 8de11e693ce181..a7901fab6dd78e 100644 --- a/Mathlib/Combinatorics/Hall/Basic.lean +++ b/Mathlib/Combinatorics/Hall/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Alena Gusakov, Bhavik Mehta, Kyle Miller. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Alena Gusakov, Bhavik Mehta, Kyle Miller -/ -import Mathlib.Combinatorics.Hall.Finite -import Mathlib.CategoryTheory.CofilteredSystem -import Mathlib.Data.Rel +module + +public import Mathlib.Combinatorics.Hall.Finite +public import Mathlib.CategoryTheory.CofilteredSystem +public import Mathlib.Data.Rel /-! # Hall's Marriage Theorem @@ -46,6 +48,8 @@ The core of this module is constructing the inverse system: for every finite sub Hall's Marriage Theorem, indexed families -/ +@[expose] public section + open Finset Function CategoryTheory open scoped SetRel diff --git a/Mathlib/Combinatorics/Hall/Finite.lean b/Mathlib/Combinatorics/Hall/Finite.lean index e517d5b1ab9487..2bd60df375e6b2 100644 --- a/Mathlib/Combinatorics/Hall/Finite.lean +++ b/Mathlib/Combinatorics/Hall/Finite.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Alena Gusakov, Bhavik Mehta, Kyle Miller. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Alena Gusakov, Bhavik Mehta, Kyle Miller -/ -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Fintype.Powerset -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Data.Set.Finite.Basic /-! # Hall's Marriage Theorem for finite index types @@ -33,6 +35,8 @@ A description of this formalization is in [Gusakov2021]. Hall's Marriage Theorem, indexed families -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/Hindman.lean b/Mathlib/Combinatorics/Hindman.lean index 71e5b770b2395e..4ae7a7b18dcb40 100644 --- a/Mathlib/Combinatorics/Hindman.lean +++ b/Mathlib/Combinatorics/Hindman.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.Data.Stream.Init -import Mathlib.Topology.Algebra.Semigroup -import Mathlib.Topology.Compactification.StoneCech -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Stream.Init +public import Mathlib.Topology.Algebra.Semigroup +public import Mathlib.Topology.Compactification.StoneCech +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Hindman's theorem on finite sums @@ -41,6 +43,8 @@ Ramsey theory, ultrafilter -/ +@[expose] public section + open Filter diff --git a/Mathlib/Combinatorics/Matroid/Basic.lean b/Mathlib/Combinatorics/Matroid/Basic.lean index d3a378b0f2b518..e98738470e6dd5 100644 --- a/Mathlib/Combinatorics/Matroid/Basic.lean +++ b/Mathlib/Combinatorics/Matroid/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Set.Card -import Mathlib.Data.Set.Finite.Powerset -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Set.Card +public import Mathlib.Data.Set.Finite.Powerset +public import Mathlib.Order.UpperLower.Closure /-! # Matroids @@ -160,6 +162,8 @@ There are a few design decisions worth discussing. Proc. Amer. Math. Soc. 144 (2016), 459-471][bowlerGeschke2015] -/ +@[expose] public section + assert_not_exists Field open Set diff --git a/Mathlib/Combinatorics/Matroid/Circuit.lean b/Mathlib/Combinatorics/Matroid/Circuit.lean index 6ff4d6b2cb6582..a66d753c6517cb 100644 --- a/Mathlib/Combinatorics/Matroid/Circuit.lean +++ b/Mathlib/Combinatorics/Matroid/Circuit.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Closure +module + +public import Mathlib.Combinatorics.Matroid.Closure /-! # Matroid IsCircuits @@ -13,7 +15,7 @@ A matroid is determined by its set of circuits, and often the circuits offer a more compact description of a matroid than the collection of independent sets or bases. In matroids arising from graphs, circuits correspond to graphical cycles. -# Main Declarations +## Main Declarations * `Matroid.IsCircuit M C` means that `C` is minimally dependent in `M`. * For an `Indep`endent set `I` whose closure contains an element `e ∉ I`, @@ -36,7 +38,7 @@ In matroids arising from graphs, circuits correspond to graphical cycles. * `Matroid.IsBase.mem_fundCocircuit_iff_mem_fundCircuit` : `e` is in the fundamental circuit for `B` and `f` iff `f` is in the fundamental cocircuit for `B` and `e`. -# Implementation Details +## Implementation Details Since `Matroid.fundCircuit M e I` is only sensible if `I` is independent and `e ∈ M.closure I \ I`, to avoid hypotheses being explicitly included in the definition, @@ -47,6 +49,8 @@ The definition is chosen so that the junk values satisfy These make the useful statement `e ∈ M.fundCircuit e I ⊆ insert e I` true unconditionally. -/ +@[expose] public section + variable {α : Type*} {M : Matroid α} {C C' I X Y R : Set α} {e f x y : α} open Set diff --git a/Mathlib/Combinatorics/Matroid/Closure.lean b/Mathlib/Combinatorics/Matroid/Closure.lean index 3b78a1a2565a8a..e4f88aacea940c 100644 --- a/Mathlib/Combinatorics/Matroid/Closure.lean +++ b/Mathlib/Combinatorics/Matroid/Closure.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Map -import Mathlib.Order.Closure -import Mathlib.Order.CompleteLatticeIntervals +module + +public import Mathlib.Combinatorics.Matroid.Map +public import Mathlib.Order.Closure +public import Mathlib.Order.CompleteLatticeIntervals /-! # Matroid Closure @@ -76,6 +78,8 @@ In lemma names, the words `spanning` and `isFlat` are used as suffixes, for instance we have `ground_spanning` rather than `spanning_ground`. -/ +@[expose] public section + assert_not_exists Field open Set diff --git a/Mathlib/Combinatorics/Matroid/Constructions.lean b/Mathlib/Combinatorics/Matroid/Constructions.lean index 3ff58ad7d498d0..c50fac327a1e3e 100644 --- a/Mathlib/Combinatorics/Matroid/Constructions.lean +++ b/Mathlib/Combinatorics/Matroid/Constructions.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Minor.Restrict +module + +public import Mathlib.Combinatorics.Matroid.Minor.Restrict /-! # Some constructions of matroids @@ -29,6 +31,8 @@ and then construct the other examples using duality and restriction. -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} {M : Matroid α} {E B I X R J : Set α} diff --git a/Mathlib/Combinatorics/Matroid/Dual.lean b/Mathlib/Combinatorics/Matroid/Dual.lean index e573a3af63839d..4bc014c2d5f42b 100644 --- a/Mathlib/Combinatorics/Matroid/Dual.lean +++ b/Mathlib/Combinatorics/Matroid/Dual.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.IndepAxioms +module + +public import Mathlib.Combinatorics.Matroid.IndepAxioms /-! # Matroid Duality @@ -28,6 +30,8 @@ This is an abbreviation for `M✶.Indep X`, but has its own name for the sake of base `B` of `M`. -/ +@[expose] public section + assert_not_exists Field open Set diff --git a/Mathlib/Combinatorics/Matroid/IndepAxioms.lean b/Mathlib/Combinatorics/Matroid/IndepAxioms.lean index 87610e1250537b..379e518e42d4db 100644 --- a/Mathlib/Combinatorics/Matroid/IndepAxioms.lean +++ b/Mathlib/Combinatorics/Matroid/IndepAxioms.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Basic -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Combinatorics.Matroid.Basic +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.Interval.Finset.Nat /-! # Matroid Independence and Basis axioms @@ -85,6 +87,8 @@ for the inverse of `e`). * `Matroid.ofIsBaseOfFinite` constructs a `Finite` matroid from its bases. -/ +@[expose] public section + assert_not_exists Field open Set Matroid diff --git a/Mathlib/Combinatorics/Matroid/Init.lean b/Mathlib/Combinatorics/Matroid/Init.lean index 0ba1866f02d1e5..d81731640039ef 100644 --- a/Mathlib/Combinatorics/Matroid/Init.lean +++ b/Mathlib/Combinatorics/Matroid/Init.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Init -import Aesop +module + +public import Mathlib.Init +public import Aesop /-! # Matroid Rule Set @@ -14,4 +16,6 @@ This module defines the `Matroid` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ +@[expose] public section + declare_aesop_rule_sets [Matroid] diff --git a/Mathlib/Combinatorics/Matroid/Loop.lean b/Mathlib/Combinatorics/Matroid/Loop.lean index a087342a6d18f8..415d778088bae0 100644 --- a/Mathlib/Combinatorics/Matroid/Loop.lean +++ b/Mathlib/Combinatorics/Matroid/Loop.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Circuit -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Combinatorics.Matroid.Circuit +public import Mathlib.Tactic.TFAE /-! # Matroid loops and coloops @@ -52,6 +54,8 @@ For `M` : Matroid `α`: * `M.removeLoops` is the matroid obtained from `M` by restricting to its set of nonloop elements. -/ +@[expose] public section + variable {α β : Type*} {M N : Matroid α} {e f : α} {F X C I : Set α} open Set diff --git a/Mathlib/Combinatorics/Matroid/Map.lean b/Mathlib/Combinatorics/Matroid/Map.lean index 2ea353e1cda49a..01f2984a09d514 100644 --- a/Mathlib/Combinatorics/Matroid/Map.lean +++ b/Mathlib/Combinatorics/Matroid/Map.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Constructions -import Mathlib.Data.Set.Notation +module + +public import Mathlib.Combinatorics.Matroid.Constructions +public import Mathlib.Data.Set.Notation /-! # Maps between matroids @@ -101,6 +103,8 @@ For this reason, `Matroid.map` requires injectivity to be well-defined in genera * [J. Oxley, Matroid Theory][oxley2011] -/ +@[expose] public section + assert_not_exists Field open Set Function Set.Notation diff --git a/Mathlib/Combinatorics/Matroid/Minor/Contract.lean b/Mathlib/Combinatorics/Matroid/Minor/Contract.lean index d319a8695aa167..3fad25d786ae52 100644 --- a/Mathlib/Combinatorics/Matroid/Minor/Contract.lean +++ b/Mathlib/Combinatorics/Matroid/Minor/Contract.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Minor.Delete -import Mathlib.Tactic.TautoSet +module + +public import Mathlib.Combinatorics.Matroid.Minor.Delete +public import Mathlib.Tactic.TautoSet /-! # Matroid Contraction @@ -23,7 +25,7 @@ While this is perhaps less intuitive, we use this very concise expression as the and prove with the lemma `Matroid.IsBasis.contract_indep_iff` that this is equivalent to the more verbose definition above. -# Main Declarations +## Main Declarations * `Matroid.contract M C`, written `M / C`, is the matroid on ground set `M.E \ C` in which a set `I ⊆ M.E \ C` is independent if and only if `I ∪ J` is independent in `M`, @@ -34,12 +36,14 @@ the more verbose definition above. sets of `M / C` are exactly the `J ⊆ M.E \ C` for which `I ∪ J` is independent in `M`. * `Matroid.contract_delete_comm` : `M / C \ D = M \ D / C` for disjoint `C` and `D`. -# Naming conventions +## Naming conventions Mirroring the convention for deletion, we use the abbreviation `contractElem` in lemma names to refer to the contraction `M / {e}` of a single element `e : α` from `M : Matroid α`. -/ +@[expose] public section + open Set variable {α : Type*} {M M' N : Matroid α} {e f : α} {I J R D B X Y Z K : Set α} diff --git a/Mathlib/Combinatorics/Matroid/Minor/Delete.lean b/Mathlib/Combinatorics/Matroid/Minor/Delete.lean index b1a1c01d71258b..ccbf30162a04d0 100644 --- a/Mathlib/Combinatorics/Matroid/Minor/Delete.lean +++ b/Mathlib/Combinatorics/Matroid/Minor/Delete.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Loop +module + +public import Mathlib.Combinatorics.Matroid.Loop /-! # Matroid Deletion @@ -21,17 +23,19 @@ the relation `M ↾ R ≤r M` holds only with the assumption `R ⊆ M.E`, whereas `M \ D`, being defined as `M ↾ (M.E \ D)`, satisfies `M \ D ≤r M` unconditionally. This is often quite convenient. -# Main Declarations +## Main Declarations * `Matroid.delete M D`, written `M \ D`, is the restriction of `M` to the set `M.E \ D`, or equivalently the matroid on `M.E \ D` whose independent sets are the `M`-independent sets. -# Naming conventions +## Naming conventions We use the abbreviation `deleteElem` in lemma names to refer to the deletion `M \ {e}` of a single element `e : α` from `M : Matroid α`. -/ +@[expose] public section + open Set variable {α : Type*} {M M' N : Matroid α} {e f : α} {I B D R X : Set α} diff --git a/Mathlib/Combinatorics/Matroid/Minor/Order.lean b/Mathlib/Combinatorics/Matroid/Minor/Order.lean index c482c04adb9dbd..6593b00c9dcfaf 100644 --- a/Mathlib/Combinatorics/Matroid/Minor/Order.lean +++ b/Mathlib/Combinatorics/Matroid/Minor/Order.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Combinatorics.Matroid.Minor.Contract +module + +public import Mathlib.Combinatorics.Matroid.Minor.Contract /-! # Matroid Minors @@ -17,7 +19,7 @@ Although we provide a `PartialOrder` instance on `Matroid α` corresponding to t we do not use the `M ≤ N` / `N < M` notation directly, instead writing `N ≤m M` and `N (unop b ⟶ unop a)ᵒᵖ⟩ /-- The opposite of an arrow in `V`. -/ +@[to_dual self (reorder := 3 4)] def Hom.op {V} [Quiver V] {X Y : V} (f : X ⟶ Y) : op Y ⟶ op X := ⟨f⟩ /-- Given an arrow in `Vᵒᵖ`, we can take the "unopposite" back in `V`. -/ +@[to_dual self (reorder := 3 4)] def Hom.unop {V} [Quiver V] {X Y : Vᵒᵖ} (f : X ⟶ Y) : unop Y ⟶ unop X := Opposite.unop f /-- The bijection `(X ⟶ Y) ≃ (op Y ⟶ op X)`. -/ -@[simps] +@[simps, to_dual self (reorder := 3 4)] def Hom.opEquiv {V} [Quiver V] {X Y : V} : (X ⟶ Y) ≃ (Opposite.op Y ⟶ Opposite.op X) where toFun := Opposite.op @@ -71,64 +80,70 @@ def Empty (V : Type u) : Type u := V instance emptyQuiver (V : Type u) : Quiver.{u} (Empty V) := ⟨fun _ _ => PEmpty⟩ -@[simp] +@[simp, to_dual self (reorder := 2 3)] theorem empty_arrow {V : Type u} (a b : Empty V) : (a ⟶ b) = PEmpty := rfl /-- A quiver is thin if it has no parallel arrows. -/ +@[to_dual IsThin' /-- `isThin'` is equivalent to `IsThin`. +It is used by `@[to_dual]` to be able to translate `IsThin`. -/] abbrev IsThin (V : Type u) [Quiver V] : Prop := ∀ a b : V, Subsingleton (a ⟶ b) section -variable {V : Type*} [Quiver V] +variable {V : Type*} [Quiver V] {X Y X' Y' : V} /-- An arrow in a quiver can be transported across equalities between the source and target objects. -/ -def homOfEq {X Y : V} (f : X ⟶ Y) {X' Y' : V} (hX : X = X') (hY : Y = Y') : X' ⟶ Y' := by +@[to_dual self (reorder := 3 4, 5 6, 8 9)] +def homOfEq (f : X ⟶ Y) (hX : X = X') (hY : Y = Y') : X' ⟶ Y' := by subst hX hY exact f -@[simp] -lemma homOfEq_trans {X Y : V} (f : X ⟶ Y) {X' Y' : V} (hX : X = X') (hY : Y = Y') +@[simp, to_dual self (reorder := 3 4, 5 6, 8 9, 10 11, 12 13)] +lemma homOfEq_trans (f : X ⟶ Y) (hX : X = X') (hY : Y = Y') {X'' Y'' : V} (hX' : X' = X'') (hY' : Y' = Y'') : homOfEq (homOfEq f hX hY) hX' hY' = homOfEq f (hX.trans hX') (hY.trans hY') := by subst hX hY hX' hY' rfl -lemma homOfEq_injective {X X' Y Y' : V} (hX : X = X') (hY : Y = Y') +@[to_dual self (reorder := 3 4, 5 6, 7 8)] +lemma homOfEq_injective (hX : X = X') (hY : Y = Y') {f g : X ⟶ Y} (h : Quiver.homOfEq f hX hY = Quiver.homOfEq g hX hY) : f = g := by subst hX hY exact h -@[simp] -lemma homOfEq_rfl {X Y : V} (f : X ⟶ Y) : Quiver.homOfEq f rfl rfl = f := rfl +@[simp, to_dual self (reorder := 3 4)] +lemma homOfEq_rfl (f : X ⟶ Y) : Quiver.homOfEq f rfl rfl = f := rfl -lemma heq_of_homOfEq_ext {X Y X' Y' : V} (hX : X = X') (hY : Y = Y') {f : X ⟶ Y} {f' : X' ⟶ Y'} +@[to_dual self (reorder := 3 4, 5 6, 7 8)] +lemma heq_of_homOfEq_ext (hX : X = X') (hY : Y = Y') {f : X ⟶ Y} {f' : X' ⟶ Y'} (e : Quiver.homOfEq f hX hY = f') : f ≍ f' := by subst hX hY rw [Quiver.homOfEq_rfl] at e rw [e] -lemma homOfEq_eq_iff {X X' Y Y' : V} (f : X ⟶ Y) (g : X' ⟶ Y') - (hX : X = X') (hY : Y = Y') : +@[to_dual self (reorder := 3 4, 5 6, 9 10)] +lemma homOfEq_eq_iff (f : X ⟶ Y) (g : X' ⟶ Y') (hX : X = X') (hY : Y = Y') : Quiver.homOfEq f hX hY = g ↔ f = Quiver.homOfEq g hX.symm hY.symm := by subst hX hY; simp -lemma eq_homOfEq_iff {X X' Y Y' : V} (f : X ⟶ Y) (g : X' ⟶ Y') - (hX : X' = X) (hY : Y' = Y) : +@[to_dual self (reorder := 3 4, 5 6, 9 10)] +lemma eq_homOfEq_iff (f : X ⟶ Y) (g : X' ⟶ Y') (hX : X' = X) (hY : Y' = Y) : f = Quiver.homOfEq g hX hY ↔ Quiver.homOfEq f hX.symm hY.symm = g := by subst hX hY; simp -lemma homOfEq_heq {X Y X' Y' : V} (hX : X = X') (hY : Y = Y') (f : X ⟶ Y) : - homOfEq f hX hY ≍ f := (heq_of_homOfEq_ext hX hY rfl).symm +@[to_dual self (reorder := 3 4, 5 6, 7 8)] +lemma homOfEq_heq (hX : X = X') (hY : Y = Y') (f : X ⟶ Y) : homOfEq f hX hY ≍ f := + (heq_of_homOfEq_ext hX hY rfl).symm -lemma homOfEq_heq_left_iff {X Y X' Y' : V} (f : X ⟶ Y) (g : X' ⟶ Y') - (hX : X = X') (hY : Y = Y') : +@[to_dual self (reorder := 3 4, 5 6, 9 10)] +lemma homOfEq_heq_left_iff (f : X ⟶ Y) (g : X' ⟶ Y') (hX : X = X') (hY : Y = Y') : homOfEq f hX hY ≍ g ↔ f ≍ g := by cases hX; cases hY; rfl -lemma homOfEq_heq_right_iff {X Y X' Y' : V} (f : X ⟶ Y) (g : X' ⟶ Y') - (hX : X' = X) (hY : Y' = Y) : +@[to_dual self (reorder := 3 4, 5 6, 9 10)] +lemma homOfEq_heq_right_iff (f : X ⟶ Y) (g : X' ⟶ Y') (hX : X' = X) (hY : Y' = Y) : f ≍ homOfEq g hX hY ↔ f ≍ g := by cases hX; cases hY; rfl diff --git a/Mathlib/Combinatorics/Quiver/Cast.lean b/Mathlib/Combinatorics/Quiver/Cast.lean index 1c48188e6c7a8b..97e5301c19b6c9 100644 --- a/Mathlib/Combinatorics/Quiver/Cast.lean +++ b/Mathlib/Combinatorics/Quiver/Cast.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Antoine Labelle, Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle, Rémi Bottinelli -/ -import Mathlib.Combinatorics.Quiver.Basic -import Mathlib.Combinatorics.Quiver.Path +module + +public import Mathlib.Combinatorics.Quiver.Basic +public import Mathlib.Combinatorics.Quiver.Path /-! @@ -15,6 +17,8 @@ rewriting arrows and paths along equalities of their endpoints. -/ +@[expose] public section + universe v v₁ v₂ u u₁ u₂ diff --git a/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean b/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean index 5bc7fa1f19e942..a39a370ae4df1f 100644 --- a/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean +++ b/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn, Matteo Cipollina -/ -import Mathlib.Combinatorics.Quiver.Subquiver -import Mathlib.Combinatorics.Quiver.Path -import Mathlib.Combinatorics.Quiver.Symmetric +module + +public import Mathlib.Combinatorics.Quiver.Subquiver +public import Mathlib.Combinatorics.Quiver.Path +public import Mathlib.Combinatorics.Quiver.Symmetric /-! ## Weakly and strongly connected components @@ -24,6 +26,8 @@ These concepts relate strong and weak connectivity and let us reason about stron components in directed graphs. -/ +@[expose] public section + universe v u namespace Quiver diff --git a/Mathlib/Combinatorics/Quiver/Covering.lean b/Mathlib/Combinatorics/Quiver/Covering.lean index 204049237d3a2c..2deb0cb9122f9c 100644 --- a/Mathlib/Combinatorics/Quiver/Covering.lean +++ b/Mathlib/Combinatorics/Quiver/Covering.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Antoine Labelle, Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle, Rémi Bottinelli -/ -import Mathlib.Combinatorics.Quiver.Cast -import Mathlib.Combinatorics.Quiver.Symmetric -import Mathlib.Data.Sigma.Basic -import Mathlib.Data.Sum.Basic -import Mathlib.Logic.Equiv.Sum -import Mathlib.Tactic.Common +module + +public import Mathlib.Combinatorics.Quiver.Cast +public import Mathlib.Combinatorics.Quiver.Symmetric +public import Mathlib.Data.Sigma.Basic +public import Mathlib.Data.Sum.Basic +public import Mathlib.Logic.Equiv.Sum +public import Mathlib.Tactic.Common /-! # Covering @@ -41,6 +43,8 @@ Clean up the namespaces by renaming `Prefunctor` to `Quiver.Prefunctor`. Cover, covering, quiver, path, lift -/ +@[expose] public section + open Function Quiver diff --git a/Mathlib/Combinatorics/Quiver/Path.lean b/Mathlib/Combinatorics/Quiver/Path.lean index 299e9dc06ea5c2..d4e838887bdfd8 100644 --- a/Mathlib/Combinatorics/Quiver/Path.lean +++ b/Mathlib/Combinatorics/Quiver/Path.lean @@ -3,10 +3,11 @@ Copyright (c) 2021 David Wärn,. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn, Kim Morrison, Matteo Cipollina -/ +module -import Mathlib.Combinatorics.Quiver.Prefunctor -import Mathlib.Logic.Lemmas -import Batteries.Data.List.Basic +public import Mathlib.Combinatorics.Quiver.Prefunctor +public import Mathlib.Logic.Lemmas +public import Batteries.Data.List.Basic /-! # Paths in quivers @@ -15,6 +16,8 @@ Given a quiver `V`, we define the type of paths from `a : V` to `b : V` as an in family. We define composition of paths and the action of prefunctors on paths. -/ +@[expose] public section + open Function universe v v₁ v₂ v₃ u u₁ u₂ u₃ diff --git a/Mathlib/Combinatorics/Quiver/Path/Decomposition.lean b/Mathlib/Combinatorics/Quiver/Path/Decomposition.lean index 6c231aedb03b3d..aa3c6767680216 100644 --- a/Mathlib/Combinatorics/Quiver/Path/Decomposition.lean +++ b/Mathlib/Combinatorics/Quiver/Path/Decomposition.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Combinatorics.Quiver.Path +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Combinatorics.Quiver.Path /-! # Path Decomposition and Boundary Crossing @@ -12,6 +14,8 @@ import Mathlib.Combinatorics.Quiver.Path This section provides lemmas for decomposing non-empty paths and for reasoning about paths that cross the boundary of a given set of vertices `S`. -/ + +@[expose] public section namespace Quiver.Path section BoundaryEdges diff --git a/Mathlib/Combinatorics/Quiver/Path/Vertices.lean b/Mathlib/Combinatorics/Quiver/Path/Vertices.lean index 9d27be9e85c18c..16128af67e2017 100644 --- a/Mathlib/Combinatorics/Quiver/Path/Vertices.lean +++ b/Mathlib/Combinatorics/Quiver/Path/Vertices.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ +module -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Combinatorics.Quiver.Path -import Mathlib.Data.Set.Insert -import Mathlib.Data.List.Basic +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Combinatorics.Quiver.Path +public import Mathlib.Data.Set.Insert +public import Mathlib.Data.List.Basic /-! # Path Vertices @@ -15,6 +16,8 @@ import Mathlib.Data.List.Basic This file provides lemmas for reasoning about the vertices of a path. -/ +@[expose] public section + namespace Quiver.Path open List @@ -230,18 +233,7 @@ theorem exists_eq_comp_and_notMem_tail_of_mem_vertices {v : V} (hv : v ∈ p.ver intro hxPrev hxe_ne obtain ⟨q₁, q₂, h_prev, h_not_tail⟩ := ih hxPrev let q₂' : Path v (pPrev.cons e).end := q₂.cons e - have h_no_tail : v ∉ q₂'.vertices.tail := by - intro hmem - have hmem' : v ∈ (q₂.vertices ++ [(pPrev.cons e).end]).tail := by - simpa [q₂', vertices_cons, concat_eq_append] using hmem - cases hq2 : q₂.vertices with - | nil => simp [hq2] at hmem' - | cons y ys => - have hx_in : v ∈ ys ++ [(pPrev.cons e).end] := by simpa [hq2] using hmem' - obtain (hx_ys | hx_last) := List.mem_append.mp hx_in - · exact h_not_tail <| by simpa [hq2] - · have : v = (pPrev.cons e).end := by simpa [List.mem_singleton] using hx_last - exact hxe_ne this + have h_no_tail : v ∉ q₂'.vertices.tail := by grind [vertices_cons, end_cons] exact ⟨q₁, q₂', by simp [q₂', h_prev], h_no_tail⟩ cases hv' with | inl h_in_prefix => diff --git a/Mathlib/Combinatorics/Quiver/Path/Weight.lean b/Mathlib/Combinatorics/Quiver/Path/Weight.lean index 6ba04cad3d2354..2cf1e9da467f70 100644 --- a/Mathlib/Combinatorics/Quiver/Path/Weight.lean +++ b/Mathlib/Combinatorics/Quiver/Path/Weight.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ -import Mathlib.Combinatorics.Quiver.Path -import Mathlib.Algebra.Order.Ring.Defs +module + +public import Mathlib.Combinatorics.Quiver.Path +public import Mathlib.Algebra.Order.Ring.Defs /-! @@ -27,6 +29,8 @@ weights of its edges, where weights are taken from a monoid. * `Quiver.Path.weightOfEPs_nonneg`: If all edge weights are non-negative, so is the path weight. -/ +@[expose] public section + namespace Quiver.Path variable {V : Type*} [Quiver V] {R : Type*} diff --git a/Mathlib/Combinatorics/Quiver/Prefunctor.lean b/Mathlib/Combinatorics/Quiver/Prefunctor.lean index c32b127d7a1c77..a604741ce1a0ff 100644 --- a/Mathlib/Combinatorics/Quiver/Prefunctor.lean +++ b/Mathlib/Combinatorics/Quiver/Prefunctor.lean @@ -3,12 +3,16 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn, Kim Morrison -/ -import Mathlib.Combinatorics.Quiver.Basic +module + +public import Mathlib.Combinatorics.Quiver.Basic /-! # Morphisms of quivers -/ +@[expose] public section + universe v₁ v₂ u u₁ u₂ /-- A morphism of quivers. As we will later have categorical functors extend this structure, diff --git a/Mathlib/Combinatorics/Quiver/Push.lean b/Mathlib/Combinatorics/Quiver/Push.lean index cf69ada0455ccc..9bb0bbaf228ccf 100644 --- a/Mathlib/Combinatorics/Quiver/Push.lean +++ b/Mathlib/Combinatorics/Quiver/Push.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémi Bottinelli -/ -import Mathlib.Combinatorics.Quiver.Prefunctor +module + +public import Mathlib.Combinatorics.Quiver.Prefunctor /-! @@ -14,6 +16,8 @@ on `W` by associating to each arrow `v ⟶ v'` in `V` an arrow `σ v ⟶ σ v'` -/ +@[expose] public section + namespace Quiver universe v v₁ v₂ u u₁ u₂ diff --git a/Mathlib/Combinatorics/Quiver/ReflQuiver.lean b/Mathlib/Combinatorics/Quiver/ReflQuiver.lean index 7cfc17e29618da..4b2f1dca64fcc9 100644 --- a/Mathlib/Combinatorics/Quiver/ReflQuiver.lean +++ b/Mathlib/Combinatorics/Quiver/ReflQuiver.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Mario Carneiro and Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Emily Riehl -/ -import Mathlib.Data.Set.Function -import Mathlib.CategoryTheory.Category.Cat +module + +public import Mathlib.Data.Set.Function +public import Mathlib.CategoryTheory.Category.Cat /-! # Reflexive Quivers @@ -17,6 +19,8 @@ prefunctors" for short. Note: Currently Category does not extend ReflQuiver, although it could. (TODO: do this) -/ + +@[expose] public section namespace CategoryTheory universe v v₁ v₂ u u₁ u₂ diff --git a/Mathlib/Combinatorics/Quiver/SingleObj.lean b/Mathlib/Combinatorics/Quiver/SingleObj.lean index 4541bc9f056561..6e34b002953cfa 100644 --- a/Mathlib/Combinatorics/Quiver/SingleObj.lean +++ b/Mathlib/Combinatorics/Quiver/SingleObj.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Antoine Labelle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle -/ -import Mathlib.Combinatorics.Quiver.Cast -import Mathlib.Combinatorics.Quiver.Symmetric +module + +public import Mathlib.Combinatorics.Quiver.Cast +public import Mathlib.Combinatorics.Quiver.Symmetric /-! # Single-object quiver @@ -21,6 +23,8 @@ More generally, a list of elements of `a` can be reinterpreted as a path from `s itself using `pathEquivList`. -/ +@[expose] public section + namespace Quiver /-- Type tag on `Unit` used to define single-object quivers. -/ diff --git a/Mathlib/Combinatorics/Quiver/Subquiver.lean b/Mathlib/Combinatorics/Quiver/Subquiver.lean index 8cedd260601116..740e9500f0c611 100644 --- a/Mathlib/Combinatorics/Quiver/Subquiver.lean +++ b/Mathlib/Combinatorics/Quiver/Subquiver.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.Order.Notation -import Mathlib.Combinatorics.Quiver.Basic +module + +public import Mathlib.Order.Notation +public import Mathlib.Combinatorics.Quiver.Basic /-! ## Wide subquivers @@ -14,6 +16,8 @@ every pair of vertices `a b : V`. We include 'wide' in the name to emphasize tha subquivers by definition contain all vertices. -/ +@[expose] public section + universe v u /-- diff --git a/Mathlib/Combinatorics/Quiver/Symmetric.lean b/Mathlib/Combinatorics/Quiver/Symmetric.lean index 63f94af838a35d..29a66fd49b4edd 100644 --- a/Mathlib/Combinatorics/Quiver/Symmetric.lean +++ b/Mathlib/Combinatorics/Quiver/Symmetric.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn, Antoine Labelle, Rémi Bottinelli -/ -import Mathlib.Combinatorics.Quiver.Path -import Mathlib.Combinatorics.Quiver.Push +module + +public import Mathlib.Combinatorics.Quiver.Path +public import Mathlib.Combinatorics.Quiver.Push /-! ## Symmetric quivers and arrow reversal @@ -20,6 +22,8 @@ This file contains constructions related to symmetric quivers: of `Symmetrify`. -/ +@[expose] public section + universe v u w v' namespace Quiver diff --git a/Mathlib/Combinatorics/Schnirelmann.lean b/Mathlib/Combinatorics/Schnirelmann.lean index 09cca797040f13..280c461ec9f77e 100644 --- a/Mathlib/Combinatorics/Schnirelmann.lean +++ b/Mathlib/Combinatorics/Schnirelmann.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta, Doga Can Sertbas -/ -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Data.Nat.ModEq -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.Real.Archimedean -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.Real.Archimedean +public import Mathlib.Order.Interval.Finset.Nat /-! # Schnirelmann density @@ -42,6 +44,8 @@ which reduces the proof obligations later that would arise with `Nat.card`. * [Ruzsa, Imre, *Sumsets and structure*][ruzsa2009] -/ +@[expose] public section + open Finset /-- The Schnirelmann density is defined as the infimum of |A ∩ {1, ..., n}| / n as n ranges over diff --git a/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean b/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean index e28a95d5acf1ba..3c25f92d5c9855 100644 --- a/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean +++ b/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean @@ -3,15 +3,18 @@ Copyright (c) 2023 Yaël Dillies, Vladimir Ivanov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Vladimir Ivanov -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Data.Finset.Sups -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Ring -import Mathlib.Algebra.BigOperators.Group.Finset.Powerset +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Data.Finset.Sups +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Ring +public import Mathlib.Algebra.BigOperators.Group.Finset.Powerset +import Mathlib.Data.Rat.Defs /-! # The Ahlswede-Zhang identity @@ -43,6 +46,8 @@ inequality since for an antichain `𝒜` and every `A ∈ 𝒜` we have * [D. T. Tru, *An AZ-style identity and Bollobás deficiency*](https://doi.org/10.1016/j.jcta.2007.03.005) -/ +@[expose] public section + section variable (α : Type*) [Fintype α] [Nonempty α] {m n : ℕ} diff --git a/Mathlib/Combinatorics/SetFamily/Compression/Down.lean b/Mathlib/Combinatorics/SetFamily/Compression/Down.lean index 836d2b474c3df7..faeb27814164d9 100644 --- a/Mathlib/Combinatorics/SetFamily/Compression/Down.lean +++ b/Mathlib/Combinatorics/SetFamily/Compression/Down.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Lattice.Fold /-! # Down-compressions @@ -35,6 +37,8 @@ when the resulting set is not already in `𝒜`. compression, down-compression -/ +@[expose] public section + variable {α : Type*} [DecidableEq α] {𝒜 : Finset (Finset α)} {s : Finset α} {a : α} diff --git a/Mathlib/Combinatorics/SetFamily/Compression/UV.lean b/Mathlib/Combinatorics/SetFamily/Compression/UV.lean index b49c0201e59c3b..1361ef595d7a58 100644 --- a/Mathlib/Combinatorics/SetFamily/Compression/UV.lean +++ b/Mathlib/Combinatorics/SetFamily/Compression/UV.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SetFamily.Shadow +module + +public import Mathlib.Combinatorics.SetFamily.Shadow /-! # UV-compressions @@ -46,6 +48,8 @@ Boolean algebra, so that one can use it for `Set α`. compression, UV-compression, shadow -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SetFamily/FourFunctions.lean b/Mathlib/Combinatorics/SetFamily/FourFunctions.lean index c2ece661a6a6cb..64bc6d7afc6f8d 100644 --- a/Mathlib/Combinatorics/SetFamily/FourFunctions.lean +++ b/Mathlib/Combinatorics/SetFamily/FourFunctions.lean @@ -3,17 +3,19 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Pi -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Data.Finset.Sups -import Mathlib.Order.Birkhoff -import Mathlib.Order.Booleanisation -import Mathlib.Order.Sublattice -import Mathlib.Tactic.Positivity.Basic -import Mathlib.Tactic.Ring -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Data.Finset.Sups +public import Mathlib.Order.Birkhoff +public import Mathlib.Order.Booleanisation +public import Mathlib.Order.Sublattice +public import Mathlib.Tactic.Positivity.Basic +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.GCongr /-! # The four functions theorem and corollaries @@ -54,6 +56,8 @@ earlier file and give it a proper API. [*Applications of the FKG Inequality and Its Relatives*, Graham][Graham1983] -/ +@[expose] public section + open Finset Fintype Function open scoped FinsetFamily diff --git a/Mathlib/Combinatorics/SetFamily/HarrisKleitman.lean b/Mathlib/Combinatorics/SetFamily/HarrisKleitman.lean index db9efa67171421..73cb77b46027d4 100644 --- a/Mathlib/Combinatorics/SetFamily/HarrisKleitman.lean +++ b/Mathlib/Combinatorics/SetFamily/HarrisKleitman.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Combinatorics.SetFamily.Compression.Down -import Mathlib.Data.Fintype.Powerset -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Combinatorics.SetFamily.Compression.Down +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Order.UpperLower.Basic /-! # Harris-Kleitman inequality @@ -26,6 +28,8 @@ correlate in the uniform measure. * [D. J. Kleitman, *Families of non-disjoint subsets*][kleitman1966] -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SetFamily/Intersecting.lean b/Mathlib/Combinatorics/SetFamily/Intersecting.lean index ce7019303f991f..01196be879f4c3 100644 --- a/Mathlib/Combinatorics/SetFamily/Intersecting.lean +++ b/Mathlib/Combinatorics/SetFamily/Intersecting.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Order.UpperLower.Basic /-! # Intersecting families @@ -24,6 +26,8 @@ This file defines intersecting families and proves their basic properties. * [D. J. Kleitman, *Families of non-disjoint subsets*][kleitman1966] -/ +@[expose] public section + assert_not_exists Monoid open Finset diff --git a/Mathlib/Combinatorics/SetFamily/Kleitman.lean b/Mathlib/Combinatorics/SetFamily/Kleitman.lean index bc7b66594e4662..7a30075d92e6ac 100644 --- a/Mathlib/Combinatorics/SetFamily/Kleitman.lean +++ b/Mathlib/Combinatorics/SetFamily/Kleitman.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.SetFamily.HarrisKleitman -import Mathlib.Combinatorics.SetFamily.Intersecting +module + +public import Mathlib.Combinatorics.SetFamily.HarrisKleitman +public import Mathlib.Combinatorics.SetFamily.Intersecting /-! # Kleitman's bound on the size of intersecting families @@ -23,6 +25,8 @@ Kleitman's bound stipulates that `k` intersecting families cover at most `2ⁿ - * [D. J. Kleitman, *Families of non-disjoint subsets*][kleitman1966] -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SetFamily/KruskalKatona.lean b/Mathlib/Combinatorics/SetFamily/KruskalKatona.lean index 22b9317c9eeb1a..90cf137b6b8aef 100644 --- a/Mathlib/Combinatorics/SetFamily/KruskalKatona.lean +++ b/Mathlib/Combinatorics/SetFamily/KruskalKatona.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Yaël Dillies -/ -import Mathlib.Combinatorics.Colex -import Mathlib.Combinatorics.SetFamily.Compression.UV -import Mathlib.Combinatorics.SetFamily.Intersecting -import Mathlib.Data.Finset.Fin +module + +public import Mathlib.Combinatorics.Colex +public import Mathlib.Combinatorics.SetFamily.Compression.UV +public import Mathlib.Combinatorics.SetFamily.Intersecting +public import Mathlib.Data.Finset.Fin /-! # Kruskal-Katona theorem @@ -42,6 +44,8 @@ The key results proved here are: kruskal-katona, kruskal, katona, shadow, initial segments, intersecting -/ +@[expose] public section + open Nat open scoped FinsetFamily diff --git a/Mathlib/Combinatorics/SetFamily/LYM.lean b/Mathlib/Combinatorics/SetFamily/LYM.lean index a8998cfd4397ff..938b11d5a7f764 100644 --- a/Mathlib/Combinatorics/SetFamily/LYM.lean +++ b/Mathlib/Combinatorics/SetFamily/LYM.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Bhavik Mehta, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Alena Gusakov, Yaël Dillies -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Field.Rat -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Combinatorics.SetFamily.Shadow -import Mathlib.Data.NNRat.Order -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Field.Rat +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.SetFamily.Shadow +public import Mathlib.Data.NNRat.Order +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # Lubell-Yamamoto-Meshalkin inequality and Sperner's theorem @@ -45,6 +47,8 @@ Provide equality cases. Local LYM gives that the equality case of LYM and Sperne shadow, lym, slice, sperner, antichain -/ +@[expose] public section + open Finset Nat open scoped FinsetFamily diff --git a/Mathlib/Combinatorics/SetFamily/Shadow.lean b/Mathlib/Combinatorics/SetFamily/Shadow.lean index 77f5c9ca01b3a8..285a062e50a766 100644 --- a/Mathlib/Combinatorics/SetFamily/Shadow.lean +++ b/Mathlib/Combinatorics/SetFamily/Shadow.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Alena Gusakov, Yaël Dillies -/ -import Mathlib.Data.Finset.Grade -import Mathlib.Data.Finset.Sups -import Mathlib.Logic.Function.Iterate +module + +public import Mathlib.Data.Finset.Grade +public import Mathlib.Data.Finset.Sups +public import Mathlib.Logic.Function.Iterate /-! # Shadows @@ -41,6 +43,8 @@ are finsets, and `𝒜, ℬ : Finset (Finset α)` are finset families. shadow, set family -/ +@[expose] public section + open Finset Nat diff --git a/Mathlib/Combinatorics/SetFamily/Shatter.lean b/Mathlib/Combinatorics/SetFamily/Shatter.lean index e4eee56f17f1e8..ddfc1fc015a6ea 100644 --- a/Mathlib/Combinatorics/SetFamily/Shatter.lean +++ b/Mathlib/Combinatorics/SetFamily/Shatter.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.SetFamily.Compression.Down -import Mathlib.Data.Fintype.Powerset -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Combinatorics.SetFamily.Compression.Down +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Shattering families @@ -25,6 +27,8 @@ This file defines the shattering property and VC-dimension of set families. * Strong shattering -/ +@[expose] public section + open scoped FinsetFamily namespace Finset diff --git a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean index be6096db7b8c32..b047a6478cac65 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Combinatorics.SimpleGraph.DegreeSum +module + +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum /-! @@ -37,6 +39,8 @@ for these theorems for multigraphs from [Chou1994]. acyclic graphs, trees -/ +@[expose] public section + namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean b/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean index 889c203aa67b66..3c1968ba4cdeed 100644 --- a/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean +++ b/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark, Kyle Miller, Lu-Ming Zhang -/ -import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting -import Mathlib.LinearAlgebra.Matrix.Symmetric -import Mathlib.LinearAlgebra.Matrix.Trace +module + +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting +public import Mathlib.LinearAlgebra.Matrix.Symmetric +public import Mathlib.LinearAlgebra.Matrix.Trace /-! # Adjacency Matrices @@ -34,6 +36,8 @@ properties to computational properties of the matrix. -/ +@[expose] public section + open Matrix diff --git a/Mathlib/Combinatorics/SimpleGraph/Basic.lean b/Mathlib/Combinatorics/SimpleGraph/Basic.lean index 2400c5218d7c72..9949da7342aa7e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Basic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Aaron Anderson, Jalex Stark, Kyle Miller. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark, Kyle Miller, Alena Gusakov, Hunter Monroe -/ -import Mathlib.Combinatorics.SimpleGraph.Init -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Rel -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Sym.Sym2 -import Mathlib.Order.CompleteBooleanAlgebra +module + +public import Mathlib.Combinatorics.SimpleGraph.Init +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Rel +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Sym.Sym2 +public import Mathlib.Order.CompleteBooleanAlgebra /-! # Simple graphs @@ -38,6 +40,8 @@ This module defines simple graphs on a vertex type `V` as an irreflexive symmetr look like. -/ +@[expose] public section + attribute [aesop norm unfold (rule_sets := [SimpleGraph])] Symmetric attribute [aesop norm unfold (rule_sets := [SimpleGraph])] Irreflexive @@ -296,37 +300,28 @@ instance distribLattice : DistribLattice (SimpleGraph V) := adj_injective.distribLattice _ (fun _ _ => rfl) fun _ _ => rfl with le := fun G H => ∀ ⦃a b⦄, G.Adj a b → H.Adj a b } -instance completeAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (SimpleGraph V) := - { SimpleGraph.distribLattice with - le := (· ≤ ·) - sup := (· ⊔ ·) - inf := (· ⊓ ·) - compl := HasCompl.compl - sdiff := (· \ ·) - top.Adj := Ne - bot.Adj _ _ := False - le_top := fun x _ _ h => x.ne_of_adj h - bot_le := fun _ _ _ h => h.elim - sdiff_eq := fun x y => by - ext v w - refine ⟨fun h => ⟨h.1, ⟨?_, h.2⟩⟩, fun h => ⟨h.1, h.2.2⟩⟩ - rintro rfl - exact x.irrefl h.1 - inf_compl_le_bot := fun _ _ _ h => False.elim <| h.2.2 h.1 - top_le_sup_compl := fun G v w hvw => by - by_cases h : G.Adj v w - · exact Or.inl h - · exact Or.inr ⟨hvw, h⟩ - sSup := sSup - le_sSup := fun _ G hG _ _ hab => ⟨G, hG, hab⟩ - sSup_le := fun s G hG a b => by - rintro ⟨H, hH, hab⟩ - exact hG _ hH hab - sInf := sInf - sInf_le := fun _ _ hG _ _ hab => hab.1 hG - le_sInf := fun _ _ hG _ _ hab => ⟨fun _ hH => hG _ hH hab, hab.ne⟩ - iInf_iSup_eq := fun f => by ext; simp [Classical.skolem] } - +instance completeAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (SimpleGraph V) where + top.Adj := Ne + bot.Adj _ _ := False + le_top x _ _ h := x.ne_of_adj h + bot_le _ _ _ h := h.elim + sdiff_eq x y := by + ext v w + refine ⟨fun h => ⟨h.1, ⟨?_, h.2⟩⟩, fun h => ⟨h.1, h.2.2⟩⟩ + rintro rfl + exact x.irrefl h.1 + inf_compl_le_bot _ _ _ h := False.elim <| h.2.2 h.1 + top_le_sup_compl G v w hvw := by + by_cases h : G.Adj v w + · exact Or.inl h + · exact Or.inr ⟨hvw, h⟩ + le_sSup _ G hG _ _ hab := ⟨G, hG, hab⟩ + sSup_le s G hG a b := by + rintro ⟨H, hH, hab⟩ + exact hG _ hH hab + sInf_le _ _ hG _ _ hab := hab.1 hG + le_sInf _ _ hG _ _ hab := ⟨fun _ hH => hG _ hH hab, hab.ne⟩ + iInf_iSup_eq f := by ext; simp [Classical.skolem] /-- The complete graph on a type `V` is the simple graph with all pairs of distinct vertices. -/ abbrev completeGraph (V : Type u) : SimpleGraph V := ⊤ @@ -602,6 +597,8 @@ theorem fromEdgeSet_empty : fromEdgeSet (∅ : Set (Sym2 V)) = ⊥ := by ext v w simp only [fromEdgeSet_adj, Set.mem_empty_iff_false, false_and, bot_adj] +@[simp] lemma fromEdgeSet_not_isDiag : fromEdgeSet {e : Sym2 V | ¬ e.IsDiag} = ⊤ := by ext; simp + @[simp] theorem fromEdgeSet_univ : fromEdgeSet (Set.univ : Set (Sym2 V)) = ⊤ := by ext v w diff --git a/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean b/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean index d6a5bf64d76b29..70ac1f8f65d4e6 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Horner -/ -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Combinatorics.SimpleGraph.Coloring -import Mathlib.Combinatorics.SimpleGraph.DegreeSum +module + +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.SimpleGraph.Coloring +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum /-! # Bipartite graphs @@ -56,6 +58,8 @@ relation `r : α → β → Prop`, see `Mathlib/Combinatorics/Enumerative/Double I.e., `G.IsBipartite ↔ ∀ n, (cycleGraph (2*n+1)).Free G`. -/ +@[expose] public section + open BigOperators Finset Fintype diff --git a/Mathlib/Combinatorics/SimpleGraph/Circulant.lean b/Mathlib/Combinatorics/SimpleGraph/Circulant.lean index de168cfa769824..e6f039260e8208 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Circulant.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Circulant.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Iván Renison, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Iván Renison, Bhavik Mehta -/ -import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.Combinatorics.SimpleGraph.Hasse -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Fin.Basic +public import Mathlib.Combinatorics.SimpleGraph.Hasse +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Definition of circulant graphs @@ -20,6 +22,8 @@ are adjacent if and only if `u - v ∈ s` or `v - u ∈ s`. The elements of `s` * `SimpleGraph.cycleGraph n`: the cycle graph over `Fin n`. -/ +@[expose] public section + namespace SimpleGraph /-- Circulant graph over additive group `G` with jumps `s` -/ @@ -44,11 +48,9 @@ theorem circulantGraph_eq_erase_zero : circulantGraph s = circulantGraph (s \ {0 | inr h1 => exact Or.inr h1.left theorem circulantGraph_eq_symm : circulantGraph s = circulantGraph (s ∪ (-s)) := by - ext (u v : G) - simp only [circulantGraph, fromRel_adj, Set.mem_union, Set.mem_neg, neg_sub, and_congr_right_iff, - iff_self_or] - intro _ h - exact Or.symm h + ext + simp only [circulantGraph_adj, Set.mem_union, Set.mem_neg, neg_sub] + grind instance [DecidableEq G] [DecidablePred (· ∈ s)] : DecidableRel (circulantGraph s).Adj := fun _ _ => inferInstanceAs (Decidable (_ ∧ _)) diff --git a/Mathlib/Combinatorics/SimpleGraph/Clique.lean b/Mathlib/Combinatorics/SimpleGraph/Clique.lean index 5d3ed6bda97a61..221f15315bcb02 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Clique.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Clique.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Copy -import Mathlib.Combinatorics.SimpleGraph.Operations -import Mathlib.Combinatorics.SimpleGraph.Paths -import Mathlib.Data.Finset.Pairwise -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Data.Fintype.Powerset -import Mathlib.Data.Nat.Lattice -import Mathlib.SetTheory.Cardinal.Finite +module + +public import Mathlib.Combinatorics.SimpleGraph.Copy +public import Mathlib.Combinatorics.SimpleGraph.Operations +public import Mathlib.Combinatorics.SimpleGraph.Paths +public import Mathlib.Data.Finset.Pairwise +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Data.Nat.Lattice +public import Mathlib.SetTheory.Cardinal.Finite /-! # Graph cliques @@ -26,6 +28,8 @@ A clique is a set of vertices that are pairwise adjacent. * `SimpleGraph.CliqueFree`: Predicate for a graph to have no `n`-cliques. -/ +@[expose] public section + open Finset Fintype Function SimpleGraph.Walk namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Coloring.lean b/Mathlib/Combinatorics/SimpleGraph/Coloring.lean index c467a594a22970..60c0f3950a4336 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Coloring.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Coloring.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Arthur Paulino. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Combinatorics.SimpleGraph.Copy -import Mathlib.Data.ENat.Lattice -import Mathlib.Data.Nat.Lattice -import Mathlib.Data.Setoid.Partition -import Mathlib.Order.Antichain -import Mathlib.Data.Nat.Cast.Order.Ring +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Combinatorics.SimpleGraph.Copy +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Data.Nat.Lattice +public import Mathlib.Data.Setoid.Partition +public import Mathlib.Order.Antichain +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # Graph Coloring @@ -55,6 +57,8 @@ the colors. * develop API for partial colorings, likely as colorings of subgraphs (`H.coe.Coloring α`) -/ +@[expose] public section + assert_not_exists Field open Fintype Function diff --git a/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean b/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean index dda40b88c7e4d3..70b040f702502f 100644 --- a/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 John Talbot and Lian Bremner Tattersall. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: John Talbot, Lian Bremner Tattersall -/ -import Mathlib.Combinatorics.SimpleGraph.Coloring -import Mathlib.Combinatorics.SimpleGraph.Copy -import Mathlib.Combinatorics.SimpleGraph.DegreeSum -import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan -import Mathlib.Combinatorics.SimpleGraph.Hasse +module + +public import Mathlib.Combinatorics.SimpleGraph.Coloring +public import Mathlib.Combinatorics.SimpleGraph.Copy +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum +public import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan +public import Mathlib.Combinatorics.SimpleGraph.Hasse /-! # Complete Multipartite Graphs @@ -49,6 +51,8 @@ for the isomorphisms between a `completeEquipartiteGraph` and a corresponding `completeMultipartiteGraph`, `turanGraph`. -/ +@[expose] public section + open Finset Fintype universe u diff --git a/Mathlib/Combinatorics/SimpleGraph/ConcreteColorings.lean b/Mathlib/Combinatorics/SimpleGraph/ConcreteColorings.lean index 0f1b4f7b78bf90..d17566a8fc020e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/ConcreteColorings.lean +++ b/Mathlib/Combinatorics/SimpleGraph/ConcreteColorings.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Iván Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Iván Renison -/ -import Mathlib.Combinatorics.SimpleGraph.Bipartite -import Mathlib.Combinatorics.SimpleGraph.Circulant -import Mathlib.Combinatorics.SimpleGraph.Coloring -import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite -import Mathlib.Combinatorics.SimpleGraph.Hasse -import Mathlib.Data.Fin.Parity +module + +public import Mathlib.Combinatorics.SimpleGraph.Bipartite +public import Mathlib.Combinatorics.SimpleGraph.Circulant +public import Mathlib.Combinatorics.SimpleGraph.Coloring +public import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite +public import Mathlib.Combinatorics.SimpleGraph.Hasse +public import Mathlib.Data.Fin.Parity /-! # Concrete colorings of common graphs @@ -21,6 +23,8 @@ This file defines colorings for some common graphs. -/ +@[expose] public section + assert_not_exists Field namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean index 4eb863b4bceafe..2058de2d7bd9e5 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Paths -import Mathlib.Combinatorics.SimpleGraph.Subgraph +module + +public import Mathlib.Combinatorics.SimpleGraph.Paths +public import Mathlib.Combinatorics.SimpleGraph.Subgraph /-! ## Main definitions @@ -26,10 +28,17 @@ import Mathlib.Combinatorics.SimpleGraph.Subgraph * `SimpleGraph.isBridge_iff_mem_and_forall_cycle_notMem` characterizes bridge edges in terms of there being no cycle containing them. +## TODO + +`IsBridge` is unpractical: we shouldn't require the edge to be present. +See https://github.com/leanprover-community/mathlib4/issues/31690. + ## Tags trails, paths, cycles, bridge edges -/ +@[expose] public section + open Function universe u v w @@ -786,6 +795,85 @@ lemma Connected.connected_delete_edge_of_not_isBridge (hG : G.Connected) {x y : have heP₁ : s(x, y) ∉ P₁.edges := fun h ↦ hxP₁ <| P₁.fst_mem_support_of_mem_edges h exact (h hxy).trans (Reachable.symm ⟨P₁.toDeleteEdges {s(x, y)} (by aesop)⟩) +/-- If `e` is an adge in `G` and is a bridge in a larger graph `G'`, then it's a bridge in `G`. -/ +theorem IsBridge.anti_of_mem_edgeSet {G' : SimpleGraph V} {e : Sym2 V} (hle : G ≤ G') + (h : e ∈ G.edgeSet) (h' : G'.IsBridge e) : G.IsBridge e := + isBridge_iff_mem_and_forall_cycle_notMem.mpr ⟨h, fun _ p hp hpe ↦ + isBridge_iff_mem_and_forall_cycle_notMem.mp h' |>.right + (p.mapLe hle) (Walk.IsCycle.mapLe hle hp) (p.edges_mapLe_eq_edges hle ▸ hpe)⟩ + end BridgeEdges +/-! +### 2-reachability + +In this section, we prove results about 2-connected components of a graph, but without naming them. + +#### TODO + +Should we explicitly have +``` +def IsEdgeReachable (k : ℕ) (u v : V) : Prop := + ∀ ⦃s : Set (Sym2 V)⦄, s.encard < k → (G.deleteEdges s).Reachable u v +``` +? `G.IsEdgeReachable 2 u v` would then be equivalent to the less idiomatic condition +`∃ x, ¬ (G.deleteEdges {s(x, y)}).Reachable u y` we use below. +See https://github.com/leanprover-community/mathlib4/issues/31691. +-/ + +namespace Walk +variable {u v x y : V} {w : G.Walk u v} + +/-- A walk between two vertices separated by a set of edges must go through one of those edges. -/ +lemma exists_mem_edges_of_not_reachable_deleteEdges (w : G.Walk u v) {s : Set (Sym2 V)} + (huv : ¬ (G.deleteEdges s).Reachable u v) : ∃ e ∈ s, e ∈ w.edges := by + contrapose! huv; exact ⟨w.toDeleteEdges _ fun _ ↦ imp_not_comm.1 <| huv _⟩ + +/-- A walk between two vertices separated by an edge must go through that edge. -/ +lemma mem_edges_of_not_reachable_deleteEdges (w : G.Walk u v) {e : Sym2 V} + (huv : ¬ (G.deleteEdges {e}).Reachable u v) : e ∈ w.edges := by + simpa using w.exists_mem_edges_of_not_reachable_deleteEdges huv + +/-- A trail doesn't go through an edge that disconnects one of its endpoints from the endpoints of +the trail. -/ +lemma IsTrail.not_mem_edges_of_not_reachable (hw : w.IsTrail) + (huy : ¬ (G.deleteEdges {s(x, y)}).Reachable u y) + (hvy : ¬ (G.deleteEdges {s(x, y)}).Reachable v y) : s(x, y) ∉ w.edges := by + classical + exact fun hxy ↦ hw.disjoint_edges_takeUntil_dropUntil (w.snd_mem_support_of_mem_edges hxy) + ((w.takeUntil y _).mem_edges_of_not_reachable_deleteEdges huy) + (by simpa using (w.dropUntil y _).reverse.mem_edges_of_not_reachable_deleteEdges hvy) + +/-- A trail doesn't go through a vertex that is disconnected from its endpoints by an edge. -/ +lemma IsTrail.not_mem_support_of_not_reachable (hw : w.IsTrail) + (huy : ¬ (G.deleteEdges {s(x, y)}).Reachable u y) + (hvy : ¬ (G.deleteEdges {s(x, y)}).Reachable v y) : y ∉ w.support := by + classical + exact fun hy ↦ hw.not_mem_edges_of_not_reachable huy hvy <| w.edges_takeUntil_subset hy <| + mem_edges_of_not_reachable_deleteEdges (w.takeUntil y hy) huy + +/-- A trail doesn't go through any leaf vertex, except possibly at its endpoints. -/ +lemma IsTrail.not_mem_support_of_subsingleton_neighborSet (hw : w.IsTrail) (hxu : x ≠ u) + (hxv : x ≠ v) (hx : (G.neighborSet x).Subsingleton) : x ∉ w.support := by + rintro hxw + obtain ⟨y, -, hxy⟩ := adj_of_mem_walk_support w (by rintro ⟨⟩; simp_all) hxw + refine hw.not_mem_support_of_not_reachable (x := y) ?_ ?_ hxw <;> + · rintro ⟨p⟩ + obtain ⟨hx₂, -, hy₂⟩ : G.Adj x p.penultimate ∧ _ ∧ ¬p.penultimate = y := by + simpa using p.reverse.adj_snd (not_nil_of_ne ‹_›) + exact hy₂ <| hx hx₂ hxy + +end Walk + +/-- Removing leaves from a connected graph keeps it connected. -/ +lemma Preconnected.induce_of_degree_eq_one (hG : G.Preconnected) {s : Set V} + (hs : ∀ v ∉ s, (G.neighborSet v).Subsingleton) : (G.induce s).Preconnected := by + rintro ⟨u, hu⟩ ⟨v, hv⟩ + obtain ⟨p, hp⟩ := hG.exists_isPath u v + constructor + convert p.induce s _ + rintro w hwp + by_contra hws + exact hp.not_mem_support_of_subsingleton_neighborSet (by grind) (by grind) (hs _ hws) hwp + end SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Represents.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Represents.lean index ffb72ac5a026bf..ba342fbdbc1e19 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Represents.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Represents.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Otte -/ +module -import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting -import Mathlib.Data.Set.Card +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting +public import Mathlib.Data.Set.Card /-! # Representation of components by a set of vertices @@ -16,6 +17,8 @@ import Mathlib.Data.Set.Card components if it contains exactly one vertex from each component. -/ +@[expose] public section + universe u variable {V : Type u} diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Subgraph.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Subgraph.lean index 6390d6924f2372..ca2887c9ac15a7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Subgraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Subgraph.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Kyle Miller, Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Rémi Bottinelli -/ -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Data.Set.Card +module + +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Data.Set.Card /-! # Connectivity of subgraphs and induced graphs @@ -16,6 +18,8 @@ import Mathlib.Data.Set.Card -/ +@[expose] public section + namespace SimpleGraph universe u v @@ -270,6 +274,16 @@ theorem toSubgraph_adj_iff {u v u' v'} (w : G.Walk u v) : lemma mem_support_of_adj_toSubgraph {u v u' v' : V} {p : G.Walk u v} (hp : p.toSubgraph.Adj u' v') : u' ∈ p.support := p.mem_verts_toSubgraph.mp (p.toSubgraph.edge_vert hp) +lemma adj_toSubgraph_iff_mem_edges {u v u' v' : V} {p : G.Walk u v} : + p.toSubgraph.Adj u' v' ↔ s(u', v') ∈ p.edges := by + rw [← p.mem_edges_toSubgraph, Subgraph.mem_edgeSet] + +lemma toSubgraph_bypass_le_toSubgraph {u v : V} {p : G.Walk u v} [DecidableEq V] : + p.bypass.toSubgraph ≤ p.toSubgraph := by + constructor + · simpa using p.support_bypass_subset + · simpa [adj_toSubgraph_iff_mem_edges] using fun _ _ h ↦ p.edges_toPath_subset h + namespace IsPath lemma neighborSet_toSubgraph_startpoint {u v} {p : G.Walk u v} diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkCounting.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkCounting.lean index 404d0a6bca5f00..27c3e8939df05e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkCounting.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkCounting.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.BigOperators.Ring.Nat -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Data.Set.Card -import Mathlib.Data.Set.Finite.Lattice +module + +public import Mathlib.Algebra.BigOperators.Ring.Nat +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Data.Set.Card +public import Mathlib.Data.Set.Finite.Lattice /-! # Counting walks of a given length @@ -21,6 +23,8 @@ can also be useful as a recursive description of this set when `V` is finite. TODO: should this be extended further? -/ +@[expose] public section + assert_not_exists Field open Finset Function diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkDecomp.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkDecomp.lean index 321bbc34fe143a..d2cae806945128 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkDecomp.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/WalkDecomp.lean @@ -3,8 +3,9 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Pim Otte -/ +module -import Mathlib.Combinatorics.SimpleGraph.Walk +public import Mathlib.Combinatorics.SimpleGraph.Walk /-! # Decomposing walks @@ -14,6 +15,8 @@ import Mathlib.Combinatorics.SimpleGraph.Walk - `rotate`: Rotate a loop walk such that it is centered at the given vertex. -/ +@[expose] public section + namespace SimpleGraph.Walk universe u diff --git a/Mathlib/Combinatorics/SimpleGraph/Copy.lean b/Mathlib/Combinatorics/SimpleGraph/Copy.lean index aa16518395ed39..310b99da58edd2 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Copy.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Copy.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies, Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Mitchell Horner -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Combinatorics.SimpleGraph.Subgraph +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Combinatorics.SimpleGraph.Subgraph /-! # Containment of graphs @@ -57,6 +59,8 @@ The following notation is declared in scope `SimpleGraph`: * Make `copyCount`/`labelledCopyCount` computable (not necessarily efficiently). -/ +@[expose] public section + open Finset Function open Fintype (card) diff --git a/Mathlib/Combinatorics/SimpleGraph/Dart.lean b/Mathlib/Combinatorics/SimpleGraph/Dart.lean index 9945964687de2c..6614594627c714 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Dart.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Dart.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Basic -import Mathlib.Data.Fintype.Sigma +module + +public import Mathlib.Combinatorics.SimpleGraph.Basic +public import Mathlib.Data.Fintype.Sigma /-! # Darts in graphs @@ -13,6 +15,8 @@ A `Dart` or half-edge or bond in a graph is an ordered pair of adjacent vertices oriented edge. This file defines darts and proves some of their basic properties. -/ +@[expose] public section + namespace SimpleGraph variable {V : Type*} (G : SimpleGraph V) diff --git a/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean b/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean index 31422aff45b2d7..acfc1c1ee60d39 100644 --- a/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean +++ b/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Combinatorics.SimpleGraph.Dart -import Mathlib.Combinatorics.SimpleGraph.Finite -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Combinatorics.SimpleGraph.Dart +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Data.ZMod.Basic /-! # Degree-sum formula and handshaking lemma @@ -35,6 +37,8 @@ of the corresponding vertex and that (2) the map from darts to edges is 2-to-1. simple graphs, sums, degree-sum formula, handshaking lemma -/ +@[expose] public section + assert_not_exists Field TwoSidedIdeal open Finset diff --git a/Mathlib/Combinatorics/SimpleGraph/DeleteEdges.lean b/Mathlib/Combinatorics/SimpleGraph/DeleteEdges.lean index 1487bb22b0408e..d1d394b24a482f 100644 --- a/Mathlib/Combinatorics/SimpleGraph/DeleteEdges.lean +++ b/Mathlib/Combinatorics/SimpleGraph/DeleteEdges.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson, Jalex Stark, Kyle Miller. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark, Kyle Miller, Alena Gusakov, Hunter Monroe -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.Combinatorics.SimpleGraph.Finite -import Mathlib.Combinatorics.SimpleGraph.Maps -import Mathlib.Data.Int.Cast.Basic +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Combinatorics.SimpleGraph.Maps +public import Mathlib.Data.Int.Cast.Basic /-! # Edge deletion @@ -26,6 +28,8 @@ case. `p`, that is, at least `r` edges must be deleted to satisfy `p`. -/ +@[expose] public section + open Finset Fintype diff --git a/Mathlib/Combinatorics/SimpleGraph/Density.lean b/Mathlib/Combinatorics/SimpleGraph/Density.lean index b30933573708fc..9f8cb3ed6df474 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Density.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Density.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Combinatorics.SimpleGraph.Basic -import Mathlib.Data.Rat.Cast.Order -import Mathlib.Order.Partition.Finpartition -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Combinatorics.SimpleGraph.Basic +public import Mathlib.Data.Rat.Cast.Order +public import Mathlib.Order.Partition.Finpartition +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Ring /-! # Edge density @@ -26,6 +28,8 @@ Between two finsets of vertices, * `SimpleGraph.edgeDensity`: Edge density of a graph. -/ +@[expose] public section + open Finset variable {𝕜 ι κ α β : Type*} diff --git a/Mathlib/Combinatorics/SimpleGraph/Diam.lean b/Mathlib/Combinatorics/SimpleGraph/Diam.lean index beddafdb741204..9eaa73dd316aca 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Diam.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Diam.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Rida Hamadani. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rida Hamadani -/ -import Mathlib.Combinatorics.SimpleGraph.Metric +module + +public import Mathlib.Combinatorics.SimpleGraph.Metric /-! # Diameter of a simple graph @@ -26,6 +28,8 @@ This module defines the eccentricity of vertices, the diameter, and the radius o -/ +@[expose] public section + assert_not_exists Field namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean b/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean index 1cbf849ba26a31..d5a72d8821bc65 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Anand Rao, Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anand Rao, Rémi Bottinelli -/ -import Mathlib.CategoryTheory.CofilteredSystem -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Data.Finite.Set +module + +public import Mathlib.CategoryTheory.CofilteredSystem +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Data.Finite.Set /-! # Ends @@ -14,6 +16,8 @@ This file contains a definition of the ends of a simple graph, as sections of th assigning, to each finite set of vertices, the connected components of its complement. -/ +@[expose] public section + universe u diff --git a/Mathlib/Combinatorics/SimpleGraph/Ends/Properties.lean b/Mathlib/Combinatorics/SimpleGraph/Ends/Properties.lean index 7a1af9a52ecaa8..1661f9a8e2495f 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Ends/Properties.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Ends/Properties.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anand Rao, Rémi Bottinelli. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anand Rao, Rémi Bottinelli -/ -import Mathlib.Combinatorics.SimpleGraph.Ends.Defs -import Mathlib.CategoryTheory.CofilteredSystem +module + +public import Mathlib.Combinatorics.SimpleGraph.Ends.Defs +public import Mathlib.CategoryTheory.CofilteredSystem /-! # Properties of the ends of graphs @@ -13,6 +15,8 @@ This file is meant to contain results about the ends of (locally finite connecte -/ +@[expose] public section + variable {V : Type} (G : SimpleGraph V) diff --git a/Mathlib/Combinatorics/SimpleGraph/Extremal/Basic.lean b/Mathlib/Combinatorics/SimpleGraph/Extremal/Basic.lean index 3e7ee213eb24d0..28b62c9c877ff7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Extremal/Basic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Extremal/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Horner -/ -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Combinatorics.SimpleGraph.Copy +module + +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Combinatorics.SimpleGraph.Copy /-! # Extremal graph theory @@ -22,6 +24,8 @@ This file introduces basic definitions for extremal graph theory, including extr If `H` is contained in all simple graphs on `n` vertices, then this is `0`. -/ +@[expose] public section + assert_not_exists Field open Finset Fintype diff --git a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean index 6b8a50fcb6e953..80aaa1e77fa663 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Combinatorics.SimpleGraph.DegreeSum -import Mathlib.Order.Partition.Equipartition +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum +public import Mathlib.Order.Partition.Equipartition /-! # Turán's theorem @@ -39,6 +41,8 @@ the property through `turanGraph n r` using the isomorphism provided by the forw * https://en.wikipedia.org/wiki/Turán%27s_theorem -/ +@[expose] public section + open Finset namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Extremal/TuranDensity.lean b/Mathlib/Combinatorics/SimpleGraph/Extremal/TuranDensity.lean index 672072c975b310..3391ed74c45561 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Extremal/TuranDensity.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Extremal/TuranDensity.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Mitchell Horner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Horner -/ -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Combinatorics.SimpleGraph.DeleteEdges -import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic -import Mathlib.Data.Nat.Choose.Cast +module + +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.SimpleGraph.DeleteEdges +public import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic +public import Mathlib.Data.Nat.Choose.Cast /-! # Turán density @@ -25,6 +27,8 @@ This file defines the **Turán density** of a simple graph. asymptotically equivalent to `turanDensity H * n.choose 2` as `n` approaches `∞`. -/ +@[expose] public section + open Asymptotics Filter Finset Fintype Topology diff --git a/Mathlib/Combinatorics/SimpleGraph/Finite.lean b/Mathlib/Combinatorics/SimpleGraph/Finite.lean index 7e98fe01ba1b5a..0f9c798957130e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Finite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Finite.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Aaron Anderson, Jalex Stark, Kyle Miller. All rights reserved Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark, Kyle Miller, Alena Gusakov -/ -import Mathlib.Combinatorics.SimpleGraph.Maps -import Mathlib.Data.Finset.Max -import Mathlib.Data.Sym.Card +module + +public import Mathlib.Combinatorics.SimpleGraph.Maps +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Sym.Card /-! # Definitions for finite and locally finite graphs @@ -38,6 +40,8 @@ or `card_verts`. is locally finite, too. -/ +@[expose] public section + open Finset Function diff --git a/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean b/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean index 332d2db3a5b3d1..7ffb317f251f0e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joanna Choules. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joanna Choules -/ -import Mathlib.CategoryTheory.CofilteredSystem -import Mathlib.Combinatorics.SimpleGraph.Subgraph +module + +public import Mathlib.CategoryTheory.CofilteredSystem +public import Mathlib.Combinatorics.SimpleGraph.Subgraph /-! # Homomorphisms from finite subgraphs @@ -30,6 +32,8 @@ finite subgraphs `G'' ≤ G'`, the inverse system `finsubgraphHomFunctor` restri `G' →fg F` to domain `G''`. -/ +@[expose] public section + open Set CategoryTheory diff --git a/Mathlib/Combinatorics/SimpleGraph/FiveWheelLike.lean b/Mathlib/Combinatorics/SimpleGraph/FiveWheelLike.lean index bd24eb426b5049..323bb0cc91b2d7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/FiveWheelLike.lean +++ b/Mathlib/Combinatorics/SimpleGraph/FiveWheelLike.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 John Talbot and Lian Bremner Tattersall. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: John Talbot, Lian Bremner Tattersall -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Ring /-! # Five-wheel like graphs @@ -80,6 +82,8 @@ We will need to refer to this consistently and choose the following formulation: https://doi.org/10.1007/s00493-003-0042-z][brandt2003] -/ +@[expose] public section + local notation "‖" x "‖" => Fintype.card x open Finset SimpleGraph @@ -342,13 +346,6 @@ lemma exists_isFiveWheelLike_succ_of_not_adj_le_two (hW : ∀ ⦃y⦄, y ∈ s notMem_mono inter_subset_left hbs, erase_eq_of_notMem <| notMem_mono inter_subset_right hat, card_insert_of_notMem (fun h ↦ G.irrefl (hW h)), hw.card_inter] -#adaptation_note -/-- -Due to a change in `grind` between `nightly-2025-10-31` and `nightly-2025-11-02`, -this proof is no longer working. I've temporarily commented it out to get a build of -`nightly-testing`. --/ -/- /-- If `G` is a `Kᵣ₊₂`-free graph with `n` vertices containing a `Wᵣ,ₖ` but no `Wᵣ,ₖ₊₁` then `G.minDegree ≤ (2 * r + k) * n / (2 * r + k + 3)` @@ -411,16 +408,11 @@ lemma minDegree_le_of_cliqueFree_fiveWheelLikeFree_succ [Fintype α] rw [hap, ← add_mul, card_add_card_compl, mul_comm, two_mul, ← add_assoc] gcongr cutsat --/ + end IsFiveWheelLike variable [DecidableEq α] -#adaptation_note -/-- -I've temporarily commented it out to get a build of `nightly-testing`. See the note above. --/ -/- /-- **Andrasfái-Erdős-Sós** theorem If `G` is a `Kᵣ₊₁`-free graph with `n` vertices and `(3 * r - 4) * n / (3 * r - 1) < G.minDegree` @@ -455,6 +447,6 @@ theorem colorable_of_cliqueFree_lt_minDegree [Fintype α] [DecidableRel G.Adj] apply (Nat.mul_le_mul_right _ (Nat.div_mul_le_self ..)).trans nlinarith exact (hd.trans_le <| minDegree_le_minDegree hle).not_ge <| hD.trans <| this --/ + end AES end SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Girth.lean b/Mathlib/Combinatorics/SimpleGraph/Girth.lean index 29c6cbb43e009c..cf40bfc3dca56d 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Girth.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Girth.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.SimpleGraph.Acyclic -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Combinatorics.SimpleGraph.Acyclic +public import Mathlib.Data.ENat.Lattice /-! # Girth of a simple graph @@ -19,6 +21,8 @@ cycle, they give `0` or `∞` respectively if the graph is acyclic. -/ +@[expose] public section + namespace SimpleGraph variable {α : Type*} {G : SimpleGraph α} diff --git a/Mathlib/Combinatorics/SimpleGraph/Hall.lean b/Mathlib/Combinatorics/SimpleGraph/Hall.lean index 32ac0703b234be..7498d8a9dd795c 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Hall.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Hall.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Vlad Tsyrklevich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vlad Tsyrklevich -/ -import Mathlib.Combinatorics.Hall.Basic -import Mathlib.Combinatorics.SimpleGraph.Bipartite -import Mathlib.Combinatorics.SimpleGraph.Matching +module + +public import Mathlib.Combinatorics.Hall.Basic +public import Mathlib.Combinatorics.SimpleGraph.Bipartite +public import Mathlib.Combinatorics.SimpleGraph.Matching /-! # Hall's Marriage Theorem @@ -25,6 +27,8 @@ This file derives Hall's Marriage Theorem for bipartite graphs from the combinat Hall's Marriage Theorem -/ +@[expose] public section + open Function namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean b/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean index a50b64bf6b984b..f9a7b8af813b3e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Bhavik Mehta, Rishi Mehta, Linus Sommer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Rishi Mehta, Linus Sommer -/ -import Mathlib.Algebra.GroupWithZero.Nat -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +module + +public import Mathlib.Algebra.GroupWithZero.Nat +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected /-! # Hamiltonian Graphs @@ -19,6 +21,8 @@ In this file we introduce Hamiltonian paths, cycles and graphs. - `SimpleGraph.IsHamiltonian`: Predicate for a graph to be Hamiltonian. -/ +@[expose] public section + open Finset Function namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Hasse.lean b/Mathlib/Combinatorics/SimpleGraph/Hasse.lean index b640c1fe80a057..7f28b7918b4fb4 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Hasse.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Hasse.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.SimpleGraph.Prod -import Mathlib.Data.Fin.SuccPredOrder -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.SuccPred.Relation -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Combinatorics.SimpleGraph.Prod +public import Mathlib.Data.Fin.SuccPredOrder +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.SuccPred.Relation +public import Mathlib.Tactic.FinCases /-! # The Hasse diagram as a graph @@ -21,6 +23,8 @@ path graph on `n` vertices. * `SimpleGraph.pathGraph`: Path graph on `n` vertices. -/ +@[expose] public section + open Order OrderDual Relation diff --git a/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean b/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean index a2c7e5f8ff5994..a35e4415f19e0b 100644 --- a/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean +++ b/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Gabriel Moise. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Moise, Yaël Dillies, Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Finite -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Matrix.Mul +module + +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Matrix.Mul /-! # Incidence matrix of a simple graph @@ -41,6 +43,8 @@ incidence matrix for each `SimpleGraph α` has the same type. arbitrary orientation of a simple graph. -/ +@[expose] public section + assert_not_exists Field open Finset Matrix SimpleGraph Sym2 diff --git a/Mathlib/Combinatorics/SimpleGraph/Init.lean b/Mathlib/Combinatorics/SimpleGraph/Init.lean index 349009999ed435..996ab2dca2d715 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Init.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Init.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ +module -import Mathlib.Init -import Aesop +public import Mathlib.Init +public import Aesop /-! # SimpleGraph Rule Set @@ -15,4 +16,6 @@ This module defines the `SimpleGraph` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ +@[expose] public section + declare_aesop_rule_sets [SimpleGraph] diff --git a/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean b/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean index a7fa7ce18201b7..76ca8553438be4 100644 --- a/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean +++ b/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Adrian Wüthrich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adrian Wüthrich -/ -import Mathlib.Analysis.Matrix.Order -import Mathlib.Combinatorics.SimpleGraph.AdjMatrix +module + +public import Mathlib.Analysis.Matrix.Order +public import Mathlib.Combinatorics.SimpleGraph.AdjMatrix /-! # Laplacian Matrix @@ -23,6 +25,8 @@ This module defines the Laplacian matrix of a graph, and proves some of its elem -/ +@[expose] public section + open Finset Matrix Module namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean b/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean index a1c37b83a30f62..90e55c877e42f9 100644 --- a/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Basic +module + +public import Mathlib.Combinatorics.SimpleGraph.Basic /-! # LineGraph @@ -18,6 +20,8 @@ import Mathlib.Combinatorics.SimpleGraph.Basic line graph -/ +@[expose] public section + namespace SimpleGraph variable {V : Type*} {G : SimpleGraph V} diff --git a/Mathlib/Combinatorics/SimpleGraph/Maps.lean b/Mathlib/Combinatorics/SimpleGraph/Maps.lean index f6620c1a2f4b22..2c0032e8234b38 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Maps.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Maps.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Hunter Monroe. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hunter Monroe, Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Dart -import Mathlib.Data.FunLike.Fintype -import Mathlib.Logic.Embedding.Set +module + +public import Mathlib.Combinatorics.SimpleGraph.Dart +public import Mathlib.Data.FunLike.Fintype +public import Mathlib.Logic.Embedding.Set /-! # Maps between graphs @@ -36,6 +38,8 @@ To make use of pre-existing simp lemmas, definitions involving morphisms are abbreviations as well. -/ +@[expose] public section + open Function diff --git a/Mathlib/Combinatorics/SimpleGraph/Matching.lean b/Mathlib/Combinatorics/SimpleGraph/Matching.lean index 867278dc5741e2..7f77923978ae38 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Matching.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Matching.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Alena Gusakov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alena Gusakov, Arthur Paulino, Kyle Miller, Pim Otte -/ -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph -import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting -import Mathlib.Combinatorics.SimpleGraph.DegreeSum -import Mathlib.Combinatorics.SimpleGraph.Operations -import Mathlib.Data.Set.Card.Arithmetic -import Mathlib.Data.Set.Functor +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum +public import Mathlib.Combinatorics.SimpleGraph.Operations +public import Mathlib.Data.Set.Card.Arithmetic +public import Mathlib.Data.Set.Functor /-! # Matchings @@ -47,6 +49,8 @@ one edge, and the edges of the subgraph represent the paired vertices. * Tutte's Theorem -/ +@[expose] public section + assert_not_exists Field TwoSidedIdeal open Function diff --git a/Mathlib/Combinatorics/SimpleGraph/Metric.lean b/Mathlib/Combinatorics/SimpleGraph/Metric.lean index 0ca20cac36849e..9524a992f240a2 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Metric.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Metric.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Vincent Beffara, Rida Hamadani -/ -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Data.ENat.Lattice /-! # Graph metric @@ -32,6 +34,8 @@ graph metric, distance -/ +@[expose] public section + assert_not_exists Field namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Operations.lean b/Mathlib/Combinatorics/SimpleGraph/Operations.lean index 193b0077e5f827..37d23db9225264 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Operations.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Operations.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Combinatorics.SimpleGraph.Finite -import Mathlib.Combinatorics.SimpleGraph.Maps -import Mathlib.Combinatorics.SimpleGraph.Subgraph +module + +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Combinatorics.SimpleGraph.Maps +public import Mathlib.Combinatorics.SimpleGraph.Subgraph /-! # Local graph operations @@ -22,6 +24,8 @@ we also prove theorems about the number of edges in the modified graphs. `G ⊔ edge s t`. -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SimpleGraph/Partition.lean b/Mathlib/Combinatorics/SimpleGraph/Partition.lean index 925943c786acf4..90155aadeafb2d 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Partition.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Partition.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Arthur Paulino. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Coloring +module + +public import Mathlib.Combinatorics.SimpleGraph.Coloring /-! # Graph partitions @@ -42,6 +44,8 @@ graph colorings and back is the identity. -/ +@[expose] public section + assert_not_exists Field universe u v diff --git a/Mathlib/Combinatorics/SimpleGraph/Path.lean b/Mathlib/Combinatorics/SimpleGraph/Path.lean index 552d8a19e5e1ba..7e7b8d019b5af7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Path.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Path.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected -import Mathlib.Combinatorics.SimpleGraph.Paths +module + +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +public import Mathlib.Combinatorics.SimpleGraph.Paths deprecated_module (since := "2025-06-13") diff --git a/Mathlib/Combinatorics/SimpleGraph/Paths.lean b/Mathlib/Combinatorics/SimpleGraph/Paths.lean index d2e1b38abd83d0..20a17f3fe7aee8 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Paths.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Paths.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkDecomp -import Mathlib.Combinatorics.SimpleGraph.Walk +module + +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkDecomp +public import Mathlib.Combinatorics.SimpleGraph.Walk /-! @@ -43,6 +45,8 @@ counterparts in [Chou1994]. trails, paths, circuits, cycles -/ +@[expose] public section + open Function universe u v w @@ -467,6 +471,10 @@ protected theorem IsPath.dropUntil {u v w : V} {p : G.Walk v w} (hc : p.IsPath) IsPath.of_append_right (p := p.takeUntil u h) (q := p.dropUntil u h) (by rwa [← take_spec _ h] at hc) +lemma IsTrail.disjoint_edges_takeUntil_dropUntil {x : V} {w : G.Walk u v} (hw : w.IsTrail) + (hx : x ∈ w.support) : (w.takeUntil x hx).edges.Disjoint (w.dropUntil x hx).edges := + List.disjoint_of_nodup_append <| by simpa [← edges_append] using hw.edges_nodup + protected theorem IsTrail.rotate {u v : V} {c : G.Walk v v} (hc : c.IsTrail) (h : u ∈ c.support) : (c.rotate h).IsTrail := by rw [isTrail_def, (c.rotate_edges h).perm.nodup_iff] diff --git a/Mathlib/Combinatorics/SimpleGraph/Prod.lean b/Mathlib/Combinatorics/SimpleGraph/Prod.lean index ea6d977b394782..89fccc0abfbf5b 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Prod.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 George Peter Banyard, Yaël Dillies, Kyle Miller. All rights Released under Apache 2.0 license as described in the file LICENSE. Authors: George Peter Banyard, Yaël Dillies, Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.Paths -import Mathlib.Combinatorics.SimpleGraph.Metric +module + +public import Mathlib.Combinatorics.SimpleGraph.Paths +public import Mathlib.Combinatorics.SimpleGraph.Metric /-! # Graph products @@ -27,6 +29,8 @@ two edges is a square. Define all other graph products! -/ +@[expose] public section + variable {α β γ : Type*} namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Bound.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Bound.lean index 4e35b02a0f4206..cb1d76e8a09f0a 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Bound.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Bound.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Algebra.Order.Chebyshev -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Order.Partition.Equipartition +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Algebra.Order.Chebyshev +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Order.Partition.Equipartition /-! # Numerical bounds for Szemerédi Regularity Lemma @@ -28,6 +30,8 @@ This entire file is internal to the proof of Szemerédi Regularity Lemma. [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finset Fintype Function Real @@ -233,7 +237,7 @@ open Lean.Meta Qq /-- Extension for the `positivity` tactic: `SzemerediRegularity.initialBound` is always positive. -/ @[positivity SzemerediRegularity.initialBound _ _] -def evalInitialBound : PositivityExt where eval {u α} _ _ e := do +meta def evalInitialBound : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℕ), ~q(SzemerediRegularity.initialBound $ε $l) => assertInstancesCommute @@ -245,7 +249,7 @@ example (ε : ℝ) (l : ℕ) : 0 < SzemerediRegularity.initialBound ε l := by p /-- Extension for the `positivity` tactic: `SzemerediRegularity.bound` is always positive. -/ @[positivity SzemerediRegularity.bound _ _] -def evalBound : PositivityExt where eval {u α} _ _ e := do +meta def evalBound : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℕ), ~q(SzemerediRegularity.bound $ε $l) => assertInstancesCommute diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean index 28e36c771c12d8..0a224ac04b8c55 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Regularity.Bound -import Mathlib.Combinatorics.SimpleGraph.Regularity.Equitabilise -import Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform +module + +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Bound +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Equitabilise +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform /-! # Chunk of the increment partition for Szemerédi Regularity Lemma @@ -34,6 +36,8 @@ Once ported to mathlib4, this file will be a great golfing ground for Heather's [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finpartition Finset Fintype Rel Nat open scoped SzemerediRegularity.Positivity diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Energy.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Energy.lean index 5d46571674948d..7c1f8040799bd9 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Energy.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Energy.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Combinatorics.SimpleGraph.Density -import Mathlib.Data.Rat.BigOperators +module + +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Combinatorics.SimpleGraph.Density +public import Mathlib.Data.Rat.BigOperators /-! # Energy of a partition @@ -22,6 +24,8 @@ has an energy greater than the previous one plus some fixed constant. [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Equitabilise.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Equitabilise.lean index 1cc03e8ebd9355..7f825d534c9a70 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Equitabilise.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Equitabilise.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Order.Partition.Equipartition +module + +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Order.Partition.Equipartition /-! # Equitabilising a partition @@ -26,6 +28,8 @@ This file allows to blow partitions up into parts of controlled size. Given a pa [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finset Nat diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Increment.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Increment.lean index c0384badead8e5..e9f6bad93f37f7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Increment.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Increment.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk -import Mathlib.Combinatorics.SimpleGraph.Regularity.Energy +module + +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Energy /-! # Increment partition for Szemerédi Regularity Lemma @@ -33,6 +35,8 @@ Once ported to mathlib4, this file will be a great golfing ground for Heather's [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finset Fintype SimpleGraph SzemerediRegularity diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Lemma.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Lemma.lean index b4d93764bd7b5d..8444cbd6b3bfd9 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Lemma.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Lemma.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Regularity.Increment +module + +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Increment /-! # Szemerédi's Regularity Lemma @@ -61,6 +63,8 @@ We currently only prove the equipartition version of SRL. [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finpartition Finset Fintype Function SzemerediRegularity diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean index dd91bea449fbc1..97d5d9357c8a53 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Combinatorics.SimpleGraph.Density -import Mathlib.Data.Nat.Cast.Order.Field -import Mathlib.Order.Partition.Equipartition -import Mathlib.SetTheory.Cardinal.Order +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Combinatorics.SimpleGraph.Density +public import Mathlib.Data.Nat.Cast.Order.Field +public import Mathlib.Order.Partition.Equipartition +public import Mathlib.SetTheory.Cardinal.Order /-! # Graph uniformity and uniform partitions @@ -39,6 +41,8 @@ greater than `(1 - ε)`. [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean index e5b003b627d191..5ec179c1893e15 100644 --- a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean +++ b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Alena Gusakov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alena Gusakov, Jeremy Tan -/ -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Combinatorics.SimpleGraph.AdjMatrix +module + +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.SimpleGraph.AdjMatrix /-! # Strongly regular graphs @@ -26,6 +28,8 @@ import Mathlib.Combinatorics.SimpleGraph.AdjMatrix `I` be the identity matrix, then `A ^ 2 = k • I + ℓ • A + μ • C`. -/ +@[expose] public section + open Finset diff --git a/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean b/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean index aaf01fc88884fa..1be8bd544ff018 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Hunter Monroe. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hunter Monroe, Kyle Miller, Alena Gusakov -/ -import Mathlib.Combinatorics.SimpleGraph.DeleteEdges -import Mathlib.Data.Fintype.Powerset +module + +public import Mathlib.Combinatorics.SimpleGraph.DeleteEdges +public import Mathlib.Data.Fintype.Powerset /-! # Subgraphs of a simple graph @@ -45,6 +47,8 @@ sub-relation of the adjacency relation of the simple graph. -/ +@[expose] public section + universe u v @@ -370,6 +374,13 @@ theorem verts_top : (⊤ : G.Subgraph).verts = Set.univ := theorem verts_bot : (⊥ : G.Subgraph).verts = ∅ := rfl +theorem eq_bot_iff_verts_eq_empty (G' : G.Subgraph) : G' = ⊥ ↔ G'.verts = ∅ := + ⟨(· ▸ verts_bot), fun h ↦ Subgraph.ext (h ▸ verts_bot (G := G)) <| + funext₂ fun _ _ ↦ propext ⟨fun h' ↦ (h ▸ h'.fst_mem :), False.elim⟩⟩ + +theorem ne_bot_iff_nonempty_verts (G' : G.Subgraph) : G' ≠ ⊥ ↔ G'.verts.Nonempty := + G'.eq_bot_iff_verts_eq_empty.not.trans <| Set.nonempty_iff_ne_empty.symm + @[simp] theorem sSup_adj {s : Set G.Subgraph} : (sSup s).Adj a b ↔ ∃ G ∈ s, Adj G a b := Iff.rfl @@ -438,35 +449,25 @@ instance distribLattice : DistribLattice G.Subgraph := le := fun x y => x.verts ⊆ y.verts ∧ ∀ ⦃v w : V⦄, x.Adj v w → y.Adj v w } instance : BoundedOrder (Subgraph G) where - top := ⊤ - bot := ⊥ le_top x := ⟨Set.subset_univ _, fun _ _ => x.adj_sub⟩ bot_le _ := ⟨Set.empty_subset _, fun _ _ => False.elim⟩ /-- Note that subgraphs do not form a Boolean algebra, because of `verts`. -/ -def completelyDistribLatticeMinimalAxioms : CompletelyDistribLattice.MinimalAxioms G.Subgraph := - { Subgraph.distribLattice with - le := (· ≤ ·) - sup := (· ⊔ ·) - inf := (· ⊓ ·) - top := ⊤ - bot := ⊥ - le_top := fun G' => ⟨Set.subset_univ _, fun _ _ => G'.adj_sub⟩ - bot_le := fun _ => ⟨Set.empty_subset _, fun _ _ => False.elim⟩ - sSup := sSup - -- Porting note: needed `apply` here to modify elaboration; previously the term itself was fine. - le_sSup := fun s G' hG' => ⟨by apply Set.subset_iUnion₂ G' hG', fun _ _ hab => ⟨G', hG', hab⟩⟩ - sSup_le := fun s G' hG' => - ⟨Set.iUnion₂_subset fun _ hH => (hG' _ hH).1, by - rintro a b ⟨H, hH, hab⟩ - exact (hG' _ hH).2 hab⟩ - sInf := sInf - sInf_le := fun _ G' hG' => ⟨Set.iInter₂_subset G' hG', fun _ _ hab => hab.1 hG'⟩ - le_sInf := fun _ G' hG' => - ⟨Set.subset_iInter₂ fun _ hH => (hG' _ hH).1, fun _ _ hab => - ⟨fun _ hH => (hG' _ hH).2 hab, G'.adj_sub hab⟩⟩ - iInf_iSup_eq := fun f => Subgraph.ext (by simpa using iInf_iSup_eq) - (by ext; simp [Classical.skolem]) } +def completelyDistribLatticeMinimalAxioms : CompletelyDistribLattice.MinimalAxioms G.Subgraph where + le_top G' := ⟨Set.subset_univ _, fun _ _ => G'.adj_sub⟩ + bot_le _ := ⟨Set.empty_subset _, fun _ _ => False.elim⟩ + -- Porting note: needed `apply` here to modify elaboration; previously the term itself was fine. + le_sSup s G' hG' := ⟨by apply Set.subset_iUnion₂ G' hG', fun _ _ hab => ⟨G', hG', hab⟩⟩ + sSup_le s G' hG' := + ⟨Set.iUnion₂_subset fun _ hH => (hG' _ hH).1, by + rintro a b ⟨H, hH, hab⟩ + exact (hG' _ hH).2 hab⟩ + sInf_le _ G' hG' := ⟨Set.iInter₂_subset G' hG', fun _ _ hab => hab.1 hG'⟩ + le_sInf _ G' hG' := + ⟨Set.subset_iInter₂ fun _ hH => (hG' _ hH).1, fun _ _ hab => + ⟨fun _ hH => (hG' _ hH).2 hab, G'.adj_sub hab⟩⟩ + iInf_iSup_eq f := Subgraph.ext (by simpa using iInf_iSup_eq) + (by ext; simp [Classical.skolem]) instance : CompletelyDistribLattice G.Subgraph := .ofMinimalAxioms completelyDistribLatticeMinimalAxioms diff --git a/Mathlib/Combinatorics/SimpleGraph/Sum.lean b/Mathlib/Combinatorics/SimpleGraph/Sum.lean index 3484154eb3c1f0..558078cfd0df2b 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Sum.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Sum.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Iván Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Iván Renison -/ -import Mathlib.Combinatorics.SimpleGraph.Basic -import Mathlib.Combinatorics.SimpleGraph.Coloring -import Mathlib.Combinatorics.SimpleGraph.Maps +module + +public import Mathlib.Combinatorics.SimpleGraph.Basic +public import Mathlib.Combinatorics.SimpleGraph.Coloring +public import Mathlib.Combinatorics.SimpleGraph.Maps /-! # Disjoint sum of graphs @@ -23,6 +25,8 @@ both in `G` and adjacent in `G`, or they are both in `H` and adjacent in `H`. * `G ⊕g H`: The disjoint sum of `G` and `H`. -/ +@[expose] public section + variable {α β γ : Type*} namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Trails.lean b/Mathlib/Combinatorics/SimpleGraph/Trails.lean index e92c38e1cdbc99..4c394ba8fb49dd 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Trails.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Trails.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.Ring.Parity -import Mathlib.Combinatorics.SimpleGraph.Paths +module + +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Combinatorics.SimpleGraph.Paths /-! @@ -34,6 +36,8 @@ Eulerian trails -/ +@[expose] public section + namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Triangle/Basic.lean b/Mathlib/Combinatorics/SimpleGraph/Triangle/Basic.lean index ce750cdc9d223d..c888df6df90dbe 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Triangle/Basic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Triangle/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Combinatorics.Enumerative.DoubleCounting -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Nat.Choose.Bounds -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.Positivity +module + +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Nat.Choose.Bounds +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.Positivity /-! # Triangles in graphs @@ -30,6 +32,8 @@ This module defines and proves properties about triangles in simple graphs. * Generalise `FarFromTriangleFree` to other graphs, to state and prove the Graph Removal Lemma. -/ +@[expose] public section + open Finset Nat open Fintype (card) diff --git a/Mathlib/Combinatorics/SimpleGraph/Triangle/Counting.lean b/Mathlib/Combinatorics/SimpleGraph/Triangle/Counting.lean index 277313ff47bf42..87933fd3fbb509 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Triangle/Counting.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Triangle/Counting.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform -import Mathlib.Data.Real.Basic -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform +public import Mathlib.Data.Real.Basic +public import Mathlib.Tactic.Linarith /-! # Triangle counting lemma @@ -18,6 +20,8 @@ In this file, we prove the triangle counting lemma. [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + -- TODO: This instance is bad because it creates data out of a Prop attribute [-instance] decidableEq_of_subsingleton diff --git a/Mathlib/Combinatorics/SimpleGraph/Triangle/Removal.lean b/Mathlib/Combinatorics/SimpleGraph/Triangle/Removal.lean index 839f2cda6933c1..21ae1cf9a43906 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Triangle/Removal.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Triangle/Removal.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.DegreeSum -import Mathlib.Combinatorics.SimpleGraph.Regularity.Lemma -import Mathlib.Combinatorics.SimpleGraph.Triangle.Basic -import Mathlib.Combinatorics.SimpleGraph.Triangle.Counting -import Mathlib.Data.Finset.CastCard +module + +public import Mathlib.Combinatorics.SimpleGraph.DegreeSum +public import Mathlib.Combinatorics.SimpleGraph.Regularity.Lemma +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Basic +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Counting +public import Mathlib.Data.Finset.CastCard /-! # Triangle removal lemma @@ -19,6 +21,8 @@ In this file, we prove the triangle removal lemma. [Yaël Dillies, Bhavik Mehta, *Formalising Szemerédi’s Regularity Lemma in Lean*][srl_itp] -/ +@[expose] public section + open Finset Fintype Nat SzemerediRegularity variable {α : Type*} [DecidableEq α] [Fintype α] {G : SimpleGraph α} [DecidableRel G.Adj] @@ -172,7 +176,7 @@ if `ε` is. This exploits the positivity of the junk value of `triangleRemovalBound ε` for `ε ≥ 1`. -/ @[positivity triangleRemovalBound _] -def evalTriangleRemovalBound : PositivityExt where eval {u α} _zα _pα e := do +meta def evalTriangleRemovalBound : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(triangleRemovalBound $ε) => let .positive hε ← core q(inferInstance) q(inferInstance) ε | failure diff --git a/Mathlib/Combinatorics/SimpleGraph/Triangle/Tripartite.lean b/Mathlib/Combinatorics/SimpleGraph/Triangle/Tripartite.lean index 21405818a3c2f1..7ac9f3a9eae193 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Triangle/Tripartite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Triangle/Tripartite.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Combinatorics.SimpleGraph.Triangle.Basic +module + +public import Mathlib.Combinatorics.SimpleGraph.Triangle.Basic /-! # Construct a tripartite graph from its triangles @@ -35,6 +37,8 @@ This construction shows up unrelatedly twice in the theory of Roth numbers: corner-free. -/ +@[expose] public section + open Finset Function Sum3 variable {α β γ 𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] diff --git a/Mathlib/Combinatorics/SimpleGraph/Turan.lean b/Mathlib/Combinatorics/SimpleGraph/Turan.lean index 2fc37d28fde884..8b2e4c1efee4fa 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Turan.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Turan.lean @@ -1,3 +1,5 @@ -import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan +module + +public import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan deprecated_module (since := "2025-08-21") diff --git a/Mathlib/Combinatorics/SimpleGraph/Tutte.lean b/Mathlib/Combinatorics/SimpleGraph/Tutte.lean index 3dfb347f29d1cd..3884fceb5d0ef0 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Tutte.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Tutte.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Otte -/ +module -import Mathlib.Combinatorics.SimpleGraph.Matching -import Mathlib.Combinatorics.SimpleGraph.Metric -import Mathlib.Combinatorics.SimpleGraph.Operations -import Mathlib.Combinatorics.SimpleGraph.UniversalVerts -import Mathlib.Data.Fintype.Card +public import Mathlib.Combinatorics.SimpleGraph.Matching +public import Mathlib.Combinatorics.SimpleGraph.Metric +public import Mathlib.Combinatorics.SimpleGraph.Operations +public import Mathlib.Combinatorics.SimpleGraph.UniversalVerts +public import Mathlib.Data.Fintype.Card /-! # Tutte's theorem @@ -25,6 +26,8 @@ import Mathlib.Data.Fintype.Card only if no Tutte violators exist. -/ +@[expose] public section + namespace SimpleGraph variable {V : Type*} {G G' : SimpleGraph V} {u x v' w : V} diff --git a/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean b/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean index 0bce72b46714e5..9ac099fcadc6d8 100644 --- a/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean +++ b/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Otte -/ -import Mathlib.Combinatorics.SimpleGraph.Clique -import Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents -import Mathlib.Combinatorics.SimpleGraph.Matching +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents +public import Mathlib.Combinatorics.SimpleGraph.Matching /-! # Universal Vertices @@ -21,6 +23,8 @@ in the proof of Tutte's Theorem. * `G.deleteUniversalVerts` is the subgraph of `G` with the universal vertices removed. -/ +@[expose] public section + assert_not_exists Field TwoSidedIdeal namespace SimpleGraph diff --git a/Mathlib/Combinatorics/SimpleGraph/Walk.lean b/Mathlib/Combinatorics/SimpleGraph/Walk.lean index 69c122270ca0db..f0bbf0af71d4c7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Walk.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Walk.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Combinatorics.SimpleGraph.DeleteEdges +module + +public import Mathlib.Combinatorics.SimpleGraph.DeleteEdges /-! @@ -33,6 +35,8 @@ walks -/ +@[expose] public section + -- TODO: split open Function @@ -1496,3 +1500,5 @@ lemma isSubwalk_antisymm {u v} {p₁ p₂ : G.Walk u v} (h₁ : p₁.IsSubwalk p end Walk end SimpleGraph + +set_option linter.style.longFile 1700 diff --git a/Mathlib/Combinatorics/Young/SemistandardTableau.lean b/Mathlib/Combinatorics/Young/SemistandardTableau.lean index 3568197c76b771..5d11338af59740 100644 --- a/Mathlib/Combinatorics/Young/SemistandardTableau.lean +++ b/Mathlib/Combinatorics/Young/SemistandardTableau.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jake Levinson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jake Levinson -/ -import Mathlib.Combinatorics.Young.YoungDiagram +module + +public import Mathlib.Combinatorics.Young.YoungDiagram /-! # Semistandard Young tableaux @@ -42,6 +44,8 @@ Semistandard Young tableau -/ +@[expose] public section + /-- A semistandard Young tableau is a filling of the cells of a Young diagram by natural numbers, such that the entries in each row are weakly increasing (left to right), and the entries diff --git a/Mathlib/Combinatorics/Young/YoungDiagram.lean b/Mathlib/Combinatorics/Young/YoungDiagram.lean index bf51bb2603b866..c50b7c181a0a71 100644 --- a/Mathlib/Combinatorics/Young/YoungDiagram.lean +++ b/Mathlib/Combinatorics/Young/YoungDiagram.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jake Levinson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jake Levinson -/ -import Mathlib.Data.Finset.Preimage -import Mathlib.Data.Finset.Prod -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Data.Finset.Preimage +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.UpperLower.Basic /-! # Young diagrams @@ -49,6 +51,8 @@ Young diagram -/ +@[expose] public section + open Function diff --git a/Mathlib/Computability/Ackermann.lean b/Mathlib/Computability/Ackermann.lean index 26c452bf08a53b..63c09b10173800 100644 --- a/Mathlib/Computability/Ackermann.lean +++ b/Mathlib/Computability/Ackermann.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Computability.PartrecCode -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Computability.PartrecCode +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Linarith /-! # Ackermann function @@ -47,6 +49,8 @@ applied twice, giving us a constant of `4 + 4`. The rest of the proof consists o which bump up our constant to `9`. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Computability/AkraBazzi/AkraBazzi.lean b/Mathlib/Computability/AkraBazzi/AkraBazzi.lean index 648276cbee722e..68f2a163ad265f 100644 --- a/Mathlib/Computability/AkraBazzi/AkraBazzi.lean +++ b/Mathlib/Computability/AkraBazzi/AkraBazzi.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Computability.AkraBazzi.SumTransform -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.Computability.AkraBazzi.SumTransform +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv /-! # Divide-and-conquer recurrences and the Akra-Bazzi theorem @@ -58,6 +59,8 @@ prove the version with a sum here, as it is simpler and more relevant for algori -/ +@[expose] public section + open Finset Real Filter Asymptotics open scoped Topology diff --git a/Mathlib/Computability/AkraBazzi/GrowsPolynomially.lean b/Mathlib/Computability/AkraBazzi/GrowsPolynomially.lean index d10311d723a6c9..3dd9a9f94b73b4 100644 --- a/Mathlib/Computability/AkraBazzi/GrowsPolynomially.lean +++ b/Mathlib/Computability/AkraBazzi/GrowsPolynomially.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Algebra.Order.ToIntervalMod -import Mathlib.Analysis.SpecialFunctions.Log.Base +public import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Algebra.Order.ToIntervalMod +public import Mathlib.Analysis.SpecialFunctions.Log.Base /-! # Akra-Bazzi theorem: the polynomial growth condition @@ -26,6 +27,8 @@ arise in practice. -/ +@[expose] public section + open Finset Real Filter Asymptotics open scoped Topology @@ -235,12 +238,9 @@ lemma eventually_atTop_nonneg_or_nonpos (hf : GrowsPolynomially f) : lemma eventually_atTop_zero_or_pos_or_neg (hf : GrowsPolynomially f) : (∀ᶠ x in atTop, f x = 0) ∨ (∀ᶠ x in atTop, 0 < f x) ∨ (∀ᶠ x in atTop, f x < 0) := by - if h : ∃ᶠ x in atTop, f x = 0 then - exact Or.inl <| eventually_zero_of_frequently_zero hf h - else - rw [not_frequently] at h - push_neg at h - cases eventually_atTop_nonneg_or_nonpos hf with + by_cases! h : ∃ᶠ x in atTop, f x = 0 + · exact Or.inl <| eventually_zero_of_frequently_zero hf h + · cases eventually_atTop_nonneg_or_nonpos hf with | inl h' => refine Or.inr (Or.inl ?_) simp only [lt_iff_le_and_ne] diff --git a/Mathlib/Computability/AkraBazzi/SumTransform.lean b/Mathlib/Computability/AkraBazzi/SumTransform.lean index 1b77dd2c252e6e..ddcc4577f894e7 100644 --- a/Mathlib/Computability/AkraBazzi/SumTransform.lean +++ b/Mathlib/Computability/AkraBazzi/SumTransform.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis -/ +module -import Mathlib.Computability.AkraBazzi.GrowsPolynomially -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public import Mathlib.Computability.AkraBazzi.GrowsPolynomially +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.Analysis.SpecialFunctions.Log.Deriv /-! # Akra-Bazzi theorem: the sum transform @@ -21,7 +22,7 @@ We develop further preliminaries required for the theorem, up to the sum transfo and positivity of `T`. * `AkraBazziRecurrence.smoothingFn`: the smoothing function $\varepsilon(x) = 1 / \log x$ used in the inductive estimates, along with monotonicity, differentiability, and asymptotic properties. -* `AkraBazziRecurrence.p`: the unique Akra–Bazzi exponent characterized by $\sum_i a_i\,(b_i)^p = 1` +* `AkraBazziRecurrence.p`: the unique Akra–Bazzi exponent characterized by $\sum_i a_i\,(b_i)^p = 1$ and supporting analytical lemmas such as continuity and injectivity of the defining sum. * `AkraBazziRecurrence.sumTransform`: the transformation that turns a function `g` into `n^p * ∑ u ∈ Finset.Ico n₀ n, g u / u^(p+1)` and its eventual comparison with multiples of `g n`. @@ -38,6 +39,8 @@ We develop further preliminaries required for the theorem, up to the sum transfo -/ +@[expose] public section + open Finset Real Filter Asymptotics open scoped Topology diff --git a/Mathlib/Computability/ContextFreeGrammar.lean b/Mathlib/Computability/ContextFreeGrammar.lean index 3aca3d37ab8adb..8c83319edf1e39 100644 --- a/Mathlib/Computability/ContextFreeGrammar.lean +++ b/Mathlib/Computability/ContextFreeGrammar.lean @@ -3,7 +3,10 @@ Copyright (c) 2023 Martin Dvorak. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Dvorak -/ -import Mathlib.Computability.Language +module + +public import Mathlib.Computability.Language +import Mathlib.Data.Finset.Image /-! # Context-Free Grammars @@ -23,6 +26,8 @@ nonterminal symbols that are referred to by its finitely many rules. * `Language.IsContextFree.reverse`: The class of context-free languages is closed under reversal. -/ +@[expose] public section + open Function /-- Rule that rewrites a single nonterminal to any string (a list of symbols). -/ diff --git a/Mathlib/Computability/DFA.lean b/Mathlib/Computability/DFA.lean index d11e68d4166e8b..e8184c3adfbd29 100644 --- a/Mathlib/Computability/DFA.lean +++ b/Mathlib/Computability/DFA.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson, Chris Wong -/ -import Mathlib.Computability.Language -import Mathlib.Data.Countable.Small -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Tactic.NormNum +module + +public import Mathlib.Computability.Language +public import Mathlib.Data.Countable.Small +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Tactic.NormNum /-! # Deterministic Finite Automata @@ -44,6 +46,8 @@ Currently, there are two disjoint sets of simp lemmas: one for `DFA.eval`, and a - Should `mem_accepts` and `mem_acceptsFrom` be marked `@[simp]`? -/ +@[expose] public section + universe u v open Computability diff --git a/Mathlib/Computability/Encoding.lean b/Mathlib/Computability/Encoding.lean index 071697c31cacf1..33337ff1888b6c 100644 --- a/Mathlib/Computability/Encoding.lean +++ b/Mathlib/Computability/Encoding.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Pim Spelier, Daan van Gent. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Spelier, Daan van Gent -/ -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Num.Lemmas -import Mathlib.Data.Option.Basic -import Mathlib.SetTheory.Cardinal.Basic -import Mathlib.Tactic.DeriveFintype +module + +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Num.Lemmas +public import Mathlib.Data.Option.Basic +public import Mathlib.SetTheory.Cardinal.Basic +public import Mathlib.Tactic.DeriveFintype /-! # Encodings @@ -24,6 +26,8 @@ It also contains several examples: - `finEncodingBoolBool` : an encoding of bool. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Computability/EpsilonNFA.lean b/Mathlib/Computability/EpsilonNFA.lean index b0121fdee4263e..d1cae1a5758a8a 100644 --- a/Mathlib/Computability/EpsilonNFA.lean +++ b/Mathlib/Computability/EpsilonNFA.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson, Yaël Dillies, Anthony DeRossi -/ -import Mathlib.Computability.NFA -import Mathlib.Data.List.ReduceOption +module + +public import Mathlib.Computability.NFA +public import Mathlib.Data.List.ReduceOption /-! # Epsilon Nondeterministic Finite Automata @@ -17,6 +19,8 @@ Since this definition allows for automata with infinite states, a `Fintype` inst supplied for true `εNFA`'s. -/ +@[expose] public section + open Set diff --git a/Mathlib/Computability/Halting.lean b/Mathlib/Computability/Halting.lean index aa9aed2419cf90..2e9c86fc107f1d 100644 --- a/Mathlib/Computability/Halting.lean +++ b/Mathlib/Computability/Halting.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.PartrecCode -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.Computability.PartrecCode +public import Mathlib.Data.Set.Subsingleton /-! # Computability theory and the halting problem @@ -16,6 +18,8 @@ A universal partial recursive function, Rice's theorem, and the halting problem. * [Mario Carneiro, *Formalizing computability theory via partial recursive functions*][carneiro2019] -/ +@[expose] public section + open List (Vector) open Encodable Denumerable diff --git a/Mathlib/Computability/Language.lean b/Mathlib/Computability/Language.lean index 1735f2db919973..4c4aa43b5771fb 100644 --- a/Mathlib/Computability/Language.lean +++ b/Mathlib/Computability/Language.lean @@ -3,10 +3,13 @@ Copyright (c) 2020 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson, Martin Dvorak -/ -import Mathlib.Algebra.Order.Kleene -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Data.Set.Lattice -import Mathlib.Tactic.DeriveFintype +module + +public import Mathlib.Algebra.Order.Kleene +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Data.Set.Lattice +public import Mathlib.Tactic.DeriveFintype +import Mathlib.Data.Fintype.Sum /-! # Languages @@ -23,6 +26,7 @@ with respect to other language operations. ## Notation * `l + m`: union of languages `l` and `m` +* `l - m`: difference of languages `l` and `m` * `l * m`: language of strings `x ++ y` such that `x ∈ l` and `y ∈ m` * `l ^ n`: language of strings consisting of `n` members of `l` concatenated together * `1`: language consisting of only the empty string. This is because it is the unit of the `*` @@ -45,6 +49,8 @@ with respect to other language operations. -/ +@[expose] public section + open List Set Computability @@ -80,6 +86,10 @@ instance : Inhabited (Language α) := ⟨(∅ : Set _)⟩ instance : Add (Language α) := ⟨((· ∪ ·) : Set (List α) → Set (List α) → Set (List α))⟩ +/-- The subtraction of two languages is their difference. -/ +instance : Sub (Language α) where + sub := SDiff.sdiff + /-- The product of two languages `l` and `m` is the language made of the strings `x ++ y` where `x ∈ l` and `y ∈ m`. -/ instance : Mul (Language α) := @@ -94,6 +104,9 @@ theorem one_def : (1 : Language α) = ({[]} : Set (List α)) := theorem add_def (l m : Language α) : l + m = (l ∪ m : Set (List α)) := rfl +theorem sub_def (l m : Language α) : l - m = (l \ m : Set (List α)) := + rfl + theorem mul_def (l m : Language α) : l * m = image2 (· ++ ·) l m := rfl @@ -123,6 +136,9 @@ theorem nil_mem_one : [] ∈ (1 : Language α) := theorem mem_add (l m : Language α) (x : List α) : x ∈ l + m ↔ x ∈ l ∨ x ∈ m := Iff.rfl +theorem mem_sub (l m : Language α) (x : List α) : x ∈ l - m ↔ x ∈ l ∧ x ∉ m := + Iff.rfl + theorem mem_mul : x ∈ l * m ↔ ∃ a ∈ l, ∃ b ∈ m, a ++ b = x := mem_image2 @@ -138,6 +154,9 @@ theorem join_mem_kstar {L : List (List α)} (h : ∀ y ∈ L, y ∈ l) : L.flatt theorem nil_mem_kstar (l : Language α) : [] ∈ l∗ := ⟨[], rfl, fun _ h ↦ by contradiction⟩ +instance : OrderedSub (Language α) where + tsub_le_iff_right _ _ _ := sdiff_le_iff' + instance instSemiring : Semiring (Language α) where add_assoc := union_assoc zero_add := empty_union @@ -221,6 +240,14 @@ theorem add_iSup {ι : Sort v} [Nonempty ι] (l : ι → Language α) (m : Langu (m + ⨆ i, l i) = ⨆ i, m + l i := sup_iSup +theorem iSup_sub {ι : Sort v} (l : ι → Language α) (m : Language α) : + (⨆ i, l i) - m = ⨆ i, l i - m := + iUnion_diff _ _ + +theorem sub_iSup {ι : Sort v} [Nonempty ι] (l : ι → Language α) (m : Language α) : + (m - ⨆ i, l i) = ⨅ i, m - l i := + diff_iUnion _ _ + theorem mem_pow {l : Language α} {x : List α} {n : ℕ} : x ∈ l ^ n ↔ ∃ S : List (List α), x = S.flatten ∧ S.length = n ∧ ∀ y ∈ S, y ∈ l := by induction n generalizing x with diff --git a/Mathlib/Computability/MyhillNerode.lean b/Mathlib/Computability/MyhillNerode.lean index 9a9fc6bd140eee..6e77ead63fbc18 100644 --- a/Mathlib/Computability/MyhillNerode.lean +++ b/Mathlib/Computability/MyhillNerode.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Google. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Wong -/ -import Mathlib.Computability.DFA -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Computability.DFA +public import Mathlib.Data.Set.Finite.Basic /-! # Myhill–Nerode theorem @@ -21,6 +23,8 @@ there are finitely many such states. * -/ +@[expose] public section + universe u v variable {α : Type u} {σ : Type v} {L : Language α} diff --git a/Mathlib/Computability/NFA.lean b/Mathlib/Computability/NFA.lean index 9f2e21cec5a51a..d37c2bc3cdc7c0 100644 --- a/Mathlib/Computability/NFA.lean +++ b/Mathlib/Computability/NFA.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson, Maja Kądziołka -/ -import Mathlib.Computability.DFA -import Mathlib.Data.Fintype.Powerset +module + +public import Mathlib.Computability.DFA +public import Mathlib.Data.Fintype.Powerset /-! # Nondeterministic Finite Automata @@ -38,6 +40,8 @@ a `Fintype` instance must be supplied for true NFAs. be repeated arbitrarily many times (and have the overall string still be accepted) -/ +@[expose] public section + open Set open Computability diff --git a/Mathlib/Computability/Partrec.lean b/Mathlib/Computability/Partrec.lean index ccc5bb69482158..bf339bc0e56989 100644 --- a/Mathlib/Computability/Partrec.lean +++ b/Mathlib/Computability/Partrec.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.Primrec -import Mathlib.Data.Nat.PSub -import Mathlib.Data.PFun +module + +public import Mathlib.Computability.Primrec +public import Mathlib.Data.Nat.PSub +public import Mathlib.Data.PFun /-! # The partial recursive functions @@ -27,6 +29,8 @@ least natural number `n` for which `f n = 0`, or diverges if such `n` doesn't ex * [Mario Carneiro, *Formalizing computability theory via partial recursive functions*][carneiro2019] -/ +@[expose] public section + open List (Vector) open Encodable Denumerable Part diff --git a/Mathlib/Computability/PartrecCode.lean b/Mathlib/Computability/PartrecCode.lean index d55496ef3a3cdc..ce48d3d3b7219c 100644 --- a/Mathlib/Computability/PartrecCode.lean +++ b/Mathlib/Computability/PartrecCode.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.Partrec -import Mathlib.Data.Option.Basic +module + +public import Mathlib.Computability.Partrec +public import Mathlib.Data.Option.Basic /-! # Gödel Numbering for Partial Recursive Functions. @@ -40,6 +42,8 @@ of some code. -/ +@[expose] public section + open Encodable Denumerable diff --git a/Mathlib/Computability/PostTuringMachine.lean b/Mathlib/Computability/PostTuringMachine.lean index 0c76db6aaf150e..22c8e2656b266f 100644 --- a/Mathlib/Computability/PostTuringMachine.lean +++ b/Mathlib/Computability/PostTuringMachine.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.Tape -import Mathlib.Data.Finset.Prod -import Mathlib.Data.Finset.Option -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.PFun +module + +public import Mathlib.Computability.Tape +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.Finset.Option +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.PFun /-! # Turing machines @@ -58,6 +60,8 @@ Given these parameters, there are a few common structures for the model that ari formalizes "essentially finite" mentioned above. -/ +@[expose] public section + assert_not_exists MonoidWithZero open List (Vector) diff --git a/Mathlib/Computability/Primrec.lean b/Mathlib/Computability/Primrec.lean index 800b6a93db2ef7..219879ac750465 100644 --- a/Mathlib/Computability/Primrec.lean +++ b/Mathlib/Computability/Primrec.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Logic.Encodable.Pi -import Mathlib.Logic.Function.Iterate +module + +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Logic.Encodable.Pi +public import Mathlib.Logic.Function.Iterate /-! # The primitive recursive functions @@ -41,6 +43,8 @@ other design choices in this formalization, see [carneiro2019]. * [Mario Carneiro, *Formalizing computability theory via partial recursive functions*][carneiro2019] -/ +@[expose] public section + open List (Vector) open Denumerable Encodable Function diff --git a/Mathlib/Computability/Reduce.lean b/Mathlib/Computability/Reduce.lean index aeb80c4ecd154c..b251a88bfc828e 100644 --- a/Mathlib/Computability/Reduce.lean +++ b/Mathlib/Computability/Reduce.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Minchao Wu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Minchao Wu, Mario Carneiro -/ -import Mathlib.Computability.Halting +module + +public import Mathlib.Computability.Halting /-! # Strong reducibility and degrees. @@ -25,6 +27,8 @@ This file uses the local notation `⊕'` for `Sum.elim` to denote the disjoint u computability, reducibility, reduction -/ +@[expose] public section + universe u v w @@ -372,7 +376,6 @@ private theorem le_trans {d₁ d₂ d₃ : ManyOneDegree} : d₁ ≤ d₂ → d apply ManyOneReducible.trans instance instPartialOrder : PartialOrder ManyOneDegree where - le := (· ≤ ·) le_refl := le_refl le_trans _ _ _ := le_trans le_antisymm _ _ := le_antisymm diff --git a/Mathlib/Computability/RegularExpressions.lean b/Mathlib/Computability/RegularExpressions.lean index f6f65eea8f5142..a920241658b608 100644 --- a/Mathlib/Computability/RegularExpressions.lean +++ b/Mathlib/Computability/RegularExpressions.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson -/ -import Mathlib.Computability.Language -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Computability.Language +public import Mathlib.Tactic.AdaptationNote /-! # Regular Expressions @@ -20,6 +22,8 @@ Multiple competing PRs towards that goal are in review. See https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Regular.20languages.3A.20the.20review.20queue -/ +@[expose] public section + open List Set open Computability diff --git a/Mathlib/Computability/TMComputable.lean b/Mathlib/Computability/TMComputable.lean index 06db8b0387e525..04c41973bab9aa 100644 --- a/Mathlib/Computability/TMComputable.lean +++ b/Mathlib/Computability/TMComputable.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Pim Spelier, Daan van Gent. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Spelier, Daan van Gent -/ -import Mathlib.Algebra.Polynomial.Eval.Defs -import Mathlib.Computability.Encoding -import Mathlib.Computability.TuringMachine +module + +public import Mathlib.Algebra.Polynomial.Eval.Defs +public import Mathlib.Computability.Encoding +public import Mathlib.Computability.TuringMachine /-! # Computable functions @@ -29,6 +31,8 @@ However, as functions only contain a finite number of executions and each one is once, this execution time is up to multiplication by a constant the amount of fundamental steps. -/ +@[expose] public section + open Computability diff --git a/Mathlib/Computability/TMConfig.lean b/Mathlib/Computability/TMConfig.lean index 551c42c7459e28..95606be4cbbe78 100644 --- a/Mathlib/Computability/TMConfig.lean +++ b/Mathlib/Computability/TMConfig.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.Halting -import Mathlib.Computability.PostTuringMachine -import Mathlib.Tactic.DeriveFintype +module + +public import Mathlib.Computability.Halting +public import Mathlib.Computability.PostTuringMachine +public import Mathlib.Tactic.DeriveFintype /-! # Modelling partial recursive functions using Turing machines @@ -22,6 +24,8 @@ Turing machine for evaluating these functions. This amounts to a constructive pr * `ToPartrec.Code.eval`: semantics for a `ToPartrec.Code` program -/ +@[expose] public section + open List (Vector) open Function (update) diff --git a/Mathlib/Computability/TMToPartrec.lean b/Mathlib/Computability/TMToPartrec.lean index 6de7a3e788f280..9f521ee888f46c 100644 --- a/Mathlib/Computability/TMToPartrec.lean +++ b/Mathlib/Computability/TMToPartrec.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.Halting -import Mathlib.Computability.TuringMachine -import Mathlib.Data.Num.Lemmas -import Mathlib.Tactic.DeriveFintype -import Mathlib.Computability.TMConfig +module + +public import Mathlib.Computability.Halting +public import Mathlib.Computability.TuringMachine +public import Mathlib.Data.Num.Lemmas +public import Mathlib.Tactic.DeriveFintype +public import Mathlib.Computability.TMConfig /-! # Modelling partial recursive functions using Turing machines @@ -23,6 +25,8 @@ Turing machine for evaluating these functions. This amounts to a constructive pr -/ +@[expose] public section + open List (Vector) open Function (update) diff --git a/Mathlib/Computability/Tape.lean b/Mathlib/Computability/Tape.lean index 584260a018487c..d9ad5a97f224db 100644 --- a/Mathlib/Computability/Tape.lean +++ b/Mathlib/Computability/Tape.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Vector.Basic -import Mathlib.Logic.Function.Iterate -import Mathlib.Tactic.ApplyFun -import Mathlib.Data.List.GetD +module + +public import Mathlib.Data.Vector.Basic +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Data.List.GetD /-! # Turing machine tapes @@ -24,6 +26,8 @@ All but finitely many of the cells are required to hold the blank symbol `defaul -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function (iterate_succ iterate_succ_apply iterate_zero_apply) diff --git a/Mathlib/Computability/TuringDegree.lean b/Mathlib/Computability/TuringDegree.lean index c92d63b4d3b815..a879110f2a884b 100644 --- a/Mathlib/Computability/TuringDegree.lean +++ b/Mathlib/Computability/TuringDegree.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Tanner Duve. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tanner Duve, Elan Roth -/ -import Mathlib.Computability.Partrec -import Mathlib.Order.Antisymmetrization +module + +public import Mathlib.Computability.Partrec +public import Mathlib.Order.Antisymmetrization /-! # Oracle computability and Turing degrees @@ -44,6 +46,8 @@ and is closed under pairing, composition, primitive recursion, and μ-recursion. Computability, Oracle, Turing Degrees, Reducibility, Equivalence Relation -/ +@[expose] public section + open Primrec Nat.Partrec Part variable {f g h : ℕ →. ℕ} diff --git a/Mathlib/Computability/TuringMachine.lean b/Mathlib/Computability/TuringMachine.lean index 133965d0249269..d212b6cc35d82c 100644 --- a/Mathlib/Computability/TuringMachine.lean +++ b/Mathlib/Computability/TuringMachine.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Computability.Tape -import Mathlib.Data.Fintype.Option -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Pi -import Mathlib.Data.PFun -import Mathlib.Computability.PostTuringMachine +module + +public import Mathlib.Computability.Tape +public import Mathlib.Data.Fintype.Option +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Data.PFun +public import Mathlib.Computability.PostTuringMachine /-! # Turing machines @@ -59,6 +61,8 @@ Given these parameters, there are a few common structures for the model that ari formalizes "essentially finite" mentioned above. -/ +@[expose] public section + assert_not_exists MonoidWithZero open List (Vector) diff --git a/Mathlib/Condensed/AB.lean b/Mathlib/Condensed/AB.lean index 4cbd6a984c3c4f..a9f5be8a86ba88 100644 --- a/Mathlib/Condensed/AB.lean +++ b/Mathlib/Condensed/AB.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Algebra.Category.ModuleCat.AB -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf -import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveColimits -import Mathlib.Condensed.Equivalence -import Mathlib.Condensed.Limits +module + +public import Mathlib.Algebra.Category.ModuleCat.AB +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf +public import Mathlib.CategoryTheory.Sites.Coherent.ExtensiveColimits +public import Mathlib.Condensed.Equivalence +public import Mathlib.Condensed.Limits /-! # AB axioms in condensed modules @@ -16,6 +18,8 @@ This file proves that the category of condensed modules over a ring satisfies Gr AB5, AB4, and AB4*. -/ +@[expose] public section + universe u open Condensed CategoryTheory Limits diff --git a/Mathlib/Condensed/Basic.lean b/Mathlib/Condensed/Basic.lean index f7d3c2778486bb..35f042731073e5 100644 --- a/Mathlib/Condensed/Basic.lean +++ b/Mathlib/Condensed/Basic.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ +module -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.Topology.Category.CompHaus.EffectiveEpi +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.Topology.Category.CompHaus.EffectiveEpi /-! @@ -29,6 +30,8 @@ as we do not impose cardinality bounds, and manage universes carefully instead. -/ +@[expose] public section + open CategoryTheory Limits open CategoryTheory diff --git a/Mathlib/Condensed/CartesianClosed.lean b/Mathlib/Condensed/CartesianClosed.lean index a70b0105c823ac..8580f769bd34e8 100644 --- a/Mathlib/Condensed/CartesianClosed.lean +++ b/Mathlib/Condensed/CartesianClosed.lean @@ -3,15 +3,19 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Closed.Types -import Mathlib.CategoryTheory.Sites.CartesianClosed -import Mathlib.Condensed.Basic -import Mathlib.CategoryTheory.Sites.LeftExact +module + +public import Mathlib.CategoryTheory.Closed.Types +public import Mathlib.CategoryTheory.Sites.CartesianClosed +public import Mathlib.Condensed.Basic +public import Mathlib.CategoryTheory.Sites.LeftExact /-! # Condensed sets form a Cartesian closed category -/ +@[expose] public section + universe u noncomputable section diff --git a/Mathlib/Condensed/Discrete/Basic.lean b/Mathlib/Condensed/Discrete/Basic.lean index c88f3062d059ed..7f8ec3a51424fa 100644 --- a/Mathlib/Condensed/Discrete/Basic.lean +++ b/Mathlib/Condensed/Discrete/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.ConstantSheaf -import Mathlib.CategoryTheory.Sites.Equivalence -import Mathlib.Condensed.Basic -import Mathlib.Condensed.Light.Basic -import Mathlib.Condensed.Light.Instances +module + +public import Mathlib.CategoryTheory.Sites.ConstantSheaf +public import Mathlib.CategoryTheory.Sites.Equivalence +public import Mathlib.Condensed.Basic +public import Mathlib.Condensed.Light.Basic +public import Mathlib.Condensed.Light.Instances /-! # Discrete-underlying adjunction @@ -26,6 +28,8 @@ condensed and light condensed objects, and provides several conditions on a (lig set or module that characterize it as discrete. -/ +@[expose] public section + universe u v w open CategoryTheory Limits Opposite GrothendieckTopology diff --git a/Mathlib/Condensed/Discrete/Characterization.lean b/Mathlib/Condensed/Discrete/Characterization.lean index 0013e8bb707dc8..3e806c4a6f7dcc 100644 --- a/Mathlib/Condensed/Discrete/Characterization.lean +++ b/Mathlib/Condensed/Discrete/Characterization.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Discrete.Colimit -import Mathlib.Condensed.Discrete.Module +module + +public import Mathlib.Condensed.Discrete.Colimit +public import Mathlib.Condensed.Discrete.Module /-! # Characterizing discrete condensed sets and `R`-modules. @@ -29,6 +31,8 @@ condensed `R`-modules are nearly identical (`CondensedMod.isDiscrete_tfae`, `LightCondSet.isDiscrete_tfae`, and `LightCondMod.isDiscrete_tfae`). -/ +@[expose] public section + universe u open CategoryTheory Limits Functor FintypeCat diff --git a/Mathlib/Condensed/Discrete/Colimit.lean b/Mathlib/Condensed/Discrete/Colimit.lean index cab8b2d53c47af..9208ab27d4c734 100644 --- a/Mathlib/Condensed/Discrete/Colimit.lean +++ b/Mathlib/Condensed/Discrete/Colimit.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Discrete.LocallyConstant -import Mathlib.Condensed.Equivalence -import Mathlib.Topology.Category.LightProfinite.Extend +module + +public import Mathlib.Condensed.Discrete.LocallyConstant +public import Mathlib.Condensed.Equivalence +public import Mathlib.Topology.Category.LightProfinite.Extend /-! # The condensed set given by left Kan extension from `FintypeCat` to `Profinite`. @@ -15,6 +17,8 @@ for every profinite set `S = limᵢSᵢ`, `X(S) ≅ colimᵢX(Sᵢ)`, and the an condensed sets. -/ +@[expose] public section + universe u noncomputable section diff --git a/Mathlib/Condensed/Discrete/LocallyConstant.lean b/Mathlib/Condensed/Discrete/LocallyConstant.lean index 4bf688ed353a2b..5fd137573e489a 100644 --- a/Mathlib/Condensed/Discrete/LocallyConstant.lean +++ b/Mathlib/Condensed/Discrete/LocallyConstant.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Discrete.Basic -import Mathlib.Condensed.TopComparison -import Mathlib.Topology.Category.CompHausLike.SigmaComparison -import Mathlib.Topology.FiberPartition +module + +public import Mathlib.Condensed.Discrete.Basic +public import Mathlib.Condensed.TopComparison +public import Mathlib.Topology.Category.CompHausLike.SigmaComparison +public import Mathlib.Topology.FiberPartition /-! # The sheaf of locally constant maps on `CompHausLike P` @@ -65,6 +67,8 @@ naturality proofs in this file (both lemmas are in the `CompHausLike.LocallyCons -/ +@[expose] public section + universe u w open CategoryTheory Limits LocallyConstant TopologicalSpace.Fiber Opposite Function Fiber diff --git a/Mathlib/Condensed/Discrete/Module.lean b/Mathlib/Condensed/Discrete/Module.lean index 150fb515ab52e1..792d5ff70f4ebf 100644 --- a/Mathlib/Condensed/Discrete/Module.lean +++ b/Mathlib/Condensed/Discrete/Module.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.ConstantSheaf -import Mathlib.Condensed.Discrete.LocallyConstant -import Mathlib.Condensed.Light.Module -import Mathlib.Condensed.Module -import Mathlib.Topology.LocallyConstant.Algebra +module + +public import Mathlib.CategoryTheory.Sites.ConstantSheaf +public import Mathlib.Condensed.Discrete.LocallyConstant +public import Mathlib.Condensed.Light.Module +public import Mathlib.Condensed.Module +public import Mathlib.Topology.LocallyConstant.Algebra /-! # Discrete condensed `R`-modules @@ -20,6 +22,8 @@ the condensed `R`-modules given by locally constant maps to it, and proves that naturally isomorphic to the constant sheaf functor (and the analogues for light condensed modules). -/ +@[expose] public section + universe w u open CategoryTheory LocallyConstant CompHausLike Functor Category Functor Opposite diff --git a/Mathlib/Condensed/Epi.lean b/Mathlib/Condensed/Epi.lean index 22b2829a51e177..f5abfad49c2184 100644 --- a/Mathlib/Condensed/Epi.lean +++ b/Mathlib/Condensed/Epi.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono -import Mathlib.CategoryTheory.Sites.Coherent.LocallySurjective -import Mathlib.CategoryTheory.Sites.EpiMono -import Mathlib.Condensed.Equivalence -import Mathlib.Condensed.Module +module + +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +public import Mathlib.CategoryTheory.Sites.Coherent.LocallySurjective +public import Mathlib.CategoryTheory.Sites.EpiMono +public import Mathlib.Condensed.Equivalence +public import Mathlib.Condensed.Module /-! # Epimorphisms of condensed objects @@ -17,6 +19,8 @@ as those morphisms which are objectwise surjective on `Stonean` (see `CondensedSet.epi_iff_surjective_on_stonean` and `CondensedMod.epi_iff_surjective_on_stonean`). -/ +@[expose] public section + universe v u w u' v' open CategoryTheory Sheaf Opposite Limits Condensed ConcreteCategory diff --git a/Mathlib/Condensed/Equivalence.lean b/Mathlib/Condensed/Equivalence.lean index 4a22105c3f1806..b826116076e586 100644 --- a/Mathlib/Condensed/Equivalence.lean +++ b/Mathlib/Condensed/Equivalence.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Nikolas Kuhn, Dagur Asgeirsson -/ -import Mathlib.Topology.Category.Profinite.EffectiveEpi -import Mathlib.Topology.Category.Stonean.EffectiveEpi -import Mathlib.Condensed.Basic -import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison +module + +public import Mathlib.Topology.Category.Profinite.EffectiveEpi +public import Mathlib.Topology.Category.Stonean.EffectiveEpi +public import Mathlib.Condensed.Basic +public import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison /-! # Sheaves on CompHaus are equivalent to sheaves on Stonean @@ -32,6 +34,8 @@ categories. We give the corresponding statements for `Profinite` as well. coherent sheaves on `CompHaus` (i.e. condensed sets). -/ +@[expose] public section + universe u open CategoryTheory Limits diff --git a/Mathlib/Condensed/Explicit.lean b/Mathlib/Condensed/Explicit.lean index 2a5d0af7ed54d1..e07e75cfa2c011 100644 --- a/Mathlib/Condensed/Explicit.lean +++ b/Mathlib/Condensed/Explicit.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Riccardo Brasca, Filippo A. E. Nuccio -/ -import Mathlib.Condensed.Module -import Mathlib.Condensed.Equivalence +module + +public import Mathlib.Condensed.Module +public import Mathlib.Condensed.Equivalence /-! # The explicit sheaf condition for condensed sets @@ -29,6 +31,8 @@ reflects finite limits (resp. products), where it is enough to check the sheaf c postcomposing with the forgetful functor. -/ +@[expose] public section + universe u open CategoryTheory Limits Opposite Functor Presheaf regularTopology diff --git a/Mathlib/Condensed/Functors.lean b/Mathlib/Condensed/Functors.lean index 1dfaaba990db60..956317051c7c47 100644 --- a/Mathlib/Condensed/Functors.lean +++ b/Mathlib/Condensed/Functors.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Preserves.Ulift -import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves -import Mathlib.CategoryTheory.Sites.Whiskering -import Mathlib.Condensed.Basic -import Mathlib.Topology.Category.Stonean.Basic +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Ulift +public import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves +public import Mathlib.CategoryTheory.Sites.Whiskering +public import Mathlib.Condensed.Basic +public import Mathlib.Topology.Category.Stonean.Basic /-! # Functors from categories of topological spaces to condensed sets @@ -22,6 +24,8 @@ sets. -/ +@[expose] public section + universe u v open CategoryTheory Limits diff --git a/Mathlib/Condensed/Light/AB.lean b/Mathlib/Condensed/Light/AB.lean index fc116ee52d6cf6..a37fa8b40b09cd 100644 --- a/Mathlib/Condensed/Light/AB.lean +++ b/Mathlib/Condensed/Light/AB.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Algebra.Category.ModuleCat.AB -import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf -import Mathlib.Condensed.Light.Epi +module + +public import Mathlib.Algebra.Category.ModuleCat.AB +public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf +public import Mathlib.Condensed.Light.Epi /-! # Grothendieck's AB axioms for light condensed modules @@ -14,6 +16,8 @@ The category of light condensed `R`-modules over a ring satisfies the countable Grothendieck's AB4* axiom -/ +@[expose] public section + universe u open CategoryTheory Limits diff --git a/Mathlib/Condensed/Light/Basic.lean b/Mathlib/Condensed/Light/Basic.lean index 84779e8376c74b..5ceeb17f4c2be3 100644 --- a/Mathlib/Condensed/Light/Basic.lean +++ b/Mathlib/Condensed/Light/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Sheaf -import Mathlib.Topology.Category.LightProfinite.EffectiveEpi +module + +public import Mathlib.CategoryTheory.Sites.Sheaf +public import Mathlib.Topology.Category.LightProfinite.EffectiveEpi /-! # Light condensed objects @@ -14,6 +16,8 @@ of Clausen-Scholze (see https://www.youtube.com/playlist?list=PLx5f8IelFRgGmu6gm -/ +@[expose] public section + universe u v w open CategoryTheory Limits diff --git a/Mathlib/Condensed/Light/CartesianClosed.lean b/Mathlib/Condensed/Light/CartesianClosed.lean index 69aafafe637ae7..d4ba1bf2d6ac2b 100644 --- a/Mathlib/Condensed/Light/CartesianClosed.lean +++ b/Mathlib/Condensed/Light/CartesianClosed.lean @@ -3,16 +3,20 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Closed.Types -import Mathlib.CategoryTheory.Sites.CartesianClosed -import Mathlib.CategoryTheory.Sites.Equivalence -import Mathlib.Condensed.Light.Basic -import Mathlib.Condensed.Light.Instances +module + +public import Mathlib.CategoryTheory.Closed.Types +public import Mathlib.CategoryTheory.Sites.CartesianClosed +public import Mathlib.CategoryTheory.Sites.Equivalence +public import Mathlib.Condensed.Light.Basic +public import Mathlib.Condensed.Light.Instances /-! # Light condensed sets form a Cartesian closed category -/ +@[expose] public section + universe u noncomputable section diff --git a/Mathlib/Condensed/Light/Epi.lean b/Mathlib/Condensed/Light/Epi.lean index e616bae4e7c37f..b499259468c697 100644 --- a/Mathlib/Condensed/Light/Epi.lean +++ b/Mathlib/Condensed/Light/Epi.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Shapes.SequentialProduct -import Mathlib.CategoryTheory.Sites.Coherent.SequentialLimit -import Mathlib.Condensed.Light.Limits +module + +public import Mathlib.CategoryTheory.Limits.Shapes.SequentialProduct +public import Mathlib.CategoryTheory.Sites.Coherent.SequentialLimit +public import Mathlib.Condensed.Light.Limits /-! # Epimorphisms of light condensed objects @@ -17,6 +19,8 @@ of light profinite sets. Further, we prove that the functor `lim : Discrete ℕ ⥤ LightCondMod R` preserves epimorphisms. -/ +@[expose] public section + universe v u w u' v' open CategoryTheory Sheaf Limits HasForget GrothendieckTopology diff --git a/Mathlib/Condensed/Light/Explicit.lean b/Mathlib/Condensed/Light/Explicit.lean index 1441969f65112c..aee19685b71f38 100644 --- a/Mathlib/Condensed/Light/Explicit.lean +++ b/Mathlib/Condensed/Light/Explicit.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison -import Mathlib.Condensed.Light.Module +module + +public import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison +public import Mathlib.Condensed.Light.Module /-! # The explicit sheaf condition for light condensed sets @@ -24,6 +26,8 @@ reflects finite limits (resp. products), where it is enough to check the sheaf c postcomposing with the forgetful functor. -/ +@[expose] public section + universe v u w open CategoryTheory Limits Opposite Functor Presheaf regularTopology diff --git a/Mathlib/Condensed/Light/Functors.lean b/Mathlib/Condensed/Light/Functors.lean index 275eb35f5e1a37..7b987b2b70c1b7 100644 --- a/Mathlib/Condensed/Light/Functors.lean +++ b/Mathlib/Condensed/Light/Functors.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves -import Mathlib.Condensed.Light.Basic +module + +public import Mathlib.CategoryTheory.Sites.Coherent.CoherentSheaves +public import Mathlib.Condensed.Light.Basic /-! # Functors from categories of topological spaces to light condensed sets @@ -19,6 +21,8 @@ sets. -/ +@[expose] public section + universe u v open CategoryTheory Limits diff --git a/Mathlib/Condensed/Light/Instances.lean b/Mathlib/Condensed/Light/Instances.lean index 6adc3e946c1cf3..b5b1a053a7deef 100644 --- a/Mathlib/Condensed/Light/Instances.lean +++ b/Mathlib/Condensed/Light/Instances.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Topology.Category.LightProfinite.EffectiveEpi -import Mathlib.CategoryTheory.Sites.Equivalence +module + +public import Mathlib.Topology.Category.LightProfinite.EffectiveEpi +public import Mathlib.CategoryTheory.Sites.Equivalence /-! # `HasSheafify` instances @@ -17,6 +19,8 @@ in the file `CategoryTheory.Sites.Equivalence`. -/ +@[expose] public section + universe u u' v open CategoryTheory Limits diff --git a/Mathlib/Condensed/Light/Limits.lean b/Mathlib/Condensed/Light/Limits.lean index 0955dd8d521783..edae4c73c4dfb0 100644 --- a/Mathlib/Condensed/Light/Limits.lean +++ b/Mathlib/Condensed/Light/Limits.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Light.Module +module + +public import Mathlib.Condensed.Light.Module /-! # Limits in categories of light condensed objects @@ -11,6 +13,8 @@ import Mathlib.Condensed.Light.Module This file adds some instances for limits in light condensed sets and modules. -/ +@[expose] public section + universe u open CategoryTheory Limits diff --git a/Mathlib/Condensed/Light/Module.lean b/Mathlib/Condensed/Light/Module.lean index 710239b6e4f47e..0bc6aa4a85f4d7 100644 --- a/Mathlib/Condensed/Light/Module.lean +++ b/Mathlib/Condensed/Light/Module.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.Algebra.Category.ModuleCat.Adjunctions -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.FilteredColimits -import Mathlib.CategoryTheory.Sites.Abelian -import Mathlib.CategoryTheory.Sites.Adjunction -import Mathlib.CategoryTheory.Sites.Equivalence -import Mathlib.Condensed.Light.Basic -import Mathlib.Condensed.Light.Instances +module + +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Adjunctions +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.FilteredColimits +public import Mathlib.CategoryTheory.Sites.Abelian +public import Mathlib.CategoryTheory.Sites.Adjunction +public import Mathlib.CategoryTheory.Sites.Equivalence +public import Mathlib.Condensed.Light.Basic +public import Mathlib.Condensed.Light.Instances /-! # Light condensed `R`-modules @@ -26,6 +28,8 @@ This file defines light condensed modules over a ring `R`. adjoint, sending a light condensed set to the corresponding *free* light condensed `R`-module. -/ +@[expose] public section + universe u diff --git a/Mathlib/Condensed/Light/Small.lean b/Mathlib/Condensed/Light/Small.lean index c3ccf7978885b6..1f3dc795f7ba3a 100644 --- a/Mathlib/Condensed/Light/Small.lean +++ b/Mathlib/Condensed/Light/Small.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Sites.Equivalence -import Mathlib.Condensed.Light.Basic +module + +public import Mathlib.CategoryTheory.Sites.Equivalence +public import Mathlib.Condensed.Light.Basic /-! # Equivalence of light condensed objects with sheaves on a small site -/ +@[expose] public section + universe u v w open CategoryTheory diff --git a/Mathlib/Condensed/Light/TopCatAdjunction.lean b/Mathlib/Condensed/Light/TopCatAdjunction.lean index f264fa02dba3ea..71f25251619324 100644 --- a/Mathlib/Condensed/Light/TopCatAdjunction.lean +++ b/Mathlib/Condensed/Light/TopCatAdjunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Light.TopComparison -import Mathlib.Topology.Category.Sequential -import Mathlib.Topology.Category.LightProfinite.Sequence +module + +public import Mathlib.Condensed.Light.TopComparison +public import Mathlib.Topology.Category.Sequential +public import Mathlib.Topology.Category.LightProfinite.Sequence /-! # The adjunction between light condensed sets and topological spaces @@ -18,6 +20,8 @@ The counit is an isomorphism for sequential spaces, and we conclude that the fun `topCatToLightCondSet` is fully faithful when restricted to sequential spaces. -/ +@[expose] public section + universe u open LightCondensed LightCondSet CategoryTheory LightProfinite diff --git a/Mathlib/Condensed/Light/TopComparison.lean b/Mathlib/Condensed/Light/TopComparison.lean index bebf7bfe428419..296535c882cde6 100644 --- a/Mathlib/Condensed/Light/TopComparison.lean +++ b/Mathlib/Condensed/Light/TopComparison.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Light.Basic -import Mathlib.Condensed.TopComparison +module + +public import Mathlib.Condensed.Light.Basic +public import Mathlib.Condensed.TopComparison /-! @@ -14,6 +16,8 @@ We define the functor `topCatToLightCondSet : TopCat.{u} ⥤ LightCondSet.{u}`. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/Condensed/Limits.lean b/Mathlib/Condensed/Limits.lean index 84356b62a436b4..29d61010df8d34 100644 --- a/Mathlib/Condensed/Limits.lean +++ b/Mathlib/Condensed/Limits.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.Module +module + +public import Mathlib.Condensed.Module /-! @@ -12,6 +14,8 @@ import Mathlib.Condensed.Module This file adds some instances for limits in condensed sets and condensed modules. -/ +@[expose] public section + universe u open CategoryTheory Limits diff --git a/Mathlib/Condensed/Module.lean b/Mathlib/Condensed/Module.lean index 6c8116b1ccfd2b..50a92e1beb18c0 100644 --- a/Mathlib/Condensed/Module.lean +++ b/Mathlib/Condensed/Module.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Algebra.Category.ModuleCat.Abelian -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.FilteredColimits -import Mathlib.Algebra.Category.ModuleCat.Adjunctions -import Mathlib.CategoryTheory.Sites.Abelian -import Mathlib.CategoryTheory.Sites.Adjunction -import Mathlib.CategoryTheory.Sites.LeftExact -import Mathlib.Condensed.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.FilteredColimits +public import Mathlib.Algebra.Category.ModuleCat.Adjunctions +public import Mathlib.CategoryTheory.Sites.Abelian +public import Mathlib.CategoryTheory.Sites.Adjunction +public import Mathlib.CategoryTheory.Sites.LeftExact +public import Mathlib.Condensed.Basic /-! # Condensed `R`-modules @@ -25,6 +27,8 @@ This file defines condensed modules over a ring `R`. condensed set to the corresponding *free* condensed `R`-module. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/Condensed/Solid.lean b/Mathlib/Condensed/Solid.lean index f1cb53d195e1a6..e5a283cf3573ff 100644 --- a/Mathlib/Condensed/Solid.lean +++ b/Mathlib/Condensed/Solid.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise -import Mathlib.Condensed.Functors -import Mathlib.Condensed.Limits +module + +public import Mathlib.CategoryTheory.Functor.KanExtension.Pointwise +public import Mathlib.Condensed.Functors +public import Mathlib.Condensed.Limits /-! @@ -23,6 +25,8 @@ TODO (hard): prove that `((profiniteSolid ℤ).obj S).IsSolid` for `S : Profinit TODO (slightly easier): prove that `((profiniteSolid 𝔽ₚ).obj S).IsSolid` for `S : Profinite`. -/ +@[expose] public section + universe u variable (R : Type (u + 1)) [Ring R] diff --git a/Mathlib/Condensed/TopCatAdjunction.lean b/Mathlib/Condensed/TopCatAdjunction.lean index cccc1b7d7f949c..463cc64c94de6e 100644 --- a/Mathlib/Condensed/TopCatAdjunction.lean +++ b/Mathlib/Condensed/TopCatAdjunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Condensed.TopComparison -import Mathlib.Topology.Category.CompactlyGenerated +module + +public import Mathlib.Condensed.TopComparison +public import Mathlib.Topology.Category.CompactlyGenerated /-! # The adjunction between condensed sets and topological spaces @@ -17,6 +19,8 @@ The counit is an isomorphism for compactly generated spaces, and we conclude tha `topCatToCondensedSet` is fully faithful when restricted to compactly generated spaces. -/ +@[expose] public section + universe u open Condensed CondensedSet CategoryTheory CompHaus diff --git a/Mathlib/Condensed/TopComparison.lean b/Mathlib/Condensed/TopComparison.lean index 9d10263da7991b..3c64bc02599e25 100644 --- a/Mathlib/Condensed/TopComparison.lean +++ b/Mathlib/Condensed/TopComparison.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.CategoryTheory.Limits.Preserves.Opposites -import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison -import Mathlib.Condensed.Basic -import Mathlib.Topology.Category.TopCat.Yoneda +module + +public import Mathlib.CategoryTheory.Limits.Preserves.Opposites +public import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison +public import Mathlib.Condensed.Basic +public import Mathlib.Topology.Category.TopCat.Yoneda /-! @@ -21,6 +23,8 @@ We apply this API to `CompHaus` and define the functor -/ +@[expose] public section + universe w w' v u open CategoryTheory Opposite Limits regularTopology ContinuousMap Topology diff --git a/Mathlib/Control/Applicative.lean b/Mathlib/Control/Applicative.lean index 1f82d1816f5bdd..7b0421b62fe51c 100644 --- a/Mathlib/Control/Applicative.lean +++ b/Mathlib/Control/Applicative.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Control.Functor -import Mathlib.Control.Basic +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Control.Functor +public import Mathlib.Control.Basic /-! # `applicative` instances @@ -17,6 +19,8 @@ This file provides `Applicative` instances for concrete functors: * `Functor.add_const` -/ +@[expose] public section + universe u v w section Lemmas diff --git a/Mathlib/Control/Basic.lean b/Mathlib/Control/Basic.lean index 147af63e06d0a4..ab53dea3e9a5cf 100644 --- a/Mathlib/Control/Basic.lean +++ b/Mathlib/Control/Basic.lean @@ -3,15 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Control.Combinators -import Mathlib.Logic.Function.Defs -import Mathlib.Tactic.CasesM -import Mathlib.Tactic.Attr.Core +module + +public import Mathlib.Control.Combinators +public import Mathlib.Tactic.CasesM +public import Mathlib.Tactic.Attr.Core /-! Extends the theory on functors, applicatives and monads. -/ +@[expose] public section + universe u v w variable {α β γ : Type u} diff --git a/Mathlib/Control/Bifunctor.lean b/Mathlib/Control/Bifunctor.lean index f2e2f94a640651..262f8904e167ce 100644 --- a/Mathlib/Control/Bifunctor.lean +++ b/Mathlib/Control/Bifunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Functor -import Mathlib.Tactic.Common +module + +public import Mathlib.Control.Functor +public import Mathlib.Tactic.Common /-! # Functors with two arguments @@ -22,6 +24,8 @@ A bifunctor is a function `F : Type* → Type* → Type*` along with a bimap whi * `LawfulBifunctor`: A typeclass asserting this bimap respects the bifunctor laws. -/ +@[expose] public section + universe u₀ u₁ u₂ v₀ v₁ v₂ diff --git a/Mathlib/Control/Bitraversable/Basic.lean b/Mathlib/Control/Bitraversable/Basic.lean index 3c67682047b572..77e9aad542956d 100644 --- a/Mathlib/Control/Bitraversable/Basic.lean +++ b/Mathlib/Control/Bitraversable/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Bifunctor -import Mathlib.Control.Traversable.Basic +module + +public import Mathlib.Control.Bifunctor +public import Mathlib.Control.Traversable.Basic /-! # Bitraversable type class @@ -37,6 +39,8 @@ The concepts and laws are taken from traversable bitraversable iterator functor bifunctor applicative -/ +@[expose] public section + universe u diff --git a/Mathlib/Control/Bitraversable/Instances.lean b/Mathlib/Control/Bitraversable/Instances.lean index 37b6de2935cf13..2289e3015200c3 100644 --- a/Mathlib/Control/Bitraversable/Instances.lean +++ b/Mathlib/Control/Bitraversable/Instances.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Bitraversable.Lemmas -import Mathlib.Control.Traversable.Lemmas +module + +public import Mathlib.Control.Bitraversable.Lemmas +public import Mathlib.Control.Traversable.Lemmas /-! # Bitraversable instances @@ -26,6 +28,8 @@ This file provides `Bitraversable` instances for concrete bifunctors: traversable bitraversable functor bifunctor applicative -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Control/Bitraversable/Lemmas.lean b/Mathlib/Control/Bitraversable/Lemmas.lean index 8ae1bc21e1a60e..896d17ffd1814a 100644 --- a/Mathlib/Control/Bitraversable/Lemmas.lean +++ b/Mathlib/Control/Bitraversable/Lemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Bitraversable.Basic +module + +public import Mathlib.Control.Bitraversable.Basic /-! # Bitraversable Lemmas @@ -32,6 +34,8 @@ traversable bitraversable functor bifunctor applicative -/ +@[expose] public section + universe u diff --git a/Mathlib/Control/Combinators.lean b/Mathlib/Control/Combinators.lean index 4d6653e9324e14..d083048217e84d 100644 --- a/Mathlib/Control/Combinators.lean +++ b/Mathlib/Control/Combinators.lean @@ -3,12 +3,15 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Monad combinators, as in Haskell's Control.Monad. -/ +@[expose] public section + universe u v w /-- Collapses two layers of monadic structure into one, diff --git a/Mathlib/Control/EquivFunctor.lean b/Mathlib/Control/EquivFunctor.lean index f04f4dfa367fb5..9330cfa6896c78 100644 --- a/Mathlib/Control/EquivFunctor.lean +++ b/Mathlib/Control/EquivFunctor.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Convert +module + +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Convert /-! # Functions functorial with respect to equivalences @@ -15,6 +17,8 @@ coherently mapping equivalences to equivalences. In categorical language, it is an endofunctor of the "core" of the category `Type`. -/ +@[expose] public section + universe u₀ u₁ u₂ v₀ v₁ v₂ diff --git a/Mathlib/Control/EquivFunctor/Instances.lean b/Mathlib/Control/EquivFunctor/Instances.lean index 6b98d0ef997718..e94d2d9049c66d 100644 --- a/Mathlib/Control/EquivFunctor/Instances.lean +++ b/Mathlib/Control/EquivFunctor/Instances.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Control.EquivFunctor -import Mathlib.Data.Fintype.OfMap +module + +public import Mathlib.Control.EquivFunctor +public import Mathlib.Data.Fintype.OfMap /-! # `EquivFunctor` instances @@ -12,6 +14,8 @@ import Mathlib.Data.Fintype.OfMap We derive some `EquivFunctor` instances, to enable `equiv_rw` to rewrite under these functions. -/ +@[expose] public section + open Equiv diff --git a/Mathlib/Control/Fix.lean b/Mathlib/Control/Fix.lean index 1119c70c71359d..b644c31ea0f2ec 100644 --- a/Mathlib/Control/Fix.lean +++ b/Mathlib/Control/Fix.lean @@ -3,11 +3,12 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Data.Part -import Mathlib.Data.Nat.Find -import Mathlib.Data.Nat.Upto -import Mathlib.Data.Stream.Defs -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.Part +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.Nat.Upto +public import Mathlib.Data.Stream.Defs /-! # Fixed point @@ -22,6 +23,8 @@ An instance is defined for `Part`. * `Part.fix` -/ +@[expose] public section + universe u v diff --git a/Mathlib/Control/Fold.lean b/Mathlib/Control/Fold.lean index 7e62d81d2b26d6..6bd0093409e375 100644 --- a/Mathlib/Control/Fold.lean +++ b/Mathlib/Control/Fold.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.CategoryTheory.Category.KleisliCat -import Mathlib.CategoryTheory.Endomorphism -import Mathlib.CategoryTheory.Types.Basic -import Mathlib.Control.Traversable.Instances -import Mathlib.Control.Traversable.Lemmas -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.CategoryTheory.Category.KleisliCat +public import Mathlib.CategoryTheory.Endomorphism +public import Mathlib.CategoryTheory.Types.Basic +public import Mathlib.Control.Traversable.Instances +public import Mathlib.Control.Traversable.Lemmas +public import Mathlib.Tactic.AdaptationNote /-! @@ -52,6 +54,8 @@ but the author cannot think of instances of `foldable` that are not also `Traversable`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Control/Functor.lean b/Mathlib/Control/Functor.lean index 0e27ac9f6e0d77..5eda9ddc64d80b 100644 --- a/Mathlib/Control/Functor.lean +++ b/Mathlib/Control/Functor.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Tactic.Attr.Register -import Mathlib.Data.Set.Defs -import Mathlib.Tactic.TypeStar -import Batteries.Tactic.Lint +module + +public import Mathlib.Tactic.Attr.Register +public import Mathlib.Data.Set.Defs +public import Mathlib.Tactic.TypeStar +public import Batteries.Tactic.Lint /-! # Functors @@ -26,6 +28,8 @@ This module provides additional lemmas, definitions, and instances for `Functor` functor, applicative -/ +@[expose] public section + universe u v w section Functor diff --git a/Mathlib/Control/Functor/Multivariate.lean b/Mathlib/Control/Functor/Multivariate.lean index c760bf63b9fa61..25ea77536d27f7 100644 --- a/Mathlib/Control/Functor/Multivariate.lean +++ b/Mathlib/Control/Functor/Multivariate.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro, Simon Hudon -/ -import Mathlib.Data.Fin.Fin2 -import Mathlib.Data.TypeVec -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Data.Fin.Fin2 +public import Mathlib.Data.TypeVec +public import Mathlib.Logic.Equiv.Defs /-! @@ -18,6 +20,8 @@ Features: -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Control/Lawful.lean b/Mathlib/Control/Lawful.lean index 5064ce464f3d38..107e3a8de8eec8 100644 --- a/Mathlib/Control/Lawful.lean +++ b/Mathlib/Control/Lawful.lean @@ -3,13 +3,16 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Ullrich -/ +module -import Mathlib.Tactic.Basic +public import Mathlib.Tactic.Basic /-! # Functor Laws, applicative laws, and monad Laws -/ +@[expose] public section + universe u v namespace StateT diff --git a/Mathlib/Control/LawfulFix.lean b/Mathlib/Control/LawfulFix.lean index 2b94edddefe24c..c6c4214d826cbb 100644 --- a/Mathlib/Control/LawfulFix.lean +++ b/Mathlib/Control/LawfulFix.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Data.Stream.Init -import Mathlib.Tactic.ApplyFun -import Mathlib.Control.Fix -import Mathlib.Order.OmegaCompletePartialOrder +module + +public import Mathlib.Data.Stream.Init +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Control.Fix +public import Mathlib.Order.OmegaCompletePartialOrder /-! # Lawful fixed point operators @@ -20,6 +22,8 @@ omega complete partial orders (ωCPO). Proofs of the lawfulness of all `Fix` ins * class `LawfulFix` -/ +@[expose] public section + universe u v variable {α : Type*} {β : α → Type*} diff --git a/Mathlib/Control/Monad/Basic.lean b/Mathlib/Control/Monad/Basic.lean index 97e5d34ad646d5..8d226fa00a85e2 100644 --- a/Mathlib/Control/Monad/Basic.lean +++ b/Mathlib/Control/Monad/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Logic.Equiv.Defs /-! # Monad @@ -34,6 +36,8 @@ functor, applicative, monad, simp -/ +@[expose] public section + universe u v variable {α β σ : Type u} diff --git a/Mathlib/Control/Monad/Cont.lean b/Mathlib/Control/Monad/Cont.lean index c5395b09eab09b..214793fb5a0aed 100644 --- a/Mathlib/Control/Monad/Cont.lean +++ b/Mathlib/Control/Monad/Cont.lean @@ -3,11 +3,14 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Monad.Basic -import Mathlib.Control.Monad.Writer -import Mathlib.Control.Lawful -import Batteries.Tactic.Congr -import Batteries.Lean.Except +module + +public import Mathlib.Control.Monad.Basic +public import Mathlib.Control.Monad.Writer +public import Mathlib.Control.Lawful +public import Batteries.Tactic.Congr +public import Batteries.Lean.Except +import all Init.Control.Option -- for unfolding `Option.lift` /-! # Continuation Monad @@ -18,6 +21,8 @@ Haskell's `Cont`, `ContT` and `MonadCont`: -/ +@[expose] public section + universe u v w u₀ u₁ v₀ v₁ structure MonadCont.Label (α : Type w) (m : Type u → Type v) (β : Type u) where @@ -157,7 +162,7 @@ def OptionT.mkLabel {α β} : Label (Option.{u} α) m β → Label α (OptionT m theorem OptionT.goto_mkLabel {α β : Type _} (x : Label (Option.{u} α) m β) (i : α) : goto (OptionT.mkLabel x) i = OptionT.mk (goto x (some i) >>= fun a => pure (some a)) := - rfl + (rfl) nonrec def OptionT.callCC [MonadCont m] {α β : Type _} (f : Label α (OptionT m) β → OptionT m α) : OptionT m α := @@ -165,7 +170,7 @@ nonrec def OptionT.callCC [MonadCont m] {α β : Type _} (f : Label α (OptionT @[simp] lemma run_callCC [MonadCont m] {α β : Type _} (f : Label α (OptionT m) β → OptionT m α) : - (OptionT.callCC f).run = (callCC fun x => OptionT.run <| f (OptionT.mkLabel x)) := rfl + (OptionT.callCC f).run = (callCC fun x => OptionT.run <| f (OptionT.mkLabel x)) := (rfl) instance [MonadCont m] : MonadCont (OptionT m) where callCC := OptionT.callCC diff --git a/Mathlib/Control/Monad/Writer.lean b/Mathlib/Control/Monad/Writer.lean index 0f4c23db89034f..7737e72a949124 100644 --- a/Mathlib/Control/Monad/Writer.lean +++ b/Mathlib/Control/Monad/Writer.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Edward Ayers -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Logic.Equiv.Defs /-! # Writer monads @@ -19,6 +21,8 @@ computation progresses. -/ +@[expose] public section + universe u v /-- Adds a writable output of type `ω` to a monad. diff --git a/Mathlib/Control/Random.lean b/Mathlib/Control/Random.lean index 4835f47086a1b2..fb4093817ac2b5 100644 --- a/Mathlib/Control/Random.lean +++ b/Mathlib/Control/Random.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Henrik Böving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Henrik Böving -/ -import Mathlib.Control.ULiftable -import Mathlib.Order.Fin.Basic +module + +public import Mathlib.Control.ULiftable +public import Mathlib.Order.Fin.Basic /-! # Rand Monad and Random Class @@ -28,6 +30,8 @@ defining objects that can be created randomly. -/ +@[expose] public section + set_option autoImplicit true -- Note: this file uses `autoImplicit` pervasively /-- A monad transformer to generate random objects using the generic generator type `g` -/ diff --git a/Mathlib/Control/Traversable/Basic.lean b/Mathlib/Control/Traversable/Basic.lean index 7f63c540a9f0b1..17675ef8551e27 100644 --- a/Mathlib/Control/Traversable/Basic.lean +++ b/Mathlib/Control/Traversable/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Data.Option.Defs -import Mathlib.Control.Functor -import Batteries.Data.List.Basic -import Mathlib.Control.Basic +module + +public import Mathlib.Data.Option.Defs +public import Mathlib.Control.Functor +public import Batteries.Data.List.Basic +public import Mathlib.Control.Basic /-! # Traversable type class @@ -55,6 +57,8 @@ traversable iterator functor applicative online at -/ +@[expose] public section + open Function hiding comp universe u v w diff --git a/Mathlib/Control/Traversable/Equiv.lean b/Mathlib/Control/Traversable/Equiv.lean index 3233b938b20ccb..a17a2e5ac4a139 100644 --- a/Mathlib/Control/Traversable/Equiv.lean +++ b/Mathlib/Control/Traversable/Equiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Traversable.Lemmas -import Mathlib.Logic.Equiv.Defs -import Batteries.Tactic.SeqFocus +module + +public import Mathlib.Control.Traversable.Lemmas +public import Mathlib.Logic.Equiv.Defs +public import Batteries.Tactic.SeqFocus /-! # Transferring `Traversable` instances along isomorphisms @@ -23,6 +25,8 @@ This file allows to transfer `Traversable` instances along isomorphisms. * `Equiv.isLawfulTraversable`: `Equiv.traverse` as a lawful traversable functor. -/ +@[expose] public section + universe u diff --git a/Mathlib/Control/Traversable/Instances.lean b/Mathlib/Control/Traversable/Instances.lean index 4e5eae68ca2ebd..33ec34fa4f7d9a 100644 --- a/Mathlib/Control/Traversable/Instances.lean +++ b/Mathlib/Control/Traversable/Instances.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Applicative -import Mathlib.Control.Traversable.Basic -import Mathlib.Data.List.Forall2 -import Mathlib.Data.Set.Functor +module + +public import Mathlib.Control.Applicative +public import Mathlib.Control.Traversable.Basic +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.Set.Functor /-! # LawfulTraversable instances @@ -15,6 +17,8 @@ This file provides instances of `LawfulTraversable` for types from the core libr `List` and `Sum`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Control/Traversable/Lemmas.lean b/Mathlib/Control/Traversable/Lemmas.lean index 4dcebf63bf5b5f..5bc058138c0083 100644 --- a/Mathlib/Control/Traversable/Lemmas.lean +++ b/Mathlib/Control/Traversable/Lemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Applicative -import Mathlib.Control.Traversable.Basic +module + +public import Mathlib.Control.Applicative +public import Mathlib.Control.Traversable.Basic /-! # Traversing collections @@ -17,6 +19,8 @@ This file proves basic properties of traversable and applicative functors and de Inspired by [The Essence of the Iterator Pattern][gibbons2009]. -/ +@[expose] public section + universe u diff --git a/Mathlib/Control/ULift.lean b/Mathlib/Control/ULift.lean index 2482e0095fe06c..919754542da087 100644 --- a/Mathlib/Control/ULift.lean +++ b/Mathlib/Control/ULift.lean @@ -3,13 +3,16 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Jannis Limperg -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Monadic instances for `ULift` and `PLift` In this file we define `Monad` and `IsLawfulMonad` instances on `PLift` and `ULift`. -/ +@[expose] public section + universe u v u' v' namespace PLift diff --git a/Mathlib/Control/ULiftable.lean b/Mathlib/Control/ULiftable.lean index 3f6d3c8e7b34ca..f4910789afaed8 100644 --- a/Mathlib/Control/ULiftable.lean +++ b/Mathlib/Control/ULiftable.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Monad.Basic -import Mathlib.Control.Monad.Cont -import Mathlib.Control.Monad.Writer -import Mathlib.Logic.Equiv.Basic -import Mathlib.Logic.Equiv.Functor -import Mathlib.Control.Lawful +module + +public import Mathlib.Control.Monad.Basic +public import Mathlib.Control.Monad.Cont +public import Mathlib.Control.Monad.Writer +public import Mathlib.Logic.Equiv.Basic +public import Mathlib.Logic.Equiv.Functor +public import Mathlib.Control.Lawful /-! # Universe lifting for type families @@ -34,6 +36,8 @@ universe polymorphism functor -/ +@[expose] public section + universe v u₀ u₁ v₀ v₁ v₂ w w₀ w₁ diff --git a/Mathlib/Data/Analysis/Filter.lean b/Mathlib/Data/Analysis/Filter.lean index 27d77411a6e089..d8ccd2d4605e3c 100644 --- a/Mathlib/Data/Analysis/Filter.lean +++ b/Mathlib/Data/Analysis/Filter.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Order.Filter.Cofinite +module + +public import Mathlib.Order.Filter.Cofinite /-! # Computational realization of filters (experimental) @@ -17,6 +19,8 @@ This file provides infrastructure to compute with filters. * `Filter.Realizer`: Realization of a `Filter`. `CFilter` that generates the given filter. -/ +@[expose] public section + open Set Filter diff --git a/Mathlib/Data/Analysis/Topology.lean b/Mathlib/Data/Analysis/Topology.lean index 2eeb1e1449bb14..4974976bd07a7b 100644 --- a/Mathlib/Data/Analysis/Topology.lean +++ b/Mathlib/Data/Analysis/Topology.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Analysis.Filter -import Mathlib.Topology.Bases -import Mathlib.Topology.LocallyFinite +module + +public import Mathlib.Data.Analysis.Filter +public import Mathlib.Topology.Bases +public import Mathlib.Topology.LocallyFinite /-! # Computational realization of topological spaces (experimental) @@ -20,6 +22,8 @@ This file provides infrastructure to compute with topological spaces. * `Compact.Realizer`: Realization of the compactness of a set. -/ +@[expose] public section + open Set diff --git a/Mathlib/Data/Array/Defs.lean b/Mathlib/Data/Array/Defs.lean index 0916f57d688ff3..72623030cf4312 100644 --- a/Mathlib/Data/Array/Defs.lean +++ b/Mathlib/Data/Array/Defs.lean @@ -3,8 +3,9 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Floris van Doorn -/ +module -import Mathlib.Init +public import Mathlib.Init /-! ## Definitions on Arrays @@ -12,6 +13,8 @@ This file contains various definitions on `Array`. It does not contain proofs about these definitions, those are contained in other files in `Mathlib/Data/Array.lean`. -/ +@[expose] public section + namespace Array universe u diff --git a/Mathlib/Data/Array/Extract.lean b/Mathlib/Data/Array/Extract.lean index 8f8981ea871d86..02de53f3e5e9f6 100644 --- a/Mathlib/Data/Array/Extract.lean +++ b/Mathlib/Data/Array/Extract.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Jiecheng Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiecheng Zhao -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! # Lemmas about `Array.extract` Some useful lemmas about Array.extract -/ +@[expose] public section + universe u variable {α : Type u} {i : Nat} diff --git a/Mathlib/Data/BitVec.lean b/Mathlib/Data/BitVec.lean index 0b45a62787dc0e..061c5c29dd4b98 100644 --- a/Mathlib/Data/BitVec.lean +++ b/Mathlib/Data/BitVec.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Harun Khan, Alex Keizer -/ -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Data.ZMod.Defs -import Mathlib.Data.Int.Cast.Lemmas +module + +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Data.ZMod.Defs +public import Mathlib.Data.Int.Cast.Lemmas /-! # Basic Theorems About Bitvectors @@ -18,6 +20,8 @@ Please do not extend this file further: material about BitVec needed in downstre can either be PR'd to Lean, or kept downstream if it also relies on Mathlib. -/ +@[expose] public section + namespace BitVec variable {w : Nat} diff --git a/Mathlib/Data/Bool/AllAny.lean b/Mathlib/Data/Bool/AllAny.lean index 1724a9ef0bbaba..ba5844f58c95e5 100644 --- a/Mathlib/Data/Bool/AllAny.lean +++ b/Mathlib/Data/Bool/AllAny.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Batteries.Tactic.Alias -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Tactic.Alias +public import Mathlib.Tactic.TypeStar /-! # Boolean quantifiers @@ -13,6 +15,8 @@ This proves a few properties about `List.all` and `List.any`, which are the `Boo existential quantifiers. Their definitions are in core Lean. -/ +@[expose] public section + variable {α : Type*} {p : α → Prop} [DecidablePred p] {l : List α} {a : α} diff --git a/Mathlib/Data/Bool/Basic.lean b/Mathlib/Data/Bool/Basic.lean index c67acffba84d85..b7fe9402c5c7c2 100644 --- a/Mathlib/Data/Bool/Basic.lean +++ b/Mathlib/Data/Bool/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad -/ -import Mathlib.Logic.Basic -import Mathlib.Order.Defs.LinearOrder +module + +public import Mathlib.Logic.Basic +public import Mathlib.Order.Defs.LinearOrder /-! # Booleans @@ -17,6 +19,8 @@ bool, boolean, Bool, De Morgan -/ +@[expose] public section + namespace Bool section diff --git a/Mathlib/Data/Bool/Count.lean b/Mathlib/Data/Bool/Count.lean index 5b0b59df4b4c2d..1da3405533f5af 100644 --- a/Mathlib/Data/Bool/Count.lean +++ b/Mathlib/Data/Bool/Count.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Monoid.NatCast -import Mathlib.Algebra.Ring.Parity -import Mathlib.Data.List.Chain +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Monoid.NatCast +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Data.List.Chain /-! # List of Booleans @@ -17,6 +19,8 @@ we prove that in a list with alternating `true`s and `false`s, the number of `tr the number of `false`s by at most one. We provide several versions of these statements. -/ +@[expose] public section + namespace List diff --git a/Mathlib/Data/Bool/Set.lean b/Mathlib/Data/Bool/Set.lean index a7cfc497029cfd..d349cf7a5a4846 100644 --- a/Mathlib/Data/Bool/Set.lean +++ b/Mathlib/Data/Bool/Set.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Insert +module + +public import Mathlib.Data.Set.Insert /-! # Booleans and set operations @@ -11,6 +13,8 @@ import Mathlib.Data.Set.Insert This file contains three trivial lemmas about `Bool`, `Set.univ`, and `Set.range`. -/ +@[expose] public section + open Set diff --git a/Mathlib/Data/Bracket.lean b/Mathlib/Data/Bracket.lean index 0026f0ec60df5e..e382b6938958b7 100644 --- a/Mathlib/Data/Bracket.lean +++ b/Mathlib/Data/Bracket.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Lutz, Oliver Nash -/ -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Tactic.TypeStar /-! # Bracket Notation @@ -22,6 +24,8 @@ We introduce the notation `⁅x, y⁆` for the `bracket` of any `Bracket` struct these are the Unicode "square with quill" brackets rather than the usual square brackets. -/ +@[expose] public section + /-- The `Bracket` class has three intended uses: 1. for certain binary operations on structures, like the product `⁅x, y⁆` of two elements `x`, `y` in a Lie algebra or the commutator of two elements `x` and `y` in a group. diff --git a/Mathlib/Data/Bundle.lean b/Mathlib/Data/Bundle.lean index f8717299404059..55c2b8f33e0929 100644 --- a/Mathlib/Data/Bundle.lean +++ b/Mathlib/Data/Bundle.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Data.Set.Basic +module + +public import Mathlib.Data.Set.Basic /-! # Bundle @@ -37,6 +39,8 @@ general, the constructions of fiber bundles we will make will be of this form. - https://en.wikipedia.org/wiki/Bundle_(mathematics) -/ +@[expose] public section + assert_not_exists RelIso open Function Set diff --git a/Mathlib/Data/Char.lean b/Mathlib/Data/Char.lean index c6c8559101d207..a9cdbb4b08770c 100644 --- a/Mathlib/Data/Char.lean +++ b/Mathlib/Data/Char.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.Basic -import Mathlib.Order.Defs.LinearOrder +module + +public import Mathlib.Data.Nat.Basic +public import Mathlib.Order.Defs.LinearOrder /-! # More `Char` instances @@ -14,6 +16,8 @@ Provides an additional definition to truncate a `Char` to `UInt8` and a theorem `Nat`. -/ +@[expose] public section + /-- Provides a `LinearOrder` instance on `Char`. `Char` is the type of Unicode scalar values. -/ diff --git a/Mathlib/Data/Complex/Basic.lean b/Mathlib/Data/Complex/Basic.lean index 32567a22588ddb..c0300a3c9f9567 100644 --- a/Mathlib/Data/Complex/Basic.lean +++ b/Mathlib/Data/Complex/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Mario Carneiro -/ -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Algebra.Ring.Torsion -import Mathlib.Algebra.Star.Basic -import Mathlib.Data.Real.Basic -import Mathlib.Order.Interval.Set.UnorderedInterval -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Algebra.Ring.Torsion +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Data.Real.Basic +public import Mathlib.Order.Interval.Set.UnorderedInterval +public import Mathlib.Tactic.Ring /-! # The complex numbers @@ -18,6 +20,8 @@ of characteristic zero. For the result that the complex numbers are algebraicall `Complex.isAlgClosed` in `Mathlib.Analysis.Complex.Polynomial.Basic`. -/ +@[expose] public section + assert_not_exists Multiset Algebra open Set Function diff --git a/Mathlib/Data/Complex/BigOperators.lean b/Mathlib/Data/Complex/BigOperators.lean index 02af83a94a767a..27be4d56c4f037 100644 --- a/Mathlib/Data/Complex/BigOperators.lean +++ b/Mathlib/Data/Complex/BigOperators.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Balance -import Mathlib.Data.Complex.Basic +module + +public import Mathlib.Algebra.BigOperators.Balance +public import Mathlib.Data.Complex.Basic /-! # Finite sums and products of complex numbers -/ +@[expose] public section + open Fintype open scoped BigOperators diff --git a/Mathlib/Data/Complex/Cardinality.lean b/Mathlib/Data/Complex/Cardinality.lean index 98e8430c6aa0e5..36493452742518 100644 --- a/Mathlib/Data/Complex/Cardinality.lean +++ b/Mathlib/Data/Complex/Cardinality.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.Cardinality +module + +public import Mathlib.Analysis.Complex.Cardinality deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Complex/Exponential.lean b/Mathlib/Data/Complex/Exponential.lean index 5d5479389d9597..78606255c0dc5f 100644 --- a/Mathlib/Data/Complex/Exponential.lean +++ b/Mathlib/Data/Complex/Exponential.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.Exponential +module + +public import Mathlib.Analysis.Complex.Exponential deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Complex/ExponentialBounds.lean b/Mathlib/Data/Complex/ExponentialBounds.lean index a229681fa91e44..1a672832723a5e 100644 --- a/Mathlib/Data/Complex/ExponentialBounds.lean +++ b/Mathlib/Data/Complex/ExponentialBounds.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.ExponentialBounds +module + +public import Mathlib.Analysis.Complex.ExponentialBounds deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Complex/FiniteDimensional.lean b/Mathlib/Data/Complex/FiniteDimensional.lean index 6671c2868b31fc..1e3346c2bea7e0 100644 --- a/Mathlib/Data/Complex/FiniteDimensional.lean +++ b/Mathlib/Data/Complex/FiniteDimensional.lean @@ -1,3 +1,5 @@ -import Mathlib.LinearAlgebra.Complex.FiniteDimensional +module + +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Complex/Norm.lean b/Mathlib/Data/Complex/Norm.lean index b3dc14f78a0dc0..9390115e63267d 100644 --- a/Mathlib/Data/Complex/Norm.lean +++ b/Mathlib/Data/Complex/Norm.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.Norm +module + +public import Mathlib.Analysis.Complex.Norm deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Complex/Order.lean b/Mathlib/Data/Complex/Order.lean index 16f38dcc3f89df..ee323e950d40d7 100644 --- a/Mathlib/Data/Complex/Order.lean +++ b/Mathlib/Data/Complex/Order.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.Order +module + +public import Mathlib.Analysis.Complex.Order deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Complex/Trigonometric.lean b/Mathlib/Data/Complex/Trigonometric.lean index 1c385a93e8e75f..0ba6ed46e90ec5 100644 --- a/Mathlib/Data/Complex/Trigonometric.lean +++ b/Mathlib/Data/Complex/Trigonometric.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Complex.Trigonometric +module + +public import Mathlib.Analysis.Complex.Trigonometric deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Countable/Basic.lean b/Mathlib/Data/Countable/Basic.lean index f4c1d97aa65824..5e7500e2c28a6e 100644 --- a/Mathlib/Data/Countable/Basic.lean +++ b/Mathlib/Data/Countable/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Countable.Defs -import Mathlib.Data.Fin.Tuple.Basic -import Mathlib.Data.ENat.Defs -import Mathlib.Logic.Equiv.Nat +module + +public import Mathlib.Data.Countable.Defs +public import Mathlib.Data.Fin.Tuple.Basic +public import Mathlib.Data.ENat.Defs +public import Mathlib.Logic.Equiv.Nat /-! # Countable types @@ -14,6 +16,8 @@ import Mathlib.Logic.Equiv.Nat In this file we provide basic instances of the `Countable` typeclass defined elsewhere. -/ +@[expose] public section + assert_not_exists Monoid universe u v w diff --git a/Mathlib/Data/Countable/Defs.lean b/Mathlib/Data/Countable/Defs.lean index ed5ecabe6021e1..4504df81231770 100644 --- a/Mathlib/Data/Countable/Defs.lean +++ b/Mathlib/Data/Countable/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Finite.Defs -import Mathlib.Data.Bool.Basic -import Mathlib.Data.Subtype -import Mathlib.Tactic.MkIffOfInductiveProp +module + +public import Mathlib.Data.Finite.Defs +public import Mathlib.Data.Bool.Basic +public import Mathlib.Data.Subtype +public import Mathlib.Tactic.MkIffOfInductiveProp /-! # Countable and uncountable types @@ -21,6 +23,8 @@ This file also provides a few instances of these typeclasses. More instances can be found in other files. -/ +@[expose] public section + open Function universe u v diff --git a/Mathlib/Data/Countable/Small.lean b/Mathlib/Data/Countable/Small.lean index 3d293b8d32b1bb..53a408342d6022 100644 --- a/Mathlib/Data/Countable/Small.lean +++ b/Mathlib/Data/Countable/Small.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Logic.Small.Basic -import Mathlib.Data.Countable.Defs +module + +public import Mathlib.Logic.Small.Basic +public import Mathlib.Data.Countable.Defs /-! # All countable types are small. @@ -12,6 +14,8 @@ import Mathlib.Data.Countable.Defs That is, any countable type is equivalent to a type in any universe. -/ +@[expose] public section + universe w v instance (priority := 100) Countable.toSmall (α : Type v) [Countable α] : Small.{w} α := diff --git a/Mathlib/Data/DFinsupp/BigOperators.lean b/Mathlib/Data/DFinsupp/BigOperators.lean index 293ded4032fc51..f362aee0254bdc 100644 --- a/Mathlib/Data/DFinsupp/BigOperators.lean +++ b/Mathlib/Data/DFinsupp/BigOperators.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Data.DFinsupp.Ext +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Data.DFinsupp.Ext /-! # Dependent functions with finite support @@ -39,6 +41,8 @@ the `Add` instance as noncomputable. This design difference is independent of th definitions, or introduce two more definitions for the other combinations of decisions. -/ +@[expose] public section + universe u u₁ u₂ v v₁ v₂ v₃ w x y l variable {ι : Type u} {γ : Type w} {β : ι → Type v} {β₁ : ι → Type v₁} {β₂ : ι → Type v₂} diff --git a/Mathlib/Data/DFinsupp/Defs.lean b/Mathlib/Data/DFinsupp/Defs.lean index ceccea747fb898..6079ac972340b5 100644 --- a/Mathlib/Data/DFinsupp/Defs.lean +++ b/Mathlib/Data/DFinsupp/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Algebra.Group.InjSurj -import Mathlib.Algebra.Group.Equiv.Defs -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Notation.Prod -import Mathlib.Algebra.Group.Basic +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Algebra.Group.InjSurj +public import Mathlib.Algebra.Group.Equiv.Defs +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Algebra.Group.Basic /-! # Dependent functions with finite support @@ -43,6 +45,8 @@ the `Add` instance as noncomputable. This design difference is independent of th definitions, or introduce two more definitions for the other combinations of decisions. -/ +@[expose] public section + assert_not_exists Finset.prod Submonoid universe u u₁ u₂ v v₁ v₂ v₃ w x y l diff --git a/Mathlib/Data/DFinsupp/Encodable.lean b/Mathlib/Data/DFinsupp/Encodable.lean index 15ec482cb9a866..21c621adfc4fba 100644 --- a/Mathlib/Data/DFinsupp/Encodable.lean +++ b/Mathlib/Data/DFinsupp/Encodable.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.DFinsupp.Defs -import Mathlib.Logic.Encodable.Pi +module + +public import Mathlib.Data.DFinsupp.Defs +public import Mathlib.Logic.Encodable.Pi /-! # `Encodable` and `Countable` instances for `Π₀ i, α i` In this file we provide instances for `Encodable (Π₀ i, α i)` and `Countable (Π₀ i, α i)`. -/ +@[expose] public section + variable {ι : Type*} {α : ι → Type*} [∀ i, Zero (α i)] instance [Encodable ι] [∀ i, Encodable (α i)] [∀ i (x : α i), Decidable (x ≠ 0)] : diff --git a/Mathlib/Data/DFinsupp/Ext.lean b/Mathlib/Data/DFinsupp/Ext.lean index 886ab4bf4ca5eb..ad226c5b0ab419 100644 --- a/Mathlib/Data/DFinsupp/Ext.lean +++ b/Mathlib/Data/DFinsupp/Ext.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Data.DFinsupp.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Data.DFinsupp.Defs /-! # Extensionality principles for `DFinsupp` @@ -15,6 +17,8 @@ import Mathlib.Data.DFinsupp.Defs are equal on each `single a b`, then they are equal. -/ +@[expose] public section + universe u u₁ u₂ v v₁ v₂ v₃ w x y l diff --git a/Mathlib/Data/DFinsupp/FiniteInfinite.lean b/Mathlib/Data/DFinsupp/FiniteInfinite.lean index 209edba0f70f80..b9811a81fa7f3b 100644 --- a/Mathlib/Data/DFinsupp/FiniteInfinite.lean +++ b/Mathlib/Data/DFinsupp/FiniteInfinite.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Data.DFinsupp.Defs -import Mathlib.Data.Fintype.Pi +module + +public import Mathlib.Data.DFinsupp.Defs +public import Mathlib.Data.Fintype.Pi /-! # Finiteness and infiniteness of the `DFinsupp` type @@ -17,6 +19,8 @@ import Mathlib.Data.Fintype.Pi then `DFinsupp` is infinite -/ +@[expose] public section + universe u u₁ u₂ v v₁ v₂ v₃ w x y l diff --git a/Mathlib/Data/DFinsupp/Interval.lean b/Mathlib/Data/DFinsupp/Interval.lean index fbc687099483a0..be5b5d8656b24b 100644 --- a/Mathlib/Data/DFinsupp/Interval.lean +++ b/Mathlib/Data/DFinsupp/Interval.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.DFinsupp.BigOperators -import Mathlib.Data.DFinsupp.Order -import Mathlib.Order.Interval.Finset.Basic -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.DFinsupp.BigOperators +public import Mathlib.Data.DFinsupp.Order +public import Mathlib.Order.Interval.Finset.Basic +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Finite intervals of finitely supported functions @@ -16,6 +18,8 @@ This file provides the `LocallyFiniteOrder` instance for `Π₀ i, α i` when ` finite and calculates the cardinality of its finite intervals. -/ +@[expose] public section + open DFinsupp Finset diff --git a/Mathlib/Data/DFinsupp/Lex.lean b/Mathlib/Data/DFinsupp/Lex.lean index 73a4998a090090..d7f7142bfd005f 100644 --- a/Mathlib/Data/DFinsupp/Lex.lean +++ b/Mathlib/Data/DFinsupp/Lex.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Junyan Xu -/ -import Mathlib.Algebra.Order.Group.PiLex -import Mathlib.Data.DFinsupp.Order -import Mathlib.Data.DFinsupp.NeLocus -import Mathlib.Order.WellFoundedSet +module + +public import Mathlib.Algebra.Order.Group.PiLex +public import Mathlib.Data.DFinsupp.Order +public import Mathlib.Data.DFinsupp.NeLocus +public import Mathlib.Order.WellFoundedSet /-! # Lexicographic order on finitely supported dependent functions @@ -14,6 +16,8 @@ import Mathlib.Order.WellFoundedSet This file defines the lexicographic order on `DFinsupp`. -/ +@[expose] public section + variable {ι : Type*} {α : ι → Type*} diff --git a/Mathlib/Data/DFinsupp/Module.lean b/Mathlib/Data/DFinsupp/Module.lean index 29d071f07bb05f..908a6114d9e33f 100644 --- a/Mathlib/Data/DFinsupp/Module.lean +++ b/Mathlib/Data/DFinsupp/Module.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Algebra.GroupWithZero.Action.Pi -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Algebra.Module.Pi -import Mathlib.Data.DFinsupp.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.Pi +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Data.DFinsupp.Defs /-! # Group actions on `DFinsupp` @@ -16,6 +18,8 @@ import Mathlib.Data.DFinsupp.Defs * `DFinsupp.module`: pointwise scalar multiplication on `DFinsupp` gives a module structure -/ +@[expose] public section + universe u u₁ u₂ v v₁ v₂ v₃ w x y l variable {ι : Type u} {γ : Type w} {β : ι → Type v} {β₁ : ι → Type v₁} {β₂ : ι → Type v₂} diff --git a/Mathlib/Data/DFinsupp/Multiset.lean b/Mathlib/Data/DFinsupp/Multiset.lean index 9f9538ec8891fd..311952cbde2959 100644 --- a/Mathlib/Data/DFinsupp/Multiset.lean +++ b/Mathlib/Data/DFinsupp/Multiset.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.DFinsupp.BigOperators -import Mathlib.Data.DFinsupp.Order +module + +public import Mathlib.Data.DFinsupp.BigOperators +public import Mathlib.Data.DFinsupp.Order /-! # Equivalence between `Multiset` and `ℕ`-valued finitely supported functions @@ -13,6 +15,8 @@ This defines `DFinsupp.toMultiset` the equivalence between `Π₀ a : α, ℕ` a with `Multiset.toDFinsupp` the reverse equivalence. -/ +@[expose] public section + open Function variable {α : Type*} diff --git a/Mathlib/Data/DFinsupp/NeLocus.lean b/Mathlib/Data/DFinsupp/NeLocus.lean index 39039154fc5116..5e7fe525dae8b9 100644 --- a/Mathlib/Data/DFinsupp/NeLocus.lean +++ b/Mathlib/Data/DFinsupp/NeLocus.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Junyan Xu -/ -import Mathlib.Data.DFinsupp.Defs +module + +public import Mathlib.Data.DFinsupp.Defs /-! # Locus of unequal values of finitely supported dependent functions @@ -18,6 +20,8 @@ Let `N : α → Type*` be a type family, assume that `N a` has a `0` for all `a `DFinsupp.support (f - g)`. -/ +@[expose] public section + variable {α : Type*} {N : α → Type*} diff --git a/Mathlib/Data/DFinsupp/Notation.lean b/Mathlib/Data/DFinsupp/Notation.lean index 06df3f3dfbdc26..8f123dae7e8f2c 100644 --- a/Mathlib/Data/DFinsupp/Notation.lean +++ b/Mathlib/Data/DFinsupp/Notation.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.DFinsupp.Defs -import Mathlib.Data.Finsupp.Notation +module + +public import Mathlib.Data.DFinsupp.Defs +public import Mathlib.Data.Finsupp.Notation /-! # Notation for `DFinsupp` @@ -17,6 +19,8 @@ Note that this syntax is for `Finsupp` by default, but works for `DFinsupp` if t is correct. -/ +@[expose] public section + namespace DFinsupp open Lean Parser Term @@ -26,7 +30,7 @@ open Finsupp.Internal /-- `DFinsupp` elaborator for `single₀`. -/ @[term_elab Finsupp.Internal.stxSingle₀] -def elabSingle₀ : Elab.Term.TermElab +meta def elabSingle₀ : Elab.Term.TermElab | `(term| single₀ $i $x) => fun ty? => do Elab.Term.tryPostponeIfNoneOrMVar ty? let some ty := ty? | Elab.throwUnsupportedSyntax @@ -36,7 +40,7 @@ def elabSingle₀ : Elab.Term.TermElab /-- `DFinsupp` elaborator for `update₀`. -/ @[term_elab Finsupp.Internal.stxUpdate₀] -def elabUpdate₀ : Elab.Term.TermElab +meta def elabUpdate₀ : Elab.Term.TermElab | `(term| update₀ $f $i $x) => fun ty? => do Elab.Term.tryPostponeIfNoneOrMVar ty? let some ty := ty? | Elab.throwUnsupportedSyntax @@ -48,13 +52,13 @@ end Internal /-- Unexpander for the `fun₀ | i => x` notation. -/ @[app_unexpander DFinsupp.single] -def singleUnexpander : Lean.PrettyPrinter.Unexpander +meta def singleUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $pat $val) => `(fun₀ | $pat => $val) | _ => throw () /-- Unexpander for the `fun₀ | i => x` notation. -/ @[app_unexpander DFinsupp.update] -def updateUnexpander : Lean.PrettyPrinter.Unexpander +meta def updateUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $f $pat $val) => match f with | `(fun₀ $xs:matchAlt*) => `(fun₀ $xs:matchAlt* | $pat => $val) | _ => throw () diff --git a/Mathlib/Data/DFinsupp/Order.lean b/Mathlib/Data/DFinsupp/Order.lean index 5cad336b4f72fb..5542c2a78d49fa 100644 --- a/Mathlib/Data/DFinsupp/Order.lean +++ b/Mathlib/Data/DFinsupp/Order.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.DFinsupp.Module +module + +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.DFinsupp.Module /-! # Pointwise order on finitely supported dependent functions @@ -19,6 +21,8 @@ This file lifts order structures on the `α i` to `Π₀ i, α i`. -/ +@[expose] public section + open Finset variable {ι : Type*} {α : ι → Type*} diff --git a/Mathlib/Data/DFinsupp/Sigma.lean b/Mathlib/Data/DFinsupp/Sigma.lean index be64d2f2b00cc1..5343fcb8c9fd8f 100644 --- a/Mathlib/Data/DFinsupp/Sigma.lean +++ b/Mathlib/Data/DFinsupp/Sigma.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Data.DFinsupp.Module -import Mathlib.Data.Fintype.Quotient +module + +public import Mathlib.Data.DFinsupp.Module +public import Mathlib.Data.Fintype.Quotient /-! # `DFinsupp` on `Sigma` types @@ -20,6 +22,8 @@ import Mathlib.Data.Fintype.Quotient -/ +@[expose] public section + universe u u₁ u₂ v v₁ v₂ v₃ w x y l diff --git a/Mathlib/Data/DFinsupp/Small.lean b/Mathlib/Data/DFinsupp/Small.lean index 0fb07d8ba1fc89..6544866910c46c 100644 --- a/Mathlib/Data/DFinsupp/Small.lean +++ b/Mathlib/Data/DFinsupp/Small.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Sophie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel, Antoine Chambert-Loir -/ -import Mathlib.Data.Finsupp.ToDFinsupp -import Mathlib.Data.DFinsupp.Defs -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.Data.Finsupp.ToDFinsupp +public import Mathlib.Data.DFinsupp.Defs +public import Mathlib.Logic.Small.Basic /-! # Smallness of the `DFinsupp` type @@ -16,6 +18,8 @@ instance on `DFinsupp π`. As an application, `σ →₀ R` has a `Small.{v}` instance if `σ` and `R` have one. -/ +@[expose] public section + universe u v w variable {ι : Type u} {π : ι → Type v} [∀ i, Zero (π i)] diff --git a/Mathlib/Data/DFinsupp/Submonoid.lean b/Mathlib/Data/DFinsupp/Submonoid.lean index 3cd762aeb45cb1..2c866233d2ad26 100644 --- a/Mathlib/Data/DFinsupp/Submonoid.lean +++ b/Mathlib/Data/DFinsupp/Submonoid.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Data.DFinsupp.BigOperators -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Data.DFinsupp.BigOperators +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # `DFinsupp` and submonoids @@ -21,6 +23,8 @@ This file mainly concerns the interaction between submonoids and products/sums o monoids can be given by taking finite sums of elements of each monoid. -/ +@[expose] public section + universe u u₁ u₂ v v₁ v₂ v₃ w x y l diff --git a/Mathlib/Data/DFinsupp/WellFounded.lean b/Mathlib/Data/DFinsupp/WellFounded.lean index 9b7130538eae95..dd1b6a666c2f3a 100644 --- a/Mathlib/Data/DFinsupp/WellFounded.lean +++ b/Mathlib/Data/DFinsupp/WellFounded.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Data.DFinsupp.Lex -import Mathlib.Order.Antisymmetrization -import Mathlib.Order.GameAdd -import Mathlib.SetTheory.Cardinal.Order -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Data.DFinsupp.Lex +public import Mathlib.Order.Antisymmetrization +public import Mathlib.Order.GameAdd +public import Mathlib.SetTheory.Cardinal.Order +public import Mathlib.Tactic.AdaptationNote /-! # Well-foundedness of the lexicographic and product orders on `DFinsupp` and `Pi` @@ -45,6 +47,8 @@ of a linear order), `¬ r j i ∧ j ≠ i` implies `r i j`, so it suffices to re to be well-founded. -/ +@[expose] public section + variable {ι : Type*} {α : ι → Type*} diff --git a/Mathlib/Data/DList/Instances.lean b/Mathlib/Data/DList/Instances.lean index 5a4d14e1b26f56..22f51fef1884b7 100644 --- a/Mathlib/Data/DList/Instances.lean +++ b/Mathlib/Data/DList/Instances.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Batteries.Data.DList.Lemmas -import Mathlib.Control.Traversable.Equiv -import Mathlib.Control.Traversable.Instances +module + +public import Batteries.Data.DList.Lemmas +public import Mathlib.Control.Traversable.Equiv +public import Mathlib.Control.Traversable.Instances /-! # Traversable instance for DLists @@ -14,6 +16,8 @@ This file provides the equivalence between `List α` and `DList α` and the trav for `DList`. -/ +@[expose] public section + open Function Equiv diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index 1cc6a64a3e6d19..acbb83e3047f8e 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.ENNReal.Operations +module + +public import Mathlib.Data.ENNReal.Operations /-! # Scalar multiplication on `ℝ≥0∞`. @@ -12,6 +14,8 @@ This file defines basic scalar actions on extended nonnegative reals, showing th `MulAction`s, `DistribMulAction`s, `Module`s and `Algebra`s restrict from `ℝ≥0∞` to `ℝ≥0`. -/ +@[expose] public section + open Set NNReal ENNReal namespace ENNReal diff --git a/Mathlib/Data/ENNReal/Basic.lean b/Mathlib/Data/ENNReal/Basic.lean index 3190ee3d80bade..b23ce9524f7137 100644 --- a/Mathlib/Data/ENNReal/Basic.lean +++ b/Mathlib/Data/ENNReal/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Order.Ring.WithTop -import Mathlib.Algebra.Order.Sub.WithTop -import Mathlib.Data.NNReal.Defs -import Mathlib.Order.Interval.Set.WithBotTop -import Mathlib.Tactic.Finiteness +module + +public import Mathlib.Algebra.Order.Ring.WithTop +public import Mathlib.Algebra.Order.Sub.WithTop +public import Mathlib.Data.NNReal.Defs +public import Mathlib.Order.Interval.Set.WithBotTop +public import Mathlib.Tactic.Finiteness /-! # Extended non-negative reals @@ -87,6 +89,8 @@ context, or if we have `(f : α → ℝ≥0∞) (hf : ∀ x, f x ≠ ∞)`. -/ +@[expose] public section + assert_not_exists Finset open Function Set NNReal @@ -727,7 +731,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: `ENNReal.toReal`. -/ @[positivity ENNReal.toReal _] -def evalENNRealtoReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalENNRealtoReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(ENNReal.toReal $a) => assertInstancesCommute @@ -736,7 +740,7 @@ def evalENNRealtoReal : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for the `positivity` tactic: `ENNReal.ofNNReal`. -/ @[positivity ENNReal.ofNNReal _] -def evalENNRealOfNNReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalENNRealOfNNReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ≥0∞), ~q(ENNReal.ofNNReal $a) => let ra ← core q(inferInstance) q(inferInstance) a diff --git a/Mathlib/Data/ENNReal/BigOperators.lean b/Mathlib/Data/ENNReal/BigOperators.lean index f4c3cbed2b1f31..80c6bbdeba2416 100644 --- a/Mathlib/Data/ENNReal/BigOperators.lean +++ b/Mathlib/Data/ENNReal/BigOperators.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.WithTop -import Mathlib.Data.NNReal.Basic -import Mathlib.Data.ENNReal.Inv +module + +public import Mathlib.Algebra.BigOperators.WithTop +public import Mathlib.Data.NNReal.Basic +public import Mathlib.Data.ENNReal.Inv /-! # Properties of big operators extended non-negative real numbers @@ -14,6 +16,8 @@ In this file we prove elementary properties of sums and products on `ℝ≥0∞` interact with the order structure on `ℝ≥0∞`. -/ +@[expose] public section + open Set NNReal ENNReal namespace ENNReal diff --git a/Mathlib/Data/ENNReal/Holder.lean b/Mathlib/Data/ENNReal/Holder.lean index 8fe405d01edab3..cd785f0cc768bd 100644 --- a/Mathlib/Data/ENNReal/Holder.lean +++ b/Mathlib/Data/ENNReal/Holder.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Data.ENNReal.Inv +module + +public import Mathlib.Data.ENNReal.Inv /-! # Hölder triples @@ -21,6 +23,8 @@ For convenience we also define `ENNReal.HolderConjugate` (with arguments `p q`) abbreviation for `ENNReal.HolderTriple p q 1`. -/ +@[expose] public section + namespace ENNReal /-- A class stating that `p q r : ℝ≥0∞` satisfy `p⁻¹ + q⁻¹ = r⁻¹`. diff --git a/Mathlib/Data/ENNReal/Inv.lean b/Mathlib/Data/ENNReal/Inv.lean index feb443404b2c86..c75393fdfdff7f 100644 --- a/Mathlib/Data/ENNReal/Inv.lean +++ b/Mathlib/Data/ENNReal/Inv.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.ENNReal.Operations +module + +public import Mathlib.Data.ENNReal.Operations /-! # Results about division in extended non-negative reals @@ -30,6 +32,8 @@ A few order isomorphisms are worthy of mention: composed with the identity order isomorphism between `Iic (1 : ℝ≥0∞)` and `Icc (0 : ℝ) 1`. -/ +@[expose] public section + assert_not_exists Finset open Set NNReal diff --git a/Mathlib/Data/ENNReal/Lemmas.lean b/Mathlib/Data/ENNReal/Lemmas.lean index 2dad884e504a11..f4350f33b720bc 100644 --- a/Mathlib/Data/ENNReal/Lemmas.lean +++ b/Mathlib/Data/ENNReal/Lemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Indicator -import Mathlib.Data.ENNReal.Basic -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Data.ENNReal.Basic +public import Mathlib.Data.Finset.Lattice.Fold /-! # Some lemmas on extended non-negative reals @@ -14,6 +16,8 @@ These are some lemmas split off from `ENNReal.Basic` because they need a lot mor They are probably good targets for further cleanup or moves. -/ +@[expose] public section + open Function Set NNReal diff --git a/Mathlib/Data/ENNReal/Operations.lean b/Mathlib/Data/ENNReal/Operations.lean index a4a52d519c8c70..db6fb1d9381985 100644 --- a/Mathlib/Data/ENNReal/Operations.lean +++ b/Mathlib/Data/ENNReal/Operations.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.ENNReal.Real +module + +public import Mathlib.Data.ENNReal.Real /-! # Properties of addition, multiplication and subtraction on extended non-negative real numbers @@ -17,6 +19,8 @@ Note: the definitions of the operations included in this file can be found in `Mathlib/Data/ENNReal/Basic.lean`. -/ +@[expose] public section + assert_not_exists Finset open Set NNReal ENNReal diff --git a/Mathlib/Data/ENNReal/Order.lean b/Mathlib/Data/ENNReal/Order.lean index deebde120da4c0..59ff3665913007 100644 --- a/Mathlib/Data/ENNReal/Order.lean +++ b/Mathlib/Data/ENNReal/Order.lean @@ -3,6 +3,8 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.ENNReal.Operations +module + +public import Mathlib.Data.ENNReal.Operations deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Data/ENNReal/Real.lean b/Mathlib/Data/ENNReal/Real.lean index 9303743539f127..2be95128e38f8c 100644 --- a/Mathlib/Data/ENNReal/Real.lean +++ b/Mathlib/Data/ENNReal/Real.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.ENNReal.Basic +module + +public import Mathlib.Data.ENNReal.Basic /-! # Maps between real and extended non-negative real numbers @@ -15,7 +17,7 @@ files. This file provides a `positivity` extension for `ENNReal.ofReal`. -# Main theorems +## Main statements - `trichotomy (p : ℝ≥0∞) : p = 0 ∨ p = ∞ ∨ 0 < p.toReal`: often used for `WithLp` and `lp` - `dichotomy (p : ℝ≥0∞) [Fact (1 ≤ p)] : p = ∞ ∨ 1 ≤ p.toReal`: often used for `WithLp` and `lp` @@ -24,6 +26,8 @@ This file provides a `positivity` extension for `ENNReal.ofReal`. `ℝ≥0∞` is a complete lattice. -/ +@[expose] public section + assert_not_exists Finset open Set NNReal ENNReal @@ -391,7 +395,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: `ENNReal.ofReal`. -/ @[positivity ENNReal.ofReal _] -def evalENNRealOfReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalENNRealOfReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ≥0∞), ~q(ENNReal.ofReal $a) => let ra ← core q(inferInstance) q(inferInstance) a diff --git a/Mathlib/Data/ENat/Basic.lean b/Mathlib/Data/ENat/Basic.lean index c4ea8a22d0ad60..17e6ccc8094543 100644 --- a/Mathlib/Data/ENat/Basic.lean +++ b/Mathlib/Data/ENat/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Nat.Units -import Mathlib.Algebra.Order.AddGroupWithTop -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Algebra.Order.Ring.WithTop -import Mathlib.Algebra.Order.Sub.WithTop -import Mathlib.Data.ENat.Defs -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Data.Nat.SuccPred +module + +public import Mathlib.Algebra.Group.Nat.Units +public import Mathlib.Algebra.Order.AddGroupWithTop +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Algebra.Order.Ring.WithTop +public import Mathlib.Algebra.Order.Sub.WithTop +public import Mathlib.Data.ENat.Defs +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Data.Nat.SuccPred /-! # Definition and basic properties of extended natural numbers @@ -34,6 +36,8 @@ for all `b`), or that it's order-cancellable (`a + b ≤ a + c → b ≤ c` for similarly for multiplication. -/ +@[expose] public section + open Function assert_not_exists Field diff --git a/Mathlib/Data/ENat/BigOperators.lean b/Mathlib/Data/ENat/BigOperators.lean index 21d07bbe0970ef..15b045fc012108 100644 --- a/Mathlib/Data/ENat/BigOperators.lean +++ b/Mathlib/Data/ENat/BigOperators.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Joachim Breitner, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joachim Breitner, Yaël Dillies -/ -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Data.ENat.Lattice /-! # Sum of suprema in `ENat` -/ +@[expose] public section + assert_not_exists Field namespace ENat diff --git a/Mathlib/Data/ENat/Defs.lean b/Mathlib/Data/ENat/Defs.lean index f5848ca876d2b0..eb0306f4c4b004 100644 --- a/Mathlib/Data/ENat/Defs.lean +++ b/Mathlib/Data/ENat/Defs.lean @@ -3,12 +3,15 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Simon Hudon, Yury Kudryashov -/ +module -import Mathlib.Data.Nat.Notation -import Mathlib.Order.TypeTags +public import Mathlib.Data.Nat.Notation +public import Mathlib.Order.TypeTags /-! # Definition and notation for extended natural numbers -/ +@[expose] public section + /-- Extended natural numbers `ℕ∞ = WithTop ℕ`. -/ def ENat : Type := WithTop ℕ deriving Top, Inhabited diff --git a/Mathlib/Data/ENat/Lattice.lean b/Mathlib/Data/ENat/Lattice.lean index 6b2381811937fe..dd03ff5bce98bc 100644 --- a/Mathlib/Data/ENat/Lattice.lean +++ b/Mathlib/Data/ENat/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Data.Nat.Lattice -import Mathlib.Data.ENat.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Data.Nat.Lattice +public import Mathlib.Data.ENat.Basic /-! # Extended natural numbers form a complete linear order @@ -17,6 +19,8 @@ of `WithTop.some`. -/ +@[expose] public section + assert_not_exists Field open Set diff --git a/Mathlib/Data/ENat/Pow.lean b/Mathlib/Data/ENat/Pow.lean index 8526ac194ba591..9348be3e3751c8 100644 --- a/Mathlib/Data/ENat/Pow.lean +++ b/Mathlib/Data/ENat/Pow.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Data.ENat.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Data.ENat.Basic /-! # Powers of extended natural numbers @@ -22,6 +24,8 @@ The quantity `x ^ y` for `x`, `y : ℕ∞` is defined as a `Pow` instance. It is lemmas' names. -/ +@[expose] public section + namespace ENat variable {x y z : ℕ∞} diff --git a/Mathlib/Data/EReal/Basic.lean b/Mathlib/Data/EReal/Basic.lean index e7912bd4f52398..40884616436511 100644 --- a/Mathlib/Data/EReal/Basic.lean +++ b/Mathlib/Data/EReal/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.Data.ENNReal.Operations +module + +public import Mathlib.Data.ENNReal.Operations /-! # The extended real numbers @@ -22,6 +24,8 @@ and their basic properties proved. The latter takes up most of the rest of this real, ereal, complete lattice -/ +@[expose] public section + open Function ENNReal NNReal Set noncomputable section @@ -821,7 +825,7 @@ open Lean Meta Qq Function /-- Extension for the `positivity` tactic: cast from `ℝ` to `EReal`. -/ @[positivity Real.toEReal _] -def evalRealToEReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalRealToEReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(EReal), ~q(Real.toEReal $a) => let ra ← core q(inferInstance) q(inferInstance) a @@ -835,7 +839,7 @@ def evalRealToEReal : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for the `positivity` tactic: cast from `ℝ≥0∞` to `EReal`. -/ @[positivity ENNReal.toEReal _] -def evalENNRealToEReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalENNRealToEReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(EReal), ~q(ENNReal.toEReal $a) => let ra ← core q(inferInstance) q(inferInstance) a @@ -852,7 +856,7 @@ We prove that `EReal.toReal x` is nonnegative whenever `x` is nonnegative. Since `EReal.toReal ⊤ = 0`, we cannot prove a stronger statement, at least without relying on a tactic like `finiteness`. -/ @[positivity EReal.toReal _] -def evalERealToReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalERealToReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(Real), ~q(EReal.toReal $a) => assertInstancesCommute @@ -868,7 +872,7 @@ and it is nonnegative otherwise. We cannot deduce any corollaries from `x ≠ 0`, since `EReal.toENNReal x = 0` for `x < 0`. -/ @[positivity EReal.toENNReal _] -def evalERealToENNReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalERealToENNReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ENNReal), ~q(EReal.toENNReal $a) => assertInstancesCommute diff --git a/Mathlib/Data/EReal/Inv.lean b/Mathlib/Data/EReal/Inv.lean index c0e241a56cf213..8210cf6129eff1 100644 --- a/Mathlib/Data/EReal/Inv.lean +++ b/Mathlib/Data/EReal/Inv.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.Data.ENNReal.Inv -import Mathlib.Data.EReal.Operations -import Mathlib.Data.Sign.Basic -import Mathlib.Data.Nat.Cast.Order.Field +module + +public import Mathlib.Data.ENNReal.Inv +public import Mathlib.Data.EReal.Operations +public import Mathlib.Data.Sign.Basic +public import Mathlib.Data.Nat.Cast.Order.Field /-! # Absolute value, sign, inversion and division on extended real numbers @@ -17,6 +19,8 @@ Then it defines the inverse of an `EReal` as `⊤⁻¹ = ⊥⁻¹ = 0`, which le `DivInvMonoid` instance and division. -/ +@[expose] public section + open ENNReal Set SignType noncomputable section @@ -547,7 +551,7 @@ open Lean Meta Qq Function /-- Extension for the `positivity` tactic: inverse of an `EReal`. -/ @[positivity (_⁻¹ : EReal)] -def evalERealInv : PositivityExt where eval {u α} zα pα e := do +meta def evalERealInv : PositivityExt where eval {u α} zα pα e := do match u, α, e with | 0, ~q(EReal), ~q($a⁻¹) => assertInstancesCommute @@ -558,7 +562,7 @@ def evalERealInv : PositivityExt where eval {u α} zα pα e := do /-- Extension for the `positivity` tactic: ratio of two `EReal`s. -/ @[positivity (_ / _ : EReal)] -def evalERealDiv : PositivityExt where eval {u α} zα pα e := do +meta def evalERealDiv : PositivityExt where eval {u α} zα pα e := do match u, α, e with | 0, ~q(EReal), ~q($a / $b) => assertInstancesCommute diff --git a/Mathlib/Data/EReal/Operations.lean b/Mathlib/Data/EReal/Operations.lean index 61c8b7ad54af7c..45ba43cd6b1027 100644 --- a/Mathlib/Data/EReal/Operations.lean +++ b/Mathlib/Data/EReal/Operations.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.Data.EReal.Basic +module + +public import Mathlib.Data.EReal.Basic /-! # Addition, negation, subtraction and multiplication on extended real numbers @@ -30,6 +32,8 @@ see `EReal.left_distrib_of_nonneg_of_ne_top`, or `0 ≤ y, z`. See `EReal.left_d (similarly for right distributivity). -/ +@[expose] public section + open ENNReal NNReal noncomputable section @@ -831,7 +835,7 @@ open Lean Meta Qq Function /-- Extension for the `positivity` tactic: sum of two `EReal`s. -/ @[positivity (_ + _ : EReal)] -def evalERealAdd : PositivityExt where eval {u α} zα pα e := do +meta def evalERealAdd : PositivityExt where eval {u α} zα pα e := do match u, α, e with | 0, ~q(EReal), ~q($a + $b) => assertInstancesCommute @@ -850,7 +854,7 @@ def evalERealAdd : PositivityExt where eval {u α} zα pα e := do /-- Extension for the `positivity` tactic: product of two `EReal`s. -/ @[positivity (_ * _ : EReal)] -def evalERealMul : PositivityExt where eval {u α} zα pα e := do +meta def evalERealMul : PositivityExt where eval {u α} zα pα e := do match u, α, e with | 0, ~q(EReal), ~q($a * $b) => assertInstancesCommute diff --git a/Mathlib/Data/Erased.lean b/Mathlib/Data/Erased.lean index 14951431076f2d..f9e2b191e75bf3 100644 --- a/Mathlib/Data/Erased.lean +++ b/Mathlib/Data/Erased.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Logic.Equiv.Defs /-! # A type for VM-erased data @@ -13,6 +15,8 @@ but erased in the VM. That is, at runtime every value of `Erased α` is represented as `0`, just like types and proofs. -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/FP/Basic.lean b/Mathlib/Data/FP/Basic.lean index fe25a5ef3b6c62..5a5653b111f9d5 100644 --- a/Mathlib/Data/FP/Basic.lean +++ b/Mathlib/Data/FP/Basic.lean @@ -3,17 +3,21 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Semiquot -import Mathlib.Data.Nat.Size -import Mathlib.Data.PNat.Defs -import Mathlib.Data.Rat.Init -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Basic +module + +public import Mathlib.Data.Semiquot +public import Mathlib.Data.Nat.Size +public import Mathlib.Data.PNat.Defs +public import Mathlib.Data.Rat.Init +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic /-! # Implementation of floating-point numbers (experimental). -/ +@[expose] public section + -- TODO add docs and remove `@[nolint docBlame]` @[nolint docBlame] diff --git a/Mathlib/Data/Fin/Basic.lean b/Mathlib/Data/Fin/Basic.lean index 35d7b5c34d9a70..4454e57f17fd6f 100644 --- a/Mathlib/Data/Fin/Basic.lean +++ b/Mathlib/Data/Fin/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Keeley Hoek -/ -import Mathlib.Data.Int.DivMod -import Mathlib.Order.Lattice -import Mathlib.Tactic.Common -import Batteries.Data.Fin.Basic +module + +public import Mathlib.Data.Int.DivMod +public import Mathlib.Order.Lattice +public import Mathlib.Tactic.Common +public import Batteries.Data.Fin.Basic /-! # The finite type with `n` elements @@ -22,6 +24,8 @@ Further definitions and eliminators can be found in `Init.Data.Fin.Lemmas` -/ +@[expose] public section + assert_not_exists Monoid Finset diff --git a/Mathlib/Data/Fin/Embedding.lean b/Mathlib/Data/Fin/Embedding.lean index fde3486c65fe11..4c00dcb4c1ce88 100644 --- a/Mathlib/Data/Fin/Embedding.lean +++ b/Mathlib/Data/Fin/Embedding.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Keeley Hoek -/ -import Mathlib.Data.Fin.SuccPred -import Mathlib.Logic.Embedding.Basic +module + +public import Mathlib.Data.Fin.SuccPred +public import Mathlib.Logic.Embedding.Basic /-! # Embeddings of `Fin n` @@ -25,6 +27,8 @@ This file defines embeddings between `Fin n` and other types, -/ +@[expose] public section + assert_not_exists Monoid Finset open Fin Nat Function diff --git a/Mathlib/Data/Fin/Fin2.lean b/Mathlib/Data/Fin/Fin2.lean index 8cce1dc436a801..1779ede4684b23 100644 --- a/Mathlib/Data/Fin/Fin2.lean +++ b/Mathlib/Data/Fin/Fin2.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Image -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.Nat.Notation -import Mathlib.Logic.Function.Basic +module + +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.Nat.Notation +public import Mathlib.Logic.Function.Basic /-! # Inductive type variant of `Fin` @@ -29,6 +31,8 @@ equalities. `0, ..., m - 1` and sending `m + i` to `n + i`. -/ +@[expose] public section + open Nat universe u diff --git a/Mathlib/Data/Fin/FlagRange.lean b/Mathlib/Data/Fin/FlagRange.lean index 0562067cd45431..03d1e1e4a47224 100644 --- a/Mathlib/Data/Fin/FlagRange.lean +++ b/Mathlib/Data/Fin/FlagRange.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Fin.Basic -import Mathlib.Order.Preorder.Chain +module + +public import Mathlib.Order.Fin.Basic +public import Mathlib.Order.Preorder.Chain /-! # Range of `f : Fin (n + 1) → α` as a `Flag` @@ -18,6 +20,8 @@ Then the range of `f` is a maximal chain. We formulate this result in terms of `IsMaxChain` and `Flag`. -/ +@[expose] public section + open Set variable {α : Type*} [PartialOrder α] [BoundedOrder α] {n : ℕ} {f : Fin (n + 1) → α} diff --git a/Mathlib/Data/Fin/Parity.lean b/Mathlib/Data/Fin/Parity.lean index f805dcfc9a5441..602fb1ad334063 100644 --- a/Mathlib/Data/Fin/Parity.lean +++ b/Mathlib/Data/Fin/Parity.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Iván Renison -/ -import Mathlib.Algebra.Ring.Parity -import Mathlib.Data.Fin.Basic -import Mathlib.Data.ZMod.Defs +module + +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Data.Fin.Basic +public import Mathlib.Data.ZMod.Defs /-! # Parity in `Fin n` @@ -17,6 +19,8 @@ We also prove a lemma about parity of `Fin.succAbove i j + Fin.predAbove j i` which can be used to prove `d ∘ d = 0` for de Rham cohomologies. -/ +@[expose] public section + open Fin namespace Fin diff --git a/Mathlib/Data/Fin/Pigeonhole.lean b/Mathlib/Data/Fin/Pigeonhole.lean index bcbd15e0d076be..143e0e0aab9495 100644 --- a/Mathlib/Data/Fin/Pigeonhole.lean +++ b/Mathlib/Data/Fin/Pigeonhole.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Martin Dvorak. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Dvorak -/ -import Mathlib.Data.Fintype.Card +module + +public import Mathlib.Data.Fintype.Card /-! # Pigeonhole-like results for Fin @@ -12,6 +14,8 @@ This adapts Pigeonhole-like results from `Mathlib.Data.Fintype.Card` to the sett has the type `f : Fin m → Fin n`. -/ +@[expose] public section + namespace Fin variable {m n : ℕ} diff --git a/Mathlib/Data/Fin/Rev.lean b/Mathlib/Data/Fin/Rev.lean index 9bf7b1a5630263..a9a0bb395bc0be 100644 --- a/Mathlib/Data/Fin/Rev.lean +++ b/Mathlib/Data/Fin/Rev.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez, Joel Riou, Yury Kudryashov -/ -import Mathlib.Data.Fin.SuccPred +module + +public import Mathlib.Data.Fin.SuccPred /-! # Reverse on `Fin n` @@ -15,6 +17,8 @@ This file contains lemmas about `Fin.rev : Fin n → Fin n` which maps `i` to `n by `i ↦ n-(i+1)` -/ +@[expose] public section + assert_not_exists Monoid Fintype open Fin Nat Function diff --git a/Mathlib/Data/Fin/SuccPred.lean b/Mathlib/Data/Fin/SuccPred.lean index ce96062db2849d..1036e979b8b1e3 100644 --- a/Mathlib/Data/Fin/SuccPred.lean +++ b/Mathlib/Data/Fin/SuccPred.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Data.Fin.Basic -import Mathlib.Logic.Equiv.Set +module + +public import Mathlib.Data.Fin.Basic +public import Mathlib.Logic.Equiv.Set /-! # Successors and predecessor operations of `Fin n` @@ -20,6 +22,8 @@ related to `Fin.succ`, `Fin.pred`, and related operations on `Fin n`. -/ +@[expose] public section + assert_not_exists Monoid Finset open Fin Nat Function diff --git a/Mathlib/Data/Fin/SuccPredOrder.lean b/Mathlib/Data/Fin/SuccPredOrder.lean index c894ffac3eb81d..feecea0b71799f 100644 --- a/Mathlib/Data/Fin/SuccPredOrder.lean +++ b/Mathlib/Data/Fin/SuccPredOrder.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Order.Fin.Basic -import Mathlib.Order.SuccPred.Basic +module + +public import Mathlib.Order.Fin.Basic +public import Mathlib.Order.SuccPred.Basic /-! # `SuccOrder` and `PredOrder` of `Fin n` @@ -15,6 +17,8 @@ to a specific `Fin` instance. -/ +@[expose] public section + namespace Fin diff --git a/Mathlib/Data/Fin/Tuple/Basic.lean b/Mathlib/Data/Fin/Tuple/Basic.lean index 8e76c365570909..bf01285cb097d4 100644 --- a/Mathlib/Data/Fin/Tuple/Basic.lean +++ b/Mathlib/Data/Fin/Tuple/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yury Kudryashov, Sébastien Gouëzel, Chris Hughes, Antoine Chambert-Loir -/ -import Mathlib.Data.Fin.Rev -import Mathlib.Data.Nat.Find -import Mathlib.Order.Fin.Basic +module + +public import Mathlib.Data.Fin.Rev +public import Mathlib.Data.Nat.Find +public import Mathlib.Order.Fin.Basic /-! # Operation on tuples @@ -76,6 +78,8 @@ For a **pivot** `p : Fin (n + 1)`, -/ +@[expose] public section + assert_not_exists Monoid universe u v diff --git a/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean b/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean index 514e9a2bdf59fd..dfd0b6ab50376c 100644 --- a/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean +++ b/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Data.Fin.Tuple.Sort -import Mathlib.Order.WellFounded -import Mathlib.Order.PiLex -import Mathlib.Data.Finite.Prod +module + +public import Mathlib.Data.Fin.Tuple.Sort +public import Mathlib.Order.WellFounded +public import Mathlib.Order.PiLex +public import Mathlib.Data.Finite.Prod /-! # "Bubble sort" induction @@ -25,6 +27,8 @@ The latter is proved by well-founded induction via `WellFounded.induction_bot'` with respect to the lexicographic ordering on the finite set of all permutations of `f`. -/ +@[expose] public section + namespace Tuple diff --git a/Mathlib/Data/Fin/Tuple/Curry.lean b/Mathlib/Data/Fin/Tuple/Curry.lean index b81fa30764bcef..e002ca5f13fe40 100644 --- a/Mathlib/Data/Fin/Tuple/Curry.lean +++ b/Mathlib/Data/Fin/Tuple/Curry.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Brendan Murphy -/ -import Mathlib.Data.Fin.Tuple.Basic -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.Logic.Function.OfArity +module + +public import Mathlib.Data.Fin.Tuple.Basic +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.Logic.Function.OfArity /-! # Currying and uncurrying of n-ary functions @@ -25,6 +27,8 @@ n-ary generalizations of the binary `curry` and `uncurry`. -/ +@[expose] public section + universe u v w w' namespace Function.FromTypes diff --git a/Mathlib/Data/Fin/Tuple/Embedding.lean b/Mathlib/Data/Fin/Tuple/Embedding.lean index e3d8c5702778e7..ee3ecb1b5924a9 100644 --- a/Mathlib/Data/Fin/Tuple/Embedding.lean +++ b/Mathlib/Data/Fin/Tuple/Embedding.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Data.Fin.Tuple.Basic -import Mathlib.Order.Fin.Basic +module + +public import Mathlib.Data.Fin.Tuple.Basic +public import Mathlib.Order.Fin.Basic /-! # Constructions of embeddings of `Fin n` into a type @@ -24,6 +26,8 @@ import Mathlib.Order.Fin.Basic -/ +@[expose] public section + open Function.Embedding Fin Set Nat namespace Fin.Embedding diff --git a/Mathlib/Data/Fin/Tuple/Finset.lean b/Mathlib/Data/Fin/Tuple/Finset.lean index 214713233e9a31..433fd3755f8a22 100644 --- a/Mathlib/Data/Fin/Tuple/Finset.lean +++ b/Mathlib/Data/Fin/Tuple/Finset.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey -/ -import Mathlib.Data.Finset.Prod -import Mathlib.Data.Fintype.Pi +module + +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.Fintype.Pi /-! # Fin-indexed tuples of finsets -/ +@[expose] public section + open Fin Fintype namespace Fin diff --git a/Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean b/Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean index 261ffe416faada..eabafd67723773 100644 --- a/Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean +++ b/Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.Group.Fin.Tuple -import Mathlib.Data.Finset.NatAntidiagonal -import Mathlib.Order.Fin.Tuple +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Group.Fin.Tuple +public import Mathlib.Data.Finset.NatAntidiagonal +public import Mathlib.Order.Fin.Tuple /-! # Collections of tuples of naturals with the same sum @@ -39,6 +41,8 @@ support finitely-supported functions, as is done with `cut` in `archive/100-theorems-list/45_partition.lean`. -/ +@[expose] public section + /-! ### Lists -/ diff --git a/Mathlib/Data/Fin/Tuple/Reflection.lean b/Mathlib/Data/Fin/Tuple/Reflection.lean index 4bb6fd4c74eff8..0b5d508e05e0b9 100644 --- a/Mathlib/Data/Fin/Tuple/Reflection.lean +++ b/Mathlib/Data/Fin/Tuple/Reflection.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Fin.VecNotation -import Mathlib.Algebra.BigOperators.Fin +module + +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Algebra.BigOperators.Fin /-! # Lemmas for tuples `Fin m → α` @@ -27,6 +29,8 @@ corresponding `*_eq` lemmas to be used in a place where they are definitionally * `FinVec.etaExpand` -/ +@[expose] public section + assert_not_exists Field namespace FinVec @@ -169,7 +173,8 @@ open Lean Meta Qq /-- Produce a term of the form `f 0 * f 1 * ... * f (n - 1)` and an application of `FinVec.prod_eq` that shows it is equal to `∏ i, f i`. -/ -def mkProdEqQ {u : Level} {α : Q(Type u)} (inst : Q(CommMonoid $α)) (n : ℕ) (f : Q(Fin $n → $α)) : +meta def mkProdEqQ {u : Level} {α : Q(Type u)} + (inst : Q(CommMonoid $α)) (n : ℕ) (f : Q(Fin $n → $α)) : MetaM <| (val : Q($α)) × Q(∏ i, $f i = $val) := do match n with | 0 => return ⟨q((1 : $α)), q(Fin.prod_univ_zero $f)⟩ @@ -191,7 +196,8 @@ where /-- Produce a term of the form `f 0 + f 1 + ... + f (n - 1)` and an application of `FinVec.sum_eq` that shows it is equal to `∑ i, f i`. -/ -def mkSumEqQ {u : Level} {α : Q(Type u)} (inst : Q(AddCommMonoid $α)) (n : ℕ) (f : Q(Fin $n → $α)) : +meta def mkSumEqQ {u : Level} {α : Q(Type u)} + (inst : Q(AddCommMonoid $α)) (n : ℕ) (f : Q(Fin $n → $α)) : MetaM <| (val : Q($α)) × Q(∑ i, $f i = $val) := do match n with | 0 => return ⟨q((0 : $α)), q(Fin.sum_univ_zero $f)⟩ diff --git a/Mathlib/Data/Fin/Tuple/Sort.lean b/Mathlib/Data/Fin/Tuple/Sort.lean index 9823961a6b7307..3d2870017bd53a 100644 --- a/Mathlib/Data/Fin/Tuple/Sort.lean +++ b/Mathlib/Data/Fin/Tuple/Sort.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.Group.End -import Mathlib.Data.Finset.Sort -import Mathlib.Data.Fintype.Sum -import Mathlib.Data.Prod.Lex -import Mathlib.Order.Interval.Finset.Fin +module + +public import Mathlib.Algebra.Group.End +public import Mathlib.Data.Finset.Sort +public import Mathlib.Data.Fintype.Sum +public import Mathlib.Data.Prod.Lex +public import Mathlib.Order.Interval.Finset.Fin /-! @@ -25,6 +27,8 @@ This file provides an API for doing so, with the sorted `n`-tuple given by -/ +@[expose] public section + namespace Tuple diff --git a/Mathlib/Data/Fin/Tuple/Take.lean b/Mathlib/Data/Fin/Tuple/Take.lean index ae39994657dd7f..d58fa90a0f0f18 100644 --- a/Mathlib/Data/Fin/Tuple/Take.lean +++ b/Mathlib/Data/Fin/Tuple/Take.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Quang Dao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Quang Dao -/ -import Mathlib.Data.Fin.Tuple.Basic +module + +public import Mathlib.Data.Fin.Tuple.Basic /-! # Take operations on tuples @@ -14,6 +16,8 @@ We define the `take` operation on `n`-tuples, which restricts a tuple to its fir `m`-tuple `(v 0, ..., v (m - 1))`. -/ +@[expose] public section + namespace Fin open Function diff --git a/Mathlib/Data/Fin/VecNotation.lean b/Mathlib/Data/Fin/VecNotation.lean index 1a840ffb7e1c35..7f38842cf101c1 100644 --- a/Mathlib/Data/Fin/VecNotation.lean +++ b/Mathlib/Data/Fin/VecNotation.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Eric Wieser -/ -import Mathlib.Data.Fin.Tuple.Basic +module + +public import Mathlib.Data.Fin.Tuple.Basic /-! # Matrix and vector notation @@ -34,6 +36,8 @@ The main new notation is `![a, b]`, which gets expanded to `vecCons a (vecCons b Examples of usage can be found in the `MathlibTest/matrix.lean` file. -/ +@[expose] public section + namespace Matrix @@ -72,7 +76,7 @@ macro_rules /-- Unexpander for the `![x, y, ...]` notation. -/ @[app_unexpander vecCons] -def vecConsUnexpander : Lean.PrettyPrinter.Unexpander +meta def vecConsUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $term ![$term2, $terms,*]) => `(![$term, $term2, $terms,*]) | `($_ $term ![$term2]) => `(![$term, $term2]) | `($_ $term ![]) => `(![$term]) @@ -80,7 +84,7 @@ def vecConsUnexpander : Lean.PrettyPrinter.Unexpander /-- Unexpander for the `![]` notation. -/ @[app_unexpander vecEmpty] -def vecEmptyUnexpander : Lean.PrettyPrinter.Unexpander +meta def vecEmptyUnexpander : Lean.PrettyPrinter.Unexpander | `($_:ident) => `(![]) | _ => throw () @@ -141,7 +145,7 @@ open Lean Qq `let ⟨xs, tailn, tail⟩ ← matchVecConsPrefix n e` decomposes `e : Fin n → _` in the form `vecCons x₀ <| ... <| vecCons xₙ <| tail` where `tail : Fin tailn → _`. -/ -partial def matchVecConsPrefix (n : Q(Nat)) (e : Expr) : MetaM <| List Expr × Q(Nat) × Expr := do +meta def matchVecConsPrefix (n : Q(Nat)) (e : Expr) : MetaM <| List Expr × Q(Nat) × Expr := do match_expr ← Meta.whnfR e with | Matrix.vecCons _ n x xs => do let (elems, n', tail) ← matchVecConsPrefix n xs @@ -258,7 +262,7 @@ theorem vecCons_inj {x y : α} {u v : Fin n → α} : vecCons x u = vecCons y v open Lean Qq in /-- `mkVecLiteralQ ![x, y, z]` produces the term `q(![$x, $y, $z])`. -/ -def _root_.PiFin.mkLiteralQ {u : Level} {α : Q(Type u)} {n : ℕ} (elems : Fin n → Q($α)) : +meta def _root_.PiFin.mkLiteralQ {u : Level} {α : Q(Type u)} {n : ℕ} (elems : Fin n → Q($α)) : Q(Fin $n → $α) := loop 0 q(vecEmpty) where @@ -273,7 +277,7 @@ where rest open Lean Qq in -protected instance _root_.PiFin.toExpr [ToLevel.{u}] [ToExpr α] (n : ℕ) : ToExpr (Fin n → α) := +protected meta instance _root_.PiFin.toExpr [ToLevel.{u}] [ToExpr α] (n : ℕ) : ToExpr (Fin n → α) := have lu := toLevel.{u} have eα : Q(Type $lu) := toTypeExpr α let toTypeExpr := q(Fin $n → $eα) diff --git a/Mathlib/Data/FinEnum.lean b/Mathlib/Data/FinEnum.lean index 80eee482d882f7..8de882ad593621 100644 --- a/Mathlib/Data/FinEnum.lean +++ b/Mathlib/Data/FinEnum.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.List.ProdSigma -import Mathlib.Data.List.Pi +module + +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.List.ProdSigma +public import Mathlib.Data.List.Pi /-! Type class for finitely enumerable types. The property is stronger @@ -14,6 +16,8 @@ than `Fintype` in that it assigns each element a rank in a finite enumeration. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/FinEnum/Option.lean b/Mathlib/Data/FinEnum/Option.lean index a1b60fc3a5cf21..73f3f05c54613e 100644 --- a/Mathlib/Data/FinEnum/Option.lean +++ b/Mathlib/Data/FinEnum/Option.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Tom Kranz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tom Kranz -/ -import Mathlib.Data.FinEnum -import Mathlib.Logic.Equiv.Fin.Basic +module + +public import Mathlib.Data.FinEnum +public import Mathlib.Logic.Equiv.Fin.Basic /-! # FinEnum instance for Option @@ -16,6 +18,8 @@ non-truncated data. * recreate rest of `Mathlib/Data/Fintype/Option.lean` -/ +@[expose] public section + namespace FinEnum universe u v diff --git a/Mathlib/Data/Finite/Card.lean b/Mathlib/Data/Finite/Card.lean index 95192d44a5a246..3cf9cec55ae581 100644 --- a/Mathlib/Data/Finite/Card.lean +++ b/Mathlib/Data/Finite/Card.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.SetTheory.Cardinal.Finite +module + +public import Mathlib.SetTheory.Cardinal.Finite /-! @@ -25,6 +27,8 @@ it. We generally put such theorems into the `SetTheory.Cardinal.Finite` module. -/ +@[expose] public section + assert_not_exists Field noncomputable section diff --git a/Mathlib/Data/Finite/Defs.lean b/Mathlib/Data/Finite/Defs.lean index 7f5760a0c350d0..6abd1d004d436b 100644 --- a/Mathlib/Data/Finite/Defs.lean +++ b/Mathlib/Data/Finite/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Set.CoeSort -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Set -import Mathlib.Util.AssertExists +module + +public import Mathlib.Data.Set.CoeSort +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Set +public import Mathlib.Util.AssertExists /-! # Definition of the `Finite` typeclass @@ -58,6 +60,8 @@ instances since they do not compute anything. finite, fintype, finite sets -/ +@[expose] public section + assert_not_exists Finset MonoidWithZero IsOrderedRing universe u v diff --git a/Mathlib/Data/Finite/Perm.lean b/Mathlib/Data/Finite/Perm.lean index 8eb40461c6e561..0e3890e5ec7b11 100644 --- a/Mathlib/Data/Finite/Perm.lean +++ b/Mathlib/Data/Finite/Perm.lean @@ -3,14 +3,17 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Data.Fintype.Perm -import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.Data.Fintype.Perm +public import Mathlib.SetTheory.Cardinal.Finite /-! # Properties of `Equiv.Perm` on `Finite` types -/ +@[expose] public section + assert_not_exists Field namespace Nat diff --git a/Mathlib/Data/Finite/Prod.lean b/Mathlib/Data/Finite/Prod.lean index b24ee1a8fd2dce..1b9e1be301b179 100644 --- a/Mathlib/Data/Finite/Prod.lean +++ b/Mathlib/Data/Finite/Prod.lean @@ -3,19 +3,23 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Pi -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Data.Vector.Basic -import Mathlib.Tactic.ApplyFun -import Mathlib.Data.ULift -import Mathlib.Data.Set.NAry +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Data.Vector.Basic +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Data.ULift +public import Mathlib.Data.Set.NAry /-! # Finiteness of products -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero variable {α β : Type*} @@ -38,6 +42,10 @@ theorem prod_right (α) [Finite (α × β)] [Nonempty α] : Finite β := end Finite +lemma Prod.finite_iff [Nonempty α] [Nonempty β] : Finite (α × β) ↔ Finite α ∧ Finite β where + mp _ := ⟨.prod_left β, .prod_right α⟩ + mpr | ⟨_, _⟩ => inferInstance + instance Pi.finite {α : Sort*} {β : α → Sort*} [Finite α] [∀ a, Finite (β a)] : Finite (∀ a, β a) := by classical diff --git a/Mathlib/Data/Finite/Set.lean b/Mathlib/Data/Finite/Set.lean index 633df5c02ef1ec..f107489107c817 100644 --- a/Mathlib/Data/Finite/Set.lean +++ b/Mathlib/Data/Finite/Set.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Data.Fintype.EquivFin /-! # Lemmas about `Finite` and `Set`s @@ -15,6 +17,8 @@ In this file we prove two lemmas about `Finite` and `Set`s. finiteness, finite sets -/ +@[expose] public section + open Set diff --git a/Mathlib/Data/Finite/Sigma.lean b/Mathlib/Data/Finite/Sigma.lean index c3be07253027e5..1beca1c1ab1c3b 100644 --- a/Mathlib/Data/Finite/Sigma.lean +++ b/Mathlib/Data/Finite/Sigma.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Fintype.Sigma +module + +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Fintype.Sigma /-! # Finiteness of sigma types -/ +@[expose] public section + variable {α : Type*} namespace Finite diff --git a/Mathlib/Data/Finite/Sum.lean b/Mathlib/Data/Finite/Sum.lean index 4c3ecc2999ef54..de92dd81a50dba 100644 --- a/Mathlib/Data/Finite/Sum.lean +++ b/Mathlib/Data/Finite/Sum.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Fintype.Sum +module + +public import Mathlib.Data.Fintype.Sum /-! # Finiteness of sum types -/ +@[expose] public section + variable {α β : Type*} namespace Finite diff --git a/Mathlib/Data/Finite/Vector.lean b/Mathlib/Data/Finite/Vector.lean index b58c4d1f53a75e..f8d16dcd4b5d23 100644 --- a/Mathlib/Data/Finite/Vector.lean +++ b/Mathlib/Data/Finite/Vector.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Fintype.Vector +module + +public import Mathlib.Data.Fintype.Vector /-! # Finiteness of vector types -/ +@[expose] public section + variable {α : Type*} instance List.Vector.finite [Finite α] {n : ℕ} : Finite (Vector α n) := by diff --git a/Mathlib/Data/Finmap.lean b/Mathlib/Data/Finmap.lean index fc4cc20e1e46e8..b1f114606d319b 100644 --- a/Mathlib/Data/Finmap.lean +++ b/Mathlib/Data/Finmap.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Sean Leather. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sean Leather, Mario Carneiro -/ -import Mathlib.Data.List.AList -import Mathlib.Data.Finset.Sigma -import Mathlib.Data.Part +module + +public import Mathlib.Data.List.AList +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Data.Part /-! # Finite maps over `Multiset` -/ +@[expose] public section + universe u v w open List diff --git a/Mathlib/Data/Finset/Attach.lean b/Mathlib/Data/Finset/Attach.lean index ac66a7c322f9f6..2823309d9bee2d 100644 --- a/Mathlib/Data/Finset/Attach.lean +++ b/Mathlib/Data/Finset/Attach.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Multiset.MapFold +module + +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Multiset.MapFold /-! # Attaching a proof of membership to a finite set @@ -20,6 +22,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/Attr.lean b/Mathlib/Data/Finset/Attr.lean index 43bc734336e24a..517401defcfbb8 100644 --- a/Mathlib/Data/Finset/Attr.lean +++ b/Mathlib/Data/Finset/Attr.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Init -import Aesop -import Qq +module + +public import Mathlib.Init +public import Aesop +public import Qq /-! # Aesop rule set for finsets @@ -13,6 +15,8 @@ import Qq This file defines `finsetNonempty`, an aesop rule set to prove that a given finset is nonempty. -/ +@[expose] public section + -- `finsetNonempty` rules try to prove that a given finset is nonempty, -- for use in positivity extensions. declare_aesop_rule_sets [finsetNonempty] (default := true) diff --git a/Mathlib/Data/Finset/Basic.lean b/Mathlib/Data/Finset/Basic.lean index c474ddbbf65739..54c1d5683ff56a 100644 --- a/Mathlib/Data/Finset/Basic.lean +++ b/Mathlib/Data/Finset/Basic.lean @@ -3,17 +3,19 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Attach -import Mathlib.Data.Finset.Disjoint -import Mathlib.Data.Finset.Erase -import Mathlib.Data.Finset.Filter -import Mathlib.Data.Finset.Range -import Mathlib.Data.Finset.SDiff -import Mathlib.Data.Multiset.Basic -import Mathlib.Logic.Equiv.Set -import Mathlib.Order.Directed -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Data.Set.SymmDiff +module + +public import Mathlib.Data.Finset.Attach +public import Mathlib.Data.Finset.Disjoint +public import Mathlib.Data.Finset.Erase +public import Mathlib.Data.Finset.Filter +public import Mathlib.Data.Finset.Range +public import Mathlib.Data.Finset.SDiff +public import Mathlib.Data.Multiset.Basic +public import Mathlib.Logic.Equiv.Set +public import Mathlib.Order.Directed +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Data.Set.SymmDiff /-! # Basic lemmas on finite sets @@ -42,6 +44,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice Monoid diff --git a/Mathlib/Data/Finset/BooleanAlgebra.lean b/Mathlib/Data/Finset/BooleanAlgebra.lean index 2aba4256b4f993..1052c776c8c2f3 100644 --- a/Mathlib/Data/Finset/BooleanAlgebra.lean +++ b/Mathlib/Data/Finset/BooleanAlgebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Basic -import Mathlib.Data.Finset.Image -import Mathlib.Data.Fintype.Defs +module + +public import Mathlib.Data.Finset.Basic +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Fintype.Defs /-! # `Finset`s are a Boolean algebra @@ -19,6 +21,8 @@ This file provides the `BooleanAlgebra (Finset α)` instance, under the assumpti * `Finset.booleanAlgebra`: `Finset α` is a Boolean algebra if `α` is finite -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Data/Finset/Card.lean b/Mathlib/Data/Finset/Card.lean index 2f4c1e81d3fb3d..32b03b677db2db 100644 --- a/Mathlib/Data/Finset/Card.lean +++ b/Mathlib/Data/Finset/Card.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad -/ -import Mathlib.Data.Finset.Basic -import Mathlib.Data.Finset.Image -import Mathlib.Data.Finset.Lattice.Lemmas +module + +public import Mathlib.Data.Finset.Basic +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Finset.Lattice.Lemmas /-! # Cardinality of a finite set @@ -27,6 +29,8 @@ This defines the cardinality of a `Finset` and provides induction principles for * `Finset.eraseInduction` -/ +@[expose] public section + assert_not_exists Monoid open Function Multiset Nat diff --git a/Mathlib/Data/Finset/CastCard.lean b/Mathlib/Data/Finset/CastCard.lean index 495e409c5129ff..acae70543ac3ad 100644 --- a/Mathlib/Data/Finset/CastCard.lean +++ b/Mathlib/Data/Finset/CastCard.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Int.Cast.Basic +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Int.Cast.Basic /-! # Cardinality of a finite set and subtraction @@ -20,6 +22,8 @@ cardinality as element of an `AddGroupWithOne`. * `Finset.cast_card_sdiff`: cardinality of `t \ s` is the difference of cardinalities if `s ⊆ t`. -/ +@[expose] public section + assert_not_exists MonoidWithZero IsOrderedMonoid open Nat diff --git a/Mathlib/Data/Finset/Dedup.lean b/Mathlib/Data/Finset/Dedup.lean index 45596035bc1ccc..8f61d868555cfc 100644 --- a/Mathlib/Data/Finset/Dedup.lean +++ b/Mathlib/Data/Finset/Dedup.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Multiset.Dedup -import Mathlib.Data.Multiset.Basic +module + +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Multiset.Dedup +public import Mathlib.Data.Multiset.Basic /-! # Deduplicating Multisets to make Finsets @@ -18,6 +20,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/Defs.lean b/Mathlib/Data/Finset/Defs.lean index 692d3112c260ad..f71798d6f876dc 100644 --- a/Mathlib/Data/Finset/Defs.lean +++ b/Mathlib/Data/Finset/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Aesop -import Mathlib.Data.Multiset.Defs -import Mathlib.Data.Set.Pairwise.Basic -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.Hom.Basic +module + +public import Aesop +public import Mathlib.Data.Multiset.Defs +public import Mathlib.Data.Set.Pairwise.Basic +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.Hom.Basic /-! # Finite sets @@ -58,6 +60,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset DirectedSystem CompleteLattice Monoid diff --git a/Mathlib/Data/Finset/Density.lean b/Mathlib/Data/Finset/Density.lean index ebdc2937d829a5..b21a64f3e6ba07 100644 --- a/Mathlib/Data/Finset/Density.lean +++ b/Mathlib/Data/Finset/Density.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Field.Rat -import Mathlib.Data.Fintype.Card -import Mathlib.Data.NNRat.Order -import Mathlib.Data.Rat.Cast.CharZero -import Mathlib.Tactic.Positivity.Basic +module + +public import Mathlib.Algebra.Order.Field.Rat +public import Mathlib.Data.Fintype.Card +public import Mathlib.Data.NNRat.Order +public import Mathlib.Data.Rat.Cast.CharZero +public import Mathlib.Tactic.Positivity.Basic /-! # Density of a finite set @@ -45,6 +47,8 @@ These considerations more generally apply to `Finset.card` and `Finset.sum` and overengineering basic definitions is likely to hinder user experience. -/ +@[expose] public section + -- TODO -- assert_not_exists Ring diff --git a/Mathlib/Data/Finset/Disjoint.lean b/Mathlib/Data/Finset/Disjoint.lean index b2f43a47ba9fdb..9f45a87dbf3f5a 100644 --- a/Mathlib/Data/Finset/Disjoint.lean +++ b/Mathlib/Data/Finset/Disjoint.lean @@ -3,7 +3,9 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Insert +module + +public import Mathlib.Data.Finset.Insert /-! # Disjoint finite sets @@ -20,6 +22,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice Monoid diff --git a/Mathlib/Data/Finset/Empty.lean b/Mathlib/Data/Finset/Empty.lean index 9e8ea49c68fef9..cdb384792a7c6d 100644 --- a/Mathlib/Data/Finset/Empty.lean +++ b/Mathlib/Data/Finset/Empty.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Multiset.ZeroCons +module + +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Multiset.ZeroCons /-! # Empty and nonempty finite sets @@ -21,6 +23,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid @@ -203,7 +207,7 @@ You can add lemmas to the rule-set by tagging them with either: TODO: should some of the lemmas be `aesop safe simp` instead? -/ -def proveFinsetNonempty {u : Level} {α : Q(Type u)} (s : Q(Finset $α)) : +meta def proveFinsetNonempty {u : Level} {α : Q(Type u)} (s : Q(Finset $α)) : MetaM (Option Q(Finset.Nonempty $s)) := do -- Aesop expects to operate on goals, so we're going to make a new goal. let goal ← Lean.Meta.mkFreshExprMVar q(Finset.Nonempty $s) diff --git a/Mathlib/Data/Finset/Erase.lean b/Mathlib/Data/Finset/Erase.lean index 3273aaf0e750d4..6d5bc42fc99858 100644 --- a/Mathlib/Data/Finset/Erase.lean +++ b/Mathlib/Data/Finset/Erase.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Multiset.Filter +module + +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Multiset.Filter /-! # Erasing an element from a finite set @@ -19,6 +21,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/Filter.lean b/Mathlib/Data/Finset/Filter.lean index 419856fd6f3c7a..5125ff4b26b6de 100644 --- a/Mathlib/Data/Finset/Filter.lean +++ b/Mathlib/Data/Finset/Filter.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Empty -import Mathlib.Data.Multiset.Filter +module + +public import Mathlib.Data.Finset.Empty +public import Mathlib.Data.Multiset.Filter /-! # Filtering a finite set @@ -20,6 +22,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid @@ -55,7 +59,7 @@ open Lean Elab Term Meta Batteries.ExtendedBinder /-- Return `true` if `expectedType?` is `some (Finset ?α)`, throws `throwUnsupportedSyntax` if it is `some (Set ?α)`, and returns `false` otherwise. -/ -def knownToBeFinsetNotSet (expectedType? : Option Expr) : TermElabM Bool := +meta def knownToBeFinsetNotSet (expectedType? : Option Expr) : TermElabM Bool := -- As we want to reason about the expected type, we would like to wait for it to be available. -- However this means that if we fall back on `elabSetBuilder` we will have postponed. -- This is undesirable as we want set builder notation to quickly elaborate to a `Set` when no @@ -88,7 +92,7 @@ See also TODO: Write a delaborator -/ @[term_elab setBuilder] -def elabFinsetBuilderSep : TermElab +meta def elabFinsetBuilderSep : TermElab | `({ $x:ident ∈ $s:term | $p }), expectedType? => do -- If the expected type is known to be `Set ?α`, give up. If it is not known to be `Set ?α` or -- `Finset ?α`, check the expected type of `s`. diff --git a/Mathlib/Data/Finset/Fin.lean b/Mathlib/Data/Finset/Fin.lean index 04d43cf705701f..56256fbe299388 100644 --- a/Mathlib/Data/Finset/Fin.lean +++ b/Mathlib/Data/Finset/Fin.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Kim Morrison, Johan Commelin -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Fin.Embedding +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Fin.Embedding /-! # Finsets in `Fin n` @@ -16,6 +18,8 @@ A few constructions for Finsets in `Fin n`. * `Finset.attachFin`: Turns a Finset of naturals strictly less than `n` into a `Finset (Fin n)`. -/ +@[expose] public section + variable {n : ℕ} diff --git a/Mathlib/Data/Finset/Finsupp.lean b/Mathlib/Data/Finset/Finsupp.lean index ff8084cf68c2cb..2e42ead7b538fd 100644 --- a/Mathlib/Data/Finset/Finsupp.lean +++ b/Mathlib/Data/Finset/Finsupp.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Data.Finsupp.Indicator -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Data.Finsupp.Indicator +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Finitely supported product of finsets @@ -26,6 +28,8 @@ We make heavy use of the fact that `0 : Finset α` is `{0}`. This scalar actions to be precisely what we want here too. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Data/Finset/Fold.lean b/Mathlib/Data/Finset/Fold.lean index dc3c4af8d70fab..29130f8c9aca33 100644 --- a/Mathlib/Data/Finset/Fold.lean +++ b/Mathlib/Data/Finset/Fold.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Basic -import Mathlib.Data.Finset.Image -import Mathlib.Data.Multiset.Fold -import Mathlib.Data.Finset.Lattice.Lemmas +module + +public import Mathlib.Data.Finset.Basic +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Multiset.Fold +public import Mathlib.Data.Finset.Lattice.Lemmas /-! # The fold operation for a commutative associative operation over a finset. -/ +@[expose] public section + assert_not_exists Monoid namespace Finset diff --git a/Mathlib/Data/Finset/Functor.lean b/Mathlib/Data/Finset/Functor.lean index d820d2bcc1ff80..37378ff5f2df82 100644 --- a/Mathlib/Data/Finset/Functor.lean +++ b/Mathlib/Data/Finset/Functor.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Kim Morrison -/ -import Batteries.Control.AlternativeMonad -import Mathlib.Data.Finset.Lattice.Union -import Mathlib.Data.Finset.NAry -import Mathlib.Data.Multiset.Functor +module + +public import Batteries.Control.AlternativeMonad +public import Mathlib.Data.Finset.Lattice.Union +public import Mathlib.Data.Finset.NAry +public import Mathlib.Data.Multiset.Functor /-! # Functoriality of `Finset` @@ -20,6 +22,8 @@ instead we could state that a functor is lawful/applicative/traversable... betwe then we could provide the instances for types with decidable equality. -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/Finset/Grade.lean b/Mathlib/Data/Finset/Grade.lean index c167356ac52122..82bd1e479869e5 100644 --- a/Mathlib/Data/Finset/Grade.lean +++ b/Mathlib/Data/Finset/Grade.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Order.Atoms -import Mathlib.Order.Grade -import Mathlib.Order.Nat +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Order.Atoms +public import Mathlib.Order.Grade +public import Mathlib.Order.Nat /-! # Finsets and multisets form a graded order @@ -20,6 +22,8 @@ proves that they form a `ℕ`-graded order. * `Finset.instGradeMinOrder_nat`: Finsets are `ℕ`-graded -/ +@[expose] public section + open Order variable {α : Type*} diff --git a/Mathlib/Data/Finset/Image.lean b/Mathlib/Data/Finset/Image.lean index 45fbd4eda793e1..2a52fef1c850b5 100644 --- a/Mathlib/Data/Finset/Image.lean +++ b/Mathlib/Data/Finset/Image.lean @@ -3,15 +3,17 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Algebra.NeZero -import Mathlib.Data.Finset.Attach -import Mathlib.Data.Finset.Disjoint -import Mathlib.Data.Finset.Erase -import Mathlib.Data.Finset.Filter -import Mathlib.Data.Finset.Range -import Mathlib.Data.Finset.Lattice.Lemmas -import Mathlib.Data.Finset.SDiff -import Mathlib.Data.Fintype.Defs +module + +public import Mathlib.Algebra.NeZero +public import Mathlib.Data.Finset.Attach +public import Mathlib.Data.Finset.Disjoint +public import Mathlib.Data.Finset.Erase +public import Mathlib.Data.Finset.Filter +public import Mathlib.Data.Finset.Range +public import Mathlib.Data.Finset.Lattice.Lemmas +public import Mathlib.Data.Finset.SDiff +public import Mathlib.Data.Fintype.Defs /-! # Image and map operations on finite sets @@ -31,6 +33,8 @@ choosing between `insert` and `Finset.cons`, or between `Finset.union` and `Fins * `Finset.subtype`: `s.subtype p` is the finset of `Subtype p` whose elements belong to `s`. * `Finset.fin`:`s.fin n` is the finset of all elements of `s` less than `n`. -/ + +@[expose] public section assert_not_exists Monoid IsOrderedMonoid variable {α β γ : Type*} diff --git a/Mathlib/Data/Finset/Insert.lean b/Mathlib/Data/Finset/Insert.lean index f7a9e7c7b89199..abd2d1b6e62ef6 100644 --- a/Mathlib/Data/Finset/Insert.lean +++ b/Mathlib/Data/Finset/Insert.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Attr -import Mathlib.Data.Finset.Dedup -import Mathlib.Data.Finset.Empty -import Mathlib.Data.Multiset.FinsetOps +module + +public import Mathlib.Data.Finset.Attr +public import Mathlib.Data.Finset.Dedup +public import Mathlib.Data.Finset.Empty +public import Mathlib.Data.Multiset.FinsetOps /-! # Constructing finite sets by adding one element @@ -30,6 +32,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/Interval.lean b/Mathlib/Data/Finset/Interval.lean index 0da10e7182df88..067c5f384b1993 100644 --- a/Mathlib/Data/Finset/Interval.lean +++ b/Mathlib/Data/Finset/Interval.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Yury Kudryashov -/ -import Mathlib.Data.Finset.Grade -import Mathlib.Data.Finset.Powerset -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Data.Finset.Grade +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Order.Interval.Finset.Basic /-! # Intervals of finsets as finsets @@ -23,6 +25,8 @@ In addition, this file gives characterizations of monotone and strictly monotone out of `Finset α` in terms of `Finset.insert` -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/Finset/Lattice/Basic.lean b/Mathlib/Data/Finset/Lattice/Basic.lean index 249485af85b8a8..68c7c601867869 100644 --- a/Mathlib/Data/Finset/Lattice/Basic.lean +++ b/Mathlib/Data/Finset/Lattice/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Multiset.FinsetOps +module + +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Multiset.FinsetOps /-! # Lattice structure on finite sets @@ -37,6 +39,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/Lattice/Fold.lean b/Mathlib/Data/Finset/Lattice/Fold.lean index 12376901e94f2f..69169e9babf37b 100644 --- a/Mathlib/Data/Finset/Lattice/Fold.lean +++ b/Mathlib/Data/Finset/Lattice/Fold.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Fold -import Mathlib.Data.Finset.Sum -import Mathlib.Data.Multiset.Lattice -import Mathlib.Data.Set.BooleanAlgebra -import Mathlib.Order.Hom.BoundedLattice -import Mathlib.Order.Nat +module + +public import Mathlib.Data.Finset.Fold +public import Mathlib.Data.Finset.Sum +public import Mathlib.Data.Multiset.Lattice +public import Mathlib.Data.Set.BooleanAlgebra +public import Mathlib.Order.Hom.BoundedLattice +public import Mathlib.Order.Nat /-! # Lattice operations on finsets @@ -21,6 +23,8 @@ See also `Mathlib/Order/CompleteLattice/Finset.lean`, which is instead concerned lattice or set operations behave when indexed by a finset. -/ +@[expose] public section + open Function Multiset OrderDual variable {F α β γ ι κ : Type*} diff --git a/Mathlib/Data/Finset/Lattice/Lemmas.lean b/Mathlib/Data/Finset/Lattice/Lemmas.lean index bbafb21caafe81..7c7564b39244a1 100644 --- a/Mathlib/Data/Finset/Lattice/Lemmas.lean +++ b/Mathlib/Data/Finset/Lattice/Lemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Insert -import Mathlib.Data.Finset.Lattice.Basic +module + +public import Mathlib.Data.Finset.Insert +public import Mathlib.Data.Finset.Lattice.Basic /-! # Lemmas about the lattice structure of finite sets @@ -18,6 +20,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice Monoid diff --git a/Mathlib/Data/Finset/Lattice/Pi.lean b/Mathlib/Data/Finset/Lattice/Pi.lean index 715658baed29d2..6299833a26f0ef 100644 --- a/Mathlib/Data/Finset/Lattice/Pi.lean +++ b/Mathlib/Data/Finset/Lattice/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Lattice.Prod -import Mathlib.Data.Finset.Pi +module + +public import Mathlib.Data.Finset.Lattice.Prod +public import Mathlib.Data.Finset.Pi /-! # Lattice operations on finsets of functions @@ -12,6 +14,8 @@ import Mathlib.Data.Finset.Pi This file is concerned with folding binary lattice operations over finsets. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidWithZero variable {α ι : Type*} diff --git a/Mathlib/Data/Finset/Lattice/Prod.lean b/Mathlib/Data/Finset/Lattice/Prod.lean index 81982929f6f68a..1b64fa3c168984 100644 --- a/Mathlib/Data/Finset/Lattice/Prod.lean +++ b/Mathlib/Data/Finset/Lattice/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Finset.Prod +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Finset.Prod /-! # Lattice operations on finsets of products @@ -12,6 +14,8 @@ import Mathlib.Data.Finset.Prod This file is concerned with folding binary lattice operations over finsets. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidWithZero open Function Multiset OrderDual diff --git a/Mathlib/Data/Finset/Lattice/Union.lean b/Mathlib/Data/Finset/Lattice/Union.lean index 36e3331fca5f51..9f76b201adc493 100644 --- a/Mathlib/Data/Finset/Lattice/Union.lean +++ b/Mathlib/Data/Finset/Lattice/Union.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Finset.Union +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Finset.Union /-! # Relating `Finset.biUnion` with lattice operations @@ -16,6 +18,8 @@ This file shows `Finset.biUnion` could alternatively be defined in terms of `Fin Remove `Finset.biUnion` in favour of `Finset.sup`. -/ +@[expose] public section + open Function Multiset OrderDual variable {F α β γ ι κ : Type*} diff --git a/Mathlib/Data/Finset/Max.lean b/Mathlib/Data/Finset/Max.lean index 6301ae04897b32..06b8d3d8813b71 100644 --- a/Mathlib/Data/Finset/Max.lean +++ b/Mathlib/Data/Finset/Max.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Lattice.Fold /-! # Maximum and minimum of finite sets -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidWithZero open Function Multiset OrderDual diff --git a/Mathlib/Data/Finset/MulAntidiagonal.lean b/Mathlib/Data/Finset/MulAntidiagonal.lean index 0b390aa491c5a6..fa4eb269136fa5 100644 --- a/Mathlib/Data/Finset/MulAntidiagonal.lean +++ b/Mathlib/Data/Finset/MulAntidiagonal.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yaël Dillies -/ -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Data.Set.MulAntidiagonal -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Data.Set.MulAntidiagonal +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Multiplication antidiagonal as a `Finset`. @@ -13,6 +15,8 @@ We construct the `Finset` of all pairs of an element in `s` and an element in `t` that multiply to `a`, given that `s` and `t` are well-ordered. -/ +@[expose] public section + namespace Set diff --git a/Mathlib/Data/Finset/NAry.lean b/Mathlib/Data/Finset/NAry.lean index 369a286b0bd98f..bb94ff35f69918 100644 --- a/Mathlib/Data/Finset/NAry.lean +++ b/Mathlib/Data/Finset/NAry.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Lattice.Prod -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Data.Finset.Lattice.Prod +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Set.Lattice.Image /-! # N-ary images of finsets @@ -22,6 +24,8 @@ We do not define `Finset.image₃` as its only purpose would be to prove propert and `Set.image2` already fulfills this task. -/ +@[expose] public section + open Function Set variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*} diff --git a/Mathlib/Data/Finset/NatAntidiagonal.lean b/Mathlib/Data/Finset/NatAntidiagonal.lean index 8282411550b744..a9bc329d17e3ee 100644 --- a/Mathlib/Data/Finset/NatAntidiagonal.lean +++ b/Mathlib/Data/Finset/NatAntidiagonal.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Order.Antidiag.Prod -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Data.Multiset.NatAntidiagonal +module + +public import Mathlib.Algebra.Order.Antidiag.Prod +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Data.Multiset.NatAntidiagonal /-! # Antidiagonals in ℕ × ℕ as finsets @@ -20,6 +22,8 @@ This refines files `Data.List.NatAntidiagonal` and `Data.Multiset.NatAntidiagona instance enabling `Finset.antidiagonal` on `Nat`. -/ +@[expose] public section + assert_not_exists Field open Function diff --git a/Mathlib/Data/Finset/NatDivisors.lean b/Mathlib/Data/Finset/NatDivisors.lean index 89131c0b95944e..45504b90550df4 100644 --- a/Mathlib/Data/Finset/NatDivisors.lean +++ b/Mathlib/Data/Finset/NatDivisors.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Yury Kudryashov -/ -import Mathlib.NumberTheory.Divisors -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.NumberTheory.Divisors +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # `Nat.divisors` as a multiplicative homomorpism @@ -13,6 +15,8 @@ The main definition of this file is `Nat.divisorsHom : ℕ →* Finset ℕ`, exhibiting `Nat.divisors` as a multiplicative homomorphism from `ℕ` to `Finset ℕ`. -/ +@[expose] public section + open Nat Finset open scoped Pointwise diff --git a/Mathlib/Data/Finset/NoncommProd.lean b/Mathlib/Data/Finset/NoncommProd.lean index bca005afa428ce..613b76118d6365 100644 --- a/Mathlib/Data/Finset/NoncommProd.lean +++ b/Mathlib/Data/Finset/NoncommProd.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Commute.Hom -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Commute.Hom +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Data.Fintype.Basic /-! # Products (respectively, sums) over a finset or a multiset. @@ -32,6 +34,8 @@ elements is commutative and using the `Finset.prod` versions of lemmas to prove version. -/ +@[expose] public section + variable {F ι α β γ : Type*} (f : α → β → β) (op : α → α → α) namespace Multiset diff --git a/Mathlib/Data/Finset/Option.lean b/Mathlib/Data/Finset/Option.lean index febde1817134c1..ff7204bf7f3a39 100644 --- a/Mathlib/Data/Finset/Option.lean +++ b/Mathlib/Data/Finset/Option.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Mario Carneiro, Sean Leather -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Union +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Union /-! # Finite sets in `Option α` @@ -24,6 +26,8 @@ Then we prove some basic lemmas about these definitions. finset, option -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/Finset/Order.lean b/Mathlib/Data/Finset/Order.lean index 68d4055ec8a08f..b17c0ed0f4be70 100644 --- a/Mathlib/Data/Finset/Order.lean +++ b/Mathlib/Data/Finset/Order.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau -/ -import Mathlib.Data.Finset.Defs -import Mathlib.Data.Multiset.ZeroCons -import Mathlib.Order.Directed +module + +public import Mathlib.Data.Finset.Defs +public import Mathlib.Data.Multiset.ZeroCons +public import Mathlib.Order.Directed /-! # Finsets of ordered types -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Data/Finset/PImage.lean b/Mathlib/Data/Finset/PImage.lean index 54b7e64db79b91..168e1da9280c43 100644 --- a/Mathlib/Data/Finset/PImage.lean +++ b/Mathlib/Data/Finset/PImage.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Finset.Option -import Mathlib.Data.PFun -import Mathlib.Data.Part +module + +public import Mathlib.Data.Finset.Option +public import Mathlib.Data.PFun +public import Mathlib.Data.Part /-! # Image of a `Finset α` under a partially defined function @@ -18,6 +20,8 @@ these definitions. finite set, image, partial function -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/Finset/Pairwise.lean b/Mathlib/Data/Finset/Pairwise.lean index 9779fb38776316..3bad2fc1055980 100644 --- a/Mathlib/Data/Finset/Pairwise.lean +++ b/Mathlib/Data/Finset/Pairwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Set.Pairwise.List +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Set.Pairwise.List /-! # Relations holding pairwise on finite sets @@ -14,6 +16,8 @@ as well as the interaction of `List.Pairwise Disjoint` and the condition of `Disjoint` on `List.toFinset`, in `Set` form. -/ +@[expose] public section + open Finset diff --git a/Mathlib/Data/Finset/Pi.lean b/Mathlib/Data/Finset/Pi.lean index 48f2fbf7b77e95..c842ae8dae9a0f 100644 --- a/Mathlib/Data/Finset/Pi.lean +++ b/Mathlib/Data/Finset/Pi.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Union -import Mathlib.Data.Multiset.Pi -import Mathlib.Logic.Function.DependsOn +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Union +public import Mathlib.Data.Multiset.Pi +public import Mathlib.Logic.Function.DependsOn /-! # The Cartesian product of finsets @@ -16,6 +18,8 @@ import Mathlib.Logic.Function.DependsOn * `Finset.pi`: Cartesian product of finsets indexed by a finset. -/ +@[expose] public section + open Function namespace Finset diff --git a/Mathlib/Data/Finset/PiInduction.lean b/Mathlib/Data/Finset/PiInduction.lean index 474564109a966c..9e41f2dddb9e41 100644 --- a/Mathlib/Data/Finset/PiInduction.lean +++ b/Mathlib/Data/Finset/PiInduction.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Finset.Max -import Mathlib.Data.Finset.Sigma -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Data.Fintype.Basic /-! # Induction principles for `∀ i, Finset (α i)` @@ -25,6 +27,8 @@ finite type. finite set, finite type, induction, function -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Finset/Piecewise.lean b/Mathlib/Data/Finset/Piecewise.lean index c24bf122cac1f7..82e2dc7ae14532 100644 --- a/Mathlib/Data/Finset/Piecewise.lean +++ b/Mathlib/Data/Finset/Piecewise.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Finset.BooleanAlgebra -import Mathlib.Data.Set.Piecewise -import Mathlib.Order.Interval.Set.Basic +module + +public import Mathlib.Data.Finset.BooleanAlgebra +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Order.Interval.Set.Basic /-! # Functions defined piecewise on a finset @@ -18,6 +20,8 @@ which is equal to `f` on `s` and `g` on the complement. Should we deduplicate this from `Set.piecewise`? -/ +@[expose] public section + open Function namespace Finset diff --git a/Mathlib/Data/Finset/Powerset.lean b/Mathlib/Data/Finset/Powerset.lean index ad35be8f01898d..e418b97f98cc01 100644 --- a/Mathlib/Data/Finset/Powerset.lean +++ b/Mathlib/Data/Finset/Powerset.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Lattice.Union -import Mathlib.Data.Multiset.Powerset -import Mathlib.Data.Set.Pairwise.Lattice +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Lattice.Union +public import Mathlib.Data.Multiset.Powerset +public import Mathlib.Data.Set.Pairwise.Lattice /-! # The powerset of a finset -/ +@[expose] public section + namespace Finset diff --git a/Mathlib/Data/Finset/Preimage.lean b/Mathlib/Data/Finset/Preimage.lean index 011a9e1808ca87..1787a1efd398cf 100644 --- a/Mathlib/Data/Finset/Preimage.lean +++ b/Mathlib/Data/Finset/Preimage.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Finset.Pi -import Mathlib.Data.Finset.Sigma -import Mathlib.Data.Finset.Sum -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Data.Finset.Pi +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Data.Finset.Sum +public import Mathlib.Data.Set.Finite.Basic /-! # Preimage of a `Finset` under an injective map. -/ +@[expose] public section + assert_not_exists Finset.sum open Set Function diff --git a/Mathlib/Data/Finset/Prod.lean b/Mathlib/Data/Finset/Prod.lean index 58c9b7afa42a9f..92f8dd04e744ef 100644 --- a/Mathlib/Data/Finset/Prod.lean +++ b/Mathlib/Data/Finset/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Oliver Nash -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Union +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Union /-! # Finsets in product types @@ -21,6 +23,8 @@ This file defines finset constructions on the product type `α × β`. Beware no `a, b ∈ s` and `a ≠ b`. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Multiset diff --git a/Mathlib/Data/Finset/Range.lean b/Mathlib/Data/Finset/Range.lean index 0f8b82df3eaf90..4a44d7a8373eda 100644 --- a/Mathlib/Data/Finset/Range.lean +++ b/Mathlib/Data/Finset/Range.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Insert -import Mathlib.Data.Multiset.Range -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Data.Finset.Insert +public import Mathlib.Data.Multiset.Range +public import Mathlib.Order.Interval.Set.Defs /-! # Finite sets made of a range of elements. @@ -24,6 +26,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/SDiff.lean b/Mathlib/Data/Finset/SDiff.lean index 71bcfcd5e89a48..151186db667f3e 100644 --- a/Mathlib/Data/Finset/SDiff.lean +++ b/Mathlib/Data/Finset/SDiff.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Insert -import Mathlib.Data.Finset.Lattice.Basic +module + +public import Mathlib.Data.Finset.Insert +public import Mathlib.Data.Finset.Lattice.Basic /-! # Difference of finite sets @@ -20,6 +22,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice IsOrderedMonoid diff --git a/Mathlib/Data/Finset/SMulAntidiagonal.lean b/Mathlib/Data/Finset/SMulAntidiagonal.lean index 503fb320309e4e..b2f1f8e0de1dc8 100644 --- a/Mathlib/Data/Finset/SMulAntidiagonal.lean +++ b/Mathlib/Data/Finset/SMulAntidiagonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Data.Set.SMulAntidiagonal +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Data.Set.SMulAntidiagonal /-! # Antidiagonal for scalar multiplication as a `Finset`. @@ -20,6 +22,8 @@ scalar-multiply to `a`. -/ +@[expose] public section + variable {G P : Type*} open Pointwise diff --git a/Mathlib/Data/Finset/Sigma.lean b/Mathlib/Data/Finset/Sigma.lean index 26561d2573967c..5b7d81d86ab6a2 100644 --- a/Mathlib/Data/Finset/Sigma.lean +++ b/Mathlib/Data/Finset/Sigma.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Set.Sigma -import Mathlib.Order.CompleteLattice.Finset +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Set.Sigma +public import Mathlib.Order.CompleteLattice.Finset /-! # Finite sets in a sigma type @@ -26,6 +28,8 @@ worth it, we must first refactor the functor library so that the `alternative` i is computable and universe-polymorphic. -/ +@[expose] public section + open Function Multiset diff --git a/Mathlib/Data/Finset/Slice.lean b/Mathlib/Data/Finset/Slice.lean index a702b508168a43..dde15f0a00d4a6 100644 --- a/Mathlib/Data/Finset/Slice.lean +++ b/Mathlib/Data/Finset/Slice.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Bhavik Mehta, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Alena Gusakov, Yaël Dillies -/ -import Mathlib.Data.Fintype.Powerset -import Mathlib.Order.Antichain -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Order.Antichain +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # `r`-sets and slice @@ -27,6 +29,8 @@ the set family made of its `r`-sets. `A # r` is notation for `A.slice r` in scope `finset_family`. -/ +@[expose] public section + open Finset Nat diff --git a/Mathlib/Data/Finset/Sort.lean b/Mathlib/Data/Finset/Sort.lean index c1b784b9e976ad..9bf61f10e6b36f 100644 --- a/Mathlib/Data/Finset/Sort.lean +++ b/Mathlib/Data/Finset/Sort.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Max -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Multiset.Sort -import Mathlib.Order.RelIso.Set +module + +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Multiset.Sort +public import Mathlib.Order.RelIso.Set /-! # Construct a sorted list from a finset. -/ +@[expose] public section + namespace Finset open Multiset Nat diff --git a/Mathlib/Data/Finset/Sum.lean b/Mathlib/Data/Finset/Sum.lean index 7a461441b2613e..f12f58796c0d64 100644 --- a/Mathlib/Data/Finset/Sum.lean +++ b/Mathlib/Data/Finset/Sum.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Fold -import Mathlib.Data.Multiset.Sum +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Finset.Fold +public import Mathlib.Data.Multiset.Sum /-! # Disjoint sum of finsets @@ -20,6 +22,8 @@ the `Finset.sum` operation which computes the additive sum. * `Finset.toRight`: Given a finset of elements `α ⊕ β`, extracts all the elements of the form `β`. -/ +@[expose] public section + open Function Multiset Sum diff --git a/Mathlib/Data/Finset/Sups.lean b/Mathlib/Data/Finset/Sups.lean index c3ff3c825992b2..07c3b12daa64fa 100644 --- a/Mathlib/Data/Finset/Sups.lean +++ b/Mathlib/Data/Finset/Sups.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.NAry -import Mathlib.Data.Finset.Slice -import Mathlib.Data.Set.Sups +module + +public import Mathlib.Data.Finset.NAry +public import Mathlib.Data.Finset.Slice +public import Mathlib.Data.Set.Sups /-! # Set family operations @@ -35,6 +37,8 @@ We define the following notation in scope `FinsetFamily`: [B. Bollobás, *Combinatorics*][bollobas1986] -/ +@[expose] public section + open Function open SetFamily diff --git a/Mathlib/Data/Finset/Sym.lean b/Mathlib/Data/Finset/Sym.lean index b3b700483b240a..7f10ab98b477bf 100644 --- a/Mathlib/Data/Finset/Sym.lean +++ b/Mathlib/Data/Finset/Sym.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Fintype.Vector -import Mathlib.Data.Multiset.Sym +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Fintype.Vector +public import Mathlib.Data.Multiset.Sym /-! # Symmetric powers of a finset @@ -26,6 +28,8 @@ This file defines the symmetric powers of a finset as `Finset (Sym α n)` and `F `Finset.sym2`. -/ +@[expose] public section + namespace Finset variable {α β : Type*} diff --git a/Mathlib/Data/Finset/SymmDiff.lean b/Mathlib/Data/Finset/SymmDiff.lean index 977f6584f83616..42a4b3a393fb86 100644 --- a/Mathlib/Data/Finset/SymmDiff.lean +++ b/Mathlib/Data/Finset/SymmDiff.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ -import Mathlib.Data.Finset.Image -import Mathlib.Data.Set.SymmDiff +module + +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Set.SymmDiff /-! # Symmetric difference of finite sets @@ -17,6 +19,8 @@ finite sets, finset -/ +@[expose] public section + -- Assert that we define `Finset` without the material on `List.sublists`. -- Note that we cannot use `List.sublists` itself as that is defined very early. assert_not_exists List.sublistsLen Multiset.powerset CompleteLattice Monoid diff --git a/Mathlib/Data/Finset/Union.lean b/Mathlib/Data/Finset/Union.lean index 217c1f1e6aa971..cc29f65f0365ff 100644 --- a/Mathlib/Data/Finset/Union.lean +++ b/Mathlib/Data/Finset/Union.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Fold -import Mathlib.Data.Multiset.Bind -import Mathlib.Order.SetNotation +module + +public import Mathlib.Data.Finset.Fold +public import Mathlib.Data.Multiset.Bind +public import Mathlib.Order.SetNotation /-! # Unions of finite sets @@ -26,6 +28,8 @@ This file defines the union of a family `t : α → Finset β` of finsets bounde Remove `Finset.biUnion` in favour of `Finset.sup`. -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction variable {α β γ : Type*} {s s₁ s₂ : Finset α} {t t₁ t₂ : α → Finset β} diff --git a/Mathlib/Data/Finset/Update.lean b/Mathlib/Data/Finset/Update.lean index 392b995578e6ea..a840f9b78bea9e 100644 --- a/Mathlib/Data/Finset/Update.lean +++ b/Mathlib/Data/Finset/Update.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Data.Finset.Pi -import Mathlib.Logic.Function.DependsOn +module + +public import Mathlib.Data.Finset.Pi +public import Mathlib.Logic.Function.DependsOn /-! # Update a function on a set of values @@ -15,6 +17,8 @@ This file defines `Function.updateFinset`, the operation that updates a function This is a very specific function used for `MeasureTheory.marginal`, and possibly not that useful for other purposes. -/ + +@[expose] public section variable {ι : Sort _} {π : ι → Sort _} {x : ∀ i, π i} [DecidableEq ι] namespace Function diff --git a/Mathlib/Data/Finsupp/AList.lean b/Mathlib/Data/Finsupp/AList.lean index 6f72f7a78aa38f..a62ceb7745bfcf 100644 --- a/Mathlib/Data/Finsupp/AList.lean +++ b/Mathlib/Data/Finsupp/AList.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.List.AList +module + +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.List.AList /-! # Connections between `Finsupp` and `AList` @@ -17,6 +19,8 @@ import Mathlib.Data.List.AList -/ +@[expose] public section + namespace Finsupp diff --git a/Mathlib/Data/Finsupp/Antidiagonal.lean b/Mathlib/Data/Finsupp/Antidiagonal.lean index d3cc6f813d245a..5d8ca5489249f9 100644 --- a/Mathlib/Data/Finsupp/Antidiagonal.lean +++ b/Mathlib/Data/Finsupp/Antidiagonal.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.Finset.NatAntidiagonal -import Mathlib.Data.Finsupp.Multiset -import Mathlib.Data.Multiset.Antidiagonal +module + +public import Mathlib.Data.Finset.NatAntidiagonal +public import Mathlib.Data.Finsupp.Multiset +public import Mathlib.Data.Multiset.Antidiagonal /-! # The `Finsupp` counterpart of `Multiset.antidiagonal`. @@ -14,6 +16,8 @@ The antidiagonal of `s : α →₀ ℕ` consists of all pairs `(t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ)` such that `t₁ + t₂ = s`. -/ +@[expose] public section + namespace Finsupp open Finset diff --git a/Mathlib/Data/Finsupp/Basic.lean b/Mathlib/Data/Finsupp/Basic.lean index 2b3fca83b352e0..5c24b9c330dd6d 100644 --- a/Mathlib/Data/Finsupp/Basic.lean +++ b/Mathlib/Data/Finsupp/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.BigOperators.Finsupp.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Preimage -import Mathlib.Algebra.Group.Indicator -import Mathlib.Data.Rat.BigOperators +module + +public import Mathlib.Algebra.BigOperators.Finsupp.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Preimage +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Data.Rat.BigOperators /-! # Miscellaneous definitions, lemmas, and constructions using finsupp @@ -33,12 +35,14 @@ This file is a `noncomputable theory` and uses classical logic throughout. -/ +@[expose] public section + noncomputable section open Finset Function -variable {α β γ ι M M' N P G H R S : Type*} +variable {α β γ ι M N P G H R S : Type*} namespace Finsupp @@ -112,94 +116,9 @@ end Finsupp section MapRange namespace Finsupp - -section Equiv - -variable [Zero M] [Zero N] [Zero P] - -/-- `Finsupp.mapRange` as an equiv. -/ -@[simps apply] -def mapRange.equiv (f : M ≃ N) (hf : f 0 = 0) (hf' : f.symm 0 = 0) : (α →₀ M) ≃ (α →₀ N) where - toFun := (mapRange f hf : (α →₀ M) → α →₀ N) - invFun := (mapRange f.symm hf' : (α →₀ N) → α →₀ M) - left_inv x := by - rw [← mapRange_comp] <;> simp_rw [Equiv.symm_comp_self] - · exact mapRange_id _ - · rfl - right_inv x := by - rw [← mapRange_comp] <;> simp_rw [Equiv.self_comp_symm] - · exact mapRange_id _ - · rfl - -@[simp] -theorem mapRange.equiv_refl : mapRange.equiv (Equiv.refl M) rfl rfl = Equiv.refl (α →₀ M) := - Equiv.ext mapRange_id - -theorem mapRange.equiv_trans (f : M ≃ N) (hf : f 0 = 0) (hf') (f₂ : N ≃ P) (hf₂ : f₂ 0 = 0) (hf₂') : - (mapRange.equiv (f.trans f₂) (by rw [Equiv.trans_apply, hf, hf₂]) - (by rw [Equiv.symm_trans_apply, hf₂', hf']) : - (α →₀ _) ≃ _) = - (mapRange.equiv f hf hf').trans (mapRange.equiv f₂ hf₂ hf₂') := - Equiv.ext <| mapRange_comp f₂ hf₂ f hf ((congrArg f₂ hf).trans hf₂) - -@[simp] -theorem mapRange.equiv_symm (f : M ≃ N) (hf hf') : - ((mapRange.equiv f hf hf').symm : (α →₀ _) ≃ _) = mapRange.equiv f.symm hf' hf := - Equiv.ext fun _ => rfl - -end Equiv - -section ZeroHom - -variable [Zero M] [Zero N] [Zero P] - -/-- Composition with a fixed zero-preserving homomorphism is itself a zero-preserving homomorphism -on functions. -/ -@[simps] -def mapRange.zeroHom (f : ZeroHom M N) : ZeroHom (α →₀ M) (α →₀ N) where - toFun := (mapRange f f.map_zero : (α →₀ M) → α →₀ N) - map_zero' := mapRange_zero - -@[simp] -theorem mapRange.zeroHom_id : mapRange.zeroHom (ZeroHom.id M) = ZeroHom.id (α →₀ M) := - ZeroHom.ext mapRange_id - -theorem mapRange.zeroHom_comp (f : ZeroHom N P) (f₂ : ZeroHom M N) : - (mapRange.zeroHom (f.comp f₂) : ZeroHom (α →₀ _) _) = - (mapRange.zeroHom f).comp (mapRange.zeroHom f₂) := - ZeroHom.ext <| mapRange_comp f (map_zero f) f₂ (map_zero f₂) (by simp only [comp_apply, map_zero]) - -end ZeroHom - -section AddMonoidHom - -variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] +variable [AddCommMonoid M] [AddCommMonoid N] variable {F : Type*} [FunLike F M N] [AddMonoidHomClass F M N] -/-- Composition with a fixed additive homomorphism is itself an additive homomorphism on functions. --/ -@[simps] -def mapRange.addMonoidHom (f : M →+ N) : (α →₀ M) →+ α →₀ N where - toFun := (mapRange f f.map_zero : (α →₀ M) → α →₀ N) - map_zero' := mapRange_zero - map_add' := mapRange_add f.map_add - -@[simp] -theorem mapRange.addMonoidHom_id : - mapRange.addMonoidHom (AddMonoidHom.id M) = AddMonoidHom.id (α →₀ M) := - AddMonoidHom.ext mapRange_id - -theorem mapRange.addMonoidHom_comp (f : N →+ P) (f₂ : M →+ N) : - (mapRange.addMonoidHom (f.comp f₂) : (α →₀ _) →+ _) = - (mapRange.addMonoidHom f).comp (mapRange.addMonoidHom f₂) := - AddMonoidHom.ext <| - mapRange_comp f (map_zero f) f₂ (map_zero f₂) (by simp only [comp_apply, map_zero]) - -@[simp] -theorem mapRange.addMonoidHom_toZeroHom (f : M →+ N) : - (mapRange.addMonoidHom f).toZeroHom = (mapRange.zeroHom f.toZeroHom : ZeroHom (α →₀ _) _) := - ZeroHom.ext fun _ => rfl - theorem mapRange_multiset_sum (f : F) (m : Multiset (α →₀ M)) : mapRange f (map_zero f) m.sum = (m.map fun x => mapRange f (map_zero f) x).sum := (mapRange.addMonoidHom (f : M →+ N) : (α →₀ _) →+ _).map_multiset_sum _ @@ -208,49 +127,6 @@ theorem mapRange_finset_sum (f : F) (s : Finset ι) (g : ι → α →₀ M) : mapRange f (map_zero f) (∑ x ∈ s, g x) = ∑ x ∈ s, mapRange f (map_zero f) (g x) := map_sum (mapRange.addMonoidHom (f : M →+ N)) _ _ -/-- `Finsupp.mapRange.AddMonoidHom` as an equiv. -/ -@[simps apply] -def mapRange.addEquiv (f : M ≃+ N) : (α →₀ M) ≃+ (α →₀ N) := - { mapRange.addMonoidHom f.toAddMonoidHom with - toFun := (mapRange f f.map_zero : (α →₀ M) → α →₀ N) - invFun := (mapRange f.symm f.symm.map_zero : (α →₀ N) → α →₀ M) - left_inv := fun x => by - rw [← mapRange_comp] <;> simp_rw [AddEquiv.symm_comp_self] - · exact mapRange_id _ - · rfl - right_inv := fun x => by - rw [← mapRange_comp] <;> simp_rw [AddEquiv.self_comp_symm] - · exact mapRange_id _ - · rfl } - -@[simp] -theorem mapRange.addEquiv_refl : mapRange.addEquiv (AddEquiv.refl M) = AddEquiv.refl (α →₀ M) := - AddEquiv.ext mapRange_id - -theorem mapRange.addEquiv_trans (f : M ≃+ N) (f₂ : N ≃+ P) : - (mapRange.addEquiv (f.trans f₂) : (α →₀ M) ≃+ (α →₀ P)) = - (mapRange.addEquiv f).trans (mapRange.addEquiv f₂) := - AddEquiv.ext (mapRange_comp _ f₂.map_zero _ f.map_zero (by simp)) - -@[simp] -theorem mapRange.addEquiv_symm (f : M ≃+ N) : - ((mapRange.addEquiv f).symm : (α →₀ _) ≃+ _) = mapRange.addEquiv f.symm := - AddEquiv.ext fun _ => rfl - -@[simp] -theorem mapRange.addEquiv_toAddMonoidHom (f : M ≃+ N) : - ((mapRange.addEquiv f : (α →₀ _) ≃+ _) : _ →+ _) = - (mapRange.addMonoidHom f.toAddMonoidHom : (α →₀ _) →+ _) := - AddMonoidHom.ext fun _ => rfl - -@[simp] -theorem mapRange.addEquiv_toEquiv (f : M ≃+ N) : - ↑(mapRange.addEquiv f : (α →₀ _) ≃+ _) = - (mapRange.equiv (f : M ≃ N) f.map_zero f.symm.map_zero : (α →₀ _) ≃ _) := - Equiv.ext fun _ => rfl - -end AddMonoidHom - end Finsupp end MapRange diff --git a/Mathlib/Data/Finsupp/BigOperators.lean b/Mathlib/Data/Finsupp/BigOperators.lean index 218703b6f549f9..c64044b500de0c 100644 --- a/Mathlib/Data/Finsupp/BigOperators.lean +++ b/Mathlib/Data/Finsupp/BigOperators.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Data.Finset.Pairwise +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Data.Finset.Pairwise /-! @@ -31,6 +33,8 @@ it is a member of the support of a member of the collection: -/ +@[expose] public section + variable {ι M : Type*} [DecidableEq ι] diff --git a/Mathlib/Data/Finsupp/Defs.lean b/Mathlib/Data/Finsupp/Defs.lean index 95333ed9a0bab8..67762d286cf92b 100644 --- a/Mathlib/Data/Finsupp/Defs.lean +++ b/Mathlib/Data/Finsupp/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.Notation.Support -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Data.Set.Finite.Basic /-! # Type of functions with finite support @@ -52,18 +54,15 @@ This file adds `α →₀ M` as a global notation for `Finsupp α M`. We also use the following convention for `Type*` variables in this file -* `α`, `β`, `γ`: types with no additional structure that appear as the first argument to `Finsupp` +* `α`, `β`: types with no additional structure that appear as the first argument to `Finsupp` somewhere in the statement; * `ι` : an auxiliary index type; -* `M`, `M'`, `N`, `P`: types with `Zero` or `(Add)(Comm)Monoid` structure; `M` is also used - for a (semi)module over a (semi)ring. +* `M`, `N`, `O`: types with `Zero` or `(Add)(Comm)Monoid` structure; * `G`, `H`: groups (commutative or not, multiplicative or additive); -* `R`, `S`: (semi)rings. - ## Implementation notes This file is a `noncomputable theory` and uses classical logic throughout. @@ -74,13 +73,15 @@ This file is a `noncomputable theory` and uses classical logic throughout. -/ +@[expose] public section + assert_not_exists CompleteLattice Monoid noncomputable section open Finset Function -variable {α β γ ι M M' N P G H R S : Type*} +variable {α β ι M N O G H : Type*} /-- `Finsupp α M`, denoted `α →₀ M`, is the type of functions `f : α → M` such that `f x = 0` for all but finitely many `x`. -/ @@ -279,7 +280,7 @@ end OfSupportFinite section MapRange -variable [Zero M] [Zero N] [Zero P] +variable [Zero M] [Zero N] [Zero O] /-- The composition of `f : M → N` and `g : α →₀ M` is `mapRange f hf g : α →₀ N`, which is well-defined when `f 0 = 0`. @@ -311,12 +312,12 @@ theorem mapRange_zero {f : M → N} {hf : f 0 = 0} : mapRange f hf (0 : α → theorem mapRange_id (g : α →₀ M) : mapRange id rfl g = g := ext fun _ => rfl -theorem mapRange_comp (f : N → P) (hf : f 0 = 0) (f₂ : M → N) (hf₂ : f₂ 0 = 0) (h : (f ∘ f₂) 0 = 0) +theorem mapRange_comp (f : N → O) (hf : f 0 = 0) (f₂ : M → N) (hf₂ : f₂ 0 = 0) (h : (f ∘ f₂) 0 = 0) (g : α →₀ M) : mapRange (f ∘ f₂) h g = mapRange f hf (mapRange f₂ hf₂ g) := ext fun _ => rfl @[simp] -lemma mapRange_mapRange (e₁ : N → P) (e₂ : M → N) (he₁ he₂) (f : α →₀ M) : +lemma mapRange_mapRange (e₁ : N → O) (e₂ : M → N) (he₁ he₂) (f : α →₀ M) : mapRange e₁ he₁ (mapRange e₂ he₂ f) = mapRange (e₁ ∘ e₂) (by simp [*]) f := ext fun _ ↦ rfl theorem support_mapRange {f : M → N} {hf : f 0 = 0} {g : α →₀ M} : @@ -359,6 +360,28 @@ lemma mapRange_surjective (e : M → N) (he₀ : e 0 = 0) (he : Surjective e) : end MapRange +section Equiv +variable [Zero M] [Zero N] [Zero O] + +/-- `Finsupp.mapRange` as an equiv. -/ +@[simps apply] +def mapRange.equiv (e : M ≃ N) (hf : e 0 = 0) : (ι →₀ M) ≃ (ι →₀ N) where + toFun := mapRange e hf + invFun := mapRange e.symm <| by simp [← hf] + left_inv x := by ext; simp + right_inv x := by ext; simp + +@[simp] lemma mapRange.equiv_refl : mapRange.equiv (.refl M) rfl = .refl (ι →₀ M) := by ext; simp + +lemma mapRange.equiv_trans (e : M ≃ N) (hf) (f₂ : N ≃ O) (hf₂) : + mapRange.equiv (ι := ι) (e.trans f₂) (by rw [Equiv.trans_apply, hf, hf₂]) = + (mapRange.equiv e hf).trans (mapRange.equiv f₂ hf₂) := by ext; simp + +@[simp] lemma mapRange.equiv_symm (e : M ≃ N) (hf) : + (mapRange.equiv (ι := ι) e hf).symm = mapRange.equiv e.symm (by simp [← hf]) := rfl + +end Equiv + /-! ### Declarations about `embDomain` -/ @@ -438,12 +461,12 @@ end EmbDomain section ZipWith -variable [Zero M] [Zero N] [Zero P] +variable [Zero M] [Zero N] [Zero O] -/-- Given finitely supported functions `g₁ : α →₀ M` and `g₂ : α →₀ N` and function `f : M → N → P`, -`Finsupp.zipWith f hf g₁ g₂` is the finitely supported function `α →₀ P` satisfying +/-- Given finitely supported functions `g₁ : α →₀ M` and `g₂ : α →₀ N` and function `f : M → N → O`, +`Finsupp.zipWith f hf g₁ g₂` is the finitely supported function `α →₀ O` satisfying `zipWith f hf g₁ g₂ a = f (g₁ a) (g₂ a)`, which is well-defined when `f 0 0 = 0`. -/ -def zipWith (f : M → N → P) (hf : f 0 0 = 0) (g₁ : α →₀ M) (g₂ : α →₀ N) : α →₀ P := +def zipWith (f : M → N → O) (hf : f 0 0 = 0) (g₁ : α →₀ M) (g₂ : α →₀ N) : α →₀ O := onFinset (haveI := Classical.decEq α; g₁.support ∪ g₂.support) (fun a => f (g₁ a) (g₂ a)) @@ -453,11 +476,11 @@ def zipWith (f : M → N → P) (hf : f 0 0 = 0) (g₁ : α →₀ M) (g₂ : α rintro ⟨h₁, h₂⟩; rw [h₁, h₂] at H; exact H hf @[simp] -theorem zipWith_apply {f : M → N → P} {hf : f 0 0 = 0} {g₁ : α →₀ M} {g₂ : α →₀ N} {a : α} : +theorem zipWith_apply {f : M → N → O} {hf : f 0 0 = 0} {g₁ : α →₀ M} {g₂ : α →₀ N} {a : α} : zipWith f hf g₁ g₂ a = f (g₁ a) (g₂ a) := rfl -theorem support_zipWith [D : DecidableEq α] {f : M → N → P} {hf : f 0 0 = 0} {g₁ : α →₀ M} +theorem support_zipWith [D : DecidableEq α] {f : M → N → O} {hf : f 0 0 = 0} {g₁ : α →₀ M} {g₂ : α →₀ N} : (zipWith f hf g₁ g₂).support ⊆ g₁.support ∪ g₂.support := by convert support_onFinset_subset diff --git a/Mathlib/Data/Finsupp/Encodable.lean b/Mathlib/Data/Finsupp/Encodable.lean index 2d0d433cbf6aa7..c96077f77ca991 100644 --- a/Mathlib/Data/Finsupp/Encodable.lean +++ b/Mathlib/Data/Finsupp/Encodable.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Finsupp.ToDFinsupp -import Mathlib.Data.DFinsupp.Encodable +module + +public import Mathlib.Data.Finsupp.ToDFinsupp +public import Mathlib.Data.DFinsupp.Encodable /-! # `Encodable` and `Countable` instances for `α →₀ β` In this file we provide instances for `Encodable (α →₀ β)` and `Countable (α →₀ β)`. -/ +@[expose] public section + instance {α β : Type*} [Encodable α] [Encodable β] [Zero β] [∀ x : β, Decidable (x ≠ 0)] : Encodable (α →₀ β) := letI : DecidableEq α := Encodable.decidableEqOfEncodable _ diff --git a/Mathlib/Data/Finsupp/Ext.lean b/Mathlib/Data/Finsupp/Ext.lean index 449367eb48c855..33ec921bf3fb36 100644 --- a/Mathlib/Data/Finsupp/Ext.lean +++ b/Mathlib/Data/Finsupp/Ext.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Algebra.Group.Submonoid.Basic -import Mathlib.Algebra.Group.TypeTags.Hom +module + +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Algebra.Group.Submonoid.Basic +public import Mathlib.Algebra.Group.TypeTags.Hom /-! # Extensionality for maps on `Finsupp` @@ -19,6 +21,8 @@ These have been moved to their own file to avoid depending on submonoids when de * `Finsupp.addHom_ext`: additive homomorphisms that are equal on each `single` are equal everywhere -/ +@[expose] public section + variable {α M N : Type*} namespace Finsupp diff --git a/Mathlib/Data/Finsupp/Fin.lean b/Mathlib/Data/Finsupp/Fin.lean index 027350c69ca700..fb4224e0123f3b 100644 --- a/Mathlib/Data/Finsupp/Fin.lean +++ b/Mathlib/Data/Finsupp/Fin.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Ivan Sadofschi Costa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ivan Sadofschi Costa -/ -import Mathlib.Data.Finsupp.Single +module + +public import Mathlib.Data.Finsupp.Single /-! # `cons` and `tail` for maps `Fin n →₀ M` @@ -17,6 +19,8 @@ In this context, we prove some usual properties of `tail` and `cons`, analogous `Data.Fin.Tuple.Basic`. -/ +@[expose] public section + open Function noncomputable section diff --git a/Mathlib/Data/Finsupp/Fintype.lean b/Mathlib/Data/Finsupp/Fintype.lean index 1af258ead54dd8..1ea187a1500ae7 100644 --- a/Mathlib/Data/Finsupp/Fintype.lean +++ b/Mathlib/Data/Finsupp/Fintype.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best -/ -import Mathlib.Data.Finsupp.Single -import Mathlib.Data.Fintype.BigOperators +module + +public import Mathlib.Data.Finsupp.Single +public import Mathlib.Data.Fintype.BigOperators /-! @@ -14,6 +16,8 @@ Some lemmas on the combination of `Finsupp`, `Fintype` and `Infinite`. -/ +@[expose] public section + variable {ι α : Type*} [DecidableEq ι] [Fintype ι] [Zero α] [Fintype α] noncomputable instance Finsupp.fintype : Fintype (ι →₀ α) := diff --git a/Mathlib/Data/Finsupp/Indicator.lean b/Mathlib/Data/Finsupp/Indicator.lean index 61ce2a7abdfb61..f7a82314220667 100644 --- a/Mathlib/Data/Finsupp/Indicator.lean +++ b/Mathlib/Data/Finsupp/Indicator.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finsupp.Single +module + +public import Mathlib.Data.Finsupp.Single /-! # Building finitely supported functions off finsets @@ -15,6 +17,8 @@ This file defines `Finsupp.indicator` to help create finsupps from finsets. * `Finsupp.indicator`: Turns a map from a `Finset` into a `Finsupp` from the entire type. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Data/Finsupp/Interval.lean b/Mathlib/Data/Finsupp/Interval.lean index 81ad1732365511..7670830afe652a 100644 --- a/Mathlib/Data/Finsupp/Interval.lean +++ b/Mathlib/Data/Finsupp/Interval.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Finsupp -import Mathlib.Data.Finsupp.Order -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Data.Finset.Finsupp +public import Mathlib.Data.Finsupp.Order +public import Mathlib.Order.Interval.Finset.Basic /-! # Finite intervals of finitely supported functions @@ -23,6 +25,8 @@ Both these definitions use the fact that `0 = {0}` to ensure that the resulting supported. -/ +@[expose] public section + noncomputable section open Finset Finsupp Function Pointwise diff --git a/Mathlib/Data/Finsupp/Lex.lean b/Mathlib/Data/Finsupp/Lex.lean index 6ee249faddedaa..5638339c541b2f 100644 --- a/Mathlib/Data/Finsupp/Lex.lean +++ b/Mathlib/Data/Finsupp/Lex.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Data.Finsupp.Order -import Mathlib.Data.DFinsupp.Lex -import Mathlib.Data.Finsupp.ToDFinsupp +module + +public import Mathlib.Data.Finsupp.Order +public import Mathlib.Data.DFinsupp.Lex +public import Mathlib.Data.Finsupp.ToDFinsupp /-! # Lexicographic order on finitely supported functions @@ -13,6 +15,8 @@ import Mathlib.Data.Finsupp.ToDFinsupp This file defines the lexicographic order on `Finsupp`. -/ +@[expose] public section + variable {α N : Type*} @@ -80,8 +84,7 @@ instance Lex.partialOrder [PartialOrder N] : PartialOrder (Lex (α →₀ N)) wh /-- The linear order on `Finsupp`s obtained by the lexicographic ordering. -/ instance Lex.linearOrder [LinearOrder N] : LinearOrder (Lex (α →₀ N)) where - lt := (· < ·) - le := (· ≤ ·) + __ := Lex.partialOrder __ := LinearOrder.lift' (toLex ∘ toDFinsupp ∘ ofLex) finsuppEquivDFinsupp.injective theorem Lex.single_strictAnti : StrictAnti fun (a : α) ↦ toLex (single a 1) := by diff --git a/Mathlib/Data/Finsupp/MonomialOrder.lean b/Mathlib/Data/Finsupp/MonomialOrder.lean index f299b8c733e30d..4ff051b53b285d 100644 --- a/Mathlib/Data/Finsupp/MonomialOrder.lean +++ b/Mathlib/Data/Finsupp/MonomialOrder.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Data.Finsupp.Lex -import Mathlib.Data.Finsupp.WellFounded -import Mathlib.Data.List.TFAE +module + +public import Mathlib.Data.Finsupp.Lex +public import Mathlib.Data.Finsupp.WellFounded +public import Mathlib.Data.List.TFAE /-! # Monomial orders @@ -53,6 +55,8 @@ it is customary to order them using the opposite order : `MvPolynomial.X 0 > MvP -/ +@[expose] public section + /-- Monomial orders : equivalence of `σ →₀ ℕ` with a well-ordered type -/ structure MonomialOrder (σ : Type*) where /-- The synonym type -/ diff --git a/Mathlib/Data/Finsupp/MonomialOrder/DegLex.lean b/Mathlib/Data/Finsupp/MonomialOrder/DegLex.lean index f931092e4794aa..3c1a4c30e990bd 100644 --- a/Mathlib/Data/Finsupp/MonomialOrder/DegLex.lean +++ b/Mathlib/Data/Finsupp/MonomialOrder/DegLex.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.Group.TransferInstance -import Mathlib.Data.Finsupp.MonomialOrder -import Mathlib.Data.Finsupp.Weight +public import Mathlib.Algebra.Group.TransferInstance +public import Mathlib.Data.Finsupp.MonomialOrder +public import Mathlib.Data.Finsupp.Weight /-! Homogeneous lexicographic monomial ordering @@ -24,6 +25,8 @@ and `MonomialOrder.degLex_lt_iff` rewrite the ordering as comparisons in the typ -/ +@[expose] public section + /-- A type synonym to equip a type with its lexicographic order sorted by degrees. -/ def DegLex (α : Type*) := α diff --git a/Mathlib/Data/Finsupp/Multiset.lean b/Mathlib/Data/Finsupp/Multiset.lean index ab820d1aed3aef..a4803b2cae5849 100644 --- a/Mathlib/Data/Finsupp/Multiset.lean +++ b/Mathlib/Data/Finsupp/Multiset.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Order.Group.Finset -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Sym.Basic -import Mathlib.Order.Preorder.Finsupp +module + +public import Mathlib.Algebra.Order.Group.Finset +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Sym.Basic +public import Mathlib.Order.Preorder.Finsupp /-! # Equivalence between `Multiset` and `ℕ`-valued finitely supported functions @@ -17,6 +19,8 @@ promoted to an order isomorphism). -/ +@[expose] public section + open Finset variable {α β ι : Type*} diff --git a/Mathlib/Data/Finsupp/NeLocus.lean b/Mathlib/Data/Finsupp/NeLocus.lean index fd238dd1885911..d999d1f9c1854c 100644 --- a/Mathlib/Data/Finsupp/NeLocus.lean +++ b/Mathlib/Data/Finsupp/NeLocus.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Group.Finsupp +module + +public import Mathlib.Algebra.Group.Finsupp /-! # Locus of unequal values of finitely supported functions @@ -19,6 +21,8 @@ In the case in which `N` is an additive group, `Finsupp.neLocus f g` coincides w `Finsupp.support (f - g)`. -/ +@[expose] public section + variable {α M N P : Type*} diff --git a/Mathlib/Data/Finsupp/Notation.lean b/Mathlib/Data/Finsupp/Notation.lean index 6490a5a5890ffc..704f4850297ef5 100644 --- a/Mathlib/Data/Finsupp/Notation.lean +++ b/Mathlib/Data/Finsupp/Notation.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Finsupp.Single +module + +public import Mathlib.Data.Finsupp.Single /-! # Notation for `Finsupp` @@ -13,13 +15,15 @@ This file provides `fun₀ | 3 => a | 7 => b` notation for `Finsupp`, which desu `singleton`. -/ +@[expose] public section + namespace Finsupp open Lean Parser Term -- A variant of `Lean.Parser.Term.matchAlts` with less line wrapping. @[nolint docBlame] -- we do not want any doc hover on this notation. -def fun₀.matchAlts : Parser := +meta def fun₀.matchAlts : Parser := leading_parser withPosition <| ppRealGroup <| many1Indent (ppSpace >> ppGroup matchAlt) /-- `fun₀ | i => a` is notation for `Finsupp.single i a`, and with multiple match arms, @@ -27,7 +31,7 @@ def fun₀.matchAlts : Parser := As a result, if multiple match arms coincide, the last one takes precedence. -/ @[term_parser] -def fun₀ := leading_parser:maxPrec +meta def fun₀ := leading_parser:maxPrec -- Prefer `fun₀` over `λ₀` when pretty printing. ppAllowUngrouped >> unicodeSymbol "λ₀" "fun₀" (preserveForPP := true) >> fun₀.matchAlts @@ -40,13 +44,13 @@ scoped syntax:lead (name := stxUpdate₀) "update₀" term:arg term:arg term:arg /-- `Finsupp` elaborator for `single₀`. -/ @[term_elab stxSingle₀] -def elabSingle₀ : Elab.Term.TermElab +meta def elabSingle₀ : Elab.Term.TermElab | `(term| single₀ $i $x) => fun ty => do Elab.Term.elabTerm (← `(Finsupp.single $i $x)) ty | _ => fun _ => Elab.throwUnsupportedSyntax /-- `Finsupp` elaborator for `update₀`. -/ @[term_elab stxUpdate₀] -def elabUpdate₀ : Elab.Term.TermElab +meta def elabUpdate₀ : Elab.Term.TermElab | `(term| update₀ $f $i $x) => fun ty => do Elab.Term.elabTerm (← `(Finsupp.update $f $i $x)) ty | _ => fun _ => Elab.throwUnsupportedSyntax @@ -70,13 +74,13 @@ end Internal /-- Unexpander for the `fun₀ | i => x` notation. -/ @[app_unexpander Finsupp.single] -def singleUnexpander : Lean.PrettyPrinter.Unexpander +meta def singleUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $pat $val) => `(fun₀ | $pat => $val) | _ => throw () /-- Unexpander for the `fun₀ | i => x` notation. -/ @[app_unexpander Finsupp.update] -def updateUnexpander : Lean.PrettyPrinter.Unexpander +meta def updateUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $f $pat $val) => match f with | `(fun₀ $xs:matchAlt*) => `(fun₀ $xs:matchAlt* | $pat => $val) | _ => throw () diff --git a/Mathlib/Data/Finsupp/Option.lean b/Mathlib/Data/Finsupp/Option.lean index 698d594fbe1f53..0be9bdba57e42f 100644 --- a/Mathlib/Data/Finsupp/Option.lean +++ b/Mathlib/Data/Finsupp/Option.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Finsupp.Basic -import Mathlib.Algebra.Module.Defs +module + +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Algebra.Module.Defs /-! # Declarations about finitely supported functions whose support is an `Option` type p @@ -20,6 +22,8 @@ This file is a `noncomputable theory` and uses classical logic throughout. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Data/Finsupp/Order.lean b/Mathlib/Data/Finsupp/Order.lean index 1c91ff7bf30a27..5c36d802568bfc 100644 --- a/Mathlib/Data/Finsupp/Order.lean +++ b/Mathlib/Data/Finsupp/Order.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Aaron Anderson -/ -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Algebra.Order.Pi -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.Order.Preorder.Finsupp +module + +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Finsupp.SMulWithZero +public import Mathlib.Order.Preorder.Finsupp /-! # Pointwise order on finitely supported functions @@ -22,6 +24,8 @@ This file lifts order structures on `α` to `ι →₀ α`. functions. -/ +@[expose] public section + noncomputable section open Finset diff --git a/Mathlib/Data/Finsupp/PWO.lean b/Mathlib/Data/Finsupp/PWO.lean index f72253cb861c98..9114a2bde51c31 100644 --- a/Mathlib/Data/Finsupp/PWO.lean +++ b/Mathlib/Data/Finsupp/PWO.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best -/ -import Mathlib.Order.Preorder.Finsupp -import Mathlib.Order.WellFoundedSet +module + +public import Mathlib.Order.Preorder.Finsupp +public import Mathlib.Order.WellFoundedSet /-! # Partial well ordering on finsupps @@ -23,6 +25,8 @@ It is in a separate file for now so as to not add imports to the file `Order.Wel Dickson, order, partial well order -/ +@[expose] public section + /-- A version of **Dickson's lemma** any subset of functions `σ →₀ α` is partially well ordered, when `σ` is `Finite` and `α` is a linear well order. diff --git a/Mathlib/Data/Finsupp/Pointwise.lean b/Mathlib/Data/Finsupp/Pointwise.lean index 6d9616eb9de1ab..b442d98d293def 100644 --- a/Mathlib/Data/Finsupp/Pointwise.lean +++ b/Mathlib/Data/Finsupp/Pointwise.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Ring.Pi +module + +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Ring.Pi /-! # The pointwise product on `Finsupp`. @@ -17,6 +19,8 @@ see the type synonyms `AddMonoidAlgebra` and `MonoidAlgebra`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Data/Finsupp/PointwiseSMul.lean b/Mathlib/Data/Finsupp/PointwiseSMul.lean index d424ddf58ec43e..f076e679814738 100644 --- a/Mathlib/Data/Finsupp/PointwiseSMul.lean +++ b/Mathlib/Data/Finsupp/PointwiseSMul.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Data.Finsupp.Defs -import Mathlib.Data.Set.SMulAntidiagonal +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Data.Finsupp.Defs +public import Mathlib.Data.Set.SMulAntidiagonal /-! # Scalar multiplication by finitely supported functions. @@ -21,6 +23,8 @@ finitely supported `R`-valued functions on `G` on the space of `V`-valued functi -/ +@[expose] public section + open Finset Function noncomputable section diff --git a/Mathlib/Data/Finsupp/SMul.lean b/Mathlib/Data/Finsupp/SMul.lean index dffada9376f8c5..3ef4505a33be25 100644 --- a/Mathlib/Data/Finsupp/SMul.lean +++ b/Mathlib/Data/Finsupp/SMul.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Module.Basic -import Mathlib.Algebra.Regular.SMul -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.GroupTheory.GroupAction.Hom +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Module.Basic +public import Mathlib.Algebra.Regular.SMul +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Finsupp.SMulWithZero +public import Mathlib.GroupTheory.GroupAction.Hom /-! # Declarations about scalar multiplication on `Finsupp` @@ -19,6 +21,8 @@ This file is a `noncomputable theory` and uses classical logic throughout. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Data/Finsupp/SMulWithZero.lean b/Mathlib/Data/Finsupp/SMulWithZero.lean index 797858fe0fc278..b1619d035f6634 100644 --- a/Mathlib/Data/Finsupp/SMulWithZero.lean +++ b/Mathlib/Data/Finsupp/SMulWithZero.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Algebra.GroupWithZero.Action.Defs +module + +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Algebra.GroupWithZero.Action.Defs /-! # Scalar multiplication on `Finsupp` @@ -27,6 +29,8 @@ reasonably light. This file is a `noncomputable theory` and uses classical logic throughout. -/ +@[expose] public section + assert_not_exists Module noncomputable section diff --git a/Mathlib/Data/Finsupp/Single.lean b/Mathlib/Data/Finsupp/Single.lean index 4b9b0c3098fe86..ccd3671b55ec27 100644 --- a/Mathlib/Data/Finsupp/Single.lean +++ b/Mathlib/Data/Finsupp/Single.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Data.Finsupp.Defs +module + +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Data.Finsupp.Defs /-! # Finitely supported functions on exactly one point @@ -23,6 +25,8 @@ using one point of the domain. This file is a `noncomputable theory` and uses classical logic throughout. -/ +@[expose] public section + assert_not_exists CompleteLattice noncomputable section diff --git a/Mathlib/Data/Finsupp/ToDFinsupp.lean b/Mathlib/Data/Finsupp/ToDFinsupp.lean index 7a3adefd2e9be2..9241f486d17237 100644 --- a/Mathlib/Data/Finsupp/ToDFinsupp.lean +++ b/Mathlib/Data/Finsupp/ToDFinsupp.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Data.DFinsupp.Module -import Mathlib.Data.Finsupp.SMul +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Data.DFinsupp.Module +public import Mathlib.Data.Finsupp.SMul /-! # Conversion between `Finsupp` and homogeneous `DFinsupp` @@ -57,6 +59,8 @@ We provide `DFinsupp.toFinsupp` and `finsuppEquivDFinsupp` computably by adding these arguments are also present on the `noncomputable` equivs. -/ +@[expose] public section + variable {ι : Type*} {R : Type*} {M : Type*} diff --git a/Mathlib/Data/Finsupp/Weight.lean b/Mathlib/Data/Finsupp/Weight.lean index e8987b0645252b..173e86dc9aa720 100644 --- a/Mathlib/Data/Finsupp/Weight.lean +++ b/Mathlib/Data/Finsupp/Weight.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.Data.Finsupp.Antidiagonal -import Mathlib.Data.Finsupp.Order -import Mathlib.LinearAlgebra.Finsupp.LinearCombination +module + +public import Mathlib.Data.Finsupp.Antidiagonal +public import Mathlib.Data.Finsupp.Order +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination /-! # weights of Finsupp functions @@ -62,6 +64,8 @@ as well as a function `w : σ → M`. (The important case is `R = ℕ`.) -/ +@[expose] public section + variable {σ M R : Type*} [Semiring R] (w : σ → M) namespace Finsupp diff --git a/Mathlib/Data/Finsupp/WellFounded.lean b/Mathlib/Data/Finsupp/WellFounded.lean index 873fc62b4eb204..1b27fad367a46e 100644 --- a/Mathlib/Data/Finsupp/WellFounded.lean +++ b/Mathlib/Data/Finsupp/WellFounded.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Data.DFinsupp.WellFounded -import Mathlib.Data.Finsupp.Lex +module + +public import Mathlib.Data.DFinsupp.WellFounded +public import Mathlib.Data.Finsupp.Lex /-! # Well-foundedness of the lexicographic and product orders on `Finsupp` @@ -22,6 +24,8 @@ order `(· < ·)`, but without the ordering conditions on `α`. All results are transferred from `DFinsupp` via `Finsupp.toDFinsupp`. -/ +@[expose] public section + variable {α N : Type*} diff --git a/Mathlib/Data/Fintype/Basic.lean b/Mathlib/Data/Fintype/Basic.lean index e6297b13482bb5..947236b4792127 100644 --- a/Mathlib/Data/Fintype/Basic.lean +++ b/Mathlib/Data/Fintype/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finite.Defs -import Mathlib.Data.Finset.BooleanAlgebra -import Mathlib.Data.Finset.Image -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.Fintype.OfMap -import Mathlib.Data.Fintype.Sets -import Mathlib.Data.List.FinRange +module + +public import Mathlib.Data.Finite.Defs +public import Mathlib.Data.Finset.BooleanAlgebra +public import Mathlib.Data.Finset.Image +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.Fintype.OfMap +public import Mathlib.Data.Fintype.Sets +public import Mathlib.Data.List.FinRange /-! # Instances for finite types @@ -17,6 +19,8 @@ import Mathlib.Data.List.FinRange This file is a collection of basic `Fintype` instances for types such as `Fin`, `Prod` and pi types. -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Data/Fintype/BigOperators.lean b/Mathlib/Data/Fintype/BigOperators.lean index 70050e034b3db2..fab5a35acd8bd3 100644 --- a/Mathlib/Data/Fintype/BigOperators.lean +++ b/Mathlib/Data/Fintype/BigOperators.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise -import Mathlib.Algebra.BigOperators.Group.Finset.Sigma -import Mathlib.Algebra.BigOperators.Option -import Mathlib.Data.Fintype.Option -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Sigma -import Mathlib.Data.Fintype.Sum -import Mathlib.Data.Fintype.Vector +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +public import Mathlib.Algebra.BigOperators.Group.Finset.Sigma +public import Mathlib.Algebra.BigOperators.Option +public import Mathlib.Data.Fintype.Option +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Sigma +public import Mathlib.Data.Fintype.Sum +public import Mathlib.Data.Fintype.Vector /-! Results about "big operations" over a `Fintype`, and consequent @@ -25,6 +27,8 @@ However many of the results here really belong in `Algebra.BigOperators.Group.Fi and should be moved at some point. -/ +@[expose] public section + assert_not_exists MulAction open Mathlib diff --git a/Mathlib/Data/Fintype/Card.lean b/Mathlib/Data/Fintype/Card.lean index 24cfcc2b7081a3..f8ce1d1d354c43 100644 --- a/Mathlib/Data/Fintype/Card.lean +++ b/Mathlib/Data/Fintype/Card.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Card -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Data.Finset.Card +public import Mathlib.Data.Fintype.Basic /-! # Cardinalities of finite types @@ -20,6 +22,8 @@ We also include some elementary results on the values of `Fintype.card` on speci -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Data/Fintype/CardEmbedding.lean b/Mathlib/Data/Fintype/CardEmbedding.lean index 59eaaa17ce8e80..ae538494344780 100644 --- a/Mathlib/Data/Fintype/CardEmbedding.lean +++ b/Mathlib/Data/Fintype/CardEmbedding.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Set.Finite.Range -import Mathlib.Logic.Equiv.Embedding +module + +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Logic.Equiv.Embedding /-! # Number of embeddings @@ -14,6 +16,8 @@ import Mathlib.Logic.Equiv.Embedding This file establishes the cardinality of `α ↪ β` in full generality. -/ +@[expose] public section + local notation "|" x "|" => Finset.card x diff --git a/Mathlib/Data/Fintype/Defs.lean b/Mathlib/Data/Fintype/Defs.lean index 3758209894649c..c06aff12d8b27b 100644 --- a/Mathlib/Data/Fintype/Defs.lean +++ b/Mathlib/Data/Fintype/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Filter -import Mathlib.Data.Finite.Defs +module + +public import Mathlib.Data.Finset.Filter +public import Mathlib.Data.Finite.Defs /-! # Finite types @@ -35,6 +37,8 @@ These files also contain appropriate `Infinite` instances for these types. `Infinite` instances for `ℕ`, `ℤ`, `Multiset α`, and `List α` are in `Data.Fintype.Lattice`. -/ +@[expose] public section + assert_not_exists Monoid open Function @@ -135,7 +139,7 @@ See also form `{x ≤ a | p x}`, `{x ≥ a | p x}`, `{x < a | p x}`, `{x > a | p x}`. -/ @[term_elab setBuilder] -def elabFinsetBuilderSetOf : TermElab +meta def elabFinsetBuilderSetOf : TermElab | `({ $x:ident | $p }), expectedType? => do -- If the expected type is not known to be `Finset ?α`, give up. unless ← knownToBeFinsetNotSet expectedType? do throwUnsupportedSyntax @@ -164,7 +168,7 @@ def elabFinsetBuilderSetOf : TermElab /-- Delaborator for `Finset.filter`. The `pp.funBinderTypes` option controls whether to show the domain type when the filter is over `Finset.univ`. -/ -@[app_delab Finset.filter] def delabFinsetFilter : Delab := +@[app_delab Finset.filter] meta def delabFinsetFilter : Delab := whenPPOption getPPNotation do let #[_, p, _, t] := (← getExpr).getAppArgs | failure guard p.isLambda diff --git a/Mathlib/Data/Fintype/EquivFin.lean b/Mathlib/Data/Fintype/EquivFin.lean index f59e0158dbe0ce..650d6f67d8195b 100644 --- a/Mathlib/Data/Fintype/EquivFin.lean +++ b/Mathlib/Data/Fintype/EquivFin.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Data.List.NodupEquivFin +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Data.List.NodupEquivFin /-! # Equivalences between `Fintype`, `Fin` and `Finite` @@ -33,6 +35,8 @@ We provide `Infinite` instances for -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Data/Fintype/Fin.lean b/Mathlib/Data/Fintype/Fin.lean index 56e0280ff4d53c..270662a8f17f06 100644 --- a/Mathlib/Data/Fintype/Fin.lean +++ b/Mathlib/Data/Fintype/Fin.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Order.Interval.Finset.Fin -import Mathlib.Data.Vector.Basic +module + +public import Mathlib.Order.Interval.Finset.Fin +public import Mathlib.Data.Vector.Basic /-! # The structure of `Fintype (Fin n)` @@ -13,6 +15,8 @@ This file contains some basic results about the `Fintype` instance for `Fin`, especially properties of `Finset.univ : Finset (Fin n)`. -/ +@[expose] public section + open List (Vector) open Finset diff --git a/Mathlib/Data/Fintype/Inv.lean b/Mathlib/Data/Fintype/Inv.lean index ab480b86cb1cb7..721acc048bcf87 100644 --- a/Mathlib/Data/Fintype/Inv.lean +++ b/Mathlib/Data/Fintype/Inv.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Basic -import Mathlib.Data.Fintype.Defs +module + +public import Mathlib.Data.Finset.Basic +public import Mathlib.Data.Fintype.Defs /-! # Computable inverses for injective/surjective functions on finite types @@ -16,6 +18,8 @@ import Mathlib.Data.Fintype.Defs * `Fintype.choose`: computably obtain a witness for `ExistsUnique`. -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Data/Fintype/Lattice.lean b/Mathlib/Data/Fintype/Lattice.lean index ec44e8f7b3c4b9..048e9497874bb3 100644 --- a/Mathlib/Data/Fintype/Lattice.lean +++ b/Mathlib/Data/Fintype/Lattice.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Max -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Fintype.Basic /-! # Lemmas relating fintypes and order/lattice structure. -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Fintype/List.lean b/Mathlib/Data/Fintype/List.lean index e54833f2cc91c2..a59450ca0f556b 100644 --- a/Mathlib/Data/Fintype/List.lean +++ b/Mathlib/Data/Fintype/List.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.List.Permutation +module + +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.List.Permutation /-! @@ -21,6 +23,8 @@ This function is applied to the `Finset.powerset` of `Finset.univ`. -/ +@[expose] public section + variable {α : Type*} open List diff --git a/Mathlib/Data/Fintype/OfMap.lean b/Mathlib/Data/Fintype/OfMap.lean index aa8c7bde44ce42..dd881d1a1a910e 100644 --- a/Mathlib/Data/Fintype/OfMap.lean +++ b/Mathlib/Data/Fintype/OfMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.Finset.Image +module + +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.Finset.Image /-! # Constructors for `Fintype` @@ -18,6 +20,8 @@ given maps from/to finite types. a type is finite if there is a bi/in/surjection from/to a finite type. -/ +@[expose] public section + assert_not_exists Monoid open Function diff --git a/Mathlib/Data/Fintype/Option.lean b/Mathlib/Data/Fintype/Option.lean index 86a2efd8a501a9..7c357825d65c5f 100644 --- a/Mathlib/Data/Fintype/Option.lean +++ b/Mathlib/Data/Fintype/Option.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Finset.Option +module + +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Finset.Option /-! # fintype instances for option -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction open Function diff --git a/Mathlib/Data/Fintype/Order.lean b/Mathlib/Data/Fintype/Order.lean index 1b84c13b8db4d7..7069955fc3990d 100644 --- a/Mathlib/Data/Fintype/Order.lean +++ b/Mathlib/Data/Fintype/Order.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson, Yaël Dillies -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Finset.Order -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Finite.Range -import Mathlib.Order.Atoms +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Finset.Order +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Order.Atoms /-! # Order structures on finite types @@ -44,6 +46,8 @@ We provide a few instances for concrete types: * `Bool.completeBooleanAlgebra` -/ +@[expose] public section + open Finset diff --git a/Mathlib/Data/Fintype/Parity.lean b/Mathlib/Data/Fintype/Parity.lean index 33677801f51cac..4f1690c3b00135 100644 --- a/Mathlib/Data/Fintype/Parity.lean +++ b/Mathlib/Data/Fintype/Parity.lean @@ -3,13 +3,18 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Algebra.Group.Even +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Algebra.Group.Even +import all Init.Data.Fin.Fold -- for exposing `Fin.foldr` /-! # The cardinality of `Fin 2` is even. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Data/Fintype/Perm.lean b/Mathlib/Data/Fintype/Perm.lean index fdcd03379ea327..ff2590b681d94d 100644 --- a/Mathlib/Data/Fintype/Perm.lean +++ b/Mathlib/Data/Fintype/Perm.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Group.List.Defs -import Mathlib.Algebra.Group.End -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Nat.Factorial.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.List.Defs +public import Mathlib.Algebra.Group.End +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Nat.Factorial.Basic /-! # `Fintype` instances for `Equiv` and `Perm` @@ -17,6 +19,8 @@ Main declarations: -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function @@ -113,10 +117,9 @@ theorem nodup_permsOfList : ∀ {l : List α}, l.Nodup → (permsOfList l).Nodup · intro f hf₁ hf₂ let ⟨x, hx, hx'⟩ := List.mem_flatMap.1 hf₂ let ⟨g, hg⟩ := List.mem_map.1 hx' - have hgxa : g⁻¹ x = a := f.injective <| by rw [hmeml hf₁, ← hg.2]; simp - have hxa : x ≠ a := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx) - exact (List.nodup_cons.1 hl).1 <| - hgxa ▸ mem_of_mem_permsOfList hg.1 (by rwa [apply_inv_self, hgxa]) + obtain rfl : g.symm x = a := f.injective <| by rw [hmeml hf₁, ← hg.2]; simp + have hxa : x ≠ g.symm x := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx) + exact (List.nodup_cons.1 hl).1 <| mem_of_mem_permsOfList hg.1 (by simpa using hxa) /-- Given a finset, produce the finset of all permutations of its elements. -/ def permsOfFinset (s : Finset α) : Finset (Perm α) := diff --git a/Mathlib/Data/Fintype/Pi.lean b/Mathlib/Data/Fintype/Pi.lean index 83bf1daa62c132..7fd7ade9dd31da 100644 --- a/Mathlib/Data/Fintype/Pi.lean +++ b/Mathlib/Data/Fintype/Pi.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Pi -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Data.Finset.Pi +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Set.Finite.Basic /-! # Fintype instances for pi types -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero open Finset Function diff --git a/Mathlib/Data/Fintype/Pigeonhole.lean b/Mathlib/Data/Fintype/Pigeonhole.lean index b5475ec98a5806..1354ed9c5ede85 100644 --- a/Mathlib/Data/Fintype/Pigeonhole.lean +++ b/Mathlib/Data/Fintype/Pigeonhole.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Union -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Data.Finset.Union +public import Mathlib.Data.Fintype.EquivFin /-! # Pigeonhole principles in finite types @@ -22,6 +24,8 @@ We provide the following versions of the pigeonholes principle. Some more pigeonhole-like statements can be found in `Data.Fintype.CardEmbedding`. -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction open Function diff --git a/Mathlib/Data/Fintype/Powerset.lean b/Mathlib/Data/Fintype/Powerset.lean index e940536869703e..257936312640d8 100644 --- a/Mathlib/Data/Fintype/Powerset.lean +++ b/Mathlib/Data/Fintype/Powerset.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Fintype.EquivFin /-! # fintype instance for `Set α`, when `α` is a fintype -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Data/Fintype/Prod.lean b/Mathlib/Data/Fintype/Prod.lean index 701e9f50cb2a14..d8661ef04700b6 100644 --- a/Mathlib/Data/Fintype/Prod.lean +++ b/Mathlib/Data/Fintype/Prod.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Prod -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.Fintype.EquivFin /-! # fintype instance for the product of two fintypes. -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Fintype/Quotient.lean b/Mathlib/Data/Fintype/Quotient.lean index d6c80619ecf752..e38dd4404b4fe4 100644 --- a/Mathlib/Data/Fintype/Quotient.lean +++ b/Mathlib/Data/Fintype/Quotient.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yuyang Zhao -/ -import Mathlib.Data.List.Pi -import Mathlib.Data.Fintype.Defs +module + +public import Mathlib.Data.List.Pi +public import Mathlib.Data.Fintype.Defs /-! # Quotients of families indexed by a finite type @@ -25,6 +27,8 @@ by a finite type. -/ +@[expose] public section + namespace Quotient diff --git a/Mathlib/Data/Fintype/Sets.lean b/Mathlib/Data/Fintype/Sets.lean index 176390886f2cc8..24d75edf20b40c 100644 --- a/Mathlib/Data/Fintype/Sets.lean +++ b/Mathlib/Data/Fintype/Sets.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.BooleanAlgebra -import Mathlib.Data.Finset.SymmDiff -import Mathlib.Data.Fintype.OfMap +module + +public import Mathlib.Data.Finset.BooleanAlgebra +public import Mathlib.Data.Finset.SymmDiff +public import Mathlib.Data.Fintype.OfMap /-! # Subsets of finite types @@ -19,6 +21,8 @@ In a `Fintype`, all `Set`s are automatically `Finset`s, and there are only finit * `Fintype.finsetEquivSet`: `Finset α` and `Set α` are equivalent if `α` is a `Fintype` -/ +@[expose] public section + assert_not_exists Monoid open Function @@ -114,6 +118,9 @@ theorem disjoint_toFinset [Fintype s] [Fintype t] : theorem toFinset_nontrivial [Fintype s] : s.toFinset.Nontrivial ↔ s.Nontrivial := by rw [Finset.Nontrivial, coe_toFinset] +theorem subsingleton_toFinset_iff [Fintype s] : Subsingleton s.toFinset ↔ s.Subsingleton := by + simp + section DecidableEq variable [DecidableEq α] (s t) [Fintype s] [Fintype t] @@ -318,6 +325,6 @@ elab (name := finsetStx) "finset% " t:term : term => do open Lean.Elab.Term.Quotation in /-- `quot_precheck` for the `finset%` syntax. -/ -@[quot_precheck finsetStx] def precheckFinsetStx : Precheck +@[quot_precheck finsetStx] meta def precheckFinsetStx : Precheck | `(finset% $t) => precheck t | _ => Elab.throwUnsupportedSyntax diff --git a/Mathlib/Data/Fintype/Shrink.lean b/Mathlib/Data/Fintype/Shrink.lean index a9f27e0cece22c..5e22bb59bf4c1d 100644 --- a/Mathlib/Data/Fintype/Shrink.lean +++ b/Mathlib/Data/Fintype/Shrink.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Countable.Small -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Data.Countable.Small +public import Mathlib.Data.Fintype.EquivFin /-! # Fintype instance for `Shrink` -/ +@[expose] public section + universe u v variable {α : Type u} [Fintype α] diff --git a/Mathlib/Data/Fintype/Sigma.lean b/Mathlib/Data/Fintype/Sigma.lean index 7a2c326361620e..03861bcdd9a78b 100644 --- a/Mathlib/Data/Fintype/Sigma.lean +++ b/Mathlib/Data/Fintype/Sigma.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Sigma -import Mathlib.Data.Fintype.OfMap +module + +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Data.Fintype.OfMap /-! # fintype instances for sigma types -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Fintype/Sort.lean b/Mathlib/Data/Fintype/Sort.lean index 060770f42c850e..4441e339a8d2cf 100644 --- a/Mathlib/Data/Fintype/Sort.lean +++ b/Mathlib/Data/Fintype/Sort.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Sort -import Mathlib.Data.Fintype.Basic +module + +public import Mathlib.Data.Finset.Sort +public import Mathlib.Data.Fintype.Basic /-! # Sorting a finite type @@ -15,6 +17,8 @@ This file provides two equivalences for linearly ordered fintypes: respectively the cardinalities of some `Finset α` and its complement. -/ +@[expose] public section + open Finset diff --git a/Mathlib/Data/Fintype/Sum.lean b/Mathlib/Data/Fintype/Sum.lean index bb3ed71f363f75..a053a4fadb1efa 100644 --- a/Mathlib/Data/Fintype/Sum.lean +++ b/Mathlib/Data/Fintype/Sum.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Sum -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Logic.Embedding.Set +module + +public import Mathlib.Data.Finset.Sum +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Logic.Embedding.Set /-! ## Instances @@ -13,6 +15,8 @@ import Mathlib.Logic.Embedding.Set We provide the `Fintype` instance for the sum of two fintypes. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/Fintype/Units.lean b/Mathlib/Data/Fintype/Units.lean index 3d7b637da0a041..769f87960b5eed 100644 --- a/Mathlib/Data/Fintype/Units.lean +++ b/Mathlib/Data/Fintype/Units.lean @@ -3,16 +3,20 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Sum -import Mathlib.SetTheory.Cardinal.Finite -import Mathlib.Algebra.GroupWithZero.Units.Equiv +module + +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Sum +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.Algebra.GroupWithZero.Units.Equiv /-! # fintype instances relating to units -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} diff --git a/Mathlib/Data/Fintype/Vector.lean b/Mathlib/Data/Fintype/Vector.lean index 02d32ff27967cd..6d88a7b1132075 100644 --- a/Mathlib/Data/Fintype/Vector.lean +++ b/Mathlib/Data/Fintype/Vector.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fintype.Pi -import Mathlib.Data.Sym.Basic +module + +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Data.Sym.Basic /-! # `Vector α n` and `Sym α n` are fintypes when `α` is. -/ +@[expose] public section + open List (Vector) variable {α : Type*} diff --git a/Mathlib/Data/Fintype/WithTopBot.lean b/Mathlib/Data/Fintype/WithTopBot.lean index df4099e382ac4d..d0cb9d1ec14064 100644 --- a/Mathlib/Data/Fintype/WithTopBot.lean +++ b/Mathlib/Data/Fintype/WithTopBot.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Fintype.Option -import Mathlib.Order.TypeTags +module + +public import Mathlib.Data.Fintype.Option +public import Mathlib.Order.TypeTags /-! # Fintype instances for `WithTop α` and `WithBot α` -/ +@[expose] public section + variable {α : Type*} instance [Fintype α] : Fintype (WithTop α) := diff --git a/Mathlib/Data/FunLike/Basic.lean b/Mathlib/Data/FunLike/Basic.lean index 429105a297ae4f..aee8fdb9ea9670 100644 --- a/Mathlib/Data/FunLike/Basic.lean +++ b/Mathlib/Data/FunLike/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Logic.Function.Basic -import Mathlib.Logic.Unique -import Mathlib.Util.CompileInductive -import Mathlib.Tactic.Simps.NotationClass +module + +public import Mathlib.Logic.Function.Basic +public import Mathlib.Logic.Unique +public import Mathlib.Util.CompileInductive +public import Mathlib.Tactic.Simps.NotationClass /-! # Typeclass for a type `F` with an injective map to `A → B` @@ -127,6 +129,8 @@ does **not** have a `FunLike` instance by checking the discrimination tree once the entire `extends` hierarchy. -/ +@[expose] public section + /-- The class `DFunLike F α β` expresses that terms of type `F` have an injective coercion to (dependent) functions from `α` to `β`. diff --git a/Mathlib/Data/FunLike/Embedding.lean b/Mathlib/Data/FunLike/Embedding.lean index a8551af72e0792..7256d6501d95b6 100644 --- a/Mathlib/Data/FunLike/Embedding.lean +++ b/Mathlib/Data/FunLike/Embedding.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Data.FunLike.Basic +module + +public import Mathlib.Data.FunLike.Basic /-! # Typeclass for a type `F` with an injective map to `A ↪ B` @@ -124,6 +126,8 @@ and defining `CoolerEmbeddingClass` only takes a constant amount of effort, instead of linearly increasing the work per `MyEmbedding`-related declaration. -/ +@[expose] public section + /-- The class `EmbeddingLike F α β` expresses that terms of type `F` have an injective coercion to injective functions `α ↪ β`. diff --git a/Mathlib/Data/FunLike/Equiv.lean b/Mathlib/Data/FunLike/Equiv.lean index 9af544a9b287da..1b22aef78aee5f 100644 --- a/Mathlib/Data/FunLike/Equiv.lean +++ b/Mathlib/Data/FunLike/Equiv.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Data.FunLike.Embedding +module + +public import Mathlib.Data.FunLike.Embedding /-! # Typeclass for a type `F` with an injective map to `A ≃ B` @@ -123,6 +125,8 @@ instead of linearly increasing the work per `MyIso`-related declaration. -/ +@[expose] public section + /-- The class `EquivLike E α β` expresses that terms of type `E` have an injective coercion to bijections between `α` and `β`. diff --git a/Mathlib/Data/FunLike/Fintype.lean b/Mathlib/Data/FunLike/Fintype.lean index 679865a0f04b90..72e51ea818a297 100644 --- a/Mathlib/Data/FunLike/Fintype.lean +++ b/Mathlib/Data/FunLike/Fintype.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.FunLike.Basic -import Mathlib.Data.Finite.Prod +module + +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.FunLike.Basic +public import Mathlib.Data.Finite.Prod /-! # Finiteness of `DFunLike` types @@ -26,6 +28,8 @@ You can use these to produce instances for specific `DFunLike` types. They can't be instances themselves since they can cause loops. -/ +@[expose] public section + -- `Type` is a reserved word, switched to `Type'` section Type' diff --git a/Mathlib/Data/Holor.lean b/Mathlib/Data/Holor.lean index 1e3690e4287d56..81036ecc262d91 100644 --- a/Mathlib/Data/Holor.lean +++ b/Mathlib/Data/Holor.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.Data.Nat.Find -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Nat.Find +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Basic properties of holors @@ -31,6 +33,8 @@ Based on the tensor library found in -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/Ineq.lean b/Mathlib/Data/Ineq.lean index e74f585ee33e61..8e735f5b2ffde1 100644 --- a/Mathlib/Data/Ineq.lean +++ b/Mathlib/Data/Ineq.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Lean.Expr.Basic +module + +public import Mathlib.Lean.Expr.Basic /-! # `Ineq` datatype @@ -13,6 +15,8 @@ involving it. The type `Ineq` is one of the fundamental objects manipulated by t `linear_combination` tactics. -/ +@[expose] public section + open Lean Meta namespace Mathlib diff --git a/Mathlib/Data/Int/AbsoluteValue.lean b/Mathlib/Data/Int/AbsoluteValue.lean index 35c8464256d8bd..5385011d46a969 100644 --- a/Mathlib/Data/Int/AbsoluteValue.lean +++ b/Mathlib/Data/Int/AbsoluteValue.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Module.Basic -import Mathlib.Algebra.Order.AbsoluteValue.Basic +module + +public import Mathlib.Algebra.Module.Basic +public import Mathlib.Algebra.Order.AbsoluteValue.Basic /-! # Absolute values and the integers @@ -16,6 +18,8 @@ This file contains some results on absolute values applied to integers. * `AbsoluteValue.map_units_int`: an absolute value sends all units of `ℤ` to `1` -/ +@[expose] public section + variable {R S : Type*} [Ring R] [CommRing S] [LinearOrder S] [IsStrictOrderedRing S] @[simp] diff --git a/Mathlib/Data/Int/Associated.lean b/Mathlib/Data/Int/Associated.lean index ab2905c2338d71..f2c5c8d1273f52 100644 --- a/Mathlib/Data/Int/Associated.lean +++ b/Mathlib/Data/Int/Associated.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.Ring.Int.Units +module + +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.Ring.Int.Units /-! # Associated elements and the integers @@ -15,6 +17,8 @@ This file contains some results on equality up to units in the integers. * `Int.natAbs_eq_iff_associated`: the absolute value is equal iff integers are associated -/ +@[expose] public section + theorem Int.natAbs_eq_iff_associated {a b : ℤ} : a.natAbs = b.natAbs ↔ Associated a b := by refine Int.natAbs_eq_natAbs_iff.trans ?_ diff --git a/Mathlib/Data/Int/Basic.lean b/Mathlib/Data/Int/Basic.lean index f67834dea761d2..b3adb0cfe402e4 100644 --- a/Mathlib/Data/Int/Basic.lean +++ b/Mathlib/Data/Int/Basic.lean @@ -3,12 +3,15 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Data.Int.Init -import Mathlib.Data.Nat.Basic -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Lift -import Mathlib.Tactic.OfNat +module + +public import Mathlib.Data.Int.Init +public import Mathlib.Data.Nat.Basic +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Tactic.Conv +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Lift +public import Mathlib.Tactic.OfNat /-! # Basic operations on the integers @@ -17,6 +20,8 @@ This file builds on `Data.Int.Init` by adding basic lemmas on integers. depending on Mathlib definitions. -/ +@[expose] public section + open Nat namespace Int diff --git a/Mathlib/Data/Int/Bitwise.lean b/Mathlib/Data/Int/Bitwise.lean index a6e9820cc7bd9d..073e8db7fd12a3 100644 --- a/Mathlib/Data/Int/Bitwise.lean +++ b/Mathlib/Data/Int/Bitwise.lean @@ -3,10 +3,14 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.Bitwise -import Mathlib.Data.Nat.Size -import Batteries.Data.Int +module + +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.Bitwise +public import Mathlib.Data.Nat.Size +public import Batteries.Data.Int +import all Init.Data.Nat.Bitwise.Basic -- for unfolding `Nat.bitwise` +import all Init.Data.Int.Bitwise.Basic -- for unfolding `Int.bitwise` /-! # Bitwise operations on integers @@ -18,6 +22,8 @@ Possibly only of archaeological significance. even and for odd values. -/ +@[expose] public section + namespace Int /-- `div2 n = n/2` -/ diff --git a/Mathlib/Data/Int/CardIntervalMod.lean b/Mathlib/Data/Int/CardIntervalMod.lean index a226571335c8e8..f8d86922f40479 100644 --- a/Mathlib/Data/Int/CardIntervalMod.lean +++ b/Mathlib/Data/Int/CardIntervalMod.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Data.Int.Interval -import Mathlib.Data.Int.ModEq -import Mathlib.Data.Nat.Count -import Mathlib.Data.Rat.Floor -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Data.Int.Interval +public import Mathlib.Data.Int.ModEq +public import Mathlib.Data.Nat.Count +public import Mathlib.Data.Rat.Floor +public import Mathlib.Order.Interval.Finset.Nat /-! # Counting elements in an interval with given residue @@ -17,6 +19,8 @@ The theorems in this file generalise `Nat.card_multiples` in zero, which reduces to the multiples). Theorems are given for `Ico` and `Ioc` intervals. -/ +@[expose] public section + open Finset Int diff --git a/Mathlib/Data/Int/Cast/Basic.lean b/Mathlib/Data/Int/Cast/Basic.lean index ba337f77c47009..ce4ff3f9661462 100644 --- a/Mathlib/Data/Int/Cast/Basic.lean +++ b/Mathlib/Data/Int/Cast/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ -import Mathlib.Data.Int.Cast.Defs -import Mathlib.Algebra.Group.Basic -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Data.Int.Cast.Defs +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Data.Nat.Basic /-! # Cast of integers (additional theorems) @@ -21,6 +23,8 @@ By contrast, this file's only import beyond `Mathlib.Data.Int.Cast.Defs` is `Mathlib.Algebra.Group.Basic`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/Int/Cast/Defs.lean b/Mathlib/Data/Int/Cast/Defs.lean index 90c95270e74e18..281e7b622c16ce 100644 --- a/Mathlib/Data/Int/Cast/Defs.lean +++ b/Mathlib/Data/Int/Cast/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ -import Mathlib.Data.Nat.Cast.Defs +module + +public import Mathlib.Data.Nat.Cast.Defs /-! # Cast of integers @@ -21,6 +23,8 @@ Preferentially, the homomorphism is written as a coercion. * `AddGroupWithOne`: Type class for `Int.cast`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/Int/Cast/Field.lean b/Mathlib/Data/Int/Cast/Field.lean index 5ec97dd55362ee..b0145608b93c70 100644 --- a/Mathlib/Data/Int/Cast/Field.lean +++ b/Mathlib/Data/Int/Cast/Field.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Ring.Int.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Ring.Int.Defs /-! # Cast of integers into fields @@ -16,6 +18,8 @@ This file concerns the canonical homomorphism `ℤ → F`, where `F` is a field. * `Int.cast_div`: if `n` divides `m`, then `↑(m / n) = ↑m / ↑n` -/ +@[expose] public section + namespace Int diff --git a/Mathlib/Data/Int/Cast/Lemmas.lean b/Mathlib/Data/Int/Cast/Lemmas.lean index 793070790be71e..b54245aa2a7ee3 100644 --- a/Mathlib/Data/Int/Cast/Lemmas.lean +++ b/Mathlib/Data/Int/Cast/Lemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.TypeTags.Hom -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Ring.Parity +module + +public import Mathlib.Algebra.Group.TypeTags.Hom +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Ring.Parity /-! # Cast of integers (additional theorems) @@ -21,6 +23,8 @@ which were not available in the import dependencies of `Data.Int.Cast.Basic`. * `castRingHom`: `cast` bundled as a `RingHom`. -/ +@[expose] public section + assert_not_exists RelIso IsOrderedMonoid Field open Additive Function Multiplicative Nat diff --git a/Mathlib/Data/Int/Cast/Pi.lean b/Mathlib/Data/Int/Cast/Pi.lean index 1b0ea4944d668c..b8d88f7bd9d27a 100644 --- a/Mathlib/Data/Int/Cast/Pi.lean +++ b/Mathlib/Data/Int/Cast/Pi.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Batteries.Tactic.Alias -import Mathlib.Data.Int.Notation -import Mathlib.Tactic.TypeStar -import Mathlib.Util.AssertExists -import Mathlib.Tactic.Push.Attr +module + +public import Batteries.Tactic.Alias +public import Mathlib.Data.Int.Notation +public import Mathlib.Tactic.TypeStar +public import Mathlib.Util.AssertExists +public import Mathlib.Tactic.Push.Attr /-! # Cast of integers to function types @@ -19,6 +21,8 @@ This file provides a (pointwise) cast from `ℤ` to function types. * `Pi.instIntCast`: map `n : ℤ` to the constant function `n : ∀ i, π i` -/ +@[expose] public section + assert_not_exists IsOrderedMonoid RingHom namespace Pi diff --git a/Mathlib/Data/Int/Cast/Prod.lean b/Mathlib/Data/Int/Cast/Prod.lean index cd7c553332f9d6..a3473f657d8617 100644 --- a/Mathlib/Data/Int/Cast/Prod.lean +++ b/Mathlib/Data/Int/Cast/Prod.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Data.Nat.Cast.Prod +module + +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Data.Nat.Cast.Prod /-! # The product of two `AddGroupWithOne`s. -/ +@[expose] public section + namespace Prod diff --git a/Mathlib/Data/Int/CharZero.lean b/Mathlib/Data/Int/CharZero.lean index 03a24069e73ed3..6baa600ba2c7ab 100644 --- a/Mathlib/Data/Int/CharZero.lean +++ b/Mathlib/Data/Int/CharZero.lean @@ -3,16 +3,20 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Notation.Support -import Mathlib.Data.Int.Cast.Field -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.Data.Int.Cast.Pi +module + +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Data.Int.Cast.Field +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.Data.Int.Cast.Pi /-! # Injectivity of `Int.Cast` into characteristic zero rings and fields. -/ +@[expose] public section + open Nat Set variable {α β : Type*} diff --git a/Mathlib/Data/Int/ConditionallyCompleteOrder.lean b/Mathlib/Data/Int/ConditionallyCompleteOrder.lean index 5fc5c589969ef5..46eee950624d2e 100644 --- a/Mathlib/Data/Int/ConditionallyCompleteOrder.lean +++ b/Mathlib/Data/Int/ConditionallyCompleteOrder.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Data.Int.LeastGreatest +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Data.Int.LeastGreatest /-! ## `ℤ` forms a conditionally complete linear order @@ -12,6 +14,8 @@ import Mathlib.Data.Int.LeastGreatest The integers form a conditionally complete linear order. -/ +@[expose] public section + open Int diff --git a/Mathlib/Data/Int/DivMod.lean b/Mathlib/Data/Int/DivMod.lean index b83608d755984d..cf6161a9ae6d96 100644 --- a/Mathlib/Data/Int/DivMod.lean +++ b/Mathlib/Data/Int/DivMod.lean @@ -3,15 +3,18 @@ Copyright (c) 2024 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ +module -import Batteries.Tactic.Alias -import Mathlib.Init +public import Batteries.Tactic.Alias +public import Mathlib.Init /-! # Basic lemmas about division and modulo for integers -/ +@[expose] public section + namespace Int /-! ### `ediv` and `fdiv` -/ diff --git a/Mathlib/Data/Int/GCD.lean b/Mathlib/Data/Int/GCD.lean index 571d35f7142b30..5d67437f0a3ff6 100644 --- a/Mathlib/Data/Int/GCD.lean +++ b/Mathlib/Data/Int/GCD.lean @@ -3,15 +3,17 @@ Copyright (c) 2018 Guy Leroy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sangwoo Jo (aka Jason), Guy Leroy, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Semiconj -import Mathlib.Algebra.Group.Commute.Units -import Mathlib.Data.Set.Operations -import Mathlib.Order.Basic -import Mathlib.Order.Bounds.Defs -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Data.Int.Basic -import Mathlib.Algebra.Divisibility.Basic -import Mathlib.Algebra.Group.Nat.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Semiconj +public import Mathlib.Algebra.Group.Commute.Units +public import Mathlib.Data.Set.Operations +public import Mathlib.Order.Basic +public import Mathlib.Order.Bounds.Defs +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Data.Int.Basic +public import Mathlib.Algebra.Divisibility.Basic +public import Mathlib.Algebra.Group.Nat.Defs /-! # Extended GCD and divisibility over ℤ @@ -31,6 +33,8 @@ import Mathlib.Algebra.Group.Nat.Defs Bézout's lemma, Bezout's lemma -/ +@[expose] public section + /-! ### Extended Euclidean algorithm -/ diff --git a/Mathlib/Data/Int/Init.lean b/Mathlib/Data/Int/Init.lean index 9f15786c86a96f..9fad6ef36a6612 100644 --- a/Mathlib/Data/Int/Init.lean +++ b/Mathlib/Data/Int/Init.lean @@ -3,12 +3,14 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Batteries.Logic -import Batteries.Tactic.Init -import Mathlib.Data.Int.Notation -import Mathlib.Data.Nat.Notation -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Logic +public import Batteries.Tactic.Init +public import Mathlib.Data.Int.Notation +public import Mathlib.Data.Nat.Notation +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar /-! # Basic operations on the integers @@ -21,6 +23,8 @@ This file should not depend on anything defined in Mathlib (except for notation) upstreamed to Batteries easily. -/ +@[expose] public section + open Nat namespace Int diff --git a/Mathlib/Data/Int/Interval.lean b/Mathlib/Data/Int/Interval.lean index 662c1c44492bb1..3342e904f62668 100644 --- a/Mathlib/Data/Int/Interval.lean +++ b/Mathlib/Data/Int/Interval.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Embedding -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Order.Interval.Finset.Basic /-! # Finite intervals of integers @@ -16,6 +18,8 @@ This file proves that `ℤ` is a `LocallyFiniteOrder` and calculates the cardina intervals as finsets and fintypes. -/ +@[expose] public section + assert_not_exists Field open Finset Int diff --git a/Mathlib/Data/Int/LeastGreatest.lean b/Mathlib/Data/Int/LeastGreatest.lean index c3024d849eafdb..ce16ccb13a6770 100644 --- a/Mathlib/Data/Int/LeastGreatest.lean +++ b/Mathlib/Data/Int/LeastGreatest.lean @@ -3,10 +3,12 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.Find -import Mathlib.Order.Bounds.Defs +module + +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.Find +public import Mathlib.Order.Bounds.Defs /-! # Least upper bound and greatest lower bound properties for integers @@ -37,6 +39,8 @@ counterpart of this statement for the least element. integer numbers, least element, greatest element -/ +@[expose] public section + namespace Int diff --git a/Mathlib/Data/Int/Lemmas.lean b/Mathlib/Data/Int/Lemmas.lean index d6f8fae285519e..27f9b1cae2983f 100644 --- a/Mathlib/Data/Int/Lemmas.lean +++ b/Mathlib/Data/Int/Lemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Data.Int.Bitwise -import Mathlib.Data.Int.Order.Lemmas -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Data.Int.Bitwise +public import Mathlib.Data.Int.Order.Lemmas +public import Mathlib.Order.Interval.Set.Defs /-! # Miscellaneous lemmas about the integers @@ -15,6 +17,8 @@ This file contains lemmas about integers, which require further imports than -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/Int/Log.lean b/Mathlib/Data/Int/Log.lean index bad26e0a1394ca..d849c94b3dbc3a 100644 --- a/Mathlib/Data/Int/Log.lean +++ b/Mathlib/Data/Int/Log.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Data.Nat.Log +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Data.Nat.Log /-! # Integer logarithms in a field with respect to a natural base @@ -47,6 +49,8 @@ def digits (b : ℕ) (q : ℚ) (n : ℕ) : ℕ := * `Int.neg_log_inv_eq_clog`, `Int.neg_clog_inv_eq_log`: the link between the two definitions. -/ +@[expose] public section + assert_not_exists Finset variable {R : Type*} [Semifield R] [LinearOrder R] [IsStrictOrderedRing R] [FloorSemiring R] diff --git a/Mathlib/Data/Int/ModEq.lean b/Mathlib/Data/Int/ModEq.lean index a488c30a97090e..04ee17ec850276 100644 --- a/Mathlib/Data/Int/ModEq.lean +++ b/Mathlib/Data/Int/ModEq.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Nat.ModEq +module + +public import Mathlib.Data.Nat.ModEq /-! @@ -19,6 +21,8 @@ modeq, congruence, mod, MOD, modulo, integers -/ +@[expose] public section + namespace Int @@ -164,7 +168,7 @@ protected theorem mul (h₁ : a ≡ b [ZMOD n]) (h₂ : c ≡ d [ZMOD n]) : a * @[gcongr] protected theorem pow (m : ℕ) (h : a ≡ b [ZMOD n]) : a ^ m ≡ b ^ m [ZMOD n] := by induction m with - | zero => rfl + | zero => simp | succ d hd => rw [pow_succ, pow_succ]; exact hd.mul h lemma of_mul_left (m : ℤ) (h : a ≡ b [ZMOD m * n]) : a ≡ b [ZMOD n] := by diff --git a/Mathlib/Data/Int/NatAbs.lean b/Mathlib/Data/Int/NatAbs.lean index e31d44fdac1d5d..5783b8039262fc 100644 --- a/Mathlib/Data/Int/NatAbs.lean +++ b/Mathlib/Data/Int/NatAbs.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Jeremy Tan -/ -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.GroupWithZero.Nat -import Mathlib.Algebra.Ring.Int.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.GroupWithZero.Nat +public import Mathlib.Algebra.Ring.Int.Defs /-! # Lemmas about `Int.natAbs` @@ -18,6 +20,8 @@ natural number. * `Int.natAbsHom`: `Int.natAbs` bundled as a `MonoidWithZeroHom`. -/ +@[expose] public section + namespace Int /-- `Int.natAbs` as a bundled `MonoidWithZeroHom`. -/ diff --git a/Mathlib/Data/Int/NatPrime.lean b/Mathlib/Data/Int/NatPrime.lean index 1d0252c8e7dd40..cc7a8a9dbd6c3d 100644 --- a/Mathlib/Data/Int/NatPrime.lean +++ b/Mathlib/Data/Int/NatPrime.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Bryan Gin-ge Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Lacker, Bryan Gin-ge Chen -/ -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Data.Int.Basic +module + +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Data.Int.Basic /-! # Lemmas about `Nat.Prime` using `Int`s -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/Int/Notation.lean b/Mathlib/Data/Int/Notation.lean index 57ac150fcbfe1c..85d29698c08558 100644 --- a/Mathlib/Data/Int/Notation.lean +++ b/Mathlib/Data/Int/Notation.lean @@ -3,10 +3,13 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Notation `ℤ` for the integers. -/ +@[expose] public section + @[inherit_doc] notation "ℤ" => Int diff --git a/Mathlib/Data/Int/Order/Basic.lean b/Mathlib/Data/Int/Order/Basic.lean index f6bdd15feccc79..b018deb0712237 100644 --- a/Mathlib/Data/Int/Order/Basic.lean +++ b/Mathlib/Data/Int/Order/Basic.lean @@ -3,16 +3,19 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ +module -import Mathlib.Data.Int.Notation -import Mathlib.Data.Nat.Notation -import Mathlib.Order.Defs.LinearOrder -import Mathlib.Tactic.ByCases +public import Mathlib.Data.Int.Notation +public import Mathlib.Data.Nat.Notation +public import Mathlib.Order.Defs.LinearOrder +public import Mathlib.Tactic.ByCases /-! # The order relation on the integers -/ +@[expose] public section + open Nat namespace Int @@ -28,16 +31,14 @@ theorem lt.elim {a b : ℤ} (h : a < b) {P : Prop} (h' : ∀ n : ℕ, a + ↑(Na alias ⟨lt_of_ofNat_lt_ofNat, ofNat_lt_ofNat_of_lt⟩ := ofNat_lt instance instLinearOrder : LinearOrder ℤ where - le := (· ≤ ·) le_refl := Int.le_refl le_trans := @Int.le_trans le_antisymm := @Int.le_antisymm - lt := (· < ·) lt_iff_le_not_ge := @Int.lt_iff_le_not_le le_total := Int.le_total - toDecidableEq := by infer_instance - toDecidableLE := by infer_instance - toDecidableLT := by infer_instance + toDecidableEq := instDecidableEq + toDecidableLE := decLe + toDecidableLT := decLt protected theorem eq_zero_or_eq_zero_of_mul_eq_zero {a b : ℤ} (h : a * b = 0) : a = 0 ∨ b = 0 := Int.mul_eq_zero.mp h diff --git a/Mathlib/Data/Int/Order/Lemmas.lean b/Mathlib/Data/Int/Order/Lemmas.lean index 68d11542df1277..ad3399a52d8180 100644 --- a/Mathlib/Data/Int/Order/Lemmas.lean +++ b/Mathlib/Data/Int/Order/Lemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Order.Ring.Abs +module + +public import Mathlib.Algebra.Order.Ring.Abs /-! # Further lemmas about the integers @@ -13,6 +15,8 @@ They are separated by now to minimize the porting requirements for tactics durin mathlib4. Please feel free to reorganize these two files. -/ +@[expose] public section + open Function Nat namespace Int diff --git a/Mathlib/Data/Int/Order/Units.lean b/Mathlib/Data/Int/Order/Units.lean index 034b2cb5388104..807fc272b1245a 100644 --- a/Mathlib/Data/Int/Order/Units.lean +++ b/Mathlib/Data/Int/Order/Units.lean @@ -3,12 +3,16 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Algebra.Order.Ring.Abs +module + +public import Mathlib.Algebra.Order.Ring.Abs /-! # Lemmas about units in `ℤ`, which interact with the order structure. -/ +@[expose] public section + namespace Int diff --git a/Mathlib/Data/Int/Range.lean b/Mathlib/Data/Int/Range.lean index a01181072cf83c..29ea2048adda54 100644 --- a/Mathlib/Data/Int/Range.lean +++ b/Mathlib/Data/Int/Range.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau -/ -import Mathlib.Algebra.Group.Int.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Basic +module + +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Basic /-! # Intervals in ℤ @@ -17,6 +19,8 @@ less than `n`. This could be unified with `Data.List.Intervals`. See the TODOs there. -/ +@[expose] public section + namespace Int /-- List enumerating `[m, n)`. This is the ℤ variant of `List.Ico`. -/ diff --git a/Mathlib/Data/Int/Sqrt.lean b/Mathlib/Data/Int/Sqrt.lean index 085727bc7de506..f0651346418c8d 100644 --- a/Mathlib/Data/Int/Sqrt.lean +++ b/Mathlib/Data/Int/Sqrt.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Data.Nat.Sqrt -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.Nat.Sqrt +public import Mathlib.Tactic.Common /-! # Square root of integers @@ -13,6 +15,8 @@ This file defines the square root function on integers. `Int.sqrt z` is the grea such that `r * r ≤ z`. If `z ≤ 0`, then `Int.sqrt z = 0`. -/ +@[expose] public section + namespace Int diff --git a/Mathlib/Data/Int/Star.lean b/Mathlib/Data/Int/Star.lean index b4e7290794d364..52bae5e5203d9e 100644 --- a/Mathlib/Data/Int/Star.lean +++ b/Mathlib/Data/Int/Star.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.Abs -import Mathlib.Algebra.Order.Monoid.Submonoid -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Algebra.Order.Star.Basic +module + +public import Mathlib.Algebra.Order.Group.Abs +public import Mathlib.Algebra.Order.Monoid.Submonoid +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Algebra.Order.Star.Basic /-! # Star ordered ring structure on `ℤ` @@ -15,6 +17,8 @@ import Mathlib.Algebra.Order.Star.Basic This file shows that `ℤ` is a `StarOrderedRing`. -/ +@[expose] public section + open AddSubmonoid Set namespace Int diff --git a/Mathlib/Data/Int/SuccPred.lean b/Mathlib/Data/Int/SuccPred.lean index 549d3242b60008..dec0f891fbdbe7 100644 --- a/Mathlib/Data/Int/SuccPred.lean +++ b/Mathlib/Data/Int/SuccPred.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Data.Nat.SuccPred +module + +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Data.Nat.SuccPred /-! # Successors and predecessors of integers @@ -12,6 +14,8 @@ import Mathlib.Data.Nat.SuccPred In this file, we show that `ℤ` is both an archimedean `SuccOrder` and an archimedean `PredOrder`. -/ +@[expose] public section + open Function Order diff --git a/Mathlib/Data/Int/WithZero.lean b/Mathlib/Data/Int/WithZero.lean index ffb4c313406add..2898225f15aebb 100644 --- a/Mathlib/Data/Int/WithZero.lean +++ b/Mathlib/Data/Int/WithZero.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.Data.NNReal.Defs +module + +public import Mathlib.Data.NNReal.Defs /-! # WithZero @@ -26,6 +28,8 @@ the morphism `WithZeroMultInt.toNNReal`. WithZero, multiplicative, nnreal -/ +@[expose] public section + assert_not_exists Finset noncomputable section diff --git a/Mathlib/Data/List/AList.lean b/Mathlib/Data/List/AList.lean index 06f4774b482920..9000ca9d68fb39 100644 --- a/Mathlib/Data/List/AList.lean +++ b/Mathlib/Data/List/AList.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Sean Leather. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sean Leather, Mario Carneiro -/ -import Mathlib.Data.List.Sigma +module + +public import Mathlib.Data.List.Sigma /-! # Association Lists @@ -32,6 +34,8 @@ provides ways to access, modify, and combine `AList`s. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Data/List/Basic.lean b/Mathlib/Data/List/Basic.lean index 396d05bae12a1d..4099ed1392efb0 100644 --- a/Mathlib/Data/List/Basic.lean +++ b/Mathlib/Data/List/Basic.lean @@ -3,18 +3,22 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Control.Basic -import Mathlib.Data.Option.Basic -import Mathlib.Data.List.Defs -import Mathlib.Data.List.Monad -import Mathlib.Logic.OpClass -import Mathlib.Logic.Unique -import Mathlib.Tactic.Common +module + +public import Mathlib.Control.Basic +public import Mathlib.Data.Option.Basic +public import Mathlib.Data.List.Defs +public import Mathlib.Data.List.Monad +public import Mathlib.Logic.OpClass +public import Mathlib.Logic.Unique +public import Mathlib.Tactic.Common /-! # Basic properties of lists -/ +@[expose] public section + assert_not_exists Lattice assert_not_exists Monoid assert_not_exists Preorder @@ -441,10 +445,18 @@ theorem exists_mem_iff_getElem {l : List α} {p : α → Prop} : simp only [mem_iff_getElem] exact ⟨fun ⟨_x, ⟨i, hi, hix⟩, hxp⟩ ↦ ⟨i, hi, hix ▸ hxp⟩, fun ⟨i, hi, hp⟩ ↦ ⟨_, ⟨i, hi, rfl⟩, hp⟩⟩ +theorem exists_mem_iff_get {l : List α} {p : α → Prop} : + (∃ x ∈ l, p x) ↔ ∃ (i : Fin l.length), p (l.get i) := + exists_mem_iff_getElem.trans ⟨fun ⟨i, hi, h⟩ ↦ ⟨⟨i, hi⟩, h⟩, fun ⟨i, h⟩ ↦ ⟨i, i.isLt, h⟩⟩ + theorem forall_mem_iff_getElem {l : List α} {p : α → Prop} : (∀ x ∈ l, p x) ↔ ∀ (i : ℕ) (_ : i < l.length), p l[i] := by simp [mem_iff_getElem, @forall_swap α] +theorem forall_mem_iff_get {l : List α} {p : α → Prop} : + (∀ x ∈ l, p x) ↔ ∀ (i : Fin l.length), p (l.get i) := + forall_mem_iff_getElem.trans ⟨fun h i ↦ h i i.isLt, fun h i hi ↦ h ⟨i, hi⟩⟩ + @[simp] theorem get_surjective_iff {l : List α} : l.get.Surjective ↔ (∀ x, x ∈ l) := forall_congr' fun _ ↦ mem_iff_get.symm diff --git a/Mathlib/Data/List/Chain.lean b/Mathlib/Data/List/Chain.lean index 13323c73e20568..a1304627044e85 100644 --- a/Mathlib/Data/List/Chain.lean +++ b/Mathlib/Data/List/Chain.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau, Yury Kudryashov -/ -import Mathlib.Data.List.Forall2 -import Mathlib.Data.List.Induction -import Mathlib.Data.List.Lex -import Mathlib.Logic.Function.Iterate -import Mathlib.Logic.Relation +module + +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.List.Induction +public import Mathlib.Data.List.Lex +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Logic.Relation /-! # Relation chain @@ -19,6 +21,8 @@ A graph-specialized version is in development and will hopefully be added under sometime soon. -/ +@[expose] public section + assert_not_imported Mathlib.Algebra.Order.Group.Nat universe u v @@ -476,7 +480,7 @@ alias exists_chain_of_relationReflTransGen := exists_isChain_cons_of_relationRef -/ theorem exists_isChain_ne_nil_of_relationReflTransGen (h : Relation.ReflTransGen r a b) : ∃ l, ∃ (hl : l ≠ []), IsChain r l ∧ l.head hl = a ∧ getLast l hl = b := by - rcases exists_isChain_cons_of_relationReflTransGen h with ⟨l, _⟩; use (a :: l); grind + rcases exists_isChain_cons_of_relationReflTransGen h with ⟨l, _⟩; grind /-- Given a chain `l`, such that a predicate `p` holds for its head if it is nonempty, and if `r x y → p x → p y`, then the predicate is true everywhere in the chain. diff --git a/Mathlib/Data/List/ChainOfFn.lean b/Mathlib/Data/List/ChainOfFn.lean index b231fcde83f143..b007fa70c50ae4 100644 --- a/Mathlib/Data/List/ChainOfFn.lean +++ b/Mathlib/Data/List/ChainOfFn.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Data.List.Chain -import Mathlib.Data.List.OfFn +module + +public import Mathlib.Data.List.Chain +public import Mathlib.Data.List.OfFn /-! # Lemmas about `IsChain` and `ofFn` @@ -12,6 +14,8 @@ import Mathlib.Data.List.OfFn This file provides lemmas involving both `List.IsChain` and `List.ofFn`. -/ +@[expose] public section + open Nat namespace List diff --git a/Mathlib/Data/List/Count.lean b/Mathlib/Data/List/Count.lean index df2f02113e15e4..edb04a2092446b 100644 --- a/Mathlib/Data/List/Count.lean +++ b/Mathlib/Data/List/Count.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Batteries.Data.List.Perm -import Mathlib.Tactic.Common +module + +public import Batteries.Data.List.Perm +public import Mathlib.Tactic.Common /-! # Counting in lists @@ -13,6 +15,8 @@ This file proves basic properties of `List.countP` and `List.count`, which count elements of a list satisfying a predicate and equal to a given element respectively. -/ +@[expose] public section + assert_not_exists Monoid Set.range open Nat diff --git a/Mathlib/Data/List/Cycle.lean b/Mathlib/Data/List/Cycle.lean index 308bfdaf22d4d7..cb0e2e4bbd03f5 100644 --- a/Mathlib/Data/List/Cycle.lean +++ b/Mathlib/Data/List/Cycle.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.Fintype.List -import Mathlib.Data.Fintype.OfMap +module + +public import Mathlib.Data.Fintype.List +public import Mathlib.Data.Fintype.OfMap /-! # Cycles of a list @@ -21,6 +23,8 @@ is different. -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace List @@ -316,6 +320,12 @@ theorem prev_getElem (l : List α) (h : Nodup l) (i : Nat) (hi : i < l.length) : rw [nodup_iff_injective_get] at h apply h; rw [← H]; simp +@[simp] +theorem next_getLast_eq_head (l : List α) (h : l ≠ []) (hn : l.Nodup) : + l.next (l.getLast h) (getLast_mem h) = l.head h := by + have h1 : l.length - 1 + 1 = l.length := by grind [length_pos_iff] + simp [getLast_eq_getElem h, head_eq_getElem h, next_getElem l hn (l.length - 1) (by grind), h1] + theorem pmap_next_eq_rotate_one (h : Nodup l) : (l.pmap l.next fun _ h => h) = l.rotate 1 := by apply List.ext_getElem · simp diff --git a/Mathlib/Data/List/Dedup.lean b/Mathlib/Data/List/Dedup.lean index 065560fc33b86b..c56c9adf5e6ba6 100644 --- a/Mathlib/Data/List/Dedup.lean +++ b/Mathlib/Data/List/Dedup.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Nodup -import Mathlib.Data.List.Lattice -import Batteries.Data.List.Pairwise +module + +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.List.Lattice +public import Batteries.Data.List.Pairwise /-! # Erasure of duplicates in a list @@ -19,6 +21,8 @@ occurrence of each. duplicate, multiplicity, nodup, `nub` -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/List/Defs.lean b/Mathlib/Data/List/Defs.lean index 22e9b9a26a1457..06634a18061859 100644 --- a/Mathlib/Data/List/Defs.lean +++ b/Mathlib/Data/List/Defs.lean @@ -3,13 +3,15 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.Nat.Notation -import Mathlib.Control.Functor -import Mathlib.Data.SProd -import Mathlib.Util.CompileInductive -import Batteries.Tactic.Lint.Basic -import Batteries.Data.List.Basic -import Batteries.Logic +module + +public import Mathlib.Data.Nat.Notation +public import Mathlib.Control.Functor +public import Mathlib.Data.SProd +public import Mathlib.Util.CompileInductive +public import Batteries.Tactic.Lint.Basic +public import Batteries.Data.List.Basic +public import Batteries.Logic /-! ## Definitions on lists @@ -18,6 +20,8 @@ This file contains various definitions on lists. It does not contain proofs about these definitions, those are contained in other files in `Data.List` -/ +@[expose] public section + namespace List open Function Nat diff --git a/Mathlib/Data/List/Destutter.lean b/Mathlib/Data/List/Destutter.lean index 57774df85d4aa9..8bbc50e6a26fae 100644 --- a/Mathlib/Data/List/Destutter.lean +++ b/Mathlib/Data/List/Destutter.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez, Eric Wieser -/ -import Mathlib.Data.List.Chain -import Mathlib.Data.List.Dedup +module + +public import Mathlib.Data.List.Chain +public import Mathlib.Data.List.Dedup /-! # Destuttering of Lists @@ -26,6 +28,8 @@ Note that we make no guarantees of being the longest sublist with this property; adjacent, chain, duplicates, remove, list, stutter, destutter -/ +@[expose] public section + open Function variable {α β : Type*} (l l₁ l₂ : List α) (R : α → α → Prop) [DecidableRel R] {a b : α} diff --git a/Mathlib/Data/List/DropRight.lean b/Mathlib/Data/List/DropRight.lean index 2083cc4426fdd4..f830f52d0ff84a 100644 --- a/Mathlib/Data/List/DropRight.lean +++ b/Mathlib/Data/List/DropRight.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.List.Induction -import Mathlib.Data.List.TakeWhile +module + +public import Mathlib.Data.List.Induction +public import Mathlib.Data.List.TakeWhile /-! @@ -31,6 +33,8 @@ another function that takes a `L : ℕ` and use `L - n`. Under a proof condition -/ +@[expose] public section + -- Make sure we don't import algebra assert_not_exists Monoid diff --git a/Mathlib/Data/List/Duplicate.lean b/Mathlib/Data/List/Duplicate.lean index 277d6c0462f3b9..1249d4efcb36bf 100644 --- a/Mathlib/Data/List/Duplicate.lean +++ b/Mathlib/Data/List/Duplicate.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky, Chris Hughes -/ -import Mathlib.Data.List.Nodup +module + +public import Mathlib.Data.List.Nodup /-! # List duplicates @@ -18,6 +20,8 @@ In this file, `x ∈+ l` notation is shorthand for `List.Duplicate x l`. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Data/List/Enum.lean b/Mathlib/Data/List/Enum.lean index 6b8b345de99e04..5741492d07415b 100644 --- a/Mathlib/Data/List/Enum.lean +++ b/Mathlib/Data/List/Enum.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yakov Pechersky, Eric Wieser -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! # Properties of `List.enum` -/ +@[expose] public section + namespace List variable {α : Type*} diff --git a/Mathlib/Data/List/FinRange.lean b/Mathlib/Data/List/FinRange.lean index eeb1a6dd84032e..d059f182b7d863 100644 --- a/Mathlib/Data/List/FinRange.lean +++ b/Mathlib/Data/List/FinRange.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau, Kim Morrison, Alex Keizer -/ -import Mathlib.Data.List.OfFn -import Batteries.Data.List.Perm -import Mathlib.Data.List.Nodup +module + +public import Mathlib.Data.List.OfFn +public import Batteries.Data.List.Perm +public import Mathlib.Data.List.Nodup /-! # Lists of elements of `Fin n` @@ -13,6 +15,8 @@ import Mathlib.Data.List.Nodup This file develops some results on `finRange n`. -/ +@[expose] public section + assert_not_exists Monoid universe u @@ -70,11 +74,11 @@ theorem finRange_succ_eq_map (n : ℕ) : finRange n.succ = 0 :: (finRange n).map theorem ofFn_eq_pmap {n} {f : Fin n → α} : ofFn f = pmap (fun i hi => f ⟨i, hi⟩) (range n) fun _ => mem_range.1 := by - rw [pmap_eq_map_attach] - exact ext_getElem (by simp) fun i hi1 hi2 => by simp [List.getElem_ofFn hi1] + ext + grind theorem ofFn_id (n) : ofFn id = finRange n := - rfl + (rfl) theorem ofFn_eq_map {n} {f : Fin n → α} : ofFn f = (finRange n).map f := by rw [← ofFn_id, map_ofFn, Function.comp_id] diff --git a/Mathlib/Data/List/Flatten.lean b/Mathlib/Data/List/Flatten.lean index cc198aca4ec9be..9f11ff1a2d1c13 100644 --- a/Mathlib/Data/List/Flatten.lean +++ b/Mathlib/Data/List/Flatten.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn, Mario Carneiro, Martin Dvorak -/ -import Mathlib.Tactic.GCongr.Core -import Mathlib.Util.AssertExists +module + +public import Mathlib.Tactic.GCongr.Core +public import Mathlib.Util.AssertExists /-! # Join of a list of lists @@ -13,6 +15,8 @@ This file proves basic properties of `List.flatten`, which concatenates a list o defined in `Init.Prelude`. -/ +@[expose] public section + -- Make sure we don't import algebra assert_not_exists Monoid diff --git a/Mathlib/Data/List/Forall2.lean b/Mathlib/Data/List/Forall2.lean index 31ed0a420d18e8..8744d292b4d538 100644 --- a/Mathlib/Data/List/Forall2.lean +++ b/Mathlib/Data/List/Forall2.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! # Double universal quantification on a list @@ -13,6 +15,8 @@ This file provides an API for `List.Forall₂` (definition in `Data.List.Defs`). of `l₁`, and `b` is the nth element of `l₂`, then `R a b` is satisfied. -/ +@[expose] public section + open Nat Function diff --git a/Mathlib/Data/List/GetD.lean b/Mathlib/Data/List/GetD.lean index ed320add77b461..8d4dbc864abf92 100644 --- a/Mathlib/Data/List/GetD.lean +++ b/Mathlib/Data/List/GetD.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey, Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Defs -import Mathlib.Data.Option.Basic -import Mathlib.Util.AssertExists +module + +public import Mathlib.Data.List.Defs +public import Mathlib.Data.Option.Basic +public import Mathlib.Util.AssertExists /-! # getD and getI @@ -15,6 +17,8 @@ access an element of a list by numerical index, with a default value as a fallba is out of range. -/ +@[expose] public section + assert_not_imported Mathlib.Algebra.Order.Group.Nat namespace List diff --git a/Mathlib/Data/List/Indexes.lean b/Mathlib/Data/List/Indexes.lean index 45c53e20a47785..12d58d1e86894c 100644 --- a/Mathlib/Data/List/Indexes.lean +++ b/Mathlib/Data/List/Indexes.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ -import Mathlib.Util.AssertExists -import Mathlib.Data.List.Defs +module + +public import Mathlib.Util.AssertExists +public import Mathlib.Data.List.Defs /-! # Lemmas about List.*Idx functions. @@ -20,6 +22,8 @@ Anyone wanting to restore this material is welcome to do so, but will need to up However, note that this material will later be implemented in the Lean standard library. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u v diff --git a/Mathlib/Data/List/Induction.lean b/Mathlib/Data/List/Induction.lean index dddcf1bfdd2c3f..d943b902e084a8 100644 --- a/Mathlib/Data/List/Induction.lean +++ b/Mathlib/Data/List/Induction.lean @@ -3,10 +3,14 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! ### Induction principles for lists -/ +@[expose] public section + variable {α : Type*} namespace List diff --git a/Mathlib/Data/List/Infix.lean b/Mathlib/Data/List/Infix.lean index 9b60a9c3ab5ea4..4079db9a8087a8 100644 --- a/Mathlib/Data/List/Infix.lean +++ b/Mathlib/Data/List/Infix.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.TakeDrop -import Mathlib.Data.List.Induction -import Mathlib.Data.Nat.Basic -import Mathlib.Order.Basic +module + +public import Mathlib.Data.List.TakeDrop +public import Mathlib.Data.List.Induction +public import Mathlib.Data.Nat.Basic +public import Mathlib.Order.Basic /-! # Prefixes, suffixes, infixes @@ -28,6 +30,8 @@ All those (except `insert`) are defined in `Mathlib/Data/List/Defs.lean`. * `l₁ <:+: l₂`: `l₁` is an infix of `l₂`. -/ +@[expose] public section + variable {α β : Type*} namespace List diff --git a/Mathlib/Data/List/InsertIdx.lean b/Mathlib/Data/List/InsertIdx.lean index b90a16262ed8de..a7129c6c49011b 100644 --- a/Mathlib/Data/List/InsertIdx.lean +++ b/Mathlib/Data/List/InsertIdx.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Basic -import Mathlib.Data.Nat.Basic -import Mathlib.Order.Basic +module + +public import Mathlib.Data.List.Basic +public import Mathlib.Data.Nat.Basic +public import Mathlib.Order.Basic /-! # insertIdx @@ -13,6 +15,8 @@ import Mathlib.Order.Basic Proves various lemmas about `List.insertIdx`. -/ +@[expose] public section + assert_not_exists Set.range open Function diff --git a/Mathlib/Data/List/InsertNth.lean b/Mathlib/Data/List/InsertNth.lean index 6e07a0f4691b7a..6855f507bd960e 100644 --- a/Mathlib/Data/List/InsertNth.lean +++ b/Mathlib/Data/List/InsertNth.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.List.InsertIdx +module + +public import Mathlib.Data.List.InsertIdx /-! This is a stub file for importing `Mathlib/Data/List/InsertNth.lean`, @@ -11,3 +13,5 @@ which has been renamed to `Mathlib/Data/List/InsertIdx.lean`. This file can be removed once the deprecation for `List.insertNth` is removed. -/ + +@[expose] public section diff --git a/Mathlib/Data/List/Intervals.lean b/Mathlib/Data/List/Intervals.lean index 89874d7b37d11c..74a5c8d178611e 100644 --- a/Mathlib/Data/List/Intervals.lean +++ b/Mathlib/Data/List/Intervals.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.List.Lattice -import Mathlib.Data.Bool.Basic -import Mathlib.Order.Lattice +module + +public import Mathlib.Data.List.Lattice +public import Mathlib.Data.Bool.Basic +public import Mathlib.Order.Lattice /-! # Intervals in ℕ @@ -21,6 +23,8 @@ and strictly less than `n`. - Once the above is done, get rid of `Int.range` (and maybe `List.range'`?). -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/List/Iterate.lean b/Mathlib/Data/List/Iterate.lean index 46d8b7665571fa..5ae7004083d4d1 100644 --- a/Mathlib/Data/List/Iterate.lean +++ b/Mathlib/Data/List/Iterate.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Miyahara Kō. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Miyahara Kō -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Data.List.Defs -import Mathlib.Data.Set.Function +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Data.List.Defs +public import Mathlib.Data.Set.Function /-! # iterate @@ -13,6 +15,8 @@ import Mathlib.Data.Set.Function Proves various lemmas about `List.iterate`. -/ +@[expose] public section + variable {α : Type*} namespace List diff --git a/Mathlib/Data/List/Lattice.lean b/Mathlib/Data/List/Lattice.lean index d56026e0b283fa..7ec4e800374379 100644 --- a/Mathlib/Data/List/Lattice.lean +++ b/Mathlib/Data/List/Lattice.lean @@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro, Kim Morrison -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! # Lattice structure of lists @@ -24,6 +26,8 @@ As opposed to `List.inter`, `List.bagInter` copes well with multiplicity. For ex `bagInter [0, 1, 2, 3, 2, 1, 0] [1, 0, 1, 4, 3] = [0, 1, 3, 1]`. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/List/Lemmas.lean b/Mathlib/Data/List/Lemmas.lean index 0b629c0baffd91..f0e5c1d3601657 100644 --- a/Mathlib/Data/List/Lemmas.lean +++ b/Mathlib/Data/List/Lemmas.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky, Yury Kudryashov -/ -import Mathlib.Data.Set.Image -import Mathlib.Data.List.InsertIdx +module + +public import Mathlib.Data.Set.Image +public import Mathlib.Data.List.InsertIdx /-! # Some lemmas about lists involving sets Split out from `Data.List.Basic` to reduce its dependencies. -/ +@[expose] public section + variable {α β γ : Type*} namespace List diff --git a/Mathlib/Data/List/Lex.lean b/Mathlib/Data/List/Lex.lean index 69713e18c92cbb..a47a4e211174e5 100644 --- a/Mathlib/Data/List/Lex.lean +++ b/Mathlib/Data/List/Lex.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Basic -import Mathlib.Data.Nat.Basic -import Mathlib.Order.RelClasses +module + +public import Mathlib.Data.List.Basic +public import Mathlib.Data.Nat.Basic +public import Mathlib.Order.RelClasses /-! # Lexicographic ordering of lists. @@ -25,6 +27,8 @@ Related files are: * `Mathlib/Data/Prod/Lex.lean`: Lexicographic order on `α × β`. -/ +@[expose] public section + namespace List diff --git a/Mathlib/Data/List/Lookmap.lean b/Mathlib/Data/List/Lookmap.lean index 834343743ce399..81fa8b9d81ded4 100644 --- a/Mathlib/Data/List/Lookmap.lean +++ b/Mathlib/Data/List/Lookmap.lean @@ -3,12 +3,17 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Batteries.Logic -import Batteries.Data.List.Basic -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Logic +public import Batteries.Data.List.Basic +public import Mathlib.Tactic.TypeStar +import all Init.Data.Array.Basic /-! ### lookmap -/ +@[expose] public section + variable {α β : Type*} namespace List diff --git a/Mathlib/Data/List/Map2.lean b/Mathlib/Data/List/Map2.lean index 96001750987ae6..c2e21ef6838ec4 100644 --- a/Mathlib/Data/List/Map2.lean +++ b/Mathlib/Data/List/Map2.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Defs -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.List.Defs +public import Mathlib.Tactic.Common /-! # Map₂ Lemmas @@ -20,6 +22,8 @@ Lists together. In particular, we include lemmas about: -/ +@[expose] public section + assert_not_exists GroupWithZero assert_not_exists Lattice assert_not_exists Prod.swap_eq_iff_eq_swap diff --git a/Mathlib/Data/List/MinMax.lean b/Mathlib/Data/List/MinMax.lean index 6836b2cdd8cb89..63d18800ea7992 100644 --- a/Mathlib/Data/List/MinMax.lean +++ b/Mathlib/Data/List/MinMax.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Minchao Wu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Minchao Wu, Chris Hughes, Mantas Bakšys -/ -import Mathlib.Data.List.Basic -import Mathlib.Order.BoundedOrder.Lattice -import Mathlib.Data.List.Induction -import Mathlib.Order.MinMax -import Mathlib.Order.WithBot +module + +public import Mathlib.Data.List.Basic +public import Mathlib.Order.BoundedOrder.Lattice +public import Mathlib.Data.List.Induction +public import Mathlib.Order.MinMax +public import Mathlib.Order.WithBot /-! # Minimum and maximum of lists @@ -24,6 +26,8 @@ The main definitions are `argmax`, `argmin`, `minimum` and `maximum` for lists. `[]` -/ +@[expose] public section + namespace List variable {α β : Type*} diff --git a/Mathlib/Data/List/ModifyLast.lean b/Mathlib/Data/List/ModifyLast.lean index a6ab6ec91ec1bc..1be4012a1921ed 100644 --- a/Mathlib/Data/List/ModifyLast.lean +++ b/Mathlib/Data/List/ModifyLast.lean @@ -3,12 +3,17 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Batteries.Data.List.Basic -import Batteries.Tactic.Alias -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Data.List.Basic +public import Batteries.Tactic.Alias +public import Mathlib.Tactic.TypeStar +import all Init.Data.Array.Basic /-! ### List.modifyLast -/ +@[expose] public section + variable {α : Type*} namespace List diff --git a/Mathlib/Data/List/Monad.lean b/Mathlib/Data/List/Monad.lean index 69528b2dcee1d7..b413ff3c1b2fa9 100644 --- a/Mathlib/Data/List/Monad.lean +++ b/Mathlib/Data/List/Monad.lean @@ -3,13 +3,16 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ +module -import Mathlib.Init -import Batteries.Control.AlternativeMonad +public import Mathlib.Init +public import Batteries.Control.AlternativeMonad /-! # Monad instances for `List` -/ +@[expose] public section + universe u namespace List diff --git a/Mathlib/Data/List/NatAntidiagonal.lean b/Mathlib/Data/List/NatAntidiagonal.lean index 4052b7a5e78625..2bbc4b12f5e59e 100644 --- a/Mathlib/Data/List/NatAntidiagonal.lean +++ b/Mathlib/Data/List/NatAntidiagonal.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Data.List.Nodup +module + +public import Mathlib.Data.List.Nodup /-! # Antidiagonals in ℕ × ℕ as lists @@ -18,6 +20,8 @@ Files `Data.Multiset.NatAntidiagonal` and `Data.Finset.NatAntidiagonal` successi `List` definition we have here into `Multiset` and `Finset`. -/ +@[expose] public section + open Function namespace List diff --git a/Mathlib/Data/List/Nodup.lean b/Mathlib/Data/List/Nodup.lean index 5642dde00f0dd9..40c052a8a6297c 100644 --- a/Mathlib/Data/List/Nodup.lean +++ b/Mathlib/Data/List/Nodup.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau -/ -import Mathlib.Data.List.Forall2 -import Mathlib.Data.Nat.Basic -import Mathlib.Order.Basic +module + +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.Nat.Basic +public import Mathlib.Order.Basic /-! # Lists with no duplicates @@ -14,6 +16,8 @@ import Mathlib.Order.Basic predicate. -/ +@[expose] public section + universe u v @@ -172,6 +176,8 @@ theorem nodup_append' {l₁ l₂ : List α} : theorem disjoint_of_nodup_append {l₁ l₂ : List α} (d : Nodup (l₁ ++ l₂)) : Disjoint l₁ l₂ := (nodup_append'.1 d).2.2 +protected alias Nodup.disjoint := disjoint_of_nodup_append + theorem Nodup.append (d₁ : Nodup l₁) (d₂ : Nodup l₂) (dj : Disjoint l₁ l₂) : Nodup (l₁ ++ l₂) := nodup_append'.2 ⟨d₁, d₂, dj⟩ diff --git a/Mathlib/Data/List/NodupEquivFin.lean b/Mathlib/Data/List/NodupEquivFin.lean index 0c145bb572fafe..cc2d088539cf58 100644 --- a/Mathlib/Data/List/NodupEquivFin.lean +++ b/Mathlib/Data/List/NodupEquivFin.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.List.Duplicate -import Mathlib.Data.List.Sort +module + +public import Mathlib.Data.List.Duplicate +public import Mathlib.Data.List.Sort /-! # Equivalence between `Fin (length l)` and elements of a list @@ -25,6 +27,8 @@ Given a list `l`, -/ +@[expose] public section + namespace List diff --git a/Mathlib/Data/List/OfFn.lean b/Mathlib/Data/List/OfFn.lean index 63f263415d524b..78b6b082a074c2 100644 --- a/Mathlib/Data/List/OfFn.lean +++ b/Mathlib/Data/List/OfFn.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fin.Tuple.Basic +module + +public import Mathlib.Data.Fin.Tuple.Basic /-! # Lists from functions @@ -20,6 +22,8 @@ The main statements pertain to lists generated using `List.ofFn` via `List.ofFn`. -/ +@[expose] public section + assert_not_exists Monoid universe u diff --git a/Mathlib/Data/List/Pairwise.lean b/Mathlib/Data/List/Pairwise.lean index b29968d0498df4..97f8dae1759110 100644 --- a/Mathlib/Data/List/Pairwise.lean +++ b/Mathlib/Data/List/Pairwise.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Batteries.Data.List.Pairwise -import Mathlib.Logic.Pairwise -import Mathlib.Logic.Relation +module + +public import Batteries.Data.List.Pairwise +public import Mathlib.Logic.Pairwise +public import Mathlib.Logic.Relation /-! # Pairwise relations on a list @@ -24,6 +26,8 @@ the pairwiseness of the list we have so far. It thus yields `l'` a maximal subli sorted, nodup -/ +@[expose] public section + open Nat Function diff --git a/Mathlib/Data/List/Palindrome.lean b/Mathlib/Data/List/Palindrome.lean index 599d40cab0d6e5..6526e7b869f6e0 100644 --- a/Mathlib/Data/List/Palindrome.lean +++ b/Mathlib/Data/List/Palindrome.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Google LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Wong -/ -import Mathlib.Data.List.Induction +module + +public import Mathlib.Data.List.Induction /-! # Palindromes @@ -24,6 +26,8 @@ principle. Also provided are conversions to and from other equivalent definition palindrome, reverse, induction -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/List/Perm/Basic.lean b/Mathlib/Data/List/Perm/Basic.lean index 73780c1b849d50..0c30ba01275b26 100644 --- a/Mathlib/Data/List/Perm/Basic.lean +++ b/Mathlib/Data/List/Perm/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Batteries.Data.List.Perm -import Mathlib.Logic.Relation -import Mathlib.Order.RelClasses -import Mathlib.Data.List.Forall2 -import Mathlib.Data.List.InsertIdx +module + +public import Batteries.Data.List.Perm +public import Mathlib.Logic.Relation +public import Mathlib.Order.RelClasses +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.List.InsertIdx /-! # List Permutations @@ -19,6 +21,8 @@ This file develops theory about the `List.Perm` relation. The notation `~` is used for permutation equivalence. -/ +@[expose] public section + -- Make sure we don't import algebra assert_not_exists Monoid diff --git a/Mathlib/Data/List/Perm/Lattice.lean b/Mathlib/Data/List/Perm/Lattice.lean index d0e7732fbdd816..ddff21d70a86e8 100644 --- a/Mathlib/Data/List/Perm/Lattice.lean +++ b/Mathlib/Data/List/Perm/Lattice.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.List.Forall2 -import Mathlib.Data.List.TakeDrop -import Mathlib.Data.List.Lattice -import Mathlib.Data.List.Nodup +module + +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.List.TakeDrop +public import Mathlib.Data.List.Lattice +public import Mathlib.Data.List.Nodup /-! # List Permutations and list lattice operations. @@ -14,6 +16,8 @@ import Mathlib.Data.List.Nodup This file develops theory about the `List.Perm` relation and the lattice structure on lists. -/ +@[expose] public section + -- Make sure we don't import algebra assert_not_exists Monoid diff --git a/Mathlib/Data/List/Perm/Subperm.lean b/Mathlib/Data/List/Perm/Subperm.lean index 428b6af2da32d5..ff74767badb9ef 100644 --- a/Mathlib/Data/List/Perm/Subperm.lean +++ b/Mathlib/Data/List/Perm/Subperm.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Batteries.Data.List.Perm -import Mathlib.Data.List.Basic +module + +public import Batteries.Data.List.Perm +public import Mathlib.Data.List.Basic /-! # List Sub-permutations @@ -16,6 +18,8 @@ This file develops theory about the `List.Subperm` relation. The notation `<+~` is used for sub-permutations. -/ +@[expose] public section + open Nat namespace List diff --git a/Mathlib/Data/List/Permutation.lean b/Mathlib/Data/List/Permutation.lean index d78c288a2417cd..12045f0c28c53b 100644 --- a/Mathlib/Data/List/Permutation.lean +++ b/Mathlib/Data/List/Permutation.lean @@ -3,14 +3,16 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Lemmas -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Data.List.Count -import Mathlib.Data.List.Duplicate -import Mathlib.Data.List.InsertIdx -import Mathlib.Data.List.Induction -import Batteries.Data.List.Perm -import Mathlib.Data.List.Perm.Basic +module + +public import Mathlib.Data.List.Lemmas +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.List.Count +public import Mathlib.Data.List.Duplicate +public import Mathlib.Data.List.InsertIdx +public import Mathlib.Data.List.Induction +public import Batteries.Data.List.Perm +public import Mathlib.Data.List.Perm.Basic /-! # Permutations of a list @@ -45,6 +47,8 @@ all positions. Hence, to build `[0, 1, 2, 3].permutations'`, it does `[0, 3, 2, 1], [3, 0, 2, 1], [3, 2, 0, 1], [3, 2, 1, 0]]` -/ +@[expose] public section + -- Make sure we don't import algebra assert_not_exists Monoid diff --git a/Mathlib/Data/List/Pi.lean b/Mathlib/Data/List/Pi.lean index a84efa15764922..a72eaf67ecc219 100644 --- a/Mathlib/Data/List/Pi.lean +++ b/Mathlib/Data/List/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.Data.Multiset.Pi +module + +public import Mathlib.Data.Multiset.Pi /-! # The Cartesian product of lists @@ -13,6 +15,8 @@ import Mathlib.Data.Multiset.Pi * `List.pi`: Cartesian product of lists indexed by a list. -/ +@[expose] public section + namespace List namespace Pi diff --git a/Mathlib/Data/List/Prime.lean b/Mathlib/Data/List/Prime.lean index f0c8764a0553ef..657eb3254fea7f 100644 --- a/Mathlib/Data/List/Prime.lean +++ b/Mathlib/Data/List/Prime.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Anne Baanen -/ -import Mathlib.Algebra.BigOperators.Group.List.Lemmas -import Mathlib.Algebra.GroupWithZero.Associated +module + +public import Mathlib.Algebra.BigOperators.Group.List.Lemmas +public import Mathlib.Algebra.GroupWithZero.Associated /-! # Products of lists of prime elements. @@ -13,6 +15,8 @@ This file contains some theorems relating `Prime` and products of `List`s. -/ +@[expose] public section + open List @@ -55,10 +59,10 @@ theorem perm_of_prod_eq_prod : ∀ {l₁ l₂ : List M}, l₁.prod = l₂.prod → (∀ p ∈ l₁, Prime p) → (∀ p ∈ l₂, Prime p) → Perm l₁ l₂ | [], [], _, _, _ => Perm.nil | [], a :: l, h₁, _, h₃ => - have ha : a ∣ 1 := prod_nil (M := M) ▸ h₁.symm ▸ (prod_cons (l := l)).symm ▸ dvd_mul_right _ _ + have ha : a ∣ 1 := prod_nil (α := M) ▸ h₁.symm ▸ (prod_cons (l := l)).symm ▸ dvd_mul_right _ _ absurd ha (Prime.not_dvd_one (h₃ a mem_cons_self)) | a :: l, [], h₁, h₂, _ => - have ha : a ∣ 1 := prod_nil (M := M) ▸ h₁ ▸ (prod_cons (l := l)).symm ▸ dvd_mul_right _ _ + have ha : a ∣ 1 := prod_nil (α := M) ▸ h₁ ▸ (prod_cons (l := l)).symm ▸ dvd_mul_right _ _ absurd ha (Prime.not_dvd_one (h₂ a mem_cons_self)) | a :: l₁, b :: l₂, h, hl₁, hl₂ => by classical diff --git a/Mathlib/Data/List/ProdSigma.lean b/Mathlib/Data/List/ProdSigma.lean index bc2b8d766d27a9..aaeded97263c4d 100644 --- a/Mathlib/Data/List/ProdSigma.lean +++ b/Mathlib/Data/List/ProdSigma.lean @@ -3,7 +3,9 @@ Copyright (c) 2015 Leonardo de Moura. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! # Lists in product and sigma types @@ -13,6 +15,8 @@ living in `Prod` and `Sigma` types respectively. Their definitions can be found [`Data.List.Defs`](./defs). Beware, this is not about `List.prod`, the multiplicative product. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/List/Range.lean b/Mathlib/Data/List/Range.lean index 6141435a796ce0..ad4b345e0e8bd5 100644 --- a/Mathlib/Data/List/Range.lean +++ b/Mathlib/Data/List/Range.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau, Kim Morrison -/ -import Mathlib.Data.List.Chain +module + +public import Mathlib.Data.List.Chain /-! # Ranges of naturals as lists @@ -16,6 +18,8 @@ tactics. `range' a b = [a, ..., a + b - 1]` is there to help prove properties ab Actual maths should use `List.Ico` instead. -/ +@[expose] public section + universe u open Nat diff --git a/Mathlib/Data/List/ReduceOption.lean b/Mathlib/Data/List/ReduceOption.lean index 4b2736bc8cf941..621fa3a1c8e806 100644 --- a/Mathlib/Data/List/ReduceOption.lean +++ b/Mathlib/Data/List/ReduceOption.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky, Anthony DeRossi -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! # Properties of `List.reduceOption` @@ -11,6 +13,8 @@ import Mathlib.Data.List.Basic In this file we prove basic lemmas about `List.reduceOption`. -/ +@[expose] public section + namespace List variable {α β : Type*} diff --git a/Mathlib/Data/List/Rotate.lean b/Mathlib/Data/List/Rotate.lean index b82510ea736473..e61c85f5e03c4c 100644 --- a/Mathlib/Data/List/Rotate.lean +++ b/Mathlib/Data/List/Rotate.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yakov Pechersky -/ -import Mathlib.Data.List.Nodup -import Mathlib.Data.List.Infix -import Mathlib.Data.Quot +module + +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.List.Infix +public import Mathlib.Data.Quot /-! # List rotation @@ -22,6 +24,8 @@ This file proves basic results about `List.rotate`, the list rotation. rotated, rotation, permutation, cycle -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/List/Sections.lean b/Mathlib/Data/List/Sections.lean index afd8bdee6f5742..fdcb0adee0529a 100644 --- a/Mathlib/Data/List/Sections.lean +++ b/Mathlib/Data/List/Sections.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Forall2 +module + +public import Mathlib.Data.List.Forall2 /-! # List sections @@ -11,6 +13,8 @@ This file proves some stuff about `List.sections` (definition in `Data.List.Defs list of lists `[l₁, ..., lₙ]` is a list whose `i`-th element comes from the `i`-th list. -/ +@[expose] public section + open Nat Function diff --git a/Mathlib/Data/List/Shortlex.lean b/Mathlib/Data/List/Shortlex.lean index 44056ffb35c784..54623f528bb919 100644 --- a/Mathlib/Data/List/Shortlex.lean +++ b/Mathlib/Data/List/Shortlex.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Hannah Fechtner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hannah Fechtner -/ +module -import Mathlib.Data.List.Lex -import Mathlib.Tactic.Linarith -import Mathlib.Order.RelClasses +public import Mathlib.Data.List.Lex +public import Mathlib.Tactic.Linarith +public import Mathlib.Order.RelClasses /-! # Shortlex ordering of lists. @@ -27,6 +28,8 @@ Related files are: and `Pi`. -/ +@[expose] public section + /-! ### shortlex ordering -/ namespace List diff --git a/Mathlib/Data/List/Sigma.lean b/Mathlib/Data/List/Sigma.lean index 11f13defd3d989..5a44f6be1a7a7f 100644 --- a/Mathlib/Data/List/Sigma.lean +++ b/Mathlib/Data/List/Sigma.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Sean Leather -/ -import Batteries.Data.List.Perm -import Mathlib.Data.List.Pairwise -import Mathlib.Data.List.Nodup -import Mathlib.Data.List.Lookmap -import Mathlib.Data.Sigma.Basic +module + +public import Batteries.Data.List.Perm +public import Mathlib.Data.List.Pairwise +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.List.Lookmap +public import Mathlib.Data.Sigma.Basic /-! # Utilities for lists of sigmas @@ -29,6 +31,8 @@ If `α : Type*` and `β : α → Type*`, then we regard `s : Sigma β` as having - `List.kextract` returns a value with a given key and the rest of the values. -/ +@[expose] public section + universe u u' v v' namespace List @@ -176,7 +180,7 @@ theorem dlookup_cons_ne (l) {a} : ∀ s : Sigma β, a ≠ s.1 → dlookup a (s : theorem dlookup_isSome {a : α} {l : List (Sigma β)} : (dlookup a l).isSome ↔ a ∈ l.keys := by induction l with | nil => simp - | cons s _ _ => by_cases a = s.fst <;> grind + | cons s _ _ => by_cases a = s.fst <;> grind +revert theorem dlookup_eq_none {a : α} {l : List (Sigma β)} : dlookup a l = none ↔ a ∉ l.keys := by simp [← dlookup_isSome, Option.isNone_iff_eq_none] @@ -185,7 +189,7 @@ theorem of_mem_dlookup {a : α} {b : β a} {l : List (Sigma β)} : b ∈ dlookup a l → Sigma.mk a b ∈ l := by induction l with | nil => grind - | cons s _ _ => by_cases a = s.fst <;> grind + | cons s _ _ => by_cases a = s.fst <;> grind +revert theorem mem_dlookup {a} {b : β a} {l : List (Sigma β)} (nd : l.NodupKeys) (h : Sigma.mk a b ∈ l) : b ∈ dlookup a l := by @@ -197,7 +201,7 @@ theorem map_dlookup_eq_find (a : α) (l : List (Sigma β)) : (dlookup a l).map (Sigma.mk a) = find? (fun s => a = s.1) l := by induction l with | nil => grind - | cons s _ _ => by_cases s.fst = a <;> grind + | cons s _ _ => by_cases s.fst = a <;> grind +revert theorem mem_dlookup_iff {a : α} {b : β a} {l : List (Sigma β)} (nd : l.NodupKeys) : b ∈ dlookup a l ↔ Sigma.mk a b ∈ l := @@ -219,7 +223,7 @@ theorem dlookup_map (l : List (Sigma β)) | nil => grind | cons s _ _ => have (h : a ≠ s.fst) : ¬ f a = (⟨f s.fst, g s.fst s.snd⟩ : Sigma β').fst := fun he => h <| hf he - by_cases a = s.fst <;> grind [Sigma.map] + by_cases a = s.fst <;> grind +revert [Sigma.map] theorem dlookup_map₁ {β : Type v} (l : List (Σ _ : α, β)) {f : α → α'} (hf : Function.Injective f) (a : α) : @@ -255,7 +259,7 @@ theorem dlookup_append (l₁ l₂ : List (Sigma β)) (a : α) : (l₁ ++ l₂).dlookup a = (l₁.dlookup a).or (l₂.dlookup a) := by induction l₁ with | nil => rfl - | cons s _ _ => by_cases a = s.fst <;> grind + | cons s _ _ => by_cases a = s.fst <;> grind +revert theorem sublist_dlookup {l₁ l₂ : List (Sigma β)} {a : α} {b : β a} (nd₂ : l₂.NodupKeys) (s : l₁ <+ l₂) (mem : b ∈ l₁.dlookup a) : b ∈ l₂.dlookup a := by diff --git a/Mathlib/Data/List/Sort.lean b/Mathlib/Data/List/Sort.lean index 229d051d445c75..60755dc4cef657 100644 --- a/Mathlib/Data/List/Sort.lean +++ b/Mathlib/Data/List/Sort.lean @@ -3,12 +3,15 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Batteries.Data.List.Pairwise -import Batteries.Data.List.Perm -import Mathlib.Data.List.OfFn -import Mathlib.Data.List.Nodup -import Mathlib.Data.List.TakeWhile -import Mathlib.Order.Fin.Basic +module + +public import Batteries.Data.List.Pairwise +public import Batteries.Data.List.Perm +public import Mathlib.Data.List.OfFn +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.List.TakeWhile +public import Mathlib.Order.Fin.Basic +import all Init.Data.List.Sort.Basic -- for exposing `mergeSort` /-! # Sorting algorithms on lists @@ -19,6 +22,8 @@ Then we define the sorting algorithm `List.insertionSort` and prove its correctness. -/ +@[expose] public section + open List.Perm universe u v diff --git a/Mathlib/Data/List/SplitBy.lean b/Mathlib/Data/List/SplitBy.lean index caaee1c6bd5444..ffb266318eb2ff 100644 --- a/Mathlib/Data/List/SplitBy.lean +++ b/Mathlib/Data/List/SplitBy.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Data.List.Chain +module + +public import Mathlib.Data.List.Chain /-! # Split a list into contiguous runs of elements which pairwise satisfy a relation. @@ -19,6 +21,8 @@ The main results are the following: related to the first element of the next list. -/ +@[expose] public section + namespace List variable {α : Type*} {m : List α} diff --git a/Mathlib/Data/List/SplitLengths.lean b/Mathlib/Data/List/SplitLengths.lean index 7e20264322542a..241871ad812329 100644 --- a/Mathlib/Data/List/SplitLengths.lean +++ b/Mathlib/Data/List/SplitLengths.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Order.MinMax +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Order.MinMax /-! # Splitting a list to chunks of specified lengths @@ -12,6 +14,8 @@ import Mathlib.Order.MinMax This file defines splitting a list to chunks of given lengths, and some proofs about that. -/ +@[expose] public section + variable {α : Type*} (l : List α) (sz : List ℕ) namespace List diff --git a/Mathlib/Data/List/SplitOn.lean b/Mathlib/Data/List/SplitOn.lean index ac141b2c697cd7..785c1ee1445dd5 100644 --- a/Mathlib/Data/List/SplitOn.lean +++ b/Mathlib/Data/List/SplitOn.lean @@ -3,10 +3,14 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Basic +module + +public import Mathlib.Data.List.Basic /-! ### List.splitOn -/ +@[expose] public section + namespace List variable {α : Type*} (p : α → Bool) (xs : List α) (ls : List (List α)) @@ -14,7 +18,7 @@ variable {α : Type*} (p : α → Bool) (xs : List α) (ls : List (List α)) attribute [simp] splitAt_eq @[simp] -theorem splitOn_nil [DecidableEq α] (a : α) : [].splitOn a = [[]] := +theorem splitOn_nil [BEq α] (a : α) : [].splitOn a = [[]] := rfl @[simp] diff --git a/Mathlib/Data/List/Sublists.lean b/Mathlib/Data/List/Sublists.lean index 0651f820927570..6300792986136b 100644 --- a/Mathlib/Data/List/Sublists.lean +++ b/Mathlib/Data/List/Sublists.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Data.List.FinRange -import Mathlib.Data.List.Perm.Basic -import Mathlib.Data.List.Lex -import Mathlib.Data.List.Induction +module + +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Data.List.FinRange +public import Mathlib.Data.List.Perm.Basic +public import Mathlib.Data.List.Lex +public import Mathlib.Data.List.Induction /-! # sublists @@ -16,6 +18,8 @@ import Mathlib.Data.List.Induction This file contains basic results on this function. -/ +@[expose] public section + universe u v w variable {α : Type u} {β : Type v} {γ : Type w} diff --git a/Mathlib/Data/List/Sym.lean b/Mathlib/Data/List/Sym.lean index 091be443c2a29f..98e6fb610f16d4 100644 --- a/Mathlib/Data/List/Sym.lean +++ b/Mathlib/Data/List/Sym.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Data.Sym.Sym2 +module + +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Data.Sym.Sym2 /-! # Unordered tuples of elements of a list @@ -25,6 +27,8 @@ from a given list. These are list versions of `Nat.multichoose`. -/ +@[expose] public section + namespace List variable {α β : Type*} diff --git a/Mathlib/Data/List/TFAE.lean b/Mathlib/Data/List/TFAE.lean index c92f426eec0a23..6c900bfd25be7c 100644 --- a/Mathlib/Data/List/TFAE.lean +++ b/Mathlib/Data/List/TFAE.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Simon Hudon -/ -import Batteries.Tactic.Alias -import Batteries.Data.List.Basic -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Tactic.Alias +public import Batteries.Data.List.Basic +public import Mathlib.Tactic.TypeStar /-! # The Following Are Equivalent @@ -15,6 +17,8 @@ This file allows to state that all propositions in a list are equivalent. It is `TFAE l` means `∀ x ∈ l, ∀ y ∈ l, x ↔ y`. This is equivalent to `Pairwise (↔) l`. -/ +@[expose] public section + namespace List diff --git a/Mathlib/Data/List/TakeDrop.lean b/Mathlib/Data/List/TakeDrop.lean index 7598f409358357..ba3b83eb704f95 100644 --- a/Mathlib/Data/List/TakeDrop.lean +++ b/Mathlib/Data/List/TakeDrop.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Data.List.Defs -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.List.Defs +public import Mathlib.Tactic.Common /-! # `Take` and `Drop` lemmas for lists @@ -12,6 +14,8 @@ import Mathlib.Tactic.Common This file provides lemmas about `List.take` and `List.drop` and related functions. -/ +@[expose] public section + assert_not_exists GroupWithZero assert_not_exists Lattice assert_not_exists Prod.swap_eq_iff_eq_swap diff --git a/Mathlib/Data/List/TakeWhile.lean b/Mathlib/Data/List/TakeWhile.lean index 403c149f77f86d..1a7f24c7046b08 100644 --- a/Mathlib/Data/List/TakeWhile.lean +++ b/Mathlib/Data/List/TakeWhile.lean @@ -3,12 +3,16 @@ Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ -import Mathlib.Order.Basic -import Mathlib.Data.Nat.Basic -import Mathlib.Tactic.Set +module + +public import Mathlib.Order.Basic +public import Mathlib.Data.Nat.Basic +public import Mathlib.Tactic.Set /-! ### List.takeWhile and List.dropWhile -/ +@[expose] public section + namespace List variable {α : Type*} (p : α → Bool) diff --git a/Mathlib/Data/List/ToFinsupp.lean b/Mathlib/Data/List/ToFinsupp.lean index 2a9f120c32b1cc..61872b4ef59964 100644 --- a/Mathlib/Data/List/ToFinsupp.lean +++ b/Mathlib/Data/List/ToFinsupp.lean @@ -3,11 +3,12 @@ Copyright (c) 2022 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.BigOperators.Group.List.Basic -import Mathlib.Algebra.Group.Embedding -import Mathlib.Algebra.Group.Finsupp -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Data.List.GetD +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Algebra.Group.Finsupp +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Data.List.GetD /-! @@ -34,6 +35,8 @@ this holds. More work will be needed to support lists over non-dec-eq types like elements are beyond the dec-eq terms of casted values from `ℕ, ℤ, ℚ`. -/ +@[expose] public section + namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l · 0 ≠ 0)] (n : ℕ) @@ -126,6 +129,6 @@ theorem toFinsupp_eq_sum_mapIdx_single {R : Type*} [AddMonoid R] (l : List R) induction l using List.reverseRecOn with | nil => exact toFinsupp_nil | append_singleton x xs ih => - classical simp [toFinsupp_concat_eq_toFinsupp_add_single, ih] + classical simp [toFinsupp_concat_eq_toFinsupp_add_single, sum_append, ih] end List diff --git a/Mathlib/Data/List/Triplewise.lean b/Mathlib/Data/List/Triplewise.lean index 8010e369f3cd79..d078a06228128d 100644 --- a/Mathlib/Data/List/Triplewise.lean +++ b/Mathlib/Data/List/Triplewise.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joseph Myers, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Yaël Dillies -/ -import Aesop -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.MkIffOfInductiveProp +module + +public import Aesop +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.MkIffOfInductiveProp /-! # Triplewise predicates on list. @@ -16,6 +18,8 @@ import Mathlib.Tactic.MkIffOfInductiveProp -/ +@[expose] public section + namespace List diff --git a/Mathlib/Data/List/Zip.lean b/Mathlib/Data/List/Zip.lean index 9c0981ff60f416..67c9f0e8769484 100644 --- a/Mathlib/Data/List/Zip.lean +++ b/Mathlib/Data/List/Zip.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau -/ -import Mathlib.Data.List.Forall2 -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Data.List.Forall2 +public import Mathlib.Data.Nat.Basic /-! # zip & unzip @@ -19,6 +21,8 @@ applies, until one of the lists is exhausted. For example, `unzip` undoes `zip`. For example, `unzip [(a₁, b₁), (a₂, b₂)] = ([a₁, a₂], [b₁, b₂])`. -/ +@[expose] public section + -- Make sure we don't import algebra assert_not_exists Monoid diff --git a/Mathlib/Data/Matrix/Action.lean b/Mathlib/Data/Matrix/Action.lean index b1f9d1144ff117..e852a00989baed 100644 --- a/Mathlib/Data/Matrix/Action.lean +++ b/Mathlib/Data/Matrix/Action.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ +module -import Mathlib.Data.Matrix.Mul -import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Data.Matrix.Mul +public import Mathlib.Algebra.Ring.Opposite /-! # Actions by matrices on vectors through `*ᵥ` and `ᵥ*`, cast as `Module`s @@ -14,6 +15,8 @@ This file provides the left- and right- module structures of square matrices on `Matrix.mulVec` and `Matrix.vecMul`. -/ +@[expose] public section + variable {n R S : Type*} namespace Matrix diff --git a/Mathlib/Data/Matrix/Auto.lean b/Mathlib/Data/Matrix/Auto.lean index b5c2e6228ed916..69f28291ec3c52 100644 --- a/Mathlib/Data/Matrix/Auto.lean +++ b/Mathlib/Data/Matrix/Auto.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Expr -import Mathlib.Data.Matrix.Reflection +module + +public import Mathlib.Algebra.Expr +public import Mathlib.Data.Matrix.Reflection /-! # Automatically generated lemmas for working with concrete matrices @@ -23,3 +25,5 @@ TODO: These magic lemmas have been skipped for now, though the plumbing lemmas i `Mathlib/Data/Matrix/Reflection.lean` are still available. They should probably be implemented as simprocs. -/ + +@[expose] public section diff --git a/Mathlib/Data/Matrix/Basic.lean b/Mathlib/Data/Matrix/Basic.lean index dbe317484c00f1..3f4e46f5e2cbc0 100644 --- a/Mathlib/Data/Matrix/Basic.lean +++ b/Mathlib/Data/Matrix/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Ellen Arlt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ellen Arlt, Blair Shi, Sean Leather, Mario Carneiro, Johan Commelin, Lu-Ming Zhang -/ -import Mathlib.Algebra.Algebra.Opposite -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.BigOperators.RingEquiv -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Matrix.Mul -import Mathlib.LinearAlgebra.Pi +module + +public import Mathlib.Algebra.Algebra.Opposite +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.BigOperators.RingEquiv +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Matrix.Mul +public import Mathlib.LinearAlgebra.Pi /-! # Matrices @@ -28,6 +30,8 @@ Under various conditions, multiplication of infinite matrices makes sense. These have not yet been implemented. -/ +@[expose] public section + assert_not_exists TrivialStar universe u u' v w @@ -790,6 +794,42 @@ open Matrix namespace Matrix +section Pi + +variable {ι : Type*} {β : ι → Type*} + +/-- Matrices over a Pi type are in canonical bijection with tuples of matrices. -/ +@[simps] def piEquiv : Matrix m n (Π i, β i) ≃ Π i, Matrix m n (β i) where + toFun f i := f.map (· i) + invFun f := .of fun j k i ↦ f i j k + left_inv _ := rfl + right_inv _ := rfl + +/-- `piEquiv` as an `AddEquiv`. -/ +@[simps!] def piAddEquiv [∀ i, Add (β i)] : Matrix m n (Π i, β i) ≃+ Π i, Matrix m n (β i) where + __ := piEquiv + map_add' _ _ := rfl + +/-- `piEquiv` as a `LinearEquiv`. -/ +@[simps] def piLinearEquiv (R) [Semiring R] [∀ i, AddCommMonoid (β i)] [∀ i, Module R (β i)] : + Matrix m n (Π i, β i) ≃ₗ[R] Π i, Matrix m n (β i) where + __ := piAddEquiv + map_smul' _ _ := rfl + +/-- `piEquiv` as a `RingEquiv`. -/ +@[simps!] def piRingEquiv [∀ i, AddCommMonoid (β i)] [∀ i, Mul (β i)] [Fintype n] : + Matrix n n (Π i, β i) ≃+* Π i, Matrix n n (β i) where + __ := piAddEquiv + map_mul' _ _ := by ext; simp [Matrix.mul_apply] + +/-- `piEquiv` as an `AlgEquiv`. -/ +@[simps!] def piAlgEquiv (R) [CommSemiring R] [∀ i, Semiring (β i)] [∀ i, Algebra R (β i)] + [Fintype n] [DecidableEq n] : Matrix n n (Π i, β i) ≃ₐ[R] Π i, Matrix n n (β i) where + __ := piRingEquiv + commutes' := (AlgHom.mk' (piRingEquiv (β := β) (n := n)).toRingHom fun _ _ ↦ rfl).commutes + +end Pi + section Transpose open Matrix diff --git a/Mathlib/Data/Matrix/Basis.lean b/Mathlib/Data/Matrix/Basis.lean index 2021486646344c..477343f3357c26 100644 --- a/Mathlib/Data/Matrix/Basis.lean +++ b/Mathlib/Data/Matrix/Basis.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Jalex Stark. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jalex Stark, Kim Morrison, Eric Wieser, Oliver Nash, Wen Yang -/ -import Mathlib.Data.Matrix.Basic +module + +public import Mathlib.Data.Matrix.Basic /-! # Matrices with a single non-zero element. @@ -12,6 +14,8 @@ This file provides `Matrix.single`. The matrix `Matrix.single i j c` has `c` at position `(i, j)`, and zeroes elsewhere. -/ +@[expose] public section + assert_not_exists Matrix.trace variable {l m n o : Type*} diff --git a/Mathlib/Data/Matrix/Bilinear.lean b/Mathlib/Data/Matrix/Bilinear.lean index 923c5be9edf0ef..34da6cc0c24c61 100644 --- a/Mathlib/Data/Matrix/Bilinear.lean +++ b/Mathlib/Data/Matrix/Bilinear.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Module.LinearMap.End -import Mathlib.Data.Matrix.Mul -import Mathlib.Data.Matrix.Basis -import Mathlib.Algebra.Algebra.Bilinear +module + +public import Mathlib.Algebra.Module.LinearMap.End +public import Mathlib.Data.Matrix.Mul +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Algebra.Algebra.Bilinear /-! # Bundled versions of multiplication for matrices @@ -15,6 +17,8 @@ This file provides versions of `LinearMap.mulLeft` and `LinearMap.mulRight` whic heterogeneous multiplication of matrices. -/ +@[expose] public section + variable {l m n o : Type*} {R A : Type*} section NonUnitalNonAssocSemiring diff --git a/Mathlib/Data/Matrix/Block.lean b/Mathlib/Data/Matrix/Block.lean index 3a7970197b5e91..6b9a81d797763e 100644 --- a/Mathlib/Data/Matrix/Block.lean +++ b/Mathlib/Data/Matrix/Block.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Ellen Arlt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ellen Arlt, Blair Shi, Sean Leather, Mario Carneiro, Johan Commelin -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Composition -import Mathlib.LinearAlgebra.Matrix.ConjTranspose +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Composition +public import Mathlib.LinearAlgebra.Matrix.ConjTranspose /-! # Block Matrices @@ -23,6 +25,8 @@ import Mathlib.LinearAlgebra.Matrix.ConjTranspose * `Matrix.blockDiag'`: extract the blocks from the diagonal of a block diagonal matrix. -/ +@[expose] public section + variable {l m n o p q : Type*} {m' n' p' : o → Type*} variable {R : Type*} {S : Type*} {α : Type*} {β : Type*} diff --git a/Mathlib/Data/Matrix/ColumnRowPartitioned.lean b/Mathlib/Data/Matrix/ColumnRowPartitioned.lean index dd0326886e1e8e..f9b38288c671d8 100644 --- a/Mathlib/Data/Matrix/ColumnRowPartitioned.lean +++ b/Mathlib/Data/Matrix/ColumnRowPartitioned.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Mohanad ahmed. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mohanad Ahmed -/ +module -import Mathlib.Data.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.SemiringInverse +public import Mathlib.Data.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.SemiringInverse /-! # Block Matrices from Rows and Columns @@ -21,6 +22,8 @@ with block matrices column matrices, row matrices, column row block matrices -/ +@[expose] public section + namespace Matrix variable {R : Type*} diff --git a/Mathlib/Data/Matrix/Composition.lean b/Mathlib/Data/Matrix/Composition.lean index 385e4820b9e065..478a2ca270bbce 100644 --- a/Mathlib/Data/Matrix/Composition.lean +++ b/Mathlib/Data/Matrix/Composition.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Yunzhou Xie, Eric Wieser -/ +module -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Basis /-! # Composition of matrices @@ -23,6 +24,8 @@ Semiring, and Algebra over a CommSemiring K. -/ +@[expose] public section + namespace Matrix variable (I J K L R R' : Type*) diff --git a/Mathlib/Data/Matrix/DMatrix.lean b/Mathlib/Data/Matrix/DMatrix.lean index 8137a0d5902fa0..cdb6c6fe4522a2 100644 --- a/Mathlib/Data/Matrix/DMatrix.lean +++ b/Mathlib/Data/Matrix/DMatrix.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.Hom.Defs -import Mathlib.Algebra.Group.Pi.Basic +module + +public import Mathlib.Algebra.Group.Hom.Defs +public import Mathlib.Algebra.Group.Pi.Basic /-! # Dependent-typed matrices -/ +@[expose] public section + universe u u' v w z diff --git a/Mathlib/Data/Matrix/Diagonal.lean b/Mathlib/Data/Matrix/Diagonal.lean index c721d40e3d2042..fa900199d251c2 100644 --- a/Mathlib/Data/Matrix/Diagonal.lean +++ b/Mathlib/Data/Matrix/Diagonal.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Ellen Arlt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ellen Arlt, Blair Shi, Sean Leather, Mario Carneiro, Johan Commelin, Lu-Ming Zhang -/ -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Data.Int.Cast.Pi -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.LinearAlgebra.Matrix.Defs -import Mathlib.Logic.Embedding.Basic +module + +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Data.Int.Cast.Pi +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.LinearAlgebra.Matrix.Defs +public import Mathlib.Logic.Embedding.Basic /-! # Diagonal matrices @@ -21,6 +23,8 @@ This file defines diagonal matrices and the `AddCommMonoidWithOne` structure on * `Matrix.instAddCommMonoidWithOne`: matrices are an additive commutative monoid with one -/ +@[expose] public section + assert_not_exists Algebra TrivialStar universe u u' v w diff --git a/Mathlib/Data/Matrix/DualNumber.lean b/Mathlib/Data/Matrix/DualNumber.lean index 730e46fb94493a..38cf082d72fc1e 100644 --- a/Mathlib/Data/Matrix/DualNumber.lean +++ b/Mathlib/Data/Matrix/DualNumber.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.DualNumber -import Mathlib.Data.Matrix.Basic +module + +public import Mathlib.Algebra.DualNumber +public import Mathlib.Data.Matrix.Basic /-! # Matrices of dual numbers are isomorphic to dual numbers over matrices @@ -13,6 +15,8 @@ Showing this for the more general case of `TrivSqZeroExt R M` would require an a `Matrix n n R` and `Matrix n n M`, which would risk causing diamonds. -/ +@[expose] public section + variable {R n : Type} [CommSemiring R] [Fintype n] [DecidableEq n] diff --git a/Mathlib/Data/Matrix/Invertible.lean b/Mathlib/Data/Matrix/Invertible.lean index dacacfd07b59b9..65458273493eef 100644 --- a/Mathlib/Data/Matrix/Invertible.lean +++ b/Mathlib/Data/Matrix/Invertible.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Ahmad Alkhalawi -/ -import Mathlib.LinearAlgebra.Matrix.ConjTranspose -import Mathlib.Tactic.Abel +module + +public import Mathlib.LinearAlgebra.Matrix.ConjTranspose +public import Mathlib.Tactic.Abel /-! # Extra lemmas about invertible matrices @@ -21,6 +23,8 @@ in `LinearAlgebra/Matrix/NonsingularInverse.lean`. * `Matrix.isUnit_transpose` -/ +@[expose] public section + open scoped Matrix diff --git a/Mathlib/Data/Matrix/Mul.lean b/Mathlib/Data/Matrix/Mul.lean index 02fafdf0821d2c..74015d26caa137 100644 --- a/Mathlib/Data/Matrix/Mul.lean +++ b/Mathlib/Data/Matrix/Mul.lean @@ -3,12 +3,13 @@ Copyright (c) 2018 Ellen Arlt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ellen Arlt, Blair Shi, Sean Leather, Mario Carneiro, Johan Commelin, Lu-Ming Zhang -/ +module -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Regular.Basic -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Matrix.Diagonal +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Matrix.Diagonal /-! # Matrix multiplication @@ -48,6 +49,8 @@ Under various conditions, multiplication of infinite matrices makes sense. These have not yet been implemented. -/ +@[expose] public section + assert_not_exists Algebra Field TrivialStar universe u u' v w diff --git a/Mathlib/Data/Matrix/PEquiv.lean b/Mathlib/Data/Matrix/PEquiv.lean index 18060a9fe533a0..5b8c4a2166fa5a 100644 --- a/Mathlib/Data/Matrix/PEquiv.lean +++ b/Mathlib/Data/Matrix/PEquiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Matrix.Mul -import Mathlib.Data.PEquiv +module + +public import Mathlib.Data.Matrix.Mul +public import Mathlib.Data.PEquiv /-! # partial equivalences for matrices @@ -32,6 +34,8 @@ inverse of this map, sending anything not in the image to zero. This file uses `ᵀ` for `Matrix.transpose`. -/ +@[expose] public section + assert_not_exists Field namespace PEquiv diff --git a/Mathlib/Data/Matrix/Reflection.lean b/Mathlib/Data/Matrix/Reflection.lean index 9adfb4a328927b..48824057dba93e 100644 --- a/Mathlib/Data/Matrix/Reflection.lean +++ b/Mathlib/Data/Matrix/Reflection.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Fin.Tuple.Reflection -import Mathlib.LinearAlgebra.Matrix.Notation +module + +public import Mathlib.Data.Fin.Tuple.Reflection +public import Mathlib.LinearAlgebra.Matrix.Notation /-! # Lemmas for concrete matrices `Matrix (Fin m) (Fin n) α` @@ -30,6 +32,8 @@ corresponding `*_eq` lemmas to be used in a place where they are definitionally -/ +@[expose] public section + open Matrix @@ -213,8 +217,7 @@ example (A : Matrix (Fin 2) (Fin 2) α) : -/ theorem etaExpand_eq {m n} (A : Matrix (Fin m) (Fin n) α) : etaExpand A = A := by simp_rw [etaExpand, FinVec.etaExpand_eq, Matrix.of] - -- This to be in the above `simp_rw` before https://github.com/leanprover/lean4/pull/2644 - erw [Equiv.refl_apply] + grind example (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] := (etaExpand_eq _).symm diff --git a/Mathlib/Data/Multiset/AddSub.lean b/Mathlib/Data/Multiset/AddSub.lean index 1d63e8b6aa1e8b..d7ea0eb5b6d97f 100644 --- a/Mathlib/Data/Multiset/AddSub.lean +++ b/Mathlib/Data/Multiset/AddSub.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.Count -import Mathlib.Data.List.Count +module + +public import Mathlib.Data.Multiset.Count +public import Mathlib.Data.List.Count /-! # Sum and difference of multisets @@ -24,6 +26,8 @@ This file defines the following operations on multisets: -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/Antidiagonal.lean b/Mathlib/Data/Multiset/Antidiagonal.lean index 1f87ef2e79b155..bfb84468c7039b 100644 --- a/Mathlib/Data/Multiset/Antidiagonal.lean +++ b/Mathlib/Data/Multiset/Antidiagonal.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.Powerset +module + +public import Mathlib.Data.Multiset.Powerset /-! # The antidiagonal on a multiset. @@ -12,6 +14,8 @@ The antidiagonal of a multiset `s` consists of all pairs `(t₁, t₂)` such that `t₁ + t₂ = s`. These pairs are counted with multiplicities. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Ring universe u diff --git a/Mathlib/Data/Multiset/Basic.lean b/Mathlib/Data/Multiset/Basic.lean index c162e298fa1cd1..7b250a8e83ce0e 100644 --- a/Mathlib/Data/Multiset/Basic.lean +++ b/Mathlib/Data/Multiset/Basic.lean @@ -3,13 +3,17 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.ZeroCons +module + +public import Mathlib.Data.Multiset.ZeroCons /-! # Basic results on multisets -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/Bind.lean b/Mathlib/Data/Multiset/Bind.lean index a60800c441b5bf..67448c9a38e5f4 100644 --- a/Mathlib/Data/Multiset/Bind.lean +++ b/Mathlib/Data/Multiset/Bind.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Basic /-! # Bind operation for multisets @@ -18,6 +20,8 @@ This file defines a few basic operations on `Multiset`, notably the monadic bind * `Multiset.sigma`: Disjoint sum of multisets in a sigma type. -/ +@[expose] public section + assert_not_exists MonoidWithZero MulAction universe v diff --git a/Mathlib/Data/Multiset/Count.lean b/Mathlib/Data/Multiset/Count.lean index 282709203ad582..af9edebb1ef700 100644 --- a/Mathlib/Data/Multiset/Count.lean +++ b/Mathlib/Data/Multiset/Count.lean @@ -3,14 +3,18 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Nodup -import Mathlib.Data.Multiset.ZeroCons +module + +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.Multiset.ZeroCons /-! # Counting multiplicity in a multiset -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/Dedup.lean b/Mathlib/Data/Multiset/Dedup.lean index 7c74a8a90c0051..81c731f4f82094 100644 --- a/Mathlib/Data/Multiset/Dedup.lean +++ b/Mathlib/Data/Multiset/Dedup.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Dedup -import Mathlib.Data.Multiset.UnionInter +module + +public import Mathlib.Data.List.Dedup +public import Mathlib.Data.Multiset.UnionInter /-! # Erasing duplicates in a multiset. -/ +@[expose] public section + assert_not_exists Monoid namespace Multiset diff --git a/Mathlib/Data/Multiset/Defs.lean b/Mathlib/Data/Multiset/Defs.lean index 92d112f30d8020..9203fc992509de 100644 --- a/Mathlib/Data/Multiset/Defs.lean +++ b/Mathlib/Data/Multiset/Defs.lean @@ -3,13 +3,15 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Perm.Subperm -import Mathlib.Data.Nat.Basic -import Mathlib.Data.Quot -import Mathlib.Order.Monotone.Defs -import Mathlib.Order.RelClasses -import Mathlib.Tactic.Monotonicity.Attr -import Mathlib.Util.AssertExists +module + +public import Mathlib.Data.List.Perm.Subperm +public import Mathlib.Data.Nat.Basic +public import Mathlib.Data.Quot +public import Mathlib.Order.Monotone.Defs +public import Mathlib.Order.RelClasses +public import Mathlib.Tactic.Monotonicity.Attr +public import Mathlib.Util.AssertExists /-! # Multisets @@ -53,6 +55,8 @@ importing `Multiset.Defs`. occurrences of `a` in `s` and `t`. -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid OrderHom diff --git a/Mathlib/Data/Multiset/DershowitzManna.lean b/Mathlib/Data/Multiset/DershowitzManna.lean index 56ac72b53f0a07..bf024b80fde13d 100644 --- a/Mathlib/Data/Multiset/DershowitzManna.lean +++ b/Mathlib/Data/Multiset/DershowitzManna.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Haitian Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Haitian Wang, Malvin Gattinger -/ -import Mathlib.Algebra.Order.Sub.Unbundled.Basic -import Mathlib.Data.Multiset.OrderedMonoid +module + +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic +public import Mathlib.Data.Multiset.OrderedMonoid /-! # Dershowitz-Manna ordering @@ -32,6 +34,8 @@ the Dershowitz-Manna ordering defined over multisets is also well-founded. -/ +@[expose] public section + open Relation namespace Multiset diff --git a/Mathlib/Data/Multiset/Filter.lean b/Mathlib/Data/Multiset/Filter.lean index 2cfd9fe147a0af..e9b435db5edf67 100644 --- a/Mathlib/Data/Multiset/Filter.lean +++ b/Mathlib/Data/Multiset/Filter.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.MapFold -import Mathlib.Data.Set.Function -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Data.Multiset.MapFold +public import Mathlib.Data.Set.Function +public import Mathlib.Order.Hom.Basic /-! # Filtering multisets by a predicate @@ -16,6 +18,8 @@ import Mathlib.Order.Hom.Basic * `Multiset.filterMap`: `filterMap f s` is the multiset of `b`s where `some b ∈ map f s`. -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/FinsetOps.lean b/Mathlib/Data/Multiset/FinsetOps.lean index dd79090cc898b1..ba1b2b9e0773aa 100644 --- a/Mathlib/Data/Multiset/FinsetOps.lean +++ b/Mathlib/Data/Multiset/FinsetOps.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.Dedup -import Mathlib.Data.List.Infix +module + +public import Mathlib.Data.Multiset.Dedup +public import Mathlib.Data.List.Infix /-! # Preparations for defining operations on `Finset`. @@ -13,6 +15,8 @@ The operations here ignore multiplicities, and prepare for defining the corresponding operations on `Finset`. -/ +@[expose] public section + -- Assert that we define `Finset` without the material on the set lattice. -- Note that we cannot put this in `Data.Finset.Basic` because we proved relevant lemmas there. diff --git a/Mathlib/Data/Multiset/Fintype.lean b/Mathlib/Data/Multiset/Fintype.lean index df006cc3fe64e0..610ba47799a5ba 100644 --- a/Mathlib/Data/Multiset/Fintype.lean +++ b/Mathlib/Data/Multiset/Fintype.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Multiset coercion to type @@ -32,6 +34,8 @@ a multiset. These coercions and definitions make it easier to sum over multisets multiset enumeration -/ +@[expose] public section + variable {α β : Type*} [DecidableEq α] [DecidableEq β] {m : Multiset α} diff --git a/Mathlib/Data/Multiset/Fold.lean b/Mathlib/Data/Multiset/Fold.lean index acee1d990e97e0..ddd456fcc8ebb4 100644 --- a/Mathlib/Data/Multiset/Fold.lean +++ b/Mathlib/Data/Multiset/Fold.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.Dedup +module + +public import Mathlib.Data.Multiset.Dedup /-! # The fold operation for a commutative associative operation over a multiset. -/ +@[expose] public section + namespace Multiset variable {α β : Type*} diff --git a/Mathlib/Data/Multiset/Functor.lean b/Mathlib/Data/Multiset/Functor.lean index 8afc798ab7a399..679a4ecdc4b58d 100644 --- a/Mathlib/Data/Multiset/Functor.lean +++ b/Mathlib/Data/Multiset/Functor.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Simon Hudon, Kenny Lau -/ -import Mathlib.Data.Multiset.Bind -import Mathlib.Control.Traversable.Lemmas -import Mathlib.Control.Traversable.Instances +module + +public import Mathlib.Data.Multiset.Bind +public import Mathlib.Control.Traversable.Lemmas +public import Mathlib.Control.Traversable.Instances /-! # Functoriality of `Multiset`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/Multiset/Interval.lean b/Mathlib/Data/Multiset/Interval.lean index 6602425bbde827..2959b2a9d69741 100644 --- a/Mathlib/Data/Multiset/Interval.lean +++ b/Mathlib/Data/Multiset/Interval.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.DFinsupp.Interval -import Mathlib.Data.DFinsupp.Multiset -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Data.Nat.Lattice +module + +public import Mathlib.Data.DFinsupp.Interval +public import Mathlib.Data.DFinsupp.Multiset +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Data.Nat.Lattice /-! # Finite intervals of multisets @@ -23,6 +25,8 @@ multisets are typically used computationally. -/ +@[expose] public section + open Finset DFinsupp Function diff --git a/Mathlib/Data/Multiset/Lattice.lean b/Mathlib/Data/Multiset/Lattice.lean index 3cb541d3977bbc..dd5789076a06dc 100644 --- a/Mathlib/Data/Multiset/Lattice.lean +++ b/Mathlib/Data/Multiset/Lattice.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.FinsetOps -import Mathlib.Data.Multiset.Fold +module + +public import Mathlib.Data.Multiset.FinsetOps +public import Mathlib.Data.Multiset.Fold /-! # Lattice operations on multisets -/ +@[expose] public section + namespace Multiset diff --git a/Mathlib/Data/Multiset/MapFold.lean b/Mathlib/Data/Multiset/MapFold.lean index 3cc6d0d95fb7f4..62db7987d5f344 100644 --- a/Mathlib/Data/Multiset/MapFold.lean +++ b/Mathlib/Data/Multiset/MapFold.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Perm.Basic -import Mathlib.Data.Multiset.Replicate -import Mathlib.Data.Set.List +module + +public import Mathlib.Data.List.Perm.Basic +public import Mathlib.Data.Multiset.Replicate +public import Mathlib.Data.Set.List /-! # Mapping and folding multisets @@ -23,6 +25,8 @@ should we switch the import direction? -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/NatAntidiagonal.lean b/Mathlib/Data/Multiset/NatAntidiagonal.lean index 0bd91d85ac7dfe..62a3a3fc804de4 100644 --- a/Mathlib/Data/Multiset/NatAntidiagonal.lean +++ b/Mathlib/Data/Multiset/NatAntidiagonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Data.List.NatAntidiagonal -import Mathlib.Data.Multiset.MapFold +module + +public import Mathlib.Data.List.NatAntidiagonal +public import Mathlib.Data.Multiset.MapFold /-! # Antidiagonals in ℕ × ℕ as multisets @@ -19,6 +21,8 @@ This refines file `Data.List.NatAntidiagonal` and is further refined by file `Data.Finset.NatAntidiagonal`. -/ +@[expose] public section + assert_not_exists Monoid namespace Multiset diff --git a/Mathlib/Data/Multiset/OrderedMonoid.lean b/Mathlib/Data/Multiset/OrderedMonoid.lean index 02355bc182506e..dd0ccaeaa77492 100644 --- a/Mathlib/Data/Multiset/OrderedMonoid.lean +++ b/Mathlib/Data/Multiset/OrderedMonoid.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Algebra.Order.Monoid.Canonical.Defs +module + +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs /-! # Multisets as ordered monoids @@ -13,6 +15,8 @@ The `IsOrderedCancelAddMonoid` and `CanonicallyOrderedAdd` instances on `Multise -/ +@[expose] public section + variable {α : Type*} namespace Multiset diff --git a/Mathlib/Data/Multiset/Pairwise.lean b/Mathlib/Data/Multiset/Pairwise.lean index 7c647a8e4b59cc..952f7cbad48f3a 100644 --- a/Mathlib/Data/Multiset/Pairwise.lean +++ b/Mathlib/Data/Multiset/Pairwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.List.Pairwise -import Mathlib.Data.Multiset.Defs +module + +public import Mathlib.Data.List.Pairwise +public import Mathlib.Data.Multiset.Defs /-! # Pairwise relations on a multiset @@ -13,6 +15,8 @@ This file provides basic results about `Multiset.Pairwise` (definitions are in `Mathlib/Data/Multiset/Defs.lean`). -/ +@[expose] public section + namespace Multiset variable {α : Type*} {r : α → α → Prop} {s : Multiset α} diff --git a/Mathlib/Data/Multiset/Pi.lean b/Mathlib/Data/Multiset/Pi.lean index ac95a61ad7a785..1ed1102254ef6c 100644 --- a/Mathlib/Data/Multiset/Pi.lean +++ b/Mathlib/Data/Multiset/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Multiset.Bind +module + +public import Mathlib.Data.Multiset.Bind /-! # The Cartesian product of multisets @@ -13,6 +15,8 @@ import Mathlib.Data.Multiset.Bind * `Multiset.pi`: Cartesian product of multisets indexed by a multiset. -/ +@[expose] public section + namespace Multiset diff --git a/Mathlib/Data/Multiset/Powerset.lean b/Mathlib/Data/Multiset/Powerset.lean index f6b0f597cf86a5..ac6fdf2196bc33 100644 --- a/Mathlib/Data/Multiset/Powerset.lean +++ b/Mathlib/Data/Multiset/Powerset.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Sublists -import Mathlib.Data.List.Zip -import Mathlib.Data.Multiset.Bind -import Mathlib.Data.Multiset.Range +module + +public import Mathlib.Data.List.Sublists +public import Mathlib.Data.List.Zip +public import Mathlib.Data.Multiset.Bind +public import Mathlib.Data.Multiset.Range /-! # The powerset of a multiset -/ +@[expose] public section + namespace Multiset open List diff --git a/Mathlib/Data/Multiset/Range.lean b/Mathlib/Data/Multiset/Range.lean index 1149531c99f101..a23901230bafe6 100644 --- a/Mathlib/Data/Multiset/Range.lean +++ b/Mathlib/Data/Multiset/Range.lean @@ -3,10 +3,14 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.UnionInter +module + +public import Mathlib.Data.Multiset.UnionInter /-! # `Multiset.range n` gives `{0, 1, ..., n-1}` as a multiset. -/ +@[expose] public section + assert_not_exists Monoid open List Nat diff --git a/Mathlib/Data/Multiset/Replicate.lean b/Mathlib/Data/Multiset/Replicate.lean index df327d6c71dd8a..50e521eb2bea8f 100644 --- a/Mathlib/Data/Multiset/Replicate.lean +++ b/Mathlib/Data/Multiset/Replicate.lean @@ -3,7 +3,9 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.AddSub +module + +public import Mathlib.Data.Multiset.AddSub /-! # Repeating elements in multisets @@ -14,6 +16,8 @@ import Mathlib.Data.Multiset.AddSub -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/Sections.lean b/Mathlib/Data/Multiset/Sections.lean index 17b552594c33bd..bc02b9c24d6801 100644 --- a/Mathlib/Data/Multiset/Sections.lean +++ b/Mathlib/Data/Multiset/Sections.lean @@ -3,12 +3,16 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Multiset.Bind +module + +public import Mathlib.Data.Multiset.Bind /-! # Sections of a multiset -/ +@[expose] public section + assert_not_exists Ring namespace Multiset diff --git a/Mathlib/Data/Multiset/Sort.lean b/Mathlib/Data/Multiset/Sort.lean index 91e8f1094d4308..860a4a0bc6bb1e 100644 --- a/Mathlib/Data/Multiset/Sort.lean +++ b/Mathlib/Data/Multiset/Sort.lean @@ -3,14 +3,19 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Sort -import Mathlib.Data.Multiset.Range -import Mathlib.Util.Qq +module + +public import Mathlib.Data.List.Sort +public import Mathlib.Data.Multiset.Range +public import Mathlib.Util.Qq +meta import Mathlib.Data.Multiset.Defs /-! # Construct a sorted list from a multiset. -/ +@[expose] public section + variable {α β : Type*} namespace Multiset @@ -89,7 +94,7 @@ end sort open Qq in universe u in -unsafe instance {α : Type u} [Lean.ToLevel.{u}] [Lean.ToExpr α] : +meta unsafe instance {α : Type u} [Lean.ToLevel.{u}] [Lean.ToExpr α] : Lean.ToExpr (Multiset α) := haveI u' := Lean.toLevel.{u} haveI α' : Q(Type u') := Lean.toTypeExpr α diff --git a/Mathlib/Data/Multiset/Sum.lean b/Mathlib/Data/Multiset/Sum.lean index b745c24c4db638..a12b0e2346c2c3 100644 --- a/Mathlib/Data/Multiset/Sum.lean +++ b/Mathlib/Data/Multiset/Sum.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.Multiset +module + +public import Mathlib.Algebra.Order.Group.Multiset /-! # Disjoint sum of multisets @@ -16,6 +18,8 @@ with the `Multiset.sum` operation which computes the additive sum. * `Multiset.disjSum`: `s.disjSum t` is the disjoint sum of `s` and `t`. -/ +@[expose] public section + open Sum diff --git a/Mathlib/Data/Multiset/Sym.lean b/Mathlib/Data/Multiset/Sym.lean index f1af8af4b34fb6..92e5dca884ecab 100644 --- a/Mathlib/Data/Multiset/Sym.lean +++ b/Mathlib/Data/Multiset/Sym.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.List.Sym +module + +public import Mathlib.Data.List.Sym /-! # Unordered tuples of elements of a multiset @@ -30,6 +32,8 @@ unordered n-tuples from a given multiset. These are multiset versions of `Nat.mu -/ +@[expose] public section + namespace Multiset variable {α β : Type*} diff --git a/Mathlib/Data/Multiset/UnionInter.lean b/Mathlib/Data/Multiset/UnionInter.lean index 80be1f68652b27..1fd3e74dc6b6fc 100644 --- a/Mathlib/Data/Multiset/UnionInter.lean +++ b/Mathlib/Data/Multiset/UnionInter.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.List.Perm.Lattice -import Mathlib.Data.Multiset.Filter -import Mathlib.Order.MinMax -import Mathlib.Logic.Pairwise +module + +public import Mathlib.Data.List.Perm.Lattice +public import Mathlib.Data.Multiset.Filter +public import Mathlib.Order.MinMax +public import Mathlib.Logic.Pairwise /-! # Distributive lattice structure on multisets @@ -20,6 +22,8 @@ operators: occurrences of `a` in `s` and `t`. -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid diff --git a/Mathlib/Data/Multiset/ZeroCons.lean b/Mathlib/Data/Multiset/ZeroCons.lean index 0916173464491c..5d820f7e16dcf8 100644 --- a/Mathlib/Data/Multiset/ZeroCons.lean +++ b/Mathlib/Data/Multiset/ZeroCons.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.Defs -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Data.Multiset.Defs +public import Mathlib.Order.BoundedOrder.Basic /-! # Definition of `0` and `::ₘ` @@ -31,6 +33,8 @@ It also defines the following predicates on multisets: * `Multiset.rec`: recursion on adding one element to a multiset at a time. -/ +@[expose] public section + -- No algebra should be required assert_not_exists Monoid OrderHom diff --git a/Mathlib/Data/NNRat/BigOperators.lean b/Mathlib/Data/NNRat/BigOperators.lean index 24cc4ad7b35500..60a4c77f37e372 100644 --- a/Mathlib/Data/NNRat/BigOperators.lean +++ b/Mathlib/Data/NNRat/BigOperators.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Data.NNRat.Defs +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Data.NNRat.Defs /-! # Casting lemmas for non-negative rational numbers involving sums and products -/ +@[expose] public section + variable {α : Type*} namespace NNRat diff --git a/Mathlib/Data/NNRat/Defs.lean b/Mathlib/Data/NNRat/Defs.lean index 73344c99bf95df..dcd5c7bbcc9af3 100644 --- a/Mathlib/Data/NNRat/Defs.lean +++ b/Mathlib/Data/NNRat/Defs.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Order.Nonneg.Basic -import Mathlib.Algebra.Order.Ring.Unbundled.Rat -import Mathlib.Algebra.Ring.Rat -import Mathlib.Data.Set.Operations -import Mathlib.Order.Bounds.Defs -import Mathlib.Order.GaloisConnection.Defs +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Order.Nonneg.Basic +public import Mathlib.Algebra.Order.Ring.Unbundled.Rat +public import Mathlib.Algebra.Ring.Rat +public import Mathlib.Data.Set.Operations +public import Mathlib.Order.Bounds.Defs +public import Mathlib.Order.GaloisConnection.Defs /-! # Nonnegative rationals @@ -35,6 +37,8 @@ Whenever you state a lemma about the coercion `ℚ≥0 → ℚ`, check that Lean `Subtype.val`. Else your lemma will never apply. -/ +@[expose] public section + assert_not_exists CompleteLattice IsOrderedMonoid library_note2 «specialised high priority simp lemma» /-- @@ -55,6 +59,7 @@ instance Rat.instPosMulMono : PosMulMono ℚ where simpa [mul_sub, sub_nonneg] using Rat.mul_nonneg hr (sub_nonneg.2 hpq) deriving instance CommSemiring for NNRat +deriving instance AddCancelCommMonoid for NNRat deriving instance LinearOrder for NNRat deriving instance Sub for NNRat deriving instance Inhabited for NNRat diff --git a/Mathlib/Data/NNRat/Floor.lean b/Mathlib/Data/NNRat/Floor.lean index b781b42a2f6315..c5ea4465184004 100644 --- a/Mathlib/Data/NNRat/Floor.lean +++ b/Mathlib/Data/NNRat/Floor.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Data.NNRat.Order -import Mathlib.Data.Rat.Floor +module + +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Data.NNRat.Order +public import Mathlib.Data.Rat.Floor +public meta import Mathlib.Data.Rat.Floor /-! # Floor Function for Non-negative Rational Numbers @@ -21,6 +24,8 @@ Note that we cannot talk about `Int.fract`, which currently only works for rings nnrat, rationals, ℚ≥0, floor -/ +@[expose] public section + assert_not_exists Finset namespace NNRat @@ -126,7 +131,7 @@ theorem IsRat.natCeil {R : Type*} [Field R] [LinearOrder R] [IsStrictOrderedRing open Lean in /-- `norm_num` extension for `Nat.ceil` -/ @[norm_num ⌈_⌉₊] -def evalNatCeil : NormNumExt where eval {u αZ} e := do +meta def evalNatCeil : NormNumExt where eval {u αZ} e := do match u, αZ, e with | 0, ~q(ℕ), ~q(@Nat.ceil $α $instSemiring $instPartialOrder $instFloorSemiring $x) => match ← derive x with diff --git a/Mathlib/Data/NNRat/Lemmas.lean b/Mathlib/Data/NNRat/Lemmas.lean index 93c43a09570e2a..35a8e7f9c8fdfa 100644 --- a/Mathlib/Data/NNRat/Lemmas.lean +++ b/Mathlib/Data/NNRat/Lemmas.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Field.Rat -import Mathlib.Algebra.Group.Indicator -import Mathlib.Algebra.Order.Field.Rat -import Mathlib.Data.Rat.Lemmas -import Mathlib.Tactic.Zify +module + +public import Mathlib.Algebra.Field.Rat +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Algebra.Order.Field.Rat +public import Mathlib.Data.Rat.Lemmas +public import Mathlib.Tactic.Zify /-! # Field and action structures on the nonnegative rationals @@ -16,6 +18,8 @@ This file provides additional results about `NNRat` that cannot live in earlier cycles. -/ +@[expose] public section + open Function open scoped NNRat diff --git a/Mathlib/Data/NNRat/Order.lean b/Mathlib/Data/NNRat/Order.lean index efcdd24ca24bc3..174aded84cd8b5 100644 --- a/Mathlib/Data/NNRat/Order.lean +++ b/Mathlib/Data/NNRat/Order.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Data.NNRat.Defs -import Mathlib.Algebra.Order.Ring.Rat -import Mathlib.Algebra.Order.Nonneg.Ring +module + +public import Mathlib.Data.NNRat.Defs +public import Mathlib.Algebra.Order.Ring.Rat +public import Mathlib.Algebra.Order.Nonneg.Ring /-! # Bundled ordered algebra structures on `ℚ≥0` -/ +@[expose] public section + instance : IsStrictOrderedRing ℚ≥0 := Nonneg.isStrictOrderedRing -- TODO: `deriving instance OrderedSub for NNRat` doesn't work yet, so we add the instance manually diff --git a/Mathlib/Data/NNReal/Basic.lean b/Mathlib/Data/NNReal/Basic.lean index 8b9c32f3dbdec7..fdd3c4fcf4b6d4 100644 --- a/Mathlib/Data/NNReal/Basic.lean +++ b/Mathlib/Data/NNReal/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.BigOperators.Expect -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.Field.Canonical -import Mathlib.Algebra.Order.Nonneg.Floor -import Mathlib.Data.Real.Pointwise -import Mathlib.Data.NNReal.Defs -import Mathlib.Order.ConditionallyCompleteLattice.Group +module + +public import Mathlib.Algebra.BigOperators.Expect +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.Field.Canonical +public import Mathlib.Algebra.Order.Nonneg.Floor +public import Mathlib.Data.Real.Pointwise +public import Mathlib.Data.NNReal.Defs +public import Mathlib.Order.ConditionallyCompleteLattice.Group /-! # Basic results on nonnegative real numbers @@ -22,6 +24,8 @@ As a consequence, it is a bit of a random collection of results, and is a good t This file uses `ℝ≥0` as a localized notation for `NNReal`. -/ +@[expose] public section + assert_not_exists TrivialStar open Function diff --git a/Mathlib/Data/NNReal/Defs.lean b/Mathlib/Data/NNReal/Defs.lean index 112b735093c08f..498481f174ba6b 100644 --- a/Mathlib/Data/NNReal/Defs.lean +++ b/Mathlib/Data/NNReal/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Order.Nonneg.Module -import Mathlib.Data.Real.Archimedean +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Order.Nonneg.Module +public import Mathlib.Data.Real.Archimedean /-! # Nonnegative real numbers @@ -45,6 +47,8 @@ of `x` with `↑x`. This tactic also works for a function `f : α → ℝ` with This file defines `ℝ≥0` as a localized notation for `NNReal`. -/ +@[expose] public section + assert_not_exists TrivialStar open Function @@ -52,7 +56,7 @@ open Function -- to ensure these instances are computable /-- Nonnegative real numbers, denoted as `ℝ≥0` within the NNReal namespace -/ def NNReal := { r : ℝ // 0 ≤ r } deriving - Zero, One, Semiring, CommMonoidWithZero, CommSemiring, + Zero, One, Semiring, CommMonoidWithZero, CommSemiring, AddCancelCommMonoid, PartialOrder, SemilatticeInf, SemilatticeSup, DistribLattice, Nontrivial, Inhabited @@ -981,7 +985,7 @@ private alias ⟨_, nnreal_coe_pos⟩ := coe_pos /-- Extension for the `positivity` tactic: cast from `ℝ≥0` to `ℝ`. -/ @[positivity NNReal.toReal _] -def evalNNRealtoReal : PositivityExt where eval {u α} _zα _pα e := do +meta def evalNNRealtoReal : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(NNReal.toReal $a) => let ra ← core q(inferInstance) q(inferInstance) a diff --git a/Mathlib/Data/NNReal/Star.lean b/Mathlib/Data/NNReal/Star.lean index d0ec78404e22a2..0296293e28a6d4 100644 --- a/Mathlib/Data/NNReal/Star.lean +++ b/Mathlib/Data/NNReal/Star.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Data.NNReal.Defs -import Mathlib.Data.Real.Star +module + +public import Mathlib.Data.NNReal.Defs +public import Mathlib.Data.Real.Star /-! # The non-negative real numbers are a `*`-ring, with the trivial `*`-structure -/ +@[expose] public section + assert_not_exists Finset open scoped NNReal diff --git a/Mathlib/Data/Nat/Basic.lean b/Mathlib/Data/Nat/Basic.lean index a0d44036e5141b..6230d89df18df9 100644 --- a/Mathlib/Data/Nat/Basic.lean +++ b/Mathlib/Data/Nat/Basic.lean @@ -3,13 +3,14 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Nat.Init -import Mathlib.Data.Set.Defs -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Order.Defs.LinearOrder -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.GCongr.Core -import Mathlib.Util.AssertExists +module + +public import Mathlib.Data.Nat.Init +public import Mathlib.Logic.Basic +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Order.Defs.LinearOrder +public import Mathlib.Tactic.GCongr.Core +public import Mathlib.Util.AssertExists /-! # Basic operations on the natural numbers @@ -20,6 +21,8 @@ depending on Mathlib definitions. See note [foundational algebra order theory]. -/ +@[expose] public section + /- We don't want to import the algebraic hierarchy in this file. -/ assert_not_exists Monoid diff --git a/Mathlib/Data/Nat/BinaryRec.lean b/Mathlib/Data/Nat/BinaryRec.lean index 0b78757465f07d..58b09dd53366e5 100644 --- a/Mathlib/Data/Nat/BinaryRec.lean +++ b/Mathlib/Data/Nat/BinaryRec.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Praneeth Kolichala, Yuyang Zhao -/ -import Batteries.Tactic.Alias -import Mathlib.Init +module + +public import Batteries.Tactic.Alias +public import Mathlib.Init /-! # Binary recursion on `Nat` @@ -18,6 +20,8 @@ This file defines binary recursion on `Nat`. * `Nat.binaryRecFromOne`: The same as `binaryRec`, but special casing both 0 and 1 as base cases. -/ +@[expose] public section + universe u namespace Nat diff --git a/Mathlib/Data/Nat/BitIndices.lean b/Mathlib/Data/Nat/BitIndices.lean index 65d72f508b539d..3b262c1da8ef6a 100644 --- a/Mathlib/Data/Nat/BitIndices.lean +++ b/Mathlib/Data/Nat/BitIndices.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Algebra.BigOperators.Ring.List -import Mathlib.Algebra.Order.BigOperators.Group.List -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.List.Sort -import Mathlib.Data.Nat.Bitwise +module + +public import Mathlib.Algebra.BigOperators.Ring.List +public import Mathlib.Algebra.Order.BigOperators.Group.List +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.List.Sort +public import Mathlib.Data.Nat.Bitwise /-! # Bit Indices @@ -25,6 +27,8 @@ This is used in `Combinatorics.colex` to construct a bijection `equivBitIndices Relate the material in this file to `Nat.digits` and `Nat.bits`. -/ +@[expose] public section + open List namespace Nat diff --git a/Mathlib/Data/Nat/Bits.lean b/Mathlib/Data/Nat/Bits.lean index 2b85645bd0cb34..b9339c02498002 100644 --- a/Mathlib/Data/Nat/Bits.lean +++ b/Mathlib/Data/Nat/Bits.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Praneeth Kolichala. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Praneeth Kolichala -/ -import Batteries.Tactic.GeneralizeProofs -import Mathlib.Data.Nat.BinaryRec -import Mathlib.Data.List.Defs -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Says -import Mathlib.Util.AssertExists +module + +public import Batteries.Tactic.GeneralizeProofs +public import Mathlib.Data.Nat.BinaryRec +public import Mathlib.Data.List.Defs +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Says +public import Mathlib.Util.AssertExists /-! # Additional properties of binary recursion on `Nat` @@ -22,6 +24,8 @@ See also: `Nat.bitwise`, `Nat.pow` (for various lemmas about `size` and `shiftLe and `Nat.digits`. -/ +@[expose] public section + assert_not_exists Monoid -- Once we're in the `Nat` namespace, `xor` will inconveniently resolve to `Nat.xor`. diff --git a/Mathlib/Data/Nat/Bitwise.lean b/Mathlib/Data/Nat/Bitwise.lean index 11252b13250de2..458f197e6c9260 100644 --- a/Mathlib/Data/Nat/Bitwise.lean +++ b/Mathlib/Data/Nat/Bitwise.lean @@ -3,16 +3,19 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Alex Keizer -/ -import Mathlib.Algebra.Group.Nat.Even -import Mathlib.Algebra.NeZero -import Mathlib.Algebra.Ring.Nat -import Mathlib.Data.Bool.Basic -import Mathlib.Data.List.GetD -import Mathlib.Data.Nat.Bits -import Mathlib.Order.Basic -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.Common -import Batteries.Data.Nat.Bitwise +module + +public import Mathlib.Algebra.Group.Nat.Even +public import Mathlib.Algebra.NeZero +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Data.Bool.Basic +public import Mathlib.Data.List.GetD +public import Mathlib.Data.Nat.Bits +public import Mathlib.Order.Basic +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.Common +public import Batteries.Data.Nat.Bitwise +import all Init.Data.Nat.Bitwise.Basic -- for unfolding `bitwise` /-! # Bitwise operations on natural numbers @@ -39,6 +42,8 @@ should be connected. bitwise, and, or, xor -/ +@[expose] public section + open Function namespace Nat diff --git a/Mathlib/Data/Nat/Cast/Basic.lean b/Mathlib/Data/Nat/Cast/Basic.lean index 0466c2e9b63e85..9e4dbaa73f085a 100644 --- a/Mathlib/Data/Nat/Cast/Basic.lean +++ b/Mathlib/Data/Nat/Cast/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Divisibility.Hom -import Mathlib.Algebra.Group.Even -import Mathlib.Algebra.Group.Nat.Hom -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Algebra.Ring.Nat +module + +public import Mathlib.Algebra.Divisibility.Hom +public import Mathlib.Algebra.Group.Even +public import Mathlib.Algebra.Group.Nat.Hom +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Algebra.Ring.Nat /-! # Cast of natural numbers (additional theorems) @@ -21,6 +23,8 @@ the natural numbers into an additive monoid with a one (`Nat.cast`). * `castRingHom`: `cast` bundled as a `RingHom`. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Commute.zero_right Commute.add_right abs_eq_max_neg NeZero.natCast_ne -- TODO: `MulOpposite.op_natCast` was not intended to be imported diff --git a/Mathlib/Data/Nat/Cast/Commute.lean b/Mathlib/Data/Nat/Cast/Commute.lean index a0cc842c8b496d..6891435582148d 100644 --- a/Mathlib/Data/Nat/Cast/Commute.lean +++ b/Mathlib/Data/Nat/Cast/Commute.lean @@ -3,14 +3,18 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Commute -import Mathlib.Algebra.Ring.Commute +module + +public import Mathlib.Algebra.GroupWithZero.Commute +public import Mathlib.Algebra.Ring.Commute /-! # Cast of natural numbers: lemmas about `Commute` -/ +@[expose] public section + variable {α : Type*} namespace Nat diff --git a/Mathlib/Data/Nat/Cast/Defs.lean b/Mathlib/Data/Nat/Cast/Defs.lean index fbcb6627ff5134..41ad697967fb54 100644 --- a/Mathlib/Data/Nat/Cast/Defs.lean +++ b/Mathlib/Data/Nat/Cast/Defs.lean @@ -3,10 +3,11 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Data.Nat.Init -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.OfNat +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Data.Nat.Init +public import Mathlib.Tactic.SplitIfs /-! # Cast of natural numbers @@ -24,6 +25,8 @@ Preferentially, the homomorphism is written as the coercion `Nat.cast`. * `Nat.cast`: Canonical homomorphism `ℕ → R`. -/ +@[expose] public section + variable {R : Type*} /-- The numeral `((0+1)+⋯)+1`. -/ diff --git a/Mathlib/Data/Nat/Cast/Field.lean b/Mathlib/Data/Nat/Cast/Field.lean index e1538e812a2ce4..16209c4e705a17 100644 --- a/Mathlib/Data/Nat/Cast/Field.lean +++ b/Mathlib/Data/Nat/Cast/Field.lean @@ -3,11 +3,13 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yaël Dillies, Patrick Stevens -/ -import Mathlib.Algebra.CharZero.Defs -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Tactic.Common -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Units.Basic +module + +public import Mathlib.Algebra.CharZero.Defs +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Tactic.Common +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Basic /-! # Cast of naturals into fields @@ -19,6 +21,8 @@ This file concerns the canonical homomorphism `ℕ → F`, where `F` is a field. * `Nat.cast_div`: if `n` divides `m`, then `↑(m / n) = ↑m / ↑n` -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Cast/NeZero.lean b/Mathlib/Data/Nat/Cast/NeZero.lean index e3fbc25aab9460..a35c41207eebf3 100644 --- a/Mathlib/Data/Nat/Cast/NeZero.lean +++ b/Mathlib/Data/Nat/Cast/NeZero.lean @@ -3,12 +3,16 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ -import Mathlib.Data.Nat.Cast.Defs +module + +public import Mathlib.Data.Nat.Cast.Defs /-! # Lemmas about nonzero elements of an `AddMonoidWithOne` -/ +@[expose] public section + open Nat namespace NeZero diff --git a/Mathlib/Data/Nat/Cast/Order/Basic.lean b/Mathlib/Data/Nat/Cast/Order/Basic.lean index 7b47ca7e287af6..7723ac0fabb2b0 100644 --- a/Mathlib/Data/Nat/Cast/Order/Basic.lean +++ b/Mathlib/Data/Nat/Cast/Order/Basic.lean @@ -3,17 +3,21 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Data.Nat.Cast.NeZero -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Data.Nat.Cast.NeZero +public import Mathlib.Order.Hom.Basic /-! # Cast of natural numbers: lemmas about order -/ +@[expose] public section + assert_not_exists IsOrderedMonoid variable {α : Type*} diff --git a/Mathlib/Data/Nat/Cast/Order/Field.lean b/Mathlib/Data/Nat/Cast/Order/Field.lean index 57f2dccc12595f..22357a45426fb4 100644 --- a/Mathlib/Data/Nat/Cast/Order/Field.lean +++ b/Mathlib/Data/Nat/Cast/Order/Field.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yaël Dillies, Patrick Stevens -/ -import Mathlib.Algebra.Order.Field.Basic +module + +public import Mathlib.Algebra.Order.Field.Basic /-! # Cast of naturals into ordered fields @@ -15,6 +17,8 @@ This file concerns the canonical homomorphism `ℕ → F`, where `F` is a `Linea * `Nat.cast_div_le`: in all cases, `↑(m / n) ≤ ↑m / ↑ n` -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Cast/Order/Ring.lean b/Mathlib/Data/Nat/Cast/Order/Ring.lean index fbc62125a71774..34b327c9845c63 100644 --- a/Mathlib/Data/Nat/Cast/Order/Ring.lean +++ b/Mathlib/Data/Nat/Cast/Order/Ring.lean @@ -3,16 +3,20 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.Nat.Cast.Order.Basic +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.Nat.Cast.Order.Basic /-! # Cast of natural numbers: lemmas about bundled ordered semirings -/ +@[expose] public section + variable {R α : Type*} namespace Nat diff --git a/Mathlib/Data/Nat/Cast/Prod.lean b/Mathlib/Data/Nat/Cast/Prod.lean index 19f4997ff20fab..8850134e8a6450 100644 --- a/Mathlib/Data/Nat/Cast/Prod.lean +++ b/Mathlib/Data/Nat/Cast/Prod.lean @@ -3,13 +3,17 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Prod -import Mathlib.Data.Nat.Cast.Defs +module + +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Data.Nat.Cast.Defs /-! # The product of two `AddMonoidWithOne`s. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {α β : Type*} diff --git a/Mathlib/Data/Nat/Cast/SetInterval.lean b/Mathlib/Data/Nat/Cast/SetInterval.lean index c27cea786a499e..7ac495b1bc435d 100644 --- a/Mathlib/Data/Nat/Cast/SetInterval.lean +++ b/Mathlib/Data/Nat/Cast/SetInterval.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Order.Interval.Set.OrdConnected -import Mathlib.Order.Nat -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Order.Interval.Set.OrdConnected +public import Mathlib.Order.Nat +public import Mathlib.Order.UpperLower.Basic /-! # Images of intervals under `Nat.cast : ℕ → ℤ` @@ -16,6 +18,8 @@ In this file we prove that the image of each `Set.Ixx` interval under `Nat.cast is the corresponding interval in `ℤ`. -/ +@[expose] public section + open Set namespace Nat diff --git a/Mathlib/Data/Nat/Cast/Synonym.lean b/Mathlib/Data/Nat/Cast/Synonym.lean index 134b313775e2de..58ccc8e6967bdc 100644 --- a/Mathlib/Data/Nat/Cast/Synonym.lean +++ b/Mathlib/Data/Nat/Cast/Synonym.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.Cast.Defs -import Mathlib.Order.Synonym +module + +public import Mathlib.Data.Nat.Cast.Defs +public import Mathlib.Order.Synonym /-! # Cast of natural numbers (additional theorems) @@ -13,6 +15,8 @@ This file proves additional properties about the *canonical* homomorphism from the natural numbers into an additive monoid with a one (`Nat.cast`). -/ +@[expose] public section + variable {α : Type*} /-! ### Order dual -/ diff --git a/Mathlib/Data/Nat/Cast/WithTop.lean b/Mathlib/Data/Nat/Cast/WithTop.lean index 87ebd68826b993..8f66b62d0fe62e 100644 --- a/Mathlib/Data/Nat/Cast/WithTop.lean +++ b/Mathlib/Data/Nat/Cast/WithTop.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Ring.Nat -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +module + +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop /-! # Lemma about the coercion `ℕ → WithBot ℕ`. @@ -13,6 +15,8 @@ An orphaned lemma about casting from `ℕ` to `WithBot ℕ`, exiled here during the port to minimize imports of `Algebra.Order.Ring.Rat`. -/ +@[expose] public section + instance : WellFoundedRelation (WithTop ℕ) where rel := (· < ·) wf := IsWellFounded.wf diff --git a/Mathlib/Data/Nat/ChineseRemainder.lean b/Mathlib/Data/Nat/ChineseRemainder.lean index 6d1eb514640153..479c214ab6dd10 100644 --- a/Mathlib/Data/Nat/ChineseRemainder.lean +++ b/Mathlib/Data/Nat/ChineseRemainder.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Shogo Saito. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shogo Saito. Adapted for mathlib by Hunter Monroe -/ -import Mathlib.Algebra.BigOperators.Ring.List -import Mathlib.Data.Nat.ModEq -import Mathlib.Data.Nat.GCD.BigOperators +module + +public import Mathlib.Algebra.BigOperators.Ring.List +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Nat.GCD.BigOperators /-! # Chinese Remainder Theorem @@ -22,6 +24,8 @@ Gödel's Beta function, which is used in proving Gödel's incompleteness theorem Chinese Remainder Theorem, Gödel, beta function -/ +@[expose] public section + open scoped Function -- required for scoped `on` notation namespace Nat diff --git a/Mathlib/Data/Nat/Choose/Basic.lean b/Mathlib/Data/Nat/Choose/Basic.lean index dc80309c868cc3..da9f02e2d720ec 100644 --- a/Mathlib/Data/Nat/Choose/Basic.lean +++ b/Mathlib/Data/Nat/Choose/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Bhavik Mehta, Stuart Presnell -/ -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Order.Monotone.Defs +module + +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Order.Monotone.Defs /-! # Binomial coefficients @@ -37,6 +39,8 @@ see `Fintype.card_powersetCard` in `Mathlib/Data/Finset/Powerset.lean`. binomial coefficient, combination, multicombination, stars and bars -/ +@[expose] public section + namespace Nat /-- `choose n k` is the number of `k`-element subsets in an `n`-element set. Also known as binomial diff --git a/Mathlib/Data/Nat/Choose/Bounds.lean b/Mathlib/Data/Nat/Choose/Bounds.lean index 3298c6091b8c06..67c882bc7da593 100644 --- a/Mathlib/Data/Nat/Choose/Bounds.lean +++ b/Mathlib/Data/Nat/Choose/Bounds.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Eric Rodriguez -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Data.Nat.Choose.Basic +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Data.Nat.Choose.Basic /-! # Inequalities for binomial coefficients @@ -20,6 +22,8 @@ bounds `n^r/r^r ≤ n.choose r ≤ e^r n^r/r^r` in the future. * `Nat.pow_le_choose`: `(n + 1 - r)^r / r! ≤ n.choose r`. Beware of the fishy ℕ-subtraction. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/Nat/Choose/Cast.lean b/Mathlib/Data/Nat/Choose/Cast.lean index 695e4b15c365dd..2890b0d10e8bee 100644 --- a/Mathlib/Data/Nat/Choose/Cast.lean +++ b/Mathlib/Data/Nat/Choose/Cast.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Data.Nat.Factorial.Cast +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Data.Nat.Factorial.Cast /-! # Cast of binomial coefficients @@ -15,6 +17,8 @@ This file allows calculating the binomial coefficient `a.choose b` as an element of characteristic `0`. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/Nat/Choose/Central.lean b/Mathlib/Data/Nat/Choose/Central.lean index bd9de22543f405..cac8f32617153c 100644 --- a/Mathlib/Data/Nat/Choose/Central.lean +++ b/Mathlib/Data/Nat/Choose/Central.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Patrick Stevens. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Stevens, Thomas Browning -/ -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Data.Nat.GCD.Basic -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Data.Nat.GCD.Basic +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Linarith /-! # Central binomial coefficients @@ -24,6 +26,8 @@ This file proves properties of the central binomial coefficients (that is, `Nat. definition of the Catalan numbers is integer-valued. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Choose/Dvd.lean b/Mathlib/Data/Nat/Choose/Dvd.lean index f33a86fad7a8a1..ccaaf4514cef50 100644 --- a/Mathlib/Data/Nat/Choose/Dvd.lean +++ b/Mathlib/Data/Nat/Choose/Dvd.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Patrick Stevens -/ -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Data.Nat.Prime.Factorial +module + +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Data.Nat.Prime.Factorial /-! # Divisibility properties of binomial coefficients -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Choose/Factorization.lean b/Mathlib/Data/Nat/Choose/Factorization.lean index a5c3d602631502..6d8e14aa35dcb1 100644 --- a/Mathlib/Data/Nat/Choose/Factorization.lean +++ b/Mathlib/Data/Nat/Choose/Factorization.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey, Patrick Stevens, Thomas Browning -/ -import Mathlib.Algebra.Order.Ring.GeomSum -import Mathlib.Data.Nat.Choose.Central -import Mathlib.Data.Nat.Digits.Lemmas -import Mathlib.Data.Nat.Factorization.Basic +module + +public import Mathlib.Algebra.Order.Ring.GeomSum +public import Mathlib.Data.Nat.Choose.Central +public import Mathlib.Data.Nat.Digits.Lemmas +public import Mathlib.Data.Nat.Factorization.Basic /-! # Factorization of Binomial Coefficients @@ -26,6 +28,8 @@ bounds in binomial coefficients. These include: These results appear in the [Erdős proof of Bertrand's postulate](aigner1999proofs). -/ +@[expose] public section + open Finset List Finsupp namespace Nat diff --git a/Mathlib/Data/Nat/Choose/Lucas.lean b/Mathlib/Data/Nat/Choose/Lucas.lean index 6e7972fa28c701..cc7280d4d0341a 100644 --- a/Mathlib/Data/Nat/Choose/Lucas.lean +++ b/Mathlib/Data/Nat/Choose/Lucas.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Gareth Ma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gareth Ma -/ -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.Data.ZMod.Basic -import Mathlib.RingTheory.Polynomial.Basic +module + +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.Data.ZMod.Basic +public import Mathlib.RingTheory.Polynomial.Basic /-! # Lucas's theorem @@ -21,6 +23,8 @@ respectively. k_i` modulo `p`, where `n_i` and `k_i` are the base-`p` digits of `n` and `k`, respectively. -/ +@[expose] public section + open Finset hiding choose open Nat Polynomial diff --git a/Mathlib/Data/Nat/Choose/Mul.lean b/Mathlib/Data/Nat/Choose/Mul.lean index 51a36f0cd81fd9..7c2e793a595b5c 100644 --- a/Mathlib/Data/Nat/Choose/Mul.lean +++ b/Mathlib/Data/Nat/Choose/Mul.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Antoine Chambert-Loir & María-Inés de Frutos—Fernández. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María-Inés de Frutos—Fernández -/ +module -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Tactic.Ring.RingNF +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Tactic.Ring.RingNF /-! # Two lemmas on choose @@ -14,6 +15,8 @@ and can't be given in `Mathlib/Data/Nat/Choose/Basic.lean` -/ +@[expose] public section + namespace Nat theorem choose_mul_add {m n : ℕ} (hn : n ≠ 0) : diff --git a/Mathlib/Data/Nat/Choose/Multinomial.lean b/Mathlib/Data/Nat/Choose/Multinomial.lean index f10927d4a10c1f..3926a859707c20 100644 --- a/Mathlib/Data/Nat/Choose/Multinomial.lean +++ b/Mathlib/Data/Nat/Choose/Multinomial.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Pim Otte -/ -import Mathlib.Algebra.Order.Antidiag.Pi -import Mathlib.Data.Finsupp.Multiset -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Data.Nat.Factorial.BigOperators -import Mathlib.Data.Nat.Factorial.DoubleFactorial +module + +public import Mathlib.Algebra.Order.Antidiag.Pi +public import Mathlib.Data.Finsupp.Multiset +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Data.Nat.Factorial.BigOperators +public import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # Multinomial @@ -24,6 +26,8 @@ This file defines the multinomial coefficient and several small lemma's for mani -/ +@[expose] public section + open Finset open scoped Nat diff --git a/Mathlib/Data/Nat/Choose/Sum.lean b/Mathlib/Data/Nat/Choose/Sum.lean index 72cbd4b0e31c43..12d59e01eb60a0 100644 --- a/Mathlib/Data/Nat/Choose/Sum.lean +++ b/Mathlib/Data/Nat/Choose/Sum.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Patrick Stevens -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Algebra.BigOperators.NatAntidiagonal -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Algebra.BigOperators.NatAntidiagonal +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Ring /-! # Sums of binomial coefficients @@ -18,6 +20,8 @@ coefficients. Theorems whose proofs depend on such sums may also go in this file reasons. -/ +@[expose] public section + open Nat Finset variable {R : Type*} diff --git a/Mathlib/Data/Nat/Choose/Vandermonde.lean b/Mathlib/Data/Nat/Choose/Vandermonde.lean index 02470cdffaec84..d77b3c4bac527c 100644 --- a/Mathlib/Data/Nat/Choose/Vandermonde.lean +++ b/Mathlib/Data/Nat/Choose/Vandermonde.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.Coeff -import Mathlib.Data.Nat.Choose.Basic +module + +public import Mathlib.Algebra.Polynomial.Coeff +public import Mathlib.Data.Nat.Choose.Basic /-! @@ -18,6 +20,8 @@ https://en.wikipedia.org/wiki/Vandermonde%27s_identity#Algebraic_proof . -/ +@[expose] public section + open Polynomial Finset Finset.Nat diff --git a/Mathlib/Data/Nat/Count.lean b/Mathlib/Data/Nat/Count.lean index 50ae44d3e2ce0c..2036368fc98e94 100644 --- a/Mathlib/Data/Nat/Count.lean +++ b/Mathlib/Data/Nat/Count.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Vladimir Goryachev. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Vladimir Goryachev, Kyle Miller, Kim Morrison, Eric Rodriguez -/ -import Mathlib.Algebra.Group.Nat.Range -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Algebra.Group.Nat.Range +public import Mathlib.Data.Set.Finite.Basic /-! # Counting on ℕ @@ -16,6 +18,8 @@ objects, and helping to evaluate it for specific `k`. -/ +@[expose] public section + assert_not_imported Mathlib.Dynamics.FixedPoints.Basic assert_not_exists Ring diff --git a/Mathlib/Data/Nat/Digits/Defs.lean b/Mathlib/Data/Nat/Digits/Defs.lean index f2dbc0aa60f7eb..179cef773da579 100644 --- a/Mathlib/Data/Nat/Digits/Defs.lean +++ b/Mathlib/Data/Nat/Digits/Defs.lean @@ -3,10 +3,14 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Shing Tak Lam, Mario Carneiro -/ -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Linarith -import Mathlib.Algebra.Order.Group.Nat +module + +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Linarith +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Ring.Defs +import all Init.Data.Repr -- for exposing `toDigitsCore` /-! # Digits of a natural number @@ -25,6 +29,8 @@ A basic `norm_digits` tactic for proving goals of the form `Nat.digits a b = l` are numerals is not yet ported. -/ +@[expose] public section + assert_not_exists Finset namespace Nat diff --git a/Mathlib/Data/Nat/Digits/Div.lean b/Mathlib/Data/Nat/Digits/Div.lean index 1eedc5f60c1cfe..fa37cfd08fc598 100644 --- a/Mathlib/Data/Nat/Digits/Div.lean +++ b/Mathlib/Data/Nat/Digits/Div.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Shing Tak Lam, Mario Carneiro -/ -import Mathlib.Data.List.Palindrome -import Mathlib.Data.Nat.Digits.Lemmas +module + +public import Mathlib.Data.List.Palindrome +public import Mathlib.Data.Nat.Digits.Lemmas /-! # Divisibility tests for natural numbers in terms of digits. @@ -14,6 +16,8 @@ Theorem #85 from https://www.cs.ru.nl/~freek/100/. -/ +@[expose] public section + namespace Nat variable {n : ℕ} diff --git a/Mathlib/Data/Nat/Digits/Lemmas.lean b/Mathlib/Data/Nat/Digits/Lemmas.lean index 0621a842e27a82..1bf1b24f592f25 100644 --- a/Mathlib/Data/Nat/Digits/Lemmas.lean +++ b/Mathlib/Data/Nat/Digits/Lemmas.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Shing Tak Lam, Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Algebra.BigOperators.Ring.List -import Mathlib.Data.Int.ModEq -import Mathlib.Data.Nat.Bits -import Mathlib.Data.Nat.Log -import Mathlib.Tactic.IntervalCases -import Mathlib.Data.Nat.Digits.Defs +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Algebra.BigOperators.Ring.List +public import Mathlib.Data.Int.ModEq +public import Mathlib.Data.Nat.Bits +public import Mathlib.Data.Nat.Log +public import Mathlib.Tactic.IntervalCases +public import Mathlib.Data.Nat.Digits.Defs /-! # Digits of a natural number @@ -17,6 +19,8 @@ import Mathlib.Data.Nat.Digits.Defs This provides lemma about the digits of natural numbers. -/ +@[expose] public section + namespace Nat variable {n : ℕ} diff --git a/Mathlib/Data/Nat/Dist.lean b/Mathlib/Data/Nat/Dist.lean index 382c517c9c8ea2..3481f0a479483b 100644 --- a/Mathlib/Data/Nat/Dist.lean +++ b/Mathlib/Data/Nat/Dist.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Jeremy Avigad -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Ring.Canonical +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Ring.Canonical /-! # Distance function on ℕ @@ -12,6 +14,8 @@ import Mathlib.Algebra.Order.Ring.Canonical This file defines a simple distance function on naturals from truncated subtraction. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/EvenOddRec.lean b/Mathlib/Data/Nat/EvenOddRec.lean index 679a7ff57f0977..a3e2db9fcc9d6b 100644 --- a/Mathlib/Data/Nat/EvenOddRec.lean +++ b/Mathlib/Data/Nat/EvenOddRec.lean @@ -3,11 +3,15 @@ Copyright (c) 2022 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell -/ -import Mathlib.Algebra.Ring.Parity -import Mathlib.Data.Nat.BinaryRec +module + +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Data.Nat.BinaryRec /-! # A recursion principle based on even and odd numbers. -/ +@[expose] public section + namespace Nat /-- Recursion principle on even and odd numbers: if we have `P 0`, and for all `i : ℕ` we can diff --git a/Mathlib/Data/Nat/Factorial/Basic.lean b/Mathlib/Data/Nat/Factorial/Basic.lean index b33a2989d6f930..e5bf565eac0a54 100644 --- a/Mathlib/Data/Nat/Factorial/Basic.lean +++ b/Mathlib/Data/Nat/Factorial/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Chris Hughes, Floris van Doorn, Yaël Dillies -/ -import Mathlib.Data.Nat.Basic -import Mathlib.Tactic.Common -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Data.Nat.Basic +public import Mathlib.Tactic.Common +public import Mathlib.Tactic.Monotonicity.Attr /-! # Factorial and variants @@ -23,6 +25,8 @@ see `Fintype.card_perm`. `n - k + 1` to `n`. -/ +@[expose] public section + namespace Nat @@ -461,7 +465,7 @@ lemma two_pow_mul_factorial_le_factorial_two_mul (n : ℕ) : 2 ^ n * n ! ≤ (2 /-! -# Factorial via binary splitting. +### Factorial via binary splitting. We prove this is equal to the standard factorial and mark it `@[csimp]`. @@ -476,45 +480,72 @@ This is the highest factorial I can `#eval` using the naive implementation witho #eval 9718 ! |>.log2 ``` +Similarly, evaluation of `ascFactorial 100 15000` fails with the naive implementation +but works with the binary recursion. + We could implement a tail-recursive version (or just use `Nat.fold`), but instead let's jump straight to binary splitting. -/ +/-- `ascFactorial` implemented using binary splitting. + +While this still performs the same number of multiplications, +the big-integer operands to each are much smaller. -/ +def ascFactorialBinary (n k : ℕ) : ℕ := + match k with + | 0 => 1 + | 1 => n + | k@(_ + 2) => ascFactorialBinary n (k / 2) * ascFactorialBinary (n + k / 2) ((k + 1) / 2) + +@[csimp] +lemma ascFactorial_eq_ascFactorialBinary : ascFactorial = ascFactorialBinary := by + ext n k + fun_induction ascFactorialBinary with + | case1 => simp + | case2 => simp [ascFactorial] + | case3 n k ih₁ ih₂ => grind [ascFactorial_mul_ascFactorial] + /-- Factorial implemented using binary splitting. While this still performs the same number of multiplications, the big-integer operands to each are much smaller. -/ -def factorialBinarySplitting (n : Nat) : Nat := - if _ : n = 0 then 1 else prodRange 1 (n + 1) -where - /-- - `prodRange lo hi` is the product of the range `lo` to `hi` (exclusive), - computed by binary splitting. - -/ - prodRange (lo hi : Nat) (h : lo < hi := by grind) : Nat := - if _ : hi = lo + 1 then lo - else - let mid := (lo + hi) / 2 - prodRange lo mid * prodRange mid hi +def factorialBinarySplitting (n : ℕ) : ℕ := + ascFactorialBinary 1 n +/-- This function was used in the definition of `factorialBinarysplitting` +before it was migrated to `ascFactorialBinary`. -/ +@[deprecated ascFactorialBinary (since := "2025-10-21"), nolint unusedArguments] +def factorialBinarySplitting.prodRange (lo hi : ℕ) (_ : lo < hi := by grind) : ℕ := + ascFactorialBinary lo (hi - lo) + +set_option linter.deprecated false in +@[deprecated factorial_mul_ascFactorial (since := "2025-10-21")] theorem factorialBinarySplitting.factorial_mul_prodRange (lo hi : Nat) (h : lo < hi) : lo ! * prodRange (lo + 1) (hi + 1) = hi ! := by - rw [prodRange] - split - · grind [factorial_succ] - · dsimp only - rw [← Nat.mul_assoc] - simp_rw [show (lo + 1 + (hi + 1)) / 2 = (lo + hi) / 2 + 1 by grind] - rw [factorial_mul_prodRange, factorial_mul_prodRange] - all_goals grind + rw [prodRange, ← ascFactorial_eq_ascFactorialBinary, factorial_mul_ascFactorial] + grind @[csimp] -theorem factorialBinarySplitting_eq_factorial : @factorial = @factorialBinarySplitting := by +theorem factorial_eq_factorialBinarySplitting : @factorial = @factorialBinarySplitting := by ext n - by_cases h : n = 0 - · simp [h, factorialBinarySplitting] - · rw [factorialBinarySplitting, ← factorialBinarySplitting.factorial_mul_prodRange 0 n (by grind)] - simp [h] + simp [factorialBinarySplitting, ← ascFactorial_eq_ascFactorialBinary] + +@[deprecated (since := "2025-10-21")] +alias factorialBinarySplitting_eq_factorial := factorial_eq_factorialBinarySplitting + +/-- `descFactorial` implemented using binary splitting. -/ +def descFactorialBinary (n k : ℕ) : ℕ := + if n < k then 0 + else ascFactorialBinary (n - k + 1) k + +@[csimp] +theorem descFactorial_eq_descFactorialBinary : descFactorial = descFactorialBinary := by + ext n k + rw [descFactorialBinary] + split_ifs with h + · rw [descFactorial_of_lt h] + · rw [← ascFactorial_eq_ascFactorialBinary, ← add_descFactorial_eq_ascFactorial'] + grind +revert /-! We are now limited by time, not stack space, diff --git a/Mathlib/Data/Nat/Factorial/BigOperators.lean b/Mathlib/Data/Nat/Factorial/BigOperators.lean index 6d970006af9125..16b40543404fd4 100644 --- a/Mathlib/Data/Nat/Factorial/BigOperators.lean +++ b/Mathlib/Data/Nat/Factorial/BigOperators.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller, Pim Otte -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Tactic.Zify +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Tactic.Zify /-! # Factorial with big operators @@ -16,6 +18,8 @@ While in terms of semantics they could be in the `Basic.lean` file, importing -/ +@[expose] public section + open Finset Nat diff --git a/Mathlib/Data/Nat/Factorial/Cast.lean b/Mathlib/Data/Nat/Factorial/Cast.lean index cc3f4367eaf297..b377246c0e986a 100644 --- a/Mathlib/Data/Nat/Factorial/Cast.lean +++ b/Mathlib/Data/Nat/Factorial/Cast.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Data.Nat.Factorial.Basic +module + +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Data.Nat.Factorial.Basic /-! # Cast of factorials @@ -18,6 +20,8 @@ to subtraction on a general semiring. For example, we can't rely on existing cas to `↑a - 1`, the other factor is `0` anyway. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/Nat/Factorial/DoubleFactorial.lean b/Mathlib/Data/Nat/Factorial/DoubleFactorial.lean index 54db24579e0d66..40d3bb7a8ca3f2 100644 --- a/Mathlib/Data/Nat/Factorial/DoubleFactorial.lean +++ b/Mathlib/Data/Nat/Factorial/DoubleFactorial.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Jake Levinson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jake Levinson -/ -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Positivity.Core -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Positivity.Core +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Double factorials @@ -19,6 +21,8 @@ This file defines the double factorial, * `Nat.doubleFactorial`: The double factorial. -/ +@[expose] public section + open Nat @@ -83,7 +87,7 @@ open Lean Meta Qq /-- Extension for `Nat.doubleFactorial`. -/ @[positivity Nat.doubleFactorial _] -def evalDoubleFactorial : PositivityExt where eval {u α} _ _ e := do +meta def evalDoubleFactorial : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℕ), ~q(Nat.doubleFactorial $n) => assumeInstancesCommute diff --git a/Mathlib/Data/Nat/Factorial/NatCast.lean b/Mathlib/Data/Nat/Factorial/NatCast.lean index 437150c1b26fab..83eefcde872be9 100644 --- a/Mathlib/Data/Nat/Factorial/NatCast.lean +++ b/Mathlib/Data/Nat/Factorial/NatCast.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ +module -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Data.Finset.NatAntidiagonal -import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Data.Finset.NatAntidiagonal +public import Mathlib.RingTheory.Nilpotent.Defs /-! # Invertibility of factorials @@ -17,6 +18,8 @@ to be a unit. -/ +@[expose] public section + namespace IsUnit open Nat diff --git a/Mathlib/Data/Nat/Factorial/SuperFactorial.lean b/Mathlib/Data/Nat/Factorial/SuperFactorial.lean index 04ce6e238316be..028666953bdaff 100644 --- a/Mathlib/Data/Nat/Factorial/SuperFactorial.lean +++ b/Mathlib/Data/Nat/Factorial/SuperFactorial.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Firsching -/ -import Mathlib.Algebra.BigOperators.Intervals -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.BigOperators.Intervals +public import Mathlib.Tactic.Ring /-! # Superfactorial @@ -17,6 +19,8 @@ This file defines the [superfactorial](https://en.wikipedia.org/wiki/Superfactor * `Nat.superFactorial`: The superfactorial, denoted by `sf`. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Factorization/Basic.lean b/Mathlib/Data/Nat/Factorization/Basic.lean index e591e766172bd4..368441d7535e3e 100644 --- a/Mathlib/Data/Nat/Factorization/Basic.lean +++ b/Mathlib/Data/Nat/Factorization/Basic.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell -/ -import Mathlib.Algebra.Order.Interval.Finset.SuccPred -import Mathlib.Data.Nat.Factorization.Defs -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Algebra.Order.Interval.Finset.SuccPred +public import Mathlib.Data.Nat.Factorization.Defs +public import Mathlib.Order.Interval.Finset.Nat /-! # Basic lemmas on prime factorizations -/ +@[expose] public section + open Finset List Finsupp namespace Nat diff --git a/Mathlib/Data/Nat/Factorization/Defs.lean b/Mathlib/Data/Nat/Factorization/Defs.lean index f9754bf04e12c6..49eda1d1d49427 100644 --- a/Mathlib/Data/Nat/Factorization/Defs.lean +++ b/Mathlib/Data/Nat/Factorization/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell -/ -import Batteries.Data.List.Count -import Mathlib.Data.Finsupp.Multiset -import Mathlib.Data.Finsupp.Order -import Mathlib.Data.Nat.PrimeFin -import Mathlib.NumberTheory.Padics.PadicVal.Defs +module + +public import Batteries.Data.List.Count +public import Mathlib.Data.Finsupp.Multiset +public import Mathlib.Data.Finsupp.Order +public import Mathlib.Data.Nat.PrimeFin +public import Mathlib.NumberTheory.Padics.PadicVal.Defs /-! # Prime factorizations @@ -36,6 +38,8 @@ mapping each prime factor of `n` to its multiplicity in `n`. For example, since -/ +@[expose] public section + open Nat Finset List Finsupp namespace Nat diff --git a/Mathlib/Data/Nat/Factorization/Induction.lean b/Mathlib/Data/Nat/Factorization/Induction.lean index 74ac465ccda3e7..b4d7f97e8d9be3 100644 --- a/Mathlib/Data/Nat/Factorization/Induction.lean +++ b/Mathlib/Data/Nat/Factorization/Induction.lean @@ -3,12 +3,16 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stuart Presnell -/ -import Mathlib.Data.Nat.Factorization.Defs +module + +public import Mathlib.Data.Nat.Factorization.Defs /-! # Induction principles involving factorizations -/ +@[expose] public section + open Nat Finset List Finsupp namespace Nat diff --git a/Mathlib/Data/Nat/Factorization/LCM.lean b/Mathlib/Data/Nat/Factorization/LCM.lean index 590e63b5ab2885..0adecb4b1bf64f 100644 --- a/Mathlib/Data/Nat/Factorization/LCM.lean +++ b/Mathlib/Data/Nat/Factorization/LCM.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau -/ -import Mathlib.Data.Nat.Factorization.Basic -import Mathlib.Data.Nat.GCD.BigOperators +module + +public import Mathlib.Data.Nat.Factorization.Basic +public import Mathlib.Data.Nat.GCD.BigOperators /-! # Lemmas about `factorizationLCMLeft` @@ -13,6 +15,8 @@ This file contains some lemmas about `factorizationLCMLeft`. These were split from `Mathlib.Data.Nat.Factorization.Basic` to reduce transitive imports. -/ +@[expose] public section + open Finset List Finsupp namespace Nat diff --git a/Mathlib/Data/Nat/Factorization/PrimePow.lean b/Mathlib/Data/Nat/Factorization/PrimePow.lean index c4f1b47101b285..949008b7e02997 100644 --- a/Mathlib/Data/Nat/Factorization/PrimePow.lean +++ b/Mathlib/Data/Nat/Factorization/PrimePow.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Algebra.IsPrimePow -import Mathlib.Data.Nat.Factorization.Basic -import Mathlib.Data.Nat.Prime.Pow -import Mathlib.NumberTheory.Divisors +module + +public import Mathlib.Algebra.IsPrimePow +public import Mathlib.Data.Nat.Factorization.Basic +public import Mathlib.Data.Nat.Prime.Pow +public import Mathlib.NumberTheory.Divisors /-! # Prime powers and factorizations @@ -14,6 +16,8 @@ import Mathlib.NumberTheory.Divisors This file deals with factorizations of prime powers. -/ +@[expose] public section + theorem IsPrimePow.minFac_pow_factorization_eq {n : ℕ} (hn : IsPrimePow n) : n.minFac ^ n.factorization n.minFac = n := by diff --git a/Mathlib/Data/Nat/Factorization/Root.lean b/Mathlib/Data/Nat/Factorization/Root.lean index d08ad18355a43f..ab18a93653fa60 100644 --- a/Mathlib/Data/Nat/Factorization/Root.lean +++ b/Mathlib/Data/Nat/Factorization/Root.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Floor.Div -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Data.Nat.Factorization.Defs +module + +public import Mathlib.Algebra.Order.Floor.Div +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Data.Nat.Factorization.Defs /-! # Roots of natural numbers, rounded up and down @@ -29,6 +31,8 @@ multiple of `a` as the multiples of some fixed number (aka `ceilRoot n a`). See * `norm_num` extension -/ +@[expose] public section + open Finsupp namespace Nat diff --git a/Mathlib/Data/Nat/Factors.lean b/Mathlib/Data/Nat/Factors.lean index 5f7de23f4cba0a..7adcc91143f0fb 100644 --- a/Mathlib/Data/Nat/Factors.lean +++ b/Mathlib/Data/Nat/Factors.lean @@ -3,12 +3,14 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.BigOperators.Ring.List -import Mathlib.Data.Nat.GCD.Basic -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.List.Prime -import Mathlib.Data.List.Sort -import Mathlib.Data.List.Perm.Subperm +module + +public import Mathlib.Algebra.BigOperators.Ring.List +public import Mathlib.Data.Nat.GCD.Basic +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Data.List.Prime +public import Mathlib.Data.List.Sort +public import Mathlib.Data.List.Perm.Subperm /-! # Prime numbers @@ -22,6 +24,8 @@ This file deals with the factors of natural numbers. -/ +@[expose] public section + assert_not_exists Multiset open Bool Subtype diff --git a/Mathlib/Data/Nat/Fib/Basic.lean b/Mathlib/Data/Nat/Fib/Basic.lean index e243f7e2573eae..cc2584d68619c9 100644 --- a/Mathlib/Data/Nat/Fib/Basic.lean +++ b/Mathlib/Data/Nat/Fib/Basic.lean @@ -3,56 +3,52 @@ Copyright (c) 2019 Kevin Kappelmann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Kappelmann, Kyle Miller, Mario Carneiro -/ -import Mathlib.Data.Finset.NatAntidiagonal -import Mathlib.Data.Nat.GCD.Basic -import Mathlib.Data.Nat.BinaryRec -import Mathlib.Logic.Function.Iterate -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Zify -import Mathlib.Data.Nat.Choose.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module -/-! -# Fibonacci Numbers - -This file defines the fibonacci series, proves results about it and introduces -methods to compute it quickly. --/ +public import Mathlib.Data.Finset.NatAntidiagonal +public import Mathlib.Data.Nat.GCD.Basic +public import Mathlib.Data.Nat.BinaryRec +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Zify +public import Mathlib.Data.Nat.Choose.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! -# The Fibonacci Sequence +# Fibonacci numbers -## Summary +This file defines the Fibonacci sequence as `F₀ = 0, F₁ = 1, Fₙ₊₂ = Fₙ + Fₙ₊₁`. Furthermore, it +proves results about the sequence and introduces methods to compute it quickly. -Definition of the Fibonacci sequence `F₀ = 0, F₁ = 1, Fₙ₊₂ = Fₙ + Fₙ₊₁`. - -## Main Definitions +## Main definitions - `Nat.fib` returns the stream of Fibonacci numbers. -## Main Statements +## Main statements -- `Nat.fib_add_two`: shows that `fib` indeed satisfies the Fibonacci recurrence `Fₙ₊₂ = Fₙ + Fₙ₊₁.`. +- `Nat.fib_add_two`: shows that `fib` indeed satisfies the Fibonacci recurrence `Fₙ₊₂ = Fₙ + Fₙ₊₁`. - `Nat.fib_gcd`: `fib n` is a strong divisibility sequence. - `Nat.fib_succ_eq_sum_choose`: `fib` is given by the sum of `Nat.choose` along an antidiagonal. - `Nat.fib_succ_eq_succ_sum`: shows that `F₀ + F₁ + ⋯ + Fₙ = Fₙ₊₂ - 1`. - `Nat.fib_two_mul` and `Nat.fib_two_mul_add_one` are the basis for an efficient algorithm to compute `fib` (see `Nat.fastFib`). -## Implementation Notes +## Implementation notes For efficiency purposes, the sequence is defined using `Stream.iterate`. ## Tags -fib, fibonacci +Fibonacci numbers, Fibonacci sequence -/ +@[expose] public section + namespace Nat -/-- Implementation of the fibonacci sequence satisfying +/-- Implementation of the Fibonacci sequence satisfying `fib 0 = 0, fib 1 = 1, fib (n + 2) = fib n + fib (n + 1)`. *Note:* We use a stream iterator for better performance when compared to the naive recursive @@ -74,7 +70,7 @@ theorem fib_one : fib 1 = 1 := theorem fib_two : fib 2 = 1 := rfl -/-- Shows that `fib` indeed satisfies the Fibonacci recurrence `Fₙ₊₂ = Fₙ + Fₙ₊₁.` -/ +/-- Shows that `fib` indeed satisfies the Fibonacci recurrence `Fₙ₊₂ = Fₙ + Fₙ₊₁`. -/ theorem fib_add_two {n : ℕ} : fib (n + 2) = fib n + fib (n + 1) := by simp [fib, Function.iterate_succ_apply'] diff --git a/Mathlib/Data/Nat/Fib/Zeckendorf.lean b/Mathlib/Data/Nat/Fib/Zeckendorf.lean index 13914eae95960b..3400990f399450 100644 --- a/Mathlib/Data/Nat/Fib/Zeckendorf.lean +++ b/Mathlib/Data/Nat/Fib/Zeckendorf.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Nat.Fib.Basic +module + +public import Mathlib.Data.Nat.Fib.Basic /-! # Zeckendorf's Theorem @@ -30,6 +32,8 @@ the lexicographic order. fibonacci, zeckendorf, digit -/ +@[expose] public section + open List Nat -- TODO: The `local` attribute makes this not considered as an instance by linters diff --git a/Mathlib/Data/Nat/Find.lean b/Mathlib/Data/Nat/Find.lean index 4945d73fef0c92..5f5ce563ca9d76 100644 --- a/Mathlib/Data/Nat/Find.lean +++ b/Mathlib/Data/Nat/Find.lean @@ -3,14 +3,18 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ +module -import Mathlib.Data.Nat.Basic -import Batteries.WF +public import Mathlib.Data.Nat.Basic +public import Mathlib.Tactic.Push +public import Batteries.WF /-! # `Nat.find` and `Nat.findGreatest` -/ +@[expose] public section + variable {m n k : ℕ} {p q : ℕ → Prop} namespace Nat @@ -163,10 +167,10 @@ def findGreatest (P : ℕ → Prop) [DecidablePred P] : ℕ → ℕ variable {P Q : ℕ → Prop} [DecidablePred P] {n : ℕ} -@[simp] lemma findGreatest_zero : Nat.findGreatest P 0 = 0 := rfl +@[simp] lemma findGreatest_zero : Nat.findGreatest P 0 = 0 := (rfl) lemma findGreatest_succ (n : ℕ) : - Nat.findGreatest P (n + 1) = if P (n + 1) then n + 1 else Nat.findGreatest P n := rfl + Nat.findGreatest P (n + 1) = if P (n + 1) then n + 1 else Nat.findGreatest P n := (rfl) @[simp] lemma findGreatest_eq : ∀ {n}, P n → Nat.findGreatest P n = n | 0, _ => rfl diff --git a/Mathlib/Data/Nat/GCD/Basic.lean b/Mathlib/Data/Nat/GCD/Basic.lean index 7f9bbbd5be6717..1b0d665325fd9b 100644 --- a/Mathlib/Data/Nat/GCD/Basic.lean +++ b/Mathlib/Data/Nat/GCD/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Algebra.Group.Nat.Units -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.GroupWithZero.Nat +module + +public import Mathlib.Algebra.Group.Nat.Units +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.GroupWithZero.Nat /-! # Properties of `Nat.gcd`, `Nat.lcm`, and `Nat.Coprime` @@ -21,6 +23,8 @@ Note that the global `IsCoprime` is not a straightforward generalization of `Nat Most of this file could be moved to batteries as well. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid namespace Nat diff --git a/Mathlib/Data/Nat/GCD/BigOperators.lean b/Mathlib/Data/Nat/GCD/BigOperators.lean index 7537108cc2eae5..4d2dbe52482b2f 100644 --- a/Mathlib/Data/Nat/GCD/BigOperators.lean +++ b/Mathlib/Data/Nat/GCD/BigOperators.lean @@ -3,13 +3,17 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! # Lemmas about coprimality with big products. These lemmas are kept separate from `Data.Nat.GCD.Basic` in order to minimize imports. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/GCD/Prime.lean b/Mathlib/Data/Nat/GCD/Prime.lean index fc51e20c309aad..3fc7a15653e612 100644 --- a/Mathlib/Data/Nat/GCD/Prime.lean +++ b/Mathlib/Data/Nat/GCD/Prime.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yongshun Ye. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongshun Ye -/ -import Mathlib.Data.Nat.GCD.Basic -import Mathlib.Data.Nat.Prime.Defs +module + +public import Mathlib.Data.Nat.GCD.Basic +public import Mathlib.Data.Nat.Prime.Defs /-! # Lemmas related to `Nat.Prime` and `lcm` @@ -20,6 +22,8 @@ These lemmas are kept separate from `Mathlib/Data/Nat/GCD/Basic.lean` in order t -/ +@[expose] public section + namespace Nat namespace Prime diff --git a/Mathlib/Data/Nat/Hyperoperation.lean b/Mathlib/Data/Nat/Hyperoperation.lean index 8976d4de2de4bd..75a1f5a268ff42 100644 --- a/Mathlib/Data/Nat/Hyperoperation.lean +++ b/Mathlib/Data/Nat/Hyperoperation.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Mark Andrew Gerads. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mark Andrew Gerads, Junyan Xu, Eric Wieser -/ -import Mathlib.Tactic.Ring +module + +public import Mathlib.Tactic.Ring /-! # Hyperoperation sequence @@ -25,6 +27,8 @@ This file defines the Hyperoperation sequence. hyperoperation -/ +@[expose] public section + /-- Implementation of the hyperoperation sequence where `hyperoperation n m k` is the `n`th hyperoperation between `m` and `k`. diff --git a/Mathlib/Data/Nat/Init.lean b/Mathlib/Data/Nat/Init.lean index b7ca036f32dd9f..797742b4e98644 100644 --- a/Mathlib/Data/Nat/Init.lean +++ b/Mathlib/Data/Nat/Init.lean @@ -3,15 +3,17 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Batteries.Tactic.Alias -import Batteries.Tactic.Init -import Mathlib.Init -import Mathlib.Data.Int.Notation -import Mathlib.Data.Nat.Notation -import Mathlib.Tactic.Basic -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar -import Mathlib.Util.AssertExists +module + +public import Batteries.Tactic.Alias +public import Batteries.Tactic.Init +public import Mathlib.Init +public import Mathlib.Data.Int.Notation +public import Mathlib.Data.Nat.Notation +public import Mathlib.Tactic.Basic +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar +public import Mathlib.Util.AssertExists /-! # Basic operations on the natural numbers @@ -31,8 +33,10 @@ upstreamed to Batteries or the Lean standard library easily. See note [foundational algebra order theory]. -/ +@[expose] public section + library_note2 «foundational algebra order theory» /-- -Batteries has a home-baked development of the algebraic and order-theoretic theory of `ℕ` and `ℤ +Batteries has a home-baked development of the algebraic and order-theoretic theory of `ℕ` and `ℤ` which, in particular, is not typeclass-mediated. This is useful to set up the algebra and finiteness libraries in mathlib (naturals and integers show up as indices/offsets in lists, cardinality in finsets, powers in groups, ...). diff --git a/Mathlib/Data/Nat/Lattice.lean b/Mathlib/Data/Nat/Lattice.lean index 315e70e04c1b5f..1b7e5e926f9c76 100644 --- a/Mathlib/Data/Nat/Lattice.lean +++ b/Mathlib/Data/Nat/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Floris van Doorn, Gabriel Ebner, Yury Kudryashov -/ -import Mathlib.Data.Set.Accumulate -import Mathlib.Order.ConditionallyCompleteLattice.Finset -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Data.Set.Accumulate +public import Mathlib.Order.ConditionallyCompleteLattice.Finset +public import Mathlib.Order.Interval.Finset.Nat /-! # Conditionally complete linear order structure on `ℕ` @@ -16,6 +18,8 @@ In this file we * prove a few lemmas about `iSup`/`iInf`/`Set.iUnion`/`Set.iInter` and natural numbers. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Set diff --git a/Mathlib/Data/Nat/Log.lean b/Mathlib/Data/Nat/Log.lean index a942dd3113ef4a..95cf1ce38fb6df 100644 --- a/Mathlib/Data/Nat/Log.lean +++ b/Mathlib/Data/Nat/Log.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Yaël Dillies -/ -import Mathlib.Data.Nat.BinaryRec -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Order.Monotone.Basic -import Mathlib.Tactic.Bound.Attribute -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Data.Nat.BinaryRec +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Order.Monotone.Basic +public import Mathlib.Tactic.Bound.Attribute +public import Mathlib.Tactic.Contrapose +public import Mathlib.Tactic.Monotonicity.Attr /-! # Natural number logarithms @@ -21,6 +23,8 @@ These are interesting because, for `1 < b`, `Nat.log b` and `Nat.clog b` are res left adjoints of `Nat.pow b`. See `pow_le_iff_le_log` and `le_pow_iff_clog_le`. -/ +@[expose] public section + assert_not_exists OrderTop namespace Nat diff --git a/Mathlib/Data/Nat/MaxPowDiv.lean b/Mathlib/Data/Nat/MaxPowDiv.lean index 49e66f23efbdfa..0f19c057f050bb 100644 --- a/Mathlib/Data/Nat/MaxPowDiv.lean +++ b/Mathlib/Data/Nat/MaxPowDiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Matthew Robert Ballard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matthew Robert Ballard -/ -import Mathlib.Algebra.Divisibility.Units -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Divisibility.Units +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Tactic.Common /-! # The maximal power of one natural number dividing another @@ -19,6 +21,8 @@ We prove enough about `maxPowDiv` in this file to show equality with `Nat.padicV The implementation of `maxPowDiv` improves on the speed of `padicValNat`. -/ +@[expose] public section + namespace Nat /-- diff --git a/Mathlib/Data/Nat/ModEq.lean b/Mathlib/Data/Nat/ModEq.lean index df039b21675a43..f0ed8e254a927b 100644 --- a/Mathlib/Data/Nat/ModEq.lean +++ b/Mathlib/Data/Nat/ModEq.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Unbundled.Int -import Mathlib.Algebra.Ring.Nat -import Mathlib.Data.Int.GCD -import Mathlib.Data.Nat.GCD.Basic +module + +public import Mathlib.Algebra.Order.Group.Unbundled.Int +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Data.Int.GCD +public import Mathlib.Data.Nat.GCD.Basic /-! # Congruences modulo a natural number @@ -24,6 +26,8 @@ and proves basic properties about it such as the Chinese Remainder Theorem ModEq, congruence, mod, MOD, modulo -/ +@[expose] public section + assert_not_exists IsOrderedMonoid Function.support namespace Nat diff --git a/Mathlib/Data/Nat/Multiplicity.lean b/Mathlib/Data/Nat/Multiplicity.lean index 2dfe4567715919..a39904c1999022 100644 --- a/Mathlib/Data/Nat/Multiplicity.lean +++ b/Mathlib/Data/Nat/Multiplicity.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Nat.Choose.Factorization +module + +public import Mathlib.Data.Nat.Choose.Factorization /-! # Natural number multiplicity @@ -43,6 +45,8 @@ Derive results from the corresponding ones `Mathlib.Data.Nat.Factorization.Multi Legendre, p-adic -/ +@[expose] public section + open Finset namespace Nat diff --git a/Mathlib/Data/Nat/Notation.lean b/Mathlib/Data/Nat/Notation.lean index c23a8c794808b8..ef7810998c571d 100644 --- a/Mathlib/Data/Nat/Notation.lean +++ b/Mathlib/Data/Nat/Notation.lean @@ -3,11 +3,14 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Notation `ℕ` for the natural numbers. -/ +@[expose] public section + @[inherit_doc] notation "ℕ" => Nat diff --git a/Mathlib/Data/Nat/Nth.lean b/Mathlib/Data/Nat/Nth.lean index 016162ea818250..75297236e7e50d 100644 --- a/Mathlib/Data/Nat/Nth.lean +++ b/Mathlib/Data/Nat/Nth.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Vladimir Goryachev. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Vladimir Goryachev, Kyle Miller, Kim Morrison, Eric Rodriguez -/ -import Mathlib.Data.List.GetD -import Mathlib.Data.Nat.Count -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.Interval.Set.Monotone -import Mathlib.Order.OrderIsoNat -import Mathlib.Order.WellFounded -import Mathlib.Data.Finset.Sort +module + +public import Mathlib.Data.List.GetD +public import Mathlib.Data.Nat.Count +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.Interval.Set.Monotone +public import Mathlib.Order.OrderIsoNat +public import Mathlib.Order.WellFounded +public import Mathlib.Data.Finset.Sort /-! # The `n`th Number Satisfying a Predicate @@ -43,6 +45,8 @@ Future work should address how lemmas that use these should be written. -/ +@[expose] public section + open Finset diff --git a/Mathlib/Data/Nat/NthRoot/Defs.lean b/Mathlib/Data/Nat/NthRoot/Defs.lean index 47ac390314699e..83a40059e89ac5 100644 --- a/Mathlib/Data/Nat/NthRoot/Defs.lean +++ b/Mathlib/Data/Nat/NthRoot/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Concordance Inc. dba Harmonic. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! # Definition of `Nat.nthRoot` @@ -12,6 +14,8 @@ In this file we define `Nat.nthRoot n a` to be the floor of the `n`th root of `a The function is defined in terms of natural numbers with no dependencies outside of prelude. -/ +@[expose] public section + /-- `Nat.nthRoot n a = ⌊(a : ℝ) ^ (1 / n : ℝ)⌋₊` defined in terms of natural numbers. We use Newton's method to find a root of $x^n = a$, diff --git a/Mathlib/Data/Nat/Order/Lemmas.lean b/Mathlib/Data/Nat/Order/Lemmas.lean index bb58ae8d4f943d..f404f3608a0645 100644 --- a/Mathlib/Data/Nat/Order/Lemmas.lean +++ b/Mathlib/Data/Nat/Order/Lemmas.lean @@ -3,8 +3,11 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Nat.Find -import Mathlib.Data.Set.Basic +module + +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.Set.Basic +public import Mathlib.Tactic.ByContra /-! # Further lemmas about the natural numbers @@ -14,6 +17,8 @@ clear. They were separated for now to minimize the porting requirements for tact during the transition to mathlib4. Please feel free to reorganize these two files. -/ +@[expose] public section + assert_not_exists RelIso namespace Nat diff --git a/Mathlib/Data/Nat/PSub.lean b/Mathlib/Data/Nat/PSub.lean index e3b06032edaff2..9ec95f5d419e78 100644 --- a/Mathlib/Data/Nat/PSub.lean +++ b/Mathlib/Data/Nat/PSub.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Data.Nat.Basic /-! # Partial predecessor and partial subtraction on the natural numbers @@ -21,6 +23,8 @@ wrap the result in an `Option` type instead: -/ +@[expose] public section + namespace Nat /-- Partial predecessor operation. Returns `ppred n = some m` diff --git a/Mathlib/Data/Nat/Pairing.lean b/Mathlib/Data/Nat/Pairing.lean index ef232fd6857d95..e93a08050fb187 100644 --- a/Mathlib/Data/Nat/Pairing.lean +++ b/Mathlib/Data/Nat/Pairing.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Notation.Prod -import Mathlib.Data.Nat.Sqrt -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Data.Nat.Sqrt +public import Mathlib.Data.Set.Lattice.Image /-! # Naturals pairing function @@ -23,6 +25,8 @@ It has the advantage of being monotone in both directions and sending `⟦0, n^2 `⟦0, n - 1⟧²`. -/ +@[expose] public section + assert_not_exists Monoid open Prod Decidable Function diff --git a/Mathlib/Data/Nat/PartENat.lean b/Mathlib/Data/Nat/PartENat.lean index 2d17ff739f7529..30809c37606492 100644 --- a/Mathlib/Data/Nat/PartENat.lean +++ b/Mathlib/Data/Nat/PartENat.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Equiv.Basic -import Mathlib.Data.ENat.Lattice -import Mathlib.Data.Part -import Mathlib.Tactic.NormNum +module + +public import Mathlib.Algebra.Group.Equiv.Basic +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Data.Part +public import Mathlib.Tactic.NormNum /-! # Natural numbers with infinity @@ -53,6 +55,8 @@ If `ENat` does not serve your purposes, please raise this on the community Zulip PartENat, ℕ∞ -/ +@[expose] public section + open Part hiding some @@ -220,7 +224,6 @@ instance decidableLe (x y : PartENat) [Decidable x.Dom] [Decidable y.Dom] : Deci else isTrue ⟨fun h => (hy h).elim, fun h => (hy h).elim⟩ instance partialOrder : PartialOrder PartENat where - le := (· ≤ ·) le_refl _ := ⟨id, fun _ => le_rfl⟩ le_trans := fun _ _ _ ⟨hxy₁, hxy₂⟩ ⟨hyz₁, hyz₂⟩ => ⟨hxy₁ ∘ hyz₁, fun _ => le_trans (hxy₂ _) (hyz₂ _)⟩ @@ -261,11 +264,9 @@ instance semilatticeSup : SemilatticeSup PartENat := ⟨fun hz => ⟨hx₁ hz, hy₁ hz⟩, fun _ => sup_le (hx₂ _) (hy₂ _)⟩ } instance orderBot : OrderBot PartENat where - bot := ⊥ bot_le _ := ⟨fun _ => trivial, fun _ => Nat.zero_le _⟩ instance orderTop : OrderTop PartENat where - top := ⊤ le_top _ := ⟨fun h => False.elim h, fun hy => False.elim hy⟩ instance : ZeroLEOneClass PartENat where diff --git a/Mathlib/Data/Nat/Periodic.lean b/Mathlib/Data/Nat/Periodic.lean index 1b8a519e04efea..32f97b528a7855 100644 --- a/Mathlib/Data/Nat/Periodic.lean +++ b/Mathlib/Data/Nat/Periodic.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey -/ -import Mathlib.Algebra.Ring.Periodic -import Mathlib.Data.Nat.Count +module + +public import Mathlib.Algebra.Ring.Periodic +public import Mathlib.Data.Nat.Count /-! # Periodic Functions on ℕ @@ -13,6 +15,8 @@ This file identifies a few functions on `ℕ` which are periodic, and also prove periodic predicates which helps determine their cardinality when filtering intervals over them. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace Nat diff --git a/Mathlib/Data/Nat/PowModTotient.lean b/Mathlib/Data/Nat/PowModTotient.lean index af6dec599e1820..fb9fcde67753db 100644 --- a/Mathlib/Data/Nat/PowModTotient.lean +++ b/Mathlib/Data/Nat/PowModTotient.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.PowModTotient +module + +public import Mathlib.NumberTheory.PowModTotient deprecated_module (since := "2025-09-19") diff --git a/Mathlib/Data/Nat/Prime/Basic.lean b/Mathlib/Data/Nat/Prime/Basic.lean index 400d216d7222e3..bdbdb33a31f845 100644 --- a/Mathlib/Data/Nat/Prime/Basic.lean +++ b/Mathlib/Data/Nat/Prime/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.Ring.Parity -import Mathlib.Data.Nat.Prime.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.Ring.Parity +public import Mathlib.Data.Nat.Prime.Defs /-! # Prime numbers @@ -15,6 +17,8 @@ This file develops the theory of prime numbers: natural numbers `p ≥ 2` whose -/ +@[expose] public section + namespace Nat variable {n : ℕ} diff --git a/Mathlib/Data/Nat/Prime/Defs.lean b/Mathlib/Data/Nat/Prime/Defs.lean index 7cb7bb9350ec42..b43590fad8e478 100644 --- a/Mathlib/Data/Nat/Prime/Defs.lean +++ b/Mathlib/Data/Nat/Prime/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Units -import Mathlib.Algebra.GroupWithZero.Nat -import Mathlib.Algebra.Prime.Defs -import Mathlib.Data.Nat.Sqrt -import Mathlib.Order.Basic +module + +public import Mathlib.Algebra.Group.Nat.Units +public import Mathlib.Algebra.GroupWithZero.Nat +public import Mathlib.Algebra.Prime.Defs +public import Mathlib.Data.Nat.Sqrt +public import Mathlib.Order.Basic /-! # Prime numbers @@ -25,6 +27,8 @@ This file deals with prime numbers: natural numbers `p ≥ 2` whose only divisor -/ +@[expose] public section + assert_not_exists Ring namespace Nat diff --git a/Mathlib/Data/Nat/Prime/Factorial.lean b/Mathlib/Data/Nat/Prime/Factorial.lean index e74974d580215a..47eee5f558dee7 100644 --- a/Mathlib/Data/Nat/Prime/Factorial.lean +++ b/Mathlib/Data/Nat/Prime/Factorial.lean @@ -3,13 +3,17 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Data.Nat.Prime.Basic +module + +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.Nat.Prime.Basic /-! # Prime natural numbers and the factorial operator -/ +@[expose] public section + open Bool Subtype open Nat diff --git a/Mathlib/Data/Nat/Prime/Infinite.lean b/Mathlib/Data/Nat/Prime/Infinite.lean index f67b58631e7690..3f7a8b1f043f99 100644 --- a/Mathlib/Data/Nat/Prime/Infinite.lean +++ b/Mathlib/Data/Nat/Prime/Infinite.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Order.Bounds.Basic +module + +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Order.Bounds.Basic /-! ## Notable Theorems @@ -16,6 +18,8 @@ import Mathlib.Order.Bounds.Basic -/ +@[expose] public section + open Bool Subtype open Nat diff --git a/Mathlib/Data/Nat/Prime/Int.lean b/Mathlib/Data/Nat/Prime/Int.lean index ba1b0d847e7db0..ec5f2f2affe804 100644 --- a/Mathlib/Data/Nat/Prime/Int.lean +++ b/Mathlib/Data/Nat/Prime/Int.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Algebra.Group.Int.Units -import Mathlib.Data.Int.Basic +module + +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Algebra.Group.Int.Units +public import Mathlib.Data.Int.Basic /-! # Prime numbers in the naturals and the integers @@ -14,6 +16,8 @@ import Mathlib.Data.Int.Basic TODO: This file can probably be merged with `Mathlib/Data/Int/NatPrime.lean`. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Prime/Nth.lean b/Mathlib/Data/Nat/Prime/Nth.lean index f9d09d963c17e3..f51ff2701f4bb2 100644 --- a/Mathlib/Data/Nat/Prime/Nth.lean +++ b/Mathlib/Data/Nat/Prime/Nth.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Ralf Stephan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ralf Stephan -/ -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.Nat.Nth +module + +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.Nat.Nth /-! # The Nth primes -/ +@[expose] public section + namespace Nat @[simp] diff --git a/Mathlib/Data/Nat/Prime/Pow.lean b/Mathlib/Data/Nat/Prime/Pow.lean index a103a434d4ff6f..e73da7ca221299 100644 --- a/Mathlib/Data/Nat/Prime/Pow.lean +++ b/Mathlib/Data/Nat/Prime/Pow.lean @@ -3,8 +3,10 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Data.Nat.Prime.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Data.Nat.Prime.Basic /-! # Prime numbers @@ -14,6 +16,8 @@ This file develops the theory of prime numbers: natural numbers `p ≥ 2` whose -/ +@[expose] public section + namespace Nat theorem pow_minFac {n k : ℕ} (hk : k ≠ 0) : (n ^ k).minFac = n.minFac := by diff --git a/Mathlib/Data/Nat/PrimeFin.lean b/Mathlib/Data/Nat/PrimeFin.lean index ebaca0692cd82e..068ca826e47863 100644 --- a/Mathlib/Data/Nat/PrimeFin.lean +++ b/Mathlib/Data/Nat/PrimeFin.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Countable.Defs -import Mathlib.Data.Nat.Factors -import Mathlib.Data.Nat.Prime.Infinite -import Mathlib.Data.Set.Finite.Lattice +module + +public import Mathlib.Data.Countable.Defs +public import Mathlib.Data.Nat.Factors +public import Mathlib.Data.Nat.Prime.Infinite +public import Mathlib.Data.Set.Finite.Lattice /-! # Prime numbers @@ -14,6 +16,8 @@ import Mathlib.Data.Set.Finite.Lattice This file contains some results about prime numbers which depend on finiteness of sets. -/ +@[expose] public section + open Finset namespace Nat diff --git a/Mathlib/Data/Nat/Set.lean b/Mathlib/Data/Nat/Set.lean index 416415053788b7..02ca1a684c9111 100644 --- a/Mathlib/Data/Nat/Set.lean +++ b/Mathlib/Data/Nat/Set.lean @@ -3,12 +3,16 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Image +module + +public import Mathlib.Data.Set.Image /-! ### Recursion on the natural numbers and `Set.range` -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/Size.lean b/Mathlib/Data/Nat/Size.lean index dfe9ad32d3a4cf..a7163f984daa5f 100644 --- a/Mathlib/Data/Nat/Size.lean +++ b/Mathlib/Data/Nat/Size.lean @@ -3,13 +3,17 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Algebra.Group.Basic -import Mathlib.Data.Nat.Bits -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Algebra.Group.Basic +public import Mathlib.Data.Nat.Bits +public import Mathlib.Data.Nat.Basic /-! Lemmas about `size`. -/ +@[expose] public section + namespace Nat /-! ### `shiftLeft` and `shiftRight` -/ diff --git a/Mathlib/Data/Nat/Sqrt.lean b/Mathlib/Data/Nat/Sqrt.lean index 772fdf97840d61..993fe3177166a7 100644 --- a/Mathlib/Data/Nat/Sqrt.lean +++ b/Mathlib/Data/Nat/Sqrt.lean @@ -3,13 +3,17 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Nat.Basic -import Batteries.Data.Nat.Basic +module + +public import Mathlib.Data.Nat.Basic +public import Batteries.Data.Nat.Basic /-! # Properties of the natural number square root function. -/ +@[expose] public section + namespace Nat /- We don't want to import the algebraic hierarchy in this file. -/ @@ -173,7 +177,7 @@ lemma sqrt_succ_le_succ_sqrt (n : ℕ) : sqrt n.succ ≤ n.sqrt.succ := le_of_lt_succ <| sqrt_lt.2 <| (have := sqrt_le_add n; by grind) @[simp] -lemma log2_two : (2 : ℕ).log2 = 1 := rfl +lemma log2_two : (2 : ℕ).log2 = 1 := by simp [log2_def] @[simp] lemma sqrt_two : sqrt 2 = 1 := by simp [sqrt, sqrt.iter] diff --git a/Mathlib/Data/Nat/Squarefree.lean b/Mathlib/Data/Nat/Squarefree.lean index d27d1f3ccb9a02..2635f694cd0102 100644 --- a/Mathlib/Data/Nat/Squarefree.lean +++ b/Mathlib/Data/Nat/Squarefree.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Algebra.Squarefree.Basic -import Mathlib.Data.Nat.Factorization.Basic -import Mathlib.NumberTheory.Divisors -import Mathlib.RingTheory.UniqueFactorizationDomain.Nat +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Algebra.Squarefree.Basic +public import Mathlib.Data.Nat.Factorization.Basic +public import Mathlib.NumberTheory.Divisors +public import Mathlib.RingTheory.UniqueFactorizationDomain.Nat /-! # Lemmas about squarefreeness of natural numbers @@ -22,6 +24,8 @@ squarefree, multiplicity -/ +@[expose] public section + open Finset namespace Nat diff --git a/Mathlib/Data/Nat/SuccPred.lean b/Mathlib/Data/Nat/SuccPred.lean index e9fcc05e127b9e..96317567b3b0e3 100644 --- a/Mathlib/Data/Nat/SuccPred.lean +++ b/Mathlib/Data/Nat/SuccPred.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Ring.Nat -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Algebra.Order.Sub.Unbundled.Basic -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Data.Fin.Basic -import Mathlib.Order.Nat -import Mathlib.Order.SuccPred.Archimedean -import Mathlib.Order.SuccPred.WithBot +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Data.Fin.Basic +public import Mathlib.Order.Nat +public import Mathlib.Order.SuccPred.Archimedean +public import Mathlib.Order.SuccPred.WithBot /-! # Successors and predecessors of naturals @@ -19,6 +21,8 @@ import Mathlib.Order.SuccPred.WithBot In this file, we show that `ℕ` is both an archimedean `succOrder` and an archimedean `predOrder`. -/ +@[expose] public section + open Function Order diff --git a/Mathlib/Data/Nat/Totient.lean b/Mathlib/Data/Nat/Totient.lean index a306bdb3f4a7ac..53f2a7974ed651 100644 --- a/Mathlib/Data/Nat/Totient.lean +++ b/Mathlib/Data/Nat/Totient.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.CharP.Two -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Data.Nat.Cast.Field -import Mathlib.Data.Nat.Factorization.Basic -import Mathlib.Data.Nat.Factorization.Induction -import Mathlib.Data.Nat.Periodic +module + +public import Mathlib.Algebra.CharP.Two +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Data.Nat.Cast.Field +public import Mathlib.Data.Nat.Factorization.Basic +public import Mathlib.Data.Nat.Factorization.Induction +public import Mathlib.Data.Nat.Periodic /-! # Euler's totient function @@ -20,6 +22,8 @@ We prove the divisor sum formula, namely that `n` equals `φ` summed over the di `totient_prime_pow`. -/ +@[expose] public section + assert_not_exists Algebra LinearMap open Finset @@ -377,7 +381,7 @@ open Lean Meta Qq /-- Extension for `Nat.totient`. -/ @[positivity Nat.totient _] -def evalNatTotient : PositivityExt where eval {u α} z p e := do +meta def evalNatTotient : PositivityExt where eval {u α} z p e := do match u, α, e with | 0, ~q(ℕ), ~q(Nat.totient $n) => assumeInstancesCommute diff --git a/Mathlib/Data/Nat/Upto.lean b/Mathlib/Data/Nat/Upto.lean index b55880fccd1369..d2126b3e5d098f 100644 --- a/Mathlib/Data/Nat/Upto.lean +++ b/Mathlib/Data/Nat/Upto.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Sub.Basic +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Sub.Basic /-! # `Nat.Upto` @@ -21,6 +23,8 @@ the difference that, in `Nat.Upto p`, `p` does not need to be decidable. In fact well-founded relation and would then fulfill the same purpose as this file. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Nat/WithBot.lean b/Mathlib/Data/Nat/WithBot.lean index 9ddbf7bcbbd23d..6230a997f5cdd8 100644 --- a/Mathlib/Data/Nat/WithBot.lean +++ b/Mathlib/Data/Nat/WithBot.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Nat.Cast.WithTop -import Mathlib.Order.Nat +module + +public import Mathlib.Data.Nat.Cast.WithTop +public import Mathlib.Order.Nat /-! # `WithBot ℕ` @@ -12,6 +14,8 @@ import Mathlib.Order.Nat Lemmas about the type of natural numbers with a bottom element adjoined. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/Data/Num/Basic.lean b/Mathlib/Data/Num/Basic.lean index b8a9e3b1d0f485..c8a50d5ff9dc90 100644 --- a/Mathlib/Data/Num/Basic.lean +++ b/Mathlib/Data/Num/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Lean.Linter.Deprecated -import Mathlib.Data.Nat.Notation -import Mathlib.Data.Int.Notation -import Mathlib.Data.Nat.BinaryRec -import Mathlib.Tactic.TypeStar +module + +public import Lean.Linter.Deprecated +public import Mathlib.Data.Nat.Notation +public import Mathlib.Data.Int.Notation +public import Mathlib.Data.Nat.BinaryRec +public import Mathlib.Tactic.TypeStar /-! # Binary representation of integers using inductive types @@ -18,6 +20,8 @@ in favor of the "Peano" natural numbers `Nat`, and the purpose of this collection of theorems is to show the equivalence of the different approaches. -/ +@[expose] public section + /-- The type of positive binary numbers. 13 = 1101(base 2) = bit1 (bit0 (bit1 one)) -/ diff --git a/Mathlib/Data/Num/Bitwise.lean b/Mathlib/Data/Num/Bitwise.lean index db600eede9abb4..0870d8e9c41287 100644 --- a/Mathlib/Data/Num/Bitwise.lean +++ b/Mathlib/Data/Num/Bitwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Num.Basic -import Mathlib.Data.Vector.Basic +module + +public import Mathlib.Data.Num.Basic +public import Mathlib.Data.Vector.Basic /-! # Bitwise operations using binary representation of integers @@ -16,6 +18,8 @@ import Mathlib.Data.Vector.Basic * arithmetic operations for `SNum`. -/ +@[expose] public section + open List (Vector) namespace PosNum diff --git a/Mathlib/Data/Num/Lemmas.lean b/Mathlib/Data/Num/Lemmas.lean index 5cb9417a743200..e01aea929de093 100644 --- a/Mathlib/Data/Num/Lemmas.lean +++ b/Mathlib/Data/Num/Lemmas.lean @@ -3,18 +3,23 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.Bitwise -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Data.Nat.PSub -import Mathlib.Data.Nat.Size -import Mathlib.Data.Num.Bitwise +module + +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.Bitwise +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Data.Nat.PSub +public import Mathlib.Data.Nat.Size +public import Mathlib.Data.Num.Bitwise +import all Init.Data.Nat.Bitwise.Basic -- for unfolding `bitwise` /-! # Properties of the binary representation of integers -/ +@[expose] public section + open Int attribute [local simp] add_assoc @@ -532,12 +537,10 @@ instance distrib : Distrib PosNum where right_distrib := by transfer; simp [mul_add, mul_comm] instance linearOrder : LinearOrder PosNum where - lt := (· < ·) lt_iff_le_not_ge := by intro a b transfer_rw apply lt_iff_le_not_ge - le := (· ≤ ·) le_refl := by transfer le_trans := by intro a b c diff --git a/Mathlib/Data/Num/Prime.lean b/Mathlib/Data/Num/Prime.lean index 7421081fe4d071..81ca14d2a70988 100644 --- a/Mathlib/Data/Num/Prime.lean +++ b/Mathlib/Data/Num/Prime.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.Num.ZNum -import Mathlib.Tactic.Ring +module + +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.Num.ZNum +public import Mathlib.Tactic.Ring /-! # Primality for binary natural numbers @@ -23,6 +25,8 @@ Nevertheless, sometimes proof by computational reflection requires natural numbe `Num` implements algorithms directly on binary natural numbers for this purpose. -/ +@[expose] public section + namespace PosNum diff --git a/Mathlib/Data/Num/ZNum.lean b/Mathlib/Data/Num/ZNum.lean index ae668a84d9a56e..667183a635f496 100644 --- a/Mathlib/Data/Num/ZNum.lean +++ b/Mathlib/Data/Num/ZNum.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Ring.Cast -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.Data.Num.Lemmas +module + +public import Mathlib.Algebra.Order.Ring.Cast +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.Data.Num.Lemmas /-! # Properties of the `ZNum` representation of integers @@ -13,6 +15,8 @@ import Mathlib.Data.Num.Lemmas This file was split from `Mathlib/Data/Num/Lemmas.lean` to keep the former under 1500 lines. -/ +@[expose] public section + open Int attribute [local simp] add_assoc @@ -383,12 +387,10 @@ scoped macro (name := transfer) "transfer" : tactic => `(tactic| (intros; transfer_rw; try simp [add_comm, add_left_comm, mul_comm, mul_left_comm])) instance linearOrder : LinearOrder ZNum where - lt := (· < ·) lt_iff_le_not_ge := by intro a b transfer_rw apply lt_iff_le_not_ge - le := (· ≤ ·) le_refl := by transfer le_trans := by intro a b c diff --git a/Mathlib/Data/Opposite.lean b/Mathlib/Data/Opposite.lean index 67dd5e083e9b7d..3b2bbad85de45f 100644 --- a/Mathlib/Data/Opposite.lean +++ b/Mathlib/Data/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Reid Barton, Simon Hudon, Kenny Lau -/ -import Mathlib.Logic.Equiv.Defs -import Mathlib.Logic.Small.Defs +module + +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Logic.Small.Defs /-! # Opposites @@ -15,6 +17,8 @@ opposite category, with all arrows reversed. -/ +@[expose] public section + universe v u @@ -37,7 +41,7 @@ attribute [pp_nodot] Opposite.unop /-- Make sure that `Opposite.op a` is pretty-printed as `op a` instead of `{ unop := a }` or `⟨a⟩`. -/ @[app_unexpander Opposite.op] -protected def Opposite.unexpander_op : Lean.PrettyPrinter.Unexpander +protected meta def Opposite.unexpander_op : Lean.PrettyPrinter.Unexpander | s => pure s @[inherit_doc] diff --git a/Mathlib/Data/Option/Basic.lean b/Mathlib/Data/Option/Basic.lean index 81c156dc9a3c1b..76ccb37413867d 100644 --- a/Mathlib/Data/Option/Basic.lean +++ b/Mathlib/Data/Option/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Control.Combinators -import Mathlib.Data.Option.Defs -import Mathlib.Logic.IsEmpty -import Mathlib.Logic.Relator -import Mathlib.Util.CompileInductive -import Aesop +module + +public import Mathlib.Control.Combinators +public import Mathlib.Data.Option.Defs +public import Mathlib.Logic.IsEmpty +public import Mathlib.Logic.Relator +public import Mathlib.Util.CompileInductive +public import Aesop /-! # Option of a type @@ -31,6 +33,8 @@ along with a term `a : α` if the value is `True`. -/ +@[expose] public section + universe u namespace Option @@ -201,7 +205,7 @@ theorem orElse_eq_none (o o' : Option α) : (o <|> o') = none ↔ o = none ∧ o section theorem choice_eq_none (α : Type*) [IsEmpty α] : choice α = none := - dif_neg (not_nonempty_iff_imp_false.mpr isEmptyElim) + choice_eq_none_iff_not_nonempty.mpr (not_nonempty_iff_imp_false.mpr isEmptyElim) end diff --git a/Mathlib/Data/Option/Defs.lean b/Mathlib/Data/Option/Defs.lean index 7f555a6a24b51d..1c8321ee21391a 100644 --- a/Mathlib/Data/Option/Defs.lean +++ b/Mathlib/Data/Option/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar -import Batteries.Tactic.Alias +module + +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar +public import Batteries.Tactic.Alias /-! # Extra definitions on `Option` @@ -15,6 +17,8 @@ files under `Mathlib/Data/Option.lean`. Other basic operations on `Option` are defined in the core library. -/ +@[expose] public section + namespace Option /-- Traverse an object of `Option α` with a function `f : α → F β` for an applicative `F`. -/ diff --git a/Mathlib/Data/Option/NAry.lean b/Mathlib/Data/Option/NAry.lean index d0042fcfd644bd..85d8d980d9ecea 100644 --- a/Mathlib/Data/Option/NAry.lean +++ b/Mathlib/Data/Option/NAry.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Batteries.Tactic.Init -import Mathlib.Logic.Function.Defs +module + +public import Batteries.Tactic.Init +public import Mathlib.Logic.Function.Defs /-! # Binary map of options @@ -25,6 +27,8 @@ We do not define `Option.map₃` as its only purpose so far would be to prove pr `Option.map₂` and casing already fulfills this task. -/ +@[expose] public section + universe u open Function diff --git a/Mathlib/Data/Ordering/Basic.lean b/Mathlib/Data/Ordering/Basic.lean index dcd1fc43362006..2c5a431b121934 100644 --- a/Mathlib/Data/Ordering/Basic.lean +++ b/Mathlib/Data/Ordering/Basic.lean @@ -3,14 +3,18 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Batteries.Tactic.Alias -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Tactic.Alias +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar /-! # Helper definitions and instances for `Ordering` -/ +@[expose] public section + universe u namespace Ordering diff --git a/Mathlib/Data/Ordering/Lemmas.lean b/Mathlib/Data/Ordering/Lemmas.lean index a5027ef17ad7cd..7c1eb95270da25 100644 --- a/Mathlib/Data/Ordering/Lemmas.lean +++ b/Mathlib/Data/Ordering/Lemmas.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Mathlib.Data.Ordering.Basic -import Mathlib.Order.Defs.Unbundled +module + +public import Mathlib.Data.Ordering.Basic +public import Mathlib.Order.Defs.Unbundled /-! # Some `Ordering` lemmas -/ +@[expose] public section + universe u namespace Ordering diff --git a/Mathlib/Data/Ordmap/Invariants.lean b/Mathlib/Data/Ordmap/Invariants.lean index 7a3094713f2334..21ad1ec48cff54 100644 --- a/Mathlib/Data/Ordmap/Invariants.lean +++ b/Mathlib/Data/Ordmap/Invariants.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Data.Nat.Dist -import Mathlib.Data.Ordmap.Ordnode -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Data.Nat.Dist +public import Mathlib.Data.Ordmap.Ordnode +public import Mathlib.Tactic.Abel /-! # Invariants for the verification of `Ordnode` @@ -44,6 +46,8 @@ Contributors are encouraged to pick this up and finish the job, if it appeals to ordered map, ordered set, data structure, verified programming -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Data/Ordmap/Ordnode.lean b/Mathlib/Data/Ordmap/Ordnode.lean index e453d33346aa9b..92d956b109bd1e 100644 --- a/Mathlib/Data/Ordmap/Ordnode.lean +++ b/Mathlib/Data/Ordmap/Ordnode.lean @@ -3,9 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Order.Compare -import Mathlib.Data.Nat.PSub -import Mathlib.Data.Option.Basic +module + +public import Mathlib.Order.Compare +public import Mathlib.Data.Nat.PSub +public import Mathlib.Data.Option.Basic +import Batteries.Data.List.Basic /-! # Ordered sets @@ -60,6 +63,8 @@ ordered map, ordered set, data structure -/ +@[expose] public section + universe u /-- An `Ordnode α` is a finite set of values, represented as a tree. diff --git a/Mathlib/Data/Ordmap/Ordset.lean b/Mathlib/Data/Ordmap/Ordset.lean index 343e70116c46b5..9b9a65fdc98f60 100644 --- a/Mathlib/Data/Ordmap/Ordset.lean +++ b/Mathlib/Data/Ordmap/Ordset.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Ordmap.Invariants +module + +public import Mathlib.Data.Ordmap.Invariants /-! # Verification of `Ordnode` @@ -32,6 +34,8 @@ because there is a decent amount of slop in the actual data structure invariants theorem will go through with multiple choices of assumption. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Data/PEquiv.lean b/Mathlib/Data/PEquiv.lean index d8830370fdd5b0..aeed59ba82ac52 100644 --- a/Mathlib/Data/PEquiv.lean +++ b/Mathlib/Data/PEquiv.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Option.Basic -import Batteries.Tactic.Congr -import Mathlib.Data.Set.Basic -import Mathlib.Tactic.Contrapose +module + +public import Mathlib.Data.Option.Basic +public import Batteries.Tactic.Congr +public import Mathlib.Data.Set.Basic +public import Mathlib.Tactic.Contrapose /-! @@ -40,6 +42,8 @@ pequiv, partial equivalence -/ +@[expose] public section + assert_not_exists RelIso universe u v w x diff --git a/Mathlib/Data/PFun.lean b/Mathlib/Data/PFun.lean index 94ff221bfc7da7..72e5fcf912b173 100644 --- a/Mathlib/Data/PFun.lean +++ b/Mathlib/Data/PFun.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon -/ -import Batteries.WF -import Batteries.Tactic.GeneralizeProofs -import Mathlib.Data.Part -import Mathlib.Data.Rel +module + +public import Batteries.WF +public import Batteries.Tactic.GeneralizeProofs +public import Mathlib.Data.Part +public import Mathlib.Data.Rel /-! # Partial functions @@ -51,6 +53,8 @@ Monad operations: * `PFun.map`: The monad `map` function, pointwise `Part.map`. -/ +@[expose] public section + open Function /-- `PFun α β`, or `α →. β`, is the type of partial functions from diff --git a/Mathlib/Data/PFunctor/Multivariate/Basic.lean b/Mathlib/Data/PFunctor/Multivariate/Basic.lean index 70a2703dfcc67b..f18d38e1e2916a 100644 --- a/Mathlib/Data/PFunctor/Multivariate/Basic.lean +++ b/Mathlib/Data/PFunctor/Multivariate/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Control.Functor.Multivariate -import Mathlib.Data.PFunctor.Univariate.Basic +module + +public import Mathlib.Control.Functor.Multivariate +public import Mathlib.Data.PFunctor.Univariate.Basic /-! # Multivariate polynomial functors. @@ -15,6 +17,8 @@ They map a type vector `α` to the type `Σ a : A, B a ⟹ α`, with `A : Type` they guarantee that occurrences of `α` are positive. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/PFunctor/Multivariate/M.lean b/Mathlib/Data/PFunctor/Multivariate/M.lean index 9acb752c8be407..fc6a14d1311cf0 100644 --- a/Mathlib/Data/PFunctor/Multivariate/M.lean +++ b/Mathlib/Data/PFunctor/Multivariate/M.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro, Simon Hudon -/ -import Mathlib.Data.PFunctor.Multivariate.Basic -import Mathlib.Data.PFunctor.Univariate.M +module + +public import Mathlib.Data.PFunctor.Multivariate.Basic +public import Mathlib.Data.PFunctor.Univariate.M /-! # The M construction as a multivariate polynomial functor. @@ -44,6 +46,8 @@ that `A` is a possibly infinite tree. [*Data Types as Quotients of Polynomial Functors*][avigad-carneiro-hudon2019] -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/PFunctor/Multivariate/W.lean b/Mathlib/Data/PFunctor/Multivariate/W.lean index f416244cdc66c8..c7576cf70b6526 100644 --- a/Mathlib/Data/PFunctor/Multivariate/W.lean +++ b/Mathlib/Data/PFunctor/Multivariate/W.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Data.PFunctor.Multivariate.Basic +module + +public import Mathlib.Data.PFunctor.Multivariate.Basic /-! # The W construction as a multivariate polynomial functor. @@ -14,7 +16,7 @@ as the least fixpoint of a polynomial functor. ## Main definitions * `W_mk` - constructor -* `W_dest - destructor +* `W_dest` - destructor * `W_rec` - recursor: basis for defining functions by structural recursion on `P.W α` * `W_rec_eq` - defining equation for `W_rec` * `W_ind` - induction principle for `P.W α` @@ -43,6 +45,8 @@ its valid paths to values of `α` [*Data Types as Quotients of Polynomial Functors*][avigad-carneiro-hudon2019] -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/PFunctor/Univariate/Basic.lean b/Mathlib/Data/PFunctor/Univariate/Basic.lean index 3a8e8234d101e1..67c4d834ceec8b 100644 --- a/Mathlib/Data/PFunctor/Univariate/Basic.lean +++ b/Mathlib/Data/PFunctor/Univariate/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Data.W.Basic +module + +public import Mathlib.Data.W.Basic /-! # Polynomial Functors @@ -12,6 +14,8 @@ This file defines polynomial functors and the W-type construction as a polynomia (For the M-type construction, see `Mathlib/Data/PFunctor/Univariate/M.lean`.) -/ +@[expose] public section + universe u v uA uB uA₁ uB₁ uA₂ uB₂ v₁ v₂ v₃ /-- A polynomial functor `P` is given by a type `A` and a family `B` of types over `A`. `P` maps diff --git a/Mathlib/Data/PFunctor/Univariate/M.lean b/Mathlib/Data/PFunctor/Univariate/M.lean index ccf4a2b0602705..fba728a99e5406 100644 --- a/Mathlib/Data/PFunctor/Univariate/M.lean +++ b/Mathlib/Data/PFunctor/Univariate/M.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Data.PFunctor.Univariate.Basic +module + +public import Mathlib.Data.PFunctor.Univariate.Basic /-! # M-types @@ -12,6 +14,8 @@ M types are potentially infinite tree-like structures. They are defined as the greatest fixpoint of a polynomial functor. -/ +@[expose] public section + universe u uA uB v w diff --git a/Mathlib/Data/PNat/Basic.lean b/Mathlib/Data/PNat/Basic.lean index 56cb93a920d210..d7d2873c5223e4 100644 --- a/Mathlib/Data/PNat/Basic.lean +++ b/Mathlib/Data/PNat/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Ralf Stephan, Neil Strickland, Ruben Van de Velde -/ -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.Order.Positive.Ring -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.PNat.Equiv +module + +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.Order.Positive.Ring +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.PNat.Equiv /-! # The positive natural numbers @@ -17,6 +19,8 @@ It is defined in `Data.PNat.Defs`, but most of the development is deferred to he that `Data.PNat.Defs` can have very few imports. -/ +@[expose] public section + deriving instance AddLeftCancelSemigroup, AddRightCancelSemigroup, AddCommSemigroup, Add, Mul, Distrib for PNat diff --git a/Mathlib/Data/PNat/Defs.lean b/Mathlib/Data/PNat/Defs.lean index 7849699af6c857..30f735f1c6556e 100644 --- a/Mathlib/Data/PNat/Defs.lean +++ b/Mathlib/Data/PNat/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Neil Strickland -/ -import Mathlib.Data.Int.Order.Basic -import Mathlib.Data.Nat.Basic -import Mathlib.Data.PNat.Notation -import Mathlib.Order.Basic -import Mathlib.Tactic.Coe -import Mathlib.Tactic.Lift +module + +public import Mathlib.Data.Int.Order.Basic +public import Mathlib.Data.Nat.Basic +public import Mathlib.Data.PNat.Notation +public import Mathlib.Order.Basic +public import Mathlib.Tactic.Coe +public import Mathlib.Tactic.Lift /-! # The positive natural numbers @@ -17,6 +19,8 @@ This file contains the definitions, and basic results. Most algebraic facts are deferred to `Data.PNat.Basic`, as they need more imports. -/ +@[expose] public section + deriving instance LinearOrder for PNat instance : One ℕ+ := diff --git a/Mathlib/Data/PNat/Equiv.lean b/Mathlib/Data/PNat/Equiv.lean index 0a31fe21546234..2cc1455b778ebc 100644 --- a/Mathlib/Data/PNat/Equiv.lean +++ b/Mathlib/Data/PNat/Equiv.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Ralf Stephan, Neil Strickland, Ruben Van de Velde -/ -import Mathlib.Data.PNat.Defs -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Data.PNat.Defs +public import Mathlib.Logic.Equiv.Defs /-! # The equivalence between `ℕ+` and `ℕ` -/ +@[expose] public section + /-- An equivalence between `ℕ+` and `ℕ` given by `PNat.natPred` and `Nat.succPNat`. -/ @[simps -fullyApplied] def _root_.Equiv.pnatEquivNat : ℕ+ ≃ ℕ where diff --git a/Mathlib/Data/PNat/Factors.lean b/Mathlib/Data/PNat/Factors.lean index 0d20f02f980c6b..cd9403603039a8 100644 --- a/Mathlib/Data/PNat/Factors.lean +++ b/Mathlib/Data/PNat/Factors.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Basic -import Mathlib.Data.PNat.Prime -import Mathlib.Data.Nat.Factors -import Mathlib.Data.Multiset.OrderedMonoid -import Mathlib.Data.Multiset.Sort +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Basic +public import Mathlib.Data.PNat.Prime +public import Mathlib.Data.Nat.Factors +public import Mathlib.Data.Multiset.OrderedMonoid +public import Mathlib.Data.Multiset.Sort /-! # Prime factors of nonzero naturals @@ -21,6 +23,8 @@ the multiplicity of `p` in this factors multiset being the p-adic valuation of ` * `FactorMultiset n`: Multiset of prime factors of `n`. -/ +@[expose] public section + /-- The type of multisets of prime numbers. Unique factorization gives an equivalence between this set and ℕ+, as we will formalize below. -/ diff --git a/Mathlib/Data/PNat/Find.lean b/Mathlib/Data/PNat/Find.lean index be017ee9184952..1b7b891681bd1c 100644 --- a/Mathlib/Data/PNat/Find.lean +++ b/Mathlib/Data/PNat/Find.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky, Floris van Doorn -/ -import Mathlib.Data.Nat.Find -import Mathlib.Data.PNat.Basic +module + +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.PNat.Basic /-! # Explicit least witnesses to existentials on positive natural numbers @@ -13,6 +15,8 @@ Implemented via calling out to `Nat.find`. -/ +@[expose] public section + namespace PNat diff --git a/Mathlib/Data/PNat/Interval.lean b/Mathlib/Data/PNat/Interval.lean index 769d2bd842c627..20332dadf58d53 100644 --- a/Mathlib/Data/PNat/Interval.lean +++ b/Mathlib/Data/PNat/Interval.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Data.PNat.Defs +module + +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Data.PNat.Defs /-! # Finite intervals of positive naturals @@ -13,6 +15,8 @@ This file proves that `ℕ+` is a `LocallyFiniteOrder` and calculates the cardin intervals as finsets and fintypes. -/ +@[expose] public section + open Finset Function PNat diff --git a/Mathlib/Data/PNat/Notation.lean b/Mathlib/Data/PNat/Notation.lean index be4a3da696f59c..430c87fddb35f6 100644 --- a/Mathlib/Data/PNat/Notation.lean +++ b/Mathlib/Data/PNat/Notation.lean @@ -3,11 +3,14 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Simon Hudon, Yury Kudryashov -/ +module -import Mathlib.Data.Nat.Notation +public import Mathlib.Data.Nat.Notation /-! # Definition and notation for positive natural numbers -/ +@[expose] public section + /-- `ℕ+` is the type of positive natural numbers. It is defined as a subtype, and the VM representation of `ℕ+` is the same as `ℕ` because the proof is not stored. -/ diff --git a/Mathlib/Data/PNat/Order.lean b/Mathlib/Data/PNat/Order.lean index 64ec9e959f521a..2ce886135294f2 100644 --- a/Mathlib/Data/PNat/Order.lean +++ b/Mathlib/Data/PNat/Order.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Javier Burroni. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Javier Burroni -/ -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Data.PNat.Basic +module + +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Data.PNat.Basic /-! # Order related instances for `ℕ+` -/ +@[expose] public section + namespace PNat open Nat diff --git a/Mathlib/Data/PNat/Prime.lean b/Mathlib/Data/PNat/Prime.lean index f03df808218d14..1de5f252c8844d 100644 --- a/Mathlib/Data/PNat/Prime.lean +++ b/Mathlib/Data/PNat/Prime.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Neil Strickland -/ -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.PNat.Basic +module + +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.PNat.Basic /-! # Primality and GCD on pnat @@ -13,6 +15,8 @@ This file extends the theory of `ℕ+` with `gcd`, `lcm` and `Prime` functions, `Nat`. -/ +@[expose] public section + namespace Nat.Primes @@ -253,12 +257,7 @@ theorem Coprime.gcd_mul (k : ℕ+) {m n : ℕ+} (h : m.Coprime n) : rw [← coprime_coe] at h; apply eq simp only [gcd_coe, mul_coe]; apply Nat.Coprime.gcd_mul k h -theorem gcd_eq_left {m n : ℕ+} : m ∣ n → m.gcd n = m := by - rw [dvd_iff] - intro h - apply eq - simp only [gcd_coe] - apply Nat.gcd_eq_left h +@[deprecated (since := "2025-11-14")] alias ⟨_, gcd_eq_left⟩ := gcd_eq_left_iff_dvd theorem Coprime.pow {m n : ℕ+} (k l : ℕ) (h : m.Coprime n) : (m ^ k : ℕ).Coprime (n ^ l) := by rw [← coprime_coe] at *; apply Nat.Coprime.pow; apply h diff --git a/Mathlib/Data/PNat/Xgcd.lean b/Mathlib/Data/PNat/Xgcd.lean index 639d3a9fb94175..c672bc73085b09 100644 --- a/Mathlib/Data/PNat/Xgcd.lean +++ b/Mathlib/Data/PNat/Xgcd.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Neil Strickland. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Neil Strickland -/ -import Mathlib.Tactic.Ring -import Mathlib.Data.PNat.Prime +module + +public import Mathlib.Tactic.Ring +public import Mathlib.Data.PNat.Prime /-! # Euclidean algorithm for ℕ @@ -31,6 +33,8 @@ the theory of continued fractions. See `Nat.Xgcd` for a very similar algorithm allowing values in `ℤ`. -/ +@[expose] public section + open Nat diff --git a/Mathlib/Data/PSigma/Order.lean b/Mathlib/Data/PSigma/Order.lean index 6ef7aea31a8ee0..3f7f1aef6b342b 100644 --- a/Mathlib/Data/PSigma/Order.lean +++ b/Mathlib/Data/PSigma/Order.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Minchao Wu -/ -import Mathlib.Data.Sigma.Lex -import Mathlib.Util.Notation3 -import Init.NotationExtra -import Mathlib.Data.Sigma.Basic -import Mathlib.Order.Lattice -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Data.Sigma.Lex +public import Mathlib.Util.Notation3 +public import Init.NotationExtra +public import Mathlib.Data.Sigma.Basic +public import Mathlib.Order.Lattice +public import Mathlib.Order.BoundedOrder.Basic /-! # Lexicographic order on a sigma type @@ -30,6 +32,8 @@ Prove that a sigma type is a `NoMaxOrder`, `NoMinOrder`, `DenselyOrdered` when i are. -/ +@[expose] public section + variable {ι : Type*} {α : ι → Type*} diff --git a/Mathlib/Data/Part.lean b/Mathlib/Data/Part.lean index ff94aece51e34c..687e158a188427 100644 --- a/Mathlib/Data/Part.lean +++ b/Mathlib/Data/Part.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon -/ -import Mathlib.Algebra.Notation.Defs -import Mathlib.Data.Set.Subsingleton -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Algebra.Notation.Defs +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Logic.Equiv.Defs /-! # Partial values of a type @@ -40,6 +42,8 @@ For `a : α`, `o : Part α`, `a ∈ o` means that `o` is defined and equal to `a `o.Dom` and `o.get _ = a`. -/ +@[expose] public section + assert_not_exists RelIso open Function diff --git a/Mathlib/Data/Pi/Interval.lean b/Mathlib/Data/Pi/Interval.lean index 4db37234636e66..1e2911c70daae3 100644 --- a/Mathlib/Data/Pi/Interval.lean +++ b/Mathlib/Data/Pi/Interval.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Interval.Finset.Basic -import Mathlib.Data.Fintype.BigOperators +module + +public import Mathlib.Order.Interval.Finset.Basic +public import Mathlib.Data.Fintype.BigOperators /-! # Intervals in a pi type @@ -13,6 +15,8 @@ This file shows that (dependent) functions to locally finite orders equipped wit order are locally finite and calculates the cardinality of their intervals. -/ +@[expose] public section + open Finset Fintype diff --git a/Mathlib/Data/Prod/Basic.lean b/Mathlib/Data/Prod/Basic.lean index e76d58c61ae970..8f72a06d6679f9 100644 --- a/Mathlib/Data/Prod/Basic.lean +++ b/Mathlib/Data/Prod/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Function.Defs -import Mathlib.Logic.Function.Iterate -import Aesop -import Mathlib.Tactic.Inhabit +module + +public import Mathlib.Logic.Function.Defs +public import Mathlib.Logic.Function.Iterate +public import Aesop +public import Mathlib.Tactic.Inhabit /-! # Extra facts about `Prod` @@ -15,6 +17,8 @@ This file proves various simple lemmas about `Prod`. It also defines better delaborators for product projections. -/ +@[expose] public section + variable {α : Type*} {β : Type*} {γ : Type*} {δ : Type*} namespace Prod @@ -299,19 +303,19 @@ open Lean PrettyPrinter Delaborator When true, then `Prod.fst x` and `Prod.snd x` pretty print as `x.1` and `x.2` rather than as `x.fst` and `x.snd`. -/ -register_option pp.numericProj.prod : Bool := { +meta register_option pp.numericProj.prod : Bool := { defValue := true descr := "enable pretty printing `Prod.fst x` as `x.1` and `Prod.snd x` as `x.2`." } /-- Tell whether pretty-printing should use numeric projection notations `.1` and `.2` for `Prod.fst` and `Prod.snd`. -/ -def getPPNumericProjProd (o : Options) : Bool := +meta def getPPNumericProjProd (o : Options) : Bool := o.get pp.numericProj.prod.name pp.numericProj.prod.defValue /-- Delaborator for `Prod.fst x` as `x.1`. -/ @[app_delab Prod.fst] -def delabProdFst : Delab := +meta def delabProdFst : Delab := whenPPOption getPPNumericProjProd <| whenPPOption getPPFieldNotation <| whenNotPPOption getPPExplicit <| @@ -321,7 +325,7 @@ def delabProdFst : Delab := /-- Delaborator for `Prod.snd x` as `x.2`. -/ @[app_delab Prod.snd] -def delabProdSnd : Delab := +meta def delabProdSnd : Delab := whenPPOption getPPNumericProjProd <| whenPPOption getPPFieldNotation <| whenNotPPOption getPPExplicit <| diff --git a/Mathlib/Data/Prod/Lex.lean b/Mathlib/Data/Prod/Lex.lean index 2c6f6d3e1e26e0..622db15b1a1cf2 100644 --- a/Mathlib/Data/Prod/Lex.lean +++ b/Mathlib/Data/Prod/Lex.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Minchao Wu -/ -import Mathlib.Data.Prod.Basic -import Mathlib.Order.Lattice -import Mathlib.Order.BoundedOrder.Basic -import Mathlib.Tactic.Tauto +module + +public import Mathlib.Data.Prod.Basic +public import Mathlib.Order.Lattice +public import Mathlib.Order.BoundedOrder.Basic +public import Mathlib.Tactic.Tauto /-! # Lexicographic order @@ -31,6 +33,8 @@ Related files are: * `Data.Sigma.Order`: Lexicographic order on `Σ i, α i`. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/Prod/PProd.lean b/Mathlib/Data/Prod/PProd.lean index b5a93641550352..8fc7f66254abde 100644 --- a/Mathlib/Data/Prod/PProd.lean +++ b/Mathlib/Data/Prod/PProd.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Batteries.Logic -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Logic +public import Mathlib.Tactic.TypeStar /-! # Extra facts about `PProd` -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Prod/TProd.lean b/Mathlib/Data/Prod/TProd.lean index dd6710614c64ac..63a3935cfa2725 100644 --- a/Mathlib/Data/Prod/TProd.lean +++ b/Mathlib/Data/Prod/TProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Data.List.Nodup -import Mathlib.Data.Set.Prod +module + +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.Set.Prod /-! # Finite products of types @@ -34,6 +36,8 @@ construction/theorem that is easier to define/prove on binary products than on f * The product of sets is `Set.tprod : (∀ i, Set (α i)) → Set (TProd α l)`. -/ +@[expose] public section + open List Function universe u v diff --git a/Mathlib/Data/QPF/Multivariate/Basic.lean b/Mathlib/Data/QPF/Multivariate/Basic.lean index 5fb34835e31441..910540e98537b2 100644 --- a/Mathlib/Data/QPF/Multivariate/Basic.lean +++ b/Mathlib/Data/QPF/Multivariate/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Data.PFunctor.Multivariate.Basic +module + +public import Mathlib.Data.PFunctor.Multivariate.Basic /-! # Multivariate quotients of polynomial functors. @@ -69,6 +71,8 @@ matched because they preserve the properties of QPF. The latter example, each proves that some operations on functors preserves the QPF structure -/ +@[expose] public section + set_option linter.style.longLine false in /-! ## Reference diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean index 736ae52e6189d8..c59d1ae3abebaa 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Control.Functor.Multivariate -import Mathlib.Data.PFunctor.Multivariate.Basic -import Mathlib.Data.PFunctor.Multivariate.M -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Control.Functor.Multivariate +public import Mathlib.Data.PFunctor.Multivariate.Basic +public import Mathlib.Data.PFunctor.Multivariate.M +public import Mathlib.Data.QPF.Multivariate.Basic /-! # The final co-algebra of a multivariate qpf is again a qpf. @@ -38,6 +40,8 @@ We define the relation `Mcongr` and take its quotient as the definition of `Cofi [*Data Types as Quotients of Polynomial Functors*][avigad-carneiro-hudon2019] -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean index 9b031b70c5d991..94e05c04a5c13e 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Data.PFunctor.Multivariate.Basic -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Data.PFunctor.Multivariate.Basic +public import Mathlib.Data.QPF.Multivariate.Basic /-! # The composition of QPFs is itself a QPF @@ -13,6 +15,8 @@ We define composition between one `n`-ary functor and `n` `m`-ary functors and show that it preserves the QPF structure -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Const.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Const.lean index 35705012f978f6..aa363ae1affc06 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Const.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Const.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Functor.Multivariate -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Control.Functor.Multivariate +public import Mathlib.Data.QPF.Multivariate.Basic /-! # Constant functors are QPFs @@ -16,6 +18,8 @@ that are not actually functorial. For instance `Const n Nat` makes specification. -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean index 6b99bc5fc449ee..e1cc1ac034406d 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Data.PFunctor.Multivariate.W -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Data.PFunctor.Multivariate.W +public import Mathlib.Data.QPF.Multivariate.Basic /-! # The initial algebra of a multivariate qpf is again a qpf. @@ -37,6 +39,8 @@ See [avigad-carneiro-hudon2019] for more details. [*Data Types as Quotients of Polynomial Functors*][avigad-carneiro-hudon2019] -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Prj.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Prj.lean index cd4157b140d29f..5a6178fae9ac89 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Prj.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Prj.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Functor.Multivariate -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Control.Functor.Multivariate +public import Mathlib.Data.QPF.Multivariate.Basic /-! Projection functors are QPFs. The `n`-ary projection functors on `i` is an `n`-ary functor `F` such that `F (α₀..αᵢ₋₁, αᵢ, αᵢ₊₁..αₙ₋₁) = αᵢ` -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean index eb57ad0cd8a904..3a63aa05ba70c5 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Simon Hudon -/ -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Data.QPF.Multivariate.Basic /-! # The quotient of QPF is itself a QPF @@ -13,6 +15,8 @@ its right inverse. They are very similar to the `abs` and `repr` functions found in the definition of `MvQPF` -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean index 3e1a619ccae078..b86c4b7e92e294 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Data.PFunctor.Multivariate.Basic -import Mathlib.Data.QPF.Multivariate.Basic +module + +public import Mathlib.Data.PFunctor.Multivariate.Basic +public import Mathlib.Data.QPF.Multivariate.Basic /-! # Dependent product and sum of QPFs are QPFs -/ +@[expose] public section + universe u diff --git a/Mathlib/Data/QPF/Univariate/Basic.lean b/Mathlib/Data/QPF/Univariate/Basic.lean index 7e57edbcc1c9c6..aace5df0227b57 100644 --- a/Mathlib/Data/QPF/Univariate/Basic.lean +++ b/Mathlib/Data/QPF/Univariate/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Data.PFunctor.Univariate.M +module + +public import Mathlib.Data.PFunctor.Univariate.M /-! @@ -37,6 +39,8 @@ The present theory focuses on the univariate case for qpfs -/ +@[expose] public section + universe u u' v diff --git a/Mathlib/Data/Quot.lean b/Mathlib/Data/Quot.lean index 97d6adff91aab7..6dee7b9f59c343 100644 --- a/Mathlib/Data/Quot.lean +++ b/Mathlib/Data/Quot.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Relation -import Mathlib.Logic.Unique -import Mathlib.Util.Notation3 +module + +public import Mathlib.Logic.Relation +public import Mathlib.Logic.Unique +public import Mathlib.Util.Notation3 /-! # Quotient types @@ -17,6 +19,8 @@ This module extends the core library's treatment of quotient types (`Init.Core`) quotient -/ +@[expose] public section + variable {α : Sort*} {β : Sort*} namespace Setoid diff --git a/Mathlib/Data/Rat/BigOperators.lean b/Mathlib/Data/Rat/BigOperators.lean index 81e5b4f7129bf7..afd57a43d44f83 100644 --- a/Mathlib/Data/Rat/BigOperators.lean +++ b/Mathlib/Data/Rat/BigOperators.lean @@ -3,12 +3,16 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Rat.Cast.CharZero -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +module + +public import Mathlib.Data.Rat.Cast.CharZero +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! # Casting lemmas for rational numbers involving sums and products -/ +@[expose] public section + variable {ι α : Type*} namespace Rat diff --git a/Mathlib/Data/Rat/Cardinal.lean b/Mathlib/Data/Rat/Cardinal.lean index b31cb4038ca5a5..901b0d78d41727 100644 --- a/Mathlib/Data/Rat/Cardinal.lean +++ b/Mathlib/Data/Rat/Cardinal.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Floris Van Doorn -/ -import Mathlib.Algebra.CharZero.Infinite -import Mathlib.Algebra.Ring.Rat -import Mathlib.Data.Rat.Encodable -import Mathlib.SetTheory.Cardinal.Basic +module + +public import Mathlib.Algebra.CharZero.Infinite +public import Mathlib.Algebra.Ring.Rat +public import Mathlib.Data.Rat.Encodable +public import Mathlib.SetTheory.Cardinal.Basic /-! # Cardinality of ℚ @@ -14,6 +16,8 @@ import Mathlib.SetTheory.Cardinal.Basic This file proves that the Cardinality of ℚ is ℵ₀ -/ +@[expose] public section + assert_not_exists Module Field open Cardinal diff --git a/Mathlib/Data/Rat/Cast/CharZero.lean b/Mathlib/Data/Rat/Cast/CharZero.lean index 38d1b329f910f9..9856c1ad792fc5 100644 --- a/Mathlib/Data/Rat/Cast/CharZero.lean +++ b/Mathlib/Data/Rat/Cast/CharZero.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Data.Rat.Cast.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Data.Rat.Cast.Defs /-! # Casts of rational numbers into characteristic zero fields (or division rings). -/ +@[expose] public section + open Function variable {F ι α β : Type*} diff --git a/Mathlib/Data/Rat/Cast/Defs.lean b/Mathlib/Data/Rat/Cast/Defs.lean index 910ef102aaa921..a7d30f76b99d40 100644 --- a/Mathlib/Data/Rat/Cast/Defs.lean +++ b/Mathlib/Data/Rat/Cast/Defs.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Field.Rat -import Mathlib.Algebra.Group.Commute.Basic -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.Data.Rat.Lemmas -import Mathlib.Order.Nat +module + +public import Mathlib.Algebra.Field.Basic +public import Mathlib.Algebra.Field.Rat +public import Mathlib.Algebra.Group.Commute.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.Data.Rat.Lemmas +public import Mathlib.Order.Nat /-! # Casts for Rational Numbers @@ -24,6 +26,8 @@ casting lemmas showing the well-behavedness of this injection. rat, rationals, field, ℚ, numerator, denominator, num, denom, cast, coercion, casting -/ +@[expose] public section + assert_not_exists MulAction IsOrderedMonoid variable {F ι α β : Type*} diff --git a/Mathlib/Data/Rat/Cast/Lemmas.lean b/Mathlib/Data/Rat/Cast/Lemmas.lean index 05e2b0f9931947..29485d34c9752c 100644 --- a/Mathlib/Data/Rat/Cast/Lemmas.lean +++ b/Mathlib/Data/Rat/Cast/Lemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Order.Nonneg.Field -import Mathlib.Data.Rat.Cast.Defs -import Mathlib.Tactic.Positivity.Basic +module + +public import Mathlib.Algebra.Order.Nonneg.Field +public import Mathlib.Data.Rat.Cast.Defs +public import Mathlib.Tactic.Positivity.Basic /-! # Some exiled lemmas about casting @@ -17,6 +19,8 @@ In fact, these lemmas don't appear to be used anywhere in Mathlib, so perhaps this file can simply be deleted. -/ +@[expose] public section + namespace Rat variable {α : Type*} [DivisionRing α] diff --git a/Mathlib/Data/Rat/Cast/OfScientific.lean b/Mathlib/Data/Rat/Cast/OfScientific.lean index 3a56082252f0ae..5fed7d8bbc9081 100644 --- a/Mathlib/Data/Rat/Cast/OfScientific.lean +++ b/Mathlib/Data/Rat/Cast/OfScientific.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Rat.Cast.CharZero -import Mathlib.Data.Rat.Cast.Lemmas +module + +public import Mathlib.Data.Rat.Cast.CharZero +public import Mathlib.Data.Rat.Cast.Lemmas /-! The `OfScientific` instance for any characteristic zero field @@ -14,6 +16,8 @@ It's probably possible, by adjusting the `OfScientific` instances, to make this more general, but it's not needed at present. -/ +@[expose] public section + open Lean.Grind in instance {K : Type*} [_root_.Field K] [CharZero K] : LawfulOfScientific K where ofScientific_def {m s e} := by diff --git a/Mathlib/Data/Rat/Cast/Order.lean b/Mathlib/Data/Rat/Cast/Order.lean index 05a707e0487bb1..76212c9c0f2df6 100644 --- a/Mathlib/Data/Rat/Cast/Order.lean +++ b/Mathlib/Data/Rat/Cast/Order.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Order.Field.Rat -import Mathlib.Data.Rat.Cast.CharZero -import Mathlib.Tactic.Positivity.Core +module + +public import Mathlib.Algebra.Order.Field.Rat +public import Mathlib.Data.Rat.Cast.CharZero +public import Mathlib.Tactic.Positivity.Core /-! # Casts of rational numbers into linear ordered fields. -/ +@[expose] public section + variable {F ι α β : Type*} namespace Rat @@ -256,7 +260,7 @@ open Lean Meta Qq Function /-- Extension for Rat.cast. -/ @[positivity Rat.cast _] -def evalRatCast : PositivityExt where eval {u α} _zα _pα e := do +meta def evalRatCast : PositivityExt where eval {u α} _zα _pα e := do let ~q(@Rat.cast _ (_) ($a : ℚ)) := e | throwError "not Rat.cast" match ← core q(inferInstance) q(inferInstance) a with | .positive pa => @@ -280,7 +284,7 @@ def evalRatCast : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for NNRat.cast. -/ @[positivity NNRat.cast _] -def evalNNRatCast : PositivityExt where eval {u α} _zα _pα e := do +meta def evalNNRatCast : PositivityExt where eval {u α} _zα _pα e := do let ~q(@NNRat.cast _ (_) ($a : ℚ≥0)) := e | throwError "not NNRat.cast" match ← core q(inferInstance) q(inferInstance) a with | .positive pa => diff --git a/Mathlib/Data/Rat/Defs.lean b/Mathlib/Data/Rat/Defs.lean index b09410833adc75..2e42375d13eab1 100644 --- a/Mathlib/Data/Rat/Defs.lean +++ b/Mathlib/Data/Rat/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Group.Defs -import Mathlib.Data.Rat.Init -import Mathlib.Order.Basic -import Mathlib.Tactic.Common -import Mathlib.Data.Nat.Basic +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Data.Nat.Basic +public import Mathlib.Data.Rat.Init +public import Mathlib.Order.Basic +public import Mathlib.Tactic.Common /-! # Basics for the Rational Numbers @@ -28,6 +30,8 @@ once the `Field` class has been defined. -/ +@[expose] public section + -- TODO: If `Inv` was defined earlier than `Algebra.Group.Defs`, we could have -- assert_not_exists Monoid assert_not_exists MonoidWithZero Lattice PNat Nat.gcd_greatest diff --git a/Mathlib/Data/Rat/Denumerable.lean b/Mathlib/Data/Rat/Denumerable.lean index fb99bd80001294..32b8c157ce2093 100644 --- a/Mathlib/Data/Rat/Denumerable.lean +++ b/Mathlib/Data/Rat/Denumerable.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Ring.Rat -import Mathlib.Data.Rat.Encodable -import Mathlib.Algebra.CharZero.Infinite -import Mathlib.Logic.Denumerable +module + +public import Mathlib.Algebra.Ring.Rat +public import Mathlib.Data.Rat.Encodable +public import Mathlib.Algebra.CharZero.Infinite +public import Mathlib.Logic.Denumerable /-! # Denumerability of ℚ @@ -16,6 +18,8 @@ This file proves that ℚ is denumerable. The fact that ℚ has cardinality ℵ₀ is proved in `Mathlib/Data/Rat/Cardinal.lean` -/ +@[expose] public section + assert_not_exists Module Field namespace Rat diff --git a/Mathlib/Data/Rat/Encodable.lean b/Mathlib/Data/Rat/Encodable.lean index de610fbb6c0e37..f576ebd8ddda96 100644 --- a/Mathlib/Data/Rat/Encodable.lean +++ b/Mathlib/Data/Rat/Encodable.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Logic.Encodable.Basic -import Mathlib.Data.Rat.Init +module + +public import Mathlib.Logic.Encodable.Basic +public import Mathlib.Data.Rat.Init /-! # The rationals are `Encodable`. @@ -13,6 +15,8 @@ As a consequence we also get the instance `Countable ℚ`. This is kept separate from `Data.Rat.Defs` in order to minimize imports. -/ +@[expose] public section + namespace Rat diff --git a/Mathlib/Data/Rat/Floor.lean b/Mathlib/Data/Rat/Floor.lean index 641e7089b5d55b..6272f4e224a827 100644 --- a/Mathlib/Data/Rat/Floor.lean +++ b/Mathlib/Data/Rat/Floor.lean @@ -3,10 +3,14 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Kappelmann -/ -import Mathlib.Algebra.Order.Round -import Mathlib.Data.Rat.Cast.Order -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Order.Round +public import Mathlib.Data.Rat.Cast.Order +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Ring +meta import Mathlib.Algebra.Order.Floor.Defs +meta import Mathlib.Algebra.Order.Round /-! # Floor Function for Rational Numbers @@ -21,6 +25,8 @@ division and modulo arithmetic are derived as well as some simple inequalities. rat, rationals, ℚ, floor -/ +@[expose] public section + assert_not_exists Finset open Int @@ -140,7 +146,7 @@ theorem isInt_intFloor_ofIsRat_neg (r : α) (n : ℕ) (d : ℕ) : /-- `norm_num` extension for `Int.floor` -/ @[norm_num ⌊_⌋] -def evalIntFloor : NormNumExt where eval {u αZ} e := do +meta def evalIntFloor : NormNumExt where eval {u αZ} e := do match u, αZ, e with | 0, ~q(ℤ), ~q(@Int.floor $α $instR $instO $instF $x) => match ← derive x with @@ -158,14 +164,14 @@ def evalIntFloor : NormNumExt where eval {u αZ} e := do let _i ← synthInstanceQ q(Field $α) let _i ← synthInstanceQ q(IsStrictOrderedRing $α) assertInstancesCommute - have z : Q(ℕ) := Lean.mkRawNatLit ⌊q⌋₊ + have z : Q(ℕ) := Lean.mkRawNatLit q.floor.toNat letI : $z =Q $n / $d := ⟨⟩ return .isNat q(inferInstance) z q(isNat_intFloor_ofIsNNRat $x $n $d $h) | .isNegNNRat _ q n d h => do let _i ← synthInstanceQ q(Field $α) let _i ← synthInstanceQ q(IsStrictOrderedRing $α) assertInstancesCommute - have z : Q(ℕ) := Lean.mkRawNatLit (-⌊q⌋).toNat + have z : Q(ℕ) := Lean.mkRawNatLit (-q.floor).toNat letI : $z =Q (-(-$n / $d) : ℤ).toNat := ⟨⟩ return .isNegNat q(inferInstance) z q(isInt_intFloor_ofIsRat_neg $x $n $d $h) | _, _, _ => failure @@ -199,7 +205,7 @@ theorem isInt_intCeil_ofIsRat_neg (r : α) (n : ℕ) (d : ℕ) : /-- `norm_num` extension for `Int.ceil` -/ @[norm_num ⌈_⌉] -def evalIntCeil : NormNumExt where eval {u αZ} e := do +meta def evalIntCeil : NormNumExt where eval {u αZ} e := do match u, αZ, e with | 0, ~q(ℤ), ~q(@Int.ceil $α $instR $instO $instF $x) => match ← derive x with @@ -217,14 +223,14 @@ def evalIntCeil : NormNumExt where eval {u αZ} e := do let _i ← synthInstanceQ q(Field $α) let _i ← synthInstanceQ q(IsStrictOrderedRing $α) assertInstancesCommute - have z : Q(ℕ) := Lean.mkRawNatLit ⌈q⌉₊ + have z : Q(ℕ) := Lean.mkRawNatLit q.ceil.toNat letI : $z =Q (-(-$n / $d) : ℤ).toNat := ⟨⟩ return .isNat q(inferInstance) z q(isNat_intCeil_ofIsNNRat $x $n $d $h) | .isNegNNRat _ q n d h => do let _i ← synthInstanceQ q(Field $α) let _i ← synthInstanceQ q(IsStrictOrderedRing $α) assertInstancesCommute - have z : Q(ℕ) := Lean.mkRawNatLit (-⌈q⌉).toNat + have z : Q(ℕ) := Lean.mkRawNatLit (-q.ceil).toNat letI : $z =Q $n / $d := ⟨⟩ return .isNegNat q(inferInstance) z q(isInt_intCeil_ofIsRat_neg $x $n $d $h) | _, _, _ => failure @@ -250,7 +256,7 @@ theorem isRat_intFract_of_isRat_negOfNat (r : α) (n d : ℕ) : /-- `norm_num` extension for `Int.fract` -/ @[norm_num (Int.fract _)] -def evalIntFract : NormNumExt where eval {u α} e := do +meta def evalIntFract : NormNumExt where eval {u α} e := do match e with | ~q(@Int.fract _ $instR $instO $instF $x) => match ← derive x with @@ -273,14 +279,14 @@ def evalIntFract : NormNumExt where eval {u α} e := do assertInstancesCommute have n' : Q(ℕ) := Lean.mkRawNatLit (q.num.natAbs % q.den) letI : $n' =Q $n % $d := ⟨⟩ - return .isNNRat _ (Int.fract q) n' d q(isNNRat_intFract_of_isNNRat _ $n $d $h) + return .isNNRat _ (q - Rat.floor q) n' d q(isNNRat_intFract_of_isNNRat _ $n $d $h) | .isNegNNRat _ q n d h => do let _i ← synthInstanceQ q(Field $α) let _i ← synthInstanceQ q(IsStrictOrderedRing $α) assertInstancesCommute have n' : Q(ℤ) := mkRawIntLit (q.num % q.den) letI : $n' =Q -$n % $d := ⟨⟩ - return .isRat _ (Int.fract q) n' d q(isRat_intFract_of_isRat_negOfNat _ $n $d $h) + return .isRat _ (q - Rat.floor q) n' d q(isRat_intFract_of_isRat_negOfNat _ $n $d $h) | _, _, _ => failure /-! @@ -304,9 +310,13 @@ theorem IsRat.isInt_round {R : Type*} [Field R] [LinearOrder R] [IsStrictOrdered rw [invOf_eq_inv, ← div_eq_mul_inv] norm_cast +/-- local copy tagged `meta` for evaluation of `round` below -/ +meta local instance : FloorRing ℚ := + (FloorRing.ofFloor ℚ Rat.floor) fun _ _ => Rat.le_floor_iff.symm + /-- `norm_num` extension for `round` -/ @[norm_num round _] -def evalRound : NormNumExt where eval {u αZ} e := do +meta def evalRound : NormNumExt where eval {u αZ} e := do match u, αZ, e with | 0, ~q(ℤ), ~q(@round $α $instRing $instLinearOrder $instFloorRing $x) => match ← derive x with diff --git a/Mathlib/Data/Rat/Init.lean b/Mathlib/Data/Rat/Init.lean index 4ac6014d1e04fe..3f6f68d4038e3a 100644 --- a/Mathlib/Data/Rat/Init.lean +++ b/Mathlib/Data/Rat/Init.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Yaël Dillies -/ -import Mathlib.Data.Nat.Notation -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar -import Batteries.Classes.RatCast +module + +public import Mathlib.Data.Nat.Notation +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.TypeStar +public import Batteries.Classes.RatCast /-! # Basic definitions around the rational numbers @@ -16,6 +18,8 @@ This file declares `ℚ` notation for the rationals and defines the nonnegative This file is eligible to upstreaming to Batteries. -/ +@[expose] public section + @[inherit_doc] notation "ℚ" => Rat /-- Nonnegative rational numbers. -/ diff --git a/Mathlib/Data/Rat/Lemmas.lean b/Mathlib/Data/Rat/Lemmas.lean index 616ecb4c448198..2fd157c861fe09 100644 --- a/Mathlib/Data/Rat/Lemmas.lean +++ b/Mathlib/Data/Rat/Lemmas.lean @@ -3,16 +3,20 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.Ring.Rat -import Mathlib.Algebra.Ring.Int.Parity -import Mathlib.Data.PNat.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.Ring.Rat +public import Mathlib.Algebra.Ring.Int.Parity +public import Mathlib.Data.PNat.Defs /-! # Further lemmas for the Rational Numbers -/ +@[expose] public section + namespace Rat diff --git a/Mathlib/Data/Rat/NatSqrt/Defs.lean b/Mathlib/Data/Rat/NatSqrt/Defs.lean index bdc35c95159dca..a51893da0be1fc 100644 --- a/Mathlib/Data/Rat/NatSqrt/Defs.lean +++ b/Mathlib/Data/Rat/NatSqrt/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Tactic.Positivity -import Mathlib.Algebra.Order.Field.Basic +module + +public import Mathlib.Tactic.Positivity +public import Mathlib.Algebra.Order.Field.Basic /-! Rational approximation of the square root of a natural number. @@ -12,6 +14,8 @@ Rational approximation of the square root of a natural number. See also `Mathlib.Data.Rat.NatSqrt.Real` for comparisons with the real square root. -/ +@[expose] public section + namespace Nat /-- diff --git a/Mathlib/Data/Rat/NatSqrt/Real.lean b/Mathlib/Data/Rat/NatSqrt/Real.lean index 00fa9ea20c9365..1aaf2bc7492d94 100644 --- a/Mathlib/Data/Rat/NatSqrt/Real.lean +++ b/Mathlib/Data/Rat/NatSqrt/Real.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Rat.NatSqrt.Defs -import Mathlib.Data.Real.Sqrt +module + +public import Mathlib.Data.Rat.NatSqrt.Defs +public import Mathlib.Data.Real.Sqrt /-! Comparisons between rational approximations to the square root of a natural number and the real square root. -/ +@[expose] public section + namespace Nat theorem ratSqrt_le_realSqrt (x : ℕ) {prec : ℕ} (h : 0 < prec) : ratSqrt x prec ≤ √x := by diff --git a/Mathlib/Data/Rat/Sqrt.lean b/Mathlib/Data/Rat/Sqrt.lean index 4a1bdf302268a8..35ec895d959a94 100644 --- a/Mathlib/Data/Rat/Sqrt.lean +++ b/Mathlib/Data/Rat/Sqrt.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Algebra.Order.Ring.Unbundled.Rat -import Mathlib.Data.Rat.Lemmas -import Mathlib.Data.Int.Sqrt +module + +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Algebra.Order.Ring.Unbundled.Rat +public import Mathlib.Data.Rat.Lemmas +public import Mathlib.Data.Int.Sqrt /-! # Square root on rational numbers @@ -16,6 +18,8 @@ and proves several theorems about it. -/ +@[expose] public section + namespace Rat diff --git a/Mathlib/Data/Rat/Star.lean b/Mathlib/Data/Rat/Star.lean index a4762d8ced664e..35b65f78f3e5bc 100644 --- a/Mathlib/Data/Rat/Star.lean +++ b/Mathlib/Data/Rat/Star.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux, Yaël Dillies -/ -import Mathlib.Algebra.GroupWithZero.Commute -import Mathlib.Algebra.Order.Monoid.Submonoid -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Data.NNRat.Order -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.GroupWithZero.Commute +public import Mathlib.Algebra.Order.Monoid.Submonoid +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Data.NNRat.Order +public import Mathlib.Tactic.FieldSimp /-! # Star ordered ring structures on `ℚ` and `ℚ≥0` @@ -17,6 +19,8 @@ This file shows that `ℚ` and `ℚ≥0` are `StarOrderedRing`s. In particular, nonnegative rational number is a sum of squares. -/ +@[expose] public section + open AddSubmonoid Set open scoped NNRat diff --git a/Mathlib/Data/Real/Archimedean.lean b/Mathlib/Data/Real/Archimedean.lean index 0700194b8cc72e..6c435a7bbd67a0 100644 --- a/Mathlib/Data/Real/Archimedean.lean +++ b/Mathlib/Data/Real/Archimedean.lean @@ -3,17 +3,21 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Algebra.Order.Group.Pointwise.Bounds -import Mathlib.Data.Real.Basic -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Order.Interval.Set.Disjoint +module + +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Algebra.Order.Group.Pointwise.Bounds +public import Mathlib.Data.Real.Basic +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Order.Interval.Set.Disjoint /-! # The real numbers are an Archimedean floor ring, and a conditionally complete linear order. -/ +@[expose] public section + assert_not_exists Finset open Pointwise CauSeq diff --git a/Mathlib/Data/Real/Basic.lean b/Mathlib/Data/Real/Basic.lean index a402bf9c017ff6..a968fa4a4b3d93 100644 --- a/Mathlib/Data/Real/Basic.lean +++ b/Mathlib/Data/Real/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Order.CauSeq.Completion -import Mathlib.Algebra.Order.Ring.Rat -import Mathlib.Data.Rat.Cast.Defs +module + +public import Mathlib.Algebra.Order.CauSeq.Completion +public import Mathlib.Algebra.Order.Ring.Rat +public import Mathlib.Data.Rat.Cast.Defs /-! # Real numbers from Cauchy sequences @@ -23,6 +25,8 @@ The fact that the real numbers are a (trivial) *-ring has similarly been deferre `Mathlib/Data/Real/Star.lean`. -/ +@[expose] public section + assert_not_exists Finset Module Submonoid FloorRing @@ -297,8 +301,6 @@ protected theorem ind_mk {C : Real → Prop} (x : Real) (h : ∀ y, C (mk y)) : exact h _ instance partialOrder : PartialOrder ℝ where - le := (· ≤ ·) - lt := (· < ·) lt_iff_le_not_ge a b := by induction a using Real.ind_mk induction b using Real.ind_mk @@ -393,57 +395,55 @@ theorem ofCauchy_inf (a b) : (⟨⟦a ⊓ b⟧⟩ : ℝ) = ⟨⟦a⟧⟩ ⊓ ⟨ theorem mk_inf (a b) : (mk (a ⊓ b) : ℝ) = mk a ⊓ mk b := ofCauchy_inf _ _ -instance : DistribLattice ℝ := - { Real.partialOrder with - sup := (· ⊔ ·) - le := (· ≤ ·) - le_sup_left := by - intro a b - induction a using Real.ind_mk - induction b using Real.ind_mk - dsimp only; rw [← mk_sup, mk_le] - exact CauSeq.le_sup_left - le_sup_right := by - intro a b - induction a using Real.ind_mk - induction b using Real.ind_mk - dsimp only; rw [← mk_sup, mk_le] - exact CauSeq.le_sup_right - sup_le := by - intro a b c - induction a using Real.ind_mk - induction b using Real.ind_mk - induction c using Real.ind_mk - simp_rw [← mk_sup, mk_le] - exact CauSeq.sup_le - inf := (· ⊓ ·) - inf_le_left := by - intro a b - induction a using Real.ind_mk - induction b using Real.ind_mk - dsimp only; rw [← mk_inf, mk_le] - exact CauSeq.inf_le_left - inf_le_right := by - intro a b - induction a using Real.ind_mk - induction b using Real.ind_mk - dsimp only; rw [← mk_inf, mk_le] - exact CauSeq.inf_le_right - le_inf := by - intro a b c - induction a using Real.ind_mk - induction b using Real.ind_mk - induction c using Real.ind_mk - simp_rw [← mk_inf, mk_le] - exact CauSeq.le_inf - le_sup_inf := by - intro a b c - induction a using Real.ind_mk - induction b using Real.ind_mk - induction c using Real.ind_mk - apply Eq.le - simp only [← mk_sup, ← mk_inf] - exact congr_arg mk (CauSeq.sup_inf_distrib_left ..).symm } +instance : DistribLattice ℝ where + sup := (· ⊔ ·) + le_sup_left := by + intro a b + induction a using Real.ind_mk + induction b using Real.ind_mk + dsimp only; rw [← mk_sup, mk_le] + exact CauSeq.le_sup_left + le_sup_right := by + intro a b + induction a using Real.ind_mk + induction b using Real.ind_mk + dsimp only; rw [← mk_sup, mk_le] + exact CauSeq.le_sup_right + sup_le := by + intro a b c + induction a using Real.ind_mk + induction b using Real.ind_mk + induction c using Real.ind_mk + simp_rw [← mk_sup, mk_le] + exact CauSeq.sup_le + inf := (· ⊓ ·) + inf_le_left := by + intro a b + induction a using Real.ind_mk + induction b using Real.ind_mk + dsimp only; rw [← mk_inf, mk_le] + exact CauSeq.inf_le_left + inf_le_right := by + intro a b + induction a using Real.ind_mk + induction b using Real.ind_mk + dsimp only; rw [← mk_inf, mk_le] + exact CauSeq.inf_le_right + le_inf := by + intro a b c + induction a using Real.ind_mk + induction b using Real.ind_mk + induction c using Real.ind_mk + simp_rw [← mk_inf, mk_le] + exact CauSeq.le_inf + le_sup_inf := by + intro a b c + induction a using Real.ind_mk + induction b using Real.ind_mk + induction c using Real.ind_mk + apply Eq.le + simp only [← mk_sup, ← mk_inf] + exact congr_arg mk (CauSeq.sup_inf_distrib_left ..).symm -- Extra instances to short-circuit type class resolution instance lattice : Lattice ℝ := diff --git a/Mathlib/Data/Real/Cardinality.lean b/Mathlib/Data/Real/Cardinality.lean index b041e70d975354..aacd5665cf0dea 100644 --- a/Mathlib/Data/Real/Cardinality.lean +++ b/Mathlib/Data/Real/Cardinality.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Real.Cardinality +module + +public import Mathlib.Analysis.Real.Cardinality deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Real/CompleteField.lean b/Mathlib/Data/Real/CompleteField.lean index d41f47b9d169ef..38b2b8444cffbc 100644 --- a/Mathlib/Data/Real/CompleteField.lean +++ b/Mathlib/Data/Real/CompleteField.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best -/ -import Mathlib.Algebra.Order.CompleteField -import Mathlib.Data.Real.Sqrt +module + +public import Mathlib.Algebra.Order.CompleteField +public import Mathlib.Data.Real.Sqrt /-! # The reals are a conditionally complete linearly ordered field -/ +@[expose] public section + /-- The reals are a conditionally complete linearly ordered field. -/ noncomputable instance : ConditionallyCompleteLinearOrderedField ℝ := { } diff --git a/Mathlib/Data/Real/ConjExponents.lean b/Mathlib/Data/Real/ConjExponents.lean index d7c08c897aa977..5450b7833c2e5d 100644 --- a/Mathlib/Data/Real/ConjExponents.lean +++ b/Mathlib/Data/Real/ConjExponents.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Data.ENNReal.Holder -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Data.ENNReal.Holder +public import Mathlib.Tactic.LinearCombination /-! # Real conjugate exponents @@ -33,6 +35,8 @@ to take the values `0` and `∞`. * Eradicate the `1 / p` spelling in lemmas. -/ +@[expose] public section + noncomputable section open scoped ENNReal NNReal diff --git a/Mathlib/Data/Real/ENatENNReal.lean b/Mathlib/Data/Real/ENatENNReal.lean index 77fef685a49a7f..dbb4deea753600 100644 --- a/Mathlib/Data/Real/ENatENNReal.lean +++ b/Mathlib/Data/Real/ENatENNReal.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.ENat.Basic -import Mathlib.Data.ENNReal.Basic +module + +public import Mathlib.Data.ENat.Basic +public import Mathlib.Data.ENNReal.Basic /-! # Coercion from `ℕ∞` to `ℝ≥0∞` @@ -12,6 +14,8 @@ import Mathlib.Data.ENNReal.Basic In this file we define a coercion from `ℕ∞` to `ℝ≥0∞` and prove some basic lemmas about this map. -/ +@[expose] public section + assert_not_exists Finset open NNReal ENNReal diff --git a/Mathlib/Data/Real/EReal.lean b/Mathlib/Data/Real/EReal.lean index bfe3421ecdb4bd..97197a82f4708a 100644 --- a/Mathlib/Data/Real/EReal.lean +++ b/Mathlib/Data/Real/EReal.lean @@ -3,6 +3,8 @@ Copyright (c) 2019 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.Data.EReal.Basic +module + +public import Mathlib.Data.EReal.Basic deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Data/Real/Embedding.lean b/Mathlib/Data/Real/Embedding.lean index f13f9018efb6d9..1defaa344f8869 100644 --- a/Mathlib/Data/Real/Embedding.lean +++ b/Mathlib/Data/Real/Embedding.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.Order.Group.Pointwise.CompleteLattice -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Data.Real.Archimedean +module + +public import Mathlib.Algebra.Order.Group.Pointwise.CompleteLattice +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.Data.Real.Archimedean /-! # Embedding of archimedean groups into reals @@ -20,6 +22,8 @@ This file provides embedding of any archimedean groups into reals. for any archimedean group `M` without specifying the `1` element in `M`. -/ +@[expose] public section + variable {M : Type*} variable [AddCommGroup M] [LinearOrder M] [IsOrderedAddMonoid M] [One M] diff --git a/Mathlib/Data/Real/Hyperreal.lean b/Mathlib/Data/Real/Hyperreal.lean index b74898e1aa841b..a4bcda3e7ecd15 100644 --- a/Mathlib/Data/Real/Hyperreal.lean +++ b/Mathlib/Data/Real/Hyperreal.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Real.Hyperreal +module + +public import Mathlib.Analysis.Real.Hyperreal deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Real/Irrational.lean b/Mathlib/Data/Real/Irrational.lean index e706456d253479..aba64ec3830341 100644 --- a/Mathlib/Data/Real/Irrational.lean +++ b/Mathlib/Data/Real/Irrational.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.Real.Irrational +module + +public import Mathlib.NumberTheory.Real.Irrational deprecated_module (since := "2025-10-13") diff --git a/Mathlib/Data/Real/Pi/Bounds.lean b/Mathlib/Data/Real/Pi/Bounds.lean index f7bf5761e300da..497d4a7a07fcb2 100644 --- a/Mathlib/Data/Real/Pi/Bounds.lean +++ b/Mathlib/Data/Real/Pi/Bounds.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Real.Pi.Bounds +module + +public import Mathlib.Analysis.Real.Pi.Bounds deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Real/Pi/Irrational.lean b/Mathlib/Data/Real/Pi/Irrational.lean index 50731dc04dfddd..969ba5d29d684b 100644 --- a/Mathlib/Data/Real/Pi/Irrational.lean +++ b/Mathlib/Data/Real/Pi/Irrational.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Real.Pi.Irrational +module + +public import Mathlib.Analysis.Real.Pi.Irrational deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Real/Pi/Leibniz.lean b/Mathlib/Data/Real/Pi/Leibniz.lean index 34f04fd6bff4f2..c75ba4f4090012 100644 --- a/Mathlib/Data/Real/Pi/Leibniz.lean +++ b/Mathlib/Data/Real/Pi/Leibniz.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Real.Pi.Leibniz +module + +public import Mathlib.Analysis.Real.Pi.Leibniz deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Real/Pi/Wallis.lean b/Mathlib/Data/Real/Pi/Wallis.lean index c0f0e9b8c7fce4..2cfad4465c4c68 100644 --- a/Mathlib/Data/Real/Pi/Wallis.lean +++ b/Mathlib/Data/Real/Pi/Wallis.lean @@ -1,3 +1,5 @@ -import Mathlib.Analysis.Real.Pi.Wallis +module + +public import Mathlib.Analysis.Real.Pi.Wallis deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Real/Pointwise.lean b/Mathlib/Data/Real/Pointwise.lean index 49bc59bbcb8dc5..b28c26237a2643 100644 --- a/Mathlib/Data/Real/Pointwise.lean +++ b/Mathlib/Data/Real/Pointwise.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set -import Mathlib.Algebra.Order.Module.Pointwise -import Mathlib.Data.Real.Archimedean +module + +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set +public import Mathlib.Algebra.Order.Module.Pointwise +public import Mathlib.Data.Real.Archimedean /-! # Pointwise operations on sets of reals @@ -21,6 +23,8 @@ This is true more generally for conditionally complete linear order whose defaul don't have those yet. -/ +@[expose] public section + assert_not_exists Finset open Set diff --git a/Mathlib/Data/Real/Sign.lean b/Mathlib/Data/Real/Sign.lean index 2f2d9f2a6a4d50..6dda69b6a8fb9c 100644 --- a/Mathlib/Data/Real/Sign.lean +++ b/Mathlib/Data/Real/Sign.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Eric Wieser -/ -import Mathlib.Data.Real.Basic +module + +public import Mathlib.Data.Real.Basic /-! # Real sign function @@ -22,6 +24,8 @@ real numbers to -1, positive real numbers to 1, and 0 to 0. sign function -/ +@[expose] public section + namespace Real diff --git a/Mathlib/Data/Real/Sqrt.lean b/Mathlib/Data/Real/Sqrt.lean index 4c5028331d91f4..a154d03d7b7ccf 100644 --- a/Mathlib/Data/Real/Sqrt.lean +++ b/Mathlib/Data/Real/Sqrt.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Yury Kudryashov -/ -import Mathlib.Topology.Instances.NNReal.Lemmas -import Mathlib.Topology.Order.MonotoneContinuity +module + +public import Mathlib.Topology.Instances.NNReal.Lemmas +public import Mathlib.Topology.Order.MonotoneContinuity /-! # Square root of a real number @@ -30,6 +32,8 @@ Then we define `Real.sqrt x` to be `NNReal.sqrt (Real.toNNReal x)`. square root -/ +@[expose] public section + open Set Filter open scoped Filter NNReal Topology @@ -60,7 +64,6 @@ lemma sqrt_le_iff_le_sq : sqrt x ≤ y ↔ x ≤ y ^ 2 := sqrt.to_galoisConnecti lemma le_sqrt_iff_sq_le : x ≤ sqrt y ↔ x ^ 2 ≤ y := (sqrt.symm.to_galoisConnection _ _).symm - @[simp] lemma sqrt_eq_zero : sqrt x = 0 ↔ x = 0 := by simp [sqrt_eq_iff_eq_sq] @[simp] lemma sqrt_eq_one : sqrt x = 1 ↔ x = 1 := by simp [sqrt_eq_iff_eq_sq] @@ -103,7 +106,7 @@ namespace Real /-- The square root of a real number. This returns 0 for negative inputs. This has notation `√x`. Note that `√x⁻¹` is parsed as `√(x⁻¹)`. -/ -noncomputable def sqrt (x : ℝ) : ℝ := +@[irreducible] noncomputable def sqrt (x : ℝ) : ℝ := NNReal.sqrt (Real.toNNReal x) -- TODO: replace this with a typeclass @@ -117,12 +120,15 @@ theorem coe_sqrt {x : ℝ≥0} : (NNReal.sqrt x : ℝ) = √(x : ℝ) := by rw [Real.sqrt, Real.toNNReal_coe] @[continuity] -theorem continuous_sqrt : Continuous (√· : ℝ → ℝ) := - NNReal.continuous_coe.comp <| NNReal.continuous_sqrt.comp continuous_real_toNNReal +theorem continuous_sqrt : Continuous (√· : ℝ → ℝ) := by + unfold sqrt + exact NNReal.continuous_coe.comp <| NNReal.continuous_sqrt.comp continuous_real_toNNReal theorem sqrt_eq_zero_of_nonpos (h : x ≤ 0) : sqrt x = 0 := by simp [sqrt, Real.toNNReal_eq_zero.2 h] -@[simp] theorem sqrt_nonneg (x : ℝ) : 0 ≤ √x := NNReal.coe_nonneg _ +@[simp] theorem sqrt_nonneg (x : ℝ) : 0 ≤ √x := by + unfold sqrt + exact NNReal.coe_nonneg _ @[simp] theorem mul_self_sqrt (h : 0 ≤ x) : √x * √x = x := by @@ -288,7 +294,7 @@ open Lean Meta Qq Function /-- Extension for the `positivity` tactic: a square root of a strictly positive nonnegative real is positive. -/ @[positivity NNReal.sqrt _] -def evalNNRealSqrt : PositivityExt where eval {u α} _zα _pα e := do +meta def evalNNRealSqrt : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(NNReal), ~q(NNReal.sqrt $a) => let ra ← core q(inferInstance) q(inferInstance) a @@ -301,7 +307,7 @@ def evalNNRealSqrt : PositivityExt where eval {u α} _zα _pα e := do /-- Extension for the `positivity` tactic: a square root is nonnegative, and is strictly positive if its input is. -/ @[positivity √_] -def evalSqrt : PositivityExt where eval {u α} _zα _pα e := do +meta def evalSqrt : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(√$a) => let ra ← catchNone <| core q(inferInstance) q(inferInstance) a diff --git a/Mathlib/Data/Real/Star.lean b/Mathlib/Data/Real/Star.lean index 11c4680d41fb43..e36077f7c171b1 100644 --- a/Mathlib/Data/Real/Star.lean +++ b/Mathlib/Data/Real/Star.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Yury Kudryashov -/ -import Mathlib.Algebra.Star.Basic -import Mathlib.Data.Real.Basic +module + +public import Mathlib.Algebra.Star.Basic +public import Mathlib.Data.Real.Basic /-! # The real numbers are a `*`-ring, with the trivial `*`-structure -/ +@[expose] public section + /-- The real numbers are a `*`-ring, with the trivial `*`-structure. -/ instance : StarRing ℝ := starRingOfComm diff --git a/Mathlib/Data/Real/StarOrdered.lean b/Mathlib/Data/Real/StarOrdered.lean index cdfa41b3958e45..c33d336f01e3c9 100644 --- a/Mathlib/Data/Real/StarOrdered.lean +++ b/Mathlib/Data/Real/StarOrdered.lean @@ -3,12 +3,16 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Data.NNReal.Star -import Mathlib.Data.Real.Sqrt +module + +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Data.NNReal.Star +public import Mathlib.Data.Real.Sqrt /-! # `ℝ` and `ℝ≥0` are *-ordered rings. -/ +@[expose] public section + open scoped NNReal /-- Although the instance `RCLike.toStarOrderedRing` exists, it is locked behind the diff --git a/Mathlib/Data/Rel.lean b/Mathlib/Data/Rel.lean index 4d3961105c9c34..f1c49493647e7f 100644 --- a/Mathlib/Data/Rel.lean +++ b/Mathlib/Data/Rel.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Data.Set.Prod -import Mathlib.Order.RelIso.Basic -import Mathlib.Order.SetNotation +module + +public import Mathlib.Data.Set.Prod +public import Mathlib.Order.RelIso.Basic +public import Mathlib.Order.SetNotation /-! # Relations as sets of pairs @@ -68,6 +70,8 @@ Simultaneously, uniform spaces need a theory of relations on a type `α` as elem `Set (α × α)`, and the new definition of `SetRel` fulfills this role quite well. -/ +@[expose] public section + variable {α β γ δ : Type*} {ι : Sort*} /-- A relation on `α` and `β`, aka a set-valued function, aka a partial multifunction. diff --git a/Mathlib/Data/Rel/Cover.lean b/Mathlib/Data/Rel/Cover.lean index 10181f8553086b..660c0286258d74 100644 --- a/Mathlib/Data/Rel/Cover.lean +++ b/Mathlib/Data/Rel/Cover.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Rel.Separated +module + +public import Mathlib.Data.Rel.Separated /-! # Covers in a uniform space @@ -23,6 +25,8 @@ The concept of uniform covers can be used to define two further notions of cover [R. Vershynin, *High Dimensional Probability*][vershynin2018high], Section 4.2. -/ +@[expose] public section + open Set namespace SetRel @@ -44,6 +48,11 @@ def IsCover (U : SetRel X X) (s N : Set X) : Prop := ∀ ⦃x⦄, x ∈ s → protected nonrec lemma IsCover.nonempty (hsN : IsCover U s N) (hs : s.Nonempty) : N.Nonempty := let ⟨_x, hx⟩ := hs; let ⟨y, hy, _⟩ := hsN hx; ⟨y, hy⟩ +@[simp] lemma IsCover.refl (U : SetRel X X) [U.IsRefl] (s : Set X) : IsCover U s s := + fun a ha ↦ ⟨a, ha, U.rfl⟩ + +lemma IsCover.rfl {U : SetRel X X} [U.IsRefl] {s : Set X} : IsCover U s s := refl U s + @[simp] protected lemma isCover_univ : IsCover univ s N ↔ (s.Nonempty → N.Nonempty) := by simp [IsCover, Set.Nonempty] diff --git a/Mathlib/Data/Rel/Separated.lean b/Mathlib/Data/Rel/Separated.lean index c0382a51a592d5..8746f4a6f229d7 100644 --- a/Mathlib/Data/Rel/Separated.lean +++ b/Mathlib/Data/Rel/Separated.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Pairwise.Basic -import Mathlib.Data.Rel +module + +public import Mathlib.Data.Set.Pairwise.Basic +public import Mathlib.Data.Rel /-! # Uniform separation @@ -24,6 +26,8 @@ The concept of uniformly separated sets is used to define two further notions of * Link to the notion of separation given by pairwise disjoint balls. -/ +@[expose] public section + open Set namespace SetRel diff --git a/Mathlib/Data/SProd.lean b/Mathlib/Data/SProd.lean index d9289154b90772..b98ccc05fe6f0b 100644 --- a/Mathlib/Data/SProd.lean +++ b/Mathlib/Data/SProd.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Miyahara Kō. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Miyahara Kō -/ +module -import Mathlib.Tactic.FBinop +public import Mathlib.Tactic.FBinop /-! # Set Product Notation @@ -21,6 +22,8 @@ notation is desirable but this notation is defined in core for `Prod` so replaci `x × y` seems difficult. -/ +@[expose] public section + universe u v w /-- Notation type class for the set product `×ˢ`. -/ diff --git a/Mathlib/Data/Semiquot.lean b/Mathlib/Data/Semiquot.lean index 57a4725511e167..07d61d20f55aa5 100644 --- a/Mathlib/Data/Semiquot.lean +++ b/Mathlib/Data/Semiquot.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Data.Set.Lattice /-! # Semiquotients @@ -15,6 +17,8 @@ which return something in a range of values (represented by the predicate `S`) but are not completely determined. -/ +@[expose] public section + /-- A member of `Semiquot α` is classically a nonempty `Set α`, and in the VM is represented by an element of `α`; the relation diff --git a/Mathlib/Data/Seq/Basic.lean b/Mathlib/Data/Seq/Basic.lean index bd342f6b34d4aa..5745ea6155636f 100644 --- a/Mathlib/Data/Seq/Basic.lean +++ b/Mathlib/Data/Seq/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Vasilii Nesterov -/ -import Mathlib.Data.Seq.Defs -import Mathlib.Data.ENat.Basic -import Mathlib.Tactic.ENatToNat -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Data.Seq.Defs +public import Mathlib.Data.ENat.Basic +public import Mathlib.Tactic.ENatToNat +public import Mathlib.Tactic.ApplyFun /-! # Basic properties of sequences (possibly infinite lists) @@ -15,6 +17,8 @@ This file provides some basic lemmas about possibly infinite lists represented b type `Stream'.Seq`. -/ +@[expose] public section + universe u v w namespace Stream' @@ -34,7 +38,7 @@ theorem length'_of_not_terminates {s : Seq α} (h : ¬ s.Terminates) : simp [length', h] @[simp] -theorem length_nil : length (nil : Seq α) terminates_nil = 0 := rfl +theorem length_nil : length (nil : Seq α) terminates_nil = 0 := by simp [length]; exact rfl @[simp] theorem length'_nil : length' (nil : Seq α) = 0 := by diff --git a/Mathlib/Data/Seq/Computation.lean b/Mathlib/Data/Seq/Computation.lean index 88b293fc46f609..6fad078af7b82b 100644 --- a/Mathlib/Data/Seq/Computation.lean +++ b/Mathlib/Data/Seq/Computation.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.Find -import Mathlib.Data.Stream.Init -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.Stream.Init +public import Mathlib.Tactic.Common /-! # Coinductive formalization of unbounded computations. @@ -14,6 +16,8 @@ This file provides a `Computation` type where `Computation α` is the type of unbounded computations returning `α`. -/ +@[expose] public section + open Function universe u v w diff --git a/Mathlib/Data/Seq/Defs.lean b/Mathlib/Data/Seq/Defs.lean index 7e13671005cf31..37dd6118280472 100644 --- a/Mathlib/Data/Seq/Defs.lean +++ b/Mathlib/Data/Seq/Defs.lean @@ -3,9 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Option.NAry -import Mathlib.Data.Seq.Computation -import Mathlib.Data.ENat.Defs +module + +public import Mathlib.Data.Option.NAry +public import Mathlib.Data.Seq.Computation +public import Mathlib.Data.ENat.Defs +import Batteries.Data.MLList.Basic /-! # Possibly infinite lists @@ -38,6 +41,8 @@ sequences by cases (`nil` and `cons`). * `eq_of_bisim`: Bisimulation principle for sequences. -/ +@[expose] public section + namespace Stream' universe u v w diff --git a/Mathlib/Data/Seq/Parallel.lean b/Mathlib/Data/Seq/Parallel.lean index d23011507cc96e..18357bdabe4eb6 100644 --- a/Mathlib/Data/Seq/Parallel.lean +++ b/Mathlib/Data/Seq/Parallel.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.WSeq.Relation +module + +public import Mathlib.Data.WSeq.Relation /-! # Parallel computation @@ -16,6 +18,8 @@ terminates_parallel and exists_of_mem_parallel. honor sequence equivalence (irrelevance of computation time).) -/ +@[expose] public section + universe u v namespace Computation diff --git a/Mathlib/Data/Seq/Seq.lean b/Mathlib/Data/Seq/Seq.lean index ca23e2dcce198f..e40834fa4a149d 100644 --- a/Mathlib/Data/Seq/Seq.lean +++ b/Mathlib/Data/Seq/Seq.lean @@ -1,3 +1,5 @@ -import Mathlib.Data.Seq.Basic +module + +public import Mathlib.Data.Seq.Basic deprecated_module (since := "2025-08-26") diff --git a/Mathlib/Data/Seq/WSeq.lean b/Mathlib/Data/Seq/WSeq.lean index 8eb554727c61d3..61ee8c47f7baaf 100644 --- a/Mathlib/Data/Seq/WSeq.lean +++ b/Mathlib/Data/Seq/WSeq.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.WSeq.Basic -import Mathlib.Data.WSeq.Defs -import Mathlib.Data.WSeq.Productive -import Mathlib.Data.WSeq.Relation +module + +public import Mathlib.Data.WSeq.Basic +public import Mathlib.Data.WSeq.Defs +public import Mathlib.Data.WSeq.Productive +public import Mathlib.Data.WSeq.Relation deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Data/Set/Accumulate.lean b/Mathlib/Data/Set/Accumulate.lean index 64d874f0e99e64..a835b46ce416f1 100644 --- a/Mathlib/Data/Set/Accumulate.lean +++ b/Mathlib/Data/Set/Accumulate.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Data.Set.Lattice /-! # Accumulate @@ -11,6 +13,8 @@ import Mathlib.Data.Set.Lattice The function `Accumulate` takes a set `s` and returns `⋃ y ≤ x, s y`. -/ +@[expose] public section + variable {α β : Type*} {s : α → Set β} diff --git a/Mathlib/Data/Set/Basic.lean b/Mathlib/Data/Set/Basic.lean index 4135b67f427f50..a1d05e1b8d9e15 100644 --- a/Mathlib/Data/Set/Basic.lean +++ b/Mathlib/Data/Set/Basic.lean @@ -3,11 +3,12 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Order.PropInstances -import Mathlib.Tactic.ByContra -import Mathlib.Tactic.Lift -import Mathlib.Tactic.Tauto -import Mathlib.Util.Delaborators +module + +public import Mathlib.Order.PropInstances +public import Mathlib.Tactic.Lift +public import Mathlib.Tactic.Tauto +public import Mathlib.Util.Delaborators /-! # Basic properties of sets @@ -55,6 +56,8 @@ Definitions in the file: set, sets, subset, subsets, union, intersection, insert, singleton, powerset -/ +@[expose] public section + assert_not_exists HeytingAlgebra RelIso /-! ### Set coercion to a type -/ diff --git a/Mathlib/Data/Set/BoolIndicator.lean b/Mathlib/Data/Set/BoolIndicator.lean index 4dc9bf48b9a017..a70adc1367d0d5 100644 --- a/Mathlib/Data/Set/BoolIndicator.lean +++ b/Mathlib/Data/Set/BoolIndicator.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson, Leonardo de Moura -/ -import Mathlib.Order.BooleanAlgebra.Set +module + +public import Mathlib.Order.BooleanAlgebra.Set /-! # Indicator function valued in bool @@ -11,6 +13,8 @@ import Mathlib.Order.BooleanAlgebra.Set See also `Set.indicator` and `Set.piecewise`. -/ +@[expose] public section + assert_not_exists RelIso open Bool diff --git a/Mathlib/Data/Set/BooleanAlgebra.lean b/Mathlib/Data/Set/BooleanAlgebra.lean index 7a5f7a4696b28a..a9b0c7dc863d4f 100644 --- a/Mathlib/Data/Set/BooleanAlgebra.lean +++ b/Mathlib/Data/Set/BooleanAlgebra.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Order.CompleteBooleanAlgebra +module + +public import Mathlib.Order.CompleteBooleanAlgebra /-! # Sets are a complete atomic Boolean algebra. @@ -19,6 +21,8 @@ Indexed union/intersection are defined in `Mathlib.Order.SetNotation`; lemmas ar See `Set.instBooleanAlgebra`. -/ +@[expose] public section + variable {α : Type*} namespace Set diff --git a/Mathlib/Data/Set/Card.lean b/Mathlib/Data/Set/Card.lean index d957f2e96d0d78..e730f5371c7f2e 100644 --- a/Mathlib/Data/Set/Card.lean +++ b/Mathlib/Data/Set/Card.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.SetTheory.Cardinal.Finite -import Mathlib.Data.Set.Finite.Powerset +module + +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.Data.Set.Finite.Powerset /-! # Noncomputable Set Cardinality @@ -55,6 +57,8 @@ the other inside the proof. A few of the theorems, such as `ncard_union_le` do n finiteness arguments; they are true by coincidence due to junk values. -/ +@[expose] public section + namespace Set variable {α β : Type*} {s t : Set α} diff --git a/Mathlib/Data/Set/Card/Arithmetic.lean b/Mathlib/Data/Set/Card/Arithmetic.lean index fd31ff82d74d6f..01d5136dd97925 100644 --- a/Mathlib/Data/Set/Card/Arithmetic.lean +++ b/Mathlib/Data/Set/Card/Arithmetic.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Pim Otte. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pim Otte -/ +module -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Data.Set.Card -import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Data.Set.Card +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! # Results using cardinal arithmetic @@ -21,6 +22,8 @@ It has been separated out to not burden `Mathlib/Data/Set/Card.lean` with extra - `exists_union_disjoint_cardinal_eq_iff` is the same, except using cardinal notation. -/ +@[expose] public section + variable {α ι : Type*} open scoped Finset diff --git a/Mathlib/Data/Set/CoeSort.lean b/Mathlib/Data/Set/CoeSort.lean index bb37e8e8197093..c416beaaf89671 100644 --- a/Mathlib/Data/Set/CoeSort.lean +++ b/Mathlib/Data/Set/CoeSort.lean @@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Johannes Hölzl, Reid Barton, Kim Morrison, Patrick Massot, Kyle Miller, Minchao Wu, Yury Kudryashov, Floris van Doorn -/ -import Mathlib.Data.Set.Defs +module + +public import Mathlib.Data.Set.Defs /-! # Coercing sets to types. @@ -17,6 +19,8 @@ More advanced theorems about these definitions are located in other files in `Ma - `Set.Elem`: coercion of a set to a type; it is reducibly equal to `{x // x ∈ s}`; -/ +@[expose] public section + namespace Set universe u v w diff --git a/Mathlib/Data/Set/Constructions.lean b/Mathlib/Data/Set/Constructions.lean index 013b5d61aaed29..037ebe4ac4cbd8 100644 --- a/Mathlib/Data/Set/Constructions.lean +++ b/Mathlib/Data/Set/Constructions.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.Data.Finset.Insert -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Data.Finset.Insert +public import Mathlib.Data.Set.Lattice /-! # Constructions involving sets of sets. @@ -22,6 +24,8 @@ set of subsets of `α` which is closed under finite intersections. -/ +@[expose] public section + variable {α : Type*} (S : Set (Set α)) diff --git a/Mathlib/Data/Set/Countable.lean b/Mathlib/Data/Set/Countable.lean index a5f8bad7b05180..dc67bd3d57dc86 100644 --- a/Mathlib/Data/Set/Countable.lean +++ b/Mathlib/Data/Set/Countable.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Countable.Basic -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Subsingleton -import Mathlib.Logic.Equiv.List -import Mathlib.Order.Preorder.Finite +module + +public import Mathlib.Data.Countable.Basic +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Logic.Equiv.List +public import Mathlib.Order.Preorder.Finite /-! # Countable sets @@ -23,6 +25,8 @@ For a noncomputable conversion to `Encodable s`, use `Set.Countable.nonempty_enc sets, countable set -/ +@[expose] public section + assert_not_exists Monoid Multiset.sort noncomputable section diff --git a/Mathlib/Data/Set/Defs.lean b/Mathlib/Data/Set/Defs.lean index d5696847da6403..d541163fe8bf42 100644 --- a/Mathlib/Data/Set/Defs.lean +++ b/Mathlib/Data/Set/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Mathlib.Init -import Batteries.Util.ExtendedBinder +module + +public import Mathlib.Init +public import Batteries.Util.ExtendedBinder /-! # Sets @@ -29,6 +31,8 @@ This file is a port of the core Lean 3 file `lib/lean/library/init/data/set.lean -/ +@[expose] public section + open Lean Elab Term Meta Batteries.ExtendedBinder universe u @@ -119,7 +123,7 @@ See also one for syntax of the form `{x ≤ a | p x}`, `{x ≥ a | p x}`, `{x < a | p x}`, `{x > a | p x}`. -/ @[term_elab setBuilder] -def elabSetBuilder : TermElab +meta def elabSetBuilder : TermElab | `({ $x:ident | $p }), expectedType? => do elabTerm (← `(setOf fun $x:ident ↦ $p)) expectedType? | `({ $x:ident : $t | $p }), expectedType? => do @@ -130,7 +134,7 @@ def elabSetBuilder : TermElab /-- Unexpander for set builder notation. -/ @[app_unexpander setOf] -def setOf.unexpander : Lean.PrettyPrinter.Unexpander +meta def setOf.unexpander : Lean.PrettyPrinter.Unexpander | `($_ fun $x:ident ↦ $p) => `({ $x:ident | $p }) | `($_ fun ($x:ident : $ty:term) ↦ $p) => `({ $x:ident : $ty:term | $p }) | _ => throw () @@ -171,7 +175,7 @@ macro (priority := low - 1) "{" pat:term " | " p:term "}" : term => /-- Pretty printing for set-builder notation with pattern matching. -/ @[app_unexpander setOf] -def setOfPatternMatchUnexpander : Lean.PrettyPrinter.Unexpander +meta def setOfPatternMatchUnexpander : Lean.PrettyPrinter.Unexpander | `($_ fun $x:ident ↦ match $y:ident with | $pat => $p) => if x == y then `({ $pat:term | $p:term }) diff --git a/Mathlib/Data/Set/Disjoint.lean b/Mathlib/Data/Set/Disjoint.lean index ec68b5ea9d82bb..22d479eaaaa3c5 100644 --- a/Mathlib/Data/Set/Disjoint.lean +++ b/Mathlib/Data/Set/Disjoint.lean @@ -3,12 +3,16 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Data.Set.Basic +module + +public import Mathlib.Data.Set.Basic /-! # Theorems about the `Disjoint` relation on `Set`. -/ +@[expose] public section + assert_not_exists HeytingAlgebra RelIso /-! ### Set coercion to a type -/ diff --git a/Mathlib/Data/Set/Enumerate.lean b/Mathlib/Data/Set/Enumerate.lean index 13a18ccc8eb44e..a8caeee69e3795 100644 --- a/Mathlib/Data/Set/Enumerate.lean +++ b/Mathlib/Data/Set/Enumerate.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.Nat.Defs -import Mathlib.Tactic.Common -import Mathlib.Data.Set.Insert +module + +public import Mathlib.Algebra.Group.Nat.Defs +public import Mathlib.Tactic.Common +public import Mathlib.Data.Set.Insert /-! # Set enumeration @@ -14,6 +16,8 @@ The definition does not assume `sel` actually is a choice function, i.e. `sel s `sel s = none ↔ s = ∅`. These assumptions are added to the lemmas needing them. -/ +@[expose] public section + assert_not_exists RelIso noncomputable section diff --git a/Mathlib/Data/Set/Equitable.lean b/Mathlib/Data/Set/Equitable.lean index d8a016bb5ef967..01c6f4bff39abd 100644 --- a/Mathlib/Data/Set/Equitable.lean +++ b/Mathlib/Data/Set/Equitable.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Ring.Defs +module + +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Ring.Defs /-! # Equitable functions @@ -20,6 +22,8 @@ useful when the codomain of `f` is `ℕ` or `ℤ` (or more generally a successor latter yet. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Data/Set/Finite/Basic.lean b/Mathlib/Data/Set/Finite/Basic.lean index aeb42239ed0f95..bad96a2f3b3b3f 100644 --- a/Mathlib/Data/Set/Finite/Basic.lean +++ b/Mathlib/Data/Set/Finite/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Tactic.Nontriviality +module + +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Tactic.Nontriviality /-! # Finite sets @@ -38,6 +40,8 @@ instances since they do not compute anything. finite sets -/ +@[expose] public section + assert_not_exists Monoid open Set Function @@ -664,6 +668,9 @@ theorem finite_union {s t : Set α} : (s ∪ t).Finite ↔ s.Finite ∧ t.Finite theorem finite_image_iff {s : Set α} {f : α → β} (hi : InjOn f s) : (f '' s).Finite ↔ s.Finite := ⟨fun h => h.of_finite_image hi, Finite.image _⟩ +lemma finite_range_iff {f : α → β} (hf : f.Injective) : (range f).Finite ↔ Finite α := by + simpa [finite_univ_iff] using finite_image_iff (s := univ) hf.injOn + theorem univ_finite_iff_nonempty_fintype : (univ : Set α).Finite ↔ Nonempty (Fintype α) := ⟨fun h => ⟨fintypeOfFiniteUniv h⟩, fun ⟨_i⟩ => finite_univ⟩ @@ -865,9 +872,8 @@ theorem infinite_image_iff {s : Set α} {f : α → β} (hi : InjOn f s) : (f '' s).Infinite ↔ s.Infinite := not_congr <| finite_image_iff hi -theorem infinite_range_iff {f : α → β} (hi : Injective f) : - (range f).Infinite ↔ Infinite α := by - rw [← image_univ, infinite_image_iff hi.injOn, infinite_univ_iff] +theorem infinite_range_iff {f : α → β} (hf : Injective f) : (range f).Infinite ↔ Infinite α := by + simpa using (finite_range_iff hf).not protected alias ⟨_, Infinite.image⟩ := infinite_image_iff diff --git a/Mathlib/Data/Set/Finite/Lattice.lean b/Mathlib/Data/Set/Finite/Lattice.lean index 28896190dff752..24e84b0fd62c39 100644 --- a/Mathlib/Data/Set/Finite/Lattice.lean +++ b/Mathlib/Data/Set/Finite/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Set.Finite.Powerset -import Mathlib.Data.Set.Finite.Range -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Data.Set.Finite.Powerset +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Data.Set.Lattice.Image /-! # Finiteness of unions and intersections @@ -20,6 +22,8 @@ and a `Set.Finite` constructor. finite sets -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero open Set Function diff --git a/Mathlib/Data/Set/Finite/Lemmas.lean b/Mathlib/Data/Set/Finite/Lemmas.lean index d327c0997d2ac3..c1affe21b29912 100644 --- a/Mathlib/Data/Set/Finite/Lemmas.lean +++ b/Mathlib/Data/Set/Finite/Lemmas.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Finset.Max -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Lattice -import Mathlib.Data.Fintype.Powerset -import Mathlib.Logic.Embedding.Set +module + +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Lattice +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Logic.Embedding.Set /-! # Lemmas on finiteness of sets @@ -20,6 +22,8 @@ If your proof has as *result* `Set.Finite`, then it should go to a more specific finite sets -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero open Set Function @@ -59,6 +63,9 @@ theorem Finite.induction_to_univ [Finite α] {C : Set α → Prop} (S0 : Set α) (H0 : C S0) (H1 : ∀ S ≠ univ, C S → ∃ a ∉ S, C (insert a S)) : C univ := finite_univ.induction_to S0 (subset_univ S0) H0 (by simpa [ssubset_univ_iff]) +theorem sUnion_finite_eq_univ {X : Type*} : ⋃₀ {(s : Set X) | Set.Finite s} = Set.univ := + sUnion_eq_univ_iff.mpr fun x ↦ ⟨{x}, finite_singleton x, rfl⟩ + /-! ### Infinite sets -/ variable {s t : Set α} diff --git a/Mathlib/Data/Set/Finite/List.lean b/Mathlib/Data/Set/Finite/List.lean index ce50cf183439c3..1c92efff14009e 100644 --- a/Mathlib/Data/Set/Finite/List.lean +++ b/Mathlib/Data/Set/Finite/List.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Data.Set.Finite.Range -import Mathlib.Data.Set.Lattice -import Mathlib.Data.Finite.Vector +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Data.Set.Lattice +public import Mathlib.Data.Finite.Vector /-! # Finiteness of sets of lists @@ -17,6 +19,8 @@ import Mathlib.Data.Finite.Vector finite sets -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero namespace List diff --git a/Mathlib/Data/Set/Finite/Monad.lean b/Mathlib/Data/Set/Finite/Monad.lean index b5c7bb05f28eb7..69c8220874ba0c 100644 --- a/Mathlib/Data/Set/Finite/Monad.lean +++ b/Mathlib/Data/Set/Finite/Monad.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Data.Set.Functor +module + +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Data.Set.Functor /-! # Finiteness of the Set monad operations @@ -15,6 +17,8 @@ import Mathlib.Data.Set.Functor finite sets -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero open Set Function diff --git a/Mathlib/Data/Set/Finite/Powerset.lean b/Mathlib/Data/Set/Finite/Powerset.lean index 0868b60f2bff5e..e643d60d5e2c89 100644 --- a/Mathlib/Data/Set/Finite/Powerset.lean +++ b/Mathlib/Data/Set/Finite/Powerset.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Set.Finite.Basic /-! # Finiteness of the powerset of a finite set @@ -19,6 +21,8 @@ and a `Set.Finite` constructor. finite sets -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero open Set Function diff --git a/Mathlib/Data/Set/Finite/Range.lean b/Mathlib/Data/Set/Finite/Range.lean index 4d9344b762b909..09dd8e55592019 100644 --- a/Mathlib/Data/Set/Finite/Range.lean +++ b/Mathlib/Data/Set/Finite/Range.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kyle Miller -/ -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.ULift +module + +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.ULift /-! # Finiteness of `Set.range` @@ -19,6 +21,8 @@ and a `Set.Finite` constructor. finite sets -/ +@[expose] public section + assert_not_exists IsOrderedRing MonoidWithZero open Set Function diff --git a/Mathlib/Data/Set/Function.lean b/Mathlib/Data/Set/Function.lean index 945be10602bf44..17975d77882dc0 100644 --- a/Mathlib/Data/Set/Function.lean +++ b/Mathlib/Data/Set/Function.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Andrew Zipperer, Haitao Zhang, Minchao Wu, Yury Kudryashov -/ -import Mathlib.Data.Set.Prod -import Mathlib.Data.Set.Restrict +module + +public import Mathlib.Data.Set.Prod +public import Mathlib.Data.Set.Restrict /-! # Functions over sets @@ -22,6 +24,8 @@ This file contains basic results on the following predicates of functions and se we have `Set.LeftInvOn f' f s` and `Set.RightInvOn f' f t`. -/ +@[expose] public section + variable {α β γ δ : Type*} {ι : Sort*} {π : α → Type*} open Equiv Equiv.Perm Function diff --git a/Mathlib/Data/Set/Functor.lean b/Mathlib/Data/Set/Functor.lean index 553872aa5fa50c..3e4f963de5d8ac 100644 --- a/Mathlib/Data/Set/Functor.lean +++ b/Mathlib/Data/Set/Functor.lean @@ -3,11 +3,13 @@ Copyright (c) 2016 Leonardo de Moura. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Batteries.Control.AlternativeMonad -import Mathlib.Control.Basic -import Mathlib.Data.Set.Defs -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Data.Set.Notation +module + +public import Batteries.Control.AlternativeMonad +public import Mathlib.Control.Basic +public import Mathlib.Data.Set.Defs +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Data.Set.Notation /-! # Functoriality of `Set` @@ -15,6 +17,8 @@ import Mathlib.Data.Set.Notation This file defines the functor structure of `Set`. -/ +@[expose] public section + universe u open Function Set.Notation diff --git a/Mathlib/Data/Set/Image.lean b/Mathlib/Data/Set/Image.lean index fa1af013ef1df3..c7c483f62aad34 100644 --- a/Mathlib/Data/Set/Image.lean +++ b/Mathlib/Data/Set/Image.lean @@ -3,12 +3,14 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Batteries.Tactic.Congr -import Mathlib.Data.Option.Basic -import Mathlib.Data.Prod.Basic -import Mathlib.Data.Set.Subsingleton -import Mathlib.Data.Set.SymmDiff -import Mathlib.Data.Set.Inclusion +module + +public import Batteries.Tactic.Congr +public import Mathlib.Data.Option.Basic +public import Mathlib.Data.Prod.Basic +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Data.Set.SymmDiff +public import Mathlib.Data.Set.Inclusion /-! # Images and preimages of sets @@ -32,6 +34,8 @@ set, sets, image, preimage, pre-image, range -/ +@[expose] public section + assert_not_exists WithTop OrderIso universe u v @@ -1248,6 +1252,18 @@ theorem injective_iff {α β} {f : Option α → β} : theorem range_eq {α β} (f : Option α → β) : range f = insert (f none) (range (f ∘ some)) := Set.ext fun _ => Option.exists.trans <| eq_comm.or Iff.rfl +/-- The range of `Option.elim b f` is `{b} ∪ range f`. -/ +theorem range_elim {α β} (b : β) (f : α → β) : + range (fun o : Option α => o.elim b f) = insert b (range f) := by + rw [range_eq] + simp [Function.comp_def] + +/-- The image of `range some` under `Option.elim b f` equals `range f`. -/ +theorem image_elim_range_some_eq_range {α β} (f : α → β) (b : β) : + (fun o : Option α => o.elim b f) '' range some = range f := by + rw [← range_comp'] + simp + end Option namespace Set diff --git a/Mathlib/Data/Set/Inclusion.lean b/Mathlib/Data/Set/Inclusion.lean index 25152197c867cf..8967e70164386c 100644 --- a/Mathlib/Data/Set/Inclusion.lean +++ b/Mathlib/Data/Set/Inclusion.lean @@ -3,10 +3,14 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Data.Set.Basic +module + +public import Mathlib.Data.Set.Basic /-! # Lemmas about `inclusion`, the injection of subtypes induced by `⊆` -/ +@[expose] public section + open Function namespace Set diff --git a/Mathlib/Data/Set/Insert.lean b/Mathlib/Data/Set/Insert.lean index 7abcea67f771c7..453116935f7ee5 100644 --- a/Mathlib/Data/Set/Insert.lean +++ b/Mathlib/Data/Set/Insert.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Data.Set.Disjoint +module + +public import Mathlib.Data.Set.Disjoint /-! # Lemmas about insertion, singleton, and pairs @@ -16,6 +18,8 @@ insert, singleton -/ +@[expose] public section + assert_not_exists HeytingAlgebra /-! ### Set coercion to a type -/ diff --git a/Mathlib/Data/Set/Lattice.lean b/Mathlib/Data/Set/Lattice.lean index 420eec5e435cbe..1f9b1d595066a8 100644 --- a/Mathlib/Data/Set/Lattice.lean +++ b/Mathlib/Data/Set/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Logic.Pairwise -import Mathlib.Data.Set.BooleanAlgebra +module + +public import Mathlib.Logic.Pairwise +public import Mathlib.Data.Set.BooleanAlgebra /-! # The set lattice @@ -41,6 +43,8 @@ In lemma names, * `⋂₀`: `Set.sInter` -/ +@[expose] public section + open Function Set universe u diff --git a/Mathlib/Data/Set/Lattice/Image.lean b/Mathlib/Data/Set/Lattice/Image.lean index 5f342155da7e00..1c34e3c3b24643 100644 --- a/Mathlib/Data/Set/Lattice/Image.lean +++ b/Mathlib/Data/Set/Lattice/Image.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Tactic.Monotonicity.Attr /-! # The set lattice and (pre)images of functions @@ -35,6 +37,8 @@ In lemma names, * `⋂₀`: `Set.sInter` -/ +@[expose] public section + open Function Set universe u @@ -392,13 +396,9 @@ theorem preimage_iUnion₂ {f : α → β} {s : ∀ i, κ i → Set β} : (f ⁻¹' ⋃ (i) (j), s i j) = ⋃ (i) (j), f ⁻¹' s i j := by simp_rw [preimage_iUnion] theorem image_sUnion {f : α → β} {s : Set (Set α)} : (f '' ⋃₀ s) = ⋃₀ (image f '' s) := by - ext b - simp only [mem_image, mem_sUnion, exists_prop, sUnion_image, mem_iUnion] - constructor - · rintro ⟨a, ⟨t, ht₁, ht₂⟩, rfl⟩ - exact ⟨t, ht₁, a, ht₂, rfl⟩ - · rintro ⟨t, ht₁, a, ht₂, rfl⟩ - exact ⟨a, ⟨t, ht₁, ht₂⟩, rfl⟩ + ext + simp only [Set.mem_iUnion, Set.sUnion_image] + grind @[simp] theorem preimage_sUnion {f : α → β} {s : Set (Set β)} : f ⁻¹' ⋃₀ s = ⋃ t ∈ s, f ⁻¹' t := by diff --git a/Mathlib/Data/Set/List.lean b/Mathlib/Data/Set/List.lean index cbbf158eafbade..1006c2ae3a57c2 100644 --- a/Mathlib/Data/Set/List.lean +++ b/Mathlib/Data/Set/List.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Image -import Mathlib.Data.List.Defs +module + +public import Mathlib.Data.Set.Image +public import Mathlib.Data.List.Defs /-! # Lemmas about `List`s and `Set.range` @@ -12,6 +14,8 @@ import Mathlib.Data.List.Defs In this file we prove lemmas about range of some operations on lists. -/ +@[expose] public section + open List diff --git a/Mathlib/Data/Set/MemPartition.lean b/Mathlib/Data/Set/MemPartition.lean index 7544f55fd5687f..4a075a0ff579c4 100644 --- a/Mathlib/Data/Set/MemPartition.lean +++ b/Mathlib/Data/Set/MemPartition.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Data.Set.Finite.Lattice +module + +public import Mathlib.Data.Set.Finite.Lattice /-! # Partitions based on membership of a sequence of sets @@ -30,6 +32,8 @@ The partition `memPartition f (n + 1)` is finer than `memPartition f n`. -/ +@[expose] public section + open Set variable {α : Type*} diff --git a/Mathlib/Data/Set/Monotone.lean b/Mathlib/Data/Set/Monotone.lean index fdc607b74b1cb4..60ec1cc5a166d4 100644 --- a/Mathlib/Data/Set/Monotone.lean +++ b/Mathlib/Data/Set/Monotone.lean @@ -3,12 +3,16 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Andrew Zipperer, Haitao Zhang, Minchao Wu, Yury Kudryashov -/ -import Mathlib.Data.Set.Function +module + +public import Mathlib.Data.Set.Function /-! # Monotone functions over sets -/ +@[expose] public section + variable {α β γ : Type*} open Equiv Equiv.Perm Function diff --git a/Mathlib/Data/Set/MulAntidiagonal.lean b/Mathlib/Data/Set/MulAntidiagonal.lean index fee6ac9d21fb94..db7a3ec0cf4eec 100644 --- a/Mathlib/Data/Set/MulAntidiagonal.lean +++ b/Mathlib/Data/Set/MulAntidiagonal.lean @@ -3,10 +3,14 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Floris van Doorn -/ -import Mathlib.Order.WellFoundedSet +module + +public import Mathlib.Order.WellFoundedSet /-! # Multiplication antidiagonal -/ +@[expose] public section + namespace Set diff --git a/Mathlib/Data/Set/NAry.lean b/Mathlib/Data/Set/NAry.lean index 5e8891974cbf36..0eda56697e456e 100644 --- a/Mathlib/Data/Set/NAry.lean +++ b/Mathlib/Data/Set/NAry.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Data.Set.Prod +module + +public import Mathlib.Data.Set.Prod /-! # N-ary images of sets @@ -17,6 +19,8 @@ This file is very similar to `Data.Finset.NAry`, to `Order.Filter.NAry`, and to `Data.Option.NAry`. Please keep them in sync. -/ +@[expose] public section + open Function namespace Set diff --git a/Mathlib/Data/Set/Notation.lean b/Mathlib/Data/Set/Notation.lean index fd312c88c90a23..cfcd3d786655b2 100644 --- a/Mathlib/Data/Set/Notation.lean +++ b/Mathlib/Data/Set/Notation.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Util.Notation3 -import Mathlib.Lean.Expr.ExtraRecognizers +module + +public import Mathlib.Util.Notation3 +public meta import Mathlib.Lean.Expr.ExtraRecognizers /-! # Set Notation @@ -22,6 +24,8 @@ They are defined here separately so that this file can be added as an exception and can thus be imported without a linting false positive when only the notation is desired. -/ +@[expose] public section + namespace Set.Notation /-- Given two sets `A` and `B`, `A ↓∩ B` denotes the intersection of `A` and `B` as a set in `Set A`. @@ -41,7 +45,7 @@ If the `Set.Notation` namespace is open, sets of a subtype coerced to the ambien represented with `↑`. -/ @[scoped delab app.Set.image] -def delab_set_image_subtype : Delab := whenPPOption getPPCoercions do +meta def delab_set_image_subtype : Delab := whenPPOption getPPCoercions do let #[α, _, f, _] := (← getExpr).getAppArgs | failure guard <| f.isAppOfArity ``Subtype.val 2 let some _ := α.coeTypeSet? | failure diff --git a/Mathlib/Data/Set/Operations.lean b/Mathlib/Data/Set/Operations.lean index 89f78ae4ff045c..8d4467a1b7cfd2 100644 --- a/Mathlib/Data/Set/Operations.lean +++ b/Mathlib/Data/Set/Operations.lean @@ -4,11 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Johannes Hölzl, Reid Barton, Kim Morrison, Patrick Massot, Kyle Miller, Minchao Wu, Yury Kudryashov, Floris van Doorn -/ -import Aesop -import Mathlib.Data.Set.CoeSort -import Mathlib.Data.SProd -import Mathlib.Data.Subtype -import Mathlib.Order.Notation +module + +public import Aesop +public import Mathlib.Data.Set.CoeSort +public import Mathlib.Data.SProd +public import Mathlib.Data.Subtype +public import Mathlib.Order.Notation /-! # Basic definitions about sets @@ -58,6 +60,8 @@ More advanced theorems about these definitions are located in other files in `Ma set, image, preimage -/ +@[expose] public section + attribute [ext] Set.ext universe u v w diff --git a/Mathlib/Data/Set/Opposite.lean b/Mathlib/Data/Set/Opposite.lean index b513d07864d91f..40ce9b27613908 100644 --- a/Mathlib/Data/Set/Opposite.lean +++ b/Mathlib/Data/Set/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.Data.Opposite -import Mathlib.Data.Set.Operations +module + +public import Mathlib.Data.Opposite +public import Mathlib.Data.Set.Operations /-! # The opposite of a set @@ -12,6 +14,8 @@ import Mathlib.Data.Set.Operations The opposite of a set `s` is simply the set obtained by taking the opposite of each member of `s`. -/ +@[expose] public section + variable {α : Type*} open Opposite diff --git a/Mathlib/Data/Set/Order.lean b/Mathlib/Data/Set/Order.lean index b981c9b122b4ef..3b7d197548763f 100644 --- a/Mathlib/Data/Set/Order.lean +++ b/Mathlib/Data/Set/Order.lean @@ -3,12 +3,16 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Data.Set.Basic +module + +public import Mathlib.Data.Set.Basic /-! # Order structures and monotonicity lemmas for `Set` -/ +@[expose] public section + open Function universe u v diff --git a/Mathlib/Data/Set/Pairwise/Basic.lean b/Mathlib/Data/Set/Pairwise/Basic.lean index d6240e409c985b..503deb1fafbaac 100644 --- a/Mathlib/Data/Set/Pairwise/Basic.lean +++ b/Mathlib/Data/Set/Pairwise/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Set.Function -import Mathlib.Logic.Pairwise -import Mathlib.Logic.Relation +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Logic.Pairwise +public import Mathlib.Logic.Relation /-! # Relations holding pairwise @@ -27,6 +29,8 @@ The spelling `s.PairwiseDisjoint id` is preferred over `s.Pairwise Disjoint` to on `Set.PairwiseDisjoint`, even though the latter unfolds to something nicer. -/ +@[expose] public section + open Function Order Set diff --git a/Mathlib/Data/Set/Pairwise/Chain.lean b/Mathlib/Data/Set/Pairwise/Chain.lean index 92e0f6d9e1b2b2..2a81178d0218e8 100644 --- a/Mathlib/Data/Set/Pairwise/Chain.lean +++ b/Mathlib/Data/Set/Pairwise/Chain.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jasper Mulder-Sohn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Edward van de Meent, Jasper Mulder-Sohn -/ -import Mathlib.Data.Set.Pairwise.Lattice -import Mathlib.Order.Preorder.Chain +module + +public import Mathlib.Data.Set.Pairwise.Lattice +public import Mathlib.Order.Preorder.Chain /-! # Pairwise results for chains @@ -12,6 +14,8 @@ import Mathlib.Order.Preorder.Chain In this file `Pairwise` results are applied to chains of sets. -/ +@[expose] public section + open Set variable {α β : Type*} {c : Set (Set α)} {r : α → α → Prop} diff --git a/Mathlib/Data/Set/Pairwise/Lattice.lean b/Mathlib/Data/Set/Pairwise/Lattice.lean index 3b9af6b2b598fc..079baec834fe03 100644 --- a/Mathlib/Data/Set/Pairwise/Lattice.lean +++ b/Mathlib/Data/Set/Pairwise/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Data.Set.Pairwise.Basic +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Data.Set.Pairwise.Basic /-! # Relations holding pairwise @@ -12,6 +14,8 @@ import Mathlib.Data.Set.Pairwise.Basic In this file we prove many facts about `Pairwise` and the set lattice. -/ +@[expose] public section + open Function Set Order diff --git a/Mathlib/Data/Set/Pairwise/List.lean b/Mathlib/Data/Set/Pairwise/List.lean index 8b03044f4c6698..37c3c89eb3eaf8 100644 --- a/Mathlib/Data/Set/Pairwise/List.lean +++ b/Mathlib/Data/Set/Pairwise/List.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kenny Lau -/ -import Mathlib.Data.List.Nodup -import Mathlib.Data.Set.Pairwise.Basic +module + +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.Set.Pairwise.Basic /-! # Translating pairwise relations on sets to lists @@ -12,6 +14,8 @@ import Mathlib.Data.Set.Pairwise.Basic On a list with no duplicates, the condition of `Set.Pairwise` and `List.Pairwise` are equivalent. -/ +@[expose] public section + variable {α : Type*} {r : α → α → Prop} diff --git a/Mathlib/Data/Set/Piecewise.lean b/Mathlib/Data/Set/Piecewise.lean index fc753f95cc8768..5550ab35e9eba1 100644 --- a/Mathlib/Data/Set/Piecewise.lean +++ b/Mathlib/Data/Set/Piecewise.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Andrew Zipperer, Haitao Zhang, Minchao Wu, Yury Kudryashov -/ -import Mathlib.Data.Set.Function +module + +public import Mathlib.Data.Set.Function /-! # Piecewise functions @@ -11,6 +13,8 @@ import Mathlib.Data.Set.Function This file contains basic results on piecewise defined functions. -/ +@[expose] public section + variable {α β γ δ : Type*} {ι : Sort*} {π : α → Type*} open Equiv Equiv.Perm Function diff --git a/Mathlib/Data/Set/Pointwise/Support.lean b/Mathlib/Data/Set/Pointwise/Support.lean index c49d01498544de..983e3ce89aed37 100644 --- a/Mathlib/Data/Set/Pointwise/Support.lean +++ b/Mathlib/Data/Set/Pointwise/Support.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set -import Mathlib.Algebra.Notation.Support +module + +public import Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set +public import Mathlib.Algebra.Notation.Support /-! # Support of a function composed with a scalar action @@ -12,6 +14,8 @@ import Mathlib.Algebra.Notation.Support We show that the support of `x ↦ f (c⁻¹ • x)` is equal to `c • support f`. -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/Data/Set/Prod.lean b/Mathlib/Data/Set/Prod.lean index 9c2060f3421eef..8648c9e231bf6e 100644 --- a/Mathlib/Data/Set/Prod.lean +++ b/Mathlib/Data/Set/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Patrick Massot -/ -import Mathlib.Data.Set.Image -import Mathlib.Data.SProd -import Mathlib.Data.Sum.Basic +module + +public import Mathlib.Data.Set.Image +public import Mathlib.Data.SProd +public import Mathlib.Data.Sum.Basic /-! # Sets in product and pi types @@ -24,6 +26,8 @@ This file contains basic results on the following notions, which are defined in * `Set.pi`: Arbitrary product of sets. -/ +@[expose] public section + open Function @@ -797,11 +801,7 @@ theorem subset_pi_iff {s'} : s' ⊆ pi s t ↔ ∀ i ∈ s, s' ⊆ (· i) ⁻¹' grind theorem update_mem_pi_iff [DecidableEq ι] {a : ∀ i, α i} {i : ι} {b : α i} : - update a i b ∈ pi s t ↔ a ∈ pi (s \ {i}) t ∧ (i ∈ s → b ∈ t i) := by - constructor - · grind [update_self, update_of_ne] - · rintro h j - cases eq_or_ne i j <;> grind [update_self, update_of_ne] + update a i b ∈ pi s t ↔ a ∈ pi (s \ {i}) t ∧ (i ∈ s → b ∈ t i) := by grind theorem update_mem_pi_iff_of_mem [DecidableEq ι] {a : ∀ i, α i} {i : ι} {b : α i} (ha : a ∈ pi s t) : update a i b ∈ pi s t ↔ i ∈ s → b ∈ t i := by diff --git a/Mathlib/Data/Set/Restrict.lean b/Mathlib/Data/Set/Restrict.lean index 18f965cb7c5e3e..68cf7c7c4a4ba3 100644 --- a/Mathlib/Data/Set/Restrict.lean +++ b/Mathlib/Data/Set/Restrict.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Andrew Zipperer, Haitao Zhang, Minchao Wu, Yury Kudryashov -/ -import Mathlib.Data.Set.Image +module + +public import Mathlib.Data.Set.Image /-! # Restrict the domain of a function to a set @@ -14,6 +16,8 @@ import Mathlib.Data.Set.Image * `Set.codRestrict f s h` : given `h : ∀ x, f x ∈ s`, restrict the codomain of `f` to the set `s`; -/ +@[expose] public section + variable {α β γ δ : Type*} {ι : Sort*} {π : α → Type*} open Equiv Equiv.Perm Function diff --git a/Mathlib/Data/Set/SMulAntidiagonal.lean b/Mathlib/Data/Set/SMulAntidiagonal.lean index 5de630d9ff5bcf..18c8f50b8b0c02 100644 --- a/Mathlib/Data/Set/SMulAntidiagonal.lean +++ b/Mathlib/Data/Set/SMulAntidiagonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Order.AddTorsor -import Mathlib.Order.WellFoundedSet +module + +public import Mathlib.Algebra.Order.AddTorsor +public import Mathlib.Order.WellFoundedSet /-! # Antidiagonal for scalar multiplication @@ -18,6 +20,8 @@ and an element in `t` that scalar-multiply to `a`. * VAdd.antidiagonal : Set-valued antidiagonal for VAdd. -/ +@[expose] public section + variable {G P : Type*} namespace Set diff --git a/Mathlib/Data/Set/Semiring.lean b/Mathlib/Data/Set/Semiring.lean index 029e3bbe13da22..c6740bdd8b3902 100644 --- a/Mathlib/Data/Set/Semiring.lean +++ b/Mathlib/Data/Set/Semiring.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Order.Kleene -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Data.Set.BooleanAlgebra -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Order.Kleene +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Data.Set.BooleanAlgebra +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Sets as a semiring under union @@ -16,6 +18,8 @@ pointwise `*` as multiplication. If `α` is a (commutative) monoid, `SetSemiring (commutative) semiring. -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Data/Set/Sigma.lean b/Mathlib/Data/Set/Sigma.lean index 1101feab579d89..efb4472e56d349 100644 --- a/Mathlib/Data/Set/Sigma.lean +++ b/Mathlib/Data/Set/Sigma.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Image -import Mathlib.Data.Set.BooleanAlgebra +module + +public import Mathlib.Data.Set.Image +public import Mathlib.Data.Set.BooleanAlgebra /-! # Sets in sigma types @@ -12,6 +14,8 @@ import Mathlib.Data.Set.BooleanAlgebra This file defines `Set.sigma`, the indexed sum of sets. -/ +@[expose] public section + namespace Set variable {ι ι' : Type*} {α : ι → Type*} {s s₁ s₂ : Set ι} {t t₁ t₂ : ∀ i, Set (α i)} diff --git a/Mathlib/Data/Set/Subset.lean b/Mathlib/Data/Set/Subset.lean index eee2d255cf27e7..0d3c7338c444e5 100644 --- a/Mathlib/Data/Set/Subset.lean +++ b/Mathlib/Data/Set/Subset.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Miguel Marco. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Miguel Marco -/ -import Mathlib.Data.Set.Function -import Mathlib.Data.Set.Functor +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Data.Set.Functor /-! # Sets in subtypes @@ -37,6 +39,8 @@ Theorem names refer to `↓∩` as `preimage_val`. subsets -/ +@[expose] public section + open Set variable {ι : Sort*} {α : Type*} {A B C : Set α} {D E : Set A} diff --git a/Mathlib/Data/Set/Subsingleton.lean b/Mathlib/Data/Set/Subsingleton.lean index e636850ea51bf6..35c7f558a51495 100644 --- a/Mathlib/Data/Set/Subsingleton.lean +++ b/Mathlib/Data/Set/Subsingleton.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Data.Set.Insert -import Mathlib.Tactic.ByContra +module + +public import Mathlib.Data.Set.Insert +public import Mathlib.Tactic.ByContra /-! # Subsingleton @@ -16,6 +18,8 @@ elements. -/ +@[expose] public section + assert_not_exists HeytingAlgebra RelIso open Function diff --git a/Mathlib/Data/Set/Sups.lean b/Mathlib/Data/Set/Sups.lean index ea9a6638ee6066..b7eaf98f220f56 100644 --- a/Mathlib/Data/Set/Sups.lean +++ b/Mathlib/Data/Set/Sups.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.NAry -import Mathlib.Order.SupClosed -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Data.Set.NAry +public import Mathlib.Order.SupClosed +public import Mathlib.Order.UpperLower.Closure /-! # Set family operations @@ -28,6 +30,8 @@ We define the following notation in scope `SetFamily`: [B. Bollobás, *Combinatorics*][bollobas1986] -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Set/SymmDiff.lean b/Mathlib/Data/Set/SymmDiff.lean index 70aa571a8066c8..3cfab62131c380 100644 --- a/Mathlib/Data/Set/SymmDiff.lean +++ b/Mathlib/Data/Set/SymmDiff.lean @@ -3,11 +3,15 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Order.BooleanAlgebra.Set -import Mathlib.Order.SymmDiff +module + +public import Mathlib.Order.BooleanAlgebra.Set +public import Mathlib.Order.SymmDiff /-! # Symmetric differences of sets -/ +@[expose] public section + assert_not_exists RelIso namespace Set diff --git a/Mathlib/Data/Set/UnionLift.lean b/Mathlib/Data/Set/UnionLift.lean index 7db0431687fcac..3cb2259d3d4f16 100644 --- a/Mathlib/Data/Set/UnionLift.lean +++ b/Mathlib/Data/Set/UnionLift.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Order.Directed +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Order.Directed /-! # Union lift @@ -36,6 +38,8 @@ constants, unary functions, or binary functions are preserved. These lemmas are: directed union, directed supremum, glue, gluing -/ +@[expose] public section + variable {α : Type*} {ι β : Sort _} namespace Set diff --git a/Mathlib/Data/SetLike/Basic.lean b/Mathlib/Data/SetLike/Basic.lean index 6d568ba3fe023a..a24ddda3f0d860 100644 --- a/Mathlib/Data/SetLike/Basic.lean +++ b/Mathlib/Data/SetLike/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Tactic.Monotonicity.Attr -import Mathlib.Tactic.SetLike -import Mathlib.Data.Set.Basic +module + +public import Mathlib.Tactic.Monotonicity.Attr +public import Mathlib.Tactic.SetLike +public import Mathlib.Data.Set.Basic /-! # Typeclass for types with a set-like extensionality property @@ -70,6 +72,8 @@ While this is equivalent, `SetLike` conveniently uses a carrier set projection d subobjects -/ +@[expose] public section + assert_not_exists RelIso /-- A class to indicate that there is a canonical injection between `A` and `Set B`. @@ -119,7 +123,7 @@ open Lean PrettyPrinter.Delaborator SubExpr rather than as `{ x // x ∈ S }`. The discriminating feature is that membership uses the `SetLike.instMembership` instance. -/ @[app_delab Subtype] -def delabSubtypeSetLike : Delab := whenPPOption getPPNotation do +meta def delabSubtypeSetLike : Delab := whenPPOption getPPNotation do let #[_, .lam n _ body _] := (← getExpr).getAppArgs | failure guard <| body.isAppOf ``Membership.mem let #[_, _, inst, _, .bvar 0] := body.getAppArgs | failure diff --git a/Mathlib/Data/SetLike/Fintype.lean b/Mathlib/Data/SetLike/Fintype.lean index b60697d09a0ba3..37ac757d545bba 100644 --- a/Mathlib/Data/SetLike/Fintype.lean +++ b/Mathlib/Data/SetLike/Fintype.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.SetLike.Basic -import Mathlib.Data.Fintype.Powerset +module + +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Data.Fintype.Powerset /-! # Set-like fintype @@ -13,6 +15,8 @@ This file contains a fintype instance for set-like objects such as subgroups. If and `Fintype B` then `Fintype A`. -/ +@[expose] public section + namespace SetLike diff --git a/Mathlib/Data/Setoid/Basic.lean b/Mathlib/Data/Setoid/Basic.lean index 43c6aeea04236b..25a864ea8487a5 100644 --- a/Mathlib/Data/Setoid/Basic.lean +++ b/Mathlib/Data/Setoid/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Bryan Gin-ge Chen -/ -import Mathlib.Logic.Relation -import Mathlib.Order.CompleteLattice.Basic -import Mathlib.Order.GaloisConnection.Defs +module + +public import Mathlib.Logic.Relation +public import Mathlib.Order.CompleteLattice.Basic +public import Mathlib.Order.GaloisConnection.Defs /-! # Equivalence relations @@ -30,6 +32,8 @@ reason about them using the existing `Setoid` and its infrastructure. setoid, equivalence, iseqv, relation, equivalence relation -/ +@[expose] public section + attribute [refl, simp] Setoid.refl attribute [symm] Setoid.symm attribute [trans] Setoid.trans @@ -164,7 +168,6 @@ theorem sInf_def {s : Set (Setoid α)} : ⇑(sInf s) = sInf ((⇑) '' s) := by rfl instance : PartialOrder (Setoid α) where - le := (· ≤ ·) lt r s := r ≤ s ∧ ¬s ≤ r le_refl _ _ _ := id le_trans _ _ _ hr hs _ _ h := hs <| hr h diff --git a/Mathlib/Data/Setoid/Partition.lean b/Mathlib/Data/Setoid/Partition.lean index 2ba36fe759b91d..5d5e17e5ba4b3b 100644 --- a/Mathlib/Data/Setoid/Partition.lean +++ b/Mathlib/Data/Setoid/Partition.lean @@ -3,9 +3,10 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Bryan Gin-ge Chen, Patrick Massot, Wen Yang, Johan Commelin -/ +module -import Mathlib.Data.Set.Finite.Range -import Mathlib.Order.Partition.Finpartition +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Order.Partition.Finpartition /-! # Equivalence relations: partitions @@ -33,6 +34,8 @@ usable. setoid, equivalence, iseqv, relation, equivalence relation, partition, equivalence class -/ +@[expose] public section + namespace Setoid @@ -242,7 +245,6 @@ instance Partition.le : LE (Subtype (@IsPartition α)) := /-- Defining a partial order on partitions as the partial order on their induced equivalence relations. -/ instance Partition.partialOrder : PartialOrder (Subtype (@IsPartition α)) where - le := (· ≤ ·) lt x y := x ≤ y ∧ ¬y ≤ x le_refl _ := @le_refl (Setoid α) _ _ le_trans _ _ _ := @le_trans (Setoid α) _ _ _ _ diff --git a/Mathlib/Data/Setoid/Partition/Card.lean b/Mathlib/Data/Setoid/Partition/Card.lean index efd21d22b86d91..06579370da55f7 100644 --- a/Mathlib/Data/Setoid/Partition/Card.lean +++ b/Mathlib/Data/Setoid/Partition/Card.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Data.Set.Card -import Mathlib.Data.Setoid.Partition +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Data.Set.Card +public import Mathlib.Data.Setoid.Partition /-! # Cardinality of parts of partitions @@ -15,6 +16,8 @@ import Mathlib.Data.Setoid.Partition -/ +@[expose] public section + section Finite open scoped BigOperators diff --git a/Mathlib/Data/Sigma/Basic.lean b/Mathlib/Data/Sigma/Basic.lean index d9916410167520..919f24d19b1adc 100644 --- a/Mathlib/Data/Sigma/Basic.lean +++ b/Mathlib/Data/Sigma/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Function.Defs -import Mathlib.Logic.Function.Basic +module + +public import Mathlib.Logic.Function.Defs +public import Mathlib.Logic.Function.Basic /-! # Sigma types @@ -29,6 +31,8 @@ types. To that effect, we have `PSigma`, which takes value in `Sort*` and carrie complicated universe signature as a consequence. -/ +@[expose] public section + open Function section Sigma diff --git a/Mathlib/Data/Sigma/Interval.lean b/Mathlib/Data/Sigma/Interval.lean index e3ecfb12cbfb1e..5fd7ac23f009ab 100644 --- a/Mathlib/Data/Sigma/Interval.lean +++ b/Mathlib/Data/Sigma/Interval.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Sigma.Order -import Mathlib.Order.Interval.Finset.Defs +module + +public import Mathlib.Data.Sigma.Order +public import Mathlib.Order.Interval.Finset.Defs /-! # Finite intervals in a sigma type @@ -17,6 +19,8 @@ calculates the cardinality of its finite intervals. Do the same for the lexicographical order -/ +@[expose] public section + open Finset Function diff --git a/Mathlib/Data/Sigma/Lex.lean b/Mathlib/Data/Sigma/Lex.lean index 59e56218a2481e..5bd89740070403 100644 --- a/Mathlib/Data/Sigma/Lex.lean +++ b/Mathlib/Data/Sigma/Lex.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Logic.Function.Defs -import Mathlib.Order.Defs.Unbundled -import Batteries.Logic +module + +public import Mathlib.Logic.Function.Defs +public import Mathlib.Order.Defs.Unbundled +public import Batteries.Logic /-! # Lexicographic order on a sigma type @@ -28,6 +30,8 @@ Related files are: `Sigma.Lex` where all summands are the same -/ +@[expose] public section + namespace Sigma diff --git a/Mathlib/Data/Sigma/Order.lean b/Mathlib/Data/Sigma/Order.lean index 60e452e81746a3..536a15a21638fd 100644 --- a/Mathlib/Data/Sigma/Order.lean +++ b/Mathlib/Data/Sigma/Order.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Sigma.Lex -import Mathlib.Util.Notation3 -import Mathlib.Data.Sigma.Basic -import Mathlib.Order.Lattice -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Data.Sigma.Lex +public import Mathlib.Util.Notation3 +public import Mathlib.Data.Sigma.Basic +public import Mathlib.Order.Lattice +public import Mathlib.Order.BoundedOrder.Basic /-! # Orders on a sigma type @@ -41,6 +43,8 @@ Upgrade `Equiv.sigma_congr_left`, `Equiv.sigma_congr`, `Equiv.sigma_assoc`, `Equiv.sigma_prod_of_equiv`, `Equiv.sigma_equiv_prod`, ... to order isomorphisms. -/ +@[expose] public section + namespace Sigma diff --git a/Mathlib/Data/Sign.lean b/Mathlib/Data/Sign.lean index 6c4497f730b99a..e0980864402686 100644 --- a/Mathlib/Data/Sign.lean +++ b/Mathlib/Data/Sign.lean @@ -3,6 +3,8 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Data.Sign.Defs +module + +public import Mathlib.Data.Sign.Defs deprecated_module (since := "2025-05-11") diff --git a/Mathlib/Data/Sign/Basic.lean b/Mathlib/Data/Sign/Basic.lean index c5cedec1aa7f8c..ecf95c807bab21 100644 --- a/Mathlib/Data/Sign/Basic.lean +++ b/Mathlib/Data/Sign/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Algebra.GroupWithZero.Units.Lemmas -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Ring.Cast -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Sign.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Units.Lemmas +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Ring.Cast +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Sign.Defs /-! # Sign function @@ -16,6 +18,8 @@ This file defines the sign function for types with zero and a decidable less-tha proves some basic theorems about it. -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/Data/Sign/Defs.lean b/Mathlib/Data/Sign/Defs.lean index 364b4daec8c6bd..a4ebdb9886ed43 100644 --- a/Mathlib/Data/Sign/Defs.lean +++ b/Mathlib/Data/Sign/Defs.lean @@ -3,10 +3,15 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.Algebra.Ring.Defs -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Tactic.DeriveFintype +module + +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Tactic.DeriveFintype +public import Mathlib.Data.Multiset.Defs +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Algebra.Group.Equiv.Defs /-! # Sign type @@ -14,6 +19,8 @@ import Mathlib.Tactic.DeriveFintype This file defines the type of signs $\{-1, 0, 1\}$ and its basic arithmetic instances. -/ +@[expose] public section + -- Don't generate unnecessary `sizeOf_spec` lemmas which the `simpNF` linter will complain about. set_option genSizeOfSpec false in /-- The type of signs. -/ @@ -97,7 +104,6 @@ private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_ : b ≤ c) : a ≤ c cases a <;> cases b <;> cases c <;> tauto instance : LinearOrder SignType where - le := (· ≤ ·) le_refl a := by cases a <;> constructor le_total a b := by cases a <;> cases b <;> first | left; constructor | right; constructor le_antisymm := le_antisymm diff --git a/Mathlib/Data/Stream/Defs.lean b/Mathlib/Data/Stream/Defs.lean index 1486283df5cbf1..a67b8f673d27fc 100644 --- a/Mathlib/Data/Stream/Defs.lean +++ b/Mathlib/Data/Stream/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Mathlib.Data.Nat.Notation +module + +public import Mathlib.Data.Nat.Notation /-! # Definition of `Stream'` and functions on streams @@ -13,6 +15,8 @@ infinite list. In this file we define `Stream'` and some functions that take and Note that we already have `Stream` to represent a similar object, hence the awkward naming. -/ +@[expose] public section + universe u v w variable {α : Type u} {β : Type v} {δ : Type w} diff --git a/Mathlib/Data/Stream/Init.lean b/Mathlib/Data/Stream/Init.lean index 835681b79557e8..89bd5c5bb99516 100644 --- a/Mathlib/Data/Stream/Init.lean +++ b/Mathlib/Data/Stream/Init.lean @@ -3,15 +3,19 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Mathlib.Data.Stream.Defs -import Mathlib.Logic.Function.Basic -import Mathlib.Data.Nat.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.Stream.Defs +public import Mathlib.Logic.Function.Basic +public import Mathlib.Data.Nat.Basic +public import Mathlib.Tactic.Common /-! # Streams a.k.a. infinite lists a.k.a. infinite sequences -/ +@[expose] public section + open Nat Function Option namespace Stream' diff --git a/Mathlib/Data/String/Basic.lean b/Mathlib/Data/String/Basic.lean index 504d6acb7340c7..3eb4781a33c239 100644 --- a/Mathlib/Data/String/Basic.lean +++ b/Mathlib/Data/String/Basic.lean @@ -3,10 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Batteries.Data.String.Lemmas -import Mathlib.Data.List.Lex -import Mathlib.Data.Char -import Mathlib.Algebra.Order.Group.Nat +module + +public import Batteries.Data.String.Lemmas +public import Mathlib.Data.List.Lex +public import Mathlib.Data.Char +public import Mathlib.Algebra.Order.Group.Nat +import all Init.Data.String.Iterator -- for unfolding `Iterator.curr` /-! # Strings @@ -14,10 +17,12 @@ import Mathlib.Algebra.Order.Group.Nat Supplementary theorems about the `String` type. -/ +@[expose] public section + namespace String /-- `<` on string iterators. This coincides with `<` on strings as lists. -/ -def ltb (s₁ s₂ : Iterator) : Bool := +def ltb (s₁ s₂ : Legacy.Iterator) : Bool := if s₂.hasNext then if s₁.hasNext then if s₁.curr = s₂.curr then @@ -28,7 +33,7 @@ def ltb (s₁ s₂ : Iterator) : Bool := /-- This overrides an instance in core Lean. -/ instance LT' : LT String := - ⟨fun s₁ s₂ ↦ ltb s₁.iter s₂.iter⟩ + ⟨fun s₁ s₂ ↦ ltb (String.Legacy.iter s₁) (String.Legacy.iter s₂)⟩ /-- This instance has a prime to avoid the name of the corresponding instance in core Lean. -/ instance decidableLT' : DecidableLT String := by @@ -36,15 +41,17 @@ instance decidableLT' : DecidableLT String := by infer_instance -- short-circuit type class inference /-- Induction on `String.ltb`. -/ -def ltb.inductionOn.{u} {motive : Iterator → Iterator → Sort u} (it₁ it₂ : Iterator) - (ind : ∀ s₁ s₂ i₁ i₂, Iterator.hasNext ⟨s₂, i₂⟩ → Iterator.hasNext ⟨s₁, i₁⟩ → - i₁.get s₁ = i₂.get s₂ → motive (Iterator.next ⟨s₁, i₁⟩) (Iterator.next ⟨s₂, i₂⟩) → - motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) - (eq : ∀ s₁ s₂ i₁ i₂, Iterator.hasNext ⟨s₂, i₂⟩ → Iterator.hasNext ⟨s₁, i₁⟩ → +@[no_expose] def ltb.inductionOn.{u} {motive : Legacy.Iterator → Legacy.Iterator → Sort u} + (it₁ it₂ : Legacy.Iterator) + (ind : ∀ s₁ s₂ i₁ i₂, Legacy.Iterator.hasNext ⟨s₂, i₂⟩ → Legacy.Iterator.hasNext ⟨s₁, i₁⟩ → + i₁.get s₁ = i₂.get s₂ → + motive (Legacy.Iterator.next ⟨s₁, i₁⟩) (Legacy.Iterator.next ⟨s₂, i₂⟩) → + motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) + (eq : ∀ s₁ s₂ i₁ i₂, Legacy.Iterator.hasNext ⟨s₂, i₂⟩ → Legacy.Iterator.hasNext ⟨s₁, i₁⟩ → ¬ i₁.get s₁ = i₂.get s₂ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) - (base₁ : ∀ s₁ s₂ i₁ i₂, Iterator.hasNext ⟨s₂, i₂⟩ → ¬ Iterator.hasNext ⟨s₁, i₁⟩ → + (base₁ : ∀ s₁ s₂ i₁ i₂, Legacy.Iterator.hasNext ⟨s₂, i₂⟩ → ¬ Legacy.Iterator.hasNext ⟨s₁, i₁⟩ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) - (base₂ : ∀ s₁ s₂ i₁ i₂, ¬ Iterator.hasNext ⟨s₂, i₂⟩ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) : + (base₂ : ∀ s₁ s₂ i₁ i₂, ¬ Legacy.Iterator.hasNext ⟨s₂, i₂⟩ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) : motive it₁ it₂ := if h₂ : it₂.hasNext then if h₁ : it₁.hasNext then @@ -54,26 +61,26 @@ def ltb.inductionOn.{u} {motive : Iterator → Iterator → Sort u} (it₁ it₂ else base₁ it₁.s it₂.s it₁.i it₂.i h₂ h₁ else base₂ it₁.s it₂.s it₁.i it₂.i h₂ -theorem ltb_cons_addChar' (c : Char) (s₁ s₂ : Iterator) : +theorem ltb_cons_addChar' (c : Char) (s₁ s₂ : Legacy.Iterator) : ltb ⟨ofList (c :: s₁.s.toList), s₁.i + c⟩ ⟨ofList (c :: s₂.s.toList), s₂.i + c⟩ = ltb s₁ s₂ := by fun_induction ltb s₁ s₂ with | case1 s₁ s₂ h₁ h₂ h ih => - rw [ltb, Iterator.hasNext_cons_addChar, Iterator.hasNext_cons_addChar, + rw [ltb, Legacy.Iterator.hasNext_cons_addChar, Legacy.Iterator.hasNext_cons_addChar, if_pos (by simpa using h₁), if_pos (by simpa using h₂), if_pos, ← ih] - · simp [Iterator.next, String.Pos.Raw.next, get_cons_addChar] + · simp [Legacy.Iterator.next, String.Pos.Raw.next, get_cons_addChar] congr 2 <;> apply Pos.Raw.add_char_right_comm - · simpa [Iterator.curr, get_cons_addChar] using h + · simpa [Legacy.Iterator.curr, get_cons_addChar] using h | case2 s₁ s₂ h₁ h₂ h => - rw [ltb, Iterator.hasNext_cons_addChar, Iterator.hasNext_cons_addChar, + rw [ltb, Legacy.Iterator.hasNext_cons_addChar, Legacy.Iterator.hasNext_cons_addChar, if_pos (by simpa using h₁), if_pos (by simpa using h₂), if_neg] - · simp [Iterator.curr, get_cons_addChar] - · simpa [Iterator.curr, get_cons_addChar] using h + · simp [Legacy.Iterator.curr, get_cons_addChar] + · simpa [Legacy.Iterator.curr, get_cons_addChar] using h | case3 s₁ s₂ h₁ h₂ => - rw [ltb, Iterator.hasNext_cons_addChar, Iterator.hasNext_cons_addChar, + rw [ltb, Legacy.Iterator.hasNext_cons_addChar, Legacy.Iterator.hasNext_cons_addChar, if_pos (by simpa using h₁), if_neg (by simpa using h₂)] | case4 s₁ s₂ h₁ => - rw [ltb, Iterator.hasNext_cons_addChar, if_neg (by simpa using h₁)] + rw [ltb, Legacy.Iterator.hasNext_cons_addChar, if_neg (by simpa using h₁)] theorem ltb_cons_addChar (c : Char) (cs₁ cs₂ : List Char) (i₁ i₂ : Pos.Raw) : ltb ⟨ofList (c :: cs₁), i₁ + c⟩ ⟨ofList (c :: cs₂), i₂ + c⟩ = @@ -91,16 +98,16 @@ theorem lt_iff_toList_lt : ∀ {s₁ s₂ : String}, s₁ < s₂ ↔ s₁.toList · unfold ltb; decide · rename_i c₂ cs₂; apply iff_of_true · unfold ltb - simp [Iterator.hasNext, Char.utf8Size_pos] + simp [Legacy.Iterator.hasNext, Char.utf8Size_pos] · apply List.nil_lt_cons · rename_i c₁ cs₁ ih; apply iff_of_false · unfold ltb - simp [Iterator.hasNext] + simp [Legacy.Iterator.hasNext] · apply not_lt_of_gt; apply List.nil_lt_cons · rename_i c₁ cs₁ ih c₂ cs₂; unfold ltb - simp only [Iterator.hasNext, Pos.Raw.byteIdx_zero, rawEndPos_ofList, utf8Len_cons, - add_pos_iff, Char.utf8Size_pos, or_true, decide_true, ↓reduceIte, Iterator.curr, - Pos.Raw.get, String.toList_ofList, Pos.Raw.utf8GetAux, Iterator.next, Pos.Raw.next, + simp only [Legacy.Iterator.hasNext, Pos.Raw.byteIdx_zero, rawEndPos_ofList, utf8Len_cons, + add_pos_iff, Char.utf8Size_pos, or_true, decide_true, ↓reduceIte, Legacy.Iterator.curr, + Pos.Raw.get, String.toList_ofList, Pos.Raw.utf8GetAux, Legacy.Iterator.next, Pos.Raw.next, Bool.ite_eq_true_distrib, decide_eq_true_eq] split_ifs with h · subst c₂ @@ -133,13 +140,13 @@ theorem asString_nil : ofList [] = "" := theorem asString_toList (s : String) : ofList s.toList = s := ofList_toList -theorem toList_nonempty : ∀ {s : String}, s ≠ "" → s.toList = s.head :: (s.drop 1).toList +theorem toList_nonempty : + ∀ {s : String}, s ≠ "" → s.toList = s.head :: (String.Legacy.drop s 1).toList | s, h => by obtain ⟨l, rfl⟩ := s.exists_eq_ofList match l with | [] => simp at h - | c::cs => simp [head, mkIterator, Iterator.curr, Pos.Raw.get, - Pos.Raw.utf8GetAux] + | c::cs => simp [head, front, Pos.Raw.get, Pos.Raw.utf8GetAux] @[simp] theorem head_empty : "".toList.head! = default := diff --git a/Mathlib/Data/String/Defs.lean b/Mathlib/Data/String/Defs.lean index a9f221d19048f8..687a9aa3b646ea 100644 --- a/Mathlib/Data/String/Defs.lean +++ b/Mathlib/Data/String/Defs.lean @@ -3,14 +3,17 @@ Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Keeley Hoek, Floris van Doorn, Chris Bailey -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Definitions for `String` This file defines a bunch of functions for the `String` datatype. -/ +@[expose] public section + namespace String /-- Pad `s : String` with repeated occurrences of `c : Char` until it's of length `n`. @@ -45,6 +48,6 @@ def mapTokens (c : Char) (f : String → String) : String → String := /-- Produce the head character from the string `s`, if `s` is not empty, otherwise `'A'`. -/ def head (s : String) : Char := - s.iter.curr + s.front end String diff --git a/Mathlib/Data/String/Lemmas.lean b/Mathlib/Data/String/Lemmas.lean index 5e54ff9db9ddc8..60ba0b00f36b39 100644 --- a/Mathlib/Data/String/Lemmas.lean +++ b/Mathlib/Data/String/Lemmas.lean @@ -3,15 +3,19 @@ Copyright (c) 2021 Chris Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Bailey -/ -import Mathlib.Data.Nat.Notation -import Mathlib.Data.String.Defs -import Mathlib.Tactic.Basic -import Batteries.Tactic.Alias +module + +public import Mathlib.Data.Nat.Notation +public import Mathlib.Data.String.Defs +public import Mathlib.Tactic.Basic +public import Batteries.Tactic.Alias /-! # Miscellaneous lemmas about strings -/ +@[expose] public section + namespace String lemma congr_append (a b : String) : a ++ b = String.ofList (a.toList ++ b.toList) := by simp diff --git a/Mathlib/Data/Subtype.lean b/Mathlib/Data/Subtype.lean index b29d5da0c18c62..bf107bd6190fc0 100644 --- a/Mathlib/Data/Subtype.lean +++ b/Mathlib/Data/Subtype.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Function.Basic -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.Simps.Basic +module + +public import Mathlib.Logic.Function.Basic +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.Simps.Basic /-! # Subtypes @@ -22,6 +24,8 @@ such, subtypes can be thought of as bundled sets, the difference being that elem still of type `α` while elements of a subtype aren't. -/ +@[expose] public section + open Function diff --git a/Mathlib/Data/Sum/Basic.lean b/Mathlib/Data/Sum/Basic.lean index b97603f21724b1..0f66aea251ee89 100644 --- a/Mathlib/Data/Sum/Basic.lean +++ b/Mathlib/Data/Sum/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yury Kudryashov -/ -import Mathlib.Logic.Function.Basic -import Mathlib.Tactic.MkIffOfInductiveProp +module + +public import Mathlib.Logic.Function.Basic +public import Mathlib.Tactic.MkIffOfInductiveProp /-! # Additional lemmas about sum types @@ -12,6 +14,8 @@ import Mathlib.Tactic.MkIffOfInductiveProp Most of the former contents of this file have been moved to Batteries. -/ +@[expose] public section + universe u v w x diff --git a/Mathlib/Data/Sum/Interval.lean b/Mathlib/Data/Sum/Interval.lean index 6d3bbf6656d12b..15357ec8e5a117 100644 --- a/Mathlib/Data/Sum/Interval.lean +++ b/Mathlib/Data/Sum/Interval.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Sum -import Mathlib.Data.Sum.Order -import Mathlib.Order.Interval.Finset.Defs +module + +public import Mathlib.Data.Finset.Sum +public import Mathlib.Data.Sum.Order +public import Mathlib.Order.Interval.Finset.Defs /-! # Finite intervals in a disjoint union @@ -14,6 +16,8 @@ This file provides the `LocallyFiniteOrder` instance for the disjoint sum and li orders and calculates the cardinality of their finite intervals. -/ +@[expose] public section + open Function Sum diff --git a/Mathlib/Data/Sum/Lattice.lean b/Mathlib/Data/Sum/Lattice.lean index 22dad4e7526c99..a77ae52e745223 100644 --- a/Mathlib/Data/Sum/Lattice.lean +++ b/Mathlib/Data/Sum/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Sum.Order -import Mathlib.Order.Hom.Lattice +module + +public import Mathlib.Data.Sum.Order +public import Mathlib.Order.Hom.Lattice /-! # Lexicographic sum of lattices @@ -13,6 +15,8 @@ This file proves that we can combine two lattices `α` and `β` into a lattice ` everything in `α` is declared smaller than everything in `β`. -/ +@[expose] public section + open OrderDual namespace Sum.Lex diff --git a/Mathlib/Data/Sum/Order.lean b/Mathlib/Data/Sum/Order.lean index e7c395368510ba..97959964a3dfc1 100644 --- a/Mathlib/Data/Sum/Order.lean +++ b/Mathlib/Data/Sum/Order.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Heyting.Basic -import Mathlib.Order.Hom.Basic -import Mathlib.Order.WithBot +module + +public import Mathlib.Order.Heyting.Basic +public import Mathlib.Order.Hom.Basic +public import Mathlib.Order.WithBot /-! # Orders on a sum type @@ -26,6 +28,8 @@ type synonym. * `α ⊕ₗ β`: The linear sum of `α` and `β`. -/ +@[expose] public section + variable {α β γ : Type*} diff --git a/Mathlib/Data/Sym/Basic.lean b/Mathlib/Data/Sym/Basic.lean index c33645ed0b37d3..f3dd2680d94fd5 100644 --- a/Mathlib/Data/Sym/Basic.lean +++ b/Mathlib/Data/Sym/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.Order.Group.Multiset -import Mathlib.Data.Setoid.Basic -import Mathlib.Data.Vector.Basic -import Mathlib.Logic.Nontrivial.Basic -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Algebra.Order.Group.Multiset +public import Mathlib.Data.Setoid.Basic +public import Mathlib.Data.Vector.Basic +public import Mathlib.Logic.Nontrivial.Basic +public import Mathlib.Tactic.ApplyFun /-! # Symmetric powers @@ -28,6 +30,8 @@ symmetric powers -/ +@[expose] public section + assert_not_exists MonoidWithZero open List (Vector) open Function @@ -477,7 +481,7 @@ def oneEquiv : α ≃ Sym α 1 where (fun l ↦ l.1.head <| List.length_pos_iff.mp <| by simp) fun ⟨_, _⟩ ⟨_, h⟩ ↦ fun perm ↦ by obtain ⟨a, rfl⟩ := List.length_eq_one_iff.mp h - exact List.eq_of_mem_singleton (perm.mem_iff.mp <| List.head_mem _) + exact List.eq_of_mem_singleton (List.Perm.mem_iff perm |>.mp <| List.head_mem _) right_inv := by rintro ⟨⟨l⟩, h⟩; obtain ⟨a, rfl⟩ := List.length_eq_one_iff.mp h; rfl /-- Fill a term `m : Sym α (n - i)` with `i` copies of `a` to obtain a term of `Sym α n`. diff --git a/Mathlib/Data/Sym/Card.lean b/Mathlib/Data/Sym/Card.lean index 983e299b3eb549..4f4113a2a5c6bb 100644 --- a/Mathlib/Data/Sym/Card.lean +++ b/Mathlib/Data/Sym/Card.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta, Huỳnh Trần Khanh, Stuart Presnell -/ -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Fintype.Sum -import Mathlib.Data.Fintype.Prod -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Fintype.Sum +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Stars and bars @@ -51,6 +53,8 @@ while the "stars and bars" technique gives stars and bars, multichoose -/ +@[expose] public section + open Finset Fintype Function Sum Nat diff --git a/Mathlib/Data/Sym/Sym2.lean b/Mathlib/Data/Sym/Sym2.lean index 699d4b9bd732a7..4366fa64005cc4 100644 --- a/Mathlib/Data/Sym/Sym2.lean +++ b/Mathlib/Data/Sym/Sym2.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Data.Finset.Prod -import Mathlib.Data.SetLike.Basic -import Mathlib.Data.Sym.Basic -import Mathlib.Data.Sym.Sym2.Init +module + +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Data.Finset.Prod +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Data.Sym.Basic +public import Mathlib.Data.Sym.Sym2.Init /-! # The symmetric square @@ -43,6 +45,8 @@ The element `Sym2.mk (a, b)` can be written as `s(a, b)` for short. symmetric square, unordered pairs, symmetric powers -/ +@[expose] public section + assert_not_exists MonoidWithZero open List (Vector) diff --git a/Mathlib/Data/Sym/Sym2/Finsupp.lean b/Mathlib/Data/Sym/Sym2/Finsupp.lean index afde5e76367b82..16fcd010fa5d33 100644 --- a/Mathlib/Data/Sym/Sym2/Finsupp.lean +++ b/Mathlib/Data/Sym/Sym2/Finsupp.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Data.Finset.Sym -import Mathlib.Data.Finsupp.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Finsupp.Defs /-! # Finitely supported functions from the symmetric square @@ -13,6 +15,8 @@ import Mathlib.Data.Finsupp.Defs This file lifts functions `α →₀ M₀` to functions `Sym2 α →₀ M₀` by precomposing with multiplication. -/ +@[expose] public section + open Sym2 variable {α M₀ : Type*} [CommMonoidWithZero M₀] {f : α →₀ M₀} diff --git a/Mathlib/Data/Sym/Sym2/Init.lean b/Mathlib/Data/Sym/Sym2/Init.lean index 9c7fdd617d0177..6f12ec2fd2b731 100644 --- a/Mathlib/Data/Sym/Sym2/Init.lean +++ b/Mathlib/Data/Sym/Sym2/Init.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ +module -import Mathlib.Init -import Aesop +public import Mathlib.Init +public import Aesop /-! # Sym2 Rule Set @@ -15,4 +16,6 @@ visible once the file in which they're declared is imported, so we must put this declaration into its own file. -/ +@[expose] public section + declare_aesop_rule_sets [Sym2] diff --git a/Mathlib/Data/Sym/Sym2/Order.lean b/Mathlib/Data/Sym/Sym2/Order.lean index 87f390352c1136..3df497c8e92599 100644 --- a/Mathlib/Data/Sym/Sym2/Order.lean +++ b/Mathlib/Data/Sym/Sym2/Order.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Sym.Sym2 -import Mathlib.Order.Lattice +module + +public import Mathlib.Data.Sym.Sym2 +public import Mathlib.Order.Lattice /-! # Sorting the elements of `Sym2` @@ -13,6 +15,8 @@ This file provides `Sym2.sortEquiv`, the forward direction of which is somewhat `Multiset.sort`. -/ +@[expose] public section + namespace Sym2 variable {α} diff --git a/Mathlib/Data/Tree/Basic.lean b/Mathlib/Data/Tree/Basic.lean index 5e4c82b5535552..215a3cbf8909aa 100644 --- a/Mathlib/Data/Tree/Basic.lean +++ b/Mathlib/Data/Tree/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 mathlib community. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Wojciech Nawrocki -/ -import Mathlib.Data.Nat.Notation -import Mathlib.Tactic.TypeStar -import Mathlib.Util.CompileInductive +module + +public import Mathlib.Data.Nat.Notation +public import Mathlib.Tactic.TypeStar +public import Mathlib.Util.CompileInductive /-! # Binary tree @@ -23,6 +25,8 @@ additional data. We provide the notation `a △ b` for making a `Tree Unit` with -/ +@[expose] public section + /-- A binary tree with values stored in non-leaf nodes. -/ inductive Tree.{u} (α : Type u) : Type u diff --git a/Mathlib/Data/Tree/Get.lean b/Mathlib/Data/Tree/Get.lean index b374b675b07ba0..c18cc3823ff6b2 100644 --- a/Mathlib/Data/Tree/Get.lean +++ b/Mathlib/Data/Tree/Get.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 mathlib community. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Wojciech Nawrocki -/ -import Mathlib.Data.Num.Basic -import Mathlib.Data.Ordering.Basic -import Mathlib.Data.Tree.Basic +module + +public import Mathlib.Data.Num.Basic +public import Mathlib.Data.Ordering.Basic +public import Mathlib.Data.Tree.Basic /-! # Binary tree get operation @@ -18,6 +20,8 @@ These definitions were moved from the main file to avoid a dependency on `Num`. -/ +@[expose] public section + namespace Tree variable {α : Type*} diff --git a/Mathlib/Data/Tree/RBMap.lean b/Mathlib/Data/Tree/RBMap.lean index bfb58c14d02784..7ff4825f854608 100644 --- a/Mathlib/Data/Tree/RBMap.lean +++ b/Mathlib/Data/Tree/RBMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 mathlib community. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Wojciech Nawrocki -/ -import Batteries.Data.RBMap.Basic -import Mathlib.Data.Tree.Basic +module + +public import Batteries.Data.RBMap.Basic +public import Mathlib.Data.Tree.Basic /-! # Binary tree and RBMaps @@ -21,6 +23,8 @@ Implement a `Traversable` instance for `Tree`. -/ +@[expose] public section + namespace Tree universe u diff --git a/Mathlib/Data/Tree/Traversable.lean b/Mathlib/Data/Tree/Traversable.lean index a0e5a9a179d227..e65ea8ac2ebbac 100644 --- a/Mathlib/Data/Tree/Traversable.lean +++ b/Mathlib/Data/Tree/Traversable.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Edward van de Meent. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Edward van de Meent -/ +module -import Mathlib.Data.Tree.Basic -import Mathlib.Control.Applicative -import Mathlib.Control.Traversable.Basic +public import Mathlib.Data.Tree.Basic +public import Mathlib.Control.Applicative +public import Mathlib.Control.Traversable.Basic /-! # Traversable Binary Tree @@ -14,6 +15,8 @@ import Mathlib.Control.Traversable.Basic Provides a `Traversable` instance for the `Tree` type. -/ +@[expose] public section + universe u v w namespace Tree diff --git a/Mathlib/Data/TwoPointing.lean b/Mathlib/Data/TwoPointing.lean index 12de92fb04f475..53a3240d04a9f9 100644 --- a/Mathlib/Data/TwoPointing.lean +++ b/Mathlib/Data/TwoPointing.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Logic.Nonempty -import Mathlib.Tactic.Simps.Basic -import Batteries.Logic +module + +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Logic.Nonempty +public import Mathlib.Tactic.Simps.Basic +public import Batteries.Logic /-! # Two-pointings @@ -24,6 +26,8 @@ bipointed types. Two-pointed types form a full subcategory of those. (https://ncatlab.org/nlab/show/coalgebra+of+the+real+interval) -/ +@[expose] public section + open Function variable {α β : Type*} diff --git a/Mathlib/Data/TypeVec.lean b/Mathlib/Data/TypeVec.lean index 1325dbcd8d8db7..90d6ac2bf60994 100644 --- a/Mathlib/Data/TypeVec.lean +++ b/Mathlib/Data/TypeVec.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro, Simon Hudon -/ -import Mathlib.Data.Fin.Fin2 -import Mathlib.Logic.Function.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.Fin.Fin2 +public import Mathlib.Logic.Function.Basic +public import Mathlib.Tactic.Common /-! @@ -30,6 +32,8 @@ Since e.g. `append1 α.drop α.last` is propositionally equal to `α` but not de to it, we need support functions and lemmas to mediate between constructions. -/ +@[expose] public section + universe u v w x /-- n-tuples of types, as a category -/ diff --git a/Mathlib/Data/UInt.lean b/Mathlib/Data/UInt.lean index 1fdf19aaa1031f..38e41f43f71c80 100644 --- a/Mathlib/Data/UInt.lean +++ b/Mathlib/Data/UInt.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Init -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Data.ZMod.Defs -import Mathlib.Data.BitVec +module + +public import Mathlib.Init +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Data.ZMod.Defs +public import Mathlib.Data.BitVec /-! @@ -24,6 +26,8 @@ version also interferes more with software-verification use-cases, which is reas cautious here. -/ +@[expose] public section + -- these theorems are fragile, so do them first set_option hygiene false in run_cmd @@ -102,7 +106,8 @@ run_cmd toBitVec_zero toBitVec_one toBitVec_add toBitVec_mul toBitVec_neg toBitVec_sub toBitVec_nsmul toBitVec_zsmul toBitVec_pow toBitVec_natCast toBitVec_intCast) in - local instance instCommRing : CommRing $typeName := + -- `noncomputable` should not be necessary but triggers some codegen assertion + noncomputable local instance instCommRing : CommRing $typeName := Function.Injective.commRing toBitVec toBitVec_injective toBitVec_zero toBitVec_one (fun _ _ => toBitVec_add) (fun _ _ => toBitVec_mul) (fun _ => toBitVec_neg) (fun _ _ => toBitVec_sub) diff --git a/Mathlib/Data/ULift.lean b/Mathlib/Data/ULift.lean index 91d3fd0af7b893..07e05d4e947707 100644 --- a/Mathlib/Data/ULift.lean +++ b/Mathlib/Data/ULift.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Control.ULift -import Mathlib.Logic.Equiv.Basic +module + +public import Mathlib.Control.ULift +public import Mathlib.Logic.Equiv.Basic /-! # Extra lemmas about `ULift` and `PLift` @@ -14,6 +16,8 @@ In this file we provide `Subsingleton`, `Unique`, `DecidableEq`, and `isEmpty` i `PLift.exists`. -/ +@[expose] public section + universe u v u' v' open Function diff --git a/Mathlib/Data/Vector/Basic.lean b/Mathlib/Data/Vector/Basic.lean index 2f1471421e619c..57e9d503fd6d58 100644 --- a/Mathlib/Data/Vector/Basic.lean +++ b/Mathlib/Data/Vector/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Vector.Defs -import Mathlib.Data.List.Nodup -import Mathlib.Data.List.OfFn -import Mathlib.Control.Applicative -import Mathlib.Control.Traversable.Basic -import Mathlib.Algebra.BigOperators.Group.List.Basic +module + +public import Mathlib.Data.Vector.Defs +public import Mathlib.Data.List.Nodup +public import Mathlib.Data.List.OfFn +public import Mathlib.Control.Applicative +public import Mathlib.Control.Traversable.Basic +public import Mathlib.Algebra.BigOperators.Group.List.Basic /-! # Additional theorems and definitions about the `Vector` type @@ -16,6 +18,8 @@ import Mathlib.Algebra.BigOperators.Group.List.Basic This file introduces the infix notation `::ᵥ` for `Vector.cons`. -/ +@[expose] public section + universe u variable {α β γ σ φ : Type*} {m n : ℕ} @@ -637,7 +641,7 @@ private def traverseAux {α β : Type u} (f : α → F β) : ∀ x : List α, F | x :: xs => Vector.cons <$> f x <*> traverseAux f xs /-- Apply an applicative function to each component of a vector. -/ -protected def traverse {α β : Type u} (f : α → F β) : Vector α n → F (Vector β n) +@[no_expose] protected def traverse {α β : Type u} (f : α → F β) : Vector α n → F (Vector β n) | ⟨v, Hv⟩ => cast (by rw [Hv]) <| traverseAux f v section diff --git a/Mathlib/Data/Vector/Defs.lean b/Mathlib/Data/Vector/Defs.lean index 9d6fba595b1fd3..de80185024512a 100644 --- a/Mathlib/Data/Vector/Defs.lean +++ b/Mathlib/Data/Vector/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Mathlib.Data.List.Defs -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.List.Defs +public import Mathlib.Tactic.Common /-! The type `List.Vector` represents lists with fixed length. @@ -15,6 +17,8 @@ Any combination of reducing the use of `List.Vector` in Mathlib, or modernising would be welcome. -/ +@[expose] public section + assert_not_exists Monoid universe u v w diff --git a/Mathlib/Data/Vector/MapLemmas.lean b/Mathlib/Data/Vector/MapLemmas.lean index 4653423e774d84..095f6dcc981a9e 100644 --- a/Mathlib/Data/Vector/MapLemmas.lean +++ b/Mathlib/Data/Vector/MapLemmas.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Alex Keizer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Keizer -/ -import Mathlib.Data.Vector.Basic -import Mathlib.Data.Vector.Snoc +module + +public import Mathlib.Data.Vector.Basic +public import Mathlib.Data.Vector.Snoc /-! This file establishes a set of normalization lemmas for `map`/`mapAccumr` operations on vectors -/ +@[expose] public section + variable {α β γ ζ σ σ₁ σ₂ φ : Type*} {n : ℕ} {s : σ} {s₁ : σ₁} {s₂ : σ₂} namespace List diff --git a/Mathlib/Data/Vector/Mem.lean b/Mathlib/Data/Vector/Mem.lean index d234e65a60df2b..536c08c72e1fef 100644 --- a/Mathlib/Data/Vector/Mem.lean +++ b/Mathlib/Data/Vector/Mem.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma -/ -import Mathlib.Data.Vector.Basic +module + +public import Mathlib.Data.Vector.Basic /-! # Theorems about membership of elements in vectors @@ -15,6 +17,8 @@ In particular we can avoid some assumptions about types being `Inhabited`, and make more general statements about `head` and `tail`. -/ +@[expose] public section + namespace List namespace Vector diff --git a/Mathlib/Data/Vector/Snoc.lean b/Mathlib/Data/Vector/Snoc.lean index 602e63ef04f539..22014d34bad5d4 100644 --- a/Mathlib/Data/Vector/Snoc.lean +++ b/Mathlib/Data/Vector/Snoc.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Alex Keizer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Keizer -/ -import Mathlib.Data.Vector.Basic +module + +public import Mathlib.Data.Vector.Basic /-! This file establishes a `snoc : Vector α n → α → Vector α (n+1)` operation, that appends a single @@ -16,6 +18,8 @@ import Mathlib.Data.Vector.Basic `snoc xs x` for its inductive case. Effectively doing induction from right-to-left -/ +@[expose] public section + namespace List namespace Vector diff --git a/Mathlib/Data/Vector/Zip.lean b/Mathlib/Data/Vector/Zip.lean index 9df0f622a85043..23afb51c70b30a 100644 --- a/Mathlib/Data/Vector/Zip.lean +++ b/Mathlib/Data/Vector/Zip.lean @@ -3,12 +3,16 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Vector.Basic +module + +public import Mathlib.Data.Vector.Basic /-! # The `zipWith` operation on vectors. -/ +@[expose] public section + namespace List namespace Vector diff --git a/Mathlib/Data/Vector3.lean b/Mathlib/Data/Vector3.lean index 1c24af3cd34080..b5dead48c71bca 100644 --- a/Mathlib/Data/Vector3.lean +++ b/Mathlib/Data/Vector3.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fin.Fin2 -import Mathlib.Util.Notation3 -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Data.Fin.Fin2 +public import Mathlib.Util.Notation3 +public import Mathlib.Tactic.TypeStar /-! # Alternate definition of `Vector` in terms of `Fin2` @@ -16,6 +18,8 @@ instead of a `List`. The `::` notation is also overloaded by this file to mean `Vector3.cons`. -/ +@[expose] public section + open Fin2 Nat universe u @@ -50,12 +54,12 @@ scoped macro_rules | `([$l,*]) => `(expand_foldr% (h t => cons h t) nil [$(.ofEl -- this is copied from `src/Init/NotationExtra.lean` /-- Unexpander for `Vector3.nil` -/ -@[app_unexpander Vector3.nil] def unexpandNil : Lean.PrettyPrinter.Unexpander +@[app_unexpander Vector3.nil] meta def unexpandNil : Lean.PrettyPrinter.Unexpander | `($(_)) => `([]) -- this is copied from `src/Init/NotationExtra.lean` /-- Unexpander for `Vector3.cons` -/ -@[app_unexpander Vector3.cons] def unexpandCons : Lean.PrettyPrinter.Unexpander +@[app_unexpander Vector3.cons] meta def unexpandCons : Lean.PrettyPrinter.Unexpander | `($(_) $x []) => `([$x]) | `($(_) $x [$xs,*]) => `([$x, $xs,*]) | _ => throw () diff --git a/Mathlib/Data/W/Basic.lean b/Mathlib/Data/W/Basic.lean index 6016950b8d0a81..3e6d8c87172cf3 100644 --- a/Mathlib/Data/W/Basic.lean +++ b/Mathlib/Data/W/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Logic.Encodable.Pi +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Logic.Encodable.Pi /-! # W types @@ -26,6 +28,8 @@ While the name `WType` is somewhat verbose, it is preferable to putting a single identifier `W` in the root namespace. -/ +@[expose] public section + -- For "W_type" /-- diff --git a/Mathlib/Data/W/Cardinal.lean b/Mathlib/Data/W/Cardinal.lean index 3d8e317cda530c..1fb3c46343a478 100644 --- a/Mathlib/Data/W/Cardinal.lean +++ b/Mathlib/Data/W/Cardinal.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.W.Basic -import Mathlib.SetTheory.Cardinal.Arithmetic +module + +public import Mathlib.Data.W.Basic +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! # Cardinality of W-types @@ -22,6 +24,8 @@ this surjection can be used to put an upper bound on the cardinality of `MvPolyn W, W type, cardinal, first order -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/W/Constructions.lean b/Mathlib/Data/W/Constructions.lean index 940f86a200b28e..8dc05293a2f845 100644 --- a/Mathlib/Data/W/Constructions.lean +++ b/Mathlib/Data/W/Constructions.lean @@ -3,7 +3,9 @@ Copyright (c) 2015 Joseph Hua. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Hua -/ -import Mathlib.Data.W.Basic +module + +public import Mathlib.Data.W.Basic /-! # Examples of W-types @@ -19,6 +21,8 @@ This file contains `Nat` and `List` as examples of W types. * `WType.equivList`: the construction of lists on a type `γ` as a W-type is equivalent to `List γ` -/ +@[expose] public section + universe u v diff --git a/Mathlib/Data/WSeq/Basic.lean b/Mathlib/Data/WSeq/Basic.lean index 7f0e2c259fb0e4..e60c64de05c5a4 100644 --- a/Mathlib/Data/WSeq/Basic.lean +++ b/Mathlib/Data/WSeq/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Seq.Basic -import Mathlib.Util.CompileInductive +module + +public import Mathlib.Data.Seq.Basic +public import Mathlib.Util.CompileInductive /-! # Partially defined possibly infinite lists @@ -13,6 +15,8 @@ This file provides a `WSeq α` type representing partially defined possibly infi (referred here as weak sequences). -/ +@[expose] public section + namespace Stream' open Function diff --git a/Mathlib/Data/WSeq/Defs.lean b/Mathlib/Data/WSeq/Defs.lean index d5734483326203..ad1172a9f4ad46 100644 --- a/Mathlib/Data/WSeq/Defs.lean +++ b/Mathlib/Data/WSeq/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Batteries.Data.DList.Basic -import Mathlib.Data.WSeq.Basic +module + +public import Batteries.Data.DList.Basic +public import Mathlib.Data.WSeq.Basic /-! # Miscellaneous definitions concerning weak sequences @@ -13,6 +15,8 @@ These definitions, as well as those in `Mathlib/Data/WSeq/Productive.lean`, are development of `Mathlib/Data/Seq/Parallel.lean`. -/ +@[expose] public section + universe u v w namespace Stream'.WSeq diff --git a/Mathlib/Data/WSeq/Productive.lean b/Mathlib/Data/WSeq/Productive.lean index 99994301ae7882..a241eb999cc8d2 100644 --- a/Mathlib/Data/WSeq/Productive.lean +++ b/Mathlib/Data/WSeq/Productive.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.WSeq.Relation +module + +public import Mathlib.Data.WSeq.Relation /-! # Productive weak sequences @@ -13,6 +15,8 @@ output always comes after a finite time. Given a productive weak sequence, a reg (`Seq`) can be derived from it using `toSeq`. -/ +@[expose] public section + universe u namespace Stream'.WSeq diff --git a/Mathlib/Data/WSeq/Relation.lean b/Mathlib/Data/WSeq/Relation.lean index d2b59e190fddac..c7d1b92c73d863 100644 --- a/Mathlib/Data/WSeq/Relation.lean +++ b/Mathlib/Data/WSeq/Relation.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.WSeq.Basic -import Mathlib.Logic.Relation +module + +public import Mathlib.Data.WSeq.Basic +public import Mathlib.Logic.Relation /-! # Relations between and equivalence of weak sequences @@ -20,6 +22,8 @@ ignoring computation time (`none` elements). Equivalence is then defined in the * `Stream'.WSeq.Equiv`: Two sequences are equivalent if they are `LiftRel (· = ·)`-related. -/ +@[expose] public section + universe u v w namespace Stream'.WSeq diff --git a/Mathlib/Data/ZMod/Aut.lean b/Mathlib/Data/ZMod/Aut.lean index 13d5333aa183c4..e85a2bdee84e45 100644 --- a/Mathlib/Data/ZMod/Aut.lean +++ b/Mathlib/Data/ZMod/Aut.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Ring.AddAut -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Algebra.Ring.AddAut +public import Mathlib.Data.ZMod.Basic /-! # Automorphism Group of `ZMod`. -/ +@[expose] public section + assert_not_exists Field TwoSidedIdeal namespace ZMod diff --git a/Mathlib/Data/ZMod/Basic.lean b/Mathlib/Data/ZMod/Basic.lean index 96df6ad979e778..472883dfab0414 100644 --- a/Mathlib/Data/ZMod/Basic.lean +++ b/Mathlib/Data/ZMod/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.CharP.Basic -import Mathlib.Algebra.Ring.Prod -import Mathlib.Data.Fintype.Units -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Data.Fintype.Units +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.Tactic.FinCases /-! # Integers mod `n` @@ -29,6 +31,8 @@ Definition of the integers mod n, and the field structure on the integers mod p. -/ +@[expose] public section + assert_not_exists Field Submodule TwoSidedIdeal open Function ZMod diff --git a/Mathlib/Data/ZMod/Coprime.lean b/Mathlib/Data/ZMod/Coprime.lean index d9a80f8b0510d0..49bdd1986e65f5 100644 --- a/Mathlib/Data/ZMod/Coprime.lean +++ b/Mathlib/Data/ZMod/Coprime.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Data.Nat.Prime.Int -import Mathlib.Data.ZMod.Basic -import Mathlib.RingTheory.Int.Basic -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.Data.ZMod.Basic +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Coprimality and vanishing @@ -16,6 +18,8 @@ We show that for prime `p`, the image of an integer `a` in `ZMod p` vanishes if `a` and `p` are not coprime. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace ZMod diff --git a/Mathlib/Data/ZMod/Defs.lean b/Mathlib/Data/ZMod/Defs.lean index 6f16b97e6263d8..52966e15b97150 100644 --- a/Mathlib/Data/ZMod/Defs.lean +++ b/Mathlib/Data/ZMod/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.Algebra.NeZero -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Algebra.Ring.GrindInstances -import Mathlib.Data.Nat.ModEq -import Mathlib.Data.Fintype.EquivFin +module + +public import Mathlib.Algebra.Group.Fin.Basic +public import Mathlib.Algebra.NeZero +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Algebra.Ring.GrindInstances +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Fintype.EquivFin /-! # Definition of `ZMod n` + basic results. @@ -29,6 +31,8 @@ able to import some part of `ZMod`. -/ +@[expose] public section + namespace Fin diff --git a/Mathlib/Data/ZMod/Factorial.lean b/Mathlib/Data/ZMod/Factorial.lean index c33e5b8eaef1c9..3e8eac47019690 100644 --- a/Mathlib/Data/ZMod/Factorial.lean +++ b/Mathlib/Data/ZMod/Factorial.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Firsching -/ -import Mathlib.Data.Nat.Factorial.BigOperators -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Data.Nat.Factorial.BigOperators +public import Mathlib.Data.ZMod.Basic /-! # Facts about factorials in ZMod @@ -23,6 +25,8 @@ For the prime case and involving `factorial` rather than `descFactorial`, see Wi -/ +@[expose] public section + assert_not_exists TwoSidedIdeal open Finset Nat diff --git a/Mathlib/Data/ZMod/IntUnitsPower.lean b/Mathlib/Data/ZMod/IntUnitsPower.lean index c5750873ab34c9..a8d94e3c71afe9 100644 --- a/Mathlib/Data/ZMod/IntUnitsPower.lean +++ b/Mathlib/Data/ZMod/IntUnitsPower.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Data.Int.Order.Units -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Data.Int.Order.Units +public import Mathlib.Data.ZMod.Basic /-! # The power operator on `ℤˣ` by `ZMod 2`, `ℕ`, and `ℤ` @@ -23,6 +25,8 @@ by using `Module R (Additive M)` in its place, especially since this already has `R = ℕ` and `R = ℤ`. -/ +@[expose] public section + assert_not_exists Ideal TwoSidedIdeal instance : SMul (ZMod 2) (Additive ℤˣ) where diff --git a/Mathlib/Data/ZMod/QuotientGroup.lean b/Mathlib/Data/ZMod/QuotientGroup.lean index 467f29737a6057..64e1e37121b9a4 100644 --- a/Mathlib/Data/ZMod/QuotientGroup.lean +++ b/Mathlib/Data/ZMod/QuotientGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Data.ZMod.Basic /-! # `ZMod n` and quotient groups / rings @@ -22,6 +24,8 @@ This file relates `ZMod n` to the quotient group `ℤ / AddSubgroup.zmultiples ( zmod, quotient group -/ +@[expose] public section + assert_not_exists Ideal TwoSidedIdeal open QuotientAddGroup Set ZMod diff --git a/Mathlib/Data/ZMod/QuotientRing.lean b/Mathlib/Data/ZMod/QuotientRing.lean index 389002267aed42..2eb686cd4d3131 100644 --- a/Mathlib/Data/ZMod/QuotientRing.lean +++ b/Mathlib/Data/ZMod/QuotientRing.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Int.Basic -import Mathlib.RingTheory.ZMod -import Mathlib.Data.Nat.Factorization.Basic +module + +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.RingTheory.ZMod +public import Mathlib.Data.Nat.Factorization.Basic /-! # `ZMod n` and quotient groups / rings @@ -24,6 +26,8 @@ This file relates `ZMod n` to the quotient ring `ℤ ⧸ Ideal.span {(n : ℤ)}` zmod, quotient ring, ideal quotient -/ +@[expose] public section + open QuotientAddGroup Set ZMod variable (n : ℕ) {A R : Type*} [AddGroup A] [Ring R] diff --git a/Mathlib/Data/ZMod/Units.lean b/Mathlib/Data/ZMod/Units.lean index ec27df70389121..4e02151b4afdb3 100644 --- a/Mathlib/Data/ZMod/Units.lean +++ b/Mathlib/Data/ZMod/Units.lean @@ -3,14 +3,18 @@ Copyright (c) 2023 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Firsching, Ashvni Narayanan, Michael Stoll -/ -import Mathlib.Algebra.BigOperators.Associated -import Mathlib.Data.ZMod.Basic -import Mathlib.RingTheory.Coprime.Lemmas +module + +public import Mathlib.Algebra.BigOperators.Associated +public import Mathlib.Data.ZMod.Basic +public import Mathlib.RingTheory.Coprime.Lemmas /-! # Lemmas about units in `ZMod`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace ZMod diff --git a/Mathlib/Data/ZMod/ValMinAbs.lean b/Mathlib/Data/ZMod/ValMinAbs.lean index ccaa5936696fb6..95b9963a6e0dc0 100644 --- a/Mathlib/Data/ZMod/ValMinAbs.lean +++ b/Mathlib/Data/ZMod/ValMinAbs.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.ZMod.Basic -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Data.ZMod.Basic +public import Mathlib.Tactic.Linarith /-! # Absolute value in `ZMod n` -/ +@[expose] public section + namespace ZMod variable {n : ℕ} {a b : ZMod n} diff --git a/Mathlib/Deprecated/Aliases.lean b/Mathlib/Deprecated/Aliases.lean index 458f6a85b1f4aa..7bf9fca22e4162 100644 --- a/Mathlib/Deprecated/Aliases.lean +++ b/Mathlib/Deprecated/Aliases.lean @@ -3,9 +3,13 @@ Copyright (c) 2024 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! Deprecated aliases can be dumped here if they are no longer used in Mathlib, to avoid needing their imports if they are otherwise unnecessary. -/ + +@[expose] public section diff --git a/Mathlib/Deprecated/Estimator.lean b/Mathlib/Deprecated/Estimator.lean index 83a85fef8cc35a..357f14bc0a605f 100644 --- a/Mathlib/Deprecated/Estimator.lean +++ b/Mathlib/Deprecated/Estimator.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Set.Operations -import Mathlib.Order.Heyting.Basic -import Mathlib.Order.RelClasses -import Mathlib.Order.Hom.Basic -import Mathlib.Lean.Thunk +module + +public import Mathlib.Data.Set.Operations +public import Mathlib.Order.Heyting.Basic +public import Mathlib.Order.RelClasses +public import Mathlib.Order.Hom.Basic +public import Mathlib.Lean.Thunk /-! # Improvable lower bounds. @@ -34,6 +36,8 @@ An appropriate well-foundedness condition would then ensure that repeated improv the exact value. -/ +@[expose] public section + variable {α ε : Type*} /-- diff --git a/Mathlib/Deprecated/MLList/BestFirst.lean b/Mathlib/Deprecated/MLList/BestFirst.lean index b526c9bf677b5a..2e9a731cd79b74 100644 --- a/Mathlib/Deprecated/MLList/BestFirst.lean +++ b/Mathlib/Deprecated/MLList/BestFirst.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Batteries.Data.MLList.Basic -import Mathlib.Data.Prod.Lex -import Mathlib.Data.Set.Finite.Range -import Mathlib.Deprecated.Estimator +module + +public import Batteries.Data.MLList.Basic +public import Mathlib.Data.Prod.Lex +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Deprecated.Estimator /-! # Best first search @@ -31,6 +33,8 @@ Options: otherwise if the graph is not a tree nodes may be visited multiple times. -/ +@[expose] public section + open Batteries EstimatorData Estimator Set /-! diff --git a/Mathlib/Deprecated/Order.lean b/Mathlib/Deprecated/Order.lean index 5d54f3e5a4c9be..750f2578a38f5b 100644 --- a/Mathlib/Deprecated/Order.lean +++ b/Mathlib/Deprecated/Order.lean @@ -1,5 +1,7 @@ -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Order.RelClasses -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Order.RelClasses +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-09-02") diff --git a/Mathlib/Deprecated/RingHom.lean b/Mathlib/Deprecated/RingHom.lean index c4e182987b0e1b..b1c06252925c83 100644 --- a/Mathlib/Deprecated/RingHom.lean +++ b/Mathlib/Deprecated/RingHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Jireh Loreaux -/ -import Mathlib.Algebra.Divisibility.Hom -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Data.Set.Insert +module + +public import Mathlib.Algebra.Divisibility.Hom +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Data.Set.Insert /-! # Additional lemmas about homomorphisms of semirings and rings @@ -13,6 +15,8 @@ import Mathlib.Data.Set.Insert These lemmas were in `Mathlib/Algebra/Hom/Ring/Defs.lean` and have now been deprecated. -/ +@[expose] public section + assert_not_exists RelIso Field open Function diff --git a/Mathlib/Dynamics/BirkhoffSum/Average.lean b/Mathlib/Dynamics/BirkhoffSum/Average.lean index 474cf2cc84dc47..f528d12f308500 100644 --- a/Mathlib/Dynamics/BirkhoffSum/Average.lean +++ b/Mathlib/Dynamics/BirkhoffSum/Average.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Lua Viana Reis, Oliver Butterley -/ -import Mathlib.Dynamics.BirkhoffSum.Basic -import Mathlib.Algebra.Module.Basic +module + +public import Mathlib.Dynamics.BirkhoffSum.Basic +public import Mathlib.Algebra.Module.Basic /-! # Birkhoff average @@ -23,6 +25,8 @@ see `birkhoffAverage_congr_ring`. -/ +@[expose] public section + open Finset section birkhoffAverage diff --git a/Mathlib/Dynamics/BirkhoffSum/Basic.lean b/Mathlib/Dynamics/BirkhoffSum/Basic.lean index 5d5a1c5d366494..890301d4647b11 100644 --- a/Mathlib/Dynamics/BirkhoffSum/Basic.lean +++ b/Mathlib/Dynamics/BirkhoffSum/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Birkhoff sums @@ -17,6 +19,8 @@ saying that these averages converge to the "space average" `⨍ x, g x ∂μ` in See also `birkhoffAverage` defined in `Dynamics/BirkhoffSum/Average`. -/ +@[expose] public section + open Finset Function section AddCommMonoid diff --git a/Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean b/Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean index 0174add50aa2ed..a43ca5a3f29636 100644 --- a/Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean +++ b/Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Dynamics.BirkhoffSum.Average +module + +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Dynamics.BirkhoffSum.Average /-! # Birkhoff average in a normed space @@ -17,6 +19,8 @@ are motivated by the proof of the von Neumann Mean Ergodic Theorem, see `LinearIsometry.tendsto_birkhoffAverage_orthogonalProjection`. -/ +@[expose] public section + open Function Set Filter open scoped Topology ENNReal Uniformity diff --git a/Mathlib/Dynamics/BirkhoffSum/QuasiMeasurePreserving.lean b/Mathlib/Dynamics/BirkhoffSum/QuasiMeasurePreserving.lean index 925623f3ae2ec4..6987b3f9d56ce7 100644 --- a/Mathlib/Dynamics/BirkhoffSum/QuasiMeasurePreserving.lean +++ b/Mathlib/Dynamics/BirkhoffSum/QuasiMeasurePreserving.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Oliver Butterley. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Butterley, Lua Viana Reis -/ -import Mathlib.Dynamics.BirkhoffSum.Average -import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving +module + +public import Mathlib.Dynamics.BirkhoffSum.Average +public import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving /-! # Birkhoff sum and average for quasi-measure-preserving maps @@ -19,6 +21,8 @@ Given a map `f` and measure `μ`, under the assumption of `QuasiMeasurePreservin -/ +@[expose] public section + namespace MeasureTheory.Measure.QuasiMeasurePreserving open Filter diff --git a/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean b/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean index f1a603f27b4450..cfc5a9d7142ea5 100644 --- a/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean +++ b/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.Order.Iterate -import Mathlib.Order.SemiconjSup -import Mathlib.Topology.Order.MonotoneContinuity -import Mathlib.Algebra.CharP.Defs +module + +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.Order.Iterate +public import Mathlib.Order.SemiconjSup +public import Mathlib.Topology.Order.MonotoneContinuity +public import Mathlib.Algebra.CharP.Defs /-! # Translation number of a monotone real map that commutes with `x ↦ x + 1` @@ -115,6 +117,8 @@ Here are some short-term goals. circle homeomorphism, rotation number -/ +@[expose] public section + open Filter Set Int Topology open Function hiding Commute diff --git a/Mathlib/Dynamics/Ergodic/Action/Basic.lean b/Mathlib/Dynamics/Ergodic/Action/Basic.lean index f6a6915cc25dde..d9f73e674cbe47 100644 --- a/Mathlib/Dynamics/Ergodic/Action/Basic.lean +++ b/Mathlib/Dynamics/Ergodic/Action/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Group.AEStabilizer -import Mathlib.Dynamics.Ergodic.Ergodic +module + +public import Mathlib.MeasureTheory.Group.AEStabilizer +public import Mathlib.Dynamics.Ergodic.Ergodic /-! # Ergodic group actions @@ -15,6 +17,8 @@ if it is a.e.-invariant under each scalar multiplication `(g • ·)`, `g : G`, then it is either null or conull. -/ +@[expose] public section + open Set Filter MeasureTheory MulAction open scoped Pointwise diff --git a/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean b/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean index 3b2a71584d0d73..a2aa5a2365c5cb 100644 --- a/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean +++ b/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.Action.Regular -import Mathlib.MeasureTheory.Measure.ContinuousPreimage -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.Dynamics.Ergodic.Action.Regular +public import Mathlib.MeasureTheory.Measure.ContinuousPreimage +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Ergodicity from minimality @@ -19,7 +21,7 @@ is based on the ergodicity of the left action of a group on itself and the following fact that we prove in `ergodic_smul_of_denseRange_pow` below: If a monoid `M` continuously acts on an R₁ topological space `X`, -`g` is an element of `M such that its natural powers are dense in `M`, +`g` is an element of `M` such that its natural powers are dense in `M`, and `μ` is a finite inner regular measure on `X` which is ergodic with respect to the action of `M`, then the scalar multiplication by `g` is an ergodic map. @@ -28,6 +30,8 @@ if it is surjective and the preimages of `1` under iterations of `f` are dense i This theorem applies, e.g., to the map `z ↦ n • z` on the additive circle or a torus. -/ +@[expose] public section + open MeasureTheory Filter Set Function open scoped Pointwise Topology @@ -63,11 +67,11 @@ theorem aeconst_of_dense_setOf_preimage_smul_eq (hsm : NullMeasurableSet s μ) aeconst_of_dense_setOf_preimage_smul_ae hsm <| hd.mono fun _ h ↦ mem_setOf.2 <| .of_eq h /-- If a monoid `M` continuously acts on an R₁ topological space `X`, -`g` is an element of `M such that its natural powers are dense in `M`, +`g` is an element of `M` such that its natural powers are dense in `M`, and `μ` is a finite inner regular measure on `X` which is ergodic with respect to the action of `M`, then the scalar multiplication by `g` is an ergodic map. -/ @[to_additive /-- If an additive monoid `M` continuously acts on an R₁ topological space `X`, -`g` is an element of `M such that its natural multiples are dense in `M`, +`g` is an element of `M` such that its natural multiples are dense in `M`, and `μ` is a finite inner regular measure on `X` which is ergodic with respect to the action of `M`, then the vector addition of `g` is an ergodic map. -/] theorem ergodic_smul_of_denseRange_pow {M : Type*} [Monoid M] [TopologicalSpace M] @@ -121,11 +125,11 @@ theorem aeconst_of_dense_aestabilizer_smul (hsm : NullMeasurableSet s μ) simpa only [preimage_smul] using hg /-- If a monoid `M` continuously acts on an R₁ topological space `X`, -`g` is an element of `M such that its integer powers are dense in `M`, +`g` is an element of `M` such that its integer powers are dense in `M`, and `μ` is a finite inner regular measure on `X` which is ergodic with respect to the action of `M`, then the scalar multiplication by `g` is an ergodic map. -/ @[to_additive /-- If an additive monoid `M` continuously acts on an R₁ topological space `X`, -`g` is an element of `M such that its integer multiples are dense in `M`, +`g` is an element of `M` such that its integer multiples are dense in `M`, and `μ` is a finite inner regular measure on `X` which is ergodic with respect to the action of `M`, then the vector addition of `g` is an ergodic map. -/] theorem ergodic_smul_of_denseRange_zpow {g : G} (hg : DenseRange (g ^ · : ℤ → G)) diff --git a/Mathlib/Dynamics/Ergodic/Action/Regular.lean b/Mathlib/Dynamics/Ergodic/Action/Regular.lean index 7abce701f315e6..619195eea8c4dd 100644 --- a/Mathlib/Dynamics/Ergodic/Action/Regular.lean +++ b/Mathlib/Dynamics/Ergodic/Action/Regular.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.Action.Basic -import Mathlib.MeasureTheory.Group.Prod +module + +public import Mathlib.Dynamics.Ergodic.Action.Basic +public import Mathlib.MeasureTheory.Group.Prod /-! # Regular action of a group on itself is ergodic @@ -12,6 +14,8 @@ import Mathlib.MeasureTheory.Group.Prod In this file we prove that the left and right actions of a group on itself are ergodic. -/ +@[expose] public section + open MeasureTheory Measure Filter Set open scoped Pointwise diff --git a/Mathlib/Dynamics/Ergodic/AddCircle.lean b/Mathlib/Dynamics/Ergodic/AddCircle.lean index fdc1b52256fe9f..ea1b6e1146585e 100644 --- a/Mathlib/Dynamics/Ergodic/AddCircle.lean +++ b/Mathlib/Dynamics/Ergodic/AddCircle.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Dynamics.FixedPoints.Prufer -import Mathlib.Dynamics.Ergodic.Ergodic -import Mathlib.MeasureTheory.Covering.DensityTheorem -import Mathlib.MeasureTheory.Group.AddCircle -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Dynamics.FixedPoints.Prufer +public import Mathlib.Dynamics.Ergodic.Ergodic +public import Mathlib.MeasureTheory.Covering.DensityTheorem +public import Mathlib.MeasureTheory.Group.AddCircle +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Ergodic maps of the additive circle @@ -28,6 +30,8 @@ This file contains proofs of ergodicity for maps of the additive circle. -/ +@[expose] public section + open Set Function MeasureTheory MeasureTheory.Measure Filter Metric diff --git a/Mathlib/Dynamics/Ergodic/AddCircleAdd.lean b/Mathlib/Dynamics/Ergodic/AddCircleAdd.lean index 3cce2d6cf79eb5..c1c6bb75f269ca 100644 --- a/Mathlib/Dynamics/Ergodic/AddCircleAdd.lean +++ b/Mathlib/Dynamics/Ergodic/AddCircleAdd.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.Action.OfMinimal -import Mathlib.Topology.Instances.AddCircle.DenseSubgroup -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +module + +public import Mathlib.Dynamics.Ergodic.Action.OfMinimal +public import Mathlib.Topology.Instances.AddCircle.DenseSubgroup +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic /-! # Ergodicity of an irrational rotation @@ -14,6 +16,8 @@ In this file we prove that rotation of `AddCircle p` by `a` is ergodic if and only if `a` has infinite order (in other words, if `a / p` is irrational). -/ +@[expose] public section + open Metric MeasureTheory AddSubgroup open scoped Pointwise diff --git a/Mathlib/Dynamics/Ergodic/Conservative.lean b/Mathlib/Dynamics/Ergodic/Conservative.lean index abdc20f6823204..6624a93c540b6b 100644 --- a/Mathlib/Dynamics/Ergodic/Conservative.lean +++ b/Mathlib/Dynamics/Ergodic/Conservative.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.Combinatorics.Pigeonhole +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.Combinatorics.Pigeonhole /-! # Conservative systems @@ -35,6 +37,8 @@ infinitely many times. conservative dynamical system, Poincare recurrence theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Dynamics/Ergodic/Ergodic.lean b/Mathlib/Dynamics/Ergodic/Ergodic.lean index 815ba24446c619..de4fa8671493cd 100644 --- a/Mathlib/Dynamics/Ergodic/Ergodic.lean +++ b/Mathlib/Dynamics/Ergodic/Ergodic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability /-! # Ergodic maps and measures @@ -17,7 +19,7 @@ In this file we define ergodic maps / measures together with quasi-ergodic maps provide some basic API. Quasi-ergodicity is a weaker condition than ergodicity for which the measure preserving condition is relaxed to quasi-measure-preserving. -# Main definitions: +## Main definitions * `PreErgodic`: the ergodicity condition without the measure-preserving condition. This exists to share code between the `Ergodic` and `QuasiErgodic` definitions. @@ -29,6 +31,8 @@ preserving condition is relaxed to quasi-measure-preserving. -/ +@[expose] public section + open Set Function Filter MeasureTheory MeasureTheory.Measure @@ -90,17 +94,25 @@ namespace MeasureTheory.MeasurePreserving variable {β : Type*} {m' : MeasurableSpace β} {μ' : Measure β} {g : α → β} -theorem preErgodic_of_preErgodic_conjugate (hg : MeasurePreserving g μ μ') (hf : PreErgodic f μ) +theorem preErgodic_of_preErgodic_semiconj (hg : MeasurePreserving g μ μ') (hf : PreErgodic f μ) {f' : β → β} (h_comm : Semiconj g f f') : PreErgodic f' μ' where aeconst_set s hs₀ hs₁ := by rw [← hg.aeconst_preimage hs₀.nullMeasurableSet] apply hf.aeconst_set (hg.measurable hs₀) rw [← preimage_comp, h_comm.comp_eq, preimage_comp, hs₁] +@[deprecated (since := "2025-11-19")] +alias preErgodic_of_preErgodic_conjugate := preErgodic_of_preErgodic_semiconj + +theorem ergodic_of_ergodic_semiconj (hg : MeasurePreserving g μ μ') (hf : Ergodic f μ) + {f' : β → β} (hf' : Measurable f') (h_comm : Semiconj g f f') : Ergodic f' μ' := + ⟨hg.of_semiconj hf.toMeasurePreserving h_comm hf', + hg.preErgodic_of_preErgodic_semiconj hf.toPreErgodic h_comm⟩ + theorem preErgodic_conjugate_iff {e : α ≃ᵐ β} (h : MeasurePreserving e μ μ') : PreErgodic (e ∘ f ∘ e.symm) μ' ↔ PreErgodic f μ := by - refine ⟨fun hf => preErgodic_of_preErgodic_conjugate (h.symm e) hf ?_, - fun hf => preErgodic_of_preErgodic_conjugate h hf ?_⟩ + refine ⟨fun hf => preErgodic_of_preErgodic_semiconj (h.symm e) hf ?_, + fun hf => preErgodic_of_preErgodic_semiconj h hf ?_⟩ · simp [Semiconj] · simp [Semiconj] diff --git a/Mathlib/Dynamics/Ergodic/Extreme.lean b/Mathlib/Dynamics/Ergodic/Extreme.lean index 42d4a37bd7f463..a58da1538f0658 100644 --- a/Mathlib/Dynamics/Ergodic/Extreme.lean +++ b/Mathlib/Dynamics/Ergodic/Extreme.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Extreme -import Mathlib.Dynamics.Ergodic.Function -import Mathlib.Dynamics.Ergodic.RadonNikodym -import Mathlib.Probability.ConditionalProbability +module + +public import Mathlib.Analysis.Convex.Extreme +public import Mathlib.Dynamics.Ergodic.Function +public import Mathlib.Dynamics.Ergodic.RadonNikodym +public import Mathlib.Probability.ConditionalProbability /-! # Ergodic measures as extreme points @@ -16,6 +18,8 @@ iff it is an extreme point of the set of invariant measures of `f` with the same We also specialize this result to probability measures. -/ +@[expose] public section + open Filter Set Function MeasureTheory Measure ProbabilityTheory open scoped NNReal ENNReal Topology diff --git a/Mathlib/Dynamics/Ergodic/Function.lean b/Mathlib/Dynamics/Ergodic/Function.lean index c6cdb1fcb0b9ce..ac868610362552 100644 --- a/Mathlib/Dynamics/Ergodic/Function.lean +++ b/Mathlib/Dynamics/Ergodic/Function.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.Ergodic -import Mathlib.MeasureTheory.Function.AEEqFun +module + +public import Mathlib.Dynamics.Ergodic.Ergodic +public import Mathlib.MeasureTheory.Function.AEEqFun /-! # Functions invariant under (quasi)ergodic map @@ -16,6 +18,8 @@ We also formulate a version for `MeasureTheory.AEEqFun` functions with all a.e. equalities replaced with equalities in the quotient space. -/ +@[expose] public section + open Function Set Filter MeasureTheory Topology TopologicalSpace variable {α X : Type*} [MeasurableSpace α] {μ : MeasureTheory.Measure α} diff --git a/Mathlib/Dynamics/Ergodic/MeasurePreserving.lean b/Mathlib/Dynamics/Ergodic/MeasurePreserving.lean index 56ff1a15c3df63..f1cd0ab3edd7b1 100644 --- a/Mathlib/Dynamics/Ergodic/MeasurePreserving.lean +++ b/Mathlib/Dynamics/Ergodic/MeasurePreserving.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.AEMeasurable -import Mathlib.Order.Filter.EventuallyConst +module + +public import Mathlib.MeasureTheory.Measure.AEMeasurable +public import Mathlib.Order.Filter.EventuallyConst /-! # Measure-preserving maps @@ -26,6 +28,8 @@ Isabelle formalization. measure-preserving map, measure -/ +@[expose] public section + open MeasureTheory.Measure Function Set open scoped ENNReal @@ -90,6 +94,17 @@ protected theorem comp {g : β → γ} {f : α → β} (hg : MeasurePreserving g (hf : MeasurePreserving f μa μb) : MeasurePreserving (g ∘ f) μa μc := ⟨hg.1.comp hf.1, by rw [← map_map hg.1 hf.1, hf.2, hg.2]⟩ +protected theorem map_of_comp {f : α → β} {g : β → γ} (hgf : MeasurePreserving (g ∘ f) μa μc) + (hg : Measurable g) (hf : Measurable f) : + MeasurePreserving g (μa.map f) μc := + ⟨hg, (map_map hg hf).trans hgf.map_eq⟩ + +protected theorem of_semiconj {f : α → β} {ga : α → α} {gb : β → β} + (hfm : MeasurePreserving f μa μb) (hga : MeasurePreserving ga μa μa) (hf : Semiconj f ga gb) + (hgb : Measurable gb) : MeasurePreserving gb μb μb := by + have := hf.comp_eq ▸ hfm.comp hga |>.map_of_comp hgb hfm.measurable + rwa [hfm.map_eq] at this + /-- An alias of `MeasureTheory.MeasurePreserving.comp` with a convenient defeq and argument order for `MeasurableEquiv` -/ protected theorem trans {e : α ≃ᵐ β} {e' : β ≃ᵐ γ} diff --git a/Mathlib/Dynamics/Ergodic/RadonNikodym.lean b/Mathlib/Dynamics/Ergodic/RadonNikodym.lean index e2ad6f5a909190..44f229cd836a5d 100644 --- a/Mathlib/Dynamics/Ergodic/RadonNikodym.lean +++ b/Mathlib/Dynamics/Ergodic/RadonNikodym.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -import Mathlib.Topology.Order.CountableSeparating +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +public import Mathlib.Topology.Order.CountableSeparating /-! # Radon-Nikodym derivative of invariant measures @@ -23,6 +25,8 @@ It isn't clear if the finiteness assumptions are optimal in this file. We should either weaken them, or describe an example showing that it's impossible. -/ +@[expose] public section + open MeasureTheory Measure Set variable {X : Type*} {m : MeasurableSpace X} {μ ν : Measure X} [IsFiniteMeasure μ] diff --git a/Mathlib/Dynamics/FixedPoints/Basic.lean b/Mathlib/Dynamics/FixedPoints/Basic.lean index ef4dbb2c5dbfb7..f390bef33f2fe3 100644 --- a/Mathlib/Dynamics/FixedPoints/Basic.lean +++ b/Mathlib/Dynamics/FixedPoints/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.End -import Mathlib.Data.Set.Function +module + +public import Mathlib.Algebra.Group.End +public import Mathlib.Data.Set.Function /-! # Fixed points of a self-map @@ -21,6 +23,8 @@ We also prove some simple lemmas about `IsFixedPt` and `∘`, `iterate`, and `Se fixed point -/ +@[expose] public section + open Equiv diff --git a/Mathlib/Dynamics/FixedPoints/Prufer.lean b/Mathlib/Dynamics/FixedPoints/Prufer.lean index 519bf0fd1bcdc0..f3b1627934ccbc 100644 --- a/Mathlib/Dynamics/FixedPoints/Prufer.lean +++ b/Mathlib/Dynamics/FixedPoints/Prufer.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Dynamics.FixedPoints.Basic +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Dynamics.FixedPoints.Basic /-! # Results about pointwise operations on sets with iteration. -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/Dynamics/FixedPoints/Topology.lean b/Mathlib/Dynamics/FixedPoints/Topology.lean index 9c65e154462427..3b57ac9370d002 100644 --- a/Mathlib/Dynamics/FixedPoints/Topology.lean +++ b/Mathlib/Dynamics/FixedPoints/Topology.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Johannes Hölzl -/ -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.Topology.Separation.Hausdorff +module + +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.Topology.Separation.Hausdorff /-! # Topological properties of fixed points @@ -19,6 +21,8 @@ Currently this file contains two lemmas: fixed points, iterates -/ +@[expose] public section + variable {α : Type*} [TopologicalSpace α] [T2Space α] {f : α → α} diff --git a/Mathlib/Dynamics/Flow.lean b/Mathlib/Dynamics/Flow.lean index d43a03fd1ba9dc..48c992ea391d53 100644 --- a/Mathlib/Dynamics/Flow.lean +++ b/Mathlib/Dynamics/Flow.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Jean Lo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jean Lo -/ -import Mathlib.Logic.Function.Iterate -import Mathlib.Topology.Algebra.Monoid -import Mathlib.Topology.Algebra.Group.Defs -import Mathlib.Algebra.Order.Monoid.Submonoid +module + +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Topology.Algebra.Monoid +public import Mathlib.Topology.Algebra.Group.Defs +public import Mathlib.Algebra.Order.Monoid.Submonoid /-! # Flows and invariant sets @@ -28,6 +30,8 @@ semiconjugacy between flows, a factor of a flow, the restriction of a flow onto an invariant subset, and the time-reversal of a flow by a group. -/ +@[expose] public section + open Set Function Filter diff --git a/Mathlib/Dynamics/Minimal.lean b/Mathlib/Dynamics/Minimal.lean index 234a027eebc380..b5971ed8d39122 100644 --- a/Mathlib/Dynamics/Minimal.lean +++ b/Mathlib/Dynamics/Minimal.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Topology.Algebra.ConstMulAction +module + +public import Mathlib.Topology.Algebra.ConstMulAction /-! # Minimal action of a group @@ -21,6 +23,8 @@ and prove some basic facts about minimal actions. group action, minimal -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/Dynamics/Newton.lean b/Mathlib/Dynamics/Newton.lean index 2c048abc643a49..99b143cba80bb0 100644 --- a/Mathlib/Dynamics/Newton.lean +++ b/Mathlib/Dynamics/Newton.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, Oliver Nash -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Identities -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.RingTheory.Polynomial.Nilpotent +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Identities +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.RingTheory.Polynomial.Nilpotent /-! # Newton-Raphson method @@ -30,6 +32,8 @@ such as Hensel's lemma and Jordan-Chevalley decomposition. -/ +@[expose] public section + open Set Function noncomputable section diff --git a/Mathlib/Dynamics/OmegaLimit.lean b/Mathlib/Dynamics/OmegaLimit.lean index e65525c3aa0024..979b85833fb45c 100644 --- a/Mathlib/Dynamics/OmegaLimit.lean +++ b/Mathlib/Dynamics/OmegaLimit.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Jean Lo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jean Lo -/ -import Mathlib.Dynamics.Flow -import Mathlib.Tactic.Monotonicity +module + +public import Mathlib.Dynamics.Flow +public import Mathlib.Tactic.Monotonicity /-! # ω-limits @@ -30,6 +32,8 @@ The `omegaLimit` scope provides the localised notation `ω` for endowed with an order. -/ +@[expose] public section + open Set Function Filter Topology @@ -151,7 +155,7 @@ theorem omegaLimit_union : ω f ϕ (s₁ ∪ s₂) = ω f ϕ s₁ ∪ ω f ϕ s · simp only [mem_union, mem_omegaLimit_iff_frequently, union_inter_distrib_right, union_nonempty, frequently_or_distrib] contrapose! - simp only [not_frequently, not_nonempty_iff_eq_empty, ← subset_empty_iff] + simp only [← subset_empty_iff] rintro ⟨⟨n₁, hn₁, h₁⟩, ⟨n₂, hn₂, h₂⟩⟩ refine ⟨n₁ ∩ n₂, inter_mem hn₁ hn₂, h₁.mono fun t ↦ ?_, h₂.mono fun t ↦ ?_⟩ exacts [Subset.trans <| inter_subset_inter_right _ <| preimage_mono inter_subset_left, diff --git a/Mathlib/Dynamics/PeriodicPts/Defs.lean b/Mathlib/Dynamics/PeriodicPts/Defs.lean index 83ebdd8cf494ff..2ac254416270c5 100644 --- a/Mathlib/Dynamics/PeriodicPts/Defs.lean +++ b/Mathlib/Dynamics/PeriodicPts/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.Data.List.Cycle -import Mathlib.Data.PNat.Notation -import Mathlib.Dynamics.FixedPoints.Basic +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.Data.List.Cycle +public import Mathlib.Data.PNat.Notation +public import Mathlib.Dynamics.FixedPoints.Basic /-! # Periodic points @@ -41,6 +43,8 @@ is a periodic point of `f` of period `n` if and only if `minimalPeriod f x | n`. -/ +@[expose] public section + assert_not_exists MonoidWithZero diff --git a/Mathlib/Dynamics/PeriodicPts/Lemmas.lean b/Mathlib/Dynamics/PeriodicPts/Lemmas.lean index bbb420b0dfbc57..e0cebe34c9dd0d 100644 --- a/Mathlib/Dynamics/PeriodicPts/Lemmas.lean +++ b/Mathlib/Dynamics/PeriodicPts/Lemmas.lean @@ -3,17 +3,21 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.PNat.Basic -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Dynamics.PeriodicPts.Defs +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Data.PNat.Basic +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Dynamics.PeriodicPts.Defs /-! # Extra lemmas about periodic points -/ +@[expose] public section + open Nat Set namespace Function diff --git a/Mathlib/Dynamics/TopologicalEntropy/CoverEntropy.lean b/Mathlib/Dynamics/TopologicalEntropy/CoverEntropy.lean index b7f08afe82a937..d17dc2c1680031 100644 --- a/Mathlib/Dynamics/TopologicalEntropy/CoverEntropy.lean +++ b/Mathlib/Dynamics/TopologicalEntropy/CoverEntropy.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine, Pietro Monticone -/ -import Mathlib.Analysis.Asymptotics.ExpGrowth -import Mathlib.Data.ENat.Lattice -import Mathlib.Data.Real.ENatENNReal -import Mathlib.Dynamics.TopologicalEntropy.DynamicalEntourage +module + +public import Mathlib.Analysis.Asymptotics.ExpGrowth +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Data.Real.ENatENNReal +public import Mathlib.Dynamics.TopologicalEntropy.DynamicalEntourage /-! # Topological entropy via covers @@ -59,6 +61,8 @@ cover, entropy Get versions of the topological entropy on (pseudo-e)metric spaces. -/ +@[expose] public section + open Set Uniformity UniformSpace open scoped SetRel diff --git a/Mathlib/Dynamics/TopologicalEntropy/DynamicalEntourage.lean b/Mathlib/Dynamics/TopologicalEntropy/DynamicalEntourage.lean index 3071b895738c70..926b1195025500 100644 --- a/Mathlib/Dynamics/TopologicalEntropy/DynamicalEntourage.lean +++ b/Mathlib/Dynamics/TopologicalEntropy/DynamicalEntourage.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine, Pietro Monticone -/ -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Topology.Constructions.SumProd -import Mathlib.Topology.UniformSpace.Basic +module + +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Topology.Constructions.SumProd +public import Mathlib.Topology.UniformSpace.Basic /-! # Dynamical entourages @@ -35,6 +37,8 @@ In the context of (pseudo-e)metric spaces, relate the usual definition of dynami these dynamical entourages. -/ +@[expose] public section + namespace Dynamics open Prod Set UniformSpace diff --git a/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean b/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean index bbaca970d86a83..1ca1fd9826b2e8 100644 --- a/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean +++ b/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine, Pietro Monticone -/ -import Mathlib.Dynamics.TopologicalEntropy.CoverEntropy +module + +public import Mathlib.Dynamics.TopologicalEntropy.CoverEntropy /-! # Topological entropy via nets @@ -49,6 +51,8 @@ net, entropy Get versions of the topological entropy on (pseudo-e)metric spaces. -/ +@[expose] public section + open Set Uniformity UniformSpace open scoped SetRel diff --git a/Mathlib/Dynamics/TopologicalEntropy/Semiconj.lean b/Mathlib/Dynamics/TopologicalEntropy/Semiconj.lean index 2f9ccf870b9883..dd01dc5b1917e1 100644 --- a/Mathlib/Dynamics/TopologicalEntropy/Semiconj.lean +++ b/Mathlib/Dynamics/TopologicalEntropy/Semiconj.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine, Pietro Monticone -/ -import Mathlib.Dynamics.TopologicalEntropy.CoverEntropy +module + +public import Mathlib.Dynamics.TopologicalEntropy.CoverEntropy /-! # Topological entropy of the image of a set under a semiconjugacy @@ -51,6 +53,8 @@ the entropy of `φ '' F` is lower than the entropy of `F` if `φ` is uniformly c entropy, semiconjugacy -/ +@[expose] public section + open Function Prod Set Uniformity UniformSpace open scoped SetRel diff --git a/Mathlib/Dynamics/TopologicalEntropy/Subset.lean b/Mathlib/Dynamics/TopologicalEntropy/Subset.lean index 29d211cb29435d..89742990c82144 100644 --- a/Mathlib/Dynamics/TopologicalEntropy/Subset.lean +++ b/Mathlib/Dynamics/TopologicalEntropy/Subset.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Damien Thomine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damien Thomine -/ -import Mathlib.Dynamics.TopologicalEntropy.NetEntropy +module + +public import Mathlib.Dynamics.TopologicalEntropy.NetEntropy /-! # Topological entropy of subsets: monotonicity, closure, union @@ -32,6 +34,8 @@ generalization of the lemmas on closures. closure, entropy, subset, union -/ +@[expose] public section + namespace Dynamics open ExpGrowth Set UniformSpace diff --git a/Mathlib/Dynamics/Transitive.lean b/Mathlib/Dynamics/Transitive.lean index b2ba5776b0f770..851b167ecf9da5 100644 --- a/Mathlib/Dynamics/Transitive.lean +++ b/Mathlib/Dynamics/Transitive.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Daniel Figueroa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Figueroa -/ -import Mathlib.Dynamics.Minimal +module + +public import Mathlib.Dynamics.Minimal /-! # Topologically transitive monoid actions @@ -18,6 +20,8 @@ and prove basic facts about topologically transitive actions. group action, topologically transitive -/ +@[expose] public section + open scoped Pointwise diff --git a/Mathlib/FieldTheory/AbelRuffini.lean b/Mathlib/FieldTheory/AbelRuffini.lean index 6004e501235f36..bfc34826a04659 100644 --- a/Mathlib/FieldTheory/AbelRuffini.lean +++ b/Mathlib/FieldTheory/AbelRuffini.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Thomas Browning and Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz -/ -import Mathlib.GroupTheory.Solvable -import Mathlib.FieldTheory.PolynomialGaloisGroup -import Mathlib.RingTheory.RootsOfUnity.Basic +module + +public import Mathlib.GroupTheory.Solvable +public import Mathlib.FieldTheory.PolynomialGaloisGroup +public import Mathlib.RingTheory.RootsOfUnity.Basic /-! # The Abel-Ruffini Theorem @@ -23,6 +25,8 @@ by radicals, then its minimal polynomial has solvable Galois group. that is solvable by radicals has a solvable Galois group. -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/FieldTheory/AbsoluteGaloisGroup.lean b/Mathlib/FieldTheory/AbsoluteGaloisGroup.lean index 16992537a9e46f..6f66c5f3ea2347 100644 --- a/Mathlib/FieldTheory/AbsoluteGaloisGroup.lean +++ b/Mathlib/FieldTheory/AbsoluteGaloisGroup.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.FieldTheory.KrullTopology -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.Topology.Algebra.Group.TopologicalAbelianization +module + +public import Mathlib.FieldTheory.KrullTopology +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.Topology.Algebra.Group.TopologicalAbelianization /-! # The topological abelianization of the absolute Galois group. @@ -28,6 +30,8 @@ field, algebraic closure, galois group, abelianization -/ +@[expose] public section + namespace Field variable (K : Type*) [Field K] diff --git a/Mathlib/FieldTheory/AlgebraicClosure.lean b/Mathlib/FieldTheory/AlgebraicClosure.lean index cf737102acfc2c..5d14eb4827012d 100644 --- a/Mathlib/FieldTheory/AlgebraicClosure.lean +++ b/Mathlib/FieldTheory/AlgebraicClosure.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu, Jiedong Jiang -/ -import Mathlib.FieldTheory.Normal.Closure -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.FieldTheory.IntermediateField.Algebraic +module + +public import Mathlib.FieldTheory.Normal.Closure +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.FieldTheory.IntermediateField.Algebraic /-! # Relative Algebraic Closure @@ -18,6 +20,8 @@ In this file we construct the relative algebraic closure of a field extension. of the field extension `E / F`, which is defined to be the integral closure of `F` in `E`. -/ + +@[expose] public section noncomputable section open Polynomial FiniteDimensional IntermediateField Field diff --git a/Mathlib/FieldTheory/AxGrothendieck.lean b/Mathlib/FieldTheory/AxGrothendieck.lean index 629afb92ce55ac..8e53ea1d5b9e54 100644 --- a/Mathlib/FieldTheory/AxGrothendieck.lean +++ b/Mathlib/FieldTheory/AxGrothendieck.lean @@ -3,12 +3,13 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.RingTheory.Algebraic.Basic -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.ModelTheory.Algebra.Field.IsAlgClosed -import Mathlib.ModelTheory.Algebra.Ring.Definability -import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.RingTheory.Algebraic.Basic +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.ModelTheory.Algebra.Field.IsAlgClosed +public import Mathlib.ModelTheory.Algebra.Ring.Definability +public import Mathlib.RingTheory.Polynomial.Basic /-! # Ax-Grothendieck @@ -37,6 +38,8 @@ the Ax-Grothendieck Theorem were first formalized in Lean 3 by Joseph Hua -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/FieldTheory/CardinalEmb.lean b/Mathlib/FieldTheory/CardinalEmb.lean index 19606066b0bc9e..b19a66de8aab7e 100644 --- a/Mathlib/FieldTheory/CardinalEmb.lean +++ b/Mathlib/FieldTheory/CardinalEmb.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.FieldTheory.SeparableClosure -import Mathlib.FieldTheory.PurelyInseparable.Basic -import Mathlib.LinearAlgebra.FreeAlgebra -import Mathlib.Order.Interval.Set.WithBotTop -import Mathlib.Order.DirectedInverseSystem +module + +public import Mathlib.FieldTheory.SeparableClosure +public import Mathlib.FieldTheory.PurelyInseparable.Basic +public import Mathlib.LinearAlgebra.FreeAlgebra +public import Mathlib.Order.Interval.Set.WithBotTop +public import Mathlib.Order.DirectedInverseSystem /-! # Number of embeddings of an algebraic extension of infinite separable degree @@ -64,6 +66,8 @@ between `E⟮ Fintype.card x diff --git a/Mathlib/FieldTheory/ChevalleyWarning.lean b/Mathlib/FieldTheory/ChevalleyWarning.lean index 3bc0af339dc311..8aa0b889f54b90 100644 --- a/Mathlib/FieldTheory/ChevalleyWarning.lean +++ b/Mathlib/FieldTheory/ChevalleyWarning.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.FieldTheory.Finite.Basic /-! # The Chevalley–Warning theorem @@ -33,6 +35,8 @@ and `q` is notation for the cardinality of `K`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/FieldTheory/Differential/Basic.lean b/Mathlib/FieldTheory/Differential/Basic.lean index 50a723faed4bd3..0f963cf5728b1a 100644 --- a/Mathlib/FieldTheory/Differential/Basic.lean +++ b/Mathlib/FieldTheory/Differential/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ -import Mathlib.RingTheory.Derivation.MapCoeffs -import Mathlib.FieldTheory.PrimitiveElement +module + +public import Mathlib.RingTheory.Derivation.MapCoeffs +public import Mathlib.FieldTheory.PrimitiveElement /-! # Differential Fields @@ -13,6 +15,8 @@ This file defines the logarithmic derivative `Differential.logDeriv` and proves This is defined algebraically, compared to `logDeriv` which is analytical. -/ +@[expose] public section + namespace Differential open algebraMap Polynomial IntermediateField diff --git a/Mathlib/FieldTheory/Differential/Liouville.lean b/Mathlib/FieldTheory/Differential/Liouville.lean index cd8b81f3ac8247..d86067025cfd7c 100644 --- a/Mathlib/FieldTheory/Differential/Liouville.lean +++ b/Mathlib/FieldTheory/Differential/Liouville.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ -import Mathlib.Algebra.Algebra.Field -import Mathlib.Algebra.BigOperators.Field -import Mathlib.FieldTheory.Differential.Basic -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +module + +public import Mathlib.Algebra.Algebra.Field +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.FieldTheory.Differential.Basic +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Liouville's theorem @@ -28,6 +30,8 @@ literature, and we introduce it as part of the formalization of Liouville's theo -/ +@[expose] public section + open Differential algebraMap IntermediateField Finset Polynomial variable (F : Type*) (K : Type*) [Field F] [Field K] [Differential F] [Differential K] diff --git a/Mathlib/FieldTheory/Extension.lean b/Mathlib/FieldTheory/Extension.lean index 1b87f1be171a84..5383dd2a7f8491 100644 --- a/Mathlib/FieldTheory/Extension.lean +++ b/Mathlib/FieldTheory/Extension.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Junyan Xu -/ -import Mathlib.Data.Fintype.Order -import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic +module + +public import Mathlib.Data.Fintype.Order +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic /-! # Extension of field embeddings @@ -21,6 +23,8 @@ The American Mathematical Monthly -/ +@[expose] public section + open Polynomial namespace IntermediateField diff --git a/Mathlib/FieldTheory/Finite/Basic.lean b/Mathlib/FieldTheory/Finite/Basic.lean index 46ba5a31712b14..92b49c31797eea 100644 --- a/Mathlib/FieldTheory/Finite/Basic.lean +++ b/Mathlib/FieldTheory/Finite/Basic.lean @@ -3,17 +3,19 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Joey van Langen, Casper Putz -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.Algebra.CharP.Reduced -import Mathlib.Algebra.Field.ZMod -import Mathlib.Data.Nat.Prime.Int -import Mathlib.Data.ZMod.ValMinAbs -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix -import Mathlib.FieldTheory.Finiteness -import Mathlib.FieldTheory.Galois.Notation -import Mathlib.FieldTheory.Perfect -import Mathlib.FieldTheory.Separable -import Mathlib.RingTheory.IntegralDomain +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.Algebra.CharP.Reduced +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.Data.ZMod.ValMinAbs +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.FieldTheory.Galois.Notation +public import Mathlib.FieldTheory.Perfect +public import Mathlib.FieldTheory.Separable +public import Mathlib.RingTheory.IntegralDomain /-! # Finite fields @@ -48,6 +50,8 @@ diamonds, as `Fintype` carries data. -/ +@[expose] public section + variable {K : Type*} {R : Type*} diff --git a/Mathlib/FieldTheory/Finite/Extension.lean b/Mathlib/FieldTheory/Finite/Extension.lean index 38f526bd0f14cb..bd6de577952c7c 100644 --- a/Mathlib/FieldTheory/Finite/Extension.lean +++ b/Mathlib/FieldTheory/Finite/Extension.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Kevin Buzzard -/ -import Mathlib.FieldTheory.Finite.GaloisField +module + +public import Mathlib.FieldTheory.Finite.GaloisField /-! # Extensions of finite fields @@ -29,6 +31,8 @@ isomorphic to our chosen `FiniteField.Extension k p n`. -/ +@[expose] public section + noncomputable section variable (k : Type*) [Field k] [Finite k] diff --git a/Mathlib/FieldTheory/Finite/GaloisField.lean b/Mathlib/FieldTheory/Finite/GaloisField.lean index 371215ea87af06..57b1292b8c919f 100644 --- a/Mathlib/FieldTheory/Finite/GaloisField.lean +++ b/Mathlib/FieldTheory/Finite/GaloisField.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Alex J. Best, Johan Commelin, Eric Rodriguez, Ruben Van de Velde -/ -import Mathlib.Algebra.Algebra.ZMod -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.RingTheory.Norm.Transitivity +module + +public import Mathlib.Algebra.Algebra.ZMod +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.RingTheory.Norm.Transitivity /-! # Galois fields @@ -30,6 +32,8 @@ It is a finite field with `p ^ n` elements. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/FieldTheory/Finite/Polynomial.lean b/Mathlib/FieldTheory/Finite/Polynomial.lean index dbd95225f9335f..394908f86021e9 100644 --- a/Mathlib/FieldTheory/Finite/Polynomial.lean +++ b/Mathlib/FieldTheory/Finite/Polynomial.lean @@ -3,16 +3,20 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Expand -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.RingTheory.MvPolynomial.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Expand +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.RingTheory.MvPolynomial.Basic /-! ## Polynomials over finite fields -/ +@[expose] public section + namespace MvPolynomial diff --git a/Mathlib/FieldTheory/Finite/Trace.lean b/Mathlib/FieldTheory/Finite/Trace.lean index b97fede0e4c818..116309a4e23912 100644 --- a/Mathlib/FieldTheory/Finite/Trace.lean +++ b/Mathlib/FieldTheory/Finite/Trace.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.RingTheory.Trace.Basic -import Mathlib.FieldTheory.Finite.GaloisField +module + +public import Mathlib.RingTheory.Trace.Basic +public import Mathlib.FieldTheory.Finite.GaloisField /-! # The trace and norm maps for finite fields @@ -24,6 +26,8 @@ We state several lemmas about the trace and norm maps for finite fields. finite field, trace, norm -/ +@[expose] public section + namespace FiniteField diff --git a/Mathlib/FieldTheory/Finiteness.lean b/Mathlib/FieldTheory/Finiteness.lean index 60407094838e6d..bcc7092efedb78 100644 --- a/Mathlib/FieldTheory/Finiteness.lean +++ b/Mathlib/FieldTheory/Finiteness.lean @@ -3,15 +3,19 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.Dimension.Finite +module + +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.Dimension.Finite /-! # A module over a division ring is Noetherian if and only if it is finite. -/ +@[expose] public section + universe u v diff --git a/Mathlib/FieldTheory/Fixed.lean b/Mathlib/FieldTheory/Fixed.lean index ebfac1bc9ebc30..ed5056e536a1fb 100644 --- a/Mathlib/FieldTheory/Fixed.lean +++ b/Mathlib/FieldTheory/Fixed.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Polynomial.GroupRingAction -import Mathlib.Algebra.Ring.Action.Field -import Mathlib.Algebra.Ring.Action.Invariant -import Mathlib.FieldTheory.Finiteness -import Mathlib.FieldTheory.Normal.Defs -import Mathlib.FieldTheory.Separable -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +module + +public import Mathlib.Algebra.Polynomial.GroupRingAction +public import Mathlib.Algebra.Ring.Action.Field +public import Mathlib.Algebra.Ring.Action.Invariant +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.FieldTheory.Normal.Defs +public import Mathlib.FieldTheory.Separable +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # Fixed field under a group action. @@ -29,6 +31,8 @@ element of `G`, where `G` is a group that acts on `F`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/FieldTheory/Galois/Abelian.lean b/Mathlib/FieldTheory/Galois/Abelian.lean index 09f4cd6f53cce6..2e20d30b2b2f7d 100644 --- a/Mathlib/FieldTheory/Galois/Abelian.lean +++ b/Mathlib/FieldTheory/Galois/Abelian.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.FieldTheory.Galois.Infinite +module + +public import Mathlib.FieldTheory.Galois.Infinite /-! @@ -13,6 +15,8 @@ In this file, we define the typeclass of abelian extensions and provide some bas -/ +@[expose] public section + variable (K L M : Type*) [Field K] [Field L] [Algebra K L] variable [Field M] [Algebra K M] [Algebra L M] [IsScalarTower K L M] diff --git a/Mathlib/FieldTheory/Galois/Basic.lean b/Mathlib/FieldTheory/Galois/Basic.lean index b1fc1d1154eb8c..acbca0230bdc5d 100644 --- a/Mathlib/FieldTheory/Galois/Basic.lean +++ b/Mathlib/FieldTheory/Galois/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz, Yongle Hu, Jingting Wang -/ -import Mathlib.FieldTheory.Fixed -import Mathlib.FieldTheory.Normal.Closure -import Mathlib.FieldTheory.PrimitiveElement -import Mathlib.GroupTheory.GroupAction.FixingSubgroup +module + +public import Mathlib.FieldTheory.Fixed +public import Mathlib.FieldTheory.Normal.Closure +public import Mathlib.FieldTheory.PrimitiveElement +public import Mathlib.GroupTheory.GroupAction.FixingSubgroup /-! # Galois Extensions @@ -38,6 +40,8 @@ Together, these two results prove the Galois correspondence. -/ +@[expose] public section + open scoped Polynomial IntermediateField @@ -341,17 +345,31 @@ theorem card_fixingSubgroup_eq_finrank [FiniteDimensional F E] [IsGalois F E] : conv_rhs => rw [← fixedField_fixingSubgroup K, IntermediateField.finrank_fixedField_eq_card] /-- The Galois correspondence from intermediate fields to subgroups. -/ -@[stacks 09DW] +@[simps! apply, stacks 09DW] def intermediateFieldEquivSubgroup [FiniteDimensional F E] [IsGalois F E] : IntermediateField F E ≃o (Subgroup Gal(E/F))ᵒᵈ where - toFun := IntermediateField.fixingSubgroup - invFun := IntermediateField.fixedField + toFun := OrderDual.toDual ∘ IntermediateField.fixingSubgroup + invFun := IntermediateField.fixedField ∘ OrderDual.ofDual left_inv K := fixedField_fixingSubgroup K right_inv H := IntermediateField.fixingSubgroup_fixedField H map_rel_iff' {K L} := by rw [← fixedField_fixingSubgroup L, IntermediateField.le_iff_le, fixedField_fixingSubgroup L] rfl +section +variable [FiniteDimensional F E] [IsGalois F E] + +lemma ofDual_intermediateFieldEquivSubgroup_apply (K : IntermediateField F E) : + (intermediateFieldEquivSubgroup K).ofDual = K.fixingSubgroup := rfl + +@[simp] lemma intermediateFieldEquivSubgroup_symm_apply (H : (Subgroup Gal(E/F))ᵒᵈ) : + intermediateFieldEquivSubgroup.symm H = fixedField H.ofDual := rfl + +lemma intermediateFieldEquivSubgroup_symm_apply_toDual (H : Subgroup Gal(E/F)) : + intermediateFieldEquivSubgroup.symm (.toDual H) = fixedField H := rfl + +end + /-- The Galois correspondence as a `GaloisInsertion`. -/ def galoisInsertionIntermediateFieldSubgroup [FiniteDimensional F E] : GaloisInsertion (OrderDual.toDual ∘ diff --git a/Mathlib/FieldTheory/Galois/GaloisClosure.lean b/Mathlib/FieldTheory/Galois/GaloisClosure.lean index 2acdc2df319203..c827fe3e0edf82 100644 --- a/Mathlib/FieldTheory/Galois/GaloisClosure.lean +++ b/Mathlib/FieldTheory/Galois/GaloisClosure.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan, Yuyang Zhao -/ +module -import Mathlib.FieldTheory.Normal.Closure -import Mathlib.FieldTheory.SeparableClosure +public import Mathlib.FieldTheory.Normal.Closure +public import Mathlib.FieldTheory.SeparableClosure /-! @@ -19,12 +20,14 @@ In a field extension `K/k` * `adjoin` : The finite Galois intermediate field obtained from the normal closure of adjoining a finite `s : Set K` to `k`. -# TODO +## TODO * `FiniteGaloisIntermediateField` should be a `ConditionallyCompleteLattice` but isn't proved yet. -/ +@[expose] public section + open IntermediateField variable (k K : Type*) [Field k] [Field K] [Algebra k K] diff --git a/Mathlib/FieldTheory/Galois/Infinite.lean b/Mathlib/FieldTheory/Galois/Infinite.lean index 47f97b65978e7e..c71af8d916d9a6 100644 --- a/Mathlib/FieldTheory/Galois/Infinite.lean +++ b/Mathlib/FieldTheory/Galois/Infinite.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ -import Mathlib.FieldTheory.KrullTopology -import Mathlib.FieldTheory.Galois.GaloisClosure -import Mathlib.Topology.Algebra.Group.ClosedSubgroup +module + +public import Mathlib.FieldTheory.KrullTopology +public import Mathlib.FieldTheory.Galois.GaloisClosure +public import Mathlib.Topology.Algebra.Group.ClosedSubgroup /-! # The Fundamental Theorem of Infinite Galois Theory @@ -15,7 +17,7 @@ open subgroups and normal subgroups. We first verify that `IntermediateField.fix `IntermediateField.fixedField` are inverses of each other between intermediate fields and closed subgroups of the Galois group. -# Main definitions and results +## Main definitions and results In `K/k`, for any intermediate field `L` : @@ -48,6 +50,8 @@ Special cases : -/ +@[expose] public section + variable {k K : Type*} [Field k] [Field K] [Algebra k K] namespace InfiniteGalois @@ -101,6 +105,10 @@ lemma fixedField_bot [IsGalois k K] : IntermediateField.fixedField (⊤ : Subgroup Gal(K/k)) = ⊥ := by rw [← IntermediateField.fixingSubgroup_bot, fixedField_fixingSubgroup] +theorem mem_bot_iff_fixed [IsGalois k K] (x : K) : + x ∈ (⊥ : IntermediateField k K) ↔ ∀ (f : Gal(K/k)), f x = x := by + simp [← fixedField_bot, IntermediateField.mem_fixedField_iff] + open IntermediateField in /-- For a subgroup `H` of `Gal(K/k)`, the fixed field of the image of `H` under the restriction to a normal intermediate field `E` is equal to the fixed field of `H` in `K` intersecting with `E`. -/ diff --git a/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean b/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean index 8a3587cb897709..8455fbd08c0afe 100644 --- a/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean +++ b/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.RingTheory.Invariant.Basic +module + +public import Mathlib.FieldTheory.Galois.Infinite +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.RingTheory.Invariant.Basic /-! # Predicate for Galois Groups @@ -34,6 +36,8 @@ But in the absence of a more suitable name, the utility of the predicate `IsGalo extensions of rings `B/A` seems to outweigh these terminological issues. -/ +@[expose] public section + section CommRing variable (G A B : Type*) [Group G] [CommSemiring A] [Semiring B] [Algebra A B] @@ -145,11 +149,11 @@ theorem isGalois [Finite G] [IsGaloisGroup G K L] : IsGalois K L := by rw [← isGalois_iff_isGalois_bot, ← fixedPoints_eq_bot G] exact IsGalois.of_fixed_field L G -/-- If `L/K` is a finite Galois extension, then `Gal(L/K)` is a Galois group for `L/K`. -/ -instance of_isGalois [FiniteDimensional K L] [IsGalois K L] : IsGaloisGroup Gal(L/K) K L where +/-- If `L/K` is a Galois extension, then `Gal(L/K)` is a Galois group for `L/K`. -/ +instance of_isGalois [IsGalois K L] : IsGaloisGroup Gal(L/K) K L where faithful := inferInstance commutes := inferInstance - isInvariant := ⟨fun x ↦ (IsGalois.mem_bot_iff_fixed x).mpr⟩ + isInvariant := ⟨fun x ↦ (InfiniteGalois.mem_bot_iff_fixed x).mpr⟩ theorem card_eq_finrank [IsGaloisGroup G K L] : Nat.card G = Module.finrank K L := by rcases fintypeOrInfinite G with _ | hG diff --git a/Mathlib/FieldTheory/Galois/NormalBasis.lean b/Mathlib/FieldTheory/Galois/NormalBasis.lean index 67755d2457bc78..584d20734e802d 100644 --- a/Mathlib/FieldTheory/Galois/NormalBasis.lean +++ b/Mathlib/FieldTheory/Galois/NormalBasis.lean @@ -3,13 +3,15 @@ Copyright (c) 2025 Madison Crim, Aaron Liu, Justus Springer, Junyan Xu. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Madison Crim, Aaron Liu, Justus Springer, Junyan Xu -/ -import Mathlib.Algebra.Module.PID -import Mathlib.Algebra.MvPolynomial.Funext -import Mathlib.Algebra.Polynomial.Module.AEval -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.LinearAlgebra.AnnihilatingPolynomial -import Mathlib.LinearAlgebra.Matrix.Nondegenerate +module + +public import Mathlib.Algebra.Module.PID +public import Mathlib.Algebra.MvPolynomial.Funext +public import Mathlib.Algebra.Polynomial.Module.AEval +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.LinearAlgebra.AnnihilatingPolynomial +public import Mathlib.LinearAlgebra.Matrix.Nondegenerate /-! # The normal basis theorem @@ -21,6 +23,8 @@ The proof follows [ConradLinearChar] Keith Conrad, *Linear Independence of Chara -/ +@[expose] public section + variable (K L : Type*) [Field K] [Field L] [Algebra K L] open Polynomial FiniteField Module Submodule LinearMap in diff --git a/Mathlib/FieldTheory/Galois/Notation.lean b/Mathlib/FieldTheory/Galois/Notation.lean index 00f454259cc715..f001b378c0ed24 100644 --- a/Mathlib/FieldTheory/Galois/Notation.lean +++ b/Mathlib/FieldTheory/Galois/Notation.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Algebra.Equiv -import Lean.PrettyPrinter.Delaborator.Basic +module + +public import Mathlib.Algebra.Algebra.Equiv +public import Lean.PrettyPrinter.Delaborator.Basic /-! # Notation for Galois group @@ -16,6 +18,8 @@ Although this notation works for all automorphism groups of algebras, we should notation when `L/K` is an extension of fields. -/ +@[expose] public section + section Notation /-- @@ -33,7 +37,7 @@ macro "Gal(" L:term:100 "/" K:term ")" : term => `($L ≃ₐ[$K] $L) open Lean PrettyPrinter.Delaborator SubExpr in /-- Pretty printer for the `Gal(L/K)` notation. -/ @[app_delab AlgEquiv] -partial def delabGal : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do +meta def delabGal : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do -- After Lean 4.19 the pretty printer clears local instances, so we re-add them here. -- TODO: remove this once the behavior changes. -- See [Zulip](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/Bug.3F.20Local.20instances.20not.20populated.20during.20delaboration/with/544850819). diff --git a/Mathlib/FieldTheory/Galois/Profinite.lean b/Mathlib/FieldTheory/Galois/Profinite.lean index 212b294e172a8b..767ccaf966bf79 100644 --- a/Mathlib/FieldTheory/Galois/Profinite.lean +++ b/Mathlib/FieldTheory/Galois/Profinite.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan, Yuyang Zhao, Jujian Zhang -/ +module -import Mathlib.FieldTheory.KrullTopology -import Mathlib.FieldTheory.Galois.GaloisClosure -import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Basic +public import Mathlib.FieldTheory.KrullTopology +public import Mathlib.FieldTheory.Galois.GaloisClosure +public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Basic /-! @@ -16,7 +17,7 @@ In this file, we prove that given a field extension `K/k`, there is a continuous `Gal(K/k)` and the limit of `Gal(L/k)`, where `L` is a finite Galois intermediate field ordered by inverse inclusion, thus making `Gal(K/k)` profinite as a limit of finite groups. -# Main definitions and results +## Main definitions and results In a field extension `K/k` @@ -52,6 +53,8 @@ In a field extension `K/k` -/ +@[expose] public section + open CategoryTheory Opposite variable {k K : Type*} [Field k] [Field K] [Algebra k K] diff --git a/Mathlib/FieldTheory/IntermediateField/Adjoin/Algebra.lean b/Mathlib/FieldTheory/IntermediateField/Adjoin/Algebra.lean index 01b03eaa9a13ea..f66d68b4a63f50 100644 --- a/Mathlib/FieldTheory/IntermediateField/Adjoin/Algebra.lean +++ b/Mathlib/FieldTheory/IntermediateField/Adjoin/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz -/ -import Mathlib.FieldTheory.Finiteness -import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs -import Mathlib.FieldTheory.IntermediateField.Algebraic +module + +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs +public import Mathlib.FieldTheory.IntermediateField.Algebraic /-! # Adjoining Elements to Fields @@ -13,6 +15,8 @@ import Mathlib.FieldTheory.IntermediateField.Algebraic This file relates `IntermediateField.adjoin` to `Algebra.adjoin`. -/ +@[expose] public section + open Module Polynomial namespace IntermediateField diff --git a/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean b/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean index 3ee8253cfa2cef..a1807e5a93c4fd 100644 --- a/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz -/ -import Mathlib.Algebra.Algebra.Subalgebra.Directed -import Mathlib.Algebra.Algebra.Subalgebra.IsSimpleOrder -import Mathlib.FieldTheory.Separable -import Mathlib.FieldTheory.SplittingField.IsSplittingField -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.RingTheory.Adjoin.Dimension -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Directed +public import Mathlib.Algebra.Algebra.Subalgebra.IsSimpleOrder +public import Mathlib.FieldTheory.Separable +public import Mathlib.FieldTheory.SplittingField.IsSplittingField +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.RingTheory.Adjoin.Dimension +public import Mathlib.RingTheory.TensorProduct.Finite /-! # Adjoining Elements to Fields @@ -17,6 +19,8 @@ import Mathlib.RingTheory.TensorProduct.Finite This file contains many results about adjoining elements to fields. -/ +@[expose] public section + open Module Polynomial namespace IntermediateField diff --git a/Mathlib/FieldTheory/IntermediateField/Adjoin/Defs.lean b/Mathlib/FieldTheory/IntermediateField/Adjoin/Defs.lean index 6c96f3234d367f..a2662f5627fced 100644 --- a/Mathlib/FieldTheory/IntermediateField/Adjoin/Defs.lean +++ b/Mathlib/FieldTheory/IntermediateField/Adjoin/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz -/ -import Mathlib.FieldTheory.IntermediateField.Basic +module + +public import Mathlib.FieldTheory.IntermediateField.Basic /-! # Adjoining Elements to Fields @@ -17,6 +19,8 @@ For example, `Algebra.adjoin K {x}` might not include `x⁻¹`. - `F⟮α⟯`: adjoin a single element `α` to `F` (in scope `IntermediateField`). -/ +@[expose] public section + open Module Polynomial namespace IntermediateField @@ -503,7 +507,7 @@ end open Lean in /-- Supporting function for the `F⟮x₁,x₂,...,xₙ⟯` adjunction notation. -/ -private partial def mkInsertTerm {m : Type → Type} [Monad m] [MonadQuotation m] +private meta def mkInsertTerm {m : Type → Type} [Monad m] [MonadQuotation m] (xs : TSyntaxArray `term) : m Term := run 0 where run (i : Nat) : m Term := do if h : i + 1 = xs.size then @@ -519,7 +523,7 @@ scoped macro:max K:term "⟮" xs:term,* "⟯" : term => do ``(adjoin $K $(← mk open Lean PrettyPrinter.Delaborator SubExpr in @[app_delab IntermediateField.adjoin] -partial def delabAdjoinNotation : Delab := whenPPOption getPPNotation do +meta def delabAdjoinNotation : Delab := whenPPOption getPPNotation do let e ← getExpr guard <| e.isAppOfArity ``adjoin 6 let F ← withNaryArg 0 delab diff --git a/Mathlib/FieldTheory/IntermediateField/Algebraic.lean b/Mathlib/FieldTheory/IntermediateField/Algebraic.lean index 930597bd85cf48..b91cb341f7b8fa 100644 --- a/Mathlib/FieldTheory/IntermediateField/Algebraic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Algebraic.lean @@ -3,16 +3,20 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.FieldTheory.IntermediateField.Basic -import Mathlib.FieldTheory.Minpoly.Basic -import Mathlib.FieldTheory.Tower -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.RingTheory.Algebraic.Integral +module + +public import Mathlib.FieldTheory.IntermediateField.Basic +public import Mathlib.FieldTheory.Minpoly.Basic +public import Mathlib.FieldTheory.Tower +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.RingTheory.Algebraic.Integral /-! # Results on finite dimensionality and algebraicity of intermediate fields. -/ +@[expose] public section + open Module variable {K L : Type*} [Field K] [Field L] [Algebra K L] diff --git a/Mathlib/FieldTheory/IntermediateField/Basic.lean b/Mathlib/FieldTheory/IntermediateField/Basic.lean index 2ff7efcb7fdef1..687faa0c33e837 100644 --- a/Mathlib/FieldTheory/IntermediateField/Basic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Algebra.Field.IsField -import Mathlib.Algebra.Field.Subfield.Basic -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.RingTheory.LocalRing.Basic +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Algebra.Field.Subfield.Basic +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.RingTheory.LocalRing.Basic /-! # Intermediate fields @@ -37,6 +39,8 @@ A `Subalgebra` is closed under all operations except `⁻¹`, intermediate field, field extension -/ +@[expose] public section + open Polynomial diff --git a/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean b/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean index 1205fd25f10772..9468d3d1bdd7ab 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.Data.Multiset.Fintype -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.FieldTheory.SplittingField.Construction +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.Data.Multiset.Fintype +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.FieldTheory.SplittingField.Construction /-! # Algebraic Closure @@ -27,6 +29,8 @@ In this file we construct the algebraic closure of a field algebraic closure, algebraically closed -/ +@[expose] public section + universe u v w noncomputable section diff --git a/Mathlib/FieldTheory/IsAlgClosed/Basic.lean b/Mathlib/FieldTheory/IsAlgClosed/Basic.lean index 00de2ce797b6c4..b1f9201a99d146 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/Basic.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.FieldTheory.Extension -import Mathlib.FieldTheory.Normal.Defs -import Mathlib.FieldTheory.Perfect -import Mathlib.RingTheory.Localization.Integral +module + +public import Mathlib.FieldTheory.Extension +public import Mathlib.FieldTheory.Normal.Defs +public import Mathlib.FieldTheory.Perfect +public import Mathlib.RingTheory.Localization.Integral /-! # Algebraically Closed Field @@ -44,6 +46,8 @@ algebraic closure, algebraically closed -/ +@[expose] public section + universe u v w open Polynomial diff --git a/Mathlib/FieldTheory/IsAlgClosed/Classification.lean b/Mathlib/FieldTheory/IsAlgClosed/Classification.lean index da0f5e894670d1..f68f24028abb3f 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/Classification.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/Classification.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Algebra.ZMod -import Mathlib.Algebra.Field.ZMod -import Mathlib.Algebra.MvPolynomial.Cardinal -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.RingTheory.Algebraic.Cardinality -import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis +module + +public import Mathlib.Algebra.Algebra.ZMod +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.Algebra.MvPolynomial.Cardinal +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.RingTheory.Algebraic.Cardinality +public import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis /-! # Classification of Algebraically closed fields @@ -23,6 +25,8 @@ This file contains results related to classifying algebraically closed fields. are isomorphic if they have the same characteristic and the same cardinality. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/FieldTheory/IsAlgClosed/Spectrum.lean b/Mathlib/FieldTheory/IsAlgClosed/Spectrum.lean index 7f55a12bb9690c..035153d2f61387 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/Spectrum.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/Spectrum.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum -import Mathlib.FieldTheory.IsAlgClosed.Basic +module + +public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum +public import Mathlib.FieldTheory.IsAlgClosed.Basic /-! # Spectrum mapping theorem @@ -33,6 +35,8 @@ eigenvalue. * `σ a` : `spectrum R a` of `a : A` -/ +@[expose] public section + namespace spectrum open Set Polynomial diff --git a/Mathlib/FieldTheory/IsPerfectClosure.lean b/Mathlib/FieldTheory/IsPerfectClosure.lean index d30a9c43625757..c6693c2de56a75 100644 --- a/Mathlib/FieldTheory/IsPerfectClosure.lean +++ b/Mathlib/FieldTheory/IsPerfectClosure.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.PurelyInseparable.Basic -import Mathlib.FieldTheory.PerfectClosure +module + +public import Mathlib.FieldTheory.PurelyInseparable.Basic +public import Mathlib.FieldTheory.PerfectClosure /-! @@ -60,6 +62,8 @@ perfect ring, perfect closure, purely inseparable -/ +@[expose] public section + open Module Polynomial IntermediateField Field noncomputable section diff --git a/Mathlib/FieldTheory/IsSepClosed.lean b/Mathlib/FieldTheory/IsSepClosed.lean index 63d35eca4ac3ba..e08b1b8e37786a 100644 --- a/Mathlib/FieldTheory/IsSepClosed.lean +++ b/Mathlib/FieldTheory/IsSepClosed.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.Galois.Basic +module + +public import Mathlib.FieldTheory.Galois.Basic /-! # Separably Closed Field @@ -47,6 +49,8 @@ separable closure, separably closed -/ +@[expose] public section + universe u v w open Polynomial diff --git a/Mathlib/FieldTheory/Isaacs.lean b/Mathlib/FieldTheory/Isaacs.lean index 07ce1492b4dc2d..5faef30cecbf5e 100644 --- a/Mathlib/FieldTheory/Isaacs.lean +++ b/Mathlib/FieldTheory/Isaacs.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.FieldTheory.Normal.Basic -import Mathlib.FieldTheory.PrimitiveElement -import Mathlib.GroupTheory.CosetCover +module + +public import Mathlib.FieldTheory.Normal.Basic +public import Mathlib.FieldTheory.PrimitiveElement +public import Mathlib.GroupTheory.CosetCover /-! # Algebraic extensions are determined by their sets of minimal polynomials up to isomorphism @@ -27,6 +29,8 @@ The American Mathematical Monthly -/ +@[expose] public section + namespace Field open Polynomial IntermediateField diff --git a/Mathlib/FieldTheory/JacobsonNoether.lean b/Mathlib/FieldTheory/JacobsonNoether.lean index a80b2c31bc0c07..90641528858837 100644 --- a/Mathlib/FieldTheory/JacobsonNoether.lean +++ b/Mathlib/FieldTheory/JacobsonNoether.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 F. Nuccio, H. Zheng, W. He, S. Wu, Y. Yuan, W. Jiao. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Filippo A. E. Nuccio, Huanyu Zheng, Sihan Wu, Wanyi He, Weichen Jiao, Yi Yuan -/ -import Mathlib.Algebra.Central.Defs -import Mathlib.Algebra.CharP.LinearMaps -import Mathlib.Algebra.CharP.Subring -import Mathlib.Algebra.GroupWithZero.Conj -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.FieldTheory.PurelyInseparable.Basic +module + +public import Mathlib.Algebra.Central.Defs +public import Mathlib.Algebra.CharP.LinearMaps +public import Mathlib.Algebra.CharP.Subring +public import Mathlib.Algebra.GroupWithZero.Conj +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.FieldTheory.PurelyInseparable.Basic /-! # The Jacobson-Noether theorem @@ -46,6 +48,8 @@ separate variables constrained by certain relations. * -/ +@[expose] public section + namespace JacobsonNoether variable {D : Type*} [DivisionRing D] [Algebra.IsAlgebraic (Subring.center D) D] diff --git a/Mathlib/FieldTheory/KrullTopology.lean b/Mathlib/FieldTheory/KrullTopology.lean index 9cc1b7ff95b67a..6204fe62e18565 100644 --- a/Mathlib/FieldTheory/KrullTopology.lean +++ b/Mathlib/FieldTheory/KrullTopology.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Sebastian Monnet. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Monnet -/ -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.Topology.Algebra.FilterBasis -import Mathlib.Topology.Algebra.OpenSubgroup +module + +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.Topology.Algebra.FilterBasis +public import Mathlib.Topology.Algebra.OpenSubgroup /-! # Krull topology @@ -55,6 +57,8 @@ all intermediate fields `E` with `E/K` finite dimensional. - `krullTopology K L` is defined as an instance for type class inference. -/ +@[expose] public section + open scoped Pointwise /-- Given a field extension `L/K`, `finiteExts K L` is the set of @@ -116,7 +120,7 @@ def galGroupBasis (K L : Type*) [Field K] [Field L] [Algebra K L] : rw [IntermediateField.mem_fixingSubgroup_iff] intro x hx change σ (g (σ⁻¹ x)) = x - have h_in_F : σ⁻¹ x ∈ F := ⟨x, hx, by dsimp; rw [← AlgEquiv.invFun_eq_symm]; rfl⟩ + have h_in_F : σ⁻¹ x ∈ F := ⟨x, hx, by dsimp⟩ have h_g_fix : g (σ⁻¹ x) = σ⁻¹ x := by rw [Subgroup.mem_carrier, IntermediateField.mem_fixingSubgroup_iff F g] at hg exact hg (σ⁻¹ x) h_in_F diff --git a/Mathlib/FieldTheory/KummerExtension.lean b/Mathlib/FieldTheory/KummerExtension.lean index e64c4c5bda2c9d..ee4394980c8ea8 100644 --- a/Mathlib/FieldTheory/KummerExtension.lean +++ b/Mathlib/FieldTheory/KummerExtension.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Andrew Yang, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.FieldTheory.KummerPolynomial -import Mathlib.LinearAlgebra.Eigenspace.Minpoly -import Mathlib.RingTheory.Norm.Basic +module + +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.FieldTheory.KummerPolynomial +public import Mathlib.LinearAlgebra.Eigenspace.Minpoly +public import Mathlib.RingTheory.Norm.Basic /-! # Kummer Extensions @@ -43,6 +45,8 @@ TODO: criteria for even `n`. See [serge_lang_algebra] VI,§9. TODO: relate Kummer extensions of degree 2 with the class `Algebra.IsQuadraticExtension`. -/ + +@[expose] public section universe u variable {K : Type u} [Field K] diff --git a/Mathlib/FieldTheory/KummerPolynomial.lean b/Mathlib/FieldTheory/KummerPolynomial.lean index 90bc67706fe48c..30f9b324bc6e8c 100644 --- a/Mathlib/FieldTheory/KummerPolynomial.lean +++ b/Mathlib/FieldTheory/KummerPolynomial.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Andrew Yang, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.AdjoinRoot -import Mathlib.RingTheory.Norm.Defs +module + +public import Mathlib.RingTheory.AdjoinRoot +public import Mathlib.RingTheory.Norm.Defs /-! # Irreducibility of X ^ p - a @@ -14,6 +16,8 @@ import Mathlib.RingTheory.Norm.Defs `-4` is not a 4th power. -/ + +@[expose] public section universe u variable {K : Type u} [Field K] diff --git a/Mathlib/FieldTheory/Laurent.lean b/Mathlib/FieldTheory/Laurent.lean index 5aa467b32d5025..f1b9411c0aa56e 100644 --- a/Mathlib/FieldTheory/Laurent.lean +++ b/Mathlib/FieldTheory/Laurent.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Polynomial.Taylor -import Mathlib.FieldTheory.RatFunc.AsPolynomial +module + +public import Mathlib.Algebra.Polynomial.Taylor +public import Mathlib.FieldTheory.RatFunc.AsPolynomial /-! # Laurent expansions of rational functions @@ -21,6 +23,8 @@ An auxiliary definition is provided first to make the construction of the `AlgHo which works on `CommRing` which are not necessarily domains. -/ +@[expose] public section + universe u diff --git a/Mathlib/FieldTheory/LinearDisjoint.lean b/Mathlib/FieldTheory/LinearDisjoint.lean index ac9de803f11dfc..ecc0bf62cdef1b 100644 --- a/Mathlib/FieldTheory/LinearDisjoint.lean +++ b/Mathlib/FieldTheory/LinearDisjoint.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.RingTheory.AlgebraicIndependent.RankAndCardinality -import Mathlib.RingTheory.LinearDisjoint +module + +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.RingTheory.AlgebraicIndependent.RankAndCardinality +public import Mathlib.RingTheory.LinearDisjoint /-! @@ -131,6 +133,8 @@ linearly disjoint, linearly independent, tensor product -/ +@[expose] public section + open scoped TensorProduct open Module IntermediateField diff --git a/Mathlib/FieldTheory/Minpoly/Basic.lean b/Mathlib/FieldTheory/Minpoly/Basic.lean index d389e77d67306e..296ece5cd6d4a7 100644 --- a/Mathlib/FieldTheory/Minpoly/Basic.lean +++ b/Mathlib/FieldTheory/Minpoly/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johan Commelin -/ -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +module + +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic /-! # Minimal polynomials @@ -14,6 +16,8 @@ such as irreducibility under the assumption `B` is a domain. -/ +@[expose] public section + open Polynomial Set Function @@ -158,7 +162,7 @@ theorem unique' {p : A[X]} (hm : p.Monic) (hp : Polynomial.aeval x p = 0) open Polynomial in /-- If a monic polynomial `p : A[X]` of degree `n` annihilates an element `x` in an `A`-algebra `B`, -such that `{xⁱ | 0 ≤ i < n} is linearly independent over `A`, then `p` is the minimal polynomial +such that `{xⁱ | 0 ≤ i < n}` is linearly independent over `A`, then `p` is the minimal polynomial of `x` over `A`. -/ theorem eq_of_linearIndependent {p : A[X]} (monic : p.Monic) (hp0 : p.aeval x = 0) (n : ℕ) (hpn : p.degree = n) (ind : LinearIndependent A fun i : Fin n ↦ x ^ i.val) : diff --git a/Mathlib/FieldTheory/Minpoly/ConjRootClass.lean b/Mathlib/FieldTheory/Minpoly/ConjRootClass.lean index a1f5665fa11d99..9f033535a59ad5 100644 --- a/Mathlib/FieldTheory/Minpoly/ConjRootClass.lean +++ b/Mathlib/FieldTheory/Minpoly/ConjRootClass.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.FieldTheory.Minpoly.IsConjRoot +module + +public import Mathlib.FieldTheory.Minpoly.IsConjRoot /-! # Conjugate root classes @@ -12,6 +14,8 @@ In this file, we define the `ConjRootClass` of a field extension `L / K` as the the relation `IsConjRoot K`. -/ +@[expose] public section + variable (K L S : Type*) [Field K] [Field L] [Field S] variable [Algebra K L] [Algebra K S] [Algebra L S] [IsScalarTower K L S] diff --git a/Mathlib/FieldTheory/Minpoly/Field.lean b/Mathlib/FieldTheory/Minpoly/Field.lean index fd3338f58a1bcd..f49ab099e08b32 100644 --- a/Mathlib/FieldTheory/Minpoly/Field.lean +++ b/Mathlib/FieldTheory/Minpoly/Field.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Johan Commelin -/ -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.Algebra.Polynomial.Lifts -import Mathlib.FieldTheory.Minpoly.Basic -import Mathlib.RingTheory.Algebraic.Integral -import Mathlib.RingTheory.LocalRing.Basic +module + +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.Algebra.Polynomial.Lifts +public import Mathlib.FieldTheory.Minpoly.Basic +public import Mathlib.RingTheory.Algebraic.Integral +public import Mathlib.RingTheory.LocalRing.Basic /-! # Minimal polynomials on an algebra over a field @@ -18,6 +20,8 @@ are irreducible, and uniquely determined by their defining property. -/ +@[expose] public section + open Polynomial Set Function minpoly diff --git a/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean b/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean index 1968e6f54a55ad..82dd0bdb02532d 100644 --- a/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean +++ b/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang -/ -import Mathlib.FieldTheory.Extension -import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic -import Mathlib.FieldTheory.Minpoly.Basic -import Mathlib.FieldTheory.Normal.Defs +module + +public import Mathlib.FieldTheory.Extension +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic +public import Mathlib.FieldTheory.Minpoly.Basic +public import Mathlib.FieldTheory.Normal.Defs /-! # Conjugate roots @@ -36,6 +38,8 @@ over `K` if they have the same minimal polynomial over `K`. conjugate root, minimal polynomial -/ +@[expose] public section + open Polynomial minpoly IntermediateField diff --git a/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean b/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean index baf1ef804376f0..6237f483151307 100644 --- a/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean +++ b/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Paul Lezeau, Junyan Xu -/ -import Mathlib.RingTheory.AdjoinRoot -import Mathlib.FieldTheory.Minpoly.Field -import Mathlib.RingTheory.Polynomial.GaussLemma +module + +public import Mathlib.RingTheory.AdjoinRoot +public import Mathlib.FieldTheory.Minpoly.Field +public import Mathlib.RingTheory.Polynomial.GaussLemma /-! # Minimal polynomials over a GCD monoid @@ -26,6 +28,8 @@ This file specializes the theory of minpoly to the case of an algebra over a GCD -/ +@[expose] public section + open Polynomial Set Function minpoly namespace minpoly diff --git a/Mathlib/FieldTheory/Minpoly/MinpolyDiv.lean b/Mathlib/FieldTheory/Minpoly/MinpolyDiv.lean index faeeabafc24281..c43a97839ee988 100644 --- a/Mathlib/FieldTheory/Minpoly/MinpolyDiv.lean +++ b/Mathlib/FieldTheory/Minpoly/MinpolyDiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed -import Mathlib.FieldTheory.PrimitiveElement -import Mathlib.FieldTheory.IsAlgClosed.Basic +module + +public import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed +public import Mathlib.FieldTheory.PrimitiveElement +public import Mathlib.FieldTheory.IsAlgClosed.Basic /-! # Results about `minpoly R x / (X - C x)` @@ -20,6 +22,8 @@ See `traceForm_dualBasis_powerBasis_eq`. - `span_coeff_minpolyDiv`: The coefficients of `minpolyDiv` spans `R`. -/ +@[expose] public section + open Polynomial Module variable (R K) {L S} [CommRing R] [Field K] [Field L] [CommRing S] [Algebra R S] [Algebra K L] diff --git a/Mathlib/FieldTheory/MvRatFunc/Rank.lean b/Mathlib/FieldTheory/MvRatFunc/Rank.lean index 8843b5d78d6fc2..feec2dec7566d4 100644 --- a/Mathlib/FieldTheory/MvRatFunc/Rank.lean +++ b/Mathlib/FieldTheory/MvRatFunc/Rank.lean @@ -3,16 +3,20 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.MvPolynomial.Cardinal -import Mathlib.RingTheory.Algebraic.LinearIndependent -import Mathlib.RingTheory.Algebraic.MvPolynomial -import Mathlib.RingTheory.Localization.Cardinality -import Mathlib.RingTheory.MvPolynomial +module + +public import Mathlib.Algebra.MvPolynomial.Cardinal +public import Mathlib.RingTheory.Algebraic.LinearIndependent +public import Mathlib.RingTheory.Algebraic.MvPolynomial +public import Mathlib.RingTheory.Localization.Cardinality +public import Mathlib.RingTheory.MvPolynomial /-! # Rank of multivariate rational function field -/ +@[expose] public section + noncomputable section universe u v diff --git a/Mathlib/FieldTheory/Normal/Basic.lean b/Mathlib/FieldTheory/Normal/Basic.lean index 64f5f8e5a7411d..4370de211c79d0 100644 --- a/Mathlib/FieldTheory/Normal/Basic.lean +++ b/Mathlib/FieldTheory/Normal/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Thomas Browning, Patrick Lutz -/ -import Mathlib.FieldTheory.Extension -import Mathlib.FieldTheory.Normal.Defs -import Mathlib.GroupTheory.Solvable -import Mathlib.FieldTheory.SplittingField.Construction +module + +public import Mathlib.FieldTheory.Extension +public import Mathlib.FieldTheory.Normal.Defs +public import Mathlib.GroupTheory.Solvable +public import Mathlib.FieldTheory.SplittingField.Construction /-! # Normal field extensions @@ -22,6 +24,8 @@ is the same as being a splitting field (`Normal.of_isSplittingField` and -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/FieldTheory/Normal/Closure.lean b/Mathlib/FieldTheory/Normal/Closure.lean index 1f0b94154fb43f..203e9e69bfa49f 100644 --- a/Mathlib/FieldTheory/Normal/Closure.lean +++ b/Mathlib/FieldTheory/Normal/Closure.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ +module -import Mathlib.RingTheory.SimpleRing.Basic -import Mathlib.FieldTheory.Normal.Basic -import Mathlib.Order.Closure -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +public import Mathlib.RingTheory.SimpleRing.Basic +public import Mathlib.FieldTheory.Normal.Basic +public import Mathlib.Order.Closure +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # Normal closures @@ -26,6 +27,8 @@ abovementioned splitting condition, in particular if `L/K/F` form a tower and `L/F` is normal. -/ +@[expose] public section + open IntermediateField IsScalarTower Polynomial variable (F K L : Type*) [Field F] [Field K] [Field L] [Algebra F K] [Algebra F L] diff --git a/Mathlib/FieldTheory/Normal/Defs.lean b/Mathlib/FieldTheory/Normal/Defs.lean index c051e69d393213..9e5c53dfaa69a0 100644 --- a/Mathlib/FieldTheory/Normal/Defs.lean +++ b/Mathlib/FieldTheory/Normal/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Thomas Browning, Patrick Lutz -/ -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.FieldTheory.Galois.Notation -import Mathlib.FieldTheory.IntermediateField.Basic -import Mathlib.FieldTheory.Minpoly.Field +module + +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.FieldTheory.Galois.Notation +public import Mathlib.FieldTheory.IntermediateField.Basic +public import Mathlib.FieldTheory.Minpoly.Field /-! # Normal field extensions @@ -18,6 +20,8 @@ In this file we define normal field extensions. - `Normal F K` where `K` is a field extension of `F`. -/ +@[expose] public section + noncomputable section open Polynomial IsScalarTower diff --git a/Mathlib/FieldTheory/NormalizedTrace.lean b/Mathlib/FieldTheory/NormalizedTrace.lean index 64378a37b7964e..9f4907ea388534 100644 --- a/Mathlib/FieldTheory/NormalizedTrace.lean +++ b/Mathlib/FieldTheory/NormalizedTrace.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Michal Staromiejski. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michal Staromiejski -/ -import Mathlib.RingTheory.Trace.Basic +module + +public import Mathlib.RingTheory.Trace.Basic /-! @@ -31,6 +33,8 @@ integral) extension of `F`. -/ +@[expose] public section + namespace Algebra variable (F K : Type*) [Field F] [Field K] [Algebra F K] diff --git a/Mathlib/FieldTheory/Perfect.lean b/Mathlib/FieldTheory/Perfect.lean index f5aaa32f17458e..826e4f4a1712c8 100644 --- a/Mathlib/FieldTheory/Perfect.lean +++ b/Mathlib/FieldTheory/Perfect.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.CharP.Basic -import Mathlib.Algebra.CharP.Reduced -import Mathlib.FieldTheory.KummerPolynomial -import Mathlib.FieldTheory.Separable +module + +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.Algebra.CharP.Reduced +public import Mathlib.FieldTheory.KummerPolynomial +public import Mathlib.FieldTheory.Separable /-! @@ -33,6 +35,8 @@ prime characteristic. -/ +@[expose] public section + open Function Polynomial /-- A perfect ring of characteristic `p` (prime) in the sense of Serre. diff --git a/Mathlib/FieldTheory/PerfectClosure.lean b/Mathlib/FieldTheory/PerfectClosure.lean index f24cd51580e9cf..e215bf3872b169 100644 --- a/Mathlib/FieldTheory/PerfectClosure.lean +++ b/Mathlib/FieldTheory/PerfectClosure.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov -/ -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.FieldTheory.Perfect +module + +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.FieldTheory.Perfect /-! @@ -47,6 +49,8 @@ perfect ring, perfect closure -/ +@[expose] public section + universe u v open Function diff --git a/Mathlib/FieldTheory/PolynomialGaloisGroup.lean b/Mathlib/FieldTheory/PolynomialGaloisGroup.lean index bc7e94f885a5ef..d55cc59cca5606 100644 --- a/Mathlib/FieldTheory/PolynomialGaloisGroup.lean +++ b/Mathlib/FieldTheory/PolynomialGaloisGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz -/ -import Mathlib.FieldTheory.Galois.Basic +module + +public import Mathlib.FieldTheory.Galois.Basic /-! # Galois Groups of Polynomials @@ -35,6 +37,8 @@ equals the number of real roots plus the number of roots not fixed by complex co -/ +@[expose] public section + assert_not_exists Real noncomputable section diff --git a/Mathlib/FieldTheory/PrimeField.lean b/Mathlib/FieldTheory/PrimeField.lean new file mode 100644 index 00000000000000..06c7afa311f25f --- /dev/null +++ b/Mathlib/FieldTheory/PrimeField.lean @@ -0,0 +1,59 @@ +/- +Copyright (c) 2025 Xavier Roblot. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Xavier Roblot, Kenny Lau +-/ +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.CharP.IntermediateField +public import Mathlib.Algebra.Field.ZMod + +/-! +# Prime fields + +A prime field is a field that does not contain any nontrivial subfield. Prime fields are `ℚ` in +characteristic `0` and `ZMod p` in characteristic `p` with `p` a prime number. Any field `K` +contains a unique prime field: it is the smallest field contained in `K`. + +## Results + +* The fields `ℚ` and `ZMod p` are prime fields. These are stated as the instances that says that + the corresponding `Subfield` type is a `Subsingleton`. +* `Subfield.bot_eq_of_charZero` : the smallest subfield of a field of characteristic `0` is (the + image of) `ℚ`. +* `Subfield.bot_eq_of_zMod_algebra`: the smallest subfield of a field of characteristic `p` is (the + image of) `ZMod p`. + +-/ + +@[expose] public section + +instance : Subsingleton (Subfield ℚ) := subsingleton_of_top_le_bot fun x _ ↦ + have h := Subsingleton.elim ((⊥ : Subfield ℚ).subtype.comp (Rat.castHom _)) (.id _ : ℚ →+* ℚ) + (congr($h x) : _ = x) ▸ Subtype.prop _ + +instance (p : ℕ) [hp : Fact (Nat.Prime p)] : Subsingleton (Subfield (ZMod p)) := + subsingleton_of_top_le_bot fun x _ ↦ + have h := Subsingleton.elim ((⊥ : Subfield (ZMod p)).subtype.comp + (ZMod.castHom dvd_rfl _)) (.id _ : ZMod p →+* ZMod p) + (congr($h x) : _ = x) ▸ Subtype.prop _ + +/-- +The smallest subfield of a field of characteristic `0` is (the image of) `ℚ`. +-/ +theorem Subfield.bot_eq_of_charZero {K : Type*} [Field K] [CharZero K] : + (⊥ : Subfield K) = (algebraMap ℚ K).fieldRange := by + rw [eq_comm, eq_bot_iff, ← Subfield.map_bot (algebraMap ℚ K), + subsingleton_iff_bot_eq_top.mpr inferInstance, ← RingHom.fieldRange_eq_map] + +/-- +The smallest subfield of a field of characteristic `p` is (the image of) `ZMod p`. +Note that the fact that the field `K` is of characteristic `p` is stated by the fact that it is +`ZMod p`-algebra. +-/ +theorem Subfield.bot_eq_of_zMod_algebra {K : Type*} (p : ℕ) [hp : Fact (Nat.Prime p)] + [Field K] [Algebra (ZMod p) K] : + (⊥ : Subfield K) = (algebraMap (ZMod p) K).fieldRange := by + rw [eq_comm, eq_bot_iff, ← Subfield.map_bot (algebraMap (ZMod p) K), + subsingleton_iff_bot_eq_top.mpr inferInstance, ← RingHom.fieldRange_eq_map] diff --git a/Mathlib/FieldTheory/PrimitiveElement.lean b/Mathlib/FieldTheory/PrimitiveElement.lean index 06dad9b16a7206..a84da4e861bc3d 100644 --- a/Mathlib/FieldTheory/PrimitiveElement.lean +++ b/Mathlib/FieldTheory/PrimitiveElement.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Lutz -/ -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.FieldTheory.SplittingField.Construction -import Mathlib.RingTheory.IntegralDomain -import Mathlib.RingTheory.Polynomial.UniqueFactorization +module + +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.FieldTheory.SplittingField.Construction +public import Mathlib.RingTheory.IntegralDomain +public import Mathlib.RingTheory.Polynomial.UniqueFactorization /-! # Primitive Element Theorem @@ -37,6 +39,8 @@ exists_adjoin_simple_eq_top -/ +@[expose] public section + noncomputable section open Module Polynomial IntermediateField diff --git a/Mathlib/FieldTheory/PurelyInseparable/Basic.lean b/Mathlib/FieldTheory/PurelyInseparable/Basic.lean index d2f11c9f45a121..a758a0496e6521 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/Basic.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.CharP.IntermediateField -import Mathlib.FieldTheory.SeparableClosure +module + +public import Mathlib.Algebra.CharP.IntermediateField +public import Mathlib.FieldTheory.SeparableClosure /-! @@ -84,6 +86,8 @@ separable degree, degree, separable closure, purely inseparable -/ +@[expose] public section + open Module Polynomial IntermediateField Field noncomputable section diff --git a/Mathlib/FieldTheory/PurelyInseparable/Exponent.lean b/Mathlib/FieldTheory/PurelyInseparable/Exponent.lean index b363b51e6d46c4..56a83a22e7cd4c 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/Exponent.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/Exponent.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Michal Staromiejski. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michal Staromiejski -/ -import Mathlib.FieldTheory.PurelyInseparable.Basic +module + +public import Mathlib.FieldTheory.PurelyInseparable.Basic /-! @@ -36,6 +38,8 @@ purely inseparable -/ +@[expose] public section + namespace IsPurelyInseparable variable (F K L : Type*) diff --git a/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean b/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean index ab7a189d2f3664..0003d69e528d09 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.Algebra.CharP.IntermediateField -import Mathlib.FieldTheory.PurelyInseparable.Basic +module + +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.Algebra.CharP.IntermediateField +public import Mathlib.FieldTheory.PurelyInseparable.Basic /-! @@ -38,6 +40,8 @@ separable degree, degree, separable closure, purely inseparable -/ +@[expose] public section + open IntermediateField Module noncomputable section diff --git a/Mathlib/FieldTheory/PurelyInseparable/Tower.lean b/Mathlib/FieldTheory/PurelyInseparable/Tower.lean index 7c48323cae3aed..33947f2d96416b 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/Tower.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/Tower.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.LinearDisjoint -import Mathlib.FieldTheory.PurelyInseparable.PerfectClosure +module + +public import Mathlib.FieldTheory.LinearDisjoint +public import Mathlib.FieldTheory.PurelyInseparable.PerfectClosure /-! @@ -41,6 +43,8 @@ separable degree, degree, separable closure, purely inseparable -/ +@[expose] public section + open Polynomial IntermediateField Field noncomputable section diff --git a/Mathlib/FieldTheory/RatFunc/AsPolynomial.lean b/Mathlib/FieldTheory/RatFunc/AsPolynomial.lean index 654ec285df09a5..f77eaefa8225cf 100644 --- a/Mathlib/FieldTheory/RatFunc/AsPolynomial.lean +++ b/Mathlib/FieldTheory/RatFunc/AsPolynomial.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.FieldTheory.RatFunc.Basic -import Mathlib.RingTheory.EuclideanDomain -import Mathlib.RingTheory.DedekindDomain.AdicValuation -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Polynomial.Content +module + +public import Mathlib.FieldTheory.RatFunc.Basic +public import Mathlib.RingTheory.EuclideanDomain +public import Mathlib.RingTheory.DedekindDomain.AdicValuation +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Polynomial.Content /-! @@ -23,6 +25,8 @@ import Mathlib.RingTheory.Polynomial.Content regarded as an element of the height-one-spectrum. -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/FieldTheory/RatFunc/Basic.lean b/Mathlib/FieldTheory/RatFunc/Basic.lean index 5c98d774c690a0..b9064a6b439984 100644 --- a/Mathlib/FieldTheory/RatFunc/Basic.lean +++ b/Mathlib/FieldTheory/RatFunc/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.FieldTheory.RatFunc.Defs -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.Algebraic.Integral +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.FieldTheory.RatFunc.Defs +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.Algebraic.Integral /-! # The field structure of rational functions @@ -45,6 +47,8 @@ with the same condition on retaining the non-zero-divisor property across the ma `[CommRing K] [IsDomain K] [CommRing R] [IsDomain R]` -/ +@[expose] public section + universe u v noncomputable section diff --git a/Mathlib/FieldTheory/RatFunc/Defs.lean b/Mathlib/FieldTheory/RatFunc/Defs.lean index 52f4a9e76a012a..e17728dfd63ab9 100644 --- a/Mathlib/FieldTheory/RatFunc/Defs.lean +++ b/Mathlib/FieldTheory/RatFunc/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Algebra.Ring.NonZeroDivisors -import Mathlib.RingTheory.Localization.FractionRing +module + +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.Algebra.Ring.NonZeroDivisors +public import Mathlib.RingTheory.Localization.FractionRing /-! # The field of rational functions @@ -47,6 +49,8 @@ the codomain is not a field or even an integral domain. -/ +@[expose] public section + noncomputable section open scoped nonZeroDivisors Polynomial diff --git a/Mathlib/FieldTheory/RatFunc/Degree.lean b/Mathlib/FieldTheory/RatFunc/Degree.lean index 363d9658f2f3f8..0dc47eae366099 100644 --- a/Mathlib/FieldTheory/RatFunc/Degree.lean +++ b/Mathlib/FieldTheory/RatFunc/Degree.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.FieldTheory.RatFunc.AsPolynomial -import Mathlib.RingTheory.EuclideanDomain -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Polynomial.Content +module + +public import Mathlib.FieldTheory.RatFunc.AsPolynomial +public import Mathlib.RingTheory.EuclideanDomain +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Polynomial.Content /-! # The degree of rational functions @@ -18,6 +20,8 @@ We define the degree of a rational function, with values in `ℤ`: `intDegree 0 = 0`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/FieldTheory/Relrank.lean b/Mathlib/FieldTheory/Relrank.lean index 64b48181b46bf9..5876ef15656240 100644 --- a/Mathlib/FieldTheory/Relrank.lean +++ b/Mathlib/FieldTheory/Relrank.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic +module + +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic /-! @@ -25,6 +27,8 @@ This file contains basics about the relative rank of subfields and intermediate -/ +@[expose] public section + open Module Cardinal universe u v w diff --git a/Mathlib/FieldTheory/Separable.lean b/Mathlib/FieldTheory/Separable.lean index fb0775171882be..1114444064f161 100644 --- a/Mathlib/FieldTheory/Separable.lean +++ b/Mathlib/FieldTheory/Separable.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Polynomial.Expand -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.Algebra.Squarefree.Basic -import Mathlib.FieldTheory.IntermediateField.Basic -import Mathlib.FieldTheory.Minpoly.Field -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.PowerBasis -import Mathlib.Data.ENat.Lattice +module + +public import Mathlib.Algebra.Polynomial.Expand +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.Algebra.Squarefree.Basic +public import Mathlib.FieldTheory.IntermediateField.Basic +public import Mathlib.FieldTheory.Minpoly.Field +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.PowerBasis +public import Mathlib.Data.ENat.Lattice /-! @@ -29,6 +31,8 @@ properties about separable polynomials here. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/FieldTheory/SeparableClosure.lean b/Mathlib/FieldTheory/SeparableClosure.lean index 6019bf641d9491..981644594f8228 100644 --- a/Mathlib/FieldTheory/SeparableClosure.lean +++ b/Mathlib/FieldTheory/SeparableClosure.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.SeparableDegree -import Mathlib.FieldTheory.IsSepClosed +module + +public import Mathlib.FieldTheory.SeparableDegree +public import Mathlib.FieldTheory.IsSepClosed /-! @@ -59,6 +61,8 @@ separable degree, degree, separable closure -/ +@[expose] public section + open Module Polynomial IntermediateField Field noncomputable section diff --git a/Mathlib/FieldTheory/SeparableDegree.lean b/Mathlib/FieldTheory/SeparableDegree.lean index d269f911545146..f8bfdbfd49e762 100644 --- a/Mathlib/FieldTheory/SeparableDegree.lean +++ b/Mathlib/FieldTheory/SeparableDegree.lean @@ -3,14 +3,16 @@ Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.FieldTheory.SplittingField.Construction -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.FieldTheory.Separable -import Mathlib.FieldTheory.Normal.Closure -import Mathlib.RingTheory.AlgebraicIndependent.Adjoin -import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis -import Mathlib.RingTheory.Polynomial.SeparableDegree -import Mathlib.RingTheory.Polynomial.UniqueFactorization +module + +public import Mathlib.FieldTheory.SplittingField.Construction +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.FieldTheory.Separable +public import Mathlib.FieldTheory.Normal.Closure +public import Mathlib.RingTheory.AlgebraicIndependent.Adjoin +public import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis +public import Mathlib.RingTheory.Polynomial.SeparableDegree +public import Mathlib.RingTheory.Polynomial.UniqueFactorization /-! @@ -118,6 +120,8 @@ separable degree, degree, polynomial -/ +@[expose] public section + open Module Polynomial IntermediateField Field noncomputable section diff --git a/Mathlib/FieldTheory/SplittingField/Construction.lean b/Mathlib/FieldTheory/SplittingField/Construction.lean index e9f9230d00a148..4e90e52c8cab5c 100644 --- a/Mathlib/FieldTheory/SplittingField/Construction.lean +++ b/Mathlib/FieldTheory/SplittingField/Construction.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.FieldTheory.SplittingField.IsSplittingField -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.RingTheory.Algebraic.Basic +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.FieldTheory.SplittingField.IsSplittingField +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.RingTheory.Algebraic.Basic /-! # Splitting fields @@ -30,6 +32,8 @@ actual `SplittingField` will be a quotient of a `MvPolynomial`, it has nice inst -/ +@[expose] public section + noncomputable section universe u v w diff --git a/Mathlib/FieldTheory/SplittingField/IsSplittingField.lean b/Mathlib/FieldTheory/SplittingField/IsSplittingField.lean index ead1c7c9666551..c4fd5b8710be1b 100644 --- a/Mathlib/FieldTheory/SplittingField/IsSplittingField.lean +++ b/Mathlib/FieldTheory/SplittingField/IsSplittingField.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition -import Mathlib.RingTheory.Adjoin.Field +module + +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +public import Mathlib.RingTheory.Adjoin.Field /-! # Splitting fields @@ -28,6 +30,8 @@ if it is the smallest field extension of `K` such that `f` splits. -/ +@[expose] public section + noncomputable section universe u v w diff --git a/Mathlib/FieldTheory/Tower.lean b/Mathlib/FieldTheory/Tower.lean index 59cdb775f2ec47..ef66e6893ef5d6 100644 --- a/Mathlib/FieldTheory/Tower.lean +++ b/Mathlib/FieldTheory/Tower.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.Noetherian.Basic +module + +public import Mathlib.RingTheory.Noetherian.Basic /-! # Finiteness of `IsScalarTower` @@ -22,6 +24,8 @@ tower law -/ +@[expose] public section + universe u v w u₁ v₁ w₁ diff --git a/Mathlib/Geometry/Convex/Cone/Basic.lean b/Mathlib/Geometry/Convex/Cone/Basic.lean index c5771013c78446..b76dd63e35df52 100644 --- a/Mathlib/Geometry/Convex/Cone/Basic.lean +++ b/Mathlib/Geometry/Convex/Cone/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Frédéric Dupuis -/ -import Mathlib.Analysis.Convex.Hull +module + +public import Mathlib.Analysis.Convex.Hull /-! # Convex cones @@ -36,6 +38,8 @@ While `Convex R` is a predicate on sets, `ConvexCone R M` is a bundled convex co * [Emo Welzl and Bernd Gärtner, *Cone Programming*][welzl_garter] -/ +@[expose] public section + assert_not_exists TopologicalSpace Real Cardinal open Set LinearMap Pointwise diff --git a/Mathlib/Geometry/Convex/Cone/Dual.lean b/Mathlib/Geometry/Convex/Cone/Dual.lean index 66c902bf2ddf33..2bcbd743acbd8e 100644 --- a/Mathlib/Geometry/Convex/Cone/Dual.lean +++ b/Mathlib/Geometry/Convex/Cone/Dual.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Module.Submodule.Pointwise -import Mathlib.Geometry.Convex.Cone.Pointed +module + +public import Mathlib.Algebra.Module.Submodule.Pointwise +public import Mathlib.Geometry.Convex.Cone.Pointed /-! # The algebraic dual of a cone @@ -29,6 +31,8 @@ Furthermore, the strict version `{y | ∀ x ∈ s, 0 < p x y}` is a candidate to Deduce from `dual_flip_dual_dual_flip` that polyhedral cones are invariant under taking double duals -/ +@[expose] public section + assert_not_exists TopologicalSpace Real Cardinal open Function LinearMap Pointwise Set diff --git a/Mathlib/Geometry/Convex/Cone/Pointed.lean b/Mathlib/Geometry/Convex/Cone/Pointed.lean index 906eb8b630439f..085247a79d7261 100644 --- a/Mathlib/Geometry/Convex/Cone/Pointed.lean +++ b/Mathlib/Geometry/Convex/Cone/Pointed.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Apurva Nakade. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Apurva Nakade -/ -import Mathlib.Algebra.Order.Nonneg.Module -import Mathlib.Geometry.Convex.Cone.Basic +module + +public import Mathlib.Algebra.Order.Nonneg.Module +public import Mathlib.Geometry.Convex.Cone.Basic /-! # Pointed cones @@ -16,6 +18,8 @@ as it allows us to use the `Module` API to work with convex cones. -/ +@[expose] public section + assert_not_exists TopologicalSpace Real Cardinal variable {R E F G : Type*} diff --git a/Mathlib/Geometry/Convex/Cone/TensorProduct.lean b/Mathlib/Geometry/Convex/Cone/TensorProduct.lean new file mode 100644 index 00000000000000..a02ce75d481564 --- /dev/null +++ b/Mathlib/Geometry/Convex/Cone/TensorProduct.lean @@ -0,0 +1,107 @@ +/- +Copyright (c) 2025 Bjørn Solheim. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Bjørn Solheim +-/ +module + +public import Mathlib.Geometry.Convex.Cone.Dual +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.TensorProduct.Basic + +/-! +# Tensor products of cones + +Given ordered modules `M` and `N`, there are in general several distinct possible +orderings of the tensor product module `M ⊗ N`. Since the ordering of an ordered module +can be represented by its cone of nonnegative elements, there are likewise multiple +ways to construct a cone in `M ⊗ N` from cones in `M` and `N`. Such constructions +are referred to as tensor products of cones. + +"Sufficiently nice" candidates for tensor products of cones are bounded by the minimal +and maximal tensor products. These products are generally distinct but coincide in special cases. + +We define the minimal and maximal tensor products of pointed cones: + +* `minTensorProduct C₁ C₂`: all conical combinations of elementary tensor products + `x ⊗ₜ y` with `x ∈ C₁` and `y ∈ C₂`. +* `maxTensorProduct C₁ C₂`: the dual cone of the minimal tensor product of the dual cones. + +## Main results + +* `minTensorProduct_le_maxTensorProduct`: the minimal tensor product + is less than or equal to the maximal tensor product + +## Notation + +* no special notation defined +* x, y, z are elements of the (original) cones +* φ, ψ are elements of the dual cones + +## References + +* [Aubrun et al. *Entangleability of cones*][aubrunEntangleabilityCones2021] + +-/ + +@[expose] public section + +open TensorProduct Module + +variable {R : Type*} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] +variable {G : Type*} [AddCommGroup G] [Module R G] +variable {H : Type*} [AddCommGroup H] [Module R H] + +namespace PointedCone + +/-- The minimal tensor product of two cones is given by all conical combinations of elementary +tensor products `x ⊗ₜ y` with `x ∈ C₁` and `y ∈ C₂`. -/ +noncomputable def minTensorProduct (C₁ : PointedCone R G) (C₂ : PointedCone R H) : + PointedCone R (G ⊗[R] H) := + .span R (.image2 (· ⊗ₜ[R] ·) C₁ C₂) + +/-- The maximal tensor product of two cones is the dual (pointed cone) of the minimal tensor product +of the dual cones. -/ +noncomputable def maxTensorProduct (C₁ : PointedCone R G) (C₂ : PointedCone R H) : + PointedCone R (G ⊗[R] H) := + .dual (dualDistrib R G H) (minTensorProduct (.dual (dualPairing R G).flip C₁) + (.dual (dualPairing R H).flip C₂)) + +/-- Characterization of the maximal tensor product: `z` lies in `maxTensorProduct C₁ C₂` iff +all pairings with elementary dual tensors are nonnegative. -/ +@[simp] +theorem mem_maxTensorProduct {C₁ : PointedCone R G} {C₂ : PointedCone R H} {z : G ⊗[R] H} : + z ∈ maxTensorProduct (R := R) C₁ C₂ ↔ + ∀ φ ∈ PointedCone.dual (dualPairing R G).flip C₁, + ∀ ψ ∈ PointedCone.dual (dualPairing R H).flip C₂, + 0 ≤ dualDistrib R G H (φ ⊗ₜ[R] ψ) z := by + simp only [maxTensorProduct, minTensorProduct, dual_span, mem_dual, Set.forall_mem_image2] + rfl + +/-- Elementary tensors are members of the maximal tensor product. -/ +theorem tmul_mem_maxTensorProduct {x y} {C₁ : PointedCone R G} {C₂ : PointedCone R H} (hx : x ∈ C₁) + (hy : y ∈ C₂) : x ⊗ₜ[R] y ∈ maxTensorProduct C₁ C₂ := by + simp only [mem_maxTensorProduct, dualDistrib_apply] + exact fun φ hφ ψ hψ => mul_nonneg (hφ hx) (hψ hy) + +/-- Elementary tensors are members of the minimal tensor product. -/ +theorem tmul_mem_minTensorProduct {x y} {C₁ : PointedCone R G} {C₂ : PointedCone R H} (hx : x ∈ C₁) + (hy : y ∈ C₂) : x ⊗ₜ[R] y ∈ minTensorProduct C₁ C₂ := + Submodule.subset_span (Set.mem_image2_of_mem hx hy) + +/-- The maximal tensor product contains the set of all elementary tensors. -/ +theorem tmul_subset_maxTensorProduct (C₁ : PointedCone R G) (C₂ : PointedCone R H) : + .image2 (· ⊗ₜ[R] ·) C₁ C₂ ⊆ (maxTensorProduct C₁ C₂ : Set (G ⊗[R] H)) := + fun _ ⟨_, hx, _, hy, hz⟩ => hz ▸ tmul_mem_maxTensorProduct hx hy + +/-- The minimal tensor product contains the set of all elementary tensors. -/ +theorem tmul_subset_minTensorProduct (C₁ : PointedCone R G) (C₂ : PointedCone R H) : + .image2 (· ⊗ₜ[R] ·) C₁ C₂ ⊆ (minTensorProduct C₁ C₂ : Set (G ⊗[R] H)) := + fun _ ⟨_, hx, _, hy, hz⟩ => hz ▸ tmul_mem_minTensorProduct hx hy + +/-- The minimal tensor product is less than or equal to the maximal tensor product. -/ +theorem minTensorProduct_le_maxTensorProduct (C₁ : PointedCone R G) (C₂ : PointedCone R H) : + minTensorProduct C₁ C₂ ≤ maxTensorProduct C₁ C₂ := by + exact Submodule.span_le.mpr (tmul_subset_maxTensorProduct C₁ C₂) + +end PointedCone diff --git a/Mathlib/Geometry/Euclidean/Altitude.lean b/Mathlib/Geometry/Euclidean/Altitude.lean index 038234dc4fbe76..992a474ecff0da 100644 --- a/Mathlib/Geometry/Euclidean/Altitude.lean +++ b/Mathlib/Geometry/Euclidean/Altitude.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Projection -import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional -import Mathlib.Analysis.InnerProductSpace.Affine +module + +public import Mathlib.Geometry.Euclidean.Projection +public import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional +public import Mathlib.Analysis.InnerProductSpace.Affine /-! # Altitudes of a simplex @@ -27,6 +29,8 @@ This file defines the altitudes of a simplex and their feet. -/ +@[expose] public section + noncomputable section namespace Affine @@ -182,7 +186,7 @@ lemma height_pos {n : ℕ} [NeZero n] (s : Simplex ℝ P n) (i : Fin (n + 1)) : open Qq Mathlib.Meta.Positivity in /-- Extension for the `positivity` tactic: the height of a simplex is always positive. -/ @[positivity height _ _] -def evalHeight : PositivityExt where eval {u α} _ _ e := do +meta def evalHeight : PositivityExt where eval {u α} _ _ e := do match u, α, e with | 0, ~q(ℝ), ~q(@height $V $P $i1 $i2 $i3 $i4 $n $hn $s $i) => assertInstancesCommute diff --git a/Mathlib/Geometry/Euclidean/Angle/Bisector.lean b/Mathlib/Geometry/Euclidean/Angle/Bisector.lean index 2107d5559d0b11..51a613c296dae9 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Bisector.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Bisector.lean @@ -3,9 +3,12 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection -import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle -import Mathlib.Geometry.Euclidean.Projection +module + +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle +public import Mathlib.Geometry.Euclidean.Projection /-! # Angle bisectors. @@ -14,6 +17,8 @@ This file proves lemmas relating to bisecting angles. -/ +@[expose] public section + namespace EuclideanGeometry @@ -104,4 +109,108 @@ lemma dist_orthogonalProjection_eq_iff_angle_eq {p p' : P} {s₁ s₂ : AffineSu · rw [dist_orthogonalProjection_eq_infDist] exact Metric.infDist_le_dist_of_mem (SetLike.mem_coe.1 hp'.2) +section Oriented + +open Module + +variable [Fact (finrank ℝ V = 2)] [Module.Oriented ℝ V (Fin 2)] + +attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two + +-- See https://github.com/leanprover/lean4/issues/11182 for why hypotheses are after the colon. +/-- A point `p` is equidistant to two affine subspaces (typically lines, for this version of the +lemma) if the oriented angles at a point `p'` in their intersection between `p` and its orthogonal +projections onto the subspaces are equal. -/ +lemma dist_orthogonalProjection_eq_of_oangle_eq {p p' : P} {s₁ s₂ : AffineSubspace ℝ P} + (hp' : p' ∈ s₁ ⊓ s₂) : + haveI : Nonempty s₁ := ⟨p', hp'.1⟩ + haveI : Nonempty s₂ := ⟨p', hp'.2⟩ + orthogonalProjection s₁ p ≠ p' → + orthogonalProjection s₂ p ≠ p' → + ∡ (orthogonalProjection s₁ p : P) p' p = ∡ p p' (orthogonalProjection s₂ p) → + dist p (orthogonalProjection s₁ p) = dist p (orthogonalProjection s₂ p) := by + intro hp₁ hp₂ h + rw [dist_orthogonalProjection_eq_iff_angle_eq hp', angle_comm, + angle_eq_iff_oangle_eq_or_wbtw hp₁ hp₂] + exact .inl h + +-- See https://github.com/leanprover/lean4/issues/11182 for why hypotheses are after the colon. +/-- The oriented angles at a point `p'` in their intersection between `p` and its orthogonal +projections onto two affine subspaces (typically lines, for this version of the lemma) are equal +if `p` is equidistant to the two subspaces. -/ +lemma oangle_eq_of_dist_orthogonalProjection_eq {p p' : P} {s₁ s₂ : AffineSubspace ℝ P} + (hp' : p' ∈ s₁ ⊓ s₂) : + haveI : Nonempty s₁ := ⟨p', hp'.1⟩ + haveI : Nonempty s₂ := ⟨p', hp'.2⟩ + (orthogonalProjection s₁ p : P) ≠ orthogonalProjection s₂ p → + dist p (orthogonalProjection s₁ p) = dist p (orthogonalProjection s₂ p) → + ∡ (orthogonalProjection s₁ p : P) p' p = ∡ p p' (orthogonalProjection s₂ p) := by + intro hne h + haveI : Nonempty s₁ := ⟨p', hp'.1⟩ + haveI : Nonempty s₂ := ⟨p', hp'.2⟩ + haveI : Nonempty (s₁ ⊓ s₂ : AffineSubspace ℝ P) := ⟨p', hp'⟩ + have hp₁ : orthogonalProjection s₁ p ≠ p' := by + intro hp + rw [hp, ← sq_eq_sq₀ dist_nonneg dist_nonneg, pow_two, pow_two, dist_comm p p', + dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq p hp'.2, + add_eq_right, mul_eq_zero, dist_eq_zero, or_self] at h + grind + have hp₂ : orthogonalProjection s₂ p ≠ p' := by + intro hp + rw [hp, ← sq_eq_sq₀ dist_nonneg dist_nonneg, pow_two, pow_two, dist_comm p p', + dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq p hp'.1, + right_eq_add, mul_eq_zero, dist_eq_zero, or_self] at h + grind + have hc : ¬ Collinear ℝ {p', (orthogonalProjection s₁ p : P), + (orthogonalProjection s₂ p : P)} := by + intro hc + have h₁ : (orthogonalProjection s₁ p : P) ∈ line[ℝ, p', (orthogonalProjection s₂ p : P)] := + hc.mem_affineSpan_of_mem_of_ne (by grind) (by grind) (by grind) (by grind) + have h₁' : (orthogonalProjection s₁ p : P) ∈ s₁ ⊓ s₂ := + ⟨orthogonalProjection_mem _, + SetLike.le_def.1 (affineSpan_pair_le_of_mem_of_mem hp'.2 (orthogonalProjection_mem _)) h₁⟩ + have h₁'' : (orthogonalProjection s₁ p : P) = (orthogonalProjection (s₁ ⊓ s₂) p : P) := by + rw [← orthogonalProjection_orthogonalProjection_of_le inf_le_left, eq_comm, + orthogonalProjection_eq_self_iff] + grind + have h₂ : (orthogonalProjection s₂ p : P) ∈ line[ℝ, p', (orthogonalProjection s₁ p : P)] := + hc.mem_affineSpan_of_mem_of_ne (by grind) (by grind) (by grind) (by grind) + have h₂' : (orthogonalProjection s₂ p : P) ∈ s₁ ⊓ s₂ := + ⟨SetLike.le_def.1 (affineSpan_pair_le_of_mem_of_mem hp'.1 (orthogonalProjection_mem _)) h₂, + orthogonalProjection_mem _⟩ + have h₂'' : (orthogonalProjection s₂ p : P) = (orthogonalProjection (s₁ ⊓ s₂) p : P) := by + rw [← orthogonalProjection_orthogonalProjection_of_le inf_le_right, eq_comm, + orthogonalProjection_eq_self_iff] + grind + apply hne + rw [h₁'', h₂''] + rw [dist_orthogonalProjection_eq_iff_angle_eq hp', angle_comm, + angle_eq_iff_oangle_eq_or_wbtw hp₁ hp₂] at h + rcases h with h | h | h + · exact h + · exfalso + exact hc h.collinear + · exfalso + have h' := h.collinear + rw [Set.pair_comm] at h' + exact hc h' + +-- See https://github.com/leanprover/lean4/issues/11182 for why hypotheses are after the colon. +/-- A point `p` is equidistant to two affine subspaces (typically lines, for this version of the +lemma) if and only if the oriented angles at a point `p'` in their intersection between `p` and +its orthogonal projections onto the subspaces are equal. -/ +lemma dist_orthogonalProjection_eq_iff_oangle_eq {p p' : P} {s₁ s₂ : AffineSubspace ℝ P} + (hp' : p' ∈ s₁ ⊓ s₂) : + haveI : Nonempty s₁ := ⟨p', hp'.1⟩ + haveI : Nonempty s₂ := ⟨p', hp'.2⟩ + (orthogonalProjection s₁ p : P) ≠ orthogonalProjection s₂ p → + orthogonalProjection s₁ p ≠ p' → + orthogonalProjection s₂ p ≠ p' → + (dist p (orthogonalProjection s₁ p) = dist p (orthogonalProjection s₂ p) ↔ + ∡ (orthogonalProjection s₁ p : P) p' p = ∡ p p' (orthogonalProjection s₂ p)) := + fun hne hp₁ hp₂ ↦ ⟨oangle_eq_of_dist_orthogonalProjection_eq hp' hne, + dist_orthogonalProjection_eq_of_oangle_eq hp' hp₁ hp₂⟩ + +end Oriented + end EuclideanGeometry diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean index 5f11994acc9dbf..78113a6ca37d56 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Convex.Side -import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +module + +public import Mathlib.Analysis.Convex.Side +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine /-! # Oriented angles. @@ -19,6 +21,8 @@ This file defines oriented angles in Euclidean affine spaces. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean index d1d98b836eccd2..1a1d6d1deae511 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Heather Macbeth -/ -import Mathlib.Analysis.InnerProductSpace.TwoDim -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic +module + +public import Mathlib.Analysis.InnerProductSpace.TwoDim +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic /-! # Oriented angles. @@ -28,6 +30,8 @@ modulo `2 * π` as equalities of `(2 : ℤ) • θ`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean index bb7e530dc5382a..90d6d26e243454 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection +module + +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection /-! # Oriented angles and orthogonal projection. @@ -13,6 +15,8 @@ This file proves lemmas relating to oriented angles involving orthogonal project -/ +@[expose] public section + namespace EuclideanGeometry diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean index 8b8fccc265ffb8..eebc613883e859 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine -import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle +module + +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle /-! # Oriented angles in right-angled triangles. @@ -14,6 +16,8 @@ degenerate) right-angled triangles in real inner product spaces and Euclidean af -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean index e565d9a8b43622..b579ef9d9bf39f 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Heather Macbeth -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Circle -import Mathlib.Geometry.Euclidean.Angle.Oriented.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.Circle +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Basic /-! # Rotations by oriented angles. @@ -17,6 +19,8 @@ This file defines rotations by oriented angles in real inner product spaces. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Angle/Sphere.lean b/Mathlib/Geometry/Euclidean/Angle/Sphere.lean index 40de312aaacf9c..5f14a474ebe359 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Sphere.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Sphere.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Angle.Oriented.RightAngle -import Mathlib.Geometry.Euclidean.Circumcenter -import Mathlib.Geometry.Euclidean.Sphere.Tangent +module + +public import Mathlib.Geometry.Euclidean.Angle.Oriented.RightAngle +public import Mathlib.Geometry.Euclidean.Circumcenter +public import Mathlib.Geometry.Euclidean.Sphere.Tangent /-! # Angles in circles and sphere. @@ -14,6 +16,8 @@ This file proves results about angles in circles and spheres. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Affine.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Affine.lean index 0b48560279bc70..f53e42105cd99b 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Affine.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Affine.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Manuel Candales -/ -import Mathlib.Analysis.Convex.Between -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic -import Mathlib.Analysis.Normed.Affine.Isometry +module + +public import Mathlib.Analysis.Convex.Between +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic +public import Mathlib.Analysis.Normed.Affine.Isometry /-! # Angles between points @@ -23,6 +25,8 @@ This file defines unoriented angles in Euclidean affine spaces. Prove the triangle inequality for the angle. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean index 8215c2bbfd319e..4f2df36275f8d7 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Manuel Candales -/ -import Mathlib.Analysis.InnerProductSpace.Subspace -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse +module + +public import Mathlib.Analysis.InnerProductSpace.Subspace +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse /-! # Angles between vectors @@ -20,6 +22,8 @@ This file defines unoriented angles in real inner product spaces. Prove the triangle inequality for the angle. -/ +@[expose] public section + assert_not_exists HasFDerivAt ConformalAt diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Conformal.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Conformal.lean index f6a0db3a627312..f11c0e78c9b84a 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Conformal.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Conformal.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ -import Mathlib.Analysis.Calculus.Conformal.NormedSpace -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic +module + +public import Mathlib.Analysis.Calculus.Conformal.NormedSpace +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic /-! # Angles and conformal maps @@ -13,6 +15,8 @@ This file proves that conformal maps preserve angles. -/ +@[expose] public section + namespace InnerProductGeometry diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/CrossProduct.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/CrossProduct.lean index a50184b0b86fe9..5f90c1d8b73694 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/CrossProduct.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/CrossProduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Vedant Gupta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vedant Gupta, Thomas Browning, Eric Wieser -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic -import Mathlib.LinearAlgebra.CrossProduct +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic +public import Mathlib.LinearAlgebra.CrossProduct /-! # Norm of cross-products @@ -14,6 +16,8 @@ This file proves `InnerProductGeometry.norm_withLpEquiv_crossProduct`, relating cross-product of two real vectors with their individual norms. -/ +@[expose] public section + open Matrix Real WithLp namespace InnerProductGeometry diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean index 97276d78d3db02..982b010187cdbe 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine -import Mathlib.Geometry.Euclidean.Projection +module + +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +public import Mathlib.Geometry.Euclidean.Projection /-! # Angles and orthogonal projection. @@ -13,6 +15,8 @@ This file proves lemmas relating to angles involving orthogonal projections. -/ +@[expose] public section + namespace EuclideanGeometry diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean index 4e7cf0cda75e60..21a29f3654b0ec 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine /-! # Right-angled triangles @@ -24,6 +26,8 @@ triangle unnecessarily. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Basic.lean b/Mathlib/Geometry/Euclidean/Basic.lean index d44c6de0e2a040..eeb81f44fca97a 100644 --- a/Mathlib/Geometry/Euclidean/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Manuel Candales -/ -import Mathlib.Geometry.Euclidean.PerpBisector -import Mathlib.Algebra.QuadraticDiscriminant +module + +public import Mathlib.Geometry.Euclidean.PerpBisector +public import Mathlib.Algebra.QuadraticDiscriminant /-! # Euclidean spaces @@ -35,6 +37,8 @@ theorems that need it. -/ +@[expose] public section + noncomputable section open RealInnerProductSpace diff --git a/Mathlib/Geometry/Euclidean/Circumcenter.lean b/Mathlib/Geometry/Euclidean/Circumcenter.lean index 84e9a2c605dd11..e6099485f8a3ec 100644 --- a/Mathlib/Geometry/Euclidean/Circumcenter.lean +++ b/Mathlib/Geometry/Euclidean/Circumcenter.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Projection -import Mathlib.Geometry.Euclidean.Sphere.Basic -import Mathlib.LinearAlgebra.AffineSpace.Simplex.Centroid -import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional -import Mathlib.Tactic.DeriveFintype +module + +public import Mathlib.Geometry.Euclidean.Projection +public import Mathlib.Geometry.Euclidean.Sphere.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Simplex.Centroid +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.Tactic.DeriveFintype /-! # Circumcenter and circumradius @@ -29,6 +31,8 @@ the circumcenter. -/ +@[expose] public section + noncomputable section open RealInnerProductSpace diff --git a/Mathlib/Geometry/Euclidean/Congruence.lean b/Mathlib/Geometry/Euclidean/Congruence.lean index ba8d808894cb0b..ac9eb30079a7fd 100644 --- a/Mathlib/Geometry/Euclidean/Congruence.lean +++ b/Mathlib/Geometry/Euclidean/Congruence.lean @@ -3,12 +3,13 @@ Copyright (c) 2023 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid, Chu Zheng -/ +module -import Mathlib.Topology.MetricSpace.Congruence -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine -import Mathlib.Geometry.Euclidean.Triangle +public import Mathlib.Topology.MetricSpace.Congruence +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +public import Mathlib.Geometry.Euclidean.Triangle /-! # Triangle congruence @@ -31,6 +32,8 @@ then reduces to ASA. -/ +@[expose] public section + open scoped Congruent namespace EuclideanGeometry diff --git a/Mathlib/Geometry/Euclidean/Incenter.lean b/Mathlib/Geometry/Euclidean/Incenter.lean index 9a9370351faf4a..a74c1e822e0b65 100644 --- a/Mathlib/Geometry/Euclidean/Incenter.lean +++ b/Mathlib/Geometry/Euclidean/Incenter.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Altitude -import Mathlib.Geometry.Euclidean.SignedDist -import Mathlib.Geometry.Euclidean.Sphere.Tangent -import Mathlib.Tactic.Positivity.Finset -import Mathlib.Topology.Instances.Sign +module + +public import Mathlib.Geometry.Euclidean.Altitude +public import Mathlib.Geometry.Euclidean.SignedDist +public import Mathlib.Geometry.Euclidean.Sphere.Tangent +public import Mathlib.Tactic.Positivity.Finset +public import Mathlib.Topology.Instances.Sign /-! # Incenters and excenters of simplices. @@ -37,6 +39,8 @@ and the center and radius of such spheres. -/ +@[expose] public section + open EuclideanGeometry open scoped Finset RealInnerProductSpace @@ -120,11 +124,14 @@ lemma sum_excenterWeightsUnnorm_empty_pos : 0 < ∑ i, s.excenterWeightsUnnorm simp_rw [excenterWeightsUnnorm_empty_apply] positivity +lemma excenterWeights_empty_pos (i : Fin (n + 1)) : 0 < s.excenterWeights ∅ i := by + simp only [excenterWeights, excenterWeightsUnnorm_empty_apply, Pi.smul_apply, smul_eq_mul] + positivity + @[simp] lemma sign_excenterWeights_empty (i : Fin (n + 1)) : SignType.sign (s.excenterWeights ∅ i) = 1 := by - simp only [excenterWeights, excenterWeightsUnnorm_empty_apply, Pi.smul_apply, smul_eq_mul] rw [sign_eq_one_iff] - positivity + exact s.excenterWeights_empty_pos i /-- The existence of the incenter, expressed in terms of `ExcenterExists`. -/ @[simp] lemma excenterExists_empty : s.ExcenterExists ∅ := @@ -356,6 +363,22 @@ lemma ExcenterExists.excenter_mem_affineSpan_range {signs : Finset (Fin (n + 1)) lemma incenter_mem_affineSpan_range : s.incenter ∈ affineSpan ℝ (Set.range s.points) := s.excenterExists_empty.excenter_mem_affineSpan_range +lemma incenter_mem_interior : s.incenter ∈ s.interior := by + have h := s.excenterExists_empty.sum_excenterWeights_eq_one + rw [incenter_eq_affineCombination, s.affineCombination_mem_interior_iff h] + intro i + refine ⟨s.excenterWeights_empty_pos i, ?_⟩ + by_contra! hp + obtain ⟨j, hj⟩ := exists_ne i + rw [← Finset.sum_add_sum_compl {j, i}, Finset.sum_pair hj] at h + revert h + apply ne_of_gt + nth_rw 2 [add_comm] + grw [hp] + rw [add_assoc, lt_add_iff_pos_right] + exact add_pos_of_pos_of_nonneg (s.excenterWeights_empty_pos j) + (Finset.sum_nonneg fun k _ ↦ (s.excenterWeights_empty_pos k).le) + lemma excenter_singleton_mem_affineSpan_range [Nat.AtLeastTwo n] (i : Fin (n + 1)) : s.excenter {i} ∈ affineSpan ℝ (Set.range s.points) := (s.excenterExists_singleton i).excenter_mem_affineSpan_range @@ -399,24 +422,65 @@ lemma ExcenterExists.affineCombination_eq_excenter_iff {signs : Finset (Fin (n + · rintro rfl rw [excenter, exsphere] +variable {s} in +lemma ExcenterExists.excenter_notMem_affineSpan_face {signs : Finset (Fin (n + 1))} + (h : s.ExcenterExists signs) {fs : Finset (Fin (n + 1))} {m : ℕ} (hfs : #fs = m + 1) + (hne : m ≠ n) : s.excenter signs ∉ affineSpan ℝ (Set.range (s.face hfs).points) := by + intro hm + rw [range_face_points] at hm + obtain ⟨i, hi⟩ : ∃ i, i ∉ (fs : Set (Fin (n + 1))) := by + simp only [SetLike.mem_coe] + have hc : #fs < #(Finset.univ : Finset (Fin (n + 1))) := by + have : m + 1 ≤ #fs := hfs.ge + grw [fs.subset_univ] at this + simp only [Finset.card_univ, Fintype.card_fin] at * + cutsat + obtain ⟨i, -, hi⟩ := Finset.exists_mem_notMem_of_card_lt_card hc + exact ⟨i, hi⟩ + rw [excenter_eq_affineCombination] at hm + exact h.excenterWeights_ne_zero i (s.independent.eq_zero_of_affineCombination_mem_affineSpan + h.sum_excenterWeights_eq_one hm (Finset.mem_univ i) hi) + +lemma incenter_notMem_affineSpan_face {fs : Finset (Fin (n + 1))} {m : ℕ} (hfs : #fs = m + 1) + (hne : m ≠ n) : s.incenter ∉ affineSpan ℝ (Set.range (s.face hfs).points) := + s.excenterExists_empty.excenter_notMem_affineSpan_face hfs hne + +variable {s} in +lemma ExcenterExists.excenter_notMem_affineSpan_faceOpposite {signs : Finset (Fin (n + 1))} + (h : s.ExcenterExists signs) (i : Fin (n + 1)) : + s.excenter signs ∉ affineSpan ℝ (Set.range (s.faceOpposite i).points) := + h.excenter_notMem_affineSpan_face _ (by have := NeZero.ne n; cutsat) + +lemma incenter_notMem_affineSpan_faceOpposite (i : Fin (n + 1)) : + s.incenter ∉ affineSpan ℝ (Set.range (s.faceOpposite i).points) := + s.excenterExists_empty.excenter_notMem_affineSpan_faceOpposite i + variable {s} in lemma ExcenterExists.excenter_ne_point {signs : Finset (Fin (n + 1))} (h : s.ExcenterExists signs) (i : Fin (n + 1)) : s.excenter signs ≠ s.points i := by - intro he - rw [eq_comm, ← Finset.univ.affineCombination_affineCombinationSingleWeights ℝ s.points - (Finset.mem_univ _), h.affineCombination_eq_excenter_iff - (Finset.univ.sum_affineCombinationSingleWeights ℝ (Finset.mem_univ _))] at he - obtain ⟨j, hij⟩ : ∃ j, j ≠ i := exists_ne i - have he' : Finset.affineCombinationSingleWeights ℝ i j = s.excenterWeights signs j := by - rw [he] - simp only [ne_eq, hij, not_false_eq_true, Finset.affineCombinationSingleWeights_apply_of_ne] - at he' - exact h.excenterWeights_ne_zero _ he'.symm + have hf := h.excenter_notMem_affineSpan_face (fs := {i}) (m := 0) (by simp) (NeZero.ne' _) + simpa using hf lemma incenter_ne_point (i : Fin (n + 1)) : s.incenter ≠ s.points i := s.excenterExists_empty.excenter_ne_point i +variable {s} in +lemma ExcenterExists.excenter_notMem_affineSpan_pair [Nat.AtLeastTwo n] + {signs : Finset (Fin (n + 1))} (h : s.ExcenterExists signs) (i j : Fin (n + 1)) : + s.excenter signs ∉ affineSpan ℝ {s.points i, s.points j} := by + by_cases hij : i = j + · simp only [hij, Set.mem_singleton_iff, Set.insert_eq_of_mem, + AffineSubspace.mem_affineSpan_singleton] + exact h.excenter_ne_point j + · convert h.excenter_notMem_affineSpan_face (fs := {i, j}) (m := 1) (by simp_all) + Nat.AtLeastTwo.ne_one.symm + simp [Set.image_insert_eq] + +lemma incenter_notMem_affineSpan_pair [Nat.AtLeastTwo n] (i j : Fin (n + 1)) : + s.incenter ∉ affineSpan ℝ {s.points i, s.points j} := + s.excenterExists_empty.excenter_notMem_affineSpan_pair i j + variable {s} in lemma ExcenterExists.excenterWeights_eq_excenterWeights_iff {signs₁ signs₂ : Finset (Fin (n + 1))} (h₁ : s.ExcenterExists signs₁) (h₂ : s.ExcenterExists signs₂) : diff --git a/Mathlib/Geometry/Euclidean/Inversion/Basic.lean b/Mathlib/Geometry/Euclidean/Inversion/Basic.lean index 4acec3ca051ccd..1620b1a952adb2 100644 --- a/Mathlib/Geometry/Euclidean/Inversion/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Inversion/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.Normed.Group.AddTorsor -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Analysis.Normed.Group.AddTorsor +public import Mathlib.Tactic.AdaptationNote /-! # Inversion in an affine space @@ -22,6 +24,8 @@ Currently, we prove only a few basic lemmas needed to prove Ptolemy's inequality `EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist`. -/ +@[expose] public section + noncomputable section open Metric Function AffineMap Set AffineSubspace diff --git a/Mathlib/Geometry/Euclidean/Inversion/Calculus.lean b/Mathlib/Geometry/Euclidean/Inversion/Calculus.lean index 9bfcdd1fd70562..e648216d0c3b4f 100644 --- a/Mathlib/Geometry/Euclidean/Inversion/Calculus.lean +++ b/Mathlib/Geometry/Euclidean/Inversion/Calculus.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Geometry.Euclidean.Inversion.Basic -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Geometry.Euclidean.Inversion.Basic +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Tactic.AdaptationNote /-! # Derivative of the inversion @@ -23,6 +25,8 @@ space in this file. inversion, derivative -/ +@[expose] public section + open Metric Function AffineMap Set AffineSubspace open scoped Topology RealInnerProductSpace @@ -100,7 +104,7 @@ theorem hasFDerivAt_inversion (hx : x ≠ c) : (LinearMap.eqOn_span' ?_) fun y hy ↦ ?_) · have : ((‖x‖ ^ 2) ^ 2)⁻¹ * (‖x‖ ^ 2) = (‖x‖ ^ 2)⁻¹ := by rw [← div_eq_inv_mul, sq (‖x‖ ^ 2), div_self_mul_self'] - simp [Submodule.reflection_orthogonalComplement_singleton_eq_neg, real_inner_self_eq_norm_sq, + simp [Submodule.reflection_orthogonalComplement_singleton_eq_neg, two_mul, this, div_eq_mul_inv, mul_add, add_smul, mul_pow] · simp [Submodule.mem_orthogonal_singleton_iff_inner_right.1 hy, Submodule.reflection_mem_subspace_eq_self hy, div_eq_mul_inv, mul_pow] diff --git a/Mathlib/Geometry/Euclidean/Inversion/ImageHyperplane.lean b/Mathlib/Geometry/Euclidean/Inversion/ImageHyperplane.lean index bb9b706fc3900d..96618e01033790 100644 --- a/Mathlib/Geometry/Euclidean/Inversion/ImageHyperplane.lean +++ b/Mathlib/Geometry/Euclidean/Inversion/ImageHyperplane.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Geometry.Euclidean.Inversion.Basic -import Mathlib.Geometry.Euclidean.PerpBisector +module + +public import Mathlib.Geometry.Euclidean.Inversion.Basic +public import Mathlib.Geometry.Euclidean.PerpBisector /-! # Image of a hyperplane under inversion @@ -24,6 +26,8 @@ We also prove that the inversion sends an affine subspace passing through the ce inversion -/ +@[expose] public section + open Metric Function AffineMap Set AffineSubspace open scoped Topology diff --git a/Mathlib/Geometry/Euclidean/MongePoint.lean b/Mathlib/Geometry/Euclidean/MongePoint.lean index d032eb04decc33..3a1bd698eda93d 100644 --- a/Mathlib/Geometry/Euclidean/MongePoint.lean +++ b/Mathlib/Geometry/Euclidean/MongePoint.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Altitude -import Mathlib.Geometry.Euclidean.Circumcenter +module + +public import Mathlib.Geometry.Euclidean.Altitude +public import Mathlib.Geometry.Euclidean.Circumcenter /-! # Monge point and orthocenter @@ -43,6 +45,8 @@ generalization, the Monge point of a simplex. -/ +@[expose] public section + noncomputable section open scoped RealInnerProductSpace diff --git a/Mathlib/Geometry/Euclidean/PerpBisector.lean b/Mathlib/Geometry/Euclidean/PerpBisector.lean index a6a3ebd6a9ea43..7d48f0b6f2337a 100644 --- a/Mathlib/Geometry/Euclidean/PerpBisector.lean +++ b/Mathlib/Geometry/Euclidean/PerpBisector.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ -import Mathlib.Analysis.InnerProductSpace.Orthogonal -import Mathlib.Analysis.Normed.Group.AddTorsor +module + +public import Mathlib.Analysis.InnerProductSpace.Orthogonal +public import Mathlib.Analysis.Normed.Group.AddTorsor /-! # Perpendicular bisector of a segment @@ -19,6 +21,8 @@ define this subspace. euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ +@[expose] public section + open Set open scoped RealInnerProductSpace @@ -35,13 +39,13 @@ variable {c p₁ p₂ : P} def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := mk' (midpoint ℝ p₁ p₂) (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))) -/-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to +/-- A point `c` belongs the perpendicular bisector of `[p₁, p₂]` iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl -/-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is +/-- A point `c` belongs the perpendicular bisector of `[p₁, p₂]` iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := diff --git a/Mathlib/Geometry/Euclidean/Projection.lean b/Mathlib/Geometry/Euclidean/Projection.lean index 2fa4ff35ed840d..e4e0fa4e66fc19 100644 --- a/Mathlib/Geometry/Euclidean/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Projection.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Manuel Candales -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Submodule -import Mathlib.Analysis.InnerProductSpace.Projection.Reflection -import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional -import Mathlib.Topology.Algebra.ContinuousAffineMap +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +public import Mathlib.Analysis.InnerProductSpace.Projection.Reflection +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.Topology.Algebra.ContinuousAffineMap /-! # Orthogonal projection in Euclidean affine spaces @@ -24,6 +26,8 @@ and reflection of a point in an affine subspace. -/ +@[expose] public section + noncomputable section open RealInnerProductSpace @@ -608,6 +612,16 @@ def orthogonalProjectionSpan {n : ℕ} (s : Simplex ℝ P n) : P →ᴬ[ℝ] affineSpan ℝ (Set.range s.points) := orthogonalProjection (affineSpan ℝ (Set.range s.points)) +lemma orthogonalProjectionSpan_congr {m n : ℕ} {s₁ : Simplex ℝ P m} {s₂ : Simplex ℝ P n} + {p₁ p₂ : P} (h : Set.range s₁.points = Set.range s₂.points) (hp : p₁ = p₂) : + (s₁.orthogonalProjectionSpan p₁ : P) = s₂.orthogonalProjectionSpan p₂ := + orthogonalProjection_congr (by rw [h]) hp + +@[simp] lemma orthogonalProjectionSpan_reindex {m n : ℕ} (s : Simplex ℝ P m) + (e : Fin (m + 1) ≃ Fin (n + 1)) (p : P) : + ((s.reindex e).orthogonalProjectionSpan p : P) = s.orthogonalProjectionSpan p := + orthogonalProjectionSpan_congr (s.reindex_range_points e) rfl + /-- Adding a vector to a point in the given subspace, then taking the orthogonal projection, produces the original point if the vector is a multiple of the result of subtracting a point's orthogonal projection diff --git a/Mathlib/Geometry/Euclidean/SignedDist.lean b/Mathlib/Geometry/Euclidean/SignedDist.lean index 0570b72794fcfc..7a359ca51ee7ca 100644 --- a/Mathlib/Geometry/Euclidean/SignedDist.lean +++ b/Mathlib/Geometry/Euclidean/SignedDist.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Projection -import Mathlib.Analysis.NormedSpace.Normalize +module + +public import Mathlib.Geometry.Euclidean.Projection +public import Mathlib.Analysis.NormedSpace.Normalize /-! # Signed distance to an affine subspace in a Euclidean space. @@ -26,6 +28,8 @@ reference point. -/ +@[expose] public section + open EuclideanGeometry NormedSpace open scoped RealInnerProductSpace diff --git a/Mathlib/Geometry/Euclidean/Simplex.lean b/Mathlib/Geometry/Euclidean/Simplex.lean index 0154d11ed4f4d1..1064dfde3df7c9 100644 --- a/Mathlib/Geometry/Euclidean/Simplex.lean +++ b/Mathlib/Geometry/Euclidean/Simplex.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Normed.Affine.Simplex -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +module + +public import Mathlib.Analysis.Normed.Affine.Simplex +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine /-! # Simplices in Euclidean spaces. @@ -17,6 +19,8 @@ This file defines properties of simplices in a Euclidean space. -/ +@[expose] public section + namespace Affine diff --git a/Mathlib/Geometry/Euclidean/Sphere/Basic.lean b/Mathlib/Geometry/Euclidean/Sphere/Basic.lean index 865ac556f673f7..16df777651882d 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Analysis.Convex.StrictConvexBetween -import Mathlib.Analysis.InnerProductSpace.Convex -import Mathlib.Analysis.Normed.Affine.Convex -import Mathlib.Geometry.Euclidean.Basic +module + +public import Mathlib.Analysis.Convex.StrictConvexBetween +public import Mathlib.Analysis.InnerProductSpace.Convex +public import Mathlib.Analysis.Normed.Affine.Convex +public import Mathlib.Geometry.Euclidean.Basic /-! # Spheres @@ -31,6 +33,8 @@ Euclidean affine spaces. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Euclidean/Sphere/Power.lean b/Mathlib/Geometry/Euclidean/Sphere/Power.lean index f23ee038952cb4..e3b68c1fd781d2 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Power.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Power.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Manuel Candales. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Manuel Candales, Benjamin Davidson -/ -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine -import Mathlib.Geometry.Euclidean.Sphere.Basic -import Mathlib.Geometry.Euclidean.Sphere.Tangent +module + +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +public import Mathlib.Geometry.Euclidean.Sphere.Basic +public import Mathlib.Geometry.Euclidean.Sphere.Tangent /-! # Power of a point (intersecting chords and secants) @@ -25,6 +27,8 @@ secants) in spheres in real inner product spaces and Euclidean affine spaces. * `Sphere.dist_sq_eq_mul_dist_of_tangent_and_secant`: Tangent-Secant Theorem. -/ +@[expose] public section + open Real diff --git a/Mathlib/Geometry/Euclidean/Sphere/Ptolemy.lean b/Mathlib/Geometry/Euclidean/Sphere/Ptolemy.lean index d458ecf303863b..f066f44149574f 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Ptolemy.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Ptolemy.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Manuel Candales. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Manuel Candales, Benjamin Davidson -/ -import Mathlib.Geometry.Euclidean.Sphere.Power -import Mathlib.Geometry.Euclidean.Triangle +module + +public import Mathlib.Geometry.Euclidean.Sphere.Power +public import Mathlib.Geometry.Euclidean.Triangle /-! # Ptolemy's theorem @@ -37,6 +39,8 @@ An API needs to be built around that concept, which would include: and so on. -/ +@[expose] public section + open Real diff --git a/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean b/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean index 784a8e8e9837fe..eb27ac99009480 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Sphere.Basic +module + +public import Mathlib.Geometry.Euclidean.Sphere.Basic /-! # Second intersection of a sphere and a line @@ -18,6 +20,8 @@ through a point on that sphere. -/ +@[expose] public section + noncomputable section @@ -87,6 +91,17 @@ theorem Sphere.eq_or_eq_secondInter_of_mem_mk'_span_singleton_iff_mem {s : Spher rw [← hp, dist_smul_vadd_eq_dist _ _ hv] at h rcases h with (h | h) <;> simp [h] +/-- A point on a line through a point on a sphere and a second point equals that point or +`secondInter`. -/ +lemma Sphere.eq_or_eq_secondInter_iff_mem_of_mem_affineSpan_pair {s : Sphere P} {p q : P} + (hp : p ∈ s) {p' : P} (hp' : p' ∈ line[ℝ, p, q]) : + p' = p ∨ p' = s.secondInter p (q -ᵥ p) ↔ p' ∈ s := by + convert s.eq_or_eq_secondInter_of_mem_mk'_span_singleton_iff_mem hp ?_ + convert hp' + rw [AffineSubspace.eq_iff_direction_eq_of_mem (AffineSubspace.self_mem_mk' p _) + (left_mem_affineSpan_pair _ _ _)] + simp [direction_affineSpan, vectorSpan_pair_rev] + /-- `secondInter` is unchanged by multiplying the vector by a nonzero real. -/ @[simp] theorem Sphere.secondInter_smul (s : Sphere P) (p : P) (v : V) {r : ℝ} (hr : r ≠ 0) : diff --git a/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean b/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean index bcbe58a61db991..7fcb42e1f2ed5e 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Geometry.Euclidean.Projection -import Mathlib.Geometry.Euclidean.Sphere.Basic +module + +public import Mathlib.Geometry.Euclidean.Projection +public import Mathlib.Geometry.Euclidean.Sphere.Basic /-! # Tangency for spheres. @@ -48,6 +50,8 @@ This file defines notions of spheres being tangent to affine subspaces and other -/ +@[expose] public section + namespace EuclideanGeometry diff --git a/Mathlib/Geometry/Euclidean/Triangle.lean b/Mathlib/Geometry/Euclidean/Triangle.lean index e73bbdf736ae12..fb8413cc676474 100644 --- a/Mathlib/Geometry/Euclidean/Triangle.lean +++ b/Mathlib/Geometry/Euclidean/Triangle.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers, Manuel Candales -/ -import Mathlib.Analysis.Normed.Affine.AddTorsor -import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine -import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Analysis.Normed.Affine.AddTorsor +public import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine +public import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine +public import Mathlib.Tactic.IntervalCases /-! # Triangles @@ -35,6 +37,8 @@ unnecessarily. -/ +@[expose] public section + noncomputable section open scoped CharZero Real RealInnerProductSpace @@ -73,8 +77,9 @@ theorem sin_angle_mul_norm_eq_sin_angle_mul_norm (x y : V) : Real.sin (angle x y) = √(⟪x, x⟫ * ⟪y, y⟫ - ⟪x, y⟫ * ⟪x, y⟫) / (‖x‖ * ‖y‖) := by simp [field, mul_assoc, sin_angle_mul_norm_mul_norm] rw [h_sin x y hx hy, h_sin y (x - y) hy (sub_ne_zero_of_ne hxy)] + simp only [inner_sub_left, inner_sub_right, real_inner_comm x y] have hsub : x - y ≠ 0 := sub_ne_zero_of_ne hxy - simp [field, inner_sub_left, inner_sub_right, real_inner_comm x y] + field_simp ring_nf /-- A variant of the law of sines, (two given sides are nonzero), vector angle form. -/ diff --git a/Mathlib/Geometry/Group/Growth/LinearLowerBound.lean b/Mathlib/Geometry/Group/Growth/LinearLowerBound.lean index 320e217551a55d..ec0e06b4a2d964 100644 --- a/Mathlib/Geometry/Group/Growth/LinearLowerBound.lean +++ b/Mathlib/Geometry/Group/Growth/LinearLowerBound.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies, Patrick Luo, Eric Rodriguez. All rights reserv Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Patrick Luo, Eric Rodriguez -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Data.Nat.SuccPred +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Data.Nat.SuccPred /-! # Linear lower bound on the growth of a generating set @@ -13,6 +15,8 @@ import Mathlib.Data.Nat.SuccPred This file proves that the growth of a set generating an infinite group is at least linear. -/ +@[expose] public section + open Subgroup open scoped Pointwise diff --git a/Mathlib/Geometry/Group/Growth/QuotientInter.lean b/Mathlib/Geometry/Group/Growth/QuotientInter.lean index 8b1ceda26b1ece..afb46577e27304 100644 --- a/Mathlib/Geometry/Group/Growth/QuotientInter.lean +++ b/Mathlib/Geometry/Group/Growth/QuotientInter.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.GroupTheory.QuotientGroup.Defs -import Mathlib.Algebra.Group.Pointwise.Finset.Basic +module + +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.GroupTheory.QuotientGroup.Defs +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic /-! # Growth in the quotient and intersection with a subgroup @@ -14,6 +16,8 @@ For a group `G` and a subgroup `H ≤ G`, this file gives upper and lower bounds finset by its growth in `H` and `G ⧸ H`. -/ +@[expose] public section + open Finset Function open scoped Pointwise diff --git a/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean b/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean index 538d84ddefaa45..b9f53e877b6a52 100644 --- a/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean +++ b/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.RingTheory.Derivation.Lie -import Mathlib.Geometry.Manifold.DerivationBundle +module + +public import Mathlib.RingTheory.Derivation.Lie +public import Mathlib.Geometry.Manifold.DerivationBundle /-! @@ -26,6 +28,8 @@ work in these settings. The left-invariant vector fields should therefore be favored to construct a theory of Lie groups in suitable generality. -/ +@[expose] public section + noncomputable section @@ -155,7 +159,8 @@ instance : AddCommGroup (LeftInvariantDerivation I G) := coe_injective.addCommGroup _ coe_zero coe_add coe_neg coe_sub (fun _ _ => rfl) fun _ _ => rfl instance : SMul 𝕜 (LeftInvariantDerivation I G) where - smul r X := ⟨r • X.1, fun g => by simp_rw [LinearMap.map_smul, left_invariant']⟩ + smul r X := ⟨r • X.1, fun g => by + simp only [LinearMap.map_smul_of_tower, map_smul]; rw [left_invariant']⟩ variable (r) diff --git a/Mathlib/Geometry/Manifold/Algebra/LieGroup.lean b/Mathlib/Geometry/Manifold/Algebra/LieGroup.lean index c8c755cab85d47..dc0734498d54bf 100644 --- a/Mathlib/Geometry/Manifold/Algebra/LieGroup.lean +++ b/Mathlib/Geometry/Manifold/Algebra/LieGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Geometry.Manifold.Algebra.Monoid +module + +public import Mathlib.Geometry.Manifold.Algebra.Monoid /-! # Lie groups @@ -47,6 +49,8 @@ so the definition does not apply. Hence the definition should be more general, a `I : ModelWithCorners 𝕜 E H`. -/ +@[expose] public section + noncomputable section open scoped Manifold ContDiff diff --git a/Mathlib/Geometry/Manifold/Algebra/Monoid.lean b/Mathlib/Geometry/Manifold/Algebra/Monoid.lean index ab50e46bfdb6d6..8e4ee820a20c36 100644 --- a/Mathlib/Geometry/Manifold/Algebra/Monoid.lean +++ b/Mathlib/Geometry/Manifold/Algebra/Monoid.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Geometry.Manifold.ContMDiffMap -import Mathlib.Geometry.Manifold.MFDeriv.Basic +module + +public import Mathlib.Geometry.Manifold.ContMDiffMap +public import Mathlib.Geometry.Manifold.MFDeriv.Basic /-! # `C^n` monoid @@ -16,6 +18,8 @@ additive counterpart `ContMDiffAdd`. These structures are general enough to also semigroups. -/ +@[expose] public section + open scoped Manifold ContDiff library_note2 «Design choices about smooth algebraic structures» /-- diff --git a/Mathlib/Geometry/Manifold/Algebra/SmoothFunctions.lean b/Mathlib/Geometry/Manifold/Algebra/SmoothFunctions.lean index cf4411a4f88f9c..edbb02e217d9b8 100644 --- a/Mathlib/Geometry/Manifold/Algebra/SmoothFunctions.lean +++ b/Mathlib/Geometry/Manifold/Algebra/SmoothFunctions.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Geometry.Manifold.Algebra.Structures +module + +public import Mathlib.Geometry.Manifold.Algebra.Structures /-! # Algebraic structures over `C^n` functions @@ -11,6 +13,8 @@ import Mathlib.Geometry.Manifold.Algebra.Structures In this file, we define instances of algebraic structures over `C^n` functions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Manifold/Algebra/Structures.lean b/Mathlib/Geometry/Manifold/Algebra/Structures.lean index 6951fdab05df86..ee9719c748bf64 100644 --- a/Mathlib/Geometry/Manifold/Algebra/Structures.lean +++ b/Mathlib/Geometry/Manifold/Algebra/Structures.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Geometry.Manifold.Algebra.LieGroup +module + +public import Mathlib.Geometry.Manifold.Algebra.LieGroup /-! # `C^n` structures @@ -13,6 +15,8 @@ term `ContMDiffRing` instead of Lie mainly because Lie ring has currently anothe in mathematics. -/ +@[expose] public section + open scoped Manifold ContDiff section ContMDiffRing diff --git a/Mathlib/Geometry/Manifold/Bordism.lean b/Mathlib/Geometry/Manifold/Bordism.lean index eb184692ff9f14..749fe5d1c359df 100644 --- a/Mathlib/Geometry/Manifold/Bordism.lean +++ b/Mathlib/Geometry/Manifold/Bordism.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Michael Rothgang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Rothgang -/ -import Mathlib.Geometry.Manifold.Instances.Real +module + +public import Mathlib.Geometry.Manifold.Instances.Real /-! ## (Unoriented) bordism theory @@ -89,6 +91,8 @@ topological pair `(X, A)`; in fact, these define an extra-ordinary homology theo singular manifold, bordism, bordism group -/ +@[expose] public section + open scoped Manifold open Module Set diff --git a/Mathlib/Geometry/Manifold/BumpFunction.lean b/Mathlib/Geometry/Manifold/BumpFunction.lean index 2cd94c7ed5b7a3..c54a98b34f0b59 100644 --- a/Mathlib/Geometry/Manifold/BumpFunction.lean +++ b/Mathlib/Geometry/Manifold/BumpFunction.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension -import Mathlib.Geometry.Manifold.ContMDiff.Atlas -import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace -import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas +module + +public import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension +public import Mathlib.Geometry.Manifold.ContMDiff.Atlas +public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace +public import Mathlib.Topology.MetricSpace.ProperSpace.Lemmas /-! # Smooth bump functions on a smooth manifold @@ -28,6 +30,8 @@ The actual statements involve (pre)images under `extChartAt I f` and are given a manifold, smooth bump function -/ +@[expose] public section + universe uE uF uH uM variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] diff --git a/Mathlib/Geometry/Manifold/ChartedSpace.lean b/Mathlib/Geometry/Manifold/ChartedSpace.lean index c9a91b65c62657..55a9b3193ef902 100644 --- a/Mathlib/Geometry/Manifold/ChartedSpace.lean +++ b/Mathlib/Geometry/Manifold/ChartedSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Topology.OpenPartialHomeomorph -import Mathlib.Topology.Connected.LocPathConnected +module + +public import Mathlib.Topology.OpenPartialHomeomorph +public import Mathlib.Topology.Connected.LocPathConnected /-! # Charted spaces @@ -108,6 +110,8 @@ In the scope `Manifold`, we denote the composition of open partial homeomorphism composition of partial equivs with `≫`. -/ +@[expose] public section + noncomputable section open TopologicalSpace Topology diff --git a/Mathlib/Geometry/Manifold/Complex.lean b/Mathlib/Geometry/Manifold/Complex.lean index eda4cbd7c1299c..a06a28881b77e7 100644 --- a/Mathlib/Geometry/Manifold/Complex.lean +++ b/Mathlib/Geometry/Manifold/Complex.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.Complex.AbsMax -import Mathlib.Analysis.LocallyConvex.WithSeminorms -import Mathlib.Geometry.Manifold.MFDeriv.Basic -import Mathlib.Topology.LocallyConstant.Basic +module + +public import Mathlib.Analysis.Complex.AbsMax +public import Mathlib.Analysis.LocallyConvex.WithSeminorms +public import Mathlib.Geometry.Manifold.MFDeriv.Basic +public import Mathlib.Topology.LocallyConstant.Basic /-! # Holomorphic functions on complex manifolds @@ -36,6 +38,8 @@ stalks, such as the Weierstrass preparation theorem. -/ +@[expose] public section + open scoped Manifold Topology Filter open Function Set Filter Complex diff --git a/Mathlib/Geometry/Manifold/ConformalGroupoid.lean b/Mathlib/Geometry/Manifold/ConformalGroupoid.lean index 2f02d7e531c782..166d05fe4a90ed 100644 --- a/Mathlib/Geometry/Manifold/ConformalGroupoid.lean +++ b/Mathlib/Geometry/Manifold/ConformalGroupoid.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ -import Mathlib.Analysis.Calculus.Conformal.NormedSpace -import Mathlib.Geometry.Manifold.ChartedSpace +module + +public import Mathlib.Analysis.Calculus.Conformal.NormedSpace +public import Mathlib.Geometry.Manifold.ChartedSpace /-! # Conformal Groupoid @@ -20,6 +22,8 @@ In this file we define the groupoid of conformal maps on normed spaces. conformal, groupoid -/ +@[expose] public section + variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean b/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean index b62d200f4924a3..d7a1af646a5e55 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.ContMDiff.Basic +module + +public import Mathlib.Geometry.Manifold.ContMDiff.Basic /-! ## Smoothness of charts and local structomorphisms @@ -12,6 +14,8 @@ We show that the model with corners, charts, extended charts and their inverses and that local structomorphisms are `C^n` with `C^n` inverses. -/ +@[expose] public section + open Set ChartedSpace IsManifold open scoped Manifold ContDiff diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean b/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean index 891e32d21dd345..6eaf20a1a81c16 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.ContMDiff.Defs +module + +public import Mathlib.Geometry.Manifold.ContMDiff.Defs /-! ## Basic properties of `C^n` functions between manifolds @@ -21,6 +23,8 @@ chain rule, manifolds, higher derivative -/ +@[expose] public section + open Filter Function Set Topology open scoped Manifold ContDiff diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Constructions.lean b/Mathlib/Geometry/Manifold/ContMDiff/Constructions.lean index 550c525007f1df..7edfc381e9ccf8 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Constructions.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Constructions.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn, Michael Rothgang -/ -import Mathlib.Geometry.Manifold.ContMDiff.Basic +module + +public import Mathlib.Geometry.Manifold.ContMDiff.Basic /-! ## Smoothness of standard maps associated to the product of manifolds @@ -18,6 +20,8 @@ This file contains results about smoothness of standard maps associated to produ -/ +@[expose] public section + open Set Function Filter ChartedSpace open scoped Topology Manifold diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean b/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean index b6f0459ea87493..905f41e43ad95a 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt -import Mathlib.Geometry.Manifold.LocalInvariantProperties +module + +public import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt +public import Mathlib.Geometry.Manifold.LocalInvariantProperties /-! # `C^n` functions between manifolds @@ -43,6 +45,8 @@ follow definitionally the setup of local invariant properties. Still, we recast in terms of extended charts in `contMDiffOn_iff` and `contMDiff_iff`. -/ +@[expose] public section + open Set Function Filter ChartedSpace IsManifold diff --git a/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean b/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean index 823ab7be963ff1..ce459ead8e99d4 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.ContMDiff.Constructions -import Mathlib.Analysis.Normed.Operator.Prod +module + +public import Mathlib.Geometry.Manifold.ContMDiff.Constructions +public import Mathlib.Analysis.Normed.Operator.Prod /-! ## Equivalence of smoothness with the basic definition for functions between vector spaces @@ -15,6 +17,8 @@ import Mathlib.Analysis.Normed.Operator.Prod -/ +@[expose] public section + open Set ChartedSpace open scoped Topology Manifold diff --git a/Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean b/Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean index b67713babf9828..8d8a44798632a1 100644 --- a/Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean +++ b/Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.MFDeriv.Tangent -import Mathlib.Geometry.Manifold.ContMDiffMap -import Mathlib.Geometry.Manifold.VectorBundle.Hom +module + +public import Mathlib.Geometry.Manifold.MFDeriv.Tangent +public import Mathlib.Geometry.Manifold.ContMDiffMap +public import Mathlib.Geometry.Manifold.VectorBundle.Hom /-! ### Interactions between differentiability, smoothness and manifold derivatives @@ -21,6 +23,8 @@ and related notions. of a `Cⁿ` function is `Cᵐ` when `m + 1 ≤ n`. -/ +@[expose] public section + open Set Function Filter ChartedSpace IsManifold Bundle open scoped Topology Manifold Bundle diff --git a/Mathlib/Geometry/Manifold/ContMDiffMap.lean b/Mathlib/Geometry/Manifold/ContMDiffMap.lean index c403ad9648e5e6..c157c16a83f2be 100644 --- a/Mathlib/Geometry/Manifold/ContMDiffMap.lean +++ b/Mathlib/Geometry/Manifold/ContMDiffMap.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace +module + +public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace /-! # `C^n` bundled maps @@ -12,6 +14,8 @@ In this file we define the type `ContMDiffMap` of `n` times continuously differe bundled maps. -/ +@[expose] public section + variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H : Type*} [TopologicalSpace H] {H' : Type*} [TopologicalSpace H'] {I : ModelWithCorners 𝕜 E H} diff --git a/Mathlib/Geometry/Manifold/DerivationBundle.lean b/Mathlib/Geometry/Manifold/DerivationBundle.lean index bd1af85d522a47..923e98d9419de0 100644 --- a/Mathlib/Geometry/Manifold/DerivationBundle.lean +++ b/Mathlib/Geometry/Manifold/DerivationBundle.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri -/ -import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions -import Mathlib.RingTheory.Derivation.Basic +module + +public import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions +public import Mathlib.RingTheory.Derivation.Basic /-! @@ -19,6 +21,8 @@ of the Lie algebra for a Lie group. This theory coincides with the usual tangent case of finite-dimensional `C^∞` real manifolds, but not in the general case. -/ +@[expose] public section + variable (𝕜 : Type*) [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) (M : Type*) @@ -109,8 +113,8 @@ namespace Derivation variable {I} /-- The evaluation at a point as a linear map. -/ -def evalAt (x : M) : Derivation 𝕜 C^∞⟮I, M; 𝕜⟯ C^∞⟮I, M; 𝕜⟯ →ₗ[𝕜] PointDerivation I x := - (ContMDiffFunction.evalAt I x).compDer +def evalAt (x : M) : Derivation 𝕜 C^∞⟮I, M; 𝕜⟯ C^∞⟮I, M; 𝕜⟯ →ₗ[C^∞⟮I, M; 𝕜⟯⟨x⟩] + PointDerivation I x := (ContMDiffFunction.evalAt I x).compDer theorem evalAt_apply (x : M) : evalAt x X f = (X f) x := rfl diff --git a/Mathlib/Geometry/Manifold/Diffeomorph.lean b/Mathlib/Geometry/Manifold/Diffeomorph.lean index 08b59bb3b3418c..b25de628b86a91 100644 --- a/Mathlib/Geometry/Manifold/Diffeomorph.lean +++ b/Mathlib/Geometry/Manifold/Diffeomorph.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri, Yury Kudryashov -/ -import Mathlib.Geometry.Manifold.ContMDiffMap -import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential +module + +public import Mathlib.Geometry.Manifold.ContMDiffMap +public import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential /-! # Diffeomorphisms @@ -52,6 +54,8 @@ practice. diffeomorphism, manifold -/ +@[expose] public section + open scoped Manifold Topology ContDiff diff --git a/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean b/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean index e202483060bb56..8349c68224b273 100644 --- a/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean +++ b/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.Lie.Basic -import Mathlib.Geometry.Manifold.Algebra.LieGroup -import Mathlib.Geometry.Manifold.VectorField.LieBracket +module + +public import Mathlib.Algebra.Lie.Basic +public import Mathlib.Geometry.Manifold.Algebra.LieGroup +public import Mathlib.Geometry.Manifold.VectorField.LieBracket /-! # The Lie algebra of a Lie group @@ -32,6 +34,8 @@ The standing assumption in this file is that the group is `C^n` for `n = minSmoo it is `C^3` over `ℝ` or `ℂ`, and analytic otherwise. -/ +@[expose] public section + noncomputable section section LieGroup diff --git a/Mathlib/Geometry/Manifold/Instances/Icc.lean b/Mathlib/Geometry/Manifold/Instances/Icc.lean index 1f087900c34209..1a8a6b48c053f2 100644 --- a/Mathlib/Geometry/Manifold/Instances/Icc.lean +++ b/Mathlib/Geometry/Manifold/Instances/Icc.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Geometry.Manifold.ContMDiff.Basic -import Mathlib.Geometry.Manifold.Instances.Real -import Mathlib.Geometry.Manifold.MFDeriv.FDeriv +module + +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Geometry.Manifold.ContMDiff.Basic +public import Mathlib.Geometry.Manifold.Instances.Real +public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! # Manifold structure on real intervals @@ -30,6 +32,8 @@ embeddings. Once this is done, with the projection `ℝ → Icc x y` is -/ +@[expose] public section + open Set WithLp open scoped Manifold Topology diff --git a/Mathlib/Geometry/Manifold/Instances/Real.lean b/Mathlib/Geometry/Manifold/Instances/Real.lean index ec5a49ca280231..e847c3dd04a2b0 100644 --- a/Mathlib/Geometry/Manifold/Instances/Real.lean +++ b/Mathlib/Geometry/Manifold/Instances/Real.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ContDiff.WithLp -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary +module + +public import Mathlib.Analysis.Calculus.ContDiff.WithLp +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary /-! # Constructing examples of manifolds over ℝ @@ -42,6 +44,8 @@ The manifold structure on the interval `[x, y] = Icc x y` requires the assumptio typeclass. We provide it as `[Fact (x < y)]`. -/ +@[expose] public section + noncomputable section open Set Function WithLp diff --git a/Mathlib/Geometry/Manifold/Instances/Sphere.lean b/Mathlib/Geometry/Manifold/Instances/Sphere.lean index 41dd7288198bf2..ffe84577893711 100644 --- a/Mathlib/Geometry/Manifold/Instances/Sphere.lean +++ b/Mathlib/Geometry/Manifold/Instances/Sphere.lean @@ -3,17 +3,19 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.Complex.Circle -import Mathlib.Analysis.Normed.Module.Ball.Action -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Geometry.Manifold.Algebra.LieGroup -import Mathlib.Geometry.Manifold.Instances.Real -import Mathlib.Geometry.Manifold.MFDeriv.Basic -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.Tactic.Module +module + +public import Mathlib.Analysis.Calculus.Deriv.Inv +public import Mathlib.Analysis.Complex.Circle +public import Mathlib.Analysis.Normed.Module.Ball.Action +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Geometry.Manifold.Algebra.LieGroup +public import Mathlib.Geometry.Manifold.Instances.Real +public import Mathlib.Geometry.Manifold.MFDeriv.Basic +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.Tactic.Module /-! # Manifold structure on the sphere @@ -64,6 +66,8 @@ naive expression `EuclideanSpace ℝ (Fin (finrank ℝ E - 1))` for the model sp Relate the stereographic projection to the inversion of the space. -/ +@[expose] public section + variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] @@ -181,7 +185,7 @@ open scoped InnerProductSpace in theorem stereoInvFun_ne_north_pole (hv : ‖v‖ = 1) (w : (ℝ ∙ v)ᗮ) : stereoInvFun hv w ≠ (⟨v, by simp [hv]⟩ : sphere (0 : E) 1) := by refine Subtype.coe_ne_coe.1 ?_ - rw [← inner_lt_one_iff_real_of_norm_one _ hv] + rw [← inner_lt_one_iff_real_of_norm_eq_one _ hv] · have hw : ⟪v, w⟫_ℝ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp w.2 have hw' : (‖(w : E)‖ ^ 2 + 4)⁻¹ * (‖(w : E)‖ ^ 2 - 4) < 1 := by rw [inv_mul_lt_iff₀'] @@ -217,7 +221,7 @@ theorem stereo_left_inv (hv : ‖v‖ = 1) {x : sphere (0 : E) 1} (hx : (x : E) · exact sq _ -- a fact which will be helpful for clearing denominators in the main calculation have ha : 0 < 1 - a := by - have : a < 1 := (inner_lt_one_iff_real_of_norm_one hv (by simp)).mpr hx.symm + have : a < 1 := (inner_lt_one_iff_real_of_norm_eq_one hv (by simp)).mpr hx.symm linarith rw [split, Submodule.coe_smul_of_tower] simp only [norm_smul, norm_div, RCLike.norm_ofNat, Real.norm_eq_abs, abs_of_nonneg ha.le] @@ -228,12 +232,12 @@ theorem stereo_left_inv (hv : ‖v‖ = 1) {x : sphere (0 : E) 1} (hx : (x : E) linear_combination 4 * (a - 1) * pythag theorem stereo_right_inv (hv : ‖v‖ = 1) (w : (ℝ ∙ v)ᗮ) : stereoToFun v (stereoInvFun hv w) = w := by - simp only [stereoToFun, stereoInvFun, stereoInvFunAux, smul_add, map_add, map_smul, innerSL_apply, - Submodule.orthogonalProjection_mem_subspace_eq_self] + simp only [stereoToFun, stereoInvFun, stereoInvFunAux, smul_add, map_add, map_smul, + innerSL_apply_apply, Submodule.orthogonalProjection_mem_subspace_eq_self] have h₁ : (ℝ ∙ v)ᗮ.orthogonalProjection v = 0 := Submodule.orthogonalProjection_orthogonalComplement_singleton_eq_zero v have h₂ : ⟪v, w⟫ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp w.2 - have h₃ : ⟪v, v⟫ = 1 := by simp [real_inner_self_eq_norm_mul_norm, hv] + have h₃ : ⟪v, v⟫ = 1 := by simp [hv] rw [h₁, h₂, h₃] match_scalars simp [field] @@ -260,7 +264,7 @@ def stereographic (hv : ‖v‖ = 1) : OpenPartialHomeomorph (sphere (0 : E) 1) continuousOn_stereoToFun.comp continuous_subtype_val.continuousOn fun w h => by dsimp exact - h ∘ Subtype.ext ∘ Eq.symm ∘ (inner_eq_one_iff_of_norm_one hv (by simp)).mp + h ∘ Subtype.ext ∘ Eq.symm ∘ (inner_eq_one_iff_of_norm_eq_one hv (by simp)).mp continuousOn_invFun := (continuous_stereoInvFun hv).continuousOn theorem stereographic_apply (hv : ‖v‖ = 1) (x : sphere (0 : E) 1) : @@ -364,7 +368,7 @@ section ContMDiffManifold open scoped InnerProductSpace theorem sphere_ext_iff (u v : sphere (0 : E) 1) : u = v ↔ ⟪(u : E), v⟫_ℝ = 1 := by - simp [Subtype.ext_iff, inner_eq_one_iff_of_norm_one] + simp [Subtype.ext_iff, inner_eq_one_iff_of_norm_eq_one] theorem stereographic'_symm_apply {n : ℕ} [Fact (finrank ℝ E = n + 1)] (v : sphere (0 : E) 1) (x : EuclideanSpace ℝ (Fin n)) : @@ -405,7 +409,7 @@ instance EuclideanSpace.instIsManifoldSphere simp only [modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm, Set.range_id, Set.inter_univ, Set.univ_inter, Set.compl_singleton_eq, Set.preimage_setOf_eq] simp only [id, comp_apply, Submodule.subtypeL_apply, OpenPartialHomeomorph.coe_coe_symm, - innerSL_apply, Ne, sphere_ext_iff, real_inner_comm (v' : E)] + innerSL_apply_apply, Ne, sphere_ext_iff, real_inner_comm (v' : E)] rfl) instance (n : ℕ) : IsManifold (𝓡 n) ω (sphere (0 : EuclideanSpace ℝ (Fin (n + 1))) 1) := @@ -450,7 +454,7 @@ theorem ContMDiff.codRestrict_sphere {n : ℕ} [Fact (finrank ℝ E = n + 1)] {f ext x have hfxv : f x = -↑v ↔ ⟪f x, -↑v⟫_ℝ = 1 := by have hfx : ‖f x‖ = 1 := by simpa using hf' x - rw [inner_eq_one_iff_of_norm_one hfx] + rw [inner_eq_one_iff_of_norm_eq_one hfx] exact norm_eq_of_mem_sphere (-v) simp [chartAt, ChartedSpace.chartAt, Subtype.ext_iff, hfxv, real_inner_comm] diff --git a/Mathlib/Geometry/Manifold/Instances/UnitsOfNormedAlgebra.lean b/Mathlib/Geometry/Manifold/Instances/UnitsOfNormedAlgebra.lean index c96eac9822d9fa..ed71fd0d4b7906 100644 --- a/Mathlib/Geometry/Manifold/Instances/UnitsOfNormedAlgebra.lean +++ b/Mathlib/Geometry/Manifold/Instances/UnitsOfNormedAlgebra.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri, Heather Macbeth, Winston Yin -/ -import Mathlib.Geometry.Manifold.Algebra.LieGroup +module + +public import Mathlib.Geometry.Manifold.Algebra.LieGroup /-! # Units of a normed algebra @@ -23,6 +25,8 @@ example {V : Type*} [NormedAddCommGroup V] [NormedSpace 𝕜 V] [CompleteSpace V ``` -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Geometry/Manifold/IntegralCurve/Basic.lean b/Mathlib/Geometry/Manifold/IntegralCurve/Basic.lean index d1fba703482703..6a389de6293b2b 100644 --- a/Mathlib/Geometry/Manifold/IntegralCurve/Basic.lean +++ b/Mathlib/Geometry/Manifold/IntegralCurve/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Winston Yin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Winston Yin -/ -import Mathlib.Geometry.Manifold.MFDeriv.Tangent +module + +public import Mathlib.Geometry.Manifold.MFDeriv.Tangent /-! # Integral curves of vector fields on a manifold @@ -46,6 +48,8 @@ junk. integral curve, vector field -/ +@[expose] public section + open scoped Manifold Topology open Set diff --git a/Mathlib/Geometry/Manifold/IntegralCurve/ExistUnique.lean b/Mathlib/Geometry/Manifold/IntegralCurve/ExistUnique.lean index 67603aa07c1b2c..9ec22367c09e51 100644 --- a/Mathlib/Geometry/Manifold/IntegralCurve/ExistUnique.lean +++ b/Mathlib/Geometry/Manifold/IntegralCurve/ExistUnique.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Winston Yin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Winston Yin -/ -import Mathlib.Analysis.ODE.Gronwall -import Mathlib.Analysis.ODE.PicardLindelof -import Mathlib.Geometry.Manifold.IntegralCurve.Transform -import Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary +module + +public import Mathlib.Analysis.ODE.Gronwall +public import Mathlib.Analysis.ODE.PicardLindelof +public import Mathlib.Geometry.Manifold.IntegralCurve.Transform +public import Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary /-! # Existence and uniqueness of integral curves @@ -42,6 +44,8 @@ We state simpler versions of the theorem for boundaryless manifolds as corollari integral curve, vector field, local existence, uniqueness -/ +@[expose] public section + open scoped Topology open Function Set diff --git a/Mathlib/Geometry/Manifold/IntegralCurve/Transform.lean b/Mathlib/Geometry/Manifold/IntegralCurve/Transform.lean index fdcc1e6cec7f16..4cb3a6d6ed560c 100644 --- a/Mathlib/Geometry/Manifold/IntegralCurve/Transform.lean +++ b/Mathlib/Geometry/Manifold/IntegralCurve/Transform.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Winston Yin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Winston Yin -/ -import Mathlib.Geometry.Manifold.IntegralCurve.Basic +module + +public import Mathlib.Geometry.Manifold.IntegralCurve.Basic /-! # Translation and scaling of integral curves @@ -22,6 +24,8 @@ This file mirrors `Mathlib/Analysis/ODE/Transform`. integral curve, vector field -/ +@[expose] public section + open Function Set variable diff --git a/Mathlib/Geometry/Manifold/IntegralCurve/UniformTime.lean b/Mathlib/Geometry/Manifold/IntegralCurve/UniformTime.lean index a63378cc3d6e51..04236717404dbe 100644 --- a/Mathlib/Geometry/Manifold/IntegralCurve/UniformTime.lean +++ b/Mathlib/Geometry/Manifold/IntegralCurve/UniformTime.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Winston Yin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Winston Yin -/ -import Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique +module + +public import Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique /-! # Uniform time lemma for the global existence of integral curves @@ -23,6 +25,8 @@ import Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique integral curve, vector field, global existence -/ +@[expose] public section + open scoped Topology open Function Set diff --git a/Mathlib/Geometry/Manifold/IsManifold/Basic.lean b/Mathlib/Geometry/Manifold/IsManifold/Basic.lean index c6be9a1baed9a8..a7515014e549b8 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/Basic.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ContDiff.Operations -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.Analysis.RCLike.TangentCone -import Mathlib.Data.Bundle -import Mathlib.Geometry.Manifold.ChartedSpace +module + +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.Analysis.RCLike.TangentCone +public import Mathlib.Data.Bundle +public import Mathlib.Geometry.Manifold.ChartedSpace /-! # `C^n` manifolds (possibly with boundary or corners) @@ -126,6 +128,8 @@ derivative will be `mfderiv I I' f`, instead of the more natural notations `Tang real and complex manifolds). -/ +@[expose] public section + open Topology noncomputable section diff --git a/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean b/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean index 29b62764ba5699..df6a02a14d842c 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Geometry.Manifold.IsManifold.Basic +module + +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Geometry.Manifold.IsManifold.Basic /-! # Extended charts in smooth manifolds @@ -39,6 +41,8 @@ in general, but we can still register them as `PartialEquiv`. -/ +@[expose] public section + noncomputable section open Set Filter Function diff --git a/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean b/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean index 2f87369c8d6f41..9607443d20f82c 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Michael Rothgang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Rothgang -/ +module -import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt +public import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt /-! # Interior and boundary of a manifold @@ -51,6 +52,8 @@ this requires a definition of submanifolds -/ +@[expose] public section + open Set open scoped Topology diff --git a/Mathlib/Geometry/Manifold/LocalDiffeomorph.lean b/Mathlib/Geometry/Manifold/LocalDiffeomorph.lean index 089e84e02567b6..5f2ab1214852d4 100644 --- a/Mathlib/Geometry/Manifold/LocalDiffeomorph.lean +++ b/Mathlib/Geometry/Manifold/LocalDiffeomorph.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Michael Rothgang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Rothgang -/ +module -import Mathlib.Geometry.Manifold.Diffeomorph -import Mathlib.Topology.IsLocalHomeomorph +public import Mathlib.Geometry.Manifold.Diffeomorph +public import Mathlib.Topology.IsLocalHomeomorph /-! # Local diffeomorphisms between manifolds @@ -56,6 +57,8 @@ local diffeomorphism, manifold -/ +@[expose] public section + open Manifold Set TopologicalSpace variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] @@ -252,7 +255,7 @@ lemma IsLocalDiffeomorph.isLocalDiffeomorphOn {f : M → N} (hf : IsLocalDiffeomorph I J n f) (s : Set M) : IsLocalDiffeomorphOn I J n f s := fun x ↦ hf x -/-! # Basic properties of local diffeomorphisms -/ +/-! ### Basic properties of local diffeomorphisms -/ section Basic variable {f : M → N} {s : Set M} {x : M} variable {I J n} diff --git a/Mathlib/Geometry/Manifold/LocalInvariantProperties.lean b/Mathlib/Geometry/Manifold/LocalInvariantProperties.lean index c8f4ce2e52233a..6fcac00b3e2586 100644 --- a/Mathlib/Geometry/Manifold/LocalInvariantProperties.lean +++ b/Mathlib/Geometry/Manifold/LocalInvariantProperties.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.ChartedSpace +module + +public import Mathlib.Geometry.Manifold.ChartedSpace /-! # Local properties invariant under a groupoid @@ -42,6 +44,8 @@ coincide on `s`, then `LiftPropWithinAt P g' s x` holds. We can't call it in the one for `LiftPropWithinAt`. -/ +@[expose] public section + noncomputable section open Set Filter TopologicalSpace diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean b/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean index 2ba1e12464a4ac..1c3715bd30cfca 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions -import Mathlib.Geometry.Manifold.VectorBundle.Tangent +module + +public import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions +public import Mathlib.Geometry.Manifold.VectorBundle.Tangent /-! # Differentiability of models with corners and (extended) charts @@ -26,6 +28,8 @@ In particular, (extended) charts have bijective differential. charts, differentiable, bijective -/ +@[expose] public section + noncomputable section open scoped Manifold ContDiff diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean b/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean index f7af5df2ec6567..e9ad046ce0048b 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.TangentCone.Prod -import Mathlib.Geometry.Manifold.MFDeriv.Defs -import Mathlib.Geometry.Manifold.ContMDiff.Defs +module + +public import Mathlib.Analysis.Calculus.TangentCone.Prod +public import Mathlib.Geometry.Manifold.MFDeriv.Defs +public import Mathlib.Geometry.Manifold.ContMDiff.Defs /-! # Basic properties of the manifold Fréchet derivative @@ -21,6 +23,8 @@ mimicking the API for Fréchet derivatives. -/ +@[expose] public section + noncomputable section assert_not_exists tangentBundleCore diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Defs.lean b/Mathlib/Geometry/Manifold/MFDeriv/Defs.lean index 79f080062c4526..679067ae2bf784 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Defs.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt -import Mathlib.Geometry.Manifold.LocalInvariantProperties +module + +public import Mathlib.Geometry.Manifold.IsManifold.ExtChartAt +public import Mathlib.Geometry.Manifold.LocalInvariantProperties /-! # The derivative of functions between manifolds @@ -97,6 +99,8 @@ the space of equivalence classes of smooth curves in the manifold. derivative, manifold -/ +@[expose] public section + noncomputable section open scoped Topology ContDiff diff --git a/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean b/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean index ba97d83d88e352..bdfe10d9723264 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.MFDeriv.Basic +module + +public import Mathlib.Geometry.Manifold.MFDeriv.Basic /-! ### Relations between vector space derivative and manifold derivative @@ -13,6 +15,8 @@ manifold structure, coincides with the usual Fréchet derivative `fderiv`. In th this and related statements. -/ +@[expose] public section + noncomputable section open scoped Manifold diff --git a/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean b/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean index c4b1659abeb5ed..a33b961df2a00a 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace -import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions +module + +public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace +public import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions /-! ## Equivalence of manifold differentiability with the basic definition for functions between vector spaces @@ -15,6 +17,8 @@ differentiability. -/ +@[expose] public section + open Set ChartedSpace IsManifold open scoped Topology Manifold diff --git a/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean b/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean index 6aaa4ac8903175..2f3a088ab42b84 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Analysis.Calculus.FDeriv.Mul -import Mathlib.Geometry.Manifold.MFDeriv.FDeriv +module + +public import Mathlib.Analysis.Calculus.FDeriv.Mul +public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! # Differentiability of specific functions @@ -18,6 +20,8 @@ In this file, we establish differentiability results for -/ +@[expose] public section + noncomputable section open scoped Manifold diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean b/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean index 0aa4af48ecd937..622f66329468e2 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.MFDeriv.Atlas -import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential -import Mathlib.Geometry.Manifold.VectorBundle.Tangent -import Mathlib.Geometry.Manifold.Diffeomorph +module + +public import Mathlib.Geometry.Manifold.MFDeriv.Atlas +public import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential +public import Mathlib.Geometry.Manifold.VectorBundle.Tangent +public import Mathlib.Geometry.Manifold.Diffeomorph /-! # Derivatives of maps in the tangent bundle @@ -16,6 +18,8 @@ bundle. Notably, it includes formulas for the tangent maps to charts, and unique statements for subsets of the tangent bundle. -/ +@[expose] public section + open Bundle Set open scoped Manifold diff --git a/Mathlib/Geometry/Manifold/MFDeriv/UniqueDifferential.lean b/Mathlib/Geometry/Manifold/MFDeriv/UniqueDifferential.lean index d1b0756ada30ff..f8201d57ef3d2b 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/UniqueDifferential.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/UniqueDifferential.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ -import Mathlib.Geometry.Manifold.MFDeriv.Atlas -import Mathlib.Geometry.Manifold.VectorBundle.Basic +module + +public import Mathlib.Geometry.Manifold.MFDeriv.Atlas +public import Mathlib.Geometry.Manifold.VectorBundle.Basic /-! # Unique derivative sets in manifolds @@ -19,6 +21,8 @@ In this file, we prove various properties of unique derivative sets in manifolds its preimage under the tangent bundle projection also has -/ +@[expose] public section + noncomputable section open scoped Manifold diff --git a/Mathlib/Geometry/Manifold/Metrizable.lean b/Mathlib/Geometry/Manifold/Metrizable.lean index c2899bc47fd8e6..6c05cd48a1e112 100644 --- a/Mathlib/Geometry/Manifold/Metrizable.lean +++ b/Mathlib/Geometry/Manifold/Metrizable.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Geometry.Manifold.IsManifold.Basic -import Mathlib.Topology.Compactness.Paracompact -import Mathlib.Topology.Metrizable.Urysohn +module + +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Geometry.Manifold.IsManifold.Basic +public import Mathlib.Topology.Compactness.Paracompact +public import Mathlib.Topology.Metrizable.Urysohn /-! # Metrizability of a σ-compact manifold @@ -15,6 +17,8 @@ In this file we show that a σ-compact Hausdorff topological manifold over a fin vector space is metrizable. -/ +@[expose] public section + open TopologicalSpace diff --git a/Mathlib/Geometry/Manifold/Notation.lean b/Mathlib/Geometry/Manifold/Notation.lean index 554be78c7e445b..6e4b9b69997221 100644 --- a/Mathlib/Geometry/Manifold/Notation.lean +++ b/Mathlib/Geometry/Manifold/Notation.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Michael Rothgang, Thomas Murrills -/ -import Mathlib.Geometry.Manifold.ContMDiff.Defs -import Mathlib.Geometry.Manifold.MFDeriv.Defs +module + +public import Mathlib.Geometry.Manifold.ContMDiff.Defs +public import Mathlib.Geometry.Manifold.MFDeriv.Defs /-! # Elaborators for differential geometry @@ -84,6 +86,8 @@ the following. -/ +public meta section + open scoped Bundle Manifold ContDiff open Lean Meta Elab Tactic diff --git a/Mathlib/Geometry/Manifold/PartitionOfUnity.lean b/Mathlib/Geometry/Manifold/PartitionOfUnity.lean index 98736bcc241719..fd22ddc1e26ea6 100644 --- a/Mathlib/Geometry/Manifold/PartitionOfUnity.lean +++ b/Mathlib/Geometry/Manifold/PartitionOfUnity.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Geometry.Manifold.Algebra.Structures -import Mathlib.Geometry.Manifold.BumpFunction -import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection -import Mathlib.Topology.MetricSpace.PartitionOfUnity -import Mathlib.Topology.ShrinkingLemma +module + +public import Mathlib.Geometry.Manifold.Algebra.Structures +public import Mathlib.Geometry.Manifold.BumpFunction +public import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection +public import Mathlib.Topology.MetricSpace.PartitionOfUnity +public import Mathlib.Topology.ShrinkingLemma /-! # Smooth partition of unity @@ -57,6 +59,8 @@ function from local functions. smooth bump function, partition of unity -/ +@[expose] public section + universe uι uE uH uM uF open Bundle Function Filter Module Set diff --git a/Mathlib/Geometry/Manifold/PoincareConjecture.lean b/Mathlib/Geometry/Manifold/PoincareConjecture.lean index 8445a361c3ce2b..43c34a0254d563 100644 --- a/Mathlib/Geometry/Manifold/PoincareConjecture.lean +++ b/Mathlib/Geometry/Manifold/PoincareConjecture.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected -import Mathlib.Geometry.Manifold.Diffeomorph -import Mathlib.Geometry.Manifold.Instances.Sphere -import Mathlib.Topology.Homotopy.Equiv -import Mathlib.Util.Superscript +module + +public import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected +public import Mathlib.Geometry.Manifold.Diffeomorph +public import Mathlib.Geometry.Manifold.Instances.Sphere +public import Mathlib.Topology.Homotopy.Equiv +public import Mathlib.Util.Superscript /-! # Statement of the generalized Poincaré conjecture @@ -19,6 +21,8 @@ and `≃ₘ⟮𝓡 n, 𝓡 n⟯` stands for a diffeomorphism, where `𝓡 n` is space viewed as a model space. -/ +@[expose] public section + open scoped Manifold ContDiff open Metric (sphere) diff --git a/Mathlib/Geometry/Manifold/Riemannian/Basic.lean b/Mathlib/Geometry/Manifold/Riemannian/Basic.lean index 51ce66e26c7c70..252cac8b59fecc 100644 --- a/Mathlib/Geometry/Manifold/Riemannian/Basic.lean +++ b/Mathlib/Geometry/Manifold/Riemannian/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Geometry.Manifold.MFDeriv.Atlas -import Mathlib.Geometry.Manifold.Riemannian.PathELength -import Mathlib.Geometry.Manifold.VectorBundle.Riemannian -import Mathlib.Geometry.Manifold.VectorBundle.Tangent -import Mathlib.MeasureTheory.Integral.IntervalIntegral.ContDiff +module + +public import Mathlib.Geometry.Manifold.MFDeriv.Atlas +public import Mathlib.Geometry.Manifold.Riemannian.PathELength +public import Mathlib.Geometry.Manifold.VectorBundle.Riemannian +public import Mathlib.Geometry.Manifold.VectorBundle.Tangent +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.ContDiff /-! # Riemannian manifolds @@ -47,6 +49,8 @@ automatic instances for these cases). One can require whatever regularity one wa the latter from the former as it cannot guess `n`). -/ +@[expose] public section + open Bundle Bornology Set MeasureTheory Manifold Filter open scoped ENNReal ContDiff Topology @@ -82,7 +86,7 @@ end section /-! -# Riemannian structure on an inner product vector space +### Riemannian structure on an inner product vector space We endow an inner product vector space with the canonical Riemannian metric, given by the inner product of the vector space in each of the tangent spaces, and we show that this construction @@ -179,7 +183,7 @@ end section /-! -# Constructing a distance from a Riemannian structure +### Constructing a distance from a Riemannian structure Let `M` be a real manifold with a Riemannian structure. We construct the associated distance and show that the associated topology coincides with the pre-existing topology. Therefore, one may diff --git a/Mathlib/Geometry/Manifold/Riemannian/PathELength.lean b/Mathlib/Geometry/Manifold/Riemannian/PathELength.lean index a89bcf3f6ec7e8..856fefaf267dad 100644 --- a/Mathlib/Geometry/Manifold/Riemannian/PathELength.lean +++ b/Mathlib/Geometry/Manifold/Riemannian/PathELength.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.AddTorsor.AffineMap -import Mathlib.Analysis.SpecialFunctions.SmoothTransition -import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace -import Mathlib.Geometry.Manifold.Instances.Icc -import Mathlib.MeasureTheory.Constructions.UnitInterval -import Mathlib.MeasureTheory.Function.JacobianOneDim +module + +public import Mathlib.Analysis.Calculus.AddTorsor.AffineMap +public import Mathlib.Analysis.SpecialFunctions.SmoothTransition +public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace +public import Mathlib.Geometry.Manifold.Instances.Icc +public import Mathlib.MeasureTheory.Constructions.UnitInterval +public import Mathlib.MeasureTheory.Function.JacobianOneDim /-! # Lengths of paths in manifolds @@ -34,6 +36,8 @@ are to Riemannian spaces we stick with the simpler name. This could be changed w manifolds are studied in mathlib. -/ +@[expose] public section + open Set MeasureTheory open scoped Manifold ENNReal ContDiff Topology diff --git a/Mathlib/Geometry/Manifold/Sheaf/Basic.lean b/Mathlib/Geometry/Manifold/Sheaf/Basic.lean index 4a47b4cf1ee64f..a2d583492415da 100644 --- a/Mathlib/Geometry/Manifold/Sheaf/Basic.lean +++ b/Mathlib/Geometry/Manifold/Sheaf/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Geometry.Manifold.LocalInvariantProperties -import Mathlib.Topology.Sheaves.LocalPredicate +module + +public import Mathlib.Geometry.Manifold.LocalInvariantProperties +public import Mathlib.Topology.Sheaves.LocalPredicate /-! # Generic construction of a sheaf from a `LocalInvariantProp` on a manifold @@ -28,6 +30,8 @@ invariant" property is preserved under restriction and gluing. which satisfy the lifted property `LiftProp P`. -/ +@[expose] public section + open scoped Manifold Topology diff --git a/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean b/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean index e11447bdc2c5ff..039cb5b7342ebd 100644 --- a/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean +++ b/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Geometry.Manifold.Sheaf.Smooth -import Mathlib.Geometry.RingedSpace.LocallyRingedSpace +module + +public import Mathlib.Geometry.Manifold.Sheaf.Smooth +public import Mathlib.Geometry.RingedSpace.LocallyRingedSpace /-! # Smooth manifolds as locally ringed spaces @@ -27,6 +29,8 @@ smooth manifolds. -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean b/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean index 82e5a7a7728364..0270bfc33d687c 100644 --- a/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean +++ b/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth, Adam Topaz -/ -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.Category.Ring.FilteredColimits -import Mathlib.Algebra.Category.Ring.Limits -import Mathlib.CategoryTheory.Sites.Whiskering -import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions -import Mathlib.Geometry.Manifold.Sheaf.Basic +module + +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.Category.Ring.FilteredColimits +public import Mathlib.Algebra.Category.Ring.Limits +public import Mathlib.CategoryTheory.Sites.Whiskering +public import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions +public import Mathlib.Geometry.Manifold.Sheaf.Basic /-! # The sheaf of smooth functions on a manifold @@ -36,7 +38,7 @@ functions from `M` to `𝕜` is a sheaf of commutative rings, the *structure she abelian Lie groups `A`, `A'`, the 'postcomposition-by-`φ`' morphism of sheaves from `smoothSheafCommGroup IM I M A` to `smoothSheafCommGroup IM I' M A'` -# Main results +## Main results * `smoothSheaf.eval_surjective`: `smoothSheaf.eval` is surjective. * `smoothSheafCommRing.eval_surjective`: `smoothSheafCommRing.eval` is surjective. @@ -62,6 +64,8 @@ generalized by this method: see https://github.com/leanprover-community/mathlib4 https://github.com/leanprover-community/mathlib4/pull/5726. -/ +@[expose] public section + noncomputable section open TopologicalSpace Opposite diff --git a/Mathlib/Geometry/Manifold/SmoothApprox.lean b/Mathlib/Geometry/Manifold/SmoothApprox.lean new file mode 100644 index 00000000000000..c1098c9045dcf9 --- /dev/null +++ b/Mathlib/Geometry/Manifold/SmoothApprox.lean @@ -0,0 +1,140 @@ +/- +Copyright (c) 2025 Anatole Dedecker. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Anatole Dedecker, Patrick Massot +-/ +module + +public import Mathlib.Geometry.Manifold.Notation +public import Mathlib.Geometry.Manifold.PartitionOfUnity + +/-! +# Approximation of continuous functions by smooth functions + +In this file, we deduce from the existence of smooth partitions of unity that any continuous map +from a real σ-compact finite dimensional manifold `M` to a real normed space `F` can be +approximated uniformly by smooth functions. + +More precisely, we strengthen this result in three ways : +* instead of a single number `ε > 0`, one may prescribe the precision of the approximation using + an arbitrary continuous positive function `ε : M → ℝ`. This allows, for example, a control + on the asymptotic behaviour of the approximation (e.g, choosing a precision `ε` which vanishes + at infinity yields that continuous functions vanishing at infinity can be approximated by + smooth functions vanishing at infinity). +* if the original map `f` already has the desired regularity on some neighborhood of a closed + set `M`, one can choose an approximation which stays equal to `f` on `S`. This allows + for some additional control in a setting with iterated approximations. +* finally, one may prescribe the approximation to vanish wherever the original function vanishes. + For example, this shows that continuous functions supported on some compact set `K` may be + approximated uniformly by smooth function supported on the **same** compact `K`. + (Compare with arguments based on convolution where one needs to thicken `K` a bit). + +## Main results + +* `Continuous.exists_contMDiff_approx_and_eqOn`: approximating a continuous function `f : M → F` + by a `C^n` function `g : M → E`, with precision prescribed by a continuous positive `ε : M → ℝ`, + while ensuring that `support g ⊆ support f` and that `g` coincides with `f` on some closed set `S` + in the neighborhood of which `f` is already `C^n`. +* `Continuous.exists_contMDiff_approx`: a simpler version of the previous result when one does not + care about prescribing points with `g x = f x`. One still gets `support g ⊆ support f` for free, + so we put it in the conclusion. +* `Continuous.exists_contDiff_approx_and_eqOn`, `Continuous.exists_contDiff_approx`: specializations + of the previous results when `M = E` is a normed space. + +## Implementation notes + +With minor work, we could strenghten the statements in the following ways: +- the precision function `ε : M → ℝ` may be assumed `LowerSemicontinuous` instead of `Continuous`, +- the condition `support g ⊆ support f`, which translates to `∀ x, f x = 0 → g x = 0`, + may be strenghtened to `∀ x, f x = h x → g x = h x` for some arbitrary smooth `h : M → F`. + +This file depends on the manifold library, which may be annoying if you only need the normed space +statements. **Please do not let this refrain you from using them** if they apply naturally in your +context: if this is too much of a problem, you should complain on Zulip, so that we get more data +about the need for a non-manifold version of `SmoothPartitionOfUnity`. + +## TODO + +- More generally, all results should apply to approximating continuous sections of a smooth + vector bundle by smooth sections. +- If needed, specialize to `M = U` an open subset of a normed space `E` + (we currently do `M = E` only). + +-/ + +@[expose] public section + +open Set Function +open scoped Topology ContDiff Manifold + +noncomputable section + +section Manifold + +variable {E F H M : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [TopologicalSpace H] (I : ModelWithCorners ℝ E H) + [TopologicalSpace M] [ChartedSpace H M] [IsManifold I ∞ M] [SigmaCompactSpace M] [T2Space M] + +variable {f : M → F} {ε : M → ℝ} + +theorem Continuous.exists_contMDiff_approx_and_eqOn (n : ℕ∞) + (f_cont : Continuous f) (ε_cont : Continuous ε) (ε_pos : ∀ x, 0 < ε x) + {S U : Set M} (hS : IsClosed S) (hU : U ∈ 𝓝ˢ S) (hfU : CMDiff[U] n f) : + ∃ g : C^n⟮I, M; 𝓘(ℝ, F), F⟯, + (∀ x, dist (g x) (f x) < ε x) ∧ EqOn g f S ∧ support g ⊆ support f := by + have dist_f_f : ∀ x, dist (f x) (f x) < ε x := by simpa only [dist_self] using ε_pos + let t : M → Set F := fun x ↦ {y | dist y (f x) < ε x ∧ (x ∈ S → y = f x) ∧ (f x = 0 → y = 0)} + suffices ∃ g : C^n⟮I, M; 𝓘(ℝ, F), F⟯, ∀ x, g x ∈ t x by + rcases this with ⟨g, hg⟩ + exact ⟨g, fun x ↦ (hg x).1, fun x ↦ (hg x).2.1, fun x ↦ mt (hg x).2.2⟩ + have t_conv (x) : Convex ℝ (t x) := (convex_ball (f x) (ε x)).inter <| + (convex_singleton _).setOf_const_imp.inter (convex_singleton _).setOf_const_imp + apply exists_contMDiffOn_forall_mem_convex_of_local I t_conv + intro x + by_cases hx : x ∈ S + · refine ⟨U, mem_nhdsSet_iff_forall.mp hU x hx, ?_⟩ + exact ⟨f, hfU, fun y _ ↦ ⟨dist_f_f y, fun _ ↦ rfl, id⟩⟩ + · have : ∀ᶠ y in 𝓝 x, y ∉ S ∧ dist (f x) (f y) < ε y := (hS.isOpen_compl.eventually_mem hx).and + ((continuous_const.dist f_cont).continuousAt.eventually_lt ε_cont.continuousAt (dist_f_f x)) + have : ∀ᶠ y in 𝓝 x, (y ∉ S ∧ dist (f x) (f y) < ε y) ∧ (f y = 0 → f x = 0) := by + by_cases hx' : f x = 0 + · simpa [hx'] using this + · simpa [hx'] using this.and (f_cont.continuousAt.eventually_ne hx') + exact ⟨_, this, (fun _ ↦ f x), contMDiffOn_const, fun y hy ↦ ⟨hy.1.2, by simp [hy.1.1], hy.2⟩⟩ + +theorem Continuous.exists_contMDiff_approx (n : ℕ∞) + (f_cont : Continuous f) (ε_cont : Continuous ε) (ε_pos : ∀ x, 0 < ε x) : + ∃ g : C^n⟮I, M; 𝓘(ℝ, F), F⟯, (∀ x, dist (g x) (f x) < ε x) ∧ support g ⊆ support f := by + obtain ⟨g, g_approx, -, g_supp⟩ := f_cont.exists_contMDiff_approx_and_eqOn I n ε_cont ε_pos + isClosed_empty mem_nhdsSet_empty contMDiffOn_empty + exact ⟨g, g_approx, g_supp⟩ + +end Manifold + +section NormedSpace + +variable {E F : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +variable {f : E → F} {ε : E → ℝ} + +theorem Continuous.exists_contDiff_approx_and_eqOn (n : ℕ∞) + (f_cont : Continuous f) (ε_cont : Continuous ε) (ε_pos : ∀ x, 0 < ε x) + {S U : Set E} (hS : IsClosed S) (hU : U ∈ 𝓝ˢ S) (hfU : ContDiffOn ℝ n f U) : + ∃ g : E → F, ContDiff ℝ n g ∧ + (∀ x, dist (g x) (f x) < ε x) ∧ EqOn g f S ∧ support g ⊆ support f := by + obtain ⟨g, g_approx, g_eqOn, g_supp⟩ := f_cont.exists_contMDiff_approx_and_eqOn 𝓘(ℝ, E) n + ε_cont ε_pos hS hU hfU.contMDiffOn + exact ⟨g, g.contMDiff.contDiff, g_approx, g_eqOn, g_supp⟩ + +theorem Continuous.exists_contDiff_approx (n : ℕ∞) + (f_cont : Continuous f) (ε_cont : Continuous ε) (ε_pos : ∀ x, 0 < ε x) : + ∃ g : E → F, ContDiff ℝ n g ∧ (∀ x, dist (g x) (f x) < ε x) ∧ support g ⊆ support f := by + obtain ⟨g, g_contDiff, g_approx, -, g_supp⟩ := f_cont.exists_contDiff_approx_and_eqOn n + ε_cont ε_pos isClosed_empty mem_nhdsSet_empty contDiffOn_empty + exact ⟨g, g_contDiff, g_approx, g_supp⟩ + +end NormedSpace diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean b/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean index b050e58ccf9603..615f6c065bd49b 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Floris van Doorn, Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Geometry.Manifold.ContMDiff.Atlas -import Mathlib.Geometry.Manifold.VectorBundle.FiberwiseLinear -import Mathlib.Topology.VectorBundle.Constructions +module + +public import Mathlib.Geometry.Manifold.ContMDiff.Atlas +public import Mathlib.Geometry.Manifold.VectorBundle.FiberwiseLinear +public import Mathlib.Topology.VectorBundle.Constructions /-! # `C^n` vector bundles @@ -57,6 +59,8 @@ fields, etc. vector bundle. -/ +@[expose] public section + assert_not_exists mfderiv open Bundle Set OpenPartialHomeomorph diff --git a/Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean b/Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean index 154f0d8bb9eebb..c6d48aad248a27 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn, Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace +module + +public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace /-! # The groupoid of `C^n`, fiberwise-linear maps @@ -11,6 +13,8 @@ This file contains preliminaries for the definition of a `C^n` vector bundle: an `StructureGroupoid`, the groupoid of `contMDiffFiberwiseLinear` functions. -/ +@[expose] public section + noncomputable section open Set TopologicalSpace diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Hom.lean b/Mathlib/Geometry/Manifold/VectorBundle/Hom.lean index d7ffb0a4d05e79..559ae3f934997a 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Hom.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Hom.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Geometry.Manifold.VectorBundle.Basic -import Mathlib.Topology.VectorBundle.Hom -import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable +module + +public import Mathlib.Geometry.Manifold.VectorBundle.Basic +public import Mathlib.Topology.VectorBundle.Hom +public import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable /-! # Homs of `C^n` vector bundles over the same base space @@ -18,6 +20,8 @@ Indeed, semilinear maps are typically not smooth. For instance, complex conjugat `ℂ`-differentiable. -/ +@[expose] public section + noncomputable section open Bundle Set OpenPartialHomeomorph ContinuousLinearMap Pretrivialization diff --git a/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean b/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean index 7d7187b787fbf1..2c14c2aa2d9b3d 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Michael Rothgang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Michael Rothgang -/ -import Mathlib.Geometry.Manifold.Algebra.Monoid -import Mathlib.Geometry.Manifold.Notation -import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable -import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection +module +public import Mathlib.Geometry.Manifold.Algebra.Monoid +public import Mathlib.Geometry.Manifold.Notation +public import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable +public import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection /-! # Local frames in a vector bundle @@ -19,11 +20,11 @@ We define a predicate `IsLocalFrame` for a collection of sections to be a local and define basic notions (such as the coefficients of a section w.r.t. a local frame, and checking the smoothness of `t` via its coefficients in a local frame). -In future work, given a basis `b` for `F` and a local trivialisation `e` for `V`, -we will construct a **smooth local frame** on `V` w.r.t. `e` and `b`, -i.e. a collection of sections `sᵢ` of `V` which is smooth on `e.baseSet` such that `{sᵢ x}` is a -basis of `V x` for each `x ∈ e.baseSet`. Any section `s` of `e` can be uniquely written as -`s = ∑ i, f^i sᵢ` near `x`, and `s` is smooth at `x` iff the functions `f^i` are. +Given a basis `b` for `F` and a local trivialisation `e` for `V`, we construct a +**smooth local frame** on `V` w.r.t. `e` and `b`, i.e. a collection of sections `sᵢ` of `V` +which is smooth on `e.baseSet` such that `{sᵢ x}` is a basis of `V x` for each `x ∈ e.baseSet`. +Any section `s` of `e` can be uniquely written as `s = ∑ i, f^i sᵢ` near `x`, +and `s` is smooth at `x` iff the functions `f^i` are. In this file, we prove the latter statement for finite-rank bundles (with coefficients in a complete field). In `OrthonormalFrame.lean`, we will prove the same for real vector bundles of any @@ -57,9 +58,19 @@ Suppose `{sᵢ}` is a local frame on `U`, and `hs : IsLocalFrameOn s U`. if all of its frame coefficients are * `IsLocalFrameOn.contMDiffOn_off_coeff hs`: a section `t` is `C^k` on an open set `t ⊆ U` ff all of its frame coefficients are -* `MDifferentiable` versions of the above three statements +* `MDifferentiable` versions of the previous three statements + +In the following lemmas, let `e` be a compatible local trivialisation of `V`, and `b` a basis of +the model fiber `F`. +* `Trivialization.basisAt e b`: for each `x ∈ e.baseSet`, + return the basis of `V x` induced by `e` and `b` +* `e.localFrame b`: the local frame on `V` induced by `e` and `b`. + Use `e.localFrame b i` to access the i-th section in that frame. +* `e.contMDiffOn_localFrame_baseSet`: each section `e.localFrame b i` is smooth on `e.baseSet` # TODO + +Strengthen the proof of smoothness in terms of the local frame coefficients. * `IsLocalFrameOn.contMDiffOn_coeff hs`: if `t` is a `C^k` section, each coefficient `hs.coeff i t` is `C^k` on `U` * `IsLocalFrameOn.contMDiffAt_iff_coeff hs`: a section `t` is `C^k` at `x ∈ U` @@ -77,6 +88,8 @@ only meaningful on the set on which they are a local frame. vector bundle, local frame, smoothness -/ + +@[expose] public section open Bundle Filter Function Topology Module open scoped Bundle Manifold ContDiff @@ -84,7 +97,7 @@ open scoped Bundle Manifold ContDiff variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] {I : ModelWithCorners 𝕜 E H} - {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [IsManifold I 0 M] + {M : Type*} [TopologicalSpace M] [ChartedSpace H M] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] -- `F` model fiber @@ -92,15 +105,12 @@ variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {V : M → Type*} [TopologicalSpace (TotalSpace F V)] [∀ x, AddCommGroup (V x)] [∀ x, Module 𝕜 (V x)] [∀ x : M, TopologicalSpace (V x)] - [FiberBundle F V] [VectorBundle 𝕜 F V] [ContMDiffVectorBundle n F V I] - -- `V` vector bundle + [FiberBundle F V] noncomputable section section IsLocalFrame -omit [IsManifold I 0 M] [VectorBundle 𝕜 F V] - variable {ι : Type*} {s s' : ι → (x : M) → V x} {u u' : Set M} {x : M} {n : WithTop ℕ∞} variable (I F n) in @@ -151,6 +161,16 @@ lemma toBasisAt_coe (hs : IsLocalFrameOn I F n s u) (hx : x ∈ u) (i : ι) : toBasisAt hs hx i = s i x := by simpa only [toBasisAt] using Basis.mk_apply (hs.linearIndependent hx) (hs.generating hx) i +/-- If `{sᵢ}` is a local frame on a vector bundle, `F` being finite-dimensional implies the +indexing set being finite. -/ +def fintype_of_finiteDimensional [VectorBundle 𝕜 F V] [FiniteDimensional 𝕜 F] + (hs : IsLocalFrameOn I F n s u) (hx : x ∈ u) : Fintype ι := by + have : FiniteDimensional 𝕜 (V x) := by + let phi := (trivializationAt F V x).linearEquivAt 𝕜 x + (FiberBundle.mem_baseSet_trivializationAt' x) + exact Finite.equiv phi.symm + exact FiniteDimensional.fintypeBasisIndex (hs.toBasisAt hx) + open scoped Classical in /-- Coefficients of a section `s` of `V` w.r.t. a local frame `{s i}` on `u`. Outside of `u`, this returns the junk value 0. -/ @@ -210,9 +230,11 @@ lemma coeff_eq_of_eq (hs : IsLocalFrameOn I F n s u) (hs' : IsLocalFrameOn I F n /-- Two sections `s` and `t` are equal at `x` if and only if their coefficients w.r.t. some local frame at `x` agree. -/ -lemma eq_iff_coeff [Fintype ι] (hs : IsLocalFrameOn I F n s u) (hx : x ∈ u) : - t x = t' x ↔ ∀ i, hs.coeff i t x = hs.coeff i t' x := - ⟨fun h i ↦ hs.coeff_congr h i, fun h ↦ by +lemma eq_iff_coeff [VectorBundle 𝕜 F V] [FiniteDimensional 𝕜 F] + (hs : IsLocalFrameOn I F n s u) (hx : x ∈ u) : + t x = t' x ↔ ∀ i, hs.coeff i t x = hs.coeff i t' x := by + have := fintype_of_finiteDimensional hs hx + exact ⟨fun h i ↦ hs.coeff_congr h i, fun h ↦ by simp +contextual [h, hs.coeff_sum_eq t hx, hs.coeff_sum_eq t' hx]⟩ lemma coeff_apply_zero_at (hs : IsLocalFrameOn I F n s u) (ht : t x = 0) (i : ι) : @@ -223,8 +245,10 @@ variable (hs : IsLocalFrameOn I F n s u) [VectorBundle 𝕜 F V] /-- Given a local frame `s i ` on `u`, if a section `t` has `C^k` coefficients on `u` w.r.t. `s i`, then `t` is `C^n` on `u`. -/ -lemma contMDiffOn_of_coeff [Fintype ι] (h : ∀ i, CMDiff[u] n (hs.coeff i t)) : +lemma contMDiffOn_of_coeff [FiniteDimensional 𝕜 F] (h : ∀ i, CMDiff[u] n (hs.coeff i t)) : CMDiff[u] n (T% t) := by + rcases u.eq_empty_or_nonempty with rfl | ⟨x, hx⟩; · simp + have := fintype_of_finiteDimensional hs hx have this (i) : CMDiff[u] n (T% (hs.coeff i t • s i)) := (h i).smul_section (hs.contMDiffOn i) have almost : CMDiff[u] n (T% (fun x ↦ ∑ i, (hs.coeff i t) x • s i x)) := @@ -235,17 +259,19 @@ lemma contMDiffOn_of_coeff [Fintype ι] (h : ∀ i, CMDiff[u] n (hs.coeff i t)) /-- Given a local frame `s i` on a neighbourhood `u` of `x`, if a section `t` has `C^k` coefficients at `x` w.r.t. `s i`, then `t` is `C^n` at `x`. -/ -lemma contMDiffAt_of_coeff [Fintype ι] +lemma contMDiffAt_of_coeff [FiniteDimensional 𝕜 F] (h : ∀ i, CMDiffAt n (hs.coeff i t) x) (hu : u ∈ 𝓝 x) : CMDiffAt n (T% t) x := by + have := fintype_of_finiteDimensional hs (mem_of_mem_nhds hu) have almost : CMDiffAt n (T% (fun x ↦ ∑ i, (hs.coeff i t) x • s i x)) x := .sum_section (fun i _ ↦ (h i).smul_section <| (hs.contMDiffOn i).contMDiffAt hu) exact almost.congr_of_eventuallyEq <| (hs.eventually_eq_sum_coeff_smul t hu).mono (by simp) /-- Given a local frame `s i` on an open set `u` containing `x`, if a section `t` has `C^k` coefficients at `x ∈ u` w.r.t. `s i`, then `t` is `C^n` at `x`. -/ -lemma contMDiffAt_of_coeff_aux [Fintype ι] (h : ∀ i, CMDiffAt n (hs.coeff i t) x) - (hu : IsOpen u) (hx : x ∈ u) : CMDiffAt n (T% t) x := - hs.contMDiffAt_of_coeff h (hu.mem_nhds hx) +lemma contMDiffAt_of_coeff_aux [FiniteDimensional 𝕜 F] (h : ∀ i, CMDiffAt n (hs.coeff i t) x) + (hu : IsOpen u) (hx : x ∈ u) : CMDiffAt n (T% t) x := by + have := fintype_of_finiteDimensional hs hx + exact hs.contMDiffAt_of_coeff h (hu.mem_nhds hx) section @@ -253,8 +279,10 @@ variable (hs : IsLocalFrameOn I F 1 s u) /-- Given a local frame `s i ` on `u`, if a section `t` has differentiable coefficients on `u` w.r.t. `s i`, then `t` is differentiable on `u`. -/ -lemma mdifferentiableOn_of_coeff [Fintype ι] (h : ∀ i, MDiff[u] (hs.coeff i t)) : +lemma mdifferentiableOn_of_coeff [FiniteDimensional 𝕜 F] (h : ∀ i, MDiff[u] (hs.coeff i t)) : MDiff[u] (T% t) := by + rcases u.eq_empty_or_nonempty with rfl | ⟨x, hx⟩; · simp + have := fintype_of_finiteDimensional hs hx have this (i) : MDiff[u] (T% (hs.coeff i t • s i)) := (h i).smul_section ((hs.contMDiffOn i).mdifferentiableOn le_rfl) have almost : MDiff[u] (T% (fun x ↦ ∑ i, (hs.coeff i t) x • s i x)) := @@ -265,8 +293,9 @@ lemma mdifferentiableOn_of_coeff [Fintype ι] (h : ∀ i, MDiff[u] (hs.coeff i t /-- Given a local frame `s i` on a neighbourhood `u` of `x`, if a section `t` has differentiable coefficients at `x` w.r.t. `s i`, then `t` is differentiable at `x`. -/ -lemma mdifferentiableAt_of_coeff [Fintype ι] +lemma mdifferentiableAt_of_coeff [FiniteDimensional 𝕜 F] (h : ∀ i, MDiffAt (hs.coeff i t) x) (hu : u ∈ 𝓝 x) : MDiffAt (T% t) x := by + have := fintype_of_finiteDimensional hs (mem_of_mem_nhds hu) have almost : MDiffAt (T% (fun x ↦ ∑ i, (hs.coeff i t) x • s i x)) x := .sum_section (fun i ↦ (h i).smul_section <| ((hs.contMDiffOn i).mdifferentiableOn le_rfl).mdifferentiableAt hu) @@ -274,7 +303,7 @@ lemma mdifferentiableAt_of_coeff [Fintype ι] /-- Given a local frame `s i` on open set `u` containing `x`, if a section `t` has differentiable coefficients at `x ∈ u` w.r.t. `s i`, then `t` is differentiable at `x`. -/ -lemma mdifferentiableAt_of_coeff_aux [Fintype ι] (h : ∀ i, MDiffAt (hs.coeff i t) x) +lemma mdifferentiableAt_of_coeff_aux [FiniteDimensional 𝕜 F] (h : ∀ i, MDiffAt (hs.coeff i t) x) (hu : IsOpen u) (hx : x ∈ u) : MDiffAt (T% t) x := hs.mdifferentiableAt_of_coeff h (hu.mem_nhds hx) @@ -283,3 +312,59 @@ end end IsLocalFrameOn end IsLocalFrame + +namespace Trivialization + +variable [VectorBundle 𝕜 F V] [ContMDiffVectorBundle n F V I] {ι : Type*} {x : M} + (e : Trivialization F (TotalSpace.proj : TotalSpace F V → M)) [MemTrivializationAtlas e] + (b : Basis ι 𝕜 F) + +/-- Given a compatible local trivialisation `e` of `V` and a basis `b` of the model fiber `F`, +return the corresponding basis of `V x`. -/ +def basisAt (hx : x ∈ e.baseSet) : Basis ι 𝕜 (V x) := + b.map (e.linearEquivAt (R := 𝕜) x hx).symm + +open scoped Classical in +/-- The local frame on `V` induced by a compatible local trivialization `e` of `V` and a basis +`b` of the model fiber `F`. Use `e.localFrame b i` to access the `i`-th section in that frame. + +If `x` is outside of `e.baseSet`, this returns the junk value 0. -/ +def localFrame : ι → (x : M) → V x := + fun i x ↦ if hx : x ∈ e.baseSet then e.basisAt b hx i else 0 + +@[simp] +lemma localFrame_apply_of_mem_baseSet {i : ι} (hx : x ∈ e.baseSet) : + e.localFrame b i x = e.basisAt b hx i := by + simp [localFrame, hx] + +lemma localFrame_apply_of_notMem {i : ι} (hx : x ∉ e.baseSet) : e.localFrame b i x = 0 := by + simp [localFrame, hx] + +/-- Each local frame `{sᵢ} ∈ Γ(E)` of a `C^k` vector bundle, defined by a local trivialisation `e`, +is `C^k` on `e.baseSet`. -/ +lemma contMDiffOn_localFrame_baseSet (i : ι) : CMDiff[e.baseSet] n (T% (e.localFrame b i)) := by + rw [e.contMDiffOn_section_baseSet_iff] + apply (contMDiffOn_const (c := b i)).congr + intro y hy + simp [hy, basisAt] + +variable (I) in +/-- `b.localFrame e i` is indeed a local frame on `e.baseSet` -/ +lemma isLocalFrameOn_localFrame_baseSet : IsLocalFrameOn I F n (e.localFrame b) e.baseSet where + contMDiffOn i := e.contMDiffOn_localFrame_baseSet _ b i + linearIndependent := by + intro x hx + convert (e.basisAt b hx).linearIndependent + simp [hx, basisAt] + generating := by + intro x hx + convert (e.basisAt b hx).span_eq.ge + simp [hx, basisAt] + +lemma _root_.contMDiffAt_localFrame_of_mem (i : ι) (hx : x ∈ e.baseSet) : + CMDiffAt n (T% (e.localFrame b i)) x := + (e.isLocalFrameOn_localFrame_baseSet I n b).contMDiffAt e.open_baseSet hx _ + +end Trivialization + +end diff --git a/Mathlib/Geometry/Manifold/VectorBundle/MDifferentiable.lean b/Mathlib/Geometry/Manifold/VectorBundle/MDifferentiable.lean index b692479e992d74..a9d70d6503620c 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/MDifferentiable.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/MDifferentiable.lean @@ -3,15 +3,19 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Patrick Massot, Michael Rothgang -/ -import Mathlib.Geometry.Manifold.VectorBundle.Basic -import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace -import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions +module + +public import Mathlib.Geometry.Manifold.VectorBundle.Basic +public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace +public import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions /-! # Differentiability of functions in vector bundles -/ +@[expose] public section + open Bundle Set OpenPartialHomeomorph ContinuousLinearMap Pretrivialization Filter open scoped Manifold Bundle Topology diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Pullback.lean b/Mathlib/Geometry/Manifold/VectorBundle/Pullback.lean index e0842d2b0af217..14394773f2603f 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Pullback.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Pullback.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Floris van Doorn, Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Geometry.Manifold.ContMDiffMap -import Mathlib.Geometry.Manifold.VectorBundle.Basic +module + +public import Mathlib.Geometry.Manifold.ContMDiffMap +public import Mathlib.Geometry.Manifold.VectorBundle.Basic /-! # Pullbacks of `C^n` vector bundles @@ -17,6 +19,8 @@ This file defines pullbacks of `C^n` vector bundles over a manifold. -/ +@[expose] public section + open Bundle Set open scoped Manifold diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Riemannian.lean b/Mathlib/Geometry/Manifold/VectorBundle/Riemannian.lean index 45bbf2ba7608e9..99e31601c44451 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Riemannian.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Riemannian.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Geometry.Manifold.VectorBundle.Hom -import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable -import Mathlib.Topology.VectorBundle.Riemannian +module + +public import Mathlib.Geometry.Manifold.VectorBundle.Hom +public import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable +public import Mathlib.Topology.VectorBundle.Riemannian /-! # Riemannian vector bundles @@ -38,6 +40,8 @@ variable ``` -/ +@[expose] public section + open Manifold Bundle ContinuousLinearMap ENat Bornology open scoped ContDiff Topology diff --git a/Mathlib/Geometry/Manifold/VectorBundle/SmoothSection.lean b/Mathlib/Geometry/Manifold/VectorBundle/SmoothSection.lean index 00fcbc301d5fcc..674e82238b964f 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/SmoothSection.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/SmoothSection.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth, Floris van Doorn, Michael Rothgang -/ -import Mathlib.Geometry.Manifold.Algebra.LieGroup -import Mathlib.Geometry.Manifold.MFDeriv.Basic -import Mathlib.Topology.ContinuousMap.Basic -import Mathlib.Geometry.Manifold.VectorBundle.Basic +module + +public import Mathlib.Geometry.Manifold.Algebra.LieGroup +public import Mathlib.Geometry.Manifold.MFDeriv.Basic +public import Mathlib.Topology.ContinuousMap.Basic +public import Mathlib.Geometry.Manifold.VectorBundle.Basic /-! # `C^n` sections @@ -19,6 +21,8 @@ sections are `C^n`. -/ +@[expose] public section + open Bundle Filter Function diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean b/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean index ef10f54603fddf..dc7b2e196b0988 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.Geometry.Manifold.VectorBundle.Basic +module + +public import Mathlib.Geometry.Manifold.VectorBundle.Basic /-! # Tangent bundles @@ -33,6 +35,8 @@ This defines a vector bundle `TangentBundle` with fibers `TangentSpace`. and a `C^n` manifold. -/ +@[expose] public section + open Bundle Set IsManifold OpenPartialHomeomorph ContinuousLinearMap diff --git a/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean b/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean index b4f3946e15c8d1..0c0c3a1750558c 100644 --- a/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean +++ b/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.VectorField -import Mathlib.Geometry.Manifold.ContMDiffMFDeriv -import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace -import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable -import Mathlib.Geometry.Manifold.VectorField.Pullback +module + +public import Mathlib.Analysis.Calculus.VectorField +public import Mathlib.Geometry.Manifold.ContMDiffMFDeriv +public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace +public import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable +public import Mathlib.Geometry.Manifold.VectorField.Pullback /-! # Lie brackets of vector fields on manifolds @@ -24,6 +26,8 @@ The main results are the following: -/ +@[expose] public section + open Set Function Filter open scoped Topology Manifold ContDiff diff --git a/Mathlib/Geometry/Manifold/VectorField/Pullback.lean b/Mathlib/Geometry/Manifold/VectorField/Pullback.lean index fd4c92ac4650db..e87a8026cd6609 100644 --- a/Mathlib/Geometry/Manifold/VectorField/Pullback.lean +++ b/Mathlib/Geometry/Manifold/VectorField/Pullback.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.VectorField -import Mathlib.Geometry.Manifold.ContMDiffMFDeriv -import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace -import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable +module + +public import Mathlib.Analysis.Calculus.VectorField +public import Mathlib.Geometry.Manifold.ContMDiffMFDeriv +public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace +public import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable /-! # Vector fields in manifolds @@ -36,6 +38,8 @@ a function from `M` to its tangent bundle through a coercion, as in: `MDifferentiableWithinAt I I.tangent (fun y ↦ (V y : TangentBundle I M)) s x`. -/ +@[expose] public section + open Set Function Filter open scoped Topology Manifold ContDiff diff --git a/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean b/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean index 4a5d2293ded495..eb7e40d3057172 100644 --- a/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean +++ b/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.FieldTheory.Finiteness -import Mathlib.Geometry.Manifold.Diffeomorph -import Mathlib.Geometry.Manifold.Instances.Real -import Mathlib.Geometry.Manifold.PartitionOfUnity +module + +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.Geometry.Manifold.Diffeomorph +public import Mathlib.Geometry.Manifold.Instances.Real +public import Mathlib.Geometry.Manifold.PartitionOfUnity /-! # Whitney embedding theorem @@ -26,6 +28,8 @@ for sufficiently large `n` there exists a smooth embedding `M → ℝ^n`. partition of unity, smooth bump function, whitney theorem -/ +@[expose] public section + universe uι uE uH uM open Function Filter Module Set Topology diff --git a/Mathlib/Geometry/RingedSpace/Basic.lean b/Mathlib/Geometry/RingedSpace/Basic.lean index 531ad3e6b6a2e7..6b232b0ab25790 100644 --- a/Mathlib/Geometry/RingedSpace/Basic.lean +++ b/Mathlib/Geometry/RingedSpace/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Justus Springer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Justus Springer, Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.Algebra.Category.Ring.FilteredColimits -import Mathlib.Algebra.Category.Ring.Limits -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Geometry.RingedSpace.SheafedSpace -import Mathlib.Topology.Sheaves.Stalks +module + +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.Algebra.Category.Ring.FilteredColimits +public import Mathlib.Algebra.Category.Ring.Limits +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Geometry.RingedSpace.SheafedSpace +public import Mathlib.Topology.Sheaves.Stalks /-! # Ringed spaces @@ -20,6 +22,8 @@ make use of the locality of stalks. See for instance PNat.equivNonZeroDivisorsNat diff --git a/Mathlib/GroupTheory/DoubleCoset.lean b/Mathlib/GroupTheory/DoubleCoset.lean index 0188f9fa45b205..07d13f5892b6ff 100644 --- a/Mathlib/GroupTheory/DoubleCoset.lean +++ b/Mathlib/GroupTheory/DoubleCoset.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.GroupTheory.Coset.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.GroupTheory.Coset.Basic /-! # Double cosets @@ -20,6 +22,8 @@ this is the usual left or right quotient of a group by a subgroup. * `DoubleCoset.quotient`: The quotient of `G` by the double coset relation, i.e, `H \ G / K`. -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {G : Type*} [Group G] {α : Type*} [Mul α] diff --git a/Mathlib/GroupTheory/EckmannHilton.lean b/Mathlib/GroupTheory/EckmannHilton.lean index f7b56f0f2250d4..8dc97239afcd97 100644 --- a/Mathlib/GroupTheory/EckmannHilton.lean +++ b/Mathlib/GroupTheory/EckmannHilton.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau, Robert Y. Lewis -/ -import Mathlib.Algebra.Group.Defs +module + +public import Mathlib.Algebra.Group.Defs /-! # Eckmann-Hilton argument @@ -21,6 +23,8 @@ The main application lies in proving that higher homotopy groups (`πₙ` for `n -/ +@[expose] public section + universe u namespace EckmannHilton diff --git a/Mathlib/GroupTheory/Exponent.lean b/Mathlib/GroupTheory/Exponent.lean index 7995a18422a244..6da80b7ee81c01 100644 --- a/Mathlib/GroupTheory/Exponent.lean +++ b/Mathlib/GroupTheory/Exponent.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.Algebra.GCDMonoid.Finset -import Mathlib.Algebra.GCDMonoid.Nat -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Data.Nat.Factorization.LCM -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.Tactic.Peel +module + +public import Mathlib.Algebra.GCDMonoid.Finset +public import Mathlib.Algebra.GCDMonoid.Nat +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Data.Nat.Factorization.LCM +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.Tactic.Peel /-! # Exponent of a group @@ -42,6 +44,8 @@ it is equal to the lowest common multiple of the order of all elements of the gr * Refactor the characteristic of a ring to be the exponent of its underlying additive group. -/ +@[expose] public section + universe u @@ -599,7 +603,7 @@ theorem Monoid.exponent_prod {M₁ M₂ : Type*} [Monoid M₁] [Monoid M₂] : end PiProd -/-! # Properties of monoids with exponent two -/ +/-! ### Properties of monoids with exponent two -/ section ExponentTwo diff --git a/Mathlib/GroupTheory/FiniteAbelian/Basic.lean b/Mathlib/GroupTheory/FiniteAbelian/Basic.lean index ef860136e39ef7..218e060273236c 100644 --- a/Mathlib/GroupTheory/FiniteAbelian/Basic.lean +++ b/Mathlib/GroupTheory/FiniteAbelian/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pierre-Alexandre Bazin -/ -import Mathlib.Algebra.Module.PID -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.Data.ZMod.QuotientRing +module + +public import Mathlib.Algebra.Module.PID +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.Data.ZMod.QuotientRing /-! # Structure of finite(ly generated) abelian groups @@ -18,6 +20,8 @@ import Mathlib.Data.ZMod.QuotientRing * `CommGroup.equiv_prod_multiplicative_zmod_of_finite` is a version for multiplicative groups. -/ +@[expose] public section + open scoped DirectSum /- diff --git a/Mathlib/GroupTheory/FiniteAbelian/Duality.lean b/Mathlib/GroupTheory/FiniteAbelian/Duality.lean index a70a76d84cd015..e046ad0be5225b 100644 --- a/Mathlib/GroupTheory/FiniteAbelian/Duality.lean +++ b/Mathlib/GroupTheory/FiniteAbelian/Duality.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.GroupTheory.FiniteAbelian.Basic -import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity +module + +public import Mathlib.GroupTheory.FiniteAbelian.Basic +public import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity /-! # Duality for finite abelian groups @@ -16,6 +18,8 @@ of unity, where `n` is the exponent of `G`. The main results in this file are * `CommGroup.monoidHom_mulEquiv_self_of_hasEnoughRootsOfUnity`: `G` is isomorphic to `G →* Mˣ`. -/ +@[expose] public section + namespace CommGroup open MonoidHom diff --git a/Mathlib/GroupTheory/Finiteness.lean b/Mathlib/GroupTheory/Finiteness.lean index af6ea578c7f2c4..7293eeeeb98031 100644 --- a/Mathlib/GroupTheory/Finiteness.lean +++ b/Mathlib/GroupTheory/Finiteness.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Group.Pointwise.Set.Finite -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.GroupTheory.FreeGroup.Basic -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Finite +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.GroupTheory.FreeGroup.Basic +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # Finitely generated monoids and groups @@ -26,6 +28,8 @@ finitely-generated modules. -/ +@[expose] public section + assert_not_exists MonoidWithZero /-! ### Monoids and submonoids -/ diff --git a/Mathlib/GroupTheory/FixedPointFree.lean b/Mathlib/GroupTheory/FixedPointFree.lean index 36f3b396e6e71d..2f5bf36c88ccc6 100644 --- a/Mathlib/GroupTheory/FixedPointFree.lean +++ b/Mathlib/GroupTheory/FixedPointFree.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.GroupTheory.Perm.Cycle.Type +module + +public import Mathlib.GroupTheory.Perm.Cycle.Type /-! # Fixed-point-free automorphisms @@ -13,6 +15,8 @@ This file defines fixed-point-free automorphisms and proves some basic propertie An automorphism `φ` of a group `G` is fixed-point-free if `1 : G` is the only fixed point of `φ`. -/ +@[expose] public section + namespace MonoidHom variable {F G : Type*} diff --git a/Mathlib/GroupTheory/Frattini.lean b/Mathlib/GroupTheory/Frattini.lean index ab94bb144f0716..056bcc787956dd 100644 --- a/Mathlib/GroupTheory/Frattini.lean +++ b/Mathlib/GroupTheory/Frattini.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Colva Roney-Dougal. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Colva Roney-Dougal, Inna Capdeboscq, Susanna Fishel, Kim Morrison -/ -import Mathlib.GroupTheory.Nilpotent -import Mathlib.Order.Radical +module + +public import Mathlib.GroupTheory.Nilpotent +public import Mathlib.Order.Radical /-! # The Frattini subgroup @@ -16,6 +18,8 @@ We give the definition of the Frattini subgroup of a group, and three elementary * The Frattini subgroup of a finite group is nilpotent. -/ +@[expose] public section + /-- The Frattini subgroup of a group is the intersection of the maximal subgroups. -/ def frattini (G : Type*) [Group G] : Subgroup G := Order.radical (Subgroup G) diff --git a/Mathlib/GroupTheory/FreeAbelianGroup.lean b/Mathlib/GroupTheory/FreeAbelianGroup.lean index eb9dec378e12c0..93a3b6ca67d462 100644 --- a/Mathlib/GroupTheory/FreeAbelianGroup.lean +++ b/Mathlib/GroupTheory/FreeAbelianGroup.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Module.NatInt -import Mathlib.GroupTheory.Abelianization.Defs -import Mathlib.GroupTheory.FreeGroup.Basic +module + +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.GroupTheory.Abelianization.Defs +public import Mathlib.GroupTheory.FreeGroup.Basic /-! # Free abelian groups @@ -63,6 +65,8 @@ are about `FreeAbelianGroup.map`. -/ +@[expose] public section + assert_not_exists Cardinal Multiset universe u v diff --git a/Mathlib/GroupTheory/FreeGroup/Basic.lean b/Mathlib/GroupTheory/FreeGroup/Basic.lean index dbc28185ad0833..c771304fd041ab 100644 --- a/Mathlib/GroupTheory/FreeGroup/Basic.lean +++ b/Mathlib/GroupTheory/FreeGroup/Basic.lean @@ -3,10 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.BigOperators.Group.List.Basic -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Data.List.Chain +module + +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Data.List.Chain +public import Mathlib.Algebra.Group.Int.Defs +public import Mathlib.Algebra.BigOperators.Group.List.Basic /-! # Free groups @@ -48,6 +51,8 @@ distinguish the quotient types more easily. free group, Newman's diamond lemma, Church-Rosser theorem -/ +@[expose] public section + open Relation open scoped List @@ -58,7 +63,7 @@ variable {α : Type u} attribute [local simp] List.append_eq_has_append /- Ensure that `@[to_additive]` uses the right namespace before the definition of `FreeGroup`. -/ -run_meta ToAdditive.insertTranslation `FreeGroup `FreeAddGroup +insert_to_additive_translation FreeGroup FreeAddGroup /-- Reduction step for the additive free group relation: `w + x + (-x) + v ~> w + v` -/ inductive FreeAddGroup.Red.Step : List (α × Bool) → List (α × Bool) → Prop @@ -662,7 +667,7 @@ def Lift.aux : List (α × Bool) → β := fun L => @[to_additive] theorem Red.Step.lift {f : α → β} (H : Red.Step L₁ L₂) : Lift.aux f L₁ = Lift.aux f L₂ := by - obtain @⟨_, _, _, b⟩ := H; cases b <;> simp [Lift.aux] + obtain @⟨_, _, _, b⟩ := H; cases b <;> simp [Lift.aux, List.prod_append] /-- If `β` is a group, then any function from `α` to `β` extends uniquely to a group homomorphism from the free group over `α` to `β` -/ @@ -672,9 +677,9 @@ from the free group over `α` to `β` -/ def lift : (α → β) ≃ (FreeGroup α →* β) where toFun f := MonoidHom.mk' (Quot.lift (Lift.aux f) fun _ _ => Red.Step.lift) <| by - rintro ⟨L₁⟩ ⟨L₂⟩; simp [Lift.aux] + rintro ⟨L₁⟩ ⟨L₂⟩; simp [Lift.aux, List.prod_append] invFun g := g ∘ of - left_inv f := List.prod_singleton + left_inv f := by ext; simp [of, Lift.aux] right_inv g := by ext; simp [of, Lift.aux] variable {f} @@ -684,8 +689,7 @@ theorem lift_mk : lift f (mk L) = List.prod (L.map fun x => cond x.2 (f x.1) (f rfl @[to_additive (attr := simp)] -theorem lift_apply_of {x} : lift f (of x) = f x := - List.prod_singleton +theorem lift_apply_of {x} : lift f (of x) = f x := by simp [of] @[to_additive] theorem lift_unique (g : FreeGroup α →* β) (hg : ∀ x, g (FreeGroup.of x) = f x) {x} : diff --git a/Mathlib/GroupTheory/FreeGroup/CyclicallyReduced.lean b/Mathlib/GroupTheory/FreeGroup/CyclicallyReduced.lean index 9e07045f9c6bbf..6f7f8d6df71323 100644 --- a/Mathlib/GroupTheory/FreeGroup/CyclicallyReduced.lean +++ b/Mathlib/GroupTheory/FreeGroup/CyclicallyReduced.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Bernhard Reinke. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amir Livne Bar-on, Bernhard Reinke -/ -import Mathlib.Data.List.Induction -import Mathlib.GroupTheory.FreeGroup.Basic -import Mathlib.GroupTheory.FreeGroup.Reduce -import Mathlib.Tactic.Group +module + +public import Mathlib.Data.List.Induction +public import Mathlib.GroupTheory.FreeGroup.Basic +public import Mathlib.GroupTheory.FreeGroup.Reduce +public import Mathlib.Tactic.Group /-! This file defines some extra lemmas for free groups, in particular about cyclically reduced words. @@ -18,6 +20,8 @@ taking powers by every non-zero element `n : ℕ` is injective. * `FreeGroup.IsCyclicallyReduced`: the predicate for cyclically reduced words -/ + +@[expose] public section open List universe u diff --git a/Mathlib/GroupTheory/FreeGroup/GeneratorEquiv.lean b/Mathlib/GroupTheory/FreeGroup/GeneratorEquiv.lean index 469745872dd5d3..77cf146fd37afc 100644 --- a/Mathlib/GroupTheory/FreeGroup/GeneratorEquiv.lean +++ b/Mathlib/GroupTheory/FreeGroup/GeneratorEquiv.lean @@ -3,15 +3,19 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.FreeAbelianGroup.Finsupp -import Mathlib.GroupTheory.FreeGroup.IsFreeGroup -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +module + +public import Mathlib.Algebra.FreeAbelianGroup.Finsupp +public import Mathlib.GroupTheory.FreeGroup.IsFreeGroup +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition /-! # Isomorphisms between free groups imply equivalences of their generators -/ +@[expose] public section + noncomputable section variable {α β G H : Type*} diff --git a/Mathlib/GroupTheory/FreeGroup/IsFreeGroup.lean b/Mathlib/GroupTheory/FreeGroup/IsFreeGroup.lean index aa2f24611eed81..c0b29d897c1b11 100644 --- a/Mathlib/GroupTheory/FreeGroup/IsFreeGroup.lean +++ b/Mathlib/GroupTheory/FreeGroup/IsFreeGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn, Eric Wieser, Joachim Breitner -/ -import Mathlib.GroupTheory.FreeGroup.Basic +module + +public import Mathlib.GroupTheory.FreeGroup.Basic /-! # Free groups structures on arbitrary types @@ -37,6 +39,8 @@ For the explicit construction of free groups, see `GroupTheory/FreeGroup`. -/ +@[expose] public section + universe u diff --git a/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean b/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean index 01dcec30499c9c..8c8d35fb30d053 100644 --- a/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean +++ b/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.CategoryTheory.Action -import Mathlib.Combinatorics.Quiver.Arborescence -import Mathlib.Combinatorics.Quiver.ConnectedComponent -import Mathlib.GroupTheory.FreeGroup.IsFreeGroup +module + +public import Mathlib.CategoryTheory.Action +public import Mathlib.Combinatorics.Quiver.Arborescence +public import Mathlib.Combinatorics.Quiver.ConnectedComponent +public import Mathlib.GroupTheory.FreeGroup.IsFreeGroup /-! # The Nielsen-Schreier theorem @@ -47,6 +49,8 @@ free group, free groupoid, Nielsen-Schreier -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/GroupTheory/FreeGroup/Orbit.lean b/Mathlib/GroupTheory/FreeGroup/Orbit.lean index 9a086097c5356c..7976fe914d9b0d 100644 --- a/Mathlib/GroupTheory/FreeGroup/Orbit.lean +++ b/Mathlib/GroupTheory/FreeGroup/Orbit.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Krause. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Krause -/ -import Mathlib.GroupTheory.FreeGroup.Reduce -import Mathlib.GroupTheory.GroupAction.Defs +module + +public import Mathlib.GroupTheory.FreeGroup.Reduce +public import Mathlib.GroupTheory.GroupAction.Defs /-! For any `w : α × Bool`, `FreeGroup.startsWith w` is the set of all elemenents of `FreeGroup α` that @@ -15,6 +17,8 @@ of `FreeGroup.startsWith w` yields the orbit of `x` under the action of `FreeGro for every `v ≠ w⁻¹` (and the point `x`). -/ +@[expose] public section + variable {α X : Type*} [DecidableEq α] namespace FreeGroup diff --git a/Mathlib/GroupTheory/FreeGroup/Reduce.lean b/Mathlib/GroupTheory/FreeGroup/Reduce.lean index 7229db2f510716..06c9230c0fc1df 100644 --- a/Mathlib/GroupTheory/FreeGroup/Reduce.lean +++ b/Mathlib/GroupTheory/FreeGroup/Reduce.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Data.Finset.Dedup -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.List.Sublists -import Mathlib.GroupTheory.FreeGroup.Basic +module + +public import Mathlib.Data.Finset.Dedup +public import Mathlib.Data.Fintype.Defs +public import Mathlib.Data.List.Sublists +public import Mathlib.GroupTheory.FreeGroup.Basic /-! # The maximal reduction of a word in a free group @@ -18,6 +20,8 @@ import Mathlib.GroupTheory.FreeGroup.Basic -/ +@[expose] public section + namespace FreeGroup diff --git a/Mathlib/GroupTheory/Goursat.lean b/Mathlib/GroupTheory/Goursat.lean index b1c91daedf6d31..42bf3ae9057a16 100644 --- a/Mathlib/GroupTheory/Goursat.lean +++ b/Mathlib/GroupTheory/Goursat.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Graph -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Group.Graph +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # Goursat's lemma for subgroups @@ -20,6 +22,8 @@ the graph of an isomorphism `G ⧸ G' ≃ H ⧸ H'`. respectively. -/ +@[expose] public section + open Function Set namespace Subgroup diff --git a/Mathlib/GroupTheory/GroupAction/Basic.lean b/Mathlib/GroupTheory/GroupAction/Basic.lean index 7b56fa784bad9d..7657f37ff03db4 100644 --- a/Mathlib/GroupTheory/GroupAction/Basic.lean +++ b/Mathlib/GroupTheory/GroupAction/Basic.lean @@ -3,16 +3,18 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Action.Prod -import Mathlib.Algebra.Group.Subgroup.Map -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Data.Finite.Sigma -import Mathlib.Data.Set.Finite.Range -import Mathlib.Data.Setoid.Basic -import Mathlib.GroupTheory.GroupAction.Defs +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Action.Prod +public import Mathlib.Algebra.Group.Subgroup.Map +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Data.Finite.Sigma +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Data.Setoid.Basic +public import Mathlib.GroupTheory.GroupAction.Defs /-! # Basic properties of group actions @@ -30,6 +32,8 @@ of `•` belong elsewhere. -/ +@[expose] public section + universe u v diff --git a/Mathlib/GroupTheory/GroupAction/Blocks.lean b/Mathlib/GroupTheory/GroupAction/Blocks.lean index 8e53075cf61cd9..b5b3d186b0237c 100644 --- a/Mathlib/GroupTheory/GroupAction/Blocks.lean +++ b/Mathlib/GroupTheory/GroupAction/Blocks.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Algebra.Pointwise.Stabilizer -import Mathlib.Data.Setoid.Partition -import Mathlib.GroupTheory.GroupAction.Pointwise -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.GroupTheory.Index -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Algebra.Pointwise.Stabilizer +public import Mathlib.Data.Setoid.Partition +public import Mathlib.GroupTheory.GroupAction.Pointwise +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.GroupTheory.Index +public import Mathlib.Tactic.IntervalCases /-! # Blocks @@ -47,6 +49,8 @@ We follow [Wielandt-1964]. -/ +@[expose] public section + open Set open scoped Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/CardCommute.lean b/Mathlib/GroupTheory/GroupAction/CardCommute.lean index 8af2a3d7e9e1ff..6114b95fa837e3 100644 --- a/Mathlib/GroupTheory/GroupAction/CardCommute.lean +++ b/Mathlib/GroupTheory/GroupAction/CardCommute.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Thomas Browning -/ -import Mathlib.Algebra.Group.ConjFinite -import Mathlib.GroupTheory.Coset.Card -import Mathlib.GroupTheory.GroupAction.Quotient +module + +public import Mathlib.Algebra.Group.ConjFinite +public import Mathlib.GroupTheory.Coset.Card +public import Mathlib.GroupTheory.GroupAction.Quotient /-! # Properties of group actions involving quotient groups @@ -22,6 +24,8 @@ prove these cardinality properties. These lemmas are separate because they require the development of cardinals. -/ +@[expose] public section + variable {α β : Type*} open Function diff --git a/Mathlib/GroupTheory/GroupAction/ConjAct.lean b/Mathlib/GroupTheory/GroupAction/ConjAct.lean index c4045285cc20d5..df1963ae7583a5 100644 --- a/Mathlib/GroupTheory/GroupAction/ConjAct.lean +++ b/Mathlib/GroupTheory/GroupAction/ConjAct.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic -import Mathlib.Data.Fintype.Card -import Mathlib.GroupTheory.GroupAction.Defs -import Mathlib.GroupTheory.Subgroup.Centralizer +module + +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic +public import Mathlib.Data.Fintype.Card +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.GroupTheory.Subgroup.Centralizer /-! # Conjugation action of a group on itself @@ -32,6 +34,8 @@ is that some theorems about the group actions will not apply when since this -/ +@[expose] public section + assert_not_exists MonoidWithZero variable (α M G : Type*) diff --git a/Mathlib/GroupTheory/GroupAction/Defs.lean b/Mathlib/GroupTheory/GroupAction/Defs.lean index 402182920b5101..de2b3b11077ac1 100644 --- a/Mathlib/GroupTheory/GroupAction/Defs.lean +++ b/Mathlib/GroupTheory/GroupAction/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.Algebra.Group.Submonoid.MulAction -import Mathlib.Data.Set.BooleanAlgebra +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.Algebra.Group.Submonoid.MulAction +public import Mathlib.Data.Set.BooleanAlgebra /-! # Definition of `orbit`, `fixedPoints` and `stabilizer` @@ -23,6 +25,8 @@ This file defines orbits, stabilizers, and other objects defined in terms of act -/ +@[expose] public section + assert_not_exists MonoidWithZero DistribMulAction universe u v diff --git a/Mathlib/GroupTheory/GroupAction/DomAct/ActionHom.lean b/Mathlib/GroupTheory/GroupAction/DomAct/ActionHom.lean index 1aa51fe52f189d..d3707948a66012 100644 --- a/Mathlib/GroupTheory/GroupAction/DomAct/ActionHom.lean +++ b/Mathlib/GroupTheory/GroupAction/DomAct/ActionHom.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.GroupTheory.GroupAction.DomAct.Basic -import Mathlib.GroupTheory.GroupAction.Hom +module + +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic +public import Mathlib.GroupTheory.GroupAction.Hom /-! # Action of `Mᵈᵐᵃ` on `α →[N] β` and `A →+[N] B` @@ -18,6 +20,8 @@ Add left actions of, e.g., `M` on `α →[N] β` to `Mathlib/Algebra/Hom/GroupAc `SMulCommClass` instances saying that left and right actions commute. -/ +@[expose] public section + namespace DomMulAct section MulActionSemiHom diff --git a/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean b/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean index e4841a971c22a1..e0b4826645e7bd 100644 --- a/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean +++ b/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Opposite -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.GroupWithZero.Action.Hom -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.GroupWithZero.Action.Hom +public import Mathlib.Algebra.Ring.Defs /-! # Type tags for right action on the domain of a function @@ -81,6 +83,8 @@ right action, so lemmas can be formulated in terms of `DomMulAct`. group action, function, domain -/ +@[expose] public section + open Function /-- If `M` multiplicatively acts on `α`, then `DomMulAct M` acts on `α → β` as well as some diff --git a/Mathlib/GroupTheory/GroupAction/Embedding.lean b/Mathlib/GroupTheory/GroupAction/Embedding.lean index 49a3fa5c1ac744..65999da1759678 100644 --- a/Mathlib/GroupTheory/GroupAction/Embedding.lean +++ b/Mathlib/GroupTheory/GroupAction/Embedding.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Action.Pi -import Mathlib.Algebra.Group.Opposite +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Action.Pi +public import Mathlib.Algebra.Group.Opposite /-! # Group actions on embeddings @@ -16,6 +18,8 @@ instances defined by `Pi.mulAction`. Note that unlike the `Pi` instance, this requires `G` to be a group. -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u v w diff --git a/Mathlib/GroupTheory/GroupAction/FixedPoints.lean b/Mathlib/GroupTheory/GroupAction/FixedPoints.lean index 8609e83a1c3677..cea02c41f6eb1d 100644 --- a/Mathlib/GroupTheory/GroupAction/FixedPoints.lean +++ b/Mathlib/GroupTheory/GroupAction/FixedPoints.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Emilie Burgun. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Emilie Burgun -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Group.Commute.Basic -import Mathlib.Dynamics.PeriodicPts.Defs -import Mathlib.GroupTheory.GroupAction.Defs +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Group.Commute.Basic +public import Mathlib.Dynamics.PeriodicPts.Defs +public import Mathlib.GroupTheory.GroupAction.Defs /-! # Properties of `fixedPoints` and `fixedBy` @@ -43,6 +45,8 @@ To properly use theorems using `fixedBy (Set α) g`, you should `open Pointwise` all points in `s` are fixed by `g`, whereas the former only requires that `g • x ∈ s`. -/ +@[expose] public section + namespace MulAction open Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/FixingSubgroup.lean b/Mathlib/GroupTheory/GroupAction/FixingSubgroup.lean index b6c559356f60ab..d91e0dc0e1c45b 100644 --- a/Mathlib/GroupTheory/GroupAction/FixingSubgroup.lean +++ b/Mathlib/GroupTheory/GroupAction/FixingSubgroup.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.GroupTheory.GroupAction.FixedPoints +module + +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.GroupTheory.GroupAction.FixedPoints /-! @@ -36,6 +38,8 @@ TODO : -/ +@[expose] public section + section Monoid diff --git a/Mathlib/GroupTheory/GroupAction/Hom.lean b/Mathlib/GroupTheory/GroupAction/Hom.lean index 0eee1caae8774a..5e67c575023603 100644 --- a/Mathlib/GroupTheory/GroupAction/Hom.lean +++ b/Mathlib/GroupTheory/GroupAction/Hom.lean @@ -3,12 +3,13 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.Group.Hom.CompTypeclasses -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.Notation.Prod -import Mathlib.Algebra.Regular.SMul -import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.Algebra.Group.Hom.CompTypeclasses +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.Notation.Prod +public import Mathlib.Algebra.Regular.SMul +public import Mathlib.Algebra.Ring.Action.Basic /-! # Equivariant homomorphisms @@ -54,6 +55,8 @@ instances of `Mul M`, `Add M`, `SMul M X` and `VAdd M X`… -/ +@[expose] public section + assert_not_exists Submonoid section MulActionHom diff --git a/Mathlib/GroupTheory/GroupAction/IterateAct.lean b/Mathlib/GroupTheory/GroupAction/IterateAct.lean index 912fcd1b2bd0ff..e9bdbf69524f6a 100644 --- a/Mathlib/GroupTheory/GroupAction/IterateAct.lean +++ b/Mathlib/GroupTheory/GroupAction/IterateAct.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Data.Countable.Defs +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Data.Countable.Defs /-! # Monoid action by iterates of a map @@ -15,6 +17,8 @@ that acts on `α` by iterates of `f`, `⟨n⟩ • x = f^[n] x`. It is useful to convert between definitions and theorems about maps and monoid actions. -/ +@[expose] public section + /-- A structure with a single field `val : ℕ` that additively acts on `α` by `⟨n⟩ +ᵥ x = f^[n] x`. -/ structure IterateAddAct {α : Type*} (f : α → α) where diff --git a/Mathlib/GroupTheory/GroupAction/Iwasawa.lean b/Mathlib/GroupTheory/GroupAction/Iwasawa.lean index 3bcdad0f06603a..f310566615084a 100644 --- a/Mathlib/GroupTheory/GroupAction/Iwasawa.lean +++ b/Mathlib/GroupTheory/GroupAction/Iwasawa.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.Group.Action.End -import Mathlib.GroupTheory.GroupAction.Primitive -import Mathlib.GroupTheory.Subgroup.Simple +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.GroupTheory.GroupAction.Primitive +public import Mathlib.GroupTheory.Subgroup.Simple /-! # Iwasawa criterion for simplicity @@ -14,7 +15,7 @@ import Mathlib.GroupTheory.Subgroup.Simple For a group `G`, this consists of an action of `G` on a type `α` and, for every `a : α`, of a subgroup `T a`, such that the following properties hold: - for all `a`, `T a` is commutative - - for all `g : G` and `a : α`, `T (g • a) = MulAut.conj g • T a + - for all `g : G` and `a : α`, `T (g • a) = MulAut.conj g • T a` - the subgroups `T a` generate `G` We then prove two versions of the Iwasawa criterion when @@ -34,6 +35,8 @@ Additivize. The issue is that it requires to additivize `commutator` (which, moreover, lives in the root namespace) -/ +@[expose] public section + namespace MulAction open scoped BigOperators Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/Jordan.lean b/Mathlib/GroupTheory/GroupAction/Jordan.lean index 0d58abf67c0885..9554dc7ce12395 100644 --- a/Mathlib/GroupTheory/GroupAction/Jordan.lean +++ b/Mathlib/GroupTheory/GroupAction/Jordan.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.Group.Pointwise.Set.Card -import Mathlib.Data.Set.Card -import Mathlib.GroupTheory.GroupAction.MultiplePrimitivity +public import Mathlib.Algebra.Group.Pointwise.Set.Card +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.GroupAction.MultiplePrimitivity /-! # Theorems of Jordan @@ -43,6 +44,8 @@ This mostly follows the book [Wielandt, *Finite permutation groups*][Wielandt-19 -/ +@[expose] public section + open MulAction SubMulAction Subgroup open scoped Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/MultiplePrimitivity.lean b/Mathlib/GroupTheory/GroupAction/MultiplePrimitivity.lean index 85b92ed3a064c0..ccb96f08e1edfa 100644 --- a/Mathlib/GroupTheory/GroupAction/MultiplePrimitivity.lean +++ b/Mathlib/GroupTheory/GroupAction/MultiplePrimitivity.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.GroupTheory.GroupAction.MultipleTransitivity -import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup +public import Mathlib.GroupTheory.GroupAction.MultipleTransitivity +public import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup /-! # Multiply preprimitive actions @@ -35,6 +36,8 @@ is `m`-primitive. -/ +@[expose] public section + open scoped BigOperators Pointwise Cardinal namespace MulAction diff --git a/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean b/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean index 9d31503aa55b7c..b523d8d690aa9d 100644 --- a/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean +++ b/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean @@ -3,12 +3,13 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.GroupTheory.GroupAction.Primitive -import Mathlib.GroupTheory.SpecificGroups.Alternating -import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup -import Mathlib.SetTheory.Cardinal.Embedding -import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.GroupTheory.GroupAction.Primitive +public import Mathlib.GroupTheory.SpecificGroups.Alternating +public import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup +public import Mathlib.SetTheory.Cardinal.Embedding +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! # Multiple transitivity @@ -47,6 +48,8 @@ on `α`, and some results are developed in this context. -/ +@[expose] public section + open MulAction MulActionHom Function.Embedding Fin Set Nat section Functoriality diff --git a/Mathlib/GroupTheory/GroupAction/Period.lean b/Mathlib/GroupTheory/GroupAction/Period.lean index 0c5e988fc713ad..85dd483d72f812 100644 --- a/Mathlib/GroupTheory/GroupAction/Period.lean +++ b/Mathlib/GroupTheory/GroupAction/Period.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Emilie Burgun. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Emilie Burgun -/ +module -import Mathlib.Dynamics.PeriodicPts.Lemmas -import Mathlib.GroupTheory.Exponent -import Mathlib.GroupTheory.GroupAction.Basic +public import Mathlib.Dynamics.PeriodicPts.Lemmas +public import Mathlib.GroupTheory.Exponent +public import Mathlib.GroupTheory.GroupAction.Basic /-! # Period of a group action @@ -19,6 +20,8 @@ If such an `m` does not exist, then by convention `MulAction.period` and `AddAction.period` return 0. -/ +@[expose] public section + namespace MulAction universe u v diff --git a/Mathlib/GroupTheory/GroupAction/Pointwise.lean b/Mathlib/GroupTheory/GroupAction/Pointwise.lean index 11fb79214b60ec..94f536d5a6c7bb 100644 --- a/Mathlib/GroupTheory/GroupAction/Pointwise.lean +++ b/Mathlib/GroupTheory/GroupAction/Pointwise.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Anne Baanen, Frédéric Dupuis, Heather Macbeth, Antoine Chambert-Loir -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Data.Set.Function -import Mathlib.GroupTheory.GroupAction.Hom -import Mathlib.Algebra.Group.Units.Hom +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Data.Set.Function +public import Mathlib.GroupTheory.GroupAction.Hom +public import Mathlib.Algebra.Group.Units.Hom /-! # Pointwise actions of equivariant maps @@ -29,6 +31,8 @@ import Mathlib.Algebra.Group.Units.Hom -/ +@[expose] public section + open Function Set Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/Primitive.lean b/Mathlib/GroupTheory/GroupAction/Primitive.lean index f55d971e1034e3..12a191ded4a933 100644 --- a/Mathlib/GroupTheory/GroupAction/Primitive.lean +++ b/Mathlib/GroupTheory/GroupAction/Primitive.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.Setoid.Partition.Card -import Mathlib.GroupTheory.GroupAction.Blocks -import Mathlib.GroupTheory.GroupAction.Transitive +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Data.Setoid.Partition.Card +public import Mathlib.GroupTheory.GroupAction.Blocks +public import Mathlib.GroupTheory.GroupAction.Transitive /-! # Primitive actions @@ -66,6 +68,8 @@ import Mathlib.GroupTheory.GroupAction.Transitive -/ +@[expose] public section + open Pointwise namespace MulAction diff --git a/Mathlib/GroupTheory/GroupAction/Quotient.lean b/Mathlib/GroupTheory/GroupAction/Quotient.lean index 08ff0513202f20..e5cfd370d15f38 100644 --- a/Mathlib/GroupTheory/GroupAction/Quotient.lean +++ b/Mathlib/GroupTheory/GroupAction/Quotient.lean @@ -3,15 +3,17 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Thomas Browning -/ -import Mathlib.Algebra.Group.Subgroup.Actions -import Mathlib.Algebra.Group.Subgroup.ZPowers.Lemmas -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Dynamics.PeriodicPts.Defs -import Mathlib.GroupTheory.Commutator.Basic -import Mathlib.GroupTheory.Coset.Basic -import Mathlib.GroupTheory.GroupAction.Basic -import Mathlib.GroupTheory.GroupAction.ConjAct -import Mathlib.GroupTheory.GroupAction.Hom +module + +public import Mathlib.Algebra.Group.Subgroup.Actions +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Lemmas +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Dynamics.PeriodicPts.Defs +public import Mathlib.GroupTheory.Commutator.Basic +public import Mathlib.GroupTheory.Coset.Basic +public import Mathlib.GroupTheory.GroupAction.Basic +public import Mathlib.GroupTheory.GroupAction.ConjAct +public import Mathlib.GroupTheory.GroupAction.Hom /-! # Properties of group actions involving quotient groups @@ -24,6 +26,8 @@ This file proves properties of group actions which use the quotient group constr as well as their analogues for additive groups. -/ +@[expose] public section + assert_not_exists Cardinal universe u v w diff --git a/Mathlib/GroupTheory/GroupAction/Ring.lean b/Mathlib/GroupTheory/GroupAction/Ring.lean index 79effed6fc4fb2..535232af84fab9 100644 --- a/Mathlib/GroupTheory/GroupAction/Ring.lean +++ b/Mathlib/GroupTheory/GroupAction/Ring.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.Ring.Defs /-! # Commutativity and associativity of action of integers on rings @@ -17,6 +19,8 @@ Those instances are in their own file only because they require much less import file they could go to. This is unfortunate and should be fixed by reorganising files. -/ +@[expose] public section + open scoped Int variable {R : Type*} diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction.lean index 66baf5837b9095..0db5f4b619f7b6 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Module.Defs -import Mathlib.Data.SetLike.Basic -import Mathlib.Data.Setoid.Basic -import Mathlib.GroupTheory.GroupAction.Defs -import Mathlib.GroupTheory.GroupAction.Hom +module + +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Data.Setoid.Basic +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.GroupTheory.GroupAction.Hom /-! @@ -31,6 +33,8 @@ For most uses, typically `Submodule R M` is more powerful. submodule, mul_action -/ +@[expose] public section + open Function diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction/Closure.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction/Closure.lean index 31a91c226d900d..5978b9dee73907 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction/Closure.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction/Closure.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Dexin Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dexin Zhang -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Lattice -import Mathlib.GroupTheory.GroupAction.SubMulAction +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Data.Set.Lattice +public import Mathlib.GroupTheory.GroupAction.SubMulAction /-! # Closure and finiteness of `SubMulAction` and `SubAddAction` -/ +@[expose] public section + namespace SubMulAction /-- The `SubMulAction` generated by a set `s`. -/ diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean index 8793cc6704d3a3..82be923573f236 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean @@ -3,13 +3,14 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ - -import Mathlib.Algebra.Group.Pointwise.Set.Card -import Mathlib.GroupTheory.GroupAction.FixingSubgroup -import Mathlib.GroupTheory.GroupAction.SubMulAction.OfStabilizer -import Mathlib.GroupTheory.GroupAction.Transitive -import Mathlib.GroupTheory.GroupAction.Primitive -import Mathlib.Tactic.Group +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Card +public import Mathlib.GroupTheory.GroupAction.FixingSubgroup +public import Mathlib.GroupTheory.GroupAction.SubMulAction.OfStabilizer +public import Mathlib.GroupTheory.GroupAction.Transitive +public import Mathlib.GroupTheory.GroupAction.Primitive +public import Mathlib.Tactic.Group /-! # SubMulActions on complements of invariant subsets @@ -24,7 +25,7 @@ and permit to manipulate them in a relatively smooth way: the identity map, when the set is the empty set. * `SubMulAction.fixingSubgroupInsertEquiv M a s` : the - multiplicative equivalence between `fixingSubgroup M (insert a s)`` + multiplicative equivalence between `fixingSubgroup M (insert a s)` and `fixingSubgroup (stabilizer M a) s` * `SubMulAction.ofFixingSubgroup_insert_map` : the equivariant @@ -61,6 +62,8 @@ and permit to manipulate them in a relatively smooth way: -/ +@[expose] public section + open scoped Pointwise open MulAction Function diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction/OfStabilizer.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction/OfStabilizer.lean index 35964a3a76f157..ba5d0a6bc40a06 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction/OfStabilizer.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction/OfStabilizer.lean @@ -3,12 +3,13 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.GroupTheory.GroupAction.Basic -import Mathlib.GroupTheory.GroupAction.Embedding -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.SetTheory.Cardinal.Finite -import Mathlib.Data.Fin.Tuple.Embedding +public import Mathlib.GroupTheory.GroupAction.Basic +public import Mathlib.GroupTheory.GroupAction.Embedding +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.Data.Fin.Tuple.Embedding /-! # The SubMulAction of the stabilizer of a point on the complement of that point @@ -45,6 +46,8 @@ Consider `a b : α` and `g : G` such that `hg : g • b = a`. -/ +@[expose] public section + open scoped Pointwise open MulAction Function.Embedding diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction/Pointwise.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction/Pointwise.lean index 2ded9f87fca22c..0390b559d60d78 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction/Pointwise.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction/Pointwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Pointwise monoid structures on SubMulAction @@ -16,6 +18,8 @@ To match `Submodule.idemSemiring`, we do not put these in the `Pointwise` locale -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/Support.lean b/Mathlib/GroupTheory/GroupAction/Support.lean index 2539e0cf2077f4..d3ff65cc073201 100644 --- a/Mathlib/GroupTheory/GroupAction/Support.lean +++ b/Mathlib/GroupTheory/GroupAction/Support.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Scalar +module + +public import Mathlib.Algebra.Group.Action.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar /-! # Support of an element under an action @@ -15,6 +17,8 @@ Given an action of a group `G` on a type `α`, we say that a set `s : Set α` su This is crucial in Fourier-Motzkin constructions. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Pointwise diff --git a/Mathlib/GroupTheory/GroupAction/Transitive.lean b/Mathlib/GroupTheory/GroupAction/Transitive.lean index 9fbb52c03f5e63..d58086ede2bc6a 100644 --- a/Mathlib/GroupTheory/GroupAction/Transitive.lean +++ b/Mathlib/GroupTheory/GroupAction/Transitive.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.GroupTheory.GroupAction.Defs -import Mathlib.GroupTheory.GroupAction.Hom +module + +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.GroupTheory.GroupAction.Hom /-! # Complements to pretransitive actions @@ -28,6 +30,8 @@ Given `MulAction G X` where `G` is a group, -/ +@[expose] public section + variable {G X : Type*} [Group G] [MulAction G X] namespace MulAction diff --git a/Mathlib/GroupTheory/GroupExtension/Basic.lean b/Mathlib/GroupTheory/GroupExtension/Basic.lean index 4b09c2be17ab28..7ea35beab352ff 100644 --- a/Mathlib/GroupTheory/GroupExtension/Basic.lean +++ b/Mathlib/GroupTheory/GroupExtension/Basic.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Yudai Yamazaki. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yudai Yamazaki -/ +module -import Mathlib.GroupTheory.GroupExtension.Defs -import Mathlib.GroupTheory.SemidirectProduct -import Mathlib.GroupTheory.QuotientGroup.Basic -import Mathlib.Tactic.Group +public import Mathlib.GroupTheory.GroupExtension.Defs +public import Mathlib.GroupTheory.SemidirectProduct +public import Mathlib.GroupTheory.QuotientGroup.Basic +public import Mathlib.Tactic.Group /-! # Basic lemmas about group extensions @@ -17,6 +18,8 @@ This file gives basic lemmas about group extensions. For the main definitions, see `Mathlib/GroupTheory/GroupExtension/Defs.lean`. -/ +@[expose] public section + variable {N G : Type*} [Group N] [Group G] namespace GroupExtension diff --git a/Mathlib/GroupTheory/GroupExtension/Defs.lean b/Mathlib/GroupTheory/GroupExtension/Defs.lean index bead54aa851e47..a86660b577d94d 100644 --- a/Mathlib/GroupTheory/GroupExtension/Defs.lean +++ b/Mathlib/GroupTheory/GroupExtension/Defs.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Yudai Yamazaki. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yudai Yamazaki -/ +module -import Mathlib.GroupTheory.GroupAction.ConjAct -import Mathlib.GroupTheory.SemidirectProduct +public import Mathlib.GroupTheory.GroupAction.ConjAct +public import Mathlib.GroupTheory.SemidirectProduct /-! # Group Extensions @@ -50,6 +51,8 @@ If `N` is abelian, (which is also stated as a TODO in `RepresentationTheory/GroupCohomology/LowDegree.lean`). -/ +@[expose] public section + variable (N E G : Type*) /-- `AddGroupExtension N E G` is a short exact sequence of additive groups `0 → N → E → G → 0`. -/ diff --git a/Mathlib/GroupTheory/HNNExtension.lean b/Mathlib/GroupTheory/HNNExtension.lean index aea5678217dfb1..7cf791cac44e7b 100644 --- a/Mathlib/GroupTheory/HNNExtension.lean +++ b/Mathlib/GroupTheory/HNNExtension.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.GroupTheory.Coprod.Basic -import Mathlib.GroupTheory.Complement +module + +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.GroupTheory.Coprod.Basic +public import Mathlib.GroupTheory.Complement /-! @@ -31,6 +33,8 @@ and Hanna Neumann. -/ +@[expose] public section + assert_not_exists Field open Monoid Coprod Multiplicative Subgroup Function @@ -526,8 +530,7 @@ theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) : -- simp [equiv_symm_eq_conj, mul_assoc]. simp only [toSubgroup_neg_one, toSubgroupEquiv_neg_one, Units.val_neg, Units.val_one, Int.reduceNeg, zpow_neg, zpow_one, inv_inv] - erw [equiv_symm_eq_conj] - simp [mul_assoc] + grind [equiv_symm_eq_conj, mul_assoc] · simp only [unitsSMulGroup, SetLike.coe_sort_coe, prod_cons, prod_group_smul, map_mul, map_inv] rcases Int.units_eq_one_or u with (rfl | rfl) · -- Before https://github.com/leanprover/lean4/pull/2644, this proof was just diff --git a/Mathlib/GroupTheory/Index.lean b/Mathlib/GroupTheory/Index.lean index f83f701354af12..a80e42edf4cfdf 100644 --- a/Mathlib/GroupTheory/Index.lean +++ b/Mathlib/GroupTheory/Index.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.BigOperators.GroupWithZero.Finset -import Mathlib.Algebra.GroupWithZero.Subgroup -import Mathlib.Data.Finite.Card -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Set.Card -import Mathlib.GroupTheory.Coset.Card -import Mathlib.GroupTheory.GroupAction.Quotient -import Mathlib.GroupTheory.QuotientGroup.Basic +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Finset +public import Mathlib.Algebra.GroupWithZero.Subgroup +public import Mathlib.Data.Finite.Card +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.Coset.Card +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.GroupTheory.QuotientGroup.Basic /-! # Index of a Subgroup @@ -25,7 +27,7 @@ Several theorems proved in this file are known as Lagrange's theorem. - `H.relIndex K` : the relative index of `H : Subgroup G` in `K : Subgroup G` as a natural number, and returns 0 if the relative index is infinite. -# Main results +## Main results - `card_mul_index` : `Nat.card H * H.index = Nat.card G` - `index_mul_card` : `H.index * Nat.card H = Nat.card G` @@ -36,6 +38,8 @@ Several theorems proved in this file are known as Lagrange's theorem. - `MulAction.index_stabilizer`: the index of the stabilizer is the cardinality of the orbit -/ +@[expose] public section + assert_not_exists Field open scoped Pointwise diff --git a/Mathlib/GroupTheory/IndexNormal.lean b/Mathlib/GroupTheory/IndexNormal.lean index c19d6ad21409ee..22942b245a161e 100644 --- a/Mathlib/GroupTheory/IndexNormal.lean +++ b/Mathlib/GroupTheory/IndexNormal.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Data.Finite.Perm -import Mathlib.Data.Nat.Prime.Factorial -import Mathlib.GroupTheory.Index +module + +public import Mathlib.Data.Finite.Perm +public import Mathlib.Data.Nat.Prime.Factorial +public import Mathlib.GroupTheory.Index /-! # Subgroups of small index are normal @@ -17,6 +19,8 @@ import Mathlib.GroupTheory.Index -/ +@[expose] public section + assert_not_exists Field open MulAction MonoidHom Nat diff --git a/Mathlib/GroupTheory/MonoidLocalization/Away.lean b/Mathlib/GroupTheory/MonoidLocalization/Away.lean index 3b653388a21b2d..dc0e3c43436f84 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Away.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Away.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.GroupTheory.MonoidLocalization.Basic +module + +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.GroupTheory.MonoidLocalization.Basic /-! # Localizing commutative monoids away from an element @@ -17,6 +19,8 @@ localization, monoid localization, quotient monoid, congruence relation, charact commutative monoid, grothendieck group -/ +@[expose] public section + assert_not_exists MonoidWithZero open Function diff --git a/Mathlib/GroupTheory/MonoidLocalization/Basic.lean b/Mathlib/GroupTheory/MonoidLocalization/Basic.lean index adc4a27f0af1b3..20a84800da30db 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Basic.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.Algebra.Regular.Basic -import Mathlib.GroupTheory.Congruence.Hom -import Mathlib.GroupTheory.OreLocalization.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.GroupTheory.Congruence.Hom +public import Mathlib.GroupTheory.OreLocalization.Basic /-! # Localizations of commutative monoids @@ -72,6 +74,8 @@ localization, monoid localization, quotient monoid, congruence relation, charact commutative monoid, grothendieck group -/ +@[expose] public section + assert_not_exists MonoidWithZero Ring open Function @@ -115,7 +119,7 @@ end Submonoid namespace Localization /- Ensure that `@[to_additive]` uses the right namespace before the definition of `Localization`. -/ -run_meta ToAdditive.insertTranslation `Localization `AddLocalization +insert_to_additive_translation Localization AddLocalization /-- The congruence relation on `M × S`, `M` a `CommMonoid` and `S` a submonoid of `M`, whose quotient is the localization of `M` at `S`, defined as the unique congruence relation on diff --git a/Mathlib/GroupTheory/MonoidLocalization/Cardinality.lean b/Mathlib/GroupTheory/MonoidLocalization/Cardinality.lean index a94d7c377c6228..97a068ebf5d1f7 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Cardinality.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Cardinality.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.GroupTheory.MonoidLocalization.Basic -import Mathlib.GroupTheory.OreLocalization.Cardinality +module + +public import Mathlib.GroupTheory.MonoidLocalization.Basic +public import Mathlib.GroupTheory.OreLocalization.Cardinality /-! @@ -14,6 +16,8 @@ This file contains some results on cardinality of localizations. -/ +@[expose] public section + universe u open Cardinal diff --git a/Mathlib/GroupTheory/MonoidLocalization/DivPairs.lean b/Mathlib/GroupTheory/MonoidLocalization/DivPairs.lean index 7ad172cf6aeeb8..eabb5a60d7e1dc 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/DivPairs.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/DivPairs.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yaël Dillies, Michał Mrugała. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Michał Mrugała -/ -import Mathlib.GroupTheory.MonoidLocalization.Basic +module + +public import Mathlib.GroupTheory.MonoidLocalization.Basic /-! # Submonoid of pairs with quotient in a submonoid @@ -11,6 +13,8 @@ import Mathlib.GroupTheory.MonoidLocalization.Basic This file defines the submonoid of pairs whose quotient lies in a submonoid of the localization. -/ +@[expose] public section + variable {M G H : Type*} [CommMonoid M] [CommGroup G] [CommGroup H] {f : (⊤ : Submonoid M).LocalizationMap G} {g : (⊤ : Submonoid M).LocalizationMap H} {s : Submonoid G} {x : M × M} diff --git a/Mathlib/GroupTheory/MonoidLocalization/Finite.lean b/Mathlib/GroupTheory/MonoidLocalization/Finite.lean index 8e0478ea56efae..b4262ddc66daa4 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Finite.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies, Patrick Luo. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Patrick Luo -/ -import Mathlib.GroupTheory.Finiteness -import Mathlib.GroupTheory.MonoidLocalization.GrothendieckGroup +module + +public import Mathlib.GroupTheory.Finiteness +public import Mathlib.GroupTheory.MonoidLocalization.GrothendieckGroup /-! # Localization of a finitely generated submonoid @@ -14,6 +16,8 @@ import Mathlib.GroupTheory.MonoidLocalization.GrothendieckGroup If `Mathlib/GroupTheory/Finiteness.lean` wasn't so heavy, this could move earlier. -/ +@[expose] public section + open Localization variable {M : Type*} [CommMonoid M] {S : Submonoid M} diff --git a/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean b/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean index 6be9880a35ffb8..e9a805c2a5f12d 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Alex J. Best, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Yaël Dillies -/ -import Mathlib.GroupTheory.MonoidLocalization.Basic +module + +public import Mathlib.GroupTheory.MonoidLocalization.Basic /-! # Grothendieck group @@ -20,6 +22,8 @@ obtained by formally making the last term of each short exact sequence invertibl * [*Grothendieck group*, Wikipedia](https://en.wikipedia.org/wiki/Grothendieck_group#Grothendieck_group_of_a_commutative_monoid) -/ +@[expose] public section + open Function Localization namespace Algebra diff --git a/Mathlib/GroupTheory/MonoidLocalization/MonoidWithZero.lean b/Mathlib/GroupTheory/MonoidLocalization/MonoidWithZero.lean index 035ee0401669dc..fa91eaad4808a1 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/MonoidWithZero.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/MonoidWithZero.lean @@ -3,17 +3,21 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.GroupTheory.MonoidLocalization.Basic -import Mathlib.RingTheory.OreLocalization.Basic -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +module + +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.GroupTheory.MonoidLocalization.Basic +public import Mathlib.RingTheory.OreLocalization.Basic +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors /-! # Localizations of commutative monoids with zeroes -/ +@[expose] public section + open Function section CommMonoidWithZero diff --git a/Mathlib/GroupTheory/MonoidLocalization/Order.lean b/Mathlib/GroupTheory/MonoidLocalization/Order.lean index 5bdd908475f8b5..828e63113c9787 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Order.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Order.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.GroupTheory.MonoidLocalization.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.GroupTheory.MonoidLocalization.Basic /-! # Ordered structures on localizations of commutative monoids -/ +@[expose] public section + open Function namespace Localization @@ -59,8 +63,6 @@ theorem mk_lt_mk : mk a₁ a₂ < mk b₁ b₂ ↔ ↑b₂ * a₁ < a₂ * b₁ -- declaring this separately to the instance below makes things faster @[to_additive] instance partialOrder : PartialOrder (Localization s) where - le := (· ≤ ·) - lt := (· < ·) le_refl a := Localization.induction_on a fun _ => le_rfl le_trans a b c := Localization.induction_on₃ a b c fun a b c hab hbc => by diff --git a/Mathlib/GroupTheory/Nilpotent.lean b/Mathlib/GroupTheory/Nilpotent.lean index 7bc7824ee41ced..b26482e051f9cf 100644 --- a/Mathlib/GroupTheory/Nilpotent.lean +++ b/Mathlib/GroupTheory/Nilpotent.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Ines Wright, Joachim Breitner -/ -import Mathlib.GroupTheory.Solvable -import Mathlib.GroupTheory.Sylow -import Mathlib.Algebra.Group.Subgroup.Order -import Mathlib.GroupTheory.Commutator.Finite +module + +public import Mathlib.GroupTheory.Solvable +public import Mathlib.GroupTheory.Sylow +public import Mathlib.Algebra.Group.Subgroup.Order +public import Mathlib.GroupTheory.Commutator.Finite /-! @@ -74,6 +76,8 @@ are not central series if `G` is not nilpotent is a standard abuse of notation. -/ +@[expose] public section + open Subgroup diff --git a/Mathlib/GroupTheory/NoncommCoprod.lean b/Mathlib/GroupTheory/NoncommCoprod.lean index 06c7d848527565..c0c4078c62107f 100644 --- a/Mathlib/GroupTheory/NoncommCoprod.lean +++ b/Mathlib/GroupTheory/NoncommCoprod.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Algebra.Group.Commute.Hom -import Mathlib.Algebra.Group.Prod -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.Order.Disjoint +module + +public import Mathlib.Algebra.Group.Commute.Hom +public import Mathlib.Algebra.Group.Prod +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.Order.Disjoint /-! # Canonical homomorphism from a pair of monoids @@ -31,6 +33,8 @@ There is an analogue `MulHom.noncommCoprod` when `f` and `g` are only `MulHom`s. For a product of a family of morphisms of monoids, see `MonoidHom.noncommPiCoprod`. -/ +@[expose] public section + assert_not_exists MonoidWithZero namespace MulHom @@ -49,7 +53,7 @@ def noncommCoprod (comm : ∀ m n, Commute (f m) (g n)) : M × N →ₙ* P where toFun mn := f mn.fst * g mn.snd map_mul' mn mn' := by simpa using (comm _ _).mul_mul_mul_comm _ _ -/-- Variant of `MulHom.noncommCoprod_apply` with the product written in the other direction` -/ +/-- Variant of `MulHom.noncommCoprod_apply` with the product written in the other direction. -/ @[to_additive /-- Variant of `AddHom.noncommCoprod_apply`, with the sum written in the other direction -/] theorem noncommCoprod_apply' (comm) (mn : M × N) : @@ -84,7 +88,7 @@ def noncommCoprod : M × N →* P where map_one' := by simp only [Prod.fst_one, Prod.snd_one, map_one, mul_one] __ := f.toMulHom.noncommCoprod g.toMulHom comm -/-- Variant of `MonoidHom.noncomCoprod_apply` with the product written in the other direction` -/ +/-- Variant of `MonoidHom.noncomCoprod_apply` with the product written in the other direction. -/ @[to_additive /-- Variant of `AddMonoidHom.noncomCoprod_apply` with the sum written in the other direction -/] theorem noncommCoprod_apply' (comm) (mn : M × N) : diff --git a/Mathlib/GroupTheory/NoncommPiCoprod.lean b/Mathlib/GroupTheory/NoncommPiCoprod.lean index 0f4cc359b6eef9..54d36addcd1b4f 100644 --- a/Mathlib/GroupTheory/NoncommPiCoprod.lean +++ b/Mathlib/GroupTheory/NoncommPiCoprod.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Joachim Breitner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joachim Breitner -/ -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.Data.Nat.GCD.BigOperators -import Mathlib.Order.SupIndep +module + +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.Data.Nat.GCD.BigOperators +public import Mathlib.Order.SupIndep /-! # Canonical homomorphism from a finite family of monoids @@ -39,6 +41,8 @@ images of different morphisms commute, we obtain a canonical morphism -/ +@[expose] public section + assert_not_exists Field namespace Subgroup diff --git a/Mathlib/GroupTheory/Order/Min.lean b/Mathlib/GroupTheory/Order/Min.lean index 521e2042beea8f..b2f483516ef591 100644 --- a/Mathlib/GroupTheory/Order/Min.lean +++ b/Mathlib/GroupTheory/Order/Min.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Torsion -import Mathlib.Data.ENat.Lattice -import Mathlib.Data.ZMod.QuotientGroup +module + +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Data.ZMod.QuotientGroup /-! # Minimum order of an element @@ -19,6 +21,8 @@ This file defines the minimum order of an element of a monoid. * `ZMod.minOrder`: The minimum order of $$ℤ/nℤ$$ is the smallest factor of `n`, unless `n = 0, 1`. -/ +@[expose] public section + open Subgroup variable {G α : Type*} diff --git a/Mathlib/GroupTheory/OrderOfElement.lean b/Mathlib/GroupTheory/OrderOfElement.lean index efb7bdb7068075..e368276c8fa85d 100644 --- a/Mathlib/GroupTheory/OrderOfElement.lean +++ b/Mathlib/GroupTheory/OrderOfElement.lean @@ -3,18 +3,20 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Julian Kuelshammer -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Group.Commute.Basic -import Mathlib.Algebra.Group.Pointwise.Set.Finite -import Mathlib.Algebra.Group.Subgroup.Finite -import Mathlib.Algebra.Module.NatInt -import Mathlib.Algebra.Order.Group.Action -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Data.Int.ModEq -import Mathlib.Dynamics.PeriodicPts.Lemmas -import Mathlib.GroupTheory.Index -import Mathlib.NumberTheory.Divisors -import Mathlib.Order.Interval.Set.Infinite +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Group.Commute.Basic +public import Mathlib.Algebra.Group.Pointwise.Set.Finite +public import Mathlib.Algebra.Group.Subgroup.Finite +public import Mathlib.Algebra.Module.NatInt +public import Mathlib.Algebra.Order.Group.Action +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Data.Int.ModEq +public import Mathlib.Dynamics.PeriodicPts.Lemmas +public import Mathlib.GroupTheory.Index +public import Mathlib.NumberTheory.Divisors +public import Mathlib.Order.Interval.Set.Infinite /-! # Order of an element @@ -35,6 +37,8 @@ This file defines the order of an element of a finite group. For a finite group order of an element -/ +@[expose] public section + assert_not_exists Field open Function Fintype Nat Pointwise Subgroup Submonoid diff --git a/Mathlib/GroupTheory/OreLocalization/Basic.lean b/Mathlib/GroupTheory/OreLocalization/Basic.lean index e63e4470d0de35..a8393c98bf47ae 100644 --- a/Mathlib/GroupTheory/OreLocalization/Basic.lean +++ b/Mathlib/GroupTheory/OreLocalization/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer, Kevin Klinge, Andrew Yang -/ -import Mathlib.GroupTheory.OreLocalization.OreSet -import Mathlib.Tactic.Common -import Mathlib.Algebra.Group.Submonoid.MulAction -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Algebra.Group.Basic +module + +public import Mathlib.GroupTheory.OreLocalization.OreSet +public import Mathlib.Tactic.Common +public import Mathlib.Algebra.Group.Submonoid.MulAction +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Algebra.Group.Basic /-! @@ -33,6 +35,8 @@ localization, Ore, non-commutative -/ +@[expose] public section + assert_not_exists RelIso MonoidWithZero universe u diff --git a/Mathlib/GroupTheory/OreLocalization/Cardinality.lean b/Mathlib/GroupTheory/OreLocalization/Cardinality.lean index 11aae8894bda89..5673419aa230f2 100644 --- a/Mathlib/GroupTheory/OreLocalization/Cardinality.lean +++ b/Mathlib/GroupTheory/OreLocalization/Cardinality.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.GroupTheory.OreLocalization.Basic -import Mathlib.SetTheory.Cardinal.Arithmetic +module + +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.GroupTheory.OreLocalization.Basic +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! @@ -20,6 +22,8 @@ This file contains some results on cardinality of Ore localizations. -/ +@[expose] public section + universe u v open Cardinal Function diff --git a/Mathlib/GroupTheory/OreLocalization/OreSet.lean b/Mathlib/GroupTheory/OreLocalization/OreSet.lean index 751e9da69bd9d8..42ca4828ec4aa1 100644 --- a/Mathlib/GroupTheory/OreLocalization/OreSet.lean +++ b/Mathlib/GroupTheory/OreLocalization/OreSet.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer, Kevin Klinge -/ -import Mathlib.Algebra.Group.Submonoid.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Defs /-! @@ -17,6 +19,8 @@ This defines left Ore sets on arbitrary monoids. -/ +@[expose] public section + assert_not_exists RelIso namespace AddOreLocalization diff --git a/Mathlib/GroupTheory/PGroup.lean b/Mathlib/GroupTheory/PGroup.lean index d4aafa3c5282a2..f03f6351fd6d00 100644 --- a/Mathlib/GroupTheory/PGroup.lean +++ b/Mathlib/GroupTheory/PGroup.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Thomas Browning -/ -import Mathlib.GroupTheory.Perm.Cycle.Type -import Mathlib.GroupTheory.SpecificGroups.Cyclic +module + +public import Mathlib.GroupTheory.Perm.Cycle.Type +public import Mathlib.GroupTheory.SpecificGroups.Cyclic /-! # p-groups @@ -14,6 +16,8 @@ then the number of fixed points of the action is congruent mod `p` to the cardin It also contains proofs of some corollaries of this lemma about existence of fixed points. -/ +@[expose] public section + open Fintype MulAction variable (p : ℕ) (G : Type*) [Group G] diff --git a/Mathlib/GroupTheory/Perm/Basic.lean b/Mathlib/GroupTheory/Perm/Basic.lean index 92e570ce41b9e6..ba5f6c3c479e7d 100644 --- a/Mathlib/GroupTheory/Perm/Basic.lean +++ b/Mathlib/GroupTheory/Perm/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Group.Action.Defs -import Mathlib.Algebra.Group.End -import Mathlib.Logic.Equiv.Set -import Mathlib.Tactic.Common +module + +public import Mathlib.Algebra.Group.Action.Defs +public import Mathlib.Algebra.Group.End +public import Mathlib.Logic.Equiv.Set +public import Mathlib.Tactic.Common /-! # Extra lemmas about permutations @@ -22,6 +24,8 @@ It would be good to merge the remaining lemmas with other files, e.g. the algebra and non-algebra parts). -/ +@[expose] public section + universe u v @@ -31,9 +35,11 @@ variable {α : Type u} {β : Type v} namespace Perm -@[simp] lemma image_inv (f : Perm α) (s : Set α) : ↑f⁻¹ '' s = f ⁻¹' s := f.image_symm_eq_preimage _ +@[deprecated Equiv.image_symm_eq_preimage (since := "2025-08-16")] +lemma image_inv (f : Perm α) (s : Set α) : ↑f⁻¹ '' s = f ⁻¹' s := f.image_symm_eq_preimage _ -@[simp] lemma preimage_inv (f : Perm α) (s : Set α) : ↑f⁻¹ ⁻¹' s = f '' s := +@[deprecated Equiv.image_eq_preimage_symm (since := "2025-08-16")] +lemma preimage_inv (f : Perm α) (s : Set α) : ↑f⁻¹ ⁻¹' s = f '' s := (f.image_eq_preimage_symm _).symm end Perm diff --git a/Mathlib/GroupTheory/Perm/Centralizer.lean b/Mathlib/GroupTheory/Perm/Centralizer.lean index 0ab173050c77e0..b8badee243bca8 100644 --- a/Mathlib/GroupTheory/Perm/Centralizer.lean +++ b/Mathlib/GroupTheory/Perm/Centralizer.lean @@ -3,13 +3,15 @@ Copyright (c) 2023 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Multiset -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.GroupTheory.NoncommCoprod -import Mathlib.GroupTheory.Perm.ConjAct -import Mathlib.GroupTheory.Perm.Cycle.PossibleTypes -import Mathlib.GroupTheory.Perm.DomMulAct -import Mathlib.GroupTheory.Rank +module + +public import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Multiset +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.GroupTheory.NoncommCoprod +public import Mathlib.GroupTheory.Perm.ConjAct +public import Mathlib.GroupTheory.Perm.Cycle.PossibleTypes +public import Mathlib.GroupTheory.Perm.DomMulAct +public import Mathlib.GroupTheory.Rank /-! # Centralizer of a permutation and cardinality of conjugacy classes in the symmetric groups @@ -96,6 +98,8 @@ injectivity `Equiv.Perm.OnCycleFactors.kerParam_injective`, its range -/ +@[expose] public section + open scoped Finset Pointwise namespace Equiv.Perm @@ -167,8 +171,7 @@ theorem coe_toPermHom (k : centralizer {g}) (c : g.cycleFactorsFinset) : The equality is proved by `Equiv.Perm.OnCycleFactors.range_toPermHom_eq_range_toPermHom'`. -/ def range_toPermHom' : Subgroup (Perm g.cycleFactorsFinset) where carrier := {τ | ∀ c, #(τ c).val.support = #c.val.support} - one_mem' := by - simp only [Set.mem_setOf_eq, coe_one, id_eq, imp_true_iff] + one_mem' := by simp mul_mem' hσ hτ := by simp only [Subtype.forall, Set.mem_setOf_eq, coe_mul, Function.comp_apply] simp only [Subtype.forall, Set.mem_setOf_eq] at hσ hτ @@ -177,9 +180,8 @@ def range_toPermHom' : Subgroup (Perm g.cycleFactorsFinset) where inv_mem' hσ := by simp only [Subtype.forall, Set.mem_setOf_eq] at hσ ⊢ intro c hc - rw [← hσ] - · simp only [Finset.coe_mem, Subtype.coe_eta, apply_inv_self] - · simp only [Finset.coe_mem] + rw [← hσ _ (by simp)] + simp variable {g} in theorem mem_range_toPermHom'_iff {τ : Perm g.cycleFactorsFinset} : diff --git a/Mathlib/GroupTheory/Perm/Closure.lean b/Mathlib/GroupTheory/Perm/Closure.lean index 3989df30e8ced0..290aecbb7b6dca 100644 --- a/Mathlib/GroupTheory/Perm/Closure.lean +++ b/Mathlib/GroupTheory/Perm/Closure.lean @@ -3,8 +3,9 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yaël Dillies -/ +module -import Mathlib.GroupTheory.Perm.Cycle.Basic +public import Mathlib.GroupTheory.Perm.Cycle.Basic /-! # Closure results for permutation groups @@ -20,6 +21,8 @@ import Mathlib.GroupTheory.Perm.Cycle.Basic -/ +@[expose] public section + open Equiv Function Finset variable {ι α β : Type*} diff --git a/Mathlib/GroupTheory/Perm/ClosureSwap.lean b/Mathlib/GroupTheory/Perm/ClosureSwap.lean index a8304b756211ed..345f9b1a482eec 100644 --- a/Mathlib/GroupTheory/Perm/ClosureSwap.lean +++ b/Mathlib/GroupTheory/Perm/ClosureSwap.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Thomas Browning, Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Junyan Xu -/ -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.GroupTheory.GroupAction.Basic -import Mathlib.GroupTheory.GroupAction.FixedPoints -import Mathlib.GroupTheory.Perm.Support -import Mathlib.Data.Set.Finite.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.GroupTheory.GroupAction.Basic +public import Mathlib.GroupTheory.GroupAction.FixedPoints +public import Mathlib.GroupTheory.Perm.Support +public import Mathlib.Data.Set.Finite.Basic /-! # Subgroups generated by transpositions @@ -24,6 +26,8 @@ This file studies subgroups generated by transpositions. -/ +@[expose] public section + open Equiv List MulAction Pointwise Set Subgroup variable {G α : Type*} [Group G] [MulAction G α] diff --git a/Mathlib/GroupTheory/Perm/ConjAct.lean b/Mathlib/GroupTheory/Perm/ConjAct.lean index c44596af38e32f..c8d629002b2f2f 100644 --- a/Mathlib/GroupTheory/Perm/ConjAct.lean +++ b/Mathlib/GroupTheory/Perm/ConjAct.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Algebra.Group.Action.Pointwise.Finset -import Mathlib.GroupTheory.Perm.Cycle.Factors +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Finset +public import Mathlib.GroupTheory.Perm.Cycle.Factors /-! # Some lemmas pertaining to the action of `ConjAct (Perm α)` on `Perm α` @@ -21,6 +23,8 @@ Let `α` be a decidable fintype. -/ +@[expose] public section + namespace Equiv.Perm open scoped Pointwise diff --git a/Mathlib/GroupTheory/Perm/Cycle/Basic.lean b/Mathlib/GroupTheory/Perm/Cycle/Basic.lean index 9c39303aa00ce1..b80e8e637c68f2 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Basic.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Basic.lean @@ -3,12 +3,13 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yaël Dillies -/ +module -import Mathlib.Algebra.Module.BigOperators -import Mathlib.GroupTheory.Perm.Basic -import Mathlib.GroupTheory.Perm.Finite -import Mathlib.GroupTheory.Perm.List -import Mathlib.GroupTheory.Perm.Sign +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.GroupTheory.Perm.Basic +public import Mathlib.GroupTheory.Perm.Finite +public import Mathlib.GroupTheory.Perm.List +public import Mathlib.GroupTheory.Perm.Sign /-! # Cycles of a permutation @@ -33,6 +34,8 @@ In the following, `f : Equiv.Perm β`. * `IsCycleOn` forbids fixed points on `s` (if `s` is nontrivial), while `IsCycle` allows them. -/ +@[expose] public section + open Equiv Function Finset @@ -61,7 +64,7 @@ protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm α) : f.SameCycle x @[symm] theorem SameCycle.symm : SameCycle f x y → SameCycle f y x := fun ⟨i, hi⟩ => - ⟨-i, by rw [zpow_neg, ← hi, inv_apply_self]⟩ + ⟨-i, by simp [zpow_neg, ← hi]⟩ theorem sameCycle_comm : SameCycle f x y ↔ SameCycle f y x := ⟨SameCycle.symm, SameCycle.symm⟩ @@ -90,7 +93,7 @@ alias ⟨SameCycle.of_inv, SameCycle.inv⟩ := sameCycle_inv @[simp] theorem sameCycle_conj : SameCycle (g * f * g⁻¹) x y ↔ SameCycle f (g⁻¹ x) (g⁻¹ y) := - exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq] + exists_congr fun i => by simp [conj_zpow, eq_symm_apply] theorem SameCycle.conj : SameCycle f x y → SameCycle (g * f * g⁻¹) (g x) (g y) := by simp [sameCycle_conj] @@ -116,12 +119,16 @@ theorem sameCycle_apply_right : SameCycle f x (f y) ↔ SameCycle f x y := by rw [sameCycle_comm, sameCycle_apply_left, sameCycle_comm] @[simp] -theorem sameCycle_inv_apply_left : SameCycle f (f⁻¹ x) y ↔ SameCycle f x y := by - rw [← sameCycle_apply_left, apply_inv_self] +theorem sameCycle_symm_apply_left : SameCycle f (f.symm x) y ↔ SameCycle f x y := by + rw [← sameCycle_apply_left, apply_symm_apply] + +@[deprecated (since := "2025-11-17")] alias sameCycle_inv_apply_left := sameCycle_symm_apply_left @[simp] -theorem sameCycle_inv_apply_right : SameCycle f x (f⁻¹ y) ↔ SameCycle f x y := by - rw [← sameCycle_apply_right, apply_inv_self] +theorem sameCycle_symm_apply_right : SameCycle f x (f.symm y) ↔ SameCycle f x y := by + rw [← sameCycle_apply_right, apply_symm_apply] + +@[deprecated (since := "2025-11-17")] alias sameCycle_inv_apply_right := sameCycle_symm_apply_right @[simp] theorem sameCycle_zpow_left {n : ℤ} : SameCycle f ((f ^ n) x) y ↔ SameCycle f x y := @@ -143,9 +150,9 @@ alias ⟨SameCycle.of_apply_left, SameCycle.apply_left⟩ := sameCycle_apply_lef alias ⟨SameCycle.of_apply_right, SameCycle.apply_right⟩ := sameCycle_apply_right -alias ⟨SameCycle.of_inv_apply_left, SameCycle.inv_apply_left⟩ := sameCycle_inv_apply_left +alias ⟨SameCycle.of_symm_apply_left, SameCycle.symm_apply_left⟩ := sameCycle_symm_apply_left -alias ⟨SameCycle.of_inv_apply_right, SameCycle.inv_apply_right⟩ := sameCycle_inv_apply_right +alias ⟨SameCycle.of_symm_apply_right, SameCycle.symm_apply_right⟩ := sameCycle_symm_apply_right alias ⟨SameCycle.of_pow_left, SameCycle.pow_left⟩ := sameCycle_pow_left @@ -250,9 +257,8 @@ theorem isCycle_inv : IsCycle f⁻¹ ↔ IsCycle f := theorem IsCycle.conj : IsCycle f → IsCycle (g * f * g⁻¹) := by rintro ⟨x, hx, h⟩ - refine ⟨g x, by simp [coe_mul, inv_apply_self, hx], fun y hy => ?_⟩ - rw [← apply_inv_self g y] - exact (h <| eq_inv_iff_eq.not.2 hy).conj + refine ⟨g x, by simp [coe_mul, hx], fun y hy => ?_⟩ + simpa using (h <| eq_inv_iff_eq.not.2 hy).conj (g := g) protected theorem IsCycle.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Subtype p) : IsCycle g → IsCycle (g.extendDomain f) := by @@ -366,48 +372,38 @@ theorem isCycle_swap_mul_aux₁ {α : Type*} [DecidableEq α] : | zero => exact fun _ h => ⟨0, h⟩ | succ n hn => intro b x f hb h - exact if hfbx : f x = b then ⟨0, hfbx⟩ - else - have : f b ≠ b ∧ b ≠ x := ne_and_ne_of_swap_mul_apply_ne_self hb - have hb' : (swap x (f x) * f) (f⁻¹ b) ≠ f⁻¹ b := by - rw [mul_apply, apply_inv_self, swap_apply_of_ne_of_ne this.2 (Ne.symm hfbx), Ne, ← - f.injective.eq_iff, apply_inv_self] - exact this.1 - let ⟨i, hi⟩ := hn hb' (f.injective <| by - rw [apply_inv_self]; rwa [pow_succ', mul_apply] at h) - ⟨i + 1, by - rw [add_comm, zpow_add, mul_apply, hi, zpow_one, mul_apply, apply_inv_self, - swap_apply_of_ne_of_ne (ne_and_ne_of_swap_mul_apply_ne_self hb).2 (Ne.symm hfbx)]⟩ + obtain hfbx | hfbx := eq_or_ne (f x) b + · exact ⟨0, hfbx⟩ + have : f b ≠ b ∧ b ≠ x := ne_and_ne_of_swap_mul_apply_ne_self hb + have hb' : (swap x (f x) * f) (f.symm b) ≠ f.symm b := by + simpa [swap_apply_of_ne_of_ne this.2 hfbx.symm, eq_symm_apply, f.injective.eq_iff] + using this.1 + obtain ⟨i, hi⟩ := hn hb' <| f.injective <| by simpa [pow_succ'] using h + refine ⟨i + 1, ?_⟩ + rw [add_comm, zpow_add, mul_apply, hi, zpow_one, mul_apply, apply_symm_apply, + swap_apply_of_ne_of_ne (ne_and_ne_of_swap_mul_apply_ne_self hb).2 hfbx.symm] theorem isCycle_swap_mul_aux₂ {α : Type*} [DecidableEq α] : - ∀ (n : ℤ) {b x : α} {f : Perm α} (_ : (swap x (f x) * f) b ≠ b) (_ : (f ^ n) (f x) = b), - ∃ i : ℤ, ((swap x (f x) * f) ^ i) (f x) = b := by - intro n - cases n with - | ofNat n => exact isCycle_swap_mul_aux₁ n - | negSucc n => - intro b x f hb h - exact if hfbx' : f x = b then ⟨0, hfbx'⟩ - else - have : f b ≠ b ∧ b ≠ x := ne_and_ne_of_swap_mul_apply_ne_self hb - have hb : (swap x (f⁻¹ x) * f⁻¹) (f⁻¹ b) ≠ f⁻¹ b := by - rw [mul_apply, swap_apply_def] - split_ifs <;> - simp only [inv_eq_iff_eq, Perm.mul_apply, zpow_negSucc, Ne, Perm.apply_inv_self] at * - <;> tauto - let ⟨i, hi⟩ := - isCycle_swap_mul_aux₁ n hb - (show (f⁻¹ ^ n) (f⁻¹ x) = f⁻¹ b by - rw [← zpow_natCast, ← h, ← mul_apply, ← mul_apply, ← mul_apply, zpow_negSucc, - ← inv_pow, pow_succ, mul_assoc, mul_assoc, inv_mul_cancel, mul_one, zpow_natCast, - ← pow_succ', ← pow_succ]) - have h : (swap x (f⁻¹ x) * f⁻¹) (f x) = f⁻¹ x := by - rw [mul_apply, inv_apply_self, swap_apply_left] - ⟨-i, by - rw [← add_sub_cancel_right i 1, neg_sub, sub_eq_add_neg, zpow_add, zpow_one, zpow_neg, - ← inv_zpow, mul_inv_rev, swap_inv, mul_swap_eq_swap_mul, inv_apply_self, swap_comm _ x, - zpow_add, zpow_one, mul_apply, mul_apply (_ ^ i), h, hi, mul_apply, apply_inv_self, - swap_apply_of_ne_of_ne this.2 (Ne.symm hfbx')]⟩ + ∀ (n : ℤ) {b x : α} {f : Perm α}, (swap x (f x) * f) b ≠ b → (f ^ n) (f x) = b → + ∃ i : ℤ, ((swap x (f x) * f) ^ i) (f x) = b + | (n : ℕ), _, _, _, hb, h => isCycle_swap_mul_aux₁ n hb h + | .negSucc n, b, x, f, hb, h => by + obtain hfxb | hfxb := eq_or_ne (f x) b + · exact ⟨0, hfxb⟩ + obtain ⟨hfb, hbx⟩ : f b ≠ b ∧ b ≠ x := ne_and_ne_of_swap_mul_apply_ne_self hb + replace hb : (swap x (f.symm x) * f⁻¹) (f.symm b) ≠ f.symm b := by + rw [mul_apply, swap_apply_def] + split_ifs <;> simp [symm_apply_eq, eq_symm_apply] at * <;> tauto + obtain ⟨i, hi⟩ := isCycle_swap_mul_aux₁ n hb <| by + rw [← mul_apply, ← pow_succ]; simpa [pow_succ', eq_symm_apply] using h + refine ⟨-i, (swap x (f⁻¹ x) * f⁻¹).injective ?_⟩ + convert hi using 1 + · rw [zpow_neg, ← inv_zpow, ← mul_apply, mul_inv_rev, swap_inv, mul_swap_eq_swap_mul] + simp [swap_comm _ x, ← mul_apply, -coe_mul, ← inv_def, -coe_inv, ← inv_def, mul_assoc _ f⁻¹, + ← mul_zpow_mul, mul_assoc _ _ f] + simp + · exact swap_apply_of_ne_of_ne (by simpa [eq_comm, eq_symm_apply, symm_apply_eq] using hfxb) + (by simpa [eq_comm, eq_symm_apply, symm_apply_eq]) theorem IsCycle.eq_swap_of_apply_apply_eq_self {α : Type*} [DecidableEq α] {f : Perm α} (hf : IsCycle f) {x : α} (hfx : f x ≠ x) (hffx : f (f x) = x) : f = swap x (f x) := @@ -429,15 +425,11 @@ theorem IsCycle.eq_swap_of_apply_apply_eq_self {α : Type*} [DecidableEq α] {f tauto theorem IsCycle.swap_mul {α : Type*} [DecidableEq α] {f : Perm α} (hf : IsCycle f) {x : α} - (hx : f x ≠ x) (hffx : f (f x) ≠ x) : IsCycle (swap x (f x) * f) := - ⟨f x, by simp [swap_apply_def, mul_apply, if_neg hffx, f.injective.eq_iff, hx], - fun y hy => - let ⟨i, hi⟩ := hf.exists_zpow_eq hx (ne_and_ne_of_swap_mul_apply_ne_self hy).1 - have hi : (f ^ (i - 1)) (f x) = y := - calc - (f ^ (i - 1) : Perm α) (f x) = (f ^ (i - 1) * f ^ (1 : ℤ) : Perm α) x := by simp - _ = y := by rwa [← zpow_add, sub_add_cancel] - isCycle_swap_mul_aux₂ (i - 1) hy hi⟩ + (hx : f x ≠ x) (hffx : f (f x) ≠ x) : IsCycle (swap x (f x) * f) := by + refine ⟨f x, ?_, fun y hy ↦ ?_⟩ + · simp [swap_apply_def, mul_apply, if_neg hffx, f.injective.eq_iff, hx] + obtain ⟨i, rfl⟩ := hf.exists_zpow_eq hx (ne_and_ne_of_swap_mul_apply_ne_self hy).1 + exact isCycle_swap_mul_aux₂ (i - 1) hy (by simp [← mul_apply, -coe_mul, ← zpow_add_one]) theorem IsCycle.sign {f : Perm α} (hf : IsCycle f) : sign f = -(-1) ^ #f.support := let ⟨x, hx⟩ := hf @@ -609,7 +601,7 @@ theorem IsCycle.pow_eq_pow_iff [Finite β] {f : Perm β} (hf : IsCycle f) {a b : rw [hf.pow_eq_one_iff] by_cases hfa : (f ^ a) x ∈ f.support · refine ⟨(f ^ a) x, mem_support.mp hfa, ?_⟩ - simp only [pow_sub _ hab, Equiv.Perm.coe_mul, Function.comp_apply, inv_apply_self, ← hx'] + simp [pow_sub _ hab, ← hx'] · have h := @Equiv.Perm.zpow_apply_comm _ f 1 a x simp only [zpow_one, zpow_natCast] at h rw [notMem_support, h, Function.Injective.eq_iff (f ^ a).injective] at hfa @@ -660,12 +652,8 @@ theorem IsCycle.isConj_iff (hσ : IsCycle σ) (hτ : IsCycle τ) : IsConj σ τ ↔ #σ.support = #τ.support where mp h := by obtain ⟨π, rfl⟩ := (_root_.isConj_iff).1 h - refine Finset.card_bij (fun a _ => π a) (fun _ ha => ?_) (fun _ _ _ _ ab => π.injective ab) - fun b hb ↦ ⟨π⁻¹ b, ?_, π.apply_inv_self b⟩ - · simp [mem_support.1 ha] - contrapose! hb - rw [mem_support, Classical.not_not] at hb - rw [mem_support, Classical.not_not, Perm.mul_apply, Perm.mul_apply, hb, Perm.apply_inv_self] + exact Finset.card_bij (fun a _ => π a) (fun _ ha => by simpa using ha) + (fun _ _ _ _ ab => π.injective ab) fun b hb ↦ ⟨π⁻¹ b, by simpa using hb, π.apply_symm_apply b⟩ mpr := hσ.isConj hτ end Conjugation @@ -705,8 +693,8 @@ alias ⟨IsCycleOn.of_inv, IsCycleOn.inv⟩ := isCycleOn_inv theorem IsCycleOn.conj (h : f.IsCycleOn s) : (g * f * g⁻¹).IsCycleOn ((g : Perm α) '' s) := ⟨(g.bijOn_image.comp h.1).comp g.bijOn_symm_image, fun x hx y hy => by - rw [← preimage_inv] at hx hy - convert Equiv.Perm.SameCycle.conj (h.2 hx hy) (g := g) <;> rw [apply_inv_self]⟩ + rw [Equiv.image_eq_preimage_symm] at hx hy + convert Equiv.Perm.SameCycle.conj (h.2 hx hy) (g := g) <;> simp⟩ theorem isCycleOn_swap [DecidableEq α] (hab : a ≠ b) : (swap a b).IsCycleOn {a, b} := ⟨bijOn_swap (by simp) (by simp), fun x hx y hy => by @@ -738,9 +726,7 @@ theorem isCycle_iff_exists_isCycleOn : exact ⟨a, hf.apply_ne hs ha, fun b hb => hf.2 ha <| hsf hb⟩ theorem IsCycleOn.apply_mem_iff (hf : f.IsCycleOn s) : f x ∈ s ↔ x ∈ s := - ⟨fun hx => by - convert hf.1.perm_inv.1 hx - rw [inv_apply_self], fun hx => hf.1.mapsTo hx⟩ + ⟨fun hx => by simpa using hf.1.perm_inv.1 hx, fun hx => hf.1.mapsTo hx⟩ /-- Note that the identity satisfies `IsCycleOn` for any subsingleton set, but not `IsCycle`. -/ theorem IsCycleOn.isCycle_subtypePerm (hf : f.IsCycleOn s) (hs : s.Nontrivial) : @@ -786,12 +772,12 @@ theorem IsCycleOn.zpow_apply_eq {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ theorem IsCycleOn.pow_apply_eq_pow_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) {m n : ℕ} : (f ^ m) a = (f ^ n) a ↔ m ≡ n [MOD #s] := by rw [Nat.modEq_iff_dvd, ← hf.zpow_apply_eq ha] - simp [sub_eq_neg_add, zpow_add, eq_inv_iff_eq, eq_comm] + simp [sub_eq_neg_add, zpow_add, eq_symm_apply, eq_comm] theorem IsCycleOn.zpow_apply_eq_zpow_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) {m n : ℤ} : (f ^ m) a = (f ^ n) a ↔ m ≡ n [ZMOD #s] := by rw [Int.modEq_iff_dvd, ← hf.zpow_apply_eq ha] - simp [sub_eq_neg_add, zpow_add, eq_inv_iff_eq, eq_comm] + simp [sub_eq_neg_add, zpow_add, eq_symm_apply, eq_comm] theorem IsCycleOn.pow_card_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) : (f ^ #s) a = a := diff --git a/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean b/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean index f79460b4caba85..4abab73d6d6c9c 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.List.Cycle -import Mathlib.GroupTheory.Perm.Cycle.Type -import Mathlib.GroupTheory.Perm.List +module + +public import Mathlib.Data.List.Cycle +public import Mathlib.GroupTheory.Perm.Cycle.Type +public import Mathlib.GroupTheory.Perm.List /-! @@ -42,6 +44,8 @@ on recursion over `Finset.univ`. -/ +@[expose] public section + open Equiv Equiv.Perm List diff --git a/Mathlib/GroupTheory/Perm/Cycle/Factors.lean b/Mathlib/GroupTheory/Perm/Cycle/Factors.lean index f7f3d6630ef2d0..5b1453657be063 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Factors.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Factors.lean @@ -3,12 +3,13 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Yaël Dillies -/ +module -import Mathlib.Data.List.Iterate -import Mathlib.Data.Set.Pairwise.List -import Mathlib.GroupTheory.Perm.Cycle.Basic -import Mathlib.GroupTheory.NoncommPiCoprod -import Mathlib.Tactic.Group +public import Mathlib.Data.List.Iterate +public import Mathlib.Data.Set.Pairwise.List +public import Mathlib.GroupTheory.Perm.Cycle.Basic +public import Mathlib.GroupTheory.NoncommPiCoprod +public import Mathlib.Tactic.Group /-! # Cycle factors of a permutation @@ -20,6 +21,8 @@ Let `β` be a `Fintype` and `f : Equiv.Perm β`. that multiply to `f`. -/ +@[expose] public section + open Equiv Function Finset variable {ι α β : Type*} @@ -51,7 +54,7 @@ theorem cycleOf_inv (f : Perm α) [DecidableRel f.SameCycle] (x : α) : (cycleOf f x)⁻¹ = cycleOf f⁻¹ x := Equiv.ext fun y => by rw [inv_eq_iff_eq, cycleOf_apply, cycleOf_apply] - split_ifs <;> simp_all [sameCycle_inv, sameCycle_inv_apply_right] + split_ifs <;> simp_all [sameCycle_inv, sameCycle_symm_apply_right] @[simp] theorem cycleOf_pow_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) : @@ -385,7 +388,7 @@ where (by rw [hfg hx] intro y hy - simp [inv_eq_iff_eq, cycleOf_apply, eq_comm (a := g y)] at hy + simp [symm_apply_eq, cycleOf_apply, eq_comm (a := g y)] at hy rw [hfg (Ne.symm hy.right), ← mul_inv_eq_one (a := g.cycleOf y), cycleOf_inv] simp_rw [mul_inv_rev] rw [inv_inv, cycleOf_mul_of_apply_right_eq_self, ← cycleOf_inv, mul_inv_eq_one] @@ -397,30 +400,20 @@ where ⟨cycleOf f x :: m, by obtain ⟨hm₁, hm₂, hm₃⟩ := hm rw [hfg hx] at hm₁ ⊢ - constructor - · rw [List.prod_cons, hm₁] - simp - · exact - ⟨fun g' hg' => - ((List.mem_cons).1 hg').elim (fun hg' => hg'.symm ▸ isCycle_cycleOf _ hx) (hm₂ g'), - List.pairwise_cons.2 - ⟨fun g' hg' y => - or_iff_not_imp_left.2 fun hgy => - have hxy : SameCycle g x y := - Classical.not_not.1 (mt cycleOf_apply_of_not_sameCycle hgy) - have hg'm : (g' :: m.erase g') ~ m := - List.cons_perm_iff_perm_erase.2 ⟨hg', List.Perm.refl _⟩ - have : ∀ h ∈ m.erase g', Disjoint g' h := - (List.pairwise_cons.1 ((hg'm.pairwise_iff Disjoint.symm).2 hm₃)).1 - by_cases id fun hg'y : g' y ≠ y => - (disjoint_prod_right _ this y).resolve_right <| by - have hsc : SameCycle g⁻¹ x (g y) := by - rwa [sameCycle_inv, sameCycle_apply_right] - rw [disjoint_prod_perm hm₃ hg'm.symm, List.prod_cons, - ← eq_inv_mul_iff_mul_eq] at hm₁ - rwa [hm₁, mul_apply, mul_apply, cycleOf_inv, hsc.cycleOf_apply, - inv_apply_self, inv_eq_iff_eq, eq_comm], - hm₃⟩⟩⟩ + rw [List.pairwise_cons] + refine ⟨?_, fun g' hg' ↦ ?_, fun g' hg' y ↦ ?_, hm₃⟩ + · simp [List.prod_cons, hm₁] + · exact ((List.mem_cons).1 hg').elim (fun hg' => hg'.symm ▸ isCycle_cycleOf _ hx) (hm₂ g') + by_contra! + obtain ⟨hgy, hg'y⟩ := this + have hxy : SameCycle g x y := not_imp_comm.1 cycleOf_apply_of_not_sameCycle hgy + have hg'm : g' :: m.erase g' ~ m := List.cons_perm_iff_perm_erase.2 ⟨hg', .refl _⟩ + have : ∀ h ∈ m.erase g', Disjoint g' h := + (List.pairwise_cons.1 ((hg'm.pairwise_iff Disjoint.symm).2 hm₃)).1 + refine hg'y <| (disjoint_prod_right _ this y).resolve_right ?_ + have hsc : SameCycle g⁻¹ x (g y) := by rwa [sameCycle_inv, sameCycle_apply_right] + rw [disjoint_prod_perm hm₃ hg'm.symm, List.prod_cons, ← eq_inv_mul_iff_mul_eq] at hm₁ + simpa [hm₁, cycleOf_inv, hsc.cycleOf_apply, eq_symm_apply, eq_comm] using hg'y⟩ theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)} (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} : @@ -691,9 +684,9 @@ theorem disjoint_mul_inv_of_mem_cycleFactorsFinset {f g : Perm α} (h : f ∈ cy intro x by_cases hx : f x = x · exact Or.inr hx - · refine Or.inl ?_ - rw [mul_apply, ← h.right, apply_inv_self] - rwa [← support_inv, apply_mem_support, support_inv, mem_support] + left + rw [mul_apply, ← h.right _ (by simpa [eq_symm_apply])] + simp /-- If c is a cycle, a ∈ c.support and c is a cycle of f, then `c = f.cycleOf a` -/ theorem cycle_is_cycleOf {f c : Equiv.Perm α} {a : α} (ha : a ∈ c.support) @@ -749,11 +742,7 @@ theorem mem_cycleFactorsFinset_conj (g k c : Perm α) : intro hc a ha simp only [coe_mul, Function.comp_apply, EmbeddingLike.apply_eq_iff_eq] apply hc - rw [mem_support] at ha ⊢ - contrapose! ha - simp only [mul_smul, ← Perm.smul_def] at ha ⊢ - rw [ha] - simp only [Perm.smul_def, apply_inv_self] + simp_all /-- If a permutation commutes with every cycle of `g`, then it commutes with `g` diff --git a/Mathlib/GroupTheory/Perm/Cycle/PossibleTypes.lean b/Mathlib/GroupTheory/Perm/Cycle/PossibleTypes.lean index c46f3128a184ce..f664ecaac4e5f1 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/PossibleTypes.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/PossibleTypes.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.GroupTheory.Perm.Cycle.Concrete +public import Mathlib.GroupTheory.Perm.Cycle.Concrete /-! # Possible cycle types of permutations @@ -14,6 +15,8 @@ import Mathlib.GroupTheory.Perm.Cycle.Concrete -/ +@[expose] public section + variable (α : Type*) [DecidableEq α] [Fintype α] section Ranges diff --git a/Mathlib/GroupTheory/Perm/Cycle/Type.lean b/Mathlib/GroupTheory/Perm/Cycle/Type.lean index 8fb97d2ae4bd4b..9ece3cf2b1e8a2 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Type.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Type.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.GCDMonoid.Multiset -import Mathlib.Algebra.GCDMonoid.Nat -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.Combinatorics.Enumerative.Partition -import Mathlib.Data.List.Rotate -import Mathlib.GroupTheory.Perm.Closure -import Mathlib.GroupTheory.Perm.Cycle.Factors -import Mathlib.Tactic.NormNum.GCD +module + +public import Mathlib.Algebra.GCDMonoid.Multiset +public import Mathlib.Algebra.GCDMonoid.Nat +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.Combinatorics.Enumerative.Partition.Basic +public import Mathlib.Data.List.Rotate +public import Mathlib.GroupTheory.Perm.Closure +public import Mathlib.GroupTheory.Perm.Cycle.Factors +public import Mathlib.Tactic.NormNum.GCD /-! # Cycle Types @@ -32,6 +34,8 @@ In this file we define the cycle type of a permutation. there exists an element of order `p` in `G`. This is known as Cauchy's theorem. -/ +@[expose] public section + open scoped Finset namespace Equiv.Perm diff --git a/Mathlib/GroupTheory/Perm/DomMulAct.lean b/Mathlib/GroupTheory/Perm/DomMulAct.lean index ca29b4e020eb84..6e9e8ef5c57aa7 100644 --- a/Mathlib/GroupTheory/Perm/DomMulAct.lean +++ b/Mathlib/GroupTheory/Perm/DomMulAct.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Junyan Xu, Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu, Antoine Chambert-Loir -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.Data.Fintype.Perm -import Mathlib.Data.Set.Card -import Mathlib.GroupTheory.GroupAction.Defs -import Mathlib.GroupTheory.GroupAction.DomAct.Basic +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Data.Fintype.Perm +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic /-! # Subgroup of `Equiv.Perm α` preserving a function @@ -32,6 +34,8 @@ Let `α` and `ι` by types and let `f : α → ι` formula, where the product is restricted to `Finset.univ.image f`. -/ +@[expose] public section + assert_not_exists Field open Equiv MulAction @@ -45,7 +49,7 @@ lemma mem_stabilizer_iff {g : (Perm α)ᵈᵐᵃ} : simp only [MulAction.mem_stabilizer_iff]; rfl /-- The `invFun` component of `MulEquiv` from `MulAction.stabilizer (Perm α) f` - to the product of the `Equiv.Perm {a // f a = i} -/ + to the product of the `Equiv.Perm {a // f a = i}`. -/ def stabilizerEquiv_invFun (g : ∀ i, Perm {a // f a = i}) (a : α) : α := g (f a) ⟨a, rfl⟩ lemma stabilizerEquiv_invFun_eq (g : ∀ i, Perm {a // f a = i}) {a : α} {i : ι} (h : f a = i) : @@ -56,7 +60,7 @@ lemma comp_stabilizerEquiv_invFun (g : ∀ i, Perm {a // f a = i}) (a : α) : (g (f a) ⟨a, rfl⟩).prop /-- The `invFun` component of `MulEquiv` from `MulAction.stabilizer (Perm α) p` - to the product of the `Equiv.Perm {a | f a = i} (as an `Equiv.Perm α`) -/ + to the product of the `Equiv.Perm {a | f a = i}` (as an `Equiv.Perm α`). -/ def stabilizerEquiv_invFun_aux (g : ∀ i, Perm {a // f a = i}) : Perm α where toFun := stabilizerEquiv_invFun g invFun := stabilizerEquiv_invFun (fun i ↦ (g i).symm) diff --git a/Mathlib/GroupTheory/Perm/Fin.lean b/Mathlib/GroupTheory/Perm/Fin.lean index d2b4cad895f43a..b1474a103311d0 100644 --- a/Mathlib/GroupTheory/Perm/Fin.lean +++ b/Mathlib/GroupTheory/Perm/Fin.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Yi Yuan -/ -import Mathlib.GroupTheory.Perm.Cycle.Type -import Mathlib.GroupTheory.Perm.Option -import Mathlib.Logic.Equiv.Fin.Rotate +module + +public import Mathlib.GroupTheory.Perm.Cycle.Type +public import Mathlib.GroupTheory.Perm.Option +public import Mathlib.Logic.Equiv.Fin.Rotate /-! # Permutations of `Fin n` -/ +@[expose] public section + assert_not_exists LinearMap open Equiv diff --git a/Mathlib/GroupTheory/Perm/Finite.lean b/Mathlib/GroupTheory/Perm/Finite.lean index d5b8f790c84843..79666b9c31ba31 100644 --- a/Mathlib/GroupTheory/Perm/Finite.lean +++ b/Mathlib/GroupTheory/Perm/Finite.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Finite.Sum -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.GroupTheory.Perm.Support -import Mathlib.Logic.Equiv.Fintype +module + +public import Mathlib.Data.Finite.Sum +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.GroupTheory.Perm.Support +public import Mathlib.Logic.Equiv.Fintype /-! # Permutations on `Fintype`s @@ -15,6 +17,8 @@ This file contains miscellaneous lemmas about `Equiv.Perm` and `Equiv.swap`, bui of those in `Mathlib/Logic/Equiv/Basic.lean` and other files in `Mathlib/GroupTheory/Perm/*`. -/ +@[expose] public section + universe u v open Equiv Function Fintype Finset @@ -49,43 +53,50 @@ theorem isConj_of_support_equiv end Conjugation - - -theorem perm_inv_on_of_perm_on_finset {s : Finset α} {f : Perm α} (h : ∀ x ∈ s, f x ∈ s) {y : α} - (hy : y ∈ s) : f⁻¹ y ∈ s := by +theorem perm_symm_on_of_perm_on_finset {s : Finset α} {f : Perm α} (h : ∀ x ∈ s, f x ∈ s) {y : α} + (hy : y ∈ s) : f.symm y ∈ s := by have h0 : ∀ y ∈ s, ∃ (x : _) (hx : x ∈ s), y = (fun i (_ : i ∈ s) => f i) x hx := Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha) (fun a₁ a₂ ha₁ ha₂ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge - obtain ⟨y2, hy2, heq⟩ := h0 y hy - convert hy2 - rw [heq] - simp only [inv_apply_self] + obtain ⟨y2, hy2, rfl⟩ := h0 y hy + simpa using hy2 -theorem perm_inv_mapsTo_of_mapsTo (f : Perm α) {s : Set α} [Finite s] (h : Set.MapsTo f s s) : - Set.MapsTo (f⁻¹ :) s s := by +@[deprecated (since := "2025-11-17")] +alias perm_inv_on_of_perm_on_finset := perm_symm_on_of_perm_on_finset + +theorem perm_symm_mapsTo_of_mapsTo (f : Perm α) {s : Set α} [Finite s] (h : Set.MapsTo f s s) : + Set.MapsTo f.symm s s := by cases nonempty_fintype s exact fun x hx => Set.mem_toFinset.mp <| - perm_inv_on_of_perm_on_finset + perm_symm_on_of_perm_on_finset (fun a ha => Set.mem_toFinset.mpr (h (Set.mem_toFinset.mp ha))) (Set.mem_toFinset.mpr hx) +@[deprecated (since := "2025-11-17")] alias perm_inv_mapsTo_of_mapsTo := perm_symm_mapsTo_of_mapsTo + @[simp] -theorem perm_inv_mapsTo_iff_mapsTo {f : Perm α} {s : Set α} [Finite s] : - Set.MapsTo (f⁻¹ :) s s ↔ Set.MapsTo f s s := - ⟨perm_inv_mapsTo_of_mapsTo f⁻¹, perm_inv_mapsTo_of_mapsTo f⟩ +theorem perm_symm_mapsTo_iff_mapsTo {f : Perm α} {s : Set α} [Finite s] : + Set.MapsTo f.symm s s ↔ Set.MapsTo f s s := + ⟨perm_symm_mapsTo_of_mapsTo f⁻¹, perm_symm_mapsTo_of_mapsTo f⟩ -theorem perm_inv_on_of_perm_on_finite {f : Perm α} {p : α → Prop} [Finite { x // p x }] - (h : ∀ x, p x → p (f x)) {x : α} (hx : p x) : p (f⁻¹ x) := by +@[deprecated (since := "2025-11-17")] +alias perm_inv_mapsTo_iff_mapsTo := perm_symm_mapsTo_iff_mapsTo + +theorem perm_symm_on_of_perm_on_finite {f : Perm α} {p : α → Prop} [Finite { x // p x }] + (h : ∀ x, p x → p (f x)) {x : α} (hx : p x) : p (f.symm x) := by have : Finite { x | p x } := by simpa - simpa using perm_inv_mapsTo_of_mapsTo (s := {x | p x}) f h hx + simpa using perm_symm_mapsTo_of_mapsTo (s := {x | p x}) f h hx + +@[deprecated (since := "2025-11-17")] +alias perm_inv_on_of_perm_on_finite := perm_symm_on_of_perm_on_finite /-- If the permutation `f` maps `{x // p x}` into itself, then this returns the permutation on `{x // p x}` induced by `f`. Note that the `h` hypothesis is weaker than for `Equiv.Perm.subtypePerm`. -/ abbrev subtypePermOfFintype (f : Perm α) {p : α → Prop} [Finite { x // p x }] (h : ∀ x, p x → p (f x)) : Perm { x // p x } := - f.subtypePerm fun x => ⟨fun h₂ => f.inv_apply_self x ▸ perm_inv_on_of_perm_on_finite h h₂, h x⟩ + f.subtypePerm fun x => ⟨fun h₂ => f.symm_apply_apply x ▸ perm_symm_on_of_perm_on_finite h h₂, h x⟩ @[simp] theorem subtypePermOfFintype_apply (f : Perm α) {p : α → Prop} [Finite { x // p x }] @@ -102,52 +113,43 @@ theorem perm_mapsTo_inl_iff_mapsTo_inr {m n : Type*} [Finite m] [Finite n] (σ : constructor <;> ( intro h classical - rw [← perm_inv_mapsTo_iff_mapsTo] at h + rw [← perm_symm_mapsTo_iff_mapsTo] at h intro x rcases hx : σ x with l | r) · rintro ⟨a, rfl⟩ obtain ⟨y, hy⟩ := h ⟨l, rfl⟩ - rw [← hx, σ.inv_apply_self] at hy - exact absurd hy Sum.inl_ne_inr + grind · rintro _; exact ⟨r, rfl⟩ · rintro _; exact ⟨l, rfl⟩ · rintro ⟨a, rfl⟩ obtain ⟨y, hy⟩ := h ⟨r, rfl⟩ - rw [← hx, σ.inv_apply_self] at hy - exact absurd hy Sum.inr_ne_inl + grind theorem mem_sumCongrHom_range_of_perm_mapsTo_inl {m n : Type*} [Finite m] [Finite n] {σ : Perm (m ⊕ n)} (h : Set.MapsTo σ (Set.range Sum.inl) (Set.range Sum.inl)) : σ ∈ (sumCongrHom m n).range := by classical - have h1 : ∀ x : m ⊕ n, (∃ a : m, Sum.inl a = x) → ∃ a : m, Sum.inl a = σ x := by - rintro x ⟨a, ha⟩ - apply h - rw [← ha] - exact ⟨a, rfl⟩ - have h3 : ∀ x : m ⊕ n, (∃ b : n, Sum.inr b = x) → ∃ b : n, Sum.inr b = σ x := by - rintro x ⟨b, hb⟩ - apply (perm_mapsTo_inl_iff_mapsTo_inr σ).mp h - rw [← hb] - exact ⟨b, rfl⟩ - let σ₁' := subtypePermOfFintype σ h1 - let σ₂' := subtypePermOfFintype σ h3 - let σ₁ := permCongr (Equiv.ofInjective _ Sum.inl_injective).symm σ₁' - let σ₂ := permCongr (Equiv.ofInjective _ Sum.inr_injective).symm σ₂' - rw [MonoidHom.mem_range, Prod.exists] - use σ₁, σ₂ - rw [Perm.sumCongrHom_apply] - ext x - rcases x with a | b - · rw [Equiv.sumCongr_apply, Sum.map_inl, permCongr_apply, Equiv.symm_symm, - apply_ofInjective_symm Sum.inl_injective] - rw [ofInjective_apply, Subtype.coe_mk, Subtype.coe_mk] - dsimp [Set.range] - rw [subtypePerm_apply] - · rw [Equiv.sumCongr_apply, Sum.map_inr, permCongr_apply, Equiv.symm_symm, - apply_ofInjective_symm Sum.inr_injective, ofInjective_apply] - dsimp [Set.range] - rw [subtypePerm_apply] + have h1 : ∀ x : m ⊕ n, (∃ a : m, Sum.inl a = x) → ∃ a : m, Sum.inl a = σ x := by + rintro _ ⟨a, rfl⟩; exact h ⟨a, rfl⟩ + have h3 : ∀ x : m ⊕ n, (∃ b : n, Sum.inr b = x) → ∃ b : n, Sum.inr b = σ x := by + rintro _ ⟨b, rfl⟩; exact (perm_mapsTo_inl_iff_mapsTo_inr σ).mp h ⟨b, rfl⟩ + let σ₁' := subtypePermOfFintype σ h1 + let σ₂' := subtypePermOfFintype σ h3 + let σ₁ := permCongr (Equiv.ofInjective _ Sum.inl_injective).symm σ₁' + let σ₂ := permCongr (Equiv.ofInjective _ Sum.inr_injective).symm σ₂' + rw [MonoidHom.mem_range, Prod.exists] + use σ₁, σ₂ + rw [Perm.sumCongrHom_apply] + ext (a | b) + · rw [Equiv.sumCongr_apply, Sum.map_inl, permCongr_apply, Equiv.symm_symm, + apply_ofInjective_symm Sum.inl_injective] + rw [ofInjective_apply, Subtype.coe_mk, Subtype.coe_mk] + dsimp [Set.range] + rw [subtypePerm_apply] + · rw [Equiv.sumCongr_apply, Sum.map_inr, permCongr_apply, Equiv.symm_symm, + apply_ofInjective_symm Sum.inr_injective, ofInjective_apply] + dsimp [Set.range] + rw [subtypePerm_apply] nonrec theorem Disjoint.orderOf {σ τ : Perm α} (hστ : Disjoint σ τ) : orderOf (σ * τ) = Nat.lcm (orderOf σ) (orderOf τ) := @@ -171,48 +173,47 @@ theorem Disjoint.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Su theorem Disjoint.isConj_mul [Finite α] {σ τ π ρ : Perm α} (hc1 : IsConj σ π) (hc2 : IsConj τ ρ) (hd1 : Disjoint σ τ) (hd2 : Disjoint π ρ) : IsConj (σ * τ) (π * ρ) := by classical - cases nonempty_fintype α - obtain ⟨f, rfl⟩ := isConj_iff.1 hc1 - obtain ⟨g, rfl⟩ := isConj_iff.1 hc2 - have hd1' := coe_inj.2 hd1.support_mul - have hd2' := coe_inj.2 hd2.support_mul - rw [coe_union] at * - have hd1'' := disjoint_coe.2 (disjoint_iff_disjoint_support.1 hd1) - have hd2'' := disjoint_coe.2 (disjoint_iff_disjoint_support.1 hd2) - refine isConj_of_support_equiv ?_ ?_ - · refine - ((Equiv.setCongr hd1').trans (Equiv.Set.union hd1'')).trans - ((Equiv.sumCongr (subtypeEquiv f fun a => ?_) (subtypeEquiv g fun a => ?_)).trans - ((Equiv.setCongr hd2').trans (Equiv.Set.union hd2'')).symm) <;> - · simp only [Set.mem_image, toEmbedding_apply, exists_eq_right, support_conj, coe_map, - apply_eq_iff_eq] - · intro x hx - simp only [trans_apply, symm_trans_apply, Equiv.setCongr_apply, Equiv.setCongr_symm_apply, - Equiv.sumCongr_apply] - rw [hd1', Set.mem_union] at hx - rcases hx with hxσ | hxτ - · rw [mem_coe, mem_support] at hxσ - rw [Set.union_apply_left, Set.union_apply_left] - · simp only [subtypeEquiv_apply, Perm.coe_mul, Sum.map_inl, comp_apply, - Set.union_symm_apply_left, Subtype.coe_mk, apply_eq_iff_eq] - have h := (hd2 (f x)).resolve_left ?_ - · rw [mul_apply, mul_apply] at h - rw [h, inv_apply_self, (hd1 x).resolve_left hxσ] - · rwa [mul_apply, mul_apply, inv_apply_self, apply_eq_iff_eq] - · rwa [Subtype.coe_mk, mem_coe, mem_support] - · rwa [Subtype.coe_mk, Perm.mul_apply, (hd1 x).resolve_left hxσ, mem_coe, - apply_mem_support, mem_support] - · rw [mem_coe, ← apply_mem_support, mem_support] at hxτ - rw [Set.union_apply_right, Set.union_apply_right] - · simp only [subtypeEquiv_apply, Perm.coe_mul, Sum.map_inr, comp_apply, - Set.union_symm_apply_right, Subtype.coe_mk] - have h := (hd2 (g (τ x))).resolve_right ?_ - · rw [mul_apply, mul_apply] at h - rw [inv_apply_self, h, (hd1 (τ x)).resolve_right hxτ] - · rwa [mul_apply, mul_apply, inv_apply_self, apply_eq_iff_eq] - · rwa [Subtype.coe_mk, mem_coe, ← apply_mem_support, mem_support] - · rwa [Subtype.coe_mk, Perm.mul_apply, (hd1 (τ x)).resolve_right hxτ, - mem_coe, mem_support] + cases nonempty_fintype α + obtain ⟨f, rfl⟩ := isConj_iff.1 hc1 + obtain ⟨g, rfl⟩ := isConj_iff.1 hc2 + have hd1' := coe_inj.2 hd1.support_mul + have hd2' := coe_inj.2 hd2.support_mul + rw [coe_union] at * + have hd1'' := disjoint_coe.2 (disjoint_iff_disjoint_support.1 hd1) + have hd2'' := disjoint_coe.2 (disjoint_iff_disjoint_support.1 hd2) + refine isConj_of_support_equiv ?_ ?_ + · refine ((Equiv.setCongr hd1').trans (Equiv.Set.union hd1'')).trans <| + (Equiv.sumCongr (subtypeEquiv f fun a => ?_) <| subtypeEquiv g fun a => ?_).trans + ((Equiv.setCongr hd2').trans (Equiv.Set.union hd2'')).symm <;> + simp only [Set.mem_image, toEmbedding_apply, exists_eq_right, support_conj, coe_map, + apply_eq_iff_eq] + intro x hx + simp only [trans_apply, symm_trans_apply, Equiv.setCongr_apply, Equiv.setCongr_symm_apply, + Equiv.sumCongr_apply] + rw [hd1', Set.mem_union] at hx + rcases hx with hxσ | hxτ + · rw [mem_coe, mem_support] at hxσ + rw [Set.union_apply_left, Set.union_apply_left] + · simp only [subtypeEquiv_apply, Perm.coe_mul, Sum.map_inl, comp_apply, + Set.union_symm_apply_left, Subtype.coe_mk, apply_eq_iff_eq, coe_inv] + have h := (hd2 (f x)).resolve_left ?_ + · rw [mul_apply, mul_apply, coe_inv] at h + rw [h, symm_apply_apply, (hd1 x).resolve_left hxσ] + · rwa [mul_apply, mul_apply, coe_inv, symm_apply_apply, apply_eq_iff_eq] + · rwa [Subtype.coe_mk, mem_coe, mem_support] + · rwa [Subtype.coe_mk, Perm.mul_apply, (hd1 x).resolve_left hxσ, mem_coe, + apply_mem_support, mem_support] + · rw [mem_coe, ← apply_mem_support, mem_support] at hxτ + rw [Set.union_apply_right, Set.union_apply_right] + · simp only [subtypeEquiv_apply, Perm.coe_mul, Sum.map_inr, comp_apply, + Set.union_symm_apply_right, Subtype.coe_mk] + have h := (hd2 (g (τ x))).resolve_right ?_ + · rw [mul_apply, mul_apply, coe_inv] at h + rw [coe_inv, coe_inv, symm_apply_apply, h, (hd1 (τ x)).resolve_right hxτ] + · rwa [mul_apply, mul_apply, coe_inv, symm_apply_apply, apply_eq_iff_eq] + · rwa [Subtype.coe_mk, mem_coe, ← apply_mem_support, mem_support] + · rwa [Subtype.coe_mk, Perm.mul_apply, (hd1 (τ x)).resolve_right hxτ, + mem_coe, mem_support] theorem apply_mem_fixedPoints_iff_mem_of_mem_centralizer {g p : Perm α} (hp : p ∈ Subgroup.centralizer {g}) {x : α} : diff --git a/Mathlib/GroupTheory/Perm/List.lean b/Mathlib/GroupTheory/Perm/List.lean index 868d511ab104f0..08929ff5600447 100644 --- a/Mathlib/GroupTheory/Perm/List.lean +++ b/Mathlib/GroupTheory/Perm/List.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Data.List.Rotate -import Mathlib.GroupTheory.Perm.Support +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Data.List.Rotate +public import Mathlib.GroupTheory.Perm.Support /-! # Permutations from a list @@ -27,6 +29,8 @@ The presence of duplicates in a particular placement can lead `List.formPerm` to nontrivial permutation that is noncyclic. -/ +@[expose] public section + namespace List diff --git a/Mathlib/GroupTheory/Perm/MaximalSubgroups.lean b/Mathlib/GroupTheory/Perm/MaximalSubgroups.lean index ec3abd95c9fcc3..55cfeffc8b49e5 100644 --- a/Mathlib/GroupTheory/Perm/MaximalSubgroups.lean +++ b/Mathlib/GroupTheory/Perm/MaximalSubgroups.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.GroupTheory.GroupAction.Jordan -import Mathlib.GroupTheory.SpecificGroups.Cyclic -import Mathlib.GroupTheory.Subgroup.Simple -import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup +module + +public import Mathlib.GroupTheory.GroupAction.Jordan +public import Mathlib.GroupTheory.SpecificGroups.Cyclic +public import Mathlib.GroupTheory.Subgroup.Simple +public import Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup /-! # Maximal subgroups of the symmetric groups @@ -33,6 +35,8 @@ The argument is taken from [M. Liebeck, C. Praeger, J. Saxl, alternating and symmetric groups*, 1987][LiebeckPraegerSaxl-1987]. -/ +@[expose] public section + open scoped Pointwise open Set diff --git a/Mathlib/GroupTheory/Perm/Option.lean b/Mathlib/GroupTheory/Perm/Option.lean index 55b10c096e868e..4fe5807c304162 100644 --- a/Mathlib/GroupTheory/Perm/Option.lean +++ b/Mathlib/GroupTheory/Perm/Option.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Fintype.Option -import Mathlib.GroupTheory.Perm.Sign +module + +public import Mathlib.Data.Fintype.Option +public import Mathlib.GroupTheory.Perm.Sign /-! # Permutations of `Option α` -/ +@[expose] public section + open Equiv diff --git a/Mathlib/GroupTheory/Perm/Sign.lean b/Mathlib/GroupTheory/Perm/Sign.lean index 661f891ee9f8e1..2424e907702178 100644 --- a/Mathlib/GroupTheory/Perm/Sign.lean +++ b/Mathlib/GroupTheory/Perm/Sign.lean @@ -3,19 +3,21 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Conj -import Mathlib.Algebra.Group.Subgroup.Lattice -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Data.Finset.Fin -import Mathlib.Data.Finset.Sort -import Mathlib.Data.Fintype.Perm -import Mathlib.Data.Fintype.Prod -import Mathlib.Data.Fintype.Sum -import Mathlib.Data.Int.Order.Units -import Mathlib.GroupTheory.Perm.Support -import Mathlib.Logic.Equiv.Fintype -import Mathlib.Tactic.NormNum.Ineq -import Mathlib.Data.Finset.Sigma +module + +public import Mathlib.Algebra.Group.Conj +public import Mathlib.Algebra.Group.Subgroup.Lattice +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Data.Finset.Fin +public import Mathlib.Data.Finset.Sort +public import Mathlib.Data.Fintype.Perm +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Data.Fintype.Sum +public import Mathlib.Data.Int.Order.Units +public import Mathlib.GroupTheory.Perm.Support +public import Mathlib.Logic.Equiv.Fintype +public import Mathlib.Tactic.NormNum.Ineq +public import Mathlib.Data.Finset.Sigma /-! # Sign of a permutation @@ -27,6 +29,8 @@ Other lemmas have been moved to `Mathlib/GroupTheory/Perm/Fintype.lean` -/ +@[expose] public section + universe u v open Equiv Function Fintype Finset @@ -194,17 +198,15 @@ theorem signBijAux_injOn {n : ℕ} {f : Perm (Fin n)} : theorem signBijAux_surj {n : ℕ} {f : Perm (Fin n)} : ∀ a ∈ finPairsLT n, ∃ b ∈ finPairsLT n, signBijAux f b = a := fun ⟨a₁, a₂⟩ ha => - if hxa : f⁻¹ a₂ < f⁻¹ a₁ then - ⟨⟨f⁻¹ a₁, f⁻¹ a₂⟩, mem_finPairsLT.2 hxa, by - dsimp [signBijAux] - rw [apply_inv_self, apply_inv_self, if_pos (mem_finPairsLT.1 ha)]⟩ + if hxa : f.symm a₂ < f.symm a₁ then + ⟨⟨f.symm a₁, f.symm a₂⟩, mem_finPairsLT.2 hxa, by + simp [signBijAux, if_pos (mem_finPairsLT.1 ha)]⟩ else - ⟨⟨f⁻¹ a₂, f⁻¹ a₁⟩, + ⟨⟨f.symm a₂, f.symm a₁⟩, mem_finPairsLT.2 <| (le_of_not_gt hxa).lt_of_ne fun h => by simp [mem_finPairsLT, f⁻¹.injective h] at ha, by - dsimp [signBijAux] - rw [apply_inv_self, apply_inv_self, if_neg (mem_finPairsLT.1 ha).le.not_gt]⟩ + simp [signBijAux, if_neg (mem_finPairsLT.1 ha).le.not_gt]⟩ theorem signBijAux_mem {n : ℕ} {f : Perm (Fin n)} : ∀ a : Σ _ : Fin n, Fin n, a ∈ finPairsLT n → signBijAux f a ∈ finPairsLT n := @@ -217,13 +219,10 @@ theorem signBijAux_mem {n : ℕ} {f : Perm (Fin n)} : @[simp] theorem signAux_inv {n : ℕ} (f : Perm (Fin n)) : signAux f⁻¹ = signAux f := - prod_nbij (signBijAux f⁻¹) signBijAux_mem signBijAux_injOn signBijAux_surj fun ⟨a, b⟩ hab ↦ - if h : f⁻¹ b < f⁻¹ a then by - simp_all [signBijAux, if_neg h.not_ge, apply_inv_self, apply_inv_self, - if_neg (mem_finPairsLT.1 hab).not_ge] - else by - simp_all [signBijAux, dif_neg h, apply_inv_self, apply_inv_self, - if_pos (mem_finPairsLT.1 hab).le] + prod_nbij (signBijAux f⁻¹) signBijAux_mem signBijAux_injOn signBijAux_surj fun ⟨a, b⟩ hab ↦ by + by_cases h : f.symm b < f.symm a + · simp_all [signBijAux, (mem_finPairsLT.1 hab).not_ge] + · simp_all [signBijAux, dif_neg h, (mem_finPairsLT.1 hab).le] theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by rw [← signAux_inv g] @@ -234,18 +233,10 @@ theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f dsimp only [signBijAux] rw [mul_apply, mul_apply] rw [mem_finPairsLT] at hab - by_cases h : g b < g a - · rw [dif_pos h] - simp only [not_le_of_gt hab, mul_one, Perm.inv_apply_self, if_false] - · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le] - by_cases h₁ : f (g b) ≤ f (g a) - · have : f (g b) ≠ f (g a) := by - rw [Ne, f.injective.eq_iff, g.injective.eq_iff] - exact ne_of_lt hab - rw [if_pos h₁, if_neg (h₁.lt_of_ne this).not_ge] - rfl - · rw [if_neg h₁, if_pos (lt_of_not_ge h₁).le] - rfl + by_cases hg : g b < g a + · simp [*] + obtain hf | hf := (f.injective.ne <| g.injective.ne hab.ne).lt_or_gt <;> + simp_all [le_of_lt, not_le_of_gt, not_lt_of_ge] private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 := show _ = ∏ x ∈ {(⟨1, 0⟩ : Σ _ : Fin (n + 2), Fin (n + 2))}, diff --git a/Mathlib/GroupTheory/Perm/Subgroup.lean b/Mathlib/GroupTheory/Perm/Subgroup.lean index 737eb688279731..755f161a8306a3 100644 --- a/Mathlib/GroupTheory/Perm/Subgroup.lean +++ b/Mathlib/GroupTheory/Perm/Subgroup.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.Algebra.Group.Subgroup.Finite -import Mathlib.Data.Fintype.Perm +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.Algebra.Group.Subgroup.Finite +public import Mathlib.Data.Fintype.Perm /-! # Lemmas about subgroups within the permutations (self-equivalences) of a type `α` @@ -20,6 +22,8 @@ The presence of these instances induces a `Fintype` instance on the `QuotientGro these subgroups. -/ +@[expose] public section + assert_not_exists Field namespace Equiv diff --git a/Mathlib/GroupTheory/Perm/Support.lean b/Mathlib/GroupTheory/Perm/Support.lean index 75e8d9e0e85312..1ccfeebd7b3cec 100644 --- a/Mathlib/GroupTheory/Perm/Support.lean +++ b/Mathlib/GroupTheory/Perm/Support.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Aaron Anderson, Yakov Pechersky -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Algebra.Group.Commute.Basic -import Mathlib.Algebra.Group.End -import Mathlib.Data.Finset.NoncommProd +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Algebra.Group.Commute.Basic +public import Mathlib.Algebra.Group.End +public import Mathlib.Data.Finset.NoncommProd /-! # support of a permutation @@ -28,6 +30,8 @@ Assume `α` is a Fintype: -/ +@[expose] public section + open Equiv Finset Function @@ -228,10 +232,10 @@ section Set variable (p q : Perm α) -theorem set_support_inv_eq : { x | p⁻¹ x ≠ x } = { x | p x ≠ x } := by - ext x - simp only [Set.mem_setOf_eq, Ne] - rw [inv_def, symm_apply_eq, eq_comm] +lemma set_support_symm_eq : {x | p.symm x ≠ x} = {x | p x ≠ x} := by + ext; simp [eq_symm_apply, eq_comm] + +@[deprecated (since := "2025-11-17")] alias set_support_inv_eq := set_support_symm_eq theorem set_support_apply_mem {p : Perm α} {a : α} : p a ∈ { x | p x ≠ x } ↔ a ∈ { x | p x ≠ x } := by simp diff --git a/Mathlib/GroupTheory/Perm/ViaEmbedding.lean b/Mathlib/GroupTheory/Perm/ViaEmbedding.lean index af68a4dbe45476..21bca3d965beb7 100644 --- a/Mathlib/GroupTheory/Perm/ViaEmbedding.lean +++ b/Mathlib/GroupTheory/Perm/ViaEmbedding.lean @@ -3,14 +3,18 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Algebra.Group.End -import Mathlib.Logic.Embedding.Basic -import Mathlib.Logic.Equiv.Set +module + +public import Mathlib.Algebra.Group.End +public import Mathlib.Logic.Embedding.Basic +public import Mathlib.Logic.Equiv.Set /-! # `Equiv.Perm.viaEmbedding`, a noncomputable analogue of `Equiv.Perm.viaFintypeEmbedding`. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/GroupTheory/PresentedGroup.lean b/Mathlib/GroupTheory/PresentedGroup.lean index a7efeee2622868..68fd9484d07dcd 100644 --- a/Mathlib/GroupTheory/PresentedGroup.lean +++ b/Mathlib/GroupTheory/PresentedGroup.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Michael Howes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Howes, Newell Jensen -/ -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.GroupTheory.FreeGroup.Basic -import Mathlib.GroupTheory.QuotientGroup.Defs +module + +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.GroupTheory.FreeGroup.Basic +public import Mathlib.GroupTheory.QuotientGroup.Defs /-! # Defining a group given by generators and relations @@ -26,6 +28,8 @@ given by generators `x : α` and relations `r ∈ rels`. generators, relations, group presentations -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/GroupTheory/PushoutI.lean b/Mathlib/GroupTheory/PushoutI.lean index b30ff726ee584d..5fe98946b10f68 100644 --- a/Mathlib/GroupTheory/PushoutI.lean +++ b/Mathlib/GroupTheory/PushoutI.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.GroupTheory.CoprodI -import Mathlib.GroupTheory.Coprod.Basic -import Mathlib.GroupTheory.Complement +public import Mathlib.GroupTheory.CoprodI +public import Mathlib.GroupTheory.Coprod.Basic +public import Mathlib.GroupTheory.Complement /-! @@ -41,6 +42,8 @@ amalgamated product, pushout, group -/ +@[expose] public section + namespace Monoid open CoprodI Subgroup Coprod Function List diff --git a/Mathlib/GroupTheory/QuotientGroup/Basic.lean b/Mathlib/GroupTheory/QuotientGroup/Basic.lean index 2b1d5b7fb23622..9853b12188315e 100644 --- a/Mathlib/GroupTheory/QuotientGroup/Basic.lean +++ b/Mathlib/GroupTheory/QuotientGroup/Basic.lean @@ -4,13 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Patrick Massot -/ -- This file is to a certain extent based on `quotient_module.lean` by Johannes Hölzl. +module -import Mathlib.Algebra.Group.Subgroup.Pointwise -import Mathlib.Data.Int.Cast.Lemmas -import Mathlib.GroupTheory.Congruence.Hom -import Mathlib.GroupTheory.Coset.Basic -import Mathlib.GroupTheory.QuotientGroup.Defs -import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Data.Int.Cast.Lemmas +public import Mathlib.GroupTheory.Congruence.Hom +public import Mathlib.GroupTheory.Coset.Basic +public import Mathlib.GroupTheory.QuotientGroup.Defs +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs /-! # Quotients of groups by normal subgroups @@ -36,6 +37,8 @@ proves Noether's first and second isomorphism theorems. isomorphism theorems, quotient groups -/ +@[expose] public section + open Function open scoped Pointwise diff --git a/Mathlib/GroupTheory/QuotientGroup/Defs.lean b/Mathlib/GroupTheory/QuotientGroup/Defs.lean index 5742c3746df8bf..651182f35bd446 100644 --- a/Mathlib/GroupTheory/QuotientGroup/Defs.lean +++ b/Mathlib/GroupTheory/QuotientGroup/Defs.lean @@ -4,10 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Patrick Massot -/ -- This file is to a certain extent based on `quotient_module.lean` by Johannes Hölzl. +module -import Mathlib.Algebra.Group.Subgroup.Ker -import Mathlib.GroupTheory.Congruence.Hom -import Mathlib.GroupTheory.Coset.Defs +public import Mathlib.Algebra.Group.Subgroup.Ker +public import Mathlib.GroupTheory.Congruence.Hom +public import Mathlib.GroupTheory.Coset.Defs /-! # Quotients of groups by normal subgroups @@ -28,6 +29,8 @@ This file defines the group structure on the quotient by a normal subgroup. quotient groups -/ +@[expose] public section + open Function open scoped Pointwise diff --git a/Mathlib/GroupTheory/QuotientGroup/Finite.lean b/Mathlib/GroupTheory/QuotientGroup/Finite.lean index 4c92b550c2c98a..6bda6badd6c644 100644 --- a/Mathlib/GroupTheory/QuotientGroup/Finite.lean +++ b/Mathlib/GroupTheory/QuotientGroup/Finite.lean @@ -4,27 +4,27 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Patrick Massot -/ -- This file is to a certain extent based on `quotient_module.lean` by Johannes Hölzl. +module -import Mathlib.Algebra.Group.Subgroup.Finite -import Mathlib.Data.Finite.Prod -import Mathlib.GroupTheory.QuotientGroup.Basic +public import Mathlib.Algebra.Group.Subgroup.Finite +public import Mathlib.Data.Finite.Prod +public import Mathlib.GroupTheory.QuotientGroup.Basic /-! # Deducing finiteness of a group. -/ -open Function -open scoped Pointwise - -universe u v w x +@[expose] public section -namespace Group +open Function QuotientGroup Subgroup +open scoped Pointwise -open QuotientGroup Subgroup -variable {F G H : Type u} [Group F] [Group G] [Group H] [Fintype F] [Fintype H] +variable {F G H : Type*} [Group F] [Group G] [Group H] [Fintype F] [Fintype H] variable (f : F →* G) (g : G →* H) +namespace Group + open scoped Classical in /-- If `F` and `H` are finite such that `ker(G →* H) ≤ im(F →* G)`, then `G` is finite. -/ @[to_additive @@ -52,9 +52,18 @@ noncomputable def fintypeOfKerOfCodom [Fintype g.ker] : Fintype G := noncomputable def fintypeOfDomOfCoker [Normal f.range] [Fintype <| G ⧸ f.range] : Fintype G := fintypeOfKerLeRange _ (mk' f.range) fun x => (eq_one_iff x).mp +end Group + @[to_additive] -lemma _root_.Finite.of_finite_quot_finite_subgroup {H : Subgroup G} [Finite H] [Finite (G ⧸ H)] : - Finite G := - Finite.of_equiv _ (groupEquivQuotientProdSubgroup (s := H)).symm +lemma finite_iff_subgroup_quotient (H : Subgroup G) : Finite G ↔ Finite H ∧ Finite (G ⧸ H) := by + rw [(groupEquivQuotientProdSubgroup (s := H)).finite_iff, Prod.finite_iff, and_comm] -end Group +@[to_additive] +lemma Finite.of_subgroup_quotient (H : Subgroup G) [Finite H] [Finite (G ⧸ H)] : Finite G := by + rw [finite_iff_subgroup_quotient]; constructor <;> assumption + +@[deprecated (since := "2025-11-11")] +alias Finite.of_finite_quot_finite_subgroup := Finite.of_subgroup_quotient + +@[deprecated (since := "2025-11-11")] +alias Finite.of_finite_quot_finite_addSubgroup := Finite.of_addSubgroup_quotient diff --git a/Mathlib/GroupTheory/Rank.lean b/Mathlib/GroupTheory/Rank.lean index 90372d948d4b36..62874dc7ed6698 100644 --- a/Mathlib/GroupTheory/Rank.lean +++ b/Mathlib/GroupTheory/Rank.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.GroupTheory.Finiteness -import Mathlib.SetTheory.Cardinal.Finite +module + +public import Mathlib.GroupTheory.Finiteness +public import Mathlib.SetTheory.Cardinal.Finite /-! # Rank of a group @@ -17,6 +19,8 @@ Should we define `erank G : ℕ∞` the rank of a not necessarily finitely gener then redefine `rank G` as `(erank G).toNat`? Maybe a `Cardinal`-valued version too? -/ +@[expose] public section + open Function Group variable {G H : Type*} [Group G] [Group H] diff --git a/Mathlib/GroupTheory/RegularWreathProduct.lean b/Mathlib/GroupTheory/RegularWreathProduct.lean index ca2c12a7d4f173..48686c19ebf3f0 100644 --- a/Mathlib/GroupTheory/RegularWreathProduct.lean +++ b/Mathlib/GroupTheory/RegularWreathProduct.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Francisco Silva. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Francisco Silva -/ +module -import Mathlib.GroupTheory.Sylow -import Mathlib.Algebra.Group.PUnit -import Mathlib.Data.Finite.Perm -import Mathlib.Algebra.Group.End +public import Mathlib.GroupTheory.Sylow +public import Mathlib.Algebra.Group.PUnit +public import Mathlib.Data.Finite.Perm +public import Mathlib.Algebra.Group.End /-! # Regular wreath product @@ -34,6 +35,8 @@ This file introduces the global notation `D ≀ᵣ Q` for `RegularWreathProduct group, regular wreath product, sylow p-subgroup -/ +@[expose] public section + variable (D Q : Type*) [Group D] [Group Q] /-- The regular wreath product of groups `Q` and `D`. It is the product `(Q → D) × Q` with the group diff --git a/Mathlib/GroupTheory/Schreier.lean b/Mathlib/GroupTheory/Schreier.lean index 038c1b39502843..668ddbf07d7a4e 100644 --- a/Mathlib/GroupTheory/Schreier.lean +++ b/Mathlib/GroupTheory/Schreier.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Group.Pointwise.Finset.Basic -import Mathlib.GroupTheory.Abelianization.Defs -import Mathlib.GroupTheory.Commutator.Finite -import Mathlib.GroupTheory.Transfer +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic +public import Mathlib.GroupTheory.Abelianization.Defs +public import Mathlib.GroupTheory.Commutator.Finite +public import Mathlib.GroupTheory.Transfer /-! # Schreier's Lemma @@ -24,6 +26,8 @@ In this file we prove Schreier's lemma. subgroup is bounded in terms of the number of commutators. -/ +@[expose] public section + open scoped Finset Pointwise diff --git a/Mathlib/GroupTheory/SchurZassenhaus.lean b/Mathlib/GroupTheory/SchurZassenhaus.lean index d5fc5a9eb3a4f2..2d55389280086f 100644 --- a/Mathlib/GroupTheory/SchurZassenhaus.lean +++ b/Mathlib/GroupTheory/SchurZassenhaus.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.GroupTheory.Transfer +module + +public import Mathlib.GroupTheory.Transfer /-! # The Schur-Zassenhaus Theorem @@ -20,6 +22,8 @@ In this file we prove the Schur-Zassenhaus theorem. then there exists a subgroup `K` which is a (left) complement of `H`. -/ +@[expose] public section + namespace Subgroup diff --git a/Mathlib/GroupTheory/SemidirectProduct.lean b/Mathlib/GroupTheory/SemidirectProduct.lean index ddee196e624254..2147811b451d33 100644 --- a/Mathlib/GroupTheory/SemidirectProduct.lean +++ b/Mathlib/GroupTheory/SemidirectProduct.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.GroupTheory.Complement +module + +public import Mathlib.GroupTheory.Complement /-! # Semidirect product @@ -28,6 +30,8 @@ This file introduces the global notation `N ⋊[φ] G` for `SemidirectProduct N group, semidirect product -/ +@[expose] public section + open Subgroup variable (N : Type*) (G : Type*) {H : Type*} [Group N] [Group G] [Group H] diff --git a/Mathlib/GroupTheory/Solvable.lean b/Mathlib/GroupTheory/Solvable.lean index 3cad7cce836f55..fcd128f2cb25e0 100644 --- a/Mathlib/GroupTheory/Solvable.lean +++ b/Mathlib/GroupTheory/Solvable.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Jordan Brown, Thomas Browning, Patrick Lutz. All rights reser Released under Apache 2.0 license as described in the file LICENSE. Authors: Jordan Brown, Thomas Browning, Patrick Lutz -/ -import Mathlib.Data.Fin.VecNotation -import Mathlib.GroupTheory.Abelianization.Defs -import Mathlib.GroupTheory.Perm.ViaEmbedding -import Mathlib.GroupTheory.Subgroup.Simple -import Mathlib.SetTheory.Cardinal.Order +module + +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.GroupTheory.Abelianization.Defs +public import Mathlib.GroupTheory.Perm.ViaEmbedding +public import Mathlib.GroupTheory.Subgroup.Simple +public import Mathlib.SetTheory.Cardinal.Order /-! # Solvable Groups @@ -23,6 +25,8 @@ the derived series of a group. * `IsSolvable G` : the group `G` is solvable -/ +@[expose] public section + open Subgroup variable {G G' : Type*} [Group G] [Group G'] {f : G →* G'} diff --git a/Mathlib/GroupTheory/SpecificGroups/Alternating.lean b/Mathlib/GroupTheory/SpecificGroups/Alternating.lean index 53f3e202ca5133..7c6247cc91a959 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Alternating.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Alternating.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Antoine Chambert-Loir -/ -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Data.Fintype.Units -import Mathlib.GroupTheory.IndexNormal -import Mathlib.GroupTheory.Perm.Fin -import Mathlib.GroupTheory.Subgroup.Simple -import Mathlib.Logic.Equiv.Fin.Rotate -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Data.Fintype.Units +public import Mathlib.GroupTheory.IndexNormal +public import Mathlib.GroupTheory.Perm.Fin +public import Mathlib.GroupTheory.Subgroup.Simple +public import Mathlib.Logic.Equiv.Fin.Rotate +public import Mathlib.Tactic.IntervalCases /-! # Alternating Groups @@ -56,6 +58,8 @@ alternating group permutation simple characteristic index -/ +@[expose] public section + -- An example on how to determine the order of an element of a finite group. example : orderOf (-1 : ℤˣ) = 2 := orderOf_eq_prime (Int.units_sq _) (by decide) @@ -162,8 +166,7 @@ theorem isConj_of {σ τ : alternatingGroup α} (hc : IsConj (σ : Perm α) (τ rw [disjoint_iff_disjoint_support, support_swap ab, Finset.disjoint_insert_left, Finset.disjoint_singleton_left] exact ⟨Finset.mem_compl.1 ha, Finset.mem_compl.1 hb⟩ - rw [mul_assoc π _ σ, hd.commute.eq, coe_inv, coe_mk] - simp [mul_assoc] + simp [mul_assoc, hd.commute.eq] theorem isThreeCycle_isConj (h5 : 5 ≤ Fintype.card α) {σ τ : alternatingGroup α} (hσ : IsThreeCycle (σ : Perm α)) (hτ : IsThreeCycle (τ : Perm α)) : IsConj σ τ := diff --git a/Mathlib/GroupTheory/SpecificGroups/Alternating/Centralizer.lean b/Mathlib/GroupTheory/SpecificGroups/Alternating/Centralizer.lean index 19b70d867d1b0f..c20d1e1aea2520 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Alternating/Centralizer.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Alternating/Centralizer.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.GroupTheory.Perm.Centralizer -import Mathlib.GroupTheory.SpecificGroups.Alternating +module + +public import Mathlib.GroupTheory.Perm.Centralizer +public import Mathlib.GroupTheory.SpecificGroups.Alternating /-! # Centralizer of an element in the alternating group @@ -33,6 +35,8 @@ Deduce the formula for the cardinality of the centralizers and conjugacy classes in `alternatingGroup α`. -/ +@[expose] public section + open Equiv Finset Function MulAction variable {α : Type*} [Fintype α] [DecidableEq α] {g : Perm α} diff --git a/Mathlib/GroupTheory/SpecificGroups/Alternating/KleinFour.lean b/Mathlib/GroupTheory/SpecificGroups/Alternating/KleinFour.lean index dda1cc699e877a..60ce120c668969 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Alternating/KleinFour.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Alternating/KleinFour.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.GroupTheory.SpecificGroups.Alternating.Centralizer -import Mathlib.GroupTheory.SpecificGroups.KleinFour -import Mathlib.GroupTheory.Sylow +public import Mathlib.GroupTheory.SpecificGroups.Alternating.Centralizer +public import Mathlib.GroupTheory.SpecificGroups.KleinFour +public import Mathlib.GroupTheory.Sylow /-! # The Klein Four subgroup of an alternating group on 4 letters @@ -50,6 +51,8 @@ without any assumption on `Nat.card α`. -/ +@[expose] public section + namespace alternatingGroup open Equiv.Perm Equiv diff --git a/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean b/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean index 0abe992edcd52f..0aee80d461d895 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.Algebra.Order.Hom.TypeTags -import Mathlib.Data.Nat.Totient -import Mathlib.Data.ZMod.Aut -import Mathlib.Data.ZMod.QuotientGroup -import Mathlib.GroupTheory.Exponent -import Mathlib.GroupTheory.Subgroup.Simple -import Mathlib.Tactic.Group +module + +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.Algebra.Order.Hom.TypeTags +public import Mathlib.Data.Nat.Totient +public import Mathlib.Data.ZMod.Aut +public import Mathlib.Data.ZMod.QuotientGroup +public import Mathlib.GroupTheory.Exponent +public import Mathlib.GroupTheory.Subgroup.Simple +public import Mathlib.Tactic.Group /-! # Cyclic groups @@ -39,6 +41,8 @@ For the concrete cyclic group of order `n`, see `Data.ZMod.Basic`. cyclic group -/ +@[expose] public section + assert_not_exists Ideal TwoSidedIdeal variable {α G G' : Type*} {a : α} diff --git a/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean b/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean index 4f4e46bd5482d1..6a9412041996e9 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Shing Tak Lam. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shing Tak Lam -/ -import Mathlib.Data.Finite.Sum -import Mathlib.Data.ZMod.Basic -import Mathlib.GroupTheory.Exponent -import Mathlib.GroupTheory.GroupAction.CardCommute -import Mathlib.GroupTheory.SpecificGroups.Cyclic -import Mathlib.GroupTheory.SpecificGroups.KleinFour +module + +public import Mathlib.Data.Finite.Sum +public import Mathlib.Data.ZMod.Basic +public import Mathlib.GroupTheory.Exponent +public import Mathlib.GroupTheory.GroupAction.CardCommute +public import Mathlib.GroupTheory.SpecificGroups.Cyclic +public import Mathlib.GroupTheory.SpecificGroups.KleinFour /-! # Dihedral Groups @@ -20,6 +22,8 @@ represents the rotations of the `n`-gon by `2πi/n`, and `sr i` represents the r `n`-gon. `DihedralGroup 0` corresponds to the infinite dihedral group. -/ +@[expose] public section + assert_not_exists Ideal TwoSidedIdeal /-- For `n ≠ 0`, `DihedralGroup n` represents the symmetry group of the regular `n`-gon. diff --git a/Mathlib/GroupTheory/SpecificGroups/KleinFour.lean b/Mathlib/GroupTheory/SpecificGroups/KleinFour.lean index e13dfa85dd0665..df592bee554ceb 100644 --- a/Mathlib/GroupTheory/SpecificGroups/KleinFour.lean +++ b/Mathlib/GroupTheory/SpecificGroups/KleinFour.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Newell Jensen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Newell Jensen -/ -import Mathlib.GroupTheory.SpecificGroups.Cyclic +module + +public import Mathlib.GroupTheory.SpecificGroups.Cyclic /-! # Klein Four Group @@ -39,7 +41,9 @@ produces the third one. non-cyclic abelian group -/ -/-! # Klein four-groups as a mixin class -/ +@[expose] public section + +/-! ### Klein four-groups as a mixin class -/ /-- An (additive) Klein four-group is an (additive) group of cardinality four and exponent two. -/ class IsAddKleinFour (G : Type*) [AddGroup G] : Prop where diff --git a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean index 394f4e6d4152b2..a0c139d17e265b 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.GroupTheory.SpecificGroups.Cyclic -import Mathlib.GroupTheory.SpecificGroups.Dihedral +module + +public import Mathlib.GroupTheory.SpecificGroups.Cyclic +public import Mathlib.GroupTheory.SpecificGroups.Dihedral /-! # Quaternion Groups @@ -40,6 +42,8 @@ Show that `QuaternionGroup 2 ≃* (Quaternion ℤ)ˣ`. -/ +@[expose] public section + /-- The (generalised) quaternion group `QuaternionGroup n` of order `4n`. It can be defined by the presentation $\langle a, x | a^{2n} = 1, x^2 = a^n, x^{-1}ax=a^{-1}\rangle$. We write `a i` for diff --git a/Mathlib/GroupTheory/SpecificGroups/ZGroup.lean b/Mathlib/GroupTheory/SpecificGroups/ZGroup.lean index bb31029d75c5e4..6415303e50f5d0 100644 --- a/Mathlib/GroupTheory/SpecificGroups/ZGroup.lean +++ b/Mathlib/GroupTheory/SpecificGroups/ZGroup.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.GroupTheory.Abelianization.Finite -import Mathlib.GroupTheory.Nilpotent -import Mathlib.GroupTheory.SchurZassenhaus -import Mathlib.GroupTheory.SemidirectProduct +module + +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.GroupTheory.Abelianization.Finite +public import Mathlib.GroupTheory.Nilpotent +public import Mathlib.GroupTheory.SchurZassenhaus +public import Mathlib.GroupTheory.SemidirectProduct /-! # Z-Groups @@ -29,6 +31,8 @@ A Z-group is a group whose Sylow subgroups are all cyclic. -/ +@[expose] public section + variable (G G' G'' : Type*) [Group G] [Group G'] [Group G''] (f : G →* G') (f' : G' →* G'') /-- A Z-group is a group whose Sylow subgroups are all cyclic. -/ diff --git a/Mathlib/GroupTheory/Subgroup/Center.lean b/Mathlib/GroupTheory/Subgroup/Center.lean index 8f1ac9e9f0a4d9..1369b740729004 100644 --- a/Mathlib/GroupTheory/Subgroup/Center.lean +++ b/Mathlib/GroupTheory/Subgroup/Center.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.GroupTheory.Submonoid.Center +module + +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.GroupTheory.Submonoid.Center /-! # Centers of subgroups -/ +@[expose] public section + assert_not_exists MonoidWithZero Multiset variable {G : Type*} [Group G] diff --git a/Mathlib/GroupTheory/Subgroup/Centralizer.lean b/Mathlib/GroupTheory/Subgroup/Centralizer.lean index 780f1881f1a5f4..797290474b8b66 100644 --- a/Mathlib/GroupTheory/Subgroup/Centralizer.lean +++ b/Mathlib/GroupTheory/Subgroup/Centralizer.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Group.Action.End -import Mathlib.GroupTheory.Subgroup.Center -import Mathlib.GroupTheory.Submonoid.Centralizer +module + +public import Mathlib.Algebra.Group.Action.End +public import Mathlib.GroupTheory.Subgroup.Center +public import Mathlib.GroupTheory.Submonoid.Centralizer /-! # Centralizers of subgroups -/ +@[expose] public section + assert_not_exists MonoidWithZero variable {G G' : Type*} [Group G] [Group G'] diff --git a/Mathlib/GroupTheory/Subgroup/Saturated.lean b/Mathlib/GroupTheory/Subgroup/Saturated.lean index 9bbcb4137b5a85..dd845c1e97bc49 100644 --- a/Mathlib/GroupTheory/Subgroup/Saturated.lean +++ b/Mathlib/GroupTheory/Subgroup/Saturated.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Subgroup.Ker +module + +public import Mathlib.Algebra.Group.Subgroup.Ker /-! # Saturated subgroups @@ -13,6 +15,8 @@ subgroup, subgroups -/ +@[expose] public section + namespace Subgroup diff --git a/Mathlib/GroupTheory/Subgroup/Simple.lean b/Mathlib/GroupTheory/Subgroup/Simple.lean index d8966898805304..b93616e5aa6cfa 100644 --- a/Mathlib/GroupTheory/Subgroup/Simple.lean +++ b/Mathlib/GroupTheory/Subgroup/Simple.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Order.Atoms -import Mathlib.Algebra.Group.Subgroup.Basic +module + +public import Mathlib.Order.Atoms +public import Mathlib.Algebra.Group.Subgroup.Basic /-! # Simple groups @@ -21,6 +23,8 @@ subgroup, subgroups -/ +@[expose] public section + variable {G : Type*} [Group G] variable {A : Type*} [AddGroup A] diff --git a/Mathlib/GroupTheory/Submonoid/Center.lean b/Mathlib/GroupTheory/Submonoid/Center.lean index 0ac14d0564d3e8..98dd2e51f50dcf 100644 --- a/Mathlib/GroupTheory/Submonoid/Center.lean +++ b/Mathlib/GroupTheory/Submonoid/Center.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Submonoid.Operations -import Mathlib.GroupTheory.Subsemigroup.Center +module + +public import Mathlib.Algebra.Group.Submonoid.Operations +public import Mathlib.GroupTheory.Subsemigroup.Center /-! # Centers of monoids @@ -18,6 +20,8 @@ We provide `Subgroup.center`, `AddSubgroup.center`, `Subsemiring.center`, and `S other files. -/ +@[expose] public section + -- Guard against import creep assert_not_exists Finset diff --git a/Mathlib/GroupTheory/Submonoid/Centralizer.lean b/Mathlib/GroupTheory/Submonoid/Centralizer.lean index 13e6c68e028740..21061ab09cb5ca 100644 --- a/Mathlib/GroupTheory/Submonoid/Centralizer.lean +++ b/Mathlib/GroupTheory/Submonoid/Centralizer.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.GroupTheory.Subsemigroup.Centralizer -import Mathlib.GroupTheory.Submonoid.Center +module + +public import Mathlib.GroupTheory.Subsemigroup.Centralizer +public import Mathlib.GroupTheory.Submonoid.Center /-! # Centralizers of magmas and monoids @@ -17,6 +19,8 @@ import Mathlib.GroupTheory.Submonoid.Center We provide `Subgroup.centralizer`, `AddSubgroup.centralizer` in other files. -/ +@[expose] public section + -- Guard against import creep assert_not_exists Finset diff --git a/Mathlib/GroupTheory/Submonoid/Inverses.lean b/Mathlib/GroupTheory/Submonoid/Inverses.lean index be4eb939e8065c..57f49373893c01 100644 --- a/Mathlib/GroupTheory/Submonoid/Inverses.lean +++ b/Mathlib/GroupTheory/Submonoid/Inverses.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Group.Submonoid.Pointwise +module + +public import Mathlib.Algebra.Group.Submonoid.Pointwise /-! @@ -28,6 +30,8 @@ See the comments of https://github.com/leanprover-community/mathlib4/pull/10679 implementation. -/ +@[expose] public section + variable {M : Type*} diff --git a/Mathlib/GroupTheory/Subsemigroup/Center.lean b/Mathlib/GroupTheory/Subsemigroup/Center.lean index 9528805ae66835..fed5a6bcea1bec 100644 --- a/Mathlib/GroupTheory/Subsemigroup/Center.lean +++ b/Mathlib/GroupTheory/Subsemigroup/Center.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Center -import Mathlib.Algebra.Group.Subsemigroup.Defs +module + +public import Mathlib.Algebra.Group.Center +public import Mathlib.Algebra.Group.Subsemigroup.Defs /-! # Centers of semigroups, as subsemigroups. @@ -23,6 +25,8 @@ We provide `Submonoid.center`, `AddSubmonoid.center`, `Subgroup.center`, `AddSub [cabreragarciarodriguezpalacios2014] -/ +@[expose] public section + assert_not_exists RelIso Finset /-! ### `Set.center` as a `Subsemigroup`. -/ diff --git a/Mathlib/GroupTheory/Subsemigroup/Centralizer.lean b/Mathlib/GroupTheory/Subsemigroup/Centralizer.lean index ad2fcd8423a13f..17f1bc52a87f6b 100644 --- a/Mathlib/GroupTheory/Subsemigroup/Centralizer.lean +++ b/Mathlib/GroupTheory/Subsemigroup/Centralizer.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Jireh Loreaux -/ -import Mathlib.Algebra.Group.Center -import Mathlib.Algebra.Group.Subsemigroup.Basic -import Mathlib.GroupTheory.Subsemigroup.Center +module + +public import Mathlib.Algebra.Group.Center +public import Mathlib.Algebra.Group.Subsemigroup.Basic +public import Mathlib.GroupTheory.Subsemigroup.Center /-! # Centralizers in semigroups, as subsemigroups. @@ -19,6 +21,8 @@ We provide `Monoid.centralizer`, `AddMonoid.centralizer`, `Subgroup.centralizer` `AddSubgroup.centralizer` in other files. -/ +@[expose] public section + -- Guard against import creep assert_not_exists Finset diff --git a/Mathlib/GroupTheory/Sylow.lean b/Mathlib/GroupTheory/Sylow.lean index 2e1288eaa0c9a1..5c31ef32da6024 100644 --- a/Mathlib/GroupTheory/Sylow.lean +++ b/Mathlib/GroupTheory/Sylow.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Thomas Browning -/ -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Data.SetLike.Fintype -import Mathlib.GroupTheory.PGroup -import Mathlib.GroupTheory.NoncommPiCoprod +module + +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Data.SetLike.Fintype +public import Mathlib.GroupTheory.PGroup +public import Mathlib.GroupTheory.NoncommPiCoprod /-! # Sylow theorems @@ -38,6 +40,8 @@ The Sylow theorems are the following results for every finite group `G` and ever If the number of Sylow `p`-subgroups is finite, then it is congruent to `1` modulo `p`. -/ +@[expose] public section + open MulAction Subgroup diff --git a/Mathlib/GroupTheory/Torsion.lean b/Mathlib/GroupTheory/Torsion.lean index e58a3ee713b83e..a29df70e080c29 100644 --- a/Mathlib/GroupTheory/Torsion.lean +++ b/Mathlib/GroupTheory/Torsion.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Julian Berman. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Berman -/ -import Mathlib.GroupTheory.PGroup -import Mathlib.LinearAlgebra.Quotient.Defs +module + +public import Mathlib.GroupTheory.PGroup +public import Mathlib.LinearAlgebra.Quotient.Defs /-! # Torsion groups @@ -38,6 +40,8 @@ periodic group, aperiodic group, torsion subgroup, torsion abelian group * groups which are residually finite p-groups with respect to 2 distinct primes are torsion free -/ +@[expose] public section + variable {G H : Type*} diff --git a/Mathlib/GroupTheory/Transfer.lean b/Mathlib/GroupTheory/Transfer.lean index 87f0fda4636da5..b6b5d548229847 100644 --- a/Mathlib/GroupTheory/Transfer.lean +++ b/Mathlib/GroupTheory/Transfer.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.GroupTheory.Complement -import Mathlib.GroupTheory.Sylow +module + +public import Mathlib.GroupTheory.Complement +public import Mathlib.GroupTheory.Sylow /-! # The Transfer Homomorphism @@ -24,6 +26,8 @@ In this file we construct the transfer homomorphism. If `hP : N(P) ≤ C(P)`, then `(transfer P hP).ker` is a normal `p`-complement. -/ +@[expose] public section + variable {G : Type*} [Group G] {H : Subgroup G} {A : Type*} [CommGroup A] (ϕ : H →* A) diff --git a/Mathlib/InformationTheory/Hamming.lean b/Mathlib/InformationTheory/Hamming.lean index 44de1cd450b989..386a690c57702b 100644 --- a/Mathlib/InformationTheory/Hamming.lean +++ b/Mathlib/InformationTheory/Hamming.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Wrenna Robson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wrenna Robson -/ -import Mathlib.Analysis.Normed.Group.Basic +module + +public import Mathlib.Analysis.Normed.Group.Basic /-! # Hamming spaces @@ -25,6 +27,8 @@ code. * the Hamming norm forms a normed group on `Hamming β`. -/ +@[expose] public section + section HammingDistNorm diff --git a/Mathlib/InformationTheory/KullbackLeibler/Basic.lean b/Mathlib/InformationTheory/KullbackLeibler/Basic.lean index 0c6b39d6e23e74..4586a40a69c4c4 100644 --- a/Mathlib/InformationTheory/KullbackLeibler/Basic.lean +++ b/Mathlib/InformationTheory/KullbackLeibler/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.InformationTheory.KullbackLeibler.KLFun -import Mathlib.MeasureTheory.Measure.Decomposition.IntegralRNDeriv +module + +public import Mathlib.InformationTheory.KullbackLeibler.KLFun +public import Mathlib.MeasureTheory.Measure.Decomposition.IntegralRNDeriv /-! # Kullback-Leibler divergence @@ -40,6 +42,8 @@ measures `μ ≪ ν`. This also makes `klDiv μ ν` equal to an f-divergence: it -/ +@[expose] public section + open Real MeasureTheory Set open scoped ENNReal diff --git a/Mathlib/InformationTheory/KullbackLeibler/KLFun.lean b/Mathlib/InformationTheory/KullbackLeibler/KLFun.lean index 97822309dfe0f2..aa5971941fd83e 100644 --- a/Mathlib/InformationTheory/KullbackLeibler/KLFun.lean +++ b/Mathlib/InformationTheory/KullbackLeibler/KLFun.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog -import Mathlib.MeasureTheory.Measure.Decomposition.IntegralRNDeriv -import Mathlib.MeasureTheory.Measure.LogLikelihoodRatio +module + +public import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +public import Mathlib.MeasureTheory.Measure.Decomposition.IntegralRNDeriv +public import Mathlib.MeasureTheory.Measure.LogLikelihoodRatio /-! # The real function `fun x ↦ x * log x + 1 - x` @@ -38,6 +40,8 @@ This is a continuous nonnegative, strictly convex function on [0,∞), with mini -/ +@[expose] public section + open Real MeasureTheory Filter Set namespace InformationTheory diff --git a/Mathlib/Init.lean b/Mathlib/Init.lean index 2d3e62f3c3edff..c9ac80b435873d 100644 --- a/Mathlib/Init.lean +++ b/Mathlib/Init.lean @@ -1,26 +1,28 @@ -import Lean.Linter.Sets -- for the definition of linter sets -import Mathlib.Tactic.Linter.CommandStart -import Mathlib.Tactic.Linter.DeprecatedSyntaxLinter -import Mathlib.Tactic.Linter.DirectoryDependency -import Mathlib.Tactic.Linter.DocPrime -import Mathlib.Tactic.Linter.DocString -import Mathlib.Tactic.Linter.GlobalAttributeIn -import Mathlib.Tactic.Linter.HashCommandLinter -import Mathlib.Tactic.Linter.Header +module + +public import Lean.Linter.Sets -- for the definition of linter sets +public import Mathlib.Tactic.Linter.CommandStart +public import Mathlib.Tactic.Linter.DeprecatedSyntaxLinter +public import Mathlib.Tactic.Linter.DirectoryDependency +public import Mathlib.Tactic.Linter.DocPrime +public import Mathlib.Tactic.Linter.DocString +public import Mathlib.Tactic.Linter.GlobalAttributeIn +public import Mathlib.Tactic.Linter.HashCommandLinter +public import Mathlib.Tactic.Linter.Header -- This linter is disabled by default, but downstream projects may want to enable it: -- to facilitate this, we import the linter here. -import Mathlib.Tactic.Linter.FlexibleLinter +public import Mathlib.Tactic.Linter.FlexibleLinter -- This file imports Batteries.Tactic.Lint, where the `env_linter` attribute is defined. -import Mathlib.Tactic.Linter.Lint -import Mathlib.Tactic.Linter.Multigoal -import Mathlib.Tactic.Linter.OldObtain +public import Mathlib.Tactic.Linter.Lint +public import Mathlib.Tactic.Linter.Multigoal +public import Mathlib.Tactic.Linter.OldObtain -- The following import contains the environment extension for the unused tactic linter. -import Mathlib.Tactic.Linter.UnusedTacticExtension -import Mathlib.Tactic.Linter.UnusedTactic -import Mathlib.Tactic.Linter.Style +public import Mathlib.Tactic.Linter.UnusedTacticExtension +public import Mathlib.Tactic.Linter.UnusedTactic +public import Mathlib.Tactic.Linter.Style -- This import makes the `#min_imports` command available globally. -import Mathlib.Tactic.MinImports -import Mathlib.Tactic.TacticAnalysis.Declarations +public import Mathlib.Tactic.MinImports +public import Mathlib.Tactic.TacticAnalysis.Declarations /-! This is the root file in Mathlib: it is imported by virtually *all* Mathlib files. @@ -53,6 +55,8 @@ All linters imported here have no bulk imports; -/ +@[expose] public section + /-- Define a linter set of all mathlib syntax linters which are enabled by default. Projects depending on mathlib can use `set_option linter.allMathlibLinters true` to enable diff --git a/Mathlib/Lean/ContextInfo.lean b/Mathlib/Lean/ContextInfo.lean index 1592308f4d482e..4d86fd8db12d97 100644 --- a/Mathlib/Lean/ContextInfo.lean +++ b/Mathlib/Lean/ContextInfo.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ +module -import Mathlib.Lean.Elab.Tactic.Meta +public meta import Mathlib.Lean.Elab.Tactic.Meta -- Import this linter explicitly to ensure that -- this file has a valid copyright header and module docstring. -import Mathlib.Tactic.Linter.Header +public import Mathlib.Tactic.Linter.Header /-! # Executing actions using the infotree @@ -15,6 +16,8 @@ This file contains helper functions for running `CoreM`, `MetaM` and tactic acti in the context of an infotree node. -/ +@[expose] public meta section + open Lean Elab Term Command Linter namespace Lean.Elab.ContextInfo @@ -72,7 +75,7 @@ def runTactic (ctx : ContextInfo) (i : TacticInfo) (goal : MVarId) (x : MVarId panic!"ContextInfo.runTactic: `goal` must be an element of `i.goalsBefore`" let mctx := i.mctxBefore let lctx := (mctx.decls.find! goal).2 - ctx.runMetaMWithMessages lctx <| do + ctx.runMetaMWithMessages lctx do -- Make a fresh metavariable because the original goal is already assigned. let type ← goal.getType let goal ← Meta.mkFreshExprSyntheticOpaqueMVar type diff --git a/Mathlib/Lean/CoreM.lean b/Mathlib/Lean/CoreM.lean index 0907ce2bf449be..3793fc69a3f6b9 100644 --- a/Mathlib/Lean/CoreM.lean +++ b/Mathlib/Lean/CoreM.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! # Additional functions using `CoreM` state. -/ +@[expose] public section + open Lean Core /-- diff --git a/Mathlib/Lean/Elab/InfoTree.lean b/Mathlib/Lean/Elab/InfoTree.lean index 733bec0c827e85..07e0ea0f4c917f 100644 --- a/Mathlib/Lean/Elab/InfoTree.lean +++ b/Mathlib/Lean/Elab/InfoTree.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Marc Huisinga. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Marc Huisinga -/ -import Mathlib.Init -import Lean.Server.InfoUtils -import Lean.Meta.TryThis +module + +public import Mathlib.Init +public import Lean.Server.InfoUtils +public import Lean.Meta.TryThis /-! # Additions to `Lean.Elab.InfoTree.Main` -/ +@[expose] public section + namespace Lean.Elab open Lean.Meta diff --git a/Mathlib/Lean/Elab/Tactic/Basic.lean b/Mathlib/Lean/Elab/Tactic/Basic.lean index c5f0229655d071..ab6ba3d161b689 100644 --- a/Mathlib/Lean/Elab/Tactic/Basic.lean +++ b/Mathlib/Lean/Elab/Tactic/Basic.lean @@ -3,11 +3,15 @@ Copyright (c) 2023 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Jon Eugster -/ -import Mathlib.Lean.Meta +module + +public import Mathlib.Lean.Meta /-! # Additions to `Lean.Elab.Tactic.Basic` -/ +@[expose] public section + open Lean Elab Tactic namespace Lean.Elab.Tactic diff --git a/Mathlib/Lean/Elab/Tactic/Meta.lean b/Mathlib/Lean/Elab/Tactic/Meta.lean index 3d08c7590b21f1..ba6f1cbd0f2cb4 100644 --- a/Mathlib/Lean/Elab/Tactic/Meta.lean +++ b/Mathlib/Lean/Elab/Tactic/Meta.lean @@ -3,15 +3,19 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Lean.Elab.SyntheticMVars +module + +public import Lean.Elab.SyntheticMVars -- Import this linter explicitly to ensure that -- this file has a valid copyright header and module docstring. -import Mathlib.Tactic.Linter.Header +public import Mathlib.Tactic.Linter.Header /-! # Additions to `Lean.Elab.Tactic.Meta` -/ +@[expose] public section + namespace Lean.Elab open Term diff --git a/Mathlib/Lean/Elab/Term.lean b/Mathlib/Lean/Elab/Term.lean index 88069b18f506eb..3425337b1c1b0b 100644 --- a/Mathlib/Lean/Elab/Term.lean +++ b/Mathlib/Lean/Elab/Term.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Init -import Lean.Elab.Term +module + +public import Mathlib.Init +public import Lean.Elab.Term /-! # Additions to `Lean.Elab.Term` -/ +public meta section + namespace Lean.Elab.Term /-- Fully elaborates the term `patt`, allowing typeclass inference failure, diff --git a/Mathlib/Lean/EnvExtension.lean b/Mathlib/Lean/EnvExtension.lean index 6ca1adad43b48c..301e6969f9d395 100644 --- a/Mathlib/Lean/EnvExtension.lean +++ b/Mathlib/Lean/EnvExtension.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Init -import Lean.ScopedEnvExtension +module + +public import Mathlib.Init +public import Lean.ScopedEnvExtension /-! # Helper function for environment extensions and attributes. -/ +@[expose] public section + open Lean instance {σ : Type} [Inhabited σ] : Inhabited (ScopedEnvExtension.State σ) := ⟨{state := default}⟩ diff --git a/Mathlib/Lean/Exception.lean b/Mathlib/Lean/Exception.lean index c15fad88d8c233..103a29b56e6e9f 100644 --- a/Mathlib/Lean/Exception.lean +++ b/Mathlib/Lean/Exception.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Edward Ayers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Edward Ayers -/ -import Mathlib.Init -import Lean.Exception +module + +public import Mathlib.Init +public import Lean.Exception /-! # Additional methods for working with `Exception`s @@ -15,6 +17,8 @@ This file contains two additional methods for working with `Exception`s -/ +@[expose] public section + open Lean /-- diff --git a/Mathlib/Lean/Expr.lean b/Mathlib/Lean/Expr.lean index fa0ec85aea5d0d..7dab2ff00cd379 100644 --- a/Mathlib/Lean/Expr.lean +++ b/Mathlib/Lean/Expr.lean @@ -3,5 +3,7 @@ Copyright (c) 2019 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Simon Hudon, Kim Morrison, Keeley Hoek, Robert Y. Lewis, Floris van Doorn -/ -import Mathlib.Lean.Expr.Basic -import Mathlib.Lean.Expr.ReplaceRec +module + +public import Mathlib.Lean.Expr.Basic +public import Mathlib.Lean.Expr.ReplaceRec diff --git a/Mathlib/Lean/Expr/Basic.lean b/Mathlib/Lean/Expr/Basic.lean index 2deed8b74bb4c5..10b051722af1a9 100644 --- a/Mathlib/Lean/Expr/Basic.lean +++ b/Mathlib/Lean/Expr/Basic.lean @@ -4,8 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Simon Hudon, Kim Morrison, Keeley Hoek, Robert Y. Lewis, Floris van Doorn, Edward Ayers, Arthur Paulino -/ -import Mathlib.Init -import Lean.Expr +module + +public import Mathlib.Init +public import Lean.Meta.Tactic.Rewrite +public import Batteries.Tactic.Alias +public import Lean.Elab.Binders /-! # Additional operations on Expr and related types @@ -15,6 +19,8 @@ This file defines basic operations on the types expr, name, declaration, level, This file is mostly for non-tactics. -/ +public section + namespace Lean namespace BinderInfo diff --git a/Mathlib/Lean/Expr/ExtraRecognizers.lean b/Mathlib/Lean/Expr/ExtraRecognizers.lean index b8ca5f661228f6..096e877f6586c7 100644 --- a/Mathlib/Lean/Expr/ExtraRecognizers.lean +++ b/Mathlib/Lean/Expr/ExtraRecognizers.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Data.Set.Operations +module + +public import Mathlib.Data.Set.Operations /-! # Additional Expr recognizers needing theory imports -/ +@[expose] public section + namespace Lean.Expr /-- If `e` is a coercion of a set to a type, return the set. diff --git a/Mathlib/Lean/Expr/Rat.lean b/Mathlib/Lean/Expr/Rat.lean index 78660ddc1f3d6f..cef2945e603ec9 100644 --- a/Mathlib/Lean/Expr/Rat.lean +++ b/Mathlib/Lean/Expr/Rat.lean @@ -3,7 +3,11 @@ Copyright (c) 2019 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison -/ -import Mathlib.Init +module + +public import Mathlib.Init +public import Batteries.Tactic.Alias +public import Lean.ToExpr /-! # Additional operations on Expr and rational numbers @@ -16,6 +20,8 @@ This file defines some operations involving `Expr` and rational numbers. This includes natural numbers, integers and rationals. -/ +public section + open Lean in instance : ToExpr Rat where toExpr q := mkApp2 (.const ``mkRat []) (toExpr q.num) (toExpr q.den) diff --git a/Mathlib/Lean/Expr/ReplaceRec.lean b/Mathlib/Lean/Expr/ReplaceRec.lean index d2959f458d8d6f..42cfe50d5ac977 100644 --- a/Mathlib/Lean/Expr/ReplaceRec.lean +++ b/Mathlib/Lean/Expr/ReplaceRec.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Simon Hudon, Kim Morrison, Keeley Hoek, Robert Y. Lewis, Floris van Doorn, Edward Ayers -/ -import Lean.Expr -import Mathlib.Util.MemoFix +module + +public import Lean.Expr +public import Mathlib.Util.MemoFix /-! # ReplaceRec @@ -14,6 +16,8 @@ We define a more flexible version of `Expr.replace` where we can use recursive c replacing a subexpression. We completely mimic the implementation of `Expr.replace`. -/ +@[expose] public section + namespace Lean.Expr /-- A version of `Expr.replace` where the replacement function is available to the function `f?`. diff --git a/Mathlib/Lean/GoalsLocation.lean b/Mathlib/Lean/GoalsLocation.lean index 75ee5eb2f8049c..0a9b5029973601 100644 --- a/Mathlib/Lean/GoalsLocation.lean +++ b/Mathlib/Lean/GoalsLocation.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Init -import Lean.Meta.Tactic.Util -import Lean.SubExpr +module + +public import Mathlib.Init +public import Lean.Meta.Tactic.Util +public import Lean.SubExpr /-! This file defines some functions for dealing with `SubExpr.GoalsLocation`. -/ +@[expose] public section + namespace Lean.SubExpr.GoalsLocation /-- The root expression of the position specified by the `GoalsLocation`. -/ def rootExpr : GoalsLocation → MetaM Expr diff --git a/Mathlib/Lean/Json.lean b/Mathlib/Lean/Json.lean index f84d34f5241b49..7903247d29d243 100644 --- a/Mathlib/Lean/Json.lean +++ b/Mathlib/Lean/Json.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ +module -import Mathlib.Init +public import Mathlib.Init +import Lean.Data.Json.FromToJson.Basic /-! # Json serialization typeclass for `PUnit` & `Fin n` & `Subtype p` -/ +@[expose] public section + universe u diff --git a/Mathlib/Lean/LocalContext.lean b/Mathlib/Lean/LocalContext.lean index 3c410ec6b63e69..2023fca2d368f6 100644 --- a/Mathlib/Lean/LocalContext.lean +++ b/Mathlib/Lean/LocalContext.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init -import Lean.LocalContext +module + +public import Mathlib.Init +public import Lean.LocalContext /-! # Additional methods about `LocalContext` -/ +@[expose] public section + namespace Lean.LocalContext universe u v diff --git a/Mathlib/Lean/Message.lean b/Mathlib/Lean/Message.lean index 3df5f164b094dd..8f4ddf531e53d5 100644 --- a/Mathlib/Lean/Message.lean +++ b/Mathlib/Lean/Message.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Lean.Message -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Lean.Message +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-08-18") diff --git a/Mathlib/Lean/Meta.lean b/Mathlib/Lean/Meta.lean index 727a89660d801a..71f79d9ea497ef 100644 --- a/Mathlib/Lean/Meta.lean +++ b/Mathlib/Lean/Meta.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Init -import Lean.Elab.Term -import Lean.Elab.Tactic.Basic -import Lean.Meta.Tactic.Assert -import Lean.Meta.Tactic.Clear -import Batteries.CodeAction -- to enable the hole code action +module + +public import Mathlib.Init +public import Lean.Elab.Term +public import Lean.Elab.Tactic.Basic +public import Lean.Meta.Tactic.Assert +public import Lean.Meta.Tactic.Clear +public import Batteries.CodeAction -- to enable the hole code action /-! ## Additional utilities in `Lean.MVarId` -/ +public section + open Lean Meta namespace Lean.MVarId diff --git a/Mathlib/Lean/Meta/Basic.lean b/Mathlib/Lean/Meta/Basic.lean index 9835a8ca50ace1..5cc5e027a0b883 100644 --- a/Mathlib/Lean/Meta/Basic.lean +++ b/Mathlib/Lean/Meta/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init -import Lean.Meta.AppBuilder -import Lean.Meta.Basic +module + +public import Mathlib.Init +public import Lean.Meta.AppBuilder +public import Lean.Meta.Coe /-! # Additions to `Lean.Meta.Basic` @@ -13,6 +15,8 @@ import Lean.Meta.Basic Likely these already exist somewhere. Pointers welcome. -/ +@[expose] public section + /-- Restore the metavariable context after execution. -/ diff --git a/Mathlib/Lean/Meta/CongrTheorems.lean b/Mathlib/Lean/Meta/CongrTheorems.lean index 8f256107c47097..35c755f7ed39b9 100644 --- a/Mathlib/Lean/Meta/CongrTheorems.lean +++ b/Mathlib/Lean/Meta/CongrTheorems.lean @@ -3,14 +3,20 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Lean.Meta.Tactic.Cleanup -import Lean.Meta.Tactic.Refl -import Mathlib.Logic.IsEmpty +module + +public import Lean.Meta.Tactic.Cleanup +public import Lean.Meta.Tactic.Refl +public import Mathlib.Logic.IsEmpty +import Lean.Meta.Tactic.Cases +import Lean.Meta.CongrTheorems /-! # Additions to `Lean.Meta.CongrTheorems` -/ +@[expose] public section + namespace Lean.Meta initialize registerTraceClass `Meta.CongrTheorems diff --git a/Mathlib/Lean/Meta/DiscrTree.lean b/Mathlib/Lean/Meta/DiscrTree.lean index 586b3f28ad8c31..2a7ee03c46a053 100644 --- a/Mathlib/Lean/Meta/DiscrTree.lean +++ b/Mathlib/Lean/Meta/DiscrTree.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init -import Lean.Meta.DiscrTree +module + +public import Mathlib.Init +public import Lean.Meta.DiscrTree /-! # Additions to `Lean.Meta.DiscrTree` -/ +@[expose] public section + namespace Lean.Meta.DiscrTree /-- diff --git a/Mathlib/Lean/Meta/KAbstractPositions.lean b/Mathlib/Lean/Meta/KAbstractPositions.lean index 765b68d4af94d5..836b353cdcef16 100644 --- a/Mathlib/Lean/Meta/KAbstractPositions.lean +++ b/Mathlib/Lean/Meta/KAbstractPositions.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Init -import Lean.HeadIndex -import Lean.Meta.ExprLens -import Lean.Meta.Check +module + +public import Mathlib.Init +public import Lean.HeadIndex +public import Lean.Meta.ExprLens +public import Lean.Meta.Check /-! @@ -24,6 +26,8 @@ whether this is the case. -/ +@[expose] public section + namespace Lean.Meta /-- Return the positions that `kabstract` would abstract for pattern `p` in expression `e`. diff --git a/Mathlib/Lean/Meta/RefinedDiscrTree.lean b/Mathlib/Lean/Meta/RefinedDiscrTree.lean index 1d626165e799cb..8883644a83e5d9 100644 --- a/Mathlib/Lean/Meta/RefinedDiscrTree.lean +++ b/Mathlib/Lean/Meta/RefinedDiscrTree.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Lean.Meta.RefinedDiscrTree.Lookup -import Mathlib.Lean.Meta.RefinedDiscrTree.Initialize +module + +public import Mathlib.Lean.Meta.RefinedDiscrTree.Lookup +public import Mathlib.Lean.Meta.RefinedDiscrTree.Initialize /-! A discrimination tree for the purpose of unifying local expressions with library results. @@ -97,6 +99,8 @@ Improve the unification lookup. -/ +public section + namespace Lean.Meta.RefinedDiscrTree variable {α : Type} diff --git a/Mathlib/Lean/Meta/RefinedDiscrTree/Basic.lean b/Mathlib/Lean/Meta/RefinedDiscrTree/Basic.lean index 1df59dd61c0743..6aac2ad35342cb 100644 --- a/Mathlib/Lean/Meta/RefinedDiscrTree/Basic.lean +++ b/Mathlib/Lean/Meta/RefinedDiscrTree/Basic.lean @@ -3,7 +3,10 @@ Copyright (c) 2024 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Init +module + +public import Mathlib.Init +public import Lean.Meta /-! # Basic Definitions for `RefinedDiscrTree` @@ -16,6 +19,8 @@ We define * `RefinedDiscrTree`, the discrimination tree itself. -/ +@[expose] public section + namespace Lean.Meta.RefinedDiscrTree diff --git a/Mathlib/Lean/Meta/RefinedDiscrTree/Encode.lean b/Mathlib/Lean/Meta/RefinedDiscrTree/Encode.lean index 4c75d89a7d736e..6baef24ebebd58 100644 --- a/Mathlib/Lean/Meta/RefinedDiscrTree/Encode.lean +++ b/Mathlib/Lean/Meta/RefinedDiscrTree/Encode.lean @@ -3,8 +3,12 @@ Copyright (c) 2024 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Lean.Meta.RefinedDiscrTree.Basic -import Lean.Meta.DiscrTree +module + +public import Mathlib.Lean.Meta.RefinedDiscrTree.Basic +public import Lean.Meta.DiscrTree +public import Lean.Meta.LazyDiscrTree +import all Lean.Meta.DiscrTree /-! # Encoding an `Expr` as a sequence of `Key`s @@ -27,6 +31,8 @@ To compute all the keys at once, we have -/ +public section + namespace Lean.Meta.RefinedDiscrTree /-- The context for the `LazyM` monad -/ @@ -63,8 +69,6 @@ private def withLams (lambdas : List FVarId) (key : Key) : StateT LazyEntry Meta modify ({ · with computedKeys := tail.foldl (init := [key]) (fun _ => .lam :: ·) }) return .lam -open private toNatLit? from Lean.Meta.DiscrTree in - @[inline] private def encodingStepAux (e : Expr) (lambdas : List FVarId) (root : Bool) : LazyM Key := do withLams lambdas (← go) @@ -82,7 +86,7 @@ where match e.getAppFn with | .const n _ => unless root do - if let some v := toNatLit? e then + if let some v := LazyDiscrTree.MatchClone.toNatLit? e then return .lit v if e.getAppNumArgs != 0 then setEAsPrevious @@ -237,7 +241,7 @@ where /-- If `entry.previous.isSome`, then replace it with `none`, and add the required entries -to entry.stack`. +to `entry.stack`. -/ private def processPrevious (entry : LazyEntry) : MetaM LazyEntry := do let some { expr, bvars, lctx, localInsts, cfg } := entry.previous | return entry diff --git a/Mathlib/Lean/Meta/RefinedDiscrTree/Initialize.lean b/Mathlib/Lean/Meta/RefinedDiscrTree/Initialize.lean index 4f77fcb6e0b183..c7d0506df853b8 100644 --- a/Mathlib/Lean/Meta/RefinedDiscrTree/Initialize.lean +++ b/Mathlib/Lean/Meta/RefinedDiscrTree/Initialize.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Lean.Meta.RefinedDiscrTree.Basic -import Lean.Meta.CompletionName +module + +public import Mathlib.Lean.Meta.RefinedDiscrTree.Basic +public import Lean.Meta.CompletionName /-! # Constructing a RefinedDiscrTree @@ -22,6 +24,9 @@ There is also `createModuleDiscrTree` which does the same but with the constants from the current file. -/ + +public section + namespace Lean.Meta.RefinedDiscrTree variable {α : Type} @@ -161,12 +166,12 @@ private structure InitResults (α : Type) where namespace InitResults /-- Combine two initial results. -/ -protected def append (x y : InitResults α) : InitResults α := +private protected def append (x y : InitResults α) : InitResults α := let { tree := xv, errors := xe } := x let { tree := yv, errors := ye } := y { tree := xv ++ yv, errors := xe ++ ye } -instance : Append (InitResults α) where +private instance : Append (InitResults α) where append := InitResults.append end InitResults diff --git a/Mathlib/Lean/Meta/RefinedDiscrTree/Lookup.lean b/Mathlib/Lean/Meta/RefinedDiscrTree/Lookup.lean index b9ca85d58b7385..f3ea7a8a97b803 100644 --- a/Mathlib/Lean/Meta/RefinedDiscrTree/Lookup.lean +++ b/Mathlib/Lean/Meta/RefinedDiscrTree/Lookup.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Lean.Meta.RefinedDiscrTree.Encode +module + +public import Mathlib.Lean.Meta.RefinedDiscrTree.Encode /-! # Matching with a RefinedDiscrTree @@ -28,6 +30,8 @@ and when it is attempted to be assigned again, we check that it is the same assi -/ +public section + namespace Lean.Meta.RefinedDiscrTree variable {α β : Type} diff --git a/Mathlib/Lean/Meta/Simp.lean b/Mathlib/Lean/Meta/Simp.lean index 8e6222e4b0e4bf..fb965d0d50c044 100644 --- a/Mathlib/Lean/Meta/Simp.lean +++ b/Mathlib/Lean/Meta/Simp.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Gabriel Ebner, Floris van Doorn -/ -import Mathlib.Init -import Lean.Elab.Tactic.Simp +module + +public import Mathlib.Init +public import Lean.Elab.Tactic.Simp /-! # Helper functions for using the simplifier. @@ -12,6 +14,8 @@ import Lean.Elab.Tactic.Simp [TODO] Needs documentation, cleanup, and possibly reunification of `mkSimpContext'` with core. -/ +@[expose] public section + open Lean Elab.Tactic def Lean.PHashSet.toList.{u} {α : Type u} [BEq α] [Hashable α] (s : Lean.PHashSet α) : List α := diff --git a/Mathlib/Lean/Meta/Tactic/Rewrite.lean b/Mathlib/Lean/Meta/Tactic/Rewrite.lean index 2b883c139a1596..31bef06636dce8 100644 --- a/Mathlib/Lean/Meta/Tactic/Rewrite.lean +++ b/Mathlib/Lean/Meta/Tactic/Rewrite.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Patrick Massot, Kyle Miller -/ -import Mathlib.Init -import Lean.Meta.Tactic.Rewrite +module + +public import Mathlib.Init +public import Lean.Meta.Tactic.Rewrite /-! # Additional declarations for `Lean.Meta.Tactic.Rewrite` -/ +@[expose] public section + namespace Lean.Expr open Meta diff --git a/Mathlib/Lean/Name.lean b/Mathlib/Lean/Name.lean index c69d0bdcbd3667..f4b70ee1914fb3 100644 --- a/Mathlib/Lean/Name.lean +++ b/Mathlib/Lean/Name.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init -import Lean.Meta.Match.MatcherInfo -import Lean.Meta.Tactic.Delta -import Std.Data.HashMap.Basic +module + +public import Mathlib.Init +public import Lean.Meta.Match.MatcherInfo +public import Lean.Meta.Tactic.Delta +public import Std.Data.HashMap.Basic /-! # Additional functions on `Lean.Name`. @@ -14,6 +16,8 @@ import Std.Data.HashMap.Basic We provide `allNames` and `allNamesByModule`. -/ +public section + open Lean Meta Elab private def isBlackListed (declName : Name) : CoreM Bool := do diff --git a/Mathlib/Lean/PrettyPrinter/Delaborator.lean b/Mathlib/Lean/PrettyPrinter/Delaborator.lean index d4b9484a78e433..3468bd5eb3d0ab 100644 --- a/Mathlib/Lean/PrettyPrinter/Delaborator.lean +++ b/Mathlib/Lean/PrettyPrinter/Delaborator.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Init -import Lean.PrettyPrinter.Delaborator.Basic +module + +public import Mathlib.Init +public import Lean.PrettyPrinter.Delaborator.Basic /-! # Additions to the delaborator -/ +@[expose] public section + namespace Lean.PrettyPrinter.Delaborator open SubExpr diff --git a/Mathlib/Lean/Thunk.lean b/Mathlib/Lean/Thunk.lean index 879e16fd6ea380..265a3ad6906cd8 100644 --- a/Mathlib/Lean/Thunk.lean +++ b/Mathlib/Lean/Thunk.lean @@ -3,12 +3,16 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! # Basic facts about `Thunk`. -/ +@[expose] public section + namespace Thunk @[simp] theorem get_pure {α} (x : α) : (Thunk.pure x).get = x := rfl diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean index 19345d9d9816f0..28fb542adefb59 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.LinearAlgebra.AffineSpace.AffineMap -import Mathlib.LinearAlgebra.GeneralLinearGroup +module + +public import Mathlib.LinearAlgebra.AffineSpace.AffineMap +public import Mathlib.LinearAlgebra.GeneralLinearGroup /-! # Affine equivalences @@ -31,6 +33,8 @@ composition in `AffineEquiv.group`. affine space, affine equivalence -/ +@[expose] public section + open Function Set open Affine @@ -577,6 +581,48 @@ theorem coe_toAffineEquiv (e : V₁ ≃ₗ[k] V₂) : ⇑e.toAffineEquiv = e := end LinearEquiv +namespace AffineEquiv + +section ofLinearEquiv + +variable {k V P : Type*} +variable [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] + +/-- Construct an affine equivalence from a linear equivalence and two base points. + +Given a linear equivalence `A : V ≃ₗ[k] V` and base points `p₀ p₁ : P`, this constructs +the affine equivalence `T x = A (x -ᵥ p₀) +ᵥ p₁`. This is the standard way to convert +a linear automorphism into an affine automorphism with specified base point mapping. -/ +def ofLinearEquiv (A : V ≃ₗ[k] V) (p₀ p₁ : P) : P ≃ᵃ[k] P := + (vaddConst k p₀).symm.trans (A.toAffineEquiv.trans (vaddConst k p₁)) + +@[simp] +theorem ofLinearEquiv_apply (A : V ≃ₗ[k] V) (p₀ p₁ : P) (x : P) : + ofLinearEquiv A p₀ p₁ x = A (x -ᵥ p₀) +ᵥ p₁ := + rfl + +@[simp] +theorem linear_ofLinearEquiv (A : V ≃ₗ[k] V) (p₀ p₁ : P) : + (ofLinearEquiv A p₀ p₁).linear = A := + rfl + +@[simp] +theorem ofLinearEquiv_refl (p : P) : + ofLinearEquiv (.refl k V) p p = .refl k P := by + ext x + simp [ofLinearEquiv_apply] + +@[simp] +theorem ofLinearEquiv_trans_ofLinearEquiv (A B : V ≃ₗ[k] V) (p₀ p₁ p₂ : P) : + (ofLinearEquiv A p₀ p₁).trans (ofLinearEquiv B p₁ p₂) = + ofLinearEquiv (A.trans B) p₀ p₂ := by + ext x + simp + +end ofLinearEquiv + +end AffineEquiv + namespace AffineMap open AffineEquiv diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean index e5ec4473cae219..b93d6cbfb26be8 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.Order.Group.Pointwise.Interval -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.Pi -import Mathlib.LinearAlgebra.Prod -import Mathlib.Tactic.Abel -import Mathlib.Algebra.AddTorsor.Basic -import Mathlib.LinearAlgebra.AffineSpace.Defs +module + +public import Mathlib.Algebra.Order.Group.Pointwise.Interval +public import Mathlib.Algebra.Order.Module.Defs +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.Tactic.Abel +public import Mathlib.Algebra.AddTorsor.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Defs /-! # Affine maps @@ -43,6 +45,8 @@ topology are defined elsewhere; see `Analysis.Normed.Affine.AddTorsor` and * https://en.wikipedia.org/wiki/Principal_homogeneous_space -/ +@[expose] public section + open Affine /-- An `AffineMap k P1 P2` (notation: `P1 →ᵃ[k] P2`) is a map from `P1` to `P2` that diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean index 940a8dd5ccaaa4..01c960e0110d1c 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs +module + +public import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs /-! # Affine spaces @@ -19,6 +21,8 @@ and the affine span of a set of points. -/ +@[expose] public section + noncomputable section open Affine @@ -557,6 +561,16 @@ theorem map_span (s : Set P₁) : (affineSpan k s).map f = affineSpan k (f '' s) theorem map_mono {s₁ s₂ : AffineSubspace k P₁} (h : s₁ ≤ s₂) : s₁.map f ≤ s₂.map f := Set.image_mono h +lemma map_mk' (p : P₁) (direction : Submodule k V₁) : + (mk' p direction).map f = mk' (f p) (direction.map f.linear) := by + ext q + simp only [mem_map, mem_mk', Submodule.mem_map] + constructor + · rintro ⟨r, hr, rfl⟩ + exact ⟨r -ᵥ p, hr, by simp⟩ + · rintro ⟨r, hr, he⟩ + exact ⟨r +ᵥ p, by simp [hr], by simp [he]⟩ + section inclusion variable {S₁ S₂ : AffineSubspace k P₁} [Nonempty S₁] diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Defs.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Defs.lean index f22313f234c19f..1712cd221a441b 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Defs.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Order.Atoms -import Mathlib.LinearAlgebra.Span.Defs -import Mathlib.LinearAlgebra.AffineSpace.Defs +module + +public import Mathlib.Order.Atoms +public import Mathlib.LinearAlgebra.Span.Defs +public import Mathlib.LinearAlgebra.AffineSpace.Defs /-! # Affine spaces @@ -43,6 +45,8 @@ topology are defined elsewhere; see `Analysis.Normed.Affine.AddTorsor` and * https://en.wikipedia.org/wiki/Affine_space * https://en.wikipedia.org/wiki/Principal_homogeneous_space -/ + +@[expose] public section noncomputable section open Affine diff --git a/Mathlib/LinearAlgebra/AffineSpace/Basis.lean b/Mathlib/LinearAlgebra/AffineSpace/Basis.lean index 64bd1a5f6e2393..151308c879ae7e 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Basis.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Basis.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.AffineSpace.Centroid -import Mathlib.LinearAlgebra.AffineSpace.Independent -import Mathlib.LinearAlgebra.AffineSpace.Pointwise -import Mathlib.LinearAlgebra.Basis.SMul +module + +public import Mathlib.LinearAlgebra.AffineSpace.Centroid +public import Mathlib.LinearAlgebra.AffineSpace.Independent +public import Mathlib.LinearAlgebra.AffineSpace.Pointwise +public import Mathlib.LinearAlgebra.Basis.SMul /-! # Affine bases and barycentric coordinates @@ -40,6 +42,8 @@ barycentric coordinate of `q : P` is `1 - fᵢ (q -ᵥ p i)`. -/ +@[expose] public section + open Affine Module Set open scoped Pointwise diff --git a/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean b/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean index db65702b60fb0d..181cbf5bcff055 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.LinearAlgebra.AffineSpace.Combination +module + +public import Mathlib.LinearAlgebra.AffineSpace.Combination /-! # Centroid of a Finite Set of Points in Affine Space @@ -21,6 +23,8 @@ ring. -/ +@[expose] public section + assert_not_exists Affine.Simplex noncomputable section diff --git a/Mathlib/LinearAlgebra/AffineSpace/Combination.lean b/Mathlib/LinearAlgebra/AffineSpace/Combination.lean index dbcbffbf97a36e..b0b75d8fe6a735 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Combination.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Combination.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Indicator -import Mathlib.Algebra.Module.BigOperators -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic -import Mathlib.LinearAlgebra.Finsupp.LinearCombination -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Indicator +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination +public import Mathlib.Tactic.FinCases /-! # Affine combinations of points @@ -38,6 +40,8 @@ These definitions are for sums over a `Finset`; versions for a -/ +@[expose] public section + noncomputable section @@ -402,17 +406,7 @@ theorem affineCombination_vsub (w₁ w₂ : ι → k) (p : ι → P) : theorem attach_affineCombination_of_injective [DecidableEq P] (s : Finset P) (w : P → k) (f : s → P) (hf : Function.Injective f) : s.attach.affineCombination k f (w ∘ f) = (image f univ).affineCombination k id w := by - simp only [affineCombination, weightedVSubOfPoint_apply, id, vadd_right_cancel_iff, - Function.comp_apply, AffineMap.coe_mk] - let g₁ : s → V := fun i => w (f i) • (f i -ᵥ Classical.choice S.nonempty) - let g₂ : P → V := fun i => w i • (i -ᵥ Classical.choice S.nonempty) - change univ.sum g₁ = (image f univ).sum g₂ - have hgf : g₁ = g₂ ∘ f := by - ext - simp [g₁, g₂] - rw [hgf, sum_image] - · simp only [g₂,Function.comp_apply] - · exact fun _ _ _ _ hxy => hf hxy + simp [affineCombination, hf] theorem attach_affineCombination_coe (s : Finset P) (w : P → k) : s.attach.affineCombination k ((↑) : s → P) (w ∘ (↑)) = s.affineCombination k id w := by @@ -875,6 +869,25 @@ lemma eq_affineCombination_of_mem_affineSpan_image {p₁ : P} {p : ι → P} {s simp only [Finset.affineCombination_map, Function.Embedding.coe_subtype] exact fs'.affineCombination_congr (by simp) (by simp) +lemma affineCombination_mem_affineSpan_image [Nontrivial k] {s : Finset ι} {w : ι → k} + (h : ∑ i ∈ s, w i = 1) {s' : Set ι} (hs' : ∀ i ∈ s, i ∉ s' → w i = 0) (p : ι → P) : + s.affineCombination k p w ∈ affineSpan k (p '' s') := by + classical + rw [Set.image_eq_range] + let w' : s' → k := fun i ↦ w i + have h' : ∑ i ∈ s with i ∈ s', w i = 1 := by + rw [← h, ← Finset.sum_sdiff (s₁ := {x ∈ s | x ∈ s'}) (s₂ := s) (by simp), right_eq_add] + refine Finset.sum_eq_zero ?_ + intro i hi + simp only [Finset.mem_sdiff, Finset.mem_filter, not_and] at hi + exact hs' i hi.1 (hi.2 hi.1) + rw [← Finset.sum_subtype_eq_sum_filter] at h' + convert affineCombination_mem_affineSpan h' (fun x ↦ p x) + rw [Finset.affineCombination_subtype_eq_filter, Finset.affineCombination_indicator_subset w p + (Finset.filter_subset _ _)] + refine Finset.affineCombination_congr _ (fun i hi ↦ ?_) (fun _ _ ↦ rfl) + simp_all [Set.indicator_apply] + variable (k V) /-- A point is in the `affineSpan` of an indexed family if and only diff --git a/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean b/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean index 54615579f5d227..306f8f9e32dc73 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean @@ -1,3 +1,5 @@ -import Mathlib.Topology.Algebra.ContinuousAffineEquiv +module + +public import Mathlib.Topology.Algebra.ContinuousAffineEquiv deprecated_module (since := "2025-09-20") diff --git a/Mathlib/LinearAlgebra/AffineSpace/Defs.lean b/Mathlib/LinearAlgebra/AffineSpace/Defs.lean index 43164fc71dca1d..675cdf1ac0daea 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Defs.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.AddTorsor.Defs +module + +public import Mathlib.Algebra.AddTorsor.Defs /-! # Affine space @@ -37,6 +39,8 @@ Some key definitions are not yet present. coordinates, with appropriate proofs of existence when `k` is a field. -/ +@[expose] public section + assert_not_exists MonoidWithZero @[inherit_doc] scoped[Affine] notation "AffineSpace" => AddTorsor diff --git a/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean b/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean index 79411c7d7bbf98..3c3cb0855d564a 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.FieldTheory.Finiteness -import Mathlib.LinearAlgebra.AffineSpace.Basis -import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +module + +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.LinearAlgebra.AffineSpace.Basis +public import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas /-! # Finite-dimensional subspaces of affine spaces. @@ -21,6 +23,8 @@ subspaces of affine spaces. -/ +@[expose] public section + noncomputable section @@ -628,6 +632,21 @@ theorem collinear_triple_of_mem_affineSpan_pair {p₁ p₂ p₃ p₄ p₅ : P} ( refine (collinear_insert_insert_insert_left_of_mem_affineSpan_pair h₁ h₂ h₃).subset ?_ gcongr; simp +/-- Replacing a point in an affine independent triple with a collinear point preserves affine +independence. -/ +theorem affineIndependent_of_affineIndependent_collinear_ne {p₁ p₂ p₃ p : P} + (ha : AffineIndependent k ![p₁, p₂, p₃]) (hcol : Collinear k {p₂, p₃, p}) (hne : p₂ ≠ p) : + AffineIndependent k ![p₁, p₂, p] := by + rw [affineIndependent_iff_not_collinear_set] + by_contra h + have h1: Collinear k {p₁, p₃, p₂, p} := by + apply collinear_insert_insert_of_mem_affineSpan_pair + · apply Collinear.mem_affineSpan_of_mem_of_ne h (by simp) (by simp) (by simp) hne + · apply Collinear.mem_affineSpan_of_mem_of_ne hcol (by simp) (by simp) (by simp) hne + have h2 : Collinear k {p₁, p₂, p₃} := h1.subset (by grind) + rw [affineIndependent_iff_not_collinear_set] at ha + exact ha h2 + variable (k) in /-- A set of points is coplanar if their `vectorSpan` has dimension at most `2`. -/ def Coplanar (s : Set P) : Prop := @@ -771,7 +790,7 @@ variable [DivisionRing k] [Module k V] protected theorem finiteDimensional [Finite ι] (b : AffineBasis ι k P) : FiniteDimensional k V := let ⟨i⟩ := b.nonempty - FiniteDimensional.of_fintype_basis (b.basisOf i) + (b.basisOf i).finiteDimensional_of_finite protected theorem finite [FiniteDimensional k V] (b : AffineBasis ι k P) : Finite ι := finite_of_fin_dim_affineIndependent k b.ind diff --git a/Mathlib/LinearAlgebra/AffineSpace/Independent.lean b/Mathlib/LinearAlgebra/AffineSpace/Independent.lean index dbdd403907e067..ebe74c2bca343b 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Independent.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Independent.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.Sign.Basic -import Mathlib.LinearAlgebra.AffineSpace.Combination -import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv -import Mathlib.LinearAlgebra.Basis.VectorSpace +module + +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.Sign.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Combination +public import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv +public import Mathlib.LinearAlgebra.Basis.VectorSpace /-! # Affine independence @@ -29,6 +31,8 @@ This file defines affinely independent families of points. -/ +@[expose] public section + noncomputable section @@ -402,8 +406,7 @@ theorem AffineEquiv.affineIndependent_iff {p : ι → P} (e : P ≃ᵃ[k] P₂) theorem AffineEquiv.affineIndependent_set_of_eq_iff {s : Set P} (e : P ≃ᵃ[k] P₂) : AffineIndependent k ((↑) : e '' s → P₂) ↔ AffineIndependent k ((↑) : s → P) := by have : e ∘ ((↑) : s → P) = ((↑) : e '' s → P₂) ∘ (e : P ≃ P₂).image s := rfl - -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 - erw [← e.affineIndependent_iff, this, affineIndependent_equiv] + simp [← e.affineIndependent_iff, this, affineIndependent_equiv] end Composition diff --git a/Mathlib/LinearAlgebra/AffineSpace/Matrix.lean b/Mathlib/LinearAlgebra/AffineSpace/Matrix.lean index 284f2ed76dca30..40b806e1e82da0 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Matrix.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Matrix.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.AffineSpace.Basis -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +module + +public import Mathlib.LinearAlgebra.AffineSpace.Basis +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse /-! # Matrix results for barycentric co-ordinates @@ -13,6 +15,8 @@ Results about the matrix of barycentric co-ordinates for a family of points in a respect to some affine basis. -/ +@[expose] public section + open Affine Matrix diff --git a/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean b/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean index 710254c9f694ce..d3df9902011ccd 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Module.Basic -import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv +module + +public import Mathlib.Algebra.Module.Basic +public import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv /-! # Midpoint of a segment @@ -31,6 +33,8 @@ We do not mark most lemmas as `@[simp]` because it is hard to tell which side is midpoint, AddMonoidHom -/ +@[expose] public section + open AffineMap AffineEquiv section diff --git a/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean b/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean index f5c255ec817802..c4800d15530dd8 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.LinearAlgebra.AffineSpace.Midpoint +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.LinearAlgebra.AffineSpace.Midpoint /-! # Midpoint of a segment for characteristic zero @@ -16,6 +18,8 @@ We collect lemmas that require that the underlying ring has characteristic zero. midpoint -/ +@[expose] public section + open AffineMap AffineEquiv diff --git a/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean b/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean index 8840e8a12e25f5..5c47fd1938de78 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Algebra.Order.Module.Synonym -import Mathlib.LinearAlgebra.AffineSpace.Midpoint -import Mathlib.LinearAlgebra.AffineSpace.Slope +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.Order.Module.Synonym +public import Mathlib.LinearAlgebra.AffineSpace.Midpoint +public import Mathlib.LinearAlgebra.AffineSpace.Slope /-! # Ordered modules as affine spaces @@ -26,6 +28,8 @@ for an ordered module interpreted as an affine space. affine space, ordered module, slope -/ +@[expose] public section + open AffineMap diff --git a/Mathlib/LinearAlgebra/AffineSpace/Pointwise.lean b/Mathlib/LinearAlgebra/AffineSpace/Pointwise.lean index ec721ba2a7cad4..8b02bcd7e656a9 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Pointwise.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Pointwise.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Hanting Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hanting Zhang -/ -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic +module + +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic /-! # Pointwise instances on `AffineSubspace`s @@ -12,6 +14,8 @@ This file provides the additive action `AffineSubspace.pointwiseAddAction` in th -/ +@[expose] public section + open Affine Pointwise diff --git a/Mathlib/LinearAlgebra/AffineSpace/Restrict.lean b/Mathlib/LinearAlgebra/AffineSpace/Restrict.lean index 406883c43782d2..95f5a7340452e5 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Restrict.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Restrict.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Paul Reichert. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Reichert -/ -import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic +module + +public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic /-! # Affine map restrictions @@ -23,6 +25,8 @@ This file defines restrictions of affine maps. * The restriction in surjective if the codomain is the image of the domain. -/ +@[expose] public section + variable {k V₁ P₁ V₂ P₂ : Type*} [Ring k] [AddCommGroup V₁] [AddCommGroup V₂] [Module k V₁] [Module k V₂] [AddTorsor V₁ P₁] [AddTorsor V₂ P₂] diff --git a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean index 630de5c329a282..e109f48347bee2 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Data.Finset.Sort -import Mathlib.LinearAlgebra.AffineSpace.Independent -import Mathlib.LinearAlgebra.AffineSpace.Restrict +module + +public import Mathlib.Data.Finset.Sort +public import Mathlib.LinearAlgebra.AffineSpace.Independent +public import Mathlib.LinearAlgebra.AffineSpace.Restrict /-! # Simplex in affine space @@ -27,6 +29,8 @@ This file defines n-dimensional simplices in affine space. -/ +@[expose] public section + noncomputable section open Finset Function Module @@ -292,6 +296,12 @@ theorem restrict_map_subtype {n : ℕ} (s : Affine.Simplex k P n) : (s.restrict _ le_rfl).map (AffineSubspace.subtype _) Subtype.coe_injective = s := rfl +lemma restrict_reindex {m n : ℕ} (s : Affine.Simplex k P n) (e : Fin (n + 1) ≃ Fin (m + 1)) + {S : AffineSubspace k P} (hS : affineSpan k (Set.range s.points) ≤ S) : + letI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + (s.reindex e).restrict S (s.reindex_range_points e ▸ hS) = (s.restrict S hS).reindex e := + rfl + end restrict end Simplex @@ -318,6 +328,27 @@ lemma affineCombination_mem_setInterior_iff {I : Set k} {n : ℕ} {s : Simplex k s.independent w' w hw' hw hww'] exact hw'01 +@[simp] lemma setInterior_reindex (I : Set k) {m n : ℕ} (s : Simplex k P n) + (e : Fin (n + 1) ≃ Fin (m + 1)) : (s.reindex e).setInterior I = s.setInterior I := by + ext p + refine ⟨fun ⟨w, hw, hwI, h⟩ ↦ ?_, fun ⟨w, hw, hwI, h⟩ ↦ ?_⟩ + · subst h + simp_rw [reindex] + rw [← Function.comp_id w, ← e.self_comp_symm, ← Function.comp_assoc, + ← Equiv.coe_toEmbedding, ← Finset.univ.affineCombination_map e.symm.toEmbedding, + map_univ_equiv] + have hw' : ∑ i, (w ∘ e) i = 1 := by rwa [sum_comp_equiv, map_univ_equiv] + rw [affineCombination_mem_setInterior_iff hw'] + exact fun i ↦ hwI (e i) + · subst h + rw [← Function.comp_id w, ← Function.comp_id s.points, ← e.symm_comp_self, + ← Function.comp_assoc, ← Function.comp_assoc, ← e.coe_toEmbedding, + ← Finset.univ.affineCombination_map e.toEmbedding, map_univ_equiv] + change Finset.univ.affineCombination k (s.reindex e).points _ ∈ _ + have hw' : ∑ i, (w ∘ e.symm) i = 1 := by rwa [sum_comp_equiv, map_univ_equiv] + rw [affineCombination_mem_setInterior_iff hw'] + exact fun i ↦ hwI (e.symm i) + lemma setInterior_mono {I J : Set k} (hij : I ⊆ J) {n : ℕ} (s : Simplex k P n) : s.setInterior I ⊆ s.setInterior J := fun _ ⟨w, hw, hw01, hww⟩ ↦ ⟨w, hw, fun i ↦ hij (hw01 i), hww⟩ @@ -335,6 +366,10 @@ interior of the convex hull of the vertices. -/ protected def interior {n : ℕ} (s : Simplex k P n) : Set P := s.setInterior (Set.Ioo 0 1) +@[simp] lemma interior_reindex {m n : ℕ} (s : Simplex k P n) (e : Fin (n + 1) ≃ Fin (m + 1)) : + (s.reindex e).interior = s.interior := + s.setInterior_reindex _ _ + lemma affineCombination_mem_interior_iff {n : ℕ} {s : Simplex k P n} {w : Fin (n + 1) → k} (hw : ∑ i, w i = 1) : Finset.univ.affineCombination k s.points w ∈ s.interior ↔ ∀ i, w i ∈ Set.Ioo 0 1 := @@ -346,6 +381,10 @@ the vertices or the closure of the interior. -/ protected def closedInterior {n : ℕ} (s : Simplex k P n) : Set P := s.setInterior (Set.Icc 0 1) +@[simp] lemma closedInterior_reindex {m n : ℕ} (s : Simplex k P n) (e : Fin (n + 1) ≃ Fin (m + 1)) : + (s.reindex e).closedInterior = s.closedInterior := + s.setInterior_reindex _ _ + lemma affineCombination_mem_closedInterior_iff {n : ℕ} {s : Simplex k P n} {w : Fin (n + 1) → k} (hw : ∑ i, w i = 1) : Finset.univ.affineCombination k s.points w ∈ s.closedInterior ↔ ∀ i, w i ∈ Set.Icc 0 1 := diff --git a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean index eaf41c2f556070..7917e9cbb75c2a 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic -import Mathlib.LinearAlgebra.AffineSpace.Centroid +module + +public import Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic +public import Mathlib.LinearAlgebra.AffineSpace.Centroid /-! # Centroid of a simplex in affine space @@ -13,6 +15,8 @@ This file proves some basic properties of the centroid of a simplex in affine sp -/ +@[expose] public section + noncomputable section open Finset diff --git a/Mathlib/LinearAlgebra/AffineSpace/Slope.lean b/Mathlib/LinearAlgebra/AffineSpace/Slope.lean index 53b296299466d4..dd2643a22fe7df 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Slope.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Slope.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.LinearAlgebra.AffineSpace.AffineMap -import Mathlib.Tactic.Field -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Module +module + +public import Mathlib.LinearAlgebra.AffineSpace.AffineMap +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Module /-! # Slope of a function @@ -21,6 +23,8 @@ interval is convex on this interval. affine space, slope -/ +@[expose] public section + open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] diff --git a/Mathlib/LinearAlgebra/Alternating/Basic.lean b/Mathlib/LinearAlgebra/Alternating/Basic.lean index c3432e01353a6b..d7c0f7765a645d 100644 --- a/Mathlib/LinearAlgebra/Alternating/Basic.lean +++ b/Mathlib/LinearAlgebra/Alternating/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Zhangir Azerbayev. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Zhangir Azerbayev -/ -import Mathlib.GroupTheory.Perm.Sign -import Mathlib.LinearAlgebra.LinearIndependent.Defs -import Mathlib.LinearAlgebra.Multilinear.Basis +module + +public import Mathlib.GroupTheory.Perm.Sign +public import Mathlib.LinearAlgebra.LinearIndependent.Defs +public import Mathlib.LinearAlgebra.Multilinear.Basis /-! # Alternating Maps @@ -39,6 +41,8 @@ using `map_swap` as a definition, and does not require `Neg N`. * `AlternatingMap.coe_smul` -/ +@[expose] public section + -- semiring / add_comm_monoid diff --git a/Mathlib/LinearAlgebra/Alternating/Curry.lean b/Mathlib/LinearAlgebra/Alternating/Curry.lean index 897ccae840e803..6ea44434cd4d94 100644 --- a/Mathlib/LinearAlgebra/Alternating/Curry.lean +++ b/Mathlib/LinearAlgebra/Alternating/Curry.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Alternating.Basic -import Mathlib.LinearAlgebra.Multilinear.Curry +module + +public import Mathlib.LinearAlgebra.Alternating.Basic +public import Mathlib.LinearAlgebra.Multilinear.Curry /-! # Currying alternating forms @@ -14,6 +16,8 @@ which interprets an alternating map in `n + 1` variables as a linear map in the 0th variable taking values in the alternating maps in `n` variables. -/ +@[expose] public section + variable {R : Type*} {M M₂ N N₂ : Type*} [CommSemiring R] [AddCommMonoid M] [AddCommMonoid M₂] [AddCommMonoid N] [AddCommMonoid N₂] [Module R M] [Module R M₂] [Module R N] [Module R N₂] {n : ℕ} diff --git a/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean b/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean index 44397948ea9e50..6e37bc40f9f2b3 100644 --- a/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean +++ b/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Group.Subgroup.Finite -import Mathlib.GroupTheory.Coset.Card -import Mathlib.GroupTheory.GroupAction.Quotient -import Mathlib.GroupTheory.Perm.Basic -import Mathlib.LinearAlgebra.Alternating.Basic -import Mathlib.LinearAlgebra.Multilinear.TensorProduct +module + +public import Mathlib.Algebra.Group.Subgroup.Finite +public import Mathlib.GroupTheory.Coset.Card +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.GroupTheory.Perm.Basic +public import Mathlib.LinearAlgebra.Alternating.Basic +public import Mathlib.LinearAlgebra.Multilinear.TensorProduct /-! # Exterior product of alternating maps @@ -18,6 +20,8 @@ to be the exterior product of two alternating maps, taking values in the tensor product of the codomains of the original maps. -/ +@[expose] public section + open TensorProduct variable {ιa ιb : Type*} [Fintype ιa] [Fintype ιb] diff --git a/Mathlib/LinearAlgebra/Alternating/Uncurry/Fin.lean b/Mathlib/LinearAlgebra/Alternating/Uncurry/Fin.lean index fa39d296fef40c..d1eec5207c75e5 100644 --- a/Mathlib/LinearAlgebra/Alternating/Uncurry/Fin.lean +++ b/Mathlib/LinearAlgebra/Alternating/Uncurry/Fin.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.LinearAlgebra.Alternating.Curry -import Mathlib.GroupTheory.Perm.Fin -import Mathlib.Data.Fin.Parity +module + +public import Mathlib.LinearAlgebra.Alternating.Curry +public import Mathlib.GroupTheory.Perm.Fin +public import Mathlib.Data.Fin.Parity /-! # Uncurrying alternating maps @@ -41,6 +43,8 @@ A version of the latter theorem for continuous alternating maps will be used to prove that the second exterior derivative of a differential form is zero. -/ +@[expose] public section + open Fin Function namespace AlternatingMap diff --git a/Mathlib/LinearAlgebra/AnnihilatingPolynomial.lean b/Mathlib/LinearAlgebra/AnnihilatingPolynomial.lean index 8c794975050920..0505eff5409e70 100644 --- a/Mathlib/LinearAlgebra/AnnihilatingPolynomial.lean +++ b/Mathlib/LinearAlgebra/AnnihilatingPolynomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Justin Thomas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Justin Thomas -/ -import Mathlib.FieldTheory.Minpoly.Field -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.Algebra.Polynomial.Module.AEval +module + +public import Mathlib.FieldTheory.Minpoly.Field +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.Algebra.Polynomial.Module.AEval /-! # Annihilating Ideal @@ -32,6 +34,8 @@ there are some common specializations which may be more familiar. * Example 2: `A = n × n` matrices with entries in `R`. -/ +@[expose] public section + open Polynomial diff --git a/Mathlib/LinearAlgebra/Basis/Basic.lean b/Mathlib/LinearAlgebra/Basis/Basic.lean index 30ce68193c3eba..87bf3b304eb8c9 100644 --- a/Mathlib/LinearAlgebra/Basis/Basic.lean +++ b/Mathlib/LinearAlgebra/Basis/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.LinearIndependent.Basic -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.LinearIndependent.Basic +public import Mathlib.LinearAlgebra.Span.Basic /-! # Basic results on bases @@ -23,6 +25,8 @@ There are also various lemmas on bases on specific spaces (such as empty or sing `span (range v) = ⊤`. -/ +@[expose] public section + assert_not_exists Ordinal noncomputable section diff --git a/Mathlib/LinearAlgebra/Basis/Bilinear.lean b/Mathlib/LinearAlgebra/Basis/Bilinear.lean index 83ddb9ae607ec7..c7be9888018295 100644 --- a/Mathlib/LinearAlgebra/Basis/Bilinear.lean +++ b/Mathlib/LinearAlgebra/Basis/Bilinear.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.Basis.Defs +module + +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.Basis.Defs /-! # Lemmas about bilinear maps with a basis over each argument -/ +@[expose] public section + open Module namespace LinearMap diff --git a/Mathlib/LinearAlgebra/Basis/Cardinality.lean b/Mathlib/LinearAlgebra/Basis/Cardinality.lean index a71be802e661ae..8ede5fcedd49b0 100644 --- a/Mathlib/LinearAlgebra/Basis/Cardinality.lean +++ b/Mathlib/LinearAlgebra/Basis/Cardinality.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp, Kim Morrison -/ -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.LinearIndependent.Defs -import Mathlib.LinearAlgebra.Span.Basic -import Mathlib.SetTheory.Cardinal.Pigeonhole +module + +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.LinearIndependent.Defs +public import Mathlib.LinearAlgebra.Span.Basic +public import Mathlib.SetTheory.Cardinal.Pigeonhole /-! # Results relating bases and cardinality. -/ +@[expose] public section + section Finite open Module Basis Cardinal Set Submodule Finsupp diff --git a/Mathlib/LinearAlgebra/Basis/Defs.lean b/Mathlib/LinearAlgebra/Basis/Defs.lean index 747bac4ee7404a..59b3d5eed7069e 100644 --- a/Mathlib/LinearAlgebra/Basis/Defs.lean +++ b/Mathlib/LinearAlgebra/Basis/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.Data.Fintype.BigOperators -import Mathlib.LinearAlgebra.Finsupp.LinearCombination +module + +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination /-! # Bases @@ -56,6 +58,8 @@ basis, bases -/ +@[expose] public section + assert_not_exists LinearMap.pi LinearIndependent Cardinal -- TODO: assert_not_exists Submodule -- (should be possible after splitting `Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean`) diff --git a/Mathlib/LinearAlgebra/Basis/Exact.lean b/Mathlib/LinearAlgebra/Basis/Exact.lean index 0c6ee9c83b9977..d437c4241050bc 100644 --- a/Mathlib/LinearAlgebra/Basis/Exact.lean +++ b/Mathlib/LinearAlgebra/Basis/Exact.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Exact -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Projection +module + +public import Mathlib.Algebra.Exact +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Projection /-! # Basis from a split exact sequence @@ -19,6 +21,8 @@ We treat linear independence and the span condition separately. For convenience is stated not for `κ ⊕ σ`, but for an arbitrary type `ι` with two maps `κ → ι` and `σ → ι`. -/ +@[expose] public section + variable {R M K P : Type*} [Ring R] [AddCommGroup M] [AddCommGroup K] [AddCommGroup P] variable [Module R M] [Module R K] [Module R P] variable {f : K →ₗ[R] M} {g : M →ₗ[R] P} {s : M →ₗ[R] K} diff --git a/Mathlib/LinearAlgebra/Basis/Fin.lean b/Mathlib/LinearAlgebra/Basis/Fin.lean index ab094d47348620..2c92d83b9acf15 100644 --- a/Mathlib/LinearAlgebra/Basis/Fin.lean +++ b/Mathlib/LinearAlgebra/Basis/Fin.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Pi +module + +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Pi /-! # Bases indexed by `Fin` -/ +@[expose] public section + assert_not_exists Ordinal noncomputable section diff --git a/Mathlib/LinearAlgebra/Basis/Flag.lean b/Mathlib/LinearAlgebra/Basis/Flag.lean index 7300ba8744ee14..b9f854b5e393e1 100644 --- a/Mathlib/LinearAlgebra/Basis/Flag.lean +++ b/Mathlib/LinearAlgebra/Basis/Flag.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Fin.FlagRange -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Dual.Basis -import Mathlib.RingTheory.SimpleRing.Basic +module + +public import Mathlib.Data.Fin.FlagRange +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Dual.Basis +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Flag of submodules defined by a basis @@ -17,6 +19,8 @@ to be the subspace spanned by the first `k` vectors of the basis `b`. We also prove some lemmas about this definition. -/ +@[expose] public section + open Set Submodule namespace Module.Basis diff --git a/Mathlib/LinearAlgebra/Basis/MulOpposite.lean b/Mathlib/LinearAlgebra/Basis/MulOpposite.lean index 4cc12b4793de81..e0f9bb47f3ff86 100644 --- a/Mathlib/LinearAlgebra/Basis/MulOpposite.lean +++ b/Mathlib/LinearAlgebra/Basis/MulOpposite.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.LinearAlgebra.FiniteDimensional.Defs +module + +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs /-! # Basis of an opposite space @@ -12,6 +14,8 @@ This file defines the basis of an opposite space and shows that the opposite space is finite-dimensional and free when the original space is. -/ +@[expose] public section + open Module MulOpposite variable {R H : Type*} diff --git a/Mathlib/LinearAlgebra/Basis/Prod.lean b/Mathlib/LinearAlgebra/Basis/Prod.lean index abf4333e651f4e..886ea17c401db1 100644 --- a/Mathlib/LinearAlgebra/Basis/Prod.lean +++ b/Mathlib/LinearAlgebra/Basis/Prod.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.LinearAlgebra.Prod -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.Finsupp.SumProd -import Mathlib.LinearAlgebra.FreeModule.Basic +module + +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.Finsupp.SumProd +public import Mathlib.LinearAlgebra.FreeModule.Basic /-! # Bases for the product of modules -/ +@[expose] public section + assert_not_exists Ordinal noncomputable section diff --git a/Mathlib/LinearAlgebra/Basis/SMul.lean b/Mathlib/LinearAlgebra/Basis/SMul.lean index 35ae358e79ec86..091b29649fb93c 100644 --- a/Mathlib/LinearAlgebra/Basis/SMul.lean +++ b/Mathlib/LinearAlgebra/Basis/SMul.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.LinearAlgebra.Basis.Basic +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.LinearAlgebra.Basis.Basic /-! # Bases and scalar multiplication @@ -13,6 +15,8 @@ This file defines the scalar multiplication of bases by multiplying each basis v -/ +@[expose] public section + assert_not_exists Ordinal noncomputable section diff --git a/Mathlib/LinearAlgebra/Basis/Submodule.lean b/Mathlib/LinearAlgebra/Basis/Submodule.lean index 6a4f7e2a9b50f3..aaa4ad1e2e04fc 100644 --- a/Mathlib/LinearAlgebra/Basis/Submodule.lean +++ b/Mathlib/LinearAlgebra/Basis/Submodule.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.Algebra.Algebra.Basic -import Mathlib.LinearAlgebra.Basis.Basic +module + +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.LinearAlgebra.Basis.Basic /-! # Bases of submodules -/ +@[expose] public section + open Function Set Submodule Finsupp Module assert_not_exists Ordinal diff --git a/Mathlib/LinearAlgebra/Basis/VectorSpace.lean b/Mathlib/LinearAlgebra/Basis/VectorSpace.lean index 90a51d0d134fa5..1968b5f664f670 100644 --- a/Mathlib/LinearAlgebra/Basis/VectorSpace.lean +++ b/Mathlib/LinearAlgebra/Basis/VectorSpace.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp -/ -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas -import Mathlib.LinearAlgebra.LinearPMap -import Mathlib.LinearAlgebra.Projection +module + +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +public import Mathlib.LinearAlgebra.LinearPMap +public import Mathlib.LinearAlgebra.Projection /-! # Bases in a vector space @@ -28,6 +30,8 @@ basis, bases -/ +@[expose] public section + open Function Module Set Submodule variable {ι : Type*} {ι' : Type*} {K : Type*} {V : Type*} {V' : Type*} diff --git a/Mathlib/LinearAlgebra/BilinearForm/Basic.lean b/Mathlib/LinearAlgebra/BilinearForm/Basic.lean index 0caff5322d5f69..1aa63f56c16675 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/Basic.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow, Kexing Ying -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.LinearAlgebra.BilinearMap +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.LinearAlgebra.BilinearMap /-! # Bilinear form @@ -42,6 +44,8 @@ In this file we use the following type variables: Bilinear form, -/ +@[expose] public section + export LinearMap (BilinForm) open LinearMap (BilinForm) diff --git a/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean b/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean index 493f3352bbe847..08ce8f8b54407e 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.BilinearForm.Properties +module + +public import Mathlib.LinearAlgebra.BilinearForm.Properties /-! @@ -17,6 +19,8 @@ import Mathlib.LinearAlgebra.BilinearForm.Properties Properly develop the material in the context of lattices. -/ +@[expose] public section + open LinearMap (BilinForm) open Module @@ -115,7 +119,7 @@ lemma dualSubmodule_dualSubmodule_flip_of_basis {ι : Type*} [Finite ι] B.dualSubmodule (B.flip.dualSubmodule (Submodule.span R (Set.range b))) = Submodule.span R (Set.range b) := by classical - letI := FiniteDimensional.of_fintype_basis b + letI := b.finiteDimensional_of_finite rw [dualSubmodule_span_of_basis _ hB.flip, dualSubmodule_span_of_basis B hB, dualBasis_dualBasis_flip hB] @@ -124,7 +128,7 @@ lemma dualSubmodule_flip_dualSubmodule_of_basis {ι : Type*} [Finite ι] B.flip.dualSubmodule (B.dualSubmodule (Submodule.span R (Set.range b))) = Submodule.span R (Set.range b) := by classical - letI := FiniteDimensional.of_fintype_basis b + letI := b.finiteDimensional_of_finite rw [dualSubmodule_span_of_basis B hB, dualSubmodule_span_of_basis _ hB.flip, dualBasis_flip_dualBasis hB] @@ -133,7 +137,7 @@ lemma dualSubmodule_dualSubmodule_of_basis B.dualSubmodule (B.dualSubmodule (Submodule.span R (Set.range b))) = Submodule.span R (Set.range b) := by classical - letI := FiniteDimensional.of_fintype_basis b + letI := b.finiteDimensional_of_finite rw [dualSubmodule_span_of_basis B hB, dualSubmodule_span_of_basis B hB, dualBasis_dualBasis hB hB'] diff --git a/Mathlib/LinearAlgebra/BilinearForm/Hom.lean b/Mathlib/LinearAlgebra/BilinearForm/Hom.lean index d16edb2095b550..8d8b19425068b9 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/Hom.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/Hom.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow, Kexing Ying -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.BilinearForm.Basic -import Mathlib.LinearAlgebra.BilinearMap +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.BilinearForm.Basic +public import Mathlib.LinearAlgebra.BilinearMap /-! # Bilinear form and linear maps @@ -38,6 +40,8 @@ In this file we use the following type variables: Bilinear form, -/ +@[expose] public section + open LinearMap (BilinForm) open LinearMap (BilinMap) open Module diff --git a/Mathlib/LinearAlgebra/BilinearForm/Orthogonal.lean b/Mathlib/LinearAlgebra/BilinearForm/Orthogonal.lean index d55938397b6e80..334594d11f44e0 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/Orthogonal.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/Orthogonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow, Kexing Ying -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.LinearAlgebra.BilinearForm.Properties +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.LinearAlgebra.BilinearForm.Properties /-! # Bilinear form @@ -30,6 +32,8 @@ In this file we use the following type variables: Bilinear form, -/ +@[expose] public section + open LinearMap (BilinForm) open Module diff --git a/Mathlib/LinearAlgebra/BilinearForm/Properties.lean b/Mathlib/LinearAlgebra/BilinearForm/Properties.lean index 41be6ff235ba99..abd83d7b311e56 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/Properties.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/Properties.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow, Kexing Ying -/ -import Mathlib.LinearAlgebra.BilinearForm.Hom -import Mathlib.LinearAlgebra.Dual.Lemmas +module + +public import Mathlib.LinearAlgebra.BilinearForm.Hom +public import Mathlib.LinearAlgebra.Dual.Lemmas /-! # Bilinear form @@ -32,6 +34,8 @@ In this file we use the following type variables: Bilinear form, -/ +@[expose] public section + open LinearMap (BilinForm) open Module @@ -371,7 +375,7 @@ variable {ι : Type*} [DecidableEq ι] [Finite ι] where `B` is a nondegenerate (symmetric) bilinear form and `b` is a finite basis. -/ noncomputable def dualBasis (B : BilinForm K V) (hB : B.Nondegenerate) (b : Basis ι K V) : Basis ι K V := - haveI := FiniteDimensional.of_fintype_basis b + haveI := b.finiteDimensional_of_finite b.dualBasis.map (B.toDual hB).symm variable {B : BilinForm K V} @@ -379,13 +383,13 @@ variable {B : BilinForm K V} @[simp] theorem dualBasis_repr_apply (hB : B.Nondegenerate) (b : Basis ι K V) (x i) : (B.dualBasis hB b).repr x i = B x (b i) := by - have := FiniteDimensional.of_fintype_basis b + have := b.finiteDimensional_of_finite rw [dualBasis, Basis.map_repr, LinearEquiv.symm_symm, LinearEquiv.trans_apply, Basis.dualBasis_repr, toDual_def] theorem apply_dualBasis_left (hB : B.Nondegenerate) (b : Basis ι K V) (i j) : B (B.dualBasis hB b i) (b j) = if j = i then 1 else 0 := by - have := FiniteDimensional.of_fintype_basis b + have := b.finiteDimensional_of_finite rw [dualBasis, Basis.map_apply, Basis.coe_dualBasis, ← toDual_def hB, LinearEquiv.apply_symm_apply, Basis.coord_apply, Basis.repr_self, Finsupp.single_apply] diff --git a/Mathlib/LinearAlgebra/BilinearForm/TensorProduct.lean b/Mathlib/LinearAlgebra/BilinearForm/TensorProduct.lean index df46a12ceb633a..fab8ed05902671 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/TensorProduct.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.BilinearForm.Hom -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.LinearAlgebra.BilinearForm.Hom +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.TensorProduct.Finite /-! # The bilinear form on a tensor product @@ -20,6 +22,8 @@ import Mathlib.RingTheory.TensorProduct.Finite -/ +@[expose] public section + universe u v w uR uA uM₁ uM₂ uN₁ uN₂ variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {M₂ : Type uM₂} {N₁ : Type uN₁} {N₂ : Type uN₂} diff --git a/Mathlib/LinearAlgebra/BilinearMap.lean b/Mathlib/LinearAlgebra/BilinearMap.lean index 7f4a19f44f55f5..c0e900b680c66f 100644 --- a/Mathlib/LinearAlgebra/BilinearMap.lean +++ b/Mathlib/LinearAlgebra/BilinearMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro -/ -import Mathlib.Algebra.Module.Submodule.Equiv -import Mathlib.Algebra.NoZeroSMulDivisors.Basic +module + +public import Mathlib.Algebra.Module.Submodule.Equiv +public import Mathlib.Algebra.NoZeroSMulDivisors.Basic /-! # Basics on bilinear maps @@ -36,6 +38,8 @@ commuting actions, and `ρ₁₂ : R →+* R₂` and `σ₁₂ : S →+* S₂`. bilinear -/ +@[expose] public section + open Function namespace LinearMap @@ -186,6 +190,10 @@ theorem lcomp_apply (f : M →ₗ[R] M₂) (g : M₂ →ₗ[R] N) (x : M) : lcom theorem lcomp_apply' (f : M →ₗ[R] M₂) (g : M₂ →ₗ[R] N) : lcomp S N f g = g ∘ₗ f := rfl +lemma lcomp_injective_of_surjective (g : M →ₗ[R] M₂) (surj : Function.Surjective g) : + Function.Injective (LinearMap.lcomp S N g) := + surj.injective_linearMapComp_right + end lcomp attribute [local instance] SMulCommClass.symm diff --git a/Mathlib/LinearAlgebra/Charpoly/BaseChange.lean b/Mathlib/LinearAlgebra/Charpoly/BaseChange.lean index 6d29d6c79e8d55..0ad336a07ba7d5 100644 --- a/Mathlib/LinearAlgebra/Charpoly/BaseChange.lean +++ b/Mathlib/LinearAlgebra/Charpoly/BaseChange.lean @@ -3,17 +3,24 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.Charpoly.ToMatrix -import Mathlib.LinearAlgebra.Determinant -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.LinearAlgebra.Charpoly.ToMatrix +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.RingTheory.TensorProduct.Finite +public import Mathlib.LinearAlgebra.TensorProduct.Tower /-! # The characteristic polynomial of base change -/ -@[simp] -lemma LinearMap.charpoly_baseChange {R M} [CommRing R] [AddCommGroup M] [Module R M] +@[expose] public section + +variable {R M} [CommRing R] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M) - (A) [CommRing A] [Algebra R A] : + (A) [CommRing A] [Algebra R A] + +@[simp] +lemma LinearMap.charpoly_baseChange : (f.baseChange A).charpoly = f.charpoly.map (algebraMap R A) := by nontriviality A have := (algebraMap R A).domain_nontrivial @@ -25,20 +32,23 @@ lemma LinearMap.charpoly_baseChange {R M} [CommRing R] [AddCommGroup M] [Module ext i j simp [LinearMap.toMatrix_apply, ← Algebra.algebraMap_eq_smul_one] -lemma LinearMap.det_eq_sign_charpoly_coeff {R M} [CommRing R] [AddCommGroup M] [Module R M] - [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M) : +lemma LinearMap.det_eq_sign_charpoly_coeff : LinearMap.det f = (-1) ^ Module.finrank R M * f.charpoly.coeff 0 := by nontriviality R rw [← LinearMap.det_toMatrix (Module.Free.chooseBasis R M), Matrix.det_eq_sign_charpoly_coeff, ← Module.finrank_eq_card_chooseBasisIndex, charpoly_def] -lemma LinearMap.det_baseChange {R M} [CommRing R] [AddCommGroup M] [Module R M] - [Module.Free R M] [Module.Finite R M] - {A} [CommRing A] [Algebra R A] (f : M →ₗ[R] M) : +variable {A} in +lemma LinearMap.det_baseChange : LinearMap.det (f.baseChange A) = algebraMap R A (LinearMap.det f) := by nontriviality A have := (algebraMap R A).domain_nontrivial rw [LinearMap.det_eq_sign_charpoly_coeff, LinearMap.det_eq_sign_charpoly_coeff] simp +lemma LinearEquiv.det_baseChange (f : M ≃ₗ[R] M) : + LinearEquiv.det (f.baseChange R A _ _) = (LinearEquiv.det f).map (algebraMap R A) := by + ext + simp [LinearMap.det_baseChange] + /-! Also see `LinearMap.trace_baseChange` in `Mathlib/LinearAlgebra/Trace` -/ diff --git a/Mathlib/LinearAlgebra/Charpoly/Basic.lean b/Mathlib/LinearAlgebra/Charpoly/Basic.lean index 922b5d9167262a..925862bca2319a 100644 --- a/Mathlib/LinearAlgebra/Charpoly/Basic.lean +++ b/Mathlib/LinearAlgebra/Charpoly/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.LinearAlgebra.Determinant -import Mathlib.FieldTheory.Minpoly.Field +module + +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.FieldTheory.Minpoly.Field /-! @@ -22,6 +24,8 @@ in any basis is in `LinearAlgebra/Charpoly/ToMatrix`. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/LinearAlgebra/Charpoly/ToMatrix.lean b/Mathlib/LinearAlgebra/Charpoly/ToMatrix.lean index 9b8e8ea9ccc81d..69c430d74e3cdb 100644 --- a/Mathlib/LinearAlgebra/Charpoly/ToMatrix.lean +++ b/Mathlib/LinearAlgebra/Charpoly/ToMatrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.LinearAlgebra.Charpoly.Basic -import Mathlib.LinearAlgebra.Matrix.Basis -import Mathlib.RingTheory.Finiteness.Prod +module + +public import Mathlib.LinearAlgebra.Charpoly.Basic +public import Mathlib.LinearAlgebra.Matrix.Basis +public import Mathlib.RingTheory.Finiteness.Prod /-! @@ -18,6 +20,8 @@ import Mathlib.RingTheory.Finiteness.Prod -/ +@[expose] public section + noncomputable section open Module Free Polynomial Matrix diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean index 1f4c19a6b6a974..c76b7c1290cd1c 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation -import Mathlib.LinearAlgebra.TensorProduct.Opposite -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +public import Mathlib.LinearAlgebra.TensorProduct.Opposite +public import Mathlib.RingTheory.TensorProduct.Basic /-! # The base change of a clifford algebra @@ -30,6 +32,8 @@ We show the additional results: * `CliffordAlgebra.toBaseChange_reverse`: the effect of base-changing a reversal. -/ +@[expose] public section + variable {R A V : Type*} variable [CommRing R] [CommRing A] [AddCommGroup V] variable [Algebra R A] [Module R V] diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Basic.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Basic.lean index 744677dfce665c..69145728cdcfee 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Utensil Song -/ -import Mathlib.Algebra.RingQuot -import Mathlib.LinearAlgebra.TensorAlgebra.Basic -import Mathlib.LinearAlgebra.QuadraticForm.Isometry -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +module + +public import Mathlib.Algebra.RingQuot +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic +public import Mathlib.LinearAlgebra.QuadraticForm.Isometry +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv /-! # Clifford Algebras @@ -42,6 +44,8 @@ The Clifford algebra of `M` is constructed as a quotient of the tensor algebra, This file is almost identical to `Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean`. -/ +@[expose] public section + variable {R : Type*} [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/CategoryTheory.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/CategoryTheory.lean index 0685918dfcfad9..cb4b679c81eeba 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/CategoryTheory.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/CategoryTheory.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Basic -import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat -import Mathlib.Algebra.Category.AlgCat.Basic +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Basic +public import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat +public import Mathlib.Algebra.Category.AlgCat.Basic /-! # Category-theoretic interpretations of `CliffordAlgebra` @@ -14,6 +16,8 @@ import Mathlib.Algebra.Category.AlgCat.Basic * `QuadraticModuleCat.cliffordAlgebra`: the functor from quadratic modules to algebras -/ +@[expose] public section + universe v u open CategoryTheory diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Conjugation.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Conjugation.lean index 8944a726cf84bb..2825f0769f093e 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Conjugation.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Conjugation.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Grading -import Mathlib.Algebra.Module.Opposite +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Grading +public import Mathlib.Algebra.Module.Opposite /-! # Conjugations @@ -30,6 +32,8 @@ https://en.wikipedia.org/wiki/Clifford_algebra#Antiautomorphisms -/ +@[expose] public section + variable {R : Type*} [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean index 15afac4a4f6de0..1db6f2a04b59da 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation -import Mathlib.LinearAlgebra.CliffordAlgebra.Fold -import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic -import Mathlib.LinearAlgebra.Dual.Defs +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +public import Mathlib.LinearAlgebra.CliffordAlgebra.Fold +public import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic +public import Mathlib.LinearAlgebra.Dual.Defs /-! # Contraction in Clifford Algebras @@ -40,6 +42,8 @@ Within this file, we use the local notation -/ +@[expose] public section + open LinearMap (BilinMap BilinForm) universe u1 u2 u3 diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean index fe846e2fb43b73..9a1a319416b99c 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.DualNumber -import Mathlib.Algebra.QuaternionBasis -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation -import Mathlib.LinearAlgebra.CliffordAlgebra.Star -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.LinearAlgebra.QuadraticForm.Prod +module + +public import Mathlib.Algebra.DualNumber +public import Mathlib.Algebra.QuaternionBasis +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +public import Mathlib.LinearAlgebra.CliffordAlgebra.Star +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.LinearAlgebra.QuadraticForm.Prod /-! # Other constructions isomorphic to Clifford Algebras @@ -57,6 +59,8 @@ and vice-versa: -/ +@[expose] public section + open CliffordAlgebra diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Even.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Even.lean index f1019cc8741f2e..50350b84db2ba7 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Even.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Even.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Fold -import Mathlib.LinearAlgebra.CliffordAlgebra.Grading +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Fold +public import Mathlib.LinearAlgebra.CliffordAlgebra.Grading /-! # The universal property of the even subalgebra @@ -32,6 +34,8 @@ For the universal property of the even subalgebra, we apply a variant of the fir choosing `S` to itself be a submodule of morphisms. -/ +@[expose] public section + namespace CliffordAlgebra diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean index 486de0b537f949..5a89c42ec8c3c4 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation -import Mathlib.LinearAlgebra.CliffordAlgebra.Even -import Mathlib.LinearAlgebra.QuadraticForm.Prod +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +public import Mathlib.LinearAlgebra.CliffordAlgebra.Even +public import Mathlib.LinearAlgebra.QuadraticForm.Prod /-! # Isomorphisms with the even subalgebra of a Clifford algebra @@ -31,6 +33,8 @@ This file provides some notable isomorphisms regarding the even subalgebra, `Cli `CliffordAlgebra.involute`. -/ +@[expose] public section + namespace CliffordAlgebra diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Fold.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Fold.lean index 826a5e5393725f..7f7882e59d4d28 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Fold.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Fold.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation /-! # Recursive computation rules for the Clifford algebra @@ -28,6 +30,8 @@ For convenience, this file also provides `CliffordAlgebra.foldl`, implemented vi * `CliffordAlgebra.left_induction`: an induction rule that adds generators from the left. -/ +@[expose] public section + universe u1 u2 u3 diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Grading.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Grading.lean index ccc965ea0aad73..7007a2a46b67b3 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Grading.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Grading.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Basic -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Basic +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! # Results about the grading structure of the clifford algebra @@ -13,6 +15,8 @@ The main result is `CliffordAlgebra.gradedAlgebra`, which says that the clifford ℤ₂-graded algebra (or "superalgebra"). -/ +@[expose] public section + namespace CliffordAlgebra diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean index 1315f00d3ed3eb..ba4ade2b589417 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction /-! # Results about inverses in Clifford algebras @@ -11,6 +13,8 @@ This contains some basic results about the inversion of vectors, related to the $ι(m)^{-1} = \frac{ι(m)}{Q(m)}$. -/ +@[expose] public section + variable {R M : Type*} variable [CommRing R] [AddCommGroup M] [Module R M] {Q : QuadraticForm R M} diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Prod.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Prod.lean index b1c2105e98bc09..e6367c2099b785 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Prod.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Grading -import Mathlib.LinearAlgebra.TensorProduct.Graded.Internal -import Mathlib.LinearAlgebra.QuadraticForm.Prod +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Grading +public import Mathlib.LinearAlgebra.TensorProduct.Graded.Internal +public import Mathlib.LinearAlgebra.QuadraticForm.Prod /-! # Clifford algebras of a direct sum of two vector spaces @@ -24,6 +26,8 @@ to a graded algebra equivalence. -/ +@[expose] public section + suppress_compilation variable {R M₁ M₂ N : Type*} diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean index ad23c89424fcdf..1f30f2cab22686 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Jiale Miao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiale Miao, Utensil Song, Eric Wieser -/ -import Mathlib.Algebra.Ring.Action.ConjAct -import Mathlib.GroupTheory.GroupAction.ConjAct -import Mathlib.Algebra.Star.Unitary -import Mathlib.LinearAlgebra.CliffordAlgebra.Star -import Mathlib.LinearAlgebra.CliffordAlgebra.Even -import Mathlib.LinearAlgebra.CliffordAlgebra.Inversion +module + +public import Mathlib.Algebra.Ring.Action.ConjAct +public import Mathlib.GroupTheory.GroupAction.ConjAct +public import Mathlib.Algebra.Star.Unitary +public import Mathlib.LinearAlgebra.CliffordAlgebra.Star +public import Mathlib.LinearAlgebra.CliffordAlgebra.Even +public import Mathlib.LinearAlgebra.CliffordAlgebra.Inversion /-! # The Pin group and the Spin group @@ -43,6 +45,8 @@ https://mathoverflow.net/q/427881/172242 and https://mathoverflow.net/q/251288/1 Try to show the reverse statement is true in finite dimensions. -/ +@[expose] public section + variable {R : Type*} [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] variable {Q : QuadraticForm R M} diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Star.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Star.lean index e5985054502116..ddb5782d89b3e5 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Star.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Star.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation /-! # Star structure on `CliffordAlgebra` @@ -22,6 +24,8 @@ Most results about `star` can be obtained by unfolding it via `CliffordAlgebra.s -/ +@[expose] public section + variable {R : Type*} [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/Coevaluation.lean b/Mathlib/LinearAlgebra/Coevaluation.lean index 5f13772b56a9de..c47b8e15479f78 100644 --- a/Mathlib/LinearAlgebra/Coevaluation.lean +++ b/Mathlib/LinearAlgebra/Coevaluation.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.LinearAlgebra.Contraction +module + +public import Mathlib.LinearAlgebra.Contraction /-! # The coevaluation map on finite-dimensional vector spaces @@ -20,6 +22,8 @@ coevaluation, dual module, tensor product * Prove that this is independent of the choice of basis on `V`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Complex/Determinant.lean b/Mathlib/LinearAlgebra/Complex/Determinant.lean index 15ff0e47babfde..3999acc8444e46 100644 --- a/Mathlib/LinearAlgebra/Complex/Determinant.lean +++ b/Mathlib/LinearAlgebra/Complex/Determinant.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.LinearAlgebra.Determinant +module + +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.LinearAlgebra.Determinant /-! # Determinants of maps in the complex numbers as a vector space over `ℝ` @@ -14,6 +16,8 @@ space over `ℝ`. -/ +@[expose] public section + namespace Complex diff --git a/Mathlib/LinearAlgebra/Complex/FiniteDimensional.lean b/Mathlib/LinearAlgebra/Complex/FiniteDimensional.lean index 6dde44d8d72871..538d991d134071 100644 --- a/Mathlib/LinearAlgebra/Complex/FiniteDimensional.lean +++ b/Mathlib/LinearAlgebra/Complex/FiniteDimensional.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Alexander Bentkamp, Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Sébastien Gouëzel, Eric Wieser -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Analysis.Complex.Cardinality -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.Order.Interval.Set.Infinite +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Analysis.Complex.Cardinality +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.Order.Interval.Set.Infinite /-! # Complex number as a finite-dimensional vector space over `ℝ` @@ -16,11 +18,13 @@ This file contains the `FiniteDimensional ℝ ℂ` instance, as well as some res (`finrank` and `Module.rank`). -/ +@[expose] public section + open Module namespace Complex -instance : FiniteDimensional ℝ ℂ := .of_fintype_basis basisOneI +instance : FiniteDimensional ℝ ℂ := basisOneI.finiteDimensional_of_finite /-- `ℂ` is a finite extension of `ℝ` of degree 2, i.e `[ℂ : ℝ] = 2` -/ @[simp, stacks 09G4] diff --git a/Mathlib/LinearAlgebra/Complex/Module.lean b/Mathlib/LinearAlgebra/Complex/Module.lean index e541b2585a9c6d..0479b97ad45272 100644 --- a/Mathlib/LinearAlgebra/Complex/Module.lean +++ b/Mathlib/LinearAlgebra/Complex/Module.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Alexander Bentkamp, Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Sébastien Gouëzel, Eric Wieser -/ -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Data.Complex.Basic -import Mathlib.Data.Real.Star -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Data.Complex.Basic +public import Mathlib.Data.Real.Star +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Complex number as a vector space over `ℝ` @@ -41,6 +43,8 @@ element of a `StarModule` over `ℂ`. `ComplexStarModule`. -/ +@[expose] public section + assert_not_exists NNReal namespace Complex diff --git a/Mathlib/LinearAlgebra/Complex/Orientation.lean b/Mathlib/LinearAlgebra/Complex/Orientation.lean index 5668fe5206b489..a6d5a75a2412c2 100644 --- a/Mathlib/LinearAlgebra/Complex/Orientation.lean +++ b/Mathlib/LinearAlgebra/Complex/Orientation.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.LinearAlgebra.Orientation +module + +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.LinearAlgebra.Orientation /-! # The standard orientation on `ℂ`. @@ -13,6 +15,8 @@ This had previously been in `LinearAlgebra.Orientation`, but keeping it separate results in a significant import reduction. -/ +@[expose] public section + namespace Complex diff --git a/Mathlib/LinearAlgebra/Contraction.lean b/Mathlib/LinearAlgebra/Contraction.lean index 7fa8cb2084f46d..85dade5c9843b6 100644 --- a/Mathlib/LinearAlgebra/Contraction.lean +++ b/Mathlib/LinearAlgebra/Contraction.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Antoine Labelle -/ -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Contractions @@ -18,6 +20,8 @@ some basic properties of these maps. contraction, dual module, tensor product -/ +@[expose] public section + variable {ι : Type*} (R M N P Q : Type*) -- Enable extensionality of maps out of the tensor product. diff --git a/Mathlib/LinearAlgebra/Countable.lean b/Mathlib/LinearAlgebra/Countable.lean index 9b55032284e962..8e66b246f57ea8 100644 --- a/Mathlib/LinearAlgebra/Countable.lean +++ b/Mathlib/LinearAlgebra/Countable.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Finsupp.Encodable -import Mathlib.Data.Set.Countable -import Mathlib.LinearAlgebra.Finsupp.LinearCombination +module + +public import Mathlib.Data.Finsupp.Encodable +public import Mathlib.Data.Set.Countable +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination /-! # Countable modules -/ +@[expose] public section + noncomputable section namespace Finsupp diff --git a/Mathlib/LinearAlgebra/CrossProduct.lean b/Mathlib/LinearAlgebra/CrossProduct.lean index 11f18187f150fc..344c01c9603696 100644 --- a/Mathlib/LinearAlgebra/CrossProduct.lean +++ b/Mathlib/LinearAlgebra/CrossProduct.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Martin Dvorak. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Dvorak, Kyle Miller, Eric Wieser -/ -import Mathlib.Algebra.Lie.Basic -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.Notation +module + +public import Mathlib.Algebra.Lie.Basic +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.Notation /-! # Cross products @@ -36,6 +38,8 @@ The scope `Matrix` gives the following notation: cross product -/ +@[expose] public section + open Matrix @@ -66,7 +70,7 @@ end Matrix open Lean Elab Meta.Tactic Term in @[term_elab Matrix._root_.«term_×₃_», inherit_doc «term_×₃_»] -def elabDeprecatedCross : TermElab +meta def elabDeprecatedCross : TermElab | `($x ×₃%$tk $y) => fun ty? => do logWarningAt tk <| .tagged ``Linter.deprecatedAttr <| m!"The ×₃ notation has been deprecated" TryThis.addSuggestion tk { suggestion := "⨯₃" } diff --git a/Mathlib/LinearAlgebra/DFinsupp.lean b/Mathlib/LinearAlgebra/DFinsupp.lean index 1744eeabd5f191..ed08a4fb3dcc14 100644 --- a/Mathlib/LinearAlgebra/DFinsupp.lean +++ b/Mathlib/LinearAlgebra/DFinsupp.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau -/ -import Mathlib.Data.DFinsupp.Submonoid -import Mathlib.Data.DFinsupp.Sigma -import Mathlib.Data.Finsupp.ToDFinsupp -import Mathlib.LinearAlgebra.Finsupp.SumProd -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +module + +public import Mathlib.Data.DFinsupp.Submonoid +public import Mathlib.Data.DFinsupp.Sigma +public import Mathlib.Data.Finsupp.ToDFinsupp +public import Mathlib.LinearAlgebra.Finsupp.SumProd +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas /-! # Properties of the module `Π₀ i, M i` @@ -35,6 +37,8 @@ much more developed, but many lemmas in that file should be eligible to copy ove function with finite support, module, linear algebra -/ +@[expose] public section + variable {ι ι' : Type*} {R : Type*} {S : Type*} {M : ι → Type*} {N : Type*} namespace DFinsupp diff --git a/Mathlib/LinearAlgebra/Determinant.lean b/Mathlib/LinearAlgebra/Determinant.lean index a06f03c89ecb2b..89b4be32c7d399 100644 --- a/Mathlib/LinearAlgebra/Determinant.lean +++ b/Mathlib/LinearAlgebra/Determinant.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.LinearAlgebra.Matrix.Reindex -import Mathlib.Tactic.FieldSimp -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.LinearAlgebra.Matrix.Basis -import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv - +module + +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.LinearAlgebra.Matrix.Reindex +public import Mathlib.Tactic.FieldSimp +public import Mathlib.LinearAlgebra.Dual.Basis +public import Mathlib.LinearAlgebra.Matrix.Dual +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.LinearAlgebra.Matrix.Basis +public import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv +public import Mathlib.RingTheory.Finiteness.Cardinality /-! # Determinant of families of vectors @@ -38,6 +42,8 @@ types used for indexing. basis, det, determinant -/ +@[expose] public section + noncomputable section @@ -486,6 +492,35 @@ theorem LinearEquiv.coe_ofIsUnitDet {f : M →ₗ[R] M'} {v : Basis ι R M} {v' ext x rfl +/-- Builds a linear equivalence from an endomorphism whose determinant is a unit. -/ +noncomputable def LinearMap.equivOfIsUnitDet + [Module.Free R M] [Module.Finite R M] + {f : M →ₗ[R] M} (h : IsUnit f.det) : + M ≃ₗ[R] M := by + by_cases hR : Nontrivial R + · let ⟨ι, b⟩ := (Module.Free.exists_basis R M).some + have : Finite ι := Module.Finite.finite_basis b + have : Fintype ι := Fintype.ofFinite ι + have : DecidableEq ι := Classical.typeDecidableEq ι + exact LinearEquiv.ofIsUnitDet (by rwa [det_toMatrix b]) + · exact 1 + +@[simp] +theorem LinearMap.equivOfIsUnitDet_apply + [Module.Free R M] [Module.Finite R M] + {f : M →ₗ[R] M} (h : IsUnit f.det) (x : M) : + (LinearMap.equivOfIsUnitDet h) x = f x := by + nontriviality M + simp [equivOfIsUnitDet, dif_pos (Module.nontrivial R M)] + +@[simp] +theorem LinearMap.coe_equivOfIsUnitDet + [Module.Free R M] [Module.Finite R M] + {f : M →ₗ[R] M} (h : IsUnit f.det) : + (LinearMap.equivOfIsUnitDet h : M →ₗ[R] M) = f := by + ext + apply LinearMap.equivOfIsUnitDet_apply + /-- Builds a linear equivalence from a linear map on a finite-dimensional vector space whose determinant is nonzero. -/ abbrev LinearMap.equivOfDetNeZero {𝕜 : Type*} [Field 𝕜] {M : Type*} [AddCommGroup M] [Module 𝕜 M] @@ -705,3 +740,17 @@ theorem det_isUnitSMul {w : ι → R} (hw : ∀ i, IsUnit (w i)) : e.det_unitsSMul_self _ end Module.Basis + +section Dual + +/-- The determinant of the transpose of an endomorphism coincides with its determinant. -/ +theorem _root_.LinearMap.det_dualMap + [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M) : + f.dualMap.det = f.det := by + set b := Module.Free.chooseBasis R M + have : Fintype (Module.Free.ChooseBasisIndex R M) := + Module.Free.ChooseBasisIndex.fintype R M + rw [← LinearMap.det_toMatrix b, ← LinearMap.det_toMatrix b.dualBasis] + simp [LinearMap.dualMap_def, LinearMap.toMatrix_transpose] + +end Dual diff --git a/Mathlib/LinearAlgebra/Dimension/Basic.lean b/Mathlib/LinearAlgebra/Dimension/Basic.lean index bfe30020a4e8f9..3d1c704e62a704 100644 --- a/Mathlib/LinearAlgebra/Dimension/Basic.lean +++ b/Mathlib/LinearAlgebra/Dimension/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Sander Dahmen, Kim Morrison -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.LinearAlgebra.LinearIndependent.Basic -import Mathlib.Data.Set.Card +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.LinearAlgebra.LinearIndependent.Basic +public import Mathlib.Data.Set.Card /-! # Dimension of modules and vector spaces @@ -30,6 +32,8 @@ inserting `lift`s. The types `M`, `M'`, ... all live in different universes, and `M₁`, `M₂`, ... all live in the same universe. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Dimension/Constructions.lean b/Mathlib/LinearAlgebra/Dimension/Constructions.lean index 0226765ea02e7a..81553bd5552d5c 100644 --- a/Mathlib/LinearAlgebra/Dimension/Constructions.lean +++ b/Mathlib/LinearAlgebra/Dimension/Constructions.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Sander Dahmen, Kim Morrison, Chris Hughes, Anne Baanen -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.LinearAlgebra.Basis.Prod -import Mathlib.LinearAlgebra.Dimension.Free -import Mathlib.LinearAlgebra.TensorProduct.Basis +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.LinearAlgebra.Basis.Prod +public import Mathlib.LinearAlgebra.Dimension.Free +public import Mathlib.LinearAlgebra.TensorProduct.Basis /-! # Rank of various constructions @@ -29,6 +31,8 @@ We have `finrank` variants for most lemmas as well. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Dimension/DivisionRing.lean b/Mathlib/LinearAlgebra/Dimension/DivisionRing.lean index 2ae8f40a686168..b77d62c15870ba 100644 --- a/Mathlib/LinearAlgebra/Dimension/DivisionRing.lean +++ b/Mathlib/LinearAlgebra/Dimension/DivisionRing.lean @@ -4,9 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Sander Dahmen, Kim Morrison, Chris Hughes, Anne Baanen, Junyan Xu -/ -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.LinearAlgebra.Dimension.RankNullity +module + +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.LinearAlgebra.Dimension.RankNullity /-! # Dimension of vector spaces @@ -26,6 +28,8 @@ See also `Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean` for the Erdős-Ka -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean b/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean index db296fb2e43482..e209701eee409c 100644 --- a/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean +++ b/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Field.Opposite -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.SetTheory.Cardinal.Subfield +module + +public import Mathlib.Algebra.Field.Opposite +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.SetTheory.Cardinal.Subfield /-! # Erdős-Kaplansky theorem @@ -17,6 +19,8 @@ import Mathlib.SetTheory.Cardinal.Subfield -/ +@[expose] public section + noncomputable section universe u v diff --git a/Mathlib/LinearAlgebra/Dimension/Finite.lean b/Mathlib/LinearAlgebra/Dimension/Finite.lean index 473d81ef12b262..b28db9757578e0 100644 --- a/Mathlib/LinearAlgebra/Dimension/Finite.lean +++ b/Mathlib/LinearAlgebra/Dimension/Finite.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Sander Dahmen, Kim Morrison -/ -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.Dimension.Subsingleton -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.SetTheory.Cardinal.Cofinality +module + +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.Dimension.Subsingleton +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.SetTheory.Cardinal.Cofinality /-! # Conditions for rank to be finite @@ -16,6 +18,8 @@ Also contains characterization for when rank equals zero or rank equals one. -/ +@[expose] public section + noncomputable section universe u v v' w diff --git a/Mathlib/LinearAlgebra/Dimension/Finrank.lean b/Mathlib/LinearAlgebra/Dimension/Finrank.lean index bf86a3bbc6a0f7..cee9a227b929cc 100644 --- a/Mathlib/LinearAlgebra/Dimension/Finrank.lean +++ b/Mathlib/LinearAlgebra/Dimension/Finrank.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Anne Baanen -/ -import Mathlib.LinearAlgebra.Dimension.Subsingleton -import Mathlib.SetTheory.Cardinal.ToNat +module + +public import Mathlib.LinearAlgebra.Dimension.Subsingleton +public import Mathlib.SetTheory.Cardinal.ToNat /-! # Finite dimension of vector spaces @@ -30,6 +32,8 @@ in `Dimension.lean`. Not all results have been ported yet. You should not assume that there has been any effort to state lemmas as generally as possible. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/LinearAlgebra/Dimension/Free.lean b/Mathlib/LinearAlgebra/Dimension/Free.lean index 32e37338cb96be..9f4922e4e24836 100644 --- a/Mathlib/LinearAlgebra/Dimension/Free.lean +++ b/Mathlib/LinearAlgebra/Dimension/Free.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.RingTheory.AlgebraTower -import Mathlib.SetTheory.Cardinal.Finsupp +module + +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.RingTheory.AlgebraTower +public import Mathlib.SetTheory.Cardinal.Finsupp /-! # Rank of free modules @@ -19,6 +21,8 @@ import Mathlib.SetTheory.Cardinal.Finsupp -/ +@[expose] public section + noncomputable section @@ -242,6 +246,24 @@ noncomputable def basisUnique (ι : Type*) [Unique ι] Module.finite_of_finrank_pos (_root_.zero_lt_one.trans_le h.symm.le) (finBasisOfFinrankEq R M h).reindex (Equiv.ofUnique _ _) +/-- If a finite module of `finrank 1` has a basis, then this basis has a unique element. -/ +theorem Basis.nonempty_unique_index_of_finrank_eq_one + {ι : Type*} (b : Module.Basis ι R M) (d1 : Module.finrank R M = 1) : + Nonempty (Unique ι) := by + -- why isn't this an instance? + have : Nontrivial R := nontrivial_of_invariantBasisNumber R + haveI : Module.Finite R M := + Module.finite_of_finrank_pos (Nat.lt_of_sub_eq_succ d1) + have : Finite ι := Module.Finite.finite_basis b + have : Fintype ι := Fintype.ofFinite ι + rwa [Module.finrank_eq_card_basis b, Fintype.card_eq_one_iff_nonempty_unique] at d1 + +theorem nonempty_linearEquiv_of_finrank_eq_one (d1 : Module.finrank R M = 1) : + Nonempty (R ≃ₗ[R] M) := by + let ⟨ι, b⟩ := (Module.Free.exists_basis R M).some + have : Unique ι := (b.nonempty_unique_index_of_finrank_eq_one d1).some + exact ⟨((b.equivFun).trans (LinearEquiv.funUnique ι R R)).symm⟩ + @[simp] theorem basisUnique_repr_eq_zero_iff {ι : Type*} [Unique ι] {h : finrank R M = 1} {v : M} {i : ι} : @@ -250,6 +272,38 @@ theorem basisUnique_repr_eq_zero_iff {ι : Type*} [Unique ι] (basisUnique ι h).repr.map_eq_zero_iff.mp (Finsupp.ext fun j => Subsingleton.elim i j ▸ hv), fun hv => by rw [hv, LinearEquiv.map_zero, Finsupp.zero_apply]⟩ +variable {R : Type*} [CommSemiring R] [StrongRankCondition R] + {M : Type*} [AddCommMonoid M] [Module R M] [Module.Free R M] + +theorem _root_.LinearMap.existsUnique_eq_smul_id_of_finrank_eq_one + (d1 : Module.finrank R M = 1) (u : M →ₗ[R] M) : + ∃! c : R, u = c • LinearMap.id := by + let e := (nonempty_linearEquiv_of_finrank_eq_one d1).some + set c := e.symm (u (e 1)) with hc + suffices u = c • LinearMap.id by + use c + simp only [this, true_and] + intro d hcd + rw [LinearMap.ext_iff] at hcd + simpa using (LinearEquiv.congr_arg (e := e.symm) (hcd (e 1))).symm + ext x + have (x : M) : x = (e.symm x) • (e 1) := by simp [← LinearEquiv.map_smul] + rw [this x] + simp only [hc, map_smul, LinearMap.smul_apply, LinearMap.id_coe, id_eq] + rw [← this] + +/-- Endomorphisms of a free module of rank one are homotheties. -/ +@[simps apply] +noncomputable def _root_.LinearEquiv.smul_id_of_finrank_eq_one (d1 : Module.finrank R M = 1) : + R ≃ₗ[R] (M →ₗ[R] M) where + toFun := fun c ↦ c • LinearMap.id + map_add' c d := by ext; simp [add_smul] + map_smul' c d := by ext; simp [mul_smul] + invFun u := (u.existsUnique_eq_smul_id_of_finrank_eq_one d1).choose + left_inv c := by + simp [← (LinearMap.existsUnique_eq_smul_id_of_finrank_eq_one d1 _).choose_spec.2 c] + right_inv u := ((u.existsUnique_eq_smul_id_of_finrank_eq_one d1).choose_spec.1).symm + end Module namespace Algebra diff --git a/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean b/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean index ab22239b0598b0..4b53ee1e1398d5 100644 --- a/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean +++ b/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.Dimension.Subsingleton +module + +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.Dimension.Subsingleton /-! @@ -17,6 +19,8 @@ and `Mathlib/LinearAlgebra/FiniteDimensional.lean`. -/ +@[expose] public section + open Cardinal Module Module Set Submodule universe u v @@ -170,7 +174,8 @@ theorem Module.rank_le_one_iff_top_isPrincipal [Module.Free K V] : rw [← Submodule.rank_le_one_iff_isPrincipal, rank_top] /-- A module has dimension 1 iff there is some `v : V` so `{v}` is a basis. --/ + +See also `Module.Basis.nonempty_unique_index_of_finrank_eq_one` -/ theorem finrank_eq_one_iff [Module.Free K V] (ι : Type*) [Unique ι] : finrank K V = 1 ↔ Nonempty (Basis ι K V) := by constructor diff --git a/Mathlib/LinearAlgebra/Dimension/LinearMap.lean b/Mathlib/LinearAlgebra/Dimension/LinearMap.lean index 2fb84b2ed86219..6a04777c2ea4d9 100644 --- a/Mathlib/LinearAlgebra/Dimension/LinearMap.lean +++ b/Mathlib/LinearAlgebra/Dimension/LinearMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Module.Projective -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +module + +public import Mathlib.Algebra.Module.Projective +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition /-! # The rank of a linear map @@ -14,6 +16,8 @@ import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition - `LinearMap.rank`: The rank of a linear map. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Dimension/Localization.lean b/Mathlib/LinearAlgebra/Dimension/Localization.lean index 2f785816e217f9..f08fdb53246fc2 100644 --- a/Mathlib/LinearAlgebra/Dimension/Localization.lean +++ b/Mathlib/LinearAlgebra/Dimension/Localization.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.LocalizedModule.Submodule -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.RingTheory.IsTensorProduct -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.OreLocalization.OreSet +module + +public import Mathlib.Algebra.Module.LocalizedModule.Submodule +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.OreLocalization.OreSet /-! # Rank of localization @@ -19,6 +21,8 @@ import Mathlib.RingTheory.OreLocalization.OreSet - `rank_quotient_add_rank_of_isDomain`: The **rank-nullity theorem** for commutative domains. -/ +@[expose] public section + open Cardinal Module nonZeroDivisors section CommRing diff --git a/Mathlib/LinearAlgebra/Dimension/RankNullity.lean b/Mathlib/LinearAlgebra/Dimension/RankNullity.lean index 8734a0785db989..d95e56b12bffec 100644 --- a/Mathlib/LinearAlgebra/Dimension/RankNullity.lean +++ b/Mathlib/LinearAlgebra/Dimension/RankNullity.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.Logic.Equiv.Fin.Rotate +module + +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.Logic.Equiv.Fin.Rotate /-! @@ -24,6 +26,8 @@ The following instances are provided in mathlib: TODO: prove the rank-nullity theorem for `[Ring R] [IsDomain R] [StrongRankCondition R]`. See `nonempty_oreSet_of_strongRankCondition` for a start. -/ + +@[expose] public section universe u v open Function Set Cardinal Submodule LinearMap diff --git a/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean b/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean index d1f121081a0bcb..6f47f4ebb2aad6 100644 --- a/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean +++ b/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Basis.Submodule -import Mathlib.LinearAlgebra.Dimension.Finrank -import Mathlib.LinearAlgebra.InvariantBasisNumber +module + +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Basis.Submodule +public import Mathlib.LinearAlgebra.Dimension.Finrank +public import Mathlib.LinearAlgebra.InvariantBasisNumber /-! # Lemmas about rank and `finrank` in rings satisfying strong rank condition. @@ -42,6 +44,8 @@ For modules over rings with invariant basis number -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Dimension/Subsingleton.lean b/Mathlib/LinearAlgebra/Dimension/Subsingleton.lean index a801c49ed59a21..94748320bd53d6 100644 --- a/Mathlib/LinearAlgebra/Dimension/Subsingleton.lean +++ b/Mathlib/LinearAlgebra/Dimension/Subsingleton.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison, Eric Wieser, Junyan Xu, Andrew Yang -/ -import Mathlib.LinearAlgebra.Dimension.Basic +module + +public import Mathlib.LinearAlgebra.Dimension.Basic /-! # Dimension of trivial modules -/ +@[expose] public section + variable (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M] section diff --git a/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean b/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean index 3251561f21fbf0..f82492e42fdf40 100644 --- a/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean +++ b/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.Dimension.Subsingleton +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.Dimension.Subsingleton /-! # Rank and torsion @@ -15,6 +17,8 @@ import Mathlib.LinearAlgebra.Dimension.Subsingleton - `rank_quotient_eq_of_le_torsion` : `rank M/N = rank M` if `N ≤ torsion M`. -/ +@[expose] public section + open Submodule theorem rank_quotient_eq_of_le_torsion {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/Dimension/Torsion/Finite.lean b/Mathlib/LinearAlgebra/Dimension/Torsion/Finite.lean index 5467878d325f12..44645c2effcc18 100644 --- a/Mathlib/LinearAlgebra/Dimension/Torsion/Finite.lean +++ b/Mathlib/LinearAlgebra/Dimension/Torsion/Finite.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl, Sander Dahmen, Kim Morrison -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.LinearAlgebra.Dimension.Finite +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.LinearAlgebra.Dimension.Finite /-! # Results relating rank and torsion. -/ +@[expose] public section + variable {R M : Type*} [CommRing R] [IsDomain R] [AddCommGroup M] [Module R M] lemma rank_eq_zero_iff_isTorsion : Module.rank R M = 0 ↔ Module.IsTorsion R M := by diff --git a/Mathlib/LinearAlgebra/DirectSum/Basis.lean b/Mathlib/LinearAlgebra/DirectSum/Basis.lean index 92ff32c19f4f71..17acb9f0b96846 100644 --- a/Mathlib/LinearAlgebra/DirectSum/Basis.lean +++ b/Mathlib/LinearAlgebra/DirectSum/Basis.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.LinearAlgebra.Finsupp.VectorSpace +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace /-! # Bases for direct sum of modules @@ -17,6 +19,8 @@ Currently, to get a basis on `⨁ i, M i` from a basis on each `M i`, use `DFins (using that the types are defeq). -/ +@[expose] public section + open DirectSum section Semiring diff --git a/Mathlib/LinearAlgebra/DirectSum/Finite.lean b/Mathlib/LinearAlgebra/DirectSum/Finite.lean index 6f239c28ce1715..41ab8e7ba3b6d1 100644 --- a/Mathlib/LinearAlgebra/DirectSum/Finite.lean +++ b/Mathlib/LinearAlgebra/DirectSum/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.RingTheory.Finiteness.Basic /-! # A finite direct sum of finite modules is finite @@ -13,6 +15,8 @@ This file defines a `Module.Finite` instance for a finite direct sum of finite m -/ +@[expose] public section + open DirectSum variable {R ι : Type*} [Semiring R] [Finite ι] (M : ι → Type*) diff --git a/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean b/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean index 29312517971cd6..732be7fff75dd4 100644 --- a/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean +++ b/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Antoine Chambert-Loir -/ -import Mathlib.Algebra.DirectSum.Finsupp -import Mathlib.LinearAlgebra.DirectSum.TensorProduct -import Mathlib.LinearAlgebra.Finsupp.SumProd +module + +public import Mathlib.Algebra.DirectSum.Finsupp +public import Mathlib.LinearAlgebra.DirectSum.TensorProduct +public import Mathlib.LinearAlgebra.Finsupp.SumProd /-! # Results on finitely supported functions. @@ -59,6 +61,8 @@ This belongs to a companion PR. * reprove `TensorProduct.finsuppLeft'` using existing heterobasic version of `TensorProduct.congr` -/ +@[expose] public section + noncomputable section @@ -156,7 +160,7 @@ lemma finsuppLeft_smul' (s : S) (t : (ι →₀ M) ⊗[R] N) : | tmul p n => ext; simp [smul_tmul', finsuppLeft_apply_tmul_apply] variable (R M N ι S) -/-- When `M` is also an `S`-module, then `TensorProduct.finsuppLeft R M N`` +/-- When `M` is also an `S`-module, then `TensorProduct.finsuppLeft R M N` is an `S`-linear equiv -/ noncomputable def finsuppLeft' : (ι →₀ M) ⊗[R] N ≃ₗ[S] ι →₀ M ⊗[R] N where diff --git a/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean b/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean index 62771d2976d5c5..4603974d0af0ff 100644 --- a/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.Algebra.DirectSum.Module +module + +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.Algebra.DirectSum.Module /-! # Tensor products of direct sums @@ -17,6 +19,8 @@ This file shows that taking `TensorProduct`s commutes with taking `DirectSum`s i * `TensorProduct.directSumRight` -/ +@[expose] public section + universe u v₁ v₂ w₁ w₁' w₂ w₂' section Ring diff --git a/Mathlib/LinearAlgebra/Dual/Basis.lean b/Mathlib/LinearAlgebra/Dual/Basis.lean index e97ed8e1871d6a..375fb594459d77 100644 --- a/Mathlib/LinearAlgebra/Dual/Basis.lean +++ b/Mathlib/LinearAlgebra/Dual/Basis.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Fabian Glöckle, Kyle Miller -/ -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.Dual.Defs +module + +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.Dual.Defs /-! # Bases of dual vector spaces @@ -30,6 +32,8 @@ This file concerns bases on dual vector spaces. then `ε` is a basis. -/ +@[expose] public section + open Module Dual Submodule LinearMap Function noncomputable section @@ -209,7 +213,7 @@ variable [CommSemiring R] [AddCommMonoid M] [Module R M] open Lean.Elab.Tactic in /-- Try using `Set.toFinite` to dispatch a `Set.Finite` goal. -/ -def evalUseFiniteInstance : TacticM Unit := do +meta def evalUseFiniteInstance : TacticM Unit := do evalTactic (← `(tactic| intros; apply Set.toFinite)) elab "use_finite_instance" : tactic => evalUseFiniteInstance diff --git a/Mathlib/LinearAlgebra/Dual/Defs.lean b/Mathlib/LinearAlgebra/Dual/Defs.lean index c6b1771bb3adbc..765410cfdd416c 100644 --- a/Mathlib/LinearAlgebra/Dual/Defs.lean +++ b/Mathlib/LinearAlgebra/Dual/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Fabian Glöckle, Kyle Miller -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.Span.Defs +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.Span.Defs /-! # Dual vector spaces @@ -39,6 +41,8 @@ The dual space of an $R$-module $M$ is the $R$-module of $R$-linear maps $M \to subspaces of `Dual K (Dual K V)`. -/ +@[expose] public section + open Module Submodule noncomputable section diff --git a/Mathlib/LinearAlgebra/Dual/Lemmas.lean b/Mathlib/LinearAlgebra/Dual/Lemmas.lean index d97da0070290d6..ae8636a1eb6233 100644 --- a/Mathlib/LinearAlgebra/Dual/Lemmas.lean +++ b/Mathlib/LinearAlgebra/Dual/Lemmas.lean @@ -3,19 +3,21 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Fabian Glöckle, Kyle Miller -/ -import Mathlib.Algebra.Module.LinearMap.DivisionRing -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Dimension.ErdosKaplansky -import Mathlib.LinearAlgebra.Dual.Basis -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber -import Mathlib.LinearAlgebra.Projection -import Mathlib.LinearAlgebra.SesquilinearForm.Basic -import Mathlib.RingTheory.Finiteness.Projective -import Mathlib.RingTheory.LocalRing.Basic -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.Algebra.Module.LinearMap.DivisionRing +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Dimension.ErdosKaplansky +public import Mathlib.LinearAlgebra.Dual.Basis +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber +public import Mathlib.LinearAlgebra.Projection +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic +public import Mathlib.RingTheory.Finiteness.Projective +public import Mathlib.RingTheory.LocalRing.Basic +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Dual vector spaces @@ -70,6 +72,8 @@ This file contains basic results on dual vector spaces. splitting of `V₁`. -/ +@[expose] public section + open Module Submodule noncomputable section diff --git a/Mathlib/LinearAlgebra/Eigenspace/Basic.lean b/Mathlib/LinearAlgebra/Eigenspace/Basic.lean index a11178c0e0db3e..30f32a14f3ca22 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Basic.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.Algebra.Algebra.Spectrum.Basic -import Mathlib.Algebra.Module.LinearMap.Basic -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.RingTheory.Nilpotent.Defs -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.Tactic.Peel +module + +public import Mathlib.Algebra.Algebra.Spectrum.Basic +public import Mathlib.Algebra.Module.LinearMap.Basic +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.Tactic.Peel /-! # Eigenvectors and eigenvalues @@ -49,6 +51,8 @@ The existence of eigenvalues over an algebraically closed field eigenspace, eigenvector, eigenvalue, eigen -/ +@[expose] public section + universe u v w diff --git a/Mathlib/LinearAlgebra/Eigenspace/Charpoly.lean b/Mathlib/LinearAlgebra/Eigenspace/Charpoly.lean index 731949b5034cf0..0c98b5188d53ae 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Charpoly.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Charpoly.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Lawrence Wu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lawrence Wu -/ -import Mathlib.LinearAlgebra.Charpoly.BaseChange -import Mathlib.LinearAlgebra.Charpoly.ToMatrix -import Mathlib.LinearAlgebra.Eigenspace.Basic +module + +public import Mathlib.LinearAlgebra.Charpoly.BaseChange +public import Mathlib.LinearAlgebra.Charpoly.ToMatrix +public import Mathlib.LinearAlgebra.Eigenspace.Basic /-! # Eigenvalues are the roots of the characteristic polynomial. @@ -15,6 +17,8 @@ import Mathlib.LinearAlgebra.Eigenspace.Basic eigenvalue, characteristic polynomial -/ +@[expose] public section + namespace Module namespace End diff --git a/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean b/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean index 6f4162af36f36e..ffdc8a9e400860 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Jon Bannon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Bannon, Jireh Loreaux -/ +module -import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.LinearAlgebra.Eigenspace.Basic /-! @@ -18,6 +19,8 @@ eigenspace, eigenvector, eigenvalue, spectrum, matrix -/ +@[expose] public section + section SpectrumDiagonal variable {R n M : Type*} [DecidableEq n] [Fintype n] diff --git a/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean b/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean index b8770b6b1ee33e..9af7437b9480a6 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.FieldTheory.Minpoly.Basic -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.RingTheory.IntegralClosure.Algebra.Basic +module + +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.FieldTheory.Minpoly.Basic +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.RingTheory.IntegralClosure.Algebra.Basic /-! # Eigenvalues are the roots of the minimal polynomial. @@ -16,6 +18,8 @@ import Mathlib.RingTheory.IntegralClosure.Algebra.Basic eigenvalue, minimal polynomial -/ +@[expose] public section + universe u v w diff --git a/Mathlib/LinearAlgebra/Eigenspace/Pi.lean b/Mathlib/LinearAlgebra/Eigenspace/Pi.lean index 13246a99c4affb..0a05bd44e1a5be 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Pi.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.Eigenspace.Triangularizable +module + +public import Mathlib.LinearAlgebra.Eigenspace.Triangularizable /-! # Simultaneous eigenvectors and eigenvalues for families of endomorphisms @@ -24,6 +26,8 @@ for commuting endomorphisms but there are important more general situations wher -/ +@[expose] public section + open Function Set namespace Module.End diff --git a/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean b/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean index a95e808fdfaa9b..0b8aff68b7ea4c 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.LinearAlgebra.Semisimple +module + +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.LinearAlgebra.Semisimple /-! # Eigenspaces of semisimple linear endomorphisms @@ -19,6 +21,8 @@ endomorphisms. -/ +@[expose] public section + open Function Set namespace Module.End diff --git a/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean b/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean index d800bbb638d94b..c09d0f73b9e4d8 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.FieldTheory.IsAlgClosed.Spectrum -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +module + +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.FieldTheory.IsAlgClosed.Spectrum +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # Triangularizable linear endomorphisms @@ -38,6 +40,8 @@ generalized eigenspaces span the whole space. eigenspace, eigenvector, eigenvalue, eigen -/ +@[expose] public section + open Set Function Module Module variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] diff --git a/Mathlib/LinearAlgebra/Eigenspace/Zero.lean b/Mathlib/LinearAlgebra/Eigenspace/Zero.lean index 39c3464cd313c9..6416f0d9a8dd25 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Zero.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Zero.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.LinearAlgebra.Charpoly.ToMatrix -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Eigenspace.Minpoly -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.RingTheory.Artinian.Module +module + +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.LinearAlgebra.Charpoly.ToMatrix +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Eigenspace.Minpoly +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.RingTheory.Artinian.Module /-! # Results on the eigenvalue 0 @@ -30,6 +32,8 @@ such as being nilpotent, having determinant equal to 0, having a non-trivial ker -/ +@[expose] public section + variable {R K M : Type*} [CommRing R] [IsDomain R] [Field K] [AddCommGroup M] variable [Module R M] [Module.Finite R M] [Module.Free R M] variable [Module K M] [Module.Finite K M] diff --git a/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean b/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean index 265a2e917cc08a..f83daeb665598a 100644 --- a/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhangir Azerbayev, Adam Topaz, Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Basic -import Mathlib.LinearAlgebra.Alternating.Curry +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Basic +public import Mathlib.LinearAlgebra.Alternating.Curry /-! # Exterior Algebras @@ -44,6 +46,8 @@ The exterior algebra of `M` is constructed as simply `CliffordAlgebra (0 : Quadr as this avoids us having to duplicate API. -/ +@[expose] public section + universe u1 u2 u3 u4 u5 diff --git a/Mathlib/LinearAlgebra/ExteriorAlgebra/Grading.lean b/Mathlib/LinearAlgebra/ExteriorAlgebra/Grading.lean index 815bb1c481bcdb..14fe1996f80c53 100644 --- a/Mathlib/LinearAlgebra/ExteriorAlgebra/Grading.lean +++ b/Mathlib/LinearAlgebra/ExteriorAlgebra/Grading.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! # Results about the grading structure of the exterior algebra @@ -15,6 +17,8 @@ The main result is `ExteriorAlgebra.gradedAlgebra`, which says that the exterior ℕ-graded algebra. -/ +@[expose] public section + namespace ExteriorAlgebra variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean b/Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean index 5aad0631df420b..ccbbdfbe10f949 100644 --- a/Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean +++ b/Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.CliffordAlgebra.Fold -import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic +module + +public import Mathlib.LinearAlgebra.CliffordAlgebra.Fold +public import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic /-! # Extending an alternating map to the exterior algebra @@ -22,6 +24,8 @@ import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic -/ +@[expose] public section + variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] diff --git a/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean b/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean index 2799024009b7d5..b4d43466eb8454 100644 --- a/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean +++ b/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel, Joël Riou -/ -import Mathlib.Algebra.Module.Presentation.Basic -import Mathlib.LinearAlgebra.ExteriorAlgebra.OfAlternating +module + +public import Mathlib.Algebra.Module.Presentation.Basic +public import Mathlib.LinearAlgebra.ExteriorAlgebra.OfAlternating /-! # Exterior powers @@ -31,6 +33,8 @@ We study the exterior powers of a module `M` over a commutative ring `R`. -/ +@[expose] public section + open scoped TensorProduct universe u diff --git a/Mathlib/LinearAlgebra/ExteriorPower/Pairing.lean b/Mathlib/LinearAlgebra/ExteriorPower/Pairing.lean index 1613b9eeb36d89..7373e581eebbd9 100644 --- a/Mathlib/LinearAlgebra/ExteriorPower/Pairing.lean +++ b/Mathlib/LinearAlgebra/ExteriorPower/Pairing.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Sophie Morel -/ +module -import Mathlib.LinearAlgebra.ExteriorPower.Basic -import Mathlib.LinearAlgebra.TensorPower.Pairing +public import Mathlib.LinearAlgebra.ExteriorPower.Basic +public import Mathlib.LinearAlgebra.TensorPower.Pairing /-! # The pairing between the exterior power of the dual and the exterior power @@ -15,6 +16,8 @@ We construct the pairing -/ +@[expose] public section + namespace exteriorPower open TensorProduct PiTensorProduct diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean index 44609ca1f6ab16..b972b86ce75cbd 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Module.Projective -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.LinearAlgebra.FiniteDimensional.Defs +module + +public import Mathlib.Algebra.Module.Projective +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs /-! # Finite-dimensional vector spaces @@ -34,6 +36,8 @@ Plenty of the results hold for general fg modules or Noetherian modules, and the `Mathlib/LinearAlgebra/FreeModule/Finite/Rank.lean` and `Mathlib/RingTheory/Noetherian.lean`. -/ +@[expose] public section + universe u v v' w open Cardinal Function IsNoetherian Module Submodule diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean index 94ffa566174ae5..bf8c5a3c9730c7 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.Dimension.Free -import Mathlib.RingTheory.SimpleRing.Basic +module + +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.Dimension.Free +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Finite-dimensional vector spaces @@ -32,7 +34,7 @@ that all these points of view are equivalent, with the following lemmas is `Fin` (in `Mathlib/LinearAlgebra/Dimension/Free.lean`) - `fintypeBasisIndex` states that a finite-dimensional vector space has a finite basis -- `of_fintype_basis` states that the existence of a basis indexed by a +- `Module.Basis.finiteDimensional_of_finite` states that the existence of a basis indexed by a finite type implies finite-dimensionality - `of_finite_basis` states that the existence of a basis indexed by a finite set implies finite-dimensionality @@ -59,6 +61,8 @@ Plenty of the results hold for general fg modules or Noetherian modules, and the `Mathlib/LinearAlgebra/FreeModule/Finite/Rank.lean` and `Mathlib/RingTheory/Noetherian.lean`. -/ +@[expose] public section + assert_not_exists Module.Projective Subalgebra universe u v v' w @@ -66,7 +70,7 @@ universe u v v' w open Cardinal Module Submodule /-- `FiniteDimensional` vector spaces are defined to be finite modules. -Use `FiniteDimensional.of_fintype_basis` to prove finite dimension from another definition. -/ +Use `Module.Basis.finiteDimensional_of_finite` to prove finite dimension from another definition. -/ abbrev FiniteDimensional (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] := Module.Finite K V @@ -98,9 +102,13 @@ instance finiteDimensional_pi' {ι : Type*} [Finite ι] (M : ι → Type*) [∀ variable {K V} /-- If a vector space has a finite basis, then it is finite-dimensional. -/ -theorem of_fintype_basis {ι : Type w} [Finite ι] (h : Basis ι K V) : FiniteDimensional K V := +theorem _root_.Module.Basis.finiteDimensional_of_finite {ι : Type w} [Finite ι] (h : Basis ι K V) : + FiniteDimensional K V := Module.Finite.of_basis h +@[deprecated (since := "2025-11-12")] +alias of_fintype_basis := Module.Basis.finiteDimensional_of_finite + /-- If a vector space is `FiniteDimensional`, all bases are indexed by a finite type -/ noncomputable def fintypeBasisIndex {ι : Type*} [FiniteDimensional K V] (b : Basis ι K V) : Fintype ι := @@ -116,7 +124,7 @@ finite-dimensional. -/ theorem of_finite_basis {ι : Type w} {s : Set ι} (h : Basis s K V) (hs : Set.Finite s) : FiniteDimensional K V := haveI := hs.fintype - of_fintype_basis h + h.finiteDimensional_of_finite /-- A subspace of a finite-dimensional space is also finite-dimensional. diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean index 50255305af17d6..65fdbde4092764 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition -import Mathlib.LinearAlgebra.FiniteDimensional.Basic -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +public import Mathlib.LinearAlgebra.FiniteDimensional.Basic +public import Mathlib.Tactic.IntervalCases /-! # Finite-dimensional vector spaces @@ -18,6 +20,8 @@ Definitions are in `Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean` and results that require fewer imports are in `Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean`. -/ +@[expose] public section + assert_not_exists Monoid.exponent Module.IsTorsion diff --git a/Mathlib/LinearAlgebra/FiniteSpan.lean b/Mathlib/LinearAlgebra/FiniteSpan.lean index 799bbcc3cac70b..61d7bf3777d712 100644 --- a/Mathlib/LinearAlgebra/FiniteSpan.lean +++ b/Mathlib/LinearAlgebra/FiniteSpan.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Deepro Choudhury -/ -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.LinearAlgebra.Span.Defs -import Mathlib.Algebra.Module.Equiv.Basic +module + +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.LinearAlgebra.Span.Defs +public import Mathlib.Algebra.Module.Equiv.Basic /-! @@ -13,6 +15,8 @@ import Mathlib.Algebra.Module.Equiv.Basic -/ +@[expose] public section + open Set Function open Submodule (span) diff --git a/Mathlib/LinearAlgebra/Finsupp/Defs.lean b/Mathlib/LinearAlgebra/Finsupp/Defs.lean index b4df3473225b5a..8a7b59445ae3bb 100644 --- a/Mathlib/LinearAlgebra/Finsupp/Defs.lean +++ b/Mathlib/LinearAlgebra/Finsupp/Defs.lean @@ -3,9 +3,12 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Pi -import Mathlib.Data.Finsupp.SMul +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.LinearMap.End +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Data.Finsupp.SMul /-! # Properties of the module `α →₀ M` @@ -27,6 +30,8 @@ In this file we define `LinearMap` versions of various maps: function with finite support, module, linear algebra -/ +@[expose] public section + assert_not_exists Submodule noncomputable section @@ -309,3 +314,49 @@ def Module.subsingletonEquiv (R M ι : Type*) [Semiring R] [Subsingleton R] [Add map_smul' r _ := (smul_zero r).symm end + +namespace Module.End + +variable (ι : Type*) {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] + +/-- If `M` is an `R`-module and `ι` is a type, then an additive endomorphism of `M` that +commutes with all `R`-endomorphisms of `M` gives rise to an additive endomorphism of `ι →₀ M` +that commutes with all `R`-endomorphisms of `ι →₀ M`. -/ +@[simps] noncomputable def ringHomEndFinsupp : + End (End R M) M →+* End (End R (ι →₀ M)) (ι →₀ M) where + toFun f := + { toFun := Finsupp.mapRange.addMonoidHom f + map_add' := map_add _ + map_smul' g x := x.induction_linear (by simp) + (fun _ _ h h' ↦ by rw [smul_add, map_add, h, h', map_add, smul_add]) fun i m ↦ by + ext j + change f (Finsupp.lapply j ∘ₗ g ∘ₗ Finsupp.lsingle i • m) = _ + rw [map_smul] + simp } + map_one' := by ext; simp + map_mul' _ _ := by ext; simp + map_zero' := by ext; simp + map_add' _ _ := by ext; simp + +variable {ι} + +/-- If `M` is an `R`-module and `ι` is an nonempty type, then every additive endomorphism +of `ι →₀ M` that commutes with all `R`-endomorphisms of `ι →₀ M` comes from an additive +endomorphism of `M` that commutes with all `R`-endomorphisms of `M`. +See (15) in F4 of §28 on p.131 of [Lorenz2008]. -/ +@[simps!] noncomputable def ringEquivEndFinsupp (i : ι) : + End (End R M) M ≃+* End (End R (ι →₀ M)) (ι →₀ M) where + __ := ringHomEndFinsupp ι + invFun f := + { toFun m := f (Finsupp.single i m) i + map_add' _ _ := by simp + map_smul' g m := let g := Finsupp.mapRange.linearMap g + show _ = g _ i by rw [← End.smul_def g, ← map_smul]; simp [g] } + left_inv _ := by ext; simp + right_inv f := by + ext x j + change f (Finsupp.lsingle (R := R) (M := M) i ∘ₗ Finsupp.lapply j • x) i = _ + rw [map_smul] + simp + +end Module.End diff --git a/Mathlib/LinearAlgebra/Finsupp/LSum.lean b/Mathlib/LinearAlgebra/Finsupp/LSum.lean index 5b5556458643f7..b541d4ab7d4a49 100644 --- a/Mathlib/LinearAlgebra/Finsupp/LSum.lean +++ b/Mathlib/LinearAlgebra/Finsupp/LSum.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.Submodule.LinearMap -import Mathlib.LinearAlgebra.Finsupp.Defs -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.Submodule.LinearMap +public import Mathlib.LinearAlgebra.Finsupp.Defs +public import Mathlib.Tactic.ApplyFun /-! # Sums as a linear map @@ -24,6 +26,8 @@ Given an `R`-module `M`, the `R`-module structure on `α →₀ M` is defined in function with finite support, module, linear algebra -/ +@[expose] public section + noncomputable section open Set LinearMap Submodule diff --git a/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean b/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean index fd30b83c434abb..946ea8b04493c2 100644 --- a/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean +++ b/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Module.Submodule.Equiv -import Mathlib.Data.Finsupp.Option -import Mathlib.LinearAlgebra.Finsupp.Supported +module + +public import Mathlib.Algebra.Module.Submodule.Equiv +public import Mathlib.Data.Finsupp.Option +public import Mathlib.LinearAlgebra.Finsupp.Supported /-! # `Finsupp.linearCombination` @@ -29,6 +31,8 @@ import Mathlib.LinearAlgebra.Finsupp.Supported function with finite support, module, linear algebra -/ +@[expose] public section + noncomputable section open Set LinearMap Submodule diff --git a/Mathlib/LinearAlgebra/Finsupp/Pi.lean b/Mathlib/LinearAlgebra/Finsupp/Pi.lean index fc2fa31e7b6d36..9ac018546b4287 100644 --- a/Mathlib/LinearAlgebra/Finsupp/Pi.lean +++ b/Mathlib/LinearAlgebra/Finsupp/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.LinearAlgebra.Finsupp.LSum -import Mathlib.LinearAlgebra.Pi +module + +public import Mathlib.LinearAlgebra.Finsupp.LSum +public import Mathlib.LinearAlgebra.Pi /-! # Properties of the module `α →₀ M` @@ -20,6 +22,8 @@ by a map `f : X ⟶ Y` when `X` and `Y` are finite. function with finite support, module, linear algebra -/ +@[expose] public section + noncomputable section open Set LinearMap Submodule diff --git a/Mathlib/LinearAlgebra/Finsupp/Span.lean b/Mathlib/LinearAlgebra/Finsupp/Span.lean index d107dbfaf2158f..e4c61750d85516 100644 --- a/Mathlib/LinearAlgebra/Finsupp/Span.lean +++ b/Mathlib/LinearAlgebra/Finsupp/Span.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.LinearAlgebra.Finsupp.Defs -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.LinearAlgebra.Finsupp.Defs +public import Mathlib.LinearAlgebra.Span.Basic /-! # Finitely supported functions and spans @@ -14,6 +16,8 @@ import Mathlib.LinearAlgebra.Span.Basic function with finite support, module, linear algebra -/ +@[expose] public section + noncomputable section open Set LinearMap Submodule diff --git a/Mathlib/LinearAlgebra/Finsupp/SumProd.lean b/Mathlib/LinearAlgebra/Finsupp/SumProd.lean index e846de2334aa22..8aad66182cf555 100644 --- a/Mathlib/LinearAlgebra/Finsupp/SumProd.lean +++ b/Mathlib/LinearAlgebra/Finsupp/SumProd.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Module.Prod -import Mathlib.Data.Finsupp.SMul +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Module.Prod +public import Mathlib.Data.Finsupp.SMul /-! # `Finsupp`s and sum/product types @@ -18,6 +20,8 @@ This file contains results about modules involving `Finsupp` and sum/product/sig function with finite support, module, linear algebra -/ +@[expose] public section + noncomputable section open Set LinearMap diff --git a/Mathlib/LinearAlgebra/Finsupp/Supported.lean b/Mathlib/LinearAlgebra/Finsupp/Supported.lean index 420cdeb6ea6917..8480f3dcbcb929 100644 --- a/Mathlib/LinearAlgebra/Finsupp/Supported.lean +++ b/Mathlib/LinearAlgebra/Finsupp/Supported.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Module.Submodule.Range -import Mathlib.LinearAlgebra.Finsupp.LSum -import Mathlib.LinearAlgebra.Span.Defs +module + +public import Mathlib.Algebra.Module.Submodule.Range +public import Mathlib.LinearAlgebra.Finsupp.LSum +public import Mathlib.LinearAlgebra.Span.Defs /-! # `Finsupp`s supported on a given submodule @@ -23,6 +25,8 @@ import Mathlib.LinearAlgebra.Span.Defs function with finite support, module, linear algebra -/ +@[expose] public section + noncomputable section open Set LinearMap Submodule diff --git a/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean b/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean index 4ef2b489818854..4f53b66974a4fe 100644 --- a/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean +++ b/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean @@ -3,14 +3,16 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.FreeAbelianGroup.Finsupp -import Mathlib.Algebra.MonoidAlgebra.Defs -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.Finsupp.Span -import Mathlib.LinearAlgebra.Projection +module + +public import Mathlib.Algebra.FreeAbelianGroup.Finsupp +public import Mathlib.Algebra.MonoidAlgebra.Defs +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.Finsupp.Span +public import Mathlib.LinearAlgebra.Projection /-! # Linear structures on function with finite support `ι →₀ M` @@ -20,6 +22,8 @@ This file contains results on the `R`-module structure on functions of finite su -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/FreeAlgebra.lean b/Mathlib/LinearAlgebra/FreeAlgebra.lean index aec62cb45f4d96..e785c59b5da365 100644 --- a/Mathlib/LinearAlgebra/FreeAlgebra.lean +++ b/Mathlib/LinearAlgebra/FreeAlgebra.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.FreeAlgebra -import Mathlib.LinearAlgebra.Basis.Cardinality -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.Dimension.Subsingleton -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +module + +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.LinearAlgebra.Basis.Cardinality +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.Dimension.Subsingleton +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition /-! # Linear algebra properties of `FreeAlgebra R X` @@ -18,6 +20,8 @@ This file provides a `FreeMonoid X` basis on the `FreeAlgebra R X`, and uses it dimension of the algebra is the cardinality of `List X` -/ +@[expose] public section + open Module universe u v diff --git a/Mathlib/LinearAlgebra/FreeModule/Basic.lean b/Mathlib/LinearAlgebra/FreeModule/Basic.lean index 1c1a9d272f99a1..5d458dbf600691 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Basic.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Module.ULift -import Mathlib.Data.Finsupp.Fintype -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Module.ULift +public import Mathlib.Data.Finsupp.Fintype +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.Logic.Small.Basic /-! # Free modules @@ -23,6 +25,8 @@ module. * `Module.Free R M` : the class of free `R`-modules. -/ +@[expose] public section + assert_not_exists DirectSum Matrix TensorProduct universe u v w z @@ -132,8 +136,8 @@ lemma of_ringEquiv {R R' M M'} [Semiring R] [AddCommMonoid M] [Module R M] let I := Module.Free.ChooseBasisIndex R M obtain ⟨e₃ : M ≃ₗ[R] I →₀ R⟩ := Module.Free.chooseBasis R M let e : M' ≃+ (I →₀ R') := - (e₂.symm.trans e₃).toAddEquiv.trans (Finsupp.mapRange.addEquiv (α := I) e₁.toAddEquiv) - have he (x) : e x = Finsupp.mapRange.addEquiv (α := I) e₁.toAddEquiv (e₃ (e₂.symm x)) := rfl + (e₂.symm.trans e₃).toAddEquiv.trans (Finsupp.mapRange.addEquiv (ι := I) e₁.toAddEquiv) + have he (x) : e x = Finsupp.mapRange.addEquiv (ι := I) e₁.toAddEquiv (e₃ (e₂.symm x)) := rfl let e' : M' ≃ₗ[R'] (I →₀ R') := { __ := e, map_smul' := fun m x ↦ Finsupp.ext fun i ↦ by simp [he, map_smulₛₗ] } exact of_basis (.ofRepr e') diff --git a/Mathlib/LinearAlgebra/FreeModule/Determinant.lean b/Mathlib/LinearAlgebra/FreeModule/Determinant.lean index 3fa9050e31eec5..018ad7b51cc04a 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Determinant.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Determinant.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best -/ -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +module + +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic /-! # Determinants in free (finite) modules @@ -18,6 +20,8 @@ free (finite) modules over any commutative ring. nontrivial module. -/ +@[expose] public section + @[simp high] theorem LinearMap.det_zero'' {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/FreeModule/Finite/Basic.lean b/Mathlib/LinearAlgebra/FreeModule/Finite/Basic.lean index 2ce7a05f1760cc..31d2492d3055f9 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Finite/Basic.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Finite/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.Matrix.StdBasis -import Mathlib.RingTheory.Finiteness.Cardinality +module + +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.Matrix.StdBasis +public import Mathlib.RingTheory.Finiteness.Cardinality /-! # Finite and free modules @@ -18,6 +20,8 @@ We provide some instances for finite and free modules. * `Module.Finite.of_basis` : A free module with a basis indexed by a `Fintype` is finite. -/ +@[expose] public section + universe u v w /-- If a free module is finite, then the arbitrary basis is finite. -/ diff --git a/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean b/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean index 925dc8c31c72ad..d0098d6c1c8a3e 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best, Xavier Roblot -/ -import Mathlib.Data.Int.Associated -import Mathlib.Data.Int.NatAbs -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient +module + +public import Mathlib.Data.Int.Associated +public import Mathlib.Data.Int.NatAbs +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient /-! # Cardinal of quotient of free finite `ℤ`-modules by submodules of full rank @@ -18,6 +20,8 @@ import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient -/ +@[expose] public section + open Module Submodule section Submodule diff --git a/Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean b/Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean index 151ede56c8222d..afbe5d1d20c242 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.Dimension.Finite +module + +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.Dimension.Finite /-! # Finite and free modules using matrices @@ -19,6 +21,8 @@ We provide some instances for finite and free modules involving matrices. is finite. -/ +@[expose] public section + universe u u' v w diff --git a/Mathlib/LinearAlgebra/FreeModule/Finite/Quotient.lean b/Mathlib/LinearAlgebra/FreeModule/Finite/Quotient.lean index 3d7bea7d0e18ea..cfb6d98167d46e 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Finite/Quotient.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Finite/Quotient.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Xavier Roblot -/ -import Mathlib.Data.ZMod.QuotientRing -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.Quotient.Pi +module + +public import Mathlib.Data.ZMod.QuotientRing +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.Quotient.Pi /-! # Quotient of submodules of full rank in free finite modules over PIDs @@ -18,6 +20,8 @@ import Mathlib.LinearAlgebra.Quotient.Pi -/ +@[expose] public section + open Module open scoped DirectSum diff --git a/Mathlib/LinearAlgebra/FreeModule/IdealQuotient.lean b/Mathlib/LinearAlgebra/FreeModule/IdealQuotient.lean index 597a43e7f52f43..a5d4ac263d6c99 100644 --- a/Mathlib/LinearAlgebra/FreeModule/IdealQuotient.lean +++ b/Mathlib/LinearAlgebra/FreeModule/IdealQuotient.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient +module + +public import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient /-! # Ideals in free modules over PIDs @@ -14,6 +16,8 @@ import Mathlib.LinearAlgebra.FreeModule.Finite.Quotient -/ +@[expose] public section + open Module open scoped DirectSum diff --git a/Mathlib/LinearAlgebra/FreeModule/Int.lean b/Mathlib/LinearAlgebra/FreeModule/Int.lean index 0afdcf8f9e1d81..a6a4fdf7d72aba 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Int.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Int.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Data.ZMod.QuotientGroup -import Mathlib.GroupTheory.Index -import Mathlib.LinearAlgebra.FreeModule.PID +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Data.ZMod.QuotientGroup +public import Mathlib.GroupTheory.Index +public import Mathlib.LinearAlgebra.FreeModule.PID /-! # Index of submodules of free ℤ-modules (considered as an `AddSubgroup`). @@ -15,6 +17,8 @@ index. -/ +@[expose] public section + variable {ι R M : Type*} {n : ℕ} [CommRing R] [AddCommGroup M] diff --git a/Mathlib/LinearAlgebra/FreeModule/ModN.lean b/Mathlib/LinearAlgebra/FreeModule/ModN.lean index a54541f0dfbddd..254f195447aa36 100644 --- a/Mathlib/LinearAlgebra/FreeModule/ModN.lean +++ b/Mathlib/LinearAlgebra/FreeModule/ModN.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.Module.ZMod -import Mathlib.LinearAlgebra.Dimension.Free +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.Module.ZMod +public import Mathlib.LinearAlgebra.Dimension.Free /-! # Quotienting out a free `ℤ`-module @@ -13,6 +15,8 @@ import Mathlib.LinearAlgebra.Dimension.Free If `G` is a rank `d` free `ℤ`-module, then `G/nG` is a finite group of cardinality `n ^ d`. -/ +@[expose] public section + open Finsupp Function Module variable {G H M : Type*} [AddCommGroup G] {n : ℕ} diff --git a/Mathlib/LinearAlgebra/FreeModule/Norm.lean b/Mathlib/LinearAlgebra/FreeModule/Norm.lean index df9daf7916b34d..c7f1e145b8841a 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Norm.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Norm.lean @@ -3,15 +3,19 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.FreeModule.IdealQuotient -import Mathlib.RingTheory.AdjoinRoot -import Mathlib.RingTheory.Norm.Defs +module + +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.FreeModule.IdealQuotient +public import Mathlib.RingTheory.AdjoinRoot +public import Mathlib.RingTheory.Norm.Defs /-! # Norms on free modules over principal ideal domains -/ +@[expose] public section + open Ideal Module Polynomial variable {R S ι : Type*} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] [CommRing S] @@ -42,10 +46,7 @@ theorem associated_norm_prod_smith [Fintype ι] (b : Basis ι R S) {f : S} (hf : zero_smul, Finset.sum_ite_eq', mul_one, if_pos (Finset.mem_univ _), b'.equiv_apply] change _ = f * _ rw [mul_comm, ← smul_eq_mul, LinearEquiv.restrictScalars_apply] - -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 - erw [LinearEquiv.coord_apply_smul] - rw [Ideal.selfBasis_def] - rfl + grind [LinearEquiv.coord_apply_smul, Ideal.selfBasis_def] end CommRing diff --git a/Mathlib/LinearAlgebra/FreeModule/PID.lean b/Mathlib/LinearAlgebra/FreeModule/PID.lean index b4caa941cd6954..1c3ef915409f89 100644 --- a/Mathlib/LinearAlgebra/FreeModule/PID.lean +++ b/Mathlib/LinearAlgebra/FreeModule/PID.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Free modules over PID @@ -45,6 +47,8 @@ free module, finitely generated module, rank, structure theorem -/ +@[expose] public section + open Module universe u v diff --git a/Mathlib/LinearAlgebra/FreeModule/StrongRankCondition.lean b/Mathlib/LinearAlgebra/FreeModule/StrongRankCondition.lean index 4a4e52ebe6281e..908cefcb4fcf11 100644 --- a/Mathlib/LinearAlgebra/FreeModule/StrongRankCondition.lean +++ b/Mathlib/LinearAlgebra/FreeModule/StrongRankCondition.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.RingTheory.FiniteType -import Mathlib.LinearAlgebra.InvariantBasisNumber +module + +public import Mathlib.RingTheory.FiniteType +public import Mathlib.LinearAlgebra.InvariantBasisNumber /-! @@ -35,6 +37,8 @@ is injective. -/ +@[expose] public section + variable (R : Type*) [CommRing R] [Nontrivial R] diff --git a/Mathlib/LinearAlgebra/FreeProduct/Basic.lean b/Mathlib/LinearAlgebra/FreeProduct/Basic.lean index 5d9693cfd17c9c..59f9c8730f8264 100644 --- a/Mathlib/LinearAlgebra/FreeProduct/Basic.lean +++ b/Mathlib/LinearAlgebra/FreeProduct/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Robert Maxton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Maxton -/ -import Mathlib.Algebra.DirectSum.Basic -import Mathlib.LinearAlgebra.TensorAlgebra.ToTensorPower +module + +public import Mathlib.Algebra.DirectSum.Basic +public import Mathlib.LinearAlgebra.TensorAlgebra.ToTensorPower /-! # The free product of $R$-algebras @@ -41,6 +43,8 @@ general $R$-algebras. - Induction principle for `FreeProduct` -/ + +@[expose] public section universe u v w w' namespace DirectSum diff --git a/Mathlib/LinearAlgebra/GeneralLinearGroup.lean b/Mathlib/LinearAlgebra/GeneralLinearGroup.lean index 11e44eb57b847e..1903337f3da3d0 100644 --- a/Mathlib/LinearAlgebra/GeneralLinearGroup.lean +++ b/Mathlib/LinearAlgebra/GeneralLinearGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Module.Equiv.Basic +module + +public import Mathlib.Algebra.Module.Equiv.Basic /-! # The general linear group of linear maps @@ -18,6 +20,8 @@ See also `Matrix.GeneralLinearGroup` -/ +@[expose] public section + variable (R M : Type*) @@ -43,6 +47,14 @@ def toLinearEquiv (f : GeneralLinearGroup R M) : M ≃ₗ[R] M := @[simp] lemma coe_toLinearEquiv (f : GeneralLinearGroup R M) : f.toLinearEquiv = (f : M → M) := rfl +theorem toLinearEquiv_mul (f g : GeneralLinearGroup R M) : + (f * g).toLinearEquiv = f.toLinearEquiv * g.toLinearEquiv := by + rfl + +theorem toLinearEquiv_inv (f : GeneralLinearGroup R M) : + (f⁻¹).toLinearEquiv = (f.toLinearEquiv)⁻¹ := by + rfl + /-- An equivalence from `M` to itself determines an invertible linear map. -/ def ofLinearEquiv (f : M ≃ₗ[R] M) : GeneralLinearGroup R M where val := f @@ -53,6 +65,14 @@ def ofLinearEquiv (f : M ≃ₗ[R] M) : GeneralLinearGroup R M where @[simp] lemma coe_ofLinearEquiv (f : M ≃ₗ[R] M) : ofLinearEquiv f = (f : M → M) := rfl +theorem ofLinearEquiv_mul (f g : M ≃ₗ[R] M) : + ofLinearEquiv (f * g) = ofLinearEquiv f * ofLinearEquiv g := by + rfl + +theorem ofLinearEquiv_inv (f : M ≃ₗ[R] M) : + ofLinearEquiv (f⁻¹) = (ofLinearEquiv f)⁻¹ := by + rfl + variable (R M) in /-- The general linear group on `R` and `M` is multiplicatively equivalent to the type of linear equivalences between `M` and itself. -/ diff --git a/Mathlib/LinearAlgebra/Goursat.lean b/Mathlib/LinearAlgebra/Goursat.lean index c6eb95e6456455..bc0aa48661d1a1 100644 --- a/Mathlib/LinearAlgebra/Goursat.lean +++ b/Mathlib/LinearAlgebra/Goursat.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.GroupTheory.Goursat -import Mathlib.LinearAlgebra.Prod -import Mathlib.LinearAlgebra.Quotient.Basic +module + +public import Mathlib.GroupTheory.Goursat +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.LinearAlgebra.Quotient.Basic /-! # Goursat's lemma for submodules @@ -20,6 +22,8 @@ Equivalently, `L` is equal to the preimage in `M × N` of the graph of this isom respectively. -/ +@[expose] public section + open Function Set LinearMap namespace Submodule diff --git a/Mathlib/LinearAlgebra/InvariantBasisNumber.lean b/Mathlib/LinearAlgebra/InvariantBasisNumber.lean index 14889f37c7539e..2774885090b58f 100644 --- a/Mathlib/LinearAlgebra/InvariantBasisNumber.lean +++ b/Mathlib/LinearAlgebra/InvariantBasisNumber.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Kim Morrison -/ -import Mathlib.RingTheory.Ideal.Quotient.Basic -import Mathlib.RingTheory.Noetherian.Orzech -import Mathlib.RingTheory.OrzechProperty -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.LinearAlgebra.Finsupp.Pi +module + +public import Mathlib.RingTheory.Ideal.Quotient.Basic +public import Mathlib.RingTheory.Noetherian.Orzech +public import Mathlib.RingTheory.OrzechProperty +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.LinearAlgebra.Finsupp.Pi /-! # Invariant basis number property @@ -101,6 +103,8 @@ free module, rank, Orzech property, (strong) rank condition, invariant basis num -/ +@[expose] public section + noncomputable section open Function diff --git a/Mathlib/LinearAlgebra/Isomorphisms.lean b/Mathlib/LinearAlgebra/Isomorphisms.lean index b2e0a4ca5c6d4a..49231bf3b79b52 100644 --- a/Mathlib/LinearAlgebra/Isomorphisms.lean +++ b/Mathlib/LinearAlgebra/Isomorphisms.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.LinearAlgebra.Quotient.Card +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.LinearAlgebra.Quotient.Card /-! # Isomorphism theorems for modules. @@ -15,6 +17,8 @@ import Mathlib.LinearAlgebra.Quotient.Card -/ +@[expose] public section + universe u v variable {R M M₂ M₃ : Type*} @@ -57,6 +61,11 @@ theorem quotKerEquivRange_symm_apply_image (x : M) (h : f x ∈ LinearMap.range f.quotKerEquivRange.symm ⟨f x, h⟩ = (LinearMap.ker f).mkQ x := f.quotKerEquivRange.symm_apply_apply ((LinearMap.ker f).mkQ x) +@[simp] +theorem quotKerEquivOfSurjective_symm_apply (hf : Function.Surjective f) (x : M) : + (f.quotKerEquivOfSurjective hf).symm (f x) = Submodule.Quotient.mk x := by + simp [LinearEquiv.symm_apply_eq] + /-- Linear map from `p` to `p+p'/p'` where `p p'` are submodules of `R` -/ abbrev subToSupQuotient (p p' : Submodule R M) : { x // x ∈ p } →ₗ[R] { x // x ∈ p ⊔ p' } ⧸ comap (Submodule.subtype (p ⊔ p')) p' := @@ -71,7 +80,7 @@ theorem comap_leq_ker_subToSupQuotient (p p' : Submodule R M) : to `x + p'`, where `p` and `p'` are submodules of an ambient module. Note that in the following declaration the type of the domain is expressed using -``comap p.subtype p ⊓ comap p.subtype p'` +`comap p.subtype p ⊓ comap p.subtype p'` instead of `comap p.subtype (p ⊓ p')` because the former is the simp normal form (see also `Submodule.comap_inf`). -/ @@ -97,7 +106,7 @@ theorem quotientInfEquivSupQuotient_surjective (p p' : Submodule R M) : Second Isomorphism Law : the canonical map from `p/(p ∩ p')` to `(p+p')/p'` as a linear isomorphism. Note that in the following declaration the type of the domain is expressed using -``comap p.subtype p ⊓ comap p.subtype p'` +`comap p.subtype p ⊓ comap p.subtype p'` instead of `comap p.subtype (p ⊓ p')` because the former is the simp normal form (see also `Submodule.comap_inf`). -/ diff --git a/Mathlib/LinearAlgebra/JordanChevalley.lean b/Mathlib/LinearAlgebra/JordanChevalley.lean index 6608613fb3eb5b..e3a69306e577ab 100644 --- a/Mathlib/LinearAlgebra/JordanChevalley.lean +++ b/Mathlib/LinearAlgebra/JordanChevalley.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Dynamics.Newton -import Mathlib.LinearAlgebra.Semisimple -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +module + +public import Mathlib.Dynamics.Newton +public import Mathlib.LinearAlgebra.Semisimple +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # Jordan-Chevalley-Dunford decomposition @@ -34,6 +36,8 @@ The proof given here uses Newton's method and is taken from Chambert-Loir's note -/ +@[expose] public section + open Algebra Polynomial namespace Module.End diff --git a/Mathlib/LinearAlgebra/Lagrange.lean b/Mathlib/LinearAlgebra/Lagrange.lean index 0c2a3c083c881d..365cf94b6a9d29 100644 --- a/Mathlib/LinearAlgebra/Lagrange.lean +++ b/Mathlib/LinearAlgebra/Lagrange.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Wrenna Robson -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Pi -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.LinearAlgebra.Vandermonde -import Mathlib.RingTheory.Polynomial.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Pi +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.LinearAlgebra.Vandermonde +public import Mathlib.RingTheory.Polynomial.Basic /-! # Lagrange interpolation @@ -25,6 +27,8 @@ import Mathlib.RingTheory.Polynomial.Basic associated with the _nodes_`x i`. -/ +@[expose] public section + open Polynomial diff --git a/Mathlib/LinearAlgebra/LeftExact.lean b/Mathlib/LinearAlgebra/LeftExact.lean new file mode 100644 index 00000000000000..7f1a804bd881bf --- /dev/null +++ b/Mathlib/LinearAlgebra/LeftExact.lean @@ -0,0 +1,44 @@ +/- +Copyright (c) 2025 Nailin Guan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Nailin Guan +-/ +module + +public import Mathlib.Algebra.Exact +public import Mathlib.LinearAlgebra.BilinearMap + +/-! +# The Left Exactness of Hom + + +If `M1 → M2 → M3 → 0` is an exact sequence of `R`-modules and `N` is a `R`-module, +then `0 → (M3 →ₗ[R] N) → (M2 →ₗ[R] N) → (M1 →ₗ[R] N)` is exact. In this file, we +show the exactness at `M2 →ₗ[R] N` (`exact_lcomp_of_exact_of_surjective`); +the injectivity part is `LinearMap.lcomp_injective_of_surjective` in the file +`Mathlib.LinearAlgebra.BilinearMap`. + + +-/ + +@[expose] public section + +namespace LinearMap + +variable {R : Type*} [CommRing R] {M1 M2 M3 : Type*} (N : Type*) + [AddCommGroup M1] [AddCommGroup M2] [AddCommGroup M3] [AddCommGroup N] + [Module R M1] [Module R M2] [Module R M3] [Module R N] + +lemma exact_lcomp_of_exact_of_surjective {f : M1 →ₗ[R] M2} {g : M2 →ₗ[R] M3} + (exac : Function.Exact f g) (surj : Function.Surjective g) : + Function.Exact (LinearMap.lcomp R N g) (LinearMap.lcomp R N f) := by + intro h + simp only [LinearMap.lcomp_apply', Set.mem_range] + refine ⟨fun hh ↦ ?_, fun ⟨y, hy⟩ ↦ ?_⟩ + · use ((LinearMap.range f).liftQ h (LinearMap.range_le_ker_iff.mpr hh)).comp + (exac.linearEquivOfSurjective surj).symm.toLinearMap + ext x + simp + · rw [← hy, LinearMap.comp_assoc, exac.linearMap_comp_eq_zero, LinearMap.comp_zero y] + +end LinearMap diff --git a/Mathlib/LinearAlgebra/LinearDisjoint.lean b/Mathlib/LinearAlgebra/LinearDisjoint.lean index 2bbf8a7aebee31..8fea9dd70c8cea 100644 --- a/Mathlib/LinearAlgebra/LinearDisjoint.lean +++ b/Mathlib/LinearAlgebra/LinearDisjoint.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.LinearAlgebra.TensorProduct.Finiteness -import Mathlib.LinearAlgebra.TensorProduct.Submodule -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.RingTheory.Flat.Basic +module + +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.LinearAlgebra.TensorProduct.Submodule +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.RingTheory.Flat.Basic /-! @@ -127,6 +129,8 @@ linearly disjoint, linearly independent, tensor product -/ +@[expose] public section + open Module open scoped TensorProduct diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean b/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean index 8585d270c0edb7..dbc1948a5bed20 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp, Anne Baanen -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.LinearAlgebra.LinearIndependent.Defs +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.LinearAlgebra.LinearIndependent.Defs /-! # Linear independence @@ -38,6 +40,8 @@ linearly dependent, linear dependence, linearly independent, linear independence -/ +@[expose] public section + assert_not_exists Cardinal noncomputable section diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean b/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean index 0744df0f6e9298..f1e26e905c9b75 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp, Anne Baanen -/ -import Mathlib.Algebra.Order.Sub.Basic -import Mathlib.LinearAlgebra.Finsupp.LinearCombination -import Mathlib.Lean.Expr.ExtraRecognizers +module + +public import Mathlib.Algebra.Order.Sub.Basic +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination +public meta import Mathlib.Lean.Expr.ExtraRecognizers /-! @@ -72,6 +74,8 @@ linearly dependent, linear dependence, linearly independent, linear independence -/ +@[expose] public section + assert_not_exists Cardinal noncomputable section @@ -101,7 +105,7 @@ in case the family of vectors is over a `Set`. Type hints look like `LinearIndependent fun (v : ↑s) => ↑v` or `LinearIndependent (ι := ↑s) f`, depending on whether the family is a lambda expression or not. -/ @[app_delab LinearIndependent] -def delabLinearIndependent : Delab := +meta def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean b/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean index 9435017fc35513..395c9ab242ab2d 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean @@ -3,15 +3,17 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Alexander Bentkamp, Anne Baanen -/ -import Mathlib.Data.Fin.Tuple.Reflection -import Mathlib.LinearAlgebra.Finsupp.SumProd -import Mathlib.LinearAlgebra.LinearIndependent.Basic -import Mathlib.LinearAlgebra.Pi -import Mathlib.Logic.Equiv.Fin.Rotate -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.Module -import Mathlib.Tactic.NoncommRing +module + +public import Mathlib.Data.Fin.Tuple.Reflection +public import Mathlib.LinearAlgebra.Finsupp.SumProd +public import Mathlib.LinearAlgebra.LinearIndependent.Basic +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.Logic.Equiv.Fin.Rotate +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.Module +public import Mathlib.Tactic.NoncommRing /-! # Linear independence @@ -46,6 +48,8 @@ linearly dependent, linear dependence, linearly independent, linear independence -/ +@[expose] public section + assert_not_exists Cardinal @@ -438,7 +442,7 @@ theorem exists_maximal_linearIndepOn (v : ι → M) : rintro x hx refine (memJ.mp (supp_f hx)).resolve_left ?_ rintro rfl - exact hIlinind (Finsupp.mem_support_iff.mp hx) + exact (Finsupp.mem_support_iff.mp hx) hIlinind use f i, hfi have hfi' : i ∈ f.support := Finsupp.mem_support_iff.mpr hfi rw [← Finset.insert_erase hfi', Finset.sum_insert (Finset.notMem_erase _ _), diff --git a/Mathlib/LinearAlgebra/LinearPMap.lean b/Mathlib/LinearAlgebra/LinearPMap.lean index bf8f6d2135f432..b492a6bd412406 100644 --- a/Mathlib/LinearAlgebra/LinearPMap.lean +++ b/Mathlib/LinearAlgebra/LinearPMap.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Moritz Doll -/ -import Mathlib.LinearAlgebra.Prod +module + +public import Mathlib.LinearAlgebra.Prod /-! # Partially defined linear maps @@ -28,6 +30,8 @@ They are also the basis for the theory of unbounded operators. -/ +@[expose] public section + universe u v w /-- A `LinearPMap R E F` or `E →ₗ.[R] F` is a linear map from a submodule of `E` to `F`. -/ @@ -223,7 +227,6 @@ instance inhabited : Inhabited (E →ₗ.[R] F) := ⟨⊥⟩ instance semilatticeInf : SemilatticeInf (E →ₗ.[R] F) where - le := (· ≤ ·) le_refl f := ⟨le_refl f.domain, fun _ _ h => Subtype.ext h ▸ rfl⟩ le_trans := fun _ _ _ ⟨fg_le, fg_eq⟩ ⟨gh_le, gh_eq⟩ => ⟨le_trans fg_le gh_le, fun x _ hxz => @@ -242,7 +245,6 @@ instance semilatticeInf : SemilatticeInf (E →ₗ.[R] F) where ⟨fun _ hx => hx.snd.fst, fun ⟨_, _, _, hx⟩ _ h => hx.trans <| congr_arg g <| Subtype.ext <| h⟩ instance orderBot : OrderBot (E →ₗ.[R] F) where - bot := ⊥ bot_le f := ⟨bot_le, fun x y h => by have hx : x = 0 := Subtype.ext ((mem_bot R).1 x.2) diff --git a/Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean b/Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean index a224ef97c5de9d..8ca13c99a09068 100644 --- a/Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean +++ b/Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Data.Int.AbsoluteValue -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +module + +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Data.Int.AbsoluteValue +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic /-! # Absolute values and matrices @@ -23,6 +25,8 @@ This file proves some bounds on matrices involving absolute values. then the determinant of the linear combination is bounded by `n! (s * y * x)^n` -/ +@[expose] public section + open Matrix open scoped Nat diff --git a/Mathlib/LinearAlgebra/Matrix/Adjugate.lean b/Mathlib/LinearAlgebra/Matrix/Adjugate.lean index 8f2bc339ff5163..a21472e3592256 100644 --- a/Mathlib/LinearAlgebra/Matrix/Adjugate.lean +++ b/Mathlib/LinearAlgebra/Matrix/Adjugate.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Regular.Basic -import Mathlib.LinearAlgebra.Matrix.MvPolynomial -import Mathlib.LinearAlgebra.Matrix.Polynomial +module + +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.LinearAlgebra.Matrix.MvPolynomial +public import Mathlib.LinearAlgebra.Matrix.Polynomial /-! # Cramer's rule and adjugate matrices @@ -38,6 +40,8 @@ We prove the adjugate behaves like `det A • A⁻¹`. cramer, cramer's rule, adjugate -/ +@[expose] public section + namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/BaseChange.lean b/Mathlib/LinearAlgebra/Matrix/BaseChange.lean index 21b00403c2cb93..4594ccffccb48c 100644 --- a/Mathlib/LinearAlgebra/Matrix/BaseChange.lean +++ b/Mathlib/LinearAlgebra/Matrix/BaseChange.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.Algebra.Field.Subfield.Defs +module + +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.Algebra.Field.Subfield.Defs /-! # Matrices and base change @@ -19,6 +21,8 @@ This file is a home for results about base change for matrices. -/ +@[expose] public section + namespace Matrix variable {m n L : Type*} [Finite m] [Fintype n] [DecidableEq m] [Field L] diff --git a/Mathlib/LinearAlgebra/Matrix/Basis.lean b/Mathlib/LinearAlgebra/Matrix/Basis.lean index 8cc128b8b3ee83..aee5abc7aa0b62 100644 --- a/Mathlib/LinearAlgebra/Matrix/Basis.lean +++ b/Mathlib/LinearAlgebra/Matrix/Basis.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.LinearAlgebra.Basis.Submodule -import Mathlib.LinearAlgebra.Matrix.Reindex -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.Basis.Submodule +public import Mathlib.LinearAlgebra.Matrix.Reindex +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Bases and matrices @@ -30,6 +32,8 @@ the matrix of their coordinates with respect to some basis. matrix, basis -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Matrix/BilinearForm.lean b/Mathlib/LinearAlgebra/Matrix/BilinearForm.lean index 27bc642c1bac17..11a0d423e2f013 100644 --- a/Mathlib/LinearAlgebra/Matrix/BilinearForm.lean +++ b/Mathlib/LinearAlgebra/Matrix/BilinearForm.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kexing Ying -/ -import Mathlib.LinearAlgebra.BilinearForm.Properties -import Mathlib.LinearAlgebra.Matrix.SesquilinearForm +module + +public import Mathlib.LinearAlgebra.BilinearForm.Properties +public import Mathlib.LinearAlgebra.Matrix.SesquilinearForm /-! # Bilinear form @@ -30,6 +32,8 @@ bilinear form, bilin form, BilinearForm, matrix, basis -/ +@[expose] public section + open LinearMap (BilinForm) open Module diff --git a/Mathlib/LinearAlgebra/Matrix/Block.lean b/Mathlib/LinearAlgebra/Matrix/Block.lean index fc7379c2c33fbb..0a5f970a05b659 100644 --- a/Mathlib/LinearAlgebra/Matrix/Block.lean +++ b/Mathlib/LinearAlgebra/Matrix/Block.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen, Wen Yang -/ -import Mathlib.LinearAlgebra.Matrix.Transvection -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.Tactic.FinCases +module + +public import Mathlib.LinearAlgebra.Matrix.Transvection +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.Tactic.FinCases /-! # Block matrices and their determinant @@ -32,6 +34,8 @@ matrix, diagonal, det, block triangular -/ +@[expose] public section + open Finset Function OrderDual diff --git a/Mathlib/LinearAlgebra/Matrix/CharP.lean b/Mathlib/LinearAlgebra/Matrix/CharP.lean index 9404e225bf7a41..809cc731e150f8 100644 --- a/Mathlib/LinearAlgebra/Matrix/CharP.lean +++ b/Mathlib/LinearAlgebra/Matrix/CharP.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Data.Matrix.Diagonal +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Data.Matrix.Diagonal /-! # Matrices in prime characteristic @@ -13,6 +15,8 @@ In this file we prove that matrices over a ring of characteristic `p` with nonempty index type have the same characteristic. -/ +@[expose] public section + open Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean index 61f35b59739eaa..a94de1eb3f7181 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.LinearAlgebra.Matrix.Adjugate -import Mathlib.LinearAlgebra.Matrix.Block -import Mathlib.RingTheory.MatrixPolynomialAlgebra +module + +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.LinearAlgebra.Matrix.Adjugate +public import Mathlib.LinearAlgebra.Matrix.Block +public import Mathlib.RingTheory.MatrixPolynomialAlgebra /-! # Characteristic polynomials and the Cayley-Hamilton theorem @@ -25,6 +27,8 @@ See the file `Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean` for corollaries We follow a nice proof from http://drorbn.net/AcademicPensieve/2015-12/CayleyHamilton.pdf -/ +@[expose] public section + noncomputable section universe u v w diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean index 3bc061fb76bd3b..7fea729a89ce47 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Aaron Anderson, Jalex Stark. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark -/ -import Mathlib.Algebra.Polynomial.Expand -import Mathlib.Algebra.Polynomial.Laurent -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic -import Mathlib.LinearAlgebra.Matrix.Reindex -import Mathlib.LinearAlgebra.Matrix.SchurComplement -import Mathlib.RingTheory.Polynomial.Nilpotent +module + +public import Mathlib.Algebra.Polynomial.Expand +public import Mathlib.Algebra.Polynomial.Laurent +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic +public import Mathlib.LinearAlgebra.Matrix.Reindex +public import Mathlib.LinearAlgebra.Matrix.SchurComplement +public import Mathlib.RingTheory.Polynomial.Nilpotent /-! # Characteristic polynomials @@ -30,6 +32,8 @@ We give methods for computing coefficients of the characteristic polynomial. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Disc.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Disc.lean index 3c6dfbc07b46b8..1917cf7ddafe97 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Disc.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Disc.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.RingTheory.Polynomial.Resultant.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.RingTheory.Polynomial.Resultant.Basic /-! # The discriminant of a matrix -/ +@[expose] public section + open Polynomial namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Eigs.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Eigs.lean index 2c6e5942f3bc3a..b75820f7602405 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Eigs.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Eigs.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Mohanad Ahmed. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mohanad Ahmed -/ -import Mathlib.Algebra.Algebra.Spectrum.Basic -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.FieldTheory.IsAlgClosed.Basic +module + +public import Mathlib.Algebra.Algebra.Spectrum.Basic +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.FieldTheory.IsAlgClosed.Basic /-! # Eigenvalues are characteristic polynomial roots. @@ -48,6 +50,8 @@ dependencies are not general enough to unify them. We should refactor arbitrary map. -/ +@[expose] public section + variable {n : Type*} [Fintype n] [DecidableEq n] variable {R K : Type*} [CommRing R] [Field K] diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean index 28949779f1baa8..e2bbab2297b976 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Aaron Anderson, Jalex Stark. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark -/ -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.LinearAlgebra.Matrix.CharP +module + +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.LinearAlgebra.Matrix.CharP /-! # Results on characteristic polynomials and traces over finite fields. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean index 6f1de2bafe2df8..0e3987ce283f80 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! @@ -20,6 +22,8 @@ ideal `I`, we may furthermore obtain a matrix representation whose entries fall This is used to conclude the Cayley-Hamilton theorem for f.g. modules over arbitrary rings. -/ +@[expose] public section + variable {ι : Type*} [Fintype ι] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Minpoly.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Minpoly.lean index 573748f5f2d6ff..eb8e0cbd3ab2dd 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Minpoly.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Minpoly.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Aaron Anderson, Jalex Stark. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jalex Stark, Eric Wieser -/ -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.RingTheory.PowerBasis +module + +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.RingTheory.PowerBasis /-! # The minimal polynomial divides the characteristic polynomial of a matrix. @@ -13,6 +15,8 @@ import Mathlib.RingTheory.PowerBasis This also includes some miscellaneous results about `minpoly` on matrices. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Univ.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Univ.lean index 75e8079d8a872c..ea850be36972aa 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Univ.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Univ.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.RingTheory.MvPolynomial.Homogeneous +module + +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.RingTheory.MvPolynomial.Homogeneous /-! # The universal characteristic polynomial @@ -29,6 +31,8 @@ of a matrix are homogeneous polynomials in the matrix entries. the `i`-th coefficient of `univ` is a homogeneous polynomial of degree `n - i`. -/ +@[expose] public section + namespace Matrix.charpoly variable {R S : Type*} (n : Type*) [CommRing R] [CommRing S] [Fintype n] [DecidableEq n] diff --git a/Mathlib/LinearAlgebra/Matrix/Circulant.lean b/Mathlib/LinearAlgebra/Matrix/Circulant.lean index ed5d0579c9058e..4fa8a94b6a0ee6 100644 --- a/Mathlib/LinearAlgebra/Matrix/Circulant.lean +++ b/Mathlib/LinearAlgebra/Matrix/Circulant.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Lu-Ming Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lu-Ming Zhang -/ -import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.LinearAlgebra.Matrix.Symmetric -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Group.Fin.Basic +public import Mathlib.LinearAlgebra.Matrix.Symmetric +public import Mathlib.Tactic.Abel /-! # Circulant matrices @@ -31,6 +33,8 @@ Namely, the index type of the circulant matrices in discussion is `Fin n`. circulant, matrix -/ +@[expose] public section + variable {α β n R : Type*} diff --git a/Mathlib/LinearAlgebra/Matrix/ConjTranspose.lean b/Mathlib/LinearAlgebra/Matrix/ConjTranspose.lean index 1e69196220d026..9a725ea83f5b19 100644 --- a/Mathlib/LinearAlgebra/Matrix/ConjTranspose.lean +++ b/Mathlib/LinearAlgebra/Matrix/ConjTranspose.lean @@ -3,15 +3,17 @@ Copyright (c) 2018 Ellen Arlt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ellen Arlt, Blair Shi, Sean Leather, Mario Carneiro, Johan Commelin, Lu-Ming Zhang -/ -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.BigOperators.RingEquiv -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Star.BigOperators -import Mathlib.Algebra.Star.Module -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.Mul +module + +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.BigOperators.RingEquiv +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Star.BigOperators +public import Mathlib.Algebra.Star.Module +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.Mul /-! # Matrices over star rings. @@ -24,6 +26,8 @@ The scope `Matrix` gives the following notation: -/ +@[expose] public section + universe u u' v w diff --git a/Mathlib/LinearAlgebra/Matrix/Defs.lean b/Mathlib/LinearAlgebra/Matrix/Defs.lean index 02627e4f6b7541..25ef1d8b669f70 100644 --- a/Mathlib/LinearAlgebra/Matrix/Defs.lean +++ b/Mathlib/LinearAlgebra/Matrix/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Ellen Arlt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ellen Arlt, Blair Shi, Sean Leather, Mario Carneiro, Johan Commelin, Lu-Ming Zhang -/ -import Mathlib.Algebra.Module.Pi +module + +public import Mathlib.Algebra.Module.Pi /-! # Matrices @@ -39,6 +41,8 @@ form `fun i j ↦ _` or even `(fun i j ↦ _ : Matrix m n α)`, as these are not as having the right type. Instead, `Matrix.of` should be used. -/ +@[expose] public section + assert_not_exists Algebra TrivialStar universe u u' v w diff --git a/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean b/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean index dae7ef2d3f48cf..b1871f3ae1c772 100644 --- a/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean +++ b/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Anne Baanen -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.Notation -import Mathlib.LinearAlgebra.Matrix.RowCol -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.GroupTheory.Perm.Fin -import Mathlib.LinearAlgebra.Alternating.Basic -import Mathlib.LinearAlgebra.Matrix.SemiringInverse +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.Notation +public import Mathlib.LinearAlgebra.Matrix.RowCol +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.GroupTheory.Perm.Fin +public import Mathlib.LinearAlgebra.Alternating.Basic +public import Mathlib.LinearAlgebra.Matrix.SemiringInverse /-! # Determinant of a matrix @@ -36,6 +38,8 @@ It is possible to configure `simp` to compute determinants. See the file -/ +@[expose] public section + universe u v w z @@ -150,7 +154,7 @@ theorem det_mul (M N : Matrix n n R) : det (M * N) = det M * det N := Fintype.sum_equiv (Equiv.mulRight σ⁻¹) _ _ fun τ => by have : (∏ j, M (τ j) (σ j)) = ∏ j, M ((τ * σ⁻¹) j) j := by rw [← (σ⁻¹ : _ ≃ _).prod_comp] - simp only [Equiv.Perm.coe_mul, apply_inv_self, Function.comp_apply] + simp have h : ε σ * ε (τ * σ⁻¹) = ε τ := calc ε σ * ε (τ * σ⁻¹) = ε (τ * σ⁻¹ * σ) := by @@ -629,20 +633,18 @@ theorem det_blockDiagonal {o : Type*} [Fintype o] [DecidableEq o] (M : o → Mat exact (this k x).1 · intro σ hσ rw [mem_preserving_snd] at hσ - have hσ' : ∀ x, (σ⁻¹ x).snd = x.snd := by - intro x - conv_rhs => rw [← Perm.apply_inv_self σ x, hσ] + have hσ' x : (σ.symm x).snd = x.snd := by simpa [eq_comm] using hσ (σ.symm x) have mk_apply_eq : ∀ k x, ((σ (x, k)).fst, k) = σ (x, k) := by intro k x ext · simp only · simp only [hσ] - have mk_inv_apply_eq : ∀ k x, ((σ⁻¹ (x, k)).fst, k) = σ⁻¹ (x, k) := by grind - refine ⟨fun k _ => ⟨fun x => (σ (x, k)).fst, fun x => (σ⁻¹ (x, k)).fst, ?_, ?_⟩, ?_, ?_⟩ + have mk_inv_apply_eq : ∀ k x, ((σ.symm (x, k)).fst, k) = σ.symm (x, k) := by grind + refine ⟨fun k _ => ⟨fun x => (σ (x, k)).fst, fun x => (σ.symm (x, k)).fst, ?_, ?_⟩, ?_, ?_⟩ · intro x - simp only [mk_apply_eq, inv_apply_self] + simp [mk_apply_eq] · intro x - simp only [mk_inv_apply_eq, apply_inv_self] + simp [mk_inv_apply_eq] · apply Finset.mem_univ · ext ⟨k, x⟩ · simp only [coe_fn_mk, prodCongrLeft_apply] diff --git a/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean b/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean index 041831e8e0496e..aa54ed002d2936 100644 --- a/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean +++ b/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.Algebra.Ring.NegOnePow +module + +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.Algebra.Ring.NegOnePow /-! # Miscellaneous results about determinant @@ -12,6 +14,8 @@ import Mathlib.Algebra.Ring.NegOnePow In this file, we collect various formulas about determinant of matrices. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean b/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean index 79a80024cb02fd..26dda03ca30597 100644 --- a/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean +++ b/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Martin Dvorak. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Dvorak, Vladimir Kolmogorov, Ivan Sergeev, Bhavik Mehta -/ -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.Data.Matrix.ColumnRowPartitioned -import Mathlib.Data.Sign.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.Data.Matrix.ColumnRowPartitioned +public import Mathlib.Data.Sign.Basic /-! # Totally unimodular matrices @@ -25,6 +27,8 @@ This file defines totally unimodular matrices and provides basic API for them. -/ +@[expose] public section + namespace Matrix variable {m m' n n' R : Type*} [CommRing R] diff --git a/Mathlib/LinearAlgebra/Matrix/Diagonal.lean b/Mathlib/LinearAlgebra/Matrix/Diagonal.lean index 6a026b2a7b901c..5a9403e4c2f6c3 100644 --- a/Mathlib/LinearAlgebra/Matrix/Diagonal.lean +++ b/Mathlib/LinearAlgebra/Matrix/Diagonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.LinearAlgebra.Dimension.LinearMap -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.Dimension.LinearMap +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Diagonal matrices @@ -17,6 +19,8 @@ diagonal matrix (`range`, `ker` and `rank`). matrix, diagonal, linear_map -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Matrix/DotProduct.lean b/Mathlib/LinearAlgebra/Matrix/DotProduct.lean index 0537391a4ed814..6308b21bc18f55 100644 --- a/Mathlib/LinearAlgebra/Matrix/DotProduct.lean +++ b/Mathlib/LinearAlgebra/Matrix/DotProduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Algebra.Star.Pi -import Mathlib.LinearAlgebra.Matrix.RowCol +module + +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Algebra.Star.Pi +public import Mathlib.LinearAlgebra.Matrix.RowCol /-! # Dot product of two vectors @@ -26,6 +28,8 @@ matrix -/ +@[expose] public section + variable {m n p R : Type*} diff --git a/Mathlib/LinearAlgebra/Matrix/Dual.lean b/Mathlib/LinearAlgebra/Matrix/Dual.lean index e464ec72ea40d3..670fd659b1ae42 100644 --- a/Mathlib/LinearAlgebra/Matrix/Dual.lean +++ b/Mathlib/LinearAlgebra/Matrix/Dual.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Dual.Basis -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Dual.Basis +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Dual space, linear maps and matrices. @@ -17,11 +19,13 @@ This file contains some results about matrices and dual spaces. matrix, linear_map, transpose, dual -/ +@[expose] public section + open Matrix Module section Transpose -variable {K V₁ V₂ ι₁ ι₂ : Type*} [Field K] [AddCommGroup V₁] [Module K V₁] [AddCommGroup V₂] +variable {K V₁ V₂ ι₁ ι₂ : Type*} [CommSemiring K] [AddCommGroup V₁] [Module K V₁] [AddCommGroup V₂] [Module K V₂] [Fintype ι₁] [Fintype ι₂] [DecidableEq ι₁] [DecidableEq ι₂] {B₁ : Basis ι₁ K V₁} {B₂ : Basis ι₂ K V₂} diff --git a/Mathlib/LinearAlgebra/Matrix/FiniteDimensional.lean b/Mathlib/LinearAlgebra/Matrix/FiniteDimensional.lean index 33fa2b735b351b..4fd2c93b81046d 100644 --- a/Mathlib/LinearAlgebra/Matrix/FiniteDimensional.lean +++ b/Mathlib/LinearAlgebra/Matrix/FiniteDimensional.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # The finite-dimensional space of matrices @@ -25,6 +27,8 @@ matrix, finite dimensional, findim, finrank -/ +@[expose] public section + universe u v diff --git a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean index 3b7ff73423e5ce..7241347a0646c7 100644 --- a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean +++ b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup -import Mathlib.Data.Int.Interval +public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup +public import Mathlib.Data.Int.Interval /-! # Matrices with fixed determinant @@ -19,6 +20,8 @@ Note: Some of this was done originally in Lean 3 in the kbb (https://github.com/kim-em/kbb/tree/master) repository, so credit to those authors. -/ +@[expose] public section + variable (n : Type*) [DecidableEq n] [Fintype n] (R : Type*) [CommRing R] /-- The subtype of matrices with fixed determinant `m` -/ diff --git a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean index 03db5ab3d43ecf..5fd4965cdad168 100644 --- a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean +++ b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +module + +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs /-! # Basic lemmas about the general linear group $GL(n, R)$ @@ -12,6 +14,8 @@ This file lists various basic lemmas about the general linear group $GL(n, R)$. see `LinearAlgebra/Matrix/GeneralLinearGroup/Defs.lean`. -/ +@[expose] public section + namespace Matrix section Examples diff --git a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Card.lean b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Card.lean index 4e0030c470301f..c8b9b6ecbb20f4 100644 --- a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Card.lean +++ b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Card.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Thomas Lanard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, Inna Capdeboscq, Johan Commelin, Thomas Lanard, Peiran Wu -/ -import Mathlib.FieldTheory.Finiteness -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs -import Mathlib.LinearAlgebra.Matrix.Rank +module + +public import Mathlib.FieldTheory.Finiteness +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.LinearAlgebra.Matrix.Rank /-! # Cardinal of the general linear group over finite rings @@ -18,6 +20,8 @@ This file computes the cardinal of the general linear group over finite rings. * `Matrix.card_GL_field` gives the cardinal of the general linear group over a finite field. -/ +@[expose] public section + open LinearMap Module section LinearIndependent diff --git a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Defs.lean b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Defs.lean index 299d8b5d7c1ad6..34a679628bb0f0 100644 --- a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Defs.lean +++ b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.Algebra.Ring.Subring.Units +module + +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.Algebra.Ring.Subring.Units /-! # The General Linear group $GL(n, R)$ @@ -25,6 +27,8 @@ consisting of all invertible `n` by `n` `R`-matrices. matrix group, group, matrix inverse -/ +@[expose] public section + namespace Matrix @@ -74,6 +78,18 @@ lemma det_ne_zero [Nontrivial R] (g : GL n R) : g.val.det ≠ 0 := def toLin : GL n R ≃* LinearMap.GeneralLinearGroup R (n → R) := Units.mapEquiv toLinAlgEquiv'.toMulEquiv +/-- The isomorphism from `GL n R` to the general linear group of a module +associated with a basis. -/ +noncomputable def toLin' + {V : Type*} [AddCommGroup V] [Module R V] (b : Module.Basis n R V) : + GL n R ≃* LinearMap.GeneralLinearGroup R V := + toLin.trans <| LinearMap.GeneralLinearGroup.congrLinearEquiv b.equivFun.symm + +lemma toLin'_apply {V : Type*} [AddCommGroup V] [Module R V] + (b : Module.Basis n R V) (M : GL n R) (v : V) : + (toLin' b M).toLinearEquiv v = Fintype.linearCombination R ⇑b (↑M *ᵥ (b.repr v)) := by + simp [toLin', toLin, Fintype.linearCombination_apply, MulEquiv.trans_apply] + /-- Given a matrix with invertible determinant, we get an element of `GL n R`. -/ @[simps! val] def mk' (A : Matrix n n R) (_ : Invertible (Matrix.det A)) : GL n R := diff --git a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/FinTwo.lean b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/FinTwo.lean index c68b7f9f9eb3c9..b976d27c79665b 100644 --- a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/FinTwo.lean +++ b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/FinTwo.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.Group.AddChar -import Mathlib.LinearAlgebra.Matrix.Charpoly.Disc -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +module + +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Disc +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs /-! # The group `GL (Fin 2) R` -/ +@[expose] public section + open Polynomial namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Gershgorin.lean b/Mathlib/LinearAlgebra/Matrix/Gershgorin.lean index 631cfdc8e0ed0d..2c3203c3d8d0c7 100644 --- a/Mathlib/LinearAlgebra/Matrix/Gershgorin.lean +++ b/Mathlib/LinearAlgebra/Matrix/Gershgorin.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.LinearAlgebra.Eigenspace.Basic -import Mathlib.LinearAlgebra.Determinant +module + +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.LinearAlgebra.Eigenspace.Basic +public import Mathlib.LinearAlgebra.Determinant /-! # Gershgorin's circle theorem @@ -18,11 +20,13 @@ of matrices and some applications. * https://en.wikipedia.org/wiki/Gershgorin_circle_theorem -/ +@[expose] public section + variable {K n : Type*} [NormedField K] [Fintype n] [DecidableEq n] {A : Matrix n n K} /-- **Gershgorin's circle theorem**: for any eigenvalue `μ` of a square matrix `A`, there exists an index `k` such that `μ` lies in the closed ball of center the diagonal term `A k k` and of -radius the sum of the norms `∑ j ≠ k, ‖A k j‖. -/ +radius the sum of the norms `∑ j ≠ k, ‖A k j‖`. -/ theorem eigenvalue_mem_ball {μ : K} (hμ : Module.End.HasEigenvalue (Matrix.toLin' A) μ) : ∃ k, μ ∈ Metric.closedBall (A k k) (∑ j ∈ Finset.univ.erase k, ‖A k j‖) := by cases isEmpty_or_nonempty n diff --git a/Mathlib/LinearAlgebra/Matrix/Hadamard.lean b/Mathlib/LinearAlgebra/Matrix/Hadamard.lean index 1c906f78c4157c..94e166473c01cd 100644 --- a/Mathlib/LinearAlgebra/Matrix/Hadamard.lean +++ b/Mathlib/LinearAlgebra/Matrix/Hadamard.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Lu-Ming Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lu-Ming Zhang -/ -import Mathlib.LinearAlgebra.Matrix.Trace -import Mathlib.Data.Matrix.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Trace +public import Mathlib.Data.Matrix.Basic /-! # Hadamard product of matrices @@ -30,6 +32,8 @@ and contains basic properties about them. hadamard product, hadamard -/ +@[expose] public section + variable {α m n R : Type*} diff --git a/Mathlib/LinearAlgebra/Matrix/Hermitian.lean b/Mathlib/LinearAlgebra/Matrix/Hermitian.lean index 703337fd1489ba..90b21cc8ab1558 100644 --- a/Mathlib/LinearAlgebra/Matrix/Hermitian.lean +++ b/Mathlib/LinearAlgebra/Matrix/Hermitian.lean @@ -3,9 +3,10 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.LinearAlgebra.Matrix.ConjTranspose -import Mathlib.LinearAlgebra.Matrix.ZPow +module + +public import Mathlib.Algebra.Star.Pi +public import Mathlib.LinearAlgebra.Matrix.ZPow /-! # Hermitian matrices @@ -23,14 +24,15 @@ self-adjoint matrix, hermitian matrix -/ +@[expose] public section -namespace Matrix - -variable {α β : Type*} {m n : Type*} {A : Matrix n n α} +-- TODO: +-- assert_not_exists MonoidAlgebra +assert_not_exists NormedGroup -open scoped Matrix +namespace Matrix -local notation "⟪" x ", " y "⟫" => inner α x y +variable {α β m n : Type*} {A : Matrix n n α} section Star @@ -307,40 +309,4 @@ end IsHermitian end SchurComplement end CommRing - -section RCLike - -open RCLike - -variable [RCLike α] - -/-- The diagonal elements of a complex Hermitian matrix are real. -/ -theorem IsHermitian.coe_re_apply_self {A : Matrix n n α} (h : A.IsHermitian) (i : n) : - (re (A i i) : α) = A i i := by rw [← conj_eq_iff_re, ← star_def, ← conjTranspose_apply, h.eq] - -/-- The diagonal elements of a complex Hermitian matrix are real. -/ -theorem IsHermitian.coe_re_diag {A : Matrix n n α} (h : A.IsHermitian) : - (fun i => (re (A.diag i) : α)) = A.diag := - funext h.coe_re_apply_self - -/-- A matrix is Hermitian iff the corresponding linear map is self adjoint. -/ -theorem isHermitian_iff_isSymmetric [Fintype n] [DecidableEq n] {A : Matrix n n α} : - IsHermitian A ↔ A.toEuclideanLin.IsSymmetric := by - rw [LinearMap.IsSymmetric, (WithLp.toLp_surjective _).forall₂] - simp only [toEuclideanLin_toLp, Matrix.toLin'_apply, EuclideanSpace.inner_eq_star_dotProduct, - star_mulVec] - constructor - · rintro (h : Aᴴ = A) x y - rw [dotProduct_comm, ← dotProduct_mulVec, h, dotProduct_comm] - · intro h - ext i j - simpa [(Pi.single_star i 1).symm] using h (Pi.single i 1) (Pi.single j 1) - -theorem IsHermitian.im_star_dotProduct_mulVec_self [Fintype n] {A : Matrix n n α} - (hA : A.IsHermitian) (x : n → α) : RCLike.im (star x ⬝ᵥ A *ᵥ x) = 0 := by - classical - exact dotProduct_comm _ (star x) ▸ (isHermitian_iff_isSymmetric.mp hA).im_inner_self_apply _ - -end RCLike - end Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/HermitianFunctionalCalculus.lean b/Mathlib/LinearAlgebra/Matrix/HermitianFunctionalCalculus.lean index 61c11d5af207db..99ce1f138d8271 100644 --- a/Mathlib/LinearAlgebra/Matrix/HermitianFunctionalCalculus.lean +++ b/Mathlib/LinearAlgebra/Matrix/HermitianFunctionalCalculus.lean @@ -1,145 +1,5 @@ -/- -Copyright (c) 2024 Jon Bannon. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Jon Bannon, Jireh Loreaux --/ -import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -import Mathlib.Analysis.Matrix.Spectrum -import Mathlib.Topology.ContinuousMap.Units +module -/-! -# Continuous Functional Calculus for Hermitian Matrices +public import Mathlib.Analysis.Matrix.HermitianFunctionalCalculus -This file defines an instance of the continuous functional calculus for Hermitian matrices over an -`RCLike` field `𝕜`. - -## Main Results - -- `Matrix.IsHermitian.cfc` : Realization of the functional calculus for a Hermitian matrix - as the triple product `U * diagonal (RCLike.ofReal ∘ f ∘ hA.eigenvalues) * star U` with - `U = eigenvectorUnitary hA`. - -- `cfc_eq` : Proof that the above agrees with the continuous functional calculus. - -- `Matrix.IsHermitian.instContinuousFunctionalCalculus` : Instance of the continuous functional - calculus for a Hermitian matrix `A` over `𝕜`. - -## Tags - -spectral theorem, diagonalization theorem, continuous functional calculus --/ - -open Topology Unitary - -namespace Matrix - -variable {n 𝕜 : Type*} [RCLike 𝕜] [Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} - -namespace IsHermitian - -variable (hA : IsHermitian A) - -/-- The star algebra homomorphism underlying the instance of the continuous functional -calculus of a Hermitian matrix. This is an auxiliary definition and is not intended -for use outside of this file. -/ -@[simps] -noncomputable def cfcAux : C(spectrum ℝ A, ℝ) →⋆ₐ[ℝ] (Matrix n n 𝕜) where - toFun := fun g => conjStarAlgAut ℝ _ hA.eigenvectorUnitary <| - diagonal (RCLike.ofReal ∘ g ∘ (fun i ↦ ⟨hA.eigenvalues i, hA.eigenvalues_mem_spectrum_real i⟩)) - map_zero' := by simp [Pi.zero_def, Function.comp_def] - map_one' := by simp [Pi.one_def, Function.comp_def] - map_mul' f g := by - simp only [ContinuousMap.coe_mul, ← map_mul, diagonal_mul_diagonal, Function.comp_apply] - rfl - map_add' f g := by - simp only [ContinuousMap.coe_add, ← map_add, diagonal_add, Function.comp_apply] - rfl - commutes' r := by - simp only [Function.comp_def, algebraMap_apply, smul_eq_mul, mul_one] - rw [← mul_one (algebraMap _ _ _), ← coe_mul_star_self hA.eigenvectorUnitary, - ← Algebra.left_comm, coe_star, ← mul_assoc, conjStarAlgAut_apply] - rfl - map_star' f := by - simp only [star_trivial, ← map_star, star_eq_conjTranspose, diagonal_conjTranspose, Pi.star_def, - Function.comp_apply, RCLike.star_def, RCLike.conj_ofReal] - rfl - -lemma isClosedEmbedding_cfcAux : IsClosedEmbedding hA.cfcAux := by - have h0 : FiniteDimensional ℝ C(spectrum ℝ A, ℝ) := - FiniteDimensional.of_injective (ContinuousMap.coeFnLinearMap ℝ (M := ℝ)) DFunLike.coe_injective - refine LinearMap.isClosedEmbedding_of_injective (𝕜 := ℝ) (E := C(spectrum ℝ A, ℝ)) - (F := Matrix n n 𝕜) (f := hA.cfcAux) <| LinearMap.ker_eq_bot'.mpr fun f hf ↦ ?_ - have h2 : - diagonal (RCLike.ofReal ∘ f ∘ fun i ↦ ⟨hA.eigenvalues i, hA.eigenvalues_mem_spectrum_real i⟩) - = (0 : Matrix n n 𝕜) := by - simp only [LinearMap.coe_coe, cfcAux_apply, conjStarAlgAut_apply] at hf - replace hf := congr($hf * (hA.eigenvectorUnitary : Matrix n n 𝕜)) - simp only [mul_assoc, SetLike.coe_mem, Unitary.star_mul_self_of_mem, mul_one, zero_mul] at hf - simpa [← mul_assoc] using congr((star hA.eigenvectorUnitary : Matrix n n 𝕜) * $hf) - ext x - simp only [ContinuousMap.zero_apply] - obtain ⟨x, hx⟩ := x - obtain ⟨i, rfl⟩ := hA.spectrum_real_eq_range_eigenvalues ▸ hx - rw [← diagonal_zero] at h2 - have := (diagonal_eq_diagonal_iff).mp h2 - exact RCLike.ofReal_eq_zero.mp (this i) - -lemma cfcAux_id : hA.cfcAux (.restrict (spectrum ℝ A) (.id ℝ)) = A := by - conv_rhs => rw [hA.spectral_theorem] - rfl - -/-- Instance of the continuous functional calculus for a Hermitian matrix over `𝕜` with -`RCLike 𝕜`. -/ -instance instContinuousFunctionalCalculus : - ContinuousFunctionalCalculus ℝ (Matrix n n 𝕜) IsSelfAdjoint where - exists_cfc_of_predicate a ha := by - replace ha : IsHermitian a := ha - refine ⟨ha.cfcAux, ha.isClosedEmbedding_cfcAux, ha.cfcAux_id, fun f ↦ ?map_spec, - fun f ↦ ?hermitian⟩ - case map_spec => - apply Set.eq_of_subset_of_subset - · rw [← ContinuousMap.spectrum_eq_range f] - apply AlgHom.spectrum_apply_subset - · rw [cfcAux_apply, conjStarAlgAut_apply, Unitary.spectrum_star_right_conjugate] - rintro - ⟨x, rfl⟩ - apply spectrum.of_algebraMap_mem 𝕜 - simp only [Function.comp_apply, Set.mem_range, spectrum_diagonal] - obtain ⟨x, hx⟩ := x - obtain ⟨i, rfl⟩ := ha.spectrum_real_eq_range_eigenvalues ▸ hx - exact ⟨i, rfl⟩ - case hermitian => - simp only [isSelfAdjoint_iff, cfcAux_apply, ← map_star] - rw [star_eq_conjTranspose, diagonal_conjTranspose] - congr! - simp [Pi.star_def, Function.comp_def] - spectrum_nonempty a ha := by - obtain (h | h) := isEmpty_or_nonempty n - · obtain ⟨x, y, hxy⟩ := exists_pair_ne (Matrix n n 𝕜) - exact False.elim <| Matrix.of.symm.injective.ne hxy <| Subsingleton.elim _ _ - · exact spectrum_real_eq_range_eigenvalues ha ▸ Set.range_nonempty _ - predicate_zero := .zero _ - -/-- The continuous functional calculus of a Hermitian matrix as a triple product using the -spectral theorem. Note that this actually operates on bare functions since every function is -continuous on the spectrum of a matrix, since the spectrum is finite. This is shown to be equal to -the generic continuous functional calculus API in `Matrix.IsHermitian.cfc_eq`. In general, users -should prefer the generic API, especially because it will make rewriting easier. -/ -protected noncomputable def cfc (f : ℝ → ℝ) : Matrix n n 𝕜 := - conjStarAlgAut ℝ _ hA.eigenvectorUnitary (diagonal (RCLike.ofReal ∘ f ∘ hA.eigenvalues)) - -lemma cfc_eq (f : ℝ → ℝ) : cfc f A = hA.cfc f := by - have hA' : IsSelfAdjoint A := hA - have := cfcHom_eq_of_continuous_of_map_id hA' hA.cfcAux hA.isClosedEmbedding_cfcAux.continuous - hA.cfcAux_id - rw [cfc_apply f A hA' (by rw [continuousOn_iff_continuous_restrict]; fun_prop), this] - simp only [cfcAux_apply, ContinuousMap.coe_mk, Function.comp_def, Set.restrict_apply, - IsHermitian.cfc] - -open Polynomial in -lemma charpoly_cfc_eq (f : ℝ → ℝ) : - (cfc f A).charpoly = ∏ i, (X - C (f (hA.eigenvalues i) : 𝕜)) := by - rw [cfc_eq hA f, IsHermitian.cfc, conjStarAlgAut_apply, charpoly_mul_comm, ← mul_assoc] - simp [charpoly_diagonal] - -end IsHermitian -end Matrix +deprecated_module (since := "2025-11-13") diff --git a/Mathlib/LinearAlgebra/Matrix/Ideal.lean b/Mathlib/LinearAlgebra/Matrix/Ideal.lean index 2751be559eaf5f..a18924af08681e 100644 --- a/Mathlib/LinearAlgebra/Matrix/Ideal.lean +++ b/Mathlib/LinearAlgebra/Matrix/Ideal.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Wojciech Nawrocki -/ -import Mathlib.Data.Matrix.Basis -import Mathlib.GroupTheory.Congruence.BigOperators -import Mathlib.RingTheory.Ideal.Lattice -import Mathlib.RingTheory.TwoSidedIdeal.Operations -import Mathlib.RingTheory.Jacobson.Ideal +module + +public import Mathlib.Data.Matrix.Basis +public import Mathlib.GroupTheory.Congruence.BigOperators +public import Mathlib.RingTheory.Ideal.Lattice +public import Mathlib.RingTheory.TwoSidedIdeal.Operations +public import Mathlib.RingTheory.Jacobson.Ideal /-! # Ideals in a matrix ring @@ -24,6 +26,8 @@ We also characterize Jacobson radicals of ideals in such rings. for any two-sided ideal $I ≤ R$. -/ +@[expose] public section + /-! ### Left ideals in a matrix semiring -/ namespace Ideal diff --git a/Mathlib/LinearAlgebra/Matrix/Integer.lean b/Mathlib/LinearAlgebra/Matrix/Integer.lean index 530a42840b1666..3c6823b92e9a65 100644 --- a/Mathlib/LinearAlgebra/Matrix/Integer.lean +++ b/Mathlib/LinearAlgebra/Matrix/Integer.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.GCDMonoid.Finset -import Mathlib.Algebra.GCDMonoid.Nat -import Mathlib.Data.Matrix.Mul -import Mathlib.Data.Rat.Cast.CharZero +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.GCDMonoid.Finset +public import Mathlib.Algebra.GCDMonoid.Nat +public import Mathlib.Data.Matrix.Mul +public import Mathlib.Data.Rat.Cast.CharZero /-! # Lemmas on integer matrices @@ -24,6 +26,8 @@ Here we collect some results about matrices over `ℚ` and `ℤ`. Consider generalizing these constructions to matrices over localizations of rings (or semirings). -/ +@[expose] public section + namespace Matrix variable {m n : Type*} [Fintype m] [Fintype n] diff --git a/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean b/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean index 2bb6fb868699b0..f3330e274c01aa 100644 --- a/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean +++ b/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Module.Projective -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.Matrix.SemiringInverse -import Mathlib.LinearAlgebra.InvariantBasisNumber +module + +public import Mathlib.Algebra.Module.Projective +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.Matrix.SemiringInverse +public import Mathlib.LinearAlgebra.InvariantBasisNumber /-! # Invertible matrices over a ring with invariant basis number are square. -/ +@[expose] public section + variable {n m : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] variable {R : Type*} [Semiring R] [InvariantBasisNumber R] diff --git a/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean b/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean index 9fb99d38806cd9..105d8746085518 100644 --- a/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean +++ b/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ +module -import Mathlib.Combinatorics.Quiver.ConnectedComponent -import Mathlib.Combinatorics.Quiver.Path.Vertices -import Mathlib.Data.Matrix.Mul +public import Mathlib.Combinatorics.Quiver.ConnectedComponent +public import Mathlib.Combinatorics.Quiver.Path.Vertices +public import Mathlib.Data.Matrix.Mul /-! # Irreducibility and primitivity of nonnegative matrices @@ -57,6 +58,8 @@ like `PosMulStrictMono R` or `Nontrivial R`. Some statements expand matrix power matrix, nonnegative, positive, power, quiver, graph, irreducible, primitive, perron-frobenius -/ + +@[expose] public section namespace Matrix open Quiver Quiver.Path diff --git a/Mathlib/LinearAlgebra/Matrix/IsDiag.lean b/Mathlib/LinearAlgebra/Matrix/IsDiag.lean index 3e7d41d8af522e..30b3efdc4a4040 100644 --- a/Mathlib/LinearAlgebra/Matrix/IsDiag.lean +++ b/Mathlib/LinearAlgebra/Matrix/IsDiag.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Lu-Ming Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lu-Ming Zhang -/ -import Mathlib.LinearAlgebra.Matrix.Kronecker -import Mathlib.LinearAlgebra.Matrix.Orthogonal -import Mathlib.LinearAlgebra.Matrix.Symmetric +module + +public import Mathlib.LinearAlgebra.Matrix.Kronecker +public import Mathlib.LinearAlgebra.Matrix.Orthogonal +public import Mathlib.LinearAlgebra.Matrix.Symmetric /-! # Diagonal matrices @@ -21,6 +23,8 @@ This file contains the definition and basic results about diagonal matrices. diag, diagonal, matrix -/ +@[expose] public section + namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Kronecker.lean b/Mathlib/LinearAlgebra/Matrix/Kronecker.lean index 09f768b3ee075d..4fdeba4bd57ab2 100644 --- a/Mathlib/LinearAlgebra/Matrix/Kronecker.lean +++ b/Mathlib/LinearAlgebra/Matrix/Kronecker.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Filippo A. E. Nuccio. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Filippo A. E. Nuccio, Eric Wieser -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.Trace -import Mathlib.LinearAlgebra.TensorProduct.Basic -import Mathlib.LinearAlgebra.TensorProduct.Associator -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.Trace +public import Mathlib.LinearAlgebra.TensorProduct.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Associator +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Kronecker product of matrices @@ -42,6 +44,8 @@ These require `open Kronecker`: -/ +@[expose] public section + namespace Matrix open scoped RightActions diff --git a/Mathlib/LinearAlgebra/Matrix/MvPolynomial.lean b/Mathlib/LinearAlgebra/Matrix/MvPolynomial.lean index 197b0715e6b176..be30f5197e6e9e 100644 --- a/Mathlib/LinearAlgebra/Matrix/MvPolynomial.lean +++ b/Mathlib/LinearAlgebra/Matrix/MvPolynomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.MvPolynomial.Eval -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic /-! # Matrices of multivariate polynomials @@ -19,6 +21,8 @@ unique variable. matrix determinant, multivariate polynomial -/ +@[expose] public section + variable {m n R S : Type*} diff --git a/Mathlib/LinearAlgebra/Matrix/Nondegenerate.lean b/Mathlib/LinearAlgebra/Matrix/Nondegenerate.lean index 545731f468a232..716fcb8321922b 100644 --- a/Mathlib/LinearAlgebra/Matrix/Nondegenerate.lean +++ b/Mathlib/LinearAlgebra/Matrix/Nondegenerate.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.Adjugate +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.Adjugate /-! # Matrices associated with non-degenerate bilinear forms @@ -17,6 +19,8 @@ import Mathlib.LinearAlgebra.Matrix.Adjugate -/ +@[expose] public section + namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean b/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean index ba800f5ed70dba..b4cb9c72958d2b 100644 --- a/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean +++ b/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Lu-Ming Zhang -/ -import Mathlib.Data.Matrix.Invertible -import Mathlib.LinearAlgebra.FiniteDimensional.Basic -import Mathlib.LinearAlgebra.Matrix.Adjugate -import Mathlib.LinearAlgebra.Matrix.Kronecker -import Mathlib.LinearAlgebra.Matrix.SemiringInverse -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.Matrix.Trace +module + +public import Mathlib.Data.Matrix.Invertible +public import Mathlib.LinearAlgebra.FiniteDimensional.Basic +public import Mathlib.LinearAlgebra.Matrix.Adjugate +public import Mathlib.LinearAlgebra.Matrix.Kronecker +public import Mathlib.LinearAlgebra.Matrix.SemiringInverse +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.Matrix.Trace /-! # Nonsingular inverses @@ -52,6 +54,8 @@ The rest of the results in the file are then about `A⁻¹` matrix inverse, cramer, cramer's rule, adjugate -/ +@[expose] public section + namespace Matrix @@ -590,7 +594,7 @@ variable (A : Matrix n n α) (U : Matrix n m α) (C : Matrix m m α) (V : Matrix /-- The **Woodbury Identity** (`⁻¹` version). -See ``add_mul_mul_inv_eq_sub'` for the binomial inverse theorem. -/ +See `add_mul_mul_inv_eq_sub'` for the binomial inverse theorem. -/ theorem add_mul_mul_inv_eq_sub (hA : IsUnit A) (hC : IsUnit C) (hAC : IsUnit (C⁻¹ + V * A⁻¹ * U)) : (A + U * C * V)⁻¹ = A⁻¹ - A⁻¹ * U * (C⁻¹ + V * A⁻¹ * U)⁻¹ * V * A⁻¹ := by obtain ⟨_⟩ := hA.nonempty_invertible diff --git a/Mathlib/LinearAlgebra/Matrix/Notation.lean b/Mathlib/LinearAlgebra/Matrix/Notation.lean index bad264028195c4..bc5daa91a18525 100644 --- a/Mathlib/LinearAlgebra/Matrix/Notation.lean +++ b/Mathlib/LinearAlgebra/Matrix/Notation.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Eric Wieser -/ -import Mathlib.Algebra.Group.Fin.Tuple -import Mathlib.Data.Fin.VecNotation -import Mathlib.LinearAlgebra.Matrix.RowCol -import Mathlib.Tactic.FinCases -import Mathlib.Algebra.BigOperators.Fin +module + +public import Mathlib.Algebra.Group.Fin.Tuple +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.LinearAlgebra.Matrix.RowCol +public import Mathlib.Tactic.FinCases +public import Mathlib.Algebra.BigOperators.Fin /-! # Matrix and vector notation @@ -37,6 +39,8 @@ This file provide notation `!![a, b; c, d]` for matrices, which corresponds to Examples of usage can be found in the `MathlibTest/matrix.lean` file. -/ +@[expose] public section + namespace Matrix universe u uₘ uₙ uₒ @@ -51,14 +55,14 @@ open Lean Qq open Qq in /-- `Matrix.mkLiteralQ !![a, b; c, d]` produces the term `q(!![$a, $b; $c, $d])`. -/ -def mkLiteralQ {u : Level} {α : Q(Type u)} {m n : Nat} (elems : Matrix (Fin m) (Fin n) Q($α)) : +meta def mkLiteralQ {u : Level} {α : Q(Type u)} {m n : Nat} (elems : Matrix (Fin m) (Fin n) Q($α)) : Q(Matrix (Fin $m) (Fin $n) $α) := let elems := PiFin.mkLiteralQ (α := q(Fin $n → $α)) fun i => PiFin.mkLiteralQ fun j => elems i j q(Matrix.of $elems) /-- Matrices can be reflected whenever their entries can. We insert a `Matrix.of` to prevent immediate decay to a function. -/ -protected instance toExpr [ToLevel.{u}] [ToLevel.{uₘ}] [ToLevel.{uₙ}] +protected meta instance toExpr [ToLevel.{u}] [ToLevel.{uₘ}] [ToLevel.{uₙ}] [Lean.ToExpr α] [Lean.ToExpr m'] [Lean.ToExpr n'] [Lean.ToExpr (m' → n' → α)] : Lean.ToExpr (Matrix m' n' α) := have eα : Q(Type $(toLevel.{u})) := toTypeExpr α @@ -119,7 +123,8 @@ macro_rules /-- Delaborator for the `!![]` notation. -/ @[app_delab DFunLike.coe] -def delabMatrixNotation : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| +meta def delabMatrixNotation : Delab := whenNotPPOption getPPExplicit <| + whenPPOption getPPNotation <| withOverApp 6 do let mkApp3 (.const ``Matrix.of _) (.app (.const ``Fin _) em) (.app (.const ``Fin _) en) _ := (← getExpr).appFn!.appArg! | failure diff --git a/Mathlib/LinearAlgebra/Matrix/Orthogonal.lean b/Mathlib/LinearAlgebra/Matrix/Orthogonal.lean index d0bc1867f39f47..6555b9463f5684 100644 --- a/Mathlib/LinearAlgebra/Matrix/Orthogonal.lean +++ b/Mathlib/LinearAlgebra/Matrix/Orthogonal.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Lu-Ming Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lu-Ming Zhang -/ -import Mathlib.Data.Matrix.Mul +module + +public import Mathlib.Data.Matrix.Mul /-! # Orthogonal @@ -22,6 +24,8 @@ This file contains definitions and properties concerning orthogonality of rows a orthogonal -/ +@[expose] public section + assert_not_exists Field namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Permanent.lean b/Mathlib/LinearAlgebra/Matrix/Permanent.lean index 83ac4c5a1b1872..e4ab202d2fd799 100644 --- a/Mathlib/LinearAlgebra/Matrix/Permanent.lean +++ b/Mathlib/LinearAlgebra/Matrix/Permanent.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Firsching -/ -import Mathlib.Data.Fintype.Perm -import Mathlib.LinearAlgebra.Matrix.RowCol +module + +public import Mathlib.Data.Fintype.Perm +public import Mathlib.LinearAlgebra.Matrix.RowCol /-! # Permanent of a matrix @@ -16,6 +18,8 @@ This file defines the permanent of a matrix, `Matrix.permanent`, and some of its -/ +@[expose] public section + open Equiv Fintype Finset namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Permutation.lean b/Mathlib/LinearAlgebra/Matrix/Permutation.lean index 27be16625096af..69cb7ff46d99eb 100644 --- a/Mathlib/LinearAlgebra/Matrix/Permutation.lean +++ b/Mathlib/LinearAlgebra/Matrix/Permutation.lean @@ -3,12 +3,13 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ +module -import Mathlib.Analysis.CStarAlgebra.Matrix -import Mathlib.Data.Matrix.PEquiv -import Mathlib.Data.Set.Card -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.Trace +public import Mathlib.Analysis.CStarAlgebra.Matrix +public import Mathlib.Data.Matrix.PEquiv +public import Mathlib.Data.Set.Card +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.Trace /-! # Permutation matrices @@ -26,6 +27,8 @@ This file defines the matrix associated with a permutation -/ +@[expose] public section + open Equiv variable {n R : Type*} [DecidableEq n] (σ : Perm n) diff --git a/Mathlib/LinearAlgebra/Matrix/Polynomial.lean b/Mathlib/LinearAlgebra/Matrix/Polynomial.lean index e7e018ed807080..399999b9da1372 100644 --- a/Mathlib/LinearAlgebra/Matrix/Polynomial.lean +++ b/Mathlib/LinearAlgebra/Matrix/Polynomial.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.Polynomial.BigOperators -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.Tactic.ComputeDegree +module + +public import Mathlib.Algebra.Polynomial.BigOperators +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.Tactic.ComputeDegree /-! # Matrices of polynomials and polynomials of matrices @@ -24,6 +26,8 @@ In particular, we give results about the polynomial given by matrix determinant, polynomial -/ +@[expose] public section + open Matrix Polynomial diff --git a/Mathlib/LinearAlgebra/Matrix/PosDef.lean b/Mathlib/LinearAlgebra/Matrix/PosDef.lean index 72dfd79c004fb6..58cb6777a72e5b 100644 --- a/Mathlib/LinearAlgebra/Matrix/PosDef.lean +++ b/Mathlib/LinearAlgebra/Matrix/PosDef.lean @@ -3,11 +3,15 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Mohanad Ahmed -/ -import Mathlib.Algebra.Order.Ring.Star -import Mathlib.LinearAlgebra.Matrix.DotProduct -import Mathlib.LinearAlgebra.Matrix.Hermitian -import Mathlib.LinearAlgebra.Matrix.Vec -import Mathlib.LinearAlgebra.QuadraticForm.Basic +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.Order.Ring.Star +public import Mathlib.Data.Real.Star +public import Mathlib.LinearAlgebra.Matrix.DotProduct +public import Mathlib.LinearAlgebra.Matrix.Hermitian +public import Mathlib.LinearAlgebra.Matrix.Vec +public import Mathlib.LinearAlgebra.QuadraticForm.Basic /-! # Positive Definite Matrices @@ -22,8 +26,6 @@ order on matrices on `ℝ` or `ℂ`. and `xᴴMx` is nonnegative for all `x`. * `Matrix.PosDef` : a matrix `M : Matrix n n R` is positive definite if it is Hermitian and `xᴴMx` is greater than zero for all nonzero `x`. -* `Matrix.InnerProductSpace.ofMatrix`: the inner product on `n → 𝕜` induced by a positive definite - matrix `M`, and is given by `⟪x, y⟫ = xᴴMy`. ## Main results @@ -33,22 +35,20 @@ order on matrices on `ℝ` or `ℂ`. * `Matrix.PosDef.isUnit`: A positive definite matrix in a field is invertible. -/ +@[expose] public section + -- TODO: -- assert_not_exists MonoidAlgebra -assert_not_exists Matrix.IsHermitian.eigenvalues - -open WithLp +assert_not_exists NormedGroup -open scoped ComplexOrder +open Matrix namespace Matrix -variable {m n R R' 𝕜 : Type*} +variable {m n R R' : Type*} variable [Fintype m] [Fintype n] variable [Ring R] [PartialOrder R] [StarRing R] variable [CommRing R'] [PartialOrder R'] [StarRing R'] -variable [RCLike 𝕜] -open Matrix /-! ## Positive semidefinite matrices @@ -76,10 +76,6 @@ namespace PosSemidef theorem isHermitian {M : Matrix n n R} (hM : M.PosSemidef) : M.IsHermitian := hM.1 -theorem re_dotProduct_nonneg {M : Matrix n n 𝕜} (hM : M.PosSemidef) (x : n → 𝕜) : - 0 ≤ RCLike.re (star x ⬝ᵥ (M *ᵥ x)) := - RCLike.nonneg_iff.mp (hM.2 _) |>.1 - lemma conjTranspose_mul_mul_same {A : Matrix n n R} (hA : PosSemidef A) {m : Type*} [Fintype m] (B : Matrix n m R) : PosSemidef (Bᴴ * A * B) := by @@ -279,10 +275,6 @@ namespace PosDef theorem isHermitian {M : Matrix n n R} (hM : M.PosDef) : M.IsHermitian := hM.1 -theorem re_dotProduct_pos {M : Matrix n n 𝕜} (hM : M.PosDef) {x : n → 𝕜} (hx : x ≠ 0) : - 0 < RCLike.re (star x ⬝ᵥ (M *ᵥ x)) := - RCLike.pos_iff.mp (hM.2 _ hx) |>.1 - theorem posSemidef {M : Matrix n n R} (hM : M.PosDef) : M.PosSemidef := by refine ⟨hM.1, ?_⟩ intro x @@ -551,28 +543,3 @@ theorem posDef_toMatrix' [DecidableEq n] {Q : QuadraticForm ℝ (n → ℝ)} (hQ exact .of_toQuadraticForm' (isSymm_toMatrix' Q) hQ end QuadraticForm - -namespace Matrix -variable {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] - -/-- A positive definite matrix `M` induces a norm `‖x‖ = sqrt (re xᴴMx)`. -/ -noncomputable abbrev NormedAddCommGroup.ofMatrix {M : Matrix n n 𝕜} (hM : M.PosDef) : - NormedAddCommGroup (n → 𝕜) := - @InnerProductSpace.Core.toNormedAddCommGroup _ _ _ _ _ - { inner x y := (M *ᵥ y) ⬝ᵥ star x - conj_inner_symm x y := by - rw [dotProduct_comm, star_dotProduct, starRingEnd_apply, star_star, - star_mulVec, dotProduct_comm (M *ᵥ y), dotProduct_mulVec, hM.isHermitian.eq] - re_inner_nonneg x := dotProduct_comm _ (star x) ▸ hM.posSemidef.re_dotProduct_nonneg x - definite x (hx : _ ⬝ᵥ _ = 0) := by - by_contra! h - simpa [hx, lt_irrefl, dotProduct_comm] using hM.re_dotProduct_pos h - add_left := by simp only [star_add, dotProduct_add, forall_const] - smul_left _ _ _ := by rw [← smul_eq_mul, ← dotProduct_smul, starRingEnd_apply, ← star_smul] } - -/-- A positive definite matrix `M` induces an inner product `⟪x, y⟫ = xᴴMy`. -/ -def InnerProductSpace.ofMatrix {M : Matrix n n 𝕜} (hM : M.PosDef) : - @InnerProductSpace 𝕜 (n → 𝕜) _ (NormedAddCommGroup.ofMatrix hM).toSeminormedAddCommGroup := - InnerProductSpace.ofCore _ - -end Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/ProjectiveSpecialLinearGroup.lean b/Mathlib/LinearAlgebra/Matrix/ProjectiveSpecialLinearGroup.lean index 537c3acc449a2f..46e1747ab23782 100644 --- a/Mathlib/LinearAlgebra/Matrix/ProjectiveSpecialLinearGroup.lean +++ b/Mathlib/LinearAlgebra/Matrix/ProjectiveSpecialLinearGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Wen Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wen Yang -/ -import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup +module + +public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup /-! # Projective Special Linear Group @@ -15,6 +17,8 @@ In the `MatrixGroups` locale: * `PSL(n, R)` is a shorthand for `Matrix.ProjectiveSpecialLinearGroup (Fin n) R` -/ +@[expose] public section + namespace Matrix universe u v diff --git a/Mathlib/LinearAlgebra/Matrix/Rank.lean b/Mathlib/LinearAlgebra/Matrix/Rank.lean index aefcb6f1a5a2de..a9121180c8a307 100644 --- a/Mathlib/LinearAlgebra/Matrix/Rank.lean +++ b/Mathlib/LinearAlgebra/Matrix/Rank.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Eric Wieser -/ -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.Matrix.Diagonal -import Mathlib.LinearAlgebra.Matrix.DotProduct -import Mathlib.LinearAlgebra.Matrix.Dual +module + +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.Matrix.Diagonal +public import Mathlib.LinearAlgebra.Matrix.DotProduct +public import Mathlib.LinearAlgebra.Matrix.Dual /-! # Rank of matrices @@ -24,6 +26,8 @@ This definition does not depend on the choice of basis, see `Matrix.rank_eq_finr -/ +@[expose] public section + open Matrix namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Reindex.lean b/Mathlib/LinearAlgebra/Matrix/Reindex.lean index 5f353dfba3efb7..ce00f8af19c5e5 100644 --- a/Mathlib/LinearAlgebra/Matrix/Reindex.lean +++ b/Mathlib/LinearAlgebra/Matrix/Reindex.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic /-! # Changing the index type of a matrix @@ -23,6 +25,8 @@ matrix, reindex -/ +@[expose] public section + namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/RowCol.lean b/Mathlib/LinearAlgebra/Matrix/RowCol.lean index ea52b457d4d0f8..b9930f21675489 100644 --- a/Mathlib/LinearAlgebra/Matrix/RowCol.lean +++ b/Mathlib/LinearAlgebra/Matrix/RowCol.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Eric Wieser -/ -import Mathlib.LinearAlgebra.Matrix.ConjTranspose +module + +public import Mathlib.LinearAlgebra.Matrix.ConjTranspose /-! # Row and column matrices @@ -19,6 +21,8 @@ This file provides results about row and column matrices. -/ +@[expose] public section + variable {l m n o : Type*} universe u v w diff --git a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean index 0874a1e752fc33..da3325eae6c7b5 100644 --- a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean +++ b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alexander Bentkamp, Eric Wieser, Jeremy Avigad, Johan Commelin -/ -import Mathlib.Data.Matrix.Invertible -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +module + +public import Mathlib.Data.Matrix.Invertible +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse /-! # 2×2 block matrices and the Schur complement @@ -28,6 +30,8 @@ Compare with `Matrix.invertibleOfFromBlocks₁₁Invertible`. -/ +@[expose] public section + variable {l m n α : Type*} diff --git a/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean b/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean index 9e438386dfa5ce..84d99ea4e729e0 100644 --- a/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean +++ b/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Group.Embedding -import Mathlib.Data.Matrix.Mul -import Mathlib.GroupTheory.Perm.Sign +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Data.Matrix.Mul +public import Mathlib.GroupTheory.Perm.Sign /-! # Nonsingular inverses over semirings @@ -14,6 +16,8 @@ This file proves `A * B = 1 ↔ B * A = 1` for square matrices over a commutativ -/ +@[expose] public section + open Equiv Equiv.Perm Finset variable {n m R : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] diff --git a/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean b/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean index f6c63f0b15c93a..5a6140e6a444a6 100644 --- a/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean +++ b/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kexing Ying, Moritz Doll -/ -import Mathlib.Algebra.GroupWithZero.Action.Opposite -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.Matrix.Basis -import Mathlib.LinearAlgebra.Matrix.Nondegenerate -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv -import Mathlib.LinearAlgebra.SesquilinearForm.Basic -import Mathlib.LinearAlgebra.Basis.Bilinear +module + +public import Mathlib.Algebra.GroupWithZero.Action.Opposite +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.Matrix.Basis +public import Mathlib.LinearAlgebra.Matrix.Nondegenerate +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic +public import Mathlib.LinearAlgebra.Basis.Bilinear /-! # Sesquilinear form @@ -35,6 +37,8 @@ Sesquilinear form, Sesquilinear map, matrix, basis -/ +@[expose] public section + open Finset LinearMap Matrix Module open scoped RightActions diff --git a/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean b/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean index a186e2419e4e0b..3db8be7db7781d 100644 --- a/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean +++ b/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Wen Yang -/ -import Mathlib.LinearAlgebra.Matrix.Adjugate -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.Matrix.Transvection -import Mathlib.RingTheory.RootsOfUnity.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Adjugate +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.Matrix.Transvection +public import Mathlib.RingTheory.RootsOfUnity.Basic /-! # The Special Linear group $SL(n, R)$ @@ -48,6 +50,8 @@ of a regular `↑` coercion. matrix group, group, matrix inverse -/ +@[expose] public section + namespace Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/StdBasis.lean b/Mathlib/LinearAlgebra/Matrix/StdBasis.lean index 7660577aa8bf1d..d895628248b30f 100644 --- a/Mathlib/LinearAlgebra/Matrix/StdBasis.lean +++ b/Mathlib/LinearAlgebra/Matrix/StdBasis.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.Data.Matrix.Basis -import Mathlib.LinearAlgebra.StdBasis +module + +public import Mathlib.Data.Matrix.Basis +public import Mathlib.LinearAlgebra.StdBasis /-! # Standard basis on matrices @@ -14,6 +16,8 @@ import Mathlib.LinearAlgebra.StdBasis * `Basis.matrix`: extend a basis on `M` to the standard basis on `Matrix n m M` -/ +@[expose] public section + open Module namespace Module.Basis diff --git a/Mathlib/LinearAlgebra/Matrix/Swap.lean b/Mathlib/LinearAlgebra/Matrix/Swap.lean index 34550b777f4eea..fe0e54daae8257 100644 --- a/Mathlib/LinearAlgebra/Matrix/Swap.lean +++ b/Mathlib/LinearAlgebra/Matrix/Swap.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs -import Mathlib.LinearAlgebra.Matrix.Permutation -import Mathlib.Data.Matrix.PEquiv +module + +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.LinearAlgebra.Matrix.Permutation +public import Mathlib.Data.Matrix.PEquiv /-! # Swap matrices @@ -22,6 +24,8 @@ Swap matrices are a special case of *elementary matrices*. For transvections see This is a thin wrapper around `(Equiv.swap i j).permMatrix`. -/ +@[expose] public section + namespace Matrix section Def diff --git a/Mathlib/LinearAlgebra/Matrix/Symmetric.lean b/Mathlib/LinearAlgebra/Matrix/Symmetric.lean index 4f02270ea0e97b..03feafc0d62536 100644 --- a/Mathlib/LinearAlgebra/Matrix/Symmetric.lean +++ b/Mathlib/LinearAlgebra/Matrix/Symmetric.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Lu-Ming Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lu-Ming Zhang -/ -import Mathlib.Data.Matrix.Basic -import Mathlib.Data.Matrix.Block +module + +public import Mathlib.Data.Matrix.Basic +public import Mathlib.Data.Matrix.Block /-! # Symmetric matrices @@ -20,6 +22,8 @@ This file contains the definition and basic results about symmetric matrices. symm, symmetric, matrix -/ +@[expose] public section + variable {α β n m R : Type*} diff --git a/Mathlib/LinearAlgebra/Matrix/ToLin.lean b/Mathlib/LinearAlgebra/Matrix/ToLin.lean index 95e0b5a4aba66a..f67d44d414c95e 100644 --- a/Mathlib/LinearAlgebra/Matrix/ToLin.lean +++ b/Mathlib/LinearAlgebra/Matrix/ToLin.lean @@ -3,17 +3,19 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Data.Finite.Sum -import Mathlib.Data.Matrix.Block -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Basis.Fin -import Mathlib.LinearAlgebra.Basis.Prod -import Mathlib.LinearAlgebra.Basis.SMul -import Mathlib.LinearAlgebra.Matrix.Notation -import Mathlib.LinearAlgebra.Matrix.StdBasis -import Mathlib.RingTheory.AlgebraTower -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Data.Finite.Sum +public import Mathlib.Data.Matrix.Block +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Basis.Fin +public import Mathlib.LinearAlgebra.Basis.Prod +public import Mathlib.LinearAlgebra.Basis.SMul +public import Mathlib.LinearAlgebra.Matrix.Notation +public import Mathlib.LinearAlgebra.Matrix.StdBasis +public import Mathlib.RingTheory.AlgebraTower +public import Mathlib.RingTheory.Ideal.Span /-! # Linear maps and matrices @@ -66,6 +68,8 @@ and (presumably) adding `_left` where necessary. linear_map, matrix, linear_equiv, diagonal, det, trace -/ +@[expose] public section + noncomputable section open LinearMap Matrix Module Set Submodule @@ -663,6 +667,10 @@ theorem LinearMap.toMatrix_mulVec_repr (f : M₁ →ₗ[R] M₂) (x : M₁) : congr exact v₁.equivFun.symm_apply_apply x +theorem Matrix.repr_toLin (M : Matrix m n R) (x : M₁) : + v₂.repr (M.toLin v₁ v₂ x) = M.mulVec (v₁.repr x) := by + rw [← toMatrix_mulVec_repr v₁, toMatrix_toLin] + @[simp] theorem LinearMap.toMatrix_basis_equiv [Fintype l] [DecidableEq l] (b : Basis l R M₁) (b' : Basis l R M₂) : @@ -691,7 +699,7 @@ variable (v₁ : Basis n R M₁) (v₂ : Basis m R M₂) /-- The matrix of `toSpanSingleton R M₂ x` given by bases `v₁` and `v₂` is equal to `vecMulVec (v₂.repr x) v₁`. When `v₁ = Module.Basis.singleton` -then this is the column matrix of `v₂.repr x`.` -/ +then this is the column matrix of `v₂.repr x`. -/ theorem LinearMap.toMatrix_toSpanSingleton (v₁ : Basis n R R) (v₂ : Basis m R M₂) (x : M₂) : (toSpanSingleton R M₂ x).toMatrix v₁ v₂ = vecMulVec (v₂.repr x) v₁ := by ext; simp [toMatrix_apply, vecMulVec_apply, mul_comm] diff --git a/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean b/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean index c659a2955d4582..9df203db3521b7 100644 --- a/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean +++ b/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs -import Mathlib.LinearAlgebra.Matrix.Nondegenerate -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Integer +module + +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.LinearAlgebra.Matrix.Nondegenerate +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Integer /-! # Matrices and linear equivalences @@ -30,6 +32,8 @@ matrix, linear_equiv, determinant, inverse -/ +@[expose] public section + open Module variable {n : Type*} [Fintype n] diff --git a/Mathlib/LinearAlgebra/Matrix/Trace.lean b/Mathlib/LinearAlgebra/Matrix/Trace.lean index a8da227bfee62a..1c0e889f57a10b 100644 --- a/Mathlib/LinearAlgebra/Matrix/Trace.lean +++ b/Mathlib/LinearAlgebra/Matrix/Trace.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen -/ -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.Notation -import Mathlib.LinearAlgebra.Matrix.RowCol +module + +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.Notation +public import Mathlib.LinearAlgebra.Matrix.RowCol /-! # Trace of a matrix @@ -22,6 +24,8 @@ matrix, trace, diagonal -/ +@[expose] public section + open Matrix diff --git a/Mathlib/LinearAlgebra/Matrix/Transvection.lean b/Mathlib/LinearAlgebra/Matrix/Transvection.lean index 88545b5ec60349..cb725f458c43ea 100644 --- a/Mathlib/LinearAlgebra/Matrix/Transvection.lean +++ b/Mathlib/LinearAlgebra/Matrix/Transvection.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.DMatrix -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.Reindex -import Mathlib.Tactic.Field +module + +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.DMatrix +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.Reindex +public import Mathlib.Tactic.Field /-! # Transvections @@ -58,6 +60,8 @@ block matrices. To proceed with the induction, we reindex our matrices to reduce to the above situation. -/ +@[expose] public section + universe u₁ u₂ @@ -304,7 +308,7 @@ end TransvectionStruct end Transvection /-! -# Reducing matrices by left and right multiplication by transvections +### Reducing matrices by left and right multiplication by transvections In this section, we show that any matrix can be reduced to diagonal form by left and right multiplication by transvections (or, equivalently, by elementary operations on lines and columns). diff --git a/Mathlib/LinearAlgebra/Matrix/Unique.lean b/Mathlib/LinearAlgebra/Matrix/Unique.lean index 58d1117c59ebc9..c97c4a836af9d0 100644 --- a/Mathlib/LinearAlgebra/Matrix/Unique.lean +++ b/Mathlib/LinearAlgebra/Matrix/Unique.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yunzhou Xie. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yunzhou Xie -/ -import Mathlib.Data.Matrix.Basic +module + +public import Mathlib.Data.Matrix.Basic /-! # One by one matrices @@ -19,6 +21,8 @@ canonical map that sends a one by one matrix `!![a]` to `a`. Matrix, Unique, AlgEquiv -/ +@[expose] public section + namespace Matrix variable {m n A R : Type*} [Unique m] [Unique n] diff --git a/Mathlib/LinearAlgebra/Matrix/Vec.lean b/Mathlib/LinearAlgebra/Matrix/Vec.lean index ae6aad2b7e7357..0b39aa261281ab 100644 --- a/Mathlib/LinearAlgebra/Matrix/Vec.lean +++ b/Mathlib/LinearAlgebra/Matrix/Vec.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Matrix.Hadamard -import Mathlib.LinearAlgebra.Matrix.Kronecker -import Mathlib.LinearAlgebra.Matrix.Trace +module + +public import Mathlib.LinearAlgebra.Matrix.Hadamard +public import Mathlib.LinearAlgebra.Matrix.Kronecker +public import Mathlib.LinearAlgebra.Matrix.Trace /-! # Vectorization of matrices @@ -28,6 +30,8 @@ If you want this function, you can write `Matrix.vec Aᵀ` instead. * [Wikipedia](https://en.wikipedia.org/wiki/Vectorization_(mathematics)) -/ + +@[expose] public section namespace Matrix variable {ι l m n p R S} diff --git a/Mathlib/LinearAlgebra/Matrix/ZPow.lean b/Mathlib/LinearAlgebra/Matrix/ZPow.lean index 551adba5b30441..ee8847ee187806 100644 --- a/Mathlib/LinearAlgebra/Matrix/ZPow.lean +++ b/Mathlib/LinearAlgebra/Matrix/ZPow.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.LinearAlgebra.Matrix.Symmetric +module + +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +public import Mathlib.LinearAlgebra.Matrix.Symmetric /-! # Integer powers of square matrices @@ -23,6 +25,8 @@ The lemma names are taken from `Algebra.GroupWithZero.Power`. matrix inverse, matrix powers -/ +@[expose] public section + open Matrix diff --git a/Mathlib/LinearAlgebra/Multilinear/Basic.lean b/Mathlib/LinearAlgebra/Multilinear/Basic.lean index a649dc0c442c7e..4a50be292cc419 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Basic.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Powerset -import Mathlib.Algebra.NoZeroSMulDivisors.Pi -import Mathlib.Data.Finset.Sort -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Fintype.Powerset -import Mathlib.LinearAlgebra.Pi -import Mathlib.Logic.Equiv.Fintype -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Powerset +public import Mathlib.Algebra.NoZeroSMulDivisors.Pi +public import Mathlib.Data.Finset.Sort +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.Logic.Equiv.Fintype +public import Mathlib.Tactic.Abel /-! # Multilinear maps @@ -67,6 +69,8 @@ which is much easier to clean up since `_inst` is a free variable and so the equality can just be substituted. -/ +@[expose] public section + open Fin Function Finset Set universe uR uS uι v v' v₁ v₁' v₁'' v₂ v₃ v₄ @@ -209,7 +213,7 @@ theorem coe_smul (c : S) (f : MultilinearMap R M₁ M₂) : ⇑(c • f) = c • end SMul -instance addCommMonoid : AddCommMonoid (MultilinearMap R M₁ M₂) := +instance addCommMonoid : AddCommMonoid (MultilinearMap R M₁ M₂) := fast_instance% coe_injective.addCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl /-- Coercion of a multilinear map to a function as an additive monoid homomorphism. -/ @@ -701,18 +705,7 @@ lemma domDomRestrict_aux {ι} [DecidableEq ι] (P : ι → Prop) [DecidablePred [DecidableEq {a // P a}] (x : (i : {a // P a}) → M₁ i) (z : (i : {a // ¬ P a}) → M₁ i) (i : {a : ι // P a}) (c : M₁ i) : (fun j ↦ if h : P j then Function.update x i c ⟨j, h⟩ else z ⟨j, h⟩) = - Function.update (fun j => if h : P j then x ⟨j, h⟩ else z ⟨j, h⟩) i c := by - ext j - by_cases h : j = i - #adaptation_note /-- 2025-10-31 https://github.com/leanprover/lean4/issues/11036 - Used to be `<;> grind [Function.update_self, Function.update_of_ne]` -/ - · subst h - simp [i.2] - · split <;> rename_i h' - · simp only [Function.update_of_ne h, h', ↓reduceDIte] - apply Function.update_of_ne - simpa [← Subtype.coe_inj] - · simp [Function.update_of_ne h, h'] + Function.update (fun j => if h : P j then x ⟨j, h⟩ else z ⟨j, h⟩) i c := by grind lemma domDomRestrict_aux_right {ι} [DecidableEq ι] (P : ι → Prop) [DecidablePred P] {M₁ : ι → Type*} [DecidableEq {a // ¬ P a}] @@ -867,7 +860,7 @@ variable [Semiring R] [(i : ι) → AddCommMonoid (M₁ i)] [(i : ι) → Module [AddCommMonoid M₂] [Module R M₂] instance [Monoid S] [DistribMulAction S M₂] [Module R M₂] [SMulCommClass R S M₂] : - DistribMulAction S (MultilinearMap R M₁ M₂) := + DistribMulAction S (MultilinearMap R M₁ M₂) := fast_instance% coe_injective.distribMulAction coeAddMonoidHom fun _ _ ↦ rfl section Module @@ -876,7 +869,7 @@ variable [Semiring S] [Module S M₂] [SMulCommClass R S M₂] /-- The space of multilinear maps over an algebra over `R` is a module over `R`, for the pointwise addition and scalar multiplication. -/ -instance : Module S (MultilinearMap R M₁ M₂) := +instance : Module S (MultilinearMap R M₁ M₂) := fast_instance% coe_injective.module _ coeAddMonoidHom fun _ _ ↦ rfl instance [NoZeroSMulDivisors S M₂] : NoZeroSMulDivisors S (MultilinearMap R M₁ M₂) := @@ -1285,17 +1278,9 @@ instance : Sub (MultilinearMap R M₁ M₂) := theorem sub_apply (m : ∀ i, M₁ i) : (f - g) m = f m - g m := rfl -instance : AddCommGroup (MultilinearMap R M₁ M₂) := - { MultilinearMap.addCommMonoid with - neg_add_cancel := fun _ => MultilinearMap.ext fun _ => neg_add_cancel _ - sub_eq_add_neg := fun _ _ => MultilinearMap.ext fun _ => sub_eq_add_neg _ _ - zsmul := fun n f => - { toFun := fun m => n • f m - map_update_add' := fun m i x y => by simp [smul_add] - map_update_smul' := fun l i x d => by simp [← smul_comm x n (_ : M₂)] } - zsmul_zero' := fun _ => MultilinearMap.ext fun _ => SubNegMonoid.zsmul_zero' _ - zsmul_succ' := fun _ _ => MultilinearMap.ext fun _ => SubNegMonoid.zsmul_succ' _ _ - zsmul_neg' := fun _ _ => MultilinearMap.ext fun _ => SubNegMonoid.zsmul_neg' _ _ } +instance : AddCommGroup (MultilinearMap R M₁ M₂) := fast_instance% + coe_injective.addCommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) + (fun _ _ => rfl) (fun _ _ => rfl) end RangeAddCommGroup diff --git a/Mathlib/LinearAlgebra/Multilinear/Basis.lean b/Mathlib/LinearAlgebra/Multilinear/Basis.lean index 3f92d3c40c7ffe..c688546c1b7d17 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Basis.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Basis.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.Multilinear.Basic +module + +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.Multilinear.Basic /-! # Multilinear maps in relation to bases. @@ -13,6 +15,8 @@ This file proves lemmas about the action of multilinear maps on basis vectors. -/ +@[expose] public section + open MultilinearMap diff --git a/Mathlib/LinearAlgebra/Multilinear/Curry.lean b/Mathlib/LinearAlgebra/Multilinear/Curry.lean index 926e14400ef175..19c6e4e02296aa 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Curry.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Curry.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Fintype.Sort -import Mathlib.LinearAlgebra.Multilinear.Basic +module + +public import Mathlib.Data.Fintype.Sort +public import Mathlib.LinearAlgebra.Multilinear.Basic /-! # Currying of multilinear maps @@ -20,6 +22,8 @@ in linear functions), called respectively `multilinearCurryLeftEquiv` and -/ +@[expose] public section + open Fin Function Finset Set universe uR uS uι uι' v v' v₁ v₂ v₃ diff --git a/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean b/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean index 25119fe0604f8c..9b87624233ebd3 100644 --- a/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean +++ b/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Sophie Morel -/ -import Mathlib.Data.Fintype.Quotient -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Multilinear.Basic +module + +public import Mathlib.Data.Fintype.Quotient +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Multilinear.Basic /-! # Interactions between finitely-supported functions and multilinear maps @@ -27,6 +29,8 @@ import Mathlib.LinearAlgebra.Multilinear.Basic -/ +@[expose] public section + universe uι uκ uS uR uM uN variable {ι : Type uι} {κ : ι → Type uκ} variable {S : Type uS} {R : Type uR} diff --git a/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean b/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean index e545c8380603b4..6dbe6eda6509b5 100644 --- a/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean +++ b/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.Multilinear.Curry -import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix +module + +public import Mathlib.LinearAlgebra.Multilinear.Curry +public import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix /-! # Multilinear maps over finite-dimensional spaces @@ -18,6 +20,8 @@ We do not put this in `LinearAlgebra.Multilinear.Basic` to avoid making the impo there. -/ +@[expose] public section + namespace MultilinearMap diff --git a/Mathlib/LinearAlgebra/Multilinear/Pi.lean b/Mathlib/LinearAlgebra/Multilinear/Pi.lean index b2c040998701b6..39ad00fea87f12 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Pi.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Pi -import Mathlib.LinearAlgebra.Multilinear.Basic +module + +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.LinearAlgebra.Multilinear.Basic /-! # Interactions between (dependent) functions and multilinear maps @@ -20,6 +22,8 @@ import Mathlib.LinearAlgebra.Multilinear.Basic - `MultilinearMap.piFamilyₗ` is a `LinearMap`, linear in the family of multilinear maps `f`. -/ +@[expose] public section + universe uι uκ uS uR uM uN variable {ι : Type uι} {κ : ι → Type uκ} variable {S : Type uS} {R : Type uR} diff --git a/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean b/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean index 399990ddff908e..b3a27986f13106 100644 --- a/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorProduct.Basic -import Mathlib.LinearAlgebra.Multilinear.Basic +module + +public import Mathlib.LinearAlgebra.TensorProduct.Basic +public import Mathlib.LinearAlgebra.Multilinear.Basic /-! # Constructions relating multilinear maps and tensor products. -/ +@[expose] public section + namespace MultilinearMap section DomCoprod diff --git a/Mathlib/LinearAlgebra/Orientation.lean b/Mathlib/LinearAlgebra/Orientation.lean index e3e07da31edd83..e4cad6ec900673 100644 --- a/Mathlib/LinearAlgebra/Orientation.lean +++ b/Mathlib/LinearAlgebra/Orientation.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.LinearAlgebra.Ray -import Mathlib.LinearAlgebra.Determinant +module + +public import Mathlib.LinearAlgebra.Ray +public import Mathlib.LinearAlgebra.Determinant /-! # Orientations of modules @@ -31,6 +33,8 @@ that index type is a `Fintype` and there exists a basis of the same cardinality. -/ +@[expose] public section + noncomputable section open Module diff --git a/Mathlib/LinearAlgebra/PID.lean b/Mathlib/LinearAlgebra/PID.lean index 8f8267fc16bf7e..db94b7c9d2066e 100644 --- a/Mathlib/LinearAlgebra/PID.lean +++ b/Mathlib/LinearAlgebra/PID.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.Trace -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +module + +public import Mathlib.LinearAlgebra.Trace +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic /-! # Linear maps of modules with coefficients in a principal ideal domain @@ -21,6 +23,8 @@ algebra import hierarchy have to depend on the theory of PIDs. -/ +@[expose] public section + namespace LinearMap variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/PerfectPairing/Basic.lean b/Mathlib/LinearAlgebra/PerfectPairing/Basic.lean index 508a6a94b33fc6..75111352e283fc 100644 --- a/Mathlib/LinearAlgebra/PerfectPairing/Basic.lean +++ b/Mathlib/LinearAlgebra/PerfectPairing/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Yaël Dillies -/ -import Mathlib.LinearAlgebra.Dual.Lemmas +module + +public import Mathlib.LinearAlgebra.Dual.Lemmas /-! # Perfect pairings @@ -20,6 +22,8 @@ In this file we provide a definition `IsPerfPair` corresponding to 1 above, toge to connect 1 and 2. -/ +@[expose] public section + open Function Module namespace LinearMap diff --git a/Mathlib/LinearAlgebra/PerfectPairing/Matrix.lean b/Mathlib/LinearAlgebra/PerfectPairing/Matrix.lean index 34e9575d974819..75b7ce935b3f21 100644 --- a/Mathlib/LinearAlgebra/PerfectPairing/Matrix.lean +++ b/Mathlib/LinearAlgebra/PerfectPairing/Matrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.PerfectPairing.Basic -import Mathlib.LinearAlgebra.Matrix.Dual -import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv +module + +public import Mathlib.LinearAlgebra.PerfectPairing.Basic +public import Mathlib.LinearAlgebra.Matrix.Dual +public import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv /-! # Perfect pairings and matrices @@ -17,6 +19,8 @@ The file contains results connecting perfect pairings and matrices. -/ +@[expose] public section + namespace Matrix variable {R n : Type*} [CommRing R] [Fintype n] [DecidableEq n] diff --git a/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean b/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean index 1f33fbf56cbb30..f0f1cc50b60914 100644 --- a/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean +++ b/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.PerfectPairing.Basic -import Mathlib.LinearAlgebra.Matrix.Basis -import Mathlib.LinearAlgebra.Matrix.BaseChange +module + +public import Mathlib.LinearAlgebra.PerfectPairing.Basic +public import Mathlib.LinearAlgebra.Matrix.Basis +public import Mathlib.LinearAlgebra.Matrix.BaseChange /-! # Restriction to submodules and restriction of scalars for perfect pairings. @@ -21,6 +23,8 @@ We provide API for restricting perfect pairings to submodules and for restrictin -/ +@[expose] public section + open Function Module Set open Submodule (span subset_span) @@ -242,7 +246,7 @@ private lemma restrictScalars_field_aux obtain ⟨n, -, b', -⟩ := p.exists_basis_basis_of_span_eq_top_of_mem_algebraMap _ _ hM hN <| by rintro - ⟨m, rfl⟩ - ⟨n, rfl⟩ exact hp m n - have : FiniteDimensional K (LinearMap.range i) := FiniteDimensional.of_fintype_basis b' + have : FiniteDimensional K (LinearMap.range i) := b'.finiteDimensional_of_finite exact Finite.equiv (LinearEquiv.ofInjective i hi).symm include hi hj in diff --git a/Mathlib/LinearAlgebra/Pi.lean b/Mathlib/LinearAlgebra/Pi.lean index 2e0de700828d34..7dfce7cb107d6d 100644 --- a/Mathlib/LinearAlgebra/Pi.lean +++ b/Mathlib/LinearAlgebra/Pi.lean @@ -3,16 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Eric Wieser -/ -import Mathlib.Algebra.Group.Fin.Tuple -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Module.Prod -import Mathlib.Algebra.Module.Submodule.Ker -import Mathlib.Algebra.Module.Submodule.Range -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.LinearAlgebra.Prod -import Mathlib.Data.Fintype.Option +module + +public import Mathlib.Algebra.Group.Fin.Tuple +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Module.Prod +public import Mathlib.Algebra.Module.Submodule.Ker +public import Mathlib.Algebra.Module.Submodule.Range +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.Data.Fintype.Option /-! # Pi types of modules @@ -32,6 +34,8 @@ It contains theorems relating these to each other, as well as to `LinearMap.ker` -/ +@[expose] public section + universe u v w x y z u' v' w' x' y' diff --git a/Mathlib/LinearAlgebra/PiTensorProduct.lean b/Mathlib/LinearAlgebra/PiTensorProduct.lean index 41b582e64fcdd8..bca85672c3ba60 100644 --- a/Mathlib/LinearAlgebra/PiTensorProduct.lean +++ b/Mathlib/LinearAlgebra/PiTensorProduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Frédéric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Frédéric Dupuis, Eric Wieser -/ -import Mathlib.LinearAlgebra.Multilinear.TensorProduct -import Mathlib.Tactic.AdaptationNote -import Mathlib.LinearAlgebra.Multilinear.Curry +module + +public import Mathlib.LinearAlgebra.Multilinear.TensorProduct +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.LinearAlgebra.Multilinear.Curry /-! # Tensor product of an indexed family of modules over commutative semirings @@ -60,6 +62,8 @@ binary tensor product in `LinearAlgebra/TensorProduct.lean`. multilinear, tensor, tensor product -/ +@[expose] public section + open Function section Semiring diff --git a/Mathlib/LinearAlgebra/Prod.lean b/Mathlib/LinearAlgebra/Prod.lean index 883631950b8000..191fa5e562e326 100644 --- a/Mathlib/LinearAlgebra/Prod.lean +++ b/Mathlib/LinearAlgebra/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Eric Wieser -/ -import Mathlib.Algebra.Algebra.Prod -import Mathlib.Algebra.Group.Graph -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.Algebra.Algebra.Prod +public import Mathlib.Algebra.Group.Graph +public import Mathlib.LinearAlgebra.Span.Basic /-! ### Products of modules @@ -34,6 +36,8 @@ It contains theorems relating these to each other, as well as to `Submodule.prod - `LinearEquiv.uniqueProd` -/ +@[expose] public section + universe u v w x y z u' v' w' y' diff --git a/Mathlib/LinearAlgebra/Projection.lean b/Mathlib/LinearAlgebra/Projection.lean index 32e6c0e5d3611a..6ae4d4213c93b2 100644 --- a/Mathlib/LinearAlgebra/Projection.lean +++ b/Mathlib/LinearAlgebra/Projection.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.LinearAlgebra.Prod -import Mathlib.Algebra.Module.Submodule.Invariant -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.Algebra.Ring.Idempotent +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.Algebra.Module.Submodule.Invariant +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.Algebra.Ring.Idempotent /-! # Projection to a subspace @@ -26,6 +28,8 @@ We also provide some lemmas justifying correctness of our definitions. projection, complement subspace -/ +@[expose] public section + noncomputable section Ring variable {R : Type*} [Ring R] {E : Type*} [AddCommGroup E] [Module R E] diff --git a/Mathlib/LinearAlgebra/Projectivization/Action.lean b/Mathlib/LinearAlgebra/Projectivization/Action.lean index 8d3c3ae2cfff91..7016555654110c 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Action.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Action.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.LinearAlgebra.Projectivization.Basic -import Mathlib.GroupTheory.GroupAction.Ring +module + +public import Mathlib.LinearAlgebra.Projectivization.Basic +public import Mathlib.GroupTheory.GroupAction.Ring /-! # Group actions on projectivization @@ -12,6 +14,8 @@ import Mathlib.GroupTheory.GroupAction.Ring Show that (among other groups), the general linear group of `V` acts on `ℙ K V`. -/ +@[expose] public section + open scoped LinearAlgebra.Projectivization Matrix namespace Projectivization diff --git a/Mathlib/LinearAlgebra/Projectivization/Basic.lean b/Mathlib/LinearAlgebra/Projectivization/Basic.lean index de4c7bfc2bd58e..16260d92c866e4 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Basic.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition -import Mathlib.LinearAlgebra.FiniteDimensional.Basic +module + +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +public import Mathlib.LinearAlgebra.FiniteDimensional.Basic /-! @@ -32,6 +34,8 @@ We have three ways to construct terms of `ℙ K V`: -/ +@[expose] public section + variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] /-- The setoid whose quotient is the projectivization of `V`. -/ diff --git a/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean b/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean index 12c41c0c244ea8..44bc7c35b0c65d 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.Data.Finite.Sum -import Mathlib.Data.Fintype.Units -import Mathlib.GroupTheory.GroupAction.Quotient -import Mathlib.LinearAlgebra.Projectivization.Basic +module + +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.Data.Finite.Sum +public import Mathlib.Data.Fintype.Units +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.LinearAlgebra.Projectivization.Basic /-! # Cardinality of projective spaces @@ -16,6 +18,8 @@ We compute the cardinality of `ℙ k V` if `k` is a finite field. -/ +@[expose] public section + namespace Projectivization open scoped LinearAlgebra.Projectivization diff --git a/Mathlib/LinearAlgebra/Projectivization/Constructions.lean b/Mathlib/LinearAlgebra/Projectivization/Constructions.lean index 80dd140e35d527..04305fad079619 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Constructions.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Constructions.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.LinearAlgebra.CrossProduct -import Mathlib.LinearAlgebra.Matrix.DotProduct -import Mathlib.LinearAlgebra.Projectivization.Basic +module + +public import Mathlib.LinearAlgebra.CrossProduct +public import Mathlib.LinearAlgebra.Matrix.DotProduct +public import Mathlib.LinearAlgebra.Projectivization.Basic /-! @@ -21,6 +23,8 @@ This file defines the dot product and cross product on projective spaces. -/ +@[expose] public section + variable {F : Type*} [Field F] {m : Type*} [Fintype m] namespace Projectivization diff --git a/Mathlib/LinearAlgebra/Projectivization/Independence.lean b/Mathlib/LinearAlgebra/Projectivization/Independence.lean index e8c91a376e7487..4384282ae8246a 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Independence.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Independence.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Michael Blyth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Blyth -/ -import Mathlib.LinearAlgebra.Projectivization.Basic +module + +public import Mathlib.LinearAlgebra.Projectivization.Basic /-! # Independence in Projective Space @@ -21,13 +23,15 @@ ambient vector space. Similarly for the definition of dependence. - A family of elements is dependent if and only if it is not independent. - Two elements are dependent if and only if they are equal. -# Future Work +## Future Work - Define collinearity in projective space. - Prove the axioms of a projective geometry are satisfied by the dependence relation. - Define projective linear subspaces. -/ +@[expose] public section + open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} diff --git a/Mathlib/LinearAlgebra/Projectivization/Subspace.lean b/Mathlib/LinearAlgebra/Projectivization/Subspace.lean index 06327d1da1ca40..9d81073f914f36 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Subspace.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Subspace.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Michael Blyth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Blyth -/ -import Mathlib.LinearAlgebra.Projectivization.Basic +module + +public import Mathlib.LinearAlgebra.Projectivization.Basic /-! # Subspaces of Projective Space @@ -27,6 +29,8 @@ also in the subset. projective space and the submodules of the underlying vector space. -/ +@[expose] public section + variable (K V : Type*) [Field K] [AddCommGroup V] [Module K V] diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean b/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean index 9fe9acb9566c28..b6a3b96732ce9e 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kexing Ying, Eric Wieser -/ -import Mathlib.Data.Finset.Sym -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic -import Mathlib.LinearAlgebra.Matrix.SesquilinearForm -import Mathlib.LinearAlgebra.Matrix.Symmetric +module + +public import Mathlib.Data.Finset.Sym +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.LinearAlgebra.Matrix.SesquilinearForm +public import Mathlib.LinearAlgebra.Matrix.Symmetric /-! # Quadratic maps @@ -75,6 +77,8 @@ has some further discussion. quadratic map, homogeneous polynomial, quadratic polynomial -/ +@[expose] public section + universe u v w variable {S T : Type*} diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean b/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean index 4c737dac32dc8f..3344cb5b23f2f6 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.BigOperators.Sym -import Mathlib.Data.Finsupp.Pointwise -import Mathlib.Data.Sym.Sym2.Finsupp -import Mathlib.LinearAlgebra.QuadraticForm.Basic +module + +public import Mathlib.Algebra.BigOperators.Sym +public import Mathlib.Data.Finsupp.Pointwise +public import Mathlib.Data.Sym.Sym2.Finsupp +public import Mathlib.LinearAlgebra.QuadraticForm.Basic /-! # Constructing a bilinear map from a quadratic map, given a basis @@ -16,6 +18,8 @@ does not require `Invertible (2 : R)`. Unlike that definition, this only works i a basis. -/ +@[expose] public section + open LinearMap (BilinMap) open Module diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Complex.lean b/Mathlib/LinearAlgebra/QuadraticForm/Complex.lean index b6445e17d51463..ed21263051cc89 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Complex.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Complex.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kexing Ying, Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv -import Mathlib.Analysis.SpecialFunctions.Pow.Complex +module + +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +public import Mathlib.Analysis.SpecialFunctions.Pow.Complex /-! # Quadratic forms over the complex numbers @@ -14,6 +16,8 @@ a sum of squares. -/ +@[expose] public section + namespace QuadraticForm diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean b/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean index 9c6c691ab17c1e..99f8a47cbc1fb2 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv -import Mathlib.LinearAlgebra.QuadraticForm.Prod +module + +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +public import Mathlib.LinearAlgebra.QuadraticForm.Prod /-! # Quadratic form structures related to `Module.Dual` @@ -21,6 +23,8 @@ import Mathlib.LinearAlgebra.QuadraticForm.Prod -/ +@[expose] public section + variable (R M N : Type*) diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Isometry.lean b/Mathlib/LinearAlgebra/QuadraticForm/Isometry.lean index e09af538b55e13..d7067dda934992 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Isometry.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Isometry.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.Basic +module + +public import Mathlib.LinearAlgebra.QuadraticForm.Basic /-! # Isometric linear maps @@ -17,6 +19,8 @@ import Mathlib.LinearAlgebra.QuadraticForm.Basic `Q₁ →qᵢ Q₂` is notation for `Q₁.Isometry Q₂`. -/ +@[expose] public section + variable {R M M₁ M₂ M₃ M₄ N : Type*} namespace QuadraticMap diff --git a/Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean b/Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean index e22f2789691ba4..f1f733175363ad 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.Basic -import Mathlib.LinearAlgebra.QuadraticForm.Isometry +module + +public import Mathlib.LinearAlgebra.QuadraticForm.Basic +public import Mathlib.LinearAlgebra.QuadraticForm.Isometry /-! # Isometric equivalences with respect to quadratic forms @@ -20,6 +22,8 @@ import Mathlib.LinearAlgebra.QuadraticForm.Isometry parametrization of `QuadraticForm.weightedSumSquares`. -/ +@[expose] public section + open Module QuadraticMap variable {ι R K M M₁ M₂ M₃ V N : Type*} diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Prod.lean b/Mathlib/LinearAlgebra/QuadraticForm/Prod.lean index ee4e75cf437631..6367b68e3220c3 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Prod.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Prod.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +module + +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv /-! # Quadratic form on product and pi types @@ -29,6 +31,8 @@ forms specifically. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean b/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean index 6672bf9c5e1106..b846483cb03b54 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv -import Mathlib.Algebra.Category.ModuleCat.Basic +module + +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +public import Mathlib.Algebra.Category.ModuleCat.Basic /-! # The category of quadratic modules -/ +@[expose] public section + open CategoryTheory universe v u diff --git a/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Monoidal.lean b/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Monoidal.lean index 991c327e18d964..bcc94d349e9496 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Monoidal.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Monoidal.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.CategoryTheory.Monoidal.Transport -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic -import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat -import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct.Isometries +module + +public import Mathlib.CategoryTheory.Monoidal.Transport +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +public import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat +public import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct.Isometries /-! # The monoidal category structure on quadratic R-modules @@ -24,6 +26,8 @@ For now, we simplify by insisting both universe levels are the same. This file essentially mirrors `Mathlib/Algebra/Category/AlgCat/Monoidal.lean`. -/ +@[expose] public section + open CategoryTheory open scoped MonoidalCategory diff --git a/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Symmetric.lean b/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Symmetric.lean index a55ab2c2fb76f7..e3cec69d6a773f 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Symmetric.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/QuadraticModuleCat/Symmetric.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Monoidal -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +module + +public import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Monoidal +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric /-! # The monoidal structure on `QuadraticModuleCat` is symmetric. @@ -18,6 +20,8 @@ In this file we show: This file essentially mirrors `Mathlib/Algebra/Category/AlgCat/Symmetric.lean`. -/ +@[expose] public section + open CategoryTheory universe v u diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Real.lean b/Mathlib/LinearAlgebra/QuadraticForm/Real.lean index b0b4653d75f254..9cc35276c8a4d7 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Real.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Real.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kexing Ying, Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv -import Mathlib.Data.Sign.Basic -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Analysis.RCLike.Basic +module + +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +public import Mathlib.Data.Sign.Basic +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Analysis.RCLike.Basic /-! # Real quadratic forms @@ -20,6 +22,8 @@ as in `QuadraticForm.equivalent_one_zero_neg_one_weighted_sum_squared`. -/ +@[expose] public section + open Finset Module QuadraticMap SignType namespace QuadraticForm diff --git a/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean b/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean index 8a7efed077f70b..185f56fc37425a 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.BilinearForm.TensorProduct -import Mathlib.LinearAlgebra.QuadraticForm.Basic +module + +public import Mathlib.LinearAlgebra.BilinearForm.TensorProduct +public import Mathlib.LinearAlgebra.QuadraticForm.Basic /-! # The quadratic form on a tensor product @@ -16,6 +18,8 @@ import Mathlib.LinearAlgebra.QuadraticForm.Basic -/ +@[expose] public section + universe uR uA uM₁ uM₂ uN₁ uN₂ variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {M₂ : Type uM₂} {N₁ : Type uN₁} {N₂ : Type uN₂} diff --git a/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean b/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean index c85c6f8d7c8991..b3eb668ecf3a4d 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct -import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv +module + +public import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct +public import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv /-! # Linear equivalences of tensor products as isometries @@ -20,6 +22,8 @@ These results are separate from the definition of `QuadraticForm.tmul` as that f * `QuadraticForm.tensorLId`: `TensorProduct.lid` as a `QuadraticForm.IsometryEquiv` -/ +@[expose] public section + universe uR uM₁ uM₂ uM₃ uM₄ variable {R : Type uR} {M₁ : Type uM₁} {M₂ : Type uM₂} {M₃ : Type uM₃} {M₄ : Type uM₄} diff --git a/Mathlib/LinearAlgebra/Quotient/Basic.lean b/Mathlib/LinearAlgebra/Quotient/Basic.lean index 75f20754e3d2ff..7e769d2339b8d5 100644 --- a/Mathlib/LinearAlgebra/Quotient/Basic.lean +++ b/Mathlib/LinearAlgebra/Quotient/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.GroupTheory.QuotientGroup.Basic -import Mathlib.LinearAlgebra.Pi -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.LinearAlgebra.Span.Basic +module + +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.GroupTheory.QuotientGroup.Basic +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.LinearAlgebra.Span.Basic /-! # Quotients by submodules @@ -25,6 +27,8 @@ import Mathlib.LinearAlgebra.Span.Basic -/ +@[expose] public section + assert_not_exists Cardinal -- For most of this file we work over a noncommutative ring diff --git a/Mathlib/LinearAlgebra/Quotient/Card.lean b/Mathlib/LinearAlgebra/Quotient/Card.lean index fd180f2744a2a5..36bdff4ca84461 100644 --- a/Mathlib/LinearAlgebra/Quotient/Card.lean +++ b/Mathlib/LinearAlgebra/Quotient/Card.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.SetTheory.Cardinal.Finite -import Mathlib.GroupTheory.Coset.Basic +module + +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.GroupTheory.Coset.Basic /-! Results about the cardinality of a quotient module. -/ +@[expose] public section + namespace Submodule open LinearMap QuotientAddGroup diff --git a/Mathlib/LinearAlgebra/Quotient/Defs.lean b/Mathlib/LinearAlgebra/Quotient/Defs.lean index 5504eb001b97e5..96a6f95043bb5b 100644 --- a/Mathlib/LinearAlgebra/Quotient/Defs.lean +++ b/Mathlib/LinearAlgebra/Quotient/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov -/ -import Mathlib.Algebra.Module.Equiv.Defs -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.GroupTheory.QuotientGroup.Defs -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.Algebra.Module.Equiv.Defs +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.GroupTheory.QuotientGroup.Defs +public import Mathlib.Logic.Small.Basic /-! # Quotients by submodules @@ -23,6 +25,8 @@ import Mathlib.Logic.Small.Basic -/ +@[expose] public section + -- For most of this file we work over a noncommutative ring section Ring diff --git a/Mathlib/LinearAlgebra/Quotient/Pi.lean b/Mathlib/LinearAlgebra/Quotient/Pi.lean index 9780081941921e..76cf93358e2e22 100644 --- a/Mathlib/LinearAlgebra/Quotient/Pi.lean +++ b/Mathlib/LinearAlgebra/Quotient/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best -/ -import Mathlib.LinearAlgebra.Pi -import Mathlib.LinearAlgebra.Quotient.Basic +module + +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.LinearAlgebra.Quotient.Basic /-! # Submodule quotients and direct sums @@ -12,7 +14,7 @@ import Mathlib.LinearAlgebra.Quotient.Basic This file contains some results on the quotient of a module by a direct sum of submodules, and the direct sum of quotients of modules by submodules. -# Main definitions +## Main definitions * `Submodule.piQuotientLift`: create a map out of the direct sum of quotients * `Submodule.quotientPiLift`: create a map out of the quotient of a direct sum @@ -20,6 +22,8 @@ and the direct sum of quotients of modules by submodules. -/ +@[expose] public section + namespace Submodule diff --git a/Mathlib/LinearAlgebra/Ray.lean b/Mathlib/LinearAlgebra/Ray.lean index 2ac734554cf317..775520e9a56924 100644 --- a/Mathlib/LinearAlgebra/Ray.lean +++ b/Mathlib/LinearAlgebra/Ray.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.Order.Module.Algebra -import Mathlib.Algebra.Ring.Subring.Units -import Mathlib.LinearAlgebra.LinearIndependent.Defs -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.Module -import Mathlib.Tactic.Positivity.Basic +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Order.Module.Algebra +public import Mathlib.Algebra.Ring.Subring.Units +public import Mathlib.LinearAlgebra.LinearIndependent.Defs +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.Module +public import Mathlib.Tactic.Positivity.Basic /-! # Rays in modules @@ -25,6 +27,8 @@ This file defines rays in modules. common positive multiple. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/Reflection.lean b/Mathlib/LinearAlgebra/Reflection.lean index 1af8eb8221b494..b4198fc6726559 100644 --- a/Mathlib/LinearAlgebra/Reflection.lean +++ b/Mathlib/LinearAlgebra/Reflection.lean @@ -3,15 +3,17 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Deepro Choudhury, Mitchell Lee, Johan Commelin -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.Module.LinearMap.Basic -import Mathlib.Algebra.Module.Submodule.Invariant -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.LinearAlgebra.Dual.Defs -import Mathlib.LinearAlgebra.FiniteSpan -import Mathlib.RingTheory.Polynomial.Chebyshev +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.Module.LinearMap.Basic +public import Mathlib.Algebra.Module.Submodule.Invariant +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.LinearAlgebra.Dual.Defs +public import Mathlib.LinearAlgebra.FiniteSpan +public import Mathlib.RingTheory.Polynomial.Chebyshev /-! # Reflections in linear algebra @@ -48,6 +50,8 @@ should connect (or unify) these definitions with `Module.reflection` defined her -/ +@[expose] public section + open Function Set open Module hiding Finite open Submodule (span) diff --git a/Mathlib/LinearAlgebra/RootSystem/Base.lean b/Mathlib/LinearAlgebra/RootSystem/Base.lean index c80865db6001dc..695f93ae8edd96 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Base.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Base.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.Chain -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +module + +public import Mathlib.LinearAlgebra.RootSystem.Chain +public import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +public import Mathlib.LinearAlgebra.RootSystem.IsValuedIn /-! # Bases for root pairings / systems @@ -45,6 +47,8 @@ is too strong. -/ +@[expose] public section + noncomputable section open Function Set Submodule diff --git a/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean b/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean index 4a4c06b7444471..a784d8c813c9b8 100644 --- a/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean +++ b/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.LinearAlgebra.PerfectPairing.Restrict -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.LinearAlgebra.PerfectPairing.Restrict +public import Mathlib.LinearAlgebra.RootSystem.IsValuedIn /-! # Base change for root pairings @@ -26,6 +28,8 @@ extension of scalars. -/ +@[expose] public section + noncomputable section open Set Function diff --git a/Mathlib/LinearAlgebra/RootSystem/Basic.lean b/Mathlib/LinearAlgebra/RootSystem/Basic.lean index c47f5401985548..d54c00c5bd427a 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Basic.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Deepro Choudhury, Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.Defs -import Mathlib.LinearAlgebra.RootSystem.Finite.Nondegenerate +module + +public import Mathlib.LinearAlgebra.RootSystem.Defs +public import Mathlib.LinearAlgebra.RootSystem.Finite.Nondegenerate /-! # Root data and root systems @@ -26,6 +28,8 @@ This file contains basic results for root systems and root data. -/ +@[expose] public section + open Set Function open Module hiding reflection open Submodule (span) diff --git a/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean b/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean index 6801f658657ce0..29a8317cab89a3 100644 --- a/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean +++ b/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.CharZero.Infinite -import Mathlib.Algebra.Module.Submodule.Union -import Mathlib.LinearAlgebra.Matrix.BilinearForm -import Mathlib.LinearAlgebra.RootSystem.Base -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas -import Mathlib.LinearAlgebra.RootSystem.Finite.Nondegenerate +module + +public import Mathlib.Algebra.CharZero.Infinite +public import Mathlib.Algebra.Module.Submodule.Union +public import Mathlib.LinearAlgebra.Matrix.BilinearForm +public import Mathlib.LinearAlgebra.RootSystem.Base +public import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +public import Mathlib.LinearAlgebra.RootSystem.Finite.Nondegenerate /-! # Cartan matrices for root systems @@ -25,6 +27,8 @@ This file contains definitions and basic results about Cartan matrices of root p -/ +@[expose] public section + noncomputable section open FaithfulSMul (algebraMap_injective) diff --git a/Mathlib/LinearAlgebra/RootSystem/Chain.lean b/Mathlib/LinearAlgebra/RootSystem/Chain.lean index 319af7e5b8ddb0..89e5286cb7b185 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Chain.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Chain.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas -import Mathlib.Order.Interval.Set.OrdConnectedLinear +module + +public import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +public import Mathlib.Order.Interval.Set.OrdConnectedLinear /-! # Chains of roots @@ -25,6 +27,8 @@ length, `p + q` is at most 3. -/ +@[expose] public section + noncomputable section open FaithfulSMul Function Set Submodule diff --git a/Mathlib/LinearAlgebra/RootSystem/Defs.lean b/Mathlib/LinearAlgebra/RootSystem/Defs.lean index 9048773c34aa66..585411a1acaf29 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Defs.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Deepro Choudhury, Scott Carnahan -/ -import Mathlib.LinearAlgebra.PerfectPairing.Basic -import Mathlib.LinearAlgebra.Reflection +module + +public import Mathlib.LinearAlgebra.PerfectPairing.Basic +public import Mathlib.LinearAlgebra.Reflection /-! # Root data and root systems @@ -57,6 +59,8 @@ require that it is compatible with reflections and coreflections. -/ +@[expose] public section + open Set Function open Module hiding reflection open Submodule (span span_image) @@ -202,6 +206,8 @@ abbrev coroot' (i : ι) : Dual R M := P.toLinearMap.flip (P.coroot i) /-- This is the pairing between roots and coroots. -/ def pairing : R := P.root' i (P.coroot j) +@[simp] lemma pairing_flip : P.flip.pairing i j = P.pairing j i := rfl + @[simp] lemma root_coroot_eq_pairing : P.toLinearMap (P.root i) (P.coroot j) = P.pairing i j := rfl @@ -603,6 +609,10 @@ alias _root_.RootSystem.reflection_perm_eq_reflection_perm_iff := finite. It is `4 cos² θ`, where `θ` describes the dihedral angle between hyperplanes. -/ def coxeterWeight : R := pairing P i j * pairing P j i +@[simp] lemma coxeterWeight_flip : + P.flip.coxeterWeight i j = P.coxeterWeight i j := by + simp [coxeterWeight, mul_comm (P.pairing j i)] + lemma coxeterWeight_swap : coxeterWeight P i j = coxeterWeight P j i := by simp only [coxeterWeight, mul_comm] @@ -614,11 +624,10 @@ lemma isOrthogonal_symm : IsOrthogonal P i j ↔ IsOrthogonal P j i := by lemma isOrthogonal_comm (h : IsOrthogonal P i j) : Commute (P.reflection i) (P.reflection j) := by rw [commute_iff_eq] - ext v + ext replace h : P.pairing i j = 0 ∧ P.pairing j i = 0 := by simpa [IsOrthogonal] using h - erw [Module.End.mul_apply, Module.End.mul_apply] - simp only [LinearEquiv.coe_coe, reflection_apply, LinearMap.flip_apply, map_sub, map_smul, - root_coroot_eq_pairing, h, zero_smul, sub_zero] + simp only [LinearEquiv.mul_apply, reflection_apply, LinearMap.flip_apply, map_sub, + map_smul, root_coroot_eq_pairing, h, zero_smul, sub_zero] abel variable {P i j} diff --git a/Mathlib/LinearAlgebra/RootSystem/Finite/CanonicalBilinear.lean b/Mathlib/LinearAlgebra/RootSystem/Finite/CanonicalBilinear.lean index 1134d6b10aa64c..815a91416b6c8f 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Finite/CanonicalBilinear.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Finite/CanonicalBilinear.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Ring.SumsOfSquares -import Mathlib.LinearAlgebra.RootSystem.RootPositive +module + +public import Mathlib.Algebra.Ring.SumsOfSquares +public import Mathlib.LinearAlgebra.RootSystem.RootPositive /-! # The canonical bilinear form on a finite root pairing @@ -38,6 +40,8 @@ Weyl group. -/ +@[expose] public section + open Set Function open Module hiding reflection open Submodule (span) diff --git a/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean b/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean index ed1e03bd85832b..7ddb0876cbb075 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.Base -import Mathlib.LinearAlgebra.RootSystem.Chain -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +module + +public import Mathlib.LinearAlgebra.RootSystem.Base +public import Mathlib.LinearAlgebra.RootSystem.Chain +public import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas /-! # Properties of the `𝔤₂` root system. @@ -42,6 +44,8 @@ Once sufficient API for `RootPairing.Base` has been developed: -/ +@[expose] public section + noncomputable section open FaithfulSMul Function Set Submodule @@ -364,13 +368,7 @@ variable (i : ι) @[simp] lemma pairingIn_shortAddLong_left : P.pairingIn ℤ (shortAddLong P) i = P.pairingIn ℤ (short P) i + P.pairingIn ℤ (long P) i := by - suffices P.pairing (shortAddLong P) i = P.pairing (short P) i + P.pairing (long P) i from - algebraMap_injective ℤ R <| by simpa only [algebraMap_pairingIn, map_add] - have : Fintype ι := Fintype.ofFinite ι - have B := (P.posRootForm ℤ).toInvariantForm - apply mul_right_cancel₀ (B.ne_zero i) - rw [← B.two_mul_apply_root_root] - simp [shortAddLongRoot_eq, mul_add, add_mul, B.two_mul_apply_root_root] + rw [pairingIn_eq_add_of_root_eq_add (shortAddLongRoot_eq P)] @[simp] lemma pairingIn_shortAddLong_right : P.pairingIn ℤ i (shortAddLong P) = @@ -395,14 +393,10 @@ variable (i : ι) @[simp] lemma pairingIn_twoShortAddLong_left : P.pairingIn ℤ (twoShortAddLong P) i = 2 * P.pairingIn ℤ (short P) i + P.pairingIn ℤ (long P) i := by - suffices P.pairing (twoShortAddLong P) i = 2 * P.pairing (short P) i + P.pairing (long P) i from - algebraMap_injective ℤ R <| by simpa only [algebraMap_pairingIn, map_add, map_mul, map_ofNat] - have : Fintype ι := Fintype.ofFinite ι - have B := (P.posRootForm ℤ).toInvariantForm - apply mul_right_cancel₀ (B.ne_zero i) - rw [← B.two_mul_apply_root_root] - simp [twoShortAddLongRoot_eq, mul_add, add_mul, B.two_mul_apply_root_root] - ring + rw [pairingIn_eq_add_of_root_eq_smul_add_smul (x := 2) (y := 1) (i := short P) (l := long P)] + · simp + · simp only [twoShortAddLongRoot_eq, one_smul, add_left_inj] + norm_cast @[simp] lemma pairingIn_twoShortAddLong_right : P.pairingIn ℤ i (twoShortAddLong P) = @@ -425,18 +419,14 @@ variable (i : ι) · rw [B.two_mul_apply_root_root, B.two_mul_apply_root_root, mul_assoc] · rw [long_eq_three_mul_short, twoShortAddLongRoot_shortRoot]; ring +omit [Finite ι] [IsDomain R] in @[simp] lemma pairingIn_threeShortAddLong_left : P.pairingIn ℤ (threeShortAddLong P) i = 3 * P.pairingIn ℤ (short P) i + P.pairingIn ℤ (long P) i := by - suffices P.pairing (threeShortAddLong P) i = - 3 * P.pairing (short P) i + P.pairing (long P) i from - algebraMap_injective ℤ R <| by simpa only [algebraMap_pairingIn, map_add, map_mul, map_ofNat] - have : Fintype ι := Fintype.ofFinite ι - have B := (P.posRootForm ℤ).toInvariantForm - apply mul_right_cancel₀ (B.ne_zero i) - rw [← B.two_mul_apply_root_root] - simp [threeShortAddLongRoot_eq, mul_add, B.two_mul_apply_root_root, mul_left_comm (2 : R) (3 : R)] - ring + rw [pairingIn_eq_add_of_root_eq_smul_add_smul (x := 3) (y := 1) (i := short P) (l := long P)] + · simp + · simp only [threeShortAddLongRoot_eq, one_smul, add_left_inj] + norm_cast @[simp] lemma pairingIn_threeShortAddLong_right : P.pairingIn ℤ i (threeShortAddLong P) = @@ -463,15 +453,10 @@ variable (i : ι) @[simp] lemma pairingIn_threeShortAddTwoLong_left : P.pairingIn ℤ (threeShortAddTwoLong P) i = 3 * P.pairingIn ℤ (short P) i + 2 * P.pairingIn ℤ (long P) i := by - suffices P.pairing (threeShortAddTwoLong P) i = - 3 * P.pairing (short P) i + 2 * P.pairing (long P) i from - algebraMap_injective ℤ R <| by simpa only [algebraMap_pairingIn, map_add, map_mul, map_ofNat] - have : Fintype ι := Fintype.ofFinite ι - have B := (P.posRootForm ℤ).toInvariantForm - apply mul_right_cancel₀ (B.ne_zero i) - rw [← B.two_mul_apply_root_root] - simp [threeShortAddTwoLongRoot_eq, mul_add, B.two_mul_apply_root_root, mul_left_comm _ (3 : R)] - ring + rw [pairingIn_eq_add_of_root_eq_smul_add_smul (x := 3) (y := 2) (i := short P) (l := long P)] + · simp + · simp only [threeShortAddTwoLongRoot_eq] + norm_cast @[simp] lemma pairingIn_threeShortAddTwoLong_right : P.pairingIn ℤ i (threeShortAddTwoLong P) = diff --git a/Mathlib/LinearAlgebra/RootSystem/Finite/Lemmas.lean b/Mathlib/LinearAlgebra/RootSystem/Finite/Lemmas.lean index d57bdde430759e..9a916280316d79 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Finite/Lemmas.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Finite/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear -import Mathlib.LinearAlgebra.RootSystem.Reduced -import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.Algebra.Ring.Torsion +module + +public import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear +public import Mathlib.LinearAlgebra.RootSystem.Reduced +public import Mathlib.LinearAlgebra.RootSystem.Irreducible +public import Mathlib.Algebra.Ring.Torsion /-! # Structural lemmas about finite crystallographic root pairings @@ -27,6 +29,8 @@ root pairings. -/ +@[expose] public section + noncomputable section open Function Set diff --git a/Mathlib/LinearAlgebra/RootSystem/Finite/Nondegenerate.lean b/Mathlib/LinearAlgebra/RootSystem/Finite/Nondegenerate.lean index 6578d9f65fbf27..bc4f364f9bf6de 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Finite/Nondegenerate.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Finite/Nondegenerate.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.LinearAlgebra.BilinearForm.Basic -import Mathlib.LinearAlgebra.BilinearForm.Orthogonal -import Mathlib.LinearAlgebra.Dimension.Localization -import Mathlib.LinearAlgebra.QuadraticForm.Basic -import Mathlib.LinearAlgebra.RootSystem.BaseChange -import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear +module + +public import Mathlib.LinearAlgebra.BilinearForm.Basic +public import Mathlib.LinearAlgebra.BilinearForm.Orthogonal +public import Mathlib.LinearAlgebra.Dimension.Localization +public import Mathlib.LinearAlgebra.QuadraticForm.Basic +public import Mathlib.LinearAlgebra.RootSystem.BaseChange +public import Mathlib.LinearAlgebra.RootSystem.Finite.CanonicalBilinear /-! # Nondegeneracy of the polarization on a finite root pairing @@ -45,6 +47,8 @@ Weyl group. * Relation to Coxeter weight. -/ +@[expose] public section + noncomputable section open Set Function @@ -91,6 +95,45 @@ instance instIsAnisotropicOfIsCrystallographic [CharZero R] [P.IsCrystallographi ne_zero := IsAnisotropic.rootForm_root_ne_zero isOrthogonal_reflection := P.rootForm_reflection_reflection_apply +lemma smul_coroot_eq_of_root_add_root_eq [P.IsAnisotropic] [NoZeroSMulDivisors R N] {i j k : ι} + {m n : R} (hk : m • P.root i + n • P.root j = P.root k) : + letI Q := + (m * m) * P.pairing i j + (m * n) * (P.pairing i j * P.pairing j i) + (n * n) * P.pairing j i + Q • P.coroot k = m • P.pairing i j • P.coroot i + n • P.pairing j i • P.coroot j := by + let B := P.toInvariantForm + let lsq (i) : R := B.form (P.root i) (P.root i) + have hlsq (i : ι) : lsq i = P.RootForm (P.root i) (P.root i) := rfl + have h₁ : lsq k • P.coroot k = (m • lsq i) • P.coroot i + (n • lsq j) • P.coroot j := by + simp only [hlsq, smul_assoc, P.rootForm_self_smul_coroot, smul_comm _ 2] + rw [← map_smul _ m, ← map_smul _ n, ← nsmul_add, ← map_add, hk] + have h₂ : + lsq k = (m * m) * lsq i + (m * n) * (2 * B.form (P.root i) (P.root j)) + (n * n) * lsq j := by + have aux : P.RootForm (P.root j) (P.root i) = B.form (P.root i) (P.root j) := + P.rootForm_symmetric.eq (P.root j) (P.root i) + simp [hlsq, ← hk, aux, B] + ring + have h₃ : 2 * B.form (P.root i) (P.root j) = P.pairing i j * lsq j := + B.two_mul_apply_root_root i j + have h₄ : P.pairing j i * lsq i = P.pairing i j * lsq j := B.pairing_mul_eq_pairing_mul_swap i j + replace h₁ : + (m * m * (P.pairing j i * lsq i)) • P.coroot k + + (m * n * (P.pairing j i * P.pairing i j * lsq j)) • P.coroot k + + (n * n * (P.pairing j i * lsq j)) • P.coroot k = + (m * (P.pairing j i * lsq i)) • P.coroot i + + (n * (P.pairing j i * lsq j)) • P.coroot j := by + rw [h₂, h₃] at h₁ + replace h₁ := congr_arg (fun n ↦ P.pairing j i • n) h₁ + simp only [add_smul, smul_add, ← mul_smul, smul_eq_mul] at h₁ + convert h₁ using 1 + · module + · ring_nf + simp only [h₄] at h₁ + apply smul_right_injective _ (c := lsq j) (RootPairing.IsAnisotropic.rootForm_root_ne_zero j) + simp only + convert h₁ using 1 + · module + · module + section DomainAlg variable (S : Type*) [CommRing S] [IsDomain R] [IsDomain S] [Algebra S R] [FaithfulSMul S R] diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean index fa44bee85466bf..72fc6e433a9fa3 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Matrix -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Algebra.Lie.Weights.Basic -import Mathlib.LinearAlgebra.Eigenspace.Matrix -import Mathlib.LinearAlgebra.RootSystem.CartanMatrix +module + +public import Mathlib.Algebra.Lie.Matrix +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.Weights.Basic +public import Mathlib.LinearAlgebra.Eigenspace.Matrix +public import Mathlib.LinearAlgebra.RootSystem.CartanMatrix /-! # Geck's construction of a Lie algebra associated to a root system @@ -47,6 +49,8 @@ a base: https://mathoverflow.net/questions/495434/ -/ +@[expose] public section + noncomputable section open Function Set Submodule diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean index b09f947b71c8ff..3f6ee7ca68a5c5 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.Base -import Mathlib.LinearAlgebra.RootSystem.Chain -import Mathlib.LinearAlgebra.RootSystem.Finite.G2 +module + +public import Mathlib.LinearAlgebra.RootSystem.Base +public import Mathlib.LinearAlgebra.RootSystem.Chain +public import Mathlib.LinearAlgebra.RootSystem.Finite.G2 /-! # Supporting lemmas for Geck's construction of a Lie algebra associated to a root system -/ +@[expose] public section + open Set open FaithfulSMul (algebraMap_injective) diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean index b0e9a9e967d5b5..e83587bf08b991 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Basic -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Lemmas -import Mathlib.Algebra.Lie.Sl2 +module + +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Basic +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Lemmas +public import Mathlib.Algebra.Lie.Sl2 /-! # Relations in Geck's construction of a Lie algebra associated to a root system @@ -23,6 +25,8 @@ satisfying relations associated to the Cartan matrix of the input root system. -/ +@[expose] public section + noncomputable section namespace RootPairing.GeckConstruction diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean index 6746466db91a21..58d3c9c1980bfc 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Lie.Matrix -import Mathlib.Algebra.Lie.Semisimple.Lemmas -import Mathlib.Algebra.Lie.Weights.Linear -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Basic -import Mathlib.RingTheory.Finiteness.Nilpotent +module + +public import Mathlib.Algebra.Lie.Matrix +public import Mathlib.Algebra.Lie.Semisimple.Lemmas +public import Mathlib.Algebra.Lie.Weights.Linear +public import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Basic +public import Mathlib.RingTheory.Finiteness.Nilpotent /-! # Geck's construction of a Lie algebra associated to a root system yields semisimple algebras @@ -26,6 +28,8 @@ algebras. -/ +@[expose] public section + noncomputable section namespace RootPairing.GeckConstruction @@ -209,9 +213,9 @@ private lemma instIsIrreducible_aux₀ {U : LieSubmodule K H (b.support ⊕ ι obtain ⟨i, hi⟩ : ∃ i, w (Sum.inr i) ≠ 0 := by obtain ⟨l, hl⟩ : ∃ l, χ (h' l) ≠ 0 := by replace hw₀ : genWeightSpace (b.support ⊕ ι → K) χ ≠ ⊥ := by - contrapose! hw₀; rw [LieSubmodule.eq_bot_iff] at hw₀; exact hw₀ _ hw + contrapose hw₀; rw [LieSubmodule.eq_bot_iff] at hw₀; exact hw₀ _ hw let χ' : H →ₗ[K] K := (Weight.mk χ hw₀).toLinear - replace hχ : χ' ≠ 0 := by contrapose! hχ; ext x; simpa using LinearMap.congr_fun hχ x + replace hχ : χ' ≠ 0 := by contrapose hχ; ext x; simpa using LinearMap.congr_fun hχ x contrapose! hχ apply LinearMap.ext_on (span_range_h'_eq_top b) rintro - ⟨l, rfl⟩ diff --git a/Mathlib/LinearAlgebra/RootSystem/Hom.lean b/Mathlib/LinearAlgebra/RootSystem/Hom.lean index b5075a2acd90d0..09312a4d095ac7 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Hom.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Hom.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.Basic -import Mathlib.LinearAlgebra.RootSystem.Defs +module + +public import Mathlib.LinearAlgebra.RootSystem.Basic +public import Mathlib.LinearAlgebra.RootSystem.Defs /-! # Morphisms of root pairings @@ -45,6 +47,8 @@ given in SGA III Exp. 21 Section 6. -/ +@[expose] public section + open Set Function noncomputable section diff --git a/Mathlib/LinearAlgebra/RootSystem/Irreducible.lean b/Mathlib/LinearAlgebra/RootSystem/Irreducible.lean index bfab967b278d1a..ff9d17a797b8cb 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Irreducible.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Irreducible.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.RootSystem.RootPositive -import Mathlib.LinearAlgebra.RootSystem.WeylGroup -import Mathlib.RepresentationTheory.Submodule +module + +public import Mathlib.LinearAlgebra.RootSystem.RootPositive +public import Mathlib.LinearAlgebra.RootSystem.WeylGroup +public import Mathlib.RepresentationTheory.Submodule /-! # Irreducible root pairings @@ -21,6 +23,8 @@ This file contains basic definitions and results about irreducible root systems. -/ +@[expose] public section + open Function Set open Submodule (span span_le) open LinearMap (ker) diff --git a/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean b/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean index ac7a1bb334f6f3..124983860fbf7d 100644 --- a/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean +++ b/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan, Oliver Nash -/ -import Mathlib.Algebra.Module.Submodule.Invariant -import Mathlib.LinearAlgebra.RootSystem.Defs +module + +public import Mathlib.Algebra.Module.Submodule.Invariant +public import Mathlib.LinearAlgebra.RootSystem.Defs /-! # Root pairings taking values in a subring @@ -24,6 +26,8 @@ of this theory is the theory of crystallographic root systems, where `S = ℤ`. -/ +@[expose] public section + open Set Function open Submodule (span) open Module diff --git a/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean b/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean index af2f64b2e736fe..cc2aa9b0eb55da 100644 --- a/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean +++ b/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.Defs +module + +public import Mathlib.LinearAlgebra.RootSystem.Defs /-! # Root pairings made from bilinear forms @@ -21,6 +23,8 @@ integral lattice with an arbitrary reflexive module equipped with a bilinear for * properties -/ +@[expose] public section + open Set Function Module noncomputable section diff --git a/Mathlib/LinearAlgebra/RootSystem/Reduced.lean b/Mathlib/LinearAlgebra/RootSystem/Reduced.lean index 9ccf69319b978d..87732b3d1fca98 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Reduced.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Reduced.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash, Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +module + +public import Mathlib.LinearAlgebra.RootSystem.IsValuedIn /-! # Reduced root pairings @@ -26,10 +28,12 @@ provide both `RootPairing.linearIndependent_iff_coxeterWeight_ne_four` and Several ways to avoid this duplication exist. We leave explorations of this for future work. One possible solution is to drop `RootPairing.pairing` and `RootPairing.coxeterWeight` entirely and rely -solely on `RootPairing.pairingIn` and `RootPairing.coxeterWeightIn`.` +solely on `RootPairing.pairingIn` and `RootPairing.coxeterWeightIn`. -/ +@[expose] public section + open Module Set Function variable {ι R M N : Type*} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] @@ -38,7 +42,11 @@ variable {ι R M N : Type*} [CommRing R] [AddCommGroup M] [Module R M] [AddCommG namespace RootPairing /-- A root pairing is said to be reduced if any linearly dependent pair of roots is related by a -sign. -/ +sign. + +TODO Consider redefining this to make it perfectly symemtric between roots and coroots (i.e., so +that the same demand is made of coroots) and turning `RootPairing.instFlipIsReduced` into a +convenience constructor. -/ @[mk_iff] class IsReduced : Prop where eq_or_eq_neg (i j : ι) (h : ¬ LinearIndependent R ![P.root i, P.root j]) : P.root i = P.root j ∨ P.root i = - P.root j @@ -194,6 +202,15 @@ lemma coxeterWeight_eq_four_iff_not_linearIndependent : P.coxeterWeight i j = 4 ↔ ¬ LinearIndependent R ![P.root i, P.root j] := by rw [P.linearIndependent_iff_coxeterWeight_ne_four, not_not] +instance instFlipIsReduced [P.IsReduced] [NoZeroSMulDivisors R N] : P.flip.IsReduced := by + refine ⟨fun i j h ↦ ?_⟩ + rcases eq_or_ne i j with rfl | hij; · tauto + right + rw [← coxeterWeight_eq_four_iff_not_linearIndependent, coxeterWeight_flip, + coxeterWeight_eq_four_iff_not_linearIndependent, IsReduced.linearIndependent_iff] at h + push_neg at h + simp [P.root_eq_neg_iff.mp (h hij)] + variable (i j) /-- See also `RootPairing.pairingIn_two_two_iff`. -/ diff --git a/Mathlib/LinearAlgebra/RootSystem/RootPairingCat.lean b/Mathlib/LinearAlgebra/RootSystem/RootPairingCat.lean index ac6822987d15ce..26ff66239d4bef 100644 --- a/Mathlib/LinearAlgebra/RootSystem/RootPairingCat.lean +++ b/Mathlib/LinearAlgebra/RootSystem/RootPairingCat.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.Hom -import Mathlib.CategoryTheory.Category.Basic +module + +public import Mathlib.LinearAlgebra.RootSystem.Hom +public import Mathlib.CategoryTheory.Category.Basic /-! # The category of root pairings @@ -25,6 +27,8 @@ This is mostly copied from `ModuleCat`. -/ +@[expose] public section + open Set Function CategoryTheory noncomputable section diff --git a/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean b/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean index 0cce647e3be4b7..565e35aa2200d0 100644 --- a/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean +++ b/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +module + +public import Mathlib.LinearAlgebra.RootSystem.IsValuedIn /-! # Invariant and root-positive bilinear forms on root pairings @@ -32,6 +34,8 @@ positive semi-definite on weight space and positive-definite on the span of root -/ +@[expose] public section + noncomputable section open FaithfulSMul Function Set Submodule diff --git a/Mathlib/LinearAlgebra/RootSystem/WeylGroup.lean b/Mathlib/LinearAlgebra/RootSystem/WeylGroup.lean index 35c7c51ce8ccfe..8b6adcc67f32c9 100644 --- a/Mathlib/LinearAlgebra/RootSystem/WeylGroup.lean +++ b/Mathlib/LinearAlgebra/RootSystem/WeylGroup.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.LinearAlgebra.RootSystem.Hom -import Mathlib.RepresentationTheory.Basic +module + +public import Mathlib.LinearAlgebra.RootSystem.Hom +public import Mathlib.RepresentationTheory.Basic /-! # The Weyl group of a root pairing @@ -30,6 +32,8 @@ on roots. * faithfulness of `weylGroupToPerm` when multiplication by 2 is injective on the weight space. -/ +@[expose] public section + open Set Function variable {ι R M N : Type*} diff --git a/Mathlib/LinearAlgebra/SModEq.lean b/Mathlib/LinearAlgebra/SModEq.lean index 3346190a826bea..36ccde3a129ef3 100644 --- a/Mathlib/LinearAlgebra/SModEq.lean +++ b/Mathlib/LinearAlgebra/SModEq.lean @@ -1,3 +1,5 @@ -import Mathlib.LinearAlgebra.SModEq.Basic +module + +public import Mathlib.LinearAlgebra.SModEq.Basic deprecated_module (since := "2025-10-28") diff --git a/Mathlib/LinearAlgebra/SModEq/Basic.lean b/Mathlib/LinearAlgebra/SModEq/Basic.lean index 87d5c90cbe6cc9..2253d4eb924322 100644 --- a/Mathlib/LinearAlgebra/SModEq/Basic.lean +++ b/Mathlib/LinearAlgebra/SModEq/Basic.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Module.Submodule.Map -import Mathlib.Algebra.Polynomial.Eval.Defs -import Mathlib.RingTheory.Ideal.Quotient.Defs +module + +public import Mathlib.Algebra.Module.Submodule.Map +public import Mathlib.Algebra.Polynomial.Eval.Defs +public import Mathlib.RingTheory.Ideal.Quotient.Defs /-! # modular equivalence for submodule -/ +@[expose] public section + open Submodule diff --git a/Mathlib/LinearAlgebra/Semisimple.lean b/Mathlib/LinearAlgebra/Semisimple.lean index 978e0da779ce46..a1295fd16b1252 100644 --- a/Mathlib/LinearAlgebra/Semisimple.lean +++ b/Mathlib/LinearAlgebra/Semisimple.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.FieldTheory.Perfect -import Mathlib.LinearAlgebra.AnnihilatingPolynomial -import Mathlib.RingTheory.Artinian.Instances -import Mathlib.RingTheory.Ideal.Quotient.Nilpotent -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.FieldTheory.Perfect +public import Mathlib.LinearAlgebra.AnnihilatingPolynomial +public import Mathlib.RingTheory.Artinian.Instances +public import Mathlib.RingTheory.Ideal.Quotient.Nilpotent +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Semisimple linear endomorphisms @@ -40,6 +42,8 @@ In finite dimensions over a field: -/ +@[expose] public section + open Set Function Polynomial variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/SesquilinearForm.lean b/Mathlib/LinearAlgebra/SesquilinearForm.lean index 14a3a4b33af853..a739c53c1a035e 100644 --- a/Mathlib/LinearAlgebra/SesquilinearForm.lean +++ b/Mathlib/LinearAlgebra/SesquilinearForm.lean @@ -3,6 +3,8 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow -/ -import Mathlib.LinearAlgebra.SesquilinearForm.Basic +module + +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic deprecated_module (since := "2025-10-06") diff --git a/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean b/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean index 449fa5e86654d1..330c64575492a0 100644 --- a/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean +++ b/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow -/ -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +module + +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.BilinearMap +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas /-! # Sesquilinear maps @@ -34,6 +36,8 @@ basic lemmas about construction and elementary calculations are found there. Sesquilinear form, Sesquilinear map -/ +@[expose] public section + open Module variable {R R₁ R₂ R₃ M M₁ M₂ M₃ Mₗ₁ Mₗ₁' Mₗ₂ Mₗ₂' K K₁ K₂ V V₁ V₂ n : Type*} diff --git a/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean b/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean index ea723b9113b52b..e92d26e0ab624d 100644 --- a/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean +++ b/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.LinearAlgebra.Matrix.PosDef +module + +public import Mathlib.LinearAlgebra.Matrix.PosDef /-! # Sesquilinear forms over a star ring @@ -12,6 +14,8 @@ This file provides some properties about sesquilinear forms `M →ₗ⋆[R] M `StarRing`. -/ +@[expose] public section + open Module LinearMap variable {R M n : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/LinearAlgebra/Span/Basic.lean b/Mathlib/LinearAlgebra/Span/Basic.lean index b7dfb39f3d38d0..48b8bedfe6849c 100644 --- a/Mathlib/LinearAlgebra/Span/Basic.lean +++ b/Mathlib/LinearAlgebra/Span/Basic.lean @@ -4,15 +4,17 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.Module.Prod -import Mathlib.Algebra.Module.Submodule.EqLocus -import Mathlib.Algebra.Module.Submodule.Equiv -import Mathlib.Algebra.Module.Submodule.RestrictScalars -import Mathlib.Algebra.NoZeroSMulDivisors.Basic -import Mathlib.LinearAlgebra.Span.Defs -import Mathlib.Order.CompactlyGenerated.Basic -import Mathlib.Order.OmegaCompletePartialOrder +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.Module.Prod +public import Mathlib.Algebra.Module.Submodule.EqLocus +public import Mathlib.Algebra.Module.Submodule.Equiv +public import Mathlib.Algebra.Module.Submodule.RestrictScalars +public import Mathlib.Algebra.NoZeroSMulDivisors.Basic +public import Mathlib.LinearAlgebra.Span.Defs +public import Mathlib.Order.CompactlyGenerated.Basic +public import Mathlib.Order.OmegaCompletePartialOrder /-! # The span of a set of vectors, as a submodule @@ -26,6 +28,8 @@ import Mathlib.Order.OmegaCompletePartialOrder -/ +@[expose] public section + variable {R R₂ K M M₂ V S : Type*} namespace Submodule diff --git a/Mathlib/LinearAlgebra/Span/Defs.lean b/Mathlib/LinearAlgebra/Span/Defs.lean index 1c7c0f4eef6bba..b701bc235ebd5b 100644 --- a/Mathlib/LinearAlgebra/Span/Defs.lean +++ b/Mathlib/LinearAlgebra/Span/Defs.lean @@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Frédéric Dupuis, Heather Macbeth -/ -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # The span of a set of vectors, as a submodule @@ -19,6 +21,8 @@ import Mathlib.Algebra.Group.Pointwise.Set.Basic -/ +@[expose] public section + assert_not_exists Field variable {R R₂ K M M₂ V S : Type*} diff --git a/Mathlib/LinearAlgebra/SpecialLinearGroup.lean b/Mathlib/LinearAlgebra/SpecialLinearGroup.lean new file mode 100644 index 00000000000000..816bbe876ea661 --- /dev/null +++ b/Mathlib/LinearAlgebra/SpecialLinearGroup.lean @@ -0,0 +1,309 @@ +/- +Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Antoine Chambert-Loir +-/ +module + +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Dual.Basis +public import Mathlib.LinearAlgebra.Matrix.Dual +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.LinearAlgebra.Charpoly.BaseChange + +/-! +# The special linear group of a module + +If `R` is a commutative ring and `V` is an `R`-module, +we define `SpecialLinearGroup R V` as the subtype of +linear equivalences `V ≃ₗ[R] V` with determinant 1. +When `V` doesn't have a finite basis, the determinant is defined by 1 +and the definition gives `V ≃ₗ[R] V`. +The interest of this definition is that `SpecialLinearGroup R V` +has a group structure. (Starting from linear maps wouldn't have worked.) + +The file is constructed parallel to the one defining `Matrix.SpecialLinearGroup`. + +We provide `SpecialLinearGroup.toLinearEquiv`: the canonical map +from `SpecialLinearGroup R V` to `V ≃ₗ[R] V`, as a monoid hom. + +When `V` is free and finite over `R`, we define +* `SpecialLinearGroup.dualMap` +* `SpecialLinearGroup.baseChange` + +We define `Matrix.SpecialLinaerGruop.toLin'_equiv`: the mul equivalence +from `Matrix.SpecialLinearGroup n R` to `SpecialLinearGroup R (n → R)` +and its variant +`Matrix.SpecialLinearGroup.toLin_equiv`, +from `Matrix.SpecialLinearGroup n R` to `SpecialLinearGroup R V`, +associated with a finite basis of `V`. + +-/ + +@[expose] public section + +variable {R V : Type*} [CommRing R] [AddCommGroup V] [Module R V] + +variable (R V) in +/-- The special linear group of a module. + +This is only meaningful when the module is finite and free, +for otherwise, it coincides with the group of linear equivalences. -/ +abbrev SpecialLinearGroup := { u : V ≃ₗ[R] V // u.det = 1 } + +namespace SpecialLinearGroup + +theorem det_eq_one (u : SpecialLinearGroup R V) : + LinearMap.det (u : V →ₗ[R] V) = 1 := by + simp [← LinearEquiv.coe_det, u.prop] + +instance : CoeFun (SpecialLinearGroup R V) (fun _ ↦ V → V) where + coe u x := u.val x + +theorem ext_iff (u v : SpecialLinearGroup R V) : u = v ↔ ∀ x : V, u x = v x := by + simp only [← Subtype.coe_inj, LinearEquiv.ext_iff] + +@[ext] +theorem ext (u v : SpecialLinearGroup R V) : (∀ x, u x = v x) → u = v := + (SpecialLinearGroup.ext_iff u v).mpr + +section rankOne + +theorem subsingleton_of_finrank_eq_one [Module.Free R V] (d1 : Module.finrank R V = 1) : + Subsingleton (SpecialLinearGroup R V) where + allEq u v := by + nontriviality R + ext x + by_cases hx : x = 0 + · simp [hx] + suffices ∀ (u : SpecialLinearGroup R V), (u : V →ₗ[R] V) = LinearMap.id by + simp only [LinearMap.ext_iff, LinearEquiv.coe_coe, LinearMap.id_coe, id_eq] at this + simp [this u, this v] + intro u + ext x + set c := (LinearEquiv.smul_id_of_finrank_eq_one d1).symm u with hc + rw [LinearEquiv.eq_symm_apply] at hc + suffices c = 1 by + simp [← hc, LinearEquiv.smul_id_of_finrank_eq_one, this] + have hu := u.prop + simpa [← Units.val_inj, LinearEquiv.coe_det, ← hc, + LinearEquiv.smul_id_of_finrank_eq_one, d1] using hu + +end rankOne + +instance : Inv (SpecialLinearGroup R V) := + ⟨fun A => ⟨A⁻¹, by simp [A.prop]⟩⟩ + +instance : Mul (SpecialLinearGroup R V) := + ⟨fun A B => ⟨A * B, by simp [A.prop, B.prop]⟩⟩ + +instance : Div (SpecialLinearGroup R V) := + ⟨fun A B => ⟨A / B, by simp [A.prop, B.prop]⟩⟩ + +instance : One (SpecialLinearGroup R V) := + ⟨⟨1, by simp⟩⟩ + +instance : Pow (SpecialLinearGroup R V) ℕ where + pow x n := ⟨x ^ n, by simp [x.prop]⟩ + +instance : Pow (SpecialLinearGroup R V) ℤ where + pow x n := ⟨x ^ n, by simp [x.prop]⟩ + +instance : Inhabited (SpecialLinearGroup R V) := + ⟨1⟩ + +/-- The transpose of an element in `SpecialLinearGroup R V`. -/ +def dualMap + [Module.Free R V] [Module.Finite R V] (A : SpecialLinearGroup R V) : + SpecialLinearGroup R (Module.Dual R V) := + ⟨LinearEquiv.dualMap (A : V ≃ₗ[R] V), by + simp only [← Units.val_inj, LinearEquiv.coe_det, Units.val_one, + LinearEquiv.dualMap, LinearMap.det_dualMap] + simp [← LinearEquiv.coe_det, A.prop]⟩ + +@[inherit_doc] +scoped postfix:1024 "ᵀ" => SpecialLinearGroup.dualMap + +section CoeLemmas + +variable (A B : SpecialLinearGroup R V) + +theorem coe_mk (A : V ≃ₗ[R] V) (h : A.det = 1) : ↑(⟨A, h⟩ : SpecialLinearGroup R V) = A := + rfl + +@[simp] +theorem coe_mul : (A * B : SpecialLinearGroup R V) = (A * B : V ≃ₗ[R] V) := + rfl + +@[simp] +theorem coe_div : (A / B : SpecialLinearGroup R V) = (A / B : V ≃ₗ[R] V) := + rfl + +@[simp] +theorem coe_inv : (A : SpecialLinearGroup R V)⁻¹ = (A⁻¹ : V ≃ₗ[R] V) := + rfl + +@[simp] +theorem coe_one : (1 : SpecialLinearGroup R V) = (1 : V ≃ₗ[R] V) := + rfl + +@[simp] +theorem det_coe : LinearEquiv.det (A : V ≃ₗ[R] V) = 1 := + A.prop + +@[simp] +theorem coe_pow (m : ℕ) : (A ^ m : SpecialLinearGroup R V) = (A : V ≃ₗ[R] V) ^ m := + rfl + +@[simp] +theorem coe_zpow (m : ℤ) : (A ^ m : SpecialLinearGroup R V) = (A : V ≃ₗ[R] V) ^ m := + rfl + +@[simp] +theorem coe_dualMap + [Module.Free R V] [Module.Finite R V] : + Aᵀ = (A : V ≃ₗ[R] V).dualMap := + rfl + +end CoeLemmas + +instance : Group (SpecialLinearGroup R V) := fast_instance% + Function.Injective.group _ Subtype.coe_injective coe_one coe_mul coe_inv coe_div coe_pow coe_zpow + +/-- A version of `Matrix.toLin' A` that produces linear equivalences. -/ +def toLinearEquiv : SpecialLinearGroup R V →* V ≃ₗ[R] V where + toFun A := A.val + map_one' := coe_one + map_mul' := coe_mul + +theorem toLinearEquiv_apply (A : SpecialLinearGroup R V) (v : V) : + A.toLinearEquiv v = A v := + rfl + +theorem toLinearEquiv_to_linearMap (A : SpecialLinearGroup R V) : + (SpecialLinearGroup.toLinearEquiv A) = (A : V →ₗ[R] V) := + rfl + +theorem toLinearEquiv_symm_apply (A : SpecialLinearGroup R V) (v : V) : + A.toLinearEquiv.symm v = A⁻¹ v := + rfl + +theorem toLinearEquiv_symm_to_linearMap (A : SpecialLinearGroup R V) : + A.toLinearEquiv.symm = ((A⁻¹ : SpecialLinearGroup R V) : V →ₗ[R] V) := + rfl + +theorem toLinearEquiv_injective : + Function.Injective (toLinearEquiv : SpecialLinearGroup R V →* V ≃ₗ[R] V) := + Subtype.val_injective + +/-- The canonical group morphism from the special linear group +to the general linear group. -/ +def toGeneralLinearGroup : SpecialLinearGroup R V →* LinearMap.GeneralLinearGroup R V := + (LinearMap.GeneralLinearGroup.generalLinearEquiv R V).symm.toMonoidHom.comp toLinearEquiv + +lemma toGeneralLinearGroup_toLinearEquiv_apply (u : SpecialLinearGroup R V) : + u.toGeneralLinearGroup.toLinearEquiv = u.toLinearEquiv := rfl + +lemma coe_toGeneralLinearGroup_apply (u : SpecialLinearGroup R V) : + u.toGeneralLinearGroup.val = u.toLinearEquiv := rfl + +lemma toGeneralLinearGroup_injective : + Function.Injective ⇑(toGeneralLinearGroup (R := R) (V := V)) := by + simp [toGeneralLinearGroup, toLinearEquiv_injective] + +lemma mem_range_toGeneralLinearGroup_iff {u : LinearMap.GeneralLinearGroup R V} : + u ∈ Set.range ⇑(toGeneralLinearGroup (R := R) (V := V)) ↔ + u.toLinearEquiv.det = 1 := by + constructor + · rintro ⟨v, hv⟩ + rw [← hv, toGeneralLinearGroup_toLinearEquiv_apply] + exact v.prop + · intro hu + refine ⟨⟨u.toLinearEquiv, hu⟩, rfl⟩ + +section baseChange + +open TensorProduct + +variable {S : Type*} [CommRing S] [Algebra R S] + [Module.Free R V] [Module.Finite R V] + +/-- By base change, an `R`-algebra `S` induces a group homomorphism from +`SpecialLinearGroup R V` to `SpecialLinearGroup S (S ⊗[R] V)`. -/ +@[simps] +def baseChange : SpecialLinearGroup R V →* SpecialLinearGroup S (S ⊗[R] V) where + toFun g := ⟨LinearEquiv.baseChange R S V V g, by + rw [LinearEquiv.det_baseChange, g.prop, map_one]⟩ + map_one' := Subtype.ext <| by simp + map_mul' x y := Subtype.ext <| by simp [LinearEquiv.baseChange_mul] + +end baseChange + +variable {W X : Type*} [AddCommGroup W] [Module R W] [AddCommGroup X] [Module R X] + +/-- The isomorphism between special linear groups of isomorphic modules. -/ +def congr_linearEquiv (e : V ≃ₗ[R] W) : + SpecialLinearGroup R V ≃* SpecialLinearGroup R W where + toFun f := ⟨e.symm ≪≫ₗ f ≪≫ₗ e, by simp [f.prop]⟩ + invFun g := ⟨e ≪≫ₗ g ≪≫ₗ e.symm, by + nth_rewrite 1 [← LinearEquiv.symm_symm e] + rw [LinearEquiv.det_conj g e.symm, g.prop]⟩ + left_inv f := Subtype.coe_injective <| by aesop + right_inv g := Subtype.coe_injective <| by aesop + map_mul' f g := Subtype.coe_injective <| by aesop + +@[simp] +theorem congr_linearEquiv_coe_apply (e : V ≃ₗ[R] W) (f : SpecialLinearGroup R V) : + (congr_linearEquiv e f : W ≃ₗ[R] W) = e.symm ≪≫ₗ f ≪≫ₗ e := + rfl + +@[simp] +theorem congr_linearEquiv_apply_apply (e : V ≃ₗ[R] W) (f : SpecialLinearGroup R V) (x : W) : + congr_linearEquiv e f x = e (f (e.symm x)) := + rfl + +theorem congr_linearEquiv_symm (e : V ≃ₗ[R] W) : + (congr_linearEquiv e).symm = congr_linearEquiv e.symm := + rfl + +theorem congr_linearEquiv_trans (e : V ≃ₗ[R] W) (f : W ≃ₗ[R] X) : + (congr_linearEquiv e).trans (congr_linearEquiv f) = congr_linearEquiv (e.trans f) := by + rfl + +theorem congr_linearEquiv_refl : + congr_linearEquiv (LinearEquiv.refl R V) = MulEquiv.refl _ := by + rfl + + +end SpecialLinearGroup + +section Matrix + +variable {n : Type*} [Fintype n] [DecidableEq n] (b : Module.Basis n R V) + +/-- The canonical isomorphism from `SL(n, R)` to the special linear group of the module `n → R`. -/ +def _root_.Matrix.SpecialLinearGroup.toLin'_equiv : + Matrix.SpecialLinearGroup n R ≃* SpecialLinearGroup R (n → R) where + toFun A := ⟨Matrix.SpecialLinearGroup.toLin' A, + by + simp [← Units.val_inj, LinearEquiv.coe_det, Units.val_one, + Matrix.SpecialLinearGroup.toLin'_to_linearMap]⟩ + invFun u := ⟨LinearMap.toMatrix' u, + by simp [← LinearEquiv.coe_det, u.prop]⟩ + left_inv A := Subtype.coe_injective <| by + rw [← LinearEquiv.eq_symm_apply, LinearMap.toMatrix'_symm, + Matrix.SpecialLinearGroup.toLin'_to_linearMap] + right_inv u := Subtype.coe_injective <| by + simp [← LinearEquiv.toLinearMap_inj, Matrix.SpecialLinearGroup.toLin'] + map_mul' A B := Subtype.coe_injective (by simp) + +/-- The isomorphism from `Matrix.SpecialLinearGroup n R` +to the special linear group of a module associated with a basis of that module. -/ +noncomputable def _root_.Matrix.SpecialLinearGroup.toLin_equiv + (b : Module.Basis n R V) : + Matrix.SpecialLinearGroup n R ≃* SpecialLinearGroup R V := + Matrix.SpecialLinearGroup.toLin'_equiv.trans + (SpecialLinearGroup.congr_linearEquiv + (b.repr.trans (Finsupp.linearEquivFunOnFinite R R n)).symm) + +end Matrix diff --git a/Mathlib/LinearAlgebra/StdBasis.lean b/Mathlib/LinearAlgebra/StdBasis.lean index aea60ab401475f..dd1ae04ed5cb89 100644 --- a/Mathlib/LinearAlgebra/StdBasis.lean +++ b/Mathlib/LinearAlgebra/StdBasis.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas /-! # The standard basis @@ -31,6 +33,8 @@ this is a basis over `Fin 3 → R`. -/ +@[expose] public section + open Function Module Set Submodule namespace Pi diff --git a/Mathlib/LinearAlgebra/SymmetricAlgebra/Basic.lean b/Mathlib/LinearAlgebra/SymmetricAlgebra/Basic.lean index 88e30d8329317e..b854e2decc382a 100644 --- a/Mathlib/LinearAlgebra/SymmetricAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/SymmetricAlgebra/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Raphael Douglas Giles. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Raphael Douglas Giles, Zhixuan Dai, Zhenyan Fu, Yiming Fu, Jingting Wang, Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorAlgebra.Basic +module + +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic /-! # Symmetric Algebras @@ -24,6 +26,8 @@ See `SymAlg R` instead if you are looking for the symmetrized algebra, which giv multiplication on `R` by $a \circ b = \frac{1}{2}(ab + ba)$. -/ +@[expose] public section + variable (R M : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] /-- Relation on the tensor algebra which will yield the symmetric algebra when diff --git a/Mathlib/LinearAlgebra/SymmetricAlgebra/Basis.lean b/Mathlib/LinearAlgebra/SymmetricAlgebra/Basis.lean index 9ae59c6cec052d..dbef0ef66716b1 100644 --- a/Mathlib/LinearAlgebra/SymmetricAlgebra/Basis.lean +++ b/Mathlib/LinearAlgebra/SymmetricAlgebra/Basis.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Raphael Douglas Giles. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Raphael Douglas Giles, Zhixuan Dai, Zhenyan Fu, Yiming Fu, Jingting Wang, Eric Wieser -/ -import Mathlib.LinearAlgebra.SymmetricAlgebra.Basic -import Mathlib.LinearAlgebra.Dimension.Basic -import Mathlib.RingTheory.MvPolynomial +module + +public import Mathlib.LinearAlgebra.SymmetricAlgebra.Basic +public import Mathlib.LinearAlgebra.Dimension.Basic +public import Mathlib.RingTheory.MvPolynomial /-! # A basis for `SymmetricAlgebra R M` @@ -28,6 +30,8 @@ import Mathlib.RingTheory.MvPolynomial This file closely mirrors the corresponding file for `TensorAlgebra`. -/ +@[expose] public section + open Module namespace SymmetricAlgebra diff --git a/Mathlib/LinearAlgebra/SymplecticGroup.lean b/Mathlib/LinearAlgebra/SymplecticGroup.lean index a97bb0535aecdd..f45df9b46ce4d0 100644 --- a/Mathlib/LinearAlgebra/SymplecticGroup.lean +++ b/Mathlib/LinearAlgebra/SymplecticGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Matej Penciak. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matej Penciak, Moritz Doll, Fabien Clery -/ -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +module + +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse /-! # The Symplectic Group @@ -20,6 +22,8 @@ This file defines the symplectic group and proves elementary properties. * For `n = 1` the symplectic group coincides with the special linear group. -/ +@[expose] public section + open Matrix diff --git a/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean b/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean index a20072faf04dc2..4f8fefefd49b81 100644 --- a/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.Algebra.FreeAlgebra -import Mathlib.Algebra.RingQuot -import Mathlib.Algebra.TrivSqZeroExt -import Mathlib.Algebra.Algebra.Operations -import Mathlib.LinearAlgebra.Multilinear.Basic +module + +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.Algebra.RingQuot +public import Mathlib.Algebra.TrivSqZeroExt +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.LinearAlgebra.Multilinear.Basic /-! # Tensor Algebras @@ -37,6 +39,8 @@ As noted above, the tensor algebra of `M` is constructed as the free `R`-algebra modulo the additional relations making the inclusion of `M` into an `R`-linear map. -/ +@[expose] public section + variable (R : Type*) [CommSemiring R] variable (M : Type*) [AddCommMonoid M] [Module R M] diff --git a/Mathlib/LinearAlgebra/TensorAlgebra/Basis.lean b/Mathlib/LinearAlgebra/TensorAlgebra/Basis.lean index a83a90426a7b17..12867f88c9cb5e 100644 --- a/Mathlib/LinearAlgebra/TensorAlgebra/Basis.lean +++ b/Mathlib/LinearAlgebra/TensorAlgebra/Basis.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorAlgebra.Basic -import Mathlib.LinearAlgebra.FreeAlgebra +module + +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic +public import Mathlib.LinearAlgebra.FreeAlgebra /-! # A basis for `TensorAlgebra R M` @@ -23,6 +25,8 @@ import Mathlib.LinearAlgebra.FreeAlgebra -/ +@[expose] public section + open Module namespace TensorAlgebra diff --git a/Mathlib/LinearAlgebra/TensorAlgebra/Grading.lean b/Mathlib/LinearAlgebra/TensorAlgebra/Grading.lean index 358156effcee48..027e23f5d40184 100644 --- a/Mathlib/LinearAlgebra/TensorAlgebra/Grading.lean +++ b/Mathlib/LinearAlgebra/TensorAlgebra/Grading.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorAlgebra.Basic -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! # Results about the grading structure of the tensor algebra @@ -13,6 +15,8 @@ The main result is `TensorAlgebra.gradedAlgebra`, which says that the tensor alg ℕ-graded algebra. -/ +@[expose] public section + namespace TensorAlgebra variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/LinearAlgebra/TensorAlgebra/ToTensorPower.lean b/Mathlib/LinearAlgebra/TensorAlgebra/ToTensorPower.lean index b7b5fb64ccf671..a48d7bf8f1e12d 100644 --- a/Mathlib/LinearAlgebra/TensorAlgebra/ToTensorPower.lean +++ b/Mathlib/LinearAlgebra/TensorAlgebra/ToTensorPower.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorAlgebra.Basic -import Mathlib.LinearAlgebra.TensorPower.Basic +module + +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic +public import Mathlib.LinearAlgebra.TensorPower.Basic /-! # Tensor algebras as direct sums of tensor powers @@ -13,6 +15,8 @@ In this file we show that `TensorAlgebra R M` is isomorphic to a direct sum of t `TensorAlgebra.equivDirectSum`. -/ +@[expose] public section + open scoped DirectSum TensorProduct variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/LinearAlgebra/TensorPower/Basic.lean b/Mathlib/LinearAlgebra/TensorPower/Basic.lean index 11593bad330e77..6712e230b3170a 100644 --- a/Mathlib/LinearAlgebra/TensorPower/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorPower/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.PiTensorProduct -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.Algebra.DirectSum.Algebra +module + +public import Mathlib.LinearAlgebra.PiTensorProduct +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.Algebra.DirectSum.Algebra /-! # Tensor power of a semimodule over a commutative semiring @@ -27,6 +29,8 @@ In this file we use `ₜ1` and `ₜ*` as local notation for the graded multiplic tensor powers. Elsewhere, using `1` and `*` on `GradedMonoid` should be preferred. -/ +@[expose] public section + open scoped TensorProduct /-- Homogeneous tensor powers $M^{\otimes n}$. `⨂[R]^n M` is a shorthand for diff --git a/Mathlib/LinearAlgebra/TensorPower/Pairing.lean b/Mathlib/LinearAlgebra/TensorPower/Pairing.lean index d87c0381443149..efac47d92b34d4 100644 --- a/Mathlib/LinearAlgebra/TensorPower/Pairing.lean +++ b/Mathlib/LinearAlgebra/TensorPower/Pairing.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.GroupTheory.MonoidLocalization.Basic -import Mathlib.LinearAlgebra.Dual.Defs -import Mathlib.LinearAlgebra.TensorPower.Basic +module + +public import Mathlib.GroupTheory.MonoidLocalization.Basic +public import Mathlib.LinearAlgebra.Dual.Defs +public import Mathlib.LinearAlgebra.TensorPower.Basic /-! # The pairing between the tensor power of the dual and the tensor power @@ -15,6 +17,8 @@ We construct the pairing -/ +@[expose] public section + open TensorProduct PiTensorProduct namespace TensorPower diff --git a/Mathlib/LinearAlgebra/TensorPower/Symmetric.lean b/Mathlib/LinearAlgebra/TensorPower/Symmetric.lean index 06bf9f55f576ad..a8a57d8eb6be61 100644 --- a/Mathlib/LinearAlgebra/TensorPower/Symmetric.lean +++ b/Mathlib/LinearAlgebra/TensorPower/Symmetric.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ +module -import Mathlib.LinearAlgebra.PiTensorProduct +public import Mathlib.LinearAlgebra.PiTensorProduct /-! # Symmetric tensor power of a semimodule over a commutative semiring @@ -29,6 +30,8 @@ from `ι → M` to `Sym[R] ι M` by `⨂ₛ[R] i, f i`. We also reserve the nota -/ +@[expose] public section + suppress_compilation universe u v diff --git a/Mathlib/LinearAlgebra/TensorProduct/Associator.lean b/Mathlib/LinearAlgebra/TensorProduct/Associator.lean index 2f871cba119f8f..75312e4fada513 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Associator.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Associator.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro -/ -import Mathlib.Algebra.Algebra.Hom -import Mathlib.LinearAlgebra.TensorProduct.Basic +module + +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.LinearAlgebra.TensorProduct.Basic /-! # Associators and unitors for tensor products of modules over a commutative ring. -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] variable {R' : Type*} [Monoid R'] variable {R'' : Type*} [Semiring R''] diff --git a/Mathlib/LinearAlgebra/TensorProduct/Basic.lean b/Mathlib/LinearAlgebra/TensorProduct/Basic.lean index c85fb6045517c5..2de29a8a49d17a 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro -/ -import Mathlib.Algebra.Module.Equiv.Basic -import Mathlib.Algebra.Module.Shrink -import Mathlib.Algebra.Module.Submodule.Bilinear -import Mathlib.GroupTheory.Congruence.Hom -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Module.Equiv.Basic +public import Mathlib.Algebra.Module.Shrink +public import Mathlib.Algebra.Module.Submodule.Bilinear +public import Mathlib.GroupTheory.Congruence.Hom +public import Mathlib.Tactic.Abel /-! # Tensor product of modules over commutative semirings. @@ -36,6 +38,8 @@ bilinear map `TensorProduct.mk` is the given bilinear map `f`. Uniqueness is sh bilinear, tensor, tensor product -/ +@[expose] public section + section Semiring variable {R R₂ R₃ R' R'' : Type*} diff --git a/Mathlib/LinearAlgebra/TensorProduct/Basis.lean b/Mathlib/LinearAlgebra/TensorProduct/Basis.lean index 57cb09b0c702f7..e7010f9985e37a 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Basis.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Basis.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer -/ -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.FreeModule.Basic +module + +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.FreeModule.Basic /-! # Bases and dimensionality of tensor products of modules @@ -15,6 +17,8 @@ This file defines various bases on the tensor product of modules, and shows that the tensor product of free modules is again free. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/LinearAlgebra/TensorProduct/DirectLimit.lean b/Mathlib/LinearAlgebra/TensorProduct/DirectLimit.lean index 5f426f6fb9960e..e4983868c1ddaa 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/DirectLimit.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/DirectLimit.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.Algebra.Colimit.Module -import Mathlib.LinearAlgebra.TensorProduct.Basic +public import Mathlib.Algebra.Colimit.Module +public import Mathlib.LinearAlgebra.TensorProduct.Basic /-! # Tensor product and direct limits commute with each other. @@ -21,6 +22,8 @@ as `R`-modules. -/ +@[expose] public section + open TensorProduct Module Module.DirectLimit variable {R : Type*} [CommSemiring R] diff --git a/Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean b/Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean index 0d71898087e869..cd6dac82cd091f 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.LinearAlgebra.TensorProduct.Basic +module + +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Basic /-! @@ -36,6 +38,8 @@ tensor product, finitely generated -/ +@[expose] public section + open scoped TensorProduct open Submodule diff --git a/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean b/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean index f7eb74592c2261..505a03e2ba0f70 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Int.Order.Units -import Mathlib.Data.ZMod.IntUnitsPower -import Mathlib.RingTheory.TensorProduct.Basic -import Mathlib.LinearAlgebra.DirectSum.TensorProduct -import Mathlib.Algebra.DirectSum.Algebra +module + +public import Mathlib.Data.Int.Order.Units +public import Mathlib.Data.ZMod.IntUnitsPower +public import Mathlib.RingTheory.TensorProduct.Basic +public import Mathlib.LinearAlgebra.DirectSum.TensorProduct +public import Mathlib.Algebra.DirectSum.Algebra /-! # Graded tensor products over graded algebras @@ -43,6 +45,8 @@ multiplication follows trivially from this after some point-free nonsense. -/ +@[expose] public section + open scoped TensorProduct DirectSum variable {R ι : Type*} diff --git a/Mathlib/LinearAlgebra/TensorProduct/Graded/Internal.lean b/Mathlib/LinearAlgebra/TensorProduct/Graded/Internal.lean index 5fc5052fa79a70..5d1d3b41223a60 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Graded/Internal.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Graded/Internal.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorProduct.Graded.External -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.LinearAlgebra.TensorProduct.Graded.External +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! # Graded tensor products over graded algebras @@ -47,6 +49,8 @@ type. * Determine if replacing the synonym with a single-field structure improves performance. -/ +@[expose] public section + suppress_compilation open scoped TensorProduct diff --git a/Mathlib/LinearAlgebra/TensorProduct/Matrix.lean b/Mathlib/LinearAlgebra/TensorProduct/Matrix.lean index 78803c880e078b..17398159b0bc1d 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Matrix.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Matrix.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Matrix.Kronecker -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.TensorProduct.Basis +module + +public import Mathlib.LinearAlgebra.Matrix.Kronecker +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.TensorProduct.Basis /-! # Connections between `TensorProduct` and `Matrix` @@ -17,6 +19,8 @@ Notably, `TensorProduct.toMatrix_map` shows that taking the tensor product of li equivalent to taking the Kronecker product of their matrix representations. -/ +@[expose] public section + open Matrix Module LinearMap open scoped Kronecker diff --git a/Mathlib/LinearAlgebra/TensorProduct/Opposite.lean b/Mathlib/LinearAlgebra/TensorProduct/Opposite.lean index 41e93e154e3720..6cc574be6487e0 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Opposite.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Opposite.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.RingTheory.TensorProduct.Maps -import Mathlib.Algebra.Algebra.Opposite +module + +public import Mathlib.RingTheory.TensorProduct.Maps +public import Mathlib.Algebra.Algebra.Opposite /-! # `MulOpposite` distributes over `⊗` @@ -13,6 +15,8 @@ The main result in this file is: * `Algebra.TensorProduct.opAlgEquiv R S A B : Aᵐᵒᵖ ⊗[R] Bᵐᵒᵖ ≃ₐ[S] (A ⊗[R] B)ᵐᵒᵖ` -/ +@[expose] public section + open scoped TensorProduct variable (R S A B : Type*) diff --git a/Mathlib/LinearAlgebra/TensorProduct/Pi.lean b/Mathlib/LinearAlgebra/TensorProduct/Pi.lean index e30515c273fe83..209cee0cff91c8 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Pi.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.LinearAlgebra.Pi +module + +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.LinearAlgebra.Pi /-! @@ -26,6 +28,8 @@ See `Mathlib/LinearAlgebra/TensorProduct/Prod.lean` for binary products. -/ +@[expose] public section + variable (R : Type*) [CommSemiring R] variable (S : Type*) [CommSemiring S] [Algebra R S] variable (N : Type*) [AddCommMonoid N] [Module R N] [Module S N] [IsScalarTower R S N] diff --git a/Mathlib/LinearAlgebra/TensorProduct/Prod.lean b/Mathlib/LinearAlgebra/TensorProduct/Prod.lean index 80ea28ff29bee8..09ae19c0dfb30d 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Prod.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Prod -import Mathlib.LinearAlgebra.TensorProduct.Tower +module + +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.LinearAlgebra.TensorProduct.Tower /-! # Tensor products of products @@ -22,6 +24,8 @@ See `Mathlib/LinearAlgebra/TensorProduct/Pi.lean` for arbitrary products. -/ +@[expose] public section + variable (R S M₁ M₂ M₃ : Type*) namespace TensorProduct diff --git a/Mathlib/LinearAlgebra/TensorProduct/Quotient.lean b/Mathlib/LinearAlgebra/TensorProduct/Quotient.lean index 3b4c45883abe45..44d50a3d56658f 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Quotient.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Quotient.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, Jujian Zhang -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Quotient.Defs +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Quotient.Defs /-! @@ -34,6 +36,8 @@ Quotient, Tensor Product -/ +@[expose] public section + assert_not_exists Cardinal namespace TensorProduct diff --git a/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean b/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean index f1515d0695ce1d..d07168b508d3ac 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Algebra.Exact -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.TensorProduct.Maps +public import Mathlib.Algebra.Exact +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Right-exactness properties of tensor product @@ -84,6 +85,8 @@ to compute some kernels. -/ +@[expose] public section + assert_not_exists Cardinal section Modules diff --git a/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean b/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean index 9c0a7737e2b48f..5014444e17716d 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.LinearAlgebra.TensorProduct.Submodule -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.LinearAlgebra.TensorProduct.Submodule +public import Mathlib.RingTheory.TensorProduct.Maps /-! @@ -32,6 +34,8 @@ mainly used in the definition of linearly disjointness. -/ +@[expose] public section + open scoped TensorProduct open Module diff --git a/Mathlib/LinearAlgebra/TensorProduct/Submodule.lean b/Mathlib/LinearAlgebra/TensorProduct/Submodule.lean index a704399b70d763..74475de33b0cc3 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Submodule.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Submodule.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.LinearAlgebra.DirectSum.Finsupp +module + +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.LinearAlgebra.DirectSum.Finsupp /-! @@ -36,6 +38,8 @@ There are also `Submodule.mulLeftMap` and `Submodule.mulRightMap`, defined in ea -/ +@[expose] public section + open scoped TensorProduct noncomputable section diff --git a/Mathlib/LinearAlgebra/TensorProduct/Tower.lean b/Mathlib/LinearAlgebra/TensorProduct/Tower.lean index 8d662a3294dffb..fb4a64d50b4291 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Tower.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Tower.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin, Eric Wieser -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.LinearAlgebra.TensorProduct.Associator +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.LinearAlgebra.TensorProduct.Associator /-! # The `A`-module structure on `M ⊗[R] N` @@ -44,6 +46,8 @@ probably should still implement the less general ones as abbreviations to the mo fewer type arguments. -/ +@[expose] public section + namespace TensorProduct namespace AlgebraTensorModule @@ -639,10 +643,6 @@ lemma baseChange_mul (f g : Module.End R M) : variable (R A M N) -/-- `baseChange A e` for `e : M ≃ₗ[R] N` is the `A`-linear map `A ⊗[R] M ≃ₗ[A] A ⊗[R] N`. -/ -def _root_.LinearEquiv.baseChange (e : M ≃ₗ[R] N) : A ⊗[R] M ≃ₗ[A] A ⊗[R] N := - AlgebraTensorModule.congr (.refl _ _) e - /-- `baseChange` as a linear map. When `M = N`, this is true more strongly as `Module.End.baseChangeHom`. -/ @@ -661,6 +661,58 @@ lemma baseChange_pow (f : Module.End R M) (n : ℕ) : (f ^ n).baseChange A = f.baseChange A ^ n := map_pow (Module.End.baseChangeHom _ _ _) f n +/-- `baseChange A e` for `e : M ≃ₗ[R] N` is the `A`-linear map `A ⊗[R] M ≃ₗ[A] A ⊗[R] N`. -/ +def _root_.LinearEquiv.baseChange (e : M ≃ₗ[R] N) : A ⊗[R] M ≃ₗ[A] A ⊗[R] N := + AlgebraTensorModule.congr (.refl _ _) e + +@[simp] +theorem _root_.LinearEquiv.coe_baseChange (e : M ≃ₗ[R] N) : + (e.baseChange R A M N : (A ⊗[R] M →ₗ[A] A ⊗[R] N)) = e.toLinearMap.baseChange A := + rfl + +@[simp] +theorem _root_.LinearEquiv.baseChange_one : + (1 : M ≃ₗ[R] M).baseChange R A M M = 1 := by + ext x + simp [← LinearEquiv.coe_toLinearMap] + +theorem _root_.LinearEquiv.baseChange_trans (e : M ≃ₗ[R] N) (f : N ≃ₗ[R] P) : + (e.trans f).baseChange R A M P = (e.baseChange R A M N).trans (f.baseChange R A N P) := by + ext x + simp only [← LinearEquiv.coe_toLinearMap, LinearEquiv.coe_baseChange, LinearEquiv.trans_apply, + LinearEquiv.coe_trans, baseChange_eq_ltensor, lTensor_comp_apply] + +theorem _root_.LinearEquiv.baseChange_mul (e : M ≃ₗ[R] M) (f : M ≃ₗ[R] M) : + (e * f).baseChange R A M M = (e.baseChange R A M M) * (f.baseChange R A M M) := by + simp [LinearEquiv.mul_eq_trans, LinearEquiv.baseChange_trans] + +theorem _root_.LinearEquiv.baseChange_symm (e : M ≃ₗ[R] N) : + e.symm.baseChange R A N M = (e.baseChange R A M N).symm := by + ext x + rw [LinearEquiv.eq_symm_apply] + simp [← LinearEquiv.coe_toLinearMap, LinearEquiv.coe_baseChange, + baseChange_eq_ltensor, ← lTensor_comp_apply] + +theorem _root_.LinearEquiv.baseChange_inv (e : M ≃ₗ[R] M) : + (e⁻¹).baseChange R A M M = (e.baseChange R A M M)⁻¹ := + LinearEquiv.baseChange_symm R A M M e + +lemma _root_.LinearEquiv.baseChange_pow (f : M ≃ₗ[R] M) (n : ℕ) : + (f ^ n).baseChange R A M M = f.baseChange R A M M ^ n := by + induction n with + | zero => simp + | succ n h => + simp [pow_succ, LinearEquiv.baseChange_mul, h] + +lemma _root_.LinearEquiv.baseChange_zpow (f : M ≃ₗ[R] M) (n : ℤ) : + (f ^ n).baseChange R A M M = f.baseChange R A M M ^ n := by + induction n with + | zero => simp + | succ n h => + simp only [zpow_add_one, LinearEquiv.baseChange_mul, h] + | pred n h => + simp only [zpow_sub_one, LinearEquiv.baseChange_mul, h, LinearEquiv.baseChange_inv] + variable {R A M N} in theorem rTensor_baseChange (φ : A →ₐ[R] B) (t : A ⊗[R] M) (f : M →ₗ[R] N) : (φ.toLinearMap.rTensor N) (f.baseChange A t) = diff --git a/Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean b/Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean index bf781a719a9b11..6fc1cf2a6aec9b 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Mitchell Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Lee, Junyan Xu -/ -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.LinearAlgebra.TensorProduct.Finiteness -import Mathlib.LinearAlgebra.DirectSum.Finsupp +module + +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.LinearAlgebra.DirectSum.Finsupp /-! # Vanishing of elements in a tensor product of two modules @@ -54,6 +56,8 @@ is injective for every submodule $M' \subseteq M$. -/ +@[expose] public section + variable (R : Type*) [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] variable {N : Type*} [AddCommGroup N] [Module R N] diff --git a/Mathlib/LinearAlgebra/Trace.lean b/Mathlib/LinearAlgebra/Trace.lean index 884c90ff14b504..aca40a646958be 100644 --- a/Mathlib/LinearAlgebra/Trace.lean +++ b/Mathlib/LinearAlgebra/Trace.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Casper Putz, Anne Baanen, Antoine Labelle -/ -import Mathlib.LinearAlgebra.Contraction -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.RingTheory.Finiteness.Prod -import Mathlib.RingTheory.TensorProduct.Finite -import Mathlib.RingTheory.TensorProduct.Free +module + +public import Mathlib.LinearAlgebra.Contraction +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.RingTheory.Finiteness.Prod +public import Mathlib.RingTheory.TensorProduct.Finite +public import Mathlib.RingTheory.TensorProduct.Free /-! # Trace of a linear map @@ -21,6 +23,8 @@ See also `LinearAlgebra/Matrix/Trace.lean` for the trace of a matrix. linear_map, trace, diagonal -/ +@[expose] public section + noncomputable section universe u v w diff --git a/Mathlib/LinearAlgebra/Transvection.lean b/Mathlib/LinearAlgebra/Transvection.lean index 72f9ad51d4bf49..0f4370824b14df 100644 --- a/Mathlib/LinearAlgebra/Transvection.lean +++ b/Mathlib/LinearAlgebra/Transvection.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Dual.Defs +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Dual.Defs /-! # Transvections in a module @@ -18,6 +19,8 @@ import Mathlib.LinearAlgebra.Dual.Defs -/ +@[expose] public section + namespace LinearMap variable {R V : Type*} [CommSemiring R] [AddCommMonoid V] [Module R V] diff --git a/Mathlib/LinearAlgebra/UnitaryGroup.lean b/Mathlib/LinearAlgebra/UnitaryGroup.lean index c6042cda63108b..effaf24203fc47 100644 --- a/Mathlib/LinearAlgebra/UnitaryGroup.lean +++ b/Mathlib/LinearAlgebra/UnitaryGroup.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Shing Tak Lam. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shing Tak Lam -/ -import Mathlib.Algebra.Star.Unitary -import Mathlib.Data.Matrix.Reflection -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +module + +public import Mathlib.Algebra.Star.Unitary +public import Mathlib.Data.Matrix.Reflection +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse /-! # The Unitary Group @@ -38,6 +40,8 @@ matrix group, group, unitary group, orthogonal group -/ +@[expose] public section + universe u v diff --git a/Mathlib/LinearAlgebra/Vandermonde.lean b/Mathlib/LinearAlgebra/Vandermonde.lean index 2fdfc21bc794a1..a9b98fdcd98be2 100644 --- a/Mathlib/LinearAlgebra/Vandermonde.lean +++ b/Mathlib/LinearAlgebra/Vandermonde.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Peter Nelson -/ -import Mathlib.Data.Nat.Factorial.BigOperators -import Mathlib.Data.Nat.Factorial.SuperFactorial -import Mathlib.LinearAlgebra.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.Nondegenerate -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Polynomial.Pochhammer +module + +public import Mathlib.Data.Nat.Factorial.BigOperators +public import Mathlib.Data.Nat.Factorial.SuperFactorial +public import Mathlib.LinearAlgebra.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.Nondegenerate +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Polynomial.Pochhammer /-! # Vandermonde matrix @@ -59,6 +61,8 @@ stating the strictly more general form as `det_projVandermonde`. Characterize when `rectVandermonde v w n` has linearly independent rows. -/ +@[expose] public section + variable {R K : Type*} [CommRing R] [Field K] {n : ℕ} open Equiv Finset diff --git a/Mathlib/Logic/Basic.lean b/Mathlib/Logic/Basic.lean index 36c09d32033601..ebe5bb06c54fcf 100644 --- a/Mathlib/Logic/Basic.lean +++ b/Mathlib/Logic/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Tactic.Attr.Register -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.Basic -import Batteries.Logic -import Batteries.Tactic.Trans -import Batteries.Util.LibraryNote -import Mathlib.Data.Nat.Notation -import Mathlib.Data.Int.Notation +module + +public import Mathlib.Tactic.Attr.Register +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.Basic +public import Batteries.Logic +public import Batteries.Tactic.Trans +public import Batteries.Util.LibraryNote +public import Mathlib.Data.Nat.Notation +public import Mathlib.Data.Int.Notation /-! # Basic logic properties @@ -23,6 +25,8 @@ Theorems that require decidability hypotheses are in the namespace `Decidable`. Classical versions are in the namespace `Classical`. -/ +@[expose] public section + open Function section Miscellany diff --git a/Mathlib/Logic/Denumerable.lean b/Mathlib/Logic/Denumerable.lean index 4dfb346f3accfb..8e31d8f5680189 100644 --- a/Mathlib/Logic/Denumerable.lean +++ b/Mathlib/Logic/Denumerable.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.List.MinMax -import Mathlib.Data.Nat.Order.Lemmas -import Mathlib.Logic.Encodable.Basic +module + +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.List.MinMax +public import Mathlib.Data.Nat.Order.Lemmas +public import Mathlib.Logic.Encodable.Basic /-! # Denumerable types @@ -21,6 +23,8 @@ This property already has a name, namely `α ≃ ℕ`, but here we are intereste typeclass. -/ +@[expose] public section + assert_not_exists Monoid variable {α β : Type*} diff --git a/Mathlib/Logic/Embedding/Basic.lean b/Mathlib/Logic/Embedding/Basic.lean index 2fb4637180ef1a..fadf89f5c657d4 100644 --- a/Mathlib/Logic/Embedding/Basic.lean +++ b/Mathlib/Logic/Embedding/Basic.lean @@ -3,16 +3,20 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Option.Basic -import Mathlib.Data.Prod.Basic -import Mathlib.Data.Prod.PProd -import Mathlib.Data.Sum.Basic -import Mathlib.Logic.Equiv.Basic +module + +public import Mathlib.Data.Option.Basic +public import Mathlib.Data.Prod.Basic +public import Mathlib.Data.Prod.PProd +public import Mathlib.Data.Sum.Basic +public import Mathlib.Logic.Equiv.Basic /-! # Injective functions -/ +@[expose] public section + universe u v w x namespace Function diff --git a/Mathlib/Logic/Embedding/Set.lean b/Mathlib/Logic/Embedding/Set.lean index c5f13254a972ec..1eb4b2947b9212 100644 --- a/Mathlib/Logic/Embedding/Set.lean +++ b/Mathlib/Logic/Embedding/Set.lean @@ -3,17 +3,21 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Set.Notation -import Mathlib.Order.SetNotation -import Mathlib.Logic.Embedding.Basic -import Mathlib.Logic.Pairwise -import Mathlib.Data.Set.Image +module + +public import Mathlib.Data.Set.Notation +public import Mathlib.Order.SetNotation +public import Mathlib.Logic.Embedding.Basic +public import Mathlib.Logic.Pairwise +public import Mathlib.Data.Set.Image /-! # Interactions between embeddings and sets. -/ +@[expose] public section + assert_not_exists WithTop universe u v w x diff --git a/Mathlib/Logic/Encodable/Basic.lean b/Mathlib/Logic/Encodable/Basic.lean index 1447317576d7ce..6842d2b07490ec 100644 --- a/Mathlib/Logic/Encodable/Basic.lean +++ b/Mathlib/Logic/Encodable/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Data.Countable.Defs -import Mathlib.Data.Fin.Basic -import Mathlib.Data.Nat.Find -import Mathlib.Data.PNat.Equiv -import Mathlib.Logic.Equiv.Nat -import Mathlib.Order.Directed -import Mathlib.Order.RelIso.Basic +module + +public import Mathlib.Data.Countable.Defs +public import Mathlib.Data.Fin.Basic +public import Mathlib.Data.Nat.Find +public import Mathlib.Data.PNat.Equiv +public import Mathlib.Logic.Equiv.Nat +public import Mathlib.Order.Directed +public import Mathlib.Order.RelIso.Basic /-! # Encodable types @@ -35,6 +37,8 @@ The point of asking for an explicit partial inverse `decode : ℕ → Option α` to make the range of `encode` decidable even when the finiteness of `α` is not. -/ +@[expose] public section + assert_not_exists Monoid open Option List Nat Function diff --git a/Mathlib/Logic/Encodable/Lattice.lean b/Mathlib/Logic/Encodable/Lattice.lean index c9a60ce46df7c3..23b7116813a55e 100644 --- a/Mathlib/Logic/Encodable/Lattice.lean +++ b/Mathlib/Logic/Encodable/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Logic.Encodable.Basic -import Mathlib.Logic.Pairwise -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.Logic.Encodable.Basic +public import Mathlib.Logic.Pairwise +public import Mathlib.Data.Set.Subsingleton /-! # Lattice operations on encodable types @@ -19,6 +21,8 @@ This is a separate file, to avoid unnecessary imports in basic files. Previously some of these results were in the `MeasureTheory` folder. -/ +@[expose] public section + open Set namespace Encodable diff --git a/Mathlib/Logic/Encodable/Pi.lean b/Mathlib/Logic/Encodable/Pi.lean index 5cada1241621a3..5ddd2e15cb265d 100644 --- a/Mathlib/Logic/Encodable/Pi.lean +++ b/Mathlib/Logic/Encodable/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Vector.Basic -import Mathlib.Logic.Equiv.Finset +module + +public import Mathlib.Data.Vector.Basic +public import Mathlib.Logic.Equiv.Finset /-! # Encodability of Pi types @@ -17,6 +19,8 @@ This file provides instances of `Encodable` for types of vectors and (dependent) finite domain and countable codomain are encodable -/ +@[expose] public section + open List (Vector) open Nat List diff --git a/Mathlib/Logic/Equiv/Array.lean b/Mathlib/Logic/Equiv/Array.lean index 51c7c80c65eddb..71c1d5ad30de9e 100644 --- a/Mathlib/Logic/Equiv/Array.lean +++ b/Mathlib/Logic/Equiv/Array.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Vector.Basic -import Mathlib.Logic.Equiv.List +module + +public import Mathlib.Data.Vector.Basic +public import Mathlib.Logic.Equiv.List /-! # Equivalences involving `Array` -/ +@[expose] public section + namespace Equiv diff --git a/Mathlib/Logic/Equiv/Basic.lean b/Mathlib/Logic/Equiv/Basic.lean index 5af3ad9da659bd..d0048f51e2a7ae 100644 --- a/Mathlib/Logic/Equiv/Basic.lean +++ b/Mathlib/Logic/Equiv/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Logic.Equiv.Option -import Mathlib.Logic.Equiv.Sum -import Mathlib.Logic.Function.Conjugate -import Mathlib.Tactic.Lift +module + +public import Mathlib.Logic.Equiv.Option +public import Mathlib.Logic.Equiv.Sum +public import Mathlib.Logic.Function.Conjugate +public import Mathlib.Tactic.Lift /-! # Equivalence between types @@ -23,6 +25,8 @@ E.g., `Mathlib/Algebra/Equiv/TransferInstance.lean` does it for many algebraic t equivalence, congruence, bijective map -/ +@[expose] public section + universe u v w z open Function @@ -84,13 +88,8 @@ theorem Perm.subtypeCongr.refl : by_cases h : p x <;> simp [h] @[simp] -theorem Perm.subtypeCongr.symm : (ep.subtypeCongr en).symm = Perm.subtypeCongr ep.symm en.symm := by - ext x - by_cases h : p x - · have : p (ep.symm ⟨x, h⟩) := Subtype.property _ - simp [h, symm_apply_eq, this] - · have : ¬p (en.symm ⟨x, h⟩) := Subtype.property (en.symm _) - simp [h, symm_apply_eq, this] +theorem Perm.subtypeCongr.symm : (ep.subtypeCongr en).symm = Perm.subtypeCongr ep.symm en.symm := + rfl @[simp] theorem Perm.subtypeCongr.trans : diff --git a/Mathlib/Logic/Equiv/Bool.lean b/Mathlib/Logic/Equiv/Bool.lean index 99c6c98c4a302c..ed5ce83ab65afb 100644 --- a/Mathlib/Logic/Equiv/Bool.lean +++ b/Mathlib/Logic/Equiv/Bool.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Emily Riehl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Emily Riehl, Wrenna Robson -/ -import Mathlib.Logic.Equiv.Basic -import Mathlib.Logic.Function.Basic +module + +public import Mathlib.Logic.Equiv.Basic +public import Mathlib.Logic.Function.Basic /-! # Equivalences involving `Bool` @@ -12,6 +14,8 @@ import Mathlib.Logic.Function.Basic This file shows that `not : Bool → Bool` is an equivalence and derives some consequences -/ +@[expose] public section + /-- The boolean negation function `not : Bool → Bool` is an involution and thus an equivalence. -/ @[simps!] def Equiv.boolNot : Equiv.Perm Bool := Bool.involutive_not.toPerm diff --git a/Mathlib/Logic/Equiv/Defs.lean b/Mathlib/Logic/Equiv/Defs.lean index 256cda9e3f06b5..a348840159b37c 100644 --- a/Mathlib/Logic/Equiv/Defs.lean +++ b/Mathlib/Logic/Equiv/Defs.lean @@ -3,13 +3,15 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Data.FunLike.Equiv -import Mathlib.Data.Quot -import Mathlib.Data.Subtype -import Mathlib.Logic.Unique -import Mathlib.Tactic.Conv -import Mathlib.Tactic.Simps.Basic -import Mathlib.Tactic.Substs +module + +public import Mathlib.Data.FunLike.Equiv +public import Mathlib.Data.Quot +public import Mathlib.Data.Subtype +public import Mathlib.Logic.Unique +public import Mathlib.Tactic.Conv +public import Mathlib.Tactic.Simps.Basic +public import Mathlib.Tactic.Substs /-! # Equivalence between types @@ -53,6 +55,8 @@ Many more such isomorphisms and operations are defined in `Mathlib/Logic/Equiv/B equivalence, congruence, bijective map -/ +@[expose] public section + open Function universe u v w z diff --git a/Mathlib/Logic/Equiv/Embedding.lean b/Mathlib/Logic/Equiv/Embedding.lean index 2b0050e224ec62..0567b1ccbfbf6b 100644 --- a/Mathlib/Logic/Equiv/Embedding.lean +++ b/Mathlib/Logic/Equiv/Embedding.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Logic.Embedding.Set +module + +public import Mathlib.Logic.Embedding.Set /-! # Equivalences on embeddings @@ -12,6 +14,8 @@ This file shows some advanced equivalences on embeddings, useful for constructin embeddings from smaller ones. -/ +@[expose] public section + open Function.Embedding diff --git a/Mathlib/Logic/Equiv/Fin/Basic.lean b/Mathlib/Logic/Equiv/Fin/Basic.lean index 8f7a01d1390e69..6c83e1012a6265 100644 --- a/Mathlib/Logic/Equiv/Fin/Basic.lean +++ b/Mathlib/Logic/Equiv/Fin/Basic.lean @@ -3,16 +3,20 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Data.Fin.VecNotation -import Mathlib.Logic.Embedding.Set -import Mathlib.Logic.Equiv.Option -import Mathlib.Data.Int.Init -import Batteries.Data.Fin.Lemmas +module + +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Logic.Embedding.Set +public import Mathlib.Logic.Equiv.Option +public import Mathlib.Data.Int.Init +public import Batteries.Data.Fin.Lemmas /-! # Equivalences for `Fin n` -/ +@[expose] public section + assert_not_exists MonoidWithZero universe u diff --git a/Mathlib/Logic/Equiv/Fin/Rotate.lean b/Mathlib/Logic/Equiv/Fin/Rotate.lean index a790b2b8204c58..77764a69a518d2 100644 --- a/Mathlib/Logic/Equiv/Fin/Rotate.lean +++ b/Mathlib/Logic/Equiv/Fin/Rotate.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Lawrence Wu, Jeremy Tan -/ -import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.Logic.Equiv.Fin.Basic +module + +public import Mathlib.Algebra.Group.Fin.Basic +public import Mathlib.Logic.Equiv.Fin.Basic /-! # Cyclic permutations on `Fin n` @@ -15,6 +17,8 @@ This file defines and proves various lemmas about them. -/ +@[expose] public section + open Nat variable {n : ℕ} diff --git a/Mathlib/Logic/Equiv/Finset.lean b/Mathlib/Logic/Equiv/Finset.lean index caad4cab1874c3..685ef1a6d5bc89 100644 --- a/Mathlib/Logic/Equiv/Finset.lean +++ b/Mathlib/Logic/Equiv/Finset.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Sort -import Mathlib.Logic.Equiv.Multiset +module + +public import Mathlib.Data.Finset.Sort +public import Mathlib.Logic.Equiv.Multiset /-! # `Encodable` and `Denumerable` instances for `Finset` -/ +@[expose] public section + variable {α} open Encodable diff --git a/Mathlib/Logic/Equiv/Fintype.lean b/Mathlib/Logic/Equiv/Fintype.lean index bf83781a3ddff4..0d34524602e294 100644 --- a/Mathlib/Logic/Equiv/Fintype.lean +++ b/Mathlib/Logic/Equiv/Fintype.lean @@ -3,27 +3,31 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.Fintype.EquivFin -import Mathlib.Data.Fintype.Inv +module + +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Data.Fintype.Inv /-! # Equivalence between fintypes This file contains some basic results on equivalences where one or both sides of the equivalence are `Fintype`s. -# Main definitions +## Main definitions - `Function.Embedding.toEquivRange`: computably turn an embedding of a fintype into an `Equiv` of the domain to its range - `Equiv.Perm.viaFintypeEmbedding : Perm α → (α ↪ β) → Perm β` extends the domain of a permutation, fixing everything outside the range of the embedding -# Implementation details +## Implementation details - `Function.Embedding.toEquivRange` uses a computable inverse, but one that has poor computational performance, since it operates by exhaustive search over the input `Fintype`s. -/ +@[expose] public section + assert_not_exists Equiv.Perm.sign section Fintype diff --git a/Mathlib/Logic/Equiv/Functor.lean b/Mathlib/Logic/Equiv/Functor.lean index 203a282c37bf9c..2cff04d9fc2f36 100644 --- a/Mathlib/Logic/Equiv/Functor.lean +++ b/Mathlib/Logic/Equiv/Functor.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Simon Hudon, Kim Morrison -/ -import Mathlib.Control.Bifunctor -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Control.Bifunctor +public import Mathlib.Logic.Equiv.Defs /-! # Functor and bifunctors can be applied to `Equiv`s. @@ -21,6 +23,8 @@ def Bifunctor.mapEquiv (F : Type u → Type v → Type w) [Bifunctor F] [LawfulB ``` -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Logic/Equiv/List.lean b/Mathlib/Logic/Equiv/List.lean index cff63b423bc1ae..d3233fa415be9a 100644 --- a/Mathlib/Logic/Equiv/List.lean +++ b/Mathlib/Logic/Equiv/List.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Logic.Denumerable +module + +public import Mathlib.Logic.Denumerable /-! # Equivalences involving `List`-like types @@ -12,6 +14,8 @@ This file defines some additional constructive equivalences using `Encodable` an function on `ℕ`. -/ +@[expose] public section + assert_not_exists Monoid Multiset.sort open List diff --git a/Mathlib/Logic/Equiv/Multiset.lean b/Mathlib/Logic/Equiv/Multiset.lean index 5151b46a3d0088..7cc95b76538c75 100644 --- a/Mathlib/Logic/Equiv/Multiset.lean +++ b/Mathlib/Logic/Equiv/Multiset.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Multiset.Sort -import Mathlib.Logic.Equiv.List +module + +public import Mathlib.Data.Multiset.Sort +public import Mathlib.Logic.Equiv.List /-! # `Encodable` and `Denumerable` instances for `Multiset` -/ +@[expose] public section + variable {α : Type*} open Encodable diff --git a/Mathlib/Logic/Equiv/Nat.lean b/Mathlib/Logic/Equiv/Nat.lean index e43150e92c5d8c..74868d45a1a01a 100644 --- a/Mathlib/Logic/Equiv/Nat.lean +++ b/Mathlib/Logic/Equiv/Nat.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.Bits -import Mathlib.Data.Nat.Pairing +module + +public import Mathlib.Data.Nat.Bits +public import Mathlib.Data.Nat.Pairing /-! # Equivalences involving `ℕ` @@ -13,6 +15,8 @@ This file defines some additional constructive equivalences using `Encodable` an function on `ℕ`. -/ +@[expose] public section + assert_not_exists Monoid open Nat Function diff --git a/Mathlib/Logic/Equiv/Option.lean b/Mathlib/Logic/Equiv/Option.lean index 19178ed643d366..7da0084a1b0c6f 100644 --- a/Mathlib/Logic/Equiv/Option.lean +++ b/Mathlib/Logic/Equiv/Option.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Control.EquivFunctor -import Mathlib.Data.Option.Basic -import Mathlib.Data.Subtype -import Mathlib.Logic.Equiv.Defs +module + +public import Mathlib.Control.EquivFunctor +public import Mathlib.Data.Option.Basic +public import Mathlib.Data.Subtype +public import Mathlib.Logic.Equiv.Defs /-! # Equivalences for `Option α` @@ -19,6 +21,8 @@ We define both sides. -/ +@[expose] public section + universe u namespace Equiv diff --git a/Mathlib/Logic/Equiv/Pairwise.lean b/Mathlib/Logic/Equiv/Pairwise.lean index ebf8a8f6c48539..40ca40d5e7347d 100644 --- a/Mathlib/Logic/Equiv/Pairwise.lean +++ b/Mathlib/Logic/Equiv/Pairwise.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ -import Mathlib.Data.FunLike.Equiv -import Mathlib.Logic.Pairwise +module + +public import Mathlib.Data.FunLike.Equiv +public import Mathlib.Logic.Pairwise /-! # Interaction of equivalences with `Pairwise` -/ +@[expose] public section + open scoped Function -- required for scoped `on` notation lemma EmbeddingLike.pairwise_comp {X : Type*} {Y : Type*} {F} [FunLike F Y X] [EmbeddingLike F Y X] diff --git a/Mathlib/Logic/Equiv/PartialEquiv.lean b/Mathlib/Logic/Equiv/PartialEquiv.lean index 30a5deff8c4197..12c3027303d0e4 100644 --- a/Mathlib/Logic/Equiv/PartialEquiv.lean +++ b/Mathlib/Logic/Equiv/PartialEquiv.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Set.Piecewise -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Core -import Mathlib.Tactic.Attr.Core +module + +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Core +public import Mathlib.Tactic.Attr.Core /-! # Partial equivalences @@ -66,6 +68,8 @@ If a lemma deals with the intersection of a set with either source or target of then it should use `e.source ∩ s` or `e.target ∩ t`, not `s ∩ e.source` or `t ∩ e.target`. -/ + +@[expose] public section open Lean Meta Elab Tactic /-! Implementation of the `mfld_set_tac` tactic for working with the domains of partially-defined @@ -77,7 +81,7 @@ new file to become functional. /-- Common `@[simps]` configuration options used for manifold-related declarations. -/ @[deprecated "Use `@[simps (attr := mfld_simps) -fullyApplied]` instead" (since := "2025-09-23")] -def mfld_cfg : Simps.Config where +meta def mfld_cfg : Simps.Config where fullyApplied := false namespace Tactic.MfldSetTac diff --git a/Mathlib/Logic/Equiv/Prod.lean b/Mathlib/Logic/Equiv/Prod.lean index 73651e6e50d945..60e71194fd7e63 100644 --- a/Mathlib/Logic/Equiv/Prod.lean +++ b/Mathlib/Logic/Equiv/Prod.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Contrapose -import Mathlib.Data.Prod.PProd +module + +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Contrapose +public import Mathlib.Data.Prod.PProd /-! # Equivalence between product types @@ -23,6 +25,8 @@ focusing on product types. equivalence, congruence, bijective map -/ +@[expose] public section + open Function universe u diff --git a/Mathlib/Logic/Equiv/Set.lean b/Mathlib/Logic/Equiv/Set.lean index a3deb23263f812..c216b81459d70a 100644 --- a/Mathlib/Logic/Equiv/Set.lean +++ b/Mathlib/Logic/Equiv/Set.lean @@ -3,9 +3,11 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Data.Set.Function -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Says +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Says /-! # Equivalences and sets @@ -22,6 +24,8 @@ This file is separate from `Equiv/Basic` such that we do not require the full la on sets before defining what an equivalence is. -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Logic/Equiv/Sum.lean b/Mathlib/Logic/Equiv/Sum.lean index 4a00c74b4e814e..631588b321532f 100644 --- a/Mathlib/Logic/Equiv/Sum.lean +++ b/Mathlib/Logic/Equiv/Sum.lean @@ -3,10 +3,12 @@ Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ -import Mathlib.Data.Option.Defs -import Mathlib.Data.Sigma.Basic -import Mathlib.Logic.Equiv.Prod -import Mathlib.Tactic.Coe +module + +public import Mathlib.Data.Option.Defs +public import Mathlib.Data.Sigma.Basic +public import Mathlib.Logic.Equiv.Prod +public import Mathlib.Tactic.Coe /-! # Equivalence between sum types @@ -30,6 +32,8 @@ E.g., `Mathlib/Algebra/Equiv/TransferInstance.lean` does it for many algebraic t equivalence, congruence, bijective map -/ +@[expose] public section + universe u v w z open Function diff --git a/Mathlib/Logic/ExistsUnique.lean b/Mathlib/Logic/ExistsUnique.lean index 94b415b6d0f6fc..ed9a74c9c94021 100644 --- a/Mathlib/Logic/ExistsUnique.lean +++ b/Mathlib/Logic/ExistsUnique.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Floris van Doorn -/ -import Mathlib.Tactic.TypeStar -import Batteries.Tactic.Alias +module + +public import Mathlib.Tactic.TypeStar +public import Batteries.Tactic.Alias /-! # `ExistsUnique` @@ -13,6 +15,8 @@ This file defines the `ExistsUnique` predicate, notated as `∃!`, and proves so basic properties. -/ +@[expose] public section + variable {α : Sort*} /-- For `p : α → Prop`, `ExistsUnique p` means that there exists a unique `x : α` with `p x`. -/ @@ -22,7 +26,7 @@ namespace Mathlib.Notation open Lean /-- Checks to see that `xs` has only one binder. -/ -def isExplicitBinderSingular (xs : TSyntax ``explicitBinders) : Bool := +meta def isExplicitBinderSingular (xs : TSyntax ``explicitBinders) : Bool := match xs with | `(explicitBinders| $_:binderIdent $[: $_]?) => true | `(explicitBinders| ($_:binderIdent : $_)) => true @@ -52,7 +56,7 @@ macro "∃!" xs:explicitBinders ", " b:term : term => do Pretty-printing for `ExistsUnique`, following the same pattern as pretty printing for `Exists`. However, it does *not* merge binders. -/ -@[app_unexpander ExistsUnique] def unexpandExistsUnique : Lean.PrettyPrinter.Unexpander +@[app_unexpander ExistsUnique] meta def unexpandExistsUnique : Lean.PrettyPrinter.Unexpander | `($(_) fun $x:ident ↦ $b) => `(∃! $x:ident, $b) | `($(_) fun ($x:ident : $t) ↦ $b) => `(∃! $x:ident : $t, $b) | _ => throw () diff --git a/Mathlib/Logic/Function/Basic.lean b/Mathlib/Logic/Function/Basic.lean index 25e6501a52bc7e..519ceaa8d2e931 100644 --- a/Mathlib/Logic/Function/Basic.lean +++ b/Mathlib/Logic/Function/Basic.lean @@ -3,19 +3,23 @@ Copyright (c) 2016 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Set.Defs -import Mathlib.Logic.Basic -import Mathlib.Logic.Function.Defs -import Mathlib.Logic.ExistsUnique -import Mathlib.Logic.Nonempty -import Mathlib.Logic.Nontrivial.Defs -import Batteries.Tactic.Init -import Mathlib.Order.Defs.Unbundled +module + +public import Mathlib.Data.Set.Defs +public import Mathlib.Logic.Basic +public import Mathlib.Logic.Function.Defs +public import Mathlib.Logic.ExistsUnique +public import Mathlib.Logic.Nonempty +public import Mathlib.Logic.Nontrivial.Defs +public import Batteries.Tactic.Init +public import Mathlib.Order.Defs.Unbundled /-! # Miscellaneous function constructions and lemmas -/ +@[expose] public section + open Function universe u v w x diff --git a/Mathlib/Logic/Function/Coequalizer.lean b/Mathlib/Logic/Function/Coequalizer.lean index 0747e17ded4ba8..59f3cbf5d68993 100644 --- a/Mathlib/Logic/Function/Coequalizer.lean +++ b/Mathlib/Logic/Function/Coequalizer.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.Lemma +module + +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.Lemma /-! # Coequalizer of a pair of functions @@ -16,6 +18,8 @@ with `u ∘ f = u ∘ g` factors uniquely via `p`. In this file we define the coequalizer and provide the basic API. -/ +@[expose] public section + universe v namespace Function diff --git a/Mathlib/Logic/Function/CompTypeclasses.lean b/Mathlib/Logic/Function/CompTypeclasses.lean index be17989d826fd9..60312af71233ef 100644 --- a/Mathlib/Logic/Function/CompTypeclasses.lean +++ b/Mathlib/Logic/Function/CompTypeclasses.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.Lemma +module + +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.Lemma /-! # Propositional typeclasses on several maps @@ -21,6 +23,8 @@ TODO : -/ +@[expose] public section + section CompTriple /-- Class of composing triples -/ @@ -47,7 +51,7 @@ instance instId_comp {M N : Type*} {φ : M → N} {ψ : N → N} [IsId ψ] : CompTriple φ ψ φ where comp_eq := by simp only [IsId.eq_id, Function.id_comp] -/-- `φ`, `ψ` and `ψ ∘ φ` for` a `CompTriple` -/ +/-- `φ`, `ψ` and `ψ ∘ φ` for a `CompTriple`. -/ theorem comp {M N P : Type*} {φ : M → N} {ψ : N → P} : CompTriple φ ψ (ψ.comp φ) where diff --git a/Mathlib/Logic/Function/Conjugate.lean b/Mathlib/Logic/Function/Conjugate.lean index 69098eb142cbfc..14029c1b2b1306 100644 --- a/Mathlib/Logic/Function/Conjugate.lean +++ b/Mathlib/Logic/Function/Conjugate.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Logic.Function.Basic +module + +public import Mathlib.Logic.Function.Basic /-! # Semiconjugate and commuting maps @@ -17,6 +19,8 @@ We define the following predicates: or equivalently `Semiconj f g g`. -/ +@[expose] public section + namespace Function variable {α : Type*} {β : Type*} {γ : Type*} diff --git a/Mathlib/Logic/Function/Defs.lean b/Mathlib/Logic/Function/Defs.lean index 7fa919bb9f5358..b0ed8482b30998 100644 --- a/Mathlib/Logic/Function/Defs.lean +++ b/Mathlib/Logic/Function/Defs.lean @@ -3,16 +3,20 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Haitao Zhang -/ -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.Attr.Register -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.Eqns -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.Attr.Register +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.Eqns +public import Mathlib.Tactic.TypeStar /-! # General operations on functions -/ +@[expose] public section + universe u₁ u₂ u₃ u₄ u₅ namespace Function diff --git a/Mathlib/Logic/Function/DependsOn.lean b/Mathlib/Logic/Function/DependsOn.lean index 584f36275dffa6..bfe4b672e22756 100644 --- a/Mathlib/Logic/Function/DependsOn.lean +++ b/Mathlib/Logic/Function/DependsOn.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Data.Set.Restrict +module + +public import Mathlib.Data.Set.Restrict /-! # Functions depending only on some variables @@ -46,6 +48,8 @@ with `DependsOn` because writing mathematically "independent of variables in `s` depends on -/ +@[expose] public section + open Function Set variable {ι : Type*} {α : ι → Type*} {β : Type*} diff --git a/Mathlib/Logic/Function/FiberPartition.lean b/Mathlib/Logic/Function/FiberPartition.lean index 98ae048056e254..e52d0455afe115 100644 --- a/Mathlib/Logic/Function/FiberPartition.lean +++ b/Mathlib/Logic/Function/FiberPartition.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ -import Mathlib.Data.Set.Insert +module + +public import Mathlib.Data.Set.Insert /-! This file defines the type `f.Fiber` of fibers of a function `f : Y → Z`, and provides some API @@ -15,6 +17,8 @@ set, and the forgetful functor from the category of condensed sets to the catego (see PR https://github.com/leanprover-community/mathlib4/pull/14027). -/ +@[expose] public section + assert_not_exists RelIso variable {X Y Z : Type*} diff --git a/Mathlib/Logic/Function/FromTypes.lean b/Mathlib/Logic/Function/FromTypes.lean index 3c44aa068ea8bb..ade3a6089b05d2 100644 --- a/Mathlib/Logic/Function/FromTypes.lean +++ b/Mathlib/Logic/Function/FromTypes.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Brendan Murphy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Brendan Murphy -/ +module -import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.Fin.VecNotation /-! # Function types of a given heterogeneous arity @@ -16,6 +17,8 @@ Note that it is often preferable to use `((i : Fin n) → p i) → τ` in place * `Function.FromTypes p τ`: `n`-ary function `p 0 → p 1 → ... → p (n - 1) → β`. -/ +@[expose] public section + universe u namespace Function diff --git a/Mathlib/Logic/Function/Iterate.lean b/Mathlib/Logic/Function/Iterate.lean index a1b0b5a53e1fd6..754a3e5eaf9fd0 100644 --- a/Mathlib/Logic/Function/Iterate.lean +++ b/Mathlib/Logic/Function/Iterate.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Logic.Function.Conjugate +module + +public import Mathlib.Logic.Function.Conjugate /-! # Iterations of a function @@ -27,6 +29,8 @@ In this file we prove simple properties of `Nat.iterate f n` a.k.a. `f^[n]`: -/ +@[expose] public section + universe u v diff --git a/Mathlib/Logic/Function/OfArity.lean b/Mathlib/Logic/Function/OfArity.lean index c94299823f3a8e..380549f27498cd 100644 --- a/Mathlib/Logic/Function/OfArity.lean +++ b/Mathlib/Logic/Function/OfArity.lean @@ -3,8 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ +module -import Mathlib.Logic.Function.FromTypes +public import Mathlib.Logic.Function.FromTypes /-! # Function types of a given arity @@ -17,6 +18,8 @@ Note that it is often preferable to use `(Fin n → α) → β` in place of `OfA * `Function.OfArity.const α b n`: `n`-ary constant function equal to `b`. -/ +@[expose] public section + universe u namespace Function diff --git a/Mathlib/Logic/Function/ULift.lean b/Mathlib/Logic/Function/ULift.lean index a2d124bc67550d..5a372787951325 100644 --- a/Mathlib/Logic/Function/ULift.lean +++ b/Mathlib/Logic/Function/ULift.lean @@ -3,12 +3,16 @@ Copyright (c) 2016 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Tactic.TypeStar /-! # `ULift` and `PLift` -/ +@[expose] public section + theorem ULift.down_injective {α : Type*} : Function.Injective (@ULift.down α) | ⟨a⟩, ⟨b⟩, _ => by congr diff --git a/Mathlib/Logic/Godel/GodelBetaFunction.lean b/Mathlib/Logic/Godel/GodelBetaFunction.lean index 4081b6b51c1c75..41fb15c08d01e5 100644 --- a/Mathlib/Logic/Godel/GodelBetaFunction.lean +++ b/Mathlib/Logic/Godel/GodelBetaFunction.lean @@ -3,15 +3,16 @@ Copyright (c) 2023 Shogo Saito. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shogo Saito. Adapted for mathlib by Hunter Monroe -/ +module -import Mathlib.Data.Nat.ModEq -import Mathlib.Data.Nat.ChineseRemainder -import Mathlib.Data.Nat.Prime.Defs -import Mathlib.Data.Nat.Pairing -import Mathlib.Order.Fin.Basic -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Nat.ChineseRemainder +public import Mathlib.Data.Nat.Prime.Defs +public import Mathlib.Data.Nat.Pairing +public import Mathlib.Order.Fin.Basic +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Nat.Factorial.Basic /-! # Gödel's Beta Function Lemma @@ -44,6 +45,8 @@ and other key results from the repository https://github.com/iehality/lean4-logi Gödel, beta function -/ +@[expose] public section + namespace Nat lemma coprime_mul_succ {n m a} (ha : m - n ∣ a) : Coprime (n * a + 1) (m * a + 1) := diff --git a/Mathlib/Logic/Hydra.lean b/Mathlib/Logic/Hydra.lean index af39cb0207f1b1..78a9d00324c329 100644 --- a/Mathlib/Logic/Hydra.lean +++ b/Mathlib/Logic/Hydra.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Data.Finsupp.Lex -import Mathlib.Data.Finsupp.Multiset -import Mathlib.Order.GameAdd +module + +public import Mathlib.Data.Finsupp.Lex +public import Mathlib.Data.Finsupp.Multiset +public import Mathlib.Order.GameAdd /-! # Termination of a hydra game @@ -30,6 +32,8 @@ TODO: formalize the relations corresponding to more powerful (e.g. Kirby–Paris hydras, and prove their well-foundedness. -/ +@[expose] public section + namespace Relation diff --git a/Mathlib/Logic/IsEmpty.lean b/Mathlib/Logic/IsEmpty.lean index 9510784242bb92..aca46e6c8ad621 100644 --- a/Mathlib/Logic/IsEmpty.lean +++ b/Mathlib/Logic/IsEmpty.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Logic.Function.Basic -import Mathlib.Logic.Relator +module + +public import Mathlib.Logic.Function.Basic +public import Mathlib.Logic.Relator /-! # Types that are empty @@ -16,6 +18,8 @@ In this file we define a typeclass `IsEmpty`, which expresses that a type has no * `IsEmpty`: a typeclass that expresses that a type is empty. -/ +@[expose] public section + variable {α β γ : Sort*} /-- `IsEmpty α` expresses that `α` is empty. -/ diff --git a/Mathlib/Logic/Lemmas.lean b/Mathlib/Logic/Lemmas.lean index 3e92a9dc21060f..6d342f041859d9 100644 --- a/Mathlib/Logic/Lemmas.lean +++ b/Mathlib/Logic/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Logic.Basic -import Mathlib.Tactic.Convert -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.Tauto +module + +public import Mathlib.Logic.Basic +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.SplitIfs +public import Mathlib.Tactic.Tauto /-! # More basic logic properties @@ -18,6 +20,8 @@ We spell those lemmas out with `dite` and `ite` rather than the `if then else` n would result in less delta-reduced statements. -/ +@[expose] public section + theorem iff_assoc {a b c : Prop} : ((a ↔ b) ↔ c) ↔ (a ↔ (b ↔ c)) := by tauto theorem iff_left_comm {a b c : Prop} : (a ↔ (b ↔ c)) ↔ (b ↔ (a ↔ c)) := by tauto theorem iff_right_comm {a b c : Prop} : ((a ↔ b) ↔ c) ↔ ((a ↔ c) ↔ b) := by tauto diff --git a/Mathlib/Logic/Nonempty.lean b/Mathlib/Logic/Nonempty.lean index f708e1d549c4db..85e3e5bf98a2dc 100644 --- a/Mathlib/Logic/Nonempty.lean +++ b/Mathlib/Logic/Nonempty.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Tactic.TypeStar /-! # Nonempty types @@ -16,6 +18,8 @@ This file proves a few extra facts about `Nonempty`, which is defined in core Le instance. -/ +@[expose] public section + section variable {α β : Sort*} diff --git a/Mathlib/Logic/Nontrivial/Basic.lean b/Mathlib/Logic/Nontrivial/Basic.lean index 797f06f5730b86..bf5c45e7c07534 100644 --- a/Mathlib/Logic/Nontrivial/Basic.lean +++ b/Mathlib/Logic/Nontrivial/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Prod.Basic -import Mathlib.Logic.Function.Basic -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Logic.Unique -import Mathlib.Order.Defs.LinearOrder -import Mathlib.Tactic.Attr.Register +module + +public import Mathlib.Data.Prod.Basic +public import Mathlib.Logic.Function.Basic +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Logic.Unique +public import Mathlib.Order.Defs.LinearOrder +public import Mathlib.Tactic.Attr.Register /-! # Nontrivial types @@ -16,6 +18,8 @@ import Mathlib.Tactic.Attr.Register Results about `Nontrivial`. -/ +@[expose] public section + variable {α : Type*} {β : Type*} -- `x` and `y` are explicit here, as they are often needed to guide typechecking of `h`. diff --git a/Mathlib/Logic/Nontrivial/Defs.lean b/Mathlib/Logic/Nontrivial/Defs.lean index 6d307aefd079e9..c61a62786fe6e0 100644 --- a/Mathlib/Logic/Nontrivial/Defs.lean +++ b/Mathlib/Logic/Nontrivial/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.Push.Attr +module + +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.Push.Attr /-! # Nontrivial types @@ -19,6 +21,8 @@ We introduce a typeclass `Nontrivial` formalizing this property. Basic results about nontrivial types are in `Mathlib/Logic/Nontrivial/Basic.lean`. -/ +@[expose] public section + variable {α : Type*} {β : Type*} /-- Predicate typeclass for expressing that a type is not reduced to a single element. In rings, diff --git a/Mathlib/Logic/OpClass.lean b/Mathlib/Logic/OpClass.lean index 6427c0f5877841..e9a39d62604967 100644 --- a/Mathlib/Logic/OpClass.lean +++ b/Mathlib/Logic/OpClass.lean @@ -3,8 +3,9 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Typeclasses for commuting heterogeneous operations @@ -20,6 +21,8 @@ They express the property that permuting arguments of type `α` does not change * `RightCommutative`: for `op : β → α → β`, `op (op b a₁) a₂ = op (op b a₂) a₁`. -/ +@[expose] public section + universe u v variable {α : Sort u} {β : Sort v} diff --git a/Mathlib/Logic/Pairwise.lean b/Mathlib/Logic/Pairwise.lean index c454a975993411..bcfad761d8b65f 100644 --- a/Mathlib/Logic/Pairwise.lean +++ b/Mathlib/Logic/Pairwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Function.Basic -import Mathlib.Data.Set.Defs +module + +public import Mathlib.Logic.Function.Basic +public import Mathlib.Data.Set.Defs /-! # Relations holding pairwise @@ -17,6 +19,8 @@ This file defines pairwise relations. * `Set.Pairwise`: `s.Pairwise r` states that `r i j` for all `i ≠ j` with `i, j ∈ s`. -/ +@[expose] public section + open Function variable {α β ι : Type*} {r p : α → α → Prop} diff --git a/Mathlib/Logic/Relation.lean b/Mathlib/Logic/Relation.lean index 31f364f4d99bff..6499dd23a8421b 100644 --- a/Mathlib/Logic/Relation.lean +++ b/Mathlib/Logic/Relation.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Relator -import Mathlib.Tactic.Use -import Mathlib.Tactic.MkIffOfInductiveProp -import Mathlib.Tactic.SimpRw -import Mathlib.Logic.Basic -import Mathlib.Order.Defs.Unbundled +module + +public import Mathlib.Logic.Relator +public import Mathlib.Tactic.Use +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Mathlib.Tactic.SimpRw +public import Mathlib.Logic.Basic +public import Mathlib.Order.Defs.Unbundled /-! # Relation closures @@ -43,6 +45,8 @@ the bundled version, see `Rel`. terms of rewriting systems, this means that `a` and `b` can be rewritten to the same term. -/ +@[expose] public section + open Function diff --git a/Mathlib/Logic/Relator.lean b/Mathlib/Logic/Relator.lean index a523e5539075c2..200f40d6c0180f 100644 --- a/Mathlib/Logic/Relator.lean +++ b/Mathlib/Logic/Relator.lean @@ -3,13 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ +module -import Mathlib.Logic.Function.Defs +public import Mathlib.Logic.Function.Defs /-! # Relator for functions, pairs, sums, and lists. -/ +@[expose] public section + namespace Relator universe u₁ u₂ v₁ v₂ diff --git a/Mathlib/Logic/Small/Basic.lean b/Mathlib/Logic/Small/Basic.lean index fcd05e7af4f8d0..9225af576a3187 100644 --- a/Mathlib/Logic/Small/Basic.lean +++ b/Mathlib/Logic/Small/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Logic.Small.Defs -import Mathlib.Logic.Equiv.Set +module + +public import Mathlib.Logic.Small.Defs +public import Mathlib.Logic.Equiv.Set /-! # Instances and theorems for `Small`. @@ -12,6 +14,8 @@ import Mathlib.Logic.Equiv.Set In particular we prove `small_of_injective` and `small_of_surjective`. -/ +@[expose] public section + assert_not_exists Countable universe u w v v' diff --git a/Mathlib/Logic/Small/Defs.lean b/Mathlib/Logic/Small/Defs.lean index de3c9068a228a1..d769202277a5f5 100644 --- a/Mathlib/Logic/Small/Defs.lean +++ b/Mathlib/Logic/Small/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.MkIffOfInductiveProp -import Mathlib.Tactic.PPWithUniv +module + +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Mathlib.Tactic.PPWithUniv /-! # Small types @@ -21,6 +23,8 @@ If `α ≃ β`, then `Small.{w} α ↔ Small.{w} β`. See `Mathlib/Logic/Small/Basic.lean` for further instances and theorems. -/ +@[expose] public section + universe u w v v' /-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`. diff --git a/Mathlib/Logic/Small/List.lean b/Mathlib/Logic/Small/List.lean index 90319f8e5672c6..ff74091005eabf 100644 --- a/Mathlib/Logic/Small/List.lean +++ b/Mathlib/Logic/Small/List.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Logic.Small.Basic -import Mathlib.Data.Vector.Basic +module + +public import Mathlib.Logic.Small.Basic +public import Mathlib.Data.Vector.Basic /-! # Instances for `Small (List α)` and `Small (Vector α)`. @@ -13,6 +15,8 @@ These must not be in `Logic.Small.Basic` as this is very low in the import hiera and is used by category theory files which do not need everything imported by `Data.Vector.Basic`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Logic/Small/Set.lean b/Mathlib/Logic/Small/Set.lean index 70ed7677a6b5b8..c90a33641233ce 100644 --- a/Mathlib/Logic/Small/Set.lean +++ b/Mathlib/Logic/Small/Set.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Timothy Carlin-Burns -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Logic.Small.Basic +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Logic.Small.Basic /-! # Results about `Small` on coerced sets -/ +@[expose] public section + universe u u1 u2 u3 u4 variable {α : Type u1} {β : Type u2} {γ : Type u3} {ι : Type u4} diff --git a/Mathlib/Logic/Unique.lean b/Mathlib/Logic/Unique.lean index 91ac752e20daec..fc9f16a1fd16f4 100644 --- a/Mathlib/Logic/Unique.lean +++ b/Mathlib/Logic/Unique.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Logic.IsEmpty -import Mathlib.Tactic.Inhabit -import Mathlib.Tactic.Push.Attr +module + +public import Mathlib.Logic.IsEmpty +public import Mathlib.Tactic.Inhabit +public import Mathlib.Tactic.Push.Attr /-! # Types with a unique term @@ -40,6 +42,8 @@ for good definitional properties of the default term. -/ +@[expose] public section + universe u v w -- Don't generate injectivity lemmas, which the `simpNF` linter will complain about. diff --git a/Mathlib/Logic/UnivLE.lean b/Mathlib/Logic/UnivLE.lean index 81cf2fbd794432..06e0ea943e6ca4 100644 --- a/Mathlib/Logic/UnivLE.lean +++ b/Mathlib/Logic/UnivLE.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Logic.Small.Defs +module + +public import Mathlib.Logic.Small.Defs /-! # UnivLE @@ -17,6 +19,8 @@ directly due to https://github.com/leanprover/lean4/issues/2297. See the doc-string for the comparison with an alternative stronger definition. -/ +@[expose] public section + universe u v w noncomputable section diff --git a/Mathlib/MeasureTheory/Category/MeasCat.lean b/Mathlib/MeasureTheory/Category/MeasCat.lean index eacec83e2204bf..a052da918e74c1 100644 --- a/Mathlib/MeasureTheory/Category/MeasCat.lean +++ b/Mathlib/MeasureTheory/Category/MeasCat.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.MeasureTheory.Measure.GiryMonad -import Mathlib.CategoryTheory.Monad.Algebra -import Mathlib.Topology.Category.TopCat.Basic +module + +public import Mathlib.MeasureTheory.Measure.GiryMonad +public import Mathlib.CategoryTheory.Monad.Algebra +public import Mathlib.Topology.Category.TopCat.Basic /-! # The category of measurable spaces @@ -25,6 +27,8 @@ Measurable spaces and measurable functions form a (concrete) category `MeasCat`. measurable space, giry monad, borel -/ +@[expose] public section + noncomputable section @@ -37,6 +41,8 @@ universe u v /-- The category of measurable spaces and measurable functions. -/ structure MeasCat : Type (u + 1) where + /-- Construct a bundled `MeasCat` from the underlying type and the typeclass. -/ + of :: /-- The underlying measurable space. -/ carrier : Type u [str : MeasurableSpace carrier] @@ -48,10 +54,6 @@ namespace MeasCat instance : CoeSort MeasCat Type* := ⟨carrier⟩ -/-- Construct a bundled `MeasCat` from the underlying type and the typeclass. -/ -abbrev of (α : Type u) [ms : MeasurableSpace α] : MeasCat where - carrier := α - theorem coe_of (X : Type u) [MeasurableSpace X] : (of X : Type u) = X := rfl diff --git a/Mathlib/MeasureTheory/Constructions/AddChar.lean b/Mathlib/MeasureTheory/Constructions/AddChar.lean index 4d2852beabfe1e..f7d7ecbfe0f8af 100644 --- a/Mathlib/MeasureTheory/Constructions/AddChar.lean +++ b/Mathlib/MeasureTheory/Constructions/AddChar.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.AddChar -import Mathlib.MeasureTheory.MeasurableSpace.Defs +module + +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.MeasureTheory.MeasurableSpace.Defs /-! # Measurable space instance for additive characters @@ -17,6 +19,8 @@ discrete measurable space. Give the definition in the correct generality. -/ +@[expose] public section + namespace AddChar variable {A M : Type*} [AddMonoid A] [Monoid M] [MeasurableSpace A] [MeasurableSpace M] diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean index 1b4cebb01be447..cab35a43554e14 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Group.Arithmetic -import Mathlib.Topology.GDelta.MetrizableSpace -import Mathlib.Topology.Instances.EReal.Lemmas -import Mathlib.Topology.Instances.Rat +module + +public import Mathlib.MeasureTheory.Group.Arithmetic +public import Mathlib.Topology.GDelta.MetrizableSpace +public import Mathlib.Topology.Instances.EReal.Lemmas +public import Mathlib.Topology.Instances.Rat /-! # Borel (measurable) space @@ -32,6 +34,8 @@ import Mathlib.Topology.Instances.Rat * `AEMeasurable.add` : similar dot notation for almost everywhere measurable functions; -/ +@[expose] public section + noncomputable section @@ -126,7 +130,7 @@ Finally, `borelize α β γ` runs `borelize α; borelize β; borelize γ`. syntax "borelize" (ppSpace colGt term:max)* : tactic /-- Add instances `borel e : MeasurableSpace e` and `⟨rfl⟩ : BorelSpace e`. -/ -def addBorelInstance (e : Expr) : TacticM Unit := do +meta def addBorelInstance (e : Expr) : TacticM Unit := do let t ← Lean.Elab.Term.exprToSyntax e evalTactic <| ← `(tactic| refine_lift @@ -136,7 +140,7 @@ def addBorelInstance (e : Expr) : TacticM Unit := do /-- Given a type `e`, an assumption `i : MeasurableSpace e`, and an instance `[BorelSpace e]`, replace `i` with `borel e`. -/ -def borelToRefl (e : Expr) (i : FVarId) : TacticM Unit := do +meta def borelToRefl (e : Expr) (i : FVarId) : TacticM Unit := do let te ← Lean.Elab.Term.exprToSyntax e evalTactic <| ← `(tactic| have := @BorelSpace.measurable_eq $te _ _ _) @@ -157,7 +161,7 @@ def borelToRefl (e : Expr) (i : FVarId) : TacticM Unit := do /-- Given a type `$t`, if there is an assumption `[i : MeasurableSpace $t]`, then try to prove `[BorelSpace $t]` and replace `i` with `borel $t`. Otherwise, add instances `borel $t : MeasurableSpace $t` and `⟨rfl⟩ : BorelSpace $t`. -/ -def borelize (t : Term) : TacticM Unit := withMainContext <| do +meta def borelize (t : Term) : TacticM Unit := withMainContext do let u ← mkFreshLevelMVar let e ← withoutRecover <| Tactic.elabTermEnsuringType t (mkSort (mkLevelSucc u)) let i? ← findLocalDeclWithType? (← mkAppOptM ``MeasurableSpace #[e]) diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Complex.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Complex.lean index 89c578de4558a5..7674854db207f9 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Complex.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Complex.lean @@ -3,11 +3,15 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Complex.Basic -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +module + +public import Mathlib.Analysis.Complex.Basic +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic /-! # Equip `ℂ` with the Borel sigma-algebra -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/ContinuousLinearMap.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/ContinuousLinearMap.lean index 093cf773a53b77..c01c080ac3ec9d 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/ContinuousLinearMap.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/ContinuousLinearMap.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot -/ -import Mathlib.Analysis.Normed.Operator.Bilinear -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.Topology.Algebra.Module.FiniteDimension +module + +public import Mathlib.Analysis.Normed.Operator.Bilinear +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.Topology.Algebra.Module.FiniteDimension /-! # Measurable functions in normed spaces -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean index 25cac428d3629b..08645ac68ff6c2 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Group.Continuity -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.Topology.MetricSpace.Thickening +module + +public import Mathlib.Analysis.Normed.Group.Continuity +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.Topology.MetricSpace.Thickening /-! # Borel sigma algebras on (pseudo-)metric spaces @@ -23,6 +25,8 @@ import Mathlib.Topology.MetricSpace.Thickening -/ +@[expose] public section + open Set Filter MeasureTheory MeasurableSpace TopologicalSpace open scoped Topology NNReal ENNReal MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean index 0bbac77a706d2b..7eda5c402e48bb 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric -import Mathlib.MeasureTheory.Constructions.BorelSpace.Real -import Mathlib.Topology.Metrizable.Real -import Mathlib.Topology.IndicatorConstPointwise +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Real +public import Mathlib.Topology.Metrizable.Real +public import Mathlib.Topology.IndicatorConstPointwise /-! # Measurable functions in (pseudo-)metrizable Borel spaces -/ +@[expose] public section + open Filter MeasureTheory TopologicalSpace Topology NNReal ENNReal MeasureTheory variable {α β : Type*} [MeasurableSpace α] diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean index 8ee0378d6baf46..148d3a60fa8918 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kexing Ying -/ -import Mathlib.Topology.Semicontinuous -import Mathlib.MeasureTheory.Function.AEMeasurableSequence -import Mathlib.MeasureTheory.Order.Lattice -import Mathlib.Topology.Order.Lattice -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +module + +public import Mathlib.Topology.Semicontinuous +public import Mathlib.MeasureTheory.Function.AEMeasurableSequence +public import Mathlib.MeasureTheory.Order.Lattice +public import Mathlib.Topology.Order.Lattice +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic /-! # Borel sigma algebras on spaces with orders @@ -36,6 +38,8 @@ import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -/ +@[expose] public section + open Set Filter MeasureTheory MeasurableSpace TopologicalSpace open scoped Topology NNReal ENNReal MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean index cbe68f1e6ef3c6..ad54824b318468 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order -import Mathlib.MeasureTheory.MeasurableSpace.Prod -import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms -import Mathlib.Topology.Instances.Real.Lemmas +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +public import Mathlib.MeasureTheory.MeasurableSpace.Prod +public import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms +public import Mathlib.Topology.Instances.Real.Lemmas /-! # Borel (measurable) spaces ℝ, ℝ≥0, ℝ≥0∞ @@ -27,6 +29,8 @@ import Mathlib.Topology.Instances.Real.Lemmas * `Measurable.ennreal*` : measurability of special cases for arithmetic operations on `ℝ≥0∞`. -/ +@[expose] public section + open Set Filter MeasureTheory MeasurableSpace open scoped Topology NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/WithTop.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/WithTop.lean index 37336f36ddbfd2..9a13abed88439e 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/WithTop.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/WithTop.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.Topology.Order.WithTop +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.Topology.Order.WithTop /-! # Borel measurable space on `WithTop` @@ -23,6 +25,8 @@ We then prove that the natural inclusion `ι → WithTop ι` is measurable, and -/ +@[expose] public section + namespace WithTop diff --git a/Mathlib/MeasureTheory/Constructions/ClosedCompactCylinders.lean b/Mathlib/MeasureTheory/Constructions/ClosedCompactCylinders.lean index 6c458d555d3355..2321bf6e04aa32 100644 --- a/Mathlib/MeasureTheory/Constructions/ClosedCompactCylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/ClosedCompactCylinders.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.MeasureTheory.Constructions.Cylinders +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.MeasureTheory.Constructions.Cylinders /-! # Cylinders with closed compact bases @@ -23,6 +25,8 @@ proof of Kolmogorov's extension theorem. -/ +@[expose] public section + open Set namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 16bd3bdf2e3744..6cd973d84be034 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.MeasureTheory.PiSystem -import Mathlib.Topology.Constructions +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.MeasureTheory.PiSystem +public import Mathlib.Topology.Constructions /-! # π-systems of cylinders and square cylinders @@ -40,6 +42,8 @@ a product set. -/ +@[expose] public section + open Function Set namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/HaarToSphere.lean b/Mathlib/MeasureTheory/Constructions/HaarToSphere.lean index a036821482b440..b3101801bef0fe 100644 --- a/Mathlib/MeasureTheory/Constructions/HaarToSphere.lean +++ b/Mathlib/MeasureTheory/Constructions/HaarToSphere.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Field.Pointwise -import Mathlib.Analysis.Normed.Module.Ball.RadialEquiv -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +module + +public import Mathlib.Algebra.Order.Field.Pointwise +public import Mathlib.Analysis.Normed.Module.Ball.RadialEquiv +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar /-! # Generalized polar coordinate change @@ -24,6 +26,8 @@ One can think about this fact as a version of polar coordinate change formula for a general nontrivial normed space. -/ +@[expose] public section + open Set Function Metric MeasurableSpace intervalIntegral open scoped Pointwise ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Constructions/Pi.lean b/Mathlib/MeasureTheory/Constructions/Pi.lean index a908a29864e206..91935c1c34d0a3 100644 --- a/Mathlib/MeasureTheory/Constructions/Pi.lean +++ b/Mathlib/MeasureTheory/Constructions/Pi.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Logic.Encodable.Pi -import Mathlib.MeasureTheory.Group.Measure -import Mathlib.MeasureTheory.MeasurableSpace.Pi -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.Topology.Constructions +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Logic.Encodable.Pi +public import Mathlib.MeasureTheory.Group.Measure +public import Mathlib.MeasureTheory.MeasurableSpace.Pi +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.Topology.Constructions /-! # Indexed product measures @@ -52,6 +54,8 @@ finitary product measure -/ +@[expose] public section + noncomputable section open Function Set MeasureTheory.OuterMeasure Filter MeasurableSpace Encodable @@ -292,6 +296,10 @@ theorem pi_pi [∀ i, SigmaFinite (μ i)] (s : ∀ i, Set (α i)) : nonrec theorem pi_univ [∀ i, SigmaFinite (μ i)] : Measure.pi μ univ = ∏ i, μ i univ := by rw [← pi_univ, pi_pi μ] +@[simp] lemma pi_singleton [∀ i, SigmaFinite (μ i)] (f : ∀ i, α i) : + Measure.pi μ {f} = ∏ i, μ i {f i} := by + simpa [Set.univ_pi_singleton, -pi_pi] using pi_pi μ fun i ↦ {f i} + instance pi.instIsFiniteMeasure [∀ i, IsFiniteMeasure (μ i)] : IsFiniteMeasure (Measure.pi μ) := ⟨Measure.pi_univ μ ▸ ENNReal.prod_lt_top (fun i _ ↦ measure_lt_top (μ i) _)⟩ diff --git a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean index 282c3c8ad5f204..a2c5535a398d89 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Felix Weilacher -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order -import Mathlib.Topology.MetricSpace.Perfect -import Mathlib.Topology.Separation.CountableSeparatingOn +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +public import Mathlib.Topology.MetricSpace.Perfect +public import Mathlib.Topology.Separation.CountableSeparatingOn /-! # The Borel sigma-algebra on Polish spaces @@ -59,6 +61,8 @@ We use this to prove several versions of the Borel isomorphism theorem. are Borel isomorphic. -/ +@[expose] public section + open Set Function PolishSpace PiNat TopologicalSpace Bornology Metric Filter Topology MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/Polish/EmbeddingReal.lean b/Mathlib/MeasureTheory/Constructions/Polish/EmbeddingReal.lean index f18dc804371eac..ad67393a879f95 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/EmbeddingReal.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/EmbeddingReal.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.Real.Cardinality -import Mathlib.MeasureTheory.Constructions.Polish.Basic +module + +public import Mathlib.Analysis.Real.Cardinality +public import Mathlib.MeasureTheory.Constructions.Polish.Basic /-! # A Polish Borel space is measurably equivalent to a set of reals -/ +@[expose] public section + open Set Function PolishSpace PiNat TopologicalSpace Bornology Metric Filter Topology MeasureTheory namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean b/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean index 87224af46c33d8..8498c76992394b 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Constructions.Polish.Basic -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +module + +public import Mathlib.MeasureTheory.Constructions.Polish.Basic +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic /-! # Results about strongly measurable functions @@ -19,6 +21,8 @@ can be extended to strongly measurable functions without assuming separability o The purpose of this file is to collect those results. -/ +@[expose] public section + open Filter MeasureTheory Set TopologicalSpace open scoped Topology diff --git a/Mathlib/MeasureTheory/Constructions/Projective.lean b/Mathlib/MeasureTheory/Constructions/Projective.lean index b6914e760103e3..8c5d3d95e2a45e 100644 --- a/Mathlib/MeasureTheory/Constructions/Projective.lean +++ b/Mathlib/MeasureTheory/Constructions/Projective.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.MeasureTheory.Constructions.Cylinders -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +module + +public import Mathlib.MeasureTheory.Constructions.Cylinders +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability /-! # Projective measure families and projective limits @@ -29,6 +31,8 @@ the projection from `∀ i, α i` to `∀ i : I, α i` maps `μ` to `P I`. -/ +@[expose] public section + open Set namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean b/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean index a9fa0a157b2fb2..654ce0afacdead 100644 --- a/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean +++ b/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.MeasureTheory.Constructions.Projective -import Mathlib.MeasureTheory.Measure.AddContent -import Mathlib.MeasureTheory.SetAlgebra +module + +public import Mathlib.MeasureTheory.Constructions.Projective +public import Mathlib.MeasureTheory.Measure.AddContent +public import Mathlib.MeasureTheory.SetAlgebra /-! # Additive content built from a projective family of measures @@ -32,6 +34,8 @@ the Kolmogorov extension theorem. -/ +@[expose] public section + open Finset diff --git a/Mathlib/MeasureTheory/Constructions/SubmoduleQuotient.lean b/Mathlib/MeasureTheory/Constructions/SubmoduleQuotient.lean index 759f561db89aa0..915c10fbbdc231 100644 --- a/Mathlib/MeasureTheory/Constructions/SubmoduleQuotient.lean +++ b/Mathlib/MeasureTheory/Constructions/SubmoduleQuotient.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.MeasureTheory.MeasurableSpace.Constructions +module + +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions /-! # Measurability on the quotient of a module by a submodule -/ +@[expose] public section + namespace Submodule.Quotient variable {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] {p : Submodule R M} diff --git a/Mathlib/MeasureTheory/Constructions/UnitInterval.lean b/Mathlib/MeasureTheory/Constructions/UnitInterval.lean index 79ebe1823cee66..7b19d0f8142586 100644 --- a/Mathlib/MeasureTheory/Constructions/UnitInterval.lean +++ b/Mathlib/MeasureTheory/Constructions/UnitInterval.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Gaëtan Serré -/ -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # The canonical measure on the unit interval @@ -14,6 +16,8 @@ and shows it is a probability measure with no atoms. It also contains some basic results on the volume of various interval sets. -/ +@[expose] public section + open scoped unitInterval open MeasureTheory Measure Set diff --git a/Mathlib/MeasureTheory/Covering/Besicovitch.lean b/Mathlib/MeasureTheory/Covering/Besicovitch.lean index b4c5e163d5afef..f41395b4d92da8 100644 --- a/Mathlib/MeasureTheory/Covering/Besicovitch.lean +++ b/Mathlib/MeasureTheory/Covering/Besicovitch.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Covering.Differentiation +module + +public import Mathlib.MeasureTheory.Covering.Differentiation /-! # Besicovitch covering theorems @@ -89,6 +91,8 @@ the remaining points, while remaining disjoint from the already chosen balls. Th balls is the desired almost everywhere covering. -/ +@[expose] public section + noncomputable section @@ -134,7 +138,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: `Besicovitch.SatelliteConfig.r`. -/ @[positivity Besicovitch.SatelliteConfig.r _ _] -def evalBesicovitchSatelliteConfigR : PositivityExt where eval {u α} _zα _pα e := do +meta def evalBesicovitchSatelliteConfigR : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(@Besicovitch.SatelliteConfig.r $β $inst $N $τ $self $i) => assertInstancesCommute diff --git a/Mathlib/MeasureTheory/Covering/BesicovitchVectorSpace.lean b/Mathlib/MeasureTheory/Covering/BesicovitchVectorSpace.lean index 6d7b6e81f0218c..17f56bb0339d28 100644 --- a/Mathlib/MeasureTheory/Covering/BesicovitchVectorSpace.lean +++ b/Mathlib/MeasureTheory/Covering/BesicovitchVectorSpace.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.MeasureTheory.Covering.Besicovitch -import Mathlib.Tactic.AdaptationNote -import Mathlib.Algebra.EuclideanDomain.Basic +module + +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.MeasureTheory.Covering.Besicovitch +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Algebra.EuclideanDomain.Basic /-! # Satellite configurations for Besicovitch covering lemma in vector spaces @@ -41,6 +43,8 @@ In particular, this number is bounded by `5 ^ dim` by a straightforward measure no satellite configurations of `(multiplicity E) + 1` points, for the parameter `goodτ E`. -/ +@[expose] public section + universe u diff --git a/Mathlib/MeasureTheory/Covering/DensityTheorem.lean b/Mathlib/MeasureTheory/Covering/DensityTheorem.lean index 501009a1ece0fd..5a5ae487a1f5e9 100644 --- a/Mathlib/MeasureTheory/Covering/DensityTheorem.lean +++ b/Mathlib/MeasureTheory/Covering/DensityTheorem.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.MeasureTheory.Measure.Doubling -import Mathlib.MeasureTheory.Covering.Vitali -import Mathlib.MeasureTheory.Covering.Differentiation +module + +public import Mathlib.MeasureTheory.Measure.Doubling +public import Mathlib.MeasureTheory.Covering.Vitali +public import Mathlib.MeasureTheory.Covering.Differentiation /-! # Uniformly locally doubling measures and Lebesgue's density theorem @@ -26,6 +28,8 @@ form of Lebesgue's density theorem. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Covering/Differentiation.lean b/Mathlib/MeasureTheory/Covering/Differentiation.lean index b2c8df169b7b31..31c6d8881343c7 100644 --- a/Mathlib/MeasureTheory/Covering/Differentiation.lean +++ b/Mathlib/MeasureTheory/Covering/Differentiation.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Covering.VitaliFamily -import Mathlib.MeasureTheory.Function.AEMeasurableOrder -import Mathlib.MeasureTheory.Integral.Average -import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue -import Mathlib.MeasureTheory.Measure.Regular +module + +public import Mathlib.MeasureTheory.Covering.VitaliFamily +public import Mathlib.MeasureTheory.Function.AEMeasurableOrder +public import Mathlib.MeasureTheory.Integral.Average +public import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue +public import Mathlib.MeasureTheory.Measure.Regular /-! # Differentiation of measures @@ -73,6 +75,8 @@ make no sense. However, the measure is not globally zero if the space is big eno * [Herbert Federer, Geometric Measure Theory, Chapter 2.9][Federer1996] -/ +@[expose] public section + open MeasureTheory Metric Set Filter TopologicalSpace MeasureTheory.Measure open scoped Filter ENNReal MeasureTheory NNReal Topology diff --git a/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean b/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean index d321f344f7209c..ab2ec814186d5d 100644 --- a/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean +++ b/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.MeasureTheory.Covering.DensityTheorem +module + +public import Mathlib.MeasureTheory.Covering.DensityTheorem /-! # Liminf, limsup, and uniformly locally doubling measures. @@ -23,6 +25,8 @@ carrying a uniformly locally doubling measure. -/ +@[expose] public section + open Set Filter Metric MeasureTheory TopologicalSpace diff --git a/Mathlib/MeasureTheory/Covering/OneDim.lean b/Mathlib/MeasureTheory/Covering/OneDim.lean index e4b199d53e0055..1a03883907b92d 100644 --- a/Mathlib/MeasureTheory/Covering/OneDim.lean +++ b/Mathlib/MeasureTheory/Covering/OneDim.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Covering.DensityTheorem -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +module + +public import Mathlib.MeasureTheory.Covering.DensityTheorem +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar /-! # Covering theorems for Lebesgue measure in one dimension @@ -14,6 +16,8 @@ in `DensityTheorem.lean`. In this file, we expand the API for this theory in one by showing that intervals belong to the relevant Vitali family. -/ +@[expose] public section + open Set MeasureTheory IsUnifLocDoublingMeasure Filter diff --git a/Mathlib/MeasureTheory/Covering/Vitali.lean b/Mathlib/MeasureTheory/Covering/Vitali.lean index a379728c36fa00..c0286bc58de453 100644 --- a/Mathlib/MeasureTheory/Covering/Vitali.lean +++ b/Mathlib/MeasureTheory/Covering/Vitali.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.MeasureTheory.Covering.VitaliFamily -import Mathlib.Data.Set.Pairwise.Lattice +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.MeasureTheory.Covering.VitaliFamily +public import Mathlib.Data.Set.Pairwise.Lattice /-! # Vitali covering theorems @@ -33,6 +35,8 @@ covering a fixed proportion `1/C` of the ball `closedBall x (3 * diam a)` forms This version is given in `Vitali.vitaliFamily`. -/ +@[expose] public section + variable {α ι : Type*} diff --git a/Mathlib/MeasureTheory/Covering/VitaliFamily.lean b/Mathlib/MeasureTheory/Covering/VitaliFamily.lean index 5a80f8afd0d659..50c6220bc34475 100644 --- a/Mathlib/MeasureTheory/Covering/VitaliFamily.lean +++ b/Mathlib/MeasureTheory/Covering/VitaliFamily.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous +module + +public import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous /-! # Vitali families @@ -45,6 +47,8 @@ Let `v` be such a Vitali family. (Vitali families are called Vitali relations there) -/ +@[expose] public section + open MeasureTheory Metric Set Filter TopologicalSpace MeasureTheory.Measure open scoped Topology diff --git a/Mathlib/MeasureTheory/Function/AEEqFun.lean b/Mathlib/MeasureTheory/Function/AEEqFun.lean index 6b49e515720ff9..ef899f740c91f6 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl, Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Zhouhang Zhou -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Integral.Lebesgue.Add -import Mathlib.Order.Filter.Germ.Basic -import Mathlib.Topology.ContinuousMap.Algebra +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add +public import Mathlib.Order.Filter.Germ.Basic +public import Mathlib.Topology.ContinuousMap.Algebra /-! @@ -68,6 +70,8 @@ function space, almost everywhere equal, `L⁰`, ae_eq_fun -/ +@[expose] public section + -- Guard against import creep assert_not_exists InnerProductSpace diff --git a/Mathlib/MeasureTheory/Function/AEEqFun/DomAct.lean b/Mathlib/MeasureTheory/Function/AEEqFun/DomAct.lean index f69094fae395e0..64f9847bfd86b8 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun/DomAct.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun/DomAct.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Function.AEEqFun -import Mathlib.MeasureTheory.Group.Action -import Mathlib.GroupTheory.GroupAction.DomAct.Basic -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas +module + +public import Mathlib.MeasureTheory.Function.AEEqFun +public import Mathlib.MeasureTheory.Group.Action +public import Mathlib.GroupTheory.GroupAction.DomAct.Basic +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas /-! # Action of `DomMulAct` and `DomAddAct` on `α →ₘ[μ] β` @@ -23,6 +25,8 @@ typeclass for quasi-measure-preserving actions yet. -/ +@[expose] public section + open MeasureTheory namespace DomMulAct diff --git a/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean b/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean index b9aca2df4906cc..bd9cba8d831de1 100644 --- a/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean +++ b/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.InnerProductSpace.Continuous -import Mathlib.Analysis.Normed.Module.HahnBanach -import Mathlib.MeasureTheory.Function.AEEqOfLIntegral -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.Order.Filter.Ring +module + +public import Mathlib.Analysis.InnerProductSpace.Continuous +public import Mathlib.Analysis.Normed.Module.HahnBanach +public import Mathlib.MeasureTheory.Function.AEEqOfLIntegral +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.Order.Filter.Ring /-! # From equality of integrals to equality of functions @@ -42,6 +44,8 @@ Generally useful lemmas which are not related to integrals: -/ +@[expose] public section + open MeasureTheory TopologicalSpace NormedSpace Filter diff --git a/Mathlib/MeasureTheory/Function/AEEqOfLIntegral.lean b/Mathlib/MeasureTheory/Function/AEEqOfLIntegral.lean index 5b47b3d1bd223d..5e4bdec655cee5 100644 --- a/Mathlib/MeasureTheory/Function/AEEqOfLIntegral.lean +++ b/Mathlib/MeasureTheory/Function/AEEqOfLIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.StronglyMeasurable.ENNReal -import Mathlib.MeasureTheory.Measure.WithDensity +module + +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.ENNReal +public import Mathlib.MeasureTheory.Measure.WithDensity /-! # From equality of integrals to equality of functions @@ -26,6 +28,8 @@ The conclusion is then `f =ᵐ[μ] g`. The main lemmas are: -/ +@[expose] public section + open Filter diff --git a/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean b/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean index bfe26f317e8168..b0ce7b625fd8c6 100644 --- a/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean +++ b/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order /-! # Measurability criterion for ennreal-valued functions @@ -20,6 +22,8 @@ but the proof would be more painful. Since our only use for now is for `ℝ≥0 as possible. -/ +@[expose] public section + open MeasureTheory Set TopologicalSpace diff --git a/Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean b/Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean index 60e89835c9bdbf..72724264ce6ac6 100644 --- a/Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean +++ b/Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.MeasurableSpace.Basic -import Mathlib.MeasureTheory.Measure.MeasureSpaceDef +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Basic +public import Mathlib.MeasureTheory.Measure.MeasureSpaceDef /-! # Sequence of measurable functions associated to a sequence of a.e.-measurable functions @@ -20,6 +22,8 @@ and a measurable set `aeSeqSet hf p`, such that * `x ∈ aeSeqSet hf p → p x (fun n ↦ f n x)` -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/AbsolutelyContinuous.lean b/Mathlib/MeasureTheory/Function/AbsolutelyContinuous.lean index 2f62e538996e37..f2a99ed623ea83 100644 --- a/Mathlib/MeasureTheory/Function/AbsolutelyContinuous.lean +++ b/Mathlib/MeasureTheory/Function/AbsolutelyContinuous.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yizheng Zhu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yizheng Zhu -/ -import Mathlib.Analysis.BoundedVariation -import Mathlib.Order.SuccPred.IntervalSucc +module + +public import Mathlib.Analysis.BoundedVariation +public import Mathlib.Order.SuccPred.IntervalSucc /-! # Absolutely Continuous Functions @@ -47,6 +49,8 @@ We conclude that absolutely continuous -/ +@[expose] public section + variable {X F : Type*} [PseudoMetricSpace X] [SeminormedAddCommGroup F] open Set Filter Function diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean index f5d6a2c215a66e..da4fc44a51df85 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.LpSeminorm.Trim -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp +module + +public import Mathlib.MeasureTheory.Function.LpSeminorm.Trim +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp /-! # Functions a.e. measurable with respect to a sub-σ-algebra @@ -32,6 +34,8 @@ sub-σ-algebra `m` in a normed space, it suffices to show that -/ +@[expose] public section + open TopologicalSpace Filter diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 3d97d94d0f4047..c034aaf7126944 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 +module + +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 /-! # Conditional expectation @@ -68,6 +70,8 @@ conditional expectation, conditional expected value -/ +@[expose] public section + open TopologicalSpace MeasureTheory.Lp Filter open scoped ENNReal Topology MeasureTheory @@ -102,7 +106,7 @@ scoped macro:max μ:term noWs "[" f:term "|" m:term "]" : term => /-- Unexpander for `μ[f|m]` notation. -/ @[app_unexpander MeasureTheory.condExp] -def condExpUnexpander : Lean.PrettyPrinter.Unexpander +meta def condExpUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $m $μ $f) => `($μ[$f|$m]) | _ => throw () @@ -335,7 +339,36 @@ theorem condExp_condExp_of_le {m₁ m₂ m₀ : MeasurableSpace α} {μ : Measur rw [setIntegral_condExp (hm₁₂.trans hm₂) integrable_condExp hs] rw [setIntegral_condExp (hm₁₂.trans hm₂) hf hs, setIntegral_condExp hm₂ hf (hm₁₂ s hs)] +/-- Conditional expectation commutes with continuous linear maps. -/ +theorem _root_.ContinuousLinearMap.comp_condExp_comm {F : Type*} [NormedAddCommGroup F] + [CompleteSpace F] [NormedSpace ℝ F] (hf_int : Integrable f μ) (T : E →L[ℝ] F) : + T ∘ μ[f|m] =ᵐ[μ] μ[T ∘ f|m] := by + by_cases hm : m ≤ m₀ + · by_cases hμ : SigmaFinite (μ.trim hm) + · refine ae_eq_condExp_of_forall_setIntegral_eq hm ?_ (fun s ms hs => ?_) (fun s ms hs => ?_) ?_ + · exact T.integrable_comp hf_int + · exact (T.integrable_comp integrable_condExp).integrableOn + · calc + ∫ x in s, (T ∘ μ[f|m]) x ∂μ = T (∫ x in s, μ[f|m] x ∂μ) := + T.integral_comp_comm integrable_condExp.restrict + _ = T (∫ x in s, f x ∂μ) := congrArg T (setIntegral_condExp hm hf_int ms) + _ = ∫ x in s, (T ∘ f) x ∂μ := (T.integral_comp_comm hf_int.restrict).symm + · exact T.cont.comp_aestronglyMeasurable stronglyMeasurable_condExp.aestronglyMeasurable + · simp [condExp_of_not_sigmaFinite hm hμ] + · simp [condExp_of_not_le hm] + +/-- Conditional expectation commutes with affine functions. Note that `IsFiniteMeasure μ` is a +necessary assumption because we want constant functions to be integrable. -/ +theorem _root_.ContinuousLinearMap.comp_condExp_add_const_comm {F : Type*} [NormedAddCommGroup F] + [CompleteSpace F] [NormedSpace ℝ F] [IsFiniteMeasure μ] (hm : m ≤ m₀) (hf_int : Integrable f μ) + (T : E →L[ℝ] F) (a : F) : (fun x ↦ T (μ[f|m] x) + a) =ᵐ[μ] μ[fun y ↦ T (f y) + a|m] := by + have hp : (fun x ↦ T (μ[f|m] x) + a) =ᵐ[μ] μ[T ∘ f|m] + μ[(fun y ↦ a)|m] := by + filter_upwards [T.comp_condExp_comm hf_int] with b hb + simpa [condExp_const hm a] + exact hp.trans (condExp_add (T.integrable_comp hf_int) (integrable_const a) m).symm + section RCLike + variable [InnerProductSpace 𝕜 E] lemma MemLp.condExpL2_ae_eq_condExp' (hm : m ≤ m₀) (hf1 : Integrable f μ) (hf2 : MemLp f 2 μ) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 46756a1599ab65..e7e8499ed5f4ee 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 -import Mathlib.MeasureTheory.Measure.Real +module + +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 +public import Mathlib.MeasureTheory.Measure.Real /-! # Conditional expectation in L1 @@ -27,6 +29,8 @@ The conditional expectation of an `L²` function is defined in -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean index bc99a1edba0a98..dc542395932b2b 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.InnerProductSpace.Projection.Basic -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique -import Mathlib.MeasureTheory.Function.L2Space +module + +public import Mathlib.Analysis.InnerProductSpace.Projection.Basic +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique +public import Mathlib.MeasureTheory.Function.L2Space /-! # Conditional expectation in L2 @@ -31,6 +33,8 @@ However, some lemmas also use `𝕜 : RCLike`: -/ +@[expose] public section + open TopologicalSpace Filter ContinuousLinearMap diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean index 0fcd4b11c8f9af..5777de262e3b6f 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +module + +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic /-! @@ -21,6 +23,8 @@ a restricted measure. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean index 6bd42060f54877..6e208c4a96e7c8 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Kexing Ying -/ -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator -import Mathlib.MeasureTheory.Function.UniformIntegrable -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym +module + +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator +public import Mathlib.MeasureTheory.Function.UniformIntegrable +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym /-! @@ -24,6 +26,8 @@ This file proves some results regarding the conditional expectation of real-valu -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Unique.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Unique.lean index d69d75ef5e2af0..36a02e097614f6 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Unique.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Unique.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.AEEqOfIntegral -import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable +module + +public import Mathlib.MeasureTheory.Function.AEEqOfIntegral +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable /-! # Uniqueness of the conditional expectation @@ -25,6 +27,8 @@ defined in this file but is introduced in -/ +@[expose] public section + open scoped ENNReal MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/ContinuousMapDense.lean b/Mathlib/MeasureTheory/Function/ContinuousMapDense.lean index 43ce537c700916..371728f92ee0a3 100644 --- a/Mathlib/MeasureTheory/Function/ContinuousMapDense.lean +++ b/Mathlib/MeasureTheory/Function/ContinuousMapDense.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.MeasureTheory.Measure.Regular -import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp -import Mathlib.Topology.UrysohnsLemma -import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions -import Mathlib.MeasureTheory.Integral.Bochner.Basic +module + +public import Mathlib.MeasureTheory.Measure.Regular +public import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +public import Mathlib.Topology.UrysohnsLemma +public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions +public import Mathlib.MeasureTheory.Integral.Bochner.Basic /-! # Approximation in Lᵖ by continuous functions @@ -57,6 +59,8 @@ See the Vitali-Carathéodory theorem, in the file `Mathlib/MeasureTheory/Integral/Bochner/VitaliCaratheodory.lean`. -/ +@[expose] public section + open scoped ENNReal NNReal Topology BoundedContinuousFunction open MeasureTheory TopologicalSpace ContinuousMap Set Bornology diff --git a/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean b/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean index 473f3a0ccba8a8..910ed3ad403d85 100644 --- a/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean +++ b/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.ProbabilityMeasure +module + +public import Mathlib.MeasureTheory.Measure.Portmanteau /-! # Convergence in distribution @@ -16,6 +18,9 @@ The definition assumes that the random variables are defined on the same probabi is the most common setting in applications. Convergence in distribution for random variables on different probability spaces can be talked about using the `ProbabilityMeasure` type directly. +We also state results relating convergence in probability (`TendstoInMeasure`) +and convergence in distribution. + ## Main definitions * `TendstoInDistribution X l Z μ`: the sequence of random variables `X n` converges in @@ -27,18 +32,32 @@ on different probability spaces can be talked about using the `ProbabilityMeasur * `TendstoInDistribution.continuous_comp`: **Continuous mapping theorem**. If `X n` tends to `Z` in distribution and `g` is continuous, then `g ∘ X n` tends to `g ∘ Z` in distribution. +* `tendstoInDistribution_of_tendstoInMeasure_sub`: the main technical tool for the next results. + Let `X, Y` be two sequences of measurable functions such that `X n` converges in distribution + to `Z`, and `Y n - X n` converges in probability to `0`. + Then `Y n` converges in distribution to `Z`. +* `TendstoInMeasure.tendstoInDistribution`: convergence in probability implies convergence in + distribution. +* `TendstoInDistribution.prodMk_of_tendstoInMeasure_const`: **Slutsky's theorem**. + If `X n` converges in distribution to `Z`, and `Y n` converges in probability to a constant `c`, + then the pair `(X n, Y n)` converges in distribution to `(Z, c)`. + -/ +@[expose] public section + open Filter open scoped Topology namespace MeasureTheory variable {Ω ι E : Type*} {m : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ] - [TopologicalSpace E] {mE : MeasurableSpace E} {X Y : ι → Ω → E} {Z : Ω → E} {l : Filter ι} + {mE : MeasurableSpace E} {X Y : ι → Ω → E} {Z : Ω → E} {l : Filter ι} section TendstoInDistribution +variable [TopologicalSpace E] + /-- Convergence in distribution of random variables. This is the weak convergence of the laws of the random variables: `Tendsto` in the `ProbabilityMeasure` type. -/ @@ -55,6 +74,15 @@ lemma tendstoInDistribution_const [OpensMeasurableSpace E] (hZ : AEMeasurable Z forall_aemeasurable := fun _ ↦ by fun_prop tendsto := tendsto_const_nhds +@[simp] +lemma tendstoInDistribution_of_isEmpty [IsEmpty E] : + TendstoInDistribution X l Z μ where + forall_aemeasurable := fun _ ↦ (measurable_of_subsingleton_codomain _).aemeasurable + aemeasurable_limit := (measurable_of_subsingleton_codomain _).aemeasurable + tendsto := by + simp only [Subsingleton.elim _ (0 : Measure E)] + exact tendsto_const_nhds + lemma tendstoInDistribution_unique [HasOuterApproxClosed E] [BorelSpace E] (X : ι → Ω → E) {Z W : Ω → E} [l.NeBot] (h1 : TendstoInDistribution X l Z μ) (h2 : TendstoInDistribution X l W μ) : @@ -81,4 +109,183 @@ theorem TendstoInDistribution.continuous_comp {F : Type*} [OpensMeasurableSpace end TendstoInDistribution +variable [SeminormedAddCommGroup E] [SecondCountableTopology E] [BorelSpace E] + +/-- Let `X, Y` be two sequences of measurable functions such that `X n` converges in distribution +to `Z`, and `Y n - X n` converges in probability to `0`. +Then `Y n` converges in distribution to `Z`. -/ +lemma tendstoInDistribution_of_tendstoInMeasure_sub + [l.IsCountablyGenerated] (Y : ι → Ω → E) (Z : Ω → E) + (hXZ : TendstoInDistribution X l Z μ) (hXY : TendstoInMeasure μ (Y - X) l 0) + (hY : ∀ i, AEMeasurable (Y i) μ) : + TendstoInDistribution Y l Z μ := by + have hZ : AEMeasurable Z μ := hXZ.aemeasurable_limit + have hX : ∀ i, AEMeasurable (X i) μ := hXZ.forall_aemeasurable + rcases isEmpty_or_nonempty E with hE | hE + · simp + let x₀ : E := hE.some + refine ⟨hY, hZ, ?_⟩ + -- We show convergence in distribution by verifying the convergence of integrals of any bounded + -- Lipschitz function `F` + suffices ∀ (F : E → ℝ) (hF_bounded : ∃ (C : ℝ), ∀ x y, dist (F x) (F y) ≤ C) + (hF_lip : ∃ L, LipschitzWith L F), + Tendsto (fun n ↦ ∫ ω, F ω ∂(μ.map (Y n))) l (𝓝 (∫ ω, F ω ∂(μ.map Z))) by + rwa [tendsto_iff_forall_lipschitz_integral_tendsto] + rintro F ⟨M, hF_bounded⟩ ⟨L, hF_lip⟩ + have hF_cont : Continuous F := hF_lip.continuous + -- If `F` is 0-Lipschitz, then it is constant, and all integrals are equal to that constant + obtain rfl | hL := eq_zero_or_pos L + · simp only [LipschitzWith.zero_iff] at hF_lip + specialize hF_lip x₀ + simp only [← hF_lip, integral_const, smul_eq_mul] + have h_prob n : IsProbabilityMeasure (μ.map (Y n)) := Measure.isProbabilityMeasure_map (hY n) + have : IsProbabilityMeasure (μ.map Z) := Measure.isProbabilityMeasure_map hZ + simpa using tendsto_const_nhds + -- now `F` is `L`-Lipschitz with `L > 0` + simp_rw [Metric.tendsto_nhds, Real.dist_eq] + suffices ∀ ε > 0, ∀ᶠ n in l, |∫ ω, F ω ∂(μ.map (Y n)) - ∫ ω, F ω ∂(μ.map Z)| < L * ε by + intro ε hε + convert this (ε / L) (by positivity) + field_simp + intro ε hε + -- We cut the difference into three pieces, two of which are small by the convergence assumptions + have h_le n : |∫ ω, F ω ∂(μ.map (Y n)) - ∫ ω, F ω ∂(μ.map Z)| + ≤ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Y n ω - X n ω‖} + + |∫ ω, F ω ∂(μ.map (X n)) - ∫ ω, F ω ∂(μ.map Z)| := by + refine (abs_sub_le (∫ ω, F ω ∂(μ.map (Y n))) (∫ ω, F ω ∂(μ.map (X n))) + (∫ ω, F ω ∂(μ.map Z))).trans ?_ + gcongr + -- `⊢ |∫ ω, F ω ∂(μ.map (Y n)) - ∫ ω, F ω ∂(μ.map (X n))|` + -- ` ≤ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Y n ω - X n ω‖}` + -- We prove integrability of the functions involved to be able to manipulate the integrals. + have h_int_Y : Integrable (fun x ↦ F (Y n x)) μ := by + refine Integrable.of_bound (by fun_prop) (‖F x₀‖ + M) (ae_of_all _ fun a ↦ ?_) + specialize hF_bounded (Y n a) x₀ + rw [← sub_le_iff_le_add'] + exact (abs_sub_abs_le_abs_sub (F (Y n a)) (F x₀)).trans hF_bounded + have h_int_X : Integrable (fun x ↦ F (X n x)) μ := by + refine Integrable.of_bound (by fun_prop) (‖F x₀‖ + M) (ae_of_all _ fun a ↦ ?_) + specialize hF_bounded (X n a) x₀ + rw [← sub_le_iff_le_add'] + exact (abs_sub_abs_le_abs_sub (F (X n a)) (F x₀)).trans hF_bounded + have h_int_sub : Integrable (fun a ↦ ‖F (Y n a) - F (X n a)‖) μ := by + rw [integrable_norm_iff (by fun_prop)] + exact h_int_Y.sub h_int_X + -- Now we prove the inequality + rw [integral_map (by fun_prop) (by fun_prop), integral_map (by fun_prop) (by fun_prop), + ← integral_sub h_int_Y h_int_X, ← Real.norm_eq_abs] + calc ‖∫ a, F (Y n a) - F (X n a) ∂μ‖ + _ ≤ ∫ a, ‖F (Y n a) - F (X n a)‖ ∂μ := norm_integral_le_integral_norm _ + -- Either `‖Y n x - X n x‖` is smaller than `ε / 2`, or it is not + _ = ∫ a in {x | ‖Y n x - X n x‖ < ε / 2}, ‖F (Y n a) - F (X n a)‖ ∂μ + + ∫ a in {x | ε / 2 ≤ ‖Y n x - X n x‖}, ‖F (Y n a) - F (X n a)‖ ∂μ := by + symm + simp_rw [← not_lt] + refine integral_add_compl₀ ?_ h_int_sub + exact nullMeasurableSet_lt (by fun_prop) (by fun_prop) + -- If it is smaller, we use the Lipschitz property of `F` + -- If not, we use the boundedness of `F`. + _ ≤ ∫ a in {x | ‖Y n x - X n x‖ < ε / 2}, L * (ε / 2) ∂μ + + ∫ a in {x | ε / 2 ≤ ‖Y n x - X n x‖}, M ∂μ := by + gcongr ?_ + ?_ + · refine setIntegral_mono_on₀ h_int_sub.integrableOn integrableOn_const ?_ ?_ + · exact nullMeasurableSet_lt (by fun_prop) (by fun_prop) + · exact fun x hx ↦ hF_lip.norm_sub_le_of_le hx.le + · refine setIntegral_mono h_int_sub.integrableOn integrableOn_const fun a ↦ ?_ + rw [← dist_eq_norm] + convert hF_bounded _ _ + -- The goal is now a simple computation + _ = L * (ε / 2) * μ.real {x | ‖Y n x - X n x‖ < ε / 2} + + M * μ.real {ω | ε / 2 ≤ ‖Y n ω - X n ω‖} := by + simp only [integral_const, MeasurableSet.univ, measureReal_restrict_apply, Set.univ_inter, + smul_eq_mul] + ring + _ ≤ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Y n ω - X n ω‖} := by + rw [mul_assoc] + gcongr + grw [measureReal_le_one, mul_one] + -- We finally show that the right-hand side tends to `L * ε / 2`, which is smaller than `L * ε` + have h_tendsto : + Tendsto (fun n ↦ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Y n ω - X n ω‖} + + |∫ ω, F ω ∂(μ.map (X n)) - ∫ ω, F ω ∂(μ.map Z)|) l (𝓝 (L * ε / 2)) := by + suffices Tendsto (fun n ↦ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Y n ω - X n ω‖} + + |∫ ω, F ω ∂(μ.map (X n)) - ∫ ω, F ω ∂(μ.map Z)|) l (𝓝 (L * ε / 2 + M * 0 + 0)) by + simpa + refine (Tendsto.add ?_ (Tendsto.const_mul _ ?_)).add ?_ + · rw [mul_div_assoc] + exact tendsto_const_nhds + · simp only [tendstoInMeasure_iff_measureReal_norm, Pi.zero_apply, sub_zero] at hXY + exact hXY (ε / 2) (by positivity) + · replace hXZ := hXZ.tendsto + simp_rw [tendsto_iff_forall_lipschitz_integral_tendsto] at hXZ + simpa [tendsto_iff_dist_tendsto_zero] using hXZ F ⟨M, hF_bounded⟩ ⟨L, hF_lip⟩ + have h_lt : L * ε / 2 < L * ε := half_lt_self (by positivity) + filter_upwards [h_tendsto.eventually_lt_const h_lt] with n hn using (h_le n).trans_lt hn + +/-- Convergence in probability (`TendstoInMeasure`) implies convergence in distribution +(`TendstoInDistribution`). -/ +lemma TendstoInMeasure.tendstoInDistribution_of_aemeasurable [l.IsCountablyGenerated] + (h : TendstoInMeasure μ X l Z) (hX : ∀ i, AEMeasurable (X i) μ) (hZ : AEMeasurable Z μ) : + TendstoInDistribution X l Z μ := + tendstoInDistribution_of_tendstoInMeasure_sub X Z (tendstoInDistribution_const hZ) + (by simpa [tendstoInMeasure_iff_norm] using h) hX + +/-- Convergence in probability (`TendstoInMeasure`) implies convergence in distribution +(`TendstoInDistribution`). -/ +lemma TendstoInMeasure.tendstoInDistribution [l.NeBot] [l.IsCountablyGenerated] + (h : TendstoInMeasure μ X l Z) (hX : ∀ i, AEMeasurable (X i) μ) : + TendstoInDistribution X l Z μ := h.tendstoInDistribution_of_aemeasurable hX (h.aemeasurable hX) + +/-- **Slutsky's theorem**: if `X n` converges in distribution to `Z`, and `Y n` converges in +probability to a constant `c`, then the pair `(X n, Y n)` converges in distribution to `(Z, c)`. -/ +theorem TendstoInDistribution.prodMk_of_tendstoInMeasure_const + {E' : Type*} {mE' : MeasurableSpace E'} [SeminormedAddCommGroup E'] [SecondCountableTopology E'] + [BorelSpace E'] + [l.IsCountablyGenerated] (X : ι → Ω → E) (Y : ι → Ω → E') (Z : Ω → E) + {c : E'} (hXZ : TendstoInDistribution X l Z μ) + (hY : TendstoInMeasure μ (fun n ↦ Y n) l (fun _ ↦ c)) + (hY_meas : ∀ i, AEMeasurable (Y i) μ) : + TendstoInDistribution (fun n ω ↦ (X n ω, Y n ω)) l (fun ω ↦ (Z ω, c)) μ := by + have hX : ∀ i, AEMeasurable (X i) μ := hXZ.forall_aemeasurable + have hZ : AEMeasurable Z μ := hXZ.aemeasurable_limit + refine tendstoInDistribution_of_tendstoInMeasure_sub (X := fun n ω ↦ (X n ω, c)) + (Y := fun n ω ↦ (X n ω, Y n ω)) (Z := fun ω ↦ (Z ω, c)) (μ := μ) (l := l) ?_ ?_ (by fun_prop) + · replace hXZ := hXZ.tendsto + refine ⟨by fun_prop, by fun_prop, ?_⟩ + rw [ProbabilityMeasure.tendsto_iff_forall_integral_tendsto] at hXZ ⊢ + intro F + let Fc : BoundedContinuousFunction E ℝ := ⟨⟨fun x ↦ F (x, c), by fun_prop⟩, by + obtain ⟨C, hC⟩ := F.map_bounded' + exact ⟨C, fun x y ↦ hC (x, c) (y, c)⟩⟩ + have h_eq (f : Ω → E) (hf : AEMeasurable f μ) : + ∫ ω, F ω ∂μ.map (fun ω ↦ (f ω, c)) = ∫ ω, F (ω, c) ∂(μ.map f) := by + rw [integral_map (by fun_prop) (by fun_prop), integral_map (by fun_prop) (by fun_prop)] + simp_rw [ProbabilityMeasure.coe_mk, h_eq (X _) (hX _), h_eq Z hZ] + simpa using hXZ Fc + · suffices TendstoInMeasure μ (fun n ω ↦ ((0 : E), Y n ω - c)) l 0 by + convert this with n ω + simp + simpa [tendstoInMeasure_iff_norm] using hY + +/-- **Slutsky's theorem** for a continuous function: if `X n` converges in distribution to `Z`, + `Y n` converges in probability to a constant `c`, and `g` is a continuous function, then + `g (X n, Y n)` converges in distribution to `g (Z, c)`. -/ +theorem TendstoInDistribution.continuous_comp_prodMk_of_tendstoInMeasure_const {E' F : Type*} + {mE' : MeasurableSpace E'} [SeminormedAddCommGroup E'] [SecondCountableTopology E'] + [BorelSpace E'] + [TopologicalSpace F] [MeasurableSpace F] [BorelSpace F] {g : E × E' → F} (hg : Continuous g) + [l.IsCountablyGenerated] {X : ι → Ω → E} {Y : ι → Ω → E'} + {c : E'} (hXZ : TendstoInDistribution X l Z μ) + (hY_tendsto : TendstoInMeasure μ (fun n ↦ Y n) l (fun _ ↦ c)) (hY : ∀ i, AEMeasurable (Y i) μ) : + TendstoInDistribution (fun n ω ↦ g (X n ω, Y n ω)) l (fun ω ↦ g (Z ω, c)) μ := by + refine TendstoInDistribution.continuous_comp hg ?_ + exact hXZ.prodMk_of_tendstoInMeasure_const X Y Z hY_tendsto hY + +lemma TendstoInDistribution.add_of_tendstoInMeasure_const + [l.IsCountablyGenerated] {c : E} (hXZ : TendstoInDistribution X l Z μ) + (hY_tendsto : TendstoInMeasure μ (fun n ↦ Y n) l (fun _ ↦ c)) (hY : ∀ i, AEMeasurable (Y i) μ) : + TendstoInDistribution (fun n ↦ X n + Y n) l (fun ω ↦ Z ω + c) μ := + hXZ.continuous_comp_prodMk_of_tendstoInMeasure_const + (g := fun (x : E × E) ↦ x.1 + x.2) (by fun_prop) hY_tendsto hY + end MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/ConvergenceInMeasure.lean b/Mathlib/MeasureTheory/Function/ConvergenceInMeasure.lean index f15d73fcbcdead..afe04f4601022c 100644 --- a/Mathlib/MeasureTheory/Function/ConvergenceInMeasure.lean +++ b/Mathlib/MeasureTheory/Function/ConvergenceInMeasure.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Rémy Degenne, Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Kexing Ying -/ -import Mathlib.MeasureTheory.Function.Egorov -import Mathlib.MeasureTheory.Function.LpSpace.Complete +module + +public import Mathlib.MeasureTheory.Function.Egorov +public import Mathlib.MeasureTheory.Function.LpSpace.Complete /-! # Convergence in measure @@ -38,6 +40,8 @@ convergence in measure and other notions of convergence. in measure. -/ +@[expose] public section + open TopologicalSpace Filter @@ -67,6 +71,7 @@ lemma tendstoInMeasure_of_ne_top [EDist E] {f : ι → α → E} {l : Filter ι} simp · exact h ε hε hε_top +/-- `TendstoInMeasure` expressed with an extended norm instead of a distance. -/ theorem tendstoInMeasure_iff_enorm [SeminormedAddCommGroup E] {l : Filter ι} {f : ι → α → E} {g : α → E} : TendstoInMeasure μ f l g ↔ @@ -74,6 +79,20 @@ theorem tendstoInMeasure_iff_enorm [SeminormedAddCommGroup E] {l : Filter ι} {f simp_rw [← edist_eq_enorm_sub] exact ⟨fun h ε hε hε_top ↦ h ε hε, tendstoInMeasure_of_ne_top⟩ +/-- `TendstoInMeasure` expressed with the real-valued measure of a set defined with +an extended norm. + +The `IsFiniteMeasure` hypothesis is necessary, otherwise `μ.real {...}` could be zero because +the measure of the set is infinite. -/ +theorem tendstoInMeasure_iff_measureReal_enorm [SeminormedAddCommGroup E] [IsFiniteMeasure μ] + {l : Filter ι} {f : ι → α → E} {g : α → E} : + TendstoInMeasure μ f l g ↔ + ∀ ε, 0 < ε → ε ≠ ∞ → Tendsto (fun i ↦ μ.real { x | ε ≤ ‖f i x - g x‖ₑ }) l (𝓝 0) := by + rw [tendstoInMeasure_iff_enorm] + congr! with ε hε hε_top + simp_rw [measureReal_def, ENNReal.tendsto_toReal_zero_iff (fun _ ↦ measure_ne_top _ _)] + +/-- `TendstoInMeasure` expressed with a distance `dist` instead of an extended distance `edist`. -/ lemma tendstoInMeasure_iff_dist [PseudoMetricSpace E] {f : ι → α → E} {l : Filter ι} {g : α → E} : TendstoInMeasure μ f l g ↔ ∀ ε, 0 < ε → Tendsto (fun i => μ { x | ε ≤ dist (f i x) (g x) }) l (𝓝 0) := by @@ -84,12 +103,37 @@ lemma tendstoInMeasure_iff_dist [PseudoMetricSpace E] {f : ι → α → E} {l : convert h ε.toReal (ENNReal.toReal_pos hε.ne' hε_top) with i a rw [edist_dist, ENNReal.le_ofReal_iff_toReal_le hε_top (by positivity)] +/-- `TendstoInMeasure` expressed with the real-valued measure of a set defined with a distance. + +The `IsFiniteMeasure` hypothesis is necessary, otherwise `μ.real {...}` could be zero because +the measure of the set is infinite. -/ +lemma tendstoInMeasure_iff_measureReal_dist [PseudoMetricSpace E] [IsFiniteMeasure μ] + {f : ι → α → E} {l : Filter ι} {g : α → E} : + TendstoInMeasure μ f l g ↔ + ∀ ε, 0 < ε → Tendsto (fun i ↦ μ.real { x | ε ≤ dist (f i x) (g x) }) l (𝓝 0) := by + rw [tendstoInMeasure_iff_dist] + congr! with ε hε hε_top + simp_rw [measureReal_def, ENNReal.tendsto_toReal_zero_iff (fun _ ↦ measure_ne_top _ _)] + +/-- `TendstoInMeasure` expressed with a norm instead of a distance. -/ theorem tendstoInMeasure_iff_norm [SeminormedAddCommGroup E] {l : Filter ι} {f : ι → α → E} {g : α → E} : TendstoInMeasure μ f l g ↔ ∀ ε, 0 < ε → Tendsto (fun i => μ { x | ε ≤ ‖f i x - g x‖ }) l (𝓝 0) := by simp_rw [tendstoInMeasure_iff_dist, dist_eq_norm_sub] +/-- `TendstoInMeasure` expressed with the real-valued measure of a set defined with a norm. + +The `IsFiniteMeasure` hypothesis is necessary, otherwise `μ.real {...}` could be zero because +the measure of the set is infinite. -/ +lemma tendstoInMeasure_iff_measureReal_norm [SeminormedAddCommGroup E] [IsFiniteMeasure μ] + {l : Filter ι} {f : ι → α → E} {g : α → E} : + TendstoInMeasure μ f l g ↔ + ∀ ε, 0 < ε → Tendsto (fun i ↦ μ.real { x | ε ≤ ‖f i x - g x‖ }) l (𝓝 0) := by + rw [tendstoInMeasure_iff_norm] + congr! with ε hε hε_top + simp_rw [measureReal_def, ENNReal.tendsto_toReal_zero_iff (fun _ ↦ measure_ne_top _ _)] + theorem tendstoInMeasure_iff_tendsto_toNNReal [EDist E] [IsFiniteMeasure μ] {f : ι → α → E} {l : Filter ι} {g : α → E} : TendstoInMeasure μ f l g ↔ @@ -291,19 +335,16 @@ theorem exists_seq_tendstoInMeasure_atTop_iff [IsFiniteMeasure μ] TendstoInMeasure μ f atTop g ↔ ∀ ns : ℕ → ℕ, StrictMono ns → ∃ ns' : ℕ → ℕ, StrictMono ns' ∧ ∀ᵐ (ω : α) ∂μ, Tendsto (fun i ↦ f (ns (ns' i)) ω) atTop (𝓝 (g ω)) := by - refine ⟨fun hfg _ hns ↦ (hfg.comp hns.tendsto_atTop).exists_seq_tendsto_ae, - not_imp_not.mp (fun h1 ↦ ?_)⟩ - rw [tendstoInMeasure_iff_tendsto_toNNReal] at h1 - push_neg at * - obtain ⟨ε, hε, h2⟩ := h1 + refine ⟨fun hfg _ hns ↦ (hfg.comp hns.tendsto_atTop).exists_seq_tendsto_ae, fun h1 ↦ ?_⟩ + rw [tendstoInMeasure_iff_tendsto_toNNReal] + by_contra! h; rcases h with ⟨ε, hε, h2⟩ obtain ⟨δ, ns, hδ, hns, h3⟩ : ∃ (δ : ℝ≥0) (ns : ℕ → ℕ), 0 < δ ∧ StrictMono ns ∧ ∀ n, δ ≤ (μ {x | ε ≤ edist (f (ns n) x) (g x)}).toNNReal := by obtain ⟨s, hs, h4⟩ := not_tendsto_iff_exists_frequently_notMem.1 h2 obtain ⟨δ, hδ, h5⟩ := NNReal.nhds_zero_basis.mem_iff.1 hs obtain ⟨ns, hns, h6⟩ := extraction_of_frequently_atTop h4 exact ⟨δ, ns, hδ, hns, fun n ↦ Set.notMem_Iio.1 (Set.notMem_subset h5 (h6 n))⟩ - refine ⟨ns, hns, fun ns' _ ↦ ?_⟩ - by_contra h6 + obtain ⟨ns', _, h6⟩ := h1 ns hns have h7 := tendstoInMeasure_iff_tendsto_toNNReal.mp <| tendstoInMeasure_of_tendsto_ae (fun n ↦ hf _) h6 exact lt_irrefl _ (lt_of_le_of_lt (ge_of_tendsto' (h7 ε hε) (fun n ↦ h3 _)) hδ) @@ -325,7 +366,7 @@ end TendstoInMeasureUnique section AEMeasurableOf -variable [MeasurableSpace E] [NormedAddCommGroup E] [BorelSpace E] +variable [MeasurableSpace E] [SeminormedAddCommGroup E] [BorelSpace E] theorem TendstoInMeasure.aemeasurable {u : Filter ι} [NeBot u] [IsCountablyGenerated u] {f : ι → α → E} {g : α → E} (hf : ∀ n, AEMeasurable (f n) μ) @@ -337,12 +378,13 @@ end AEMeasurableOf section TendstoInMeasureOf -variable [NormedAddCommGroup E] {p : ℝ≥0∞} +variable {p : ℝ≥0∞} variable {f : ι → α → E} {g : α → E} /-- This lemma is superseded by `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` where we allow `p = ∞` and only require `AEStronglyMeasurable`. -/ -theorem tendstoInMeasure_of_tendsto_eLpNorm_of_stronglyMeasurable (hp_ne_zero : p ≠ 0) +theorem tendstoInMeasure_of_tendsto_eLpNorm_of_stronglyMeasurable [SeminormedAddCommGroup E] + (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g) {l : Filter ι} (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g := by @@ -364,7 +406,8 @@ theorem tendstoInMeasure_of_tendsto_eLpNorm_of_stronglyMeasurable (hp_ne_zero : /-- This lemma is superseded by `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` where we allow `p = ∞`. -/ -theorem tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) +theorem tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top [SeminormedAddCommGroup E] + (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : AEStronglyMeasurable g μ) {l : Filter ι} (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g := by refine TendstoInMeasure.congr (fun i => (hf i).ae_eq_mk.symm) hg.ae_eq_mk.symm ?_ @@ -377,7 +420,7 @@ theorem tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top (hp_ne_zero : p ≠ 0) (hp /-- See also `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` which work for general Lp-convergence for all `p ≠ 0`. -/ -theorem tendstoInMeasure_of_tendsto_eLpNorm_top {E} [NormedAddCommGroup E] {f : ι → α → E} +theorem tendstoInMeasure_of_tendsto_eLpNorm_top {E} [SeminormedAddCommGroup E] {f : ι → α → E} {g : α → E} {l : Filter ι} (hfg : Tendsto (fun n => eLpNorm (f n - g) ∞ μ) l (𝓝 0)) : TendstoInMeasure μ f l g := by refine tendstoInMeasure_of_ne_top fun δ hδ hδ_top ↦ ?_ @@ -394,7 +437,8 @@ theorem tendstoInMeasure_of_tendsto_eLpNorm_top {E} [NormedAddCommGroup E] {f : simp [edist_eq_enorm_sub] /-- Convergence in Lp implies convergence in measure. -/ -theorem tendstoInMeasure_of_tendsto_eLpNorm {l : Filter ι} (hp_ne_zero : p ≠ 0) +theorem tendstoInMeasure_of_tendsto_eLpNorm [NormedAddCommGroup E] + {l : Filter ι} (hp_ne_zero : p ≠ 0) (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : AEStronglyMeasurable g μ) (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g := by by_cases hp_ne_top : p = ∞ @@ -403,7 +447,8 @@ theorem tendstoInMeasure_of_tendsto_eLpNorm {l : Filter ι} (hp_ne_zero : p ≠ · exact tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top hp_ne_zero hp_ne_top hf hg hfg /-- Convergence in Lp implies convergence in measure. -/ -theorem tendstoInMeasure_of_tendsto_Lp [hp : Fact (1 ≤ p)] {f : ι → Lp E p μ} {g : Lp E p μ} +theorem tendstoInMeasure_of_tendsto_Lp [NormedAddCommGroup E] [hp : Fact (1 ≤ p)] + {f : ι → Lp E p μ} {g : Lp E p μ} {l : Filter ι} (hfg : Tendsto f l (𝓝 g)) : TendstoInMeasure μ (fun n => f n) l g := tendstoInMeasure_of_tendsto_eLpNorm (zero_lt_one.trans_le hp.elim).ne.symm (fun _ => Lp.aestronglyMeasurable _) (Lp.aestronglyMeasurable _) diff --git a/Mathlib/MeasureTheory/Function/Egorov.lean b/Mathlib/MeasureTheory/Function/Egorov.lean index 3e999ae6c36177..801e03478910d8 100644 --- a/Mathlib/MeasureTheory/Function/Egorov.lean +++ b/Mathlib/MeasureTheory/Function/Egorov.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +module + +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic /-! # Egorov theorem @@ -20,6 +22,8 @@ convergence in measure. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/EssSup.lean b/Mathlib/MeasureTheory/Function/EssSup.lean index 54d193e3bca8bd..c3ad81127a3ea2 100644 --- a/Mathlib/MeasureTheory/Function/EssSup.lean +++ b/Mathlib/MeasureTheory/Function/EssSup.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order -import Mathlib.MeasureTheory.Measure.Count -import Mathlib.Order.Filter.ENNReal -import Mathlib.Probability.UniformOn +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +public import Mathlib.MeasureTheory.Measure.Count +public import Mathlib.Order.Filter.ENNReal +public import Mathlib.Probability.UniformOn /-! # Essential supremum and infimum @@ -28,6 +30,8 @@ sense). We do not define that quantity here, which is simply the supremum of a m * `essInf f μ := (ae μ).liminf f` -/ +@[expose] public section + open Filter MeasureTheory ProbabilityTheory Set TopologicalSpace open scoped ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Function/FactorsThrough.lean b/Mathlib/MeasureTheory/Function/FactorsThrough.lean index 8f4041188e7c8e..788259e9d8b063 100644 --- a/Mathlib/MeasureTheory/Function/FactorsThrough.lean +++ b/Mathlib/MeasureTheory/Function/FactorsThrough.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Constructions.Polish.StronglyMeasurable -import Mathlib.Probability.Process.Filtration +module + +public import Mathlib.MeasureTheory.Constructions.Polish.StronglyMeasurable +public import Mathlib.Probability.Process.Filtration /-! # Factorization of a map from measurability @@ -18,6 +20,8 @@ This is the content of the [Doob-Dynkin lemma](https://en.wikipedia.org/wiki/Doo see `exists_eq_measurable_comp`. -/ +@[expose] public section + namespace MeasureTheory open Filter Filtration Set TopologicalSpace diff --git a/Mathlib/MeasureTheory/Function/Floor.lean b/Mathlib/MeasureTheory/Function/Floor.lean index 31f217515eaedf..a130c0e0bfdc2e 100644 --- a/Mathlib/MeasureTheory/Function/Floor.lean +++ b/Mathlib/MeasureTheory/Function/Floor.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order /-! # Measurability of `⌊x⌋` etc @@ -12,6 +14,8 @@ In this file we prove that `Int.floor`, `Int.ceil`, `Int.fract`, `Nat.floor`, an measurable under some assumptions on the (semi)ring. -/ +@[expose] public section + open Set diff --git a/Mathlib/MeasureTheory/Function/Holder.lean b/Mathlib/MeasureTheory/Function/Holder.lean index 09f726bf3977f6..807765aea70258 100644 --- a/Mathlib/MeasureTheory/Function/Holder.lean +++ b/Mathlib/MeasureTheory/Function/Holder.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.MeasureTheory.Integral.Bochner.Basic +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Basic /-! # Continuous bilinear maps on `MeasureTheory.Lp` spaces @@ -22,6 +24,8 @@ natural map `ContinuousLinearMap.lpPairing : Lp E p μ →L[𝕜] Lp F q μ →L is the natural map `Lp (StrongDual 𝕜 E) p μ →L[𝕜] StrongDual 𝕜 (Lp E q μ)`. -/ +@[expose] public section + open ENNReal MeasureTheory Lp open scoped NNReal diff --git a/Mathlib/MeasureTheory/Function/Intersectivity.lean b/Mathlib/MeasureTheory/Function/Intersectivity.lean index e9bd18e7adf815..b360f0a0985ff2 100644 --- a/Mathlib/MeasureTheory/Function/Intersectivity.lean +++ b/Mathlib/MeasureTheory/Function/Intersectivity.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.MeasureTheory.Integral.Average +module + +public import Mathlib.MeasureTheory.Integral.Average /-! # Bergelson's intersectivity lemma @@ -28,6 +30,8 @@ Use the ergodic theorem to deduce the refinement of the Poincaré recurrence the Bergelson. -/ +@[expose] public section + open Filter Function MeasureTheory Set open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Function/Jacobian.lean b/Mathlib/MeasureTheory/Function/Jacobian.lean index 8db5e6b9814390..733e717a69d6e3 100644 --- a/Mathlib/MeasureTheory/Function/Jacobian.lean +++ b/Mathlib/MeasureTheory/Function/Jacobian.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.FDeriv.Congr -import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap -import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.Analysis.Normed.Module.Ball.Pointwise -import Mathlib.MeasureTheory.Constructions.Polish.Basic -import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn -import Mathlib.Topology.Algebra.Module.Determinant +module + +public import Mathlib.Analysis.Calculus.FDeriv.Congr +public import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap +public import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.Analysis.Normed.Module.Ball.Pointwise +public import Mathlib.MeasureTheory.Constructions.Polish.Basic +public import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn +public import Mathlib.Topology.Algebra.Module.Determinant /-! # Change of variables in higher-dimensional integrals @@ -92,6 +94,8 @@ Change of variables in integrals [Fremlin, *Measure Theory* (volume 2)][fremlin_vol2] -/ +@[expose] public section + open MeasureTheory MeasureTheory.Measure Metric Filter Set Module Asymptotics TopologicalSpace diff --git a/Mathlib/MeasureTheory/Function/JacobianOneDim.lean b/Mathlib/MeasureTheory/Function/JacobianOneDim.lean index be5be77bf6af43..f1103522045ea8 100644 --- a/Mathlib/MeasureTheory/Function/JacobianOneDim.lean +++ b/Mathlib/MeasureTheory/Function/JacobianOneDim.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.MeasureTheory.Function.Jacobian +module + +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.MeasureTheory.Function.Jacobian /-! # Change of variable formulas for integrals in dimension 1 @@ -22,6 +24,8 @@ the change of variables formula in dimension 1 for non-monotone functions, formu the interval integral and with stronger requirements on the integrand. -/ +@[expose] public section + open MeasureTheory MeasureTheory.Measure Metric Filter Set Module Asymptotics TopologicalSpace ContinuousLinearMap diff --git a/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean b/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean index 57d559e725c6cb..648867cbc49e0f 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.MeasureTheory.Function.L1Space.Integrable +module + +public import Mathlib.MeasureTheory.Function.L1Space.Integrable /-! # `L¹` space @@ -25,6 +27,8 @@ function space, l1 -/ +@[expose] public section + noncomputable section open EMetric ENNReal Filter MeasureTheory NNReal Set diff --git a/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean b/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean index 7317a91730de9c..2676935f1da35d 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence -import Mathlib.MeasureTheory.Integral.Lebesgue.Norm -import Mathlib.MeasureTheory.Measure.WithDensity +module + +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.Lebesgue.Norm +public import Mathlib.MeasureTheory.Measure.WithDensity /-! # Function with finite integral @@ -25,6 +27,8 @@ finite integral -/ +@[expose] public section + noncomputable section open Topology ENNReal MeasureTheory NNReal diff --git a/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean b/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean index 45ebd151fc845a..7f598de617eaf5 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.MeasureTheory.Function.L1Space.HasFiniteIntegral -import Mathlib.MeasureTheory.Function.LpOrder -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas +module + +public import Mathlib.MeasureTheory.Function.L1Space.HasFiniteIntegral +public import Mathlib.MeasureTheory.Function.LpOrder +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas /-! # Integrable functions @@ -33,6 +35,8 @@ integrable -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/L2Space.lean b/Mathlib/MeasureTheory/Function/L2Space.lean index 89f16296648e0b..ce1011e21188be 100644 --- a/Mathlib/MeasureTheory/Function/L2Space.lean +++ b/Mathlib/MeasureTheory/Function/L2Space.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.InnerProductSpace.LinearMap -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +module + +public import Mathlib.Analysis.InnerProductSpace.LinearMap +public import Mathlib.Analysis.RCLike.Lemmas +public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap /-! # `L^2` space @@ -24,6 +26,8 @@ is also an inner product space, with inner product defined as `inner f g := ∫ * `L2.innerProductSpace` : `Lp E 2 μ` is an inner product space. -/ +@[expose] public section + noncomputable section open TopologicalSpace MeasureTheory MeasureTheory.Lp Filter diff --git a/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean b/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean index cc63d0429e7473..dad3cdd414879c 100644 --- a/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean +++ b/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Integral.IntegrableOn +module + +public import Mathlib.MeasureTheory.Integral.IntegrableOn /-! # Locally integrable functions @@ -22,6 +24,8 @@ on compact sets. integrable on `s`. -/ +@[expose] public section + open MeasureTheory MeasureTheory.Measure Set Function TopologicalSpace Bornology open scoped Topology Interval ENNReal diff --git a/Mathlib/MeasureTheory/Function/LpOrder.lean b/Mathlib/MeasureTheory/Function/LpOrder.lean index e160d005cb899b..e0c1a143cdee24 100644 --- a/Mathlib/MeasureTheory/Function/LpOrder.lean +++ b/Mathlib/MeasureTheory/Function/LpOrder.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.Normed.Order.Lattice -import Mathlib.MeasureTheory.Function.ConvergenceInMeasure -import Mathlib.MeasureTheory.Function.LpSpace.Basic +module + +public import Mathlib.Analysis.Normed.Order.Lattice +public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure +public import Mathlib.MeasureTheory.Function.LpSpace.Basic /-! # Order related properties of Lp spaces @@ -21,6 +23,8 @@ import Mathlib.MeasureTheory.Function.LpSpace.Basic -/ +@[expose] public section + open TopologicalSpace MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean index 8e8ae3c1effce9..fa06b678155662 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean @@ -3,17 +3,21 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Group.Indicator -import Mathlib.Data.Fintype.Order -import Mathlib.MeasureTheory.Function.AEEqFun -import Mathlib.MeasureTheory.Function.LpSeminorm.Defs -import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic -import Mathlib.MeasureTheory.Integral.Lebesgue.Countable -import Mathlib.MeasureTheory.Integral.Lebesgue.Sub +module + +public import Mathlib.Analysis.Normed.Group.Indicator +public import Mathlib.Data.Fintype.Order +public import Mathlib.MeasureTheory.Function.AEEqFun +public import Mathlib.MeasureTheory.Function.LpSeminorm.Defs +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +public import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +public import Mathlib.MeasureTheory.Integral.Lebesgue.Sub /-! # Basic theorems about ℒp space -/ + +@[expose] public section noncomputable section open TopologicalSpace MeasureTheory Filter diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/ChebyshevMarkov.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/ChebyshevMarkov.lean index 4e77f4515c3390..209ba6c3e790a7 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/ChebyshevMarkov.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/ChebyshevMarkov.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +module + +public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic /-! # Chebyshev-Markov inequality in terms of Lp seminorms @@ -11,6 +13,8 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.Basic In this file we formulate several versions of the Chebyshev-Markov inequality in terms of the `MeasureTheory.eLpNorm` seminorm. -/ + +@[expose] public section open scoped NNReal ENNReal namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean index 89c5b736953ea8..8a69d2bdbafd4d 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Eric Wieser -/ -import Mathlib.Data.ENNReal.Holder -import Mathlib.MeasureTheory.Function.LpSeminorm.Basic -import Mathlib.MeasureTheory.Integral.MeanInequalities +module + +public import Mathlib.Data.ENNReal.Holder +public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +public import Mathlib.MeasureTheory.Integral.MeanInequalities /-! # Compare Lp seminorms for different values of `p` @@ -14,6 +16,8 @@ In this file we compare `MeasureTheory.eLpNorm'` and `MeasureTheory.eLpNorm` for exponents. -/ +@[expose] public section + open Filter ENNReal open scoped Topology diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/Defs.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/Defs.lean index e2cd900e194f26..ec31bfeb892d11 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/Defs.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.MeasureTheory.Function.EssSup -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.MeasureTheory.Function.EssSup +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic /-! # ℒp space @@ -31,6 +33,8 @@ and is almost everywhere strongly measurable. -/ +@[expose] public section + noncomputable section open scoped NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/Prod.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/Prod.lean index 4193ea638e3cd8..ff6b775876748b 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/Prod.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/Prod.lean @@ -3,15 +3,18 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ +module -import Mathlib.MeasureTheory.Function.LpSeminorm.Basic -import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +public import Mathlib.MeasureTheory.Measure.Prod /-! # ℒp spaces and products -/ +@[expose] public section + open scoped ENNReal namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean index 4b2e6ad5ad995a..fff3fb6963c554 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.LpSeminorm.Basic -import Mathlib.MeasureTheory.Integral.MeanInequalities +module + +public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +public import Mathlib.MeasureTheory.Integral.MeanInequalities /-! # Triangle inequality for `Lp`-seminorm @@ -13,6 +15,8 @@ In this file we prove several versions of the triangle inequality for the `Lp` s as well as simple corollaries. -/ +@[expose] public section + open Filter open scoped ENNReal Topology diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/Trim.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/Trim.lean index 9560199dd59e64..2bc0c1289f7948 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/Trim.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/Trim.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +module + +public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic /-! # Lp seminorm with respect to trimmed measure @@ -12,6 +14,8 @@ In this file we prove basic properties of the Lp-seminorm of a function with respect to the restriction of a measure to a sub-σ-algebra. -/ +@[expose] public section + namespace MeasureTheory open Filter diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index df8d1e310b65b3..2fb91cf97cde4e 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Operator.NNNorm -import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov -import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp -import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality +module + +public import Mathlib.Analysis.Normed.Operator.NNNorm +public import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov +public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp +public import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality /-! # Lp space @@ -54,6 +56,8 @@ of the coercions of `f` and `g`. All such lemmas use `coeFn` in their name, to d function coercion from the coercion to almost everywhere defined functions. -/ +@[expose] public section + noncomputable section open MeasureTheory Filter diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Complete.lean b/Mathlib/MeasureTheory/Function/LpSpace/Complete.lean index 288ee3d84974d5..61059f5afc3e24 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Complete.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Complete.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.MeasureTheory.Function.LpSpace.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.MeasureTheory.Function.LpSpace.Basic /-! # `Lp` is a complete space @@ -13,6 +15,8 @@ In this file we show that `Lp` is a complete space for `1 ≤ p`, in `MeasureTheory.Lp.instCompleteSpace`. -/ +@[expose] public section + open MeasureTheory Filter open scoped ENNReal Topology diff --git a/Mathlib/MeasureTheory/Function/LpSpace/ContinuousCompMeasurePreserving.lean b/Mathlib/MeasureTheory/Function/LpSpace/ContinuousCompMeasurePreserving.lean index 27de7c2bfb1ac3..fe84fdf8f93994 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/ContinuousCompMeasurePreserving.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/ContinuousCompMeasurePreserving.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp -import Mathlib.MeasureTheory.Measure.ContinuousPreimage +module + +public import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +public import Mathlib.MeasureTheory.Measure.ContinuousPreimage /-! # Continuity of `MeasureTheory.Lp.compMeasurePreserving` @@ -21,6 +23,8 @@ defined on `MeasureTheory.Lp E p ν × {f : C(X, Y) // MeasurePreserving f μ ν Finally, we provide dot notation convenience lemmas. -/ +@[expose] public section + open Filter Set MeasureTheory open scoped ENNReal Topology symmDiff diff --git a/Mathlib/MeasureTheory/Function/LpSpace/ContinuousFunctions.lean b/Mathlib/MeasureTheory/Function/LpSpace/ContinuousFunctions.lean index 8e8dd6fad3baaf..3c8efa6dff2bac 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/ContinuousFunctions.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/ContinuousFunctions.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Operator.NormedSpace -import Mathlib.MeasureTheory.Function.LpSpace.Basic -import Mathlib.MeasureTheory.Measure.OpenPos -import Mathlib.Topology.ContinuousMap.Compact +module + +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.MeasureTheory.Function.LpSpace.Basic +public import Mathlib.MeasureTheory.Measure.OpenPos +public import Mathlib.Topology.ContinuousMap.Compact /-! # Continuous functions in Lp space @@ -17,6 +19,8 @@ as `BoundedContinuousFunction.toLp`. -/ +@[expose] public section + open BoundedContinuousFunction MeasureTheory Filter open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Basic.lean index 3deffc070711be..0c3c7410c37aab 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Function.AEEqFun.DomAct -import Mathlib.MeasureTheory.Function.LpSpace.Indicator +module + +public import Mathlib.MeasureTheory.Function.AEEqFun.DomAct +public import Mathlib.MeasureTheory.Function.LpSpace.Indicator /-! # Action of `Mᵈᵐᵃ` on `Lᵖ` spaces @@ -16,6 +18,8 @@ and `c : M`, then `(.mk c : Mᵈᵐᵃ) • [f]` is represented by the function We also prove basic properties of this action. -/ +@[expose] public section + open MeasureTheory Filter open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Continuous.lean b/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Continuous.lean index 9e649b4cf39559..82adc156c1ea31 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Continuous.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/DomAct/Continuous.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic -import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving -import Mathlib.Topology.Algebra.Constructions.DomMulAct +module + +public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic +public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving +public import Mathlib.Topology.Algebra.Constructions.DomMulAct +import all Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic -- for `to_additive` to unfold proof /-! # Continuity of the action of `Mᵈᵐᵃ` on `MeasureSpace.Lp E p μ` @@ -31,6 +34,8 @@ and `μ` is the Haar measure. measure theory, group action, domain action, continuous action, Lp space -/ +@[expose] public section + open scoped ENNReal open DomMulAct diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Indicator.lean b/Mathlib/MeasureTheory/Function/LpSpace/Indicator.lean index 9c7bf04b5a3260..8b7e00a5190df2 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Indicator.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Indicator.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.MeasureTheory.Function.LpSpace.Basic -import Mathlib.MeasureTheory.Measure.Real -import Mathlib.Order.Filter.IndicatorFunction +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.MeasureTheory.Function.LpSpace.Basic +public import Mathlib.MeasureTheory.Measure.Real +public import Mathlib.Order.Filter.IndicatorFunction /-! # Indicator of a set as an element of `Lp` @@ -20,6 +22,8 @@ For a set `s` with `(hs : MeasurableSet s)` and `(hμs : μ s < ∞)`, we build * `MeasureTheory.Lp.const`: Constant function as an element of `Lp` for a finite measure. -/ +@[expose] public section + noncomputable section open MeasureTheory Filter diff --git a/Mathlib/MeasureTheory/Function/SimpleFunc.lean b/Mathlib/MeasureTheory/Function/SimpleFunc.lean index 199874f960f739..d505a1da48c3b5 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFunc.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFunc.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Algebra.Order.Pi -import Mathlib.Algebra.Algebra.Pi -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +module + +public import Mathlib.Algebra.Order.Pi +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order /-! # Simple functions @@ -21,6 +23,8 @@ characteristic functions and is closed under addition and supremum of increasing functions. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean b/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean index 421a54d9ab865a..b8d306200ad70b 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth -/ -import Mathlib.MeasureTheory.Function.SimpleFunc -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable +module + +public import Mathlib.MeasureTheory.Function.SimpleFunc +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable /-! # Density of simple functions @@ -31,6 +33,8 @@ by a sequence of simple functions. * `α →ₛ β` (local notation): the type of simple functions `α → β`. -/ +@[expose] public section + open Set Function Filter TopologicalSpace EMetric MeasureTheory open scoped Topology ENNReal diff --git a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean index 19b0ef5f3b07d1..00802641a237a7 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth -/ -import Mathlib.MeasureTheory.Function.L1Space.AEEqFun -import Mathlib.MeasureTheory.Function.LpSpace.Complete -import Mathlib.MeasureTheory.Function.LpSpace.Indicator +module + +public import Mathlib.MeasureTheory.Function.L1Space.AEEqFun +public import Mathlib.MeasureTheory.Function.LpSpace.Complete +public import Mathlib.MeasureTheory.Function.LpSpace.Indicator /-! # Density of simple functions @@ -40,6 +42,8 @@ For `E` finite-dimensional, simple functions `α →ₛ E` are dense in L^∞ -- * `α →₁ₛ[μ] E`: the type of `L1` simple functions `α → β`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/SpecialFunctions/Arctan.lean b/Mathlib/MeasureTheory/Function/SpecialFunctions/Arctan.lean index 1aab3310c886a3..8e49fff257b5ef 100644 --- a/Mathlib/MeasureTheory/Function/SpecialFunctions/Arctan.lean +++ b/Mathlib/MeasureTheory/Function/SpecialFunctions/Arctan.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic /-! # Measurability of arctan -/ +@[expose] public section + namespace Real diff --git a/Mathlib/MeasureTheory/Function/SpecialFunctions/Basic.lean b/Mathlib/MeasureTheory/Function/SpecialFunctions/Basic.lean index 8b967764edb464..c982f5c85a6b63 100644 --- a/Mathlib/MeasureTheory/Function/SpecialFunctions/Basic.lean +++ b/Mathlib/MeasureTheory/Function/SpecialFunctions/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric -import Mathlib.MeasureTheory.Constructions.BorelSpace.Real +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Real /-! # Measurability of real and complex functions @@ -18,6 +20,8 @@ See also `MeasureTheory.Function.SpecialFunctions.Arctan` and `MeasureTheory.Function.SpecialFunctions.Inner`, which have been split off to minimize imports. -/ +@[expose] public section + -- Guard against import creep: assert_not_exists InnerProductSpace Real.arctan FiniteDimensional.proper diff --git a/Mathlib/MeasureTheory/Function/SpecialFunctions/Inner.lean b/Mathlib/MeasureTheory/Function/SpecialFunctions/Inner.lean index d5d0e5989ab71f..9330e08946b02f 100644 --- a/Mathlib/MeasureTheory/Function/SpecialFunctions/Inner.lean +++ b/Mathlib/MeasureTheory/Function/SpecialFunctions/Inner.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.InnerProductSpace.Continuous -import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex +module + +public import Mathlib.Analysis.InnerProductSpace.Continuous +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex /-! # Measurability of scalar products -/ +@[expose] public section + variable {α : Type*} {𝕜 : Type*} {E : Type*} variable [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] diff --git a/Mathlib/MeasureTheory/Function/SpecialFunctions/RCLike.lean b/Mathlib/MeasureTheory/Function/SpecialFunctions/RCLike.lean index 901f414e3c78c4..10bf5cb147d660 100644 --- a/Mathlib/MeasureTheory/Function/SpecialFunctions/RCLike.lean +++ b/Mathlib/MeasureTheory/Function/SpecialFunctions/RCLike.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex +module + +public import Mathlib.Analysis.RCLike.Lemmas +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex /-! # Measurability of the basic `RCLike` functions -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Function/SpecialFunctions/Sinc.lean b/Mathlib/MeasureTheory/Function/SpecialFunctions/Sinc.lean index 83e07db0ce7fce..760093006a8d00 100644 --- a/Mathlib/MeasureTheory/Function/SpecialFunctions/Sinc.lean +++ b/Mathlib/MeasureTheory/Function/SpecialFunctions/Sinc.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Sinc -import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic -import Mathlib.MeasureTheory.Function.L1Space.Integrable +module + +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Sinc +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +public import Mathlib.MeasureTheory.Function.L1Space.Integrable /-! # Measurability and integrability of the sinc function @@ -17,6 +19,8 @@ import Mathlib.MeasureTheory.Function.L1Space.Integrable -/ +@[expose] public section + open MeasureTheory variable {α : Type*} {_ : MeasurableSpace α} {f : α → ℝ} {μ : Measure α} diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean index 7d5621c12a18bd..3c8584f1245168 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +module + +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic /-! # Strongly measurable and finitely strongly measurable functions @@ -39,6 +41,8 @@ measurable functions, as a basis for the Bochner integral. -/ +@[expose] public section + open MeasureTheory Filter TopologicalSpace Function Set MeasureTheory.Measure open ENNReal Topology MeasureTheory NNReal diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean index f5d5aebee325f6..8f87d9fe9d6cb8 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Module.Basic -import Mathlib.MeasureTheory.Function.SimpleFuncDense +module + +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.MeasureTheory.Function.SimpleFuncDense /-! # Strongly measurable and finitely strongly measurable functions @@ -38,6 +40,8 @@ We provide a solid API for strongly measurable functions, as a basis for the Boc -/ +@[expose] public section + -- Guard against import creep assert_not_exists InnerProductSpace diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/ENNReal.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/ENNReal.lean index 8ea07df0066af1..119bb5f1398a77 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/ENNReal.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/ENNReal.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ +module -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Integral.Lebesgue.Add +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add /-! # Finitely strongly measurable functions with value in ENNReal @@ -15,6 +16,8 @@ whose support has finite measure. -/ +@[expose] public section + open MeasureTheory open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Inner.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Inner.lean index d70ac499372c9d..2b6f93704673fd 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Inner.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Inner.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.InnerProductSpace.Continuous -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +module + +public import Mathlib.Analysis.InnerProductSpace.Continuous +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable /-! # Inner products of strongly measurable functions are strongly measurable. -/ +@[expose] public section + variable {α 𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lemmas.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lemmas.lean index fb029669c12172..95c9ea36c1a05e 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lemmas.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lemmas.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Sébastien Gouëzel -/ -import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Measure.WithDensity -import Mathlib.Topology.Algebra.Module.FiniteDimension +module + +public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Measure.WithDensity +public import Mathlib.Topology.Algebra.Module.FiniteDimension /-! # Strongly measurable and finitely strongly measurable functions @@ -22,6 +24,8 @@ functions, started in `Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.l -/ +@[expose] public section + open MeasureTheory Filter Set ENNReal NNReal variable {α β γ : Type*} {m : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β] diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean index 8c9afa0ad46a6b..cb842ac33ded4a 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas +module + +public import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas /-! # Finitely strongly measurable functions in `Lp` @@ -24,6 +26,8 @@ Functions in `Lp` for `0 < p < ∞` are finitely strongly measurable. -/ +@[expose] public section + open MeasureTheory Filter TopologicalSpace Function diff --git a/Mathlib/MeasureTheory/Function/UnifTight.lean b/Mathlib/MeasureTheory/Function/UnifTight.lean index bb06f9c2c08546..8189b410b81da4 100644 --- a/Mathlib/MeasureTheory/Function/UnifTight.lean +++ b/Mathlib/MeasureTheory/Function/UnifTight.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Igor Khavkine. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Igor Khavkine -/ -import Mathlib.MeasureTheory.Function.ConvergenceInMeasure -import Mathlib.MeasureTheory.Function.UniformIntegrable +module + +public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure +public import Mathlib.MeasureTheory.Function.UniformIntegrable /-! # Uniform tightness @@ -21,7 +23,7 @@ is also proved later in the file. exists some measurable set `s` with finite measure such that the Lp-norm of `f i` restricted to `sᶜ` is smaller than `ε` for all `i`. -# Main results +## Main results * `MeasureTheory.unifTight_finite`: a finite sequence of Lp functions is uniformly tight. @@ -36,6 +38,8 @@ is also proved later in the file. uniform integrable, uniformly tight, Vitali convergence theorem -/ +@[expose] public section + namespace MeasureTheory open Set Filter Topology MeasureTheory NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Function/UniformIntegrable.lean b/Mathlib/MeasureTheory/Function/UniformIntegrable.lean index 3bf8d65858fd16..4752f9c23d5385 100644 --- a/Mathlib/MeasureTheory/Function/UniformIntegrable.lean +++ b/Mathlib/MeasureTheory/Function/UniformIntegrable.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Function.ConvergenceInMeasure -import Mathlib.MeasureTheory.Function.L1Space.Integrable +module + +public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure +public import Mathlib.MeasureTheory.Function.L1Space.Integrable /-! # Uniform integrability @@ -28,7 +30,7 @@ formulate the martingale convergence theorem. probability theory sense if it is uniformly integrable in the measure theory sense and has uniformly bounded Lp-norm. -# Main results +## Main results * `MeasureTheory.unifIntegrable_finite`: a finite sequence of Lp functions is uniformly integrable. @@ -42,6 +44,8 @@ formulate the martingale convergence theorem. uniform integrable, uniformly absolutely continuous integral, Vitali convergence theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Group/AEStabilizer.lean b/Mathlib/MeasureTheory/Group/AEStabilizer.lean index 2b1ba6c3cfdf57..baf412b2cb75a1 100644 --- a/Mathlib/MeasureTheory/Group/AEStabilizer.lean +++ b/Mathlib/MeasureTheory/Group/AEStabilizer.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Group.Action -import Mathlib.Order.Filter.EventuallyConst +module + +public import Mathlib.MeasureTheory.Group.Action +public import Mathlib.Order.Filter.EventuallyConst /-! # A.e. stabilizer of a set @@ -27,6 +29,8 @@ Also, many lemmas in this file are true for a *quasi-measure-preserving* action, but we don't have the corresponding typeclass. -/ +@[expose] public section + open Filter Set MeasureTheory open scoped Pointwise diff --git a/Mathlib/MeasureTheory/Group/Action.lean b/Mathlib/MeasureTheory/Group/Action.lean index c5a7aea72459cc..f4119cdeb5daa9 100644 --- a/Mathlib/MeasureTheory/Group/Action.lean +++ b/Mathlib/MeasureTheory/Group/Action.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.Dynamics.Minimal -import Mathlib.GroupTheory.GroupAction.Hom -import Mathlib.MeasureTheory.Group.MeasurableEquiv -import Mathlib.MeasureTheory.Measure.Regular -import Mathlib.MeasureTheory.Group.Defs -import Mathlib.Order.Filter.EventuallyConst +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.Dynamics.Minimal +public import Mathlib.GroupTheory.GroupAction.Hom +public import Mathlib.MeasureTheory.Group.MeasurableEquiv +public import Mathlib.MeasureTheory.Measure.Regular +public import Mathlib.MeasureTheory.Group.Defs +public import Mathlib.Order.Filter.EventuallyConst /-! # Measures invariant under group actions @@ -20,6 +22,8 @@ typeclass for measures invariant under action of an (additive or multiplicative) some basic properties of such measures. -/ +@[expose] public section + open scoped ENNReal NNReal Pointwise Topology open MeasureTheory.Measure Set Function Filter diff --git a/Mathlib/MeasureTheory/Group/AddCircle.lean b/Mathlib/MeasureTheory/Group/AddCircle.lean index 83bfea7b2dce3e..4973f04562b26c 100644 --- a/Mathlib/MeasureTheory/Group/AddCircle.lean +++ b/Mathlib/MeasureTheory/Group/AddCircle.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic -import Mathlib.Data.ZMod.QuotientGroup -import Mathlib.MeasureTheory.Group.AEStabilizer +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +public import Mathlib.Data.ZMod.QuotientGroup +public import Mathlib.MeasureTheory.Group.AEStabilizer /-! # Measure-theoretic results about the additive circle @@ -21,6 +23,8 @@ The file is a place to collect measure-theoretic results about the additive circ -/ +@[expose] public section + open Set Function Filter MeasureTheory MeasureTheory.Measure Metric diff --git a/Mathlib/MeasureTheory/Group/Arithmetic.lean b/Mathlib/MeasureTheory/Group/Arithmetic.lean index 5562855a861836..61e4e0759e172f 100644 --- a/Mathlib/MeasureTheory/Group/Arithmetic.lean +++ b/Mathlib/MeasureTheory/Group/Arithmetic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.AEMeasurable +module + +public import Mathlib.MeasureTheory.Measure.AEMeasurable /-! # Typeclasses for measurability of operations @@ -42,6 +44,8 @@ measurable function, arithmetic operator in the conclusion of `MeasurableSMul`.) -/ +@[expose] public section + open MeasureTheory open scoped Pointwise diff --git a/Mathlib/MeasureTheory/Group/Convolution.lean b/Mathlib/MeasureTheory/Group/Convolution.lean index bcae5a290f82fa..7c8d14f42196f0 100644 --- a/Mathlib/MeasureTheory/Group/Convolution.lean +++ b/Mathlib/MeasureTheory/Group/Convolution.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker -/ -import Mathlib.MeasureTheory.Group.Defs -import Mathlib.MeasureTheory.Measure.Prod +module + +public import Mathlib.MeasureTheory.Group.Defs +public import Mathlib.MeasureTheory.Measure.Prod /-! # The multiplicative and additive convolution of measures @@ -19,6 +21,8 @@ In this file we define and prove properties about the convolutions of two measur under the product measure. -/ +@[expose] public section + namespace MeasureTheory namespace Measure diff --git a/Mathlib/MeasureTheory/Group/Defs.lean b/Mathlib/MeasureTheory/Group/Defs.lean index 8dd6bd67e42055..9c4ec6a36e160d 100644 --- a/Mathlib/MeasureTheory/Group/Defs.lean +++ b/Mathlib/MeasureTheory/Group/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.Map +module + +public import Mathlib.MeasureTheory.Measure.Map /-! # Definitions about invariant measures @@ -37,6 +39,8 @@ The definitions that use `MeasureTheory.Measure.map` imply that the left (resp., right) multiplication is `AEMeasurable`. -/ +@[expose] public section + assert_not_exists Module.Basis namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Group/FundamentalDomain.lean b/Mathlib/MeasureTheory/Group/FundamentalDomain.lean index 7a342e951064d3..76f45bedfc6b35 100644 --- a/Mathlib/MeasureTheory/Group/FundamentalDomain.lean +++ b/Mathlib/MeasureTheory/Group/FundamentalDomain.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Alex Kontorovich, Heather Macbeth -/ -import Mathlib.MeasureTheory.Group.Action -import Mathlib.MeasureTheory.Group.Pointwise -import Mathlib.MeasureTheory.Integral.Lebesgue.Map -import Mathlib.MeasureTheory.Integral.Bochner.Set +module + +public import Mathlib.MeasureTheory.Group.Action +public import Mathlib.MeasureTheory.Group.Pointwise +public import Mathlib.MeasureTheory.Integral.Lebesgue.Map +public import Mathlib.MeasureTheory.Integral.Bochner.Set /-! # Fundamental domain of a group action @@ -45,6 +47,8 @@ We also generate additive versions of all theorems in this file using the `to_ad Elements of `s` that do not belong to any other translate of `s`. -/ +@[expose] public section + open scoped ENNReal Pointwise Topology NNReal ENNReal MeasureTheory diff --git a/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean b/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean index c710a9130e6df3..559973587eae8b 100644 --- a/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean +++ b/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best -/ -import Mathlib.Analysis.Convex.Body -import Mathlib.Analysis.Convex.Measure -import Mathlib.MeasureTheory.Group.FundamentalDomain +module + +public import Mathlib.Analysis.Convex.Body +public import Mathlib.Analysis.Convex.Measure +public import Mathlib.MeasureTheory.Group.FundamentalDomain /-! # Geometry of numbers @@ -33,6 +35,8 @@ Hermann Minkowski. * [Pete L. Clark, *Geometry of Numbers with Applications to Number Theory*][clark_gon] p.28 -/ +@[expose] public section + namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Group/Integral.lean b/Mathlib/MeasureTheory/Group/Integral.lean index ebaf3920b72edd..dc14ee215108fc 100644 --- a/Mathlib/MeasureTheory/Group/Integral.lean +++ b/Mathlib/MeasureTheory/Group/Integral.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.MeasureTheory.Group.Measure +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.MeasureTheory.Group.Measure /-! # Bochner Integration on Groups @@ -13,6 +15,8 @@ We develop properties of integrals with a group as domain. This file contains properties about integrability and Bochner integration. -/ +@[expose] public section + namespace MeasureTheory open Measure TopologicalSpace diff --git a/Mathlib/MeasureTheory/Group/IntegralConvolution.lean b/Mathlib/MeasureTheory/Group/IntegralConvolution.lean index c15a049f2c7979..f9d4db70f31209 100644 --- a/Mathlib/MeasureTheory/Group/IntegralConvolution.lean +++ b/Mathlib/MeasureTheory/Group/IntegralConvolution.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Group.Convolution -import Mathlib.MeasureTheory.Integral.Prod +module + +public import Mathlib.MeasureTheory.Group.Convolution +public import Mathlib.MeasureTheory.Integral.Prod /-! # Bochner integrals of convolutions @@ -23,6 +25,8 @@ integrals over there. `∫ x, f x ∂(μ ∗ₘ ν) = ∫ x, ∫ y, f (x + y) ∂ν ∂μ`. -/ +@[expose] public section + namespace MeasureTheory variable {M F : Type*} [Monoid M] {mM : MeasurableSpace M} [MeasurableMul₂ M] diff --git a/Mathlib/MeasureTheory/Group/LIntegral.lean b/Mathlib/MeasureTheory/Group/LIntegral.lean index 9fb994a1de6b94..40d7f23f16f530 100644 --- a/Mathlib/MeasureTheory/Group/LIntegral.lean +++ b/Mathlib/MeasureTheory/Group/LIntegral.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Group.Measure +module + +public import Mathlib.MeasureTheory.Group.Measure /-! # Lebesgue Integration on Groups @@ -12,6 +14,8 @@ We develop properties of integrals with a group as domain. This file contains properties about Lebesgue integration. -/ +@[expose] public section + assert_not_exists NormedSpace namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Group/MeasurableEquiv.lean b/Mathlib/MeasureTheory/Group/MeasurableEquiv.lean index 24cd0e01a4329a..db24b7e4aa6897 100644 --- a/Mathlib/MeasureTheory/Group/MeasurableEquiv.lean +++ b/Mathlib/MeasureTheory/Group/MeasurableEquiv.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Group.Arithmetic +module + +public import Mathlib.MeasureTheory.Group.Arithmetic /-! # (Scalar) multiplication and (vector) addition as measurable equivalences @@ -34,6 +36,8 @@ We also deduce that the corresponding maps are measurable embeddings. measurable, equivalence, group action -/ +@[expose] public section + open scoped Pointwise NNReal namespace MeasurableEquiv diff --git a/Mathlib/MeasureTheory/Group/Measure.lean b/Mathlib/MeasureTheory/Group/Measure.lean index f2925905d410c3..e40ba322ba8c19 100644 --- a/Mathlib/MeasureTheory/Group/Measure.lean +++ b/Mathlib/MeasureTheory/Group/Measure.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Algebra.Group.Pointwise.Set.Card -import Mathlib.GroupTheory.Complement -import Mathlib.MeasureTheory.Group.Action -import Mathlib.MeasureTheory.Group.Pointwise -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.Topology.Algebra.Module.Equiv -import Mathlib.Topology.ContinuousMap.CocompactMap -import Mathlib.Topology.Algebra.ContinuousMonoidHom +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Card +public import Mathlib.GroupTheory.Complement +public import Mathlib.MeasureTheory.Group.Action +public import Mathlib.MeasureTheory.Group.Pointwise +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.Topology.Algebra.Module.Equiv +public import Mathlib.Topology.ContinuousMap.CocompactMap +public import Mathlib.Topology.Algebra.ContinuousMonoidHom /-! # Measures on Groups @@ -26,6 +28,8 @@ We develop some properties of measures on (topological) groups We also give analogues of all these notions in the additive world. -/ +@[expose] public section + noncomputable section @@ -876,7 +880,7 @@ instance _root_.ContinuousMulEquiv.isHaarMeasure_map [BorelSpace G] [IsTopologic [IsTopologicalGroup H] (e : G ≃ₜ* H) : (μ.map e).IsHaarMeasure := e.toMulEquiv.isHaarMeasure_map μ e.continuous e.symm.continuous -/-- A convenience wrapper for MeasureTheory.Measure.isAddHaarMeasure_map`. -/ +/-- A convenience wrapper for `MeasureTheory.Measure.isAddHaarMeasure_map`. -/ instance _root_.ContinuousLinearEquiv.isAddHaarMeasure_map {E F R S : Type*} [Semiring R] [Semiring S] [AddCommGroup E] [Module R E] [AddCommGroup F] [Module S F] diff --git a/Mathlib/MeasureTheory/Group/ModularCharacter.lean b/Mathlib/MeasureTheory/Group/ModularCharacter.lean index 23abed39d34b0a..2369ac16d20836 100644 --- a/Mathlib/MeasureTheory/Group/ModularCharacter.lean +++ b/Mathlib/MeasureTheory/Group/ModularCharacter.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Noam Atar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Noam Atar -/ -import Mathlib.MeasureTheory.Function.LocallyIntegrable -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Group.Measure -import Mathlib.Topology.Metrizable.Urysohn -import Mathlib.MeasureTheory.Measure.Haar.Unique -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +module + +public import Mathlib.MeasureTheory.Function.LocallyIntegrable +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Group.Measure +public import Mathlib.Topology.Metrizable.Urysohn +public import Mathlib.MeasureTheory.Measure.Haar.Unique +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic /-! # Modular character of a locally compact group @@ -29,6 +31,8 @@ TODO: Show that the character is continuous. * `modularCharacter`: The homomorphism G →* ℝ≥0 whose toFun is `modularCharacterFun`. -/ +@[expose] public section + open MeasureTheory open scoped NNReal diff --git a/Mathlib/MeasureTheory/Group/Pointwise.lean b/Mathlib/MeasureTheory/Group/Pointwise.lean index 84db89e4019cb7..9bfa485d96a080 100644 --- a/Mathlib/MeasureTheory/Group/Pointwise.lean +++ b/Mathlib/MeasureTheory/Group/Pointwise.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Alex J. Best -/ -import Mathlib.MeasureTheory.Group.Arithmetic +module + +public import Mathlib.MeasureTheory.Group.Arithmetic /-! # Pointwise set operations on `MeasurableSet`s @@ -13,6 +15,8 @@ In this file we prove several versions of the following fact: if `s` is a measur no `MeasurableSet.mul` etc. -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/MeasureTheory/Group/Prod.lean b/Mathlib/MeasureTheory/Group/Prod.lean index 73226ef793c503..52d9fb5ce8d26e 100644 --- a/Mathlib/MeasureTheory/Group/Prod.lean +++ b/Mathlib/MeasureTheory/Group/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Group.Measure -import Mathlib.MeasureTheory.Measure.Prod +module + +public import Mathlib.MeasureTheory.Group.Measure +public import Mathlib.MeasureTheory.Measure.Prod /-! # Measure theory in the product of groups @@ -37,6 +39,8 @@ continuous functions instead of measurable sets and working in the general local setting, see the file `Mathlib/MeasureTheory/Measure/Haar/Unique.lean`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/Asymptotics.lean b/Mathlib/MeasureTheory/Integral/Asymptotics.lean index 69fecde8ba93fa..e9bb5ae5a8f82b 100644 --- a/Mathlib/MeasureTheory/Integral/Asymptotics.lean +++ b/Mathlib/MeasureTheory/Integral/Asymptotics.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Lawrence Wu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lawrence Wu -/ -import Mathlib.MeasureTheory.Group.Measure -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +module + +public import Mathlib.MeasureTheory.Group.Measure +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap /-! # Bounding of integrals by asymptotics @@ -25,6 +27,8 @@ We establish integrability of `f` from `f = O(g)`. `g` integrable `atTop`, then `f` is integrable. -/ +@[expose] public section + open Asymptotics MeasureTheory Set Filter variable {α E F : Type*} [NormedAddCommGroup E] {f : α → E} {g : α → F} {a : α} {l : Filter α} diff --git a/Mathlib/MeasureTheory/Integral/Average.lean b/Mathlib/MeasureTheory/Integral/Average.lean index 96892b2e1f731b..71b48a2833c92f 100644 --- a/Mathlib/MeasureTheory/Integral/Average.lean +++ b/Mathlib/MeasureTheory/Integral/Average.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Yaël Dillies -/ -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +module + +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap /-! # Integral average of a function @@ -34,6 +36,8 @@ function, we provide a convenience lemma `MeasureTheory.Integrable.to_average`. integral, center mass, average value -/ +@[expose] public section + open ENNReal MeasureTheory MeasureTheory.Measure Metric Set Filter TopologicalSpace Function diff --git a/Mathlib/MeasureTheory/Integral/Bochner.lean b/Mathlib/MeasureTheory/Integral/Bochner.lean index 79468f5403307d..0e73cb60bf591f 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.MeasureTheory.Integral.Bochner.L1 -import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.MeasureTheory.Integral.Bochner.L1 +public import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory deprecated_module (since := "2025-04-13") diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index a8d2362ff15125..992c462bd5ae61 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.MeasureTheory.Group.MeasurableEquiv -import Mathlib.MeasureTheory.Integral.Bochner.L1 -import Mathlib.MeasureTheory.Integral.IntegrableOn -import Mathlib.MeasureTheory.Measure.OpenPos -import Mathlib.MeasureTheory.Measure.Real +module + +public import Mathlib.MeasureTheory.Group.MeasurableEquiv +public import Mathlib.MeasureTheory.Integral.Bochner.L1 +public import Mathlib.MeasureTheory.Integral.IntegrableOn +public import Mathlib.MeasureTheory.Measure.OpenPos +public import Mathlib.MeasureTheory.Measure.Real /-! # Bochner integral @@ -130,6 +132,8 @@ Bochner integral, simple function, function space, Lebesgue dominated convergenc -/ +@[expose] public section + noncomputable section open Filter ENNReal EMetric Set TopologicalSpace Topology @@ -148,7 +152,7 @@ Define the Bochner integral on functions generally to be the `L1` Bochner integr functions, and 0 otherwise; prove its basic properties. -/ -variable [NormedAddCommGroup E] [hE : CompleteSpace E] [NormedDivisionRing 𝕜] +variable [NormedAddCommGroup E] [NormedDivisionRing 𝕜] [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] @@ -182,6 +186,10 @@ open ContinuousLinearMap MeasureTheory.SimpleFunc variable [NormedSpace ℝ E] variable {f : α → E} {m : MeasurableSpace α} {μ : Measure α} +section Basic + +variable [hE : CompleteSpace E] + theorem integral_eq (f : α → E) (hf : Integrable f μ) : ∫ a, f a ∂μ = L1.integral (hf.toL1 f) := by simp [integral, hE, hf] @@ -569,15 +577,19 @@ theorem integral_eq_integral_pos_part_sub_integral_neg_part {f : α → ℝ} (hf · simp · exact hf.neg.real_toNNReal +end Basic + section Order variable [PartialOrder E] [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] [OrderClosedTopology E] /-- The integral of a function which is nonnegative almost everywhere is nonnegative. -/ lemma integral_nonneg_of_ae {f : α → E} (hf : 0 ≤ᵐ[μ] f) : - 0 ≤ ∫ x, f x ∂μ := - integral_eq_setToFun f ▸ setToFun_nonneg (dominatedFinMeasAdditive_weightedSMul μ) - (fun s _ _ => weightedSMul_nonneg s) hf + 0 ≤ ∫ x, f x ∂μ := by + by_cases hE : CompleteSpace E + · exact integral_eq_setToFun f ▸ setToFun_nonneg (dominatedFinMeasAdditive_weightedSMul μ) + (fun s _ _ => weightedSMul_nonneg s) hf + · simp [integral, hE] lemma integral_nonneg {f : α → E} (hf : 0 ≤ f) : 0 ≤ ∫ x, f x ∂μ := @@ -615,6 +627,8 @@ lemma integral_mono_of_nonneg {f g : α → E} (hf : 0 ≤ᵐ[μ] f) (hgi : Inte @[gcongr] lemma integral_mono_measure {f : α → E} {ν : Measure α} (hle : μ ≤ ν) (hf : 0 ≤ᵐ[ν] f) (hfi : Integrable f ν) : ∫ (a : α), f a ∂μ ≤ ∫ (a : α), f a ∂ν := by + by_cases hE : CompleteSpace E + swap; · simp [integral, hE] borelize E obtain ⟨g, hg, hg_nonneg, hfg⟩ := hfi.1.exists_stronglyMeasurable_range_subset isClosed_Ici.measurableSet (Set.nonempty_Ici (a := 0)) hf @@ -676,6 +690,8 @@ lemma integral_concaveOn_of_integrand_ae {β : Type*} [AddCommMonoid β] end Order +variable [hE : CompleteSpace E] + theorem lintegral_coe_eq_integral (f : α → ℝ≥0) (hfi : Integrable (fun x => (f x : ℝ)) μ) : ∫⁻ a, f a ∂μ = ENNReal.ofReal (∫ a, f a ∂μ) := by simp_rw [integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall fun x => (f x).coe_nonneg) @@ -1440,7 +1456,7 @@ attribute [local instance] monadLiftOptionMetaM in This extension only proves non-negativity, strict positivity is more delicate for integration and requires more assumptions. -/ @[positivity MeasureTheory.integral _ _] -def evalIntegral : PositivityExt where eval {u α} zα pα e := do +meta def evalIntegral : PositivityExt where eval {u α} zα pα e := do match u, α, e with | 0, ~q(ℝ), ~q(@MeasureTheory.integral $i ℝ _ $inst2 _ _ $f) => let i : Q($i) ← mkFreshExprMVarQ q($i) .syntheticOpaque diff --git a/Mathlib/MeasureTheory/Integral/Bochner/ContinuousLinearMap.lean b/Mathlib/MeasureTheory/Integral/Bochner/ContinuousLinearMap.lean index 4a55376a4131ae..857218527b58d5 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/ContinuousLinearMap.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/ContinuousLinearMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.Analysis.Normed.Operator.CompleteCodomain -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.Topology.ContinuousMap.ContinuousMapZero +module + +public import Mathlib.Analysis.Normed.Operator.CompleteCodomain +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.Topology.ContinuousMap.ContinuousMapZero /-! # Continuous linear maps composed with integration @@ -17,6 +19,8 @@ the composition, as we are dealing with classes of functions, but it has already as `ContinuousLinearMap.compLp`. We take advantage of this construction here. -/ +@[expose] public section + open MeasureTheory RCLike open scoped ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Integral/Bochner/FundThmCalculus.lean b/Mathlib/MeasureTheory/Integral/Bochner/FundThmCalculus.lean index cf48736f6e0c82..ac19548892ffec 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/FundThmCalculus.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/FundThmCalculus.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Integral.Bochner.Set +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Set /-! # Fundamental theorem of calculus for set integrals @@ -19,6 +21,8 @@ as `s` tends to `l.smallSets`, i.e. for any `ε>0` there exists `t ∈ l` such t theorem for a locally finite measure `μ` and a function `f` continuous at a point `a`. -/ +@[expose] public section + open Filter MeasureTheory Topology Asymptotics Metric variable {X E ι : Type*} [MeasurableSpace X] [NormedAddCommGroup E] [NormedSpace ℝ E] diff --git a/Mathlib/MeasureTheory/Integral/Bochner/L1.lean b/Mathlib/MeasureTheory/Integral/Bochner/L1.lean index 435c4d5c32e1ae..1670f66a20af93 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/L1.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/L1.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.SetToL1 +module + +public import Mathlib.MeasureTheory.Integral.SetToL1 /-! # Bochner integral @@ -53,6 +55,8 @@ Bochner integral, simple function, function space, Lebesgue dominated convergenc -/ +@[expose] public section + assert_not_exists Differentiable diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Set.lean b/Mathlib/MeasureTheory/Integral/Bochner/Set.lean index ea18629396cb36..f02c2449d82640 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Set.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Set.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.Combinatorics.Enumerative.InclusionExclusion -import Mathlib.MeasureTheory.Function.LocallyIntegrable -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Topology.ContinuousMap.Compact -import Mathlib.Topology.MetricSpace.ThickenedIndicator +module + +public import Mathlib.Combinatorics.Enumerative.InclusionExclusion +public import Mathlib.MeasureTheory.Function.LocallyIntegrable +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Topology.ContinuousMap.Compact +public import Mathlib.Topology.MetricSpace.ThickenedIndicator /-! # Set integral @@ -38,6 +40,8 @@ Note that the set notations are defined in the file but we reference them here because all theorems about set integrals are in this file. -/ +@[expose] public section + assert_not_exists InnerProductSpace open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology @@ -684,15 +688,19 @@ end NormedAddCommGroup section Mono -variable {μ : Measure X} {f g : X → ℝ} {s t : Set X} +variable [NormedAddCommGroup E] [NormedSpace ℝ E] [PartialOrder E] + [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] [OrderClosedTopology E] + {μ : Measure X} {f g : X → E} {s t : Set X} section variable (hf : IntegrableOn f s μ) (hg : IntegrableOn g s μ) include hf hg theorem setIntegral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict s] g) : - ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ := - integral_mono_ae hf hg h + ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ := by + by_cases hE : CompleteSpace E + · exact integral_mono_ae hf hg h + · simp [integral, hE] theorem setIntegral_mono_ae (h : f ≤ᵐ[μ] g) : ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ := setIntegral_mono_ae_restrict hf hg (ae_restrict_of_ae h) @@ -736,12 +744,17 @@ theorem setIntegral_le_integral (hfi : Integrable f μ) (hf : 0 ≤ᵐ[μ] f) : ∫ x in s, f x ∂μ ≤ ∫ x, f x ∂μ := integral_mono_measure (Measure.restrict_le_self) hf hfi -theorem setIntegral_ge_of_const_le {c : ℝ} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) +theorem setIntegral_ge_of_const_le [CompleteSpace E] {c : E} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) : - c * μ.real s ≤ ∫ x in s, f x ∂μ := by - rw [mul_comm, ← smul_eq_mul, ← setIntegral_const c] + μ.real s • c ≤ ∫ x in s, f x ∂μ := by + rw [← setIntegral_const c] exact setIntegral_mono_on (integrableOn_const hμs) hfint hs hf +theorem setIntegral_ge_of_const_le_real {f : X → ℝ} {c : ℝ} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) + (hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) : + c * μ.real s ≤ ∫ x in s, f x ∂μ := by + simpa [mul_comm] using setIntegral_ge_of_const_le hs hμs hf hfint + end Mono section Nonneg diff --git a/Mathlib/MeasureTheory/Integral/Bochner/VitaliCaratheodory.lean b/Mathlib/MeasureTheory/Integral/Bochner/VitaliCaratheodory.lean index 1bb21dec738aaa..21c95ecff9cc55 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/VitaliCaratheodory.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/VitaliCaratheodory.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Regular -import Mathlib.Topology.Semicontinuous -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Topology.Instances.EReal.Lemmas +module + +public import Mathlib.MeasureTheory.Measure.Regular +public import Mathlib.Topology.Semicontinuous +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Topology.Instances.EReal.Lemmas /-! # Vitali-Carathéodory theorem @@ -69,6 +71,8 @@ See result `MeasureTheory.Lp.boundedContinuousFunction_dense`, in the file -/ +@[expose] public section + open scoped ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Integral/BochnerL1.lean b/Mathlib/MeasureTheory/Integral/BochnerL1.lean index 72386d631db234..79483b11c2db7c 100644 --- a/Mathlib/MeasureTheory/Integral/BochnerL1.lean +++ b/Mathlib/MeasureTheory/Integral/BochnerL1.lean @@ -3,6 +3,8 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.Bochner.L1 +module + +public import Mathlib.MeasureTheory.Integral.Bochner.L1 deprecated_module (since := "2025-04-06") diff --git a/Mathlib/MeasureTheory/Integral/BoundedContinuousFunction.lean b/Mathlib/MeasureTheory/Integral/BoundedContinuousFunction.lean index 4b9faedf17f0bb..9dd36e5ba83c0c 100644 --- a/Mathlib/MeasureTheory/Integral/BoundedContinuousFunction.lean +++ b/Mathlib/MeasureTheory/Integral/BoundedContinuousFunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Topology.ContinuousMap.Bounded.Normed -import Mathlib.Topology.Algebra.Order.LiminfLimsup +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Topology.ContinuousMap.Bounded.Normed +public import Mathlib.Topology.Algebra.Order.LiminfLimsup /-! # Integration of bounded continuous functions @@ -16,6 +18,8 @@ specialized form in some other files, in particular in those related to the topo convergence of probability measures and finite measures. -/ +@[expose] public section + open MeasureTheory Filter open scoped ENNReal NNReal BoundedContinuousFunction Topology diff --git a/Mathlib/MeasureTheory/Integral/CircleAverage.lean b/Mathlib/MeasureTheory/Integral/CircleAverage.lean index 81dad2e72b2431..889f67319b741c 100644 --- a/Mathlib/MeasureTheory/Integral/CircleAverage.lean +++ b/Mathlib/MeasureTheory/Integral/CircleAverage.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.MeasureTheory.Integral.CircleIntegral -import Mathlib.MeasureTheory.Integral.IntervalAverage -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +module + +public import Mathlib.MeasureTheory.Integral.CircleIntegral +public import Mathlib.MeasureTheory.Integral.IntervalAverage +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic /-! # Circle Averages @@ -27,6 +29,8 @@ Implementation Note: Like `circleMap`, `circleAverage`s are defined for negative `circleAverage_congr_negRadius` shows that the average is independent of the radius' sign. -/ +@[expose] public section + open Complex Filter Metric Real variable @@ -38,7 +42,7 @@ variable namespace Real /-! -# Definition +### Definition -/ variable (f c R) in @@ -53,7 +57,7 @@ noncomputable def circleAverage : E := lemma circleAverage_def : circleAverage f c R = (2 * π)⁻¹ • ∫ θ in 0..2 * π, f (circleMap c R θ) := rfl -/-- Expression of `circleAverage´ in terms of interval averages. -/ +/-- Expression of `circleAverage` in terms of interval averages. -/ lemma circleAverage_eq_intervalAverage : circleAverage f c R = ⨍ θ in 0..2 * π, f (circleMap c R θ) := by simp [circleAverage, interval_average_eq] @@ -68,7 +72,7 @@ lemma circleAverage_eq_intervalAverage : one_smul] /-- -Expression of `circleAverage´ with arbitrary center in terms of `circleAverage` with center zero. +Expression of `circleAverage` with arbitrary center in terms of `circleAverage` with center zero. -/ lemma circleAverage_fun_add : circleAverage (fun z ↦ f (z + c)) 0 R = circleAverage f c R := by diff --git a/Mathlib/MeasureTheory/Integral/CircleIntegral.lean b/Mathlib/MeasureTheory/Integral/CircleIntegral.lean index c113bd823db5f0..a06e232d5eea78 100644 --- a/Mathlib/MeasureTheory/Integral/CircleIntegral.lean +++ b/Mathlib/MeasureTheory/Integral/CircleIntegral.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Analytic.IsolatedZeros -import Mathlib.Analysis.SpecialFunctions.Complex.CircleMap -import Mathlib.Analysis.SpecialFunctions.NonIntegrable +module + +public import Mathlib.Analysis.Analytic.IsolatedZeros +public import Mathlib.Analysis.SpecialFunctions.Complex.CircleMap +public import Mathlib.Analysis.SpecialFunctions.NonIntegrable /-! # Integral over a circle in `ℂ` @@ -62,6 +64,8 @@ some lemmas use, e.g., `(z - c)⁻¹ • f z` instead of `f z / (z - c)`. integral, circle, Cauchy integral -/ +@[expose] public section + variable {E : Type*} [NormedAddCommGroup E] noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/CircleTransform.lean b/Mathlib/MeasureTheory/Integral/CircleTransform.lean index 38382e5273afaa..b65550727c92db 100644 --- a/Mathlib/MeasureTheory/Integral/CircleTransform.lean +++ b/Mathlib/MeasureTheory/Integral/CircleTransform.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Data.Complex.Basic -import Mathlib.MeasureTheory.Integral.CircleIntegral +module + +public import Mathlib.Data.Complex.Basic +public import Mathlib.MeasureTheory.Integral.CircleIntegral /-! # Circle integral transform @@ -18,6 +20,8 @@ is holomorphic. -/ +@[expose] public section + open Set MeasureTheory Metric Filter Function diff --git a/Mathlib/MeasureTheory/Integral/CompactlySupported.lean b/Mathlib/MeasureTheory/Integral/CompactlySupported.lean index 4d3fe48b153483..74d9d34d4d337a 100644 --- a/Mathlib/MeasureTheory/Integral/CompactlySupported.lean +++ b/Mathlib/MeasureTheory/Integral/CompactlySupported.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yongxi Lin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongxi Lin, Thomas Zhu -/ -import Mathlib.MeasureTheory.Function.LocallyIntegrable -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Topology.ContinuousMap.CompactlySupported +module + +public import Mathlib.MeasureTheory.Function.LocallyIntegrable +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Topology.ContinuousMap.CompactlySupported /-! # Integrating compactly supported continuous functions @@ -14,6 +16,8 @@ This file contains definitions and lemmas related to integrals of compactly supp functions. -/ +@[expose] public section + open scoped ENNReal NNReal open CompactlySupported MeasureTheory diff --git a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean index 29506f5b04f401..28f0e05dfb07d1 100644 --- a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Field.Pointwise -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Analysis.Calculus.Deriv.AffineMap -import Mathlib.Analysis.Calculus.Deriv.Shift -import Mathlib.Analysis.Normed.Module.Convex -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.Algebra.Order.Field.Pointwise +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.Analysis.Calculus.Deriv.AffineMap +public import Mathlib.Analysis.Calculus.Deriv.Shift +public import Mathlib.Analysis.Normed.Module.Convex +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Integral of a 1-form along a path @@ -84,6 +86,8 @@ in `HasFDerivWithinAt.curveIntegral_segment_source` and a future formalization of Poincaré lemma. -/ +@[expose] public section + open Metric MeasureTheory Topology Set Interval AffineMap Convex Filter open scoped Pointwise unitInterval diff --git a/Mathlib/MeasureTheory/Integral/DivergenceTheorem.lean b/Mathlib/MeasureTheory/Integral/DivergenceTheorem.lean index 09b0a9b632ed32..7cad3988f9ba35 100644 --- a/Mathlib/MeasureTheory/Integral/DivergenceTheorem.lean +++ b/Mathlib/MeasureTheory/Integral/DivergenceTheorem.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.BoxIntegral.DivergenceTheorem -import Mathlib.Analysis.BoxIntegral.Integrability -import Mathlib.Analysis.Calculus.Deriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Equiv -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.Analysis.BoxIntegral.DivergenceTheorem +public import Mathlib.Analysis.BoxIntegral.Integrability +public import Mathlib.Analysis.Calculus.Deriv.Basic +public import Mathlib.Analysis.Calculus.FDeriv.Equiv +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Divergence theorem for Bochner integral @@ -49,6 +51,8 @@ website shows the actual terms, not those abbreviated using local notations. divergence theorem, Bochner integral -/ +@[expose] public section + open Set Finset TopologicalSpace Function BoxIntegral MeasureTheory Filter diff --git a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean index a38dc550e41533..2c98f201678524 100644 --- a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean +++ b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Patrick Massot -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.MeasureTheory.Measure.Real -import Mathlib.Order.Filter.IndicatorFunction +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.MeasureTheory.Measure.Real +public import Mathlib.Order.Filter.IndicatorFunction /-! # The dominated convergence theorem @@ -29,6 +31,8 @@ for the Bochner integral. -/ +@[expose] public section + open MeasureTheory Metric /-! diff --git a/Mathlib/MeasureTheory/Integral/ExpDecay.lean b/Mathlib/MeasureTheory/Integral/ExpDecay.lean index 7de49a8f862135..fde4a7345883d9 100644 --- a/Mathlib/MeasureTheory/Integral/ExpDecay.lean +++ b/Mathlib/MeasureTheory/Integral/ExpDecay.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.MeasureTheory.Integral.Asymptotics -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.MeasureTheory.Integral.IntegralEqImproper +module + +public import Mathlib.MeasureTheory.Integral.Asymptotics +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper /-! # Integrals with exponential decay at ∞ @@ -17,6 +19,8 @@ for integrability: exists `b > 0` such that `f(x) = O(exp(-b x))` as `x → ∞`, then `f` is integrable on `(a, ∞)`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean b/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean index 99285434591558..4ddfb4e1c4616a 100644 --- a/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean +++ b/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +module + +public import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp /-! # Additivity on measurable sets with finite measure @@ -30,6 +32,8 @@ The starting object `T : Set α → E →L[ℝ] F` matters only through its rest with finite measure. Its value on other sets is ignored. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/FundThmCalculus.lean b/Mathlib/MeasureTheory/Integral/FundThmCalculus.lean index 039794d2c686b6..f12b07f695527b 100644 --- a/Mathlib/MeasureTheory/Integral/FundThmCalculus.lean +++ b/Mathlib/MeasureTheory/Integral/FundThmCalculus.lean @@ -3,6 +3,8 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus deprecated_module (since := "2025-04-06") diff --git a/Mathlib/MeasureTheory/Integral/Gamma.lean b/Mathlib/MeasureTheory/Integral/Gamma.lean index 1b1f349c0cbdd6..c12408d8db34fd 100644 --- a/Mathlib/MeasureTheory/Integral/Gamma.lean +++ b/Mathlib/MeasureTheory/Integral/Gamma.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Analysis.SpecialFunctions.PolarCoord -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.PolarCoord +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic /-! # Integrals involving the Gamma function @@ -14,6 +16,8 @@ In this file, we collect several integrals over `ℝ` or `ℂ` that evaluate in -/ +@[expose] public section + open Real Set MeasureTheory MeasureTheory.Measure section real diff --git a/Mathlib/MeasureTheory/Integral/Indicator.lean b/Mathlib/MeasureTheory/Integral/Indicator.lean index d11d1fd4d30c11..b815554cd55992 100644 --- a/Mathlib/MeasureTheory/Integral/Indicator.lean +++ b/Mathlib/MeasureTheory/Integral/Indicator.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable -import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable +public import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence /-! # Results about indicator functions, their integrals, and measures @@ -26,6 +28,8 @@ moved out of `Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean`, and the lemma be moved to, e.g., `Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean`. -/ +@[expose] public section + namespace MeasureTheory section TendstoIndicator diff --git a/Mathlib/MeasureTheory/Integral/IntegrableOn.lean b/Mathlib/MeasureTheory/Integral/IntegrableOn.lean index aa17a5ee6a76d2..251c5f3c332078 100644 --- a/Mathlib/MeasureTheory/Integral/IntegrableOn.lean +++ b/Mathlib/MeasureTheory/Integral/IntegrableOn.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Function.L1Space.Integrable -import Mathlib.MeasureTheory.Function.LpSpace.Indicator +module + +public import Mathlib.MeasureTheory.Function.L1Space.Integrable +public import Mathlib.MeasureTheory.Function.LpSpace.Indicator /-! # Functions integrable on a set and at a filter @@ -18,6 +20,8 @@ at `l`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/IntegralEqImproper.lean b/Mathlib/MeasureTheory/Integral/IntegralEqImproper.lean index 25f687f0babbc2..27fc39b52b385a 100644 --- a/Mathlib/MeasureTheory/Integral/IntegralEqImproper.lean +++ b/Mathlib/MeasureTheory/Integral/IntegralEqImproper.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Bhavik Mehta -/ -import Mathlib.Analysis.Calculus.Deriv.Support -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv -import Mathlib.MeasureTheory.Function.JacobianOneDim -import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts -import Mathlib.MeasureTheory.Measure.Haar.NormedSpace -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.Analysis.Calculus.Deriv.Support +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.MeasureTheory.Function.JacobianOneDim +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +public import Mathlib.MeasureTheory.Measure.Haar.NormedSpace +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Links between an integral and its "improper" version @@ -75,6 +77,8 @@ Versions of these results are also given on the intervals `(-∞, a]` and `(-∞ the corresponding versions of integration by parts. -/ +@[expose] public section + open MeasureTheory Filter Set TopologicalSpace Topology open scoped ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Integral/IntegrationByParts.lean b/Mathlib/MeasureTheory/Integral/IntegrationByParts.lean index 914520ab740df0..5331c1ad419584 100644 --- a/Mathlib/MeasureTheory/Integral/IntegrationByParts.lean +++ b/Mathlib/MeasureTheory/Integral/IntegrationByParts.lean @@ -3,6 +3,8 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts deprecated_module (since := "2025-04-06") diff --git a/Mathlib/MeasureTheory/Integral/IntervalAverage.lean b/Mathlib/MeasureTheory/Integral/IntervalAverage.lean index 1a1b842f4153d7..7f36c4a5d7e43d 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalAverage.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalAverage.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.MeasureTheory.Integral.Average +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.MeasureTheory.Integral.Average /-! # Integral average over an interval @@ -25,6 +27,8 @@ We also prove that `⨍ x in a..b, f x = ⨍ x in b..a, f x`, see `interval_aver -/ +@[expose] public section + open MeasureTheory Set TopologicalSpace @@ -32,7 +36,8 @@ open scoped Interval variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] -/-- `⨍ x in a..b, f x` is the average of `f` over the interval `Ι a w.r.t. the Lebesgue measure. -/ +/-- `⨍ x in a..b, f x` is the average of `f` over the interval `Ι a b` w.r.t. the Lebesgue +measure. -/ notation3 "⨍ "(...)" in "a".."b", "r:60:(scoped f => average (Measure.restrict volume (uIoc a b)) f) => r diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral.lean index 0180e3852d3906..8f3d22ff60d28c 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus -import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts deprecated_module (since := "2025-04-13") diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean index a37787624a00ef..21b45755054162 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic -import Mathlib.MeasureTheory.Topology +module + +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +public import Mathlib.MeasureTheory.Topology /-! # Integral over an interval @@ -45,6 +47,8 @@ three possible intervals with the same endpoints for two reasons: integral -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/ContDiff.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/ContDiff.lean index 84daca46a4298c..1f2c69f76d5f2a 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/ContDiff.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/ContDiff.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +module + +public import Mathlib.Analysis.Calculus.ContDiff.Basic +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus /-! # Fundamental theorem of calculus for `C^1` functions @@ -12,6 +14,8 @@ We give versions of the second fundamental theorem of calculus under the strong that the function is `C^1` on the interval. This is restrictive, but satisfied in many situations. -/ +@[expose] public section + noncomputable section open MeasureTheory Set Filter Function Asymptotics diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/DerivIntegrable.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/DerivIntegrable.lean index ae732ae24ab85c..d027bac257ae8c 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/DerivIntegrable.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/DerivIntegrable.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yizheng Zhu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yizheng Zhu -/ -import Mathlib.Analysis.BoundedVariation -import Mathlib.MeasureTheory.Function.AbsolutelyContinuous -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Slope +module + +public import Mathlib.Analysis.BoundedVariation +public import Mathlib.MeasureTheory.Function.AbsolutelyContinuous +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Slope /-! # `f'` is interval integrable for certain classes of functions `f` @@ -24,6 +26,8 @@ then `f'` is interval integrable on `a..b`. interval integrable, monotone, bounded variation, absolutely continuous -/ +@[expose] public section + open MeasureTheory Set Filter open scoped Topology diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean index f8dda5a34fa551..5fafce010be232 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Measurable -import Mathlib.Analysis.Normed.Module.Dual -import Mathlib.MeasureTheory.Integral.Bochner.FundThmCalculus -import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.Analysis.Calculus.TangentCone.Prod +module + +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.Comp +public import Mathlib.Analysis.Calculus.FDeriv.Measurable +public import Mathlib.Analysis.Normed.Module.Dual +public import Mathlib.MeasureTheory.Integral.Bochner.FundThmCalculus +public import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.Analysis.Calculus.TangentCone.Prod /-! # Fundamental Theorem of Calculus @@ -141,6 +143,8 @@ instances could be added when needed (in that case, one also needs to add instan integral, fundamental theorem of calculus, FTC-1, FTC-2 -/ +@[expose] public section + assert_not_exists HasDerivAt.mul -- guard against import creep noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean index 96d304d604cf8d..019ce4547fce90 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot, Sébastien Gouëzel -/ -import Mathlib.Analysis.Calculus.Deriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +module + +public import Mathlib.Analysis.Calculus.Deriv.Mul +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus /-! # Integration by parts and by substitution @@ -23,6 +25,8 @@ can be found in `Mathlib/MeasureTheory/Function/JacobianOneDim.lean` integration by parts, change of variables in integrals -/ +@[expose] public section + open MeasureTheory Set open scoped Topology Interval diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/LebesgueDifferentiationThm.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/LebesgueDifferentiationThm.lean index f7ee3b57b3421a..b9a3092595865e 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/LebesgueDifferentiationThm.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/LebesgueDifferentiationThm.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yizheng Zhu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yizheng Zhu -/ -import Mathlib.Analysis.Calculus.Deriv.Slope -import Mathlib.MeasureTheory.Covering.OneDim -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.Analysis.Calculus.Deriv.Slope +public import Mathlib.MeasureTheory.Covering.OneDim +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Lebesgue Differentiation Theorem (Interval Version) @@ -22,6 +24,8 @@ is interval integrable on `a..b`, then for almost every `x ∈ uIcc a b`, for an derivative of `∫ (t : ℝ) in c..x, f t` at `x` is equal to `f x`. -/ +@[expose] public section + open MeasureTheory Set Filter Function IsUnifLocDoublingMeasure open scoped Topology diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean index 6cfbe7280f535e..45c445df755ca7 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Alex Kontorovich, Heather Macbeth -/ -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.MeasureTheory.Measure.Haar.Quotient -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.Topology.Algebra.Order.Floor -import Mathlib.Topology.Instances.AddCircle.Real +module + +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.MeasureTheory.Measure.Haar.Quotient +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.Topology.Algebra.Order.Floor +public import Mathlib.Topology.Instances.AddCircle.Real /-! # Integrals of periodic functions @@ -24,6 +26,8 @@ Another consequence (`Function.Periodic.intervalIntegral_add_eq` and related dec period `T`. -/ +@[expose] public section + open Set Function MeasureTheory MeasureTheory.Measure TopologicalSpace AddSubgroup intervalIntegral open scoped MeasureTheory NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Slope.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Slope.lean index 206cdb14e7844a..85e3f8314d7d5f 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Slope.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Slope.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yizheng Zhu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yizheng Zhu -/ -import Mathlib.LinearAlgebra.AffineSpace.Slope -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.LinearAlgebra.AffineSpace.Slope +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Some properties of the interval integral of `fun x ↦ slope f x (x + c)`, given a constant `c : ℝ` @@ -22,6 +24,8 @@ at most `f (b + c) - f a`. interval integrable, interval integral, monotone, slope -/ +@[expose] public section + open MeasureTheory Set /-- If `f` is interval integrable on `a..(b + c)` where `a ≤ b` and `0 ≤ c`, then diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/TrapezoidalRule.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/TrapezoidalRule.lean index dc1c9279cd2ca6..a25a7006ad6c0d 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/TrapezoidalRule.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/TrapezoidalRule.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 P. Michael Kielstra. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: P. Michael Kielstra -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Tactic.Field +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Tactic.Field /-! # The trapezoidal rule @@ -20,6 +22,8 @@ We follow the proof on (Wikipedia)[https://en.wikipedia.org/wiki/Trapezoidal_rul bound. -/ +@[expose] public section + open MeasureTheory intervalIntegral Interval Finset HasDerivWithinAt Set /-- Integration of `f` from `a` to `b` using the trapezoidal rule with `N+1` total evaluations of diff --git a/Mathlib/MeasureTheory/Integral/Layercake.lean b/Mathlib/MeasureTheory/Integral/Layercake.lean index cc3c9257f82a41..f80210ec98cb40 100644 --- a/Mathlib/MeasureTheory/Integral/Layercake.lean +++ b/Mathlib/MeasureTheory/Integral/Layercake.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # The layer cake formula / Cavalieri's principle / tail probability formula @@ -56,6 +58,8 @@ function, is given in `Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean`. layer cake representation, Cavalieri's principle, tail probability formula -/ +@[expose] public section + noncomputable section open scoped ENNReal MeasureTheory Topology diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue.lean b/Mathlib/MeasureTheory/Integral/Lebesgue.lean index 88f5ca4aba4ac0..2c3fe352ef5f61 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic -import Mathlib.MeasureTheory.Integral.Lebesgue.Countable -import Mathlib.MeasureTheory.Integral.Lebesgue.MeasurePreserving -import Mathlib.MeasureTheory.Integral.Lebesgue.Norm +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +public import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +public import Mathlib.MeasureTheory.Integral.Lebesgue.MeasurePreserving +public import Mathlib.MeasureTheory.Integral.Lebesgue.Norm deprecated_module (since := "2025-04-13") diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Add.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Add.lean index e69d64279a7228..b9905dc353186d 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Add.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Add.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Real -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Real +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic /-! # Monotone convergence theorem and addition of Lebesgue integrals @@ -16,6 +18,8 @@ several variants of this theorem, then uses it to show that the Lebesgue integra a constant. -/ +@[expose] public section + namespace MeasureTheory open Set Filter ENNReal Topology NNReal SimpleFunc diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean index d94262b3747c70..cb4f25b535d3c3 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Function.SimpleFunc +module + +public import Mathlib.MeasureTheory.Function.SimpleFunc /-! # Lower Lebesgue integral for `ℝ≥0∞`-valued functions @@ -23,6 +25,8 @@ We introduce the following notation for the lower Lebesgue integral of a functio to the canonical measure `volume`, defined as `∫⁻ x, f x ∂(volume.restrict s)`. -/ +@[expose] public section + assert_not_exists Module.Basis Norm MeasureTheory.MeasurePreserving MeasureTheory.Measure.dirac open Set hiding restrict restrict_apply diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Countable.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Countable.lean index 7d7a65ac698183..b0a7002b5efe01 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Countable.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Countable.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Map -import Mathlib.MeasureTheory.Integral.Lebesgue.Markov -import Mathlib.MeasureTheory.Measure.Count +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Map +public import Mathlib.MeasureTheory.Integral.Lebesgue.Markov +public import Mathlib.MeasureTheory.Measure.Count /-! # Lebesgue integral over finite and countable types, sets and measures @@ -16,6 +18,8 @@ The lemmas in this file require at least one of the following of the Lebesgue in * The measure is finite, s-finite or sigma-finite -/ +@[expose] public section + namespace MeasureTheory open Set ENNReal NNReal Measure diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/DominatedConvergence.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/DominatedConvergence.lean index 6f1f6103596640..bc75ae1c1a2245 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/DominatedConvergence.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/DominatedConvergence.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Markov -import Mathlib.MeasureTheory.Integral.Lebesgue.Sub +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Markov +public import Mathlib.MeasureTheory.Integral.Lebesgue.Sub /-! # Dominated convergence theorem @@ -14,6 +16,8 @@ a sequence of (almost everywhere) measurable functions can be swapped if the fun pointwise dominated by a fixed function. This file provides a few variants of the result. -/ +@[expose] public section + open Filter ENNReal Topology namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Map.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Map.lean index ceab01e59c1722..cd30f4bfe59ad1 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Map.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Map.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Integral.Lebesgue.Add +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add /-! # Behavior of the Lebesgue integral under maps -/ +@[expose] public section + namespace MeasureTheory open Set Filter ENNReal SimpleFunc diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Markov.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Markov.lean index 6c4151b62b6e62..076ac1fc1a4622 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Markov.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Markov.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Add +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add /-! # Markov's inequality @@ -17,6 +19,8 @@ the measure-theoretic form: This file proves a few variants of the inequality and other lemmas that depend on it. -/ +@[expose] public section + namespace MeasureTheory open Set Filter ENNReal Topology @@ -128,7 +132,6 @@ theorem lintegral_strict_mono_of_ae_le_of_frequently_ae_lt {f g : α → ℝ≥0 (hfi : ∫⁻ x, f x ∂μ ≠ ∞) (h_le : f ≤ᵐ[μ] g) (h : ∃ᵐ x ∂μ, f x ≠ g x) : ∫⁻ x, f x ∂μ < ∫⁻ x, g x ∂μ := by contrapose! h - simp only [not_frequently, Ne, Classical.not_not] exact ae_eq_of_ae_le_of_lintegral_le h_le hfi hg h theorem lintegral_strict_mono_of_ae_le_of_ae_lt_on {f g : α → ℝ≥0∞} (hg : AEMeasurable g μ) diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/MeasurePreserving.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/MeasurePreserving.lean index 1582ba49bf96f2..b0ad2254f404b1 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/MeasurePreserving.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/MeasurePreserving.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic deprecated_module (since := "2025-04-15") diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Norm.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Norm.lean index 36912561ec1072..c50732ed24f163 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Norm.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Norm.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.Analysis.Normed.Group.Basic -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +module + +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic /-! # Interactions between the Lebesgue integral and norms -/ +@[expose] public section + namespace MeasureTheory variable {α : Type*} [MeasurableSpace α] {μ : Measure α} diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Sub.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Sub.lean index eadc269428d038..c1b282db105197 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Sub.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Sub.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Add +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add /-! # Subtraction of Lebesgue integrals @@ -13,6 +15,8 @@ In this file we first show that Lebesgue integrals can be subtracted with the ex the monotone convergence theorem that use this subtraction in their proofs. -/ +@[expose] public section + open Filter ENNReal Topology namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Integral/LebesgueNormedSpace.lean b/Mathlib/MeasureTheory/Integral/LebesgueNormedSpace.lean index 02feec70974ce8..dd9eadc0ecedc3 100644 --- a/Mathlib/MeasureTheory/Integral/LebesgueNormedSpace.lean +++ b/Mathlib/MeasureTheory/Integral/LebesgueNormedSpace.lean @@ -3,11 +3,15 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.WithDensity -import Mathlib.Analysis.Normed.Module.Basic +module + +public import Mathlib.MeasureTheory.Measure.WithDensity +public import Mathlib.Analysis.Normed.Module.Basic /-! # A lemma about measurability with density under scalar multiplication in normed spaces -/ +@[expose] public section + open MeasureTheory Filter ENNReal Set diff --git a/Mathlib/MeasureTheory/Integral/Marginal.lean b/Mathlib/MeasureTheory/Integral/Marginal.lean index 187318398cafe7..a4ca29e2080aec 100644 --- a/Mathlib/MeasureTheory/Integral/Marginal.lean +++ b/Mathlib/MeasureTheory/Integral/Marginal.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Heather Macbeth -/ -import Mathlib.MeasureTheory.Constructions.Pi +module + +public import Mathlib.MeasureTheory.Constructions.Pi /-! # Marginals of multivariate functions @@ -53,6 +55,8 @@ since there is no well-behaved measure on the domain of `f`. -/ +@[expose] public section + open scoped ENNReal open Set Function Equiv Finset @@ -108,7 +112,7 @@ theorem lmarginal_congr {x y : ∀ i, X i} (f : (∀ i, X i) → ℝ≥0∞) theorem lmarginal_update_of_mem {i : δ} (hi : i ∈ s) (f : (∀ i, X i) → ℝ≥0∞) (x : ∀ i, X i) (y : X i) : (∫⋯∫⁻_s, f ∂μ) (Function.update x i y) = (∫⋯∫⁻_s, f ∂μ) x := by - grind [Function.update_of_ne, MeasureTheory.lmarginal_congr] + grind [MeasureTheory.lmarginal_congr] variable {μ} in theorem lmarginal_singleton (f : (∀ i, X i) → ℝ≥0∞) (i : δ) : diff --git a/Mathlib/MeasureTheory/Integral/MeanInequalities.lean b/Mathlib/MeasureTheory/Integral/MeanInequalities.lean index aef12aa8577528..65d3ea47d5676a 100644 --- a/Mathlib/MeasureTheory/Integral/MeanInequalities.lean +++ b/Mathlib/MeasureTheory/Integral/MeanInequalities.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.MeanInequalities -import Mathlib.Analysis.MeanInequalitiesPow -import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic -import Mathlib.MeasureTheory.Integral.Lebesgue.Add +module + +public import Mathlib.Analysis.MeanInequalities +public import Mathlib.Analysis.MeanInequalitiesPow +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +public import Mathlib.MeasureTheory.Integral.Lebesgue.Add /-! # Mean value inequalities for integrals @@ -32,6 +34,8 @@ Minkowski's inequality for the Lebesgue integral of measurable functions with ` we prove `(∫ (f + g)^p ∂μ) ^ (1/p) ≤ (∫ f^p ∂μ) ^ (1/p) + (∫ g^p ∂μ) ^ (1/p)` for `1 ≤ p`. -/ +@[expose] public section + section LIntegral diff --git a/Mathlib/MeasureTheory/Integral/PeakFunction.lean b/Mathlib/MeasureTheory/Integral/PeakFunction.lean index 23d849536202f2..f02a0fefa8d072 100644 --- a/Mathlib/MeasureTheory/Integral/PeakFunction.lean +++ b/Mathlib/MeasureTheory/Integral/PeakFunction.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.IntegralEqImproper +module + +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper /-! # Integrals against peak functions @@ -33,6 +35,8 @@ Note that there are related results about convolution with respect to peak funct `Mathlib/Analysis/Convolution.lean`, such as `MeasureTheory.convolution_tendsto_right` there. -/ +@[expose] public section + open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric open scoped Topology ENNReal diff --git a/Mathlib/MeasureTheory/Integral/Periodic.lean b/Mathlib/MeasureTheory/Integral/Periodic.lean index 7049a49e155d95..09d5c383eebf47 100644 --- a/Mathlib/MeasureTheory/Integral/Periodic.lean +++ b/Mathlib/MeasureTheory/Integral/Periodic.lean @@ -3,6 +3,8 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Alex Kontorovich, Heather Macbeth -/ -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +module + +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic deprecated_module (since := "2025-04-13") diff --git a/Mathlib/MeasureTheory/Integral/Pi.lean b/Mathlib/MeasureTheory/Integral/Pi.lean index 6fc4b6ab760dcc..f4cbf386ad6ea9 100644 --- a/Mathlib/MeasureTheory/Integral/Pi.lean +++ b/Mathlib/MeasureTheory/Integral/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.MeasureTheory.Integral.Prod +module + +public import Mathlib.MeasureTheory.Integral.Prod /-! # Integration with respect to a finite product of measures @@ -14,6 +16,8 @@ that its integral is the product of the individual integrals, in `MeasureTheory.integral_fintype_prod_eq_prod`. -/ +@[expose] public section + open Fintype MeasureTheory MeasureTheory.Measure namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Integral/Prod.lean b/Mathlib/MeasureTheory/Integral/Prod.lean index ec3f7c3f14b366..73de69496c9f71 100644 --- a/Mathlib/MeasureTheory/Integral/Prod.lean +++ b/Mathlib/MeasureTheory/Integral/Prod.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Function.LpSeminorm.Prod -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.MeasureTheory.Measure.Prod +module + +public import Mathlib.MeasureTheory.Function.LpSeminorm.Prod +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.MeasureTheory.Measure.Prod /-! # Integration with respect to the product measure @@ -33,6 +35,8 @@ In this file we prove Fubini's theorem. product measure, Fubini's theorem, Fubini-Tonelli theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean index 1cb054d1c291e5..6c1b028b5d2c2b 100644 --- a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jesse Reimann. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jesse Reimann, Kalle Kytölä -/ -import Mathlib.MeasureTheory.Measure.Content -import Mathlib.Topology.ContinuousMap.CompactlySupported -import Mathlib.Topology.PartitionOfUnity +module + +public import Mathlib.MeasureTheory.Measure.Content +public import Mathlib.Topology.ContinuousMap.CompactlySupported +public import Mathlib.Topology.PartitionOfUnity /-! # Riesz–Markov–Kakutani representation theorem @@ -27,6 +29,8 @@ literature. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/NNReal.lean b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/NNReal.lean index 369e1b7e8b361f..6de8fd8d8f92d0 100644 --- a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/NNReal.lean +++ b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/NNReal.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Yoh Tanimioto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yoh Tanimoto -/ +module -import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real +public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real /-! # Riesz–Markov–Kakutani representation theorem for `ℝ≥0` @@ -25,6 +26,8 @@ reducing the statement to the `ℝ`-version of the theorem. -/ +@[expose] public section + open scoped NNReal open CompactlySupported CompactlySupportedContinuousMap MeasureTheory diff --git a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean index 80d7e0361c829b..60f3e8f37ad298 100644 --- a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean +++ b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Yoh Tanimoto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yoh Tanimoto, Oliver Butterley -/ -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.MeasureTheory.Integral.CompactlySupported -import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic -import Mathlib.Order.Interval.Set.Union +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.MeasureTheory.Integral.CompactlySupported +public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic +public import Mathlib.Order.Interval.Set.Union /-! # Riesz–Markov–Kakutani representation theorem for real-linear functionals @@ -40,6 +42,8 @@ equality is proven using two inequalities by considering `Λ f` and `Λ (-f)` fo * [Walter Rudin, Real and Complex Analysis.][Rud87] -/ +@[expose] public section + open scoped ENNReal open CompactlySupported CompactlySupportedContinuousMap Filter Function Set Topology TopologicalSpace MeasureTheory @@ -301,7 +305,7 @@ private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rie gcongr have h : ∀ n, (y n - ε') * μ.real (E n) ≤ ∫ x in (E n), f x ∂μ := by intro n - apply setIntegral_ge_of_const_le (hE.2.2.2 n) (hE' n) + apply setIntegral_ge_of_const_le_real (hE.2.2.2 n) (hE' n) · intro x hx dsimp [y]; linarith [(hE.2.2.1 n x hx).1] · apply Integrable.integrableOn diff --git a/Mathlib/MeasureTheory/Integral/SetIntegral.lean b/Mathlib/MeasureTheory/Integral/SetIntegral.lean index edbc4a55858f7a..c64b58e2376868 100644 --- a/Mathlib/MeasureTheory/Integral/SetIntegral.lean +++ b/Mathlib/MeasureTheory/Integral/SetIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.MeasureTheory.Integral.Bochner.FundThmCalculus -import Mathlib.MeasureTheory.Integral.Bochner.Set +module + +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.MeasureTheory.Integral.Bochner.FundThmCalculus +public import Mathlib.MeasureTheory.Integral.Bochner.Set deprecated_module (since := "2025-04-15") diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index cc926ad619a069..42a93a40709c72 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.FinMeasAdditive -import Mathlib.Analysis.Normed.Operator.Extend +module + +public import Mathlib.MeasureTheory.Integral.FinMeasAdditive +public import Mathlib.Analysis.Normed.Operator.Extend /-! # Extension of a linear function from indicators to L1 @@ -57,6 +59,8 @@ If the space is also an ordered additive group with an order closed topology and - `setToFun_mono (hfg : f ≤ᵐ[μ] g) : setToFun μ T hT f ≤ setToFun μ T hT g` -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Integral/TorusIntegral.lean b/Mathlib/MeasureTheory/Integral/TorusIntegral.lean index d305d42f1d43cb..13ea96a3396fb7 100644 --- a/Mathlib/MeasureTheory/Integral/TorusIntegral.lean +++ b/Mathlib/MeasureTheory/Integral/TorusIntegral.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Cuma Kökmen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Cuma Kökmen, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Integral.CircleIntegral -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.Order.Fin.Tuple -import Mathlib.Util.Superscript +module + +public import Mathlib.MeasureTheory.Integral.CircleIntegral +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.Order.Fin.Tuple +public import Mathlib.Util.Superscript /-! # Integral over a torus in `ℂⁿ` @@ -55,6 +57,8 @@ We also define a predicate saying that `f ∘ torusMap c R` is integrable on the integral, torus -/ +@[expose] public section + variable {n : ℕ} variable {E : Type*} [NormedAddCommGroup E] diff --git a/Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean b/Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean index 8055858045c686..d86de36b84b6a6 100644 --- a/Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean +++ b/Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean @@ -3,6 +3,8 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory +module + +public import Mathlib.MeasureTheory.Integral.Bochner.VitaliCaratheodory deprecated_module (since := "2025-04-06") diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean b/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean index 7bf164fb926420..398f498de958bd 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Data.Int.Cast.Pi -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.MeasureTheory.MeasurableSpace.Defs +module + +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Data.Int.Cast.Pi +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.MeasureTheory.MeasurableSpace.Defs /-! # Measurable spaces and measurable functions @@ -40,6 +42,8 @@ Galois connection induced by `f`. measurable space, σ-algebra, measurable function, dynkin system, π-λ theorem, π-system -/ +@[expose] public section + open Set MeasureTheory universe uι diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Card.lean b/Mathlib/MeasureTheory/MeasurableSpace/Card.lean index 9a70174115e1b0..3a3cc52ce83fb1 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Card.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Card.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Violeta Hernández Palacios -/ -import Mathlib.MeasureTheory.MeasurableSpace.Defs -import Mathlib.SetTheory.Cardinal.Regular -import Mathlib.SetTheory.Cardinal.Continuum -import Mathlib.SetTheory.Cardinal.Ordinal +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Defs +public import Mathlib.SetTheory.Cardinal.Regular +public import Mathlib.SetTheory.Cardinal.Continuum +public import Mathlib.SetTheory.Cardinal.Ordinal /-! # Cardinal of sigma-algebras @@ -25,6 +27,8 @@ each step of the construction. We show in `MeasurableSpace.generateMeasurable_eq indeed generates this sigma-algebra. -/ +@[expose] public section + universe u v diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean b/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean index ae2dfb1e9f10cc..2e066b783a912b 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean @@ -3,13 +3,15 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Finset.Update -import Mathlib.Data.Prod.TProd -import Mathlib.Data.Set.UnionLift -import Mathlib.GroupTheory.Coset.Defs -import Mathlib.MeasureTheory.MeasurableSpace.Basic -import Mathlib.MeasureTheory.MeasurableSpace.Instances -import Mathlib.Order.Disjointed +module + +public import Mathlib.Data.Finset.Update +public import Mathlib.Data.Prod.TProd +public import Mathlib.Data.Set.UnionLift +public import Mathlib.GroupTheory.Coset.Defs +public import Mathlib.MeasureTheory.MeasurableSpace.Basic +public import Mathlib.MeasureTheory.MeasurableSpace.Instances +public import Mathlib.Order.Disjointed /-! # Constructions for measurable spaces and functions @@ -18,6 +20,8 @@ This file provides several ways to construct new measurable spaces and functions `Quotient`, `Subtype`, `Prod`, `Pi`, etc. -/ +@[expose] public section + assert_not_exists Filter open Set Function diff --git a/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean b/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean index aff687c2d33c52..042711e3d87e1e 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Felix Weilacher. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Felix Weilacher, Yury Kudryashov, Rémy Degenne -/ -import Mathlib.MeasureTheory.MeasurableSpace.Embedding -import Mathlib.Data.Set.MemPartition -import Mathlib.Order.Filter.CountableSeparatingOn +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Embedding +public import Mathlib.Data.Set.MemPartition +public import Mathlib.Order.Filter.CountableSeparatingOn /-! # Countably generated measurable spaces @@ -40,6 +42,8 @@ The file also contains measurability results about `memPartition`, from which th -/ +@[expose] public section + open Set MeasureTheory namespace MeasurableSpace diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean b/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean index 0f0d834ebdcdc4..01d6072f42d855 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Set.Countable -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Tactic.FunProp.Attr -import Mathlib.Tactic.Measurability +module + +public import Mathlib.Data.Set.Countable +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Tactic.FunProp.Attr +public import Mathlib.Tactic.Measurability /-! # Measurable spaces and measurable functions @@ -35,6 +37,8 @@ contains all of them. measurable space, σ-algebra, measurable function -/ +@[expose] public section + assert_not_exists Covariant MonoidWithZero open Set Encodable Function Equiv @@ -205,6 +209,20 @@ protected theorem MeasurableSet.cond {s₁ s₂ : Set α} (h₁ : MeasurableSet protected theorem MeasurableSet.const (p : Prop) : MeasurableSet { _a : α | p } := by by_cases p <;> simp [*] +protected lemma MeasurableSet.imp {p q : α → Prop} + (hs : MeasurableSet {x | p x}) (ht : MeasurableSet {x | q x}) : + MeasurableSet {x | p x → q x} := by + have h_eq : {x | p x → q x} = {x | p x}ᶜ ∪ {x | q x} := by ext; grind + rw [h_eq] + exact hs.compl.union ht + +protected lemma MeasurableSet.iff {p q : α → Prop} + (hs : MeasurableSet {x | p x}) (ht : MeasurableSet {x | q x}) : + MeasurableSet {x | p x ↔ q x} := by + have h_eq : {x | p x ↔ q x} = {x | p x → q x} ∩ {x | q x → p x} := by ext; simp; grind + rw [h_eq] + exact (hs.imp ht).inter (ht.imp hs) + /-- Every set has a measurable superset. Declare this as local instance as needed. -/ theorem nonempty_measurable_superset (s : Set α) : Nonempty { t // s ⊆ t ∧ MeasurableSet t } := ⟨⟨univ, subset_univ s, MeasurableSet.univ⟩⟩ diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean b/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean index d936ffe1061d84..90b2a8c132feec 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.Tactic.FunProp +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.Tactic.FunProp /-! # Measurable embeddings and equivalences @@ -35,6 +37,8 @@ We prove a multitude of elementary lemmas about these, and one more substantial measurable equivalence, measurable embedding -/ +@[expose] public section + open Set Function Equiv MeasureTheory diff --git a/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean b/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean index 6385bf0ebb1d07..f6b711b55c5f1e 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Felix Weilacher. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Felix Weilacher -/ +module -import Mathlib.MeasureTheory.MeasurableSpace.Defs -import Mathlib.Order.Filter.CountableInter +public import Mathlib.MeasureTheory.MeasurableSpace.Defs +public import Mathlib.Order.Filter.CountableInter /-! # Measurability modulo a filter @@ -31,6 +32,8 @@ TODO: Implement the latter. -/ +@[expose] public section + open Filter Set MeasurableSpace variable {α : Type*} (m : MeasurableSpace α) {s t : Set α} diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Instances.lean b/Mathlib/MeasureTheory/MeasurableSpace/Instances.lean index a760b97654d0de..fbd8302fa67663 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Instances.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Instances.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.MeasurableSpace.Defs -import Mathlib.GroupTheory.GroupAction.IterateAct -import Mathlib.Data.Rat.Init -import Mathlib.Data.ZMod.Defs +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Defs +public import Mathlib.GroupTheory.GroupAction.IterateAct +public import Mathlib.Data.Rat.Init +public import Mathlib.Data.ZMod.Defs /-! # Measurable-space typeclass instances @@ -15,6 +17,8 @@ This file provides measurable-space instances for a selection of standard counta in each case defining the Σ-algebra to be `⊤` (the discrete measurable-space structure). -/ +@[expose] public section + instance Empty.instMeasurableSpace : MeasurableSpace Empty := ⊤ instance PUnit.instMeasurableSpace : MeasurableSpace PUnit := ⊤ diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean b/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean index 635f9202e9bae4..cb1b8e37868318 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.MeasurableSpace.Defs +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Defs /-! # σ-algebra of sets invariant under a self-map @@ -13,6 +15,8 @@ to be the σ-algebra of sets `s : Set α` such that - and `f ⁻ˢ' s = s`. -/ +@[expose] public section + open Set Function open scoped MeasureTheory diff --git a/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean b/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean index a1205540d67bf6..8c79dddf824353 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.Order.Filter.AtTopBot.CompleteLattice -import Mathlib.Order.Filter.AtTopBot.CountablyGenerated -import Mathlib.Order.Filter.SmallSets -import Mathlib.Order.LiminfLimsup -import Mathlib.Tactic.FinCases +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.Order.Filter.AtTopBot.CompleteLattice +public import Mathlib.Order.Filter.AtTopBot.CountablyGenerated +public import Mathlib.Order.Filter.SmallSets +public import Mathlib.Order.LiminfLimsup +public import Mathlib.Tactic.FinCases /-! # Measurably generated filters @@ -17,6 +19,8 @@ We say that a filter `f` is measurably generated if every set `s ∈ f` includes set `t ∈ f`. This property is useful, e.g., to extract a measurable witness of `Filter.Eventually`. -/ +@[expose] public section + open Set Filter universe uι @@ -51,35 +55,14 @@ theorem measurableSet_generateFrom_singleton_iff {s t : Set α} : · rintro ⟨x, rfl⟩ by_cases hT : True ∈ x · by_cases hF : False ∈ x - · refine Or.inr <| Or.inr <| Or.inr <| subset_antisymm (subset_univ _) ?_ - suffices x = univ by simp only [this, preimage_univ, subset_refl] - refine subset_antisymm (subset_univ _) ?_ - rw [univ_eq_true_false] - rintro - (rfl | rfl) - · assumption - · assumption - · have hx : x = {True} := by - ext p - refine ⟨fun hp ↦ mem_singleton_iff.2 ?_, fun hp ↦ hp ▸ hT⟩ - by_contra hpneg - rw [eq_iff_iff, iff_true, ← false_iff] at hpneg - exact hF (by convert hp) - simp [hx] + · suffices x = univ by grind + grind [univ_eq_true_false] + · grind · by_cases hF : False ∈ x - · have hx : x = {False} := by - ext p - refine ⟨fun hp ↦ mem_singleton_iff.2 ?_, fun hp ↦ hp ▸ hF⟩ - grind - refine Or.inr <| Or.inr <| Or.inl <| ?_ - simp [hx, compl_def] - · refine Or.inl <| subset_antisymm ?_ <| empty_subset _ - suffices x ⊆ ∅ by - rw [subset_empty_iff] at this - simp only [this, preimage_empty, subset_refl] + · grind + · suffices x ⊆ ∅ by grind intro p hp - fin_cases p - · contradiction - · contradiction + fin_cases p <;> contradiction · rintro (rfl | rfl | rfl | rfl) on_goal 1 => use ∅ on_goal 2 => use {True} diff --git a/Mathlib/MeasureTheory/MeasurableSpace/NCard.lean b/Mathlib/MeasureTheory/MeasurableSpace/NCard.lean index 0729e807c65750..af19fd1666915c 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/NCard.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/NCard.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Card -import Mathlib.MeasureTheory.MeasurableSpace.Constructions +module + +public import Mathlib.Data.Set.Card +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions /-! # Measurability of `Set.encard` and `Set.ncard` @@ -13,6 +15,8 @@ In this file we prove that `Set.encard` and `Set.ncard` are measurable functions provided that the ambient space is countable. -/ +@[expose] public section + open Set variable {α : Type*} [Countable α] diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Pi.lean b/Mathlib/MeasureTheory/MeasurableSpace/Pi.lean index e9c845b3b8c745..9ac1896f535108 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Pi.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.MeasureTheory.PiSystem +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.MeasureTheory.PiSystem /-! # Bases of the indexed product σ-algebra @@ -17,6 +19,8 @@ then the sets `{x | ∀ i, x i ∈ s i}`, where `s i ∈ C i`, generate the σ-algebra on the indexed product of `α i`s. -/ +@[expose] public section + noncomputable section open Function Set MeasurableSpace Encodable diff --git a/Mathlib/MeasureTheory/MeasurableSpace/PreorderRestrict.lean b/Mathlib/MeasureTheory/MeasurableSpace/PreorderRestrict.lean index 6c90369494549b..cb1e513bf495cd 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/PreorderRestrict.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/PreorderRestrict.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.Order.Restriction +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.Order.Restriction /-! # Measurability of the restriction function for functions indexed by a preorder @@ -13,6 +15,8 @@ We prove that the map which restricts a function `f : (i : α) → X i` to eleme measurable. -/ +@[expose] public section + open MeasureTheory namespace Preorder diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Prod.lean b/Mathlib/MeasureTheory/MeasurableSpace/Prod.lean index f03704f0acff78..ff07cb6ae4d3b3 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Prod.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.MeasurableSpace.Embedding -import Mathlib.MeasureTheory.PiSystem +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Embedding +public import Mathlib.MeasureTheory.PiSystem /-! # The product sigma algebra @@ -12,6 +14,8 @@ import Mathlib.MeasureTheory.PiSystem This file talks about the measurability of operations on binary functions. -/ +@[expose] public section + assert_not_exists MeasureTheory.Measure noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/AEDisjoint.lean b/Mathlib/MeasureTheory/Measure/AEDisjoint.lean index 7998e50fd3efc5..f013aaba6978c1 100644 --- a/Mathlib/MeasureTheory/Measure/AEDisjoint.lean +++ b/Mathlib/MeasureTheory/Measure/AEDisjoint.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.MeasureSpaceDef +module + +public import Mathlib.MeasureTheory.Measure.MeasureSpaceDef /-! # Almost everywhere disjoint sets @@ -13,6 +15,8 @@ intersection has measure zero. This assumption can be used instead of `Disjoint` measure theory. -/ +@[expose] public section + open Set Function diff --git a/Mathlib/MeasureTheory/Measure/AEMeasurable.lean b/Mathlib/MeasureTheory/Measure/AEMeasurable.lean index 94e6256b1ecd44..9addf8501b275e 100644 --- a/Mathlib/MeasureTheory/Measure/AEMeasurable.lean +++ b/Mathlib/MeasureTheory/Measure/AEMeasurable.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Trim -import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated +module + +public import Mathlib.MeasureTheory.Measure.Trim +public import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated /-! # Almost everywhere measurable functions @@ -14,6 +16,8 @@ function. This property, called `AEMeasurable f μ`, is defined in the file `Mea We discuss several of its properties that are analogous to properties of measurable functions. -/ +@[expose] public section + open MeasureTheory MeasureTheory.Measure Filter Set Function ENNReal variable {ι α β γ δ R : Type*} {m0 : MeasurableSpace α} [MeasurableSpace β] [MeasurableSpace γ] diff --git a/Mathlib/MeasureTheory/Measure/AbsolutelyContinuous.lean b/Mathlib/MeasureTheory/Measure/AbsolutelyContinuous.lean index bd46b646ec311e..7e90c1a8df4abf 100644 --- a/Mathlib/MeasureTheory/Measure/AbsolutelyContinuous.lean +++ b/Mathlib/MeasureTheory/Measure/AbsolutelyContinuous.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Map +module + +public import Mathlib.MeasureTheory.Measure.Map /-! # Absolute Continuity of Measures @@ -29,6 +31,8 @@ It is equivalent to an inequality of the almost everywhere filters of the measur -/ +@[expose] public section + variable {α β δ ι R : Type*} namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/AddContent.lean b/Mathlib/MeasureTheory/Measure/AddContent.lean index c8a049508d5273..bc48c754fcd9b1 100644 --- a/Mathlib/MeasureTheory/Measure/AddContent.lean +++ b/Mathlib/MeasureTheory/Measure/AddContent.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.MeasureTheory.SetSemiring -import Mathlib.MeasureTheory.OuterMeasure.Induced +module + +public import Mathlib.MeasureTheory.SetSemiring +public import Mathlib.MeasureTheory.OuterMeasure.Induced /-! # Additive Contents @@ -51,6 +53,8 @@ If `C` is a set ring (`MeasureTheory.IsSetRing C`), we have -/ +@[expose] public section + open Set Finset Function Filter open scoped ENNReal Topology Function diff --git a/Mathlib/MeasureTheory/Measure/CharacteristicFunction.lean b/Mathlib/MeasureTheory/Measure/CharacteristicFunction.lean index d010e9cac79541..8ce3a3351147c7 100644 --- a/Mathlib/MeasureTheory/Measure/CharacteristicFunction.lean +++ b/Mathlib/MeasureTheory/Measure/CharacteristicFunction.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Jakob Stiefel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Stiefel, Rémy Degenne, Thomas Zhu -/ -import Mathlib.Analysis.Fourier.BoundedContinuousFunctionChar -import Mathlib.Analysis.Fourier.FourierTransform -import Mathlib.Analysis.InnerProductSpace.Dual -import Mathlib.Analysis.InnerProductSpace.ProdL2 -import Mathlib.Analysis.Normed.Lp.MeasurableSpace -import Mathlib.MeasureTheory.Group.IntegralConvolution -import Mathlib.MeasureTheory.Integral.Pi -import Mathlib.MeasureTheory.Measure.FiniteMeasureExt +module + +public import Mathlib.Analysis.Fourier.BoundedContinuousFunctionChar +public import Mathlib.Analysis.Fourier.FourierTransform +public import Mathlib.Analysis.InnerProductSpace.Dual +public import Mathlib.Analysis.InnerProductSpace.ProdL2 +public import Mathlib.Analysis.Normed.Lp.MeasurableSpace +public import Mathlib.MeasureTheory.Group.IntegralConvolution +public import Mathlib.MeasureTheory.Integral.Pi +public import Mathlib.MeasureTheory.Measure.FiniteMeasureExt /-! # Characteristic Function of a Finite Measure @@ -49,6 +51,8 @@ and `L`. -/ +@[expose] public section + open BoundedContinuousFunction RealInnerProductSpace Real Complex ComplexConjugate NormedSpace WithLp diff --git a/Mathlib/MeasureTheory/Measure/Comap.lean b/Mathlib/MeasureTheory/Measure/Comap.lean index 0305e9c566226c..d49b6794c844ca 100644 --- a/Mathlib/MeasureTheory/Measure/Comap.lean +++ b/Mathlib/MeasureTheory/Measure/Comap.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving +module + +public import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving /-! # Pullback of a measure @@ -17,6 +19,8 @@ In the future, we may decide to redefine `comap f μ` so that it gives meaningfu for covering maps like `(↑) : ℝ → AddCircle (1 : ℝ)`. -/ +@[expose] public section + open Function Set Filter open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Complex.lean b/Mathlib/MeasureTheory/Measure/Complex.lean index 5eb54b9e8e982c..b92d49d0a921ff 100644 --- a/Mathlib/MeasureTheory/Measure/Complex.lean +++ b/Mathlib/MeasureTheory/Measure/Complex.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.VectorMeasure.Basic -import Mathlib.Analysis.Complex.Basic +module + +public import Mathlib.MeasureTheory.VectorMeasure.Basic +public import Mathlib.Analysis.Complex.Basic /-! # Complex measure @@ -29,6 +31,8 @@ a complex measure is always in the form `s + it` where `s` and `t` are signed me Complex measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/Content.lean b/Mathlib/MeasureTheory/Measure/Content.lean index 104c6d06316081..2e1c70450c994d 100644 --- a/Mathlib/MeasureTheory/Measure/Content.lean +++ b/Mathlib/MeasureTheory/Measure/Content.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Measure.MeasureSpace -import Mathlib.MeasureTheory.Measure.Regular -import Mathlib.Topology.Sets.Compacts +module + +public import Mathlib.MeasureTheory.Measure.MeasureSpace +public import Mathlib.MeasureTheory.Measure.Regular +public import Mathlib.Topology.Sets.Compacts /-! # Contents @@ -49,6 +51,8 @@ When the space is locally compact, `μ.measure` is also regular. * -/ +@[expose] public section + universe u v w diff --git a/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean b/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean index 053ddc2d7e3391..30cdd8f85248d4 100644 --- a/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean +++ b/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Topology.CompactOpen -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.MeasureTheory.Measure.Regular +module + +public import Mathlib.Topology.CompactOpen +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.MeasureTheory.Measure.Regular /-! # Continuity of the preimage of a set under a measure-preserving continuous function @@ -20,6 +22,8 @@ a null measurable set `s`, and a null measurable set `t` of finite measure, the set of parameters `z` such that `f z ⁻¹' t` is a.e. equal to `s` is a closed set. -/ +@[expose] public section + open Filter Set open scoped ENNReal symmDiff Topology diff --git a/Mathlib/MeasureTheory/Measure/Count.lean b/Mathlib/MeasureTheory/Measure/Count.lean index 3308e41f8d108f..b6e323b8a81451 100644 --- a/Mathlib/MeasureTheory/Measure/Count.lean +++ b/Mathlib/MeasureTheory/Measure/Count.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.MeasureTheory.Measure.Dirac -import Mathlib.Topology.Algebra.InfiniteSum.ENNReal +module + +public import Mathlib.MeasureTheory.Measure.Dirac +public import Mathlib.Topology.Algebra.InfiniteSum.ENNReal /-! # Counting measure @@ -14,6 +16,8 @@ as `MeasureTheory.Measure.sum MeasureTheory.Measure.dirac` and prove basic properties of this measure. -/ +@[expose] public section + open Set open scoped ENNReal Finset diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/Exhaustion.lean b/Mathlib/MeasureTheory/Measure/Decomposition/Exhaustion.lean index 6d3f80554188f0..8cb72e4e89155a 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/Exhaustion.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/Exhaustion.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite /-! # Method of exhaustion @@ -44,6 +46,8 @@ If `μ, ν` are two measures with `ν` s-finite, then there exists a set `s` suc -/ +@[expose] public section + assert_not_exists MeasureTheory.Measure.rnDeriv assert_not_exists MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/Hahn.lean b/Mathlib/MeasureTheory/Measure/Decomposition/Hahn.lean index 42110f07863a77..b363dc276c6ea6 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/Hahn.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/Hahn.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Loic Simon -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite /-! # Unsigned Hahn decomposition theorem @@ -28,6 +30,8 @@ This file proves the unsigned version of the Hahn decomposition theorem. Hahn decomposition -/ +@[expose] public section + assert_not_exists MeasureTheory.Measure.rnDeriv assert_not_exists MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/IntegralRNDeriv.lean b/Mathlib/MeasureTheory/Measure/Decomposition/IntegralRNDeriv.lean index b91a8863958aec..5ff7fa63056c19 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/IntegralRNDeriv.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/IntegralRNDeriv.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Analysis.Convex.Continuous -import Mathlib.Analysis.Convex.Integral -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +module + +public import Mathlib.Analysis.Convex.Continuous +public import Mathlib.Analysis.Convex.Integral +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym /-! # Integrals of functions of Radon-Nikodym derivatives @@ -18,6 +20,8 @@ import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -/ +@[expose] public section + open Set diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean b/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean index d37b40a2769544..eeac980aecdd30 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Measure.Decomposition.Hahn -import Mathlib.MeasureTheory.Function.AEEqOfLIntegral -import Mathlib.MeasureTheory.Measure.Sub +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.Hahn +public import Mathlib.MeasureTheory.Function.AEEqOfLIntegral +public import Mathlib.MeasureTheory.Measure.Sub /-! # Lebesgue decomposition @@ -44,6 +46,8 @@ The Lebesgue decomposition provides the Radon-Nikodym theorem readily. Lebesgue decomposition theorem -/ +@[expose] public section + assert_not_exists MeasureTheory.VectorMeasure open scoped MeasureTheory NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/RadonNikodym.lean b/Mathlib/MeasureTheory/Measure/Decomposition/RadonNikodym.lean index 3b8e0066cc05b7..1964b2deab8617 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/RadonNikodym.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/RadonNikodym.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue +module + +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue /-! # Radon-Nikodym theorem @@ -40,6 +42,8 @@ The file also contains properties of `rnDeriv` that use the Radon-Nikodym theore Radon-Nikodym theorem -/ +@[expose] public section + assert_not_exists InnerProductSpace assert_not_exists MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/Measure/Dirac.lean b/Mathlib/MeasureTheory/Measure/Dirac.lean index 73edd7694bed1b..a3fd516d39a4e3 100644 --- a/Mathlib/MeasureTheory/Measure/Dirac.lean +++ b/Mathlib/MeasureTheory/Measure/Dirac.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated -import Mathlib.MeasureTheory.Measure.MutuallySingular -import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability -import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite +module + +public import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated +public import Mathlib.MeasureTheory.Measure.MutuallySingular +public import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +public import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite /-! # Dirac measure @@ -16,6 +18,8 @@ In this file we define the Dirac measure `MeasureTheory.Measure.dirac a` and prove some basic facts about it. -/ +@[expose] public section + open Function Set open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Measure/DiracProba.lean b/Mathlib/MeasureTheory/Measure/DiracProba.lean index 2eb5d0e7bc84ec..f0e66517ecd0e8 100644 --- a/Mathlib/MeasureTheory/Measure/DiracProba.lean +++ b/Mathlib/MeasureTheory/Measure/DiracProba.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.Topology.Separation.CompletelyRegular -import Mathlib.MeasureTheory.Measure.ProbabilityMeasure +module + +public import Mathlib.Topology.Separation.CompletelyRegular +public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure /-! # Dirac deltas as probability measures and embedding of a space into probability measures on it @@ -21,6 +23,8 @@ import Mathlib.MeasureTheory.Measure.ProbabilityMeasure probability measure, Dirac delta, embedding -/ +@[expose] public section + open Topology Metric Filter Set ENNReal NNReal BoundedContinuousFunction open scoped Topology ENNReal NNReal BoundedContinuousFunction @@ -81,10 +85,8 @@ lemma not_tendsto_diracProba_of_not_tendsto [CompletelyRegularSpace X] {x : X} ( (h : ¬ Tendsto id L (𝓝 x)) : ¬ Tendsto diracProba L (𝓝 (diracProba x)) := by obtain ⟨U, U_nhds, hU⟩ : ∃ U, U ∈ 𝓝 x ∧ ∃ᶠ x in L, x ∉ U := by - by_contra! con - apply h - intro U U_nhds - simpa only [not_frequently, not_not] using con U U_nhds + contrapose! h + exact h have Uint_nhds : interior U ∈ 𝓝 x := by simpa only [interior_mem_nhds] using U_nhds obtain ⟨f, fx_eq_one, f_vanishes_outside⟩ := CompletelyRegularSpace.exists_BCNN isOpen_interior.isClosed_compl diff --git a/Mathlib/MeasureTheory/Measure/Doubling.lean b/Mathlib/MeasureTheory/Measure/Doubling.lean index 14d98257e5741e..1c10e856930273 100644 --- a/Mathlib/MeasureTheory/Measure/Doubling.lean +++ b/Mathlib/MeasureTheory/Measure/Doubling.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Analysis.SpecialFunctions.Log.Base -import Mathlib.MeasureTheory.Measure.MeasureSpaceDef +module + +public import Mathlib.Analysis.SpecialFunctions.Log.Base +public import Mathlib.MeasureTheory.Measure.MeasureSpaceDef /-! # Uniformly locally doubling measures @@ -23,6 +25,8 @@ This file records basic facts about uniformly locally doubling measures. appearing in the definition of a uniformly locally doubling measure. -/ +@[expose] public section + noncomputable section open Set Filter Metric MeasureTheory TopologicalSpace ENNReal NNReal Topology diff --git a/Mathlib/MeasureTheory/Measure/EverywherePos.lean b/Mathlib/MeasureTheory/Measure/EverywherePos.lean index ddd65f43c74127..a149d60a458a4b 100644 --- a/Mathlib/MeasureTheory/Measure/EverywherePos.lean +++ b/Mathlib/MeasureTheory/Measure/EverywherePos.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Group.Measure -import Mathlib.Tactic.Group -import Mathlib.Topology.UrysohnsLemma +module + +public import Mathlib.MeasureTheory.Group.Measure +public import Mathlib.Tactic.Group +public import Mathlib.Topology.UrysohnsLemma /-! # Everywhere positive sets in measure spaces @@ -36,6 +38,8 @@ assuming additionally that `s` has finite measure. measures. -/ +@[expose] public section + open scoped Topology ENNReal NNReal open Set Filter diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean index 8b2d117c0290f6..a496453a782ae7 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.Topology.Algebra.Module.WeakDual +module + +public import Mathlib.Analysis.RCLike.Lemmas +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.Topology.Algebra.Module.WeakDual /-! # Finite measures @@ -80,6 +82,8 @@ weak convergence of measures, finite measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean index 22edc866af5ae2..b50ecb49685da4 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jakob Stiefel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Stiefel -/ -import Mathlib.Analysis.RCLike.BoundedContinuous -import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSqIntegral -import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed +module + +public import Mathlib.Analysis.RCLike.BoundedContinuous +public import Mathlib.Analysis.SpecialFunctions.MulExpNegMulSqIntegral +public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed /-! # Extensionality of finite measures @@ -16,6 +18,8 @@ the integrals of all elements of `A` with respect to two finite measures `P, P'` measures coincide. In other words: If a Subalgebra separates points, it separates finite measures. -/ +@[expose] public section + open MeasureTheory Filter Real RCLike BoundedContinuousFunction open scoped Topology diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean index b20deb61323b44..745db1117295d8 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric +module + +public import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric /-! # Products of finite measures and probability measures @@ -26,6 +28,8 @@ continuously on the factors. -/ +@[expose] public section + open MeasureTheory Topology Metric Filter Set ENNReal NNReal open scoped Topology ENNReal NNReal BoundedContinuousFunction diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean index 1e4439f0156b01..b579ae7da8e2cf 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric -import Mathlib.MeasureTheory.Measure.Prod +module + +public import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric +public import Mathlib.MeasureTheory.Measure.Prod /-! # Products of finite measures and probability measures @@ -27,6 +29,8 @@ continuously on the factors. -/ +@[expose] public section + open MeasureTheory Topology Metric Filter Set ENNReal NNReal open scoped Topology ENNReal NNReal BoundedContinuousFunction diff --git a/Mathlib/MeasureTheory/Measure/GiryMonad.lean b/Mathlib/MeasureTheory/Measure/GiryMonad.lean index 522599264a011b..044bf28f6e6ecc 100644 --- a/Mathlib/MeasureTheory/Measure/GiryMonad.lean +++ b/Mathlib/MeasureTheory/Measure/GiryMonad.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Countable /-! # The Giry monad @@ -27,6 +29,8 @@ monad to an honest monad of the functor `measure : MeasCat ⥤ MeasCat`. giry monad -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/Haar/Basic.lean b/Mathlib/MeasureTheory/Measure/Haar/Basic.lean index d14cc08b8e1321..b4e594bf46a5f1 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Basic.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Measure.Content -import Mathlib.MeasureTheory.Group.Prod -import Mathlib.Topology.Algebra.Group.Compact +module + +public import Mathlib.MeasureTheory.Measure.Content +public import Mathlib.MeasureTheory.Group.Prod +public import Mathlib.Topology.Algebra.Group.Compact /-! # Haar measure @@ -60,6 +62,8 @@ the file `Mathlib/MeasureTheory/Measure/Haar/Unique.lean`. * https://en.wikipedia.org/wiki/Haar_measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/Haar/Disintegration.lean b/Mathlib/MeasureTheory/Measure/Haar/Disintegration.lean index 5e9217df18b892..0580e648c24e2b 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Disintegration.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Disintegration.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Haar.Basic -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.MeasureTheory.Measure.Haar.Basic +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Pushing a Haar measure by a linear map @@ -22,6 +24,8 @@ TODO: this holds more generally in any locally compact group, see [Fremlin, *Measure Theory* (volume 4, 443Q)][fremlin_vol4] -/ +@[expose] public section + open MeasureTheory Measure Set open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Haar/DistribChar.lean b/Mathlib/MeasureTheory/Measure/Haar/DistribChar.lean index 823c4c9e5bcf44..72b1cb362675d5 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/DistribChar.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/DistribChar.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang, Yaël Dillies, Javier López-Contreras. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Yaël Dillies, Javier López-Contreras -/ -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # The distributive character of Haar measures @@ -24,6 +26,8 @@ multiplicative instead of distributive. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/217875-Is-there-code-for-X.3F/topic/canonical.20norm.20coming.20from.20Haar.20measure/near/480050592) -/ +@[expose] public section + open MeasureTheory.Measure open scoped NNReal Pointwise ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean b/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean index 50e4b316d2d829..19632ccd3bcdf0 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Analysis.InnerProductSpace.Orientation -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.Analysis.Normed.Lp.MeasurableSpace +module + +public import Mathlib.Analysis.InnerProductSpace.Orientation +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.Analysis.Normed.Lp.MeasurableSpace /-! # Volume forms and measures on inner product spaces @@ -17,6 +19,8 @@ measure `1` to the parallelepiped spanned by any orthonormal basis, and that it the canonical `volume` from the `MeasureSpace` instance. -/ +@[expose] public section + open Module MeasureTheory MeasureTheory.Measure Set WithLp variable {ι E F : Type*} diff --git a/Mathlib/MeasureTheory/Measure/Haar/MulEquivHaarChar.lean b/Mathlib/MeasureTheory/Measure/Haar/MulEquivHaarChar.lean index 5e19e59dd11711..c0afa8bf97e0cb 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/MulEquivHaarChar.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/MulEquivHaarChar.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Scaling Haar measure by a continuous isomorphism @@ -20,6 +22,8 @@ real constant which we call `mulEquivHaarChar φ`. -/ +@[expose] public section + open MeasureTheory.Measure open scoped NNReal Pointwise ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean b/Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean index 7aa61b9aaa57d5..32c5b74fda5b30 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace -import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -import Mathlib.MeasureTheory.Integral.Bochner.Set +module + +public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace +public import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +public import Mathlib.MeasureTheory.Integral.Bochner.Set /-! # Basic properties of Haar measures on real vector spaces -/ +@[expose] public section + noncomputable section open Function Filter Inv MeasureTheory.Measure Module Set TopologicalSpace diff --git a/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean b/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean index cd6ec920fb92ef..662db40af52ba0 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Haar.Basic -import Mathlib.Analysis.InnerProductSpace.PiL2 +module + +public import Mathlib.MeasureTheory.Measure.Haar.Basic +public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # Additive Haar measure constructed from a basis @@ -25,6 +27,8 @@ by using the Lebesgue measure associated to some orthonormal basis (which is in of the basis). -/ +@[expose] public section + open Set TopologicalSpace MeasureTheory MeasureTheory.Measure Module @@ -207,9 +211,9 @@ theorem parallelepiped_reindex (b : Basis ι ℝ E) (e : ι ≃ ι') : theorem parallelepiped_map (b : Basis ι ℝ E) (e : E ≃ₗ[ℝ] F) : (b.map e).parallelepiped = b.parallelepiped.map e - (haveI := FiniteDimensional.of_fintype_basis b + (haveI := b.finiteDimensional_of_finite LinearMap.continuous_of_finiteDimensional e.toLinearMap) - (haveI := FiniteDimensional.of_fintype_basis (b.map e) + (haveI := (b.map e).finiteDimensional_of_finite LinearMap.isOpenMap_of_finiteDimensional _ e.surjective) := PositiveCompacts.ext (image_parallelepiped e.toLinearMap _).symm @@ -254,7 +258,7 @@ instance _root_.isAddHaarMeasure_basis_addHaar (b : Basis ι ℝ E) : IsAddHaarM rw [Basis.addHaar]; exact Measure.isAddHaarMeasure_addHaarMeasure _ instance (b : Basis ι ℝ E) : SigmaFinite b.addHaar := by - have : FiniteDimensional ℝ E := FiniteDimensional.of_fintype_basis b + have : FiniteDimensional ℝ E := b.finiteDimensional_of_finite rw [Basis.addHaar_def]; exact sigmaFinite_addHaarMeasure /-- Let `μ` be a σ-finite left invariant measure on `E`. Then `μ` is equal to the Haar measure @@ -277,8 +281,8 @@ variable [MeasurableSpace F] [BorelSpace F] [SecondCountableTopologyEither E F] theorem prod_addHaar (v : Basis ι ℝ E) (w : Basis ι' ℝ F) : (v.prod w).addHaar = v.addHaar.prod w.addHaar := by - have : FiniteDimensional ℝ E := FiniteDimensional.of_fintype_basis v - have : FiniteDimensional ℝ F := FiniteDimensional.of_fintype_basis w + have : FiniteDimensional ℝ E := v.finiteDimensional_of_finite + have : FiniteDimensional ℝ F := w.finiteDimensional_of_finite simp [(v.prod w).addHaar_eq_iff, Basis.prod_parallelepiped, Basis.addHaar_self] end Module.Basis diff --git a/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean b/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean index 1ba118240d141a..aeb9688f7a15fe 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Alex Kontorovich and Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, Heather Macbeth -/ -import Mathlib.Algebra.Group.Opposite -import Mathlib.MeasureTheory.Constructions.Polish.Basic -import Mathlib.MeasureTheory.Group.FundamentalDomain -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.MeasureTheory.Measure.Haar.Basic +module + +public import Mathlib.Algebra.Group.Opposite +public import Mathlib.MeasureTheory.Constructions.Polish.Basic +public import Mathlib.MeasureTheory.Group.FundamentalDomain +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Measure.Haar.Basic /-! # Haar quotient measure @@ -44,6 +46,8 @@ Note that a group `G` with Haar measure that is both left and right invariant is **unimodular**. -/ +@[expose] public section + open Set MeasureTheory TopologicalSpace MeasureTheory.Measure open scoped Pointwise NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Haar/Unique.lean b/Mathlib/MeasureTheory/Measure/Haar/Unique.lean index d8a580f423c8a1..7d86dee6cb9844 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Unique.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Unique.lean @@ -3,15 +3,17 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Function.LocallyIntegrable -import Mathlib.MeasureTheory.Group.Integral -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.MeasureTheory.Measure.EverywherePos -import Mathlib.MeasureTheory.Measure.Haar.Basic -import Mathlib.Topology.Metrizable.Urysohn -import Mathlib.Topology.UrysohnsLemma -import Mathlib.Topology.ContinuousMap.Ordered +module + +public import Mathlib.MeasureTheory.Function.LocallyIntegrable +public import Mathlib.MeasureTheory.Group.Integral +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.MeasureTheory.Measure.EverywherePos +public import Mathlib.MeasureTheory.Measure.Haar.Basic +public import Mathlib.Topology.Metrizable.Urysohn +public import Mathlib.Topology.UrysohnsLemma +public import Mathlib.Topology.ContinuousMap.Ordered /-! # Uniqueness of Haar measure in locally compact groups @@ -66,6 +68,8 @@ the measures but discarding the assumption that they are finite on compact sets. [Fremlin, *Measure Theory* (volume 4)][fremlin_vol4] -/ +@[expose] public section + open Filter Set TopologicalSpace Function MeasureTheory Measure open scoped Uniformity Topology ENNReal Pointwise NNReal diff --git a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean index d15d44917cab5f..b65527be4250b1 100644 --- a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean +++ b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction -import Mathlib.Topology.MetricSpace.ThickenedIndicator +module + +public import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction +public import Mathlib.Topology.MetricSpace.ThickenedIndicator /-! # Spaces where indicators of closed sets have decreasing approximations by continuous functions @@ -34,6 +36,8 @@ convergence in distribution for random variables behave somewhat well in spaces -/ +@[expose] public section + open BoundedContinuousFunction MeasureTheory Topology Metric Filter Set ENNReal NNReal open scoped Topology ENNReal NNReal BoundedContinuousFunction diff --git a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean index 2a140585cbcf42..7826ff1152e3f1 100644 --- a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean +++ b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Integral.Prod -import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed +module + +public import Mathlib.MeasureTheory.Integral.Prod +public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed /-! # Characterization of a finite measure by the integrals of products of bounded functions @@ -24,7 +26,7 @@ such that for any two families bounded continuous functions We specialize these results to the cases where one of the families contains only one type. -# Main statements +## Main statements * `ext_of_integral_prod_mul_prod_boundedContinuousFunction`: A finite measure `μ` over `(Π i, X i) × (Π j, Y j)` is determined by the values @@ -46,11 +48,13 @@ We specialize these results to the cases where one of the families contains only `ν` is the only finite measure `ξ` such that for all real bounded continuous functions `f` and `g` we have `∫ z, f z.1 * g z.2 ∂ξ = ∫ x, f x ∂μ * ∫ y, g y ∂ν`. -# Tags +## Tags bounded continuous function, product measure -/ +@[expose] public section + open BoundedContinuousFunction MeasureTheory Topology Filter Set ENNReal NNReal MeasurableSpace open scoped Topology ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Measure/Hausdorff.lean b/Mathlib/MeasureTheory/Measure/Hausdorff.lean index af583a7e8b1417..6d6c279a8e70c3 100644 --- a/Mathlib/MeasureTheory/Measure/Hausdorff.lean +++ b/Mathlib/MeasureTheory/Measure/Hausdorff.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.Convex.Between -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic -import Mathlib.Topology.MetricSpace.Holder -import Mathlib.Topology.MetricSpace.MetricSeparated +module + +public import Mathlib.Analysis.Convex.Between +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +public import Mathlib.Topology.MetricSpace.Holder +public import Mathlib.Topology.MetricSpace.MetricSeparated /-! # Hausdorff measure and metric (outer) measures @@ -106,6 +108,8 @@ dimension. Hausdorff measure, measure, metric measure -/ +@[expose] public section + open scoped NNReal ENNReal Topology diff --git a/Mathlib/MeasureTheory/Measure/IntegralCharFun.lean b/Mathlib/MeasureTheory/Measure/IntegralCharFun.lean index 054109665299a9..ecf5ca613991ae 100644 --- a/Mathlib/MeasureTheory/Measure/IntegralCharFun.lean +++ b/Mathlib/MeasureTheory/Measure/IntegralCharFun.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.MeasureTheory.Function.SpecialFunctions.Sinc -import Mathlib.MeasureTheory.Measure.CharacteristicFunction +module + +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Sinc +public import Mathlib.MeasureTheory.Measure.CharacteristicFunction /-! # Integrals of characteristic functions @@ -29,6 +31,8 @@ relating the measure of some sets to integrals of characteristic functions. -/ +@[expose] public section + open RealInnerProductSpace Real Complex NormedSpace namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean index 1fd2bc39e845a7..23ee440a638c35 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Dynamics.Ergodic.MeasurePreserving -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Matrix.Diagonal -import Mathlib.LinearAlgebra.Matrix.Transvection -import Mathlib.MeasureTheory.Group.LIntegral -import Mathlib.MeasureTheory.Integral.Marginal -import Mathlib.MeasureTheory.Measure.Stieltjes -import Mathlib.MeasureTheory.Measure.Haar.OfBasis +module + +public import Mathlib.Dynamics.Ergodic.MeasurePreserving +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Matrix.Diagonal +public import Mathlib.LinearAlgebra.Matrix.Transvection +public import Mathlib.MeasureTheory.Group.LIntegral +public import Mathlib.MeasureTheory.Integral.Marginal +public import Mathlib.MeasureTheory.Measure.Stieltjes +public import Mathlib.MeasureTheory.Measure.Haar.OfBasis /-! # Lebesgue measure on the real line and on `ℝⁿ` @@ -28,6 +30,8 @@ More properties of the Lebesgue measure are deduced from this in additive Haar measure on a finite-dimensional real vector space. -/ +@[expose] public section + assert_not_exists MeasureTheory.integral diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/Complex.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/Complex.lean index 402c4cd37d695d..b1c4aefc14f73b 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/Complex.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/Complex.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace -import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex +module + +public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex /-! # Lebesgue measure on `ℂ` @@ -17,6 +19,8 @@ used ways to represent `ℝ²` in `mathlib`: `ℝ × ℝ` and `Fin 2 → ℝ`, d of `MeasureTheory.measurePreserving`). -/ +@[expose] public section + open MeasureTheory Module noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean index a79082abbec0d5..cf69d68988877c 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Sébastien Gouëzel -/ -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric -import Mathlib.MeasureTheory.Group.Pointwise -import Mathlib.MeasureTheory.Measure.Doubling -import Mathlib.MeasureTheory.Measure.Haar.Basic -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +module + +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric +public import Mathlib.MeasureTheory.Group.Pointwise +public import Mathlib.MeasureTheory.Measure.Doubling +public import Mathlib.MeasureTheory.Measure.Haar.Basic +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic /-! # Relationship between the Haar and Lebesgue measures @@ -44,6 +46,8 @@ Statements on integrals of functions with respect to an additive Haar measure ca `MeasureTheory.Measure.Haar.NormedSpace`. -/ +@[expose] public section + assert_not_exists MeasureTheory.integral open TopologicalSpace Set Filter Metric Bornology @@ -562,7 +566,7 @@ variable {ι G : Type*} [Fintype ι] [DecidableEq ι] [NormedAddCommGroup G] [No theorem addHaar_parallelepiped (b : Basis ι ℝ G) (v : ι → G) : b.addHaar (parallelepiped v) = ENNReal.ofReal |b.det v| := by - have : FiniteDimensional ℝ G := FiniteDimensional.of_fintype_basis b + have : FiniteDimensional ℝ G := b.finiteDimensional_of_finite have A : parallelepiped v = b.constr ℕ v '' parallelepiped b := by rw [image_parallelepiped] exact congr_arg _ <| funext fun i ↦ (b.constr_basis ℕ v i).symm diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/Integral.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/Integral.lean index f8ba08362424c8..03edd1bb603bff 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/Integral.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/Integral.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic -import Mathlib.MeasureTheory.Measure.Haar.Unique +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +public import Mathlib.MeasureTheory.Measure.Haar.Unique /-! # Properties of integration with respect to the Lebesgue measure -/ +@[expose] public section + open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean index 9b423a477692d0..33078411fc9c5f 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.MeasureTheory.Constructions.HaarToSphere -import Mathlib.MeasureTheory.Integral.Gamma -import Mathlib.MeasureTheory.Integral.Pi +module + +public import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.MeasureTheory.Constructions.HaarToSphere +public import Mathlib.MeasureTheory.Integral.Gamma +public import Mathlib.MeasureTheory.Integral.Pi /-! # Volume of balls @@ -39,6 +41,8 @@ Using these formulas, we compute the volume of the unit balls in several cases. * `Complex.volume_ball` / `Complex.volume_closedBall`: volume of open and closed balls in `ℂ`. -/ +@[expose] public section + section general_case open MeasureTheory MeasureTheory.Measure Module ENNReal diff --git a/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean b/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean index 643fdea2dbb569..e035c41da95c22 100644 --- a/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean +++ b/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Measure.Portmanteau -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.MeasureTheory.Integral.Layercake -import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction +module + +public import Mathlib.MeasureTheory.Measure.Portmanteau +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.Layercake +public import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction /-! # The Lévy-Prokhorov distance on spaces of finite measures and probability measures @@ -33,6 +35,8 @@ import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction finite measure, probability measure, weak convergence, convergence in distribution, metrizability -/ +@[expose] public section + open Topology Metric Filter Set ENNReal NNReal namespace MeasureTheory @@ -265,7 +269,7 @@ open Lean.PrettyPrinter.Delaborator in /-- This prevents `ofMeasure x` being printed as `{ toMeasure := x }` by `delabStructureInstance`. -/ @[app_delab LevyProkhorov.ofMeasure] -def LevyProkhorov.delabOfMeasure : Delab := delabApp +meta def LevyProkhorov.delabOfMeasure : Delab := delabApp namespace LevyProkhorov diff --git a/Mathlib/MeasureTheory/Measure/LogLikelihoodRatio.lean b/Mathlib/MeasureTheory/Measure/LogLikelihoodRatio.lean index 269ef88859de46..5bf5fe34f45f47 100644 --- a/Mathlib/MeasureTheory/Measure/LogLikelihoodRatio.lean +++ b/Mathlib/MeasureTheory/Measure/LogLikelihoodRatio.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Tilted +module + +public import Mathlib.MeasureTheory.Measure.Tilted /-! # Log-likelihood Ratio @@ -21,6 +23,8 @@ This file contains a definition of the log-likelihood ratio (llr) and its proper -/ +@[expose] public section + open Real open scoped ENNReal NNReal Topology diff --git a/Mathlib/MeasureTheory/Measure/Map.lean b/Mathlib/MeasureTheory/Measure/Map.lean index 8d3c5f28640e33..42d539e02df6bf 100644 --- a/Mathlib/MeasureTheory/Measure/Map.lean +++ b/Mathlib/MeasureTheory/Measure/Map.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.MeasurableSpace.Embedding -import Mathlib.MeasureTheory.Measure.MeasureSpace +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Embedding +public import Mathlib.MeasureTheory.Measure.MeasureSpace /-! # Pushforward of a measure @@ -24,6 +26,8 @@ If `f` is not a.e. measurable, then we define `map f μ` to be zero. -/ +@[expose] public section + variable {α β γ : Type*} open Set Function ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean index 1e48593306ef69..7af021e2ff7921 100644 --- a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean +++ b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.MeasurableSpace.MeasurablyGenerated -import Mathlib.MeasureTheory.Measure.NullMeasurable -import Mathlib.Order.Interval.Set.Monotone +module + +public import Mathlib.MeasureTheory.MeasurableSpace.MeasurablyGenerated +public import Mathlib.MeasureTheory.Measure.NullMeasurable +public import Mathlib.Order.Interval.Set.Monotone /-! # Measure spaces @@ -77,6 +79,8 @@ The measure is denoted `volume`. measure, almost everywhere, measure space, completion, null set, null measurable set -/ +@[expose] public section + noncomputable section open Set diff --git a/Mathlib/MeasureTheory/Measure/MeasureSpaceDef.lean b/Mathlib/MeasureTheory/Measure/MeasureSpaceDef.lean index 63e4c6158e4263..3be3b3ac7d765f 100644 --- a/Mathlib/MeasureTheory/Measure/MeasureSpaceDef.lean +++ b/Mathlib/MeasureTheory/Measure/MeasureSpaceDef.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.OuterMeasure.Induced -import Mathlib.MeasureTheory.OuterMeasure.AE -import Mathlib.Order.Filter.CountableInter +module + +public import Mathlib.MeasureTheory.OuterMeasure.Induced +public import Mathlib.MeasureTheory.OuterMeasure.AE +public import Mathlib.Order.Filter.CountableInter /-! # Measure spaces @@ -52,6 +54,8 @@ This file does not import `MeasureTheory.MeasurableSpace.Basic`, but only `Measu measure, almost everywhere, measure space -/ +@[expose] public section + assert_not_exists Module.Basis noncomputable section @@ -386,7 +390,7 @@ section open MeasureTheory /-! -# Almost everywhere measurable functions +### Almost everywhere measurable functions A function is almost everywhere measurable if it coincides almost everywhere with a measurable function. We define this property, called `AEMeasurable f μ`. It's properties are discussed in diff --git a/Mathlib/MeasureTheory/Measure/MutuallySingular.lean b/Mathlib/MeasureTheory/Measure/MutuallySingular.lean index 50cab57e21f2d4..19299cf2cfd53d 100644 --- a/Mathlib/MeasureTheory/Measure/MutuallySingular.lean +++ b/Mathlib/MeasureTheory/Measure/MutuallySingular.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.Restrict +module + +public import Mathlib.MeasureTheory.Measure.Restrict /-! # Mutually singular measures @@ -21,6 +23,8 @@ facts about it. measure, mutually singular -/ +@[expose] public section + open Set diff --git a/Mathlib/MeasureTheory/Measure/NullMeasurable.lean b/Mathlib/MeasureTheory/Measure/NullMeasurable.lean index 2554afcb952351..a3c3c696c0f8ba 100644 --- a/Mathlib/MeasureTheory/Measure/NullMeasurable.lean +++ b/Mathlib/MeasureTheory/Measure/NullMeasurable.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Yury Kudryashov -/ -import Mathlib.MeasureTheory.MeasurableSpace.EventuallyMeasurable -import Mathlib.MeasureTheory.MeasurableSpace.Basic -import Mathlib.MeasureTheory.Measure.AEDisjoint +module + +public import Mathlib.MeasureTheory.MeasurableSpace.EventuallyMeasurable +public import Mathlib.MeasureTheory.MeasurableSpace.Basic +public import Mathlib.MeasureTheory.Measure.AEDisjoint /-! # Null measurable sets and complete measures @@ -55,6 +57,8 @@ the output type. measurable, measure, null measurable, completion -/ +@[expose] public section + open Filter Set Encodable open scoped ENNReal diff --git a/Mathlib/MeasureTheory/Measure/OpenPos.lean b/Mathlib/MeasureTheory/Measure/OpenPos.lean index b16380debea977..afc096e7aa43d3 100644 --- a/Mathlib/MeasureTheory/Measure/OpenPos.lean +++ b/Mathlib/MeasureTheory/Measure/OpenPos.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability /-! # Measures positive on nonempty opens @@ -17,6 +19,8 @@ about these measures. -/ +@[expose] public section + open Topology ENNReal MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Portmanteau.lean b/Mathlib/MeasureTheory/Measure/Portmanteau.lean index 464db74f1fa130..8577ff320c5ae7 100644 --- a/Mathlib/MeasureTheory/Measure/Portmanteau.lean +++ b/Mathlib/MeasureTheory/Measure/Portmanteau.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Measure.ProbabilityMeasure -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic -import Mathlib.MeasureTheory.Integral.Layercake -import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction +module + +public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +public import Mathlib.MeasureTheory.Integral.Layercake +public import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction /-! # Characterizations of weak convergence of finite measures and probability measures @@ -80,6 +82,8 @@ probability measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean b/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean index b4e8fda8570bbe..20e43f45568b65 100644 --- a/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.MeasureTheory.Measure.FiniteMeasure -import Mathlib.MeasureTheory.Integral.Average -import Mathlib.MeasureTheory.Measure.Prod +module + +public import Mathlib.MeasureTheory.Measure.FiniteMeasure +public import Mathlib.MeasureTheory.Integral.Average +public import Mathlib.MeasureTheory.Measure.Prod /-! # Probability measures @@ -72,6 +74,8 @@ convergence in distribution, convergence in law, weak convergence of measures, p -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/Prod.lean b/Mathlib/MeasureTheory/Measure/Prod.lean index 012efd623b41d5..2db2ee8619b125 100644 --- a/Mathlib/MeasureTheory/Measure/Prod.lean +++ b/Mathlib/MeasureTheory/Measure/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.MeasureTheory.Measure.GiryMonad -import Mathlib.MeasureTheory.Measure.OpenPos +module + +public import Mathlib.MeasureTheory.Measure.GiryMonad +public import Mathlib.MeasureTheory.Measure.OpenPos /-! # The product measure @@ -49,6 +51,8 @@ reversed. product measure, Tonelli's theorem, Fubini-Tonelli theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/Measure/QuasiMeasurePreserving.lean b/Mathlib/MeasureTheory/Measure/QuasiMeasurePreserving.lean index c6d97070fe6cdc..c1450f855785e3 100644 --- a/Mathlib/MeasureTheory/Measure/QuasiMeasurePreserving.lean +++ b/Mathlib/MeasureTheory/Measure/QuasiMeasurePreserving.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous -import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli +module + +public import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous +public import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli /-! # Quasi-Measure-Preserving Functions @@ -21,6 +23,8 @@ absolutely continuous with respect to `μb`). -/ +@[expose] public section + variable {α β γ δ : Type*} namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Real.lean b/Mathlib/MeasureTheory/Measure/Real.lean index 7082c3f7174ad5..e95a31451fe1eb 100644 --- a/Mathlib/MeasureTheory/Measure/Real.lean +++ b/Mathlib/MeasureTheory/Measure/Real.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability -import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +public import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite /-! # Measures as real-valued functions @@ -26,6 +28,8 @@ more painful with reals than nonnegative extended reals. They should probably be run. -/ +@[expose] public section + open MeasureTheory Measure Set open scoped ENNReal NNReal Function symmDiff @@ -440,7 +444,7 @@ open Lean Meta Qq Function /-- Extension for the `positivity` tactic: applications of `μ.real` are nonnegative. -/ @[positivity MeasureTheory.Measure.real _ _] -def evalMeasureReal : PositivityExt where eval {_ _} _zα _pα e := do +meta def evalMeasureReal : PositivityExt where eval {_ _} _zα _pα e := do let .app (.app _ a) b ← whnfR e | throwError "not measureReal" let p ← mkAppOptM ``MeasureTheory.measureReal_nonneg #[none, none, a, b] pure (.nonnegative p) diff --git a/Mathlib/MeasureTheory/Measure/Regular.lean b/Mathlib/MeasureTheory/Measure/Regular.lean index ab5d4372d7a656..b83ce5b4166aec 100644 --- a/Mathlib/MeasureTheory/Measure/Regular.lean +++ b/Mathlib/MeasureTheory/Measure/Regular.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn, Yury Kudryashov -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic -import Mathlib.MeasureTheory.Group.MeasurableEquiv +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +public import Mathlib.MeasureTheory.Group.MeasurableEquiv /-! # Regular measures @@ -189,6 +191,8 @@ proofs or statements do not apply directly. [Bogachev, Measure Theory, volume 2, Theorem 7.11.1][bogachev2007] -/ +@[expose] public section + open Set Filter ENNReal NNReal TopologicalSpace open scoped symmDiff Topology diff --git a/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean b/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean index ff666b21737cda..3fbcdc8010a456 100644 --- a/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean +++ b/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.MeasureTheory.Measure.Regular -import Mathlib.Topology.MetricSpace.Polish -import Mathlib.Topology.UniformSpace.Cauchy +module + +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.MeasureTheory.Measure.Regular +public import Mathlib.Topology.MetricSpace.Polish +public import Mathlib.Topology.UniformSpace.Cauchy /-! # Inner regularity of finite measures @@ -22,6 +24,8 @@ Finite measures on Polish spaces are an important special case, which makes the probability. -/ +@[expose] public section + open Set MeasureTheory open scoped ENNReal Uniformity diff --git a/Mathlib/MeasureTheory/Measure/Restrict.lean b/Mathlib/MeasureTheory/Measure/Restrict.lean index c8e9f9fb894b99..c9e41f40be0219 100644 --- a/Mathlib/MeasureTheory/Measure/Restrict.lean +++ b/Mathlib/MeasureTheory/Measure/Restrict.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Comap -import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving -import Mathlib.Data.Set.Card +module + +public import Mathlib.MeasureTheory.Measure.Comap +public import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving +public import Mathlib.Data.Set.Card /-! # Restricting a measure to a subset or a subtype @@ -20,6 +22,8 @@ We also study the relationship between the restriction of a measure to a subtype pullback under `Subtype.val`) and the restriction to a set as above. -/ +@[expose] public section + open scoped ENNReal NNReal Topology open Set MeasureTheory Measure Filter MeasurableSpace ENNReal Function @@ -891,8 +895,21 @@ theorem _root_.MeasurableEquiv.restrict_map (e : α ≃ᵐ β) (μ : Measure α) (μ.map e).restrict s = (μ.restrict <| e ⁻¹' s).map e := e.measurableEmbedding.restrict_map _ _ +lemma _root_.MeasurableEquiv.comap_apply (e : α ≃ᵐ β) (μ : Measure β) (s : Set α) : + comap e μ s = μ (e.symm ⁻¹' s) := by + rw [e.measurableEmbedding.comap_apply, e.image_eq_preimage_symm] + end MeasurableEmbedding +lemma MeasureTheory.Measure.map_eq_comap {_ : MeasurableSpace α} {_ : MeasurableSpace β} {f : α → β} + {g : β → α} {μ : Measure α} (hf : Measurable f) (hg : MeasurableEmbedding g) + (hμg : ∀ᵐ a ∂μ, a ∈ Set.range g) (hfg : ∀ a, f (g a) = a) : μ.map f = μ.comap g := by + ext s hs + rw [map_apply hf hs, hg.comap_apply, ← measure_diff_null hμg] + congr + simp + grind + section Subtype theorem comap_subtype_coe_apply {_m0 : MeasurableSpace α} {s : Set α} (hs : MeasurableSet s) diff --git a/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean b/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean index 798c816b34af71..c0ba7e7d01b131 100644 --- a/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp -import Mathlib.MeasureTheory.SetAlgebra +module + +public import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +public import Mathlib.MeasureTheory.SetAlgebra /-! # Separable measure @@ -63,6 +65,8 @@ written `≠ ∞` rather than `< ∞`. See `Ne.lt_top` and `ne_of_lt` to switch separable measure, measure-dense, Lp space, second-countable -/ +@[expose] public section + open MeasurableSpace Set ENNReal TopologicalSpace symmDiff Real namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Stieltjes.lean b/Mathlib/MeasureTheory/Measure/Stieltjes.lean index 72086add93e022..97dba912b17b98 100644 --- a/Mathlib/MeasureTheory/Measure/Stieltjes.lean +++ b/Mathlib/MeasureTheory/Measure/Stieltjes.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Constructions.BorelSpace.Order -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability -import Mathlib.Topology.Algebra.UniformMulAction -import Mathlib.Topology.Order.LeftRightLim +module + +public import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +public import Mathlib.Topology.Algebra.UniformMulAction +public import Mathlib.Topology.Order.LeftRightLim /-! # Stieltjes measures on the real line @@ -24,6 +26,8 @@ corresponding measure, giving mass `f b - f a` to the interval `(a, b]`. * `f.measure_Icc` and `f.measure_Ico` are analogous. -/ +@[expose] public section + noncomputable section open Set Filter Function ENNReal NNReal Topology MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Sub.lean b/Mathlib/MeasureTheory/Measure/Sub.lean index 5f6f8e3f599033..112a922c5a708a 100644 --- a/Mathlib/MeasureTheory/Measure/Sub.lean +++ b/Mathlib/MeasureTheory/Measure/Sub.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Martin Zinkevich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Zinkevich -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite /-! # Subtraction of measures @@ -16,6 +18,8 @@ Specifically, note that if you have `α = {1,2}`, and `μ {1} = 2`, `μ {2} = 0` `ν univ ≠ ∞`, then `(μ - ν) + ν = μ`. -/ +@[expose] public section + open Set namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Support.lean b/Mathlib/MeasureTheory/Measure/Support.lean index 9e65d8d48cbc95..0fa0ad3cfbb294 100644 --- a/Mathlib/MeasureTheory/Measure/Support.lean +++ b/Mathlib/MeasureTheory/Measure/Support.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Jon Bannon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jon Bannon, Jireh Loreaux -/ +module -import Mathlib.MeasureTheory.Measure.OpenPos +public import Mathlib.MeasureTheory.Measure.OpenPos /-! # Support of a Measure @@ -36,6 +37,8 @@ and various descriptions of the complement of the support are provided. measure, support, Lindelöf -/ +@[expose] public section + section Support namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Tight.lean b/Mathlib/MeasureTheory/Measure/Tight.lean index b2b982baa8a632..608ef54aea439a 100644 --- a/Mathlib/MeasureTheory/Measure/Tight.lean +++ b/Mathlib/MeasureTheory/Measure/Tight.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Josha Dekker -/ -import Mathlib.MeasureTheory.Measure.RegularityCompacts -import Mathlib.Topology.Order.Lattice +module + +public import Mathlib.MeasureTheory.Measure.RegularityCompacts +public import Mathlib.Topology.Order.Lattice /-! # Tight sets of measures @@ -27,6 +29,8 @@ measures in the set, the complement of `K` has measure at most `ε`. -/ +@[expose] public section + open Filter Set open scoped ENNReal NNReal Topology diff --git a/Mathlib/MeasureTheory/Measure/TightNormed.lean b/Mathlib/MeasureTheory/Measure/TightNormed.lean index 59f55113b341ab..9ef01893fa1973 100644 --- a/Mathlib/MeasureTheory/Measure/TightNormed.lean +++ b/Mathlib/MeasureTheory/Measure/TightNormed.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.MeasureTheory.Measure.Tight -import Mathlib.Order.CompletePartialOrder +module + +public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.MeasureTheory.Measure.Tight +public import Mathlib.Order.CompletePartialOrder /-! # Tight sets of measures in normed spaces @@ -22,6 +24,8 @@ Criteria for tightness of sets of measures in normed and inner product spaces. -/ +@[expose] public section + open Filter open scoped Topology ENNReal InnerProductSpace diff --git a/Mathlib/MeasureTheory/Measure/Tilted.lean b/Mathlib/MeasureTheory/Measure/Tilted.lean index 9273f171ac946d..1aefce4e8a3cd5 100644 --- a/Mathlib/MeasureTheory/Measure/Tilted.lean +++ b/Mathlib/MeasureTheory/Measure/Tilted.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym /-! # Exponentially tilted measures @@ -23,6 +25,8 @@ can be used for example to establish variational expressions for the Kullback-Le -/ +@[expose] public section + open Real open scoped ENNReal NNReal diff --git a/Mathlib/MeasureTheory/Measure/Trim.lean b/Mathlib/MeasureTheory/Measure/Trim.lean index 19aa7ad9e845b9..f7e6b71a6bcbfb 100644 --- a/Mathlib/MeasureTheory/Measure/Trim.lean +++ b/Mathlib/MeasureTheory/Measure/Trim.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite /-! # Restriction of a measure to a sub-σ-algebra @@ -15,6 +17,8 @@ import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite -/ +@[expose] public section + open scoped ENNReal namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses.lean b/Mathlib/MeasureTheory/Measure/Typeclasses.lean index 86f2aa863ed7fc..e75d95b793af53 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite -import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability -import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +public import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +public import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite deprecated_module (since := "2025-04-13") diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean index 55ff3668bb4b1e..84c43cc6b16f2f 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Restrict +module + +public import Mathlib.MeasureTheory.Measure.Restrict /-! # Classes for finite measures @@ -14,6 +16,8 @@ We introduce the following typeclasses for measures: * `IsLocallyFiniteMeasure μ` : `∀ x, ∃ s ∈ 𝓝 x, μ s < ∞`. -/ +@[expose] public section + open scoped NNReal Topology open Set MeasureTheory Measure Filter Function MeasurableSpace ENNReal diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/NoAtoms.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/NoAtoms.lean index d71bdc1a419ee4..4708665ed0f735 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/NoAtoms.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/NoAtoms.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Restrict +module + +public import Mathlib.MeasureTheory.Measure.Restrict /-! # Measures having no atoms @@ -15,6 +17,8 @@ A measure `μ` has no atoms if the measure of each singleton is zero. Should `NoAtoms` be redefined as `∀ s, 0 < μ s → ∃ t ⊆ s, 0 < μ t ∧ μ t < μ s`? -/ +@[expose] public section + namespace MeasureTheory open Set Measure diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean index d0c8afac0d2c00..86eb78619e6d57 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean @@ -3,7 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +public import Mathlib.Topology.UnitInterval /-! # Classes for probability measures @@ -14,6 +17,8 @@ We introduce the following typeclasses for measures: * `IsProbabilityMeasure μ`: `μ univ = 1`. -/ +@[expose] public section + namespace MeasureTheory open Set Measure Filter Function ENNReal @@ -92,6 +97,11 @@ instance isProbabilityMeasure_ite {p : Prop} [Decidable p] {μ ν : Measure α} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : IsProbabilityMeasure (ite p μ ν) := by split <;> infer_instance +open unitInterval in +instance {μ ν : Measure α} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {p : I} : + IsProbabilityMeasure (toNNReal p • μ + toNNReal (σ p) • ν) where + measure_univ := by simp [← add_smul] + variable [IsProbabilityMeasure μ] {p : α → Prop} {f : β → α} theorem Measure.isProbabilityMeasure_map {f : α → β} (hf : AEMeasurable f μ) : diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean index df851d1269db1c..f30fb388afa864 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite /-! # Classes for s-finite measures @@ -15,6 +17,8 @@ We introduce the following typeclasses for measures: where `μ` is finite. -/ +@[expose] public section + namespace MeasureTheory open Set Filter Function Measure MeasurableSpace NNReal ENNReal diff --git a/Mathlib/MeasureTheory/Measure/WithDensity.lean b/Mathlib/MeasureTheory/Measure/WithDensity.lean index 9149c8a346cda1..57896d155bbc96 100644 --- a/Mathlib/MeasureTheory/Measure/WithDensity.lean +++ b/Mathlib/MeasureTheory/Measure/WithDensity.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Johannes Hölzl -/ -import Mathlib.MeasureTheory.Integral.Lebesgue.Countable -import Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion -import Mathlib.MeasureTheory.Group.Convolution -import Mathlib.Analysis.LConvolution +module + +public import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +public import Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion +public import Mathlib.MeasureTheory.Group.Convolution +public import Mathlib.Analysis.LConvolution /-! # Measure with a given density with respect to another measure @@ -22,6 +24,8 @@ See `MeasureTheory.Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq`. -/ +@[expose] public section + open Set hiding restrict restrict_apply open Filter ENNReal NNReal MeasureTheory.Measure diff --git a/Mathlib/MeasureTheory/Measure/WithDensityFinite.lean b/Mathlib/MeasureTheory/Measure/WithDensityFinite.lean index 59f3e40a39a662..aba8b48290d0d0 100644 --- a/Mathlib/MeasureTheory/Measure/WithDensityFinite.lean +++ b/Mathlib/MeasureTheory/Measure/WithDensityFinite.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion -import Mathlib.Probability.ConditionalProbability +module + +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion +public import Mathlib.Probability.ConditionalProbability /-! # s-finite measures can be written as `withDensity` of a finite measure @@ -36,6 +38,8 @@ In this definition and the results below, `μ` is an s-finite measure (`SFinite -/ +@[expose] public section + open Set open scoped ENNReal ProbabilityTheory diff --git a/Mathlib/MeasureTheory/Order/Group/Lattice.lean b/Mathlib/MeasureTheory/Order/Group/Lattice.lean index 6b39cae592902c..4f68dff4806a17 100644 --- a/Mathlib/MeasureTheory/Order/Group/Lattice.lean +++ b/Mathlib/MeasureTheory/Order/Group/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.Order.Group.PosPart -import Mathlib.MeasureTheory.Group.Arithmetic -import Mathlib.MeasureTheory.Order.Lattice +module + +public import Mathlib.Algebra.Order.Group.PosPart +public import Mathlib.MeasureTheory.Group.Arithmetic +public import Mathlib.MeasureTheory.Order.Lattice /-! # Measurability results on groups with a lattice structure. @@ -15,6 +17,8 @@ import Mathlib.MeasureTheory.Order.Lattice measurable function, group, lattice operation -/ +@[expose] public section + variable {α β : Type*} [Lattice α] [Group α] [MeasurableSpace α] [MeasurableSpace β] {f : β → α} diff --git a/Mathlib/MeasureTheory/Order/Lattice.lean b/Mathlib/MeasureTheory/Order/Lattice.lean index ff20fcf618b730..29d4eb36f74d1d 100644 --- a/Mathlib/MeasureTheory/Order/Lattice.lean +++ b/Mathlib/MeasureTheory/Order/Lattice.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.AEMeasurable +module + +public import Mathlib.MeasureTheory.Measure.AEMeasurable /-! # Typeclasses for measurability of lattice operations @@ -27,6 +29,8 @@ measurable function, lattice operation -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/MeasureTheory/Order/UpperLower.lean b/Mathlib/MeasureTheory/Order/UpperLower.lean index b7f4da183cf528..efcb101a386c03 100644 --- a/Mathlib/MeasureTheory/Order/UpperLower.lean +++ b/Mathlib/MeasureTheory/Order/UpperLower.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies, Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Kexing Ying -/ -import Mathlib.Analysis.Normed.Order.UpperLower -import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace -import Mathlib.Topology.Order.DenselyOrdered +module + +public import Mathlib.Analysis.Normed.Order.UpperLower +public import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace +public import Mathlib.Topology.Order.DenselyOrdered /-! # Order-connected sets are null-measurable @@ -45,6 +47,8 @@ any subset of the antidiagonal `{(x, y) | x + y = 0}`) is order-connected. Generalize so that it also applies to `ℝ × ℝ`, for example. -/ +@[expose] public section + open Filter MeasureTheory Metric Set open scoped Topology diff --git a/Mathlib/MeasureTheory/OuterMeasure/AE.lean b/Mathlib/MeasureTheory/OuterMeasure/AE.lean index 1809d6b4ad4312..2692cafdb76c9d 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/AE.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/AE.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yury Kudryashov -/ -import Mathlib.MeasureTheory.OuterMeasure.Basic +module + +public import Mathlib.MeasureTheory.OuterMeasure.Basic /-! # The “almost everywhere” filter of co-null sets. @@ -32,6 +34,8 @@ However, we restate some lemmas specifically for `ae`. outer measure, measure, almost everywhere -/ +@[expose] public section + open Filter Set open scoped ENNReal diff --git a/Mathlib/MeasureTheory/OuterMeasure/Basic.lean b/Mathlib/MeasureTheory/OuterMeasure/Basic.lean index a2c4435a371ae7..5418ed8456eda8 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Countable.Basic -import Mathlib.Data.Fin.VecNotation -import Mathlib.Order.Disjointed -import Mathlib.MeasureTheory.OuterMeasure.Defs -import Mathlib.Topology.Instances.ENNReal.Lemmas +module + +public import Mathlib.Data.Countable.Basic +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Order.Disjointed +public import Mathlib.MeasureTheory.OuterMeasure.Defs +public import Mathlib.Topology.Instances.ENNReal.Lemmas /-! # Outer Measures @@ -30,6 +32,8 @@ Note that we do not need `α` to be measurable to define an outer measure. outer measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/OuterMeasure/BorelCantelli.lean b/Mathlib/MeasureTheory/OuterMeasure/BorelCantelli.lean index 929acc3d97a687..c286378265fb75 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/BorelCantelli.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/BorelCantelli.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel, Yury Kudryashov -/ -import Mathlib.MeasureTheory.OuterMeasure.AE +module + +public import Mathlib.MeasureTheory.OuterMeasure.AE /-! # Borel-Cantelli lemma, part 1 @@ -24,6 +26,8 @@ For the *second* Borel-Cantelli lemma (applying to independent sets in a probabi see `ProbabilityTheory.measure_limsup_eq_one`. -/ +@[expose] public section + open Filter Set open scoped ENNReal Topology diff --git a/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean b/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean index bdbfbeca169bd8..9db1edc62b81f3 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.OuterMeasure.OfFunction -import Mathlib.MeasureTheory.PiSystem +module + +public import Mathlib.MeasureTheory.OuterMeasure.OfFunction +public import Mathlib.MeasureTheory.PiSystem /-! # The Caratheodory σ-algebra of an outer measure @@ -28,6 +30,8 @@ Carathéodory-measurable, Carathéodory's criterion -/ +@[expose] public section + noncomputable section open Set Function Filter diff --git a/Mathlib/MeasureTheory/OuterMeasure/Defs.lean b/Mathlib/MeasureTheory/OuterMeasure/Defs.lean index 3cd54e651cfd55..d46ad9bb3d3e5d 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/Defs.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Yury Kudryashov -/ -import Mathlib.Topology.Algebra.InfiniteSum.Defs -import Mathlib.Topology.Order.Real +module + +public import Mathlib.Topology.Algebra.InfiniteSum.Defs +public import Mathlib.Topology.Order.Real /-! # Definitions of an outer measure and the corresponding `FunLike` class @@ -33,6 +35,8 @@ We also define a typeclass `MeasureTheory.OuterMeasureClass`. outer measure -/ +@[expose] public section + assert_not_exists Module.Basis IsTopologicalRing UniformSpace open scoped ENNReal diff --git a/Mathlib/MeasureTheory/OuterMeasure/Induced.lean b/Mathlib/MeasureTheory/OuterMeasure/Induced.lean index 96dbe3519046b2..6f283b25d0ee2a 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/Induced.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/Induced.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.ENNReal.Action -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.MeasureTheory.OuterMeasure.Caratheodory +module + +public import Mathlib.Data.ENNReal.Action +public import Mathlib.MeasureTheory.MeasurableSpace.Constructions +public import Mathlib.MeasureTheory.OuterMeasure.Caratheodory /-! # Induced Outer Measure @@ -25,6 +27,8 @@ outer measure -/ +@[expose] public section + noncomputable section open Set Function Filter diff --git a/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean b/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean index 986fd1ae06635c..4487308b3f3e34 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.MeasureTheory.SetSemiring -import Mathlib.MeasureTheory.Measure.AddContent -import Mathlib.MeasureTheory.Measure.Trim +module + +public import Mathlib.MeasureTheory.SetSemiring +public import Mathlib.MeasureTheory.Measure.AddContent +public import Mathlib.MeasureTheory.Measure.Trim /-! # Carathéodory's extension theorem @@ -38,6 +40,8 @@ the outer measure induced by `m`. The induced outer measure is equal to `m` on ` content on a semiring coincides with the content on the semiring. -/ +@[expose] public section + open Set open scoped ENNReal diff --git a/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean b/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean index 910309d818ea9e..e31a62dd4fcd5d 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.MeasureTheory.OuterMeasure.Operations -import Mathlib.Analysis.SpecificLimits.Basic +module + +public import Mathlib.MeasureTheory.OuterMeasure.Operations +public import Mathlib.Analysis.SpecificLimits.Basic /-! # Outer measures from functions @@ -34,6 +36,8 @@ outer measure, Carathéodory-measurable, Carathéodory's criterion -/ +@[expose] public section + assert_not_exists Module.Basis noncomputable section diff --git a/Mathlib/MeasureTheory/OuterMeasure/Operations.lean b/Mathlib/MeasureTheory/OuterMeasure/Operations.lean index b72fba32207b4b..bb5ba79def3f86 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/Operations.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/Operations.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Indicator -import Mathlib.MeasureTheory.OuterMeasure.Basic +module + +public import Mathlib.Algebra.Order.Group.Indicator +public import Mathlib.MeasureTheory.OuterMeasure.Basic /-! # Operations on outer measures @@ -23,6 +25,8 @@ outer measure -/ +@[expose] public section + noncomputable section open Set Function Filter diff --git a/Mathlib/MeasureTheory/PiSystem.lean b/Mathlib/MeasureTheory/PiSystem.lean index 515e002fed57b5..768a1832c37b38 100644 --- a/Mathlib/MeasureTheory/PiSystem.lean +++ b/Mathlib/MeasureTheory/PiSystem.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Martin Zinkevich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Martin Zinkevich, Rémy Degenne -/ -import Mathlib.Logic.Encodable.Lattice -import Mathlib.MeasureTheory.MeasurableSpace.Defs -import Mathlib.Order.Disjointed +module + +public import Mathlib.Logic.Encodable.Lattice +public import Mathlib.MeasureTheory.MeasurableSpace.Defs +public import Mathlib.Order.Disjointed /-! # Induction principles for measurable sets, related to π-systems and λ-systems. @@ -54,6 +56,8 @@ import Mathlib.Order.Disjointed lattice and Galois insertion on the subtype corresponding to `IsPiSystem`. -/ +@[expose] public section + open MeasurableSpace Set diff --git a/Mathlib/MeasureTheory/SetAlgebra.lean b/Mathlib/MeasureTheory/SetAlgebra.lean index 0ff0ada7f3f9e7..14f232231f0f93 100644 --- a/Mathlib/MeasureTheory/SetAlgebra.lean +++ b/Mathlib/MeasureTheory/SetAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Data.Finite.Prod -import Mathlib.MeasureTheory.SetSemiring +module + +public import Mathlib.Data.Finite.Prod +public import Mathlib.MeasureTheory.SetSemiring /-! # Algebra of sets @@ -41,6 +43,8 @@ of sets generated by `𝒜`. algebra of sets, generated algebra of sets -/ +@[expose] public section + open MeasurableSpace Set namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/SetSemiring.lean b/Mathlib/MeasureTheory/SetSemiring.lean index c734ea83ca0965..6f3f674080eff9 100644 --- a/Mathlib/MeasureTheory/SetSemiring.lean +++ b/Mathlib/MeasureTheory/SetSemiring.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ -import Mathlib.Data.Nat.Lattice -import Mathlib.Data.Set.Accumulate -import Mathlib.Data.Set.Pairwise.Lattice -import Mathlib.MeasureTheory.PiSystem +module + +public import Mathlib.Data.Nat.Lattice +public import Mathlib.Data.Set.Accumulate +public import Mathlib.Data.Set.Pairwise.Lattice +public import Mathlib.MeasureTheory.PiSystem /-! # Semirings and rings of sets @@ -48,6 +50,8 @@ A ring of sets is a set of sets containing `∅`, stable by union, set differenc -/ +@[expose] public section + open Finset Set namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMap.lean b/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMap.lean index fc47060d04a460..d179e9c3f839eb 100644 --- a/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMap.lean +++ b/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMap.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Topology.ContinuousMap.Compact -import Mathlib.Topology.ContinuousMap.Algebra -import Mathlib.MeasureTheory.Integral.IntegrableOn +module + +public import Mathlib.Topology.ContinuousMap.Compact +public import Mathlib.Topology.ContinuousMap.Algebra +public import Mathlib.MeasureTheory.Integral.IntegrableOn /-! # Specific results about `ContinuousMap`-valued integration @@ -48,6 +50,8 @@ to approach integration valued in a functional space `ℱ`. More precisely: -/ +@[expose] public section + open MeasureTheory namespace ContinuousMap diff --git a/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMapZero.lean b/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMapZero.lean index f1cf92e005db46..cbaf331b6f099f 100644 --- a/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMapZero.lean +++ b/Mathlib/MeasureTheory/SpecificCodomains/ContinuousMapZero.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker -/ -import Mathlib.Topology.ContinuousMap.ContinuousMapZero -import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMap +module + +public import Mathlib.Topology.ContinuousMap.ContinuousMapZero +public import Mathlib.MeasureTheory.SpecificCodomains.ContinuousMap /-! # Specific results about `ContinuousMapZero`-valued integration @@ -19,6 +21,8 @@ module docstring. -/ +@[expose] public section + open MeasureTheory namespace ContinuousMapZero diff --git a/Mathlib/MeasureTheory/SpecificCodomains/Pi.lean b/Mathlib/MeasureTheory/SpecificCodomains/Pi.lean index deee4d2165ee9b..cf845b3d0aa5ee 100644 --- a/Mathlib/MeasureTheory/SpecificCodomains/Pi.lean +++ b/Mathlib/MeasureTheory/SpecificCodomains/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +module + +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap /-! # Integrability in a product space @@ -12,6 +14,8 @@ We prove that `f : X → Π i, E i` is in `Lᵖ` if and only if for all `i`, `f We do the same for `f : X → (E × F)`. -/ +@[expose] public section + namespace MeasureTheory open scoped ENNReal diff --git a/Mathlib/MeasureTheory/SpecificCodomains/WithLp.lean b/Mathlib/MeasureTheory/SpecificCodomains/WithLp.lean index 46d6343f3abbb6..dfdeac45b106d9 100644 --- a/Mathlib/MeasureTheory/SpecificCodomains/WithLp.lean +++ b/Mathlib/MeasureTheory/SpecificCodomains/WithLp.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Analysis.Normed.Lp.PiLp -import Mathlib.MeasureTheory.SpecificCodomains.Pi +module + +public import Mathlib.Analysis.Normed.Lp.PiLp +public import Mathlib.MeasureTheory.SpecificCodomains.Pi /-! # Integrability in `WithLp` @@ -13,6 +15,8 @@ We prove that `f : X → PiLp q E` is in `Lᵖ` if and only if for all `i`, `f We do the same for `f : X → WithLp q (E × F)`. -/ +@[expose] public section + open scoped ENNReal namespace MeasureTheory diff --git a/Mathlib/MeasureTheory/Topology.lean b/Mathlib/MeasureTheory/Topology.lean index 009b7183f69e45..dd00c290a8670e 100644 --- a/Mathlib/MeasureTheory/Topology.lean +++ b/Mathlib/MeasureTheory/Topology.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Stefan Kebekus. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Stefan Kebekus -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms -import Mathlib.Topology.DiscreteSubset +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.NoAtoms +public import Mathlib.Topology.DiscreteSubset /-! # Theorems combining measure theory and topology @@ -12,6 +14,8 @@ import Mathlib.Topology.DiscreteSubset This file gathers theorems that combine measure theory and topology, and cannot easily be added to the existing files without introducing massive dependencies between the subjects. -/ + +@[expose] public section open Filter MeasureTheory /-- Under reasonable assumptions, sets that are codiscrete within `U` are contained in the “almost diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index acd54f20ad35a7..72a962bd4cd449 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Measure.Real -import Mathlib.MeasureTheory.Measure.Typeclasses.Finite -import Mathlib.Topology.Algebra.InfiniteSum.Module +module + +public import Mathlib.MeasureTheory.Measure.Real +public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +public import Mathlib.Topology.Algebra.InfiniteSum.Module /-! @@ -42,6 +44,8 @@ since this provides summability. vector measure, signed measure, complex measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Hahn.lean b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Hahn.lean index 3968bb82e0f239..2a60410761d646 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Hahn.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Hahn.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.VectorMeasure.Basic -import Mathlib.Order.SymmDiff +module + +public import Mathlib.MeasureTheory.VectorMeasure.Basic +public import Mathlib.Order.SymmDiff /-! # Hahn decomposition @@ -34,6 +36,8 @@ being positive/negative with respect to the signed measure `s`. Hahn decomposition theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Jordan.lean b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Jordan.lean index 8d4db6426328be..27c06572462f9a 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Jordan.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Jordan.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Hahn -import Mathlib.MeasureTheory.Measure.MutuallySingular -import Mathlib.Topology.Algebra.UniformMulAction +module + +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Hahn +public import Mathlib.MeasureTheory.Measure.MutuallySingular +public import Mathlib.Topology.Algebra.UniformMulAction /-! # Jordan decomposition @@ -40,6 +42,8 @@ is useful for the Lebesgue decomposition theorem. Jordan decomposition theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/JordanSub.lean b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/JordanSub.lean index 7c22dd2967793f..1ab015aac88725 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/JordanSub.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/JordanSub.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Loic Simon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Loic Simon -/ -import Mathlib.MeasureTheory.Measure.Decomposition.Hahn -import Mathlib.MeasureTheory.Measure.Sub -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.Hahn +public import Mathlib.MeasureTheory.Measure.Sub +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan /-! # Jordan decomposition from signed measure subtraction @@ -28,6 +30,8 @@ where `μ ≤ ν` and `ν ≤ μ`, and the measure difference behaves like a sig `(μ - ν).toSignedMeasure - (ν - μ).toSignedMeasure`. -/ +@[expose] public section + open scoped ENNReal NNReal namespace MeasureTheory.Measure diff --git a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean index 1b7cdc7e6da460..c9a7600e33b7f4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue -import Mathlib.MeasureTheory.Measure.Complex -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan -import Mathlib.MeasureTheory.VectorMeasure.WithDensity +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue +public import Mathlib.MeasureTheory.Measure.Complex +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan +public import Mathlib.MeasureTheory.VectorMeasure.WithDensity /-! # Lebesgue decomposition @@ -39,6 +41,8 @@ to `ν`. Lebesgue decomposition theorem -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/RadonNikodym.lean b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/RadonNikodym.lean index 84449d4b65fe6a..44e8cbe6ef6c85 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/RadonNikodym.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/RadonNikodym.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Thomas Zhu -/ -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Lebesgue +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Lebesgue /-! # Radon-Nikodym derivatives of vector measures @@ -14,6 +16,8 @@ that depend both on the Lebesgue decomposition of signed measures and the theory of Radon-Nikodym derivatives of usual measures. -/ +@[expose] public section + namespace MeasureTheory variable {α : Type*} {m : MeasurableSpace α} diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean index 9d65e62a3388b5..b4da5059cb90fc 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.VectorMeasure.Basic -import Mathlib.MeasureTheory.Function.AEEqOfIntegral +module + +public import Mathlib.MeasureTheory.VectorMeasure.Basic +public import Mathlib.MeasureTheory.Function.AEEqOfIntegral /-! @@ -21,6 +23,8 @@ the Radon-Nikodym theorem for signed measures. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/ModelTheory/Algebra/Field/Basic.lean b/Mathlib/ModelTheory/Algebra/Field/Basic.lean index 0dce878e6c8b4c..328f6c840fac7f 100644 --- a/Mathlib/ModelTheory/Algebra/Field/Basic.lean +++ b/Mathlib/ModelTheory/Algebra/Field/Basic.lean @@ -3,12 +3,13 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.ModelTheory.Syntax -import Mathlib.ModelTheory.Semantics -import Mathlib.ModelTheory.Algebra.Ring.Basic -import Mathlib.Algebra.Field.MinimalAxioms -import Mathlib.Data.Nat.Cast.Order.Ring +public import Mathlib.ModelTheory.Syntax +public import Mathlib.ModelTheory.Semantics +public import Mathlib.ModelTheory.Algebra.Ring.Basic +public import Mathlib.Algebra.Field.MinimalAxioms +public import Mathlib.Data.Nat.Cast.Order.Ring /-! # The First-Order Theory of Fields @@ -25,6 +26,8 @@ This file defines the first-order theory of fields as a theory over the language `Language.ring.Structure` instance. -/ +@[expose] public section + variable {K : Type*} namespace FirstOrder diff --git a/Mathlib/ModelTheory/Algebra/Field/CharP.lean b/Mathlib/ModelTheory/Algebra/Field/CharP.lean index f1d893de9c74d1..69d6040d887561 100644 --- a/Mathlib/ModelTheory/Algebra/Field/CharP.lean +++ b/Mathlib/ModelTheory/Algebra/Field/CharP.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.Algebra.CharP.Basic -import Mathlib.ModelTheory.Algebra.Ring.FreeCommRing -import Mathlib.ModelTheory.Algebra.Field.Basic +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.ModelTheory.Algebra.Ring.FreeCommRing +public import Mathlib.ModelTheory.Algebra.Field.Basic /-! # First-order theory of fields @@ -20,6 +21,8 @@ language of rings as a theory over the language of rings -/ +@[expose] public section + variable {p : ℕ} {K : Type*} namespace FirstOrder diff --git a/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean b/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean index 2e4def18cfa60e..be0c15ecf29b5c 100644 --- a/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean +++ b/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean @@ -3,12 +3,13 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.Data.Nat.PrimeFin -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.FieldTheory.IsAlgClosed.Classification -import Mathlib.ModelTheory.Algebra.Field.CharP -import Mathlib.ModelTheory.Satisfiability +public import Mathlib.Data.Nat.PrimeFin +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.FieldTheory.IsAlgClosed.Classification +public import Mathlib.ModelTheory.Algebra.Field.CharP +public import Mathlib.ModelTheory.Satisfiability /-! @@ -43,6 +44,8 @@ the Ax-Grothendieck Theorem were first formalized in Lean 3 by Joseph Hua -/ +@[expose] public section + variable {K : Type*} namespace FirstOrder diff --git a/Mathlib/ModelTheory/Algebra/Ring/Basic.lean b/Mathlib/ModelTheory/Algebra/Ring/Basic.lean index 7917e6a9810bf1..236a5be8c4bfd7 100644 --- a/Mathlib/ModelTheory/Algebra/Ring/Basic.lean +++ b/Mathlib/ModelTheory/Algebra/Ring/Basic.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.ModelTheory.Syntax -import Mathlib.ModelTheory.Semantics -import Mathlib.Algebra.Ring.Equiv +public import Mathlib.ModelTheory.Syntax +public import Mathlib.ModelTheory.Semantics +public import Mathlib.Algebra.Ring.Equiv /-! # First-Order Language of Rings @@ -39,6 +40,8 @@ you must add local instances with definitions like `ModelTheory.Field.fieldOfMod (in `Mathlib/ModelTheory/Algebra/Field/Basic.lean`), depending on the Theory. -/ +@[expose] public section + variable {α : Type*} namespace FirstOrder diff --git a/Mathlib/ModelTheory/Algebra/Ring/Definability.lean b/Mathlib/ModelTheory/Algebra/Ring/Definability.lean index 4c306a264d0530..a616d3ccdb3094 100644 --- a/Mathlib/ModelTheory/Algebra/Ring/Definability.lean +++ b/Mathlib/ModelTheory/Algebra/Ring/Definability.lean @@ -3,11 +3,12 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.ModelTheory.Definability -import Mathlib.RingTheory.MvPolynomial.FreeCommRing -import Mathlib.RingTheory.Nullstellensatz -import Mathlib.ModelTheory.Algebra.Ring.FreeCommRing +public import Mathlib.ModelTheory.Definability +public import Mathlib.RingTheory.MvPolynomial.FreeCommRing +public import Mathlib.RingTheory.Nullstellensatz +public import Mathlib.ModelTheory.Algebra.Ring.FreeCommRing /-! @@ -17,6 +18,8 @@ This file proves that the set of zeros of a multivariable polynomial is a defina -/ +@[expose] public section + namespace FirstOrder namespace Ring diff --git a/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean b/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean index affebfdda5f3fd..fe45b81dcff5e7 100644 --- a/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean +++ b/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.ModelTheory.Algebra.Ring.Basic -import Mathlib.RingTheory.FreeCommRing +public import Mathlib.ModelTheory.Algebra.Ring.Basic +public import Mathlib.RingTheory.FreeCommRing /-! # Making a term in the language of rings from an element of the FreeCommRing @@ -17,6 +18,8 @@ The theorem `FirstOrder.Ring.realize_termOfFreeCommRing` shows that the term con realized in a ring `R` is equal to the lift of the element of `FreeCommRing α` to `R`. -/ +@[expose] public section + namespace FirstOrder namespace Ring diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Basic.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Basic.lean index 4160101d40cbf7..48f74cc03face0 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Basic.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Dexin Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dexin Zhang -/ -import Mathlib.Algebra.Group.Basic -import Mathlib.ModelTheory.Semantics +module + +public import Mathlib.Algebra.Group.Basic +public import Mathlib.ModelTheory.Semantics /-! # Presburger arithmetic @@ -23,6 +25,8 @@ This file defines the first-order language of Presburger arithmetic as (0,1,+). completeness, etc). -/ +@[expose] public section + variable {α : Type*} namespace FirstOrder diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean index 4801a73d5ac6bb..8e05c0a6915492 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Dexin Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dexin Zhang -/ -import Mathlib.GroupTheory.Finiteness -import Mathlib.LinearAlgebra.LinearIndependent.Defs +module + +public import Mathlib.GroupTheory.Finiteness +public import Mathlib.LinearAlgebra.LinearIndependent.Defs /-! # Linear and semilinear sets @@ -42,6 +44,8 @@ of sets in form `{ x | ∃ y, p x y }`. * [Samuel Eilenberg and M. P. Schützenberger, *Rational Sets in Commutative Monoids*][eilenberg1969] -/ +@[expose] public section + variable {M N ι κ F : Type*} [AddCommMonoid M] [AddCommMonoid N] [FunLike F M N] [AddMonoidHomClass F M N] {a : M} {s s₁ s₂ : Set M} diff --git a/Mathlib/ModelTheory/Basic.lean b/Mathlib/ModelTheory/Basic.lean index e252b35e212dae..357a1f6181d46f 100644 --- a/Mathlib/ModelTheory/Basic.lean +++ b/Mathlib/ModelTheory/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Aaron Anderson, Jesse Michael Han, Floris van Doorn. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jesse Michael Han, Floris van Doorn -/ -import Mathlib.SetTheory.Cardinal.Basic +module + +public import Mathlib.SetTheory.Cardinal.Basic /-! # Basics on First-Order Structures @@ -38,6 +40,8 @@ For the Flypitch project: the continuum hypothesis*][flypitch_itp] -/ +@[expose] public section + universe u v u' v' w w' open Cardinal diff --git a/Mathlib/ModelTheory/Bundled.lean b/Mathlib/ModelTheory/Bundled.lean index 5fc873f49158a2..cb1d26a19bba85 100644 --- a/Mathlib/ModelTheory/Bundled.lean +++ b/Mathlib/ModelTheory/Bundled.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.ElementarySubstructures -import Mathlib.CategoryTheory.ConcreteCategory.Bundled +module + +public import Mathlib.ModelTheory.ElementarySubstructures +public import Mathlib.CategoryTheory.ConcreteCategory.Bundled /-! # Bundled First-Order Structures @@ -21,6 +23,8 @@ This file bundles types together with their first-order structure. - Define category structures on bundled structures and models. -/ +@[expose] public section + universe u v w w' x diff --git a/Mathlib/ModelTheory/Complexity.lean b/Mathlib/ModelTheory/Complexity.lean index 13c939b13a8ec9..a214a45df75c11 100644 --- a/Mathlib/ModelTheory/Complexity.lean +++ b/Mathlib/ModelTheory/Complexity.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.Equivalence +module + +public import Mathlib.ModelTheory.Equivalence /-! # Quantifier Complexity @@ -28,6 +30,8 @@ This file defines quantifier complexity of first-order formulas, and constructs -/ +@[expose] public section + universe u v w u' v' namespace FirstOrder diff --git a/Mathlib/ModelTheory/Definability.lean b/Mathlib/ModelTheory/Definability.lean index 7dd62906b90ed8..57cd2db8a461d2 100644 --- a/Mathlib/ModelTheory/Definability.lean +++ b/Mathlib/ModelTheory/Definability.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.SetLike.Basic -import Mathlib.ModelTheory.Semantics +module + +public import Mathlib.Data.SetLike.Basic +public import Mathlib.ModelTheory.Semantics /-! # Definable Sets @@ -30,6 +32,8 @@ This file defines what it means for a set over a first-order structure to be def -/ +@[expose] public section + universe u v w u₁ diff --git a/Mathlib/ModelTheory/DirectLimit.lean b/Mathlib/ModelTheory/DirectLimit.lean index ed244f4eb795a1..47fc428a88da95 100644 --- a/Mathlib/ModelTheory/DirectLimit.lean +++ b/Mathlib/ModelTheory/DirectLimit.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Gabin Kolly -/ -import Mathlib.Data.Finite.Sum -import Mathlib.Data.Fintype.Order -import Mathlib.ModelTheory.FinitelyGenerated -import Mathlib.ModelTheory.Quotients -import Mathlib.Order.DirectedInverseSystem +module + +public import Mathlib.Data.Finite.Sum +public import Mathlib.Data.Fintype.Order +public import Mathlib.ModelTheory.FinitelyGenerated +public import Mathlib.ModelTheory.Quotients +public import Mathlib.Order.DirectedInverseSystem /-! # Direct Limits of First-Order Structures @@ -25,6 +27,8 @@ This file constructs the direct limit of a directed system of first-order embedd isomorphic direct systems. -/ +@[expose] public section + universe v w w' u₁ u₂ @@ -58,9 +62,7 @@ theorem coe_natLERec (m n : ℕ) (h : m ≤ n) : obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le h ext x induction k with - | zero => - -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 - erw [natLERec, Nat.leRecOn_self, Embedding.refl_apply, Nat.leRecOn_self] + | zero => simp [natLERec, Nat.leRecOn_self] | succ k ih => -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 erw [Nat.leRecOn_succ le_self_add, natLERec, Nat.leRecOn_succ le_self_add, ← natLERec, diff --git a/Mathlib/ModelTheory/ElementaryMaps.lean b/Mathlib/ModelTheory/ElementaryMaps.lean index dc6db23bfcf65b..29681772d8de6e 100644 --- a/Mathlib/ModelTheory/ElementaryMaps.lean +++ b/Mathlib/ModelTheory/ElementaryMaps.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Fintype.Basic -import Mathlib.ModelTheory.Substructures +module + +public import Mathlib.Data.Fintype.Basic +public import Mathlib.ModelTheory.Substructures /-! # Elementary Maps Between First-Order Structures @@ -24,6 +26,8 @@ import Mathlib.ModelTheory.Substructures gives a simple criterion for an embedding to be elementary. -/ +@[expose] public section + open FirstOrder diff --git a/Mathlib/ModelTheory/ElementarySubstructures.lean b/Mathlib/ModelTheory/ElementarySubstructures.lean index 08afc61f6f74a6..541bd3cc9e97e4 100644 --- a/Mathlib/ModelTheory/ElementarySubstructures.lean +++ b/Mathlib/ModelTheory/ElementarySubstructures.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.ElementaryMaps +module + +public import Mathlib.ModelTheory.ElementaryMaps /-! # Elementary Substructures @@ -20,6 +22,8 @@ import Mathlib.ModelTheory.ElementaryMaps substructure to be elementary. -/ +@[expose] public section + open FirstOrder diff --git a/Mathlib/ModelTheory/Encoding.lean b/Mathlib/ModelTheory/Encoding.lean index 40f20e80294466..09ce41b51e413d 100644 --- a/Mathlib/ModelTheory/Encoding.lean +++ b/Mathlib/ModelTheory/Encoding.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Computability.Encoding -import Mathlib.Logic.Small.List -import Mathlib.ModelTheory.Syntax -import Mathlib.SetTheory.Cardinal.Arithmetic +module + +public import Mathlib.Computability.Encoding +public import Mathlib.Logic.Small.List +public import Mathlib.ModelTheory.Syntax +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! # Encodings and Cardinality of First-Order Syntax @@ -32,6 +34,8 @@ import Mathlib.SetTheory.Cardinal.Arithmetic -/ +@[expose] public section + universe u v w u' diff --git a/Mathlib/ModelTheory/Equivalence.lean b/Mathlib/ModelTheory/Equivalence.lean index 98530447d86593..a25737a2126ae1 100644 --- a/Mathlib/ModelTheory/Equivalence.lean +++ b/Mathlib/ModelTheory/Equivalence.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.Satisfiability +module + +public import Mathlib.ModelTheory.Satisfiability /-! # Equivalence of Formulas @@ -18,6 +20,8 @@ import Mathlib.ModelTheory.Satisfiability -/ +@[expose] public section + universe u v w w' open Cardinal CategoryTheory diff --git a/Mathlib/ModelTheory/FinitelyGenerated.lean b/Mathlib/ModelTheory/FinitelyGenerated.lean index 28aa7eaf522621..d5341b1c86ea86 100644 --- a/Mathlib/ModelTheory/FinitelyGenerated.lean +++ b/Mathlib/ModelTheory/FinitelyGenerated.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.ModelTheory.Substructures +module + +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.ModelTheory.Substructures /-! # Finitely Generated First-Order Structures @@ -27,6 +29,8 @@ this definition of finite generation to define the others. -/ +@[expose] public section + open FirstOrder Set namespace FirstOrder diff --git a/Mathlib/ModelTheory/Fraisse.lean b/Mathlib/ModelTheory/Fraisse.lean index 839779d0dd7411..3f5a74c41e7486 100644 --- a/Mathlib/ModelTheory/Fraisse.lean +++ b/Mathlib/ModelTheory/Fraisse.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Gabin Kolly -/ -import Mathlib.ModelTheory.FinitelyGenerated -import Mathlib.ModelTheory.PartialEquiv -import Mathlib.ModelTheory.Bundled -import Mathlib.Algebra.Order.Archimedean.Basic +module + +public import Mathlib.ModelTheory.FinitelyGenerated +public import Mathlib.ModelTheory.PartialEquiv +public import Mathlib.ModelTheory.Bundled +public import Mathlib.Algebra.Order.Archimedean.Basic /-! # Fraïssé Classes and Fraïssé Limits @@ -66,6 +68,8 @@ Fraïssé limit - the countable ultrahomogeneous structure with that age. -/ +@[expose] public section + universe u v w w' diff --git a/Mathlib/ModelTheory/Graph.lean b/Mathlib/ModelTheory/Graph.lean index d5dc2cd134c9e6..82f91f11922578 100644 --- a/Mathlib/ModelTheory/Graph.lean +++ b/Mathlib/ModelTheory/Graph.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.Satisfiability -import Mathlib.Combinatorics.SimpleGraph.Basic +module + +public import Mathlib.ModelTheory.Satisfiability +public import Mathlib.Combinatorics.SimpleGraph.Basic /-! # First-Order Structures in Graph Theory @@ -21,6 +23,8 @@ This file defines first-order languages, structures, and theories in graph theor of the theory of simple graphs. -/ +@[expose] public section + universe u namespace FirstOrder diff --git a/Mathlib/ModelTheory/LanguageMap.lean b/Mathlib/ModelTheory/LanguageMap.lean index 5540f6d47335a9..f6eb2e8b133a9b 100644 --- a/Mathlib/ModelTheory/LanguageMap.lean +++ b/Mathlib/ModelTheory/LanguageMap.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Aaron Anderson, Jesse Michael Han, Floris van Doorn. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jesse Michael Han, Floris van Doorn -/ -import Mathlib.ModelTheory.Basic +module + +public import Mathlib.ModelTheory.Basic /-! # Language Maps @@ -31,6 +33,8 @@ For the Flypitch project: -/ +@[expose] public section + universe u v u' v' w w' namespace FirstOrder diff --git a/Mathlib/ModelTheory/Order.lean b/Mathlib/ModelTheory/Order.lean index d00b87d61e80e5..068f6e205e9aab 100644 --- a/Mathlib/ModelTheory/Order.lean +++ b/Mathlib/ModelTheory/Order.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.CharZero.Infinite -import Mathlib.Data.Rat.Encodable -import Mathlib.Data.Finset.Sort -import Mathlib.ModelTheory.Complexity -import Mathlib.ModelTheory.Fraisse -import Mathlib.Order.CountableDenseLinearOrder +module + +public import Mathlib.Algebra.CharZero.Infinite +public import Mathlib.Data.Rat.Encodable +public import Mathlib.Data.Finset.Sort +public import Mathlib.ModelTheory.Complexity +public import Mathlib.ModelTheory.Fraisse +public import Mathlib.Order.CountableDenseLinearOrder /-! # Ordered First-Ordered Structures @@ -50,6 +52,8 @@ This file defines ordered first-order languages and structures, as well as their -/ +@[expose] public section + universe u v w w' diff --git a/Mathlib/ModelTheory/PartialEquiv.lean b/Mathlib/ModelTheory/PartialEquiv.lean index e9515b933a0fc4..670589e1c17da9 100644 --- a/Mathlib/ModelTheory/PartialEquiv.lean +++ b/Mathlib/ModelTheory/PartialEquiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Gabin Kolly. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Gabin Kolly, David Wärn -/ -import Mathlib.ModelTheory.DirectLimit -import Mathlib.Order.Ideal +module + +public import Mathlib.ModelTheory.DirectLimit +public import Mathlib.Order.Ideal /-! # Partial Isomorphisms @@ -34,6 +36,8 @@ This file defines partial isomorphisms between first-order structures. -/ +@[expose] public section + universe u v w w' namespace FirstOrder diff --git a/Mathlib/ModelTheory/Quotients.lean b/Mathlib/ModelTheory/Quotients.lean index bcc18ff887f893..f687ae86c6f5c8 100644 --- a/Mathlib/ModelTheory/Quotients.lean +++ b/Mathlib/ModelTheory/Quotients.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Fintype.Quotient -import Mathlib.ModelTheory.Semantics +module + +public import Mathlib.Data.Fintype.Quotient +public import Mathlib.ModelTheory.Semantics /-! # Quotients of First-Order Structures @@ -19,6 +21,8 @@ This file defines prestructures and quotients of first-order structures. `Quotient s`. -/ +@[expose] public section + namespace FirstOrder diff --git a/Mathlib/ModelTheory/Satisfiability.lean b/Mathlib/ModelTheory/Satisfiability.lean index 55b8e908383027..372333cb2fb94c 100644 --- a/Mathlib/ModelTheory/Satisfiability.lean +++ b/Mathlib/ModelTheory/Satisfiability.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.Ultraproducts -import Mathlib.ModelTheory.Bundled -import Mathlib.ModelTheory.Skolem -import Mathlib.Order.Filter.AtTopBot.Basic +module + +public import Mathlib.ModelTheory.Ultraproducts +public import Mathlib.ModelTheory.Bundled +public import Mathlib.ModelTheory.Skolem +public import Mathlib.Order.Filter.AtTopBot.Basic /-! # First-Order Satisfiability @@ -41,6 +43,8 @@ This file deals with the satisfiability of first-order theories, as well as equi of `L`. By Löwenheim-Skolem, this is equivalent to satisfiability in any universe. -/ +@[expose] public section + universe u v w w' diff --git a/Mathlib/ModelTheory/Semantics.lean b/Mathlib/ModelTheory/Semantics.lean index 6689dc1070bef2..117b89cc12f7c9 100644 --- a/Mathlib/ModelTheory/Semantics.lean +++ b/Mathlib/ModelTheory/Semantics.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Aaron Anderson, Jesse Michael Han, Floris van Doorn. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jesse Michael Han, Floris van Doorn -/ -import Mathlib.Data.Finset.Basic -import Mathlib.ModelTheory.Syntax -import Mathlib.Data.List.ProdSigma +module + +public import Mathlib.Data.Finset.Basic +public import Mathlib.ModelTheory.Syntax +public import Mathlib.Data.List.ProdSigma /-! # Basics on First-Order Semantics @@ -46,6 +48,8 @@ For the Flypitch project: the continuum hypothesis*][flypitch_itp] -/ +@[expose] public section + universe u v w u' v' diff --git a/Mathlib/ModelTheory/Skolem.lean b/Mathlib/ModelTheory/Skolem.lean index 551920790ad180..277922a16a1ffb 100644 --- a/Mathlib/ModelTheory/Skolem.lean +++ b/Mathlib/ModelTheory/Skolem.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.ElementarySubstructures +module + +public import Mathlib.ModelTheory.ElementarySubstructures /-! # Skolem Functions and Downward Löwenheim–Skolem @@ -24,6 +26,8 @@ import Mathlib.ModelTheory.ElementarySubstructures - Use `skolem₁` recursively to construct an actual Skolemization of a language. -/ +@[expose] public section + universe u v w w' diff --git a/Mathlib/ModelTheory/Substructures.lean b/Mathlib/ModelTheory/Substructures.lean index 261a13bdf4bdd6..94368ea49276ca 100644 --- a/Mathlib/ModelTheory/Substructures.lean +++ b/Mathlib/ModelTheory/Substructures.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Gabin Kolly -/ -import Mathlib.Data.Fintype.Order -import Mathlib.Order.Closure -import Mathlib.ModelTheory.Semantics -import Mathlib.ModelTheory.Encoding +module + +public import Mathlib.Data.Fintype.Order +public import Mathlib.Order.Closure +public import Mathlib.ModelTheory.Semantics +public import Mathlib.ModelTheory.Encoding /-! # First-Order Substructures @@ -39,6 +41,8 @@ substructures appearing in the algebra library. - `L.Substructure M` forms a `CompleteLattice`. -/ +@[expose] public section + universe u v w namespace FirstOrder diff --git a/Mathlib/ModelTheory/Syntax.lean b/Mathlib/ModelTheory/Syntax.lean index 57365274fd6da9..d35639ddf380b5 100644 --- a/Mathlib/ModelTheory/Syntax.lean +++ b/Mathlib/ModelTheory/Syntax.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Aaron Anderson, Jesse Michael Han, Floris van Doorn. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Jesse Michael Han, Floris van Doorn -/ -import Mathlib.Data.Set.Prod -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.ModelTheory.LanguageMap -import Mathlib.Algebra.Order.Group.Nat +module + +public import Mathlib.Data.Set.Prod +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.ModelTheory.LanguageMap +public import Mathlib.Algebra.Order.Group.Nat /-! # Basics on First-Order Syntax @@ -56,6 +58,8 @@ For the Flypitch project: the continuum hypothesis*][flypitch_itp] -/ +@[expose] public section + universe u v w u' v' diff --git a/Mathlib/ModelTheory/Types.lean b/Mathlib/ModelTheory/Types.lean index ce8c2432ced62f..186688c0590426 100644 --- a/Mathlib/ModelTheory/Types.lean +++ b/Mathlib/ModelTheory/Types.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.Satisfiability +module + +public import Mathlib.ModelTheory.Satisfiability /-! # Type Spaces @@ -36,6 +38,8 @@ This file defines the space of complete types over a first-order theory. - Connect `T.CompleteType α` to sets of formulas `L.Formula α`. -/ +@[expose] public section + universe u v w w' diff --git a/Mathlib/ModelTheory/Ultraproducts.lean b/Mathlib/ModelTheory/Ultraproducts.lean index 460da0205d09a3..8c436697c7c071 100644 --- a/Mathlib/ModelTheory/Ultraproducts.lean +++ b/Mathlib/ModelTheory/Ultraproducts.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.ModelTheory.Quotients -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Filter.Germ.Basic -import Mathlib.Order.Filter.Ultrafilter.Defs +module + +public import Mathlib.ModelTheory.Quotients +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Filter.Germ.Basic +public import Mathlib.Order.Filter.Ultrafilter.Defs /-! # Ultraproducts and Łoś's Theorem @@ -26,6 +28,8 @@ import Mathlib.Order.Filter.Ultrafilter.Defs ultraproduct, Los's theorem -/ +@[expose] public section + universe u v variable {α : Type*} (M : α → Type*) (u : Ultrafilter α) @@ -130,13 +134,11 @@ theorem boundedFormula_realize_cast {β : Type*} {n : ℕ} (φ : L.BoundedFormul simp only [Function.comp_def, ih, h'] refine ⟨fun h => ?_, fun h m => ?_⟩ · contrapose! h - simp_rw [← Ultrafilter.eventually_not, not_forall] at h refine ⟨fun a : α => Classical.epsilon fun m : M a => ¬φ.Realize (fun i => x i a) (Fin.snoc (fun i => v i a) m), ?_⟩ - rw [← Ultrafilter.eventually_not] exact Filter.mem_of_superset h fun a ha => Classical.epsilon_spec ha · rw [Filter.eventually_iff] at * exact Filter.mem_of_superset h fun a ha => ha (m a) diff --git a/Mathlib/NumberTheory/ADEInequality.lean b/Mathlib/NumberTheory/ADEInequality.lean index b74131ff1e3647..1eb8e47399d9aa 100644 --- a/Mathlib/NumberTheory/ADEInequality.lean +++ b/Mathlib/NumberTheory/ADEInequality.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Order.Ring.Rat -import Mathlib.Data.Multiset.Sort -import Mathlib.Data.PNat.Basic -import Mathlib.Data.PNat.Interval -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Algebra.Order.Ring.Rat +public import Mathlib.Data.Multiset.Sort +public import Mathlib.Data.PNat.Basic +public import Mathlib.Data.PNat.Interval +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.IntervalCases /-! # The inequality `p⁻¹ + q⁻¹ + r⁻¹ > 1` @@ -35,6 +37,8 @@ in the classification of Dynkin diagrams, root systems, and semisimple Lie algeb -/ +@[expose] public section + namespace ADEInequality diff --git a/Mathlib/NumberTheory/AbelSummation.lean b/Mathlib/NumberTheory/AbelSummation.lean index 8dd3a69dced005..75f45353e8edcc 100644 --- a/Mathlib/NumberTheory/AbelSummation.lean +++ b/Mathlib/NumberTheory/AbelSummation.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.MeasureTheory.Function.Floor -import Mathlib.MeasureTheory.Integral.Asymptotics -import Mathlib.MeasureTheory.Integral.IntegralEqImproper -import Mathlib.Topology.Order.IsLocallyClosed +module + +public import Mathlib.MeasureTheory.Function.Floor +public import Mathlib.MeasureTheory.Integral.Asymptotics +public import Mathlib.MeasureTheory.Integral.IntegralEqImproper +public import Mathlib.Topology.Order.IsLocallyClosed /-! # Abel's summation formula @@ -41,6 +43,8 @@ Primed versions of the three results above are also stated for when the endpoint -/ +@[expose] public section + noncomputable section open Finset MeasureTheory diff --git a/Mathlib/NumberTheory/ArithmeticFunction.lean b/Mathlib/NumberTheory/ArithmeticFunction.lean index fc3d59a7b1ef02..e49f9cc17b3d7f 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction.lean @@ -3,13 +3,16 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Algebra.Module.BigOperators -import Mathlib.NumberTheory.Divisors -import Mathlib.Data.Nat.Squarefree -import Mathlib.Data.Nat.GCD.BigOperators -import Mathlib.Data.Nat.Factorization.Induction -import Mathlib.Tactic.ArithMult +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.NumberTheory.Divisors +public import Mathlib.Data.Nat.Squarefree +public import Mathlib.Data.Nat.GCD.BigOperators +public import Mathlib.Data.Nat.Factorization.Induction +public import Mathlib.Data.Nat.Factorization.PrimePow +public import Mathlib.Tactic.ArithMult /-! # Arithmetic Functions and Dirichlet Convolution @@ -64,6 +67,8 @@ arithmetic functions, dirichlet convolution, divisors -/ +@[expose] public section + open Finset open Nat @@ -1066,16 +1071,34 @@ theorem cardDistinctFactors_eq_cardFactors_iff_squarefree {n : ℕ} (h0 : n ≠ apply List.nodup_dedup · simp [h.dedup, cardFactors] +theorem cardDistinctFactors_eq_one_iff {n : ℕ} : ω n = 1 ↔ IsPrimePow n := by + rw [ArithmeticFunction.cardDistinctFactors_apply, isPrimePow_iff_card_primeFactors_eq_one, + ← Nat.toFinset_factors, List.card_toFinset] + @[simp] theorem cardDistinctFactors_apply_prime_pow {p k : ℕ} (hp : p.Prime) (hk : k ≠ 0) : - ω (p ^ k) = 1 := by - rw [cardDistinctFactors_apply, hp.primeFactorsList_pow, List.replicate_dedup hk, - List.length_singleton] + ω (p ^ k) = 1 := + cardDistinctFactors_eq_one_iff.mpr <| hp.isPrimePow.pow hk @[simp] theorem cardDistinctFactors_apply_prime {p : ℕ} (hp : p.Prime) : ω p = 1 := by rw [← pow_one p, cardDistinctFactors_apply_prime_pow hp one_ne_zero] +theorem cardDistinctFactors_mul {m n : ℕ} (h : m.Coprime n) : ω (m * n) = ω m + ω n := by + simp [cardDistinctFactors_apply, Nat.perm_primeFactorsList_mul_of_coprime h |>.dedup |>.length_eq, + Nat.coprime_primeFactorsList_disjoint h |>.dedup_append] + +open scoped Function in +theorem cardDistinctFactors_prod {ι : Type*} {s : Finset ι} {f : ι → ℕ} + (h : (s : Set ι).Pairwise (Nat.Coprime on f)) : ω (∏ i ∈ s, f i) = ∑ i ∈ s, ω (f i) := by + induction s using Finset.cons_induction_on with + | empty => simp + | cons a s ha ih => + rw [prod_cons, sum_cons, cardDistinctFactors_mul, ih] + · exact fun {x} hx {y} hy hxy => h (by simp [hx]) (by simp [hy]) hxy + · exact Coprime.prod_right fun i hi => + h (by simp) (by simp [hi]) (ne_of_mem_of_not_mem hi ha).symm + /-- `μ` is the Möbius function. If `n` is squarefree with an even number of distinct prime factors, `μ n = 1`. If `n` is squarefree with an odd number of distinct prime factors, `μ n = -1`. If `n` is not squarefree, `μ n = 0`. -/ @@ -1424,7 +1447,7 @@ open Lean Meta Qq /-- Extension for `ArithmeticFunction.sigma`. -/ @[positivity ArithmeticFunction.sigma _ _] -def evalArithmeticFunctionSigma : PositivityExt where eval {u α} z p e := do +meta def evalArithmeticFunctionSigma : PositivityExt where eval {u α} z p e := do match u, α, e with | 0, ~q(ℕ), ~q(ArithmeticFunction.sigma $k $n) => let rn ← core z p n @@ -1436,7 +1459,7 @@ def evalArithmeticFunctionSigma : PositivityExt where eval {u α} z p e := do /-- Extension for `ArithmeticFunction.zeta`. -/ @[positivity ArithmeticFunction.zeta _] -def evalArithmeticFunctionZeta : PositivityExt where eval {u α} z p e := do +meta def evalArithmeticFunctionZeta : PositivityExt where eval {u α} z p e := do match u, α, e with | 0, ~q(ℕ), ~q(ArithmeticFunction.zeta $n) => let rn ← core z p n diff --git a/Mathlib/NumberTheory/Basic.lean b/Mathlib/NumberTheory/Basic.lean index 2092df338ceb46..811a4e5d2b9a25 100644 --- a/Mathlib/NumberTheory/Basic.lean +++ b/Mathlib/NumberTheory/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Ideal.Span /-! # Basic results in number theory @@ -20,6 +22,8 @@ all natural numbers `p` and `k` if `p` divides `a-b` in `R`, then `p ^ (k + 1)` `a ^ (p ^ k) - b ^ (p ^ k)`. -/ +@[expose] public section + section diff --git a/Mathlib/NumberTheory/Bernoulli.lean b/Mathlib/NumberTheory/Bernoulli.lean index 7ae29fbd6ce19f..3d8e469887f8c3 100644 --- a/Mathlib/NumberTheory/Bernoulli.lean +++ b/Mathlib/NumberTheory/Bernoulli.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kevin Buzzard -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.RingTheory.PowerSeries.Inverse -import Mathlib.RingTheory.PowerSeries.WellKnown +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.RingTheory.PowerSeries.Inverse +public import Mathlib.RingTheory.PowerSeries.WellKnown /-! # Bernoulli numbers @@ -49,6 +51,8 @@ then defined as `bernoulli := (-1)^n * bernoulli'`. `sum_bernoulli : ∑ k ∈ Finset.range n, (n.choose k : ℚ) * bernoulli k = if n = 1 then 1 else 0` -/ +@[expose] public section + open Nat Finset Finset.Nat PowerSeries diff --git a/Mathlib/NumberTheory/BernoulliPolynomials.lean b/Mathlib/NumberTheory/BernoulliPolynomials.lean index 95132a3e90a38f..26ddb723df95ad 100644 --- a/Mathlib/NumberTheory/BernoulliPolynomials.lean +++ b/Mathlib/NumberTheory/BernoulliPolynomials.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Ashvni Narayanan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ashvni Narayanan, David Loeffler -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Data.Nat.Choose.Cast -import Mathlib.NumberTheory.Bernoulli +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Data.Nat.Choose.Cast +public import Mathlib.NumberTheory.Bernoulli /-! # Bernoulli polynomials @@ -38,6 +40,8 @@ Bernoulli polynomials are defined using `bernoulli`, the Bernoulli numbers. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/NumberTheory/Bertrand.lean b/Mathlib/NumberTheory/Bertrand.lean index 4dd28bc070c99b..0d860624408618 100644 --- a/Mathlib/NumberTheory/Bertrand.lean +++ b/Mathlib/NumberTheory/Bertrand.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Patrick Stevens. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Stevens, Bolton Bailey -/ -import Mathlib.Data.Nat.Choose.Factorization -import Mathlib.NumberTheory.Primorial -import Mathlib.Analysis.Convex.SpecificFunctions.Basic -import Mathlib.Analysis.Convex.SpecificFunctions.Deriv -import Mathlib.Tactic.NormNum.Prime +module + +public import Mathlib.Data.Nat.Choose.Factorization +public import Mathlib.NumberTheory.Primorial +public import Mathlib.Analysis.Convex.SpecificFunctions.Basic +public import Mathlib.Analysis.Convex.SpecificFunctions.Deriv +public import Mathlib.Tactic.NormNum.Prime /-! # Bertrand's Postulate @@ -37,6 +39,8 @@ binomial coefficient given in `Nat.four_pow_lt_mul_centralBinom`. Bertrand, prime, binomial coefficients -/ +@[expose] public section + section Real diff --git a/Mathlib/NumberTheory/ClassNumber/AdmissibleAbs.lean b/Mathlib/NumberTheory/ClassNumber/AdmissibleAbs.lean index 891ff1e19e06bd..a87b9f3eec94fb 100644 --- a/Mathlib/NumberTheory/ClassNumber/AdmissibleAbs.lean +++ b/Mathlib/NumberTheory/ClassNumber/AdmissibleAbs.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Algebra.Basic -import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue -import Mathlib.Data.Real.Archimedean +module + +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue +public import Mathlib.Data.Real.Archimedean /-! # Admissible absolute value on the integers @@ -19,6 +21,8 @@ is finite. mapping negative `x` to `-x`, is admissible. -/ +@[expose] public section + namespace AbsoluteValue diff --git a/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean b/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean index db4198622d106b..d4674cf4da4bc4 100644 --- a/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean +++ b/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Data.Real.Basic -import Mathlib.Combinatorics.Pigeonhole -import Mathlib.Algebra.Order.AbsoluteValue.Euclidean +module + +public import Mathlib.Data.Real.Basic +public import Mathlib.Combinatorics.Pigeonhole +public import Mathlib.Algebra.Order.AbsoluteValue.Euclidean /-! # Admissible absolute values @@ -27,6 +29,8 @@ of the ring of integers of a global field is finite. mapping `p : Polynomial 𝔽_q` to `q ^ degree p`, is admissible -/ +@[expose] public section + local infixl:50 " ≺ " => EuclideanDomain.r namespace AbsoluteValue diff --git a/Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean b/Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean index 6d700e4f376096..0690afc06f79be 100644 --- a/Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean +++ b/Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Polynomial.Degree.CardPowDegree -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue -import Mathlib.RingTheory.LocalRing.Basic +module + +public import Mathlib.Algebra.Polynomial.Degree.CardPowDegree +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue +public import Mathlib.RingTheory.LocalRing.Basic /-! # Admissible absolute values on polynomials @@ -20,6 +22,8 @@ use to show the class number of the ring of integers of a function field is fini mapping `p : Polynomial 𝔽_q` to `q ^ degree p`, is admissible -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/NumberTheory/ClassNumber/Finite.lean b/Mathlib/NumberTheory/ClassNumber/Finite.lean index 1cae384ca3fd5f..d35a0f687382fb 100644 --- a/Mathlib/NumberTheory/ClassNumber/Finite.lean +++ b/Mathlib/NumberTheory/ClassNumber/Finite.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.Matrix.AbsoluteValue -import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue -import Mathlib.RingTheory.ClassGroup -import Mathlib.RingTheory.DedekindDomain.IntegralClosure -import Mathlib.RingTheory.Norm.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.LinearAlgebra.Matrix.AbsoluteValue +public import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue +public import Mathlib.RingTheory.ClassGroup +public import Mathlib.RingTheory.DedekindDomain.IntegralClosure +public import Mathlib.RingTheory.Norm.Basic /-! # Class numbers of global fields @@ -21,6 +23,8 @@ finiteness of the class group for number fields and function fields. its integral closure has a finite class group -/ +@[expose] public section + open Module Ring open scoped nonZeroDivisors @@ -39,7 +43,7 @@ variable {ι : Type*} [DecidableEq ι] [Fintype ι] (bS : Basis ι R S) /-- If `b` is an `R`-basis of `S` of cardinality `n`, then `normBound abv b` is an integer such that for every `R`-integral element `a : S` with coordinates `≤ y`, -we have algebra.norm a ≤ norm_bound abv b * y ^ n`. (See also `norm_le` and `norm_lt`). -/ +we have `algebra.norm a ≤ normBound abv b * y ^ n`. (See also `norm_le` and `norm_lt`). -/ noncomputable def normBound : ℤ := let n := Fintype.card ι let i : ι := Nonempty.some bS.index_nonempty diff --git a/Mathlib/NumberTheory/ClassNumber/FunctionField.lean b/Mathlib/NumberTheory/ClassNumber/FunctionField.lean index 6c6aecd30fe2d0..010a4f8df8b1ec 100644 --- a/Mathlib/NumberTheory/ClassNumber/FunctionField.lean +++ b/Mathlib/NumberTheory/ClassNumber/FunctionField.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.NumberTheory.ClassNumber.AdmissibleCardPowDegree -import Mathlib.NumberTheory.ClassNumber.Finite -import Mathlib.NumberTheory.FunctionField +module + +public import Mathlib.NumberTheory.ClassNumber.AdmissibleCardPowDegree +public import Mathlib.NumberTheory.ClassNumber.Finite +public import Mathlib.NumberTheory.FunctionField /-! # Class numbers of function fields @@ -19,6 +21,8 @@ on the class number. cardinality of the class group of its ring of integers -/ +@[expose] public section + namespace FunctionField diff --git a/Mathlib/NumberTheory/Cyclotomic/Basic.lean b/Mathlib/NumberTheory/Cyclotomic/Basic.lean index 448365100e6d4b..211ef7bfd79585 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Basic.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.FieldTheory.SeparableClosure -import Mathlib.FieldTheory.Galois.Abelian +module + +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.FieldTheory.SeparableClosure +public import Mathlib.FieldTheory.Galois.Abelian /-! # Cyclotomic extensions @@ -58,6 +60,8 @@ included in the `Cyclotomic` locale. -/ +@[expose] public section + open Polynomial Algebra Module Set diff --git a/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean b/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean index adca0be6d86bdd..527f9e649d32e3 100644 --- a/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean +++ b/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Hanneke Wiersema. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Hanneke Wiersema, Andrew Yang -/ -import Mathlib.Algebra.Ring.Aut -import Mathlib.NumberTheory.Padics.RingHoms -import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity -import Mathlib.RingTheory.RootsOfUnity.Minpoly -import Mathlib.FieldTheory.KrullTopology +module + +public import Mathlib.Algebra.Ring.Aut +public import Mathlib.NumberTheory.Padics.RingHoms +public import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity +public import Mathlib.RingTheory.RootsOfUnity.Minpoly +public import Mathlib.FieldTheory.KrullTopology /-! @@ -63,6 +65,8 @@ where `d` is the number of `n`th roots of unity in `L`. cyclotomic character -/ +@[expose] public section + universe u variable {L : Type u} [CommRing L] [IsDomain L] diff --git a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean index a9567cd667c0e9..c2c5506a511382 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots -import Mathlib.RingTheory.DedekindDomain.Dvr -import Mathlib.NumberTheory.NumberField.Discriminant.Defs +module + +public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots +public import Mathlib.RingTheory.DedekindDomain.Dvr +public import Mathlib.NumberTheory.NumberField.Discriminant.Defs /-! # Discriminant of cyclotomic fields @@ -19,6 +21,8 @@ We compute the discriminant of a `p ^ n`-th cyclotomic extension. -/ +@[expose] public section + universe u v diff --git a/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean b/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean index f1ed7016c326e5..184b6ec782beb2 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings +module + +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/Gal.lean b/Mathlib/NumberTheory/Cyclotomic/Gal.lean index 67f4d3465a808a..8bd31169f36f06 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Gal.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Gal.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots -import Mathlib.FieldTheory.PolynomialGaloisGroup +module + +public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots +public import Mathlib.FieldTheory.PolynomialGaloisGroup /-! # Galois group of cyclotomic extensions @@ -36,6 +38,8 @@ it is always a subgroup, and if the `n`th cyclotomic polynomial is irreducible, -/ +@[expose] public section + variable {n : ℕ} [NeZero n] (K : Type*) [Field K] {L : Type*} {μ : L} diff --git a/Mathlib/NumberTheory/Cyclotomic/PID.lean b/Mathlib/NumberTheory/Cyclotomic/PID.lean index e42a3ee394d8b5..c46b3bc72d8610 100644 --- a/Mathlib/NumberTheory/Cyclotomic/PID.lean +++ b/Mathlib/NumberTheory/Cyclotomic/PID.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.NumberField.Cyclotomic.PID +module + +public import Mathlib.NumberTheory.NumberField.Cyclotomic.PID deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean b/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean index 1dee3129d8382a..0de485ca728d37 100644 --- a/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean +++ b/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean @@ -3,15 +3,17 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Riccardo Brasca, Eric Rodriguez -/ -import Mathlib.Data.Nat.Factorization.LCM -import Mathlib.Data.Nat.Factorization.PrimePow -import Mathlib.Data.PNat.Prime -import Mathlib.NumberTheory.Cyclotomic.Basic -import Mathlib.RingTheory.Adjoin.PowerBasis -import Mathlib.RingTheory.Norm.Transitivity -import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval -import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Data.Nat.Factorization.LCM +public import Mathlib.Data.Nat.Factorization.PrimePow +public import Mathlib.Data.PNat.Prime +public import Mathlib.NumberTheory.Cyclotomic.Basic +public import Mathlib.RingTheory.Adjoin.PowerBasis +public import Mathlib.RingTheory.Norm.Transitivity +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Primitive roots in cyclotomic fields @@ -62,6 +64,8 @@ and only at the "final step", when we need to provide an "explicit" primitive ro -/ +@[expose] public section + open Polynomial Algebra Finset Module IsCyclotomicExtension Nat PNat Set open scoped IntermediateField diff --git a/Mathlib/NumberTheory/Cyclotomic/Rat.lean b/Mathlib/NumberTheory/Cyclotomic/Rat.lean index b2582c7b013db6..a1266c8865ebdb 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Rat.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Rat.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic +module + +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/Three.lean b/Mathlib/NumberTheory/Cyclotomic/Three.lean index 7d050869f16712..82f48ff304106f 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Three.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Three.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.NumberField.Cyclotomic.Three +module + +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Three deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Dioph.lean b/Mathlib/NumberTheory/Dioph.lean index 094797c0f531b5..d3acfb28c3faba 100644 --- a/Mathlib/NumberTheory/Dioph.lean +++ b/Mathlib/NumberTheory/Dioph.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fin.Fin2 -import Mathlib.Data.PFun -import Mathlib.Data.Vector3 -import Mathlib.NumberTheory.PellMatiyasevic +module + +public import Mathlib.Data.Fin.Fin2 +public import Mathlib.Data.PFun +public import Mathlib.Data.Vector3 +public import Mathlib.NumberTheory.PellMatiyasevic /-! # Diophantine functions and Matiyasevic's theorem @@ -49,6 +51,8 @@ Matiyasevic's theorem, Hilbert's tenth problem * Connect `Poly` to `MvPolynomial` -/ +@[expose] public section + open Fin2 Function Nat Sum diff --git a/Mathlib/NumberTheory/DiophantineApproximation/Basic.lean b/Mathlib/NumberTheory/DiophantineApproximation/Basic.lean index 74a4a618673060..b8d0df4cf5163c 100644 --- a/Mathlib/NumberTheory/DiophantineApproximation/Basic.lean +++ b/Mathlib/NumberTheory/DiophantineApproximation/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Geißer, Michael Stoll -/ -import Mathlib.NumberTheory.Real.Irrational -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.Int.Basic -import Mathlib.Tactic.Basic +module + +public import Mathlib.NumberTheory.Real.Irrational +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.Tactic.Basic /-! # Diophantine Approximation @@ -68,6 +70,8 @@ fractions is much more extensive than the English one.) Diophantine approximation, Dirichlet's approximation theorem, continued fraction -/ +@[expose] public section + namespace Real diff --git a/Mathlib/NumberTheory/DiophantineApproximation/ContinuedFractions.lean b/Mathlib/NumberTheory/DiophantineApproximation/ContinuedFractions.lean index 3ce8711c04c55f..c5b5ad6a183266 100644 --- a/Mathlib/NumberTheory/DiophantineApproximation/ContinuedFractions.lean +++ b/Mathlib/NumberTheory/DiophantineApproximation/ContinuedFractions.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Geißer, Michael Stoll -/ -import Mathlib.Algebra.ContinuedFractions.Computation.ApproximationCorollaries -import Mathlib.Algebra.ContinuedFractions.Computation.Translations -import Mathlib.NumberTheory.DiophantineApproximation.Basic +module + +public import Mathlib.Algebra.ContinuedFractions.Computation.ApproximationCorollaries +public import Mathlib.Algebra.ContinuedFractions.Computation.Translations +public import Mathlib.NumberTheory.DiophantineApproximation.Basic /-! # Diophantine Approximation using continued fractions @@ -18,6 +20,8 @@ a simple recursive definition of the convergents that is also defined in that fi This file provides `Real.exists_convs_eq_rat`, using `GenContFract.convs` of `GenContFract.of ξ`. -/ +@[expose] public section + section Convergent namespace Real diff --git a/Mathlib/NumberTheory/DirichletCharacter/Basic.lean b/Mathlib/NumberTheory/DirichletCharacter/Basic.lean index 38cf586a7afbda..3fca76e5bf9768 100644 --- a/Mathlib/NumberTheory/DirichletCharacter/Basic.lean +++ b/Mathlib/NumberTheory/DirichletCharacter/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Ashvni Narayanan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ashvni Narayanan, Moritz Firsching, Michael Stoll -/ -import Mathlib.Algebra.Group.EvenFunction -import Mathlib.Data.ZMod.Units -import Mathlib.NumberTheory.MulChar.Basic +module + +public import Mathlib.Algebra.Group.EvenFunction +public import Mathlib.Data.ZMod.Units +public import Mathlib.NumberTheory.MulChar.Basic /-! # Dirichlet Characters @@ -26,6 +28,8 @@ Main definitions: dirichlet character, multiplicative character -/ +@[expose] public section + /-! ### Definitions -/ diff --git a/Mathlib/NumberTheory/DirichletCharacter/Bounds.lean b/Mathlib/NumberTheory/DirichletCharacter/Bounds.lean index 1bdf5d62458948..93a3f942fcd6f6 100644 --- a/Mathlib/NumberTheory/DirichletCharacter/Bounds.lean +++ b/Mathlib/NumberTheory/DirichletCharacter/Bounds.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Normed.Field.Basic -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.NumberTheory.DirichletCharacter.Basic +module + +public import Mathlib.Analysis.Normed.Field.Basic +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.NumberTheory.DirichletCharacter.Basic /-! # Bounds for values of Dirichlet characters @@ -15,6 +17,8 @@ We consider Dirichlet characters `χ` with values in a normed field `F`. We show that `‖χ a‖ = 1` if `a` is a unit and `‖χ a‖ ≤ 1` in general. -/ +@[expose] public section + variable {F : Type*} [NormedField F] {n : ℕ} (χ : DirichletCharacter F n) namespace DirichletCharacter diff --git a/Mathlib/NumberTheory/DirichletCharacter/GaussSum.lean b/Mathlib/NumberTheory/DirichletCharacter/GaussSum.lean index d12fa719087e15..7bd03011e64768 100644 --- a/Mathlib/NumberTheory/DirichletCharacter/GaussSum.lean +++ b/Mathlib/NumberTheory/DirichletCharacter/GaussSum.lean @@ -3,12 +3,16 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.DirichletCharacter.Basic -import Mathlib.NumberTheory.GaussSum +module + +public import Mathlib.NumberTheory.DirichletCharacter.Basic +public import Mathlib.NumberTheory.GaussSum /-! # Gauss sums for Dirichlet characters -/ + +@[expose] public section variable {N : ℕ} [NeZero N] {R : Type*} [CommRing R] (e : AddChar (ZMod N) R) open AddChar DirichletCharacter diff --git a/Mathlib/NumberTheory/DirichletCharacter/Orthogonality.lean b/Mathlib/NumberTheory/DirichletCharacter/Orthogonality.lean index ae59f209823d98..94e866cd188747 100644 --- a/Mathlib/NumberTheory/DirichletCharacter/Orthogonality.lean +++ b/Mathlib/NumberTheory/DirichletCharacter/Orthogonality.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.NumberTheory.DirichletCharacter.Basic -import Mathlib.NumberTheory.MulChar.Duality +module + +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.NumberTheory.DirichletCharacter.Basic +public import Mathlib.NumberTheory.MulChar.Duality /-! # Orthogonality relations for Dirichlet characters @@ -17,6 +19,8 @@ when `a ≠ b` and has the value `n.totient` otherwise. This requires `R` to hav enough roots of unity (e.g., `R` could be an algebraically closed field of characteristic zero). -/ +@[expose] public section + namespace DirichletCharacter -- This is needed to be able to write down sums over characters. diff --git a/Mathlib/NumberTheory/Divisors.lean b/Mathlib/NumberTheory/Divisors.lean index 27f02ae3be34a7..1f50d736ed0edc 100644 --- a/Mathlib/NumberTheory/Divisors.lean +++ b/Mathlib/NumberTheory/Divisors.lean @@ -3,15 +3,17 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.IsPrimePow -import Mathlib.Algebra.Order.BigOperators.Group.Finset -import Mathlib.Algebra.Order.Interval.Finset.SuccPred -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Algebra.Ring.CharZero -import Mathlib.Data.Nat.Cast.Order.Ring -import Mathlib.Data.Nat.PrimeFin -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.Interval.Finset.Nat +module + +public import Mathlib.Algebra.IsPrimePow +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Algebra.Order.Interval.Finset.SuccPred +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Algebra.Ring.CharZero +public import Mathlib.Data.Nat.Cast.Order.Ring +public import Mathlib.Data.Nat.PrimeFin +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.Interval.Finset.Nat /-! # Divisor Finsets @@ -37,6 +39,8 @@ divisors, perfect numbers -/ +@[expose] public section + open Finset namespace Nat diff --git a/Mathlib/NumberTheory/EllipticDivisibilitySequence.lean b/Mathlib/NumberTheory/EllipticDivisibilitySequence.lean index eccc3fee2ded3a..72496352821207 100644 --- a/Mathlib/NumberTheory/EllipticDivisibilitySequence.lean +++ b/Mathlib/NumberTheory/EllipticDivisibilitySequence.lean @@ -3,9 +3,12 @@ Copyright (c) 2024 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Data.Nat.EvenOddRec -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Data.Nat.EvenOddRec +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.LinearCombination +import Mathlib.Algebra.Group.Int.Even /-! # Elliptic divisibility sequences @@ -65,6 +68,8 @@ M Ward, *Memoir on Elliptic Divisibility Sequences* elliptic, divisibility, sequence -/ +@[expose] public section + universe u v variable {R : Type u} [CommRing R] diff --git a/Mathlib/NumberTheory/EulerProduct/Basic.lean b/Mathlib/NumberTheory/EulerProduct/Basic.lean index 3b5b00bd764d96..e4ee2eae32fed6 100644 --- a/Mathlib/NumberTheory/EulerProduct/Basic.lean +++ b/Mathlib/NumberTheory/EulerProduct/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Normed.Ring.InfiniteSum -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.NumberTheory.ArithmeticFunction -import Mathlib.NumberTheory.SmoothNumbers +module + +public import Mathlib.Analysis.Normed.Ring.InfiniteSum +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.NumberTheory.ArithmeticFunction +public import Mathlib.NumberTheory.SmoothNumbers /-! # Euler Products @@ -42,6 +44,8 @@ for `s : Finset ℕ`. Euler product, multiplicative function -/ +@[expose] public section + /-- If `f` is multiplicative and summable, then its values at natural numbers `> 1` have norm strictly less than `1`. -/ lemma Summable.norm_lt_one {F : Type*} [NormedDivisionRing F] [CompleteSpace F] {f : ℕ →* F} diff --git a/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean b/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean index e54b6a9db5e736..eead73829c8315 100644 --- a/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean +++ b/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.EulerProduct.ExpLog -import Mathlib.NumberTheory.LSeries.Dirichlet +module + +public import Mathlib.NumberTheory.EulerProduct.ExpLog +public import Mathlib.NumberTheory.LSeries.Dirichlet /-! # The Euler Product for the Riemann Zeta Function and Dirichlet L-Series @@ -22,6 +24,8 @@ The second result is `dirichletLSeries_eulerProduct` (with variants which is the analogous statement for Dirichlet L-series. -/ +@[expose] public section + open Complex variable {s : ℂ} diff --git a/Mathlib/NumberTheory/EulerProduct/ExpLog.lean b/Mathlib/NumberTheory/EulerProduct/ExpLog.lean index a041a63f518af0..d16be0ad24940d 100644 --- a/Mathlib/NumberTheory/EulerProduct/ExpLog.lean +++ b/Mathlib/NumberTheory/EulerProduct/ExpLog.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv -import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.NumberTheory.EulerProduct.Basic +module + +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional +public import Mathlib.NumberTheory.EulerProduct.Basic /-! # Logarithms of Euler Products @@ -16,6 +18,8 @@ under suitable conditions on `f`. This can be seen as a logarithmic version of t Euler product for `f`. -/ +@[expose] public section + open Complex open Topology in diff --git a/Mathlib/NumberTheory/FLT/Basic.lean b/Mathlib/NumberTheory/FLT/Basic.lean index d70b39fe7e08c0..5202059f5afca0 100644 --- a/Mathlib/NumberTheory/FLT/Basic.lean +++ b/Mathlib/NumberTheory/FLT/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Yaël Dillies, Jineon Baek -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.GCDMonoid.Finset -import Mathlib.Algebra.GCDMonoid.Nat -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.GCDMonoid.Finset +public import Mathlib.Algebra.GCDMonoid.Nat +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Statement of Fermat's Last Theorem @@ -42,6 +44,8 @@ https://github.com/ImperialCollegeLondon/FLT . -/ +@[expose] public section + open List /-- Statement of Fermat's Last Theorem over a given semiring with a specific exponent. -/ diff --git a/Mathlib/NumberTheory/FLT/Four.lean b/Mathlib/NumberTheory/FLT/Four.lean index b5d64a1074b7aa..cd985f0beac4a6 100644 --- a/Mathlib/NumberTheory/FLT/Four.lean +++ b/Mathlib/NumberTheory/FLT/Four.lean @@ -3,17 +3,21 @@ Copyright (c) 2020 Paul van Wamelen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul van Wamelen -/ -import Mathlib.Data.Nat.Factors -import Mathlib.NumberTheory.FLT.Basic -import Mathlib.NumberTheory.PythagoreanTriples -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Data.Nat.Factors +public import Mathlib.NumberTheory.FLT.Basic +public import Mathlib.NumberTheory.PythagoreanTriples +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.Tactic.LinearCombination /-! # Fermat's Last Theorem for the case n = 4 There are no non-zero integers `a`, `b` and `c` such that `a ^ 4 + b ^ 4 = c ^ 4`. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal noncomputable section diff --git a/Mathlib/NumberTheory/FLT/MasonStothers.lean b/Mathlib/NumberTheory/FLT/MasonStothers.lean index c50f2e2e0870f7..15c853a60176ba 100644 --- a/Mathlib/NumberTheory/FLT/MasonStothers.lean +++ b/Mathlib/NumberTheory/FLT/MasonStothers.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jineon Baek and Seewoo Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jineon Baek, Seewoo Lee -/ -import Mathlib.RingTheory.Polynomial.Radical +module + +public import Mathlib.RingTheory.Polynomial.Radical /-! # Mason-Stothers theorem @@ -18,6 +20,8 @@ but slightly different. -/ +@[expose] public section + open Polynomial UniqueFactorizationMonoid UniqueFactorizationDomain EuclideanDomain variable {k : Type*} [Field k] [DecidableEq k] diff --git a/Mathlib/NumberTheory/FLT/Polynomial.lean b/Mathlib/NumberTheory/FLT/Polynomial.lean index 8d4ba9446b70ce..fb5e08a9379be0 100644 --- a/Mathlib/NumberTheory/FLT/Polynomial.lean +++ b/Mathlib/NumberTheory/FLT/Polynomial.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Jineon Baek and Seewoo Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jineon Baek, Seewoo Lee -/ -import Mathlib.Algebra.Polynomial.Expand -import Mathlib.Algebra.GroupWithZero.Defs -import Mathlib.NumberTheory.FLT.Basic -import Mathlib.NumberTheory.FLT.MasonStothers -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.Polynomial.Expand +public import Mathlib.Algebra.GroupWithZero.Defs +public import Mathlib.NumberTheory.FLT.Basic +public import Mathlib.NumberTheory.FLT.MasonStothers +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.Tactic.GCongr /-! # Fermat's Last Theorem for polynomials over a field @@ -28,6 +30,8 @@ The proof uses the Mason-Stothers theorem (Polynomial ABC theorem) and infinite (in the characteristic p case). -/ +@[expose] public section + open Polynomial UniqueFactorizationMonoid variable {k R : Type*} [Field k] [CommRing R] [IsDomain R] [NormalizationMonoid R] diff --git a/Mathlib/NumberTheory/FLT/Three.lean b/Mathlib/NumberTheory/FLT/Three.lean index e0b64b154e8be3..8af16ca2e316dd 100644 --- a/Mathlib/NumberTheory/FLT/Three.lean +++ b/Mathlib/NumberTheory/FLT/Three.lean @@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Sanyam Gupta, Omar Haddad, David Lowry-Duda, Lorenzo Luccioli, Pietro Monticone, Alexis Saurin, Florent Schaffhauser -/ -import Mathlib.NumberTheory.FLT.Basic -import Mathlib.NumberTheory.NumberField.Cyclotomic.PID -import Mathlib.NumberTheory.NumberField.Cyclotomic.Three -import Mathlib.Algebra.Ring.Divisibility.Lemmas +module + +public import Mathlib.NumberTheory.FLT.Basic +public import Mathlib.NumberTheory.NumberField.Cyclotomic.PID +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Three +public import Mathlib.Algebra.Ring.Divisibility.Lemmas /-! # Fermat Last Theorem in the case `n = 3` @@ -48,6 +50,8 @@ The strategy is the following: -/ +@[expose] public section + section case1 open ZMod diff --git a/Mathlib/NumberTheory/FactorisationProperties.lean b/Mathlib/NumberTheory/FactorisationProperties.lean index ab6a1e6b385f1e..60d4b6c17f21e1 100644 --- a/Mathlib/NumberTheory/FactorisationProperties.lean +++ b/Mathlib/NumberTheory/FactorisationProperties.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Colin Jones. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Colin Jones -/ -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.NumberTheory.Divisors -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.NormNum.Prime +module + +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.NumberTheory.Divisors +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.NormNum.Prime /-! # Factorisation properties of natural numbers @@ -45,6 +47,8 @@ relations with prime and perfect numbers. abundant, deficient, weird, pseudoperfect -/ +@[expose] public section + open Finset namespace Nat diff --git a/Mathlib/NumberTheory/Fermat.lean b/Mathlib/NumberTheory/Fermat.lean index 8df2f820b52435..d1a412ef64875b 100644 --- a/Mathlib/NumberTheory/Fermat.lean +++ b/Mathlib/NumberTheory/Fermat.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Firsching -/ -import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity -import Mathlib.NumberTheory.LucasPrimality +module + +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity +public import Mathlib.NumberTheory.LucasPrimality /-! # Fermat numbers @@ -20,6 +22,8 @@ for all natural numbers `n`. form `k * 2 ^ (n + 2) + 1`. -/ +@[expose] public section + open Function namespace Nat @@ -187,7 +191,7 @@ lemma fermat_primeFactors_one_lt (n p : ℕ) (hn : 1 < n) (hp : p.Prime) -- TODO: move to NumberTheory.Mersenne, once we have that. /-! -# Primality of Mersenne numbers `Mₙ = a ^ n - 1` +### Primality of Mersenne numbers `Mₙ = a ^ n - 1` -/ /-- Prime `a ^ n - 1` implies `a = 2` and prime `n`. -/ diff --git a/Mathlib/NumberTheory/FermatPsp.lean b/Mathlib/NumberTheory/FermatPsp.lean index daecf82b0b4e49..cec433c5081e3a 100644 --- a/Mathlib/NumberTheory/FermatPsp.lean +++ b/Mathlib/NumberTheory/FermatPsp.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Niels Voss. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Niels Voss -/ -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.Order.Filter.Cofinite -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.Order.Filter.Cofinite +public import Mathlib.Tactic.GCongr /-! # Fermat Pseudoprimes @@ -40,6 +42,8 @@ The main theorems are - `Nat.exists_infinite_pseudoprimes`: there are infinite pseudoprimes to any base `b ≥ 1` -/ +@[expose] public section + namespace Nat /-- diff --git a/Mathlib/NumberTheory/FrobeniusNumber.lean b/Mathlib/NumberTheory/FrobeniusNumber.lean index 62480a4187ad30..e98f418091f126 100644 --- a/Mathlib/NumberTheory/FrobeniusNumber.lean +++ b/Mathlib/NumberTheory/FrobeniusNumber.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Alex Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Zhao, Daniel Buth, Sebastian Meier, Junyan Xu -/ -import Mathlib.RingTheory.Ideal.NatInt +module + +public import Mathlib.RingTheory.Ideal.NatInt /-! # Frobenius Number @@ -35,6 +37,8 @@ is a multiple of n, and we're done. frobenius number, chicken mcnugget, chinese remainder theorem, AddSubmonoid.closure -/ +@[expose] public section + open Nat diff --git a/Mathlib/NumberTheory/FunctionField.lean b/Mathlib/NumberTheory/FunctionField.lean index 2cfb05feb02c53..3be99c253313aa 100644 --- a/Mathlib/NumberTheory/FunctionField.lean +++ b/Mathlib/NumberTheory/FunctionField.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Ashvni Narayanan -/ -import Mathlib.FieldTheory.RatFunc.Degree -import Mathlib.RingTheory.DedekindDomain.IntegralClosure -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.Topology.Algebra.Valued.ValuedField +module + +public import Mathlib.FieldTheory.RatFunc.Degree +public import Mathlib.RingTheory.DedekindDomain.IntegralClosure +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.Topology.Algebra.Valued.ValuedField /-! # Function fields @@ -39,6 +41,8 @@ adding them back in lemmas when they are needed. function field, ring of integers -/ +@[expose] public section + noncomputable section @@ -69,9 +73,9 @@ theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] simp only [map_one, map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := Module.finBasis (RatFunc Fq) F - exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) + exact (b.mapCoeffs e this).finiteDimensional_of_finite · let b := Module.finBasis Fqt F - refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) + refine (b.mapCoeffs e.symm ?_).finiteDimensional_of_finite intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] namespace FunctionField diff --git a/Mathlib/NumberTheory/GaussSum.lean b/Mathlib/NumberTheory/GaussSum.lean index f2dc48ff26aaf1..9b26fa8d260b4f 100644 --- a/Mathlib/NumberTheory/GaussSum.lean +++ b/Mathlib/NumberTheory/GaussSum.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.LegendreSymbol.AddCharacter -import Mathlib.NumberTheory.LegendreSymbol.ZModChar -import Mathlib.Algebra.CharP.CharAndCard +module + +public import Mathlib.NumberTheory.LegendreSymbol.AddCharacter +public import Mathlib.NumberTheory.LegendreSymbol.ZModChar +public import Mathlib.Algebra.CharP.CharAndCard /-! # Gauss sums @@ -45,6 +47,8 @@ Quadratic Reciprocity. additive character, multiplicative character, Gauss sum -/ +@[expose] public section + universe u v diff --git a/Mathlib/NumberTheory/Harmonic/Bounds.lean b/Mathlib/NumberTheory/Harmonic/Bounds.lean index 21461dfba7c5af..f858f74192346a 100644 --- a/Mathlib/NumberTheory/Harmonic/Bounds.lean +++ b/Mathlib/NumberTheory/Harmonic/Bounds.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Arend Mellendijk. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ +module -import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -import Mathlib.Analysis.SumIntegralComparisons -import Mathlib.NumberTheory.Harmonic.Defs +public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +public import Mathlib.Analysis.SumIntegralComparisons +public import Mathlib.NumberTheory.Harmonic.Defs /-! @@ -14,6 +15,8 @@ This file proves $\log(n + 1) \le H_n \le 1 + \log(n)$ for all natural numbers $ -/ +@[expose] public section + lemma harmonic_eq_sum_Icc {n : ℕ} : harmonic n = ∑ i ∈ Finset.Icc 1 n, (↑i)⁻¹ := by rw [harmonic, Finset.range_eq_Ico, Finset.sum_Ico_add' (fun (i : ℕ) ↦ (i : ℚ)⁻¹) 0 n (c := 1)] simp only [Finset.Ico_add_one_right_eq_Icc] diff --git a/Mathlib/NumberTheory/Harmonic/Defs.lean b/Mathlib/NumberTheory/Harmonic/Defs.lean index bfccacb2423e6c..f35a54ee302524 100644 --- a/Mathlib/NumberTheory/Harmonic/Defs.lean +++ b/Mathlib/NumberTheory/Harmonic/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Koundinya Vajjha. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Koundinya Vajjha, Thomas Browning -/ -import Mathlib.Data.Rat.Defs -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Rat.Defs +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! @@ -15,6 +17,8 @@ This file defines the harmonic numbers. -/ +@[expose] public section + /-- The nth-harmonic number defined as a finset sum of consecutive reciprocals. -/ def harmonic : ℕ → ℚ := fun n => ∑ i ∈ Finset.range n, (↑(i + 1))⁻¹ diff --git a/Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean b/Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean index 5371ea80deed87..ae2e78cdaa83d2 100644 --- a/Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean +++ b/Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.Complex.ExponentialBounds -import Mathlib.Analysis.Normed.Order.Lattice -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.NumberTheory.Harmonic.Defs +public import Mathlib.Analysis.Complex.ExponentialBounds +public import Mathlib.Analysis.Normed.Order.Lattice +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.NumberTheory.Harmonic.Defs /-! # The Euler-Mascheroni constant `γ` @@ -35,6 +36,8 @@ It follows that both sequences tend to a common limit `γ`, and we have the ineq `1 / 2 < γ < 2 / 3`. -/ +@[expose] public section + open Filter Topology namespace Real diff --git a/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean b/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean index 654e6cd6369797..2fe49f78b7d4cb 100644 --- a/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean +++ b/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.Convex.Deriv -import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne -import Mathlib.Data.Nat.Factorial.Basic -import Mathlib.NumberTheory.Harmonic.EulerMascheroni +public import Mathlib.Analysis.Convex.Deriv +public import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne +public import Mathlib.Data.Nat.Factorial.Basic +public import Mathlib.NumberTheory.Harmonic.EulerMascheroni /-! # Derivative of Γ at positive integers @@ -18,6 +19,8 @@ We prove the formula for the derivative of `Real.Gamma` at a positive integer: -/ +@[expose] public section + open Nat Set Filter Topology local notation "γ" => Real.eulerMascheroniConstant diff --git a/Mathlib/NumberTheory/Harmonic/Int.lean b/Mathlib/NumberTheory/Harmonic/Int.lean index 190fb7ef560632..0da46d4c350f3d 100644 --- a/Mathlib/NumberTheory/Harmonic/Int.lean +++ b/Mathlib/NumberTheory/Harmonic/Int.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Koundinya Vajjha. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Koundinya Vajjha, Thomas Browning -/ -import Mathlib.NumberTheory.Harmonic.Defs -import Mathlib.NumberTheory.Padics.PadicNumbers -import Mathlib.Tactic.Positivity +module + +public import Mathlib.NumberTheory.Harmonic.Defs +public import Mathlib.NumberTheory.Padics.PadicNumbers +public import Mathlib.Tactic.Positivity /-! @@ -17,6 +19,8 @@ https://kconrad.math.uconn.edu/blurbs/gradnumthy/padicharmonicsum.pdf -/ +@[expose] public section + lemma harmonic_pos {n : ℕ} (Hn : n ≠ 0) : 0 < harmonic n := by unfold harmonic rw [← Finset.nonempty_range_iff] at Hn diff --git a/Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean b/Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean index 54cb8fe7bf40fa..d7cb1f81eea37c 100644 --- a/Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean +++ b/Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.LSeries.RiemannZeta -import Mathlib.NumberTheory.Harmonic.GammaDeriv +module + +public import Mathlib.NumberTheory.LSeries.RiemannZeta +public import Mathlib.NumberTheory.Harmonic.GammaDeriv /-! # Asymptotics of `ζ s` as `s → 1` @@ -29,6 +31,8 @@ exists and is equal to `γ`. Finally, using this and the Riemann removable singu we obtain the limit along punctured neighbourhoods of 1 in `ℂ`. -/ +@[expose] public section + open Real Set MeasureTheory Filter Topology @[inherit_doc] local notation "γ" => eulerMascheroniConstant diff --git a/Mathlib/NumberTheory/JacobiSum/Basic.lean b/Mathlib/NumberTheory/JacobiSum/Basic.lean index 49c600ad2446f5..4fda30bec821fb 100644 --- a/Mathlib/NumberTheory/JacobiSum/Basic.lean +++ b/Mathlib/NumberTheory/JacobiSum/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.GaussSum -import Mathlib.NumberTheory.MulChar.Lemmas -import Mathlib.RingTheory.RootsOfUnity.Lemmas +module + +public import Mathlib.NumberTheory.GaussSum +public import Mathlib.NumberTheory.MulChar.Lemmas +public import Mathlib.RingTheory.RootsOfUnity.Lemmas /-! # Jacobi Sums @@ -28,6 +30,8 @@ but generalize where appropriate. This is based on Lean code written as part of the bachelor's thesis of Alexander Spahl. -/ +@[expose] public section + open Finset /-! diff --git a/Mathlib/NumberTheory/KummerDedekind.lean b/Mathlib/NumberTheory/KummerDedekind.lean index 0de8cb9bba81f1..5f63f8b58ab012 100644 --- a/Mathlib/NumberTheory/KummerDedekind.lean +++ b/Mathlib/NumberTheory/KummerDedekind.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Paul Lezeau -/ -import Mathlib.RingTheory.Conductor -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas -import Mathlib.RingTheory.IsAdjoinRoot +module + +public import Mathlib.RingTheory.Conductor +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +public import Mathlib.RingTheory.IsAdjoinRoot /-! # Kummer-Dedekind theorem @@ -53,6 +55,8 @@ with a formula). kummer, dedekind, kummer dedekind, dedekind-kummer, dedekind kummer -/ +@[expose] public section + variable {R : Type*} {S : Type*} [CommRing R] [CommRing S] [Algebra R S] {x : S} {I : Ideal R} diff --git a/Mathlib/NumberTheory/LSeries/AbstractFuncEq.lean b/Mathlib/NumberTheory/LSeries/AbstractFuncEq.lean index 5cc513ed214903..0466869bceb40e 100644 --- a/Mathlib/NumberTheory/LSeries/AbstractFuncEq.lean +++ b/Mathlib/NumberTheory/LSeries/AbstractFuncEq.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.MellinTransform +public import Mathlib.Analysis.MellinTransform /-! # Abstract functional equations for Mellin transforms @@ -56,6 +57,8 @@ See the sections *Main theorems on weak FE-pairs* and - `WeakFEPair.Λ_residue_zero`: computation of the residue at `0`. -/ +@[expose] public section + /- TODO : Consider extending the results to allow functional equations of the form `f (N / x) = (const) • x ^ k • g x` for a real parameter `0 < N`. This could be done either by diff --git a/Mathlib/NumberTheory/LSeries/Basic.lean b/Mathlib/NumberTheory/LSeries/Basic.lean index 0081d983adeda1..67336759ddb09e 100644 --- a/Mathlib/NumberTheory/LSeries/Basic.lean +++ b/Mathlib/NumberTheory/LSeries/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Michael Stoll -/ -import Mathlib.Analysis.PSeries -import Mathlib.Analysis.Normed.Module.FiniteDimension -import Mathlib.LinearAlgebra.Complex.FiniteDimensional +module + +public import Mathlib.Analysis.PSeries +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional /-! # L-series @@ -52,6 +54,8 @@ by David Loeffler and Michael Stoll. L-series -/ +@[expose] public section + open Complex /-! diff --git a/Mathlib/NumberTheory/LSeries/Convergence.lean b/Mathlib/NumberTheory/LSeries/Convergence.lean index 13c1c24f2b3f56..8dd208aa006f6c 100644 --- a/Mathlib/NumberTheory/LSeries/Convergence.lean +++ b/Mathlib/NumberTheory/LSeries/Convergence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Data.EReal.Basic -import Mathlib.NumberTheory.LSeries.Basic +module + +public import Mathlib.Data.EReal.Basic +public import Mathlib.NumberTheory.LSeries.Basic /-! # Convergence of L-series @@ -18,6 +20,8 @@ real part `x` and provide some results about it. L-series, abscissa of convergence -/ +@[expose] public section + open Complex /-- The abscissa `x : EReal` of absolute convergence of the L-series associated to `f`: diff --git a/Mathlib/NumberTheory/LSeries/Convolution.lean b/Mathlib/NumberTheory/LSeries/Convolution.lean index b910112c58495e..922a0796ef7387 100644 --- a/Mathlib/NumberTheory/LSeries/Convolution.lean +++ b/Mathlib/NumberTheory/LSeries/Convolution.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.Analysis.Normed.Ring.InfiniteSum -import Mathlib.NumberTheory.ArithmeticFunction -import Mathlib.NumberTheory.LSeries.Convergence +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.Analysis.Normed.Ring.InfiniteSum +public import Mathlib.NumberTheory.ArithmeticFunction +public import Mathlib.NumberTheory.LSeries.Convergence /-! # Dirichlet convolution of sequences and products of L-series @@ -21,6 +23,8 @@ of convergence of the L-series `L f` and `L g` of `f` and `g`; see `LSeries_con and `LSeries_convolution'`. -/ +@[expose] public section + open scoped LSeries.notation open Complex LSeries diff --git a/Mathlib/NumberTheory/LSeries/Deriv.lean b/Mathlib/NumberTheory/LSeries/Deriv.lean index 6c832122c02338..e63f93ab4d8e4c 100644 --- a/Mathlib/NumberTheory/LSeries/Deriv.lean +++ b/Mathlib/NumberTheory/LSeries/Deriv.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.NumberTheory.LSeries.Convergence -import Mathlib.Analysis.SpecialFunctions.Pow.Deriv -import Mathlib.Analysis.Complex.HalfPlane +module + +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.NumberTheory.LSeries.Convergence +public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +public import Mathlib.Analysis.Complex.HalfPlane /-! # Differentiability and derivatives of L-series @@ -28,6 +30,8 @@ We introduce `LSeries.logMul` as an abbreviation for the point-wise product `log the problem that this expression does not type-check. -/ +@[expose] public section + open Complex LSeries /-! diff --git a/Mathlib/NumberTheory/LSeries/Dirichlet.lean b/Mathlib/NumberTheory/LSeries/Dirichlet.lean index 529e2e65effa81..74bd0d27f18534 100644 --- a/Mathlib/NumberTheory/LSeries/Dirichlet.lean +++ b/Mathlib/NumberTheory/LSeries/Dirichlet.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.DirichletCharacter.Bounds -import Mathlib.NumberTheory.LSeries.Convolution -import Mathlib.NumberTheory.LSeries.Deriv -import Mathlib.NumberTheory.LSeries.RiemannZeta -import Mathlib.NumberTheory.SumPrimeReciprocals -import Mathlib.NumberTheory.VonMangoldt +module + +public import Mathlib.NumberTheory.DirichletCharacter.Bounds +public import Mathlib.NumberTheory.LSeries.Convolution +public import Mathlib.NumberTheory.LSeries.Deriv +public import Mathlib.NumberTheory.LSeries.RiemannZeta +public import Mathlib.NumberTheory.SumPrimeReciprocals +public import Mathlib.NumberTheory.VonMangoldt /-! # L-series of Dirichlet characters and arithmetic functions @@ -31,6 +33,8 @@ as special cases. Dirichlet L-series, Möbius function, von Mangoldt function, Riemann zeta function -/ +@[expose] public section + open scoped LSeries.notation /-- `δ` is the function underlying the arithmetic function `1`. -/ diff --git a/Mathlib/NumberTheory/LSeries/DirichletContinuation.lean b/Mathlib/NumberTheory/LSeries/DirichletContinuation.lean index 06b8f5d94e2b24..e39164d48850d4 100644 --- a/Mathlib/NumberTheory/LSeries/DirichletContinuation.lean +++ b/Mathlib/NumberTheory/LSeries/DirichletContinuation.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler, Michael Stoll -/ -import Mathlib.NumberTheory.LSeries.ZMod -import Mathlib.NumberTheory.DirichletCharacter.Basic -import Mathlib.NumberTheory.EulerProduct.DirichletLSeries +module + +public import Mathlib.NumberTheory.LSeries.ZMod +public import Mathlib.NumberTheory.DirichletCharacter.Basic +public import Mathlib.NumberTheory.EulerProduct.DirichletLSeries /-! # Analytic continuation of Dirichlet L-functions @@ -38,6 +40,8 @@ All definitions and theorems are in the `DirichletCharacter` namespace. `completedLFunction χ s = N ^ (s - 1 / 2) * rootNumber χ * completedLFunction χ⁻¹ s`. -/ +@[expose] public section + open HurwitzZeta Complex Finset ZMod Filter open scoped Real Topology diff --git a/Mathlib/NumberTheory/LSeries/HurwitzZeta.lean b/Mathlib/NumberTheory/LSeries/HurwitzZeta.lean index ff0527fa28b728..bdbae9c2a0199c 100644 --- a/Mathlib/NumberTheory/LSeries/HurwitzZeta.lean +++ b/Mathlib/NumberTheory/LSeries/HurwitzZeta.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.NumberTheory.LSeries.HurwitzZetaEven -import Mathlib.NumberTheory.LSeries.HurwitzZetaOdd -import Mathlib.Analysis.SpecialFunctions.Gamma.Beta +public import Mathlib.NumberTheory.LSeries.HurwitzZetaEven +public import Mathlib.NumberTheory.LSeries.HurwitzZetaOdd +public import Mathlib.Analysis.SpecialFunctions.Gamma.Beta /-! # The Hurwitz zeta function @@ -35,6 +36,8 @@ This file gives the definition and properties of the following two functions: * `hurwitzZeta_one_sub` and `expZeta_one_sub`: functional equations `s ↔ 1 - s`. -/ +@[expose] public section + open Set Real Complex Filter Topology namespace HurwitzZeta diff --git a/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean b/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean index 876bcf6ef2a697..93418bec563130 100644 --- a/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean +++ b/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.LSeries.AbstractFuncEq -import Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds -import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne -import Mathlib.NumberTheory.LSeries.MellinEqDirichlet -import Mathlib.NumberTheory.LSeries.Basic -import Mathlib.Analysis.Complex.RemovableSingularity +module + +public import Mathlib.NumberTheory.LSeries.AbstractFuncEq +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds +public import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne +public import Mathlib.NumberTheory.LSeries.MellinEqDirichlet +public import Mathlib.NumberTheory.LSeries.Basic +public import Mathlib.Analysis.Complex.RemovableSingularity /-! # Even Hurwitz zeta functions @@ -44,6 +46,8 @@ multiples of `1 / s` and `1 / (1 - s)`. * `hasSum_int_hurwitzZetaEven` and `hasSum_nat_cosZeta`: relation between the zeta functions and the corresponding Dirichlet series for `1 < re s`. -/ + +@[expose] public section noncomputable section open Complex Filter Topology Asymptotics Real Set MeasureTheory diff --git a/Mathlib/NumberTheory/LSeries/HurwitzZetaOdd.lean b/Mathlib/NumberTheory/LSeries/HurwitzZetaOdd.lean index d5cb5d7c5a3d9c..cddff2108792e5 100644 --- a/Mathlib/NumberTheory/LSeries/HurwitzZetaOdd.lean +++ b/Mathlib/NumberTheory/LSeries/HurwitzZetaOdd.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.LSeries.AbstractFuncEq -import Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds -import Mathlib.NumberTheory.LSeries.MellinEqDirichlet -import Mathlib.NumberTheory.LSeries.Basic +module + +public import Mathlib.NumberTheory.LSeries.AbstractFuncEq +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds +public import Mathlib.NumberTheory.LSeries.MellinEqDirichlet +public import Mathlib.NumberTheory.LSeries.Basic /-! # Odd Hurwitz zeta functions @@ -40,6 +42,8 @@ various versions of the Jacobi theta function. the zeta functions and corresponding Dirichlet series for `1 < re s` -/ +@[expose] public section + noncomputable section open Complex diff --git a/Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean b/Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean index e13f7e0e88615a..fda1f57a6e02e2 100644 --- a/Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean +++ b/Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.NumberTheory.ZetaValues -import Mathlib.NumberTheory.LSeries.RiemannZeta +public import Mathlib.NumberTheory.ZetaValues +public import Mathlib.NumberTheory.LSeries.RiemannZeta /-! # Special values of Hurwitz and Riemann zeta functions @@ -36,6 +37,8 @@ sums in the convergence range.) methods in the library at the present time (May 2024). -/ +@[expose] public section + open Complex Real Set open scoped Nat diff --git a/Mathlib/NumberTheory/LSeries/Injectivity.lean b/Mathlib/NumberTheory/LSeries/Injectivity.lean index 9396437c6733f8..b76a0ca0420447 100644 --- a/Mathlib/NumberTheory/LSeries/Injectivity.lean +++ b/Mathlib/NumberTheory/LSeries/Injectivity.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Analysis.Normed.Group.Tannery -import Mathlib.NumberTheory.LSeries.Convergence -import Mathlib.NumberTheory.LSeries.Linearity +module + +public import Mathlib.Analysis.Normed.Group.Tannery +public import Mathlib.NumberTheory.LSeries.Convergence +public import Mathlib.NumberTheory.LSeries.Linearity /-! # A converging L-series determines its coefficients @@ -15,6 +17,8 @@ must agree on all nonzero arguments. See `LSeries_eq_iff_of_abscissaOfAbsConv_lt and `LSeries_injOn`. -/ +@[expose] public section + open LSeries Complex -- The following two lemmas need both `LSeries.Linearity` and `LSeries.Convergence`, diff --git a/Mathlib/NumberTheory/LSeries/Linearity.lean b/Mathlib/NumberTheory/LSeries/Linearity.lean index 60a4a76843d7c6..b1eaa8d5be3ad6 100644 --- a/Mathlib/NumberTheory/LSeries/Linearity.lean +++ b/Mathlib/NumberTheory/LSeries/Linearity.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.BigOperators.Field -import Mathlib.NumberTheory.LSeries.Basic +module + +public import Mathlib.Algebra.BigOperators.Field +public import Mathlib.NumberTheory.LSeries.Basic /-! # Linearity of the L-series of `f` as a function of `f` @@ -13,6 +15,8 @@ We show that the `LSeries` of `f : ℕ → ℂ` is a linear function of `f` (ass of both L-series when adding two functions). -/ +@[expose] public section + /-! ### Addition -/ diff --git a/Mathlib/NumberTheory/LSeries/MellinEqDirichlet.lean b/Mathlib/NumberTheory/LSeries/MellinEqDirichlet.lean index 23d4086cb53608..8ebc8733a1eda1 100644 --- a/Mathlib/NumberTheory/LSeries/MellinEqDirichlet.lean +++ b/Mathlib/NumberTheory/LSeries/MellinEqDirichlet.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne +public import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne /-! # Dirichlet series as Mellin transforms @@ -12,6 +13,8 @@ Here we prove general results of the form "the Mellin transform of a power serie a Dirichlet series". -/ +@[expose] public section + open Filter Topology Asymptotics Real Set MeasureTheory open Complex diff --git a/Mathlib/NumberTheory/LSeries/Nonvanishing.lean b/Mathlib/NumberTheory/LSeries/Nonvanishing.lean index 5323f117fa277e..46c4f7c9d048c7 100644 --- a/Mathlib/NumberTheory/LSeries/Nonvanishing.lean +++ b/Mathlib/NumberTheory/LSeries/Nonvanishing.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll, David Loeffler -/ -import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds -import Mathlib.NumberTheory.Harmonic.ZetaAsymp -import Mathlib.NumberTheory.LSeries.Dirichlet -import Mathlib.NumberTheory.LSeries.DirichletContinuation -import Mathlib.NumberTheory.LSeries.Positivity +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds +public import Mathlib.NumberTheory.Harmonic.ZetaAsymp +public import Mathlib.NumberTheory.LSeries.Dirichlet +public import Mathlib.NumberTheory.LSeries.DirichletContinuation +public import Mathlib.NumberTheory.LSeries.Positivity /-! # The L-function of a Dirichlet character does not vanish on Re(s) ≥ 1 @@ -38,6 +40,8 @@ we show has absolute value `≥ 1` for all positive `x` and real `y`; if `L(χ, this product would have to tend to 0 as `x → 0`, which is a contradiction. -/ +@[expose] public section + /- NB: Many lemmas (and some defs) in this file are private, since they concern properties of hypothetical objects which we eventually deduce cannot exist. We have only made public the lemmas whose hypotheses do not turn out to be contradictory. @@ -276,8 +280,8 @@ private lemma one_lt_re_one_add {x : ℝ} (hx : 0 < x) (y : ℝ) : ofReal_im, mul_zero, sub_self, add_zero, re_ofNat, im_ofNat, mul_one, mul_im, and_self] open scoped LSeries.notation in -/-- For positive `x` and nonzero `y` and a Dirichlet character `χ` we have that -`|L(χ^0, 1 + x)^3 L(χ, 1 + x + I * y)^4 L(χ^2, 1 + x + 2 * I * y)| ≥ 1. -/ +/-- For positive `x` and nonzero `y` and a Dirichlet character `χ` we have +`|L(χ^0, 1 + x)^3 * L(χ, 1 + x + I * y)^4 * L(χ^2, 1 + x + 2 * I * y)| ≥ 1`. -/ lemma norm_LSeries_product_ge_one {x : ℝ} (hx : 0 < x) (y : ℝ) : ‖L ↗(1 : DirichletCharacter ℂ N) (1 + x) ^ 3 * L ↗χ (1 + x + I * y) ^ 4 * L ↗(χ ^ 2 :) (1 + x + 2 * I * y)‖ ≥ 1 := by diff --git a/Mathlib/NumberTheory/LSeries/Positivity.lean b/Mathlib/NumberTheory/LSeries/Positivity.lean index 993343642cdb49..c20b7dc9bb750c 100644 --- a/Mathlib/NumberTheory/LSeries/Positivity.lean +++ b/Mathlib/NumberTheory/LSeries/Positivity.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler, Michael Stoll -/ -import Mathlib.Analysis.Complex.TaylorSeries -import Mathlib.Analysis.Complex.Positivity -import Mathlib.NumberTheory.ArithmeticFunction -import Mathlib.NumberTheory.LSeries.Deriv +module + +public import Mathlib.Analysis.Complex.TaylorSeries +public import Mathlib.Analysis.Complex.Positivity +public import Mathlib.NumberTheory.ArithmeticFunction +public import Mathlib.NumberTheory.LSeries.Deriv /-! # Positivity of values of L-series @@ -23,6 +25,8 @@ The main results of this file are as follows. `ArithmeticFunction.LSeries_positive_of_eq_differentiable`. -/ +@[expose] public section + open scoped ComplexOrder open Complex diff --git a/Mathlib/NumberTheory/LSeries/PrimesInAP.lean b/Mathlib/NumberTheory/LSeries/PrimesInAP.lean index 56ddd4600d59c2..0bafd45015a47b 100644 --- a/Mathlib/NumberTheory/LSeries/PrimesInAP.lean +++ b/Mathlib/NumberTheory/LSeries/PrimesInAP.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Data.ZMod.Coprime -import Mathlib.NumberTheory.DirichletCharacter.Orthogonality -import Mathlib.NumberTheory.LSeries.Linearity -import Mathlib.NumberTheory.LSeries.Nonvanishing +module + +public import Mathlib.Data.ZMod.Coprime +public import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +public import Mathlib.NumberTheory.LSeries.Linearity +public import Mathlib.NumberTheory.LSeries.Nonvanishing /-! # Dirichlet's Theorem on primes in arithmetic progression @@ -66,6 +68,8 @@ We give two versions of **Dirichlet's Theorem**: prime number, arithmetic progression, residue class, Dirichlet's Theorem -/ +@[expose] public section + /-! ### Auxiliary statements diff --git a/Mathlib/NumberTheory/LSeries/RiemannZeta.lean b/Mathlib/NumberTheory/LSeries/RiemannZeta.lean index 3b57258f4f3149..20ab5d49c7151f 100644 --- a/Mathlib/NumberTheory/LSeries/RiemannZeta.lean +++ b/Mathlib/NumberTheory/LSeries/RiemannZeta.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.LSeries.HurwitzZeta -import Mathlib.Analysis.PSeriesComplex +module + +public import Mathlib.NumberTheory.LSeries.HurwitzZeta +public import Mathlib.Analysis.PSeriesComplex /-! # Definition of the Riemann zeta function @@ -42,6 +44,8 @@ These results are mostly special cases of more general results for even Hurwitz proved in `Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean`. -/ +@[expose] public section + open CharZero Set Filter HurwitzZeta diff --git a/Mathlib/NumberTheory/LSeries/SumCoeff.lean b/Mathlib/NumberTheory/LSeries/SumCoeff.lean index a8f6c7a29fb1c9..470315ae95cec6 100644 --- a/Mathlib/NumberTheory/LSeries/SumCoeff.lean +++ b/Mathlib/NumberTheory/LSeries/SumCoeff.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Analysis.Asymptotics.SpecificAsymptotics -import Mathlib.Analysis.InnerProductSpace.Calculus -import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals -import Mathlib.NumberTheory.AbelSummation -import Mathlib.NumberTheory.LSeries.Basic +module + +public import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +public import Mathlib.NumberTheory.AbelSummation +public import Mathlib.NumberTheory.LSeries.Basic /-! # Partial sums of coefficients of L-series @@ -32,6 +34,8 @@ L-series. -/ +@[expose] public section + open Finset Filter MeasureTheory Topology Complex Asymptotics section summable diff --git a/Mathlib/NumberTheory/LSeries/ZMod.lean b/Mathlib/NumberTheory/LSeries/ZMod.lean index 4236086bbb222d..a3d99ed319043e 100644 --- a/Mathlib/NumberTheory/LSeries/ZMod.lean +++ b/Mathlib/NumberTheory/LSeries/ZMod.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.Fourier.ZMod -import Mathlib.Analysis.NormedSpace.Connected -import Mathlib.NumberTheory.LSeries.RiemannZeta +public import Mathlib.Analysis.Fourier.ZMod +public import Mathlib.Analysis.NormedSpace.Connected +public import Mathlib.NumberTheory.LSeries.RiemannZeta /-! # L-series of functions on `ZMod N` @@ -55,6 +56,8 @@ Results for completed L-functions: the functional equation relating `completedLFunction Φ (1 - s)` to `completedLFunction (𝓕 Φ) s`. -/ +@[expose] public section + open HurwitzZeta Complex ZMod Finset Topology Filter Set open scoped Real diff --git a/Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean b/Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean index 5baf4a8cf56027..27eef8e110caed 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots -import Mathlib.FieldTheory.Finite.Trace -import Mathlib.Algebra.Group.AddChar -import Mathlib.Data.ZMod.Units -import Mathlib.Analysis.Complex.Polynomial.Basic +module + +public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots +public import Mathlib.FieldTheory.Finite.Trace +public import Mathlib.Algebra.Group.AddChar +public import Mathlib.Data.ZMod.Units +public import Mathlib.Analysis.Complex.Polynomial.Basic /-! # Additive characters of finite rings and fields @@ -36,6 +38,8 @@ is nontrivial (and the target is a domain); see `AddChar.sum_eq_zero_of_isNontri additive character -/ +@[expose] public section + universe u v diff --git a/Mathlib/NumberTheory/LegendreSymbol/Basic.lean b/Mathlib/NumberTheory/LegendreSymbol/Basic.lean index a3104e976ab674..f10648f4d4451a 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/Basic.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Michael Stoll -/ -import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic +module + +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic /-! # Legendre symbol @@ -33,6 +35,8 @@ are squares: quadratic residue, quadratic nonresidue, Legendre symbol -/ +@[expose] public section + open Nat diff --git a/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean b/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean index 05a6f003907f4e..899c94d31d8b53 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Nat.Prime.Factorial -import Mathlib.NumberTheory.LegendreSymbol.Basic +module + +public import Mathlib.Data.Nat.Prime.Factorial +public import Mathlib.NumberTheory.LegendreSymbol.Basic /-! # Lemmas of Gauss and Eisenstein @@ -13,6 +15,8 @@ This file contains the Lemmas of Gauss and Eisenstein on the Legendre symbol. The main results are `ZMod.gauss_lemma` and `ZMod.eisenstein_lemma`. -/ +@[expose] public section + open Finset Nat diff --git a/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean b/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean index 11ba9dcdde363c..15fd29a5402fbd 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll, Thomas Zhu, Mario Carneiro -/ -import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity +module + +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity /-! # The Jacobi Symbol @@ -58,6 +60,8 @@ We define the notation `J(a | b)` for `jacobiSym a b`, localized to `NumberTheor Jacobi symbol, quadratic reciprocity -/ +@[expose] public section + section Jacobi @@ -463,7 +467,7 @@ theorem mod_right' (a : ℕ) {b : ℕ} (hb : Odd b) : J(a | b) = J(a | b % (4 * · rw [mod_left ↑(b % _), mod_left b, Int.natCast_mod, Int.emod_emod_of_dvd b] simp only [ha₂, Nat.cast_mul, ← mul_assoc] apply dvd_mul_left - rcases e with - | e; · rfl + rcases e with - | e; · simp · rw [χ₈_nat_mod_eight, χ₈_nat_mod_eight (b % (4 * a)), mod_mod_of_dvd b] use 2 ^ e * a'; rw [ha₂, Nat.pow_succ]; ring diff --git a/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/Basic.lean b/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/Basic.lean index 36924710998c25..9dd028bde596e2 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/Basic.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Data.Fintype.Parity -import Mathlib.NumberTheory.LegendreSymbol.ZModChar -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.Data.Fintype.Parity +public import Mathlib.NumberTheory.LegendreSymbol.ZModChar +public import Mathlib.FieldTheory.Finite.Basic /-! # Quadratic characters of finite fields @@ -18,6 +20,8 @@ some basic statements about it. quadratic character -/ +@[expose] public section + /-! ### Definition of the quadratic character diff --git a/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean b/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean index b204412a783cfb..8803ab5d394fce 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic -import Mathlib.NumberTheory.GaussSum +module + +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic +public import Mathlib.NumberTheory.GaussSum /-! # Quadratic characters of finite fields @@ -13,6 +15,8 @@ Further facts relying on Gauss sums. -/ +@[expose] public section + /-! ### Basic properties of the quadratic character diff --git a/Mathlib/NumberTheory/LegendreSymbol/QuadraticReciprocity.lean b/Mathlib/NumberTheory/LegendreSymbol/QuadraticReciprocity.lean index ed037e090045de..2b85b3d9f3b043 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/QuadraticReciprocity.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/QuadraticReciprocity.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Michael Stoll -/ -import Mathlib.NumberTheory.LegendreSymbol.Basic -import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum +module + +public import Mathlib.NumberTheory.LegendreSymbol.Basic +public import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum /-! # Quadratic reciprocity. @@ -33,6 +35,8 @@ properties of quadratic Gauss sums as provided by `NumberTheory.LegendreSymbol.G quadratic residue, quadratic nonresidue, Legendre symbol, quadratic reciprocity -/ +@[expose] public section + open Nat diff --git a/Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean b/Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean index 65ed3fff4f1da4..d402c0b4316961 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Data.Int.Range -import Mathlib.Data.ZMod.Basic -import Mathlib.NumberTheory.MulChar.Basic +module + +public import Mathlib.Data.Int.Range +public import Mathlib.Data.ZMod.Basic +public import Mathlib.NumberTheory.MulChar.Basic /-! # Quadratic characters on ℤ/nℤ @@ -19,6 +21,8 @@ We set them up to be of type `MulChar (ZMod n) ℤ`, where `n` is `4` or `8`. quadratic character, zmod -/ +@[expose] public section + /-! ### Quadratic characters mod 4 and 8 diff --git a/Mathlib/NumberTheory/LocalField/Basic.lean b/Mathlib/NumberTheory/LocalField/Basic.lean index 0161b2694b8d3a..f542b1b8b4fe58 100644 --- a/Mathlib/NumberTheory/LocalField/Basic.lean +++ b/Mathlib/NumberTheory/LocalField/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Valuation.DiscreteValuativeRel -import Mathlib.Topology.Algebra.Valued.LocallyCompact -import Mathlib.Topology.Algebra.Valued.ValuativeRel +module + +public import Mathlib.RingTheory.Valuation.DiscreteValuativeRel +public import Mathlib.Topology.Algebra.Valued.LocallyCompact +public import Mathlib.Topology.Algebra.Valued.ValuativeRel /-! @@ -17,6 +19,8 @@ and it is locally compact and non-discrete. -/ +@[expose] public section + /-- Given a topological field `K` equipped with an equivalence class of valuations (a `ValuativeRel`), we say that it is a non-archimedean local field if the topology comes from the given valuation, diff --git a/Mathlib/NumberTheory/LucasLehmer.lean b/Mathlib/NumberTheory/LucasLehmer.lean index b33e3c68a640c1..94fbba683873d9 100644 --- a/Mathlib/NumberTheory/LucasLehmer.lean +++ b/Mathlib/NumberTheory/LucasLehmer.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Alastair Irving, Kim Morrison, Ainsley Pahljina -/ -import Mathlib.NumberTheory.Fermat -import Mathlib.RingTheory.Fintype +module + +public import Mathlib.NumberTheory.Fermat +public import Mathlib.RingTheory.Fintype /-! # The Lucas-Lehmer test for Mersenne primes @@ -30,6 +32,8 @@ This tactic was ported by Thomas Murrills to Lean 4, and then it was converted t extension and made to use kernel reductions by Kyle Miller. -/ +@[expose] public section + /-- The Mersenne numbers, 2^p - 1. -/ def mersenne (p : ℕ) : ℕ := 2 ^ p - 1 @@ -78,7 +82,7 @@ alias ⟨_, mersenne_pos_of_pos⟩ := mersenne_pos /-- Extension for the `positivity` tactic: `mersenne`. -/ @[positivity mersenne _] -def evalMersenne : PositivityExt where eval {u α} _zα _pα e := do +meta def evalMersenne : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℕ), ~q(mersenne $a) => let ra ← core q(inferInstance) q(inferInstance) a @@ -594,7 +598,7 @@ theorem lucas_lehmer_sufficiency (p : ℕ) (w : 1 < p) : LucasLehmerTest p → ( have h := lt_of_lt_of_le h₁ h₂ exact not_lt_of_ge (Nat.sub_le _ _) h -/-- If `2^p-1` is prime then the Lucas-Lehmer test holds, `s(p-2) % (2^p-1) = 0. -/ +/-- If `2^p - 1` is prime then the Lucas-Lehmer test holds, `s (p - 2) % (2^p - 1) = 0`. -/ theorem lucas_lehmer_necessity (p : ℕ) (w : 3 ≤ p) (hp : (mersenne p).Prime) : LucasLehmerTest p := by have : Fact (mersenne p).Prime := ⟨‹_›⟩ @@ -655,13 +659,14 @@ theorem sModNat_eq_sMod (p k : ℕ) (hp : 2 ≤ p) : (sModNat (2 ^ p - 1) k : Int.add_emod_right, ← sub_eq_add_neg] /-- Tail-recursive version of `sModNat`. -/ -def sModNatTR (q k : ℕ) : ℕ := +meta def sModNatTR (q k : ℕ) : ℕ := go k (4 % q) where /-- Helper function for `sMod''`. -/ go : ℕ → ℕ → ℕ | 0, acc => acc | n + 1, acc => go n ((acc ^ 2 + (q - 2)) % q) +termination_by structural x => x /-- Generalization of `sModNat` with arbitrary base case, @@ -716,7 +721,7 @@ theorem isNat_not_lucasLehmerTest : {p np : ℕ} → /-- Calculate `LucasLehmer.LucasLehmerTest p` for `2 ≤ p` by using kernel reduction for the `sMod'` function. -/ @[norm_num LucasLehmer.LucasLehmerTest (_ : ℕ)] -def evalLucasLehmerTest : NormNumExt where eval {_ _} e := do +meta def evalLucasLehmerTest : NormNumExt where eval {_ _} e := do let .app _ (p : Q(ℕ)) ← Meta.whnfR e | failure let ⟨ep, hp⟩ ← deriveNat p _ let np := ep.natLit! diff --git a/Mathlib/NumberTheory/LucasPrimality.lean b/Mathlib/NumberTheory/LucasPrimality.lean index d368ba8ebef890..1a358ce7c3f861 100644 --- a/Mathlib/NumberTheory/LucasPrimality.lean +++ b/Mathlib/NumberTheory/LucasPrimality.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey -/ -import Mathlib.Algebra.Field.ZMod -import Mathlib.RingTheory.IntegralDomain +module + +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.RingTheory.IntegralDomain /-! # The Lucas test for primes @@ -27,6 +29,8 @@ cases, we can take `q` to be any prime and see that `hd` does not hold, since `a to `1`. -/ +@[expose] public section + /-- If `a^(p-1) = 1 mod p`, but `a^((p-1)/q) ≠ 1 mod p` for all prime factors `q` of `p-1`, then `p` is prime. This is true because `a` has order `p-1` in the multiplicative group mod `p`, so this diff --git a/Mathlib/NumberTheory/MaricaSchoenheim.lean b/Mathlib/NumberTheory/MaricaSchoenheim.lean index 146fdc34c8319b..b150ed580d9e1e 100644 --- a/Mathlib/NumberTheory/MaricaSchoenheim.lean +++ b/Mathlib/NumberTheory/MaricaSchoenheim.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Combinatorics.SetFamily.FourFunctions -import Mathlib.Data.Nat.Squarefree +module + +public import Mathlib.Combinatorics.SetFamily.FourFunctions +public import Mathlib.Data.Nat.Squarefree /-! # The Marica-Schönheim special case of Graham's conjecture @@ -18,6 +20,8 @@ squarefree as a corollary of the Marica-Schönheim inequality. [*Applications of the FKG Inequality and Its Relatives*, Graham][Graham1983] -/ +@[expose] public section + open Finset open scoped FinsetFamily diff --git a/Mathlib/NumberTheory/Modular.lean b/Mathlib/NumberTheory/Modular.lean index b3810f99d2bbb2..a7ba68f4dc0bd3 100644 --- a/Mathlib/NumberTheory/Modular.lean +++ b/Mathlib/NumberTheory/Modular.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Alex Kontorovich and Heather Macbeth and Marc Masdeu. All rig Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Kontorovich, Heather Macbeth, Marc Masdeu -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction -import Mathlib.LinearAlgebra.GeneralLinearGroup -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Basic -import Mathlib.Topology.Instances.Matrix -import Mathlib.Topology.Algebra.Module.FiniteDimension -import Mathlib.Topology.Instances.ZMultiples +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction +public import Mathlib.LinearAlgebra.GeneralLinearGroup +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Basic +public import Mathlib.Topology.Instances.Matrix +public import Mathlib.Topology.Algebra.Module.FiniteDimension +public import Mathlib.Topology.Instances.ZMultiples /-! # The action of the modular group SL(2, ℤ) on the upper half-plane @@ -37,7 +39,7 @@ Any `z : ℍ` can be moved to `𝒟` by an element of `SL(2,ℤ)`: If both `z` and `γ • z` are in the open domain `𝒟ᵒ` then `z = γ • z`: `eq_smul_self_of_mem_fdo_mem_fdo {z : ℍ} {g : SL(2,ℤ)} (hz : z ∈ 𝒟ᵒ) (hg : g • z ∈ 𝒟ᵒ) : z = g • z` -# Discussion +## Discussion Standard proofs make use of the identity @@ -59,6 +61,8 @@ existence of `g` maximizing `(g•z).im` (see `ModularGroup.exists_max_im`), and those, to minimize `|(g•z).re|` (see `ModularGroup.exists_row_one_eq_and_min_re`). -/ +@[expose] public section + open Complex diff --git a/Mathlib/NumberTheory/ModularForms/ArithmeticSubgroups.lean b/Mathlib/NumberTheory/ModularForms/ArithmeticSubgroups.lean index 33edcd290d8892..a30e6a3d11a591 100644 --- a/Mathlib/NumberTheory/ModularForms/ArithmeticSubgroups.lean +++ b/Mathlib/NumberTheory/ModularForms/ArithmeticSubgroups.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Topology.Algebra.IsUniformGroup.DiscreteSubgroup -import Mathlib.Topology.Algebra.Ring.Real -import Mathlib.Topology.Instances.Matrix -import Mathlib.Topology.MetricSpace.Isometry +module + +public import Mathlib.Topology.Algebra.IsUniformGroup.DiscreteSubgroup +public import Mathlib.Topology.Algebra.Ring.Real +public import Mathlib.Topology.Instances.Matrix +public import Mathlib.Topology.MetricSpace.Isometry /-! # Arithmetic subgroups of `GL(2, ℝ)` @@ -15,6 +17,8 @@ We define a subgroup of `GL (Fin 2) ℝ` to be *arithmetic* if it is commensurab of `SL(2, ℤ)`. -/ +@[expose] public section + open Matrix Matrix.SpecialLinearGroup open scoped MatrixGroups diff --git a/Mathlib/NumberTheory/ModularForms/Basic.lean b/Mathlib/NumberTheory/ModularForms/Basic.lean index 494d266234ac5b..9c35c77828244e 100644 --- a/Mathlib/NumberTheory/ModularForms/Basic.lean +++ b/Mathlib/NumberTheory/ModularForms/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Algebra.DirectSum.Algebra -import Mathlib.Analysis.Calculus.FDeriv.Star -import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold -import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions -import Mathlib.NumberTheory.ModularForms.BoundedAtCusp -import Mathlib.NumberTheory.ModularForms.SlashInvariantForms +module + +public import Mathlib.Algebra.DirectSum.Algebra +public import Mathlib.Analysis.Calculus.FDeriv.Star +public import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold +public import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions +public import Mathlib.NumberTheory.ModularForms.BoundedAtCusp +public import Mathlib.NumberTheory.ModularForms.SlashInvariantForms /-! # Modular forms @@ -21,6 +23,8 @@ define the space of modular forms, cusp forms and prove that the product of two modular form. -/ +@[expose] public section + open Complex UpperHalfPlane Matrix.SpecialLinearGroup open scoped Topology Manifold MatrixGroups ComplexConjugate diff --git a/Mathlib/NumberTheory/ModularForms/BoundedAtCusp.lean b/Mathlib/NumberTheory/ModularForms/BoundedAtCusp.lean index d3678e5f24f248..72f3b523bf913a 100644 --- a/Mathlib/NumberTheory/ModularForms/BoundedAtCusp.lean +++ b/Mathlib/NumberTheory/ModularForms/BoundedAtCusp.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty -import Mathlib.NumberTheory.ModularForms.Cusps -import Mathlib.NumberTheory.ModularForms.SlashActions +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty +public import Mathlib.NumberTheory.ModularForms.Cusps +public import Mathlib.NumberTheory.ModularForms.SlashActions /-! # Boundedness and vanishing at cusps @@ -14,6 +16,8 @@ We define the notions of "bounded at c" and "vanishing at c" for functions on ` an element of `OnePoint ℝ`. -/ +@[expose] public section + open Matrix SpecialLinearGroup UpperHalfPlane Filter Polynomial OnePoint open scoped MatrixGroups LinearAlgebra.Projectivization ModularForm diff --git a/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean b/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean index 0bb85bd3c527c2..17cd742b4dfd3d 100644 --- a/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean +++ b/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.LinearAlgebra.Matrix.Integer -import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups +module + +public import Mathlib.LinearAlgebra.Matrix.Integer +public import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups /-! # Congruence subgroups @@ -16,6 +18,8 @@ It also contains basic results about congruence subgroups. -/ +@[expose] public section + open Matrix.SpecialLinearGroup Matrix open scoped MatrixGroups ModularGroup Real diff --git a/Mathlib/NumberTheory/ModularForms/Cusps.lean b/Mathlib/NumberTheory/ModularForms/Cusps.lean index c18e4b6592745e..c990bc7526248b 100644 --- a/Mathlib/NumberTheory/ModularForms/Cusps.lean +++ b/Mathlib/NumberTheory/ModularForms/Cusps.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Analysis.RCLike.Basic -import Mathlib.GroupTheory.Commensurable -import Mathlib.RingTheory.Localization.NumDen -import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine -import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.GroupTheory.Commensurable +public import Mathlib.RingTheory.Localization.NumDen +public import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine +public import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups /-! # Cusps @@ -16,6 +18,8 @@ import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups We define the cusps of a subgroup of `GL(2, ℝ)` as the fixed points of parabolic elements. -/ +@[expose] public section + open Matrix SpecialLinearGroup GeneralLinearGroup Filter Polynomial OnePoint open scoped MatrixGroups LinearAlgebra.Projectivization diff --git a/Mathlib/NumberTheory/ModularForms/DedekindEta.lean b/Mathlib/NumberTheory/ModularForms/DedekindEta.lean index 05208cdf1d835d..43f80d796c8a1d 100644 --- a/Mathlib/NumberTheory/ModularForms/DedekindEta.lean +++ b/Mathlib/NumberTheory/ModularForms/DedekindEta.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ +module -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.Analysis.Complex.UpperHalfPlane.Exp -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.Analysis.Complex.UpperHalfPlane.Exp +public import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn /-! # Dedekind eta function @@ -22,6 +23,8 @@ differentiable on the upper half-plane. * [F. Diamond and J. Shurman, *A First Course in Modular Forms*][diamondshurman2005], section 1.2 -/ +@[expose] public section + open TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Basic.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Basic.lean index ded6c5ae7efb14..4c98f506390283 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Basic.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Basic.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.NumberTheory.ModularForms.Basic -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.IsBoundedAtImInfty -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.MDifferentiable +public import Mathlib.NumberTheory.ModularForms.Basic +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.IsBoundedAtImInfty +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.MDifferentiable /-! # Eisenstein series are Modular Forms @@ -14,11 +15,13 @@ import Mathlib.NumberTheory.ModularForms.EisensteinSeries.MDifferentiable We show that Eisenstein series of weight `k` and level `Γ(N)` with congruence condition `a : Fin 2 → ZMod N` are Modular Forms. -# TODO +## TODO Add q-expansions and prove that they are not all identically zero. -/ +@[expose] public section + noncomputable section namespace ModularForm diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Defs.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Defs.lean index 1978290a11231e..873965a59097c6 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Defs.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.NumberTheory.ModularForms.SlashInvariantForms -import Mathlib.RingTheory.EuclideanDomain -import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.NumberTheory.ModularForms.SlashInvariantForms +public import Mathlib.RingTheory.EuclideanDomain +public import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups /-! # Eisenstein Series @@ -25,6 +27,8 @@ import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups * [F. Diamond and J. Shurman, *A First Course in Modular Forms*][diamondshurman2005] -/ +@[expose] public section + noncomputable section open ModularForm UpperHalfPlane Complex Matrix CongruenceSubgroup Set diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/IsBoundedAtImInfty.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/IsBoundedAtImInfty.lean index 33d58a91ebb7c0..ad25181271181b 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/IsBoundedAtImInfty.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/IsBoundedAtImInfty.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable -import Mathlib.NumberTheory.ModularForms.Identities +public import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable +public import Mathlib.NumberTheory.ModularForms.Identities /-! # Boundedness of Eisenstein series @@ -25,6 +26,8 @@ We can then, first observe that the slash action just changes our `a` to `(a ᵥ we then use our bounds for Eisenstein series in these vertical strips to get the result. -/ +@[expose] public section + noncomputable section open ModularForm UpperHalfPlane Matrix SlashInvariantForm CongruenceSubgroup diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/MDifferentiable.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/MDifferentiable.lean index 022cefff11ab52..85fc86dfa17fdd 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/MDifferentiable.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/MDifferentiable.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.UniformConvergence -import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold -import Mathlib.Analysis.Complex.LocallyUniformLimit -import Mathlib.Geometry.Manifold.MFDeriv.FDeriv +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.UniformConvergence +public import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold +public import Mathlib.Analysis.Complex.LocallyUniformLimit +public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! # Holomorphicity of Eisenstein series @@ -17,6 +18,8 @@ We show that Eisenstein series of weight `k` and level `Γ(N)` with congruence c MDifferentiable. -/ +@[expose] public section + noncomputable section open UpperHalfPlane Filter Function Complex Manifold CongruenceSubgroup diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/QExpansion.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/QExpansion.lean index f5fbe039213d4a..a78d3c9b020cb2 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/QExpansion.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/QExpansion.lean @@ -3,22 +3,43 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Complex.SummableUniformlyOn -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent +module + +public import Mathlib.Analysis.Complex.SummableUniformlyOn +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent +public import Mathlib.NumberTheory.LSeries.Dirichlet +public import Mathlib.NumberTheory.LSeries.HurwitzZetaValues +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Basic +public import Mathlib.NumberTheory.TsumDivsorsAntidiagonal /-! -# Einstein series q-expansions +# Eisenstein series q-expansions + +We give the q-expansion of Eisenstein series of weight `k` and level 1. In particular, we prove +`EisensteinSeries.q_expansion_bernoulli` which says that for even `k` with `3 ≤ k` +Eisenstein series can we written as `1 - (2k / bernoulli k) ∑' n, σ_{k-1}(n) q^n` where +`q = exp(2πiz)` and `σ_{k-1}(n)` is the sum of the `(k-1)`-th powers of the divisors of `n`. +We need `k` to be even so that the Eisenstein series are non-zero and we require `k ≥ 3` so that +the series converges absolutely. -We give some identities for q-expansions of Eisenstein series that will be used in describing their -q-expansions. +The proof relies on the identity +`∑' n : ℤ, 1 / (z + n) ^ (k + 1) = ((-2πi)^(k+1) / k!) ∑' n : ℕ, n^k q^n` which comes from +differentiating the expansion of `π cot(πz)` in terms of exponentials. Since our Eisenstein series +are defined as sums over coprime integer pairs, we also need to relate these to sums over all pairs +of integers, which is done in `tsum_eisSummand_eq_riemannZeta_mul_eisensteinSeries`. This then +gives the q-expansion with a Riemann zeta factor, which we simplify using the formula for +`ζ(k)` in terms of Bernoulli numbers to get the final result. -/ -open Set Metric TopologicalSpace Function Filter Complex EisensteinSeries +@[expose] public section -open _root_.UpperHalfPlane hiding I +open Set Metric TopologicalSpace Function Filter Complex ArithmeticFunction + ModularForm EisensteinSeries -open scoped Topology Real Nat Complex Pointwise +open scoped Topology Real Nat Complex Pointwise ArithmeticFunction.sigma + +open _root_.UpperHalfPlane hiding I local notation "ℍₒ" => upperHalfPlaneSet @@ -181,3 +202,96 @@ theorem EisensteinSeries.qExpansion_identity_pnat {k : ℕ} (hk : 1 ≤ k) (z : · simp [show k ≠ 0 by grind] · apply (summable_pow_mul_cexp k 1 z).congr simp + +lemma summable_eisSummand {k : ℕ} (hk : 3 ≤ k) (z : ℍ) : + Summable (eisSummand k · z) := + summable_norm_iff.mp <| summable_norm_eisSummand (Int.toNat_le.mp hk) z + +lemma summable_prod_eisSummand {k : ℕ} (hk : 3 ≤ k) (z : ℍ) : + Summable fun x : ℤ × ℤ ↦ eisSummand k ![x.1, x.2] z := by + refine (finTwoArrowEquiv ℤ).summable_iff.mp <| (summable_eisSummand hk z).congr (fun v ↦ ?_) + simp [show ![v 0, v 1] = v from List.ofFn_inj.mp rfl] + +lemma tsum_eisSummand_eq_tsum_sigma_mul_cexp_pow {k : ℕ} (hk : 3 ≤ k) (hk2 : Even k) (z : ℍ) : + ∑' v, eisSummand k v z = 2 * riemannZeta k + 2 * ((-2 * π * I) ^ k / (k - 1)!) * + ∑' (n : ℕ+), σ (k - 1) n * cexp (2 * π * I * z) ^ (n : ℕ) := by + rw [← (finTwoArrowEquiv ℤ).symm.tsum_eq, finTwoArrowEquiv_symm_apply, + Summable.tsum_prod (summable_prod_eisSummand hk z), + tsum_int_eq_zero_add_two_mul_tsum_pnat (fun n ↦ ?h₁) + (by simpa using (summable_prod_eisSummand hk z).prod)] + case h₁ => + nth_rewrite 1 [← tsum_comp_neg] + exact tsum_congr fun y ↦ by simp [eisSummand, ← neg_add _ (y : ℂ), -neg_add_rev, hk2.neg_pow] + have H (b : ℕ+) := qExpansion_identity_pnat (k := k - 1) (by grind) ⟨b * z, by simpa using z.2⟩ + simp_rw [show k - 1 + 1 = k by grind, one_div] at H + simp only [coe_mk_subtype, neg_mul] at H + rw [nsmul_eq_mul, mul_assoc] + congr + · simp [eisSummand, two_mul_riemannZeta_eq_tsum_int_inv_pow_of_even (by grind) hk2] + · suffices ∑' (m : ℕ+) (n : ℕ+), (n : ℕ) ^ (k - 1) * cexp (2 * π * I * (m * z)) ^ (n : ℕ) = + ∑' (m : ℕ+) (n : ℕ+), (n : ℕ) ^ (k - 1) * cexp (2 * π * I * z) ^ (m * n : ℕ) by + simp [eisSummand, H, tsum_mul_left, + ← tsum_prod_pow_eq_tsum_sigma (k - 1) (norm_exp_two_pi_I_lt_one z), this] + simp_rw [← Complex.exp_nat_mul] + exact tsum_congr₂ (fun m n ↦ by push_cast; ring_nf) + +lemma eisSummand_of_gammaSet_eq_divIntMap (k : ℤ) (z : ℍ) {n : ℕ} (v : gammaSet 1 n 0) : + eisSummand k v z = ((n : ℂ) ^ k)⁻¹ * eisSummand k (divIntMap n v) z := by + simp_rw [eisSummand] + nth_rw 1 2 [gammaSet_eq_gcd_mul_divIntMap v.2] + simp [← mul_inv, ← mul_zpow, mul_add, mul_assoc] + +lemma tsum_eisSummand_eq_riemannZeta_mul_eisensteinSeries {k : ℕ} (hk : 3 ≤ k) (z : ℍ) : + ∑' v : Fin 2 → ℤ, eisSummand k v z = riemannZeta k * eisensteinSeries (N := 1) 0 k z := by + have hk1 : 1 < k := by grind + have hk2 : 3 ≤ (k : ℤ) := mod_cast hk + simp_rw [← gammaSetDivGcdSigmaEquiv.symm.tsum_eq, gammaSetDivGcdSigmaEquiv_symm_eq] + rw [eisensteinSeries, Summable.tsum_sigma ?hsumm, zeta_nat_eq_tsum_of_gt_one hk1, + tsum_mul_tsum_of_summable_norm (by simp [hk1]) ((summable_norm_eisSummand hk2 z).subtype _)] + case hsumm => + exact gammaSetDivGcdSigmaEquiv.symm.summable_iff.mpr (summable_norm_eisSummand hk2 z).of_norm + |>.congr <| by simp + simp_rw [one_div] + rw [Summable.tsum_prod' ?h₁ fun b ↦ ?h₂] + case h₁ => + exact summable_mul_of_summable_norm (f := fun (n : ℕ) ↦ ((n : ℂ) ^ k)⁻¹) + (g := fun (v : gammaSet 1 1 0) ↦ eisSummand k v z) (by simp [hk1]) + ((summable_norm_eisSummand hk2 z).subtype _) + case h₂ => + simpa using ((summable_norm_eisSummand hk2 z).subtype _).of_norm.mul_left (a := ((b : ℂ) ^ k)⁻¹) + refine tsum_congr fun b ↦ ?_ + rcases eq_or_ne b 0 with rfl | hb + · simp [show ((0 : ℂ) ^ k)⁻¹ = 0 by aesop, eisSummand_of_gammaSet_eq_divIntMap] + · have : NeZero b := ⟨hb⟩ + simpa [eisSummand_of_gammaSet_eq_divIntMap k z, tsum_mul_left, hb] + using (gammaSetDivGcdEquiv b).tsum_eq (eisSummand k · z) + +/-- The q-Expansion of normalised Eisenstein series of level one with `riemannZeta` term. -/ +lemma EisensteinSeries.q_expansion_riemannZeta {k : ℕ} (hk : 3 ≤ k) (hk2 : Even k) (z : ℍ) : + E hk z = 1 + (riemannZeta k)⁻¹ * (-2 * π * I) ^ k / (k - 1)! * + ∑' n : ℕ+, σ (k - 1) n * cexp (2 * π * I * z) ^ (n : ℤ) := by + have : eisensteinSeries_MF (Int.toNat_le.mp hk) 0 z = eisensteinSeries_SIF (N := 1) 0 k z := rfl + rw [E, ModularForm.IsGLPos.smul_apply, this, eisensteinSeries_SIF_apply 0 k z, eisensteinSeries] + have HE1 := tsum_eisSummand_eq_tsum_sigma_mul_cexp_pow hk hk2 z + have HE2 := tsum_eisSummand_eq_riemannZeta_mul_eisensteinSeries hk z + have z2 : riemannZeta k ≠ 0 := riemannZeta_ne_zero_of_one_lt_re <| by norm_cast; grind + simp [eisSummand, eisensteinSeries, ← inv_mul_eq_iff_eq_mul₀ z2] at HE1 HE2 ⊢ + grind + +private lemma eisensteinSeries_coeff_identity {k : ℕ} (hk2 : Even k) (hkn0 : k ≠ 0) : + (riemannZeta k)⁻¹ * (-2 * π * I) ^ k / (k - 1)! = -(2 * k / bernoulli k) := by + have h2 : k = 2 * (k / 2 - 1 + 1) := by grind + set m := k / 2 - 1 + rw [h2, Nat.cast_mul 2 (m + 1), Nat.cast_two, riemannZeta_two_mul_nat (show m + 1 ≠ 0 by grind), + show (2 * (m + 1))! = 2 * (m + 1) * (2 * m + 1)! by grind [Nat.factorial_succ], + show 2 * (m + 1) - 1 = 2 * m + 1 by grind, mul_pow, mul_pow, pow_mul I, I_sq] + norm_cast + simp [field] + grind + +/-- The q-Expansion of normalised Eisenstein series of level one with `bernoulli` term. -/ +lemma EisensteinSeries.q_expansion_bernoulli {k : ℕ} (hk : 3 ≤ k) (hk2 : Even k) (z : ℍ) : + E hk z = 1 - (2 * k / bernoulli k) * + ∑' n : ℕ+, σ (k - 1) n * cexp (2 * π * I * z) ^ (n : ℤ) := by + convert q_expansion_riemannZeta hk hk2 z using 1 + rw [eisensteinSeries_coeff_identity hk2 (by grind), neg_mul, ← sub_eq_add_neg] diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Summable.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Summable.lean index bcba8c49a96ece..1a76f8f8c82c44 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Summable.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/Summable.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.Analysis.Complex.UpperHalfPlane.Topology -import Mathlib.Analysis.PSeries -import Mathlib.Order.Interval.Finset.Box -import Mathlib.Analysis.Asymptotics.Defs +public import Mathlib.Analysis.Complex.UpperHalfPlane.Topology +public import Mathlib.Analysis.PSeries +public import Mathlib.Order.Interval.Finset.Box +public import Mathlib.Analysis.Asymptotics.Defs /-! # Summability of Eisenstein series @@ -16,6 +17,8 @@ We gather results about the summability of Eisenstein series, particularly the summability of the Eisenstein series summands, which are used in the proof of the boundedness of Eisenstein series at infinity. -/ + +@[expose] public section noncomputable section open Complex UpperHalfPlane Set Finset Topology Filter Asymptotics diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/UniformConvergence.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/UniformConvergence.lean index 2a856c46559050..2d8326f2af9128 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/UniformConvergence.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/UniformConvergence.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ +module -import Mathlib.Analysis.Normed.Group.FunctionSeries -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs -import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable +public import Mathlib.Analysis.Normed.Group.FunctionSeries +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs +public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable /-! # Uniform convergence of Eisenstein series @@ -25,6 +26,8 @@ We then show in `summable_one_div_rpow_max` that the sum of `max (|c|, |d|) ^ (- `Finset.box` lemmas. -/ +@[expose] public section + noncomputable section open Complex UpperHalfPlane Set Finset CongruenceSubgroup Topology diff --git a/Mathlib/NumberTheory/ModularForms/Identities.lean b/Mathlib/NumberTheory/ModularForms/Identities.lean index 43c271272b55d6..d06dc4feac712b 100644 --- a/Mathlib/NumberTheory/ModularForms/Identities.lean +++ b/Mathlib/NumberTheory/ModularForms/Identities.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ +module -import Mathlib.NumberTheory.ModularForms.SlashInvariantForms -import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups +public import Mathlib.NumberTheory.ModularForms.SlashInvariantForms +public import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups /-! # Identities of ModularForms and SlashInvariantForms @@ -13,6 +14,8 @@ import Mathlib.NumberTheory.ModularForms.CongruenceSubgroups Collection of useful identities of modular forms. -/ +@[expose] public section + noncomputable section open ModularForm UpperHalfPlane Matrix CongruenceSubgroup Matrix.SpecialLinearGroup diff --git a/Mathlib/NumberTheory/ModularForms/JacobiTheta/Bounds.lean b/Mathlib/NumberTheory/ModularForms/JacobiTheta/Bounds.lean index fec23dbbbbeff9..eae82df34782b2 100644 --- a/Mathlib/NumberTheory/ModularForms/JacobiTheta/Bounds.lean +++ b/Mathlib/NumberTheory/ModularForms/JacobiTheta/Bounds.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable /-! # Asymptotic bounds for Jacobi theta functions @@ -34,6 +35,8 @@ hence Dirichlet L-functions, etc). `∞`. -/ +@[expose] public section + open Set Filter Topology Asymptotics Real noncomputable section diff --git a/Mathlib/NumberTheory/ModularForms/JacobiTheta/Manifold.lean b/Mathlib/NumberTheory/ModularForms/JacobiTheta/Manifold.lean index be0610ef074c3b..e6e0084c1a41e3 100644 --- a/Mathlib/NumberTheory/ModularForms/JacobiTheta/Manifold.lean +++ b/Mathlib/NumberTheory/ModularForms/JacobiTheta/Manifold.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold -import Mathlib.Geometry.Manifold.MFDeriv.FDeriv -import Mathlib.NumberTheory.ModularForms.JacobiTheta.OneVariable +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold +public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.OneVariable /-! # Manifold differentiability of the Jacobi theta function @@ -18,6 +20,8 @@ differentiability. Prove smoothness (in terms of `Smooth`). -/ +@[expose] public section + open scoped UpperHalfPlane Manifold diff --git a/Mathlib/NumberTheory/ModularForms/JacobiTheta/OneVariable.lean b/Mathlib/NumberTheory/ModularForms/JacobiTheta/OneVariable.lean index 8b97109d242791..2bb1a3631362ac 100644 --- a/Mathlib/NumberTheory/ModularForms/JacobiTheta/OneVariable.lean +++ b/Mathlib/NumberTheory/ModularForms/JacobiTheta/OneVariable.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable -import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction +module + +public import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable +public import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction /-! # Jacobi's theta function @@ -17,6 +19,8 @@ and proves the modular transformation properties `θ (τ + 2) = θ τ` and show that `θ` is differentiable on `ℍ`, and `θ(τ) - 1` has exponential decay as `im τ → ∞`. -/ +@[expose] public section + open Complex Real Asymptotics Filter Topology open scoped Real UpperHalfPlane diff --git a/Mathlib/NumberTheory/ModularForms/JacobiTheta/TwoVariable.lean b/Mathlib/NumberTheory/ModularForms/JacobiTheta/TwoVariable.lean index 2e199ac931aaaa..5eb121609fff6b 100644 --- a/Mathlib/NumberTheory/ModularForms/JacobiTheta/TwoVariable.lean +++ b/Mathlib/NumberTheory/ModularForms/JacobiTheta/TwoVariable.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Calculus.SmoothSeries -import Mathlib.Analysis.Normed.Operator.Prod -import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation -import Mathlib.LinearAlgebra.Complex.FiniteDimensional +module + +public import Mathlib.Analysis.Calculus.SmoothSeries +public import Mathlib.Analysis.Normed.Operator.Prod +public import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation +public import Mathlib.LinearAlgebra.Complex.FiniteDimensional /-! # The two-variable Jacobi theta function @@ -26,6 +28,8 @@ $$\theta'(z, τ) = \sum_{n \in \mathbb{Z}} 2 \pi i n \exp (2 i \pi n z + i \pi n of even Dirichlet characters, and that of `θ'` will do the same for odd Dirichlet characters.) -/ +@[expose] public section + open Complex Real Asymptotics Filter Topology open scoped ComplexConjugate diff --git a/Mathlib/NumberTheory/ModularForms/LevelOne.lean b/Mathlib/NumberTheory/ModularForms/LevelOne.lean index 14c9c9b959b063..c40b5aa227c92d 100644 --- a/Mathlib/NumberTheory/ModularForms/LevelOne.lean +++ b/Mathlib/NumberTheory/ModularForms/LevelOne.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Complex.AbsMax -import Mathlib.NumberTheory.Modular -import Mathlib.NumberTheory.ModularForms.QExpansion +module + +public import Mathlib.Analysis.Complex.AbsMax +public import Mathlib.NumberTheory.Modular +public import Mathlib.NumberTheory.ModularForms.QExpansion /-! # Level one modular forms @@ -16,6 +18,8 @@ TODO: Add finite-dimensionality of these spaces of modular forms. -/ +@[expose] public section + open UpperHalfPlane ModularGroup SlashInvariantForm ModularForm Complex CongruenceSubgroup Real Function SlashInvariantFormClass ModularFormClass Periodic diff --git a/Mathlib/NumberTheory/ModularForms/Petersson.lean b/Mathlib/NumberTheory/ModularForms/Petersson.lean index 74ecda7d7c5861..2daf8b0214f256 100644 --- a/Mathlib/NumberTheory/ModularForms/Petersson.lean +++ b/Mathlib/NumberTheory/ModularForms/Petersson.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ +module -import Mathlib.Analysis.Complex.UpperHalfPlane.Topology -import Mathlib.NumberTheory.ModularForms.SlashInvariantForms +public import Mathlib.Analysis.Complex.UpperHalfPlane.Topology +public import Mathlib.NumberTheory.ModularForms.SlashInvariantForms /-! # The Petersson scalar product @@ -17,6 +18,8 @@ We show this function is (weight 0) invariant under `Γ` if `f, f'` are (weight `Γ`. -/ +@[expose] public section + open UpperHalfPlane diff --git a/Mathlib/NumberTheory/ModularForms/QExpansion.lean b/Mathlib/NumberTheory/ModularForms/QExpansion.lean index 4c0aee338d8642..4c84ffc282a57a 100644 --- a/Mathlib/NumberTheory/ModularForms/QExpansion.lean +++ b/Mathlib/NumberTheory/ModularForms/QExpansion.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.Analysis.Complex.TaylorSeries -import Mathlib.Analysis.Complex.UpperHalfPlane.Exp -import Mathlib.NumberTheory.ModularForms.Basic -import Mathlib.NumberTheory.ModularForms.Identities -import Mathlib.RingTheory.PowerSeries.Basic +module + +public import Mathlib.Analysis.Complex.TaylorSeries +public import Mathlib.Analysis.Complex.UpperHalfPlane.Exp +public import Mathlib.NumberTheory.ModularForms.Basic +public import Mathlib.NumberTheory.ModularForms.Identities +public import Mathlib.RingTheory.PowerSeries.Basic /-! # q-expansions of modular forms @@ -37,6 +39,8 @@ We also define the `q`-expansion of a modular form, either as a power series or the graded ring of all modular forms?) -/ +@[expose] public section + open ModularForm Complex Filter UpperHalfPlane Function Matrix.SpecialLinearGroup open scoped Real MatrixGroups CongruenceSubgroup diff --git a/Mathlib/NumberTheory/ModularForms/SlashActions.lean b/Mathlib/NumberTheory/ModularForms/SlashActions.lean index cc91cdd8007633..0738bc5654711a 100644 --- a/Mathlib/NumberTheory/ModularForms/SlashActions.lean +++ b/Mathlib/NumberTheory/ModularForms/SlashActions.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction -import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs -import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Analysis.Complex.UpperHalfPlane.MoebiusAction +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup +public import Mathlib.Tactic.AdaptationNote /-! # Slash actions @@ -22,6 +24,8 @@ Scoped in the `ModularForm` namespace, this file defines * `f ∣[k] A`: the `k`th slash action by `A` on `f` -/ +@[expose] public section + open Complex UpperHalfPlane ModularGroup diff --git a/Mathlib/NumberTheory/ModularForms/SlashInvariantForms.lean b/Mathlib/NumberTheory/ModularForms/SlashInvariantForms.lean index c10bbc14682573..0e0eddb6771253 100644 --- a/Mathlib/NumberTheory/ModularForms/SlashInvariantForms.lean +++ b/Mathlib/NumberTheory/ModularForms/SlashInvariantForms.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups -import Mathlib.NumberTheory.ModularForms.SlashActions +module + +public import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups +public import Mathlib.NumberTheory.ModularForms.SlashActions /-! # Slash invariant forms @@ -14,6 +16,8 @@ defining `ModularForm` and `CuspForm`. We prove several instances for such space that they form a module over `ℝ`, and over `ℂ` if the group is contained in `SL(2, ℝ)`. -/ +@[expose] public section + open Complex UpperHalfPlane ModularForm open scoped MatrixGroups diff --git a/Mathlib/NumberTheory/MulChar/Basic.lean b/Mathlib/NumberTheory/MulChar/Basic.lean index 2bb0de42e0f8c1..d0e68daee43288 100644 --- a/Mathlib/NumberTheory/MulChar/Basic.lean +++ b/Mathlib/NumberTheory/MulChar/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.CharP.Basic -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.Algebra.Ring.Regular -import Mathlib.Data.Fintype.Units -import Mathlib.GroupTheory.OrderOfElement +module + +public import Mathlib.Algebra.CharP.Basic +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.Data.Fintype.Units +public import Mathlib.GroupTheory.OrderOfElement /-! # Multiplicative characters of finite rings and fields @@ -36,6 +38,8 @@ character vanishes; see `MulChar.IsNontrivial.sum_eq_zero`. multiplicative character -/ +@[expose] public section + /-! ### Definitions related to multiplicative characters diff --git a/Mathlib/NumberTheory/MulChar/Duality.lean b/Mathlib/NumberTheory/MulChar/Duality.lean index 139ab3c59e0ff5..a9987eae2d7da8 100644 --- a/Mathlib/NumberTheory/MulChar/Duality.lean +++ b/Mathlib/NumberTheory/MulChar/Duality.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.GroupTheory.FiniteAbelian.Duality -import Mathlib.NumberTheory.MulChar.Basic +module + +public import Mathlib.GroupTheory.FiniteAbelian.Duality +public import Mathlib.NumberTheory.MulChar.Basic /-! # Duality for multiplicative characters @@ -19,6 +21,8 @@ where `n` is the exponent of `M`. Then the main results of this file are as foll (noncanonically) isomorphic to `Mˣ`. -/ +@[expose] public section + namespace MulChar variable {M R : Type*} [CommMonoid M] [CommRing R] diff --git a/Mathlib/NumberTheory/MulChar/Lemmas.lean b/Mathlib/NumberTheory/MulChar/Lemmas.lean index 29aeb72b5a59df..64d2c7be0c768b 100644 --- a/Mathlib/NumberTheory/MulChar/Lemmas.lean +++ b/Mathlib/NumberTheory/MulChar/Lemmas.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.NumberTheory.MulChar.Basic -import Mathlib.RingTheory.RootsOfUnity.Complex +module + +public import Mathlib.NumberTheory.MulChar.Basic +public import Mathlib.RingTheory.RootsOfUnity.Complex /-! # Further Results on multiplicative characters -/ +@[expose] public section + namespace MulChar /-- Two multiplicative characters on a monoid whose unit group is generated by `g` diff --git a/Mathlib/NumberTheory/Multiplicity.lean b/Mathlib/NumberTheory/Multiplicity.lean index 86c9e9a3fb01ec..fbc034fefeea2d 100644 --- a/Mathlib/NumberTheory/Multiplicity.lean +++ b/Mathlib/NumberTheory/Multiplicity.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Tian Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tian Chen, Mantas Bakšys -/ -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.Algebra.Ring.Int.Parity -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Data.Nat.Prime.Int -import Mathlib.NumberTheory.Padics.PadicVal.Defs -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.Algebra.Ring.Int.Parity +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.NumberTheory.Padics.PadicVal.Defs +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Ideal.Span /-! # Multiplicity in Number Theory @@ -28,6 +30,8 @@ This file contains results in number theory relating to multiplicity. (https://en.wikipedia.org/wiki/Lifting-the-exponent_lemma) -/ +@[expose] public section + open Ideal Ideal.Quotient Finset diff --git a/Mathlib/NumberTheory/Niven.lean b/Mathlib/NumberTheory/Niven.lean index 4dc80469566606..2cb73e275a64cd 100644 --- a/Mathlib/NumberTheory/Niven.lean +++ b/Mathlib/NumberTheory/Niven.lean @@ -1,12 +1,15 @@ /- Copyright (c) 2025 Alex Meiburg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Alex Meiburg +Authors: Alex Meiburg, Snir Broshi -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Log -import Mathlib.RingTheory.Polynomial.RationalRoot -import Mathlib.Tactic.Peel -import Mathlib.Tactic.Rify +module + +public import Mathlib.Analysis.Complex.IsIntegral +public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +public import Mathlib.RingTheory.Polynomial.RationalRoot +public import Mathlib.Tactic.Peel +public import Mathlib.Tactic.Rify /-! # Niven's Theorem @@ -16,6 +19,8 @@ by π. Equivalently, the only rational numbers that occur as `cos(π * p / q)` a values `{-1, -1/2, 0, 1/2, 1}`. -/ +@[expose] public section + namespace IsIntegral variable {α R : Type*} [DivisionRing α] [CharZero α] {q : ℚ} {x : α} @@ -37,24 +42,82 @@ variable {θ : ℝ} open Real -theorem isIntegral_two_mul_cos_rat_mul_pi (r : ℚ) : - IsIntegral ℤ (2 * cos (r * π)) := by - let z : ℂ := .exp (.I * r * π) - obtain ⟨p, q, hq_pos, rfl⟩ : ∃ (p : ℤ) (q : ℕ), q ≠ 0 ∧ r = p / q := - ⟨r.num, r.den, r.den_ne_zero, r.num_div_den.symm⟩ - -- Let `z = e ^ (i * π * p / q)`, which is a root of unity. - have hz_root : z ^ (2 * q) = 1 := by - rw [← Complex.exp_nat_mul, Complex.exp_eq_one_iff] - use p - push_cast - field [hq_pos] - -- Since z is a root of unity, `2 cos θ = z` and `z⁻¹` are algebraic integers, and their sum. - have h_cos_eq : 2 * cos (p / q * π) = z + z⁻¹ := by - simpa [Complex.cos, Complex.exp_neg, z] using by ring_nf - obtain ⟨f, hf₁, hf₂⟩ : IsIntegral ℤ (z + z⁻¹) := by apply IsIntegral.add <;> - exact ⟨.X ^ (2 * q) - 1, Polynomial.monic_X_pow_sub_C _ (by positivity), by simp [hz_root]⟩ - use f, hf₁ - simp_all [Polynomial.eval₂_eq_sum_range, ← Complex.ofReal_inj] +section IsIntegral + +namespace Complex + +lemma exp_rat_mul_pi_mul_I_pow_two_mul_den (q : ℚ) : exp (q * π * I) ^ (2 * q.den) = 1 := by + nth_rw 1 [← q.num_div_den, ← exp_nat_mul] + push_cast + rw [show 2 * q.den * (q.num / q.den * π * I) = q.num * (2 * π * I) by field, + exp_int_mul_two_pi_mul_I] + +/-- `exp(q * π * I)` for `q : ℚ` is integral over `ℤ`. -/ +theorem isIntegral_exp_rat_mul_pi_mul_I (q : ℚ) : IsIntegral ℤ <| exp <| q * π * I := by + refine .of_pow (Nat.mul_pos zero_lt_two q.den_pos) ?_ + exact exp_rat_mul_pi_mul_I_pow_two_mul_den _ ▸ isIntegral_one + +/-- `exp(-(q * π) * I)` for `q : ℚ` is integral over `ℤ`. -/ +theorem isIntegral_exp_neg_rat_mul_pi_mul_I (q : ℚ) : + IsIntegral ℤ <| exp <| -(q * π) * I := by + simpa using isIntegral_exp_rat_mul_pi_mul_I (-q) + +/-- `2 sin(q * π)` for `q : ℚ` is integral over `ℤ`, using the complex `sin` function. -/ +theorem isIntegral_two_mul_sin_rat_mul_pi (q : ℚ) : IsIntegral ℤ <| 2 * sin (q * π) := by + rw [sin.eq_1, mul_div_cancel₀ _ two_ne_zero] + exact (isIntegral_exp_neg_rat_mul_pi_mul_I q).sub (isIntegral_exp_rat_mul_pi_mul_I q) + |>.mul isIntegral_int_I + +/-- `2 cos(q * π)` for `q : ℚ` is integral over `ℤ`, using the complex `cos` function. -/ +theorem isIntegral_two_mul_cos_rat_mul_pi (q : ℚ) : IsIntegral ℤ <| 2 * cos (q * π) := by + rw [cos.eq_1, mul_div_cancel₀ _ two_ne_zero] + exact (isIntegral_exp_rat_mul_pi_mul_I q).add (isIntegral_exp_neg_rat_mul_pi_mul_I q) + +/-- `sin(q * π)` for `q : ℚ` is algebraic over `ℤ`, using the complex `sin` function. -/ +theorem isAlgebraic_sin_rat_mul_pi (q : ℚ) : IsAlgebraic ℤ <| sin <| q * π := + .of_mul (by simp) (isAlgebraic_algebraMap _) (isIntegral_two_mul_sin_rat_mul_pi q).isAlgebraic + +/-- `cos(q * π)` for `q : ℚ` is algebraic over `ℤ`, using the complex `cos` function. -/ +theorem isAlgebraic_cos_rat_mul_pi (q : ℚ) : IsAlgebraic ℤ <| cos <| q * π := + .of_mul (by simp) (isAlgebraic_algebraMap _) (isIntegral_two_mul_cos_rat_mul_pi q).isAlgebraic + +/-- `tan(q * π)` for `q : ℚ` is algebraic over `ℤ`, using the complex `tan` function. -/ +theorem isAlgebraic_tan_rat_mul_pi (q : ℚ) : IsAlgebraic ℤ <| tan <| q * π := + (isAlgebraic_sin_rat_mul_pi q).mul (isAlgebraic_cos_rat_mul_pi q).inv + +end Complex + +namespace Real + +/-- `2 sin(q * π)` for `q : ℚ` is integral over `ℤ`, using the real `sin` function. -/ +theorem isIntegral_two_mul_sin_rat_mul_pi (q : ℚ) : IsIntegral ℤ <| 2 * sin (q * π) := + isIntegral_algebraMap_iff (B := ℂ) RCLike.ofReal_injective |>.mp <| by + simp [Complex.isIntegral_two_mul_sin_rat_mul_pi] + +/-- `2 cos(q * π)` for `q : ℚ` is integral over `ℤ`, using the real `cos` function. -/ +theorem isIntegral_two_mul_cos_rat_mul_pi (q : ℚ) : IsIntegral ℤ <| 2 * cos (q * π) := + isIntegral_algebraMap_iff (B := ℂ) RCLike.ofReal_injective |>.mp <| by + simp [Complex.isIntegral_two_mul_cos_rat_mul_pi] + +@[deprecated (since := "2025-11-15")] +alias _root_.isIntegral_two_mul_cos_rat_mul_pi := isIntegral_two_mul_cos_rat_mul_pi + +/-- `sin(q * π)` for `q : ℚ` is algebraic over `ℤ`, using the real `sin` function. -/ +theorem isAlgebraic_sin_rat_mul_pi (q : ℚ) : IsAlgebraic ℤ <| sin <| q * π := + .of_mul (by simp) (isAlgebraic_algebraMap _) (isIntegral_two_mul_sin_rat_mul_pi q).isAlgebraic + +/-- `cos(q * π)` for `q : ℚ` is algebraic over `ℤ`, using the real `cos` function. -/ +theorem isAlgebraic_cos_rat_mul_pi (q : ℚ) : IsAlgebraic ℤ <| cos <| q * π := + .of_mul (by simp) (isAlgebraic_algebraMap _) (isIntegral_two_mul_cos_rat_mul_pi q).isAlgebraic + +/-- `tan(q * π)` for `q : ℚ` is algebraic over `ℤ`, using the real `tan` function. -/ +theorem isAlgebraic_tan_rat_mul_pi (q : ℚ) : IsAlgebraic ℤ <| tan <| q * π := + isAlgebraic_algebraMap_iff (A := ℂ) RCLike.ofReal_injective |>.mp <| by + simp [Complex.isAlgebraic_tan_rat_mul_pi] + +end Real + +end IsIntegral /-- **Niven's theorem**: The only rational values of `cos` that occur at rational multiples of π are `{-1, -1/2, 0, 1/2, 1}`. -/ @@ -64,7 +127,7 @@ theorem niven (hθ : ∃ r : ℚ, θ = r * π) (hcos : ∃ q : ℚ, cos θ = q) -- Hence, `2 cos θ ∈ {-2, -1, 0, 1, 2}`. obtain ⟨r, rfl⟩ := hθ obtain ⟨k, hk⟩ : ∃ k : ℤ, 2 * cos (r * π) = k := by - rw [← (isIntegral_two_mul_cos_rat_mul_pi r).exists_int_iff_exists_rat] + rw [← (Real.isIntegral_two_mul_cos_rat_mul_pi r).exists_int_iff_exists_rat] exact ⟨2 * hcos.choose, by push_cast; linarith [hcos.choose_spec]⟩ -- Since k is an integer and `2 * cos (w * pi) = k`, we have $k ∈ {-2, -1, 0, 1, 2}$. have hk_values : k ∈ Finset.Icc (-2 : ℤ) 2 := by diff --git a/Mathlib/NumberTheory/NumberField/AdeleRing.lean b/Mathlib/NumberTheory/NumberField/AdeleRing.lean index f1fdfe72ead8d3..a0f7aea5dd66c7 100644 --- a/Mathlib/NumberTheory/NumberField/AdeleRing.lean +++ b/Mathlib/NumberTheory/NumberField/AdeleRing.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Salvatore Mercuri, María Inés de Frutos-Fernández. All rig Released under Apache 2.0 license as described in the file LICENSE. Authors: Salvatore Mercuri, María Inés de Frutos-Fernández -/ -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic -import Mathlib.NumberTheory.NumberField.InfinitePlace.Completion -import Mathlib.RingTheory.DedekindDomain.FiniteAdeleRing +module + +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Completion +public import Mathlib.RingTheory.DedekindDomain.FiniteAdeleRing /-! # The adele ring of a number field @@ -34,6 +36,8 @@ direct product of the infinite adele ring and the finite adele ring. infinite adele ring, adele ring, number field -/ +@[expose] public section + noncomputable section namespace NumberField diff --git a/Mathlib/NumberTheory/NumberField/Basic.lean b/Mathlib/NumberTheory/NumberField/Basic.lean index 7126b2c6f18e21..eadc96bf9dd8c0 100644 --- a/Mathlib/NumberTheory/NumberField/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Ashvni Narayanan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ashvni Narayanan, Anne Baanen -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Algebra.CharZero.AddMonoidHom -import Mathlib.Algebra.Ring.Int.Parity -import Mathlib.Algebra.Ring.Int.Units -import Mathlib.RingTheory.DedekindDomain.IntegralClosure +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.CharZero.AddMonoidHom +public import Mathlib.Algebra.Ring.Int.Parity +public import Mathlib.Algebra.Ring.Int.Units +public import Mathlib.RingTheory.DedekindDomain.IntegralClosure /-! # Number fields @@ -32,6 +34,8 @@ but are independent of that choice. number field, ring of integers -/ +@[expose] public section + /-- A number field is a field which has characteristic zero and is finite dimensional over ℚ. -/ @@ -419,11 +423,15 @@ noncomputable def ringOfIntegersEquiv : 𝓞 ℚ ≃+* ℤ := RingOfIntegers.equiv ℤ @[simp] -theorem coe_ringOfIntegersEquiv (z : 𝓞 ℚ) : +theorem ringOfIntegersEquiv_apply_coe (z : 𝓞 ℚ) : (Rat.ringOfIntegersEquiv z : ℚ) = algebraMap (𝓞 ℚ) ℚ z := by obtain ⟨z, rfl⟩ := Rat.ringOfIntegersEquiv.symm.surjective z simp +theorem ringOfIntegersEquiv_symm_apply_coe (x : ℤ) : + (ringOfIntegersEquiv.symm x : ℚ) = ↑x := + eq_intCast ringOfIntegersEquiv.symm _ ▸ rfl + end Rat namespace AdjoinRoot diff --git a/Mathlib/NumberTheory/NumberField/CMField.lean b/Mathlib/NumberTheory/NumberField/CMField.lean index 3c296f5e6e594b..f7f5293f130f76 100644 --- a/Mathlib/NumberTheory/NumberField/CMField.lean +++ b/Mathlib/NumberTheory/NumberField/CMField.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 X. Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex -import Mathlib.NumberTheory.NumberField.Units.Regulator -import Mathlib.RingTheory.RootsOfUnity.Complex +module + +public import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex +public import Mathlib.NumberTheory.NumberField.Units.Regulator +public import Mathlib.RingTheory.RootsOfUnity.Complex /-! # CM-extension of number fields @@ -48,6 +50,8 @@ results for the general case can be deduced for the CM case by using the isomorp -/ +@[expose] public section + open NumberField ComplexEmbedding InfinitePlace Algebra open scoped ComplexConjugate diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean index f5ddb712d515c2..00f9ed1b5f3c8d 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.Module.ZLattice.Basic -import Mathlib.Analysis.InnerProductSpace.ProdL2 -import Mathlib.MeasureTheory.Measure.Haar.Unique -import Mathlib.NumberTheory.NumberField.FractionalIdeal -import Mathlib.NumberTheory.NumberField.Units.Basic +module + +public import Mathlib.Algebra.Module.ZLattice.Basic +public import Mathlib.Analysis.InnerProductSpace.ProdL2 +public import Mathlib.MeasureTheory.Measure.Haar.Unique +public import Mathlib.NumberTheory.NumberField.FractionalIdeal +public import Mathlib.NumberTheory.NumberField.Units.Basic /-! # Canonical embedding of a number field @@ -37,6 +39,8 @@ into the type `(K →+* ℂ) → ℂ` of `ℂ`-vectors indexed by the complex em number field, infinite places -/ +@[expose] public section + open Module variable (K : Type*) [Field K] diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean index b85dcea350b1da..44b9979fcfb2c8 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.MeasureTheory.Group.GeometryOfNumbers -import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup +module + +public import Mathlib.MeasureTheory.Group.GeometryOfNumbers +public import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic +public import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup /-! # Convex Bodies @@ -37,6 +39,8 @@ associated to a number field of signature `K` and proves several existence theor number field, infinite places -/ +@[expose] public section + variable (K : Type*) [Field K] namespace NumberField.mixedEmbedding diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean index d58c5cfd8aa13a..dd9de161bea063 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.RingTheory.Ideal.IsPrincipal -import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem -import Mathlib.RingTheory.ClassGroup +module + +public import Mathlib.RingTheory.Ideal.IsPrincipal +public import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem +public import Mathlib.RingTheory.ClassGroup /-! # Fundamental Cone @@ -37,6 +39,8 @@ mixed space that is a fundamental domain for the action of `(𝓞 K)ˣ` modulo t number field, canonical embedding, units, principal ideals -/ +@[expose] public section + variable (K : Type*) [Field K] namespace NumberField.mixedEmbedding @@ -121,11 +125,13 @@ theorem logMap_mul (hx : mixedEmbedding.norm x ≠ 0) (hy : mixedEmbedding.norm · exact mixedEmbedding.norm_ne_zero_iff.mp hx w · exact mixedEmbedding.norm_ne_zero_iff.mp hy w -theorem logMap_apply_of_norm_one (hx : mixedEmbedding.norm x = 1) +theorem logMap_apply_of_norm_eq_one (hx : mixedEmbedding.norm x = 1) (w : {w : InfinitePlace K // w ≠ w₀}) : logMap x w = mult w.val * Real.log (normAtPlace w x) := by rw [logMap_apply, hx, Real.log_one, zero_mul, sub_zero] +@[deprecated (since := "2025-11-15")] alias logMap_apply_of_norm_one := logMap_apply_of_norm_eq_one + @[simp] theorem logMap_eq_logEmbedding (u : (𝓞 K)ˣ) : logMap (mixedEmbedding K u) = logEmbedding K (Additive.ofMul u) := by diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/NormLeOne.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/NormLeOne.lean index a0172e04c5c33c..526fb6a05f1e64 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/NormLeOne.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/NormLeOne.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCone -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.PolarCoord -import Mathlib.NumberTheory.NumberField.Units.Regulator +module + +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCone +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.PolarCoord +public import Mathlib.NumberTheory.NumberField.Units.Regulator /-! # Fundamental Cone: set of elements of norm ≤ 1 @@ -120,6 +122,8 @@ identify `realSpace K` with its image in `mixedSpace K`). -/ +@[expose] public section + variable (K : Type*) [Field K] open Finset Module NumberField NumberField.InfinitePlace NumberField.mixedEmbedding diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/PolarCoord.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/PolarCoord.lean index 7faeabf7e52390..f77e8f7696bc83 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/PolarCoord.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/PolarCoord.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Analysis.SpecialFunctions.PolarCoord -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.PolarCoord +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic /-! # Polar coordinate change of variables for the mixed space of a number field @@ -46,6 +48,8 @@ mixed space with enough symmetries, see `volume_eq_two_pi_pow_mul_integral` and -/ +@[expose] public section + variable (K : Type*) [Field K] namespace NumberField.mixedEmbedding diff --git a/Mathlib/NumberTheory/NumberField/ClassNumber.lean b/Mathlib/NumberTheory/NumberField/ClassNumber.lean index 2e59f397e36f34..9ff22c128cce69 100644 --- a/Mathlib/NumberTheory/NumberField/ClassNumber.lean +++ b/Mathlib/NumberTheory/NumberField/ClassNumber.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Riccardo Brasca, Xavier Roblot -/ -import Mathlib.NumberTheory.ClassNumber.AdmissibleAbs -import Mathlib.NumberTheory.ClassNumber.Finite -import Mathlib.NumberTheory.NumberField.Discriminant.Basic -import Mathlib.RingTheory.Ideal.IsPrincipal -import Mathlib.NumberTheory.RamificationInertia.Galois +module + +public import Mathlib.NumberTheory.ClassNumber.AdmissibleAbs +public import Mathlib.NumberTheory.ClassNumber.Finite +public import Mathlib.NumberTheory.NumberField.Discriminant.Basic +public import Mathlib.RingTheory.Ideal.IsPrincipal +public import Mathlib.NumberTheory.RamificationInertia.Galois /-! # Class numbers of number fields @@ -38,6 +40,8 @@ cardinality of the class group of its ring of integers to deal with the finite number of primes `p` in the interval. -/ +@[expose] public section + open scoped nonZeroDivisors Real open Module NumberField InfinitePlace Ideal Nat diff --git a/Mathlib/NumberTheory/NumberField/Completion.lean b/Mathlib/NumberTheory/NumberField/Completion.lean index 6bbb1ac420e274..f48e266c35bff7 100644 --- a/Mathlib/NumberTheory/NumberField/Completion.lean +++ b/Mathlib/NumberTheory/NumberField/Completion.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.NumberField.InfinitePlace.Completion +module + +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Completion deprecated_module (since := "2025-09-24") diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean index c3707f20374538..bbbfed3151bce9 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.NumberTheory.Cyclotomic.Discriminant -import Mathlib.RingTheory.Ideal.Norm.AbsNorm -import Mathlib.RingTheory.Norm.Transitivity -import Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral -import Mathlib.RingTheory.Prime +module + +public import Mathlib.NumberTheory.Cyclotomic.Discriminant +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm +public import Mathlib.RingTheory.Norm.Transitivity +public import Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral +public import Mathlib.RingTheory.Prime /-! # Ring of integers of `p ^ n`-th cyclotomic fields @@ -24,6 +26,8 @@ integers of a `p ^ n`-th cyclotomic extension of `ℚ`. of cyclotomic fields. -/ +@[expose] public section + universe u open Algebra IsCyclotomicExtension Polynomial NumberField @@ -373,7 +377,7 @@ theorem norm_toInteger_sub_one_eq_one {n : ℕ} [IsCyclotomicExtension {n} ℚ K eval_one_cyclotomic_not_prime_pow h₂, Int.cast_one] /-- The norm, relative to `ℤ`, of `ζ ^ p ^ s - 1` in a `p ^ (k + 1)`-th cyclotomic extension of `ℚ` -is p ^ p ^ s` if `s ≤ k` and `p ^ (k - s + 1) ≠ 2`. -/ +is `p ^ p ^ s` if `s ≤ k` and `p ^ (k - s + 1) ≠ 2`. -/ lemma norm_toInteger_pow_sub_one_of_prime_pow_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] (hζ : IsPrimitiveRoot ζ (p ^ (k + 1))) {s : ℕ} (hs : s ≤ k) (htwo : p ^ (k - s + 1) ≠ 2) : Algebra.norm ℤ (hζ.toInteger ^ p ^ s - 1) = p ^ p ^ s := by diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Embeddings.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Embeddings.lean index 5eae9b1d842318..641733893e85ef 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Embeddings.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Embeddings.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ +module -import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots -import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic /-! # Cyclotomic extensions of `ℚ` are totally complex number fields. @@ -17,6 +18,8 @@ We prove that cyclotomic extensions of `ℚ` are totally complex, meaning that then there are no real places of `K`. -/ +@[expose] public section + universe u namespace IsCyclotomicExtension.Rat diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean index 7cb36bad1a870f..f68d56268338c8 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic -import Mathlib.NumberTheory.RamificationInertia.Galois -import Mathlib.RingTheory.Ideal.Int -import Mathlib.RingTheory.RootsOfUnity.CyclotomicUnits +module + +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic +public import Mathlib.NumberTheory.RamificationInertia.Galois +public import Mathlib.RingTheory.Ideal.Int +public import Mathlib.RingTheory.RootsOfUnity.CyclotomicUnits /-! # Ideals in cyclotomic fields @@ -25,6 +27,8 @@ In this file, we prove results about ideals in cyclotomic extensions of `ℚ`. ideal above `p` in `ℚ(ζ_pᵏ)` is `p ^ (k - 1) * (p - 1)`. -/ +@[expose] public section + namespace IsCyclotomicExtension.Rat open Ideal NumberField diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/PID.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/PID.lean index 3ade10132af801..fd3aa877bb79cc 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/PID.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/PID.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ +module -import Mathlib.NumberTheory.NumberField.ClassNumber -import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic -import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings +public import Mathlib.NumberTheory.NumberField.ClassNumber +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings /-! # Cyclotomic fields whose ring of integers is a PID. @@ -18,6 +19,8 @@ but the proof is more and more involved. * `five_pid`: If `IsCyclotomicExtension {5} ℚ K` then `𝓞 K` is a principal ideal domain. -/ +@[expose] public section + universe u namespace IsCyclotomicExtension.Rat diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean index 39f336fbb07d98..b45cde2658a862 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Pietro Monticone -/ +module -import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings -import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic -import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem -import Mathlib.RingTheory.Fintype +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic +public import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem +public import Mathlib.RingTheory.Fintype /-! # Third Cyclotomic Field @@ -27,6 +28,8 @@ This is a special case of the so-called *Kummer's lemma* (see for example [washi Theorem 5.36 -/ +@[expose] public section + open NumberField Units InfinitePlace nonZeroDivisors Polynomial namespace IsCyclotomicExtension.Rat.Three diff --git a/Mathlib/NumberTheory/NumberField/DedekindZeta.lean b/Mathlib/NumberTheory/NumberField/DedekindZeta.lean index 4713f9ec8e6079..3c3d6b09835a76 100644 --- a/Mathlib/NumberTheory/NumberField/DedekindZeta.lean +++ b/Mathlib/NumberTheory/NumberField/DedekindZeta.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.BigOperators.Ring.Nat -import Mathlib.NumberTheory.LSeries.SumCoeff -import Mathlib.NumberTheory.NumberField.Ideal.Asymptotics +module + +public import Mathlib.Algebra.BigOperators.Ring.Nat +public import Mathlib.NumberTheory.LSeries.SumCoeff +public import Mathlib.NumberTheory.NumberField.Ideal.Asymptotics /-! # The Dedekind zeta function of a number field @@ -21,11 +23,13 @@ In this file, we define and prove results about the Dedekind zeta function of a computation of the residue of the Dedekind zeta function at `s = 1`, see Chap. 7 of [D. Marcus, *Number Fields*][marcus1977number] -# TODO +## TODO Generalize the construction of the Dedekind zeta function. -/ +@[expose] public section + variable (K : Type*) [Field K] [NumberField K] noncomputable section diff --git a/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean b/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean index 73bf7a94bdd3f4..0e175e71ae7d8f 100644 --- a/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.Module.ZLattice.Covolume -import Mathlib.Analysis.Real.Pi.Bounds -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody -import Mathlib.NumberTheory.NumberField.Discriminant.Defs -import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex -import Mathlib.Tactic.Rify +module + +public import Mathlib.Algebra.Module.ZLattice.Covolume +public import Mathlib.Analysis.Real.Pi.Bounds +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody +public import Mathlib.NumberTheory.NumberField.Discriminant.Defs +public import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex +public import Mathlib.Tactic.Rify /-! # Number field discriminant @@ -26,6 +28,8 @@ This file defines the discriminant of a number field. number field, discriminant -/ +@[expose] public section + -- TODO. Rewrite some of the FLT results on the discriminant using the definitions and results of -- this file diff --git a/Mathlib/NumberTheory/NumberField/Discriminant/Defs.lean b/Mathlib/NumberTheory/NumberField/Discriminant/Defs.lean index f2c2c1e59e718a..d362cb965cb31e 100644 --- a/Mathlib/NumberTheory/NumberField/Discriminant/Defs.lean +++ b/Mathlib/NumberTheory/NumberField/Discriminant/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Init.Data.ULift -import Init.Data.Fin.Fold -import Init.Data.List.Nat.Pairwise -import Init.Data.List.Nat.Range -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.RingTheory.Localization.NormTrace +module + +public import Init.Data.ULift +public import Init.Data.Fin.Fold +public import Init.Data.List.Nat.Pairwise +public import Init.Data.List.Nat.Range +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.RingTheory.Localization.NormTrace /-! # Number field discriminant @@ -22,6 +24,8 @@ This file defines the discriminant of a number field. number field, discriminant -/ +@[expose] public section + open Module -- TODO: Rewrite some of the FLT results on the discriminant using the definitions and results of diff --git a/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean b/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean index 3820452b7b6518..19606b9485738d 100644 --- a/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean +++ b/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.NumberTheory.NumberField.Discriminant.Basic -import Mathlib.RingTheory.DedekindDomain.LinearDisjoint -import Mathlib.RingTheory.Ideal.Norm.RelNorm +module + +public import Mathlib.NumberTheory.NumberField.Discriminant.Basic +public import Mathlib.RingTheory.DedekindDomain.LinearDisjoint +public import Mathlib.RingTheory.Ideal.Norm.RelNorm /-! @@ -23,6 +25,8 @@ import Mathlib.RingTheory.Ideal.Norm.RelNorm -/ +@[expose] public section + namespace NumberField variable (K 𝒪 : Type*) [Field K] [NumberField K] [CommRing 𝒪] [Algebra 𝒪 K] diff --git a/Mathlib/NumberTheory/NumberField/Embeddings.lean b/Mathlib/NumberTheory/NumberField/Embeddings.lean index d91a907d24035a..7327e916fa684a 100644 --- a/Mathlib/NumberTheory/NumberField/Embeddings.lean +++ b/Mathlib/NumberTheory/NumberField/Embeddings.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.InfinitePlace.Ramification -import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex +module + +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Ramification +public import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex deprecated_module (since := "2025-04-30") diff --git a/Mathlib/NumberTheory/NumberField/EquivReindex.lean b/Mathlib/NumberTheory/NumberField/EquivReindex.lean index df076a12fdb775..4683331635aa99 100644 --- a/Mathlib/NumberTheory/NumberField/EquivReindex.lean +++ b/Mathlib/NumberTheory/NumberField/EquivReindex.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Michail Karatarakis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michail Karatarakis -/ -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic +module + +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic /-! @@ -16,6 +18,8 @@ index set of the chosen basis of the ring of integers of `K`. house, number field, algebraic number -/ +@[expose] public section + variable (K : Type*) [Field K] [NumberField K] namespace NumberField diff --git a/Mathlib/NumberTheory/NumberField/FinitePlaces.lean b/Mathlib/NumberTheory/NumberField/FinitePlaces.lean index a3290dda8b36ac..99d8423c9ec915 100644 --- a/Mathlib/NumberTheory/NumberField/FinitePlaces.lean +++ b/Mathlib/NumberTheory/NumberField/FinitePlaces.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ -import Mathlib.Algebra.Order.Archimedean.Submonoid -import Mathlib.Algebra.GroupWithZero.Range -import Mathlib.Data.Int.WithZero -import Mathlib.NumberTheory.NumberField.InfinitePlace.Embeddings -import Mathlib.RingTheory.DedekindDomain.AdicValuation -import Mathlib.RingTheory.DedekindDomain.Factorization -import Mathlib.RingTheory.Ideal.Norm.AbsNorm -import Mathlib.RingTheory.Valuation.Archimedean -import Mathlib.Topology.Algebra.Valued.NormedValued +module + +public import Mathlib.Algebra.Order.Archimedean.Submonoid +public import Mathlib.Algebra.GroupWithZero.Range +public import Mathlib.Data.Int.WithZero +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Embeddings +public import Mathlib.RingTheory.DedekindDomain.AdicValuation +public import Mathlib.RingTheory.DedekindDomain.Factorization +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm +public import Mathlib.RingTheory.Valuation.Archimedean +public import Mathlib.Topology.Algebra.Valued.NormedValued /-! # Finite places of number fields @@ -36,6 +38,8 @@ into a completion of `K` associated to a non-zero prime ideal of `𝓞 K`. number field, places, finite places -/ +@[expose] public section + open Ideal IsDedekindDomain HeightOneSpectrum WithZeroMulInt WithZero open scoped WithZero NNReal diff --git a/Mathlib/NumberTheory/NumberField/FractionalIdeal.lean b/Mathlib/NumberTheory/NumberField/FractionalIdeal.lean index 4991cb7eed9fb8..c0739b8a24b226 100644 --- a/Mathlib/NumberTheory/NumberField/FractionalIdeal.lean +++ b/Mathlib/NumberTheory/NumberField/FractionalIdeal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.RingTheory.FractionalIdeal.Norm -import Mathlib.RingTheory.FractionalIdeal.Operations +module + +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.RingTheory.FractionalIdeal.Norm +public import Mathlib.RingTheory.FractionalIdeal.Operations /-! @@ -22,6 +24,8 @@ Prove some results on the fractional ideals of number fields. `basisOfFractionalIdeal I` is equal to the norm of `I`. -/ +@[expose] public section + variable (K : Type*) [Field K] [NumberField K] namespace NumberField diff --git a/Mathlib/NumberTheory/NumberField/House.lean b/Mathlib/NumberTheory/NumberField/House.lean index 496911334a02b3..023556124090a4 100644 --- a/Mathlib/NumberTheory/NumberField/House.lean +++ b/Mathlib/NumberTheory/NumberField/House.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Michail Karatarakis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michail Karatarakis -/ -import Mathlib.NumberTheory.SiegelsLemma -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic -import Mathlib.NumberTheory.NumberField.EquivReindex +module + +public import Mathlib.NumberTheory.SiegelsLemma +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic +public import Mathlib.NumberTheory.NumberField.EquivReindex /-! @@ -21,6 +23,8 @@ the largest of the modulus of its conjugates. number field, algebraic number, house -/ +@[expose] public section + variable {K : Type*} [Field K] [NumberField K] namespace NumberField diff --git a/Mathlib/NumberTheory/NumberField/Ideal.lean b/Mathlib/NumberTheory/NumberField/Ideal.lean index 39b620cc99fd47..fb7fc9457b3a4b 100644 --- a/Mathlib/NumberTheory/NumberField/Ideal.lean +++ b/Mathlib/NumberTheory/NumberField/Ideal.lean @@ -1,3 +1,5 @@ -import Mathlib.NumberTheory.NumberField.Ideal.Asymptotics +module + +public import Mathlib.NumberTheory.NumberField.Ideal.Asymptotics deprecated_module (since := "2025-06-04") diff --git a/Mathlib/NumberTheory/NumberField/Ideal/Asymptotics.lean b/Mathlib/NumberTheory/NumberField/Ideal/Asymptotics.lean index b90a32ce269211..a9917df12eac4c 100644 --- a/Mathlib/NumberTheory/NumberField/Ideal/Asymptotics.lean +++ b/Mathlib/NumberTheory/NumberField/Ideal/Asymptotics.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne -import Mathlib.NumberTheory.NumberField.ClassNumber +module + +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne +public import Mathlib.NumberTheory.NumberField.ClassNumber /-! # Asymptotics on integral ideals of a number field @@ -20,6 +22,8 @@ We prove several asymptotics involving integral ideals of a number field. -/ +@[expose] public section + noncomputable section open Ideal diff --git a/Mathlib/NumberTheory/NumberField/Ideal/Basic.lean b/Mathlib/NumberTheory/NumberField/Ideal/Basic.lean index 51276c64cee946..27acf4c1c084c6 100644 --- a/Mathlib/NumberTheory/NumberField/Ideal/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Ideal/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic -import Mathlib.NumberTheory.NumberField.Units.Basic +module + +public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic +public import Mathlib.NumberTheory.NumberField.Units.Basic /-! # Basic results on integral ideals of a number field @@ -25,6 +27,8 @@ We study results about integral ideals of a number field `K`. -/ +@[expose] public section + section torsionMapQuot open Ideal NumberField Units diff --git a/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean b/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean index ed205fafbc7ea0..75f288036df0ba 100644 --- a/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean +++ b/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.KummerDedekind -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.NumberTheory.RamificationInertia.Basic -import Mathlib.RingTheory.Ideal.Int +module + +public import Mathlib.NumberTheory.KummerDedekind +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.NumberTheory.RamificationInertia.Basic +public import Mathlib.RingTheory.Ideal.Int /-! # Kummer-Dedekind criterion for the splitting of prime numbers @@ -45,6 +47,8 @@ Let `K` be a number field and `θ` an algebraic integer of `K`. -/ +@[expose] public section + noncomputable section open Polynomial NumberField Ideal KummerDedekind UniqueFactorizationMonoid diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean index b138f84360c351..3a47a73bc65d97 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.InfinitePlace.Embeddings -import Mathlib.NumberTheory.NumberField.Norm -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots -import Mathlib.Topology.Instances.Complex +module + +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Embeddings +public import Mathlib.NumberTheory.NumberField.Norm +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +public import Mathlib.Topology.Instances.Complex /-! # Infinite places of a number field @@ -36,6 +38,8 @@ This file defines the infinite places of a number field. number field, infinite places -/ +@[expose] public section + open scoped Finset open NumberField Fintype Module diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Completion.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Completion.lean index d8c21c2522cfcf..fff0c15aee0090 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Completion.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Completion.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Salvatore Mercuri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Salvatore Mercuri -/ -import Mathlib.Analysis.Normed.Field.WithAbs -import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +module + +public import Mathlib.Analysis.Normed.Field.WithAbs +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic /-! # The completion of a number field at an infinite place @@ -51,6 +53,8 @@ field at an infinite place is then derived in this file, as `InfinitePlace` is a ## Tags number field, embeddings, infinite places, completion, absolute value -/ + +@[expose] public section noncomputable section namespace NumberField.InfinitePlace diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean index ffaa86fc6c9839..1f06477a6fdf04 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Xavier Roblot -/ -import Mathlib.Algebra.Algebra.Hom.Rat -import Mathlib.Analysis.Complex.Polynomial.Basic -import Mathlib.NumberTheory.NumberField.Basic +module + +public import Mathlib.Algebra.Algebra.Hom.Rat +public import Mathlib.Analysis.Complex.Polynomial.Basic +public import Mathlib.NumberTheory.NumberField.Basic /-! # Embeddings of number fields @@ -26,6 +28,8 @@ the field of complex numbers. number field, embeddings -/ +@[expose] public section + open scoped Finset namespace NumberField.Embeddings diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean index d126fa1c68ae60..9916d223101dc7 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic -import Mathlib.Analysis.Normed.Ring.WithAbs +module + +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +public import Mathlib.Analysis.Normed.Ring.WithAbs /-! # Ramification of infinite places of a number field @@ -30,6 +32,8 @@ This file studies the ramification of infinite places of a number field. number field, infinite places, ramification -/ +@[expose] public section + open NumberField Fintype Module namespace NumberField.InfinitePlace diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/TotallyRealComplex.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/TotallyRealComplex.lean index be532ef57917bc..70bfb58502225b 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/TotallyRealComplex.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/TotallyRealComplex.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Xavier Roblot -/ -import Mathlib.NumberTheory.NumberField.InfinitePlace.Ramification +module + +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Ramification /-! # Totally real and totally complex number fields @@ -25,6 +27,8 @@ This file defines the type of totally real and totally complex number fields. number field, infinite places, totally real, totally complex -/ +@[expose] public section + namespace NumberField open InfinitePlace Module @@ -66,6 +70,13 @@ theorem IsTotallyReal.of_algebra [IsTotallyReal K] [Algebra F K] : IsTotallyReal obtain ⟨W, rfl⟩ : ∃ W : InfinitePlace K, W.comap (algebraMap F K) = w := comap_surjective w exact IsReal.comap _ (IsTotallyReal.isReal W) +theorem isTotallyReal_iff_ofRingEquiv (f : F ≃+* K) : IsTotallyReal F ↔ IsTotallyReal K := + ⟨fun _ ↦ .ofRingEquiv f, fun _ ↦ .ofRingEquiv f.symm⟩ + +@[simp] +theorem isTotallyReal_top_iff : IsTotallyReal (⊤ : Subfield K) ↔ IsTotallyReal K := + isTotallyReal_iff_ofRingEquiv Subfield.topEquiv + @[deprecated (since := "2025-05-19")] alias IsTotally.of_algebra := IsTotallyReal.of_algebra instance [IsTotallyReal K] (F : IntermediateField ℚ K) : IsTotallyReal F := @@ -141,6 +152,15 @@ instance isTotallyReal_iSup {ι : Type*} {k : ι → Subfield K} [∀ i, IsTotal IsTotallyReal (⨆ i, k i : Subfield K) := by simp_all [isTotallyReal_iff_le_maximalRealSubfield] +@[simp] +theorem IsTotallyReal.maximalRealSubfield_eq_top [IsTotallyReal K] : maximalRealSubfield K = ⊤ := + top_unique <| NumberField.IsTotallyReal.le_maximalRealSubfield _ + +theorem maximalRealSubfield_eq_top_iff_isTotallyReal : + maximalRealSubfield K = ⊤ ↔ IsTotallyReal K where + mp h := by rw [← isTotallyReal_top_iff, isTotallyReal_iff_le_maximalRealSubfield, h] + mpr _ := IsTotallyReal.maximalRealSubfield_eq_top + end maximalRealSubfield end TotallyRealField diff --git a/Mathlib/NumberTheory/NumberField/Norm.lean b/Mathlib/NumberTheory/NumberField/Norm.lean index ff976dfcfc9c00..489d1e9c3b3860 100644 --- a/Mathlib/NumberTheory/NumberField/Norm.lean +++ b/Mathlib/NumberTheory/NumberField/Norm.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Eric Rodriguez -/ -import Mathlib.NumberTheory.NumberField.Basic -import Mathlib.RingTheory.Localization.NormTrace -import Mathlib.RingTheory.Norm.Transitivity +module + +public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.RingTheory.Localization.NormTrace +public import Mathlib.RingTheory.Norm.Transitivity /-! # Norm in number fields @@ -20,6 +22,8 @@ rings of integers. -/ +@[expose] public section + open scoped NumberField diff --git a/Mathlib/NumberTheory/NumberField/ProductFormula.lean b/Mathlib/NumberTheory/NumberField/ProductFormula.lean index cdb7eddfd321df..7a1c9ba749860b 100644 --- a/Mathlib/NumberTheory/NumberField/ProductFormula.lean +++ b/Mathlib/NumberTheory/NumberField/ProductFormula.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ -import Mathlib.NumberTheory.NumberField.FinitePlaces -import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +module + +public import Mathlib.NumberTheory.NumberField.FinitePlaces +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic /-! # The Product Formula for number fields @@ -29,6 +31,8 @@ ideal of `𝓞 K` raised to the power of the `v`-adic valuation of `x`. number field, embeddings, places, infinite places, finite places, product formula -/ +@[expose] public section + namespace NumberField variable {K : Type*} [Field K] [NumberField K] diff --git a/Mathlib/NumberTheory/NumberField/Units/Basic.lean b/Mathlib/NumberTheory/NumberField/Units/Basic.lean index 47c7f5b17971b7..44e33f91fd4a85 100644 --- a/Mathlib/NumberTheory/NumberField/Units/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Units/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.GroupTheory.Torsion -import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic -import Mathlib.RingTheory.LocalRing.RingHom.Basic -import Mathlib.RingTheory.RootsOfUnity.Complex +module + +public import Mathlib.GroupTheory.Torsion +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +public import Mathlib.RingTheory.LocalRing.RingHom.Basic +public import Mathlib.RingTheory.RootsOfUnity.Complex /-! # Units of a number field @@ -30,6 +32,8 @@ field `K` and its torsion subgroup. number field, units -/ +@[expose] public section + open scoped NumberField noncomputable section diff --git a/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean b/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean index 08f336f9d17a9d..343e0969e6504a 100644 --- a/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean +++ b/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.LinearAlgebra.Matrix.Gershgorin -import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody -import Mathlib.NumberTheory.NumberField.Units.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Gershgorin +public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody +public import Mathlib.NumberTheory.NumberField.Units.Basic /-! # Dirichlet theorem on the group of units of a number field @@ -35,6 +37,8 @@ subgroup is a free `ℤ`-module of rank `card (InfinitePlace K) - 1`. number field, units, Dirichlet unit theorem -/ +@[expose] public section + noncomputable section open Module NumberField NumberField.InfinitePlace NumberField.Units diff --git a/Mathlib/NumberTheory/NumberField/Units/Regulator.lean b/Mathlib/NumberTheory/NumberField/Units/Regulator.lean index c6c3a96fa36d37..a1d9e0a9e80b86 100644 --- a/Mathlib/NumberTheory/NumberField/Units/Regulator.lean +++ b/Mathlib/NumberTheory/NumberField/Units/Regulator.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.Module.ZLattice.Covolume -import Mathlib.LinearAlgebra.Matrix.Determinant.Misc -import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem +module + +public import Mathlib.Algebra.Module.ZLattice.Covolume +public import Mathlib.LinearAlgebra.Matrix.Determinant.Misc +public import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem /-! # Regulator of a number field @@ -31,6 +33,8 @@ We define and prove basic results about the regulator of a number field `K`. number field, units, regulator -/ +@[expose] public section + open scoped NumberField noncomputable section diff --git a/Mathlib/NumberTheory/Ostrowski.lean b/Mathlib/NumberTheory/Ostrowski.lean index b292df34a0db5b..aad7037a6ea9ed 100644 --- a/Mathlib/NumberTheory/Ostrowski.lean +++ b/Mathlib/NumberTheory/Ostrowski.lean @@ -5,11 +5,12 @@ Authors: David Kurniadi Angdinata, Fabrizio Barroero, Laura Capuano, Nirvana Cop María Inés de Frutos-Fernández, Sam van Gool, Silvain Rideau-Kikuchi, Amos Turchet, Francesco Veneziano -/ +module -import Mathlib.Analysis.AbsoluteValue.Equivalence -import Mathlib.Analysis.SpecialFunctions.Log.Base -import Mathlib.Analysis.SpecialFunctions.Pow.Continuity -import Mathlib.NumberTheory.Padics.PadicNorm +public import Mathlib.Analysis.AbsoluteValue.Equivalence +public import Mathlib.Analysis.SpecialFunctions.Log.Base +public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity +public import Mathlib.NumberTheory.Padics.PadicNorm /-! # Ostrowski’s Theorem @@ -38,6 +39,8 @@ Extend to arbitrary number fields. absolute value, Ostrowski's theorem -/ +@[expose] public section + open Filter Nat Real Topology -- For any `C > 0`, the limit of `C ^ (1/k)` is 1 as `k → ∞` diff --git a/Mathlib/NumberTheory/Padics/AddChar.lean b/Mathlib/NumberTheory/Padics/AddChar.lean index 7dadf9884e5d16..ec976a31bf347e 100644 --- a/Mathlib/NumberTheory/Padics/AddChar.lean +++ b/Mathlib/NumberTheory/Padics/AddChar.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.Padics.MahlerBasis -import Mathlib.Topology.Algebra.Monoid.AddChar -import Mathlib.Analysis.SpecificLimits.Normed +module + +public import Mathlib.NumberTheory.Padics.MahlerBasis +public import Mathlib.Topology.Algebra.Monoid.AddChar +public import Mathlib.Analysis.SpecificLimits.Normed /-! # Additive characters of `ℤ_[p]` @@ -35,6 +37,8 @@ equivalent if `NormMulClass R` holds. * Show that the above equivalences are homeomorphisms, for appropriate choices of the topology. -/ +@[expose] public section + open scoped fwdDiff open Filter Topology diff --git a/Mathlib/NumberTheory/Padics/Complex.lean b/Mathlib/NumberTheory/Padics/Complex.lean index 89472df6c7f42c..3e7b9b19ea84ca 100644 --- a/Mathlib/NumberTheory/Padics/Complex.lean +++ b/Mathlib/NumberTheory/Padics/Complex.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Analysis.Normed.Unbundled.SpectralNorm -import Mathlib.NumberTheory.Padics.PadicNumbers -import Mathlib.Topology.Algebra.Valued.NormedValued -import Mathlib.Topology.Algebra.Valued.ValuedField +module + +public import Mathlib.Analysis.Normed.Unbundled.SpectralNorm +public import Mathlib.NumberTheory.Padics.PadicNumbers +public import Mathlib.Topology.Algebra.Valued.NormedValued +public import Mathlib.Topology.Algebra.Valued.ValuedField /-! # The field `ℂ_[p]` of `p`-adic complex numbers. @@ -36,6 +38,8 @@ integers. p-adic, p adic, padic, norm, valuation, Cauchy, completion, p-adic completion -/ +@[expose] public section + noncomputable section open Valuation diff --git a/Mathlib/NumberTheory/Padics/Hensel.lean b/Mathlib/NumberTheory/Padics/Hensel.lean index 594d00c2a815f7..11ae032e497a15 100644 --- a/Mathlib/NumberTheory/Padics/Hensel.lean +++ b/Mathlib/NumberTheory/Padics/Hensel.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Algebra.Polynomial.Identities -import Mathlib.Analysis.SpecificLimits.Basic -import Mathlib.NumberTheory.Padics.PadicIntegers -import Mathlib.Topology.Algebra.Polynomial -import Mathlib.Topology.MetricSpace.CauSeqFilter +module + +public import Mathlib.Algebra.Polynomial.Identities +public import Mathlib.Analysis.SpecificLimits.Basic +public import Mathlib.NumberTheory.Padics.PadicIntegers +public import Mathlib.Topology.Algebra.Polynomial +public import Mathlib.Topology.MetricSpace.CauSeqFilter /-! # Hensel's lemma on ℤ_p @@ -31,6 +33,8 @@ The proof and motivation are described in the paper p-adic, p adic, padic, p-adic integer -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/NumberTheory/Padics/MahlerBasis.lean b/Mathlib/NumberTheory/Padics/MahlerBasis.lean index 6a618d4fccc088..cecc25dbba04ae 100644 --- a/Mathlib/NumberTheory/Padics/MahlerBasis.lean +++ b/Mathlib/NumberTheory/Padics/MahlerBasis.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Giulio Caflisch, David Loeffler -/ -import Mathlib.Algebra.Group.ForwardDiff -import Mathlib.Analysis.Normed.Group.Ultra -import Mathlib.NumberTheory.Padics.ProperSpace -import Mathlib.RingTheory.Binomial -import Mathlib.Topology.Algebra.InfiniteSum.Nonarchimedean -import Mathlib.Topology.Algebra.Polynomial -import Mathlib.Topology.ContinuousMap.ZeroAtInfty -import Mathlib.Topology.MetricSpace.Ultra.ContinuousMaps +module + +public import Mathlib.Algebra.Group.ForwardDiff +public import Mathlib.Analysis.Normed.Group.Ultra +public import Mathlib.NumberTheory.Padics.ProperSpace +public import Mathlib.RingTheory.Binomial +public import Mathlib.Topology.Algebra.InfiniteSum.Nonarchimedean +public import Mathlib.Topology.Algebra.Polynomial +public import Mathlib.Topology.ContinuousMap.ZeroAtInfty +public import Mathlib.Topology.MetricSpace.Ultra.ContinuousMaps /-! # The Mahler basis of continuous functions @@ -39,6 +41,8 @@ for his bachelor's thesis at ETH Zürich. Bojanic -/ +@[expose] public section + open Finset IsUltrametricDist NNReal Filter open scoped fwdDiff ZeroAtInfty Topology diff --git a/Mathlib/NumberTheory/Padics/PadicIntegers.lean b/Mathlib/NumberTheory/Padics/PadicIntegers.lean index 3b50556d9b3caf..4a124ce013d8da 100644 --- a/Mathlib/NumberTheory/Padics/PadicIntegers.lean +++ b/Mathlib/NumberTheory/Padics/PadicIntegers.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Mario Carneiro, Johan Commelin -/ -import Mathlib.NumberTheory.Padics.PadicNumbers -import Mathlib.RingTheory.DiscreteValuationRing.Basic +module + +public import Mathlib.NumberTheory.Padics.PadicNumbers +public import Mathlib.RingTheory.DiscreteValuationRing.Basic /-! # p-adic integers @@ -45,6 +47,8 @@ Coercions into `ℤ_[p]` are set up to work with the `norm_cast` tactic. p-adic, p adic, padic, p-adic integer -/ +@[expose] public section + open Padic Metric IsLocalRing diff --git a/Mathlib/NumberTheory/Padics/PadicNorm.lean b/Mathlib/NumberTheory/Padics/PadicNorm.lean index 2e7adf7804ea5c..069beafe4cb307 100644 --- a/Mathlib/NumberTheory/Padics/PadicNorm.lean +++ b/Mathlib/NumberTheory/Padics/PadicNorm.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Algebra.Order.AbsoluteValue.Basic -import Mathlib.NumberTheory.Padics.PadicVal.Basic +module + +public import Mathlib.Algebra.Order.AbsoluteValue.Basic +public import Mathlib.NumberTheory.Padics.PadicVal.Basic /-! # p-adic norm @@ -34,6 +36,8 @@ by taking `[Fact p.Prime]` as a type class argument. p-adic, p adic, padic, norm, valuation -/ +@[expose] public section + /-- If `q ≠ 0`, the `p`-adic norm of a rational `q` is `p ^ (-padicValRat p q)`. If `q = 0`, the `p`-adic norm of `q` is `0`. -/ diff --git a/Mathlib/NumberTheory/Padics/PadicNumbers.lean b/Mathlib/NumberTheory/Padics/PadicNumbers.lean index c98d5dc302da81..1d9faa033c6a97 100644 --- a/Mathlib/NumberTheory/Padics/PadicNumbers.lean +++ b/Mathlib/NumberTheory/Padics/PadicNumbers.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.RingTheory.Valuation.Basic -import Mathlib.NumberTheory.Padics.PadicNorm -import Mathlib.Analysis.Normed.Field.Lemmas -import Mathlib.Tactic.Peel -import Mathlib.Topology.MetricSpace.Ultra.Basic +module + +public import Mathlib.RingTheory.Valuation.Basic +public import Mathlib.NumberTheory.Padics.PadicNorm +public import Mathlib.Analysis.Normed.Field.Lemmas +public import Mathlib.Tactic.Peel +public import Mathlib.Topology.MetricSpace.Ultra.Basic /-! # p-adic numbers @@ -58,6 +60,8 @@ Coercions from `ℚ` to `ℚ_[p]` are set up to work with the `norm_cast` tactic p-adic, p adic, padic, norm, valuation, cauchy, completion, p-adic completion -/ +@[expose] public section + open WithZero /-- The p-adic valuation on rationals, sending `p` to `(exp (-1) : ℤᵐ⁰)` -/ diff --git a/Mathlib/NumberTheory/Padics/PadicVal/Basic.lean b/Mathlib/NumberTheory/Padics/PadicVal/Basic.lean index 6d72e7dbeb5881..25e197b6cf67f2 100644 --- a/Mathlib/NumberTheory/Padics/PadicVal/Basic.lean +++ b/Mathlib/NumberTheory/Padics/PadicVal/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Matthew Robert Ballard -/ -import Mathlib.NumberTheory.Divisors -import Mathlib.NumberTheory.Padics.PadicVal.Defs -import Mathlib.Data.Nat.MaxPowDiv -import Mathlib.Data.Nat.Multiplicity -import Mathlib.Data.Nat.Prime.Int +module + +public import Mathlib.NumberTheory.Divisors +public import Mathlib.NumberTheory.Padics.PadicVal.Defs +public import Mathlib.Data.Nat.MaxPowDiv +public import Mathlib.Data.Nat.Multiplicity +public import Mathlib.Data.Nat.Prime.Int /-! # `p`-adic Valuation @@ -59,6 +61,8 @@ by taking `[Fact p.Prime]` as a type class argument. p-adic, p adic, padic, norm, valuation -/ +@[expose] public section + universe u diff --git a/Mathlib/NumberTheory/Padics/PadicVal/Defs.lean b/Mathlib/NumberTheory/Padics/PadicVal/Defs.lean index a01b88ca709b6c..92269b0ffd62c1 100644 --- a/Mathlib/NumberTheory/Padics/PadicVal/Defs.lean +++ b/Mathlib/NumberTheory/Padics/PadicVal/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Matthew Robert Ballard -/ -import Mathlib.RingTheory.Multiplicity -import Mathlib.Data.Nat.Factors +module + +public import Mathlib.RingTheory.Multiplicity +public import Mathlib.Data.Nat.Factors /-! # `p`-adic Valuation @@ -18,6 +20,8 @@ assumptions on `p`. The `p`-adic valuations on `ℕ` and `ℤ` agree with that o The valuation induces a norm on `ℚ`. This norm is defined in padicNorm.lean. -/ +@[expose] public section + assert_not_exists Field universe u diff --git a/Mathlib/NumberTheory/Padics/ProperSpace.lean b/Mathlib/NumberTheory/Padics/ProperSpace.lean index c1f72a1b4ded7e..91224c60442f09 100644 --- a/Mathlib/NumberTheory/Padics/ProperSpace.lean +++ b/Mathlib/NumberTheory/Padics/ProperSpace.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Jou Glasheen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jou Glasheen, Kevin Buzzard -/ +module -import Mathlib.Analysis.Normed.Field.ProperSpace -import Mathlib.NumberTheory.Padics.RingHoms +public import Mathlib.Analysis.Normed.Field.ProperSpace +public import Mathlib.NumberTheory.Padics.RingHoms /-! # Properness of the p-adic numbers @@ -29,6 +30,8 @@ Gouvêa, F. Q. (2020) p-adic Numbers An Introduction. 3rd edition. Cham, Springer International Publishing -/ +@[expose] public section + assert_not_exists FiniteDimensional open Metric Topology diff --git a/Mathlib/NumberTheory/Padics/RingHoms.lean b/Mathlib/NumberTheory/Padics/RingHoms.lean index 6d2db32db8cb58..801ab801f006db 100644 --- a/Mathlib/NumberTheory/Padics/RingHoms.lean +++ b/Mathlib/NumberTheory/Padics/RingHoms.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Johan Commelin, Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.Field.ZMod -import Mathlib.NumberTheory.Padics.PadicIntegers -import Mathlib.RingTheory.LocalRing.ResidueField.Defs -import Mathlib.RingTheory.ZMod +module + +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.NumberTheory.Padics.PadicIntegers +public import Mathlib.RingTheory.LocalRing.ResidueField.Defs +public import Mathlib.RingTheory.ZMod /-! @@ -24,7 +26,7 @@ and we may want to use it without the `^1` getting in the way. * `PadicInt.toZModPow`: ring homomorphism to `ℤ/p^nℤ`, implemented as `ZMod (p^n)`. * `PadicInt.ker_toZMod` / `PadicInt.ker_toZModPow`: the kernels of these maps are the ideals generated by `p^n` -* `PadicInt.residueField` shows that the residue field of `ℤ_[p]` is isomorphic to ``ℤ/pℤ`. +* `PadicInt.residueField` shows that the residue field of `ℤ_[p]` is isomorphic to `ℤ/pℤ`. We also establish the universal property of `ℤ_[p]` as a projective limit. Given a family of compatible ring homomorphisms `f_k : R → ℤ/p^nℤ`, @@ -39,6 +41,8 @@ The constructions of the ring homomorphisms go through an auxiliary constructor -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/NumberTheory/Padics/ValuativeRel.lean b/Mathlib/NumberTheory/Padics/ValuativeRel.lean index baa1785f2fcc27..8d56de0d2587ac 100644 --- a/Mathlib/NumberTheory/Padics/ValuativeRel.lean +++ b/Mathlib/NumberTheory/Padics/ValuativeRel.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.NumberTheory.Padics.PadicNumbers -import Mathlib.RingTheory.Valuation.RankOne +module + +public import Mathlib.NumberTheory.Padics.PadicNumbers +public import Mathlib.RingTheory.Valuation.RankOne /-! # p-adic numbers with a valuative relation @@ -14,6 +16,8 @@ import Mathlib.RingTheory.Valuation.RankOne p-adic, p adic, padic, norm, valuation, cauchy, completion, p-adic completion -/ +@[expose] public section + variable {p : ℕ} [hp : Fact p.Prime] {Γ₀ : Type*} [LinearOrderedCommMonoidWithZero Γ₀] (v : Valuation ℚ_[p] Γ₀) diff --git a/Mathlib/NumberTheory/Padics/WithVal.lean b/Mathlib/NumberTheory/Padics/WithVal.lean index 1b617fb9cea7cc..72dd69fc88ac1a 100644 --- a/Mathlib/NumberTheory/Padics/WithVal.lean +++ b/Mathlib/NumberTheory/Padics/WithVal.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Analysis.RCLike.Basic -import Mathlib.NumberTheory.Padics.PadicNumbers -import Mathlib.Topology.Algebra.Valued.ValuedField -import Mathlib.Topology.Algebra.Valued.WithVal -import Mathlib.Topology.GDelta.MetrizableSpace +module + +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.NumberTheory.Padics.PadicNumbers +public import Mathlib.Topology.Algebra.Valued.ValuedField +public import Mathlib.Topology.Algebra.Valued.WithVal +public import Mathlib.Topology.GDelta.MetrizableSpace /-! # Equivalence between `ℚ_[p]` and `(Rat.padicValuation p).Completion` @@ -25,6 +27,8 @@ which is shorthand for `UniformSpace.Completion (WithVal (Rat.padicValuation p)) -/ +@[expose] public section + namespace Padic variable {p : ℕ} [Fact p.Prime] diff --git a/Mathlib/NumberTheory/Pell.lean b/Mathlib/NumberTheory/Pell.lean index beb8f9a862621a..346662e660734f 100644 --- a/Mathlib/NumberTheory/Pell.lean +++ b/Mathlib/NumberTheory/Pell.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Geißer, Michael Stoll -/ -import Mathlib.Data.ZMod.Basic -import Mathlib.NumberTheory.DiophantineApproximation.Basic -import Mathlib.NumberTheory.Zsqrtd.Basic -import Mathlib.Tactic.Qify +module + +public import Mathlib.Data.ZMod.Basic +public import Mathlib.NumberTheory.DiophantineApproximation.Basic +public import Mathlib.NumberTheory.Zsqrtd.Basic +public import Mathlib.Tactic.Qify /-! # Pell's Equation @@ -51,6 +53,8 @@ Pell's equation * Connect solutions to the continued fraction expansion of `√d`. -/ +@[expose] public section + namespace Pell diff --git a/Mathlib/NumberTheory/PellMatiyasevic.lean b/Mathlib/NumberTheory/PellMatiyasevic.lean index c9fb5f06d270dd..d0c7c96a427b5d 100644 --- a/Mathlib/NumberTheory/PellMatiyasevic.lean +++ b/Mathlib/NumberTheory/PellMatiyasevic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Nat.ModEq -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.NumberTheory.Zsqrtd.Basic +module + +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.NumberTheory.Zsqrtd.Basic /-! # Pell's equation and Matiyasevic's theorem @@ -48,6 +50,8 @@ Pell's equation, Matiyasevic's theorem, Hilbert's tenth problem -/ +@[expose] public section + namespace Pell diff --git a/Mathlib/NumberTheory/PowModTotient.lean b/Mathlib/NumberTheory/PowModTotient.lean index 2e29b0b00df5cc..e4f46f1ca659ef 100644 --- a/Mathlib/NumberTheory/PowModTotient.lean +++ b/Mathlib/NumberTheory/PowModTotient.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey -/ -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.FieldTheory.Finite.Basic /-! # Modular exponentiation with the totient function @@ -25,6 +27,8 @@ function when the base is coprime to the modulus. -/ +@[expose] public section + namespace Nat lemma pow_totient_mod_eq_one {x n : ℕ} (hn : 1 < n) (h : x.Coprime n) : diff --git a/Mathlib/NumberTheory/PrimeCounting.lean b/Mathlib/NumberTheory/PrimeCounting.lean index bf2f705da6ac17..8128c666dec6f9 100644 --- a/Mathlib/NumberTheory/PrimeCounting.lean +++ b/Mathlib/NumberTheory/PrimeCounting.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Bolton Bailey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bolton Bailey, Ralf Stephan -/ -import Mathlib.Data.Nat.Prime.Nth -import Mathlib.Data.Nat.Totient -import Mathlib.NumberTheory.SmoothNumbers -import Mathlib.Order.Filter.AtTopBot.Basic +module + +public import Mathlib.Data.Nat.Prime.Nth +public import Mathlib.Data.Nat.Totient +public import Mathlib.NumberTheory.SmoothNumbers +public import Mathlib.Order.Filter.AtTopBot.Basic /-! # The Prime Counting Function @@ -33,6 +35,8 @@ function (and `π'` to represent the reindexed version). -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/NumberTheory/PrimesCongruentOne.lean b/Mathlib/NumberTheory/PrimesCongruentOne.lean index 1f6769bc0bd3b4..9cee27319f5e26 100644 --- a/Mathlib/NumberTheory/PrimesCongruentOne.lean +++ b/Mathlib/NumberTheory/PrimesCongruentOne.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval +module + +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval /-! # Primes congruent to one @@ -12,6 +14,8 @@ We prove that, for any positive `k : ℕ`, there are infinitely many primes `p` `p ≡ 1 [MOD k]`. -/ +@[expose] public section + namespace Nat diff --git a/Mathlib/NumberTheory/Primorial.lean b/Mathlib/NumberTheory/Primorial.lean index f785e3d272e699..b3a0987fd24c00 100644 --- a/Mathlib/NumberTheory/Primorial.lean +++ b/Mathlib/NumberTheory/Primorial.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Patrick Stevens. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Stevens, Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Associated -import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Data.Nat.Choose.Dvd -import Mathlib.Data.Nat.Prime.Basic +module + +public import Mathlib.Algebra.BigOperators.Associated +public import Mathlib.Algebra.Order.BigOperators.Ring.Finset +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Data.Nat.Choose.Dvd +public import Mathlib.Data.Nat.Prime.Basic /-! # Primorial @@ -22,6 +24,8 @@ We use the local notation `n#` for the primorial of `n`: that is, the product of than or equal to `n`. -/ +@[expose] public section + open Finset diff --git a/Mathlib/NumberTheory/PythagoreanTriples.lean b/Mathlib/NumberTheory/PythagoreanTriples.lean index 286c19b19aae6c..0139ac24818c1e 100644 --- a/Mathlib/NumberTheory/PythagoreanTriples.lean +++ b/Mathlib/NumberTheory/PythagoreanTriples.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Paul van Wamelen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul van Wamelen -/ -import Mathlib.Data.Int.NatPrime -import Mathlib.Data.ZMod.Basic -import Mathlib.RingTheory.Int.Basic -import Mathlib.Tactic.Field +module + +public import Mathlib.Data.Int.NatPrime +public import Mathlib.Data.ZMod.Basic +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.Tactic.Field /-! # Pythagorean Triples @@ -22,6 +24,8 @@ analyze the parity of `x`, `y`, `m` and `n` and eliminate all the impossible cas the bulk of the proof below. -/ +@[expose] public section + assert_not_exists TwoSidedIdeal theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z ≠ 2 := by diff --git a/Mathlib/NumberTheory/RamificationInertia/Basic.lean b/Mathlib/NumberTheory/RamificationInertia/Basic.lean index 04ba81bc6d1d93..d9c47e3b7ea881 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Basic.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas -import Mathlib.RingTheory.Finiteness.Quotient -import Mathlib.RingTheory.Ideal.Norm.AbsNorm +module + +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +public import Mathlib.RingTheory.Finiteness.Quotient +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm /-! # Ramification index and inertia degree @@ -40,6 +42,8 @@ leaving `p` and `P` implicit. -/ +@[expose] public section + namespace Ideal diff --git a/Mathlib/NumberTheory/RamificationInertia/Galois.lean b/Mathlib/NumberTheory/RamificationInertia/Galois.lean index b98619b91b2e7a..f314b7e30f7c8a 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Galois.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Galois.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yongle Hu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongle Hu, Jiedong Jiang -/ -import Mathlib.FieldTheory.Galois.IsGaloisGroup -import Mathlib.NumberTheory.RamificationInertia.Basic +module + +public import Mathlib.FieldTheory.Galois.IsGaloisGroup +public import Mathlib.NumberTheory.RamificationInertia.Basic /-! # Ramification theory in Galois extensions of Dedekind domains @@ -41,6 +43,8 @@ Assume `B / A` is a finite extension of Dedekind domains, `K` is the fraction ri -/ +@[expose] public section + open Algebra Pointwise attribute [local instance] FractionRing.liftAlgebra diff --git a/Mathlib/NumberTheory/RamificationInertia/Unramified.lean b/Mathlib/NumberTheory/RamificationInertia/Unramified.lean index 915af5c09e08fe..cefa048b836cb5 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Unramified.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Unramified.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.NumberTheory.RamificationInertia.Basic -import Mathlib.RingTheory.LocalRing.ResidueField.Instances -import Mathlib.RingTheory.Unramified.LocalRing +module + +public import Mathlib.NumberTheory.RamificationInertia.Basic +public import Mathlib.RingTheory.LocalRing.ResidueField.Instances +public import Mathlib.RingTheory.Unramified.LocalRing /-! @@ -20,6 +22,8 @@ We connect `Ideal.ramificationIdx` to the commutative algebra notion predicate o -/ +@[expose] public section + variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra S T] [Algebra R T] [IsScalarTower R S T] diff --git a/Mathlib/NumberTheory/Rayleigh.lean b/Mathlib/NumberTheory/Rayleigh.lean index c22cbd9345c8bb..6f5a2a7626abe6 100644 --- a/Mathlib/NumberTheory/Rayleigh.lean +++ b/Mathlib/NumberTheory/Rayleigh.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Jason Yuen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jason Yuen -/ -import Mathlib.Data.Real.ConjExponents -import Mathlib.NumberTheory.Real.Irrational +module + +public import Mathlib.Data.Real.ConjExponents +public import Mathlib.NumberTheory.Real.Irrational /-! # Rayleigh's theorem on Beatty sequences @@ -45,6 +47,8 @@ The main statements are: beatty, sequence, rayleigh, irrational, floor, positive -/ +@[expose] public section + /-- In the Beatty sequence for real number `r`, the `k`th term is `⌊k * r⌋`. -/ noncomputable def beattySeq (r : ℝ) : ℤ → ℤ := fun k ↦ ⌊k * r⌋ diff --git a/Mathlib/NumberTheory/Real/GoldenRatio.lean b/Mathlib/NumberTheory/Real/GoldenRatio.lean index 14d9c1efdc7be3..99c2e276761c21 100644 --- a/Mathlib/NumberTheory/Real/GoldenRatio.lean +++ b/Mathlib/NumberTheory/Real/GoldenRatio.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu, Kamila Szewczyk -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.LinearRecurrence -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.Nat.Fib.Basic -import Mathlib.NumberTheory.Real.Irrational -import Mathlib.Tactic.NormNum.NatFib -import Mathlib.Tactic.NormNum.Prime +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.LinearRecurrence +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.Nat.Fib.Basic +public import Mathlib.NumberTheory.Real.Irrational +public import Mathlib.Tactic.NormNum.NatFib +public import Mathlib.Tactic.NormNum.Prime /-! # The golden ratio and its conjugate @@ -22,6 +24,8 @@ irrationality, and we link them to the Fibonacci sequence by proving Binet's formula. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/NumberTheory/Real/Irrational.lean b/Mathlib/NumberTheory/Real/Irrational.lean index 5a791418cef0cd..58bf115e3f7185 100644 --- a/Mathlib/NumberTheory/Real/Irrational.lean +++ b/Mathlib/NumberTheory/Real/Irrational.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Data.Nat.Prime.Int -import Mathlib.Data.Rat.Sqrt -import Mathlib.Data.Real.Sqrt -import Mathlib.RingTheory.Algebraic.Basic -import Mathlib.Tactic.IntervalCases +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.Data.Rat.Sqrt +public import Mathlib.Data.Real.Sqrt +public import Mathlib.RingTheory.Algebraic.Basic +public import Mathlib.Tactic.IntervalCases /-! # Irrational real numbers @@ -24,6 +26,8 @@ when `n` is a numeric literal or cast; but this only works if you `unseal Nat.sqrt.iter in` before the theorem where you use this proof. -/ +@[expose] public section + open Rat Real diff --git a/Mathlib/NumberTheory/SelbergSieve.lean b/Mathlib/NumberTheory/SelbergSieve.lean index de43f0cba13350..036d64a8c6ceda 100644 --- a/Mathlib/NumberTheory/SelbergSieve.lean +++ b/Mathlib/NumberTheory/SelbergSieve.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Arend Mellendijk. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ -import Mathlib.Data.Real.Basic -import Mathlib.NumberTheory.ArithmeticFunction +module + +public import Mathlib.Data.Real.Basic +public import Mathlib.NumberTheory.ArithmeticFunction /-! # The Selberg Sieve @@ -28,6 +30,8 @@ minor notational difference is that we write $\nu(n)$ in place of $\frac{\omega( -/ +@[expose] public section + noncomputable section open scoped BigOperators ArithmeticFunction @@ -82,7 +86,7 @@ open Lean Meta Qq /-- Extension for the `positivity` tactic: `BoundingSieve.weights`. -/ @[positivity BoundingSieve.weights _ _] -def evalBoundingSieveWeights : PositivityExt where eval {u α} _zα _pα e := do +meta def evalBoundingSieveWeights : PositivityExt where eval {u α} _zα _pα e := do match u, α, e with | 0, ~q(ℝ), ~q(@BoundingSieve.weights $s $n) => assertInstancesCommute diff --git a/Mathlib/NumberTheory/SiegelsLemma.lean b/Mathlib/NumberTheory/SiegelsLemma.lean index 65174777410968..b189d605e37507 100644 --- a/Mathlib/NumberTheory/SiegelsLemma.lean +++ b/Mathlib/NumberTheory/SiegelsLemma.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero, Laura Capuano, Amos Turchet -/ -import Mathlib.Analysis.Matrix.Normed -import Mathlib.Data.Pi.Interval -import Mathlib.Tactic.Rify +module + +public import Mathlib.Analysis.Matrix.Normed +public import Mathlib.Data.Pi.Interval +public import Mathlib.Tactic.Rify /-! # Siegel's Lemma @@ -31,6 +33,8 @@ the entries of the matrix See [M. Hindry and J. Silverman, Diophantine Geometry: an Introduction][hindrysilverman00]. -/ +@[expose] public section + /- We set ‖⬝‖ to be Matrix.seminormedAddCommGroup -/ attribute [local instance] Matrix.seminormedAddCommGroup @@ -75,7 +79,7 @@ private lemma image_T_subset_S [DecidableEq α] [DecidableEq β] (v) (hv : v ∈ refine ⟨fun i ↦ ?_, fun i ↦ ?_⟩ all_goals simp only [mul_neg] - gcongr ∑ _ : α, ?_ with j _ -- Get rid of sums + gcongr ∑ _ : β, ?_ with j _ -- Get rid of sums rw [← mul_comm (v j)] -- Move A i j to the right of the products rcases le_total 0 (A i j) with hsign | hsign-- We have to distinguish cases: we have now 4 goals · rw [negPart_eq_zero.2 hsign] diff --git a/Mathlib/NumberTheory/SmoothNumbers.lean b/Mathlib/NumberTheory/SmoothNumbers.lean index f8bdb979e8bfda..95a9e779c91bef 100644 --- a/Mathlib/NumberTheory/SmoothNumbers.lean +++ b/Mathlib/NumberTheory/SmoothNumbers.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll, Ralf Stephan -/ -import Mathlib.Data.Nat.Factorization.Defs -import Mathlib.Data.Nat.Squarefree +module + +public import Mathlib.Data.Nat.Factorization.Defs +public import Mathlib.Data.Nat.Squarefree /-! # Smooth numbers @@ -30,6 +32,8 @@ and we provide some API, in particular bounds for their cardinalities; see `Nat.smoothNumbersUpTo_card_le` and `Nat.roughNumbersUpTo_card_le`. -/ +@[expose] public section + open scoped Finset namespace Nat diff --git a/Mathlib/NumberTheory/SumFourSquares.lean b/Mathlib/NumberTheory/SumFourSquares.lean index beb982876d85b8..e3cc686afcbf04 100644 --- a/Mathlib/NumberTheory/SumFourSquares.lean +++ b/Mathlib/NumberTheory/SumFourSquares.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.FieldTheory.Finite.Basic /-! # Lagrange's four square theorem @@ -16,6 +18,8 @@ a proof that every natural number is the sum of four square numbers. The proof used is close to Lagrange's original proof. -/ +@[expose] public section + open Finset Polynomial FiniteField Equiv diff --git a/Mathlib/NumberTheory/SumPrimeReciprocals.lean b/Mathlib/NumberTheory/SumPrimeReciprocals.lean index 50a1f778b3956b..684c602ee56762 100644 --- a/Mathlib/NumberTheory/SumPrimeReciprocals.lean +++ b/Mathlib/NumberTheory/SumPrimeReciprocals.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.Algebra.Order.Group.Indicator -import Mathlib.Analysis.PSeries -import Mathlib.NumberTheory.SmoothNumbers +module + +public import Mathlib.Algebra.Order.Group.Indicator +public import Mathlib.Analysis.PSeries +public import Mathlib.NumberTheory.SmoothNumbers /-! # The sum of the reciprocals of the primes diverges @@ -23,6 +25,8 @@ See the sixth proof for the infinity of primes in Chapter 1 of [aigner1999proofs The proof is due to Erdős. -/ +@[expose] public section + open Set Nat open scoped Topology diff --git a/Mathlib/NumberTheory/SumTwoSquares.lean b/Mathlib/NumberTheory/SumTwoSquares.lean index 1a7baa2155f776..534d5846add505 100644 --- a/Mathlib/NumberTheory/SumTwoSquares.lean +++ b/Mathlib/NumberTheory/SumTwoSquares.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Michael Stoll -/ -import Mathlib.Data.Nat.Squarefree -import Mathlib.NumberTheory.Zsqrtd.QuadraticReciprocity -import Mathlib.NumberTheory.Padics.PadicVal.Basic +module + +public import Mathlib.Data.Nat.Squarefree +public import Mathlib.NumberTheory.Zsqrtd.QuadraticReciprocity +public import Mathlib.NumberTheory.Padics.PadicVal.Basic /-! # Sums of two squares @@ -21,6 +23,8 @@ There is an alternative characterization as the numbers of the form `a^2 * b`, w natural number such that `-1` is a square modulo `b`; see `Nat.eq_sq_add_sq_iff_eq_sq_mul`. -/ +@[expose] public section + section Fermat @@ -222,7 +226,7 @@ theorem Nat.eq_sq_add_sq_iff {n : ℕ} : refine eq_sq_add_sq_iff_eq_sq_mul.trans ⟨fun ⟨a, b, h₁, h₂⟩ q hq h ↦ ?_, fun H ↦ ?_⟩ · have : Fact q.Prime := ⟨prime_of_mem_primeFactors hq⟩ have : q ∣ b → q ∈ b.primeFactors := by grind [mem_primeFactors] - grind [padicValNat.mul, padicValNat.pow, + grind (splits := 10) [padicValNat.mul, padicValNat.pow, padicValNat.eq_zero_of_not_dvd, mod_four_ne_three_of_mem_primeFactors_of_isSquare_neg_one] · obtain ⟨b, a, hb₀, ha₀, hab, hb⟩ := sq_mul_squarefree_of_pos hn₀ refine ⟨a, b, hab.symm, ZMod.isSquare_neg_one_iff_forall_mem_primeFactors_mod_four_ne_three hb diff --git a/Mathlib/NumberTheory/Transcendental/Lindemann/AnalyticalPart.lean b/Mathlib/NumberTheory/Transcendental/Lindemann/AnalyticalPart.lean index 2784516889fe3e..2b73dbf68fac2a 100644 --- a/Mathlib/NumberTheory/Transcendental/Lindemann/AnalyticalPart.lean +++ b/Mathlib/NumberTheory/Transcendental/Lindemann/AnalyticalPart.lean @@ -3,17 +3,21 @@ Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.Algebra.Polynomial.SumIteratedDerivative -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus -import Mathlib.RingTheory.Int.Basic -import Mathlib.Topology.Algebra.Polynomial +module + +public import Mathlib.Algebra.Polynomial.SumIteratedDerivative +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.Topology.Algebra.Polynomial /-! # Analytic part of the Lindemann-Weierstrass theorem -/ +@[expose] public section + namespace LindemannWeierstrass noncomputable section diff --git a/Mathlib/NumberTheory/Transcendental/Liouville/Basic.lean b/Mathlib/NumberTheory/Transcendental/Liouville/Basic.lean index 5ade825af7dbea..961fbda340d237 100644 --- a/Mathlib/NumberTheory/Transcendental/Liouville/Basic.lean +++ b/Mathlib/NumberTheory/Transcendental/Liouville/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Jujian Zhang -/ -import Mathlib.Algebra.Polynomial.DenomsClearable -import Mathlib.Analysis.Calculus.MeanValue -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.NumberTheory.Real.Irrational -import Mathlib.Topology.Algebra.Polynomial +module + +public import Mathlib.Algebra.Polynomial.DenomsClearable +public import Mathlib.Analysis.Calculus.MeanValue +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.NumberTheory.Real.Irrational +public import Mathlib.Topology.Algebra.Polynomial /-! @@ -23,6 +25,8 @@ and obtain precise inequalities that ultimately allow us to prove transcendence Liouville numbers. -/ +@[expose] public section + /-- A Liouville number is a real number `x` such that for every natural number `n`, there exist `a, b ∈ ℤ` with `1 < b` such that `0 < |x - a/b| < 1/bⁿ`. diff --git a/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleNumber.lean b/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleNumber.lean index 96179b6407c959..42ffe3c7473802 100644 --- a/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleNumber.lean +++ b/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleNumber.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Jujian Zhang -/ -import Mathlib.NumberTheory.Transcendental.Liouville.Basic +module + +public import Mathlib.NumberTheory.Transcendental.Liouville.Basic /-! @@ -22,7 +24,7 @@ if the series does not converge, then the sum of the series is defined to be zer We prove that, for $m \in \mathbb{N}$ satisfying $2 \le m$, Liouville's constant associated to $m$ is a transcendental number. Classically, the Liouville number for $m = 2$ is the one called -``Liouville's constant''. +"Liouville's constant". ## Implementation notes @@ -30,6 +32,8 @@ The indexing $m$ is eventually a natural number satisfying $2 ≤ m$. However, w lemmas for $m \in \mathbb{R}$. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleWith.lean b/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleWith.lean index eabcb921d7a25d..e4f4694d66a8d7 100644 --- a/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleWith.lean +++ b/Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleWith.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics -import Mathlib.NumberTheory.Transcendental.Liouville.Basic -import Mathlib.Topology.Instances.Irrational +module + +public import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +public import Mathlib.NumberTheory.Transcendental.Liouville.Basic +public import Mathlib.Topology.Instances.Irrational /-! # Liouville numbers with a given exponent @@ -33,6 +35,8 @@ predicate. Liouville number, irrational, irrationality exponent -/ +@[expose] public section + open Filter Metric Real Set @@ -294,9 +298,8 @@ variable {x : ℝ} exists a numerator `a` such that `x ≠ a / b` and `|x - a / b| < 1 / b ^ n`. -/ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) : ∃ᶠ b : ℕ in atTop, ∃ a : ℤ, x ≠ a / b ∧ |x - a / b| < 1 / (b : ℝ) ^ n := by - refine Classical.not_not.1 fun H => ?_ - simp only [not_exists, not_frequently, not_and, not_lt, - eventually_atTop] at H + by_contra! H + simp only [eventually_atTop] at H rcases H with ⟨N, hN⟩ have : ∀ b > (1 : ℕ), ∀ᶠ m : ℕ in atTop, ∀ a : ℤ, 1 / (b : ℝ) ^ m ≤ |x - a / b| := by intro b hb diff --git a/Mathlib/NumberTheory/Transcendental/Liouville/Measure.lean b/Mathlib/NumberTheory/Transcendental/Liouville/Measure.lean index 2f4fd8c5f7bd92..c303c6d4b1fc67 100644 --- a/Mathlib/NumberTheory/Transcendental/Liouville/Measure.lean +++ b/Mathlib/NumberTheory/Transcendental/Liouville/Measure.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.MeasureTheory.Measure.Lebesgue.Basic -import Mathlib.NumberTheory.Transcendental.Liouville.Residual -import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleWith -import Mathlib.Analysis.PSeries +module + +public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +public import Mathlib.NumberTheory.Transcendental.Liouville.Residual +public import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleWith +public import Mathlib.Analysis.PSeries /-! # Volume of the set of Liouville numbers @@ -25,6 +27,8 @@ measure. The fact that the filters are disjoint means that two mutually exclusiv Liouville number, Lebesgue measure, residual, generic property -/ +@[expose] public section + open scoped Filter ENNReal Topology NNReal open Filter Set Metric MeasureTheory Real diff --git a/Mathlib/NumberTheory/Transcendental/Liouville/Residual.lean b/Mathlib/NumberTheory/Transcendental/Liouville/Residual.lean index 95a9a895e3284f..a4d28119adbe14 100644 --- a/Mathlib/NumberTheory/Transcendental/Liouville/Residual.lean +++ b/Mathlib/NumberTheory/Transcendental/Liouville/Residual.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.NumberTheory.Transcendental.Liouville.Basic -import Mathlib.Topology.Baire.Lemmas -import Mathlib.Topology.Baire.LocallyCompactRegular -import Mathlib.Topology.Instances.Irrational +module + +public import Mathlib.NumberTheory.Transcendental.Liouville.Basic +public import Mathlib.Topology.Baire.Lemmas +public import Mathlib.Topology.Baire.LocallyCompactRegular +public import Mathlib.Topology.Instances.Irrational /-! # Density of Liouville numbers @@ -15,6 +17,8 @@ In this file we prove that the set of Liouville numbers form a dense `Gδ` set. similar statement about irrational numbers. -/ +@[expose] public section + open scoped Filter diff --git a/Mathlib/NumberTheory/TsumDivsorsAntidiagonal.lean b/Mathlib/NumberTheory/TsumDivsorsAntidiagonal.lean index e784abfca32d3e..a4c03e8c7c0206 100644 --- a/Mathlib/NumberTheory/TsumDivsorsAntidiagonal.lean +++ b/Mathlib/NumberTheory/TsumDivsorsAntidiagonal.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Analysis.SpecificLimits.Normed -import Mathlib.NumberTheory.ArithmeticFunction +module + +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.NumberTheory.ArithmeticFunction /-! # Lemmas on infinite sums over the antidiagonal of the divisors function @@ -19,6 +21,8 @@ Lambert series. -/ +@[expose] public section + open Filter Complex ArithmeticFunction Nat Topology /-- The map from `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` diff --git a/Mathlib/NumberTheory/VonMangoldt.lean b/Mathlib/NumberTheory/VonMangoldt.lean index c2ece7dda9ef4d..f9bd6727cfdb3c 100644 --- a/Mathlib/NumberTheory/VonMangoldt.lean +++ b/Mathlib/NumberTheory/VonMangoldt.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Analysis.SpecialFunctions.Log.Basic -import Mathlib.Data.Nat.Cast.Field -import Mathlib.Data.Nat.Factorization.PrimePow -import Mathlib.NumberTheory.ArithmeticFunction +module + +public import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.Data.Nat.Cast.Field +public import Mathlib.Data.Nat.Factorization.PrimePow +public import Mathlib.NumberTheory.ArithmeticFunction /-! # The von Mangoldt Function @@ -33,6 +35,8 @@ functions) and also in the scope `ArithmeticFunction.vonMangoldt`. -/ +@[expose] public section + namespace ArithmeticFunction open Finset Nat diff --git a/Mathlib/NumberTheory/WellApproximable.lean b/Mathlib/NumberTheory/WellApproximable.lean index 37c6943e548636..f827bb0dec5595 100644 --- a/Mathlib/NumberTheory/WellApproximable.lean +++ b/Mathlib/NumberTheory/WellApproximable.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Dynamics.Ergodic.AddCircle -import Mathlib.MeasureTheory.Covering.LiminfLimsup +module + +public import Mathlib.Dynamics.Ergodic.AddCircle +public import Mathlib.MeasureTheory.Covering.LiminfLimsup /-! # Well-approximable numbers and Gallagher's ergodic theorem @@ -57,6 +59,8 @@ Use `AddCircle.exists_norm_nsmul_le` to prove: (which is equivalent to `Real.infinite_rat_abs_sub_lt_one_div_den_sq_iff_irrational`). -/ +@[expose] public section + open Set Filter Function Metric MeasureTheory diff --git a/Mathlib/NumberTheory/Wilson.lean b/Mathlib/NumberTheory/Wilson.lean index bc6c1f1d92c49f..27055a7a60312d 100644 --- a/Mathlib/NumberTheory/Wilson.lean +++ b/Mathlib/NumberTheory/Wilson.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 John Nicol. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: John Nicol -/ -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.FieldTheory.Finite.Basic /-! # Wilson's theorem. @@ -24,6 +26,8 @@ This could be generalized to similar results about finite abelian groups. * Give `wilsons_lemma` a descriptive name. -/ +@[expose] public section + assert_not_exists legendreSym.quadratic_reciprocity open Finset Nat FiniteField ZMod diff --git a/Mathlib/NumberTheory/ZetaValues.lean b/Mathlib/NumberTheory/ZetaValues.lean index 7995b371e31dce..bb4660dd17100b 100644 --- a/Mathlib/NumberTheory/ZetaValues.lean +++ b/Mathlib/NumberTheory/ZetaValues.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ -import Mathlib.NumberTheory.BernoulliPolynomials -import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Analysis.Fourier.AddCircle -import Mathlib.Analysis.PSeries +module + +public import Mathlib.NumberTheory.BernoulliPolynomials +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Analysis.Fourier.AddCircle +public import Mathlib.Analysis.PSeries /-! # Critical values of the Riemann zeta function @@ -26,6 +28,8 @@ zeta functions, in terms of Bernoulli polynomials. an explicit multiple of `Bₖ(x)`, for any `x ∈ [0, 1]` and `k ≥ 3` odd. -/ +@[expose] public section + noncomputable section open scoped Nat Real Interval diff --git a/Mathlib/NumberTheory/Zsqrtd/Basic.lean b/Mathlib/NumberTheory/Zsqrtd/Basic.lean index 2af0248910337c..2c459ecef124be 100644 --- a/Mathlib/NumberTheory/Zsqrtd/Basic.lean +++ b/Mathlib/NumberTheory/Zsqrtd/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Ring.Associated -import Mathlib.Algebra.Star.Unitary -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.Tactic.Ring -import Mathlib.Algebra.EuclideanDomain.Int +module + +public import Mathlib.Algebra.Ring.Associated +public import Mathlib.Algebra.Star.Unitary +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.Tactic.Ring +public import Mathlib.Algebra.EuclideanDomain.Int /-! # ℤ[√d] @@ -21,6 +23,8 @@ to choices of square roots of `d` in `R`. -/ +@[expose] public section + /-- The ring of integers adjoined with a square root of `d`. These have the form `a + b √d` where `a b : ℤ`. The components @@ -675,10 +679,8 @@ protected theorem le_total (a b : ℤ√d) : a ≤ b ∨ b ≤ a := by rwa [neg_sub] at t instance preorder : Preorder (ℤ√d) where - le := (· ≤ ·) le_refl a := show Nonneg (a - a) by simp only [sub_self]; trivial le_trans a b c hab hbc := by simpa [sub_add_sub_cancel'] using hab.add hbc - lt := (· < ·) lt_iff_le_not_ge _ _ := (and_iff_right_of_imp (Zsqrtd.le_total _ _).resolve_left).symm open Int in diff --git a/Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean b/Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean index 4115235e77b14e..7781806446792f 100644 --- a/Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean +++ b/Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Complex.Basic -import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.Real.Archimedean -import Mathlib.NumberTheory.Zsqrtd.Basic +module + +public import Mathlib.Data.Complex.Basic +public import Mathlib.Data.Nat.Prime.Basic +public import Mathlib.Data.Real.Archimedean +public import Mathlib.NumberTheory.Zsqrtd.Basic /-! # Gaussian integers @@ -37,6 +39,8 @@ adjoined a square root of `d`, in this case `-1`. The definition is reducible, s and definitions about `Zsqrtd` can easily be used. -/ +@[expose] public section + open Zsqrtd Complex diff --git a/Mathlib/NumberTheory/Zsqrtd/QuadraticReciprocity.lean b/Mathlib/NumberTheory/Zsqrtd/QuadraticReciprocity.lean index efd9cb6524e882..9a49b15be82e3f 100644 --- a/Mathlib/NumberTheory/Zsqrtd/QuadraticReciprocity.lean +++ b/Mathlib/NumberTheory/Zsqrtd/QuadraticReciprocity.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.NumberTheory.Zsqrtd.GaussianInt -import Mathlib.NumberTheory.LegendreSymbol.Basic +module + +public import Mathlib.NumberTheory.Zsqrtd.GaussianInt +public import Mathlib.NumberTheory.LegendreSymbol.Basic /-! # Facts about the Gaussian integers relying on quadratic reciprocity. @@ -16,6 +18,8 @@ A prime natural number is prime in `ℤ[i]` if and only if it is `3` mod `4` -/ +@[expose] public section + open Zsqrtd Complex diff --git a/Mathlib/NumberTheory/Zsqrtd/ToReal.lean b/Mathlib/NumberTheory/Zsqrtd/ToReal.lean index 2a65601ee24b2c..dc952583add2d3 100644 --- a/Mathlib/NumberTheory/Zsqrtd/ToReal.lean +++ b/Mathlib/NumberTheory/Zsqrtd/ToReal.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Data.Real.Sqrt -import Mathlib.NumberTheory.Zsqrtd.Basic +module + +public import Mathlib.Data.Real.Sqrt +public import Mathlib.NumberTheory.Zsqrtd.Basic /-! # Image of `Zsqrtd` in `ℝ` @@ -13,6 +15,8 @@ This file defines `Zsqrtd.toReal` and related lemmas. It is in a separate file to avoid pulling in all of `Data.Real` into `Data.Zsqrtd`. -/ +@[expose] public section + namespace Zsqrtd diff --git a/Mathlib/Order/Antichain.lean b/Mathlib/Order/Antichain.lean index e0677b7bb72fde..118719ec68beaa 100644 --- a/Mathlib/Order/Antichain.lean +++ b/Mathlib/Order/Antichain.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.Preorder.Chain +module + +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.Preorder.Chain /-! # Antichains @@ -21,6 +23,8 @@ relation is `G.Adj` for `G : SimpleGraph α`, this corresponds to independent se * `IsMaxAntichain r s`: An antichain such that no antichain strictly including `s` exists. -/ +@[expose] public section + assert_not_exists CompleteLattice open Function Set diff --git a/Mathlib/Order/Antisymmetrization.lean b/Mathlib/Order/Antisymmetrization.lean index 810e495d4c5d05..a90975e3e71d1e 100644 --- a/Mathlib/Order/Antisymmetrization.lean +++ b/Mathlib/Order/Antisymmetrization.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Logic.Relation -import Mathlib.Order.Hom.Basic -import Mathlib.Tactic.Tauto +module + +public import Mathlib.Logic.Relation +public import Mathlib.Order.Hom.Basic +public import Mathlib.Tactic.Tauto /-! # Turning a preorder into a partial order @@ -23,6 +25,8 @@ such that `a ≤ b` and `b ≤ a`. preorder, `Antisymmetrization α` is a partial order. -/ +@[expose] public section + open Function OrderDual variable {α β : Type*} {a b c d : α} @@ -92,11 +96,11 @@ lemma AntisymmRel.left (h : AntisymmRel r a b) : r a b := h.1 lemma AntisymmRel.right (h : AntisymmRel r a b) : r b a := h.2 /-- See if the term is `AntisymmRel r a b` and the goal is `r a b`. -/ -@[gcongr_forward] def exactAntisymmRelLeft : ForwardExt where +@[gcongr_forward] meta def exactAntisymmRelLeft : ForwardExt where eval h goal := do goal.assignIfDefEq (← Lean.Meta.mkAppM ``AntisymmRel.left #[h]) /-- See if the term is `AntisymmRel r a b` and the goal is `r b a`. -/ -@[gcongr_forward] def exactAntisymmRelRight : ForwardExt where +@[gcongr_forward] meta def exactAntisymmRelRight : ForwardExt where eval h goal := do goal.assignIfDefEq (← Lean.Meta.mkAppM ``AntisymmRel.right #[h]) end Mathlib.Tactic.GCongr diff --git a/Mathlib/Order/Atoms.lean b/Mathlib/Order/Atoms.lean index 7bbe66af67bfdc..5129e1506f1834 100644 --- a/Mathlib/Order/Atoms.lean +++ b/Mathlib/Order/Atoms.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.ModularLattice -import Mathlib.Order.SuccPred.Basic -import Mathlib.Order.WellFounded -import Mathlib.Tactic.Nontriviality -import Mathlib.Order.ConditionallyCompleteLattice.Indexed +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.ModularLattice +public import Mathlib.Order.SuccPred.Basic +public import Mathlib.Order.WellFounded +public import Mathlib.Tactic.Nontriviality +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed /-! # Atoms, Coatoms, and Simple Lattices @@ -52,6 +54,8 @@ which are lattices with only two elements, and related ideas. -/ +@[expose] public section + open Order variable {ι : Sort*} {α β : Type*} @@ -740,7 +744,6 @@ instance OrderDual.instIsSimpleOrder {α} [LE α] [BoundedOrder α] [IsSimpleOrd /-- A simple `BoundedOrder` induces a preorder. This is not an instance to prevent loops. -/ protected def IsSimpleOrder.preorder {α} [LE α] [BoundedOrder α] [IsSimpleOrder α] : Preorder α where - le := (· ≤ ·) le_refl a := by rcases eq_bot_or_eq_top a with (rfl | rfl) <;> simp le_trans a b c := by rcases eq_bot_or_eq_top a with (rfl | rfl) diff --git a/Mathlib/Order/Atoms/Finite.lean b/Mathlib/Order/Atoms/Finite.lean index 1eb5d70f5014d1..c49b9b64753089 100644 --- a/Mathlib/Order/Atoms/Finite.lean +++ b/Mathlib/Order/Atoms/Finite.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.Atoms -import Mathlib.Order.Interval.Finset.Defs -import Mathlib.Order.Preorder.Finite +module + +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.Atoms +public import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Order.Preorder.Finite /-! # Atoms, Coatoms, Simple Lattices, and Finiteness @@ -19,6 +21,8 @@ This module contains some results on atoms and simple lattices in the finite con -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Order/Basic.lean b/Mathlib/Order/Basic.lean index f97ba4db625a43..af92aa31de0572 100644 --- a/Mathlib/Order/Basic.lean +++ b/Mathlib/Order/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Subtype -import Mathlib.Order.Defs.LinearOrder -import Mathlib.Order.Notation -import Mathlib.Tactic.GRewrite -import Mathlib.Tactic.Spread -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Inhabit -import Mathlib.Tactic.SimpRw +module + +public import Mathlib.Data.Subtype +public import Mathlib.Order.Defs.LinearOrder +public import Mathlib.Order.Notation +public import Mathlib.Tactic.GRewrite +public import Mathlib.Tactic.Spread +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Inhabit +public import Mathlib.Tactic.SimpRw /-! # Basic definitions about `≤` and `<` @@ -58,6 +60,8 @@ provide many aliases to dot notation-less lemmas. For example, `le_trans` is ali preorder, order, partial order, poset, linear order, chain -/ +@[expose] public section + open Function @@ -128,8 +132,6 @@ lemma not_lt_iff_le_imp_ge : ¬ a < b ↔ (a ≤ b → b ≤ a) := by @[deprecated (since := "2025-05-11")] alias not_lt_iff_le_imp_le := not_lt_iff_le_imp_ge -lemma ge_of_eq (h : a = b) : b ≤ a := le_of_eq h.symm - @[simp] lemma lt_self_iff_false (x : α) : x < x ↔ False := ⟨lt_irrefl x, False.elim⟩ alias le_trans' := ge_trans @@ -195,10 +197,8 @@ theorem forall_ge_iff_le : (∀ ⦃c⦄, a ≤ c → b ≤ c) ↔ b ≤ a := namespace Mathlib.Tactic.GCongr -@[gcongr] theorem gt_imp_gt (h₁ : a ≤ c) (h₂ : d ≤ b) : a > b → c > d := lt_imp_lt_of_le_of_le h₂ h₁ - /-- See if the term is `a < b` and the goal is `a ≤ b`. -/ -@[gcongr_forward] def exactLeOfLt : ForwardExt where +@[gcongr_forward] meta def exactLeOfLt : ForwardExt where eval h goal := do goal.assignIfDefEq (← Lean.Meta.mkAppM ``le_of_lt #[h]) end Mathlib.Tactic.GCongr @@ -211,11 +211,6 @@ section PartialOrder variable [PartialOrder α] {a b : α} -theorem ge_antisymm : a ≤ b → b ≤ a → b = a := - flip le_antisymm - -theorem lt_of_le_of_ne' : a ≤ b → b ≠ a → a < b := fun h₁ h₂ ↦ lt_of_le_of_ne h₁ h₂.symm - theorem Ne.lt_of_le : a ≠ b → a ≤ b → a < b := flip lt_of_le_of_ne @@ -295,7 +290,6 @@ protected theorem Decidable.eq_or_lt_of_le [DecidableLE α] (h : a ≤ b) : a = theorem eq_or_lt_of_le (h : a ≤ b) : a = b ∨ a < b := (lt_or_eq_of_le h).symm theorem eq_or_lt_of_le' (h : a ≤ b) : b = a ∨ a < b := (eq_or_lt_of_le h).imp Eq.symm id -theorem lt_or_eq_of_le' (h : a ≤ b) : a < b ∨ b = a := (eq_or_lt_of_le' h).symm alias LE.le.lt_or_eq_dec := Decidable.lt_or_eq_of_le alias LE.le.eq_or_lt_dec := Decidable.eq_or_lt_of_le @@ -378,15 +372,6 @@ lemma gt_or_lt (h : a < b) (c : α) : a < c ∨ c < b := (le_or_gt b c).imp h.tr end LT.lt --- Variant of `min_def` with the branches reversed. -theorem min_def' (a b : α) : min a b = if b ≤ a then b else a := by - grind - --- Variant of `min_def` with the branches reversed. --- This is sometimes useful as it used to be the default. -theorem max_def' (a b : α) : max a b = if b ≤ a then a else b := by - grind - @[deprecated (since := "2025-05-11")] alias lt_of_not_le := lt_of_not_ge @[deprecated (since := "2025-05-11")] alias lt_iff_not_le := lt_iff_not_ge diff --git a/Mathlib/Order/Birkhoff.lean b/Mathlib/Order/Birkhoff.lean index b2b80f993925d2..5cc9e4b59e698a 100644 --- a/Mathlib/Order/Birkhoff.lean +++ b/Mathlib/Order/Birkhoff.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Filippo A. E. Nuccio, Sam van Gool -/ -import Mathlib.Data.Fintype.Order -import Mathlib.Order.Interval.Finset.Basic -import Mathlib.Order.Irreducible -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Data.Fintype.Order +public import Mathlib.Order.Interval.Finset.Basic +public import Mathlib.Order.Irreducible +public import Mathlib.Order.UpperLower.Closure /-! # Birkhoff representation @@ -48,6 +50,8 @@ partial orders. TODO: extend to morphisms. birkhoff, representation, stone duality, lattice embedding -/ +@[expose] public section + open Finset Function OrderDual UpperSet LowerSet variable {α : Type*} diff --git a/Mathlib/Order/BooleanAlgebra.lean b/Mathlib/Order/BooleanAlgebra.lean index 5d6a1b2ca02dca..29db2c078ccba8 100644 --- a/Mathlib/Order/BooleanAlgebra.lean +++ b/Mathlib/Order/BooleanAlgebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Bryan Gin-ge Chen -/ -import Mathlib.Order.BooleanAlgebra.Defs -import Mathlib.Order.BooleanAlgebra.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Order.BooleanAlgebra.Defs +public import Mathlib.Order.BooleanAlgebra.Basic +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-06-19") diff --git a/Mathlib/Order/BooleanAlgebra/Basic.lean b/Mathlib/Order/BooleanAlgebra/Basic.lean index 205f0c812de485..67c491afb64ad4 100644 --- a/Mathlib/Order/BooleanAlgebra/Basic.lean +++ b/Mathlib/Order/BooleanAlgebra/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Bryan Gin-ge Chen -/ -import Mathlib.Order.BooleanAlgebra.Defs +module + +public import Mathlib.Order.BooleanAlgebra.Defs /-! # Basic properties of Boolean algebras @@ -23,6 +25,8 @@ generalized Boolean algebras, Boolean algebras, lattices, sdiff, compl -/ +@[expose] public section + universe u v variable {α : Type u} {β : Type*} {x y z : α} @@ -630,9 +634,6 @@ protected abbrev Function.Injective.booleanAlgebra [Max α] [Min α] [Top α] [B (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) (map_himp : ∀ a b, f (a ⇨ b) = f a ⇨ f b) : BooleanAlgebra α where __ := hf.generalizedBooleanAlgebra f map_sup map_inf map_bot map_sdiff - compl := compl - himp := himp - top := ⊤ le_top _ := (@le_top β _ _ _).trans map_top.ge bot_le _ := map_bot.le.trans bot_le inf_compl_le_bot a := ((map_inf _ _).trans <| by rw [map_compl, inf_compl_eq_bot, map_bot]).le diff --git a/Mathlib/Order/BooleanAlgebra/Defs.lean b/Mathlib/Order/BooleanAlgebra/Defs.lean index 712b090d7223c0..afe95f53464d75 100644 --- a/Mathlib/Order/BooleanAlgebra/Defs.lean +++ b/Mathlib/Order/BooleanAlgebra/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Bryan Gin-ge Chen -/ -import Mathlib.Order.Heyting.Basic +module + +public import Mathlib.Order.Heyting.Basic /-! # (Generalized) Boolean algebras @@ -55,6 +57,8 @@ that for all `a, b : α` where `a ≤ b`, the equations `x ⊔ a = b` and `x ⊓ generalized Boolean algebras, Boolean algebras, lattices, sdiff, compl -/ +@[expose] public section + assert_not_exists RelIso open Function OrderDual diff --git a/Mathlib/Order/BooleanAlgebra/Set.lean b/Mathlib/Order/BooleanAlgebra/Set.lean index c08894d572b868..477cc4c4bd5002 100644 --- a/Mathlib/Order/BooleanAlgebra/Set.lean +++ b/Mathlib/Order/BooleanAlgebra/Set.lean @@ -3,8 +3,10 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura -/ -import Mathlib.Data.Set.Insert -import Mathlib.Order.BooleanAlgebra.Basic +module + +public import Mathlib.Data.Set.Insert +public import Mathlib.Order.BooleanAlgebra.Basic /-! # Boolean algebra of sets @@ -21,6 +23,8 @@ complement. set, sets, subset, subsets, complement -/ +@[expose] public section + assert_not_exists RelIso open Function diff --git a/Mathlib/Order/BooleanGenerators.lean b/Mathlib/Order/BooleanGenerators.lean index c3a0f3ae8459cd..f3047f9e9c03bd 100644 --- a/Mathlib/Order/BooleanGenerators.lean +++ b/Mathlib/Order/BooleanGenerators.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Order.CompactlyGenerated.Basic +module + +public import Mathlib.Order.CompactlyGenerated.Basic /-! # Generators for Boolean algebras @@ -30,6 +32,8 @@ A set of *Boolean generators* in a compactly generated complete lattice is a sub -/ +@[expose] public section + namespace IsCompactlyGenerated open CompleteLattice diff --git a/Mathlib/Order/BooleanSubalgebra.lean b/Mathlib/Order/BooleanSubalgebra.lean index 16304b8b32dbf6..b2fd0a970a1b93 100644 --- a/Mathlib/Order/BooleanSubalgebra.lean +++ b/Mathlib/Order/BooleanSubalgebra.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Sublattice +module + +public import Mathlib.Order.Sublattice /-! # Boolean subalgebras @@ -11,6 +13,8 @@ import Mathlib.Order.Sublattice This file defines Boolean subalgebras. -/ +@[expose] public section + open Function Set variable {ι : Sort*} {α β γ : Type*} diff --git a/Mathlib/Order/Booleanisation.lean b/Mathlib/Order/Booleanisation.lean index c12777abd20ac7..cfbb8f09225bd4 100644 --- a/Mathlib/Order/Booleanisation.lean +++ b/Mathlib/Order/Booleanisation.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.BooleanAlgebra.Basic -import Mathlib.Order.Hom.Lattice +module + +public import Mathlib.Order.BooleanAlgebra.Basic +public import Mathlib.Order.Hom.Lattice /-! # Adding complements to a generalized Boolean algebra @@ -28,6 +30,8 @@ If mathlib ever acquires `GenBoolAlg`, the category of generalised Boolean algeb show that `Booleanisation` is the free functor from `GenBoolAlg` to `BoolAlg`. -/ +@[expose] public section + open Function variable {α : Type*} @@ -47,7 +51,7 @@ instance instDecidableEq [DecidableEq α] : DecidableEq (Booleanisation α) := algebra. -/ @[match_pattern] def lift : α → Booleanisation α := Sum.inl -/-- The inclusion `a ↦ aᶜ from a generalized Boolean algebra to its generated Boolean algebra. -/ +/-- The inclusion `a ↦ aᶜ` from a generalized Boolean algebra to its generated Boolean algebra. -/ @[match_pattern] def comp : α → Booleanisation α := Sum.inr /-- The complement operator on `Booleanisation α` sends `a` to `aᶜ` and `aᶜ` to `a`, for `a : α`. -/ diff --git a/Mathlib/Order/Bounded.lean b/Mathlib/Order/Bounded.lean index 82fad54aa4cae4..c56f5fd3dc89f2 100644 --- a/Mathlib/Order/Bounded.lean +++ b/Mathlib/Order/Bounded.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.RelClasses -import Mathlib.Order.Interval.Set.Basic +module + +public import Mathlib.Order.RelClasses +public import Mathlib.Order.Interval.Set.Basic /-! # Bounded and unbounded sets @@ -13,6 +15,8 @@ the same ideas, or similar results with a few minor differences. The file is div different general ideas. -/ +@[expose] public section + assert_not_exists RelIso namespace Set diff --git a/Mathlib/Order/BoundedOrder/Basic.lean b/Mathlib/Order/BoundedOrder/Basic.lean index 6735b70adc057d..d81c823612d066 100644 --- a/Mathlib/Order/BoundedOrder/Basic.lean +++ b/Mathlib/Order/BoundedOrder/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.Max -import Mathlib.Order.ULift -import Mathlib.Tactic.ByCases -import Mathlib.Tactic.Finiteness.Attr -import Mathlib.Util.AssertExists +module + +public import Mathlib.Order.Max +public import Mathlib.Order.ULift +public import Mathlib.Tactic.ByCases +public import Mathlib.Tactic.Finiteness.Attr +public import Mathlib.Util.AssertExists /-! # ⊤ and ⊥, bounded lattices and variants @@ -24,6 +26,8 @@ instances for `Prop` and `fun`. -/ +@[expose] public section + assert_not_exists Monotone universe u v @@ -227,21 +231,15 @@ instance instOrderBot [LE α] [OrderTop α] : OrderBot αᵒᵈ where __ := inferInstanceAs (Bot αᵒᵈ) bot_le := @le_top α _ _ -@[simp] -theorem ofDual_bot [Top α] : ofDual ⊥ = (⊤ : α) := - rfl - -@[simp] -theorem ofDual_top [Bot α] : ofDual ⊤ = (⊥ : α) := - rfl - -@[simp] -theorem toDual_bot [Bot α] : toDual (⊥ : α) = ⊤ := - rfl +@[simp] lemma ofDual_bot [Top α] : ofDual ⊥ = (⊤ : α) := rfl +@[simp] lemma ofDual_top [Bot α] : ofDual ⊤ = (⊥ : α) := rfl +@[simp] lemma toDual_bot [Bot α] : toDual (⊥ : α) = ⊤ := rfl +@[simp] lemma toDual_top [Top α] : toDual (⊤ : α) = ⊥ := rfl -@[simp] -theorem toDual_top [Top α] : toDual (⊤ : α) = ⊥ := - rfl +@[simp] lemma ofDual_eq_bot [Bot α] {a : αᵒᵈ} : ofDual a = ⊥ ↔ a = ⊤ := .rfl +@[simp] lemma ofDual_eq_top [Top α] {a : αᵒᵈ} : ofDual a = ⊤ ↔ a = ⊥ := .rfl +@[simp] lemma toDual_eq_bot [Top α] {a : α} : toDual a = ⊥ ↔ a = ⊤ := .rfl +@[simp] lemma toDual_eq_top [Bot α] {a : α} : toDual a = ⊤ ↔ a = ⊥ := .rfl end OrderDual diff --git a/Mathlib/Order/BoundedOrder/Lattice.lean b/Mathlib/Order/BoundedOrder/Lattice.lean index e5560d4df190bb..0b07cebae2777c 100644 --- a/Mathlib/Order/BoundedOrder/Lattice.lean +++ b/Mathlib/Order/BoundedOrder/Lattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.BoundedOrder.Basic -import Mathlib.Order.Lattice +module + +public import Mathlib.Order.BoundedOrder.Basic +public import Mathlib.Order.Lattice /-! # Bounded lattices @@ -22,6 +24,8 @@ instances for `Prop` and `fun`. Typical examples include `Prop` and `Set α`. -/ +@[expose] public section + open Function OrderDual universe u v diff --git a/Mathlib/Order/BoundedOrder/Monotone.lean b/Mathlib/Order/BoundedOrder/Monotone.lean index 5d956237521570..f540462ce35f31 100644 --- a/Mathlib/Order/BoundedOrder/Monotone.lean +++ b/Mathlib/Order/BoundedOrder/Monotone.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.BoundedOrder.Basic -import Mathlib.Order.Monotone.Basic +module + +public import Mathlib.Order.BoundedOrder.Basic +public import Mathlib.Order.Monotone.Basic /-! # Monotone functions on bounded orders -/ +@[expose] public section + assert_not_exists SemilatticeSup open Function OrderDual diff --git a/Mathlib/Order/Bounds/Basic.lean b/Mathlib/Order/Bounds/Basic.lean index eadc601894970e..7de250849659c0 100644 --- a/Mathlib/Order/Bounds/Basic.lean +++ b/Mathlib/Order/Bounds/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Order.Bounds.Defs -import Mathlib.Order.Directed -import Mathlib.Order.BoundedOrder.Monotone -import Mathlib.Order.Interval.Set.Basic +module + +public import Mathlib.Order.Bounds.Defs +public import Mathlib.Order.Directed +public import Mathlib.Order.BoundedOrder.Monotone +public import Mathlib.Order.Interval.Set.Basic /-! # Upper / lower bounds @@ -16,6 +18,8 @@ monotonicity, behaviour under `∪`, `∩`, `insert`, and provide formulas for `∅`, `univ`, and intervals. -/ +@[expose] public section + open Function Set open OrderDual (toDual ofDual) diff --git a/Mathlib/Order/Bounds/Defs.lean b/Mathlib/Order/Bounds/Defs.lean index 94fe6812e329fa..1af87b49705976 100644 --- a/Mathlib/Order/Bounds/Defs.lean +++ b/Mathlib/Order/Bounds/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Data.Set.Defs -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Data.Set.Defs +public import Mathlib.Tactic.TypeStar /-! # Definitions about upper/lower bounds @@ -22,6 +24,8 @@ In this file we define: * `IsCoinitialFor s t` : for all `a ∈ s` there exists `b ∈ t` such that `b ≤ a` -/ +@[expose] public section + variable {α : Type*} [LE α] /-- The set of upper bounds of a set. -/ diff --git a/Mathlib/Order/Bounds/Image.lean b/Mathlib/Order/Bounds/Image.lean index 5ce8615853725d..90ab2fa1d36e47 100644 --- a/Mathlib/Order/Bounds/Image.lean +++ b/Mathlib/Order/Bounds/Image.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Paul Lezeau -/ -import Mathlib.Data.Set.NAry -import Mathlib.Order.Bounds.Basic +module + +public import Mathlib.Data.Set.NAry +public import Mathlib.Order.Bounds.Basic /-! @@ -13,6 +15,8 @@ import Mathlib.Order.Bounds.Basic In this file we prove various results about the behaviour of bounds under monotone/antitone maps. -/ +@[expose] public section + open Function Set open OrderDual (toDual ofDual) diff --git a/Mathlib/Order/Bounds/Lattice.lean b/Mathlib/Order/Bounds/Lattice.lean index 9f1c66d33ee1da..e39410ca1b785d 100644 --- a/Mathlib/Order/Bounds/Lattice.lean +++ b/Mathlib/Order/Bounds/Lattice.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Data.Set.Lattice.Image /-! # Unions and intersections of bounds @@ -16,6 +18,8 @@ In a separate file as we need to import `Mathlib/Data/Set/Lattice.lean`. -/ +@[expose] public section + variable {α : Type*} [Preorder α] {ι : Sort*} {s : ι → Set α} open Set diff --git a/Mathlib/Order/Bounds/OrderIso.lean b/Mathlib/Order/Bounds/OrderIso.lean index 556858c744b2dd..94c45a8c856ac0 100644 --- a/Mathlib/Order/Bounds/OrderIso.lean +++ b/Mathlib/Order/Bounds/OrderIso.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Order.Bounds.Image -import Mathlib.Order.Hom.Set +module + +public import Mathlib.Order.Bounds.Image +public import Mathlib.Order.Hom.Set /-! # Order isomorphisms and bounds. -/ +@[expose] public section + open Set namespace OrderIso diff --git a/Mathlib/Order/BourbakiWitt.lean b/Mathlib/Order/BourbakiWitt.lean index ab51b1129b70d6..8d8d471229488b 100644 --- a/Mathlib/Order/BourbakiWitt.lean +++ b/Mathlib/Order/BourbakiWitt.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Finn Mortimore. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Finn Mortimore -/ -import Mathlib.Order.Preorder.Chain -import Mathlib.Data.Set.Lattice -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.Order.OmegaCompletePartialOrder +module + +public import Mathlib.Order.Preorder.Chain +public import Mathlib.Data.Set.Lattice +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.Order.OmegaCompletePartialOrder /-! # Bourbaki-Witt Theorem @@ -28,6 +30,8 @@ partial order and $f : X → X$ is inflationary (i.e. ∀ x, x ≤ f x), then $f The proof used can be found in [serge_lang_algebra] -/ +@[expose] public section + variable {α : Type*} /-- The type of nonempty chains of an order -/ diff --git a/Mathlib/Order/Category/BddDistLat.lean b/Mathlib/Order/Category/BddDistLat.lean index a589fb4071b2c2..ba42c38861ae3b 100644 --- a/Mathlib/Order/Category/BddDistLat.lean +++ b/Mathlib/Order/Category/BddDistLat.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.BddLat -import Mathlib.Order.Category.DistLat +module + +public import Mathlib.Order.Category.BddLat +public import Mathlib.Order.Category.DistLat /-! # The category of bounded distributive lattices @@ -15,6 +17,8 @@ Note that this category is sometimes called [`DistLat`](https://ncatlab.org/nlab being a lattice is understood to entail having a bottom and a top element. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Category/BddLat.lean b/Mathlib/Order/Category/BddLat.lean index 77cd9f1ec78dd1..8f5f62f5ca10fd 100644 --- a/Mathlib/Order/Category/BddLat.lean +++ b/Mathlib/Order/Category/BddLat.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.Adjunction.Unique -import Mathlib.Order.Category.BddOrd -import Mathlib.Order.Category.Lat -import Mathlib.Order.Category.Semilat -import Mathlib.Order.Hom.WithTopBot +module + +public import Mathlib.CategoryTheory.Adjunction.Unique +public import Mathlib.Order.Category.BddOrd +public import Mathlib.Order.Category.Lat +public import Mathlib.Order.Category.Semilat +public import Mathlib.Order.Hom.WithTopBot /-! # The category of bounded lattices @@ -18,6 +20,8 @@ In literature, this is sometimes called `Lat`, the category of lattices, because understood to entail having a bottom and a top element. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Category/BddOrd.lean b/Mathlib/Order/Category/BddOrd.lean index 9cba04c1bde13b..04ae17347758b6 100644 --- a/Mathlib/Order/Category/BddOrd.lean +++ b/Mathlib/Order/Category/BddOrd.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.Category.Bipointed -import Mathlib.Order.Category.PartOrd -import Mathlib.Order.Hom.Bounded +module + +public import Mathlib.CategoryTheory.Category.Bipointed +public import Mathlib.Order.Category.PartOrd +public import Mathlib.Order.Hom.Bounded /-! # The category of bounded orders @@ -13,6 +15,8 @@ import Mathlib.Order.Hom.Bounded This defines `BddOrd`, the category of bounded orders. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Order/Category/BoolAlg.lean b/Mathlib/Order/Category/BoolAlg.lean index f2556c955c686d..37bbaa2a8ae4c1 100644 --- a/Mathlib/Order/Category/BoolAlg.lean +++ b/Mathlib/Order/Category/BoolAlg.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.HeytAlg -import Mathlib.Order.Hom.CompleteLattice +module + +public import Mathlib.Order.Category.HeytAlg +public import Mathlib.Order.Hom.CompleteLattice /-! # The category of Boolean algebras @@ -12,6 +14,8 @@ import Mathlib.Order.Hom.CompleteLattice This defines `BoolAlg`, the category of Boolean algebras. -/ +@[expose] public section + open OrderDual Opposite Set @@ -21,6 +25,8 @@ open CategoryTheory /-- The category of Boolean algebras. -/ structure BoolAlg where + /-- Construct a bundled `BoolAlg` from the underlying type and typeclass. -/ + of :: /-- The underlying Boolean algebra. -/ carrier : Type* [str : BooleanAlgebra carrier] @@ -36,9 +42,6 @@ instance : CoeSort BoolAlg (Type _) := attribute [coe] BoolAlg.carrier -/-- Construct a bundled `BoolAlg` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [BooleanAlgebra X] : BoolAlg := ⟨X⟩ - /-- The type of morphisms in `BoolAlg R`. -/ @[ext] structure Hom (X Y : BoolAlg.{u}) where diff --git a/Mathlib/Order/Category/CompleteLat.lean b/Mathlib/Order/Category/CompleteLat.lean index 7bdbae6c01df8f..5ff78fd55f456b 100644 --- a/Mathlib/Order/Category/CompleteLat.lean +++ b/Mathlib/Order/Category/CompleteLat.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.BddLat -import Mathlib.Order.Hom.CompleteLattice +module + +public import Mathlib.Order.Category.BddLat +public import Mathlib.Order.Hom.CompleteLattice /-! # The category of complete lattices @@ -12,6 +14,8 @@ import Mathlib.Order.Hom.CompleteLattice This file defines `CompleteLat`, the category of complete lattices. -/ +@[expose] public section + universe u @@ -19,6 +23,8 @@ open CategoryTheory /-- The category of complete lattices. -/ structure CompleteLat where + /-- Construct a bundled `CompleteLat` from the underlying type and typeclass. -/ + of :: /-- The underlying lattice. -/ (carrier : Type*) [str : CompleteLattice carrier] @@ -34,9 +40,6 @@ instance : CoeSort CompleteLat (Type _) := attribute [coe] CompleteLat.carrier -/-- Construct a bundled `CompleteLat` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [CompleteLattice X] : CompleteLat := ⟨X⟩ - theorem coe_of (α : Type*) [CompleteLattice α] : ↥(of α) = α := rfl diff --git a/Mathlib/Order/Category/DistLat.lean b/Mathlib/Order/Category/DistLat.lean index 5662517cedbd45..8b8c7d7c2648f7 100644 --- a/Mathlib/Order/Category/DistLat.lean +++ b/Mathlib/Order/Category/DistLat.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.Lat +module + +public import Mathlib.Order.Category.Lat /-! # The category of distributive lattices @@ -15,6 +17,8 @@ correspond to `DistLat` as we don't require bottom or top elements. Instead, thi corresponds to `BddDistLat`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Category/FinBddDistLat.lean b/Mathlib/Order/Category/FinBddDistLat.lean index 46121beef610dc..01a2632a393c5f 100644 --- a/Mathlib/Order/Category/FinBddDistLat.lean +++ b/Mathlib/Order/Category/FinBddDistLat.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Fintype.Order -import Mathlib.Order.Category.BddDistLat -import Mathlib.Order.Category.FinPartOrd +module + +public import Mathlib.Data.Fintype.Order +public import Mathlib.Order.Category.BddDistLat +public import Mathlib.Order.Category.FinPartOrd /-! # The category of finite bounded distributive lattices @@ -14,6 +16,8 @@ This file defines `FinBddDistLat`, the category of finite distributive lattices bounded lattice homomorphisms. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Category/FinBoolAlg.lean b/Mathlib/Order/Category/FinBoolAlg.lean index aef0605d22eaf9..13e6dd7a344622 100644 --- a/Mathlib/Order/Category/FinBoolAlg.lean +++ b/Mathlib/Order/Category/FinBoolAlg.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Fintype.Powerset -import Mathlib.Order.Category.BoolAlg -import Mathlib.Order.Category.FinBddDistLat -import Mathlib.Order.Hom.CompleteLattice -import Mathlib.Tactic.ApplyFun -import Mathlib.Data.Set.Subsingleton +module + +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Order.Category.BoolAlg +public import Mathlib.Order.Category.FinBddDistLat +public import Mathlib.Order.Hom.CompleteLattice +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Data.Set.Subsingleton /-! # The category of finite Boolean algebras @@ -27,6 +29,8 @@ FintypeCat_to_FinBoolAlg_op.left_op `FinBoolAlg` is essentially small. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Category/FinPartOrd.lean b/Mathlib/Order/Category/FinPartOrd.lean index 0836d3707d354a..c6a348eeed045f 100644 --- a/Mathlib/Order/Category/FinPartOrd.lean +++ b/Mathlib/Order/Category/FinPartOrd.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.CategoryTheory.FintypeCat -import Mathlib.Order.Category.PartOrd +module + +public import Mathlib.CategoryTheory.FintypeCat +public import Mathlib.Order.Category.PartOrd /-! # The category of finite partial orders @@ -19,6 +21,8 @@ bounded. `FinPartOrd` is equivalent to a small category. -/ +@[expose] public section + universe u v diff --git a/Mathlib/Order/Category/Frm.lean b/Mathlib/Order/Category/Frm.lean index ab4a97f2890c5e..503260702a78a7 100644 --- a/Mathlib/Order/Category/Frm.lean +++ b/Mathlib/Order/Category/Frm.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.Lat -import Mathlib.Order.Hom.CompleteLattice -import Mathlib.CategoryTheory.ConcreteCategory.Bundled +module + +public import Mathlib.Order.Category.Lat +public import Mathlib.Order.Hom.CompleteLattice +public import Mathlib.CategoryTheory.ConcreteCategory.Bundled /-! # The category of frames @@ -17,6 +19,8 @@ This file defines `Frm`, the category of frames. * [nLab, *Frm*](https://ncatlab.org/nlab/show/Frm) -/ +@[expose] public section + universe u @@ -24,6 +28,8 @@ open CategoryTheory Order /-- The category of frames. -/ structure Frm where + /-- Construct a bundled `Frm` from the underlying type and typeclass. -/ + of :: /-- The underlying frame. -/ (carrier : Type*) [str : Frame carrier] @@ -39,9 +45,6 @@ instance : CoeSort Frm (Type _) := attribute [coe] Frm.carrier -/-- Construct a bundled `Frm` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [Frame X] : Frm := ⟨X⟩ - /-- The type of morphisms in `Frm R`. -/ @[ext] structure Hom (X Y : Frm.{u}) where diff --git a/Mathlib/Order/Category/HeytAlg.lean b/Mathlib/Order/Category/HeytAlg.lean index 97d19ad81d349d..cd29c06295d268 100644 --- a/Mathlib/Order/Category/HeytAlg.lean +++ b/Mathlib/Order/Category/HeytAlg.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.BddDistLat -import Mathlib.Order.Heyting.Hom +module + +public import Mathlib.Order.Category.BddDistLat +public import Mathlib.Order.Heyting.Hom /-! # The category of Heyting algebras @@ -12,6 +14,8 @@ import Mathlib.Order.Heyting.Hom This file defines `HeytAlg`, the category of Heyting algebras. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Category/Lat.lean b/Mathlib/Order/Category/Lat.lean index ce10091cca1422..dcaeb7f31097b7 100644 --- a/Mathlib/Order/Category/Lat.lean +++ b/Mathlib/Order/Category/Lat.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.PartOrd -import Mathlib.Order.Hom.Lattice +module + +public import Mathlib.Order.Category.PartOrd +public import Mathlib.Order.Hom.Lattice /-! # The category of lattices @@ -20,6 +22,8 @@ corresponds to `BddLat`. The free functor from `Lat` to `BddLat` is `X → WithTop (WithBot X)`. -/ +@[expose] public section + universe u open CategoryTheory diff --git a/Mathlib/Order/Category/LinOrd.lean b/Mathlib/Order/Category/LinOrd.lean index 39b7710e9ba51b..05ef60447e5cab 100644 --- a/Mathlib/Order/Category/LinOrd.lean +++ b/Mathlib/Order/Category/LinOrd.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Order.Category.Lat +module + +public import Mathlib.Order.Category.Lat /-! # Category of linear orders @@ -11,6 +13,8 @@ import Mathlib.Order.Category.Lat This defines `LinOrd`, the category of linear orders with monotone maps. -/ +@[expose] public section + open CategoryTheory @@ -18,6 +22,8 @@ universe u /-- The category of linear orders. -/ structure LinOrd where + /-- Construct a bundled `LinOrd` from the underlying type and typeclass. -/ + of :: /-- The underlying linearly ordered type. -/ (carrier : Type*) [str : LinearOrder carrier] @@ -33,9 +39,6 @@ instance : CoeSort LinOrd (Type _) := attribute [coe] LinOrd.carrier -/-- Construct a bundled `LinOrd` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [LinearOrder X] : LinOrd := ⟨X⟩ - /-- The type of morphisms in `LinOrd R`. -/ @[ext] structure Hom (X Y : LinOrd.{u}) where diff --git a/Mathlib/Order/Category/NonemptyFinLinOrd.lean b/Mathlib/Order/Category/NonemptyFinLinOrd.lean index 7c7b4ea14ed43e..d6b5a6fdcdc065 100644 --- a/Mathlib/Order/Category/NonemptyFinLinOrd.lean +++ b/Mathlib/Order/Category/NonemptyFinLinOrd.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.CategoryTheory.ConcreteCategory.EpiMono -import Mathlib.CategoryTheory.Limits.Shapes.Images -import Mathlib.CategoryTheory.Limits.Shapes.RegularMono -import Mathlib.Data.Fintype.Order -import Mathlib.Data.Set.Subsingleton -import Mathlib.Order.Category.FinPartOrd -import Mathlib.Order.Category.LinOrd +module + +public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono +public import Mathlib.CategoryTheory.Limits.Shapes.Images +public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono +public import Mathlib.Data.Fintype.Order +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Order.Category.FinPartOrd +public import Mathlib.Order.Category.LinOrd /-! # Nonempty finite linear orders @@ -21,6 +23,8 @@ Note: `NonemptyFinLinOrd` is *not* a subcategory of `FinBddDistLat` because its preserve `⊥` and `⊤`. -/ +@[expose] public section + universe u v open CategoryTheory CategoryTheory.Limits diff --git a/Mathlib/Order/Category/OmegaCompletePartialOrder.lean b/Mathlib/Order/Category/OmegaCompletePartialOrder.lean index 2dc6facb342730..a5e54049ba15ea 100644 --- a/Mathlib/Order/Category/OmegaCompletePartialOrder.lean +++ b/Mathlib/Order/Category/OmegaCompletePartialOrder.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Order.OmegaCompletePartialOrder -import Mathlib.CategoryTheory.Limits.Shapes.Products -import Mathlib.CategoryTheory.Limits.Shapes.Equalizers -import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers -import Mathlib.CategoryTheory.ConcreteCategory.Basic +module + +public import Mathlib.Order.OmegaCompletePartialOrder +public import Mathlib.CategoryTheory.Limits.Shapes.Products +public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers +public import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers +public import Mathlib.CategoryTheory.ConcreteCategory.Basic /-! # Category of types with an omega complete partial order @@ -23,6 +25,8 @@ an `OmegaCompletePartialOrder`. -/ +@[expose] public section + open CategoryTheory @@ -31,6 +35,8 @@ universe u v /-- The category of types with an omega complete partial order. -/ structure ωCPO : Type (u + 1) where + /-- Construct a bundled ωCPO from the underlying type and typeclass. -/ + of :: /-- The underlying type. -/ carrier : Type u [str : OmegaCompletePartialOrder carrier] @@ -44,10 +50,6 @@ open OmegaCompletePartialOrder instance : CoeSort ωCPO Type* := ⟨carrier⟩ -/-- Construct a bundled ωCPO from the underlying type and typeclass. -/ -abbrev of (α : Type*) [OmegaCompletePartialOrder α] : ωCPO where - carrier := α - theorem coe_of (α : Type*) [OmegaCompletePartialOrder α] : ↥(of α) = α := rfl diff --git a/Mathlib/Order/Category/PartOrd.lean b/Mathlib/Order/Category/PartOrd.lean index c668742f03b70b..2a35c7c4fdac14 100644 --- a/Mathlib/Order/Category/PartOrd.lean +++ b/Mathlib/Order/Category/PartOrd.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Order.Antisymmetrization -import Mathlib.Order.Category.Preord -import Mathlib.CategoryTheory.Adjunction.Basic +module + +public import Mathlib.Order.Antisymmetrization +public import Mathlib.Order.Category.Preord +public import Mathlib.CategoryTheory.Adjunction.Basic /-! # Category of partial orders @@ -13,12 +15,16 @@ import Mathlib.CategoryTheory.Adjunction.Basic This defines `PartOrd`, the category of partial orders with monotone maps. -/ +@[expose] public section + open CategoryTheory universe u /-- The category of partial orders. -/ structure PartOrd where + /-- Construct a bundled `PartOrd` from the underlying type and typeclass. -/ + of :: /-- The underlying partially ordered type. -/ (carrier : Type*) [str : PartialOrder carrier] @@ -34,9 +40,6 @@ instance : CoeSort PartOrd (Type _) := attribute [coe] PartOrd.carrier -/-- Construct a bundled `PartOrd` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [PartialOrder X] : PartOrd := ⟨X⟩ - /-- The type of morphisms in `PartOrd R`. -/ @[ext] structure Hom (X Y : PartOrd.{u}) where diff --git a/Mathlib/Order/Category/PartOrdEmb.lean b/Mathlib/Order/Category/PartOrdEmb.lean index 1dc88fbe932be1..b037662612e141 100644 --- a/Mathlib/Order/Category/PartOrdEmb.lean +++ b/Mathlib/Order/Category/PartOrdEmb.lean @@ -3,22 +3,31 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Johan Commelin -/ -import Mathlib.Order.Category.PartOrd +module + +public import Mathlib.Order.Category.PartOrd +public import Mathlib.CategoryTheory.Limits.Filtered +public import Mathlib.CategoryTheory.Limits.Preserves.Filtered +public import Mathlib.CategoryTheory.Limits.Types.Filtered /-! # Category of partial orders, with order embeddings as morphisms This defines `PartOrdEmb`, the category of partial orders with order embeddings -as morphisms. +as morphisms. We also show that `PartOrdEmb` has filtered colimits. -/ -open CategoryTheory +@[expose] public section + +open CategoryTheory Limits universe u /-- The category of partial orders. -/ structure PartOrdEmb where + /-- Construct a bundled `PartOrdEmb` from the underlying type and typeclass. -/ + of :: /-- The underlying partially ordered type. -/ (carrier : Type*) [str : PartialOrder carrier] @@ -34,9 +43,6 @@ instance : CoeSort PartOrdEmb (Type _) := attribute [coe] PartOrdEmb.carrier -/-- Construct a bundled `PartOrdEmb` from the underlying type and typeclass. -/ -abbrev of (X : Type*) [PartialOrder X] : PartOrdEmb := ⟨X⟩ - /-- The type of morphisms in `PartOrdEmb R`. -/ @[ext] structure Hom (X Y : PartOrdEmb.{u}) where @@ -106,6 +112,10 @@ lemma comp_apply {X Y Z : PartOrdEmb} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : lemma Hom.injective {X Y : PartOrdEmb.{u}} (f : X ⟶ Y) : Function.Injective f := f.hom'.injective +lemma Hom.le_iff_le {X Y : PartOrdEmb.{u}} (f : X ⟶ Y) (x₁ x₂ : X) : + f x₁ ≤ f x₂ ↔ x₁ ≤ x₂ := + f.hom'.le_iff_le + @[ext] lemma hom_ext {X Y : PartOrdEmb} {f g : X ⟶ Y} (hf : f.hom = g.hom) : f = g := Hom.ext hf @@ -166,3 +176,143 @@ theorem partOrdEmb_dual_comp_forget_to_pardOrd : PartOrdEmb.dual ⋙ forget₂ PartOrdEmb PartOrd = forget₂ PartOrdEmb PartOrd ⋙ PartOrd.dual := rfl + +namespace PartOrdEmb + +variable {J : Type u} [SmallCategory J] [IsFiltered J] {F : J ⥤ PartOrdEmb.{u}} + +namespace Limits + +variable {c : Cocone (F ⋙ forget _)} (hc : IsColimit c) + +/-- Given a functor `F : J ⥤ PartOrdEmb` and a colimit cocone `c` for +`F ⋙ forget _`, this is the type `c.pt` on which we define a partial order +which makes it the colimit of `F`. -/ +@[nolint unusedArguments] +def CoconePt (_ : IsColimit c) : Type u := c.pt + +open IsFiltered + +instance : PartialOrder (CoconePt hc) where + le x y := ∃ (j : J) (x' y' : F.obj j) (hx : c.ι.app j x' = x) + (hy : c.ι.app j y' = y), x' ≤ y' + le_refl x := by + obtain ⟨j, x', hx⟩ := Types.jointly_surjective_of_isColimit hc x + exact ⟨j, x', x', hx, hx, le_rfl⟩ + le_trans := by + rintro x y z ⟨j, x₁, y₁, hx₁, hy₁, hxy⟩ ⟨k, y₂, z₁, hy₂, hz₁, hyz⟩ + obtain ⟨l, a, b, h⟩ := + (Types.FilteredColimit.isColimit_eq_iff _ hc (xi := y₁) (xj := y₂)).1 + (hy₁.trans hy₂.symm) + exact ⟨l, F.map a x₁, F.map b z₁, + (ConcreteCategory.congr_hom (c.w a) x₁).trans hx₁, + (ConcreteCategory.congr_hom (c.w b) z₁).trans hz₁, + ((F.map a).hom.monotone hxy).trans + (le_of_eq_of_le h ((F.map b).hom.monotone hyz))⟩ + le_antisymm := by + rintro x y ⟨j, x₁, y₁, hx₁, hy₁, h₁⟩ ⟨k, y₂, x₂, hy₂, hx₂, h₂⟩ + obtain ⟨l, a, b, x₃, y₃, h₃, h₄, h₅, h₆⟩ : + ∃ (l : J) (a : j ⟶ l) (b : k ⟶ l) (x₃ y₃ : _), + x₃ = F.map a x₁ ∧ x₃ = F.map b x₂ ∧ y₃ = F.map a y₁ ∧ y₃ = F.map b y₂ := by + obtain ⟨l₁, a, b, h₃⟩ := + (Types.FilteredColimit.isColimit_eq_iff _ hc (xi := x₁) (xj := x₂)).1 + (hx₁.trans hx₂.symm) + obtain ⟨l₂, a', b', h₄⟩ := + (Types.FilteredColimit.isColimit_eq_iff _ hc (xi := y₁) (xj := y₂)).1 + (hy₁.trans hy₂.symm) + obtain ⟨l, d, d', h₅, h₆⟩ := IsFiltered.bowtie a a' b b' + exact ⟨l, a ≫ d, b ≫ d, F.map (a ≫ d) x₁, F.map (a' ≫ d') y₁, rfl, + by simpa, by rw [h₅], by simpa [h₆]⟩ + have h₇ : x₃ = y₃ := + le_antisymm + (by simpa only [h₃, h₅] using (F.map a).hom.monotone h₁) + (by simpa only [h₄, h₆] using (F.map b).hom.monotone h₂) + exact hx₁.symm.trans ((ConcreteCategory.congr_hom (c.w a) x₁).symm.trans + ((congr_arg (c.ι.app l) (h₃.symm.trans (h₇.trans h₅))).trans + ((ConcreteCategory.congr_hom (c.w a) y₁).trans hy₁))) + +/-- The colimit cocone for a functor `F : J ⥤ PartOrdEmb` from a filtered +category that is constructed from a colimit cocone for `F ⋙ forget _`. -/ +@[simps] +def cocone : Cocone F where + pt := .of (CoconePt hc) + ι.app j := ofHom + { toFun := c.ι.app j + inj' x y h := by + obtain ⟨k, a, ha⟩ := (Types.FilteredColimit.isColimit_eq_iff' hc x y).1 h + exact (F.map a).injective ha + map_rel_iff' {x y} := by + refine ⟨?_, fun h ↦ ⟨j, x, y, rfl, rfl, h⟩⟩ + rintro ⟨k, x', y', hx, hy, h⟩ + obtain ⟨l₁, a₁, b₁, hl₁⟩ := (Types.FilteredColimit.isColimit_eq_iff _ hc).1 hx + obtain ⟨l₂, a₂, b₂, hl₂⟩ := (Types.FilteredColimit.isColimit_eq_iff _ hc).1 hy + dsimp at hx hy hl₁ hl₂ + obtain ⟨m, d, d', h₁, h₂⟩ := bowtie a₁ a₂ b₁ b₂ + rw [← (F.map (a₁ ≫ d)).le_iff_le] at h + rw [← (F.map (b₁ ≫ d)).le_iff_le] + conv_rhs => rw [h₂] + conv_rhs at h => rw [h₁] + simpa [← hl₁, ← hl₂] using h } + ι.naturality _ _ f := by ext x; exact ConcreteCategory.congr_hom (c.w f) x + +/-- Auxiliary definition for `isColimitCocone`. -/ +def CoconePt.desc (s : Cocone F) : CoconePt hc ↪o s.pt where + toFun := hc.desc ((forget _).mapCocone s) + inj' x y h := by + obtain ⟨j, x', y', rfl, rfl⟩ := + Types.FilteredColimit.jointly_surjective_of_isColimit₂ hc x y + obtain rfl := (s.ι.app j).injective + (((congr_fun (hc.fac ((forget _).mapCocone s) j) x').symm.trans h).trans + (congr_fun (hc.fac ((forget _).mapCocone s) j) y')) + rfl + map_rel_iff' {x y} := by + obtain ⟨j, x', y', rfl, rfl⟩ := + Types.FilteredColimit.jointly_surjective_of_isColimit₂ hc x y + have hx := (congr_fun (hc.fac ((forget _).mapCocone s) j) x') + have hy := (congr_fun (hc.fac ((forget _).mapCocone s) j) y') + dsimp at hx hy ⊢ + rw [hx, hy, OrderEmbedding.le_iff_le] + refine ⟨fun h ↦ ⟨j, _, _, rfl, rfl, h⟩, fun ⟨k, x, y, hx', hy', h⟩ ↦ ?_⟩ + obtain ⟨l, f, g, hl⟩ := (Types.FilteredColimit.isColimit_eq_iff _ hc).1 hx' + obtain ⟨l', f', g', hl'⟩ := (Types.FilteredColimit.isColimit_eq_iff _ hc).1 hy' + obtain ⟨m, a, b, h₁, h₂⟩ := bowtie f f' g g' + dsimp at hl hl' + rw [← (F.map (f ≫ a)).le_iff_le] at h + rw [← (F.map (g ≫ a)).le_iff_le] + exact le_of_eq_of_le (by simp [hl]) (le_of_le_of_eq h (by simp [h₁, h₂, hl'])) + +@[simp] +lemma CoconePt.fac_apply (s : Cocone F) (j : J) (x : F.obj j) : + CoconePt.desc hc s (c.ι.app j x) = s.ι.app j x := + congr_fun (hc.fac ((forget _).mapCocone s) j) x + +/-- A colimit cocone for `F : J ⥤ PartOrdEmb` (with `J` filtered) can be +obtained from a colimit cocone for `F ⋙ forget _`. -/ +def isColimitCocone : IsColimit (cocone hc) where + desc s := ofHom (CoconePt.desc hc s) + uniq s m hm := by + ext x + obtain ⟨j, x, rfl⟩ := Types.jointly_surjective_of_isColimit hc x + exact ((ConcreteCategory.congr_hom (hm j)) x).trans (CoconePt.fac_apply hc s j x).symm + +instance : HasColimit F where + exists_colimit := ⟨_, isColimitCocone (colimit.isColimit (F ⋙ forget _))⟩ + +instance : PreservesColimit F (forget _) := + preservesColimit_of_preserves_colimit_cocone + (isColimitCocone (colimit.isColimit (F ⋙ forget _))) + (colimit.isColimit (F ⋙ forget _)) + +instance : HasColimitsOfShape J PartOrdEmb.{u} where + +instance : PreservesColimitsOfShape J (forget PartOrdEmb.{u}) where + +instance : HasFilteredColimitsOfSize.{u, u} PartOrdEmb.{u} where + HasColimitsOfShape _ := inferInstance + +instance : PreservesFilteredColimitsOfSize.{u, u} (forget PartOrdEmb.{u}) where + preserves_filtered_colimits _ := inferInstance + +end Limits + +end PartOrdEmb diff --git a/Mathlib/Order/Category/Preord.lean b/Mathlib/Order/Category/Preord.lean index fd88380b2ef74d..667cece0b7793a 100644 --- a/Mathlib/Order/Category/Preord.lean +++ b/Mathlib/Order/Category/Preord.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Elementwise -import Mathlib.Order.Hom.Basic -import Mathlib.Order.CompleteBooleanAlgebra +module + +public import Mathlib.CategoryTheory.Category.Cat +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.Order.Hom.Basic +public import Mathlib.Order.CompleteBooleanAlgebra /-! # Category of preorders @@ -15,6 +17,8 @@ import Mathlib.Order.CompleteBooleanAlgebra This defines `Preord`, the category of preorders with monotone maps. -/ +@[expose] public section + universe u @@ -22,6 +26,8 @@ open CategoryTheory /-- The category of preorders. -/ structure Preord where + /-- Construct a bundled `Preord` from the underlying type and typeclass. -/ + of :: /-- The underlying preordered type. -/ (carrier : Type*) [str : Preorder carrier] @@ -37,9 +43,6 @@ instance : CoeSort Preord (Type u) := attribute [coe] Preord.carrier -/-- Construct a bundled `Preord` from the underlying type and typeclass. -/ -abbrev of (X : Type u) [Preorder X] : Preord := ⟨X⟩ - /-- The type of morphisms in `Preord R`. -/ @[ext] structure Hom (X Y : Preord.{u}) where diff --git a/Mathlib/Order/Category/Semilat.lean b/Mathlib/Order/Category/Semilat.lean index 99697228e445ab..91bdf3dc396811 100644 --- a/Mathlib/Order/Category/Semilat.lean +++ b/Mathlib/Order/Category/Semilat.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Category.PartOrd -import Mathlib.Order.Hom.BoundedLattice +module + +public import Mathlib.Order.Category.PartOrd +public import Mathlib.Order.Hom.BoundedLattice /-! # The categories of semilattices @@ -17,6 +19,8 @@ element and inf-semilattices with a top element. * [nLab, *semilattice*](https://ncatlab.org/nlab/show/semilattice) -/ +@[expose] public section + universe u @@ -24,6 +28,8 @@ open CategoryTheory /-- The category of sup-semilattices with a bottom element. -/ structure SemilatSupCat : Type (u + 1) where + /-- Construct a bundled `SemilatSupCat` from a `SemilatticeSup`. -/ + of :: /-- The underlying type of a sup-semilattice with a bottom element. -/ protected X : Type u [isSemilatticeSup : SemilatticeSup X] @@ -31,6 +37,8 @@ structure SemilatSupCat : Type (u + 1) where /-- The category of inf-semilattices with a top element. -/ structure SemilatInfCat : Type (u + 1) where + /-- Construct a bundled `SemilatInfCat` from a `SemilatticeInf`. -/ + of :: /-- The underlying type of an inf-semilattice with a top element. -/ protected X : Type u [isSemilatticeInf : SemilatticeInf X] @@ -43,10 +51,6 @@ instance : CoeSort SemilatSupCat Type* := attribute [instance] isSemilatticeSup isOrderBot -/-- Construct a bundled `SemilatSupCat` from a `SemilatticeSup`. -/ -abbrev of (α : Type*) [SemilatticeSup α] [OrderBot α] : SemilatSupCat := - ⟨α⟩ - theorem coe_of (α : Type*) [SemilatticeSup α] [OrderBot α] : ↥(of α) = α := rfl @@ -83,10 +87,6 @@ instance : CoeSort SemilatInfCat Type* := attribute [instance] isSemilatticeInf isOrderTop -/-- Construct a bundled `SemilatInfCat` from a `SemilatticeInf`. -/ -abbrev of (α : Type*) [SemilatticeInf α] [OrderTop α] : SemilatInfCat := - ⟨α⟩ - theorem coe_of (α : Type*) [SemilatticeInf α] [OrderTop α] : ↥(of α) = α := rfl diff --git a/Mathlib/Order/Chain.lean b/Mathlib/Order/Chain.lean index 2c632f6bdf9250..bb0b928f9c277e 100644 --- a/Mathlib/Order/Chain.lean +++ b/Mathlib/Order/Chain.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.Preorder.Chain -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Order.Preorder.Chain +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-13") diff --git a/Mathlib/Order/Circular.lean b/Mathlib/Order/Circular.lean index ce956d41e79364..28099745c23ff6 100644 --- a/Mathlib/Order/Circular.lean +++ b/Mathlib/Order/Circular.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Lattice -import Mathlib.Tactic.Order +module + +public import Mathlib.Order.Lattice +public import Mathlib.Tactic.Order /-! # Circular order hierarchy @@ -85,6 +87,8 @@ and the circular order of months. Is `α →c β` a good notation? circular order, cyclic order, circularly ordered set, cyclically ordered set -/ +@[expose] public section + assert_not_exists RelIso /-- Syntax typeclass for a betweenness relation. -/ @@ -373,9 +377,6 @@ abbrev Preorder.toCircularPreorder (α : Type*) [Preorder α] : CircularPreorder | refine .inr <| .inr ?_; constructor <;> order sbtw_iff_btw_not_btw {a b c} := by simp_rw [lt_iff_le_not_ge] - have h1 := le_trans a b c - have h2 := le_trans b c a - have h3 := le_trans c a b grind /-- The circular partial order obtained from "looping around" a partial order. diff --git a/Mathlib/Order/Circular/ZMod.lean b/Mathlib/Order/Circular/ZMod.lean index 91dcb50fb06bb6..79d22329ce82ef 100644 --- a/Mathlib/Order/Circular/ZMod.lean +++ b/Mathlib/Order/Circular/ZMod.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Oliver Nash, Yaël Dillies -/ -import Mathlib.Order.Circular -import Mathlib.Order.Fin.Basic -import Mathlib.Data.ZMod.Defs +module + +public import Mathlib.Order.Circular +public import Mathlib.Order.Fin.Basic +public import Mathlib.Data.ZMod.Defs /-! # The circular order on `ZMod n` @@ -13,6 +15,8 @@ import Mathlib.Data.ZMod.Defs This file defines the circular order on `ZMod n`. -/ +@[expose] public section + instance : CircularOrder ℤ := LinearOrder.toCircularOrder _ variable {a b c : ℤ} diff --git a/Mathlib/Order/Closure.lean b/Mathlib/Order/Closure.lean index cbd7a5ada04e04..4350e3f811114a 100644 --- a/Mathlib/Order/Closure.lean +++ b/Mathlib/Order/Closure.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Yaël Dillies -/ -import Mathlib.Data.Set.BooleanAlgebra -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Data.Set.BooleanAlgebra +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.Hom.Basic /-! # Closure operators between preorders @@ -44,6 +46,8 @@ place when using concrete closure operators such as `ConvexHull`. * https://en.wikipedia.org/wiki/Closure_operator#Closure_operators_on_partially_ordered_sets -/ +@[expose] public section + open Set /-! ### Closure operator -/ diff --git a/Mathlib/Order/Cofinal.lean b/Mathlib/Order/Cofinal.lean index 9741266ea6afef..8e1b967861769d 100644 --- a/Mathlib/Order/Cofinal.lean +++ b/Mathlib/Order/Cofinal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.GaloisConnection.Basic -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Order.WellFounded +module + +public import Mathlib.Order.GaloisConnection.Basic +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Order.WellFounded /-! # Cofinal sets @@ -21,6 +23,8 @@ For the cofinality of a set as a cardinal, see `Mathlib/SetTheory/Cardinal/Cofin - Deprecate `Order.Cofinal` in favor of this predicate. -/ +@[expose] public section + variable {α β : Type*} section LE diff --git a/Mathlib/Order/CompactlyGenerated/Basic.lean b/Mathlib/Order/CompactlyGenerated/Basic.lean index aa959414ee1d3f..8db58340cf5037 100644 --- a/Mathlib/Order/CompactlyGenerated/Basic.lean +++ b/Mathlib/Order/CompactlyGenerated/Basic.lean @@ -3,16 +3,18 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Order.Atoms -import Mathlib.Order.OrderIsoNat -import Mathlib.Order.RelIso.Set -import Mathlib.Order.SupClosed -import Mathlib.Order.SupIndep -import Mathlib.Order.Zorn -import Mathlib.Data.Finset.Order -import Mathlib.Order.Interval.Set.OrderIso -import Mathlib.Data.Finite.Set -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Order.Atoms +public import Mathlib.Order.OrderIsoNat +public import Mathlib.Order.RelIso.Set +public import Mathlib.Order.SupClosed +public import Mathlib.Order.SupIndep +public import Mathlib.Order.Zorn +public import Mathlib.Data.Finset.Order +public import Mathlib.Order.Interval.Set.OrderIso +public import Mathlib.Data.Finite.Set +public import Mathlib.Tactic.TFAE /-! # Compactness properties for complete lattices @@ -51,6 +53,8 @@ We also show well-founded lattices are compactly generated complete lattice, well-founded, compact -/ +@[expose] public section + open Set variable {ι : Sort*} {α : Type*} [CompleteLattice α] {f : ι → α} diff --git a/Mathlib/Order/CompactlyGenerated/Intervals.lean b/Mathlib/Order/CompactlyGenerated/Intervals.lean index b10143b1be0ec9..ed9d193606cc2a 100644 --- a/Mathlib/Order/CompactlyGenerated/Intervals.lean +++ b/Mathlib/Order/CompactlyGenerated/Intervals.lean @@ -3,14 +3,17 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ +module -import Mathlib.Order.CompleteLatticeIntervals -import Mathlib.Order.CompactlyGenerated.Basic +public import Mathlib.Order.CompleteLatticeIntervals +public import Mathlib.Order.CompactlyGenerated.Basic /-! # Results about compactness properties for intervals in complete lattices -/ +@[expose] public section + variable {ι α : Type*} [CompleteLattice α] namespace Set.Iic diff --git a/Mathlib/Order/Comparable.lean b/Mathlib/Order/Comparable.lean index 4c3bb9f8dca32e..4823351eec4b05 100644 --- a/Mathlib/Order/Comparable.lean +++ b/Mathlib/Order/Comparable.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.Antisymmetrization +module + +public import Mathlib.Order.Antisymmetrization /-! # Comparability and incomparability relations @@ -32,6 +34,8 @@ to the other, use `not_compRel_iff` and `not_incompRel_iff`. These definitions should be linked to `IsChain` and `IsAntichain`. -/ +@[expose] public section + open Function variable {α : Type*} {a b c d : α} diff --git a/Mathlib/Order/Compare.lean b/Mathlib/Order/Compare.lean index 77561fda02c7ee..09b12ea071bd7d 100644 --- a/Mathlib/Order/Compare.lean +++ b/Mathlib/Order/Compare.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Ordering.Basic -import Mathlib.Order.Synonym +module + +public import Mathlib.Data.Ordering.Basic +public import Mathlib.Order.Synonym /-! # Comparison @@ -20,6 +22,8 @@ This file provides basic results about orderings and comparison in linear orders elements that are not one strictly less than the other either way are equal. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Order/CompleteBooleanAlgebra.lean b/Mathlib/Order/CompleteBooleanAlgebra.lean index 03261e4a1965ae..9ca0febba10e62 100644 --- a/Mathlib/Order/CompleteBooleanAlgebra.lean +++ b/Mathlib/Order/CompleteBooleanAlgebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Logic.Equiv.Set -import Mathlib.Logic.Pairwise -import Mathlib.Order.CompleteLattice.Lemmas -import Mathlib.Order.Directed -import Mathlib.Order.GaloisConnection.Basic +module + +public import Mathlib.Logic.Equiv.Set +public import Mathlib.Logic.Pairwise +public import Mathlib.Order.CompleteLattice.Lemmas +public import Mathlib.Order.Directed +public import Mathlib.Order.GaloisConnection.Basic /-! # Frames, completely distributive lattices and complete Boolean algebras @@ -50,6 +52,8 @@ distributive lattice. * [Francis Borceux, *Handbook of Categorical Algebra III*][borceux-vol3] -/ +@[expose] public section + open Function Set universe u v w w' diff --git a/Mathlib/Order/CompleteLattice/Basic.lean b/Mathlib/Order/CompleteLattice/Basic.lean index 6ee7b542af7712..7dc2fa40dce2d4 100644 --- a/Mathlib/Order/CompleteLattice/Basic.lean +++ b/Mathlib/Order/CompleteLattice/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Set.NAry -import Mathlib.Data.ULift -import Mathlib.Order.CompleteLattice.Defs -import Mathlib.Order.Hom.Set +module + +public import Mathlib.Data.Set.NAry +public import Mathlib.Data.ULift +public import Mathlib.Order.CompleteLattice.Defs +public import Mathlib.Order.Hom.Set /-! # Theory of complete lattices @@ -33,6 +35,8 @@ In lemma names, * `⨅ i, f i` : `iInf f`, the infimum of the range of `f`. -/ +@[expose] public section + open Function OrderDual Set variable {α β γ : Type*} {ι ι' : Sort*} {κ : ι → Sort*} {κ' : ι' → Sort*} @@ -1375,7 +1379,5 @@ protected abbrev Function.Injective.completeLattice [Max α] [Min α] [SupSet α sSup_le _ _ h := (map_sSup _).trans_le <| iSup₂_le h sInf_le _ a h := (map_sInf _).trans_le <| iInf₂_le a h le_sInf _ _ h := (le_iInf₂ h).trans (map_sInf _).ge - top := ⊤ le_top _ := (@le_top β _ _ _).trans map_top.ge - bot := ⊥ bot_le _ := map_bot.le.trans bot_le diff --git a/Mathlib/Order/CompleteLattice/Chain.lean b/Mathlib/Order/CompleteLattice/Chain.lean index 9c1e7eb87ccab2..b10b8b938ecff5 100644 --- a/Mathlib/Order/CompleteLattice/Chain.lean +++ b/Mathlib/Order/CompleteLattice/Chain.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Order.Preorder.Chain +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Order.Preorder.Chain /-! # Hausdorff's maximality principle @@ -22,6 +24,8 @@ Originally ported from Isabelle/HOL. The Fleuriot, Tobias Nipkow, Christian Sternagel. -/ +@[expose] public section + open Set variable {α : Type*} {r : α → α → Prop} {c c₁ c₂ s t : Set α} {a b x y : α} diff --git a/Mathlib/Order/CompleteLattice/Defs.lean b/Mathlib/Order/CompleteLattice/Defs.lean index c17dcb5ccf7dc8..1f1fba342daa00 100644 --- a/Mathlib/Order/CompleteLattice/Defs.lean +++ b/Mathlib/Order/CompleteLattice/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.SetNotation +module + +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.SetNotation /-! # Definition of complete lattices @@ -40,6 +42,8 @@ In lemma names, * `⨅ i, f i` : `iInf f`, the infimum of the range of `f`. -/ +@[expose] public section + open Function OrderDual Set variable {α β γ : Type*} {ι ι' : Sort*} {κ : ι → Sort*} {κ' : ι' → Sort*} diff --git a/Mathlib/Order/CompleteLattice/Finset.lean b/Mathlib/Order/CompleteLattice/Finset.lean index 2bcc7ddbeecafe..3a485892764c7c 100644 --- a/Mathlib/Order/CompleteLattice/Finset.lean +++ b/Mathlib/Order/CompleteLattice/Finset.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Finset.Option -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Data.Finset.Option +public import Mathlib.Data.Set.Lattice.Image /-! # Lattice operations on finsets @@ -15,6 +17,8 @@ See also `Mathlib/Data/Finset/Lattice.lean`, which is concerned with folding bin operations over a finset. -/ +@[expose] public section + assert_not_exists IsOrderedMonoid MonoidWithZero open Function Multiset OrderDual diff --git a/Mathlib/Order/CompleteLattice/Group.lean b/Mathlib/Order/CompleteLattice/Group.lean index f9e2f03f2cc182..d0f195ca1efc72 100644 --- a/Mathlib/Order/CompleteLattice/Group.lean +++ b/Mathlib/Order/CompleteLattice/Group.lean @@ -3,12 +3,16 @@ Copyright (c) 2025 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual -import Mathlib.Order.CompleteLattice.Basic +module + +public import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +public import Mathlib.Order.CompleteLattice.Basic /-! # Complete lattices and groups -/ +@[expose] public section + variable {α : Type*} {ι : Sort*} {κ : ι → Sort*} [CompleteLattice α] [Mul α] [MulLeftMono α] [MulRightMono α] diff --git a/Mathlib/Order/CompleteLattice/Lemmas.lean b/Mathlib/Order/CompleteLattice/Lemmas.lean index d333609d38f270..c27d395ffc378f 100644 --- a/Mathlib/Order/CompleteLattice/Lemmas.lean +++ b/Mathlib/Order/CompleteLattice/Lemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Bool.Set -import Mathlib.Data.Nat.Set -import Mathlib.Order.CompleteLattice.Basic +module + +public import Mathlib.Data.Bool.Set +public import Mathlib.Data.Nat.Set +public import Mathlib.Order.CompleteLattice.Basic /-! # Theory of complete lattices @@ -32,6 +34,8 @@ In lemma names, * `⨅ i, f i` : `iInf f`, the infimum of the range of `f`. -/ +@[expose] public section + open Function OrderDual Set variable {α β γ : Type*} {ι ι' : Sort*} {κ : ι → Sort*} {κ' : ι' → Sort*} diff --git a/Mathlib/Order/CompleteLattice/MulticoequalizerDiagram.lean b/Mathlib/Order/CompleteLattice/MulticoequalizerDiagram.lean index 173d588a417b92..b8198c2d342f45 100644 --- a/Mathlib/Order/CompleteLattice/MulticoequalizerDiagram.lean +++ b/Mathlib/Order/CompleteLattice/MulticoequalizerDiagram.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.CompleteLattice.Lemmas -import Mathlib.CategoryTheory.Category.Preorder -import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer -import Mathlib.CategoryTheory.CommSq -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Order.CompleteLattice.Lemmas +public import Mathlib.CategoryTheory.Category.Preorder +public import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer +public import Mathlib.CategoryTheory.CommSq +public import Mathlib.Tactic.FinCases /-! # Multicoequalizer diagrams in complete lattices @@ -28,6 +30,8 @@ in the category of types. -/ +@[expose] public section + universe u open CategoryTheory Limits diff --git a/Mathlib/Order/CompleteLattice/SetLike.lean b/Mathlib/Order/CompleteLattice/SetLike.lean index b1eed0f3d402d9..24975d3b6d7df6 100644 --- a/Mathlib/Order/CompleteLattice/SetLike.lean +++ b/Mathlib/Order/CompleteLattice/SetLike.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Sven Manthe. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sven Manthe -/ -import Mathlib.Order.CompleteSublattice +module + +public import Mathlib.Order.CompleteSublattice /-! # `SetLike` instance for elements of `CompleteSublattice (Set X)` @@ -11,6 +13,8 @@ import Mathlib.Order.CompleteSublattice This file provides lemmas for the `SetLike` instance for elements of `CompleteSublattice (Set X)` -/ +@[expose] public section + attribute [local instance] SetLike.instSubtypeSet namespace Sublattice diff --git a/Mathlib/Order/CompleteLatticeIntervals.lean b/Mathlib/Order/CompleteLatticeIntervals.lean index aebd2e6e837726..3bce5c6ab3b915 100644 --- a/Mathlib/Order/CompleteLatticeIntervals.lean +++ b/Mathlib/Order/CompleteLatticeIntervals.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.LatticeIntervals -import Mathlib.Order.Interval.Set.OrdConnected +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.LatticeIntervals +public import Mathlib.Order.Interval.Set.OrdConnected /-! # Subtypes of conditionally complete linear orders @@ -20,6 +22,8 @@ Add appropriate instances for all `Set.Ixx`. This requires a refactor that will default values for `sSup` and `sInf`. -/ +@[expose] public section + assert_not_exists Multiset open Set diff --git a/Mathlib/Order/CompletePartialOrder.lean b/Mathlib/Order/CompletePartialOrder.lean index 41f80dffe5b349..454422dcee76f6 100644 --- a/Mathlib/Order/CompletePartialOrder.lean +++ b/Mathlib/Order/CompletePartialOrder.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Order.OmegaCompletePartialOrder +module + +public import Mathlib.Order.OmegaCompletePartialOrder /-! # Complete Partial Orders @@ -30,6 +32,8 @@ These are partial orders for which every directed set has a least upper bound. complete partial order, directedly complete partial order -/ +@[expose] public section + variable {ι : Sort*} {α β : Type*} section CompletePartialOrder diff --git a/Mathlib/Order/CompleteSublattice.lean b/Mathlib/Order/CompleteSublattice.lean index ddade6d3b88d48..92f1a740f184a0 100644 --- a/Mathlib/Order/CompleteSublattice.lean +++ b/Mathlib/Order/CompleteSublattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Data.Set.Functor -import Mathlib.Order.Sublattice -import Mathlib.Order.Hom.CompleteLattice +module + +public import Mathlib.Data.Set.Functor +public import Mathlib.Order.Sublattice +public import Mathlib.Order.Hom.CompleteLattice /-! # Complete Sublattices @@ -24,6 +26,8 @@ invariant submodules of some module with respect to a linear map. -/ +@[expose] public section + open Function Set variable (α β : Type*) [CompleteLattice α] [CompleteLattice β] (f : CompleteLatticeHom α β) diff --git a/Mathlib/Order/Concept.lean b/Mathlib/Order/Concept.lean index 740d8ccb127819..c19ca3518c2be1 100644 --- a/Mathlib/Order/Concept.lean +++ b/Mathlib/Order/Concept.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Data.Set.Lattice /-! # Formal concept analysis @@ -35,6 +37,8 @@ Prove the fundamental theorem of concept lattices. concept, formal concept analysis, intent, extend, attribute -/ +@[expose] public section + open Function OrderDual Set diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Basic.lean b/Mathlib/Order/ConditionallyCompleteLattice/Basic.lean index 0697941425ef9d..887e0def16e6c8 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Basic.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Set.Lattice -import Mathlib.Order.ConditionallyCompleteLattice.Defs +module + +public import Mathlib.Data.Set.Lattice +public import Mathlib.Order.ConditionallyCompleteLattice.Defs /-! # Theory of conditionally complete lattices @@ -25,6 +27,8 @@ while `csInf_le` is the same statement in conditionally complete lattices with an additional assumption that `s` is bounded below. -/ +@[expose] public section + -- Guard against import creep assert_not_exists Multiset diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean b/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean index 676f0a93f2a033..fcdae9b63d016b 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.SetNotation -import Mathlib.Order.WellFounded +module + +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.SetNotation +public import Mathlib.Order.WellFounded /-! # Definitions of conditionally complete lattices @@ -26,6 +28,8 @@ while `csInf_le` is the same statement in conditionally complete lattices with an additional assumption that `s` is bounded below. -/ +@[expose] public section + open Set variable {α β γ : Type*} {ι : Sort*} diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Finset.lean b/Mathlib/Order/ConditionallyCompleteLattice/Finset.lean index 235a96fa6b8b9a..1fe9530755180a 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Finset.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Finset.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Data.Finset.Max -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.ConditionallyCompleteLattice.Indexed +module + +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed /-! # Conditionally complete lattices and finite sets. -/ +@[expose] public section + open Set diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Group.lean b/Mathlib/Order/ConditionallyCompleteLattice/Group.lean index 5c476e1c6e10a8..b9918d296f9ce7 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Group.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Group.lean @@ -3,15 +3,19 @@ Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Algebra.Order.Group.Unbundled.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Algebra.Order.Group.Unbundled.Basic +public import Mathlib.Algebra.Order.Monoid.Unbundled.OrderDual /-! # Conditionally complete lattices and groups. -/ +@[expose] public section + open Set section Mul diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean b/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean index 3ef97582da54fc..360ab5fd6fe992 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Sébastian Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastian Gouëzel -/ -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Indexed sup / inf in conditionally complete lattices @@ -13,6 +15,8 @@ rather than complete, lattice. We add a prefix `c` to distinguish them from the complete lattices, giving names `ciSup_xxx` or `ciInf_xxx`. -/ +@[expose] public section + -- Guard against import creep assert_not_exists Multiset diff --git a/Mathlib/Order/Copy.lean b/Mathlib/Order/Copy.lean index b63dac7a24f986..30c8aa01b0f831 100644 --- a/Mathlib/Order/Copy.lean +++ b/Mathlib/Order/Copy.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Yaël Dillies -/ -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Tooling to make copies of lattice structures @@ -13,6 +15,8 @@ where one replaces the data parts with provably equal definitions that have better definitional properties. -/ +@[expose] public section + open Order diff --git a/Mathlib/Order/CountableDenseLinearOrder.lean b/Mathlib/Order/CountableDenseLinearOrder.lean index 3e76a3af852573..8eee9001398313 100644 --- a/Mathlib/Order/CountableDenseLinearOrder.lean +++ b/Mathlib/Order/CountableDenseLinearOrder.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.Order.Ideal -import Mathlib.Data.Finset.Max +module + +public import Mathlib.Order.Ideal +public import Mathlib.Data.Finset.Max /-! # The back and forth method and countable dense linear orders @@ -28,6 +30,8 @@ https://en.wikipedia.org/wiki/Back-and-forth_method back and forth, dense, countable, order -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Order/Cover.lean b/Mathlib/Order/Cover.lean index 73ed8c8a43cdf6..27fabe39a35964 100644 --- a/Mathlib/Order/Cover.lean +++ b/Mathlib/Order/Cover.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Violeta Hernández Palacios, Grayson Burton, Floris van Doorn, Bhavik Mehta -/ -import Mathlib.Order.Antisymmetrization -import Mathlib.Order.Hom.WithTopBot -import Mathlib.Order.Interval.Set.OrdConnected -import Mathlib.Order.Interval.Set.WithBotTop +module + +public import Mathlib.Order.Antisymmetrization +public import Mathlib.Order.Hom.WithTopBot +public import Mathlib.Order.Interval.Set.OrdConnected +public import Mathlib.Order.Interval.Set.WithBotTop /-! # The covering relation @@ -23,6 +25,8 @@ in a preorder this is equivalent to `a ⋖ b ∨ (a ≤ b ∧ b ≤ a)` * `a ⩿ b` means that `b` weakly covers `a`. -/ +@[expose] public section + open Set OrderDual diff --git a/Mathlib/Order/Defs/LinearOrder.lean b/Mathlib/Order/Defs/LinearOrder.lean index 7b6f0d5598418c..e2c210fec21968 100644 --- a/Mathlib/Order/Defs/LinearOrder.lean +++ b/Mathlib/Order/Defs/LinearOrder.lean @@ -3,15 +3,17 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Batteries.Classes.Order -import Batteries.Tactic.Trans -import Mathlib.Data.Ordering.Basic -import Mathlib.Tactic.ExtendDoc -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.Push.Attr -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.TypeStar -import Mathlib.Order.Defs.PartialOrder +module + +public import Batteries.Classes.Order +public import Batteries.Tactic.Trans +public import Mathlib.Data.Ordering.Basic +public import Mathlib.Tactic.ExtendDoc +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.Push.Attr +public import Mathlib.Tactic.SplitIfs +public import Mathlib.Tactic.TypeStar +public import Mathlib.Order.Defs.PartialOrder /-! # Orders @@ -19,6 +21,8 @@ import Mathlib.Order.Defs.PartialOrder Defines classes for linear orders and proves some basic lemmas about them. -/ +@[expose] public section + variable {α : Type*} section LinearOrder @@ -71,12 +75,20 @@ class LinearOrder (α : Type*) extends PartialOrder α, Min α, Max α, Ord α w compare_eq_compareOfLessAndEq : ∀ a b, compare a b = compareOfLessAndEq a b := by compareOfLessAndEq_rfl +attribute [to_dual existing] LinearOrder.toMax + variable [LinearOrder α] {a b c : α} attribute [instance 900] LinearOrder.toDecidableLT attribute [instance 900] LinearOrder.toDecidableLE attribute [instance 900] LinearOrder.toDecidableEq +@[to_dual existing toDecidableLT, inherit_doc toDecidableLT] +def LinearOrder.toDecidableLT' : DecidableLT' α := fun a b => toDecidableLT b a + +@[to_dual existing toDecidableLE, inherit_doc toDecidableLE] +def LinearOrder.toDecidableLE' : DecidableLE' α := fun a b => toDecidableLE b a + instance : Std.IsLinearOrder α where le_total := LinearOrder.le_total @@ -87,8 +99,8 @@ lemma lt_of_not_ge (h : ¬b ≤ a) : a < b := lt_of_le_not_ge (le_of_not_ge h) h @[deprecated (since := "2025-05-11")] alias le_of_not_le := le_of_not_ge -lemma lt_trichotomy (a b : α) : a < b ∨ a = b ∨ b < a := by - grind [le_total, Decidable.lt_or_eq_of_le] +@[to_dual gt_trichotomy] +lemma lt_trichotomy (a b : α) : a < b ∨ a = b ∨ b < a := by grind lemma le_of_not_gt (h : ¬b < a) : a ≤ b := match lt_trichotomy a b with @@ -107,8 +119,10 @@ lemma le_or_gt (a b : α) : a ≤ b ∨ b < a := (lt_or_ge b a).symm @[deprecated (since := "2025-05-11")] alias le_or_lt := le_or_gt -lemma lt_or_gt_of_ne (h : a ≠ b) : a < b ∨ b < a := by simpa [h] using lt_trichotomy a b +@[to_dual gt_or_lt_of_ne] +lemma lt_or_gt_of_ne (h : a ≠ b) : a < b ∨ b < a := by grind +@[to_dual ne_iff_gt_or_lt] lemma ne_iff_lt_or_gt : a ≠ b ↔ a < b ∨ b < a := ⟨lt_or_gt_of_ne, (Or.elim · ne_of_lt ne_of_gt)⟩ lemma lt_iff_not_ge : a < b ↔ ¬b ≤ a := ⟨not_le_of_gt, lt_of_not_ge⟩ @@ -116,12 +130,16 @@ lemma lt_iff_not_ge : a < b ↔ ¬b ≤ a := ⟨not_le_of_gt, lt_of_not_ge⟩ @[simp, push] lemma not_lt : ¬a < b ↔ b ≤ a := ⟨le_of_not_gt, not_lt_of_ge⟩ @[simp, push] lemma not_le : ¬a ≤ b ↔ b < a := lt_iff_not_ge.symm +attribute [to_dual self (reorder := a b)] + le_total le_of_not_ge lt_of_not_ge le_of_not_gt lt_or_ge le_or_gt lt_iff_not_ge not_lt not_le + +@[to_dual eq_or_lt_of_not_gt] lemma eq_or_gt_of_not_lt (h : ¬a < b) : a = b ∨ b < a := if h₁ : a = b then Or.inl h₁ else Or.inr (lt_of_not_ge fun hge => h (lt_of_le_of_ne hge h₁)) -@[deprecated (since := "2025-07-27")] alias eq_or_lt_of_not_gt := eq_or_gt_of_not_lt @[deprecated (since := "2025-05-11")] alias eq_or_lt_of_not_lt := eq_or_gt_of_not_lt +@[to_dual self (reorder := a b, c d)] theorem le_imp_le_of_lt_imp_lt {α β} [Preorder α] [LinearOrder β] {a b : α} {c d : β} (H : d < c → b < a) (h : a ≤ b) : c ≤ d := le_of_not_gt fun h' => not_le_of_gt (H h') h @@ -131,115 +149,63 @@ lemma min_def (a b : α) : min a b = if a ≤ b then a else b := LinearOrder.min @[grind =] lemma max_def (a b : α) : max a b = if a ≤ b then b else a := LinearOrder.max_def a b -lemma min_le_left (a b : α) : min a b ≤ a := by - if h : a ≤ b - then simp [min_def, if_pos h, le_refl] - else simpa [min_def, if_neg h] using le_of_not_ge h +@[to_dual existing max_def] +theorem min_def' (a b : α) : min a b = if b ≤ a then b else a := by grind -lemma min_le_right (a b : α) : min a b ≤ b := by - if h : a ≤ b - then simpa [min_def, if_pos h] using h - else simp [min_def, if_neg h, le_refl] +@[to_dual existing min_def] +theorem max_def' (a b : α) : max a b = if b ≤ a then a else b := by grind -lemma le_min (h₁ : c ≤ a) (h₂ : c ≤ b) : c ≤ min a b := by - grind - -lemma le_max_left (a b : α) : a ≤ max a b := by - if h : a ≤ b - then simpa [max_def, if_pos h] using h - else simp [max_def, if_neg h, le_refl] +@[to_dual le_max_left] +lemma min_le_left (a b : α) : min a b ≤ a := by grind -lemma le_max_right (a b : α) : b ≤ max a b := by - if h : a ≤ b - then simp [max_def, if_pos h, le_refl] - else simpa [max_def, if_neg h] using le_of_not_ge h +@[to_dual le_max_right] +lemma min_le_right (a b : α) : min a b ≤ b := by grind -lemma max_le (h₁ : a ≤ c) (h₂ : b ≤ c) : max a b ≤ c := by - grind +@[to_dual max_le] +lemma le_min (h₁ : c ≤ a) (h₂ : c ≤ b) : c ≤ min a b := by grind +@[to_dual] lemma eq_min (h₁ : c ≤ a) (h₂ : c ≤ b) (h₃ : ∀ {d}, d ≤ a → d ≤ b → d ≤ c) : c = min a b := le_antisymm (le_min h₁ h₂) (h₃ (min_le_left a b) (min_le_right a b)) +@[to_dual] lemma min_comm (a b : α) : min a b = min b a := eq_min (min_le_right a b) (min_le_left a b) fun h₁ h₂ => le_min h₂ h₁ -lemma min_assoc (a b c : α) : min (min a b) c = min a (min b c) := by - apply eq_min - · apply le_trans (min_le_left ..) (min_le_left ..) - · apply le_min - · apply le_trans (min_le_left ..) (min_le_right ..) - · apply min_le_right - · intro d h₁ h₂; apply le_min - · apply le_min h₁; apply le_trans h₂; apply min_le_left - · apply le_trans h₂; apply min_le_right +@[to_dual] +lemma min_assoc (a b c : α) : min (min a b) c = min a (min b c) := by grind -lemma min_left_comm (a b c : α) : min a (min b c) = min b (min a c) := by - rw [← min_assoc, min_comm a, min_assoc] +@[to_dual] +lemma min_left_comm (a b c : α) : min a (min b c) = min b (min a c) := by grind -@[simp] lemma min_self (a : α) : min a a = a := by simp [min_def] +@[to_dual (attr := simp)] lemma min_self (a : α) : min a a = a := by grind -lemma min_eq_left (h : a ≤ b) : min a b = a := by - grind +@[to_dual] +lemma min_eq_left (h : a ≤ b) : min a b = a := by grind +@[to_dual] lemma min_eq_right (h : b ≤ a) : min a b = b := min_comm b a ▸ min_eq_left h -lemma eq_max (h₁ : a ≤ c) (h₂ : b ≤ c) (h₃ : ∀ {d}, a ≤ d → b ≤ d → c ≤ d) : - c = max a b := - le_antisymm (h₃ (le_max_left a b) (le_max_right a b)) (max_le h₁ h₂) - -lemma max_comm (a b : α) : max a b = max b a := - eq_max (le_max_right a b) (le_max_left a b) fun h₁ h₂ => max_le h₂ h₁ - -lemma max_assoc (a b c : α) : max (max a b) c = max a (max b c) := by - apply eq_max - · apply le_trans (le_max_left a b) (le_max_left ..) - · apply max_le - · apply le_trans (le_max_right a b) (le_max_left ..) - · apply le_max_right - · intro d h₁ h₂; apply max_le - · apply max_le h₁; apply le_trans (le_max_left _ _) h₂ - · apply le_trans (le_max_right _ _) h₂ - -lemma max_left_comm (a b c : α) : max a (max b c) = max b (max a c) := by - rw [← max_assoc, max_comm a, max_assoc] - -@[simp] lemma max_self (a : α) : max a a = a := by simp [max_def] - -lemma max_eq_left (h : b ≤ a) : max a b = a := by - apply Eq.symm; apply eq_max (le_refl _) h; intros; assumption - -lemma max_eq_right (h : a ≤ b) : max a b = b := max_comm b a ▸ max_eq_left h - -lemma min_eq_left_of_lt (h : a < b) : min a b = a := min_eq_left (le_of_lt h) -lemma min_eq_right_of_lt (h : b < a) : min a b = b := min_eq_right (le_of_lt h) -lemma max_eq_left_of_lt (h : b < a) : max a b = a := max_eq_left (le_of_lt h) -lemma max_eq_right_of_lt (h : a < b) : max a b = b := max_eq_right (le_of_lt h) +@[to_dual] lemma min_eq_left_of_lt (h : a < b) : min a b = a := min_eq_left (le_of_lt h) +@[to_dual] lemma min_eq_right_of_lt (h : b < a) : min a b = b := min_eq_right (le_of_lt h) +@[to_dual max_lt] lemma lt_min (h₁ : a < b) (h₂ : a < c) : a < min b c := by cases le_total b c <;> simp [min_eq_left, min_eq_right, *] -lemma max_lt (h₁ : a < c) (h₂ : b < c) : max a b < c := by - cases le_total a b <;> simp [max_eq_left, max_eq_right, *] - section Ord lemma compare_lt_iff_lt : compare a b = .lt ↔ a < b := by rw [LinearOrder.compare_eq_compareOfLessAndEq, compareOfLessAndEq] - split_ifs <;> simp only [*, lt_irrefl] + grind lemma compare_gt_iff_gt : compare a b = .gt ↔ b < a := by rw [LinearOrder.compare_eq_compareOfLessAndEq, compareOfLessAndEq] - split_ifs <;> simp only [*, lt_irrefl, not_lt_of_gt] - case _ h₁ h₂ => - have h : b < a := lt_trichotomy a b |>.resolve_left h₁ |>.resolve_left h₂ - rwa [true_iff] + grind lemma compare_eq_iff_eq : compare a b = .eq ↔ a = b := by rw [LinearOrder.compare_eq_compareOfLessAndEq, compareOfLessAndEq] - split_ifs <;> try simp only - case _ h => rw [false_iff]; exact ne_iff_lt_or_gt.2 <| .inl h - case _ _ h => rwa [true_iff] - case _ _ h => rwa [false_iff] + grind lemma compare_le_iff_le : compare a b ≠ .gt ↔ a ≤ b := by cases h : compare a b diff --git a/Mathlib/Order/Defs/PartialOrder.lean b/Mathlib/Order/Defs/PartialOrder.lean index 5bad830840f1aa..8452aebb4c7d43 100644 --- a/Mathlib/Order/Defs/PartialOrder.lean +++ b/Mathlib/Order/Defs/PartialOrder.lean @@ -3,12 +3,15 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Batteries.Tactic.Alias -import Batteries.Tactic.Trans -import Mathlib.Tactic.ExtendDoc -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.TypeStar +module + +public import Batteries.Tactic.Alias +public import Batteries.Tactic.Trans +public import Mathlib.Tactic.ExtendDoc +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.SplitIfs +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.ToDual /-! # Orders @@ -28,6 +31,8 @@ in a preorder this is equivalent to `a ⋖ b ∨ (a ≤ b ∧ b ≤ a)` * `a ⩿ b` means that `b` weakly covers `a`. -/ +@[expose] public section + variable {α : Type*} section Preorder @@ -43,6 +48,9 @@ class Preorder (α : Type*) extends LE α, LT α where lt := fun a b => a ≤ b ∧ ¬b ≤ a lt_iff_le_not_ge : ∀ a b : α, a < b ↔ a ≤ b ∧ ¬b ≤ a := by intros; rfl +attribute [to_dual self (reorder := 3 5, 6 7)] Preorder.le_trans +attribute [to_dual self (reorder := 3 4)] Preorder.lt_iff_le_not_ge + instance [Preorder α] : Std.LawfulOrderLT α where lt_iff := Preorder.lt_iff_le_not_ge @@ -61,79 +69,92 @@ variable [Preorder α] {a b c : α} lemma le_rfl : a ≤ a := le_refl a /-- The relation `≤` on a preorder is transitive. -/ -lemma le_trans : a ≤ b → b ≤ c → a ≤ c := Preorder.le_trans _ _ _ +@[to_dual ge_trans] lemma le_trans : a ≤ b → b ≤ c → a ≤ c := Preorder.le_trans _ _ _ +@[to_dual self (reorder := 3 4)] lemma lt_iff_le_not_ge : a < b ↔ a ≤ b ∧ ¬b ≤ a := Preorder.lt_iff_le_not_ge _ _ @[deprecated (since := "2025-05-11")] alias lt_iff_le_not_le := lt_iff_le_not_ge +@[to_dual self (reorder := 3 4)] lemma lt_of_le_not_ge (hab : a ≤ b) (hba : ¬ b ≤ a) : a < b := lt_iff_le_not_ge.2 ⟨hab, hba⟩ @[deprecated (since := "2025-05-11")] alias lt_of_le_not_le := lt_of_le_not_ge +@[to_dual ge_of_eq] lemma le_of_eq (hab : a = b) : a ≤ b := by rw [hab] +@[to_dual self (reorder := 3 4)] lemma le_of_lt (hab : a < b) : a ≤ b := (lt_iff_le_not_ge.1 hab).1 +@[to_dual self (reorder := 3 4)] lemma not_le_of_gt (hab : a < b) : ¬ b ≤ a := (lt_iff_le_not_ge.1 hab).2 +@[to_dual self (reorder := 3 4)] lemma not_lt_of_ge (hab : a ≤ b) : ¬ b < a := imp_not_comm.1 not_le_of_gt hab @[deprecated (since := "2025-05-11")] alias not_le_of_lt := not_le_of_gt @[deprecated (since := "2025-05-11")] alias not_lt_of_le := not_lt_of_ge -alias LT.lt.not_ge := not_le_of_gt -alias LE.le.not_gt := not_lt_of_ge +@[to_dual self (reorder := 3 4)] alias LT.lt.not_ge := not_le_of_gt +@[to_dual self (reorder := 3 4)] alias LE.le.not_gt := not_lt_of_ge @[deprecated (since := "2025-06-07")] alias LT.lt.not_le := LT.lt.not_ge @[deprecated (since := "2025-06-07")] alias LE.le.not_lt := LE.le.not_gt - -lemma ge_trans : b ≤ a → c ≤ b → c ≤ a := fun h₁ h₂ => le_trans h₂ h₁ - -lemma lt_irrefl (a : α) : ¬a < a := fun h ↦ not_le_of_gt h le_rfl +@[to_dual self] lemma lt_irrefl (a : α) : ¬a < a := fun h ↦ not_le_of_gt h le_rfl @[deprecated (since := "2025-06-07")] alias gt_irrefl := lt_irrefl +@[to_dual lt_of_lt_of_le'] lemma lt_of_lt_of_le (hab : a < b) (hbc : b ≤ c) : a < c := lt_of_le_not_ge (le_trans (le_of_lt hab) hbc) fun hca ↦ not_le_of_gt hab (le_trans hbc hca) +@[to_dual lt_of_le_of_lt'] lemma lt_of_le_of_lt (hab : a ≤ b) (hbc : b < c) : a < c := lt_of_le_not_ge (le_trans hab (le_of_lt hbc)) fun hca ↦ not_le_of_gt hbc (le_trans hca hab) -lemma lt_of_lt_of_le' : b < a → c ≤ b → c < a := flip lt_of_le_of_lt -lemma lt_of_le_of_lt' : b ≤ a → c < b → c < a := flip lt_of_lt_of_le - @[deprecated (since := "2025-06-07")] alias gt_of_gt_of_ge := lt_of_lt_of_le' @[deprecated (since := "2025-06-07")] alias gt_of_ge_of_gt := lt_of_le_of_lt' +@[to_dual gt_trans] lemma lt_trans : a < b → b < c → a < c := fun h₁ h₂ => lt_of_lt_of_le h₁ (le_of_lt h₂) -lemma gt_trans : b < a → c < b → c < a := flip lt_trans +@[to_dual ne_of_gt] lemma ne_of_lt (h : a < b) : a ≠ b := fun he => absurd h (he ▸ lt_irrefl a) -lemma ne_of_gt (h : b < a) : a ≠ b := fun he => absurd h (he ▸ lt_irrefl a) +@[to_dual self (reorder := 3 4)] lemma lt_asymm (h : a < b) : ¬b < a := fun h1 : b < a => lt_irrefl a (lt_trans h h1) +@[to_dual self (reorder := 3 4)] alias not_lt_of_gt := lt_asymm - @[deprecated (since := "2025-05-11")] alias not_lt_of_lt := not_lt_of_gt +@[to_dual le_of_lt_or_eq'] lemma le_of_lt_or_eq (h : a < b ∨ a = b) : a ≤ b := h.elim le_of_lt le_of_eq +@[to_dual le_of_eq_or_lt'] lemma le_of_eq_or_lt (h : a = b ∨ a < b) : a ≤ b := h.elim le_of_eq le_of_lt -instance : @Trans α α α LE.le LE.le LE.le := ⟨le_trans⟩ -instance : @Trans α α α LT.lt LT.lt LT.lt := ⟨lt_trans⟩ -instance : @Trans α α α LT.lt LE.le LT.lt := ⟨lt_of_lt_of_le⟩ -instance : @Trans α α α LE.le LT.lt LT.lt := ⟨lt_of_le_of_lt⟩ -instance : @Trans α α α GE.ge GE.ge GE.ge := ⟨ge_trans⟩ -instance : @Trans α α α GT.gt GT.gt GT.gt := ⟨gt_trans⟩ -instance : @Trans α α α GT.gt GE.ge GT.gt := ⟨lt_of_lt_of_le'⟩ -instance : @Trans α α α GE.ge GT.gt GT.gt := ⟨lt_of_le_of_lt'⟩ +instance instTransLE : @Trans α α α LE.le LE.le LE.le := ⟨le_trans⟩ +instance instTransLT : @Trans α α α LT.lt LT.lt LT.lt := ⟨lt_trans⟩ +instance instTransLTLE : @Trans α α α LT.lt LE.le LT.lt := ⟨lt_of_lt_of_le⟩ +instance instTransLELT : @Trans α α α LE.le LT.lt LT.lt := ⟨lt_of_le_of_lt⟩ +-- we have to express the following 4 instances in terms of `≥` instead of flipping the arguments +-- to `≤`, because otherwise `calc` gets confused. +@[to_dual existing instTransLE] +instance instTransGE : @Trans α α α GE.ge GE.ge GE.ge := ⟨ge_trans⟩ +@[to_dual existing instTransLT] +instance instTransGT : @Trans α α α GT.gt GT.gt GT.gt := ⟨gt_trans⟩ +@[to_dual existing instTransLTLE] +instance instTransGTGE : @Trans α α α GT.gt GE.ge GT.gt := ⟨lt_of_lt_of_le'⟩ +@[to_dual existing instTransLELT] +instance instTransGEGT : @Trans α α α GE.ge GT.gt GT.gt := ⟨lt_of_le_of_lt'⟩ /-- `<` is decidable if `≤` is. -/ +@[to_dual decidableGTOfDecidableGE /-- `<` is decidable if `≤` is. -/] def decidableLTOfDecidableLE [DecidableLE α] : DecidableLT α := fun _ _ => decidable_of_iff _ lt_iff_le_not_ge.symm /-- `WCovBy a b` means that `a = b` or `b` covers `a`. This means that `a ≤ b` and there is no element in between. This is denoted `a ⩿ b`. -/ +@[to_dual self (reorder := 3 4)] def WCovBy (a b : α) : Prop := a ≤ b ∧ ∀ ⦃c⦄, a < c → ¬c < b @@ -142,6 +163,7 @@ infixl:50 " ⩿ " => WCovBy /-- `CovBy a b` means that `b` covers `a`. This means that `a < b` and there is no element in between. This is denoted `a ⋖ b`. -/ +@[to_dual self (reorder := 3 4)] def CovBy {α : Type*} [LT α] (a b : α) : Prop := a < b ∧ ∀ ⦃c⦄, a < c → ¬c < b @@ -160,24 +182,31 @@ section PartialOrder class PartialOrder (α : Type*) extends Preorder α where le_antisymm : ∀ a b : α, a ≤ b → b ≤ a → a = b +attribute [to_dual self (reorder := 5 6)] PartialOrder.le_antisymm + instance [PartialOrder α] : Std.IsPartialOrder α where le_antisymm := PartialOrder.le_antisymm variable [PartialOrder α] {a b : α} +@[to_dual ge_antisymm] lemma le_antisymm : a ≤ b → b ≤ a → a = b := PartialOrder.le_antisymm _ _ +@[to_dual eq_of_ge_of_le] alias eq_of_le_of_ge := le_antisymm @[deprecated (since := "2025-06-07")] alias eq_of_le_of_le := eq_of_le_of_ge +@[to_dual ge_antisymm_iff] lemma le_antisymm_iff : a = b ↔ a ≤ b ∧ b ≤ a := ⟨fun e => ⟨le_of_eq e, le_of_eq e.symm⟩, fun ⟨h1, h2⟩ => le_antisymm h1 h2⟩ +@[to_dual lt_of_le_of_ne'] lemma lt_of_le_of_ne : a ≤ b → a ≠ b → a < b := fun h₁ h₂ => lt_of_le_not_ge h₁ <| mt (le_antisymm h₁) h₂ /-- Equality is decidable if `≤` is. -/ +@[to_dual decidableEqofDecidableGE /-- Equality is decidable if `≤` is. -/] def decidableEqOfDecidableLE [DecidableLE α] : DecidableEq α | a, b => if hab : a ≤ b then @@ -185,13 +214,17 @@ def decidableEqOfDecidableLE [DecidableLE α] : DecidableEq α else isFalse fun heq => hab (heq ▸ le_refl _) -- See Note [decidable namespace] +@[to_dual Decidable.lt_or_eq_of_le'] protected lemma Decidable.lt_or_eq_of_le [DecidableLE α] (hab : a ≤ b) : a < b ∨ a = b := if hba : b ≤ a then Or.inr (le_antisymm hab hba) else Or.inl (lt_of_le_not_ge hab hba) +@[to_dual Decidable.le_iff_lt_or_eq'] protected lemma Decidable.le_iff_lt_or_eq [DecidableLE α] : a ≤ b ↔ a < b ∨ a = b := ⟨Decidable.lt_or_eq_of_le, le_of_lt_or_eq⟩ +@[to_dual lt_or_eq_of_le'] lemma lt_or_eq_of_le : a ≤ b → a < b ∨ a = b := open scoped Classical in Decidable.lt_or_eq_of_le +@[to_dual le_iff_lt_or_eq'] lemma le_iff_lt_or_eq : a ≤ b ↔ a < b ∨ a = b := open scoped Classical in Decidable.le_iff_lt_or_eq end PartialOrder diff --git a/Mathlib/Order/Defs/Unbundled.lean b/Mathlib/Order/Defs/Unbundled.lean index 9ec38de252ea67..075be7112ab63b 100644 --- a/Mathlib/Order/Defs/Unbundled.lean +++ b/Mathlib/Order/Defs/Unbundled.lean @@ -3,11 +3,13 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ -import Mathlib.Data.Set.Defs -import Mathlib.Tactic.ExtendDoc -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.TypeStar +module + +public import Mathlib.Data.Set.Defs +public import Mathlib.Tactic.ExtendDoc +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.SplitIfs +public import Mathlib.Tactic.TypeStar /-! # Orders @@ -16,6 +18,8 @@ Defines classes for preorders, partial orders, and linear orders and proves some basic lemmas about them. -/ +@[expose] public section + /-! ### Unbundled classes -/ /-- An empty relation does not relate any elements. -/ diff --git a/Mathlib/Order/Directed.lean b/Mathlib/Order/Directed.lean index 8d4cc5a4d2ae31..718e99a12c6c71 100644 --- a/Mathlib/Order/Directed.lean +++ b/Mathlib/Order/Directed.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yaël Dillies -/ -import Mathlib.Data.Set.Image +module + +public import Mathlib.Data.Set.Image /-! # Directed indexed families and sets @@ -27,6 +29,8 @@ Define connected orders (the transitive symmetric closure of `≤` is everything * [Gierz et al, *A Compendium of Continuous Lattices*][GierzEtAl1980] -/ +@[expose] public section + open Function diff --git a/Mathlib/Order/DirectedInverseSystem.lean b/Mathlib/Order/DirectedInverseSystem.lean index 7cb172c364b552..0025fbe3d7658f 100644 --- a/Mathlib/Order/DirectedInverseSystem.lean +++ b/Mathlib/Order/DirectedInverseSystem.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Order.SuccPred.Limit -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Order.SuccPred.Limit +public import Mathlib.Order.UpperLower.Basic /-! # Definition of direct systems, inverse systems, and cardinalities in specific inverse systems @@ -56,6 +58,8 @@ the distinguished bijection that is compatible with the projections to all `X i` -/ +@[expose] public section + open Order Set variable {ι : Type*} [Preorder ι] {F₁ F₂ F X : ι → Type*} diff --git a/Mathlib/Order/Disjoint.lean b/Mathlib/Order/Disjoint.lean index 6edec14cf48b7b..a6c2a1042c018d 100644 --- a/Mathlib/Order/Disjoint.lean +++ b/Mathlib/Order/Disjoint.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Aesop -import Mathlib.Order.BoundedOrder.Lattice +module + +public import Aesop +public import Mathlib.Order.BoundedOrder.Lattice /-! # Disjointness and complements @@ -21,6 +23,8 @@ This file defines `Disjoint`, `Codisjoint`, and the `IsCompl` predicate. -/ +@[expose] public section + open Function variable {α : Type*} diff --git a/Mathlib/Order/Disjointed.lean b/Mathlib/Order/Disjointed.lean index f39ab08d88e8cb..e6f4bdfb4ee5a3 100644 --- a/Mathlib/Order/Disjointed.lean +++ b/Mathlib/Order/Disjointed.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yaël Dillies, David Loeffler -/ -import Mathlib.Order.PartialSups -import Mathlib.Order.Interval.Finset.Fin +module + +public import Mathlib.Order.PartialSups +public import Mathlib.Order.Interval.Finset.Fin /-! # Making a sequence disjoint @@ -33,6 +35,8 @@ It is actually unique, as `disjointed_unique` shows. We also provide set notation variants of some lemmas. -/ +@[expose] public section + assert_not_exists SuccAddOrder open Finset Order diff --git a/Mathlib/Order/Extension/Linear.lean b/Mathlib/Order/Extension/Linear.lean index 8d8565643e9e23..96bb308852051f 100644 --- a/Mathlib/Order/Extension/Linear.lean +++ b/Mathlib/Order/Extension/Linear.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ -import Mathlib.Order.Zorn +module + +public import Mathlib.Order.Zorn /-! # Extend a partial order to a linear order @@ -12,6 +14,8 @@ This file constructs a linear order which is an extension of the given partial o lemma. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Extension/Well.lean b/Mathlib/Order/Extension/Well.lean index 216048a829c599..47b6d1cb46f81a 100644 --- a/Mathlib/Order/Extension/Well.lean +++ b/Mathlib/Order/Extension/Well.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies, Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Junyan Xu -/ -import Mathlib.Data.Prod.Lex -import Mathlib.SetTheory.Ordinal.Rank +module + +public import Mathlib.Data.Prod.Lex +public import Mathlib.SetTheory.Ordinal.Rank /-! # Extend a well-founded order to a well-order @@ -33,6 +35,8 @@ to the `mathlib` 3 version but avoids non-standard instances. well-founded relation, well order, extension -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/Filter/AtTopBot/Archimedean.lean b/Mathlib/Order/Filter/AtTopBot/Archimedean.lean index 95906eac1817d1..e85a025f43bc40 100644 --- a/Mathlib/Order/Filter/AtTopBot/Archimedean.lean +++ b/Mathlib/Order/Filter/AtTopBot/Archimedean.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ -import Mathlib.Algebra.Order.Archimedean.Basic -import Mathlib.Order.Filter.AtTopBot.Group -import Mathlib.Order.Filter.CountablyGenerated -import Mathlib.Tactic.GCongr +module + +public import Mathlib.Algebra.Order.Archimedean.Basic +public import Mathlib.Order.Filter.AtTopBot.Group +public import Mathlib.Order.Filter.CountablyGenerated +public import Mathlib.Tactic.GCongr /-! # `Filter.atTop` filter and archimedean (semi)rings/fields @@ -17,6 +19,8 @@ does `f`. We also prove that `Nat.cast : ℕ → R` tends to `Filter.atTop` alon well as version of these two results for `ℤ` (and a ring `R`) and `ℚ` (and a field `R`). -/ +@[expose] public section + variable {α R : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/Basic.lean b/Mathlib/Order/Filter/AtTopBot/Basic.lean index 189bc770a0aaca..cfb3869dc9a347 100644 --- a/Mathlib/Order/Filter/AtTopBot/Basic.lean +++ b/Mathlib/Order/Filter/AtTopBot/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Order.Filter.Bases.Basic -import Mathlib.Order.Filter.AtTopBot.Tendsto -import Mathlib.Order.Nat -import Mathlib.Tactic.Subsingleton +module + +public import Mathlib.Order.Filter.Bases.Basic +public import Mathlib.Order.Filter.AtTopBot.Tendsto +public import Mathlib.Order.Nat +public import Mathlib.Tactic.Subsingleton /-! # Basic results on `Filter.atTop` and `Filter.atBot` filters @@ -14,6 +16,8 @@ import Mathlib.Tactic.Subsingleton In this file we prove many lemmas like “if `f → +∞`, then `f ± c → +∞`”. -/ +@[expose] public section + assert_not_exists Finset variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/BigOperators.lean b/Mathlib/Order/Filter/AtTopBot/BigOperators.lean index 4ce9038653844b..62bb73f5a29916 100644 --- a/Mathlib/Order/Filter/AtTopBot/BigOperators.lean +++ b/Mathlib/Order/Filter/AtTopBot/BigOperators.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Preimage -import Mathlib.Order.Filter.AtTopBot.Basic +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Preimage +public import Mathlib.Order.Filter.AtTopBot.Basic /-! # Two lemmas about limit of `Π b ∈ s, f b` along @@ -14,6 +16,8 @@ about `Filter.atTop : Filter (Finset _)` and `∏ b ∈ s, f b`. These lemmas are useful to build the theory of absolutely convergent series. -/ +@[expose] public section + open Filter Finset variable {α β M : Type*} [CommMonoid M] diff --git a/Mathlib/Order/Filter/AtTopBot/CompleteLattice.lean b/Mathlib/Order/Filter/AtTopBot/CompleteLattice.lean index 1fca16ad3bbcd1..3fc515325b9f2d 100644 --- a/Mathlib/Order/Filter/AtTopBot/CompleteLattice.lean +++ b/Mathlib/Order/Filter/AtTopBot/CompleteLattice.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Order.Filter.AtTopBot.Tendsto +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Order.Filter.AtTopBot.Tendsto /-! # `Filter.atTop` and `Filter.atBot` in (conditionally) complete lattices -/ +@[expose] public section + assert_not_exists Finset variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/CountablyGenerated.lean b/Mathlib/Order/Filter/AtTopBot/CountablyGenerated.lean index dee22d8610652f..1c8a7f7c01fde2 100644 --- a/Mathlib/Order/Filter/AtTopBot/CountablyGenerated.lean +++ b/Mathlib/Order/Filter/AtTopBot/CountablyGenerated.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Order.Filter.AtTopBot.Finite -import Mathlib.Order.Filter.AtTopBot.Prod -import Mathlib.Order.Filter.CountablyGenerated +module + +public import Mathlib.Order.Filter.AtTopBot.Finite +public import Mathlib.Order.Filter.AtTopBot.Prod +public import Mathlib.Order.Filter.CountablyGenerated /-! # Convergence to infinity and countably generated filters @@ -19,6 +21,8 @@ In this file we prove that is equivalent to convergence along all sequences that converge to this filter. -/ +@[expose] public section + open Set namespace Filter diff --git a/Mathlib/Order/Filter/AtTopBot/Defs.lean b/Mathlib/Order/Filter/AtTopBot/Defs.lean index 57a65253ada2a2..b678f5e2df54d3 100644 --- a/Mathlib/Order/Filter/AtTopBot/Defs.lean +++ b/Mathlib/Order/Filter/AtTopBot/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Set.Piecewise -import Mathlib.Order.Filter.Basic +module + +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Order.Filter.Basic /-! # Definition of `Filter.atTop` and `Filter.atBot` filters @@ -15,6 +17,8 @@ In this file we define the filters * `Filter.atBot`: corresponds to `n → -∞`. -/ +@[expose] public section + assert_not_exists Finset variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/Disjoint.lean b/Mathlib/Order/Filter/AtTopBot/Disjoint.lean index 34dd9ca8e0c74e..02d6f0585e852e 100644 --- a/Mathlib/Order/Filter/AtTopBot/Disjoint.lean +++ b/Mathlib/Order/Filter/AtTopBot/Disjoint.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Order.Filter.AtTopBot.Defs -import Mathlib.Order.Interval.Set.Disjoint +module + +public import Mathlib.Order.Filter.AtTopBot.Defs +public import Mathlib.Order.Interval.Set.Disjoint /-! # Disjointness of `Filter.atTop` and `Filter.atBot` -/ +@[expose] public section + assert_not_exists Finset variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/Field.lean b/Mathlib/Order/Filter/AtTopBot/Field.lean index 3b5074dbf97131..fa441ac1c97d59 100644 --- a/Mathlib/Order/Filter/AtTopBot/Field.lean +++ b/Mathlib/Order/Filter/AtTopBot/Field.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Order.Filter.AtTopBot.Ring +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Order.Filter.AtTopBot.Ring /-! # Convergence to ±infinity in linear ordered (semi)fields -/ +@[expose] public section + namespace Filter variable {α β : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/Finite.lean b/Mathlib/Order/Filter/AtTopBot/Finite.lean index 76b93ec8dee5d4..df3645e7fb9ce4 100644 --- a/Mathlib/Order/Filter/AtTopBot/Finite.lean +++ b/Mathlib/Order/Filter/AtTopBot/Finite.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.Order.Filter.Bases.Finite -import Mathlib.Order.Filter.AtTopBot.Basic +module + +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.Order.Filter.Bases.Finite +public import Mathlib.Order.Filter.AtTopBot.Basic /-! # Finiteness and `Filter.atTop` and `Filter.atBot` filters @@ -14,6 +16,8 @@ This file contains results on `Filter.atTop` and `Filter.atBot` that depend on the finiteness theory developed in Mathlib. -/ +@[expose] public section + variable {ι ι' α β γ : Type*} open Set diff --git a/Mathlib/Order/Filter/AtTopBot/Finset.lean b/Mathlib/Order/Filter/AtTopBot/Finset.lean index f5fd40eda9880d..37588a6b45063b 100644 --- a/Mathlib/Order/Filter/AtTopBot/Finset.lean +++ b/Mathlib/Order/Filter/AtTopBot/Finset.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Finset.Order -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Interval.Finset.Defs +module + +public import Mathlib.Data.Finset.Order +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Interval.Finset.Defs /-! # `Filter.atTop` and `Filter.atBot` filters and finite sets. -/ +@[expose] public section + variable {ι ι' α β γ : Type*} open Set diff --git a/Mathlib/Order/Filter/AtTopBot/Floor.lean b/Mathlib/Order/Filter/AtTopBot/Floor.lean index c870a98a9581e1..41a381495f00bb 100644 --- a/Mathlib/Order/Filter/AtTopBot/Floor.lean +++ b/Mathlib/Order/Filter/AtTopBot/Floor.lean @@ -3,15 +3,19 @@ Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.Algebra.Order.Floor.Semiring -import Mathlib.Algebra.Order.Ring.Abs -import Mathlib.Order.Filter.AtTopBot.Finite -import Mathlib.Tactic.Positivity.Basic +module + +public import Mathlib.Algebra.Order.Floor.Semiring +public import Mathlib.Algebra.Order.Ring.Abs +public import Mathlib.Order.Filter.AtTopBot.Finite +public import Mathlib.Tactic.Positivity.Basic /-! # `a * c ^ n < (n - d)!` holds true for sufficiently large `n`. -/ +@[expose] public section + open Filter open scoped Nat diff --git a/Mathlib/Order/Filter/AtTopBot/Group.lean b/Mathlib/Order/Filter/AtTopBot/Group.lean index 0e42f35be097b9..f8bccb5f86f527 100644 --- a/Mathlib/Order/Filter/AtTopBot/Group.lean +++ b/Mathlib/Order/Filter/AtTopBot/Group.lean @@ -3,15 +3,19 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.MinMax -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.AtTopBot.Map -import Mathlib.Order.Filter.AtTopBot.Monoid +module + +public import Mathlib.Algebra.Order.Group.MinMax +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.AtTopBot.Map +public import Mathlib.Order.Filter.AtTopBot.Monoid /-! # Convergence to ±infinity in ordered commutative groups -/ +@[expose] public section + variable {α G : Type*} open Set diff --git a/Mathlib/Order/Filter/AtTopBot/Interval.lean b/Mathlib/Order/Filter/AtTopBot/Interval.lean index 1d42f4e21db7c4..2311a3946226d2 100644 --- a/Mathlib/Order/Filter/AtTopBot/Interval.lean +++ b/Mathlib/Order/Filter/AtTopBot/Interval.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ +module -import Mathlib.Order.Filter.AtTopBot.Archimedean -import Mathlib.Order.Filter.Prod -import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Order.Filter.AtTopBot.Archimedean +public import Mathlib.Order.Filter.Prod +public import Mathlib.Order.Interval.Finset.Defs /-! # Limits of intervals along filters @@ -15,6 +16,8 @@ This file contains some lemmas about how filters `Ixx` behave as the endpoints t -/ +@[expose] public section + namespace Finset open Filter diff --git a/Mathlib/Order/Filter/AtTopBot/Map.lean b/Mathlib/Order/Filter/AtTopBot/Map.lean index 8438f579a3d09e..f233f77702f95a 100644 --- a/Mathlib/Order/Filter/AtTopBot/Map.lean +++ b/Mathlib/Order/Filter/AtTopBot/Map.lean @@ -3,15 +3,19 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Order.Filter.AtTopBot.Defs -import Mathlib.Order.Filter.Map -import Mathlib.Order.Filter.Tendsto -import Mathlib.Order.Interval.Set.OrderIso +module + +public import Mathlib.Order.Filter.AtTopBot.Defs +public import Mathlib.Order.Filter.Map +public import Mathlib.Order.Filter.Tendsto +public import Mathlib.Order.Interval.Set.OrderIso /-! # Map and comap of `Filter.atTop` and `Filter.atBot` -/ +@[expose] public section + assert_not_exists Finset variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Filter/AtTopBot/ModEq.lean b/Mathlib/Order/Filter/AtTopBot/ModEq.lean index d1682a6fab1efb..c511295aa2c6ea 100644 --- a/Mathlib/Order/Filter/AtTopBot/ModEq.lean +++ b/Mathlib/Order/Filter/AtTopBot/ModEq.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.Nat.ModEq -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.AtTopBot.Monoid +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.AtTopBot.Monoid /-! # Numbers are frequently ModEq to fixed numbers @@ -17,6 +19,8 @@ import Mathlib.Order.Filter.AtTopBot.Monoid In this file we prove that `m ≡ d [MOD n]` frequently as `m → ∞`. -/ +@[expose] public section + open Filter diff --git a/Mathlib/Order/Filter/AtTopBot/Monoid.lean b/Mathlib/Order/Filter/AtTopBot/Monoid.lean index 6a714f62ffea8c..2897c9be3c5b25 100644 --- a/Mathlib/Order/Filter/AtTopBot/Monoid.lean +++ b/Mathlib/Order/Filter/AtTopBot/Monoid.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Algebra.Order.Monoid.Unbundled.Pow -import Mathlib.Order.Filter.AtTopBot.Tendsto +module + +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Algebra.Order.Monoid.Unbundled.Pow +public import Mathlib.Order.Filter.AtTopBot.Tendsto /-! # Convergence to ±infinity in ordered commutative monoids -/ +@[expose] public section + variable {α M : Type*} namespace Filter diff --git a/Mathlib/Order/Filter/AtTopBot/Prod.lean b/Mathlib/Order/Filter/AtTopBot/Prod.lean index e80f1b86c1ff06..ca135cee9a6c5e 100644 --- a/Mathlib/Order/Filter/AtTopBot/Prod.lean +++ b/Mathlib/Order/Filter/AtTopBot/Prod.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Finset.Prod -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.Prod +module + +public import Mathlib.Data.Finset.Prod +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.Prod /-! # `Filter.atTop` and `Filter.atBot` filters on products -/ +@[expose] public section + variable {ι ι' α β γ : Type*} open Set diff --git a/Mathlib/Order/Filter/AtTopBot/Ring.lean b/Mathlib/Order/Filter/AtTopBot/Ring.lean index 4b2b45aa8c7425..1cbadecafcf740 100644 --- a/Mathlib/Order/Filter/AtTopBot/Ring.lean +++ b/Mathlib/Order/Filter/AtTopBot/Ring.lean @@ -3,13 +3,17 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Order.Filter.AtTopBot.Group +module + +public import Mathlib.Algebra.Order.Ring.Defs +public import Mathlib.Order.Filter.AtTopBot.Group /-! # Convergence to ±infinity in ordered rings -/ +@[expose] public section + variable {α β : Type*} namespace Filter diff --git a/Mathlib/Order/Filter/AtTopBot/Tendsto.lean b/Mathlib/Order/Filter/AtTopBot/Tendsto.lean index e447d6ce227616..034626a18f5164 100644 --- a/Mathlib/Order/Filter/AtTopBot/Tendsto.lean +++ b/Mathlib/Order/Filter/AtTopBot/Tendsto.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Order.Filter.AtTopBot.Disjoint -import Mathlib.Order.Filter.Tendsto +module + +public import Mathlib.Order.Filter.AtTopBot.Disjoint +public import Mathlib.Order.Filter.Tendsto /-! # Limits of `Filter.atTop` and `Filter.atBot` @@ -13,6 +15,8 @@ In this file we prove many lemmas on the combination of `Filter.atTop` and `Filt and `Tendsto`. -/ +@[expose] public section + assert_not_exists Finset variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Filter/Bases/Basic.lean b/Mathlib/Order/Filter/Bases/Basic.lean index 2aeacd75e9678f..5fddc91c778973 100644 --- a/Mathlib/Order/Filter/Bases/Basic.lean +++ b/Mathlib/Order/Filter/Bases/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Johannes Hölzl, Mario Carneiro, Patrick Massot -/ -import Mathlib.Data.Set.Sigma -import Mathlib.Order.Filter.Defs -import Mathlib.Order.Filter.Map -import Mathlib.Order.Interval.Set.Basic +module + +public import Mathlib.Data.Set.Sigma +public import Mathlib.Order.Filter.Defs +public import Mathlib.Order.Filter.Map +public import Mathlib.Order.Interval.Set.Basic /-! # Basic results on filter bases @@ -68,6 +70,8 @@ machinery, e.g., `simp only [true_and_iff]` or `simp only [forall_const]` can he ## Main statements -/ +@[expose] public section + assert_not_exists Finset open Set Filter diff --git a/Mathlib/Order/Filter/Bases/Finite.lean b/Mathlib/Order/Filter/Bases/Finite.lean index 7e84fb15e4c156..0480bd0b8e87ae 100644 --- a/Mathlib/Order/Filter/Bases/Finite.lean +++ b/Mathlib/Order/Filter/Bases/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Johannes Hölzl, Mario Carneiro, Patrick Massot -/ -import Mathlib.Order.Filter.Bases.Basic -import Mathlib.Order.Filter.Finite +module + +public import Mathlib.Order.Filter.Bases.Basic +public import Mathlib.Order.Filter.Finite /-! # Finiteness results on filter bases @@ -14,6 +16,8 @@ such that the intersection of two elements of this collection contains some elem the collection. -/ +@[expose] public section + open Set Filter variable {α β γ : Type*} {ι ι' : Sort*} diff --git a/Mathlib/Order/Filter/Basic.lean b/Mathlib/Order/Filter/Basic.lean index 074c6a691c9a83..bd691dba91634d 100644 --- a/Mathlib/Order/Filter/Basic.lean +++ b/Mathlib/Order/Filter/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad -/ -import Mathlib.Algebra.Group.Pi.Basic -import Mathlib.Data.Set.Lattice -import Mathlib.Order.Filter.Defs +module + +public import Mathlib.Algebra.Group.Pi.Basic +public import Mathlib.Data.Set.Lattice +public import Mathlib.Order.Filter.Defs /-! # Theory of filters on sets @@ -59,6 +61,8 @@ we do *not* require. This gives `Filter X` better formal properties, in particul `[NeBot f]` in a number of lemmas and definitions. -/ +@[expose] public section + assert_not_exists IsOrderedRing Fintype open Function Set Order @@ -767,11 +771,11 @@ theorem frequently_iff {f : Filter α} {P : α → Prop} : simp only [frequently_iff_forall_eventually_exists_and, @and_comm (P _)] rfl -@[simp] +@[simp, push] theorem not_eventually {p : α → Prop} {f : Filter α} : (¬∀ᶠ x in f, p x) ↔ ∃ᶠ x in f, ¬p x := by simp [Filter.Frequently] -@[simp] +@[simp, push] theorem not_frequently {p : α → Prop} {f : Filter α} : (¬∃ᶠ x in f, p x) ↔ ∀ᶠ x in f, ¬p x := by simp only [Filter.Frequently, not_not] diff --git a/Mathlib/Order/Filter/CardinalInter.lean b/Mathlib/Order/Filter/CardinalInter.lean index 4c7eabbe4a24f4..57579c7748a0bf 100644 --- a/Mathlib/Order/Filter/CardinalInter.lean +++ b/Mathlib/Order/Filter/CardinalInter.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker -/ -import Mathlib.Order.Filter.Tendsto -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Filter.CountableInter -import Mathlib.SetTheory.Cardinal.Regular -import Mathlib.Tactic.Linarith +module + +public import Mathlib.Order.Filter.Tendsto +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Filter.CountableInter +public import Mathlib.SetTheory.Cardinal.Regular +public import Mathlib.Tactic.Linarith /-! # Filters with a cardinal intersection property @@ -16,7 +18,7 @@ In this file we define `CardinalInterFilter l c` to be the class of filters with property: for any collection of sets `s ∈ l` with cardinality strictly less than `c`, their intersection belongs to `l` as well. -# Main results +## Main results * `Filter.cardinalInterFilter_aleph0` establishes that every filter `l` is a `CardinalInterFilter l ℵ₀` * `CardinalInterFilter.toCountableInterFilter` establishes that every `CardinalInterFilter l c` with @@ -30,6 +32,8 @@ their intersection belongs to `l` as well. filter, cardinal -/ +@[expose] public section + open Set Filter Cardinal diff --git a/Mathlib/Order/Filter/Cocardinal.lean b/Mathlib/Order/Filter/Cocardinal.lean index 9163bc760c12fa..68253e877f2407 100644 --- a/Mathlib/Order/Filter/Cocardinal.lean +++ b/Mathlib/Order/Filter/Cocardinal.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker -/ -import Mathlib.Order.Filter.Cofinite -import Mathlib.Order.Filter.CountableInter -import Mathlib.Order.Filter.CardinalInter -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.SetTheory.Cardinal.Cofinality +module + +public import Mathlib.Order.Filter.Cofinite +public import Mathlib.Order.Filter.CountableInter +public import Mathlib.Order.Filter.CardinalInter +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.SetTheory.Cardinal.Cofinality /-! # The cocardinal filter @@ -18,6 +20,8 @@ In this file we define `Filter.cocardinal hc`: the filter of sets with cardinali -/ +@[expose] public section + open Set Filter Cardinal universe u diff --git a/Mathlib/Order/Filter/Cofinite.lean b/Mathlib/Order/Filter/Cofinite.lean index a16bbea92ee871..9f74c8eefc6b24 100644 --- a/Mathlib/Order/Filter/Cofinite.lean +++ b/Mathlib/Order/Filter/Cofinite.lean @@ -3,15 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov -/ -import Mathlib.Data.Finite.Prod -import Mathlib.Data.Fintype.Pi -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.Filter.CountablyGenerated -import Mathlib.Order.Filter.Ker -import Mathlib.Order.Filter.Pi -import Mathlib.Order.Filter.Prod -import Mathlib.Order.Filter.AtTopBot.Basic +module + +public import Mathlib.Data.Finite.Prod +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.Filter.CountablyGenerated +public import Mathlib.Order.Filter.Ker +public import Mathlib.Order.Filter.Pi +public import Mathlib.Order.Filter.Prod +public import Mathlib.Order.Filter.AtTopBot.Basic /-! # The cofinite filter @@ -27,6 +29,8 @@ and prove its basic properties. In particular, we prove that for `ℕ` it is equ Define filters for other cardinalities of the complement. -/ +@[expose] public section + open Set Function variable {ι α β : Type*} {l : Filter α} diff --git a/Mathlib/Order/Filter/CountableInter.lean b/Mathlib/Order/Filter/CountableInter.lean index 22b29a60b2dff2..478729e47d8216 100644 --- a/Mathlib/Order/Filter/CountableInter.lean +++ b/Mathlib/Order/Filter/CountableInter.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Filter.Curry -import Mathlib.Data.Set.Countable +module + +public import Mathlib.Order.Filter.Curry +public import Mathlib.Data.Set.Countable /-! # Filters with countable intersection property @@ -28,6 +30,8 @@ preferred spelling; it has the advantage of not requiring the user to import the filter, countable -/ +@[expose] public section + open Set Filter diff --git a/Mathlib/Order/Filter/CountableSeparatingOn.lean b/Mathlib/Order/Filter/CountableSeparatingOn.lean index 552a128f17bc54..bd9925537539e8 100644 --- a/Mathlib/Order/Filter/CountableSeparatingOn.lean +++ b/Mathlib/Order/Filter/CountableSeparatingOn.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Filter.CountableInter +module + +public import Mathlib.Order.Filter.CountableInter /-! # Filters with countable intersections and countable separating families @@ -70,6 +72,8 @@ We formalize several versions of this theorem in filter, countable -/ +@[expose] public section + open Function Set Filter /-- We say that a type `α` has a *countable separating family of sets* satisfying a predicate diff --git a/Mathlib/Order/Filter/CountablyGenerated.lean b/Mathlib/Order/Filter/CountablyGenerated.lean index 56ca0da55526f8..86b15e42cef8b1 100644 --- a/Mathlib/Order/Filter/CountablyGenerated.lean +++ b/Mathlib/Order/Filter/CountablyGenerated.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner, Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Set.Countable -import Mathlib.Order.Filter.Bases.Finite +module + +public import Mathlib.Data.Set.Countable +public import Mathlib.Order.Filter.Bases.Finite /-! # Countably generated filters @@ -16,6 +18,8 @@ We also define predicates `Filter.IsCountableBasis` and `Filter.HasCountableBasi saying that a specific family of sets is a countable basis. -/ +@[expose] public section + open Set namespace Filter diff --git a/Mathlib/Order/Filter/Curry.lean b/Mathlib/Order/Filter/Curry.lean index 499959af5c5783..ad6d74e7760371 100644 --- a/Mathlib/Order/Filter/Curry.lean +++ b/Mathlib/Order/Filter/Curry.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kevin H. Wilson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin H. Wilson -/ -import Mathlib.Order.Filter.Prod +module + +public import Mathlib.Order.Filter.Prod /-! # Curried Filters @@ -44,6 +46,8 @@ describing the product of two sets, namely `s ×ˢ t = fst ⁻¹' s ∩ snd ⁻ uniform convergence, curried filters, product filters -/ +@[expose] public section + namespace Filter diff --git a/Mathlib/Order/Filter/Defs.lean b/Mathlib/Order/Filter/Defs.lean index 5065b24ce03e45..086395debb6db2 100644 --- a/Mathlib/Order/Filter/Defs.lean +++ b/Mathlib/Order/Filter/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad -/ -import Mathlib.Data.Set.Insert -import Mathlib.Order.SetNotation -import Mathlib.Order.BooleanAlgebra.Set -import Mathlib.Order.Bounds.Defs +module + +public import Mathlib.Data.Set.Insert +public import Mathlib.Order.SetNotation +public import Mathlib.Order.BooleanAlgebra.Set +public import Mathlib.Order.Bounds.Defs /-! # Definitions about filters @@ -60,6 +62,8 @@ at the cost of including the assumption `[NeBot f]` in a number of lemmas and de * [N. Bourbaki, *General Topology*][bourbaki1966] -/ +@[expose] public section + assert_not_exists RelIso open Set diff --git a/Mathlib/Order/Filter/ENNReal.lean b/Mathlib/Order/Filter/ENNReal.lean index 899503e8b5d9b2..f6c57811b7aef8 100644 --- a/Mathlib/Order/Filter/ENNReal.lean +++ b/Mathlib/Order/Filter/ENNReal.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Topology.Order.LiminfLimsup -import Mathlib.Topology.Metrizable.Real +module + +public import Mathlib.Topology.Order.LiminfLimsup +public import Mathlib.Topology.Metrizable.Real /-! # Limsup and liminf of reals @@ -12,6 +14,8 @@ import Mathlib.Topology.Metrizable.Real This file compiles filter-related results about `ℝ`, `ℝ≥0` and `ℝ≥0∞`. -/ +@[expose] public section + open Filter ENNReal diff --git a/Mathlib/Order/Filter/EventuallyConst.lean b/Mathlib/Order/Filter/EventuallyConst.lean index 2d1cb8347234a0..81fd98bd75cd8c 100644 --- a/Mathlib/Order/Filter/EventuallyConst.lean +++ b/Mathlib/Order/Filter/EventuallyConst.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Floris van Doorn -/ -import Mathlib.Algebra.Notation.Indicator -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.Subsingleton +module + +public import Mathlib.Algebra.Notation.Indicator +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.Subsingleton /-! # Functions that are eventually constant along a filter @@ -21,6 +23,8 @@ Instead, we say that `Filter.map f l` is supported on a subsingleton. This allows us to drop `[Nonempty _]` assumptions here and there. -/ +@[expose] public section + open Set variable {α β γ δ : Type*} {l : Filter α} {f : α → β} diff --git a/Mathlib/Order/Filter/Extr.lean b/Mathlib/Order/Filter/Extr.lean index d45144f5e5a06d..87cbb07b6a9feb 100644 --- a/Mathlib/Order/Filter/Extr.lean +++ b/Mathlib/Order/Filter/Extr.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Filter.Tendsto -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Order.Filter.Tendsto +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Data.Finset.Lattice.Fold /-! # Minimum and maximum w.r.t. a filter and on a set @@ -74,6 +76,8 @@ Similar predicates with `on` suffix are particular cases for `l = 𝓟 s`. types of filters, and define the missing lemmas once one of these two lists grows. -/ +@[expose] public section + universe u v w x diff --git a/Mathlib/Order/Filter/FilterProduct.lean b/Mathlib/Order/Filter/FilterProduct.lean index 0056f6bacbc75a..3693ff5bbf4f78 100644 --- a/Mathlib/Order/Filter/FilterProduct.lean +++ b/Mathlib/Order/Filter/FilterProduct.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Abhimanyu Pallavi Sudhir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Abhimanyu Pallavi Sudhir, Yury Kudryashov -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Order.Filter.Ring -import Mathlib.Order.Filter.Ultrafilter.Defs +module + +public import Mathlib.Algebra.Field.Defs +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Order.Filter.Ring +public import Mathlib.Order.Filter.Ultrafilter.Defs /-! # Ultraproducts @@ -20,6 +22,8 @@ ultrafilter. Definitions and properties that work for any filter should go to `O ultrafilter, ultraproduct -/ +@[expose] public section + universe u v diff --git a/Mathlib/Order/Filter/Finite.lean b/Mathlib/Order/Filter/Finite.lean index cc2cda77d69bfc..747c287bbd817a 100644 --- a/Mathlib/Order/Filter/Finite.lean +++ b/Mathlib/Order/Filter/Finite.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad -/ -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.CompleteLattice.Finset -import Mathlib.Order.Filter.Basic +module + +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.CompleteLattice.Finset +public import Mathlib.Order.Filter.Basic /-! # Results relating filters to finiteness @@ -13,6 +15,8 @@ import Mathlib.Order.Filter.Basic This file proves that finitely many conditions eventually hold if each of them eventually holds. -/ +@[expose] public section + open Function Set Order open scoped symmDiff @@ -258,7 +262,7 @@ theorem iInf_principal_finite {ι : Type w} {s : Set ι} (hs : s.Finite) (f : ι end Lattice -/-! ### Eventually -/ +/-! ### Eventually and Frequently -/ @[simp] theorem eventually_all {ι : Sort*} [Finite ι] {l} {p : ι → α → Prop} : @@ -278,6 +282,26 @@ protected alias _root_.Set.Finite.eventually_all := eventually_all_finite protected alias _root_.Finset.eventually_all := eventually_all_finset +@[simp] +theorem frequently_exists {ι : Sort*} [Finite ι] {l} {p : ι → α → Prop} : + (∃ᶠ x in l, ∃ i, p i x) ↔ ∃ i, ∃ᶠ x in l, p i x := by + rw [← not_iff_not] + simp + +@[simp] +theorem frequently_exists_finite {ι} {I : Set ι} (hI : I.Finite) {l} {p : ι → α → Prop} : + (∃ᶠ x in l, ∃ i ∈ I, p i x) ↔ ∃ i ∈ I, ∃ᶠ x in l, p i x := by + rw [← not_iff_not] + simp [hI] + +protected alias _root_.Set.Finite.frequently_exists := frequently_exists_finite + +@[simp] theorem frequently_exists_finset {ι} (I : Finset ι) {l} {p : ι → α → Prop} : + (∃ᶠ x in l, ∃ i ∈ I, p i x) ↔ ∃ i ∈ I, ∃ᶠ x in l, p i x := + I.finite_toSet.frequently_exists + +protected alias _root_.Finset.frequently_exists := frequently_exists_finset + lemma eventually_subset_of_finite {ι : Type*} {f : Filter ι} {s : ι → Set α} {t : Set α} (ht : t.Finite) (hs : ∀ a ∈ t, ∀ᶠ i in f, a ∈ s i) : ∀ᶠ i in f, t ⊆ s i := by simpa [Set.subset_def, eventually_all_finite ht] using hs diff --git a/Mathlib/Order/Filter/Germ/Basic.lean b/Mathlib/Order/Filter/Germ/Basic.lean index 120dba7c133a8a..8383d9a91fab77 100644 --- a/Mathlib/Order/Filter/Germ/Basic.lean +++ b/Mathlib/Order/Filter/Germ/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Abhimanyu Pallavi Sudhir -/ -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE -import Mathlib.Data.Int.Cast.Basic -import Mathlib.Data.Int.Cast.Pi -import Mathlib.Data.Nat.Cast.Basic -import Mathlib.Order.Filter.Tendsto +module + +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE +public import Mathlib.Data.Int.Cast.Basic +public import Mathlib.Data.Int.Cast.Pi +public import Mathlib.Data.Nat.Cast.Basic +public import Mathlib.Order.Filter.Tendsto /-! # Germ of a function at a filter @@ -52,6 +54,8 @@ For each of the following structures we prove that if `β` has this structure, t filter, germ -/ +@[expose] public section + assert_not_exists IsOrderedRing open scoped Relator @@ -690,7 +694,6 @@ theorem const_le_iff [LE β] [NeBot l] {x y : β} : (↑x : Germ l β) ≤ ↑y liftRel_const_iff instance instPreorder [Preorder β] : Preorder (Germ l β) where - le := (· ≤ ·) le_refl f := inductionOn f <| EventuallyLE.refl l le_trans f₁ f₂ f₃ := inductionOn₃ f₁ f₂ f₃ fun _ _ _ => EventuallyLE.trans diff --git a/Mathlib/Order/Filter/Germ/OrderedMonoid.lean b/Mathlib/Order/Filter/Germ/OrderedMonoid.lean index 199974b208f4f7..5bd28d90ae604f 100644 --- a/Mathlib/Order/Filter/Germ/OrderedMonoid.lean +++ b/Mathlib/Order/Filter/Germ/OrderedMonoid.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Abhimanyu Pallavi Sudhir -/ -import Mathlib.Algebra.Module.Pi -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Order.Filter.Germ.Basic +module + +public import Mathlib.Algebra.Module.Pi +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Order.Filter.Germ.Basic /-! # Ordered monoid instances on the space of germs of a function at a filter @@ -20,6 +22,8 @@ For each of the following structures we prove that if `β` has this structure, t filter, germ -/ +@[expose] public section + namespace Filter.Germ variable {α : Type*} {β : Type*} {l : Filter α} diff --git a/Mathlib/Order/Filter/IndicatorFunction.lean b/Mathlib/Order/Filter/IndicatorFunction.lean index ce817acdc5544e..da71a3f77ad791 100644 --- a/Mathlib/Order/Filter/IndicatorFunction.lean +++ b/Mathlib/Order/Filter/IndicatorFunction.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov -/ -import Mathlib.Algebra.Group.Indicator -import Mathlib.Order.CompleteLattice.Finset -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.Filter.AtTopBot.Defs -import Mathlib.Order.Filter.Tendsto +module + +public import Mathlib.Algebra.Group.Indicator +public import Mathlib.Order.CompleteLattice.Finset +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.Filter.AtTopBot.Defs +public import Mathlib.Order.Filter.Tendsto /-! # Indicator function and filters @@ -18,6 +20,8 @@ Properties of additive and multiplicative indicator functions involving `=ᶠ` a indicator, characteristic, filter -/ +@[expose] public section + variable {α β M E : Type*} open Set Filter diff --git a/Mathlib/Order/Filter/Interval.lean b/Mathlib/Order/Filter/Interval.lean index 9fd813961a0b87..27e3e39e0cfe76 100644 --- a/Mathlib/Order/Filter/Interval.lean +++ b/Mathlib/Order/Filter/Interval.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Interval.Set.OrdConnected -import Mathlib.Order.Filter.SmallSets -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.Order.Filter.Bases.Finite +module + +public import Mathlib.Order.Interval.Set.OrdConnected +public import Mathlib.Order.Filter.SmallSets +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.Order.Filter.Bases.Finite /-! # Convergence of intervals @@ -73,6 +75,8 @@ that need topology are defined in `Mathlib/Topology/Algebra/Ordered`. -/ +@[expose] public section + variable {α β : Type*} diff --git a/Mathlib/Order/Filter/IsBounded.lean b/Mathlib/Order/Filter/IsBounded.lean index 55bad3731414f1..2f7b74ad0a0e1a 100644 --- a/Mathlib/Order/Filter/IsBounded.lean +++ b/Mathlib/Order/Filter/IsBounded.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Johannes Hölzl, Rémy Degenne -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Order.Filter.Cofinite +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Order.Filter.Cofinite /-! # Lemmas about `Is(Co)Bounded(Under)` @@ -16,6 +18,8 @@ This file proves several lemmas about `IsBounded`, `IsBoundedUnder`, `IsCobounded` and `IsCoboundedUnder`. -/ +@[expose] public section + open Set Function variable {α β γ ι : Type*} diff --git a/Mathlib/Order/Filter/Ker.lean b/Mathlib/Order/Filter/Ker.lean index ba8503a4f6052c..4924f9f749c7ec 100644 --- a/Mathlib/Order/Filter/Ker.lean +++ b/Mathlib/Order/Filter/Ker.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Filter.Map +module + +public import Mathlib.Order.Filter.Map /-! # Kernel of a filter @@ -15,6 +17,8 @@ We also prove that `Filter.principal` and `Filter.ker` form a Galois coinsertion and prove other basic theorems about `Filter.ker`. -/ +@[expose] public section + open Function Set namespace Filter diff --git a/Mathlib/Order/Filter/Lift.lean b/Mathlib/Order/Filter/Lift.lean index b4f192aa3e880a..002da45b05b096 100644 --- a/Mathlib/Order/Filter/Lift.lean +++ b/Mathlib/Order/Filter/Lift.lean @@ -3,15 +3,19 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.Filter.Prod -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Filter.Bases.Basic +module + +public import Mathlib.Order.Filter.Prod +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Filter.Bases.Basic /-! # Lift filters along filter and set functions -/ +@[expose] public section + open Set Filter Function namespace Filter diff --git a/Mathlib/Order/Filter/ListTraverse.lean b/Mathlib/Order/Filter/ListTraverse.lean index 392ccfec14112a..3d7be1bd5da6a8 100644 --- a/Mathlib/Order/Filter/ListTraverse.lean +++ b/Mathlib/Order/Filter/ListTraverse.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Control.Traversable.Instances -import Mathlib.Order.Filter.Map +module + +public import Mathlib.Control.Traversable.Instances +public import Mathlib.Order.Filter.Map /-! # Properties of `Traversable.traverse` on `List`s and `Filter`s @@ -12,6 +14,8 @@ In this file we prove basic properties (monotonicity, membership) for `Traversable.traverse f l`, where `f : β → Filter α` and `l : List β`. -/ +@[expose] public section + open Set List namespace Filter diff --git a/Mathlib/Order/Filter/Map.lean b/Mathlib/Order/Filter/Map.lean index ac15ba40b59fd9..e1c126aadb7fc7 100644 --- a/Mathlib/Order/Filter/Map.lean +++ b/Mathlib/Order/Filter/Map.lean @@ -3,14 +3,18 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad -/ -import Mathlib.Control.Basic -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Order.Filter.Basic +module + +public import Mathlib.Control.Basic +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Order.Filter.Basic /-! # Theorems about map and comap on filters. -/ +@[expose] public section + assert_not_exists IsOrderedRing Fintype open Function Set Order diff --git a/Mathlib/Order/Filter/NAry.lean b/Mathlib/Order/Filter/NAry.lean index 95abb7aaf47bb0..ffce6f40206747 100644 --- a/Mathlib/Order/Filter/NAry.lean +++ b/Mathlib/Order/Filter/NAry.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Filter.Bases.Basic -import Mathlib.Order.Filter.Prod +module + +public import Mathlib.Order.Filter.Bases.Basic +public import Mathlib.Order.Filter.Prod /-! # N-ary maps of filter @@ -22,6 +24,8 @@ This file is very similar to `Data.Set.NAry`, `Data.Finset.NAry` and `Data.Optio keep them in sync. -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Order/Filter/Partial.lean b/Mathlib/Order/Filter/Partial.lean index 6d53cd0f4935c9..322251651dfef2 100644 --- a/Mathlib/Order/Filter/Partial.lean +++ b/Mathlib/Order/Filter/Partial.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad -/ -import Mathlib.Order.Filter.Tendsto -import Mathlib.Data.PFun +module + +public import Mathlib.Order.Filter.Tendsto +public import Mathlib.Data.PFun /-! # `Tendsto` for relations and partial functions @@ -39,6 +41,8 @@ We first take care of relations. Then the definitions for partial functions are cases of the definitions for relations. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Order/Filter/Pi.lean b/Mathlib/Order/Filter/Pi.lean index 889d6b0ef7446a..4969404ae44652 100644 --- a/Mathlib/Order/Filter/Pi.lean +++ b/Mathlib/Order/Filter/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Alex Kontorovich -/ -import Mathlib.Data.Set.Piecewise -import Mathlib.Order.Filter.Tendsto -import Mathlib.Order.Filter.Bases.Finite +module + +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Order.Filter.Tendsto +public import Mathlib.Order.Filter.Bases.Finite /-! # (Co)product of a family of filters @@ -21,6 +23,8 @@ In this file we define two filters on `Π i, α i` and prove some basic properti of `comap (eval i) (f i)`. -/ +@[expose] public section + open Set Function Filter diff --git a/Mathlib/Order/Filter/Pointwise.lean b/Mathlib/Order/Filter/Pointwise.lean index fb0273b4cfe5bf..562d0b9e6ec365 100644 --- a/Mathlib/Order/Filter/Pointwise.lean +++ b/Mathlib/Order/Filter/Pointwise.lean @@ -3,16 +3,18 @@ Copyright (c) 2019 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yaël Dillies -/ -import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.Algebra.Ring.Defs -import Mathlib.Order.Filter.AtTopBot.Map -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Filter.NAry -import Mathlib.Order.Filter.Ultrafilter.Defs +module + +public import Mathlib.Algebra.Group.Action.Pointwise.Set.Basic +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Order.Filter.AtTopBot.Map +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Filter.NAry +public import Mathlib.Order.Filter.Ultrafilter.Defs /-! # Pointwise operations on filters @@ -59,6 +61,8 @@ instances reducible changes the behavior of `simp`). filter multiplication, filter addition, pointwise addition, pointwise multiplication, -/ +@[expose] public section + open Function Set Filter Pointwise diff --git a/Mathlib/Order/Filter/Prod.lean b/Mathlib/Order/Filter/Prod.lean index 848db6b0d3aa15..1eb114de6d221e 100644 --- a/Mathlib/Order/Filter/Prod.lean +++ b/Mathlib/Order/Filter/Prod.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Yury Kudryashov, Kevin H. Wilson, Heather Macbeth -/ -import Mathlib.Order.Filter.Tendsto +module + +public import Mathlib.Order.Filter.Tendsto /-! # Product and coproduct filters @@ -34,6 +36,8 @@ As product filter we want to have `F` as result. -/ +@[expose] public section + open Set open Filter @@ -171,8 +175,9 @@ theorem Eventually.curry {la : Filter α} {lb : Filter β} {p : α × β → Pro exact ha.mono fun a ha => hb.mono fun b hb => h ha hb protected lemma Frequently.uncurry {la : Filter α} {lb : Filter β} {p : α → β → Prop} - (h : ∃ᶠ x in la, ∃ᶠ y in lb, p x y) : ∃ᶠ xy in la ×ˢ lb, p xy.1 xy.2 := - mt (fun h ↦ by simpa only [not_frequently] using h.curry) h + (h : ∃ᶠ x in la, ∃ᶠ y in lb, p x y) : ∃ᶠ xy in la ×ˢ lb, p xy.1 xy.2 := by + contrapose! h + exact h.curry lemma Frequently.of_curry {la : Filter α} {lb : Filter β} {p : α × β → Prop} (h : ∃ᶠ x in la, ∃ᶠ y in lb, p (x, y)) : ∃ᶠ xy in la ×ˢ lb, p xy := diff --git a/Mathlib/Order/Filter/Ring.lean b/Mathlib/Order/Filter/Ring.lean index de9b225328ae70..49f55b4a1b4639 100644 --- a/Mathlib/Order/Filter/Ring.lean +++ b/Mathlib/Order/Filter/Ring.lean @@ -3,12 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad -/ -import Mathlib.Order.Filter.Germ.OrderedMonoid -import Mathlib.Algebra.Order.Ring.Defs +module + +public import Mathlib.Order.Filter.Germ.OrderedMonoid +public import Mathlib.Algebra.Order.Ring.Defs /-! # Lemmas about filters and ordered rings. -/ + +@[expose] public section namespace Filter open Function Filter @@ -32,7 +36,7 @@ theorem EventuallyLE.mul_nonneg [Semiring β] [PartialOrder β] [IsOrderedRing {l : Filter α} {f g : α → β} (hf : 0 ≤ᶠ[l] f) (hg : 0 ≤ᶠ[l] g) : 0 ≤ᶠ[l] f * g := by filter_upwards [hf, hg] with x using _root_.mul_nonneg -theorem eventually_sub_nonneg [Ring β] [PartialOrder β] [IsOrderedRing β] +theorem eventually_sub_nonneg [AddGroup β] [LE β] [AddRightMono β] {l : Filter α} {f g : α → β} : 0 ≤ᶠ[l] g - f ↔ f ≤ᶠ[l] g := eventually_congr <| Eventually.of_forall fun _ => sub_nonneg diff --git a/Mathlib/Order/Filter/SmallSets.lean b/Mathlib/Order/Filter/SmallSets.lean index fba4ce053e079b..8832ce845e7287 100644 --- a/Mathlib/Order/Filter/SmallSets.lean +++ b/Mathlib/Order/Filter/SmallSets.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Floris van Doorn, Yury Kudryashov -/ -import Mathlib.Order.Filter.Lift -import Mathlib.Order.Filter.AtTopBot.Basic +module + +public import Mathlib.Order.Filter.Lift +public import Mathlib.Order.Filter.AtTopBot.Basic /-! # The filter of small sets @@ -19,6 +21,8 @@ then saying that `fun i ↦ support (f i)` tendsto `(𝓝 0).smallSets` is a way `f` tends to the Dirac delta distribution. -/ +@[expose] public section + open Filter diff --git a/Mathlib/Order/Filter/Subsingleton.lean b/Mathlib/Order/Filter/Subsingleton.lean index 2d970ffc18af71..e3df3be6e331c8 100644 --- a/Mathlib/Order/Filter/Subsingleton.lean +++ b/Mathlib/Order/Filter/Subsingleton.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Filter.CountablyGenerated -import Mathlib.Order.Filter.Prod -import Mathlib.Order.Filter.Ultrafilter.Defs +module + +public import Mathlib.Order.Filter.CountablyGenerated +public import Mathlib.Order.Filter.Prod +public import Mathlib.Order.Filter.Ultrafilter.Defs /-! # Subsingleton filters @@ -13,6 +15,8 @@ We say that a filter `l` is a *subsingleton* if there exists a subsingleton set Equivalently, `l` is either `⊥` or `pure a` for some `a`. -/ +@[expose] public section + open Set variable {α β : Type*} {l : Filter α} diff --git a/Mathlib/Order/Filter/Tendsto.lean b/Mathlib/Order/Filter/Tendsto.lean index dda3854d6a154b..1e565d404950dd 100644 --- a/Mathlib/Order/Filter/Tendsto.lean +++ b/Mathlib/Order/Filter/Tendsto.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad -/ -import Mathlib.Order.Filter.Basic -import Mathlib.Order.Filter.Map +module + +public import Mathlib.Order.Filter.Basic +public import Mathlib.Order.Filter.Map /-! # Convergence in terms of filters @@ -18,6 +20,8 @@ some `x` and `u n` belongs to a set `M` for `n` large enough then `x` is in the which is a special case of `mem_closure_of_tendsto` from `Topology/Basic`. -/ +@[expose] public section + open Set Filter variable {α β γ : Type*} {ι : Sort*} diff --git a/Mathlib/Order/Filter/Ultrafilter/Basic.lean b/Mathlib/Order/Filter/Ultrafilter/Basic.lean index b32c9e9aab3c6d..cc769db13c4663 100644 --- a/Mathlib/Order/Filter/Ultrafilter/Basic.lean +++ b/Mathlib/Order/Filter/Ultrafilter/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov -/ -import Mathlib.Order.Filter.Ultrafilter.Defs -import Mathlib.Order.Filter.Cofinite -import Mathlib.Order.ZornAtoms +module + +public import Mathlib.Order.Filter.Ultrafilter.Defs +public import Mathlib.Order.Filter.Cofinite +public import Mathlib.Order.ZornAtoms /-! # Ultrafilters @@ -16,6 +18,8 @@ In this file we define * `hyperfilter`: the ultrafilter extending the cofinite filter. -/ +@[expose] public section + universe u v variable {α : Type u} {β : Type v} diff --git a/Mathlib/Order/Filter/Ultrafilter/Defs.lean b/Mathlib/Order/Filter/Ultrafilter/Defs.lean index 5b17fa7f161266..b586be7c567c8d 100644 --- a/Mathlib/Order/Filter/Ultrafilter/Defs.lean +++ b/Mathlib/Order/Filter/Ultrafilter/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov -/ -import Mathlib.Order.Filter.Map -import Mathlib.Order.ZornAtoms +module + +public import Mathlib.Order.Filter.Map +public import Mathlib.Order.ZornAtoms /-! # Ultrafilters @@ -18,6 +20,8 @@ In this file we define * `Ultrafilter.map`, `Ultrafilter.bind`, `Ultrafilter.comap` : operations on ultrafilters; -/ +@[expose] public section + assert_not_exists Set.Finite universe u v @@ -161,6 +165,7 @@ protected theorem em (f : Ultrafilter α) (p : α → Prop) : (∀ᶠ x in f, p theorem eventually_or : (∀ᶠ x in f, p x ∨ q x) ↔ (∀ᶠ x in f, p x) ∨ ∀ᶠ x in f, q x := union_mem_iff +@[push ← high] -- higher priority than `Filter.not_eventually` theorem eventually_not : (∀ᶠ x in f, ¬p x) ↔ ¬∀ᶠ x in f, p x := compl_mem_iff_notMem diff --git a/Mathlib/Order/Filter/ZeroAndBoundedAtFilter.lean b/Mathlib/Order/Filter/ZeroAndBoundedAtFilter.lean index 86fb85687f05f2..fe544e9c6ec5b6 100644 --- a/Mathlib/Order/Filter/ZeroAndBoundedAtFilter.lean +++ b/Mathlib/Order/Filter/ZeroAndBoundedAtFilter.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck, David Loeffler -/ -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.Analysis.Asymptotics.Lemmas -import Mathlib.Algebra.Algebra.Pi +module + +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.Analysis.Asymptotics.Lemmas +public import Mathlib.Algebra.Algebra.Pi /-! # Zero and Bounded at filter @@ -17,6 +19,8 @@ that are `BoundedAtFilter`. -/ +@[expose] public section + namespace Filter diff --git a/Mathlib/Order/Fin/Basic.lean b/Mathlib/Order/Fin/Basic.lean index 790478e18d3adf..ffd020c5860370 100644 --- a/Mathlib/Order/Fin/Basic.lean +++ b/Mathlib/Order/Fin/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Keeley Hoek -/ -import Mathlib.Data.Fin.Embedding -import Mathlib.Data.Fin.Rev -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Data.Fin.Embedding +public import Mathlib.Data.Fin.Rev +public import Mathlib.Order.Hom.Basic /-! # `Fin n` forms a bounded linear order @@ -33,6 +35,8 @@ This file expands on the development in the core library. * `Fin.revOrderIso`: `Fin.rev` as an `OrderIso`, the antitone involution given by `i ↦ n-(i+1)` -/ +@[expose] public section + assert_not_exists Monoid open Function Nat Set diff --git a/Mathlib/Order/Fin/Finset.lean b/Mathlib/Order/Fin/Finset.lean index f4bd982c8df155..283edb290ab5ef 100644 --- a/Mathlib/Order/Fin/Finset.lean +++ b/Mathlib/Order/Fin/Finset.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.Fin.Tuple -import Mathlib.Order.Hom.Set -import Mathlib.Data.Finset.Insert +module + +public import Mathlib.Order.Fin.Tuple +public import Mathlib.Order.Hom.Set +public import Mathlib.Data.Finset.Insert /-! # Order isomorphisms from Fin to finsets @@ -22,6 +24,8 @@ to the finset `{a, b, c}` when `a < b` and `b < c`. -/ +@[expose] public section + namespace Fin variable {α : Type*} [Preorder α] diff --git a/Mathlib/Order/Fin/SuccAboveOrderIso.lean b/Mathlib/Order/Fin/SuccAboveOrderIso.lean index a4e7776ad5c59a..30ecd6f3de8541 100644 --- a/Mathlib/Order/Fin/SuccAboveOrderIso.lean +++ b/Mathlib/Order/Fin/SuccAboveOrderIso.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ +module -import Mathlib.Order.Fin.Basic -import Mathlib.Data.Fintype.Basic -import Mathlib.Tactic.FinCases +public import Mathlib.Order.Fin.Basic +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Tactic.FinCases /-! # The order isomorphism `Fin (n + 1) ≃o {i}ᶜ` @@ -16,6 +17,8 @@ an order isomorphism `Fin (n + 1) ≃o ({i}ᶜ : Finset (Fin (n + 2)))`. -/ +@[expose] public section + open Finset /-- Given `i : Fin (n + 2)`, this is the order isomorphism diff --git a/Mathlib/Order/Fin/Tuple.lean b/Mathlib/Order/Fin/Tuple.lean index 0e659fc1d72d12..4a6bc9e130cfc2 100644 --- a/Mathlib/Order/Fin/Tuple.lean +++ b/Mathlib/Order/Fin/Tuple.lean @@ -3,16 +3,20 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yury Kudryashov, Sébastien Gouëzel, Chris Hughes -/ -import Mathlib.Data.Fin.VecNotation -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.Order.Fin.Basic -import Mathlib.Order.PiLex -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.Order.Fin.Basic +public import Mathlib.Order.PiLex +public import Mathlib.Order.Interval.Set.Defs /-! # Order properties on tuples -/ +@[expose] public section + assert_not_exists Monoid open Function Set diff --git a/Mathlib/Order/FixedPoints.lean b/Mathlib/Order/FixedPoints.lean index 9145c3b8a3a7d4..a6027fe91ef98c 100644 --- a/Mathlib/Order/FixedPoints.lean +++ b/Mathlib/Order/FixedPoints.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kenny Lau, Yury Kudryashov -/ -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.Order.Hom.Order -import Mathlib.Order.OmegaCompletePartialOrder +module + +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.Order.Hom.Order +public import Mathlib.Order.OmegaCompletePartialOrder /-! # Fixed point construction on complete lattices @@ -28,6 +30,8 @@ This file sets up the basic theory of fixed points of a monotone function in a c fixed point, complete lattice, monotone function -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Order/GaloisConnection/Basic.lean b/Mathlib/Order/GaloisConnection/Basic.lean index 86ed031b87d214..e57707d2c7de14 100644 --- a/Mathlib/Order/GaloisConnection/Basic.lean +++ b/Mathlib/Order/GaloisConnection/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.Bounds.Image -import Mathlib.Order.CompleteLattice.Basic -import Mathlib.Order.WithBot +module + +public import Mathlib.Order.Bounds.Image +public import Mathlib.Order.CompleteLattice.Basic +public import Mathlib.Order.WithBot /-! # Galois connections, insertions and coinsertions @@ -36,6 +38,8 @@ with a proof that intersection of subgroups is a subgroup, rather than the closu intersection. -/ +@[expose] public section + open Function OrderDual Set diff --git a/Mathlib/Order/GaloisConnection/Defs.lean b/Mathlib/Order/GaloisConnection/Defs.lean index 52f18bf4687d0c..750d6b935e2f4f 100644 --- a/Mathlib/Order/GaloisConnection/Defs.lean +++ b/Mathlib/Order/GaloisConnection/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.BoundedOrder.Basic -import Mathlib.Order.Monotone.Basic -import Mathlib.Tactic.Monotonicity.Attr -import Mathlib.Util.AssertExists +module + +public import Mathlib.Order.BoundedOrder.Basic +public import Mathlib.Order.Monotone.Basic +public import Mathlib.Tactic.Monotonicity.Attr +public import Mathlib.Util.AssertExists /-! # Galois connections, insertions and coinsertions @@ -23,6 +25,8 @@ such that `∀ a b, l a ≤ b ↔ a ≤ u b`. * `GaloisCoinsertion`: A Galois coinsertion is a Galois connection where `u ∘ l = id` -/ +@[expose] public section + assert_not_exists CompleteLattice RelIso open Function OrderDual Set diff --git a/Mathlib/Order/GameAdd.lean b/Mathlib/Order/GameAdd.lean index 253ac21e814476..f7301ad9257bd6 100644 --- a/Mathlib/Order/GameAdd.lean +++ b/Mathlib/Order/GameAdd.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Data.Sym.Sym2 -import Mathlib.Logic.Relation +module + +public import Mathlib.Data.Sym.Sym2 +public import Mathlib.Logic.Relation /-! # Game addition relation @@ -27,6 +29,8 @@ We also define `Sym2.GameAdd`, which is the unordered pair analog of `Prod.GameA decreases at a time. -/ +@[expose] public section + variable {α β : Type*} {rα : α → α → Prop} {rβ : β → β → Prop} {a : α} {b : β} /-! ### `Prod.GameAdd` -/ diff --git a/Mathlib/Order/Grade.lean b/Mathlib/Order/Grade.lean index 8f0ed418d18aaf..77331441610402 100644 --- a/Mathlib/Order/Grade.lean +++ b/Mathlib/Order/Grade.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies, Violeta Hernández Palacios. All rights reserv Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Violeta Hernández Palacios, Grayson Burton, Vladimir Ivanov -/ -import Mathlib.Data.Int.SuccPred -import Mathlib.Order.Fin.Basic +module + +public import Mathlib.Data.Int.SuccPred +public import Mathlib.Order.Fin.Basic /-! # Graded orders @@ -54,6 +56,8 @@ Instead, we define graded orders by their grade function, without talking about * [Richard Stanley, *Enumerative Combinatorics*][stanley2012] -/ +@[expose] public section + open Nat OrderDual variable {𝕆 ℙ α β : Type*} diff --git a/Mathlib/Order/Height.lean b/Mathlib/Order/Height.lean index c9792100fee89a..ea99c6d25077f6 100644 --- a/Mathlib/Order/Height.lean +++ b/Mathlib/Order/Height.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Data.ENat.Lattice -import Mathlib.Order.OrderIsoNat -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Order.OrderIsoNat +public import Mathlib.Tactic.TFAE /-! @@ -40,6 +42,8 @@ This is defined as the maximum of the lengths of `Set.subchain`s, valued in `ℕ -/ +@[expose] public section + assert_not_exists Field open List hiding le_antisymm diff --git a/Mathlib/Order/Heyting/Basic.lean b/Mathlib/Order/Heyting/Basic.lean index f7e62ecf2e26c0..36cf2cfa6e554f 100644 --- a/Mathlib/Order/Heyting/Basic.lean +++ b/Mathlib/Order/Heyting/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.PropInstances -import Mathlib.Order.GaloisConnection.Defs +module + +public import Mathlib.Order.PropInstances +public import Mathlib.Order.GaloisConnection.Defs /-! # Heyting algebras @@ -41,6 +43,8 @@ Heyting algebras are the order-theoretic equivalent of Cartesian closed categori Heyting, Brouwer, algebra, implication, negation, intuitionistic -/ +@[expose] public section + assert_not_exists RelIso open Function OrderDual diff --git a/Mathlib/Order/Heyting/Boundary.lean b/Mathlib/Order/Heyting/Boundary.lean index 1a1c326ef5f3d5..dc0f70eaf5968e 100644 --- a/Mathlib/Order/Heyting/Boundary.lean +++ b/Mathlib/Order/Heyting/Boundary.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.BooleanAlgebra.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Order.BooleanAlgebra.Basic +public import Mathlib.Tactic.Common /-! # Co-Heyting boundary @@ -22,6 +24,8 @@ boundary. `∂ a` is notation for `Coheyting.boundary a` in scope `Heyting`. -/ +@[expose] public section + assert_not_exists RelIso variable {α : Type*} diff --git a/Mathlib/Order/Heyting/Hom.lean b/Mathlib/Order/Heyting/Hom.lean index cd159d041dd5de..480d84b913689e 100644 --- a/Mathlib/Order/Heyting/Hom.lean +++ b/Mathlib/Order/Heyting/Hom.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Hom.BoundedLattice +module + +public import Mathlib.Order.Hom.BoundedLattice /-! # Heyting algebra morphisms @@ -27,6 +29,8 @@ be satisfied by itself and all stricter types. * `BiheytingHomClass` -/ +@[expose] public section + open Function diff --git a/Mathlib/Order/Heyting/Regular.lean b/Mathlib/Order/Heyting/Regular.lean index 9f3c08e7346acd..123a30e2247a9c 100644 --- a/Mathlib/Order/Heyting/Regular.lean +++ b/Mathlib/Order/Heyting/Regular.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.GaloisConnection.Basic +module + +public import Mathlib.Order.GaloisConnection.Basic /-! # Heyting regular elements @@ -25,6 +27,8 @@ by simply double-negating all propositions. This is practical for synthetic comp * [Francis Borceux, *Handbook of Categorical Algebra III*][borceux-vol3] -/ +@[expose] public section + open Function diff --git a/Mathlib/Order/Hom/Basic.lean b/Mathlib/Order/Hom/Basic.lean index 502af2c3f6ad5f..bfc9060b46030b 100644 --- a/Mathlib/Order/Hom/Basic.lean +++ b/Mathlib/Order/Hom/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Order.Disjoint -import Mathlib.Order.RelIso.Basic -import Mathlib.Tactic.Monotonicity.Attr +module + +public import Mathlib.Order.Disjoint +public import Mathlib.Order.RelIso.Basic +public import Mathlib.Tactic.Monotonicity.Attr /-! # Order homomorphisms @@ -66,6 +68,8 @@ We also define two functions to convert other bundled maps to `α →o β`: monotone map, bundled morphism -/ +@[expose] public section + -- Developments relating order homs and sets belong in `Order.Hom.Set` or later. assert_not_imported Mathlib.Data.Set.Basic @@ -1104,6 +1108,17 @@ end StrictMono protected def OrderIso.dual [LE α] [LE β] (f : α ≃o β) : αᵒᵈ ≃o βᵒᵈ := ⟨f.toEquiv, f.map_rel_iff⟩ +section +variable [LE α] [LE β] (f : α ≃o β) + +@[simp] lemma OrderIso.dual_apply (x) : f.dual x = .toDual (f x.ofDual) := rfl + +@[simp] lemma OrderIso.dual_symm_apply (x) : f.dual.symm x = .toDual (f.symm x.ofDual) := rfl + +@[simp] lemma OrderIso.symm_dual : f.symm.dual = f.dual.symm := rfl + +end + section LatticeIsos theorem OrderIso.map_bot' [LE α] [PartialOrder β] (f : α ≃o β) {x : α} {y : β} (hx : ∀ x', x ≤ x') diff --git a/Mathlib/Order/Hom/Bounded.lean b/Mathlib/Order/Hom/Bounded.lean index 541f7650316069..3d43d9ec6b9173 100644 --- a/Mathlib/Order/Hom/Bounded.lean +++ b/Mathlib/Order/Hom/Bounded.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Order.Hom.Basic /-! # Bounded order homomorphisms @@ -26,6 +28,8 @@ be satisfied by itself and all stricter types. * `BoundedOrderHomClass` -/ +@[expose] public section + open Function OrderDual diff --git a/Mathlib/Order/Hom/BoundedLattice.lean b/Mathlib/Order/Hom/BoundedLattice.lean index 0afbe4d6374352..3bffcd3dfd2619 100644 --- a/Mathlib/Order/Hom/BoundedLattice.lean +++ b/Mathlib/Order/Hom/BoundedLattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Hom.Bounded -import Mathlib.Order.Hom.Lattice -import Mathlib.Order.SymmDiff +module + +public import Mathlib.Order.Hom.Bounded +public import Mathlib.Order.Hom.Lattice +public import Mathlib.Order.SymmDiff /-! # Bounded lattice homomorphisms @@ -32,6 +34,8 @@ be satisfied by itself and all stricter types. Do we need more intersections between `BotHom`, `TopHom` and lattice homomorphisms? -/ +@[expose] public section + open Function diff --git a/Mathlib/Order/Hom/CompleteLattice.lean b/Mathlib/Order/Hom/CompleteLattice.lean index f1b19913284bd6..afffa01f1092ed 100644 --- a/Mathlib/Order/Hom/CompleteLattice.lean +++ b/Mathlib/Order/Hom/CompleteLattice.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Order.Hom.BoundedLattice +module + +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Order.Hom.BoundedLattice /-! # Complete lattice homomorphisms @@ -36,6 +38,8 @@ be satisfied by itself and all stricter types. Frame homs are Heyting homs. -/ + +@[expose] public section assert_not_exists Monoid open Function OrderDual Set @@ -327,7 +331,6 @@ instance : Bot (sSupHom α β) := · rw [hs.image_const, sSup_singleton]⟩⟩ instance : OrderBot (sSupHom α β) where - bot := ⊥ bot_le := fun _ _ ↦ OrderBot.bot_le _ @[simp] @@ -448,7 +451,6 @@ instance : Top (sInfHom α β) := · rw [hs.image_const, sInf_singleton]⟩⟩ instance : OrderTop (sInfHom α β) where - top := ⊤ le_top := fun _ _ => OrderTop.le_top _ @[simp] diff --git a/Mathlib/Order/Hom/Lattice.lean b/Mathlib/Order/Hom/Lattice.lean index f1fb917d7808f0..7d0791ff2e963e 100644 --- a/Mathlib/Order/Hom/Lattice.lean +++ b/Mathlib/Order/Hom/Lattice.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Order.Hom.Basic /-! # Unbounded lattice homomorphisms @@ -27,6 +29,8 @@ be satisfied by itself and all stricter types. * `LatticeHomClass` -/ +@[expose] public section + open Function diff --git a/Mathlib/Order/Hom/Lex.lean b/Mathlib/Order/Hom/Lex.lean index 08c042b4cb431f..46bbd436d776f7 100644 --- a/Mathlib/Order/Hom/Lex.lean +++ b/Mathlib/Order/Hom/Lex.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Data.Prod.Lex -import Mathlib.Data.Sum.Order -import Mathlib.Order.Hom.Set -import Mathlib.Order.RelIso.Set +module + +public import Mathlib.Data.Prod.Lex +public import Mathlib.Data.Sum.Order +public import Mathlib.Order.Hom.Set +public import Mathlib.Order.RelIso.Set /-! # Lexicographic order and order isomorphisms @@ -19,6 +21,8 @@ import Mathlib.Order.RelIso.Set other side is `Unique`. -/ +@[expose] public section + open Set variable {α : Type*} diff --git a/Mathlib/Order/Hom/Order.lean b/Mathlib/Order/Hom/Order.lean index 2847417a291088..9f77adbf24956a 100644 --- a/Mathlib/Order/Hom/Order.lean +++ b/Mathlib/Order/Hom/Order.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Anne Baanen -/ -import Mathlib.Logic.Function.Iterate -import Mathlib.Order.GaloisConnection.Basic -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Order.GaloisConnection.Basic +public import Mathlib.Order.Hom.Basic /-! # Lattice structure on order homomorphisms @@ -22,6 +24,8 @@ monotone functions. monotone map, bundled morphism -/ +@[expose] public section + namespace OrderHom @@ -62,7 +66,6 @@ instance [Preorder β] [OrderBot β] : Bot (α →o β) where bot := const α ⊥ instance orderBot [Preorder β] [OrderBot β] : OrderBot (α →o β) where - bot := ⊥ bot_le _ _ := bot_le @[simps] @@ -70,7 +73,6 @@ instance instTopOrderHom [Preorder β] [OrderTop β] : Top (α →o β) where top := const α ⊤ instance orderTop [Preorder β] [OrderTop β] : OrderTop (α →o β) where - top := ⊤ le_top _ _ := le_top instance [CompleteLattice β] : InfSet (α →o β) where diff --git a/Mathlib/Order/Hom/Set.lean b/Mathlib/Order/Hom/Set.lean index 855217a30f465c..3c61e30b3fa74b 100644 --- a/Mathlib/Order/Hom/Set.lean +++ b/Mathlib/Order/Hom/Set.lean @@ -3,16 +3,20 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Logic.Equiv.Set -import Mathlib.Order.Hom.Basic -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Order.WellFounded -import Mathlib.Tactic.MinImports +module + +public import Mathlib.Logic.Equiv.Set +public import Mathlib.Order.Hom.Basic +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Order.WellFounded +public import Mathlib.Tactic.MinImports /-! # Order homomorphisms and sets -/ +@[expose] public section + open OrderDual Set diff --git a/Mathlib/Order/Hom/WithTopBot.lean b/Mathlib/Order/Hom/WithTopBot.lean index 1928bd7d753419..564bf8253f740f 100644 --- a/Mathlib/Order/Hom/WithTopBot.lean +++ b/Mathlib/Order/Hom/WithTopBot.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Hom.BoundedLattice -import Mathlib.Order.WithBot +module + +public import Mathlib.Order.Hom.BoundedLattice +public import Mathlib.Order.WithBot /-! # Adjoining `⊤` and `⊥` to order maps and lattice homomorphisms @@ -16,6 +18,8 @@ Some definitions cause a possibly unbounded lattice homomorphism to become bound so they change the type of the homomorphism. -/ +@[expose] public section + variable {α β γ : Type*} diff --git a/Mathlib/Order/Ideal.lean b/Mathlib/Order/Ideal.lean index 058d01211c90cb..d98ecd826a7429 100644 --- a/Mathlib/Order/Ideal.lean +++ b/Mathlib/Order/Ideal.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 David Wärn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Wärn -/ -import Mathlib.Data.Finset.Lattice.Fold -import Mathlib.Logic.Encodable.Basic -import Mathlib.Order.Atoms -import Mathlib.Order.Cofinal -import Mathlib.Order.UpperLower.Principal +module + +public import Mathlib.Data.Finset.Lattice.Fold +public import Mathlib.Logic.Encodable.Basic +public import Mathlib.Order.Atoms +public import Mathlib.Order.Cofinal +public import Mathlib.Order.UpperLower.Principal /-! # Order ideals, cofinal sets, and the Rasiowa–Sikorski lemma @@ -45,6 +47,8 @@ ideal, cofinal, dense, countable, generic -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Order/InitialSeg.lean b/Mathlib/Order/InitialSeg.lean index 5cb02fdb56017c..d96204c81627aa 100644 --- a/Mathlib/Order/InitialSeg.lean +++ b/Mathlib/Order/InitialSeg.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.Data.Sum.Order -import Mathlib.Order.Hom.Lex -import Mathlib.Order.RelIso.Set -import Mathlib.Order.UpperLower.Basic -import Mathlib.Order.WellFounded +module + +public import Mathlib.Data.Sum.Order +public import Mathlib.Order.Hom.Lex +public import Mathlib.Order.RelIso.Set +public import Mathlib.Order.UpperLower.Basic +public import Mathlib.Order.WellFounded /-! # Initial and principal segments @@ -41,6 +43,8 @@ These notations belong to the `InitialSeg` locale. * `α do -- If the expected type is not known to be `Finset ?α`, give up. unless ← knownToBeFinsetNotSet expectedType? do throwUnsupportedSyntax diff --git a/Mathlib/Order/Interval/Finset/DenselyOrdered.lean b/Mathlib/Order/Interval/Finset/DenselyOrdered.lean index c6c2e52c4d9416..8d917ff0ca0fbe 100644 --- a/Mathlib/Order/Interval/Finset/DenselyOrdered.lean +++ b/Mathlib/Order/Interval/Finset/DenselyOrdered.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Order.Interval.Finset.Basic /-! # Linear locally finite orders are densely ordered iff they are trivial @@ -14,6 +16,8 @@ import Mathlib.Order.Interval.Finset.Basic -/ +@[expose] public section + variable {X : Type*} [LinearOrder X] [LocallyFiniteOrder X] lemma LocallyFiniteOrder.denselyOrdered_iff_subsingleton : diff --git a/Mathlib/Order/Interval/Finset/Fin.lean b/Mathlib/Order/Interval/Finset/Fin.lean index 3121d94dd5d0d7..82c68c3f9d151d 100644 --- a/Mathlib/Order/Interval/Finset/Fin.lean +++ b/Mathlib/Order/Interval/Finset/Fin.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Yury Kudryashov -/ -import Mathlib.Data.Finset.Fin -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Order.Interval.Set.Fin +module + +public import Mathlib.Data.Finset.Fin +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Order.Interval.Set.Fin /-! # Finite intervals in `Fin n` @@ -14,6 +16,8 @@ This file proves that `Fin n` is a `LocallyFiniteOrder` and calculates the cardi intervals as Finsets and Fintypes. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Finset Function diff --git a/Mathlib/Order/Interval/Finset/Nat.lean b/Mathlib/Order/Interval/Finset/Nat.lean index 1e70d8563851c1..6f5a7ae02bf974 100644 --- a/Mathlib/Order/Interval/Finset/Nat.lean +++ b/Mathlib/Order/Interval/Finset/Nat.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Algebra.Group.Embedding -import Mathlib.Order.Interval.Finset.SuccPred -import Mathlib.Order.Interval.Multiset +module + +public import Mathlib.Algebra.Group.Embedding +public import Mathlib.Order.Interval.Finset.SuccPred +public import Mathlib.Order.Interval.Multiset /-! # Finite intervals of naturals @@ -19,6 +21,8 @@ Some lemmas can be generalized using `OrderedGroup`, `CanonicallyOrderedMul` or and subsequently be moved upstream to `Order.Interval.Finset`. -/ +@[expose] public section + assert_not_exists Ring open Finset Nat diff --git a/Mathlib/Order/Interval/Finset/SuccPred.lean b/Mathlib/Order/Interval/Finset/SuccPred.lean index a1c059f8ef44f6..5d9d3eac9850ef 100644 --- a/Mathlib/Order/Interval/Finset/SuccPred.lean +++ b/Mathlib/Order/Interval/Finset/SuccPred.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Interval.Finset.Defs -import Mathlib.Order.Interval.Set.SuccPred +module + +public import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Order.Interval.Set.SuccPred /-! # Finset intervals in a successor-predecessor order @@ -23,6 +25,8 @@ Please keep in sync with: Copy over `insert` lemmas from `Mathlib/Order/Interval/Finset/Nat.lean`. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Order diff --git a/Mathlib/Order/Interval/Lex.lean b/Mathlib/Order/Interval/Lex.lean index 16a3793988aebe..1dac59fd2076dc 100644 --- a/Mathlib/Order/Interval/Lex.lean +++ b/Mathlib/Order/Interval/Lex.lean @@ -3,9 +3,13 @@ Copyright (c) 2025 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Order.Interval.Basic -import Mathlib.Data.Prod.Lex -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Order.Interval.Basic +public import Mathlib.Data.Prod.Lex +public import Mathlib.Tactic.FastInstance +meta import Mathlib.Order.Interval.Basic -- for `#eval` testing + /-! # The lexicographic order on intervals @@ -14,6 +18,8 @@ This order is compatible with the inclusion ordering, but is total. Under this ordering, `[(3, 3), (2, 2), (2, 3), (1, 1), (1, 2), (1, 3)]` is sorted. -/ +@[expose] public section + namespace NonemptyInterval variable {α} diff --git a/Mathlib/Order/Interval/Multiset.lean b/Mathlib/Order/Interval/Multiset.lean index 1cdb198782b44f..090a9e8f26ff23 100644 --- a/Mathlib/Order/Interval/Multiset.lean +++ b/Mathlib/Order/Interval/Multiset.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Order.Interval.Finset.Basic /-! # Intervals as multisets @@ -31,6 +33,8 @@ In a `LocallyFiniteOrderBot`, Do we really need this file at all? (March 2024) -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Order/Interval/Set/Basic.lean b/Mathlib/Order/Interval/Set/Basic.lean index d2100d3cf15cc4..fccc2a0c1ef0bf 100644 --- a/Mathlib/Order/Interval/Set/Basic.lean +++ b/Mathlib/Order/Interval/Set/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot, Yury Kudryashov, Rémy Degenne -/ -import Mathlib.Data.Set.Subsingleton -import Mathlib.Order.BooleanAlgebra.Set -import Mathlib.Order.Interval.Set.Defs +module + +public import Mathlib.Data.Set.Subsingleton +public import Mathlib.Order.BooleanAlgebra.Set +public import Mathlib.Order.Interval.Set.Defs /-! # Intervals @@ -35,6 +37,8 @@ theorem Ico_subset_Ici (h : a₂ ≤ a₁) : Ico a₁ b₁ ⊆ Ici a₂ := Logical equivalences, such as `Icc_subset_Ici_iff`, are however stated. -/ +@[expose] public section + assert_not_exists RelIso open Function diff --git a/Mathlib/Order/Interval/Set/Defs.lean b/Mathlib/Order/Interval/Set/Defs.lean index c4c30ff59637c7..34daa4956d3d48 100644 --- a/Mathlib/Order/Interval/Set/Defs.lean +++ b/Mathlib/Order/Interval/Set/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Set.Defs -import Mathlib.Order.Defs.PartialOrder +module + +public import Mathlib.Data.Set.Defs +public import Mathlib.Order.Defs.PartialOrder /-! # Intervals @@ -23,6 +25,8 @@ We also define a typeclass `Set.OrdConnected` saying that a set includes `Set.Icc a b` whenever it contains both `a` and `b`. -/ +@[expose] public section + namespace Set variable {α : Type*} [Preorder α] {a b x : α} diff --git a/Mathlib/Order/Interval/Set/Disjoint.lean b/Mathlib/Order/Interval/Set/Disjoint.lean index f06fb4274cc2de..4bb8c6fae4a23f 100644 --- a/Mathlib/Order/Interval/Set/Disjoint.lean +++ b/Mathlib/Order/Interval/Set/Disjoint.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Yury Kudryashov -/ -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Order.Interval.Set.LinearOrder -import Mathlib.Order.MinMax +module + +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Order.Interval.Set.LinearOrder +public import Mathlib.Order.MinMax /-! # Extra lemmas about intervals @@ -17,6 +19,8 @@ from `Data.Set.Lattice`, including `Disjoint`. We consider various intersections and unions of half infinite intervals. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/Order/Interval/Set/Fin.lean b/Mathlib/Order/Interval/Set/Fin.lean index 4788a2e3415af4..43145be379c5f1 100644 --- a/Mathlib/Order/Interval/Set/Fin.lean +++ b/Mathlib/Order/Interval/Set/Fin.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Fin.Basic -import Mathlib.Order.Interval.Set.UnorderedInterval +module + +public import Mathlib.Order.Fin.Basic +public import Mathlib.Order.Interval.Set.UnorderedInterval /-! # (Pre)images of set intervals under `Fin` operations @@ -23,6 +25,8 @@ under the following operations: - `Fin.rev`. -/ +@[expose] public section + open Function Set namespace Fin diff --git a/Mathlib/Order/Interval/Set/Final.lean b/Mathlib/Order/Interval/Set/Final.lean index 52a7d4241793b7..d98d1d596705b1 100644 --- a/Mathlib/Order/Interval/Set/Final.lean +++ b/Mathlib/Order/Interval/Set/Final.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.CategoryTheory.Filtered.Final +module + +public import Mathlib.CategoryTheory.Filtered.Final /-! # Final functors between intervals -/ +@[expose] public section + universe u instance Set.Ici.subtype_functor_final {J : Type u} [LinearOrder J] (j : J) : diff --git a/Mathlib/Order/Interval/Set/Image.lean b/Mathlib/Order/Interval/Set/Image.lean index 1f8c656c3c7349..0fe987f5d5f91d 100644 --- a/Mathlib/Order/Interval/Set/Image.lean +++ b/Mathlib/Order/Interval/Set/Image.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Yaël Dillies -/ -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Data.Set.Function -import Mathlib.Order.Directed +module + +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Data.Set.Function +public import Mathlib.Order.Directed /-! # Monotone functions on intervals @@ -14,6 +16,8 @@ This file shows many variants of the fact that a monotone function `f` sends an endpoints `a` and `b` to the interval with endpoints `f a` and `f b`. -/ +@[expose] public section + variable {α β : Type*} {f : α → β} open Set diff --git a/Mathlib/Order/Interval/Set/Infinite.lean b/Mathlib/Order/Interval/Set/Infinite.lean index f6d1cfbc032d3b..638bf1d1dc076c 100644 --- a/Mathlib/Order/Interval/Set/Infinite.lean +++ b/Mathlib/Order/Interval/Set/Infinite.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Order.Interval.Set.Basic +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Order.Interval.Set.Basic /-! # Infinitude of intervals @@ -14,6 +16,8 @@ in orders that are unbounded on the appropriate side. We also prove that an unbo preorder is an infinite type. -/ +@[expose] public section + variable {α : Type*} [Preorder α] diff --git a/Mathlib/Order/Interval/Set/InitialSeg.lean b/Mathlib/Order/Interval/Set/InitialSeg.lean index 399bb0faee906a..698c9901098a7d 100644 --- a/Mathlib/Order/Interval/Set/InitialSeg.lean +++ b/Mathlib/Order/Interval/Set/InitialSeg.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.InitialSeg +module + +public import Mathlib.Order.InitialSeg /-! # Intervals as initial segments @@ -14,6 +16,8 @@ isomorphic to `Set.Iio f.top`. -/ +@[expose] public section + namespace Set variable {α : Type*} [Preorder α] diff --git a/Mathlib/Order/Interval/Set/IsoIoo.lean b/Mathlib/Order/Interval/Set/IsoIoo.lean index cf9bf475145d24..748ae90131418d 100644 --- a/Mathlib/Order/Interval/Set/IsoIoo.lean +++ b/Mathlib/Order/Interval/Set/IsoIoo.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Monotone.Odd -import Mathlib.Algebra.Order.Field.Basic -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Order.Monotone.Odd +public import Mathlib.Algebra.Order.Field.Basic +public import Mathlib.Tactic.FieldSimp /-! # Order isomorphism between a linear ordered field and `(-1, 1)` @@ -14,6 +16,8 @@ In this file we provide an order isomorphism `orderIsoIooNegOneOne` between the `(-1, 1)` in a linear ordered field and the whole field. -/ +@[expose] public section + open Set /-- In a linear ordered field, the whole field is order isomorphic to the open interval `(-1, 1)`. diff --git a/Mathlib/Order/Interval/Set/Limit.lean b/Mathlib/Order/Interval/Set/Limit.lean index fa146d3d78df94..95de006de57713 100644 --- a/Mathlib/Order/Interval/Set/Limit.lean +++ b/Mathlib/Order/Interval/Set/Limit.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.SetIsMax -import Mathlib.Order.SuccPred.Limit +module + +public import Mathlib.Order.SetIsMax +public import Mathlib.Order.SuccPred.Limit /-! # Limit elements in Set.Ici @@ -15,6 +17,8 @@ and `m : Set.Ici j` is successor limit, then -/ +@[expose] public section + universe u namespace Set.Ici diff --git a/Mathlib/Order/Interval/Set/LinearOrder.lean b/Mathlib/Order/Interval/Set/LinearOrder.lean index 419847f5d0c801..5aa74d692efd4c 100644 --- a/Mathlib/Order/Interval/Set/LinearOrder.lean +++ b/Mathlib/Order/Interval/Set/LinearOrder.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot, Yury Kudryashov, Rémy Degenne -/ -import Mathlib.Order.Interval.Set.Basic +module + +public import Mathlib.Order.Interval.Set.Basic /-! # Interval properties in linear orders @@ -12,6 +14,8 @@ Since every pair of elements are comparable in a linear order, intervals over th better behaved. This file collects their properties under this assumption. -/ +@[expose] public section + assert_not_exists RelIso open Function diff --git a/Mathlib/Order/Interval/Set/Monotone.lean b/Mathlib/Order/Interval/Set/Monotone.lean index 0fc6a784809cd8..6ee91f45707224 100644 --- a/Mathlib/Order/Interval/Set/Monotone.lean +++ b/Mathlib/Order/Interval/Set/Monotone.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Monotone -import Mathlib.Order.Interval.Set.Disjoint -import Mathlib.Order.SuccPred.Archimedean +module + +public import Mathlib.Data.Set.Monotone +public import Mathlib.Order.Interval.Set.Disjoint +public import Mathlib.Order.SuccPred.Archimedean /-! # Monotonicity on intervals @@ -14,6 +16,8 @@ In this file we prove that `Set.Ici` etc. are monotone/antitone functions. We al about functions monotone on intervals in `SuccOrder`s. -/ +@[expose] public section + open Set diff --git a/Mathlib/Order/Interval/Set/OrdConnected.lean b/Mathlib/Order/Interval/Set/OrdConnected.lean index 5686dc67747824..f74b7d05c8e690 100644 --- a/Mathlib/Order/Interval/Set/OrdConnected.lean +++ b/Mathlib/Order/Interval/Set/OrdConnected.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Interval.Set.OrderEmbedding -import Mathlib.Order.Antichain -import Mathlib.Order.SetNotation +module + +public import Mathlib.Order.Interval.Set.OrderEmbedding +public import Mathlib.Order.Antichain +public import Mathlib.Order.SetNotation /-! # Order-connected sets @@ -19,6 +21,8 @@ In this file we prove that intersection of a family of `OrdConnected` sets is `O that all standard intervals are `OrdConnected`. -/ +@[expose] public section + open scoped Interval open Set open OrderDual (toDual ofDual) diff --git a/Mathlib/Order/Interval/Set/OrdConnectedComponent.lean b/Mathlib/Order/Interval/Set/OrdConnectedComponent.lean index f9e029ca8a4c6d..442742305150e7 100644 --- a/Mathlib/Order/Interval/Set/OrdConnectedComponent.lean +++ b/Mathlib/Order/Interval/Set/OrdConnectedComponent.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Interval.Set.OrdConnected -import Mathlib.Data.Set.Lattice.Image +module + +public import Mathlib.Order.Interval.Set.OrdConnected +public import Mathlib.Data.Set.Lattice.Image /-! # Order connected components of a set @@ -15,6 +17,8 @@ this construction is used only to prove that any linear order with order topolog so we only add API needed for this lemma. -/ +@[expose] public section + open Interval Function OrderDual diff --git a/Mathlib/Order/Interval/Set/OrdConnectedLinear.lean b/Mathlib/Order/Interval/Set/OrdConnectedLinear.lean index 07f7cc799754e6..8915d38652358b 100644 --- a/Mathlib/Order/Interval/Set/OrdConnectedLinear.lean +++ b/Mathlib/Order/Interval/Set/OrdConnectedLinear.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Bhavik Mehta, Oliver Nash -/ -import Mathlib.Data.Nat.Lattice -import Mathlib.Data.Int.ConditionallyCompleteOrder -import Mathlib.Data.Int.Interval -import Mathlib.Data.Int.SuccPred +module + +public import Mathlib.Data.Nat.Lattice +public import Mathlib.Data.Int.ConditionallyCompleteOrder +public import Mathlib.Data.Int.Interval +public import Mathlib.Data.Int.SuccPred /-! # Order-connected subsets of linear orders @@ -26,6 +28,8 @@ some convenience lemmas for characterising closed intervals in certain concrete * `Set.Nonempty.eq_Icc_iff_int`: characterisation of closed intervals for `ℤ`. -/ +@[expose] public section + variable {α : Type*} {I : Set α} lemma Set.Nonempty.ordConnected_iff_of_bdd diff --git a/Mathlib/Order/Interval/Set/OrderEmbedding.lean b/Mathlib/Order/Interval/Set/OrderEmbedding.lean index 139c2db545ffb8..40e3ddf8404e68 100644 --- a/Mathlib/Order/Interval/Set/OrderEmbedding.lean +++ b/Mathlib/Order/Interval/Set/OrderEmbedding.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Interval.Set.UnorderedInterval -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Order.Interval.Set.UnorderedInterval +public import Mathlib.Order.Hom.Basic /-! # Preimages of intervals under order embeddings @@ -15,6 +17,8 @@ is an interval in the domain. Note that similar statements about images require the range to be order-connected. -/ +@[expose] public section + open Set namespace OrderEmbedding diff --git a/Mathlib/Order/Interval/Set/OrderIso.lean b/Mathlib/Order/Interval/Set/OrderIso.lean index 9019112fadef23..e9054b0d3affac 100644 --- a/Mathlib/Order/Interval/Set/OrderIso.lean +++ b/Mathlib/Order/Interval/Set/OrderIso.lean @@ -3,13 +3,17 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot, Yury Kudryashov, Rémy Degenne -/ -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Order.Hom.Set +module + +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Order.Hom.Set /-! # Lemmas about images of intervals under order isomorphisms. -/ +@[expose] public section + open Set namespace OrderIso diff --git a/Mathlib/Order/Interval/Set/Pi.lean b/Mathlib/Order/Interval/Set/Pi.lean index 4c7e0bfbd1c266..34d8dfd94dc4e1 100644 --- a/Mathlib/Order/Interval/Set/Pi.lean +++ b/Mathlib/Order/Interval/Set/Pi.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Notation.Pi.Basic -import Mathlib.Data.Set.BooleanAlgebra -import Mathlib.Data.Set.Piecewise -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Order.Interval.Set.UnorderedInterval +module + +public import Mathlib.Algebra.Notation.Pi.Basic +public import Mathlib.Data.Set.BooleanAlgebra +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Order.Interval.Set.UnorderedInterval /-! # Intervals in `pi`-space @@ -17,6 +19,8 @@ In this we prove various simple lemmas about intervals in `Π i, α i`. Closed i usually include the corresponding products as proper subsets. -/ +@[expose] public section + -- Porting note: Added, since dot notation no longer works on `Function.update` open Function diff --git a/Mathlib/Order/Interval/Set/ProjIcc.lean b/Mathlib/Order/Interval/Set/ProjIcc.lean index 52530ac3c96723..e5e95407f9500d 100644 --- a/Mathlib/Order/Interval/Set/ProjIcc.lean +++ b/Mathlib/Order/Interval/Set/ProjIcc.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Patrick Massot -/ -import Mathlib.Data.Set.Function -import Mathlib.Order.Interval.Set.OrdConnected +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Order.Interval.Set.OrdConnected /-! # Projection of a line onto a closed interval @@ -27,6 +29,8 @@ Given a linearly ordered type `α`, in this file we define We also prove some trivial properties of these maps. -/ +@[expose] public section + variable {α β : Type*} [LinearOrder α] diff --git a/Mathlib/Order/Interval/Set/SuccOrder.lean b/Mathlib/Order/Interval/Set/SuccOrder.lean index 2cc2260a24bec9..78ad565df405d9 100644 --- a/Mathlib/Order/Interval/Set/SuccOrder.lean +++ b/Mathlib/Order/Interval/Set/SuccOrder.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.LatticeIntervals -import Mathlib.Order.SuccPred.Basic +module + +public import Mathlib.Order.LatticeIntervals +public import Mathlib.Order.SuccPred.Basic /-! # Successors in intervals @@ -15,6 +17,8 @@ which is not the maximum, we have `↑(Order.succ i) = Order.succ ↑i`. -/ +@[expose] public section + namespace Set variable {J : Type*} [PartialOrder J] diff --git a/Mathlib/Order/Interval/Set/SuccPred.lean b/Mathlib/Order/Interval/Set/SuccPred.lean index bedf52ee807282..5a29ab3997b91a 100644 --- a/Mathlib/Order/Interval/Set/SuccPred.lean +++ b/Mathlib/Order/Interval/Set/SuccPred.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Order.SuccPred.Basic +module + +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Order.SuccPred.Basic /-! # Set intervals in a successor-predecessor order @@ -23,6 +25,8 @@ Please keep in sync with: Copy over `insert` lemmas from `Mathlib/Order/Interval/Finset/Nat.lean`. -/ +@[expose] public section + assert_not_exists MonoidWithZero open Order diff --git a/Mathlib/Order/Interval/Set/SurjOn.lean b/Mathlib/Order/Interval/Set/SurjOn.lean index 60d3c57ac79da0..4a50cb8bb9918e 100644 --- a/Mathlib/Order/Interval/Set/SurjOn.lean +++ b/Mathlib/Order/Interval/Set/SurjOn.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Data.Set.Function -import Mathlib.Order.Interval.Set.LinearOrder +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Order.Interval.Set.LinearOrder /-! # Monotone surjective functions are surjective on intervals @@ -14,6 +16,8 @@ endpoints in the range. This is expressed in this file using `Set.surjOn`, and permutations of interval endpoints. -/ +@[expose] public section + variable {α : Type*} {β : Type*} [LinearOrder α] [PartialOrder β] {f : α → β} diff --git a/Mathlib/Order/Interval/Set/Union.lean b/Mathlib/Order/Interval/Set/Union.lean index 233de1dfbe78f5..dc766d2af4b033 100644 --- a/Mathlib/Order/Interval/Set/Union.lean +++ b/Mathlib/Order/Interval/Set/Union.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Oliver Butterley. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Butterley -/ -import Mathlib.Data.Finset.Range -import Mathlib.Data.Set.Lattice -import Mathlib.Order.Interval.Set.LinearOrder +module + +public import Mathlib.Data.Finset.Range +public import Mathlib.Data.Set.Lattice +public import Mathlib.Order.Interval.Set.LinearOrder /-! # Extra lemmas about unions of intervals @@ -15,6 +17,8 @@ concerning infinite unions in `Mathlib/Order/Interval/Set/Disjoint.lean` because `Finset.range`. -/ +@[expose] public section + open Set /-- Union of consecutive intervals contains the interval defined by the initial and final points. -/ diff --git a/Mathlib/Order/Interval/Set/UnorderedInterval.lean b/Mathlib/Order/Interval/Set/UnorderedInterval.lean index abc072b1ccdafe..f02335b4601b53 100644 --- a/Mathlib/Order/Interval/Set/UnorderedInterval.lean +++ b/Mathlib/Order/Interval/Set/UnorderedInterval.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Zhouhang Zhou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou -/ -import Mathlib.Data.Set.Order -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.Interval.Set.Image -import Mathlib.Order.Interval.Set.LinearOrder -import Mathlib.Tactic.Common -import Mathlib.Order.MinMax +module + +public import Mathlib.Data.Set.Order +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.Interval.Set.Image +public import Mathlib.Order.Interval.Set.LinearOrder +public import Mathlib.Tactic.Common +public import Mathlib.Order.MinMax /-! # Intervals without endpoints ordering @@ -36,6 +38,8 @@ make the notation available. -/ +@[expose] public section + open Function @@ -352,6 +356,9 @@ lemma uIoo_of_gt (h : b < a) : uIoo a b = Ioo b a := uIoo_of_ge h.le lemma uIoo_self : uIoo a a = ∅ := by simp [uIoo] +@[simp] lemma left_notMem_uIoo : a ∉ uIoo a b := by simp +contextual [uIoo, le_of_lt] +@[simp] lemma right_notMem_uIoo : b ∉ uIoo a b := by simp +contextual [uIoo, le_of_lt] + lemma Ioo_subset_uIoo : Ioo a b ⊆ uIoo a b := Ioo_subset_Ioo inf_le_left le_sup_right /-- Same as `Ioo_subset_uIoo` but with `Ioo a b` replaced by `Ioo b a`. -/ @@ -371,9 +378,23 @@ lemma uIoo_of_not_le (h : ¬a ≤ b) : uIoo a b = Ioo b a := uIoo_of_gt <| lt_of lemma uIoo_of_not_ge (h : ¬b ≤ a) : uIoo a b = Ioo a b := uIoo_of_lt <| lt_of_not_ge h -theorem uIoo_subset_uIcc {α : Type*} [LinearOrder α] (a : α) (b : α) : uIoo a b ⊆ uIcc a b := by +lemma uIoo_subset_uIcc_self : uIoo a b ⊆ uIcc a b := by simp [uIoo, uIcc, Ioo_subset_Icc_self] +@[deprecated uIoo_subset_uIcc_self (since := "2025-11-09")] +lemma uIoo_subset_uIcc (a b : α) : uIoo a b ⊆ uIcc a b := uIoo_subset_uIcc_self + +lemma uIoo_subset_Ioo (ha : a₁ ∈ Icc a₂ b₂) (hb : b₁ ∈ Icc a₂ b₂) : uIoo a₁ b₁ ⊆ Ioo a₂ b₂ := + Ioo_subset_Ioo (le_inf ha.1 hb.1) (sup_le ha.2 hb.2) + +@[simp] lemma nonempty_uIoo [DenselyOrdered α] : (uIoo a b).Nonempty ↔ a ≠ b := by + simp [uIoo, eq_comm] + +lemma uIoo_eq_union : uIoo a b = Ioo a b ∪ Ioo b a := by + rcases lt_or_ge a b with h | h + · simp [uIoo_of_lt, h, Ioo_eq_empty_of_le h.le] + · simp [uIoo_of_ge, h] + end uIoo end LinearOrder diff --git a/Mathlib/Order/Interval/Set/WithBotTop.lean b/Mathlib/Order/Interval/Set/WithBotTop.lean index 40a7d1873d6460..b5a3918e4c355f 100644 --- a/Mathlib/Order/Interval/Set/WithBotTop.lean +++ b/Mathlib/Order/Interval/Set/WithBotTop.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Image -import Mathlib.Order.Interval.Set.Basic -import Mathlib.Order.WithBot +module + +public import Mathlib.Data.Set.Image +public import Mathlib.Order.Interval.Set.Basic +public import Mathlib.Order.WithBot /-! # Intervals in `WithTop α` and `WithBot α` @@ -14,6 +16,8 @@ In this file we prove various lemmas about `Set.image`s and `Set.preimage`s of i `some : α → WithTop α` and `some : α → WithBot α`. -/ +@[expose] public section + open Set variable {α : Type*} diff --git a/Mathlib/Order/Irreducible.lean b/Mathlib/Order/Irreducible.lean index 073fbe1f19059d..dc96b3fdd2bbb9 100644 --- a/Mathlib/Order/Irreducible.lean +++ b/Mathlib/Order/Irreducible.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Finset.Lattice.Fold +module + +public import Mathlib.Data.Finset.Lattice.Fold /-! # Irreducible and prime elements in an order @@ -28,6 +30,8 @@ Both hold for all (non-minimal) elements in a linear order. in a well-founded semilattice. -/ +@[expose] public section + open Finset OrderDual diff --git a/Mathlib/Order/IsNormal.lean b/Mathlib/Order/IsNormal.lean index e4b0394efff8f8..c7059b46f6de8f 100644 --- a/Mathlib/Order/IsNormal.lean +++ b/Mathlib/Order/IsNormal.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.SuccPred.CompleteLinearOrder -import Mathlib.Order.SuccPred.InitialSeg +module + +public import Mathlib.Order.SuccPred.CompleteLinearOrder +public import Mathlib.Order.SuccPred.InitialSeg /-! # Normal functions @@ -22,6 +24,8 @@ bound of `f b` with `b < a`. * Replace `Ordinal.IsNormal` by this more general notion. -/ +@[expose] public section + open Order Set variable {α β γ : Type*} {a b : α} {f : α → β} {g : β → γ} diff --git a/Mathlib/Order/Iterate.lean b/Mathlib/Order/Iterate.lean index dcb7f3e67db0d2..77b379eeb592a9 100644 --- a/Mathlib/Order/Iterate.lean +++ b/Mathlib/Order/Iterate.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Logic.Function.Iterate -import Mathlib.Order.Monotone.Basic +module + +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Order.Monotone.Basic /-! # Inequalities on iterates @@ -16,6 +18,8 @@ Current selection of inequalities is motivated by formalization of the rotation a circle homeomorphism. -/ +@[expose] public section + open Function open Function (Commute) diff --git a/Mathlib/Order/JordanHolder.lean b/Mathlib/Order/JordanHolder.lean index 77b96b2af127be..dd5ad6cab1075a 100644 --- a/Mathlib/Order/JordanHolder.lean +++ b/Mathlib/Order/JordanHolder.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Order.Lattice -import Mathlib.Data.List.Sort -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.Logic.Equiv.Functor -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Order.RelSeries +module + +public import Mathlib.Order.Lattice +public import Mathlib.Data.List.Sort +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.Logic.Equiv.Functor +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Order.RelSeries /-! # Jordan-Hölder Theorem @@ -68,6 +70,8 @@ instances should not be a global instance. > See `JordanHolderModule.instJordanHolderLattice`. -/ +@[expose] public section + universe u diff --git a/Mathlib/Order/KonigLemma.lean b/Mathlib/Order/KonigLemma.lean index e70ad7b8c00eda..7f7aa0ba2744fd 100644 --- a/Mathlib/Order/KonigLemma.lean +++ b/Mathlib/Order/KonigLemma.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Order.Atoms.Finite -import Mathlib.Order.Grade -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Order.Atoms.Finite +public import Mathlib.Order.Grade +public import Mathlib.Tactic.ApplyFun /-! # Kőnig's infinity lemma @@ -50,6 +52,8 @@ Formulate the lemma as a statement about graphs. -/ +@[expose] public section + open Set section Sequence diff --git a/Mathlib/Order/KrullDimension.lean b/Mathlib/Order/KrullDimension.lean index 5e315ae6a575a6..c5f545745f6b99 100644 --- a/Mathlib/Order/KrullDimension.lean +++ b/Mathlib/Order/KrullDimension.lean @@ -3,13 +3,14 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Fangming Li, Joachim Breitner -/ +module -import Mathlib.Algebra.Order.Group.Int -import Mathlib.Algebra.Order.SuccPred.WithBot -import Mathlib.Data.ENat.Lattice -import Mathlib.Order.Atoms -import Mathlib.Order.RelSeries -import Mathlib.Tactic.FinCases +public import Mathlib.Algebra.Order.Group.Int +public import Mathlib.Algebra.Order.SuccPred.WithBot +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Order.Atoms +public import Mathlib.Order.RelSeries +public import Mathlib.Tactic.FinCases /-! # Krull dimension of a preordered set and height of an element @@ -60,6 +61,8 @@ in this file would generalize as well. But we don't think it would be useful, so Krull dimension of a preorder. -/ +@[expose] public section + assert_not_exists Field namespace Order diff --git a/Mathlib/Order/Lattice.lean b/Mathlib/Order/Lattice.lean index 0dd6490e486c55..e7968a6c7b31f3 100644 --- a/Mathlib/Order/Lattice.lean +++ b/Mathlib/Order/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Bool.Basic -import Mathlib.Order.Monotone.Basic -import Mathlib.Order.ULift +module + +public import Mathlib.Data.Bool.Basic +public import Mathlib.Order.Monotone.Basic +public import Mathlib.Order.ULift /-! # (Semi-)lattices @@ -48,6 +50,8 @@ semilattice, lattice -/ +@[expose] public section + universe u v w variable {α : Type u} {β : Type v} diff --git a/Mathlib/Order/Lattice/Congruence.lean b/Mathlib/Order/Lattice/Congruence.lean index 28ada5e6c71806..52a9ff8fefc1a8 100644 --- a/Mathlib/Order/Lattice/Congruence.lean +++ b/Mathlib/Order/Lattice/Congruence.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Data.Setoid.Basic -import Mathlib.Order.Lattice -import Mathlib.Order.Hom.Lattice +module + +public import Mathlib.Data.Setoid.Basic +public import Mathlib.Order.Lattice +public import Mathlib.Order.Hom.Lattice /-! # Lattice Congruences @@ -29,6 +31,8 @@ import Mathlib.Order.Hom.Lattice Lattice, Congruence -/ +@[expose] public section + variable {F α β : Type*} [Lattice α] [Lattice β] variable (α) in diff --git a/Mathlib/Order/LatticeIntervals.lean b/Mathlib/Order/LatticeIntervals.lean index 3ec8bf04cf0c88..aa8ec0baffe61d 100644 --- a/Mathlib/Order/LatticeIntervals.lean +++ b/Mathlib/Order/LatticeIntervals.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Order.Bounds.Basic +module + +public import Mathlib.Order.Bounds.Basic /-! # Intervals in Lattices @@ -25,6 +27,8 @@ In the following, `*` can represent either `c`, `o`, or `i`. * `Set.Ici.boundedOrder`, within an `OrderTop` -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Order/LiminfLimsup.lean b/Mathlib/Order/LiminfLimsup.lean index b9922c123a722c..8639a632239d8f 100644 --- a/Mathlib/Order/LiminfLimsup.lean +++ b/Mathlib/Order/LiminfLimsup.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Johannes Hölzl, Rémy Degenne -/ -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Order.Filter.IsBounded -import Mathlib.Order.Hom.CompleteLattice +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Order.Filter.IsBounded +public import Mathlib.Order.Hom.CompleteLattice /-! # liminfs and limsups of functions and filters @@ -35,6 +37,8 @@ the definitions of Limsup and Liminf. In complete lattices, however, it coincides with the `Inf Sup` definition. -/ +@[expose] public section + open Filter Set Function variable {α β γ ι ι' : Type*} @@ -469,9 +473,8 @@ theorem liminf_le_of_frequently_le' {α β} [CompleteLattice β] {f : Filter α} rw [liminf_eq] refine sSup_le fun b hb => ?_ have hbx : ∃ᶠ _ in f, b ≤ x := by - revert h - rw [← not_imp_not, not_frequently, not_frequently] - exact fun h => hb.mp (h.mono fun a hbx hba hax => hbx (hba.trans hax)) + contrapose! h + exact hb.mp (h.mono fun a hbx hba hax => hbx (hba.trans hax)) exact hbx.exists.choose_spec theorem le_limsup_of_frequently_le' {α β} [CompleteLattice β] {f : Filter α} {u : α → β} {x : β} @@ -748,7 +751,6 @@ theorem frequently_lt_of_lt_limsSup {f : Filter α} [ConditionallyCompleteLinear (hf : f.IsCobounded (· ≤ ·) := by isBoundedDefault) (h : a < limsSup f) : ∃ᶠ n in f, a < n := by contrapose! h - simp only [not_frequently, not_lt] at h exact limsSup_le_of_le hf h theorem frequently_lt_of_limsInf_lt {f : Filter α} [ConditionallyCompleteLinearOrder α] {a : α} @@ -815,10 +817,8 @@ variable [ConditionallyCompleteLinearOrder β] {f : Filter α} {u : α → β} theorem le_limsup_of_frequently_le {b : β} (hu_le : ∃ᶠ x in f, b ≤ u x) (hu : f.IsBoundedUnder (· ≤ ·) u := by isBoundedDefault) : b ≤ limsup u f := by - revert hu_le - rw [← not_imp_not, not_frequently] - simp_rw [← lt_iff_not_ge] - exact fun h => eventually_lt_of_limsup_lt h hu + contrapose! hu_le with h + exact eventually_lt_of_limsup_lt h hu theorem liminf_le_of_frequently_le {b : β} (hu_le : ∃ᶠ x in f, u x ≤ b) (hu : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault) : diff --git a/Mathlib/Order/Max.lean b/Mathlib/Order/Max.lean index 64524125938ccf..03591cb21b31fe 100644 --- a/Mathlib/Order/Max.lean +++ b/Mathlib/Order/Max.lean @@ -3,7 +3,9 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Yury Kudryashov, Yaël Dillies -/ -import Mathlib.Order.Synonym +module + +public import Mathlib.Order.Synonym /-! # Minimal/maximal and bottom/top elements @@ -28,6 +30,8 @@ See also `isBot_iff_isMin` and `isTop_iff_isMax` for the equivalences in a (co)d * `NoMaxOrder`: An order without maximal elements. -/ +@[expose] public section + open OrderDual diff --git a/Mathlib/Order/MinMax.lean b/Mathlib/Order/MinMax.lean index db761e9ef9e5b5..1d0be2d9d84f78 100644 --- a/Mathlib/Order/MinMax.lean +++ b/Mathlib/Order/MinMax.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Logic.OpClass -import Mathlib.Order.Lattice +module + +public import Mathlib.Logic.OpClass +public import Mathlib.Order.Lattice /-! # `max` and `min` @@ -16,6 +18,8 @@ This file proves basic properties about maxima and minima on a `LinearOrder`. min, max -/ +@[expose] public section + universe u v diff --git a/Mathlib/Order/Minimal.lean b/Mathlib/Order/Minimal.lean index c033cfff2d6eaf..554f31fba51ea9 100644 --- a/Mathlib/Order/Minimal.lean +++ b/Mathlib/Order/Minimal.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Peter Nelson -/ -import Mathlib.Order.Hom.Basic -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Order.WellFounded +module + +public import Mathlib.Order.Hom.Basic +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Order.WellFounded /-! # Minimality and Maximality @@ -39,6 +41,8 @@ but it may be worth re-examining this to make it easier in the future; see the T * API for `MinimalFor`/`MaximalFor` -/ +@[expose] public section + assert_not_exists CompleteLattice open Set OrderDual diff --git a/Mathlib/Order/ModularLattice.lean b/Mathlib/Order/ModularLattice.lean index a8930e0060af8a..3de20b9f0104dc 100644 --- a/Mathlib/Order/ModularLattice.lean +++ b/Mathlib/Order/ModularLattice.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Yaël Dillies -/ -import Mathlib.Data.Set.Monotone -import Mathlib.Order.Cover -import Mathlib.Order.LatticeIntervals -import Mathlib.Order.GaloisConnection.Defs +module + +public import Mathlib.Data.Set.Monotone +public import Mathlib.Order.Cover +public import Mathlib.Order.LatticeIntervals +public import Mathlib.Order.GaloisConnection.Defs /-! # Modular Lattices @@ -52,6 +54,8 @@ We define (semi)modularity typeclasses as Prop-valued mixins. - Relate atoms and coatoms in modular lattices -/ +@[expose] public section + open Set diff --git a/Mathlib/Order/Monotone/Basic.lean b/Mathlib/Order/Monotone/Basic.lean index 724ff9c928f3e7..9198455c19f7cc 100644 --- a/Mathlib/Order/Monotone/Basic.lean +++ b/Mathlib/Order/Monotone/Basic.lean @@ -3,14 +3,17 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro, Yaël Dillies -/ -import Mathlib.Data.Nat.Basic -import Mathlib.Data.Int.Order.Basic -import Mathlib.Logic.Function.Iterate -import Mathlib.Order.Compare -import Mathlib.Order.Max -import Mathlib.Order.Monotone.Defs -import Mathlib.Order.RelClasses -import Mathlib.Tactic.Choose +module + +public import Mathlib.Data.Nat.Basic +public import Mathlib.Data.Int.Order.Basic +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Order.Compare +public import Mathlib.Order.Max +public import Mathlib.Order.Monotone.Defs +public import Mathlib.Order.RelClasses +public import Mathlib.Tactic.Choose +public import Mathlib.Tactic.Contrapose /-! # Monotonicity @@ -48,6 +51,8 @@ monotone, strictly monotone, antitone, strictly antitone, increasing, strictly i decreasing, strictly decreasing -/ +@[expose] public section + open Function OrderDual universe u v diff --git a/Mathlib/Order/Monotone/Defs.lean b/Mathlib/Order/Monotone/Defs.lean index 46577be4bf2a55..d2cb98a93a8b05 100644 --- a/Mathlib/Order/Monotone/Defs.lean +++ b/Mathlib/Order/Monotone/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro, Yaël Dillies -/ -import Mathlib.Data.Set.Operations -import Mathlib.Logic.Function.Iterate -import Mathlib.Order.Basic -import Mathlib.Tactic.Coe -import Mathlib.Util.AssertExists +module + +public import Mathlib.Data.Set.Operations +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Order.Basic +public import Mathlib.Tactic.Coe +public import Mathlib.Util.AssertExists /-! # Monotonicity @@ -42,6 +44,8 @@ monotone, strictly monotone, antitone, strictly antitone, increasing, strictly i decreasing, strictly decreasing -/ +@[expose] public section + assert_not_exists Nat.instLinearOrder Int.instLinearOrder diff --git a/Mathlib/Order/Monotone/Extension.lean b/Mathlib/Order/Monotone/Extension.lean index bf4f181821b4d2..0a2680e26e125a 100644 --- a/Mathlib/Order/Monotone/Extension.lean +++ b/Mathlib/Order/Monotone/Extension.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Yury Kudryashov -/ -import Mathlib.Data.Set.Monotone -import Mathlib.Order.ConditionallyCompleteLattice.Basic +module + +public import Mathlib.Data.Set.Monotone +public import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Extension of a monotone function from a set to the whole space @@ -13,6 +15,8 @@ In this file we prove that if a function is monotone and is bounded on a set `s` monotone extension to the whole space. -/ +@[expose] public section + open Set diff --git a/Mathlib/Order/Monotone/Monovary.lean b/Mathlib/Order/Monotone/Monovary.lean index e15f7e2dbf971d..8285fa51e59416 100644 --- a/Mathlib/Order/Monotone/Monovary.lean +++ b/Mathlib/Order/Monotone/Monovary.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Operations -import Mathlib.Order.Lattice +module + +public import Mathlib.Data.Set.Operations +public import Mathlib.Order.Lattice /-! # Monovariance of functions @@ -24,6 +26,8 @@ This condition comes up in the rearrangement inequality. See `Algebra.Order.Rear * `AntivaryOn f g s`: `f` antivaries with `g` on `s`. -/ +@[expose] public section + open Function Set diff --git a/Mathlib/Order/Monotone/MonovaryOrder.lean b/Mathlib/Order/Monotone/MonovaryOrder.lean index 1dd22cf9006ac8..65ecd4ea83c9bf 100644 --- a/Mathlib/Order/Monotone/MonovaryOrder.lean +++ b/Mathlib/Order/Monotone/MonovaryOrder.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Monotone.Monovary -import Mathlib.SetTheory.Cardinal.Order +module + +public import Mathlib.Order.Monotone.Monovary +public import Mathlib.SetTheory.Cardinal.Order /-! # Interpreting monovarying functions as monotone functions @@ -13,6 +15,8 @@ This file proves that monovarying functions to linear orders can be made simulta setting the correct order on their shared indexing type. -/ +@[expose] public section + open Function Set variable {ι ι' α β γ : Type*} diff --git a/Mathlib/Order/Monotone/Odd.lean b/Mathlib/Order/Monotone/Odd.lean index 5c9f3dd31e0f20..b65216c8e0afc2 100644 --- a/Mathlib/Order/Monotone/Odd.lean +++ b/Mathlib/Order/Monotone/Odd.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Group.Defs -import Mathlib.Algebra.Order.Monoid.OrderDual -import Mathlib.Order.Monotone.Union +module + +public import Mathlib.Algebra.Order.Group.Defs +public import Mathlib.Algebra.Order.Monoid.OrderDual +public import Mathlib.Order.Monotone.Union /-! # Monotonicity of odd functions @@ -15,6 +17,8 @@ provided that it is monotone on `Set.Ici 0`, see `monotone_of_odd_of_monotoneOn_ prove versions of this lemma for `Antitone`, `StrictMono`, and `StrictAnti`. -/ +@[expose] public section + open Set diff --git a/Mathlib/Order/Monotone/Union.lean b/Mathlib/Order/Monotone/Union.lean index e1d57e863f7f37..18f2af817e9f22 100644 --- a/Mathlib/Order/Monotone/Union.lean +++ b/Mathlib/Order/Monotone/Union.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Sébastien Gouëzel -/ -import Mathlib.Order.Bounds.Basic -import Mathlib.Order.Interval.Set.LinearOrder +module + +public import Mathlib.Order.Bounds.Basic +public import Mathlib.Order.Interval.Set.LinearOrder /-! # Monotonicity on intervals @@ -15,6 +17,8 @@ of a more general statement where one deduces monotonicity on a union from monot set. -/ +@[expose] public section + open Set diff --git a/Mathlib/Order/Nat.lean b/Mathlib/Order/Nat.lean index cff543489216aa..28358a5083d955 100644 --- a/Mathlib/Order/Nat.lean +++ b/Mathlib/Order/Nat.lean @@ -3,9 +3,11 @@ Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights r Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Nat.Find -import Mathlib.Order.BoundedOrder.Basic -import Mathlib.Order.Bounds.Defs +module + +public import Mathlib.Data.Nat.Find +public import Mathlib.Order.BoundedOrder.Basic +public import Mathlib.Order.Bounds.Defs /-! # The natural numbers form a linear order @@ -19,6 +21,8 @@ See note [foundational algebra order theory]. Move the `LinearOrder ℕ` instance here (https://github.com/leanprover-community/mathlib4/pull/13092). -/ +@[expose] public section + namespace Nat instance instOrderBot : OrderBot ℕ where diff --git a/Mathlib/Order/Notation.lean b/Mathlib/Order/Notation.lean index 82984794ff4e3e..c4b710caaa2352 100644 --- a/Mathlib/Order/Notation.lean +++ b/Mathlib/Order/Notation.lean @@ -3,10 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Yaël Dillies -/ -import Qq -import Mathlib.Lean.PrettyPrinter.Delaborator -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.Simps.NotationClass +module + +public import Qq +public meta import Mathlib.Lean.PrettyPrinter.Delaborator +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.Simps.NotationClass +public import Mathlib.Tactic.ToDual /-! # Notation classes for lattice operations @@ -34,6 +37,8 @@ Lemmas about the operators `⊔` and `⊓` should use the names `sup` and `inf` -/ +@[expose] public section + /-- Set / lattice complement -/ @[notation_class] class HasCompl (α : Type*) where @@ -70,11 +75,11 @@ namespace Mathlib.Meta open Lean Meta PrettyPrinter Delaborator SubExpr Qq -- irreducible to not confuse Qq -@[irreducible] private def linearOrderExpr (u : Level) : Q(Type u → Type u) := +@[irreducible] private meta def linearOrderExpr (u : Level) : Q(Type u → Type u) := .const `LinearOrder [u] -private def linearOrderToMax (u : Level) : Q((a : Type u) → $(linearOrderExpr u) a → Max a) := +private meta def linearOrderToMax (u : Level) : Q((a : Type u) → $(linearOrderExpr u) a → Max a) := .const `LinearOrder.toMax [u] -private def linearOrderToMin (u : Level) : Q((a : Type u) → $(linearOrderExpr u) a → Min a) := +private meta def linearOrderToMin (u : Level) : Q((a : Type u) → $(linearOrderExpr u) a → Min a) := .const `LinearOrder.toMin [u] /-- @@ -82,7 +87,7 @@ Return `true` if `LinearOrder` is imported and `inst` comes from a `LinearOrder We use a `try catch` block to make sure there are no surprising errors during delaboration. -/ -private def hasLinearOrder (u : Level) (α : Q(Type u)) (cls : Q(Type u → Type u)) +private meta def hasLinearOrder (u : Level) (α : Q(Type u)) (cls : Q(Type u → Type u)) (toCls : Q((α : Type u) → $(linearOrderExpr u) α → $cls α)) (inst : Q($cls $α)) : MetaM Bool := do try @@ -100,7 +105,7 @@ private def hasLinearOrder (u : Level) (α : Q(Type u)) (cls : Q(Type u → Type /-- Delaborate `max x y` into `x ⊔ y` if the type is not a linear order. -/ @[delab app.Max.max] -def delabSup : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do +meta def delabSup : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do let_expr f@Max.max α inst _ _ := ← getExpr | failure have u := f.constLevels![0]! if ← hasLinearOrder u α q(Max) q($(linearOrderToMax u)) inst then @@ -112,7 +117,7 @@ def delabSup : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotat /-- Delaborate `min x y` into `x ⊓ y` if the type is not a linear order. -/ @[delab app.Min.min] -def delabInf : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do +meta def delabInf : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do let_expr f@Min.min α inst _ _ := ← getExpr | failure have u := f.constLevels![0]! if ← hasLinearOrder u α q(Min) q($(linearOrderToMin u)) inst then @@ -160,7 +165,7 @@ class Top (α : Type*) where top : α /-- Typeclass for the `⊥` (`\bot`) notation -/ -@[notation_class, ext] +@[notation_class, ext, to_dual] class Bot (α : Type*) where /-- The bot (`⊥`, `\bot`) element -/ bot : α @@ -171,10 +176,8 @@ notation "⊤" => Top.top /-- The bot (`⊥`, `\bot`) element -/ notation "⊥" => Bot.bot +@[to_dual] instance (priority := 100) top_nonempty (α : Type*) [Top α] : Nonempty α := ⟨⊤⟩ -instance (priority := 100) bot_nonempty (α : Type*) [Bot α] : Nonempty α := - ⟨⊥⟩ - attribute [match_pattern] Bot.bot Top.top diff --git a/Mathlib/Order/Nucleus.lean b/Mathlib/Order/Nucleus.lean index c042f6f0595717..3c827798b8619e 100644 --- a/Mathlib/Order/Nucleus.lean +++ b/Mathlib/Order/Nucleus.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Krause. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chriara Cimino, Christian Krause -/ -import Mathlib.Order.Closure -import Mathlib.Order.Hom.CompleteLattice +module + +public import Mathlib.Order.Closure +public import Mathlib.Order.Hom.CompleteLattice /-! # Nucleus @@ -20,6 +22,8 @@ https://ncatlab.org/nlab/show/sublocale https://ncatlab.org/nlab/show/nucleus -/ +@[expose] public section + open Order InfHom Set variable {X : Type*} diff --git a/Mathlib/Order/OmegaCompletePartialOrder.lean b/Mathlib/Order/OmegaCompletePartialOrder.lean index 7bc15830473977..6e524b25afd091 100644 --- a/Mathlib/Order/OmegaCompletePartialOrder.lean +++ b/Mathlib/Order/OmegaCompletePartialOrder.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Ira Fesefeldt -/ -import Mathlib.Control.Monad.Basic -import Mathlib.Dynamics.FixedPoints.Basic -import Mathlib.Order.CompleteLattice.Basic -import Mathlib.Order.Iterate -import Mathlib.Order.Part -import Mathlib.Order.Preorder.Chain -import Mathlib.Order.ScottContinuity +module + +public import Mathlib.Control.Monad.Basic +public import Mathlib.Dynamics.FixedPoints.Basic +public import Mathlib.Order.CompleteLattice.Basic +public import Mathlib.Order.Iterate +public import Mathlib.Order.Part +public import Mathlib.Order.Preorder.Chain +public import Mathlib.Order.ScottContinuity /-! # Omega Complete Partial Orders @@ -54,6 +56,8 @@ supremum helps define the meaning of recursive procedures. * [Semantics of Programming Languages: Structures and Techniques][gunter1992] -/ +@[expose] public section + assert_not_exists IsOrderedMonoid universe u v diff --git a/Mathlib/Order/OrdContinuous.lean b/Mathlib/Order/OrdContinuous.lean index e77036c3013342..a29e0ed5f12082 100644 --- a/Mathlib/Order/OrdContinuous.lean +++ b/Mathlib/Order/OrdContinuous.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Johannes Hölzl -/ -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.RelIso.Basic +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.RelIso.Basic /-! # Order continuity @@ -18,6 +20,8 @@ We prove some basic lemmas (`map_sup`, `map_sSup` etc) and prove that a `RelIso` and right order continuous. -/ +@[expose] public section + universe u v w x diff --git a/Mathlib/Order/OrderIsoNat.lean b/Mathlib/Order/OrderIsoNat.lean index c4c6bd5456abc2..7b639f5dfe1bb9 100644 --- a/Mathlib/Order/OrderIsoNat.lean +++ b/Mathlib/Order/OrderIsoNat.lean @@ -3,12 +3,13 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ +module -import Mathlib.Data.Nat.Lattice -import Mathlib.Logic.Denumerable -import Mathlib.Logic.Function.Iterate -import Mathlib.Order.Hom.Basic -import Mathlib.Data.Set.Subsingleton +public import Mathlib.Data.Nat.Lattice +public import Mathlib.Logic.Denumerable +public import Mathlib.Logic.Function.Iterate +public import Mathlib.Order.Hom.Basic +public import Mathlib.Data.Set.Subsingleton /-! # Relation embeddings from the naturals @@ -25,6 +26,8 @@ defines the limit value of an eventually-constant sequence. in the sequence. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Order/PFilter.lean b/Mathlib/Order/PFilter.lean index d4611745445506..08fd982ae85afa 100644 --- a/Mathlib/Order/PFilter.lean +++ b/Mathlib/Order/PFilter.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Mathieu Guay-Paquet. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mathieu Guay-Paquet -/ -import Mathlib.Order.Ideal +module + +public import Mathlib.Order.Ideal /-! # Order filters @@ -30,6 +32,8 @@ pfilter, filter, ideal, dual -/ +@[expose] public section + open OrderDual namespace Order diff --git a/Mathlib/Order/Part.lean b/Mathlib/Order/Part.lean index d5e8b158e2ec8d..61c79a201d6ab6 100644 --- a/Mathlib/Order/Part.lean +++ b/Mathlib/Order/Part.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Part -import Mathlib.Order.Hom.Basic -import Mathlib.Tactic.Common +module + +public import Mathlib.Data.Part +public import Mathlib.Order.Hom.Basic +public import Mathlib.Tactic.Common /-! # Monotonicity of monadic operations on `Part` -/ +@[expose] public section + open Part variable {α β γ : Type*} [Preorder α] diff --git a/Mathlib/Order/PartialSups.lean b/Mathlib/Order/PartialSups.lean index 4a6fc63bf0dc77..a9597e64ad5e78 100644 --- a/Mathlib/Order/PartialSups.lean +++ b/Mathlib/Order/PartialSups.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Order.Interval.Finset.Nat -import Mathlib.Order.SuccPred.Basic +module + +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Order.SuccPred.Basic /-! # The monotone sequence of partial supremums of a sequence @@ -34,6 +36,8 @@ One might dispute whether this sequence should start at `f 0` or `⊥`. We choos -/ +@[expose] public section + open Finset variable {α β ι : Type*} diff --git a/Mathlib/Order/Partition/Basic.lean b/Mathlib/Order/Partition/Basic.lean index 399d1bf36952c5..1b0cd5efe8021e 100644 --- a/Mathlib/Order/Partition/Basic.lean +++ b/Mathlib/Order/Partition/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.SupIndep +module + +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.SupIndep /-! # Partitions @@ -28,6 +30,8 @@ where `s` is the set of all `x` for which `r x x`. * Give API lemmas for the specialization to the `Set` case. -/ + +@[expose] public section variable {α : Type*} {s x y : α} open Set diff --git a/Mathlib/Order/Partition/Equipartition.lean b/Mathlib/Order/Partition/Equipartition.lean index 7e764c2e270773..19dbdab93b81b5 100644 --- a/Mathlib/Order/Partition/Equipartition.lean +++ b/Mathlib/Order/Partition/Equipartition.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Algebra.Order.Ring.Nat -import Mathlib.Data.Set.Equitable -import Mathlib.Logic.Equiv.Fin.Basic -import Mathlib.Order.Partition.Finpartition -import Mathlib.Tactic.ApplyFun +module + +public import Mathlib.Algebra.Order.Ring.Nat +public import Mathlib.Data.Set.Equitable +public import Mathlib.Logic.Equiv.Fin.Basic +public import Mathlib.Order.Partition.Finpartition +public import Mathlib.Tactic.ApplyFun /-! # Finite equipartitions @@ -23,6 +25,8 @@ difference of `1`. the number of parts. -/ +@[expose] public section + open Finset Fintype diff --git a/Mathlib/Order/Partition/Finpartition.lean b/Mathlib/Order/Partition/Finpartition.lean index e788a740b5a8f7..887105a5f994e9 100644 --- a/Mathlib/Order/Partition/Finpartition.lean +++ b/Mathlib/Order/Partition/Finpartition.lean @@ -3,14 +3,16 @@ Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ -import Mathlib.Data.Finset.Lattice.Prod -import Mathlib.Data.Finset.Pairwise -import Mathlib.Data.Fintype.Powerset -import Mathlib.Data.Setoid.Basic -import Mathlib.Order.Atoms -import Mathlib.Order.SupIndep -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Data.Finset.Lattice.Prod +public import Mathlib.Data.Finset.Pairwise +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Data.Setoid.Basic +public import Mathlib.Order.Atoms +public import Mathlib.Order.SupIndep +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Finite partitions @@ -60,6 +62,8 @@ the literature and turn the order around? The specialisation to `Finset α` could be generalised to atomistic orders. -/ +@[expose] public section + open Finset Function diff --git a/Mathlib/Order/PiLex.lean b/Mathlib/Order/PiLex.lean index c11ff033ff1718..cc8e0c16f4dc1f 100644 --- a/Mathlib/Order/PiLex.lean +++ b/Mathlib/Order/PiLex.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Order.WellFounded -import Mathlib.Tactic.Common +module + +public import Mathlib.Order.WellFounded +public import Mathlib.Tactic.Common /-! # Lexicographic order on Pi types @@ -30,6 +32,8 @@ Related files are: * `Data.Prod.Lex`: Lexicographic order on `α × β`. -/ +@[expose] public section + assert_not_exists Monoid variable {ι : Type*} {β : ι → Type*} (r : ι → ι → Prop) (s : ∀ {i}, β i → β i → Prop) diff --git a/Mathlib/Order/Preorder/Chain.lean b/Mathlib/Order/Preorder/Chain.lean index 4fed8d18aa4105..6a1d1d8b1f1ac7 100644 --- a/Mathlib/Order/Preorder/Chain.lean +++ b/Mathlib/Order/Preorder/Chain.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Data.Set.Pairwise.Basic -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.Directed -import Mathlib.Order.Hom.Set +module + +public import Mathlib.Data.Set.Pairwise.Basic +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.Directed +public import Mathlib.Order.Hom.Set /-! # Chains and flags @@ -25,6 +27,8 @@ Originally ported from Isabelle/HOL. The Fleuriot, Tobias Nipkow, Christian Sternagel. -/ +@[expose] public section + assert_not_exists CompleteLattice open Set diff --git a/Mathlib/Order/Preorder/Finite.lean b/Mathlib/Order/Preorder/Finite.lean index c1551df4f331d5..b0493edf0c8b73 100644 --- a/Mathlib/Order/Preorder/Finite.lean +++ b/Mathlib/Order/Preorder/Finite.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Order.Minimal +module + +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Order.Minimal /-! # Finite preorders and finite sets in a preorder @@ -13,6 +15,8 @@ This file shows that non-empty finite sets in a preorder have minimal/maximal el contrapositively that non-empty sets without minimal or maximal elements are infinite. -/ +@[expose] public section + variable {ι α β : Type*} namespace Finset diff --git a/Mathlib/Order/Preorder/Finsupp.lean b/Mathlib/Order/Preorder/Finsupp.lean index 21892cef13b223..8c6946db7e764c 100644 --- a/Mathlib/Order/Preorder/Finsupp.lean +++ b/Mathlib/Order/Preorder/Finsupp.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Aaron Anderson -/ -import Mathlib.Data.Finsupp.Defs +module + +public import Mathlib.Data.Finsupp.Defs /-! # Pointwise order on finitely supported functions @@ -11,6 +13,8 @@ import Mathlib.Data.Finsupp.Defs This file lifts order structures on `M` to `ι →₀ M`. -/ +@[expose] public section + assert_not_exists CompleteLattice noncomputable section diff --git a/Mathlib/Order/PrimeIdeal.lean b/Mathlib/Order/PrimeIdeal.lean index 0375c9156d41a8..3d1efcc8764a35 100644 --- a/Mathlib/Order/PrimeIdeal.lean +++ b/Mathlib/Order/PrimeIdeal.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Noam Atar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Noam Atar -/ -import Mathlib.Order.Ideal -import Mathlib.Order.PFilter +module + +public import Mathlib.Order.Ideal +public import Mathlib.Order.PFilter /-! # Prime ideals @@ -30,6 +32,8 @@ ideal, prime -/ +@[expose] public section + open Order.PFilter diff --git a/Mathlib/Order/PrimeSeparator.lean b/Mathlib/Order/PrimeSeparator.lean index 128945e3f2d9e9..5f11e5593be1ad 100644 --- a/Mathlib/Order/PrimeSeparator.lean +++ b/Mathlib/Order/PrimeSeparator.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Sam van Gool. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sam van Gool -/ +module -import Mathlib.Order.PrimeIdeal -import Mathlib.Order.Zorn +public import Mathlib.Order.PrimeIdeal +public import Mathlib.Order.Zorn /-! # Separating prime filters and ideals @@ -25,6 +26,8 @@ ideal, filter, prime, distributive lattice (1938)][Sto1938] -/ +@[expose] public section + universe u variable {α : Type*} diff --git a/Mathlib/Order/Prod/Lex/Hom.lean b/Mathlib/Order/Prod/Lex/Hom.lean index 7d13b65c6331ac..01429ff42b6876 100644 --- a/Mathlib/Order/Prod/Lex/Hom.lean +++ b/Mathlib/Order/Prod/Lex/Hom.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Data.Prod.Lex -import Mathlib.Order.Hom.Basic +module + +public import Mathlib.Data.Prod.Lex +public import Mathlib.Order.Hom.Basic /-! # Order homomorphism for `Prod.Lex` -/ +@[expose] public section + /-- `toLex` as an `OrderHom`. -/ @[simps] def Prod.Lex.toLexOrderHom {α β : Type*} [PartialOrder α] [Preorder β] : diff --git a/Mathlib/Order/PropInstances.lean b/Mathlib/Order/PropInstances.lean index e22bfeea679bc1..ab21ed1f551f29 100644 --- a/Mathlib/Order/PropInstances.lean +++ b/Mathlib/Order/PropInstances.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.Disjoint +module + +public import Mathlib.Order.Disjoint /-! @@ -13,6 +15,8 @@ Instances on `Prop` such as `DistribLattice`, `BoundedOrder`, `LinearOrder`. -/ +@[expose] public section + /-- Propositions form a distributive lattice. -/ instance Prop.instDistribLattice : DistribLattice Prop where sup := Or diff --git a/Mathlib/Order/Radical.lean b/Mathlib/Order/Radical.lean index 74175151d9df53..6091057906ab2d 100644 --- a/Mathlib/Order/Radical.lean +++ b/Mathlib/Order/Radical.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Colva Roney-Dougal. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Colva Roney-Dougal, Inna Capdeboscq, Susanna Fishel, Kim Morrison -/ -import Mathlib.Order.Atoms +module + +public import Mathlib.Order.Atoms /-! # The radical of a lattice @@ -11,6 +13,8 @@ import Mathlib.Order.Atoms This file contains results on the order radical of a lattice: the infimum of the coatoms. -/ +@[expose] public section + /-- The infimum of all coatoms. diff --git a/Mathlib/Order/Rel/GaloisConnection.lean b/Mathlib/Order/Rel/GaloisConnection.lean index c22cf6f8cb614c..701c583e9df069 100644 --- a/Mathlib/Order/Rel/GaloisConnection.lean +++ b/Mathlib/Order/Rel/GaloisConnection.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Lagrange Mathematics and Computing Research Center. All right Released under Apache 2.0 license as described in the file LICENSE. Authors: Anthony Bordg -/ -import Mathlib.Data.Rel +module + +public import Mathlib.Data.Rel /-! # The Galois Connection Induced by a Relation @@ -32,6 +34,8 @@ We define `R.leftFixedPoints` (resp. `R.rightFixedPoints`) as the set of fixed p relation, Galois connection, induced bijection, fixed points -/ +@[expose] public section + variable {α β : Type*} (R : SetRel α β) namespace SetRel diff --git a/Mathlib/Order/RelClasses.lean b/Mathlib/Order/RelClasses.lean index c3f4c3746a5c94..2999c975c26514 100644 --- a/Mathlib/Order/RelClasses.lean +++ b/Mathlib/Order/RelClasses.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro, Yury Kudryashov -/ -import Mathlib.Logic.IsEmpty -import Mathlib.Order.Basic -import Mathlib.Tactic.MkIffOfInductiveProp -import Batteries.WF +module + +public import Mathlib.Logic.IsEmpty +public import Mathlib.Order.Basic +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Batteries.WF /-! # Unbundled relation classes @@ -17,6 +19,8 @@ The main difference between these classes and the usual order classes (`Preorder usual classes extend `LE` and/or `LT` while these classes take a relation as an explicit argument. -/ +@[expose] public section + universe u v variable {α : Type u} {β : Type v} {r : α → α → Prop} {s : β → β → Prop} @@ -653,7 +657,7 @@ theorem ssuperset_imp_ssuperset (h₁ : a ⊆ c) (h₂ : d ⊆ b) : a ⊃ b → ssubset_imp_ssubset h₂ h₁ /-- See if the term is `a ⊂ b` and the goal is `a ⊆ b`. -/ -@[gcongr_forward] def exactSubsetOfSSubset : Mathlib.Tactic.GCongr.ForwardExt where +@[gcongr_forward] meta def exactSubsetOfSSubset : Mathlib.Tactic.GCongr.ForwardExt where eval h goal := do goal.assignIfDefEq (← Lean.Meta.mkAppM ``subset_of_ssubset #[h]) end GCongr diff --git a/Mathlib/Order/RelIso/Basic.lean b/Mathlib/Order/RelIso/Basic.lean index daf84413adecda..c6bdfe69b277ad 100644 --- a/Mathlib/Order/RelIso/Basic.lean +++ b/Mathlib/Order/RelIso/Basic.lean @@ -3,9 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.FunLike.Basic -import Mathlib.Logic.Embedding.Basic -import Mathlib.Order.RelClasses +module + +public import Mathlib.Logic.Embedding.Basic +public import Mathlib.Order.RelClasses /-! # Relation homomorphisms, embeddings, isomorphisms @@ -31,6 +32,8 @@ isomorphisms. * `≃r`: `RelIso` -/ +@[expose] public section + open Function universe u v w diff --git a/Mathlib/Order/RelIso/Set.lean b/Mathlib/Order/RelIso/Set.lean index 67ae6837ebc263..64fbd16e17c494 100644 --- a/Mathlib/Order/RelIso/Set.lean +++ b/Mathlib/Order/RelIso/Set.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Order.Directed -import Mathlib.Order.RelIso.Basic -import Mathlib.Logic.Embedding.Set -import Mathlib.Logic.Equiv.Set +module + +public import Mathlib.Order.Directed +public import Mathlib.Order.RelIso.Basic +public import Mathlib.Logic.Embedding.Set +public import Mathlib.Logic.Equiv.Set /-! # Interactions between relation homomorphisms and sets @@ -15,6 +17,8 @@ It is likely that there are better homes for many of these statement, in files further down the import graph. -/ +@[expose] public section + open Function diff --git a/Mathlib/Order/RelSeries.lean b/Mathlib/Order/RelSeries.lean index 57e9e65aeb4b70..805d9f7533c04a 100644 --- a/Mathlib/Order/RelSeries.lean +++ b/Mathlib/Order/RelSeries.lean @@ -3,15 +3,17 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Fangming Li -/ -import Mathlib.Algebra.GroupWithZero.Nat -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Monoid.NatCast -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.Fintype.Pi -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Data.Fintype.Sigma -import Mathlib.Data.Rel -import Mathlib.Order.OrderIsoNat +module + +public import Mathlib.Algebra.GroupWithZero.Nat +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Monoid.NatCast +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Data.Fintype.Sigma +public import Mathlib.Data.Rel +public import Mathlib.Order.OrderIsoNat /-! # Series of a relation @@ -21,6 +23,8 @@ If `r` is a relation on `α` then a relation series of length `n` is a series -/ +@[expose] public section + open scoped SetRel variable {α : Type*} (r : SetRel α α) @@ -100,7 +104,7 @@ lemma length_toList (x : RelSeries r) : x.toList.length = x.length + 1 := @[simp] lemma toList_singleton (x : α) : (singleton r x).toList = [x] := - rfl + by simp [toList, singleton] lemma isChain_toList (x : RelSeries r) : x.toList.IsChain (· ~[r] ·) := by rw [List.isChain_iff_get] diff --git a/Mathlib/Order/Restriction.lean b/Mathlib/Order/Restriction.lean index 163c535d74cdbd..a17dd0147bd0d0 100644 --- a/Mathlib/Order/Restriction.lean +++ b/Mathlib/Order/Restriction.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Data.Finset.Update -import Mathlib.Order.Interval.Finset.Basic +module + +public import Mathlib.Data.Finset.Update +public import Mathlib.Order.Interval.Finset.Basic /-! # Restriction of a function indexed by a preorder @@ -23,6 +25,8 @@ and `Preorder.frestrictLe₂`. * `Preorder.restrictLe a f`: Restricts the function `f` to the variables indexed by elements `≤ a`. -/ +@[expose] public section + namespace Preorder variable {α : Type*} [Preorder α] {π : α → Type*} diff --git a/Mathlib/Order/ScottContinuity.lean b/Mathlib/Order/ScottContinuity.lean index b616c04597fe7f..d1e16dab3e2071 100644 --- a/Mathlib/Order/ScottContinuity.lean +++ b/Mathlib/Order/ScottContinuity.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Order.Bounds.Basic +module + +public import Mathlib.Order.Bounds.Basic /-! # Scott continuity @@ -27,6 +29,8 @@ in this file, and ωScott Continuity on chains later in -/ +@[expose] public section + open Set variable {α β : Type*} diff --git a/Mathlib/Order/ScottContinuity/Complete.lean b/Mathlib/Order/ScottContinuity/Complete.lean index dd1df18dd726f8..d2703c4b6159c5 100644 --- a/Mathlib/Order/ScottContinuity/Complete.lean +++ b/Mathlib/Order/ScottContinuity/Complete.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Order.ScottContinuity.Prod +module + +public import Mathlib.Order.ScottContinuity.Prod /-! @@ -16,6 +18,8 @@ import Mathlib.Order.ScottContinuity.Prod -/ +@[expose] public section + variable {α β : Type*} section CompleteLattice diff --git a/Mathlib/Order/ScottContinuity/Prod.lean b/Mathlib/Order/ScottContinuity/Prod.lean index e4f5066cf72f58..12684f22f7d594 100644 --- a/Mathlib/Order/ScottContinuity/Prod.lean +++ b/Mathlib/Order/ScottContinuity/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christopher Hoskin -/ -import Mathlib.Order.ScottContinuity -import Mathlib.Order.Bounds.Lattice +module + +public import Mathlib.Order.ScottContinuity +public import Mathlib.Order.Bounds.Lattice /-! # Scott continuity on product spaces @@ -17,6 +19,8 @@ import Mathlib.Order.Bounds.Lattice -/ +@[expose] public section + open Set variable {α β γ : Type*} diff --git a/Mathlib/Order/SemiconjSup.lean b/Mathlib/Order/SemiconjSup.lean index 6012692bbb08f2..9a8fca764974b4 100644 --- a/Mathlib/Order/SemiconjSup.lean +++ b/Mathlib/Order/SemiconjSup.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Group.Units.Equiv -import Mathlib.Algebra.Order.Group.End -import Mathlib.Logic.Function.Conjugate -import Mathlib.Order.Bounds.OrderIso -import Mathlib.Order.OrdContinuous +module + +public import Mathlib.Algebra.Group.Units.Equiv +public import Mathlib.Algebra.Order.Group.End +public import Mathlib.Logic.Function.Conjugate +public import Mathlib.Order.Bounds.OrderIso +public import Mathlib.Order.OrdContinuous /-! # Semiconjugate by `sSup` @@ -30,6 +32,8 @@ homeomorphisms of the circle, so in order to apply results from this file one ha homeomorphisms to the real line first. -/ +@[expose] public section + -- Guard against import creep assert_not_exists Finset diff --git a/Mathlib/Order/Set.lean b/Mathlib/Order/Set.lean index dcc25ffca62c76..2b96aa4f7a14d8 100644 --- a/Mathlib/Order/Set.lean +++ b/Mathlib/Order/Set.lean @@ -3,12 +3,15 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ +module -import Mathlib.Data.Set.Image -import Mathlib.Order.TypeTags +public import Mathlib.Data.Set.Image +public import Mathlib.Order.TypeTags /-! # `Set.range` on `WithBot` and `WithTop` -/ +@[expose] public section + open Set variable {α β : Type*} diff --git a/Mathlib/Order/SetIsMax.lean b/Mathlib/Order/SetIsMax.lean index 7ef6fc229c567b..42c014bad97c77 100644 --- a/Mathlib/Order/SetIsMax.lean +++ b/Mathlib/Order/SetIsMax.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.Max -import Mathlib.Data.Set.CoeSort +module + +public import Mathlib.Order.Max +public import Mathlib.Data.Set.CoeSort /-! # Maximal elements of subsets @@ -14,6 +16,8 @@ then `↑m : J` is not maximal in `J`. -/ +@[expose] public section + universe u namespace Set diff --git a/Mathlib/Order/SetNotation.lean b/Mathlib/Order/SetNotation.lean index bc594dceae25ed..f1d5f06ef1a96d 100644 --- a/Mathlib/Order/SetNotation.lean +++ b/Mathlib/Order/SetNotation.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Patrick Massot, Yury Kudryashov -/ -import Mathlib.Data.Set.Operations -import Mathlib.Util.Notation3 +module + +public import Mathlib.Data.Set.Operations +public import Mathlib.Util.Notation3 /-! # Notation classes for set supremum and infimum @@ -31,6 +33,8 @@ In this file we introduce notation for indexed suprema, infima, unions, and inte -/ +@[expose] public section + open Set universe u v @@ -78,7 +82,7 @@ open Lean Lean.PrettyPrinter.Delaborator /-- Delaborator for indexed supremum. -/ @[app_delab iSup] -def iSup_delab : Delab := whenPPOption Lean.getPPNotation <| withOverApp 4 do +meta def iSup_delab : Delab := whenPPOption Lean.getPPNotation <| withOverApp 4 do let #[_, ι, _, f] := (← SubExpr.getExpr).getAppArgs | failure unless f.isLambda do failure let prop ← Meta.isProp ι @@ -106,7 +110,7 @@ def iSup_delab : Delab := whenPPOption Lean.getPPNotation <| withOverApp 4 do /-- Delaborator for indexed infimum. -/ @[app_delab iInf] -def iInf_delab : Delab := whenPPOption Lean.getPPNotation <| withOverApp 4 do +meta def iInf_delab : Delab := whenPPOption Lean.getPPNotation <| withOverApp 4 do let #[_, ι, _, f] := (← SubExpr.getExpr).getAppArgs | failure unless f.isLambda do failure let prop ← Meta.isProp ι @@ -183,7 +187,7 @@ open Lean Lean.PrettyPrinter.Delaborator /-- Delaborator for indexed unions. -/ @[app_delab Set.iUnion] -def iUnion_delab : Delab := whenPPOption Lean.getPPNotation do +meta def iUnion_delab : Delab := whenPPOption Lean.getPPNotation do let #[_, ι, f] := (← SubExpr.getExpr).getAppArgs | failure unless f.isLambda do failure let prop ← Meta.isProp ι @@ -211,7 +215,7 @@ def iUnion_delab : Delab := whenPPOption Lean.getPPNotation do /-- Delaborator for indexed intersections. -/ @[app_delab Set.iInter] -def sInter_delab : Delab := whenPPOption Lean.getPPNotation do +meta def sInter_delab : Delab := whenPPOption Lean.getPPNotation do let #[_, ι, f] := (← SubExpr.getExpr).getAppArgs | failure unless f.isLambda do failure let prop ← Meta.isProp ι diff --git a/Mathlib/Order/Shrink.lean b/Mathlib/Order/Shrink.lean index 00a7e285c370ec..bc8e799614b7d7 100644 --- a/Mathlib/Order/Shrink.lean +++ b/Mathlib/Order/Shrink.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.Order.SuccPred.Basic -import Mathlib.Logic.Small.Defs +module + +public import Mathlib.Order.SuccPred.Basic +public import Mathlib.Logic.Small.Defs /-! # Order instances on Shrink @@ -14,6 +16,8 @@ instances on `α` to `Shrink.{u} α`. -/ +@[expose] public section + universe u v variable (α : Type v) [Small.{u} α] diff --git a/Mathlib/Order/Sublattice.lean b/Mathlib/Order/Sublattice.lean index 77205f383aa1cc..de82cc5676af2f 100644 --- a/Mathlib/Order/Sublattice.lean +++ b/Mathlib/Order/Sublattice.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.SupClosed +module + +public import Mathlib.Order.SupClosed /-! # Sublattices @@ -19,6 +21,8 @@ Subsemilattices, if people care about them. sublattice -/ +@[expose] public section + open Function Set variable {ι : Sort*} (α β γ : Type*) [Lattice α] [Lattice β] [Lattice γ] diff --git a/Mathlib/Order/Sublocale.lean b/Mathlib/Order/Sublocale.lean index 34dad7a01aa0c9..c2399a57e96903 100644 --- a/Mathlib/Order/Sublocale.lean +++ b/Mathlib/Order/Sublocale.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Krause. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chriara Cimino, Christian Krause -/ -import Mathlib.Order.Nucleus -import Mathlib.Order.SupClosed +module + +public import Mathlib.Order.Nucleus +public import Mathlib.Order.SupClosed /-! # Sublocale @@ -24,6 +26,8 @@ Create separate definitions for `sInf_mem` and `HImpClosed` (also useful for `Co * https://ncatlab.org/nlab/show/nucleus -/ +@[expose] public section + variable {X : Type*} [Order.Frame X] open Set diff --git a/Mathlib/Order/SuccPred/Archimedean.lean b/Mathlib/Order/SuccPred/Archimedean.lean index 209e24738e3ec3..18f70b6a0a78b6 100644 --- a/Mathlib/Order/SuccPred/Archimedean.lean +++ b/Mathlib/Order/SuccPred/Archimedean.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.SuccPred.Basic +module + +public import Mathlib.Order.SuccPred.Basic /-! # Archimedean successor and predecessor @@ -14,6 +16,8 @@ import Mathlib.Order.SuccPred.Basic ones. -/ +@[expose] public section + variable {α β : Type*} open Order Function diff --git a/Mathlib/Order/SuccPred/Basic.lean b/Mathlib/Order/SuccPred/Basic.lean index eec6055d094285..1d1c0f2a8a1a42 100644 --- a/Mathlib/Order/SuccPred/Basic.lean +++ b/Mathlib/Order/SuccPred/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.ConditionallyCompleteLattice.Basic -import Mathlib.Order.Cover -import Mathlib.Order.Iterate +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Basic +public import Mathlib.Order.Cover +public import Mathlib.Order.Iterate /-! # Successor and predecessor @@ -38,6 +40,8 @@ The stricter condition of every element having a sensible successor can be obtai combination of `SuccOrder α` and `NoMaxOrder α`. -/ +@[expose] public section + open Function OrderDual Set variable {α β : Type*} diff --git a/Mathlib/Order/SuccPred/CompleteLinearOrder.lean b/Mathlib/Order/SuccPred/CompleteLinearOrder.lean index 6c1fac99585167..31de80c9adb332 100644 --- a/Mathlib/Order/SuccPred/CompleteLinearOrder.lean +++ b/Mathlib/Order/SuccPred/CompleteLinearOrder.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Order.ConditionallyCompleteLattice.Indexed -import Mathlib.Order.SuccPred.Limit +module + +public import Mathlib.Order.ConditionallyCompleteLattice.Indexed +public import Mathlib.Order.SuccPred.Limit /-! @@ -12,6 +14,8 @@ import Mathlib.Order.SuccPred.Limit -/ +@[expose] public section + open Order Set variable {ι : Sort*} {α : Type*} diff --git a/Mathlib/Order/SuccPred/InitialSeg.lean b/Mathlib/Order/SuccPred/InitialSeg.lean index b099907d102108..557d2db85848d2 100644 --- a/Mathlib/Order/SuccPred/InitialSeg.lean +++ b/Mathlib/Order/SuccPred/InitialSeg.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.InitialSeg -import Mathlib.Order.SuccPred.Limit +module + +public import Mathlib.Order.InitialSeg +public import Mathlib.Order.SuccPred.Limit /-! # Initial segments and successors @@ -12,6 +14,8 @@ import Mathlib.Order.SuccPred.Limit We establish some connections between initial segment embeddings and successors and predecessors. -/ +@[expose] public section + variable {α β : Type*} {a b : α} [PartialOrder α] [PartialOrder β] open Order diff --git a/Mathlib/Order/SuccPred/IntervalSucc.lean b/Mathlib/Order/SuccPred/IntervalSucc.lean index b8d136d72da89a..c533e82696e6b3 100644 --- a/Mathlib/Order/SuccPred/IntervalSucc.lean +++ b/Mathlib/Order/SuccPred/IntervalSucc.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Data.Set.Pairwise.Basic -import Mathlib.Data.Set.Lattice -import Mathlib.Order.SuccPred.Archimedean +module + +public import Mathlib.Data.Set.Pairwise.Basic +public import Mathlib.Data.Set.Lattice +public import Mathlib.Order.SuccPred.Archimedean /-! # Intervals `Ixx (f x) (f (Order.succ x))` @@ -23,6 +25,8 @@ In this file we prove For the latter lemma, we also prove various order dual versions. -/ +@[expose] public section + open Set Order diff --git a/Mathlib/Order/SuccPred/Limit.lean b/Mathlib/Order/SuccPred/Limit.lean index 77676d92256e62..aa0a9b576b55da 100644 --- a/Mathlib/Order/SuccPred/Limit.lean +++ b/Mathlib/Order/SuccPred/Limit.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.SuccPred.Archimedean -import Mathlib.Order.BoundedOrder.Lattice +module + +public import Mathlib.Order.SuccPred.Archimedean +public import Mathlib.Order.BoundedOrder.Lattice /-! # Successor and predecessor limits @@ -18,6 +20,8 @@ maximal elements from being predecessor limits. As such, we also provide `Order. `Order.IsPredLimit`, which exclude these cases. -/ +@[expose] public section + variable {α : Type*} {a b : α} diff --git a/Mathlib/Order/SuccPred/LinearLocallyFinite.lean b/Mathlib/Order/SuccPred/LinearLocallyFinite.lean index e6593e7e57619c..1ea63e5b40aafa 100644 --- a/Mathlib/Order/SuccPred/LinearLocallyFinite.lean +++ b/Mathlib/Order/SuccPred/LinearLocallyFinite.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Data.Countable.Basic -import Mathlib.Data.Finset.Max -import Mathlib.Data.Fintype.Pigeonhole -import Mathlib.Logic.Encodable.Basic -import Mathlib.Order.Interval.Finset.Defs -import Mathlib.Order.SuccPred.Archimedean +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Data.Countable.Basic +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Fintype.Pigeonhole +public import Mathlib.Logic.Encodable.Basic +public import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Order.SuccPred.Archimedean /-! # Linear locally finite orders @@ -53,6 +55,8 @@ About `toZ`: -/ +@[expose] public section + open Order diff --git a/Mathlib/Order/SuccPred/Relation.lean b/Mathlib/Order/SuccPred/Relation.lean index b54a6dd23a17fa..9ecf05af53cec8 100644 --- a/Mathlib/Order/SuccPred/Relation.lean +++ b/Mathlib/Order/SuccPred/Relation.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Order.SuccPred.Archimedean +module + +public import Mathlib.Order.SuccPred.Archimedean /-! # Relations on types with a `SuccOrder` @@ -12,6 +14,8 @@ This file contains properties about relations on types with a `SuccOrder` and their closure operations (like the transitive closure). -/ +@[expose] public section + open Function Order Relation Set section PartialSucc diff --git a/Mathlib/Order/SuccPred/Tree.lean b/Mathlib/Order/SuccPred/Tree.lean index cb884768001149..9ceb0d9797b397 100644 --- a/Mathlib/Order/SuccPred/Tree.lean +++ b/Mathlib/Order/SuccPred/Tree.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ +module -import Mathlib.Order.SuccPred.Archimedean -import Mathlib.Data.Nat.Find -import Mathlib.Order.Atoms -import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.SuccPred.Archimedean +public import Mathlib.Data.Nat.Find +public import Mathlib.Order.Atoms +public import Mathlib.Data.SetLike.Basic /-! # Rooted trees @@ -18,6 +19,8 @@ This is a `PartialOrder`, with `PredOrder` with the immediate parent as a predec dangling chains. -/ +@[expose] public section + variable {α : Type*} [PartialOrder α] [PredOrder α] [IsPredArchimedean α] namespace IsPredArchimedean diff --git a/Mathlib/Order/SuccPred/WithBot.lean b/Mathlib/Order/SuccPred/WithBot.lean index 2ac6e4dfbe1fae..712201b06a09a5 100644 --- a/Mathlib/Order/SuccPred/WithBot.lean +++ b/Mathlib/Order/SuccPred/WithBot.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Order.SuccPred.Basic +module + +public import Mathlib.Order.SuccPred.Basic /-! # Successor function on `WithBot` @@ -11,6 +13,8 @@ import Mathlib.Order.SuccPred.Basic This file defines the successor of `a : WithBot α` as an element of `α`, and dually for `WithTop`. -/ +@[expose] public section + namespace WithBot variable {α : Type*} [Preorder α] [OrderBot α] [SuccOrder α] {x y : WithBot α} diff --git a/Mathlib/Order/SupClosed.lean b/Mathlib/Order/SupClosed.lean index 63e534020df9e8..06077d42137ee1 100644 --- a/Mathlib/Order/SupClosed.lean +++ b/Mathlib/Order/SupClosed.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Yaël Dillies, Christopher Hoskin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Christopher Hoskin -/ -import Mathlib.Data.Finset.Lattice.Prod -import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Order.Closure -import Mathlib.Order.ConditionallyCompleteLattice.Finset +module + +public import Mathlib.Data.Finset.Lattice.Prod +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Order.Closure +public import Mathlib.Order.ConditionallyCompleteLattice.Finset /-! # Sets closed under join/meet @@ -30,6 +32,8 @@ is automatically complete. All dually for `⊓`. greatest lower bound is automatically complete. -/ +@[expose] public section + variable {ι : Sort*} {F α β : Type*} section SemilatticeSup diff --git a/Mathlib/Order/SupIndep.lean b/Mathlib/Order/SupIndep.lean index 2ffa5693c74d5c..ec6d9d919affcd 100644 --- a/Mathlib/Order/SupIndep.lean +++ b/Mathlib/Order/SupIndep.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Aaron Anderson, Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Kevin Buzzard, Yaël Dillies, Eric Wieser -/ -import Mathlib.Data.Finset.Lattice.Union -import Mathlib.Data.Finset.Lattice.Prod -import Mathlib.Data.Finset.Sigma -import Mathlib.Data.Fintype.Basic -import Mathlib.Order.CompleteLatticeIntervals -import Mathlib.Order.ModularLattice +module + +public import Mathlib.Data.Finset.Lattice.Union +public import Mathlib.Data.Finset.Lattice.Prod +public import Mathlib.Data.Finset.Sigma +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Order.CompleteLatticeIntervals +public import Mathlib.Order.ModularLattice /-! # Supremum independence @@ -40,6 +42,8 @@ For the finite version, we avoid the "obvious" definition `ι`. -/ +@[expose] public section + variable {α β ι ι' : Type*} @@ -209,7 +213,6 @@ protected theorem SupIndep.disjoint_sup_sup {s : Finset ι} {f : ι → α} {u v induction u using Finset.induction generalizing v with | empty => simp | insert x u hx ih => - specialize ih (v := insert x v) grind [= SupIndep, = disjoint_comm, ← Disjoint.disjoint_sup_left_of_disjoint_sup_right] theorem supIndep_sigma_iff' {β : ι → Type*} {s : Finset ι} {g : ∀ i, Finset (β i)} diff --git a/Mathlib/Order/SymmDiff.lean b/Mathlib/Order/SymmDiff.lean index c7867598b6b18c..a863713554149a 100644 --- a/Mathlib/Order/SymmDiff.lean +++ b/Mathlib/Order/SymmDiff.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Bryan Gin-ge Chen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Bryan Gin-ge Chen, Yaël Dillies -/ -import Mathlib.Order.BooleanAlgebra.Basic -import Mathlib.Logic.Equiv.Basic +module + +public import Mathlib.Order.BooleanAlgebra.Basic +public import Mathlib.Logic.Equiv.Basic /-! # Symmetric difference and bi-implication @@ -49,6 +51,8 @@ boolean ring, generalized boolean algebra, boolean algebra, symmetric difference Heyting -/ +@[expose] public section + assert_not_exists RelIso open Function OrderDual diff --git a/Mathlib/Order/Synonym.lean b/Mathlib/Order/Synonym.lean index 297d4fc61bc27c..6f9aa53e3379d9 100644 --- a/Mathlib/Order/Synonym.lean +++ b/Mathlib/Order/Synonym.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin, Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Damiano Testa, Yaël Dillies -/ -import Mathlib.Logic.Equiv.Defs -import Mathlib.Logic.Nontrivial.Defs -import Mathlib.Order.Basic +module + +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Logic.Nontrivial.Defs +public import Mathlib.Order.Basic /-! # Type synonyms @@ -38,6 +40,8 @@ coercions should be inserted: This file is similar to `Algebra.Group.TypeTags`. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Order/TeichmullerTukey.lean b/Mathlib/Order/TeichmullerTukey.lean index 029f94f20d27ef..7b9a87277fc8cb 100644 --- a/Mathlib/Order/TeichmullerTukey.lean +++ b/Mathlib/Order/TeichmullerTukey.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Ansar Azhdarov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ansar Azhdarov -/ -import Mathlib.Data.Set.Finite.Range -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.Zorn +module + +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.Zorn /-! # Teichmuller-Tukey @@ -28,6 +30,8 @@ Teichmuller-Tukey lemma. - -/ +@[expose] public section + open Set Finite variable {α : Type*} (F : Set (Set α)) diff --git a/Mathlib/Order/TransfiniteIteration.lean b/Mathlib/Order/TransfiniteIteration.lean index d9ab15cec163b7..ce1c3a0eee2645 100644 --- a/Mathlib/Order/TransfiniteIteration.lean +++ b/Mathlib/Order/TransfiniteIteration.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou, Violeta Hernández Palacios -/ +module -import Mathlib.Order.SuccPred.Limit +public import Mathlib.Order.SuccPred.Limit /-! # Transfinite iteration of a function `I → I` @@ -31,6 +32,8 @@ when we know `Cardinal.mk I < Cardinal.mk J`). -/ +@[expose] public section + universe w u section diff --git a/Mathlib/Order/TypeTags.lean b/Mathlib/Order/TypeTags.lean index 65d24335fb5d9a..dd4f53d06d4e13 100644 --- a/Mathlib/Order/TypeTags.lean +++ b/Mathlib/Order/TypeTags.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Simon Hudon, Yury Kudryashov -/ -import Mathlib.Order.Notation +module + +public import Mathlib.Order.Notation /-! # Order-related type synonyms @@ -14,6 +16,8 @@ so that, e.g., `Data/Countable/Basic` can prove `Countable ENat` without exploding its imports. -/ +@[expose] public section + variable {α : Type*} /-- Attach `⊥` to a type. -/ diff --git a/Mathlib/Order/ULift.lean b/Mathlib/Order/ULift.lean index fbc397ad10cff8..501b73a989fae9 100644 --- a/Mathlib/Order/ULift.lean +++ b/Mathlib/Order/ULift.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Logic.Function.ULift -import Mathlib.Order.Basic +module + +public import Mathlib.Logic.Function.ULift +public import Mathlib.Order.Basic /-! # Ordered structures on `ULift.{v} α` @@ -12,6 +14,8 @@ Once these basic instances are setup, the instances of more complex typeclasses the corresponding `Prod` instances. -/ +@[expose] public section + namespace ULift open Batteries diff --git a/Mathlib/Order/UpperLower/Basic.lean b/Mathlib/Order/UpperLower/Basic.lean index 13a26aff87007e..cea8743a3e3d7f 100644 --- a/Mathlib/Order/UpperLower/Basic.lean +++ b/Mathlib/Order/UpperLower/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ -import Mathlib.Logic.Equiv.Set -import Mathlib.Order.Interval.Set.OrderEmbedding -import Mathlib.Order.SetNotation -import Mathlib.Order.WellFounded +module + +public import Mathlib.Logic.Equiv.Set +public import Mathlib.Order.Interval.Set.OrderEmbedding +public import Mathlib.Order.SetNotation +public import Mathlib.Order.WellFounded /-! # Properties of unbundled upper/lower sets @@ -21,6 +23,8 @@ on the underlying order (such as `PartialOrder` and `LinearOrder`). * Order equivalence between upper/lower sets and antichains. -/ +@[expose] public section + open OrderDual Set variable {α β : Type*} {ι : Sort*} {κ : ι → Sort*} diff --git a/Mathlib/Order/UpperLower/Closure.lean b/Mathlib/Order/UpperLower/Closure.lean index 6d870ebb7180cf..6b2c6fe648e226 100644 --- a/Mathlib/Order/UpperLower/Closure.lean +++ b/Mathlib/Order/UpperLower/Closure.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ -import Mathlib.Order.Interval.Set.OrdConnected -import Mathlib.Order.Minimal -import Mathlib.Order.UpperLower.Principal +module + +public import Mathlib.Order.Interval.Set.OrdConnected +public import Mathlib.Order.Minimal +public import Mathlib.Order.UpperLower.Principal /-! # Upper and lower closures @@ -20,6 +22,8 @@ they are equivalent to a union over principal upper (lower) sets, as shown in `c * `lowerClosure`: The least lower set containing a set. -/ +@[expose] public section + open OrderDual Set variable {α β : Type*} {ι : Sort*} diff --git a/Mathlib/Order/UpperLower/CompleteLattice.lean b/Mathlib/Order/UpperLower/CompleteLattice.lean index 1e0f9654458288..1a0ad3d3de1e91 100644 --- a/Mathlib/Order/UpperLower/CompleteLattice.lean +++ b/Mathlib/Order/UpperLower/CompleteLattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ -import Mathlib.Data.Set.Lattice.Image -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Data.Set.Lattice.Image +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.UpperLower.Basic /-! # The complete lattice structure on `UpperSet`/`LowerSet` @@ -19,6 +21,8 @@ Upper sets are ordered by **reverse** inclusion. This convention is motivated by makes them order-isomorphic to lower sets and antichains, and matches the convention on `Filter`. -/ +@[expose] public section + open OrderDual Set variable {α β γ : Type*} {ι : Sort*} {κ : ι → Sort*} diff --git a/Mathlib/Order/UpperLower/Fibration.lean b/Mathlib/Order/UpperLower/Fibration.lean index ebb38a930b0ada..e07c4e76571d79 100644 --- a/Mathlib/Order/UpperLower/Fibration.lean +++ b/Mathlib/Order/UpperLower/Fibration.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ -import Mathlib.Order.UpperLower.Basic +module + +public import Mathlib.Order.UpperLower.Basic /-! # Upper/lower sets and fibrations -/ +@[expose] public section + open Set namespace Relation diff --git a/Mathlib/Order/UpperLower/Hom.lean b/Mathlib/Order/UpperLower/Hom.lean index e6f4627d3e2ca0..c04d816ed9f418 100644 --- a/Mathlib/Order/UpperLower/Hom.lean +++ b/Mathlib/Order/UpperLower/Hom.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Order.Hom.CompleteLattice -import Mathlib.Order.UpperLower.Principal +module + +public import Mathlib.Order.Hom.CompleteLattice +public import Mathlib.Order.UpperLower.Principal /-! # `UpperSet.Ici` etc. as `Sup`/`sSup`/`Inf`/`sInf`-homomorphisms @@ -13,6 +15,8 @@ In this file we define `UpperSet.iciSupHom` etc. These functions are `UpperSet.I `LowerSet.Iic` bundled as `SupHom`s, `InfHom`s, `sSupHom`s, or `sInfHom`s. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/Order/UpperLower/LocallyFinite.lean b/Mathlib/Order/UpperLower/LocallyFinite.lean index 3c6711bd058d9f..72938696b2388d 100644 --- a/Mathlib/Order/UpperLower/LocallyFinite.lean +++ b/Mathlib/Order/UpperLower/LocallyFinite.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.Order.Interval.Finset.Defs -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.Interval.Finset.Defs +public import Mathlib.Order.UpperLower.Closure /-! # Upper and lower sets in a locally finite order @@ -13,6 +15,8 @@ import Mathlib.Order.UpperLower.Closure In this file we characterise the interaction of `UpperSet`/`LowerSet` and `LocallyFiniteOrder`. -/ +@[expose] public section + namespace Set diff --git a/Mathlib/Order/UpperLower/Principal.lean b/Mathlib/Order/UpperLower/Principal.lean index e751bbe86c9930..5e497c52b3a5eb 100644 --- a/Mathlib/Order/UpperLower/Principal.lean +++ b/Mathlib/Order/UpperLower/Principal.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ -import Mathlib.Order.Interval.Set.OrderIso -import Mathlib.Order.UpperLower.CompleteLattice +module + +public import Mathlib.Order.Interval.Set.OrderIso +public import Mathlib.Order.UpperLower.CompleteLattice /-! # Principal upper/lower sets @@ -19,6 +21,8 @@ The results in this file all assume that the underlying type is equipped with at * `LowerSet.Iio`: Strict principal lower set. `Set.Iio` as a lower set. -/ +@[expose] public section + open Function Set variable {α β : Type*} {ι : Sort*} {κ : ι → Sort*} diff --git a/Mathlib/Order/UpperLower/Prod.lean b/Mathlib/Order/UpperLower/Prod.lean index c664eccfe6da7b..f746daa8b63126 100644 --- a/Mathlib/Order/UpperLower/Prod.lean +++ b/Mathlib/Order/UpperLower/Prod.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ -import Mathlib.Order.UpperLower.Closure +module + +public import Mathlib.Order.UpperLower.Closure /-! # Upper and lower set product @@ -16,6 +18,8 @@ defines said product over the types `UpperSet` and `LowerSet` and proves some of * `×ˢ` is notation for `UpperSet.prod` / `LowerSet.prod`. -/ +@[expose] public section + open Set variable {α β : Type*} diff --git a/Mathlib/Order/UpperLower/Relative.lean b/Mathlib/Order/UpperLower/Relative.lean index 9c8ff968b20e53..4b71fcabee22d2 100644 --- a/Mathlib/Order/UpperLower/Relative.lean +++ b/Mathlib/Order/UpperLower/Relative.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Jeremy Tan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Tan -/ -import Mathlib.Data.Set.Image -import Mathlib.Data.SetLike.Basic -import Mathlib.Order.Interval.Set.Defs -import Mathlib.Order.SetNotation +module + +public import Mathlib.Data.Set.Image +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Order.Interval.Set.Defs +public import Mathlib.Order.SetNotation /-! # Properties of relative upper/lower sets @@ -14,6 +16,8 @@ import Mathlib.Order.SetNotation This file proves results on `IsRelUpperSet` and `IsRelLowerSet`. -/ +@[expose] public section + open Set variable {α : Type*} {ι : Sort*} {κ : ι → Sort*} {s t : Set α} {a : α} {P : α → Prop} diff --git a/Mathlib/Order/WellFounded.lean b/Mathlib/Order/WellFounded.lean index 595cefd7af25a9..9496dbab0f6f39 100644 --- a/Mathlib/Order/WellFounded.lean +++ b/Mathlib/Order/WellFounded.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Mario Carneiro -/ -import Mathlib.Data.Set.Function -import Mathlib.Order.Bounds.Defs +module + +public import Mathlib.Data.Set.Function +public import Mathlib.Order.Bounds.Defs /-! # Well-founded relations @@ -18,6 +20,8 @@ and provide a few new definitions: `WellFounded.min`, `WellFounded.sup`, and `We and an induction principle `WellFounded.induction_bot`. -/ +@[expose] public section + theorem acc_def {α} {r : α → α → Prop} {a : α} : Acc r a ↔ ∀ b, r b a → Acc r b where mp h := h.rec fun _ h _ ↦ h mpr := .intro a diff --git a/Mathlib/Order/WellFoundedSet.lean b/Mathlib/Order/WellFoundedSet.lean index cb8bd586377a49..978e93b3ac1544 100644 --- a/Mathlib/Order/WellFoundedSet.lean +++ b/Mathlib/Order/WellFoundedSet.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.Prod.Lex -import Mathlib.Data.Sigma.Lex -import Mathlib.Order.RelIso.Set -import Mathlib.Order.WellQuasiOrder -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Data.Prod.Lex +public import Mathlib.Data.Sigma.Lex +public import Mathlib.Order.RelIso.Set +public import Mathlib.Order.WellQuasiOrder +public import Mathlib.Tactic.TFAE /-! # Well-founded sets @@ -46,6 +48,8 @@ This file introduces versions of `WellFounded` and `WellQuasiOrdered` for sets. * [Nash-Williams, *On Well-Quasi-Ordering Finite Trees*][Nash-Williams63] -/ +@[expose] public section + assert_not_exists IsOrderedRing open scoped Function -- required for scoped `on` notation diff --git a/Mathlib/Order/WellQuasiOrder.lean b/Mathlib/Order/WellQuasiOrder.lean index 078418460005e6..ac26a6ba2deff6 100644 --- a/Mathlib/Order/WellQuasiOrder.lean +++ b/Mathlib/Order/WellQuasiOrder.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios, Aaron Anderson -/ -import Mathlib.Data.Fintype.Card -import Mathlib.Data.Set.Finite.Basic -import Mathlib.Order.Antichain -import Mathlib.Order.OrderIsoNat +module + +public import Mathlib.Data.Fintype.Card +public import Mathlib.Data.Set.Finite.Basic +public import Mathlib.Order.Antichain +public import Mathlib.Order.OrderIsoNat /-! # Well quasi-orders @@ -25,6 +27,8 @@ with no infinite antichains. wqo, pwo, well quasi-order, partial well order, dickson order -/ +@[expose] public section + variable {α β : Type*} {r : α → α → Prop} {s : β → β → Prop} /-- A well quasi-order or WQO is a relation such that any infinite sequence contains an infinite diff --git a/Mathlib/Order/WithBot.lean b/Mathlib/Order/WithBot.lean index 7d0a4f771aa443..462c4e857c859c 100644 --- a/Mathlib/Order/WithBot.lean +++ b/Mathlib/Order/WithBot.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Logic.Nontrivial.Basic -import Mathlib.Order.TypeTags -import Mathlib.Data.Option.NAry -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Lift -import Mathlib.Data.Option.Basic -import Mathlib.Order.Lattice -import Mathlib.Order.BoundedOrder.Basic +module + +public import Mathlib.Logic.Nontrivial.Basic +public import Mathlib.Order.TypeTags +public import Mathlib.Data.Option.NAry +public import Mathlib.Tactic.Contrapose +public import Mathlib.Tactic.Lift +public import Mathlib.Data.Option.Basic +public import Mathlib.Order.Lattice +public import Mathlib.Order.BoundedOrder.Basic /-! # `WithBot`, `WithTop` @@ -23,6 +25,8 @@ Adding a `bot` or a `top` to an order. -/ +@[expose] public section + variable {α β γ δ : Type*} namespace WithBot diff --git a/Mathlib/Order/Zorn.lean b/Mathlib/Order/Zorn.lean index 2ec50c5d66868e..ec89a345872533 100644 --- a/Mathlib/Order/Zorn.lean +++ b/Mathlib/Order/Zorn.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Order.CompleteLattice.Chain -import Mathlib.Order.Minimal +module + +public import Mathlib.Order.CompleteLattice.Chain +public import Mathlib.Order.Minimal /-! # Zorn's lemmas @@ -59,6 +61,8 @@ Originally ported from Isabelle/HOL. The Fleuriot, Tobias Nipkow, Christian Sternagel. -/ +@[expose] public section + open Set variable {α β : Type*} {r : α → α → Prop} {c : Set α} diff --git a/Mathlib/Order/ZornAtoms.lean b/Mathlib/Order/ZornAtoms.lean index 99e546394afc77..f541c2b1b870fe 100644 --- a/Mathlib/Order/ZornAtoms.lean +++ b/Mathlib/Order/ZornAtoms.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Order.Zorn -import Mathlib.Order.Atoms +module + +public import Mathlib.Order.Zorn +public import Mathlib.Order.Atoms /-! # Zorn lemma for (co)atoms @@ -14,6 +16,8 @@ In this file we use Zorn's lemma to prove that a partial order is atomic if ever statement. -/ +@[expose] public section + open Set diff --git a/Mathlib/Probability/BorelCantelli.lean b/Mathlib/Probability/BorelCantelli.lean index 6eee0420d5744a..ad66800d0ffb39 100644 --- a/Mathlib/Probability/BorelCantelli.lean +++ b/Mathlib/Probability/BorelCantelli.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Probability.Martingale.BorelCantelli -import Mathlib.Probability.ConditionalExpectation -import Mathlib.Probability.Independence.Basic +module + +public import Mathlib.Probability.Martingale.BorelCantelli +public import Mathlib.Probability.ConditionalExpectation +public import Mathlib.Probability.Independence.Basic /-! @@ -24,6 +26,8 @@ filtration. in probability spaces), see `MeasureTheory.measure_limsup_atTop_eq_zero`. -/ +@[expose] public section + open scoped ENNReal Topology open MeasureTheory diff --git a/Mathlib/Probability/CDF.lean b/Mathlib/Probability/CDF.lean index 10a35e9d2cbf33..c88266ec41a490 100644 --- a/Mathlib/Probability/CDF.lean +++ b/Mathlib/Probability/CDF.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Disintegration.CondCDF +module + +public import Mathlib.Probability.Kernel.Disintegration.CondCDF /-! # Cumulative distribution function of a real probability measure @@ -38,6 +40,8 @@ The definition could be extended to `ℝⁿ`, either by extending the definition using another construction here. -/ +@[expose] public section + open MeasureTheory Measure Set Filter open scoped Topology diff --git a/Mathlib/Probability/CondVar.lean b/Mathlib/Probability/CondVar.lean index 0a363b41db2487..ce51f35b68243f 100644 --- a/Mathlib/Probability/CondVar.lean +++ b/Mathlib/Probability/CondVar.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real -import Mathlib.MeasureTheory.Integral.Average -import Mathlib.Probability.Moments.Variance +module + +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real +public import Mathlib.MeasureTheory.Integral.Average +public import Mathlib.Probability.Moments.Variance /-! # Conditional variance @@ -19,6 +21,8 @@ Define the Lebesgue conditional variance. See conditional expectation). -/ +@[expose] public section + open MeasureTheory Filter open scoped ENNReal diff --git a/Mathlib/Probability/ConditionalExpectation.lean b/Mathlib/Probability/ConditionalExpectation.lean index f38cc39a7f9f27..f75ff21992e8e9 100644 --- a/Mathlib/Probability/ConditionalExpectation.lean +++ b/Mathlib/Probability/ConditionalExpectation.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Probability.Notation -import Mathlib.Probability.Independence.Basic -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +module + +public import Mathlib.Probability.Notation +public import Mathlib.Probability.Independence.Basic +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic /-! @@ -21,6 +23,8 @@ the main conditional expectation file. -/ +@[expose] public section + open TopologicalSpace Filter diff --git a/Mathlib/Probability/ConditionalProbability.lean b/Mathlib/Probability/ConditionalProbability.lean index e1e4f895ad7947..81c8c45d3b1a8a 100644 --- a/Mathlib/Probability/ConditionalProbability.lean +++ b/Mathlib/Probability/ConditionalProbability.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rishikesh Vaishnav. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rishikesh Vaishnav -/ -import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +module + +public import Mathlib.MeasureTheory.Measure.Typeclasses.Probability /-! # Conditional Probability @@ -54,6 +56,8 @@ the conditioning set has non-zero measure should be named using the abbreviation conditional, conditioned, bayes -/ +@[expose] public section + noncomputable section open ENNReal MeasureTheory MeasureTheory.Measure MeasurableSpace Set @@ -87,7 +91,7 @@ open Lean PrettyPrinter.Delaborator SubExpr /-- Unexpander for `μ[|s]` notation. -/ @[app_unexpander ProbabilityTheory.cond] -def condUnexpander : Lean.PrettyPrinter.Unexpander +meta def condUnexpander : Lean.PrettyPrinter.Unexpander | `($_ $μ $s) => `($μ[|$s]) | _ => throw () @@ -97,7 +101,7 @@ def condUnexpander : Lean.PrettyPrinter.Unexpander /-- Delaborator for `μ[t|s]` notation. -/ @[app_delab DFunLike.coe] -def delabCondApplied : Delab := +meta def delabCondApplied : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| withOverApp 6 do let e ← getExpr guard <| e.isAppOfArity' ``DFunLike.coe 6 diff --git a/Mathlib/Probability/Decision/Risk/Basic.lean b/Mathlib/Probability/Decision/Risk/Basic.lean index 9dc53035a111db..c2ce779cbc8436 100644 --- a/Mathlib/Probability/Decision/Risk/Basic.lean +++ b/Mathlib/Probability/Decision/Risk/Basic.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ +module -import Mathlib.Probability.Decision.Risk.Defs -import Mathlib.Probability.Kernel.Composition.MeasureComp +public import Mathlib.Probability.Decision.Risk.Defs +public import Mathlib.Probability.Kernel.Composition.MeasureComp /-! # Basic properties of the risk of an estimator @@ -32,6 +33,8 @@ In many cases, the maximal Bayes risk and the minimax risk are equal -/ +@[expose] public section + open MeasureTheory Function open scoped ENNReal NNReal diff --git a/Mathlib/Probability/Decision/Risk/Defs.lean b/Mathlib/Probability/Decision/Risk/Defs.lean index 402eccb6daeea3..2d89ff9ca0b384 100644 --- a/Mathlib/Probability/Decision/Risk/Defs.lean +++ b/Mathlib/Probability/Decision/Risk/Defs.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ +module -import Mathlib.Probability.Kernel.Composition.Comp +public import Mathlib.Probability.Kernel.Composition.Comp /-! # Risk of an estimator @@ -31,6 +32,8 @@ to that integral as `risk` in lemma names. -/ +@[expose] public section + open MeasureTheory open scoped ENNReal diff --git a/Mathlib/Probability/Density.lean b/Mathlib/Probability/Density.lean index 19f5b05f02e9b2..778ca88569f781 100644 --- a/Mathlib/Probability/Density.lean +++ b/Mathlib/Probability/Density.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -import Mathlib.MeasureTheory.Measure.Haar.OfBasis -import Mathlib.Probability.Independence.Basic +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +public import Mathlib.MeasureTheory.Measure.Haar.OfBasis +public import Mathlib.Probability.Independence.Basic /-! # Probability density function @@ -49,6 +51,8 @@ it exists for all random variables. However, to define this, we will need Fourie which we currently do not have. -/ +@[expose] public section + open scoped MeasureTheory NNReal ENNReal diff --git a/Mathlib/Probability/Distributions/Beta.lean b/Mathlib/Probability/Distributions/Beta.lean index 4bebcf69153a88..ab470a8bb17952 100644 --- a/Mathlib/Probability/Distributions/Beta.lean +++ b/Mathlib/Probability/Distributions/Beta.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Tommy Löfgren. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tommy Löfgren -/ -import Mathlib.Analysis.SpecialFunctions.Gamma.Beta +module + +public import Mathlib.Analysis.SpecialFunctions.Gamma.Beta /-! # Beta distributions over ℝ @@ -17,6 +19,8 @@ Define the beta distribution over the reals. `betaPDF α β = ENNReal.ofReal (betaPDFReal α β)`. -/ +@[expose] public section + open scoped ENNReal NNReal open MeasureTheory Complex Set diff --git a/Mathlib/Probability/Distributions/Exponential.lean b/Mathlib/Probability/Distributions/Exponential.lean index 183232d8a7dd7b..86371828025e63 100644 --- a/Mathlib/Probability/Distributions/Exponential.lean +++ b/Mathlib/Probability/Distributions/Exponential.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Claus Clausen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Claus Clausen, Patrick Massot -/ -import Mathlib.Probability.Notation -import Mathlib.Probability.CDF -import Mathlib.Probability.Distributions.Gamma +module + +public import Mathlib.Probability.Notation +public import Mathlib.Probability.CDF +public import Mathlib.Probability.Distributions.Gamma /-! # Exponential distributions over ℝ @@ -24,6 +26,8 @@ Define the Exponential measure over the reals. known function given as `r x ↦ 1 - exp (- (r * x))` for `0 ≤ x` or `0` else. -/ +@[expose] public section + open scoped ENNReal NNReal open MeasureTheory Real Set Filter Topology diff --git a/Mathlib/Probability/Distributions/Fernique.lean b/Mathlib/Probability/Distributions/Fernique.lean index 5b1c06329a447d..ca8b6c28e4008e 100644 --- a/Mathlib/Probability/Distributions/Fernique.lean +++ b/Mathlib/Probability/Distributions/Fernique.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.SpecificLimits.ArithmeticGeometric -import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap -import Mathlib.MeasureTheory.Function.L1Space.Integrable -import Mathlib.Topology.MetricSpace.Polish +module + +public import Mathlib.Analysis.SpecificLimits.ArithmeticGeometric +public import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap +public import Mathlib.MeasureTheory.Function.L1Space.Integrable +public import Mathlib.Topology.MetricSpace.Polish /-! # Fernique's theorem for rotation-invariant measures @@ -73,6 +75,8 @@ the first moment. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory Complex NormedSpace Filter open scoped ENNReal NNReal Real Topology diff --git a/Mathlib/Probability/Distributions/Gamma.lean b/Mathlib/Probability/Distributions/Gamma.lean index 3cdb149dde7954..e258b14ab19c51 100644 --- a/Mathlib/Probability/Distributions/Gamma.lean +++ b/Mathlib/Probability/Distributions/Gamma.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker -/ -import Mathlib.Probability.Notation -import Mathlib.Probability.CDF -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +module + +public import Mathlib.Probability.Notation +public import Mathlib.Probability.CDF +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic /-! # Gamma distributions over ℝ @@ -21,6 +23,8 @@ Define the gamma measure over the reals. -/ +@[expose] public section + open scoped ENNReal NNReal open MeasureTheory Real Set Filter Topology diff --git a/Mathlib/Probability/Distributions/Gaussian.lean b/Mathlib/Probability/Distributions/Gaussian.lean index fffb45ed849198..e4e14e75b528d3 100644 --- a/Mathlib/Probability/Distributions/Gaussian.lean +++ b/Mathlib/Probability/Distributions/Gaussian.lean @@ -1,3 +1,5 @@ -import Mathlib.Probability.Distributions.Gaussian.Real +module + +public import Mathlib.Probability.Distributions.Gaussian.Real deprecated_module (since := "2025-05-16") diff --git a/Mathlib/Probability/Distributions/Gaussian/Basic.lean b/Mathlib/Probability/Distributions/Gaussian/Basic.lean index 1ffd2fdb674a03..42e339fc3a1124 100644 --- a/Mathlib/Probability/Distributions/Gaussian/Basic.lean +++ b/Mathlib/Probability/Distributions/Gaussian/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Distributions.Gaussian.Real +module + +public import Mathlib.Probability.Distributions.Gaussian.Real /-! # Gaussian distributions in Banach spaces @@ -31,6 +33,8 @@ For Gaussian distributions in `ℝ`, see the file `Mathlib.Probability.Distribut -/ +@[expose] public section + open MeasureTheory Complex NormedSpace open scoped ENNReal NNReal diff --git a/Mathlib/Probability/Distributions/Gaussian/Fernique.lean b/Mathlib/Probability/Distributions/Gaussian/Fernique.lean index 76a83b694a7b7f..d545947625618d 100644 --- a/Mathlib/Probability/Distributions/Gaussian/Fernique.lean +++ b/Mathlib/Probability/Distributions/Gaussian/Fernique.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Distributions.Fernique -import Mathlib.Probability.Distributions.Gaussian.Basic +module + +public import Mathlib.Probability.Distributions.Fernique +public import Mathlib.Probability.Distributions.Gaussian.Basic /-! # Fernique's theorem for Gaussian measures @@ -28,6 +30,8 @@ As a consequence, a Gaussian measure has finite moments of all orders. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory Complex NormedSpace open scoped ENNReal NNReal Real Topology diff --git a/Mathlib/Probability/Distributions/Gaussian/Real.lean b/Mathlib/Probability/Distributions/Gaussian/Real.lean index 37634c4c12e93e..930bfa027f6d4c 100644 --- a/Mathlib/Probability/Distributions/Gaussian/Real.lean +++ b/Mathlib/Probability/Distributions/Gaussian/Real.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lorenzo Luccioli, Rémy Degenne, Alexander Bentkamp -/ -import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform -import Mathlib.MeasureTheory.Group.Convolution -import Mathlib.Probability.Moments.MGFAnalytic -import Mathlib.Probability.Independence.Basic +module + +public import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform +public import Mathlib.MeasureTheory.Group.Convolution +public import Mathlib.Probability.Moments.MGFAnalytic +public import Mathlib.Probability.Independence.Basic /-! # Gaussian distributions over ℝ @@ -32,6 +34,8 @@ We define a Gaussian measure over the reals. -/ +@[expose] public section + open scoped ENNReal NNReal Real Complex open MeasureTheory diff --git a/Mathlib/Probability/Distributions/Geometric.lean b/Mathlib/Probability/Distributions/Geometric.lean index 57ff50feb0021f..dce39df2f0a9dc 100644 --- a/Mathlib/Probability/Distributions/Geometric.lean +++ b/Mathlib/Probability/Distributions/Geometric.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker -/ +module -import Mathlib.Probability.ProbabilityMassFunction.Basic -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +public import Mathlib.Probability.ProbabilityMassFunction.Basic +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic /-! # Geometric distributions over ℕ @@ -20,6 +21,8 @@ Define the geometric measure over the natural numbers * `geometricMeasure`: a geometric measure on `ℕ`, parametrized by its success probability `p`. -/ +@[expose] public section + open scoped ENNReal NNReal open MeasureTheory Real Set Filter Topology diff --git a/Mathlib/Probability/Distributions/Pareto.lean b/Mathlib/Probability/Distributions/Pareto.lean index 96f24ccd8355a3..584733c0d1ea6e 100644 --- a/Mathlib/Probability/Distributions/Pareto.lean +++ b/Mathlib/Probability/Distributions/Pareto.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Alvan Caleb Arulandu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alvan Caleb Arulandu -/ -import Mathlib.Probability.Notation -import Mathlib.Probability.CDF -import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +module + +public import Mathlib.Probability.Notation +public import Mathlib.Probability.CDF +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals /-! # Pareto distributions over ℝ @@ -21,6 +23,8 @@ Define the Pareto measure over the reals. -/ +@[expose] public section + open scoped ENNReal NNReal open MeasureTheory Real Set Filter Topology diff --git a/Mathlib/Probability/Distributions/Poisson.lean b/Mathlib/Probability/Distributions/Poisson.lean index 0d1088ae3faba7..8da1ff0db2020d 100644 --- a/Mathlib/Probability/Distributions/Poisson.lean +++ b/Mathlib/Probability/Distributions/Poisson.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker -/ +module -import Mathlib.Analysis.SpecialFunctions.Exponential -import Mathlib.Probability.ProbabilityMassFunction.Basic -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +public import Mathlib.Analysis.SpecialFunctions.Exponential +public import Mathlib.Probability.ProbabilityMassFunction.Basic +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic /-! # Poisson distributions over ℕ @@ -21,6 +22,8 @@ Define the Poisson measure over the natural numbers * `poissonMeasure`: a Poisson measure on `ℕ`, parametrized by its rate `λ`. -/ +@[expose] public section + open scoped ENNReal NNReal Nat open MeasureTheory Real Set Filter Topology diff --git a/Mathlib/Probability/Distributions/Uniform.lean b/Mathlib/Probability/Distributions/Uniform.lean index cfb3ab22b10b6d..6034cf0685e668 100644 --- a/Mathlib/Probability/Distributions/Uniform.lean +++ b/Mathlib/Probability/Distributions/Uniform.lean @@ -3,29 +3,31 @@ Copyright (c) 2024 Josha Dekker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Josha Dekker, Devon Tuma, Kexing Ying -/ -import Mathlib.Probability.Notation -import Mathlib.Probability.Density -import Mathlib.Probability.ConditionalProbability -import Mathlib.Probability.ProbabilityMassFunction.Constructions +module + +public import Mathlib.Probability.Notation +public import Mathlib.Probability.Density +public import Mathlib.Probability.ConditionalProbability +public import Mathlib.Probability.ProbabilityMassFunction.Constructions /-! # Uniform distributions and probability mass functions This file defines two related notions of uniform distributions, which will be unified in the future. -# Uniform distributions +## Uniform distributions Defines the uniform distribution for any set with finite measure. -## Main definitions +### Main definitions * `IsUniform X s ℙ μ` : A random variable `X` has uniform distribution on `s` under `ℙ` if the push-forward measure agrees with the rescaled restricted measure `μ`. -# Uniform probability mass functions +## Uniform probability mass functions This file defines a number of uniform `PMF` distributions from various inputs, uniformly drawing from the corresponding object. -## Main definitions +### Main definitions `PMF.uniformOfFinset` gives each element in the set equal probability, with `0` probability for elements not in the set. @@ -39,6 +41,8 @@ This file defines a number of uniform `PMF` distributions from various inputs, * Refactor the `PMF` definitions to come from a `uniformMeasure` on a `Finset`/`Fintype`/`Multiset`. -/ +@[expose] public section + open scoped Finset MeasureTheory NNReal ENNReal -- TODO: We can't `open ProbabilityTheory` without opening the `ProbabilityTheory` scope :( diff --git a/Mathlib/Probability/HasLaw.lean b/Mathlib/Probability/HasLaw.lean index 7374a5e0b60b94..29cc8165906951 100644 --- a/Mathlib/Probability/HasLaw.lean +++ b/Mathlib/Probability/HasLaw.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Probability.Density -import Mathlib.Probability.Moments.Variance +module + +public import Mathlib.Probability.Density +public import Mathlib.Probability.Moments.Variance /-! # Law of a random variable @@ -17,6 +19,8 @@ operations on the codomain of `X`. See for instance `HasLaw.comp`, `IndepFun.hasLaw_mul` and `IndepFun.hasLaw_add`. -/ +@[expose] public section + open MeasureTheory Measure open scoped ENNReal diff --git a/Mathlib/Probability/HasLawExists.lean b/Mathlib/Probability/HasLawExists.lean index 0ec3f5a288c33c..b6d4439f5aa170 100644 --- a/Mathlib/Probability/HasLawExists.lean +++ b/Mathlib/Probability/HasLawExists.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 David Ledvinka. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Ledvinka -/ -import Mathlib.Probability.HasLaw -import Mathlib.Probability.Independence.InfinitePi +module + +public import Mathlib.Probability.HasLaw +public import Mathlib.Probability.Independence.InfinitePi /-! # Existence of Random Variables @@ -13,6 +15,8 @@ This file contains lemmas that state the existence of random variables with give and a given dependency structure (currently only mutual independence is considered). -/ +@[expose] public section + open MeasureTheory Measure namespace ProbabilityTheory diff --git a/Mathlib/Probability/IdentDistrib.lean b/Mathlib/Probability/IdentDistrib.lean index 211f79d3fb8f1a..8d7b3b684325fd 100644 --- a/Mathlib/Probability/IdentDistrib.lean +++ b/Mathlib/Probability/IdentDistrib.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Probability.Moments.Variance -import Mathlib.MeasureTheory.Function.UniformIntegrable +module + +public import Mathlib.Probability.Moments.Variance +public import Mathlib.MeasureTheory.Function.UniformIntegrable /-! # Identically distributed random variables @@ -48,6 +50,8 @@ identically distributed, and `h.norm` states that `‖f‖` and `‖g‖` are id so on. -/ +@[expose] public section + open MeasureTheory Filter Finset diff --git a/Mathlib/Probability/Independence/Basic.lean b/Mathlib/Probability/Independence/Basic.lean index edc1f6f990c93e..1929910755377f 100644 --- a/Mathlib/Probability/Independence/Basic.lean +++ b/Mathlib/Probability/Independence/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Independence.Kernel -import Mathlib.MeasureTheory.Constructions.Pi -import Mathlib.MeasureTheory.Group.Convolution +module + +public import Mathlib.Probability.Independence.Kernel +public import Mathlib.MeasureTheory.Constructions.Pi +public import Mathlib.MeasureTheory.Group.Convolution /-! # Independence of sets of sets and measure spaces (σ-algebras) @@ -73,6 +75,8 @@ when defining `μ` in the example above, the measurable space used is the last o Part A, Chapter 4. -/ +@[expose] public section + assert_not_exists MeasureTheory.Integrable open MeasureTheory MeasurableSpace Set diff --git a/Mathlib/Probability/Independence/BoundedContinuousFunction.lean b/Mathlib/Probability/Independence/BoundedContinuousFunction.lean index 7541b5d9e42f65..c04b02cde8222a 100644 --- a/Mathlib/Probability/Independence/BoundedContinuousFunction.lean +++ b/Mathlib/Probability/Independence/BoundedContinuousFunction.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Measure.HasOuterApproxClosedProd -import Mathlib.Probability.Independence.Process -import Mathlib.Probability.Notation +module + +public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosedProd +public import Mathlib.Probability.Independence.Process +public import Mathlib.Probability.Notation /-! # Characterizing independence via bounded continuous functions @@ -43,23 +45,25 @@ function `f : (Π s : I, E s) → ℝ`, we have `∫ ω in A, f (X · ω) ∂P = This again is formulated with different versions. We also provide versions in terms of `IndepSets` instead of `Indep`. -# Main statement +## Main statement * `indep_comap_process_of_bcf`: A `σ`-algebra `m` is independent from a stochastic process `X` if for any `A` such that `MeasurableSet[m] A`, any `I : Finset S`, and any bounded continuous function `f : (Π s : I, E s) → ℝ`, we have `∫ ω in A, f (X · ω) ∂P = P.real A * ∫ ω, f (X · ω) ∂P`. -# Notations +## Notations to avoid writing `boundedContinuousFunction` in the names, which is quite lengthy, we abbreviate it to `bcf`. -# Tags +## Tags independence, bounded continuous functions -/ +@[expose] public section + open MeasureTheory Measure ProbabilityTheory ENNReal open scoped BoundedContinuousFunction diff --git a/Mathlib/Probability/Independence/CharacteristicFunction.lean b/Mathlib/Probability/Independence/CharacteristicFunction.lean index 819692c7ce830e..30063f445197b0 100644 --- a/Mathlib/Probability/Independence/CharacteristicFunction.lean +++ b/Mathlib/Probability/Independence/CharacteristicFunction.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Measure.CharacteristicFunction -import Mathlib.Probability.Independence.Basic +module + +public import Mathlib.MeasureTheory.Measure.CharacteristicFunction +public import Mathlib.Probability.Independence.Basic /-! # Links between independence and characteristic function @@ -15,6 +17,8 @@ two variables and a finite family of variables. We prove the analoguous statemen with an arbitrary Lp norm, for the dual characteristic function. -/ +@[expose] public section + namespace ProbabilityTheory open MeasureTheory WithLp diff --git a/Mathlib/Probability/Independence/Conditional.lean b/Mathlib/Probability/Independence/Conditional.lean index 5ec4147e5caef6..d4a4d93af6fe78 100644 --- a/Mathlib/Probability/Independence/Conditional.lean +++ b/Mathlib/Probability/Independence/Conditional.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Independence.Kernel -import Mathlib.Probability.Kernel.CompProdEqIff -import Mathlib.Probability.Kernel.Composition.Lemmas -import Mathlib.Probability.Kernel.Condexp +module + +public import Mathlib.Probability.Independence.Kernel +public import Mathlib.Probability.Kernel.CompProdEqIff +public import Mathlib.Probability.Kernel.Composition.Lemmas +public import Mathlib.Probability.Kernel.Condexp /-! # Conditional Independence @@ -60,6 +62,8 @@ The kernel used is `ProbabilityTheory.condExpKernel`. -/ +@[expose] public section + open MeasureTheory MeasurableSpace open scoped MeasureTheory ENNReal diff --git a/Mathlib/Probability/Independence/InfinitePi.lean b/Mathlib/Probability/Independence/InfinitePi.lean index 9985d5cb7b44e3..e3d0e05f1a2bf7 100644 --- a/Mathlib/Probability/Independence/InfinitePi.lean +++ b/Mathlib/Probability/Independence/InfinitePi.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Probability.Independence.Basic -import Mathlib.Probability.ProductMeasure +module + +public import Mathlib.Probability.Independence.Basic +public import Mathlib.Probability.ProductMeasure /-! # Independence of an infinite family of random variables @@ -23,6 +25,8 @@ Although the first two options are equivalent, the last two are not if the index countable. -/ +@[expose] public section + open MeasureTheory Measure ProbabilityTheory namespace ProbabilityTheory @@ -49,7 +53,7 @@ lemma iIndepFun_iff_map_fun_eq_infinitePi_map₀ (mX : AEMeasurable (fun ω i exact fun i ↦ mX.eval i any_goals fun_prop · exact mX - · exact .univ_pi fun i ↦ ht i i.2 + · exact .univ_pi fun i ↦ ht i mpr h := by have _ i := isProbabilityMeasure_map (mX.eval i) rw [iIndepFun_iff_finset] diff --git a/Mathlib/Probability/Independence/Integrable.lean b/Mathlib/Probability/Independence/Integrable.lean index 15ae8bab5aba8d..e4448fe735cbb9 100644 --- a/Mathlib/Probability/Independence/Integrable.lean +++ b/Mathlib/Probability/Independence/Integrable.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.MeasureTheory.Function.L1Space.Integrable -import Mathlib.Probability.Independence.Basic +module + +public import Mathlib.MeasureTheory.Function.L1Space.Integrable +public import Mathlib.Probability.Independence.Basic /-! # Independence of functions implies that the measure is a probability measure @@ -14,6 +16,8 @@ of another function, then the space is a probability space. -/ +@[expose] public section + open Filter ProbabilityTheory open scoped ENNReal NNReal Topology diff --git a/Mathlib/Probability/Independence/Integration.lean b/Mathlib/Probability/Independence/Integration.lean index 4dfc5e6486618b..8756e1d526865e 100644 --- a/Mathlib/Probability/Independence/Integration.lean +++ b/Mathlib/Probability/Independence/Integration.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Martin Zinkevich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Zinkevich, Vincent Beffara, Etienne Marion -/ -import Mathlib.MeasureTheory.Integral.Pi -import Mathlib.Probability.Independence.Integrable -import Mathlib.Probability.Notation +module + +public import Mathlib.MeasureTheory.Integral.Pi +public import Mathlib.Probability.Independence.Integrable +public import Mathlib.Probability.Notation /-! # Integration in Probability Theory @@ -27,6 +29,8 @@ example [M1 : MeasurableSpace Ω] {M2 : MeasurableSpace Ω} {μ : Measure Ω} : -/ +@[expose] public section + open Set MeasureTheory diff --git a/Mathlib/Probability/Independence/Kernel.lean b/Mathlib/Probability/Independence/Kernel.lean index 714942f5f1a662..dc0b0dabe7ba91 100644 --- a/Mathlib/Probability/Independence/Kernel.lean +++ b/Mathlib/Probability/Independence/Kernel.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.ConditionalProbability -import Mathlib.Probability.Kernel.Basic -import Mathlib.Probability.Kernel.Composition.MeasureComp -import Mathlib.Tactic.Peel -import Mathlib.MeasureTheory.MeasurableSpace.Pi +module + +public import Mathlib.Probability.ConditionalProbability +public import Mathlib.Probability.Kernel.Basic +public import Mathlib.Probability.Kernel.Composition.MeasureComp +public import Mathlib.Tactic.Peel +public import Mathlib.MeasureTheory.MeasurableSpace.Pi /-! # Independence with respect to a kernel and a measure @@ -46,6 +48,8 @@ definitions in the particular case of the usual independence notion. * `ProbabilityTheory.Kernel.IndepSets.Indep`: variant with two π-systems. -/ +@[expose] public section + open Set MeasureTheory MeasurableSpace open scoped MeasureTheory ENNReal @@ -428,16 +432,10 @@ theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace rcases Finset.mem_insert.mp hx with hx | hx · simp [hx, ht₁] · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂] - have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true] - have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false] have h_inter : ⋂ (t : ι) (_ : t ∈ ({i, j} : Finset ι)), ite (t = i) t₁ t₂ = ite (i = i) t₁ t₂ ∩ ite (j = i) t₁ t₂ := by simp only [Finset.set_biInter_singleton, Finset.set_biInter_insert] filter_upwards [h_indep {i, j} hf_m] with a h_indep' - have h_prod : (∏ t ∈ ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂)) - = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by - simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff, - Finset.mem_singleton] grind theorem iIndep.indep {m : ι → MeasurableSpace Ω} {_mΩ : MeasurableSpace Ω} diff --git a/Mathlib/Probability/Independence/Process.lean b/Mathlib/Probability/Independence/Process.lean index 7b44bf23fe631e..519b2a95f22990 100644 --- a/Mathlib/Probability/Independence/Process.lean +++ b/Mathlib/Probability/Independence/Process.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Constructions.Cylinders -import Mathlib.Probability.Independence.Basic +module + +public import Mathlib.MeasureTheory.Constructions.Cylinders +public import Mathlib.Probability.Independence.Basic /-! # Independence of stochastic processes @@ -22,6 +24,8 @@ We prove an analogous condition for a family of stochastic processes. independence, stochastic processes -/ +@[expose] public section + open MeasureTheory MeasurableSpace namespace ProbabilityTheory diff --git a/Mathlib/Probability/Independence/ZeroOne.lean b/Mathlib/Probability/Independence/ZeroOne.lean index 8cd601fba4bae3..e64411e8a0355d 100644 --- a/Mathlib/Probability/Independence/ZeroOne.lean +++ b/Mathlib/Probability/Independence/ZeroOne.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Independence.Basic -import Mathlib.Probability.Independence.Conditional +module + +public import Mathlib.Probability.Independence.Basic +public import Mathlib.Probability.Independence.Conditional /-! # Kolmogorov's 0-1 law @@ -19,6 +21,8 @@ is measurable with respect to the tail σ-algebra `limsup s atTop` has probabili σ-algebras `s` has probability 0 or 1. -/ +@[expose] public section + open MeasureTheory MeasurableSpace open scoped MeasureTheory ENNReal diff --git a/Mathlib/Probability/Integration.lean b/Mathlib/Probability/Integration.lean index 7d90fd85030cb7..0806fbbe84d8b0 100644 --- a/Mathlib/Probability/Integration.lean +++ b/Mathlib/Probability/Integration.lean @@ -3,6 +3,8 @@ Copyright (c) 2021 Martin Zinkevich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Martin Zinkevich, Vincent Beffara -/ -import Mathlib.Probability.Independence.Integration +module + +public import Mathlib.Probability.Independence.Integration deprecated_module (since := "2025-07-30") diff --git a/Mathlib/Probability/Kernel/Basic.lean b/Mathlib/Probability/Kernel/Basic.lean index 1b22571807f8fd..1d218fb2f3dfb3 100644 --- a/Mathlib/Probability/Kernel/Basic.lean +++ b/Mathlib/Probability/Kernel/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Defs +module + +public import Mathlib.Probability.Kernel.Defs /-! # Basic kernels @@ -36,6 +38,8 @@ kernels. -/ +@[expose] public section + assert_not_exists MeasureTheory.integral open MeasureTheory diff --git a/Mathlib/Probability/Kernel/CompProdEqIff.lean b/Mathlib/Probability/Kernel/CompProdEqIff.lean index a2f5c7ec230e34..08e1b4012161d3 100644 --- a/Mathlib/Probability/Kernel/CompProdEqIff.lean +++ b/Mathlib/Probability/Kernel/CompProdEqIff.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.AbsolutelyContinuous +module + +public import Mathlib.Probability.Kernel.Composition.AbsolutelyContinuous /-! # Condition for two kernels to be equal almost everywhere @@ -19,6 +21,8 @@ The result requires `α` to be countable or `β` to be a countably generated mea -/ +@[expose] public section + open ProbabilityTheory MeasureTheory open scoped ENNReal diff --git a/Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean b/Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean index 5397b31e0bacc0..1e87bb34a6eaf2 100644 --- a/Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean +++ b/Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Probability.Kernel.Composition.MeasureCompProd -import Mathlib.Probability.Kernel.RadonNikodym +module + +public import Mathlib.Probability.Kernel.Composition.MeasureCompProd +public import Mathlib.Probability.Kernel.RadonNikodym /-! # Absolute continuity of the composition of measures and kernels @@ -25,6 +27,8 @@ or mutually singular. -/ +@[expose] public section + open ProbabilityTheory Filter open scoped ENNReal diff --git a/Mathlib/Probability/Kernel/Composition/Comp.lean b/Mathlib/Probability/Kernel/Composition/Comp.lean index b454e892a082ee..8b450e250ff614 100644 --- a/Mathlib/Probability/Kernel/Composition/Comp.lean +++ b/Mathlib/Probability/Kernel/Composition/Comp.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Etienne Marion -/ -import Mathlib.Probability.Kernel.MeasurableLIntegral +module + +public import Mathlib.Probability.Kernel.MeasurableLIntegral /-! # Composition of kernels @@ -29,6 +31,8 @@ a kernel from `α` to `γ`. -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/Kernel/Composition/CompMap.lean b/Mathlib/Probability/Kernel/Composition/CompMap.lean index 3f33740c2c22e6..090d9be91a6635 100644 --- a/Mathlib/Probability/Kernel/Composition/CompMap.lean +++ b/Mathlib/Probability/Kernel/Composition/CompMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.Comp -import Mathlib.Probability.Kernel.Composition.MapComap +module + +public import Mathlib.Probability.Kernel.Composition.Comp +public import Mathlib.Probability.Kernel.Composition.MapComap /-! # Lemmas about compositions and maps of kernels @@ -17,6 +19,8 @@ a deterministic kernel. See `deterministic_comp_eq_map` and `comp_deterministic_ -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/Kernel/Composition/CompNotation.lean b/Mathlib/Probability/Kernel/Composition/CompNotation.lean index 73af5ee6814479..4798c34fdb40a3 100644 --- a/Mathlib/Probability/Kernel/Composition/CompNotation.lean +++ b/Mathlib/Probability/Kernel/Composition/CompNotation.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Probability.Kernel.Basic +module + +public import Mathlib.Probability.Kernel.Basic /-! # Notation for the composition of a measure and a kernel @@ -20,6 +22,8 @@ This file does not define composition but only introduces notation for * `κ ∘ₘ μ = MeasureTheory.Measure.bind μ κ`, for `κ` a kernel. -/ +@[expose] public section + /- This file is only for lemmas that are direct specializations of `Measure.bind` to kernels, anything more involved should go elsewhere (for example the `MeasureComp` file). -/ assert_not_exists ProbabilityTheory.Kernel.compProd diff --git a/Mathlib/Probability/Kernel/Composition/CompProd.lean b/Mathlib/Probability/Kernel/Composition/CompProd.lean index 60240c3ebeca9d..78b8634917ace9 100644 --- a/Mathlib/Probability/Kernel/Composition/CompProd.lean +++ b/Mathlib/Probability/Kernel/Composition/CompProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.Comp -import Mathlib.Probability.Kernel.Composition.ParallelComp +module + +public import Mathlib.Probability.Kernel.Composition.Comp +public import Mathlib.Probability.Kernel.Composition.ParallelComp /-! # Composition-product of kernels @@ -36,6 +38,8 @@ that convention because it fits better with the use of the name `comp` elsewhere -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean b/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean index a8485493393e33..720d2ea29b6995 100644 --- a/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean +++ b/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Etienne Marion -/ -import Mathlib.Probability.Kernel.Composition.MeasureComp -import Mathlib.Probability.Kernel.MeasurableIntegral +module + +public import Mathlib.Probability.Kernel.Composition.MeasureComp +public import Mathlib.Probability.Kernel.MeasurableIntegral /-! # Bochner integral of a function against the composition and the composition-products of two kernels @@ -44,6 +46,8 @@ composition-product. However it is necessary to do all the proofs once again bec composition-product requires s-finiteness while the composition does not. -/ +@[expose] public section + noncomputable section @@ -326,6 +330,14 @@ theorem integrable_comp_iff ⦃f : γ → E⦄ (hf : AEStronglyMeasurable f ((η simp only [Integrable, hf, hasFiniteIntegral_comp_iff' hf, true_and, eventually_and, hf.comp, hf.norm.integral_kernel_comp] +protected lemma _root_.MeasureTheory.Measure.integrable_comp_iff {μ : Measure α} {f : β → E} + (hf : AEStronglyMeasurable f (κ ∘ₘ μ)) : + Integrable f (κ ∘ₘ μ) + ↔ (∀ᵐ x ∂μ, Integrable f (κ x)) ∧ Integrable (fun x ↦ ∫ y, ‖f y‖ ∂κ x) μ := by + rw [Measure.comp_eq_comp_const_apply, ProbabilityTheory.integrable_comp_iff] + · simp + · simpa [Kernel.comp_apply] + theorem _root_.MeasureTheory.Integrable.ae_of_comp ⦃f : γ → E⦄ (hf : Integrable f ((η ∘ₖ κ) a)) : ∀ᵐ x ∂κ a, Integrable f (η x) := ((integrable_comp_iff hf.1).1 hf).1 diff --git a/Mathlib/Probability/Kernel/Composition/KernelLemmas.lean b/Mathlib/Probability/Kernel/Composition/KernelLemmas.lean index ee5fec6a49b80e..699321a768edc6 100644 --- a/Mathlib/Probability/Kernel/Composition/KernelLemmas.lean +++ b/Mathlib/Probability/Kernel/Composition/KernelLemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Probability.Kernel.Composition.CompProd -import Mathlib.Probability.Kernel.Composition.Prod +module + +public import Mathlib.Probability.Kernel.Composition.CompProd +public import Mathlib.Probability.Kernel.Composition.Prod /-! # Lemmas relating different ways to compose kernels @@ -22,6 +24,8 @@ compositions/products. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/Composition/Lemmas.lean b/Mathlib/Probability/Kernel/Composition/Lemmas.lean index e8c52142e864be..201f3f98df8327 100644 --- a/Mathlib/Probability/Kernel/Composition/Lemmas.lean +++ b/Mathlib/Probability/Kernel/Composition/Lemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Probability.Kernel.Composition.MeasureComp +module + +public import Mathlib.Probability.Kernel.Composition.MeasureComp /-! # Lemmas relating different ways to compose measures and kernels @@ -13,6 +15,8 @@ the other files in this directory, because they involve several types of composi -/ +@[expose] public section + open MeasureTheory ProbabilityTheory open scoped ENNReal diff --git a/Mathlib/Probability/Kernel/Composition/MapComap.lean b/Mathlib/Probability/Kernel/Composition/MapComap.lean index 496c11ed708e17..9e1e9c19e5204d 100644 --- a/Mathlib/Probability/Kernel/Composition/MapComap.lean +++ b/Mathlib/Probability/Kernel/Composition/MapComap.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Probability.Kernel.Basic +module + +public import Mathlib.Probability.Kernel.Basic /-! # Map of a kernel by a measurable function @@ -26,6 +28,8 @@ Kernels built from other kernels: -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/Kernel/Composition/MeasureComp.lean b/Mathlib/Probability/Kernel/Composition/MeasureComp.lean index eb7b17eb70c065..81bf2b2cfb4af6 100644 --- a/Mathlib/Probability/Kernel/Composition/MeasureComp.lean +++ b/Mathlib/Probability/Kernel/Composition/MeasureComp.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.Probability.Kernel.Composition.CompNotation -import Mathlib.Probability.Kernel.Composition.KernelLemmas -import Mathlib.Probability.Kernel.Composition.MeasureCompProd +module + +public import Mathlib.Probability.Kernel.Composition.CompNotation +public import Mathlib.Probability.Kernel.Composition.KernelLemmas +public import Mathlib.Probability.Kernel.Composition.MeasureCompProd /-! # Lemmas about the composition of a measure and a kernel @@ -14,6 +16,8 @@ Basic lemmas about the composition `κ ∘ₘ μ` of a kernel `κ` and a measure -/ +@[expose] public section + open scoped ENNReal open ProbabilityTheory MeasureTheory diff --git a/Mathlib/Probability/Kernel/Composition/MeasureCompProd.lean b/Mathlib/Probability/Kernel/Composition/MeasureCompProd.lean index c55f51ee0db8f5..9f3f6304109497 100644 --- a/Mathlib/Probability/Kernel/Composition/MeasureCompProd.lean +++ b/Mathlib/Probability/Kernel/Composition/MeasureCompProd.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.Probability.Kernel.Composition.CompProd +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.Probability.Kernel.Composition.CompProd /-! # Composition-Product of a measure and a kernel @@ -25,6 +27,8 @@ This operation, denoted by `⊗ₘ`, takes `μ : Measure α` and `κ : Kernel α * `μ ⊗ₘ κ = μ.compProd κ` -/ +@[expose] public section + open scoped ENNReal open ProbabilityTheory Set diff --git a/Mathlib/Probability/Kernel/Composition/ParallelComp.lean b/Mathlib/Probability/Kernel/Composition/ParallelComp.lean index 3f2149af9499be..03adfbaa8995d6 100644 --- a/Mathlib/Probability/Kernel/Composition/ParallelComp.lean +++ b/Mathlib/Probability/Kernel/Composition/ParallelComp.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Lorenzo Luccioli -/ -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.Probability.Kernel.Composition.MapComap -import Mathlib.Probability.Kernel.MeasurableLIntegral +module + +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.Probability.Kernel.Composition.MapComap +public import Mathlib.Probability.Kernel.MeasurableLIntegral /-! @@ -26,6 +28,8 @@ Two kernels `κ : Kernel α β` and `η : Kernel γ δ` can be applied in parall -/ +@[expose] public section + open MeasureTheory open scoped ENNReal diff --git a/Mathlib/Probability/Kernel/Composition/Prod.lean b/Mathlib/Probability/Kernel/Composition/Prod.lean index 93c79d85332179..4c2ca33414e800 100644 --- a/Mathlib/Probability/Kernel/Composition/Prod.lean +++ b/Mathlib/Probability/Kernel/Composition/Prod.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.CompMap -import Mathlib.Probability.Kernel.Composition.ParallelComp +module + +public import Mathlib.Probability.Kernel.Composition.CompMap +public import Mathlib.Probability.Kernel.Composition.ParallelComp /-! # Product and composition of kernels @@ -29,6 +31,8 @@ a kernel from `α` to `β × γ`. -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/Kernel/CondDistrib.lean b/Mathlib/Probability/Kernel/CondDistrib.lean index 094c0fb961a550..774b4bcd076c8b 100644 --- a/Mathlib/Probability/Kernel/CondDistrib.lean +++ b/Mathlib/Probability/Kernel/CondDistrib.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.Lemmas -import Mathlib.Probability.Kernel.Disintegration.Unique +module + +public import Mathlib.Probability.Kernel.Composition.Lemmas +public import Mathlib.Probability.Kernel.Disintegration.Unique /-! # Regular conditional probability distribution @@ -40,6 +42,8 @@ to `m`. -/ +@[expose] public section + open MeasureTheory Set Filter TopologicalSpace diff --git a/Mathlib/Probability/Kernel/Condexp.lean b/Mathlib/Probability/Kernel/Condexp.lean index 52f856485ce24e..df26f4f30cb862 100644 --- a/Mathlib/Probability/Kernel/Condexp.lean +++ b/Mathlib/Probability/Kernel/Condexp.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.MeasureComp -import Mathlib.Probability.Kernel.CondDistrib -import Mathlib.Probability.ConditionalProbability +module + +public import Mathlib.Probability.Kernel.Composition.MeasureComp +public import Mathlib.Probability.Kernel.CondDistrib +public import Mathlib.Probability.ConditionalProbability /-! # Kernel associated with a conditional expectation @@ -30,6 +32,8 @@ on `Ω` allows us to do so. -/ +@[expose] public section + open MeasureTheory Set Filter TopologicalSpace diff --git a/Mathlib/Probability/Kernel/Defs.lean b/Mathlib/Probability/Kernel/Defs.lean index f8ee124fb30423..0ce9704c4f2697 100644 --- a/Mathlib/Probability/Kernel/Defs.lean +++ b/Mathlib/Probability/Kernel/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.GiryMonad +module + +public import Mathlib.MeasureTheory.Measure.GiryMonad /-! # Markov Kernels @@ -36,6 +38,8 @@ Classes of kernels: -/ +@[expose] public section + assert_not_exists MeasureTheory.integral open MeasureTheory diff --git a/Mathlib/Probability/Kernel/Disintegration/Basic.lean b/Mathlib/Probability/Kernel/Disintegration/Basic.lean index a19616471a8dbd..1d7e289ce314eb 100644 --- a/Mathlib/Probability/Kernel/Disintegration/Basic.lean +++ b/Mathlib/Probability/Kernel/Disintegration/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies, Kin Yau James Wong. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Kin Yau James Wong, Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.AEEqOfLIntegral -import Mathlib.Probability.Kernel.Composition.MeasureCompProd +module + +public import Mathlib.MeasureTheory.Function.AEEqOfLIntegral +public import Mathlib.Probability.Kernel.Composition.MeasureCompProd /-! # Disintegration of measures and kernels @@ -35,6 +37,8 @@ disintegrated by some kernel, then `κ` itself is disintegrated by a kernel, nam disintegrating kernels. -/ +@[expose] public section + open MeasureTheory Set Filter MeasurableSpace ProbabilityTheory open scoped ENNReal MeasureTheory Topology diff --git a/Mathlib/Probability/Kernel/Disintegration/CDFToKernel.lean b/Mathlib/Probability/Kernel/Disintegration/CDFToKernel.lean index 6ef535add672b8..ab66389c7ab5e0 100644 --- a/Mathlib/Probability/Kernel/Disintegration/CDFToKernel.lean +++ b/Mathlib/Probability/Kernel/Disintegration/CDFToKernel.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.AEEqOfIntegral -import Mathlib.Probability.Kernel.Composition.CompProd -import Mathlib.Probability.Kernel.Disintegration.MeasurableStieltjes +module + +public import Mathlib.MeasureTheory.Function.AEEqOfIntegral +public import Mathlib.Probability.Kernel.Composition.CompProd +public import Mathlib.Probability.Kernel.Disintegration.MeasurableStieltjes /-! # Building a Markov kernel from a conditional cumulative distribution function @@ -45,6 +47,8 @@ Let `κ : Kernel α (β × ℝ)` and `ν : Kernel α β`. -/ +@[expose] public section + open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/Disintegration/CondCDF.lean b/Mathlib/Probability/Kernel/Disintegration/CondCDF.lean index 1c07ea176d071f..69d0133f6f1b49 100644 --- a/Mathlib/Probability/Kernel/Disintegration/CondCDF.lean +++ b/Mathlib/Probability/Kernel/Disintegration/CondCDF.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -import Mathlib.MeasureTheory.Measure.Prod -import Mathlib.Probability.Kernel.Disintegration.CDFToKernel +module + +public import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.Probability.Kernel.Disintegration.CDFToKernel /-! # Conditional cumulative distribution function @@ -37,6 +39,8 @@ easily. Here we apply that construction to the case `β = Unit` and then drop ` -/ +@[expose] public section + open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology diff --git a/Mathlib/Probability/Kernel/Disintegration/Density.lean b/Mathlib/Probability/Kernel/Disintegration/Density.lean index 1a8b9af258154d..bea6a2ddf9e075 100644 --- a/Mathlib/Probability/Kernel/Disintegration/Density.lean +++ b/Mathlib/Probability/Kernel/Disintegration/Density.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.MapComap -import Mathlib.Probability.Martingale.Convergence -import Mathlib.Probability.Process.PartitionFiltration +module + +public import Mathlib.Probability.Kernel.Composition.MapComap +public import Mathlib.Probability.Martingale.Convergence +public import Mathlib.Probability.Process.PartitionFiltration /-! # Kernel density @@ -75,6 +77,8 @@ The construction of the density process in this file follows the proof of Theore generated hypothesis instead of specializing to `ℝ`. -/ +@[expose] public section + open MeasureTheory Set Filter MeasurableSpace open scoped NNReal ENNReal MeasureTheory Topology ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/Disintegration/Integral.lean b/Mathlib/Probability/Kernel/Disintegration/Integral.lean index a31ff181c79a08..0f7ea6bc8ca89c 100644 --- a/Mathlib/Probability/Kernel/Disintegration/Integral.lean +++ b/Mathlib/Probability/Kernel/Disintegration/Integral.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.IntegralCompProd -import Mathlib.Probability.Kernel.Disintegration.StandardBorel +module + +public import Mathlib.Probability.Kernel.Composition.IntegralCompProd +public import Mathlib.Probability.Kernel.Disintegration.StandardBorel /-! # Lebesgue and Bochner integrals of conditional kernels @@ -23,6 +25,8 @@ Corresponding statements for the Lebesgue integral and/or without the sets `s` a provided. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory MeasurableSpace open scoped ENNReal diff --git a/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean b/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean index b31bb49383e27a..4e18b7814a1275 100644 --- a/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean +++ b/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.GiryMonad -import Mathlib.MeasureTheory.Measure.Stieltjes -import Mathlib.Analysis.Normed.Order.Lattice -import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic +module + +public import Mathlib.MeasureTheory.Measure.GiryMonad +public import Mathlib.MeasureTheory.Measure.Stieltjes +public import Mathlib.Analysis.Normed.Order.Lattice +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic /-! # Measurable parametric Stieltjes functions @@ -41,6 +43,8 @@ Finally, we define `stieltjesOfMeasurableRat`, composition of `toRatCDF` and -/ +@[expose] public section + open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology diff --git a/Mathlib/Probability/Kernel/Disintegration/StandardBorel.lean b/Mathlib/Probability/Kernel/Disintegration/StandardBorel.lean index a78fae89f678e6..388c41e982fa51 100644 --- a/Mathlib/Probability/Kernel/Disintegration/StandardBorel.lean +++ b/Mathlib/Probability/Kernel/Disintegration/StandardBorel.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Composition.MeasureCompProd -import Mathlib.Probability.Kernel.Disintegration.Basic -import Mathlib.Probability.Kernel.Disintegration.CondCDF -import Mathlib.Probability.Kernel.Disintegration.Density -import Mathlib.Probability.Kernel.Disintegration.CDFToKernel -import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal +module + +public import Mathlib.Probability.Kernel.Composition.MeasureCompProd +public import Mathlib.Probability.Kernel.Disintegration.Basic +public import Mathlib.Probability.Kernel.Disintegration.CondCDF +public import Mathlib.Probability.Kernel.Disintegration.Density +public import Mathlib.Probability.Kernel.Disintegration.CDFToKernel +public import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal /-! # Existence of disintegration of measures and kernels for standard Borel spaces @@ -62,6 +64,8 @@ The conditional kernel is unique (almost everywhere w.r.t. `fst κ`): this is pr * `MeasureTheory.Measure.compProd_fst_condKernel`: `ρ.fst ⊗ₘ ρ.condKernel = ρ` -/ +@[expose] public section + open MeasureTheory Set Filter MeasurableSpace open scoped ENNReal MeasureTheory Topology ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/Disintegration/Unique.lean b/Mathlib/Probability/Kernel/Disintegration/Unique.lean index e2af5205fe1f66..555fd713ee869c 100644 --- a/Mathlib/Probability/Kernel/Disintegration/Unique.lean +++ b/Mathlib/Probability/Kernel/Disintegration/Unique.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Rémy Degenne -/ -import Mathlib.Probability.Kernel.Disintegration.Integral +module + +public import Mathlib.Probability.Kernel.Disintegration.Integral /-! # Uniqueness of the conditional kernel @@ -21,6 +23,8 @@ We prove that the conditional kernels `ProbabilityTheory.Kernel.condKernel` and everywhere equal to the measure `condKernel`. -/ +@[expose] public section + open MeasureTheory Set Filter MeasurableSpace open scoped ENNReal MeasureTheory Topology ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/Integral.lean b/Mathlib/Probability/Kernel/Integral.lean index 81e7ff88d03b8f..f3c92f690f4101 100644 --- a/Mathlib/Probability/Kernel/Integral.lean +++ b/Mathlib/Probability/Kernel/Integral.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Probability.Kernel.Basic +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Probability.Kernel.Basic /-! # Bochner integrals of kernels -/ +@[expose] public section + open MeasureTheory namespace ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/Invariance.lean b/Mathlib/Probability/Kernel/Invariance.lean index 549463a29bb4e6..fe8d19bce2a9f1 100644 --- a/Mathlib/Probability/Kernel/Invariance.lean +++ b/Mathlib/Probability/Kernel/Invariance.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Matteo Cipollina -/ -import Mathlib.Probability.Kernel.Composition.MeasureComp +module + +public import Mathlib.Probability.Kernel.Composition.MeasureComp /-! # Invariance of measures along a kernel @@ -17,6 +19,8 @@ kernel `μ.bind κ` is the same measure. -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean b/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean index a40e8112e60f7b..ec108c8e91afb2 100644 --- a/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean +++ b/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.MeasurableSpace.Embedding -import Mathlib.Order.Restriction +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Embedding +public import Mathlib.Order.Restriction /-! # Auxiliary maps for Ionescu-Tulcea theorem This file contains auxiliary maps which are used to prove the Ionescu-Tulcea theorem. -/ +@[expose] public section + open Finset Preorder section Definitions diff --git a/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean b/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean index 72284a2c7ec12f..b27e84589fe6b6 100644 --- a/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean +++ b/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.MeasurableSpace.PreorderRestrict -import Mathlib.Probability.Kernel.Composition.Prod -import Mathlib.Probability.Kernel.IonescuTulcea.Maps +module + +public import Mathlib.MeasureTheory.MeasurableSpace.PreorderRestrict +public import Mathlib.Probability.Kernel.Composition.Prod +public import Mathlib.Probability.Kernel.IonescuTulcea.Maps /-! # Consecutive composition of kernels @@ -68,6 +70,8 @@ against `partialTraj κ a b`, taking inspiration from `MeasureTheory.lmarginal`. Ionescu-Tulcea theorem, composition of kernels -/ +@[expose] public section + open Finset Function MeasureTheory Preorder ProbabilityTheory open scoped ENNReal diff --git a/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean b/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean index f94496e6ccc70f..8fd880f8de55b2 100644 --- a/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean +++ b/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Constructions.ProjectiveFamilyContent -import Mathlib.MeasureTheory.Function.FactorsThrough -import Mathlib.MeasureTheory.Measure.ProbabilityMeasure -import Mathlib.MeasureTheory.OuterMeasure.OfAddContent -import Mathlib.Probability.Kernel.Composition.IntegralCompProd -import Mathlib.Probability.Kernel.IonescuTulcea.PartialTraj -import Mathlib.Probability.Kernel.SetIntegral +module + +public import Mathlib.MeasureTheory.Constructions.ProjectiveFamilyContent +public import Mathlib.MeasureTheory.Function.FactorsThrough +public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure +public import Mathlib.MeasureTheory.OuterMeasure.OfAddContent +public import Mathlib.Probability.Kernel.Composition.IntegralCompProd +public import Mathlib.Probability.Kernel.IonescuTulcea.PartialTraj +public import Mathlib.Probability.Kernel.SetIntegral /-! # Ionescu-Tulcea theorem @@ -72,6 +74,8 @@ see Proposition 10.6.1 in [D. L. Cohn, *Measure Theory*][cohn2013measure]. Ionescu-Tulcea theorem -/ +@[expose] public section + open Filter Finset Function MeasurableEquiv MeasurableSpace MeasureTheory Preorder ProbabilityTheory open scoped ENNReal Topology diff --git a/Mathlib/Probability/Kernel/MeasurableIntegral.lean b/Mathlib/Probability/Kernel/MeasurableIntegral.lean index 218ce4c4213ecb..ccd486bf75061c 100644 --- a/Mathlib/Probability/Kernel/MeasurableIntegral.lean +++ b/Mathlib/Probability/Kernel/MeasurableIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.Probability.Kernel.MeasurableLIntegral +module + +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.Probability.Kernel.MeasurableLIntegral /-! # Measurability of the integral against a kernel @@ -19,6 +21,8 @@ The Bochner integral of a strongly measurable function against a kernel is stron -/ +@[expose] public section + open MeasureTheory ProbabilityTheory Function Set Filter diff --git a/Mathlib/Probability/Kernel/MeasurableLIntegral.lean b/Mathlib/Probability/Kernel/MeasurableLIntegral.lean index 922262cd459a73..c5e85faf1b7b57 100644 --- a/Mathlib/Probability/Kernel/MeasurableLIntegral.lean +++ b/Mathlib/Probability/Kernel/MeasurableLIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.MeasurableSpace.Prod -import Mathlib.Probability.Kernel.Basic +module + +public import Mathlib.MeasureTheory.MeasurableSpace.Prod +public import Mathlib.Probability.Kernel.Basic /-! # Measurability of the integral against a kernel @@ -19,6 +21,8 @@ The Lebesgue integral of a measurable function against a kernel is measurable. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory Function Set Filter diff --git a/Mathlib/Probability/Kernel/Posterior.lean b/Mathlib/Probability/Kernel/Posterior.lean index 11c1e18b5cb6a0..db22e148f729be 100644 --- a/Mathlib/Probability/Kernel/Posterior.lean +++ b/Mathlib/Probability/Kernel/Posterior.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.CompProdEqIff -import Mathlib.Probability.Kernel.Composition.Lemmas -import Mathlib.Probability.Kernel.Disintegration.StandardBorel +module + +public import Mathlib.Probability.Kernel.CompProdEqIff +public import Mathlib.Probability.Kernel.Composition.Lemmas +public import Mathlib.Probability.Kernel.Disintegration.StandardBorel /-! @@ -48,6 +50,8 @@ denote `κ†`, but we have to also specify the measure `μ`. -/ +@[expose] public section + open scoped ENNReal open MeasureTheory diff --git a/Mathlib/Probability/Kernel/Proper.lean b/Mathlib/Probability/Kernel/Proper.lean index ad174aa8531bfe..0de6b80e4757be 100644 --- a/Mathlib/Probability/Kernel/Proper.lean +++ b/Mathlib/Probability/Kernel/Proper.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yaël Dillies, Kalle Kytölä, Kin Yau James Wong. All rights Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Kalle Kytölä, Kin Yau James Wong -/ -import Mathlib.Probability.Kernel.Composition.CompNotation +module + +public import Mathlib.Probability.Kernel.Composition.CompNotation /-! # Proper kernels @@ -25,6 +27,8 @@ event. Prove the `integral` versions of the `lintegral` lemmas below -/ +@[expose] public section + open MeasureTheory ENNReal NNReal Set open scoped ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/RadonNikodym.lean b/Mathlib/Probability/Kernel/RadonNikodym.lean index 8a0707db3f4fb5..54eca2d08897a0 100644 --- a/Mathlib/Probability/Kernel/RadonNikodym.lean +++ b/Mathlib/Probability/Kernel/RadonNikodym.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Disintegration.Density -import Mathlib.Probability.Kernel.WithDensity +module + +public import Mathlib.Probability.Kernel.Disintegration.Density +public import Mathlib.Probability.Kernel.WithDensity /-! # Radon-Nikodym derivative and Lebesgue decomposition for kernels @@ -68,6 +70,8 @@ Theorem 1.28 in [O. Kallenberg, Random Measures, Theory and Applications][kallen -/ +@[expose] public section + open MeasureTheory Set Filter ENNReal open scoped NNReal MeasureTheory Topology ProbabilityTheory diff --git a/Mathlib/Probability/Kernel/SetIntegral.lean b/Mathlib/Probability/Kernel/SetIntegral.lean index 10afd47f147f52..a34762483376b2 100644 --- a/Mathlib/Probability/Kernel/SetIntegral.lean +++ b/Mathlib/Probability/Kernel/SetIntegral.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.MeasureTheory.Integral.Bochner.Set -import Mathlib.Probability.Kernel.Integral +module + +public import Mathlib.MeasureTheory.Integral.Bochner.Set +public import Mathlib.Probability.Kernel.Integral /-! # Integral against a kernel over a set @@ -12,6 +14,8 @@ This file contains lemmas about the integral against a kernel and over a set. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory namespace ProbabilityTheory.Kernel diff --git a/Mathlib/Probability/Kernel/WithDensity.lean b/Mathlib/Probability/Kernel/WithDensity.lean index 06e4bd3f24707c..514cde20bfc03e 100644 --- a/Mathlib/Probability/Kernel/WithDensity.lean +++ b/Mathlib/Probability/Kernel/WithDensity.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap -import Mathlib.Probability.Kernel.MeasurableLIntegral +module + +public import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +public import Mathlib.Probability.Kernel.MeasurableLIntegral /-! # With Density @@ -28,6 +30,8 @@ an s-finite kernel. -/ +@[expose] public section + open MeasureTheory ProbabilityTheory diff --git a/Mathlib/Probability/Martingale/Basic.lean b/Mathlib/Probability/Martingale/Basic.lean index 9d8c15abf9570a..f7ccc83df4a1d4 100644 --- a/Mathlib/Probability/Martingale/Basic.lean +++ b/Mathlib/Probability/Martingale/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Kexing Ying -/ -import Mathlib.Probability.Notation -import Mathlib.Probability.Process.Stopping -import Mathlib.Probability.Process.Predictable +module + +public import Mathlib.Probability.Notation +public import Mathlib.Probability.Process.Stopping +public import Mathlib.Probability.Process.Predictable /-! # Martingales @@ -36,6 +38,8 @@ The definitions of filtration and adapted can be found in `Probability.Process.S -/ +@[expose] public section + open TopologicalSpace Filter diff --git a/Mathlib/Probability/Martingale/BorelCantelli.lean b/Mathlib/Probability/Martingale/BorelCantelli.lean index d65102917a8dd4..86a1e0c4394741 100644 --- a/Mathlib/Probability/Martingale/BorelCantelli.lean +++ b/Mathlib/Probability/Martingale/BorelCantelli.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Algebra.Order.Archimedean.IndicatorCard -import Mathlib.Probability.Martingale.Centering -import Mathlib.Probability.Martingale.Convergence -import Mathlib.Probability.Martingale.OptionalStopping +module + +public import Mathlib.Algebra.Order.Archimedean.IndicatorCard +public import Mathlib.Probability.Martingale.Centering +public import Mathlib.Probability.Martingale.Convergence +public import Mathlib.Probability.Martingale.OptionalStopping /-! @@ -32,6 +34,8 @@ the results here), and `ProbabilityTheory.measure_limsup_eq_one` for the second -/ +@[expose] public section + open Filter diff --git a/Mathlib/Probability/Martingale/Centering.lean b/Mathlib/Probability/Martingale/Centering.lean index d72e7c8f3091e9..8ae809f59f8571 100644 --- a/Mathlib/Probability/Martingale/Centering.lean +++ b/Mathlib/Probability/Martingale/Centering.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Martingale.Basic +module + +public import Mathlib.Probability.Martingale.Basic /-! # Centering lemma for stochastic processes @@ -28,6 +30,8 @@ From a process `f`, a filtration `ℱ` and a measure `μ`, we define two process -/ +@[expose] public section + open TopologicalSpace Filter diff --git a/Mathlib/Probability/Martingale/Convergence.lean b/Mathlib/Probability/Martingale/Convergence.lean index 8c6f2c2f5fa4ad..62cf3fa14d0100 100644 --- a/Mathlib/Probability/Martingale/Convergence.lean +++ b/Mathlib/Probability/Martingale/Convergence.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.MeasureTheory.Constructions.Polish.Basic -import Mathlib.MeasureTheory.Function.UniformIntegrable -import Mathlib.Probability.Martingale.Upcrossing +module + +public import Mathlib.MeasureTheory.Constructions.Polish.Basic +public import Mathlib.MeasureTheory.Function.UniformIntegrable +public import Mathlib.Probability.Martingale.Upcrossing /-! @@ -41,6 +43,8 @@ theorems. -/ +@[expose] public section + open TopologicalSpace Filter MeasureTheory.Filtration diff --git a/Mathlib/Probability/Martingale/OptionalSampling.lean b/Mathlib/Probability/Martingale/OptionalSampling.lean index 0f03539cf6171e..5c333f03fe7166 100644 --- a/Mathlib/Probability/Martingale/OptionalSampling.lean +++ b/Mathlib/Probability/Martingale/OptionalSampling.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Order.SuccPred.LinearLocallyFinite -import Mathlib.Probability.Martingale.Basic +module + +public import Mathlib.Order.SuccPred.LinearLocallyFinite +public import Mathlib.Probability.Martingale.Basic /-! # Optional sampling theorem @@ -28,6 +30,8 @@ If `τ` is a bounded stopping time and `σ` is another stopping time, then the v -/ +@[expose] public section + open scoped MeasureTheory ENNReal diff --git a/Mathlib/Probability/Martingale/OptionalStopping.lean b/Mathlib/Probability/Martingale/OptionalStopping.lean index 8f055d8b5d2a9c..5b83d58fd3e5a2 100644 --- a/Mathlib/Probability/Martingale/OptionalStopping.lean +++ b/Mathlib/Probability/Martingale/OptionalStopping.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Probability.Process.HittingTime -import Mathlib.Probability.Martingale.Basic +module + +public import Mathlib.Probability.Process.HittingTime +public import Mathlib.Probability.Martingale.Basic /-! # Optional stopping theorem (fair game theorem) @@ -24,6 +26,8 @@ This file also contains Doob's maximal inequality: given a non-negative submarti -/ +@[expose] public section + open scoped NNReal ENNReal MeasureTheory ProbabilityTheory @@ -126,7 +130,7 @@ theorem smul_le_stoppedValue_hittingBtwn [IsFiniteMeasure μ] (hsub : Submarting exact let ⟨j, hj₁, hj₂⟩ := hx ⟨j, hj₁, hj₂⟩ - have h := setIntegral_ge_of_const_le (measurableSet_le measurable_const + have h := setIntegral_ge_of_const_le_real (measurableSet_le measurable_const (Finset.measurable_range_sup'' fun n _ => (hsub.stronglyMeasurable n).measurable.le (𝒢.le n))) (measure_ne_top _ _) this (Integrable.integrableOn (hsub.integrable_stoppedValue (hittingBtwn_isStoppingTime hsub.adapted measurableSet_Ici) (mod_cast hittingBtwn_le))) diff --git a/Mathlib/Probability/Martingale/Upcrossing.lean b/Mathlib/Probability/Martingale/Upcrossing.lean index f3c3674ad40ad6..2bfaf5f76a6a4b 100644 --- a/Mathlib/Probability/Martingale/Upcrossing.lean +++ b/Mathlib/Probability/Martingale/Upcrossing.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Order.Interval.Set.Monotone -import Mathlib.Probability.Process.HittingTime -import Mathlib.Probability.Martingale.Basic -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Order.Interval.Set.Monotone +public import Mathlib.Probability.Process.HittingTime +public import Mathlib.Probability.Martingale.Basic +public import Mathlib.Tactic.AdaptationNote /-! @@ -54,6 +56,8 @@ We mostly follow the proof from [Kallenberg, *Foundations of modern probability* -/ +@[expose] public section + open TopologicalSpace Filter diff --git a/Mathlib/Probability/Moments/Basic.lean b/Mathlib/Probability/Moments/Basic.lean index ae8105f4b297a2..76b958de35d872 100644 --- a/Mathlib/Probability/Moments/Basic.lean +++ b/Mathlib/Probability/Moments/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.IdentDistrib +module + +public import Mathlib.Probability.IdentDistrib /-! # Moments and moment-generating function @@ -35,6 +37,8 @@ import Mathlib.Probability.IdentDistrib of `cgf`. -/ +@[expose] public section + open MeasureTheory Filter Finset Real diff --git a/Mathlib/Probability/Moments/ComplexMGF.lean b/Mathlib/Probability/Moments/ComplexMGF.lean index f6fb458b7442a5..8165d88608b3e9 100644 --- a/Mathlib/Probability/Moments/ComplexMGF.lean +++ b/Mathlib/Probability/Moments/ComplexMGF.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.Calculus.ParametricIntegral -import Mathlib.Analysis.Complex.CauchyIntegral -import Mathlib.MeasureTheory.Measure.CharacteristicFunction -import Mathlib.Probability.Moments.Basic -import Mathlib.Probability.Moments.IntegrableExpMul +module + +public import Mathlib.Analysis.Calculus.ParametricIntegral +public import Mathlib.Analysis.Complex.CauchyIntegral +public import Mathlib.MeasureTheory.Measure.CharacteristicFunction +public import Mathlib.Probability.Moments.Basic +public import Mathlib.Probability.Moments.IntegrableExpMul /-! # The complex-valued moment-generating function @@ -54,6 +56,8 @@ properties of the mgf from those of the characteristic function). -/ +@[expose] public section + open MeasureTheory Filter Finset Real Complex diff --git a/Mathlib/Probability/Moments/Covariance.lean b/Mathlib/Probability/Moments/Covariance.lean index c54dfa7ff5c686..35a43ef0fa02c4 100644 --- a/Mathlib/Probability/Moments/Covariance.lean +++ b/Mathlib/Probability/Moments/Covariance.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Etienne Marion -/ -import Mathlib.Probability.Independence.Integration +module + +public import Mathlib.Probability.Independence.Integration /-! # Covariance @@ -26,6 +28,8 @@ We define the covariance of two real-valued random variables. -/ +@[expose] public section + open MeasureTheory namespace ProbabilityTheory diff --git a/Mathlib/Probability/Moments/CovarianceBilin.lean b/Mathlib/Probability/Moments/CovarianceBilin.lean index c70779106edffe..0048da2128423d 100644 --- a/Mathlib/Probability/Moments/CovarianceBilin.lean +++ b/Mathlib/Probability/Moments/CovarianceBilin.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Etienne Marion -/ -import Mathlib.Analysis.InnerProductSpace.Positive -import Mathlib.Analysis.Normed.Lp.MeasurableSpace -import Mathlib.MeasureTheory.SpecificCodomains.WithLp -import Mathlib.Probability.Moments.Basic -import Mathlib.Probability.Moments.CovarianceBilinDual +module + +public import Mathlib.Analysis.InnerProductSpace.Positive +public import Mathlib.Analysis.Normed.Lp.MeasurableSpace +public import Mathlib.MeasureTheory.SpecificCodomains.WithLp +public import Mathlib.Probability.Moments.Basic +public import Mathlib.Probability.Moments.CovarianceBilinDual /-! # Covariance in Hilbert spaces @@ -33,6 +35,8 @@ as the scalar product against some element of `E`. This motivates the definition covariance, Hilbert space, bilinear form -/ +@[expose] public section + open MeasureTheory InnerProductSpace NormedSpace WithLp EuclideanSpace open scoped RealInnerProductSpace @@ -56,17 +60,16 @@ lemma covarianceBilin_eq_covarianceBilinDual (x y : E) : covarianceBilin μ x y = covarianceBilinDual μ (toDualMap ℝ E x) (toDualMap ℝ E y) := rfl @[simp] -lemma covarianceBilin_of_not_memLp [IsFiniteMeasure μ] (h : ¬MemLp id 2 μ) : +lemma covarianceBilin_of_not_memLp (h : ¬MemLp id 2 μ) : covarianceBilin μ = 0 := by ext simp [covarianceBilin_eq_covarianceBilinDual, h] lemma covarianceBilin_apply [CompleteSpace E] [IsFiniteMeasure μ] (h : MemLp id 2 μ) (x y : E) : covarianceBilin μ x y = ∫ z, ⟪x, z - μ[id]⟫ * ⟪y, z - μ[id]⟫ ∂μ := by - simp_rw [covarianceBilin, ContinuousLinearMap.bilinearComp_apply, covarianceBilinDual_apply' h] - simp only [LinearIsometry.coe_toContinuousLinearMap, id_eq, toDualMap_apply] + simp [covarianceBilin, covarianceBilinDual_apply' h] -lemma covarianceBilin_comm [IsFiniteMeasure μ] (x y : E) : +lemma covarianceBilin_comm (x y : E) : covarianceBilin μ x y = covarianceBilin μ y x := by rw [covarianceBilin_eq_covarianceBilinDual, covarianceBilinDual_comm, covarianceBilin_eq_covarianceBilinDual] @@ -95,11 +98,11 @@ lemma covarianceBilin_real_self {μ : Measure ℝ} [IsFiniteMeasure μ] (x : ℝ rw [covarianceBilin_real, pow_two] @[simp] -lemma covarianceBilin_self_nonneg [IsFiniteMeasure μ] (x : E) : +lemma covarianceBilin_self_nonneg (x : E) : 0 ≤ covarianceBilin μ x x := by simp [covarianceBilin] -lemma isPosSemidef_covarianceBilin [IsFiniteMeasure μ] : +lemma isPosSemidef_covarianceBilin : (covarianceBilin μ).toBilinForm.IsPosSemidef where eq := covarianceBilin_comm nonneg := covarianceBilin_self_nonneg @@ -203,10 +206,7 @@ lemma covarianceOperator_of_not_memLp (hμ : ¬MemLp id 2 μ) : lemma covarianceOperator_inner (hμ : MemLp id 2 μ) (x y : E) : ⟪covarianceOperator μ x, y⟫ = ∫ z, ⟪x, z⟫ * ⟪y, z⟫ ∂μ := by - simp only [covarianceOperator, continuousLinearMapOfBilin_apply, - ContinuousLinearMap.bilinearComp_apply, LinearIsometry.coe_toContinuousLinearMap] - rw [uncenteredCovarianceBilinDual_apply hμ] - simp_rw [toDualMap_apply] + simp [covarianceOperator, uncenteredCovarianceBilinDual_apply hμ] lemma covarianceOperator_apply (hμ : MemLp id 2 μ) (x : E) : covarianceOperator μ x = ∫ y, ⟪x, y⟫ • y ∂μ := by diff --git a/Mathlib/Probability/Moments/CovarianceBilinDual.lean b/Mathlib/Probability/Moments/CovarianceBilinDual.lean index e9952d89d47737..296a71a1cd58fc 100644 --- a/Mathlib/Probability/Moments/CovarianceBilinDual.lean +++ b/Mathlib/Probability/Moments/CovarianceBilinDual.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Analysis.LocallyConvex.ContinuousOfBounded -import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap -import Mathlib.Probability.Moments.Variance +module + +public import Mathlib.Analysis.LocallyConvex.ContinuousOfBounded +public import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap +public import Mathlib.Probability.Moments.Variance /-! # Covariance in Banach spaces @@ -36,6 +38,8 @@ The hypothesis that `μ` has a second moment is written as `MemLp id 2 μ` in th -/ +@[expose] public section + open MeasureTheory ProbabilityTheory Complex NormedSpace open scoped ENNReal NNReal Real Topology @@ -232,7 +236,7 @@ end Centered section Covariance -variable [NormedSpace ℝ E] [BorelSpace E] [IsFiniteMeasure μ] +variable [NormedSpace ℝ E] [BorelSpace E] open Classical in /-- Continuous bilinear form with value `∫ x, (L₁ x - μ[L₁]) * (L₂ x - μ[L₂]) ∂μ` on `(L₁, L₂)` @@ -241,15 +245,68 @@ noncomputable def covarianceBilinDual (μ : Measure E) : StrongDual ℝ E →L[ℝ] StrongDual ℝ E →L[ℝ] ℝ := uncenteredCovarianceBilinDual (μ.map (fun x ↦ x - ∫ x, x ∂μ)) -@[simp] -lemma covarianceBilinDual_of_not_memLp (h : ¬ MemLp id 2 μ) (L₁ L₂ : StrongDual ℝ E) : +omit [BorelSpace E] in +lemma _root_.MeasureTheory.memLp_id_of_self_sub_integral {p : ℝ≥0∞} + (h_Lp : MemLp (fun x ↦ x - ∫ y, y ∂μ) p μ) : MemLp id p μ := by + have : (id : E → E) = fun x ↦ x - ∫ x, x ∂μ + ∫ x, x ∂μ := by ext; simp + rw [this] + apply h_Lp.add + set c := ∫ x, x ∂μ + /- We need to check that the constant `c = ∫ x, x ∂μ` is in `L^p`. Note that we don't assume + that `μ` is finite, so this requires an argument. If the constant is zero, it's obvious. + If it's nonzero, this means that `x` is integrable for `μ` (as otherwise the integral would be + `0` by our choice of junk value), so `‖x‖ ^ (1/p)` is in `L^p`. + The constant `c` is controlled by `2 ‖x - c‖` close to `0` (say when `‖x‖ ≤ ‖c‖ / 2`) + and by a multiple of `‖x‖ ^ (1/p)` away from `0`. Those two functions + are in `L^p` by assumptions, so the constant `c` also is. -/ + by_cases hx : c = 0 + · simp [hx] + rcases eq_or_ne p 0 with rfl | hp0 + · simp [aestronglyMeasurable_const] + rcases eq_or_ne p ∞ with rfl | hptop + · exact memLp_top_const c + apply (integrable_norm_rpow_iff (by fun_prop) hp0 hptop).1 + have I : Integrable (fun (x : E) ↦ ‖x‖) μ := by + apply Integrable.norm + contrapose! hx + exact integral_undef hx + have := (h_Lp.integrable_norm_rpow hp0 hptop).const_mul (2 ^ p.toReal) + apply (((I.const_mul (2 * ‖c‖ ^ (p.toReal - 1))).add this)).mono' (by fun_prop) + filter_upwards [] with y + lift p to ℝ≥0 using hptop + simp only [ENNReal.coe_toReal, Real.norm_eq_abs, Pi.add_apply] + rw [abs_of_nonneg (by positivity)] + rcases le_total ‖y‖ (‖c‖ / 2) + · have : ‖c‖ ≤ ‖y‖ + ‖y - c‖ := Eq.trans_le (by abel_nf) (norm_sub_le y (y - c)) + calc ‖c‖ ^ (p : ℝ) + _ ≤ (2 * ‖y - c‖) ^ (p : ℝ) := + Real.rpow_le_rpow (by positivity) (by linarith) (by positivity) + _ = 0 + 2 ^ (p : ℝ) * ‖y - c‖ ^ (p : ℝ) := by + rw [Real.mul_rpow (by simp) (by positivity)] + ring + _ ≤ 2 * ‖c‖ ^ (p - 1 : ℝ) * ‖y‖ + 2 ^ (p : ℝ) * ‖y - c‖ ^ (p : ℝ) := by + gcongr + positivity + · calc ‖c‖ ^ (p : ℝ ) + _ = ‖c‖ ^ ((p - 1) + 1 : ℝ) := by abel_nf + _ = ‖c‖ ^ (p - 1 : ℝ) * ‖c‖ := by rw [Real.rpow_add (by positivity), Real.rpow_one] + _ ≤ ‖c‖ ^ (p - 1 : ℝ) * (2 * ‖y‖) := by gcongr; linarith + _ = 2 * ‖c‖ ^ (p - 1 : ℝ) * ‖y‖ + 0 := by ring + _ ≤ 2 * ‖c‖ ^ (p - 1 : ℝ) * ‖y‖ + 2 ^ (p : ℝ) * ‖y - c‖ ^ (p : ℝ) := by gcongr; positivity + +lemma covarianceBilinDual_of_not_memLp' (h : ¬ MemLp (fun x ↦ x - ∫ y, y ∂μ) 2 μ) + (L₁ L₂ : StrongDual ℝ E) : covarianceBilinDual μ L₁ L₂ = 0 := by rw [covarianceBilinDual, uncenteredCovarianceBilinDual_of_not_memLp] rw [(measurableEmbedding_subRight _).memLp_map_measure_iff] - refine fun h_Lp ↦ h ?_ - have : (id : E → E) = fun x ↦ x - ∫ x, x ∂μ + ∫ x, x ∂μ := by ext; simp - rw [this] - exact h_Lp.add (memLp_const _) + exact h + +@[simp] +lemma covarianceBilinDual_of_not_memLp (h : ¬ MemLp id 2 μ) (L₁ L₂ : StrongDual ℝ E) : + covarianceBilinDual μ L₁ L₂ = 0 := by + apply covarianceBilinDual_of_not_memLp' + contrapose! h + exact memLp_id_of_self_sub_integral h @[simp] lemma covarianceBilinDual_zero : covarianceBilinDual (0 : Measure E) = 0 := by @@ -257,11 +314,11 @@ lemma covarianceBilinDual_zero : covarianceBilinDual (0 : Measure E) = 0 := by lemma covarianceBilinDual_comm (L₁ L₂ : StrongDual ℝ E) : covarianceBilinDual μ L₁ L₂ = covarianceBilinDual μ L₂ L₁ := by - by_cases h : MemLp id 2 μ + by_cases h : MemLp (fun x ↦ x - ∫ y, y ∂μ) 2 μ · have h' : MemLp id 2 (Measure.map (fun x ↦ x - ∫ (x : E), x ∂μ) μ) := - (measurableEmbedding_subRight _).memLp_map_measure_iff.mpr <| h.sub (memLp_const _) + (measurableEmbedding_subRight _).memLp_map_measure_iff.mpr <| h simp_rw [covarianceBilinDual, uncenteredCovarianceBilinDual_apply h', mul_comm (L₁ _)] - · simp [h] + · simp [h, covarianceBilinDual_of_not_memLp'] @[simp] lemma covarianceBilinDual_self_nonneg (L : StrongDual ℝ E) : 0 ≤ covarianceBilinDual μ L L := by @@ -271,7 +328,7 @@ lemma covarianceBilinDual_self_nonneg (L : StrongDual ℝ E) : 0 ≤ covarianceB exact real_inner_self_nonneg · simp [h] -variable [CompleteSpace E] +variable [CompleteSpace E] [IsFiniteMeasure μ] lemma covarianceBilinDual_apply (h : MemLp id 2 μ) (L₁ L₂ : StrongDual ℝ E) : covarianceBilinDual μ L₁ L₂ = ∫ x, (L₁ x - μ[L₁]) * (L₂ x - μ[L₂]) ∂μ := by diff --git a/Mathlib/Probability/Moments/IntegrableExpMul.lean b/Mathlib/Probability/Moments/IntegrableExpMul.lean index d60abbdd972064..17e4045d8fc5b3 100644 --- a/Mathlib/Probability/Moments/IntegrableExpMul.lean +++ b/Mathlib/Probability/Moments/IntegrableExpMul.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.L1Space.Integrable -import Mathlib.MeasureTheory.Order.Group.Lattice +module + +public import Mathlib.MeasureTheory.Function.L1Space.Integrable +public import Mathlib.MeasureTheory.Order.Group.Lattice /-! # Domain of the moment-generating function @@ -35,6 +37,8 @@ We prove the integrability of other functions for `t` in the interior of that in -/ +@[expose] public section + open MeasureTheory Filter Finset Real diff --git a/Mathlib/Probability/Moments/MGFAnalytic.lean b/Mathlib/Probability/Moments/MGFAnalytic.lean index 459f9616b6201e..c59e37e10d471e 100644 --- a/Mathlib/Probability/Moments/MGFAnalytic.lean +++ b/Mathlib/Probability/Moments/MGFAnalytic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Moments.ComplexMGF -import Mathlib.Analysis.SpecialFunctions.Complex.Analytic -import Mathlib.Analysis.Calculus.Taylor +module + +public import Mathlib.Probability.Moments.ComplexMGF +public import Mathlib.Analysis.SpecialFunctions.Complex.Analytic +public import Mathlib.Analysis.Calculus.Taylor /-! # The moment-generating function is analytic @@ -24,6 +26,8 @@ is analytic on the interior of `integrableExpSet X μ`, the interval on which it -/ +@[expose] public section + open MeasureTheory Filter Finset Real diff --git a/Mathlib/Probability/Moments/SubGaussian.lean b/Mathlib/Probability/Moments/SubGaussian.lean index 9d39365e866312..f7dc4bfcee1cc8 100644 --- a/Mathlib/Probability/Moments/SubGaussian.lean +++ b/Mathlib/Probability/Moments/SubGaussian.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.Probability.Kernel.Condexp -import Mathlib.Probability.Moments.MGFAnalytic -import Mathlib.Probability.Moments.Tilted +module + +public import Mathlib.Probability.Kernel.Condexp +public import Mathlib.Probability.Moments.MGFAnalytic +public import Mathlib.Probability.Moments.Tilted /-! # Sub-Gaussian random variables @@ -118,6 +120,8 @@ a conditional expectation, `(μ.trim hm)`-almost surely: -/ +@[expose] public section + open MeasureTheory Real open scoped ENNReal NNReal Topology diff --git a/Mathlib/Probability/Moments/Tilted.lean b/Mathlib/Probability/Moments/Tilted.lean index 3719483ce33a8a..7f88da46c5eb7d 100644 --- a/Mathlib/Probability/Moments/Tilted.lean +++ b/Mathlib/Probability/Moments/Tilted.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Measure.Tilted -import Mathlib.Probability.Moments.MGFAnalytic +module + +public import Mathlib.MeasureTheory.Measure.Tilted +public import Mathlib.Probability.Moments.MGFAnalytic /-! # Results relating `Measure.tilted` to `mgf` and `cgf` @@ -24,6 +26,8 @@ of `X`. -/ +@[expose] public section + open MeasureTheory Real Set Finset diff --git a/Mathlib/Probability/Moments/Variance.lean b/Mathlib/Probability/Moments/Variance.lean index eb83bf0ce7a4ba..cfbba16ed08ae4 100644 --- a/Mathlib/Probability/Moments/Variance.lean +++ b/Mathlib/Probability/Moments/Variance.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Kexing Ying -/ -import Mathlib.Probability.Moments.Covariance +module + +public import Mathlib.Probability.Moments.Covariance /-! # Variance of random variables @@ -34,6 +36,8 @@ We define the variance of a real-valued random variable as `Var[X] = 𝔼[(X - `a ≤ X ≤ b` almost everywhere is at most`((b - a) / 2) ^ 2`. -/ +@[expose] public section + open MeasureTheory Filter Finset noncomputable section diff --git a/Mathlib/Probability/Notation.lean b/Mathlib/Probability/Notation.lean index 2bf6ab64febaf5..46bc4733dd6e09 100644 --- a/Mathlib/Probability/Notation.lean +++ b/Mathlib/Probability/Notation.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic -import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue +module + +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +public import Mathlib.MeasureTheory.Measure.Decomposition.Lebesgue /-! # Notations for probability theory @@ -29,6 +31,8 @@ To use these notations, you need to use `open scoped ProbabilityTheory` or `open ProbabilityTheory`. -/ +@[expose] public section + open MeasureTheory diff --git a/Mathlib/Probability/ProbabilityMassFunction/Basic.lean b/Mathlib/Probability/ProbabilityMassFunction/Basic.lean index 9b8c2478fbd367..c8e33581e13661 100644 --- a/Mathlib/Probability/ProbabilityMassFunction/Basic.lean +++ b/Mathlib/Probability/ProbabilityMassFunction/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Devon Tuma -/ -import Mathlib.Topology.Instances.ENNReal.Lemmas -import Mathlib.MeasureTheory.Measure.Dirac +module + +public import Mathlib.Topology.Instances.ENNReal.Lemmas +public import Mathlib.MeasureTheory.Measure.Dirac /-! # Probability mass functions @@ -29,6 +31,8 @@ to be the measure of the singleton set `{x}`. probability mass function, discrete probability measure -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Probability/ProbabilityMassFunction/Binomial.lean b/Mathlib/Probability/ProbabilityMassFunction/Binomial.lean index 8ef586df94d98f..b9f1d660e11635 100644 --- a/Mathlib/Probability/ProbabilityMassFunction/Binomial.lean +++ b/Mathlib/Probability/ProbabilityMassFunction/Binomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joachim Breitner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joachim Breitner -/ -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Probability.ProbabilityMassFunction.Constructions -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Probability.ProbabilityMassFunction.Constructions +public import Mathlib.Tactic.FinCases /-! # The binomial distribution @@ -17,6 +19,8 @@ This file defines the probability mass function of the binomial distribution. * `binomial_one_eq_bernoulli`: For `n = 1`, it is equal to `PMF.bernoulli`. -/ +@[expose] public section + namespace PMF open ENNReal NNReal diff --git a/Mathlib/Probability/ProbabilityMassFunction/Constructions.lean b/Mathlib/Probability/ProbabilityMassFunction/Constructions.lean index cd9c9b6aebc937..7960169836ae1a 100644 --- a/Mathlib/Probability/ProbabilityMassFunction/Constructions.lean +++ b/Mathlib/Probability/ProbabilityMassFunction/Constructions.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Devon Tuma -/ -import Mathlib.Probability.ProbabilityMassFunction.Monad -import Mathlib.Control.ULiftable +module + +public import Mathlib.Probability.ProbabilityMassFunction.Monad +public import Mathlib.Control.ULiftable /-! # Specific Constructions of Probability Mass Functions @@ -24,6 +26,8 @@ and `filter` uses this to filter the support of a `PMF` and re-normalize the new -/ +@[expose] public section + universe u v namespace PMF diff --git a/Mathlib/Probability/ProbabilityMassFunction/Integrals.lean b/Mathlib/Probability/ProbabilityMassFunction/Integrals.lean index bf26acf2d0a9de..bd129e3d4096ea 100644 --- a/Mathlib/Probability/ProbabilityMassFunction/Integrals.lean +++ b/Mathlib/Probability/ProbabilityMassFunction/Integrals.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Joachim Breitner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joachim Breitner -/ -import Mathlib.Probability.ProbabilityMassFunction.Basic -import Mathlib.Probability.ProbabilityMassFunction.Constructions -import Mathlib.MeasureTheory.Integral.Bochner.Basic +module + +public import Mathlib.Probability.ProbabilityMassFunction.Basic +public import Mathlib.Probability.ProbabilityMassFunction.Constructions +public import Mathlib.MeasureTheory.Integral.Bochner.Basic /-! # Integrals with a measure derived from probability mass functions. @@ -16,6 +18,8 @@ value) with regard to a measure derived from a `PMF` is a sum weighted by the `P It also provides the expected value for specific probability mass functions. -/ +@[expose] public section + namespace PMF open MeasureTheory NNReal ENNReal TopologicalSpace diff --git a/Mathlib/Probability/ProbabilityMassFunction/Monad.lean b/Mathlib/Probability/ProbabilityMassFunction/Monad.lean index 876540f3fb6c5a..13abad136fb9ac 100644 --- a/Mathlib/Probability/ProbabilityMassFunction/Monad.lean +++ b/Mathlib/Probability/ProbabilityMassFunction/Monad.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Devon Tuma -/ -import Mathlib.Probability.ProbabilityMassFunction.Basic +module + +public import Mathlib.Probability.ProbabilityMassFunction.Basic /-! # Monad Operations for Probability Mass Functions @@ -18,6 +20,8 @@ so that the second argument only needs to be defined on the support of the first -/ +@[expose] public section + noncomputable section @@ -201,16 +205,11 @@ theorem bindOnSupport_apply (b : β) : @[simp] theorem support_bindOnSupport : (p.bindOnSupport f).support = ⋃ (a : α) (h : a ∈ p.support), (f a h).support := by - refine Set.ext fun b => ?_ - simp only [ENNReal.tsum_eq_zero, not_or, mem_support_iff, bindOnSupport_apply, Ne, not_forall, - mul_eq_zero, Set.mem_iUnion] - exact - ⟨fun hb => - let ⟨a, ⟨ha, ha'⟩⟩ := hb - ⟨a, ha, by simpa [ha] using ha'⟩, - fun hb => - let ⟨a, ha, ha'⟩ := hb - ⟨a, ⟨ha, by simpa [(mem_support_iff _ a).1 ha] using ha'⟩⟩⟩ + ext + -- `simp` suffices; squeezed for performance + simp only [mem_support_iff, bindOnSupport_apply, ne_eq, ENNReal.tsum_eq_zero, + dite_eq_left_iff, mul_eq_zero, not_forall, not_or, and_exists_self, + Set.mem_iUnion] theorem mem_support_bindOnSupport_iff (b : β) : b ∈ (p.bindOnSupport f).support ↔ ∃ (a : α) (h : a ∈ p.support), b ∈ (f a h).support := by diff --git a/Mathlib/Probability/Process/Adapted.lean b/Mathlib/Probability/Process/Adapted.lean index 6a7376b9669dec..0cca55b334f97f 100644 --- a/Mathlib/Probability/Process/Adapted.lean +++ b/Mathlib/Probability/Process/Adapted.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Rémy Degenne -/ -import Mathlib.Probability.Process.Filtration -import Mathlib.Topology.Instances.Discrete +module + +public import Mathlib.Probability.Process.Filtration +public import Mathlib.Topology.Instances.Discrete /-! # Adapted and progressively measurable processes @@ -32,6 +34,8 @@ adapted, progressively measurable -/ +@[expose] public section + open Filter Order TopologicalSpace diff --git a/Mathlib/Probability/Process/Filtration.lean b/Mathlib/Probability/Process/Filtration.lean index 9b53caf96b607d..3b3dba152e8c11 100644 --- a/Mathlib/Probability/Process/Filtration.lean +++ b/Mathlib/Probability/Process/Filtration.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Rémy Degenne -/ -import Mathlib.MeasureTheory.Constructions.Cylinders -import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real -import Mathlib.MeasureTheory.MeasurableSpace.PreorderRestrict +module + +public import Mathlib.MeasureTheory.Constructions.Cylinders +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real +public import Mathlib.MeasureTheory.MeasurableSpace.PreorderRestrict /-! # Filtrations @@ -31,6 +33,8 @@ filtration, stochastic process -/ +@[expose] public section + open Filter Order TopologicalSpace @@ -157,7 +161,6 @@ theorem sInf_def (s : Set (Filtration ι m)) (i : ι) : rfl noncomputable instance instCompleteLattice : CompleteLattice (Filtration ι m) where - le := (· ≤ ·) le_refl _ _ := le_rfl le_trans _ _ _ h_fg h_gh i := (h_fg i).trans (h_gh i) le_antisymm _ _ h_fg h_gf := Filtration.ext <| funext fun i => (h_fg i).antisymm (h_gf i) @@ -169,14 +172,12 @@ noncomputable instance instCompleteLattice : CompleteLattice (Filtration ι m) w inf_le_left _ _ _ := inf_le_left inf_le_right _ _ _ := inf_le_right le_inf _ _ _ h_fg h_fh i := le_inf (h_fg i) (h_fh i) - sSup := sSup le_sSup _ f hf_mem _ := le_sSup ⟨f, hf_mem, rfl⟩ sSup_le s f h_forall i := sSup_le fun m' hm' => by obtain ⟨g, hg_mem, hfm'⟩ := hm' rw [← hfm'] exact h_forall g hg_mem i - sInf := sInf sInf_le s f hf_mem i := by have hs : s.Nonempty := ⟨f, hf_mem⟩ simp only [sInf_def, hs, if_true] @@ -187,8 +188,6 @@ noncomputable instance instCompleteLattice : CompleteLattice (Filtration ι m) w simp only [sInf_def, hs, if_true, le_sInf_iff, Set.mem_image, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂] exact fun g hg_mem => h_forall g hg_mem i - top := ⊤ - bot := ⊥ le_top f i := f.le' i bot_le _ _ := bot_le diff --git a/Mathlib/Probability/Process/FiniteDimensionalLaws.lean b/Mathlib/Probability/Process/FiniteDimensionalLaws.lean index 1aa153354b6c60..1c93fb0f5956be 100644 --- a/Mathlib/Probability/Process/FiniteDimensionalLaws.lean +++ b/Mathlib/Probability/Process/FiniteDimensionalLaws.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Jonas Bayer -/ +module -import Mathlib.MeasureTheory.Constructions.Projective -import Mathlib.Probability.IdentDistrib +public import Mathlib.MeasureTheory.Constructions.Projective +public import Mathlib.Probability.IdentDistrib /-! # Finite-dimensional distributions of a stochastic process @@ -30,6 +31,8 @@ finite-dimensional distributions. -/ +@[expose] public section + open MeasureTheory namespace ProbabilityTheory diff --git a/Mathlib/Probability/Process/HittingTime.lean b/Mathlib/Probability/Process/HittingTime.lean index 2e4f8157323be7..d63c5fc5c05666 100644 --- a/Mathlib/Probability/Process/HittingTime.lean +++ b/Mathlib/Probability/Process/HittingTime.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Rémy Degenne -/ -import Mathlib.Probability.Process.Stopping -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Probability.Process.Stopping +public import Mathlib.Tactic.AdaptationNote /-! # Hitting times @@ -30,6 +32,8 @@ only proved it for the discrete case so far). -/ +@[expose] public section + open Filter Order TopologicalSpace diff --git a/Mathlib/Probability/Process/Kolmogorov.lean b/Mathlib/Probability/Process/Kolmogorov.lean index 86414e4c9d9710..8c9ca8769da15d 100644 --- a/Mathlib/Probability/Process/Kolmogorov.lean +++ b/Mathlib/Probability/Process/Kolmogorov.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic -import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable -import Mathlib.MeasureTheory.Integral.Lebesgue.Basic +module + +public import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasurable +public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic /-! # Stochastic processes satisfying the Kolmogorov condition @@ -37,6 +39,8 @@ of pairs can be obtained from measurability of each `X t`. -/ +@[expose] public section + open MeasureTheory open scoped ENNReal NNReal diff --git a/Mathlib/Probability/Process/PartitionFiltration.lean b/Mathlib/Probability/Process/PartitionFiltration.lean index 23a6b95dd69073..9edb2ab461038e 100644 --- a/Mathlib/Probability/Process/PartitionFiltration.lean +++ b/Mathlib/Probability/Process/PartitionFiltration.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ -import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated -import Mathlib.Probability.Process.Filtration +module + +public import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated +public import Mathlib.Probability.Process.Filtration /-! # Filtration built from the finite partitions of a countably generated measurable space @@ -35,6 +37,8 @@ function on `α`. -/ +@[expose] public section + open MeasureTheory MeasurableSpace namespace ProbabilityTheory diff --git a/Mathlib/Probability/Process/Predictable.lean b/Mathlib/Probability/Process/Predictable.lean index 54f542a102c7d2..7b26a4d3bba018 100644 --- a/Mathlib/Probability/Process/Predictable.lean +++ b/Mathlib/Probability/Process/Predictable.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ -import Mathlib.Probability.Process.Adapted +module + +public import Mathlib.Probability.Process.Adapted /-! # Predictable σ-algebra @@ -30,6 +32,8 @@ predictable, previsible -/ +@[expose] public section + open Filter Order TopologicalSpace open scoped MeasureTheory NNReal ENNReal Topology diff --git a/Mathlib/Probability/Process/Stopping.lean b/Mathlib/Probability/Process/Stopping.lean index 36ad6f64a597f3..4d160b7ebe4dcc 100644 --- a/Mathlib/Probability/Process/Stopping.lean +++ b/Mathlib/Probability/Process/Stopping.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Rémy Degenne -/ -import Mathlib.Probability.Process.Adapted -import Mathlib.MeasureTheory.Constructions.BorelSpace.WithTop +module + +public import Mathlib.Probability.Process.Adapted +public import Mathlib.MeasureTheory.Constructions.BorelSpace.WithTop /-! # Stopping times, stopped processes and stopped values @@ -50,7 +52,9 @@ stopping time, stochastic process -/ -open Filter Order TopologicalSpace +@[expose] public section + +open Filter Order TopologicalSpace WithTop open scoped MeasureTheory NNReal ENNReal Topology @@ -99,7 +103,7 @@ theorem IsStoppingTime.measurableSet_lt_of_pred [PredOrder ι] (hτ : IsStopping cases τ ω with | top => simp | coe t => - simp only [WithTop.coe_lt_coe, WithTop.coe_le_coe] + simp only [coe_lt_coe, coe_le_coe] rw [le_pred_iff_of_not_isMin hi_min] rw [this] exact f.mono (pred_le i) _ (hτ.measurableSet_le <| pred i) @@ -219,7 +223,7 @@ theorem IsStoppingTime.measurableSet_lt (hτ : IsStoppingTime f τ) (i : ι) : exact hτ.measurableSet_lt_of_isLUB i' hi'_lub · have h_lt_eq_preimage : {ω : Ω | τ ω < i} = τ ⁻¹' Set.Iio i := rfl have h_Iio_eq_Iic' : Set.Iio (i : WithTop ι) = Set.Iic (i' : WithTop ι) := by - rw [← WithTop.image_coe_Iio, ← WithTop.image_coe_Iic, h_Iio_eq_Iic] + rw [← image_coe_Iio, ← image_coe_Iic, h_Iio_eq_Iic] rw [h_lt_eq_preimage, h_Iio_eq_Iic'] exact f.mono (lub_Iio_le i hi'_lub) _ (hτ.measurableSet_le i') @@ -299,7 +303,7 @@ theorem add_const [AddGroup ι] [Preorder ι] [AddRightMono ι] simp only have h_eq : {ω | τ ω + i ≤ j} = {ω | τ ω ≤ j - i} := by ext ω - simp only [Set.mem_setOf_eq, WithTop.coe_sub] + simp only [Set.mem_setOf_eq, coe_sub] cases τ ω with | top => simp | coe a => norm_cast; simp_rw [← le_sub_iff_add_le] @@ -729,10 +733,15 @@ noncomputable def stoppedProcess (u : ι → Ω → β) (τ : Ω → WithTop ι) : ι → Ω → β := fun i ω => u (min (i : WithTop ι) (τ ω)).untopA ω -theorem stoppedProcess_eq_stoppedValue {u : ι → Ω → β} {τ : Ω → WithTop ι} : +variable {u : ι → Ω → β} {τ σ : Ω → WithTop ι} + +theorem stoppedProcess_eq_stoppedValue : stoppedProcess u τ = fun i : ι => stoppedValue u fun ω => min i (τ ω) := rfl -theorem stoppedValue_stoppedProcess {u : ι → Ω → β} {τ σ : Ω → WithTop ι} : +theorem stoppedProcess_eq_stoppedValue_apply (i : ι) (ω : Ω) : + stoppedProcess u τ i ω = stoppedValue u (fun ω ↦ min i (τ ω)) ω := rfl + +theorem stoppedValue_stoppedProcess : stoppedValue (stoppedProcess u τ) σ = fun ω ↦ if σ ω ≠ ⊤ then stoppedValue u (fun ω ↦ min (σ ω) (τ ω)) ω else stoppedValue u (fun ω ↦ min (Classical.arbitrary ι) (τ ω)) ω := by @@ -740,21 +749,64 @@ theorem stoppedValue_stoppedProcess {u : ι → Ω → β} {τ σ : Ω → WithT simp only [stoppedValue, stoppedProcess, ne_eq, ite_not] cases σ ω <;> cases τ ω <;> simp -theorem stoppedValue_stoppedProcess_ae_eq {u : ι → Ω → β} {τ σ : Ω → WithTop ι} {μ : Measure Ω} +theorem stoppedValue_stoppedProcess_apply {ω : Ω} (hω : σ ω ≠ ⊤) : + stoppedValue (stoppedProcess u τ) σ ω = stoppedValue u (fun ω ↦ min (σ ω) (τ ω)) ω := by + simp [stoppedValue_stoppedProcess, hω] + +theorem stoppedValue_stoppedProcess_ae_eq {μ : Measure Ω} (hσ : ∀ᵐ ω ∂μ, σ ω ≠ ⊤) : stoppedValue (stoppedProcess u τ) σ =ᵐ[μ] stoppedValue u (fun ω ↦ min (σ ω) (τ ω)) := by filter_upwards [hσ] with ω hσ using by simp [stoppedValue_stoppedProcess, hσ] -theorem stoppedProcess_eq_of_le {u : ι → Ω → β} {τ : Ω → WithTop ι} {i : ι} {ω : Ω} (h : i ≤ τ ω) : +theorem stoppedProcess_eq_of_le {i : ι} {ω : Ω} (h : i ≤ τ ω) : stoppedProcess u τ i ω = u i ω := by simp [stoppedProcess, min_eq_left h] -theorem stoppedProcess_eq_of_ge {u : ι → Ω → β} {τ : Ω → WithTop ι} {i : ι} {ω : Ω} (h : τ ω ≤ i) : +theorem stoppedProcess_eq_of_ge {i : ι} {ω : Ω} (h : τ ω ≤ i) : stoppedProcess u τ i ω = u (τ ω).untopA ω := by simp [stoppedProcess, min_eq_right h] +lemma stoppedProcess_indicator_comm [Zero β] {s : Set Ω} (i : ι) : + stoppedProcess (fun i ↦ s.indicator (u i)) τ i = s.indicator (stoppedProcess u τ i) := by + ext ω + by_cases hω : ω ∈ s <;> simp [stoppedProcess, hω] + +lemma stoppedProcess_indicator_comm' [Zero β] {s : Set Ω} : + stoppedProcess (fun i ↦ s.indicator (u i)) τ = fun i ↦ s.indicator (stoppedProcess u τ i) := by + ext i ω + rw [stoppedProcess_indicator_comm] + +@[simp] +theorem stoppedProcess_stoppedProcess : + stoppedProcess (stoppedProcess u τ) σ = stoppedProcess u (σ ⊓ τ) := by + ext i ω + simp_rw [stoppedProcess] + by_cases hτ : τ ω = ⊤ + · simp [hτ] + by_cases hσ : σ ω = ⊤ + · simp [hσ] + by_cases hστ : σ ω ≤ τ ω + · rw [min_eq_left, untopA_eq_untop coe_ne_top] + · simp [hστ] + · refine le_trans ?_ hστ + simp [untopA_eq_untop] + · nth_rewrite 2 [untopA_eq_untop] + · rw [coe_untop, min_assoc] + rfl + · exact (lt_of_le_of_lt (min_le_right _ _) <| lt_top_iff_ne_top.2 hσ).ne + +theorem stoppedProcess_stoppedProcess' : + stoppedProcess (stoppedProcess u τ) σ = stoppedProcess u (fun ω ↦ min (σ ω) (τ ω)) := by + rw [stoppedProcess_stoppedProcess]; rfl + +theorem stoppedProcess_stoppedProcess_of_le_right (h : σ ≤ τ) : + stoppedProcess (stoppedProcess u τ) σ = stoppedProcess u σ := by simp [h] + +theorem stoppedProcess_stoppedProcess_of_le_left (h : τ ≤ σ) : + stoppedProcess (stoppedProcess u τ) σ = stoppedProcess u τ := by simp [h] + section ProgMeasurable variable [MeasurableSpace ι] [TopologicalSpace ι] [OrderTopology ι] [SecondCountableTopology ι] - [BorelSpace ι] [TopologicalSpace β] {u : ι → Ω → β} {τ : Ω → WithTop ι} {f : Filtration ι m} + [BorelSpace ι] [TopologicalSpace β] {f : Filtration ι m} theorem progMeasurable_min_stopping_time [PseudoMetrizableSpace ι] (hτ : IsStoppingTime f τ) : ProgMeasurable f fun i ω ↦ (min (i : WithTop ι) (τ ω)).untopA := by @@ -776,7 +828,7 @@ theorem progMeasurable_min_stopping_time [PseudoMetrizableSpace ι] (hτ : IsSto have h_set_eq : (fun x : s => τ (x : Set.Iic i × Ω).snd) ⁻¹' Set.Iic j = (fun x : s => (x : Set.Iic i × Ω).snd) ⁻¹' {ω | τ ω ≤ min i j} := by ext1 ω - simp only [Set.mem_preimage, Set.mem_Iic, WithTop.coe_min, le_inf_iff, + simp only [Set.mem_preimage, Set.mem_Iic, coe_min, le_inf_iff, Set.preimage_setOf_eq, Set.mem_setOf_eq, iff_and_self] exact fun _ => ω.prop rw [h_set_eq] @@ -823,7 +875,7 @@ theorem ProgMeasurable.stronglyMeasurable_stoppedProcess [PseudoMetrizableSpace theorem stronglyMeasurable_stoppedValue_of_le (h : ProgMeasurable f u) (hτ : IsStoppingTime f τ) {n : ι} (hτ_le : ∀ ω, τ ω ≤ n) : StronglyMeasurable[f n] (stoppedValue u τ) := by - have hτ_le' ω : (τ ω).untopA ≤ n := WithTop.untopA_le (hτ_le ω) + have hτ_le' ω : (τ ω).untopA ≤ n := untopA_le (hτ_le ω) have : stoppedValue u τ = (fun p : Set.Iic n × Ω => u (↑p.fst) p.snd) ∘ fun ω => (⟨(τ ω).untopA, hτ_le' ω⟩, ω) := by ext1 ω; simp only [stoppedValue, Function.comp_apply] @@ -867,7 +919,7 @@ theorem measurable_stoppedValue [PseudoMetrizableSpace β] [MeasurableSpace β] by_cases h : τ ω = ⊤ · exact .inr h · lift τ ω to ι using h with t - simp only [WithTop.coe_le_coe, WithTop.coe_ne_top, or_false] + simp only [coe_le_coe, coe_ne_top, or_false] rw [tendsto_atTop] at h_seq_tendsto exact (h_seq_tendsto t).exists rw [this] @@ -877,7 +929,7 @@ theorem measurable_stoppedValue [PseudoMetrizableSpace β] [MeasurableSpace β] · have : stoppedValue u τ ⁻¹' t ∩ {ω | τ ω = ⊤} = (fun ω ↦ u (Classical.arbitrary ι) ω) ⁻¹' t ∩ {ω | τ ω = ⊤} := by ext ω - simp only [Set.mem_inter_iff, Set.mem_preimage, stoppedValue, WithTop.untopA, + simp only [Set.mem_inter_iff, Set.mem_preimage, stoppedValue, untopA, Set.mem_setOf_eq, and_congr_left_iff] intro h simp [h] @@ -942,13 +994,13 @@ theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : specialize hbdd ω h lift τ ω to ι using h_top with i hi rw [Finset.sum_eq_single_of_mem i] - · simp only [WithTop.untopD_coe] + · simp only [untopD_coe] rw [Set.indicator_of_notMem, zero_add, Set.indicator_of_mem] <;> rw [Set.mem_setOf] · exact hi.symm · rw [← hi] exact not_le.2 h · rw [Finset.mem_filter] - simp only [Set.mem_image, Finset.mem_coe, WithTop.coe_eq_coe, exists_eq_right] at hbdd + simp only [Set.mem_image, Finset.mem_coe, coe_eq_coe, exists_eq_right] at hbdd exact ⟨hbdd, mod_cast h⟩ · intro b _ hneq rw [Set.indicator_of_notMem] @@ -1100,7 +1152,7 @@ theorem stoppedValue_sub_eq_sum [AddCommGroup β] (hle : τ ≤ π) (hπ : ∀ stoppedValue u π - stoppedValue u τ = fun ω => (∑ i ∈ Finset.Ico (τ ω).untopA (π ω).untopA, (u (i + 1) - u i)) ω := by ext ω - have h_le' : (τ ω).untopA ≤ (π ω).untopA := WithTop.untopA_mono (mod_cast hπ ω) (hle ω) + have h_le' : (τ ω).untopA ≤ (π ω).untopA := untopA_mono (mod_cast hπ ω) (hle ω) rw [Finset.sum_Ico_eq_sub _ h_le', Finset.sum_range_sub, Finset.sum_range_sub] simp [stoppedValue] diff --git a/Mathlib/Probability/ProductMeasure.lean b/Mathlib/Probability/ProductMeasure.lean index e4cbf52c9ec96e..2e15abfaf0ad74 100644 --- a/Mathlib/Probability/ProductMeasure.lean +++ b/Mathlib/Probability/ProductMeasure.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Etienne Marion. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Etienne Marion -/ -import Mathlib.Probability.Kernel.Composition.MeasureComp -import Mathlib.Probability.Kernel.IonescuTulcea.Traj +module + +public import Mathlib.Probability.Kernel.Composition.MeasureComp +public import Mathlib.Probability.Kernel.IonescuTulcea.Traj /-! # Infinite product of probability measures @@ -45,6 +47,8 @@ in which case `piContent μ` is known to be a true measure (see `piContent_eq_me infinite product measure -/ +@[expose] public section + open ProbabilityTheory Finset Filter Preorder MeasurableEquiv open scoped ENNReal Topology @@ -379,7 +383,7 @@ instance : IsProbabilityMeasure (infinitePi μ) := by it gives the same measure to measurable boxes. -/ theorem eq_infinitePi {ν : Measure (Π i, X i)} (hν : ∀ s : Finset ι, ∀ t : (i : ι) → Set (X i), - (∀ i ∈ s, MeasurableSet (t i)) → ν (Set.pi s t) = ∏ i ∈ s, μ i (t i)) : + (∀ i, MeasurableSet (t i)) → ν (Set.pi s t) = ∏ i ∈ s, μ i (t i)) : ν = infinitePi μ := by refine (isProjectiveLimit_infinitePi μ).unique ?_ |>.symm refine fun s ↦ (pi_eq fun t ht ↦ ?_).symm @@ -388,7 +392,10 @@ theorem eq_infinitePi {ν : Measure (Π i, X i)} · congr with i rw [dif_pos i.2] any_goals fun_prop - · exact fun i hi ↦ dif_pos hi ▸ ht ⟨i, hi⟩ + · rintro i + split_ifs with hi + · exact ht ⟨i, hi⟩ + · exact .univ · exact .univ_pi ht -- TODO: add a version for an infinite product @@ -403,6 +410,16 @@ lemma infinitePi_pi {s : Finset ι} {t : (i : ι) → Set (X i)} · exact measurable_restrict _ · exact .univ_pi fun i ↦ mt i.1 i.2 +-- TODO: add a version for infinite `ι`. See TODO on `infinitePi_pi`. +@[simp] +lemma infinitePi_singleton [Fintype ι] [∀ i, MeasurableSingletonClass (X i)] (f : ∀ i, X i) : + infinitePi μ {f} = ∏ i, μ i {f i} := by + simpa [Set.univ_pi_singleton] using + infinitePi_pi μ (s := .univ) (t := fun i ↦ {f i}) fun _ _ ↦ .singleton _ + +@[simp] lemma infinitePi_dirac (f : ∀ i, X i) : infinitePi (fun i ↦ dirac (f i)) = dirac f := + .symm <| eq_infinitePi _ <| by simp +contextual [MeasurableSet.pi, Finset.countable_toSet] + lemma _root_.measurePreserving_eval_infinitePi (i : ι) : MeasurePreserving (Function.eval i) (infinitePi μ) (μ i) where measurable := by fun_prop @@ -424,12 +441,12 @@ lemma infinitePi_map_pi {Y : ι → Type*} [∀ i, MeasurableSpace (Y i)] {f : ( have (i : ι) : IsProbabilityMeasure ((μ i).map (f i)) := isProbabilityMeasure_map (hf i).aemeasurable refine eq_infinitePi _ fun s t ht ↦ ?_ - rw [map_apply (by fun_prop) (.pi s.countable_toSet ht)] + rw [map_apply (by fun_prop) (.pi s.countable_toSet fun _ _ ↦ ht _)] have : (fun (x : Π i, X i) i ↦ f i (x i)) ⁻¹' ((s : Set ι).pi t) = (s : Set ι).pi (fun i ↦ (f i) ⁻¹' (t i)) := by ext x; simp - rw [this, infinitePi_pi _ (fun i hi ↦ hf i (ht i hi))] - refine Finset.prod_congr rfl fun i hi ↦ ?_ - rw [map_apply (by fun_prop) (ht i hi)] + rw [this, infinitePi_pi _ (fun i _ ↦ hf i (ht i))] + congr! with i hi + rw [map_apply (by fun_prop) (ht i)] /-- If we push the product measure forward by a reindexing equivalence, we get a product measure on the reindexed product. -/ @@ -466,15 +483,15 @@ lemma infinitePi_map_piCurry_symm : apply eq_infinitePi intro s t ht classical - rw [map_apply (by fun_prop) (.pi (countable_toSet _) ht), ← Finset.sigma_image_fst_preimage_mk s, - coe_piCurry_symm, Finset.coe_sigma, Set.uncurry_preimage_sigma_pi, infinitePi_pi, - Finset.prod_sigma] + rw [map_apply (by fun_prop) (.pi (countable_toSet _) fun _ _ ↦ ht _), + ← Finset.sigma_image_fst_preimage_mk s, coe_piCurry_symm, Finset.coe_sigma, + Set.uncurry_preimage_sigma_pi, infinitePi_pi, Finset.prod_sigma] · apply Finset.prod_congr rfl simp only [Finset.mem_image, Sigma.exists, exists_and_right, exists_eq_right, forall_exists_index] intro i j hij rw [infinitePi_pi] - simpa using fun j hj ↦ ht _ hj + simp [ht] · simp only [mem_image, Sigma.exists, exists_and_right, exists_eq_right, forall_exists_index] exact fun i j hij ↦ MeasurableSet.pi (countable_toSet _) fun k hk ↦ by simp_all diff --git a/Mathlib/Probability/StrongLaw.lean b/Mathlib/Probability/StrongLaw.lean index 1df263bcc8be55..400975c56c4cf8 100644 --- a/Mathlib/Probability/StrongLaw.lean +++ b/Mathlib/Probability/StrongLaw.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.Probability.IdentDistrib -import Mathlib.Probability.Independence.Integrable -import Mathlib.MeasureTheory.Integral.DominatedConvergence -import Mathlib.Analysis.SpecificLimits.FloorPow -import Mathlib.Analysis.PSeries -import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +module + +public import Mathlib.Probability.IdentDistrib +public import Mathlib.Probability.Independence.Integrable +public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.Analysis.SpecificLimits.FloorPow +public import Mathlib.Analysis.PSeries +public import Mathlib.Analysis.Asymptotics.SpecificAsymptotics /-! # The strong law of large numbers @@ -53,6 +55,8 @@ random variables. Let `Yₙ` be the truncation of `Xₙ` up to `n`. We claim tha that, if `c` is close enough to `1`, the gap between `c^k` and `c^(k+1)` is small. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Probability/UniformOn.lean b/Mathlib/Probability/UniformOn.lean index a87543a21e030a..7c0f4eeccab44f 100644 --- a/Mathlib/Probability/UniformOn.lean +++ b/Mathlib/Probability/UniformOn.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying, Bhavik Mehta -/ -import Mathlib.Probability.ConditionalProbability -import Mathlib.MeasureTheory.Measure.Count +module + +public import Mathlib.Probability.ConditionalProbability +public import Mathlib.MeasureTheory.Measure.Count /-! # Classical probability @@ -33,6 +35,8 @@ writing `uniformOn s P`. We should avoid this however as none of the lemmas are predicates. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/Probability/Variance.lean b/Mathlib/Probability/Variance.lean index 72da3527cf8591..354b6eacc4c317 100644 --- a/Mathlib/Probability/Variance.lean +++ b/Mathlib/Probability/Variance.lean @@ -1,3 +1,5 @@ -import Mathlib.Probability.Moments.Variance +module + +public import Mathlib.Probability.Moments.Variance deprecated_module (since := "2025-05-16") diff --git a/Mathlib/RepresentationTheory/Basic.lean b/Mathlib/RepresentationTheory/Basic.lean index c1c35d21bc014b..10150430622dca 100644 --- a/Mathlib/RepresentationTheory/Basic.lean +++ b/Mathlib/RepresentationTheory/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Antoine Labelle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle -/ -import Mathlib.LinearAlgebra.Contraction -import Mathlib.Algebra.Group.Equiv.TypeTags +module + +public import Mathlib.LinearAlgebra.Contraction +public import Mathlib.Algebra.Group.Equiv.TypeTags /-! # Monoid representations @@ -33,6 +35,8 @@ module can be accessed via `ρ.asModule`. Conversely, given a `MonoidAlgebra k G `M.ofModule` is the associated representation seen as a homomorphism. -/ +@[expose] public section + open MonoidAlgebra (lift of) open LinearMap Module diff --git a/Mathlib/RepresentationTheory/Character.lean b/Mathlib/RepresentationTheory/Character.lean index f6ab3ad53cdadd..6725a30cde9cc3 100644 --- a/Mathlib/RepresentationTheory/Character.lean +++ b/Mathlib/RepresentationTheory/Character.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Antoine Labelle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle -/ -import Mathlib.RepresentationTheory.FDRep -import Mathlib.LinearAlgebra.Trace -import Mathlib.RepresentationTheory.Invariants +module + +public import Mathlib.RepresentationTheory.FDRep +public import Mathlib.LinearAlgebra.Trace +public import Mathlib.RepresentationTheory.Invariants /-! # Characters of representations @@ -28,6 +30,8 @@ defined in `Mathlib/CategoryTheory/Simple.lean` in terms of `Vᘁ` and `ihom V W`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RepresentationTheory/Coinduced.lean b/Mathlib/RepresentationTheory/Coinduced.lean index 016e72cca9859a..46f37078cb0fe5 100644 --- a/Mathlib/RepresentationTheory/Coinduced.lean +++ b/Mathlib/RepresentationTheory/Coinduced.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Preserves -import Mathlib.RepresentationTheory.Rep +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Preserves +public import Mathlib.RepresentationTheory.Rep /-! # Coinduced representations @@ -39,6 +41,8 @@ coinduction functor and hence that the coinduction functor preserves limits. -/ +@[expose] public section + universe u namespace Representation diff --git a/Mathlib/RepresentationTheory/Coinvariants.lean b/Mathlib/RepresentationTheory/Coinvariants.lean index 9dbd119d393bde..35f9eafd5ecebf 100644 --- a/Mathlib/RepresentationTheory/Coinvariants.lean +++ b/Mathlib/RepresentationTheory/Coinvariants.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.RepresentationTheory.Rep +module + +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.RepresentationTheory.Rep /-! # Coinvariants of a group representation @@ -35,6 +37,8 @@ left adjoint to the functor equipping a module with the trivial representation. -/ +@[expose] public section + universe u v namespace Representation diff --git a/Mathlib/RepresentationTheory/FDRep.lean b/Mathlib/RepresentationTheory/FDRep.lean index 0c6d466813f788..b3b84ffb94c069 100644 --- a/Mathlib/RepresentationTheory/FDRep.lean +++ b/Mathlib/RepresentationTheory/FDRep.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.FGModuleCat.Limits -import Mathlib.Algebra.Category.FGModuleCat.Colimits -import Mathlib.CategoryTheory.Monoidal.Rigid.Braided -import Mathlib.CategoryTheory.Preadditive.Schur -import Mathlib.RepresentationTheory.Basic -import Mathlib.RepresentationTheory.Rep +module + +public import Mathlib.Algebra.Category.FGModuleCat.Limits +public import Mathlib.Algebra.Category.FGModuleCat.Colimits +public import Mathlib.CategoryTheory.Monoidal.Rigid.Braided +public import Mathlib.CategoryTheory.Preadditive.Schur +public import Mathlib.RepresentationTheory.Basic +public import Mathlib.RepresentationTheory.Rep /-! # `FDRep k G` is the category of finite-dimensional `k`-linear representations of `G`. @@ -44,6 +46,8 @@ and this is reflected in the documentation. -/ +@[expose] public section + suppress_compilation universe u diff --git a/Mathlib/RepresentationTheory/FinGroupCharZero.lean b/Mathlib/RepresentationTheory/FinGroupCharZero.lean index 8c8a25dd7e83ec..a919e5f6467302 100644 --- a/Mathlib/RepresentationTheory/FinGroupCharZero.lean +++ b/Mathlib/RepresentationTheory/FinGroupCharZero.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.Algebra.Category.FGModuleCat.Abelian -import Mathlib.Algebra.Category.ModuleCat.Injective -import Mathlib.RepresentationTheory.Character -import Mathlib.RepresentationTheory.Maschke -import Mathlib.RingTheory.SimpleModule.InjectiveProjective +module + +public import Mathlib.Algebra.Category.FGModuleCat.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Injective +public import Mathlib.RepresentationTheory.Character +public import Mathlib.RepresentationTheory.Maschke +public import Mathlib.RingTheory.SimpleModule.InjectiveProjective /-! # Applications of Maschke's theorem @@ -27,6 +29,8 @@ if and only if `∑ g : G, V.character g * V.character g⁻¹ = Fintype.card G`. -/ +@[expose] public section + universe u variable {k : Type u} [Field k] {G : Type u} [Fintype G] [Group G] diff --git a/Mathlib/RepresentationTheory/FiniteIndex.lean b/Mathlib/RepresentationTheory/FiniteIndex.lean index 98a09d4d84ecda..fbbf34c6475a3f 100644 --- a/Mathlib/RepresentationTheory/FiniteIndex.lean +++ b/Mathlib/RepresentationTheory/FiniteIndex.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.GroupTheory.Index -import Mathlib.RepresentationTheory.Coinduced -import Mathlib.RepresentationTheory.Induced +module + +public import Mathlib.GroupTheory.Index +public import Mathlib.RepresentationTheory.Coinduced +public import Mathlib.RepresentationTheory.Induced /-! # (Co)induced representations of a finite index subgroup @@ -24,6 +26,8 @@ and which is 0 elsewhere. Meanwhile, the inverse sends `f : G → A` to `∑ᵢ -/ +@[expose] public section + universe u namespace Rep diff --git a/Mathlib/RepresentationTheory/GroupCohomology/Basic.lean b/Mathlib/RepresentationTheory/GroupCohomology/Basic.lean index 91be6281841638..9a69849eb9279a 100644 --- a/Mathlib/RepresentationTheory/GroupCohomology/Basic.lean +++ b/Mathlib/RepresentationTheory/GroupCohomology/Basic.lean @@ -3,6 +3,8 @@ Copyright (c) 2023 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic +module + +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic deprecated_module (since := "2025-06-14") diff --git a/Mathlib/RepresentationTheory/GroupCohomology/Functoriality.lean b/Mathlib/RepresentationTheory/GroupCohomology/Functoriality.lean index 45004eedea2f7d..00a93703ecb210 100644 --- a/Mathlib/RepresentationTheory/GroupCohomology/Functoriality.lean +++ b/Mathlib/RepresentationTheory/GroupCohomology/Functoriality.lean @@ -3,6 +3,8 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Functoriality +module + +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Functoriality deprecated_module (since := "2025-06-14") diff --git a/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean b/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean index 6f272027e3f240..73b95731c561a3 100644 --- a/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean +++ b/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean @@ -3,6 +3,8 @@ Copyright (c) 2023 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Hilbert90 +module + +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Hilbert90 deprecated_module (since := "2025-06-14") diff --git a/Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean b/Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean index f67ab84d9f9bfd..b5542a9f359d31 100644 --- a/Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean +++ b/Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean @@ -3,6 +3,8 @@ Copyright (c) 2023 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Joël Riou -/ -import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree +module + +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree deprecated_module (since := "2025-06-14") diff --git a/Mathlib/RepresentationTheory/GroupCohomology/Resolution.lean b/Mathlib/RepresentationTheory/GroupCohomology/Resolution.lean index 6726d3457a91f5..9a76931817827d 100644 --- a/Mathlib/RepresentationTheory/GroupCohomology/Resolution.lean +++ b/Mathlib/RepresentationTheory/GroupCohomology/Resolution.lean @@ -3,6 +3,8 @@ Copyright (c) 2022 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.Resolution +module + +public import Mathlib.RepresentationTheory.Homological.Resolution deprecated_module (since := "2025-06-14") diff --git a/Mathlib/RepresentationTheory/Homological/FiniteCyclic.lean b/Mathlib/RepresentationTheory/Homological/FiniteCyclic.lean index 6a9b7fc463884f..f58a51ba348975 100644 --- a/Mathlib/RepresentationTheory/Homological/FiniteCyclic.lean +++ b/Mathlib/RepresentationTheory/Homological/FiniteCyclic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.AlternatingConst -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.CategoryTheory.Preadditive.Projective.Resolution -import Mathlib.GroupTheory.OrderOfElement -import Mathlib.RepresentationTheory.Coinvariants +module + +public import Mathlib.Algebra.Homology.AlternatingConst +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.CategoryTheory.Preadditive.Projective.Resolution +public import Mathlib.GroupTheory.OrderOfElement +public import Mathlib.RepresentationTheory.Coinvariants /-! # Projective resolution of `k` as a trivial `k`-linear representation of a finite cyclic group @@ -37,6 +39,8 @@ this resolution to compute the group homology of representations of finite cycli -/ +@[expose] public section + universe v u open CategoryTheory Finsupp diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Basic.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Basic.lean index 109065adee89ee..64ec46c1fac00f 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Basic.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.Opposite -import Mathlib.Algebra.Homology.ConcreteCategory -import Mathlib.RepresentationTheory.Homological.Resolution -import Mathlib.Tactic.CategoryTheory.Slice +module + +public import Mathlib.Algebra.Homology.Opposite +public import Mathlib.Algebra.Homology.ConcreteCategory +public import Mathlib.RepresentationTheory.Homological.Resolution +public import Mathlib.Tactic.CategoryTheory.Slice /-! # The group cohomology of a `k`-linear `G`-representation @@ -63,6 +65,8 @@ Longer term: spectral sequences in general). -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Functoriality.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Functoriality.lean index ecf342336525ad..be7131b5b4a612 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Functoriality.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Functoriality.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic -import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree +module + +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree /-! # Functoriality of group cohomology @@ -26,6 +28,8 @@ We also provide extra API for these maps in degrees 0, 1, 2. -/ +@[expose] public section + universe v u namespace groupCohomology diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Hilbert90.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Hilbert90.lean index 7c41ee9b8dd211..978001e64aac83 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Hilbert90.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Hilbert90.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.FieldTheory.Fixed -import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree +module + +public import Mathlib.FieldTheory.Fixed +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree /-! # Hilbert's Theorem 90 @@ -46,6 +48,8 @@ statement is clearer. -/ +@[expose] public section + namespace groupCohomology namespace Hilbert90 diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean index 33e59ce920692f..d49c9e38517730 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.ConcreteCategory -import Mathlib.Algebra.Homology.HomologicalComplexAbelian -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Functoriality +module + +public import Mathlib.Algebra.Homology.ConcreteCategory +public import Mathlib.Algebra.Homology.HomologicalComplexAbelian +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Functoriality /-! # Long exact sequence in group cohomology @@ -25,6 +27,8 @@ to specialize API about long exact sequences to group cohomology. -/ +@[expose] public section + universe u v namespace groupCohomology diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean index a15564aba29ec2..0e0a392d46631e 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Joël Riou -/ -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic -import Mathlib.RepresentationTheory.Invariants +module + +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic +public import Mathlib.RepresentationTheory.Invariants /-! # The low-degree cohomology of a `k`-linear `G`-representation @@ -50,6 +52,8 @@ the `cocyclesₙ` in this file, for `n = 0, 1, 2`. -/ +@[expose] public section + universe v u noncomputable section diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Shapiro.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Shapiro.lean index 48ecead8a107a7..c63d41af2299dd 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/Shapiro.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/Shapiro.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Resolution -import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic -import Mathlib.RepresentationTheory.Coinduced -import Mathlib.RepresentationTheory.Induced +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Resolution +public import Mathlib.RepresentationTheory.Homological.GroupCohomology.Basic +public import Mathlib.RepresentationTheory.Coinduced +public import Mathlib.RepresentationTheory.Induced /-! # Shapiro's lemma for group cohomology @@ -28,6 +30,8 @@ Shapiro's lemma for group cohomology: `Hⁿ(G, Coind_S^G(A)) ≅ Hⁿ(S, A)` for !-/ +@[expose] public section + universe u namespace groupCohomology diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/Basic.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/Basic.lean index a4eed7b1bed95d..69fe47d86925ac 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/Basic.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.ConcreteCategory -import Mathlib.RepresentationTheory.Coinvariants -import Mathlib.RepresentationTheory.Homological.Resolution -import Mathlib.Tactic.CategoryTheory.Slice -import Mathlib.CategoryTheory.Abelian.LeftDerived +module + +public import Mathlib.Algebra.Homology.ConcreteCategory +public import Mathlib.RepresentationTheory.Coinvariants +public import Mathlib.RepresentationTheory.Homological.Resolution +public import Mathlib.Tactic.CategoryTheory.Slice +public import Mathlib.CategoryTheory.Abelian.LeftDerived /-! # The group homology of a `k`-linear `G`-representation @@ -69,6 +71,8 @@ for commutative rings. -/ +@[expose] public section + noncomputable section universe u diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/FiniteCyclic.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/FiniteCyclic.lean index 4f02bd51d4bc58..b26d7a4e5f50f6 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/FiniteCyclic.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/FiniteCyclic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.FiniteCyclic -import Mathlib.RepresentationTheory.Homological.GroupHomology.LowDegree +module + +public import Mathlib.RepresentationTheory.Homological.FiniteCyclic +public import Mathlib.RepresentationTheory.Homological.GroupHomology.LowDegree /-! # Group homology of a finite cyclic group @@ -32,6 +34,8 @@ computes group homology. -/ +@[expose] public section + universe v u open CategoryTheory Representation Finsupp Limits diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean index 1864df62b466e7..f96b3afc1aa0b4 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Homological.GroupHomology.LowDegree +module + +public import Mathlib.RepresentationTheory.Homological.GroupHomology.LowDegree /-! # Functoriality of group homology @@ -33,6 +35,8 @@ We also provide extra API for these maps in degrees 0, 1, 2. -/ +@[expose] public section + universe v u namespace groupHomology diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean index 179dfd3d802ceb..d75ba3062495d5 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.ConcreteCategory -import Mathlib.Algebra.Homology.HomologicalComplexAbelian -import Mathlib.RepresentationTheory.Homological.GroupHomology.Functoriality +module + +public import Mathlib.Algebra.Homology.ConcreteCategory +public import Mathlib.Algebra.Homology.HomologicalComplexAbelian +public import Mathlib.RepresentationTheory.Homological.GroupHomology.Functoriality /-! # Long exact sequence in group homology @@ -25,6 +27,8 @@ to specialize API about long exact sequences to group homology. -/ +@[expose] public section + universe v u namespace groupHomology diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean index cbfe484d6c4241..c1ac8c5dd25eb5 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.GroupTheory.Abelianization.Defs -import Mathlib.RepresentationTheory.Homological.GroupHomology.Basic -import Mathlib.RepresentationTheory.Invariants +module + +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.GroupTheory.Abelianization.Defs +public import Mathlib.RepresentationTheory.Homological.GroupHomology.Basic +public import Mathlib.RepresentationTheory.Invariants /-! # The low-degree homology of a `k`-linear `G`-representation @@ -43,6 +45,8 @@ We show that when the representation on `A` is trivial, `H₁(G, A) ≃+ Gᵃᵇ -/ +@[expose] public section + universe v u noncomputable section diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/Shapiro.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/Shapiro.lean index 1c05293072b20b..e4da087bd2fbb3 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/Shapiro.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/Shapiro.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.CategoryTheory.Preadditive.Projective.Resolution -import Mathlib.RepresentationTheory.Homological.GroupHomology.Basic -import Mathlib.RepresentationTheory.Coinduced -import Mathlib.RepresentationTheory.Induced +module + +public import Mathlib.CategoryTheory.Preadditive.Projective.Resolution +public import Mathlib.RepresentationTheory.Homological.GroupHomology.Basic +public import Mathlib.RepresentationTheory.Coinduced +public import Mathlib.RepresentationTheory.Induced /-! # Shapiro's lemma for group homology @@ -35,6 +37,8 @@ group homology, we conclude Shapiro's lemma: `Hₙ(G, Ind_S^G(A)) ≅ Hₙ(S, A) -/ +@[expose] public section + universe u namespace groupHomology diff --git a/Mathlib/RepresentationTheory/Homological/Resolution.lean b/Mathlib/RepresentationTheory/Homological/Resolution.lean index 5d22a98d34b5bb..d448b918b3bbb6 100644 --- a/Mathlib/RepresentationTheory/Homological/Resolution.lean +++ b/Mathlib/RepresentationTheory/Homological/Resolution.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Category.ModuleCat.Projective -import Mathlib.AlgebraicTopology.ExtraDegeneracy -import Mathlib.CategoryTheory.Abelian.Ext -import Mathlib.RepresentationTheory.Rep -import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced +module + +public import Mathlib.Algebra.Category.ModuleCat.Projective +public import Mathlib.AlgebraicTopology.ExtraDegeneracy +public import Mathlib.CategoryTheory.Abelian.Ext +public import Mathlib.RepresentationTheory.Rep +public import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced /-! # The standard and bar resolutions of `k` as a trivial `k`-linear `G`-representation @@ -58,6 +60,8 @@ computing group (co)homology. -/ +@[expose] public section + suppress_compilation noncomputable section diff --git a/Mathlib/RepresentationTheory/Induced.lean b/Mathlib/RepresentationTheory/Induced.lean index 8efe32eaf7bf1b..72697b77d89083 100644 --- a/Mathlib/RepresentationTheory/Induced.lean +++ b/Mathlib/RepresentationTheory/Induced.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RepresentationTheory.Coinvariants +module + +public import Mathlib.RepresentationTheory.Coinvariants /-! # Induced representations @@ -39,6 +41,8 @@ is used to prove Shapiro's lemma in -/ +@[expose] public section + universe u namespace Representation diff --git a/Mathlib/RepresentationTheory/Invariants.lean b/Mathlib/RepresentationTheory/Invariants.lean index 723705f9b8b3d5..56d1e8ef294dae 100644 --- a/Mathlib/RepresentationTheory/Invariants.lean +++ b/Mathlib/RepresentationTheory/Invariants.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Antoine Labelle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Labelle -/ -import Mathlib.RepresentationTheory.Basic -import Mathlib.RepresentationTheory.FDRep +module + +public import Mathlib.RepresentationTheory.Basic +public import Mathlib.RepresentationTheory.FDRep /-! # Subspace of invariants a group representation @@ -18,6 +20,8 @@ In order for the definition of the average element to make sense, we need to ass results that the order of `G` is invertible in `k` (e. g. `k` has characteristic `0`). -/ +@[expose] public section + suppress_compilation universe u diff --git a/Mathlib/RepresentationTheory/Maschke.lean b/Mathlib/RepresentationTheory/Maschke.lean index 8690edd9679367..943a78faf56a56 100644 --- a/Mathlib/RepresentationTheory/Maschke.lean +++ b/Mathlib/RepresentationTheory/Maschke.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.Algebra.MonoidAlgebra.Basic -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Maschke's theorem @@ -31,6 +33,8 @@ It's not so far to give the usual statement, that every finite-dimensional repre of a finite group is semisimple (i.e. a direct sum of irreducibles). -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RepresentationTheory/Rep.lean b/Mathlib/RepresentationTheory/Rep.lean index 37ab5146ed0374..585aeeb8d22a70 100644 --- a/Mathlib/RepresentationTheory/Rep.lean +++ b/Mathlib/RepresentationTheory/Rep.lean @@ -3,15 +3,17 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Category.ModuleCat.Adjunctions -import Mathlib.Algebra.Category.ModuleCat.EpiMono -import Mathlib.Algebra.Category.ModuleCat.Limits -import Mathlib.Algebra.Category.ModuleCat.Colimits -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric -import Mathlib.Algebra.Category.ModuleCat.Projective -import Mathlib.CategoryTheory.Elementwise -import Mathlib.CategoryTheory.Action.Monoidal -import Mathlib.RepresentationTheory.Basic +module + +public import Mathlib.Algebra.Category.ModuleCat.Adjunctions +public import Mathlib.Algebra.Category.ModuleCat.EpiMono +public import Mathlib.Algebra.Category.ModuleCat.Limits +public import Mathlib.Algebra.Category.ModuleCat.Colimits +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +public import Mathlib.Algebra.Category.ModuleCat.Projective +public import Mathlib.CategoryTheory.Elementwise +public import Mathlib.CategoryTheory.Action.Monoidal +public import Mathlib.RepresentationTheory.Basic /-! # `Rep k G` is the category of `k`-linear representations of `G`. @@ -27,6 +29,8 @@ We construct the categorical equivalence `Rep k G ≌ ModuleCat (MonoidAlgebra k We verify that `Rep k G` is a `k`-linear abelian symmetric monoidal category with all (co)limits. -/ +@[expose] public section + suppress_compilation universe u @@ -824,7 +828,7 @@ theorem repOfTprodIso_inv_apply (x : TensorProduct k V W) : (repOfTprodIso ρ τ end Representation /-! -# The categorical equivalence `Rep k G ≌ Module.{u} (MonoidAlgebra k G)`. +### The categorical equivalence `Rep k G ≌ Module.{u} (MonoidAlgebra k G)`. -/ diff --git a/Mathlib/RepresentationTheory/Submodule.lean b/Mathlib/RepresentationTheory/Submodule.lean index ab9c47c8e7c765..75dc75b80d5b42 100644 --- a/Mathlib/RepresentationTheory/Submodule.lean +++ b/Mathlib/RepresentationTheory/Submodule.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.Module.Submodule.Invariant -import Mathlib.RepresentationTheory.Basic +module + +public import Mathlib.Algebra.Module.Submodule.Invariant +public import Mathlib.RepresentationTheory.Basic /-! # Invariant submodules of a group representation -/ +@[expose] public section + variable {k G V : Type*} [CommSemiring k] [Monoid G] [AddCommMonoid V] [Module k V] (ρ : Representation k G V) diff --git a/Mathlib/RepresentationTheory/Tannaka.lean b/Mathlib/RepresentationTheory/Tannaka.lean index a234b493f5fb6f..b55c286fe4b356 100644 --- a/Mathlib/RepresentationTheory/Tannaka.lean +++ b/Mathlib/RepresentationTheory/Tannaka.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yacine Benmeuraiem. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yacine Benmeuraiem -/ -import Mathlib.RepresentationTheory.FDRep +module + +public import Mathlib.RepresentationTheory.FDRep /-! # Tannaka duality for finite groups @@ -21,6 +23,8 @@ The main result is the isomorphism `equiv : G ≃* Aut (forget k G)`. -/ +@[expose] public section + noncomputable section open CategoryTheory MonoidalCategory ModuleCat Finset Pi diff --git a/Mathlib/RingTheory/AdicCompletion/Algebra.lean b/Mathlib/RingTheory/AdicCompletion/Algebra.lean index 1bca86a8f018d1..72cc20a15ce022 100644 --- a/Mathlib/RingTheory/AdicCompletion/Algebra.lean +++ b/Mathlib/RingTheory/AdicCompletion/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.RingTheory.AdicCompletion.Basic +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.RingTheory.AdicCompletion.Basic /-! # Algebra instance on adic completion @@ -13,6 +15,13 @@ import Mathlib.RingTheory.AdicCompletion.Basic In this file we provide an algebra instance on the adic completion of a ring. Then the adic completion of any module is a module over the adic completion of the ring. +## Main definitions + +- `evalₐ`: the canonical algebra map from the adic completion to `R ⧸ I ^ n`. + +- `AdicCompletion.liftRingHom`: given a compatible family of ring maps + `R →+* S ⧸ I ^ n`, the lift ring map `R →+* AdicCompletion I S`. + ## Implementation details We do not make a separate adic completion type in algebra case, to not duplicate all @@ -22,6 +31,8 @@ providing as much API as possible. -/ +@[expose] public section + suppress_compilation open Submodule @@ -121,6 +132,29 @@ def evalₐ (n : ℕ) : AdicCompletion I R →ₐ[R] R ⧸ I ^ n := (Ideal.quotientEquivAlgOfEq R h) (AlgHom.ofLinearMap (eval I R n) rfl (fun _ _ ↦ rfl)) +theorem factor_evalₐ_eq_eval {n : ℕ} (x : AdicCompletion I R) (h : I ^ n ≤ I ^ n • ⊤) : + Ideal.Quotient.factor h (evalₐ I n x) = eval I R n x := by + simp [evalₐ] + +theorem factor_eval_eq_evalₐ {n : ℕ} (x : AdicCompletion I R) (h : I ^ n • ⊤ ≤ I ^ n) : + factor h (eval I R n x) = evalₐ I n x := by + simp [evalₐ] + +/-- +The composition map `R →+* AdicCompletion I R →+* R ⧸ I ^ n` equals to the natural quotient map. +-/ +@[simp] +theorem evalₐ_of (n : ℕ) (x : R) : + evalₐ I n (of I R x) = Ideal.Quotient.mk _ x := by + simp [evalₐ] + +theorem surjective_evalₐ (n : ℕ) : Function.Surjective (evalₐ I n) := by + simp only [evalₐ, smul_eq_mul, Ideal.quotientEquivAlgOfEq_coe_eq_factorₐ, + AlgHom.coe_comp] + apply Function.Surjective.comp + · exact factor_surjective Ideal.mul_le_right + · exact eval_surjective I R n + @[simp] theorem evalₐ_mk (n : ℕ) (x : AdicCauchySequence I R) : evalₐ I n (mk I R x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by @@ -276,4 +310,90 @@ example : module I = @Algebra.toModule (AdicCompletion I R) (AdicCompletion I R) _ _ (Algebra.id _) := by with_reducible_and_instances rfl +section liftRingHom + +open Ideal Quotient + +variable {R S : Type*} [NonAssocSemiring R] [CommRing S] (I : Ideal S) + +/-- +The universal property of `AdicCompletion` for rings. +The lift ring map `R →+* AdicCompletion I S` of a compatible family of +ring maps `R →+* S ⧸ I ^ n`. +-/ +def liftRingHom (f : (n : ℕ) → R →+* S ⧸ I ^ n) + (hf : ∀ {m n : ℕ} (hle : m ≤ n), (Ideal.Quotient.factorPow I hle).comp (f n) = f m) : + R →+* AdicCompletion I S where + toFun := fun x ↦ ⟨fun n ↦ (factor (le_of_eq (Ideal.mul_top _).symm)) (f n x), + fun hkl ↦ by simp [transitionMap, Submodule.factorPow, ← hf hkl]⟩ + map_add' x y := by + simp only [map_add] + ext; simp + map_zero' := by + simp only [map_zero] + ext; simp + map_mul' x y := by + simp only [mapQ_eq_factor, factor_eq_factor, map_mul] + ext; simp + map_one' := by + simp only [map_one] + ext; simp + +variable (f : (n : ℕ) → R →+* S ⧸ I ^ n) + (hf : ∀ {m n : ℕ} (hle : m ≤ n), (Ideal.Quotient.factorPow I hle).comp (f n) = f m) + +theorem factor_eval_liftRingHom (n : ℕ) (x : R) (h : I ^ n • ⊤ ≤ I ^ n) : + factor h (eval I S n (liftRingHom I f hf x)) = f n x := by + simp [liftRingHom, eval] + +@[simp] +theorem evalₐ_liftRingHom (n : ℕ) (x : R) : + evalₐ I n (liftRingHom I f hf x) = f n x := by + rw [← factor_eval_eq_evalₐ I _ (le_of_eq (Ideal.mul_top _))] + simp [liftRingHom, eval] + +@[simp] +theorem evalₐ_comp_liftRingHom (n : ℕ) : + (evalₐ I n : _ →+* _).comp (liftRingHom I f hf) = f n := by + ext; simp + +variable [IsAdicComplete I S] + +/-- +When `S` is `I`-adic complete, the canonical map from `S` to +its `I`-adic completion is an `S`-algebra isomorphism. +-/ +noncomputable def ofAlgEquiv : S ≃ₐ[S] AdicCompletion I S where + __ := ofLinearEquiv I S + map_mul' _ _ := by ext; simp + commutes' _ := rfl + +@[simp] +theorem ofAlgEquiv_apply (x : S) : ofAlgEquiv I x = of I S x := by + rfl + +@[simp] +theorem of_ofAlgEquiv_symm (x : AdicCompletion I S) : + of I S ((ofAlgEquiv I).symm x) = x := by + simp [ofAlgEquiv] + +@[simp] +theorem ofAlgEquiv_symm_of (x : S) : + (ofAlgEquiv I).symm (of I S x) = x := by + simp [ofAlgEquiv] + +theorem mk_smul_top_ofAlgEquiv_symm (n : ℕ) (x : AdicCompletion I S) : + Ideal.Quotient.mk (I ^ n • ⊤) ((ofAlgEquiv I).symm x) = eval I S n x := by + nth_rw 2 [← of_ofAlgEquiv_symm I x] + simp [-of_ofAlgEquiv_symm, eval] + +@[simp] +theorem mk_ofAlgEquiv_symm (n : ℕ) (x : AdicCompletion I S) : + Ideal.Quotient.mk (I ^ n) ((ofAlgEquiv I).symm x) = evalₐ I n x := by + simp only [evalₐ, AlgHom.coe_comp, Function.comp_apply, AlgHom.ofLinearMap_apply] + rw [← mk_smul_top_ofAlgEquiv_symm I n x] + simp + +end liftRingHom + end AdicCompletion diff --git a/Mathlib/RingTheory/AdicCompletion/AsTensorProduct.lean b/Mathlib/RingTheory/AdicCompletion/AsTensorProduct.lean index 85b677373bcb21..8172dfecdf4226 100644 --- a/Mathlib/RingTheory/AdicCompletion/AsTensorProduct.lean +++ b/Mathlib/RingTheory/AdicCompletion/AsTensorProduct.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.Algebra.FiveLemma -import Mathlib.LinearAlgebra.TensorProduct.Pi -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.AdicCompletion.Exactness -import Mathlib.RingTheory.Flat.Tensor +module + +public import Mathlib.Algebra.FiveLemma +public import Mathlib.LinearAlgebra.TensorProduct.Pi +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.AdicCompletion.Exactness +public import Mathlib.RingTheory.Flat.Tensor /-! @@ -35,6 +37,8 @@ As a corollary we obtain -/ +@[expose] public section + suppress_compilation universe u v diff --git a/Mathlib/RingTheory/AdicCompletion/Basic.lean b/Mathlib/RingTheory/AdicCompletion/Basic.lean index 0474cf6b2ce189..90c1c436fa98d6 100644 --- a/Mathlib/RingTheory/AdicCompletion/Basic.lean +++ b/Mathlib/RingTheory/AdicCompletion/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Judith Ludwig, Christian Merten, Jiedong Jiang -/ -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.LinearAlgebra.SModEq.Basic -import Mathlib.RingTheory.Ideal.Quotient.PowTransition -import Mathlib.RingTheory.Jacobson.Ideal +module + +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.LinearAlgebra.SModEq.Basic +public import Mathlib.RingTheory.Ideal.Quotient.PowTransition +public import Mathlib.RingTheory.Jacobson.Ideal /-! # Completion of a module with respect to an ideal. @@ -29,6 +31,8 @@ with respect to an ideal `I`: `I`-adically complete. -/ +@[expose] public section + suppress_compilation open Submodule Ideal Quotient @@ -67,6 +71,49 @@ theorem IsHausdorff.eq_iff_smodEq [IsHausdorff I M] {x y : M} : apply IsHausdorff.haus' (I := I) (x - y) simpa [SModEq.sub_mem] using h +variable (I) in +theorem IsHausdorff.funext {M : Type*} [IsHausdorff I N] {f g : M → N} + (h : ∀ n m, Submodule.Quotient.mk (p := (I ^ n • ⊤ : Submodule R N)) (f m) = + Submodule.Quotient.mk (g m)) : + f = g := by + ext m + rw [IsHausdorff.eq_iff_smodEq (I := I)] + intro n + exact h n m + +variable (I) in +theorem IsHausdorff.StrictMono.funext {M : Type*} [IsHausdorff I N] {f g : M → N} {a : ℕ → ℕ} + (ha : StrictMono a) (h : ∀ n m, Submodule.Quotient.mk (p := (I ^ a n • ⊤ : Submodule R N)) + (f m) = Submodule.Quotient.mk (g m)) : f = g := by + ext m + rw [IsHausdorff.eq_iff_smodEq (I := I)] + intro n + apply SModEq.mono (Submodule.pow_smul_top_le I N ha.le_apply) + exact h n m + +/-- +A variant of `IsHausdorff.funext`, where the target is a ring instead of a module. +-/ +theorem IsHausdorff.funext' {R S : Type*} [CommRing S] (I : Ideal S) [IsHausdorff I S] + {f g : R → S} (h : ∀ n r, Ideal.Quotient.mk (I ^ n) (f r) = Ideal.Quotient.mk (I ^ n) (g r)) : + f = g := by + ext r + rw [IsHausdorff.eq_iff_smodEq (I := I)] + intro n + simpa using h n r + +/-- +A variant of `IsHausdorff.StrictMono.funext`, where the target is a ring instead of a module. +-/ +theorem IsHausdorff.StrictMono.funext' {R S : Type*} [CommRing S] (I : Ideal S) [IsHausdorff I S] + {f g : R → S} {a : ℕ → ℕ} (ha : StrictMono a) (h : ∀ n r, Ideal.Quotient.mk (I ^ a n) (f r) = + Ideal.Quotient.mk (I ^ a n) (g r)) : f = g := by + ext m + rw [IsHausdorff.eq_iff_smodEq (I := I)] + intro n + apply SModEq.mono (Submodule.pow_smul_top_le I S ha.le_apply) + simpa using h n m + theorem IsPrecomplete.prec (_ : IsPrecomplete I M) {f : ℕ → M} : (∀ {m n}, m ≤ n → f m ≡ f n [SMOD (I ^ m • ⊤ : Submodule R M)]) → ∃ L : M, ∀ n, f n ≡ L [SMOD (I ^ n • ⊤ : Submodule R M)] := @@ -672,10 +719,10 @@ Then it is the map `IsAdicComplete.lift`. theorem eq_lift {f : (n : ℕ) → M →ₗ[R] N ⧸ (I ^ n • ⊤)} (h : ∀ {m n : ℕ} (hle : m ≤ n), factorPow I N hle ∘ₗ f n = f m) {F : M →ₗ[R] N} (hF : ∀ n, mkQ _ ∘ₗ F = f n) : F = lift I f h := by - ext s - rw [IsHausdorff.eq_iff_smodEq (I := I)] - intro n - simp [SModEq, ← hF n] + apply DFunLike.coe_injective + apply IsHausdorff.funext I + intro n m + simp [← hF n] end lift @@ -753,11 +800,10 @@ theorem mkQ_comp_lift {n : ℕ} : theorem eq_lift {F : M →ₗ[R] N} (hF : ∀ n, mkQ _ ∘ₗ F = f n) : F = lift I ha f hf := by - ext s - rw [IsHausdorff.eq_iff_smodEq (I := I)] - intro n - apply SModEq.mono (smul_mono_left (Ideal.pow_le_pow_right (ha.id_le n))) - simp [SModEq, ← hF n, mk_lift I ha f hf] + apply DFunLike.coe_injective + apply IsHausdorff.StrictMono.funext I ha + intro n m + simp [← hF n] end StrictMono diff --git a/Mathlib/RingTheory/AdicCompletion/Exactness.lean b/Mathlib/RingTheory/AdicCompletion/Exactness.lean index 20d563f9082fae..58432e6dfca930 100644 --- a/Mathlib/RingTheory/AdicCompletion/Exactness.lean +++ b/Mathlib/RingTheory/AdicCompletion/Exactness.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.Algebra.Exact -import Mathlib.RingTheory.AdicCompletion.Functoriality -import Mathlib.RingTheory.Filtration +module + +public import Mathlib.Algebra.Exact +public import Mathlib.RingTheory.AdicCompletion.Functoriality +public import Mathlib.RingTheory.Filtration /-! # Exactness of adic completion @@ -26,6 +28,8 @@ All results are proven directly without using Mittag-Leffler systems. -/ +@[expose] public section + universe u v w t open LinearMap diff --git a/Mathlib/RingTheory/AdicCompletion/Functoriality.lean b/Mathlib/RingTheory/AdicCompletion/Functoriality.lean index ccefa2370b9a3a..f9b4f7476ebb96 100644 --- a/Mathlib/RingTheory/AdicCompletion/Functoriality.lean +++ b/Mathlib/RingTheory/AdicCompletion/Functoriality.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Judith Ludwig, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Christian Merten -/ -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.RingTheory.AdicCompletion.Algebra -import Mathlib.Algebra.DirectSum.Basic +module + +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.RingTheory.AdicCompletion.Algebra +public import Mathlib.Algebra.DirectSum.Basic /-! # Functoriality of adic completions @@ -24,6 +26,8 @@ In this file we establish functorial properties of the adic completion. -/ +@[expose] public section + suppress_compilation variable {R : Type*} [CommRing R] (I : Ideal R) diff --git a/Mathlib/RingTheory/AdicCompletion/LocalRing.lean b/Mathlib/RingTheory/AdicCompletion/LocalRing.lean index 607c54988dae6a..5d7e2ad621976b 100644 --- a/Mathlib/RingTheory/AdicCompletion/LocalRing.lean +++ b/Mathlib/RingTheory/AdicCompletion/LocalRing.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ +module -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.RingTheory.LocalRing.Defs +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.RingTheory.LocalRing.Defs /-! # Basic Properties of Complete Local Ring @@ -15,6 +16,8 @@ ia a local ring (complete local ring). -/ +@[expose] public section + variable {R : Type*} [CommRing R] (m : Ideal R) [hmax : m.IsMaximal] open Ideal Quotient diff --git a/Mathlib/RingTheory/AdicCompletion/Noetherian.lean b/Mathlib/RingTheory/AdicCompletion/Noetherian.lean index 56d98832598f16..79b0985e5009c5 100644 --- a/Mathlib/RingTheory/AdicCompletion/Noetherian.lean +++ b/Mathlib/RingTheory/AdicCompletion/Noetherian.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.RingTheory.Filtration +module + +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.RingTheory.Filtration /-! # Hausdorff-ness for Noetherian rings -/ +@[expose] public section + open IsLocalRing variable {R : Type*} [CommRing R] (I : Ideal R) (M : Type*) [AddCommGroup M] [Module R M] diff --git a/Mathlib/RingTheory/AdicCompletion/RingHom.lean b/Mathlib/RingTheory/AdicCompletion/RingHom.lean new file mode 100644 index 00000000000000..9815ebe0540077 --- /dev/null +++ b/Mathlib/RingTheory/AdicCompletion/RingHom.lean @@ -0,0 +1,154 @@ +/- +Copyright (c) 2025 Jiedong Jiang. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Jiedong Jiang +-/ +module + +public import Mathlib.RingTheory.AdicCompletion.Algebra + +/-! +# Lift of ring homomorphisms to adic completions +Let `R`, `S` be rings, `I` be an ideal of `S`. +In this file we prove that a compatible family of ring homomorphisms from a ring `R` to +`S ⧸ I ^ n` can be lifted to a ring homomorphism `R →+* AdicCompletion I S`. +If `S` is `I`-adically complete, then this compatible family of ring homomorphisms can be +lifted to a ring homomorphism `R →+* S`. + +## Main definitions + +- `IsAdicComplete.liftRingHom`: if `R` is + `I`-adically complete, then a compatible family of + ring maps `S →+* R ⧸ I ^ n` can be lifted to a unique ring map `S →+* R`. + Together with `mk_liftRingHom_apply` and `eq_liftRingHom`, it gives the universal property + of `R` being `I`-adically complete. +-/ + +@[expose] public section + +open Ideal Quotient + +variable {R S : Type*} [NonAssocSemiring R] [CommRing S] (I : Ideal S) + +namespace IsAdicComplete + +open AdicCompletion + +section + +variable [IsAdicComplete I S] (f : (n : ℕ) → R →+* S ⧸ I ^ n) + (hf : ∀ {m n : ℕ} (hle : m ≤ n), (factorPow I hle).comp (f n) = f m) + +/-- +Universal property of `IsAdicComplete` for rings. +The lift ring map `lift I f hf : R →+* S` of a sequence of compatible +ring maps `f n : R →+* S ⧸ (I ^ n)`. +-/ +noncomputable def liftRingHom : + R →+* S := + ((ofAlgEquiv I).symm : _ →+* _).comp (AdicCompletion.liftRingHom I f hf) + +@[simp] +theorem of_liftRingHom (x : R) : + of I S (liftRingHom I f hf x) = (AdicCompletion.liftRingHom I f hf x) := by + simp [liftRingHom] + +@[simp] +theorem ofAlgEquiv_comp_liftRingHom : + (ofAlgEquiv I : S →+* AdicCompletion I S).comp (liftRingHom I f hf) = + AdicCompletion.liftRingHom I f hf := by + ext; simp + +/-- +The composition of lift linear map `lift I f hf : R →+* S` with the canonical +projection `S →+* S ⧸ (I ^ n)` is `f n` . +-/ +@[simp] +theorem mk_liftRingHom (n : ℕ) (x : R) : + Ideal.Quotient.mk (I ^ n) (liftRingHom I f hf x) = f n x := by + simp only [liftRingHom, RingHom.coe_comp, RingHom.coe_coe, Function.comp_apply] + rw [← evalₐ_of I n] + simp + +@[simp] +theorem mk_comp_liftRingHom (n : ℕ) : + (Ideal.Quotient.mk (I ^ n)).comp (liftRingHom I f hf) = f n := by + ext; simp + +/-- +Uniqueness of the lift. +Given a compatible family of linear maps `f n : R →ₗ[R] S ⧸ (I ^ n)`. +If `F : R →+* S` makes the following diagram commutes +``` + R + | \ + F| \ f n + | \ + v v + S --> S ⧸ (I ^ n) +``` +Then it is the map `IsAdicComplete.lift`. +-/ +theorem eq_liftRingHom (F : R →+* S) + (hF : ∀ n, (Ideal.Quotient.mk (I ^ n)).comp F = f n) : + F = liftRingHom I f hf := by + apply DFunLike.coe_injective + apply IsHausdorff.funext' I + intro n m + simp [← hF n] + +end + +namespace StrictMono + +variable {a : ℕ → ℕ} (ha : StrictMono a) (f : (n : ℕ) → R →+* S ⧸ I ^ a n) +variable (hf : ∀ {m}, (factorPow I (ha.monotone m.le_succ)).comp (f (m + 1)) = f m) + +variable {I} + +include hf in +/-- +`RingHom` variant of `IsAdicComplete.StrictMono.factorPow_comp_eq_of_factorPow_comp_succ_eq`. +-/ +theorem factorPow_comp_eq_of_factorPow_comp_succ_eq' + {m n : ℕ} (hle : m ≤ n) : (factorPow I (ha.monotone hle)).comp (f n) = f m := by + ext x + symm + refine Submodule.eq_factor_of_eq_factor_succ ?_ (fun n ↦ f n x) ?_ hle + · exact fun _ _ le ↦ Ideal.pow_le_pow_right (ha.monotone le) + · intro s + simp only [RingHom.ext_iff] at hf + simpa using (hf x).symm + +variable [IsAdicComplete I S] + +variable (I) +/-- +A variant of `IsAdicComplete.liftRingHom`. Only takes `f n : R →+* S ⧸ I ^ (a n)` +from a strictly increasing sequence `a n`. +-/ +noncomputable def liftRingHom : R →+* S := + IsAdicComplete.liftRingHom I (fun n ↦ (factorPow I (ha.id_le n)).comp (f n)) + (fun hle ↦ by ext; simp [← factorPow_comp_eq_of_factorPow_comp_succ_eq' ha f hf hle]) + +@[simp] +theorem mk_liftRingHom {n : ℕ} (x : R) : + Ideal.Quotient.mk _ (liftRingHom I ha f hf x) = f n x := by + simp [liftRingHom, IsAdicComplete.liftRingHom, + factorPow_comp_eq_of_factorPow_comp_succ_eq' ha f hf ha.le_apply] + +@[simp] +theorem mk_comp_liftRingHom {n : ℕ} : + (Ideal.Quotient.mk (I ^ (a n))).comp (liftRingHom I ha f hf) = f n := by + ext; simp + +theorem eq_liftRingHom {F : R →+* S} + (hF : ∀ n, (Ideal.Quotient.mk _).comp F = f n) : F = liftRingHom I ha f hf := by + apply DFunLike.coe_injective + apply IsHausdorff.StrictMono.funext' I ha + intro n m + simp [← hF n] + +end StrictMono + +end IsAdicComplete diff --git a/Mathlib/RingTheory/AdicCompletion/Topology.lean b/Mathlib/RingTheory/AdicCompletion/Topology.lean index 934f0e3de204d0..131ad829f7b5ee 100644 --- a/Mathlib/RingTheory/AdicCompletion/Topology.lean +++ b/Mathlib/RingTheory/AdicCompletion/Topology.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.Topology.Algebra.Nonarchimedean.AdicTopology +module + +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.Topology.Algebra.Nonarchimedean.AdicTopology /-! @@ -18,6 +20,8 @@ import Mathlib.Topology.Algebra.Nonarchimedean.AdicTopology -/ +@[expose] public section + section TopologicalSpace variable {R : Type*} [CommRing R] [TopologicalSpace R] {I : Ideal R} (hI : IsAdic I) diff --git a/Mathlib/RingTheory/Adjoin/Basic.lean b/Mathlib/RingTheory/Adjoin/Basic.lean index 16f824a98f84ad..d4ebf512ee705e 100644 --- a/Mathlib/RingTheory/Adjoin/Basic.lean +++ b/Mathlib/RingTheory/Adjoin/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Algebra.Subalgebra.Prod -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Prod +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Prod +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.LinearAlgebra.Prod /-! # Adjoining elements to form subalgebras @@ -18,6 +20,8 @@ adjoin, algebra -/ +@[expose] public section + assert_not_exists Polynomial universe uR uS uA uB diff --git a/Mathlib/RingTheory/Adjoin/Dimension.lean b/Mathlib/RingTheory/Adjoin/Dimension.lean index 630dc116b81060..e70c4c785a64cf 100644 --- a/Mathlib/RingTheory/Adjoin/Dimension.lean +++ b/Mathlib/RingTheory/Adjoin/Dimension.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Group.Pointwise.Set.Card -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.RingTheory.Adjoin.Basic +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Card +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.RingTheory.Adjoin.Basic /-! # Some results on dimensions of algebra adjoin @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Adjoin.Basic This file contains some results on dimensions of `Algebra.adjoin`. -/ +@[expose] public section + open Module universe u v diff --git a/Mathlib/RingTheory/Adjoin/FG.lean b/Mathlib/RingTheory/Adjoin/FG.lean index 49bae2e93e208e..e061c0d5b96226 100644 --- a/Mathlib/RingTheory/Adjoin/FG.lean +++ b/Mathlib/RingTheory/Adjoin/FG.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.MvPolynomial.Eval -import Mathlib.RingTheory.Adjoin.Basic -import Mathlib.RingTheory.Polynomial.Basic -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.RingTheory.Adjoin.Basic +public import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Adjoining elements to form subalgebras @@ -25,6 +27,8 @@ adjoin, algebra, finitely-generated algebra -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Adjoin/FGBaseChange.lean b/Mathlib/RingTheory/Adjoin/FGBaseChange.lean new file mode 100644 index 00000000000000..7f121e11b5cd64 --- /dev/null +++ b/Mathlib/RingTheory/Adjoin/FGBaseChange.lean @@ -0,0 +1,34 @@ +/- +Copyright (c) 2025 Dion Leijnse. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Dion Leijnse +-/ +module + +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.RingTheory.TensorProduct.Maps +public import Mathlib.RingTheory.Adjoin.FG + +/-! +# Finitely generated subalgebras of a base change obtained from an element + +## Main results +- `exists_fg_and_mem_baseChange`: given an element `x` of a tensor product `A ⊗[R] B` of two + `R`-algebras `A` and `B`, there exists a finitely generated subalgebra `C` of `B` such that `x` + is contained in `C ⊗[R] B`. + +-/ + +@[expose] public section + +open TensorProduct + +lemma exists_fg_and_mem_baseChange {R A B : Type*} [CommSemiring R] + [CommSemiring A] [Semiring B] [Algebra R A] [Algebra R B] (x : A ⊗[R] B) : + ∃ C : Subalgebra R B, C.FG ∧ x ∈ C.baseChange A := by + obtain ⟨S, hS⟩ := TensorProduct.exists_finset x + classical + refine ⟨Algebra.adjoin R (S.image fun j ↦ j.2), ?_, ?_⟩ + · exact Subalgebra.fg_adjoin_finset _ + · exact hS ▸ Subalgebra.sum_mem _ fun s hs ↦ (Subalgebra.tmul_mem_baseChange + (Algebra.subset_adjoin (Finset.mem_image_of_mem _ hs)) s.1) diff --git a/Mathlib/RingTheory/Adjoin/Field.lean b/Mathlib/RingTheory/Adjoin/Field.lean index 0011fdbf1974ae..320f33789a633c 100644 --- a/Mathlib/RingTheory/Adjoin/Field.lean +++ b/Mathlib/RingTheory/Adjoin/Field.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.RingTheory.Adjoin.Basic -import Mathlib.RingTheory.AdjoinRoot +module + +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.RingTheory.Adjoin.Basic +public import Mathlib.RingTheory.AdjoinRoot /-! # Adjoining elements to a field @@ -19,6 +21,8 @@ Some lemmas on the ring generated by adjoining an element to a field. then `Algebra.adjoin F s` embeds in `L`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/Adjoin/Polynomial.lean b/Mathlib/RingTheory/Adjoin/Polynomial.lean index ac0cd72f287987..aba98336608deb 100644 --- a/Mathlib/RingTheory/Adjoin/Polynomial.lean +++ b/Mathlib/RingTheory/Adjoin/Polynomial.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ -import Mathlib.Algebra.Polynomial.AlgebraMap +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap /-! # Polynomials and adjoining roots @@ -14,6 +16,8 @@ import Mathlib.Algebra.Polynomial.AlgebraMap adjoining an element to a commutative (semi)ring gives a commutative (semi)ring -/ +@[expose] public section + noncomputable section open Finset diff --git a/Mathlib/RingTheory/Adjoin/PowerBasis.lean b/Mathlib/RingTheory/Adjoin/PowerBasis.lean index 6d1a5c28c8dda0..449dda28d8723b 100644 --- a/Mathlib/RingTheory/Adjoin/PowerBasis.lean +++ b/Mathlib/RingTheory/Adjoin/PowerBasis.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Adjoin.Basic -import Mathlib.RingTheory.PowerBasis -import Mathlib.LinearAlgebra.Matrix.Basis +module + +public import Mathlib.RingTheory.Adjoin.Basic +public import Mathlib.RingTheory.PowerBasis +public import Mathlib.LinearAlgebra.Matrix.Basis /-! # Power basis for `Algebra.adjoin R {x}` @@ -14,6 +16,8 @@ This file defines the canonical power basis on `Algebra.adjoin R {x}`, where `x` is an integral element over `R`. -/ +@[expose] public section + open Module Polynomial PowerBasis variable {K S : Type*} [Field K] [CommRing S] [Algebra K S] diff --git a/Mathlib/RingTheory/Adjoin/Tower.lean b/Mathlib/RingTheory/Adjoin/Tower.lean index ee67b642948fd8..cd35fd4dbf7361 100644 --- a/Mathlib/RingTheory/Adjoin/Tower.lean +++ b/Mathlib/RingTheory/Adjoin/Tower.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.Adjoin.FG +module + +public import Mathlib.RingTheory.Adjoin.FG /-! # Adjoining elements and being finitely generated in an algebra tower @@ -16,6 +18,8 @@ import Mathlib.RingTheory.Adjoin.FG C is algebra-finite over A, and C is module-finite over B, then B is algebra-finite over A. -/ +@[expose] public section + open Pointwise diff --git a/Mathlib/RingTheory/AdjoinRoot.lean b/Mathlib/RingTheory/AdjoinRoot.lean index f6e2c4e2da0357..87d57d304bd777 100644 --- a/Mathlib/RingTheory/AdjoinRoot.lean +++ b/Mathlib/RingTheory/AdjoinRoot.lean @@ -3,16 +3,18 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Chris Hughes -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.FieldTheory.Minpoly.Basic -import Mathlib.RingTheory.Adjoin.Basic -import Mathlib.RingTheory.FinitePresentation -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Ideal.Quotient.Noetherian -import Mathlib.RingTheory.PowerBasis -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.RingTheory.Polynomial.Quotient +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.FieldTheory.Minpoly.Basic +public import Mathlib.RingTheory.Adjoin.Basic +public import Mathlib.RingTheory.FinitePresentation +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Ideal.Quotient.Noetherian +public import Mathlib.RingTheory.PowerBasis +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.RingTheory.Polynomial.Quotient /-! # Adjoining roots of polynomials @@ -46,6 +48,8 @@ The main definitions are in the `AdjoinRoot` namespace. -/ +@[expose] public section + noncomputable section open Algebra (FinitePresentation FiniteType) diff --git a/Mathlib/RingTheory/AlgebraTower.lean b/Mathlib/RingTheory/AlgebraTower.lean index 975ed0bd1a5eb2..326fceb2acb014 100644 --- a/Mathlib/RingTheory/AlgebraTower.lean +++ b/Mathlib/RingTheory/AlgebraTower.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.LinearAlgebra.Basis.Basic +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.LinearAlgebra.Basis.Basic /-! # Towers of algebras @@ -23,6 +25,8 @@ of `A`, then `{bi cj | i ∈ I, j ∈ J}` is an `R`-basis of `A`. This statement base rings to be a field, so we also generalize the lemma to rings in this file. -/ +@[expose] public section + open Module open scoped Pointwise diff --git a/Mathlib/RingTheory/Algebraic/Basic.lean b/Mathlib/RingTheory/Algebraic/Basic.lean index 43f2730a3d8bda..0b1d9961dd80e1 100644 --- a/Mathlib/RingTheory/Algebraic/Basic.lean +++ b/Mathlib/RingTheory/Algebraic/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.Expand -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Algebraic.Defs -import Mathlib.RingTheory.Polynomial.Tower +module + +public import Mathlib.Algebra.Polynomial.Expand +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Algebraic.Defs +public import Mathlib.RingTheory.Polynomial.Tower /-! # Algebraic elements and algebraic extensions @@ -18,6 +20,8 @@ The main result in this file proves transitivity of algebraicity: a tower of algebraic field extensions is algebraic. -/ +@[expose] public section + universe u v w open Polynomial nonZeroDivisors diff --git a/Mathlib/RingTheory/Algebraic/Cardinality.lean b/Mathlib/RingTheory/Algebraic/Cardinality.lean index e520e97253903a..a389977dd09443 100644 --- a/Mathlib/RingTheory/Algebraic/Cardinality.lean +++ b/Mathlib/RingTheory/Algebraic/Cardinality.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Polynomial.Cardinal -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.RingTheory.Algebraic.Defs +module + +public import Mathlib.Algebra.Polynomial.Cardinal +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.RingTheory.Algebraic.Defs /-! # Cardinality of algebraic extensions @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Algebraic.Defs This file contains results on cardinality of algebraic extensions. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Algebraic/Defs.lean b/Mathlib/RingTheory/Algebraic/Defs.lean index b1e0042b4bd310..6927514be63269 100644 --- a/Mathlib/RingTheory/Algebraic/Defs.lean +++ b/Mathlib/RingTheory/Algebraic/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.AlgebraMap +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap /-! # Algebraic elements and algebraic extensions @@ -26,6 +28,8 @@ An R-algebra is algebraic over R if and only if all its elements are algebraic o * `Subalgebra.isAlgebraic_iff`: a subalgebra is algebraic iff it is algebraic as an algebra. -/ +@[expose] public section + assert_not_exists IsIntegralClosure LinearIndependent IsLocalRing MvPolynomial universe u v w diff --git a/Mathlib/RingTheory/Algebraic/Integral.lean b/Mathlib/RingTheory/Algebraic/Integral.lean index cd21e785ee4fab..04bbf6996ccfa7 100644 --- a/Mathlib/RingTheory/Algebraic/Integral.lean +++ b/Mathlib/RingTheory/Algebraic/Integral.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.LinearAlgebra.Dimension.Localization -import Mathlib.RingTheory.Algebraic.Basic -import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic -import Mathlib.RingTheory.Localization.BaseChange +module + +public import Mathlib.LinearAlgebra.Dimension.Localization +public import Mathlib.RingTheory.Algebraic.Basic +public import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic +public import Mathlib.RingTheory.Localization.BaseChange /-! # Algebraic elements and integral elements @@ -33,6 +35,8 @@ is algebraic and that every algebraic element over a field is integral. remains transcendental over any algebraic `R`-subalgebra that has no zero divisors. -/ +@[expose] public section + assert_not_exists IsLocalRing universe u v w diff --git a/Mathlib/RingTheory/Algebraic/LinearIndependent.lean b/Mathlib/RingTheory/Algebraic/LinearIndependent.lean index a8cd4b11006a1c..288a66c5ecd779 100644 --- a/Mathlib/RingTheory/Algebraic/LinearIndependent.lean +++ b/Mathlib/RingTheory/Algebraic/LinearIndependent.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.LinearAlgebra.LinearIndependent.Defs -import Mathlib.RingTheory.Algebraic.Defs +module + +public import Mathlib.LinearAlgebra.LinearIndependent.Defs +public import Mathlib.RingTheory.Algebraic.Defs /-! # Linear independence of transcendental elements @@ -15,6 +17,8 @@ import Mathlib.RingTheory.Algebraic.Defs then `{(x - a)⁻¹ | a : F}` is linearly independent over `F`. -/ +@[expose] public section + open Polynomial section diff --git a/Mathlib/RingTheory/Algebraic/MvPolynomial.lean b/Mathlib/RingTheory/Algebraic/MvPolynomial.lean index 0de432433d874b..3b353ad30a6a39 100644 --- a/Mathlib/RingTheory/Algebraic/MvPolynomial.lean +++ b/Mathlib/RingTheory/Algebraic/MvPolynomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Supported -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Algebraic.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Supported +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Algebraic.Basic /-! # Transcendental elements in `MvPolynomial` @@ -14,6 +16,8 @@ This file lists some results on some elements in `MvPolynomial σ R` being trans over the base ring `R` and subrings `MvPolynomial.supported` of `MvPolynomial σ R`. -/ +@[expose] public section + universe u v w open Polynomial diff --git a/Mathlib/RingTheory/Algebraic/Pi.lean b/Mathlib/RingTheory/Algebraic/Pi.lean index 57b5f116787c47..587817b124cd93 100644 --- a/Mathlib/RingTheory/Algebraic/Pi.lean +++ b/Mathlib/RingTheory/Algebraic/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.AlgebraMap +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap /-! # Algebraic functions @@ -11,6 +13,8 @@ import Mathlib.Algebra.Polynomial.AlgebraMap This file defines algebraic functions as the image of the `algebraMap R[X] (R → S)`. -/ +@[expose] public section + assert_not_exists IsIntegralClosure LinearIndependent IsLocalRing MvPolynomial open Polynomial diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean b/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean index 66a7c7a829c695..b7bfb4a3f0bd0c 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra -import Mathlib.RingTheory.AlgebraicIndependent.Defs +module + +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra +public import Mathlib.RingTheory.AlgebraicIndependent.Defs /-! # Algebraic Independence @@ -21,6 +23,8 @@ This file concerns adjoining an algebraic independent family to a field. `AlgebraicIndependent.aevalEquivField`. -/ +@[expose] public section + noncomputable section open Function Set Subalgebra MvPolynomial Algebra diff --git a/Mathlib/RingTheory/AlgebraicIndependent/AlgebraicClosure.lean b/Mathlib/RingTheory/AlgebraicIndependent/AlgebraicClosure.lean index e1a33f7a70d9cf..90f874c3d7a647 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/AlgebraicClosure.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/AlgebraicClosure.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.FieldTheory.AlgebraicClosure -import Mathlib.RingTheory.Algebraic.Integral -import Mathlib.RingTheory.AlgebraicIndependent.Transcendental +module + +public import Mathlib.FieldTheory.AlgebraicClosure +public import Mathlib.RingTheory.Algebraic.Integral +public import Mathlib.RingTheory.AlgebraicIndependent.Transcendental /-! # Algebraic independence persists to the algebraic closure @@ -20,6 +22,8 @@ import Mathlib.RingTheory.AlgebraicIndependent.Transcendental algebraically independent over the algebraic closure. -/ +@[expose] public section + open Function Algebra section diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean b/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean index 5d24c626f9708e..20c92a73c74568 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Algebra.MvPolynomial.Monad -import Mathlib.Algebra.MvPolynomial.Supported -import Mathlib.RingTheory.AlgebraicIndependent.Defs -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.MvPolynomial.Basic +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Algebra.MvPolynomial.Monad +public import Mathlib.Algebra.MvPolynomial.Supported +public import Mathlib.RingTheory.AlgebraicIndependent.Defs +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.MvPolynomial.Basic /-! # Algebraic Independence @@ -25,6 +27,8 @@ transcendence basis, transcendence degree, transcendence -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Defs.lean b/Mathlib/RingTheory/AlgebraicIndependent/Defs.lean index 13782f15671102..bf0f60e87f4374 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Defs.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.MvPolynomial.CommRing +module + +public import Mathlib.Algebra.MvPolynomial.CommRing /-! # Algebraic Independence @@ -36,6 +38,8 @@ We show that algebraic independence is preserved under injective maps of the ind -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean b/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean index 5c81f625102826..53776481753041 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic -import Mathlib.FieldTheory.MvRatFunc.Rank -import Mathlib.RingTheory.Algebraic.Cardinality -import Mathlib.RingTheory.AlgebraicIndependent.Adjoin -import Mathlib.RingTheory.AlgebraicIndependent.Transcendental -import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis +module + +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic +public import Mathlib.FieldTheory.MvRatFunc.Rank +public import Mathlib.RingTheory.Algebraic.Cardinality +public import Mathlib.RingTheory.AlgebraicIndependent.Adjoin +public import Mathlib.RingTheory.AlgebraicIndependent.Transcendental +public import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis /-! # Cardinality of a transcendence basis @@ -28,6 +30,8 @@ transcendence basis, transcendence degree, transcendence -/ +@[expose] public section + noncomputable section open Function Set Subalgebra MvPolynomial Algebra diff --git a/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean b/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean index a33d060a840c72..a20637bb8c4ee3 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Combinatorics.Matroid.IndepAxioms -import Mathlib.Combinatorics.Matroid.Rank.Cardinal -import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra -import Mathlib.RingTheory.AlgebraicIndependent.Transcendental +module + +public import Mathlib.Combinatorics.Matroid.IndepAxioms +public import Mathlib.Combinatorics.Matroid.Rank.Cardinal +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra +public import Mathlib.RingTheory.AlgebraicIndependent.Transcendental /-! # Transcendence basis @@ -32,6 +34,8 @@ transcendence basis, transcendence degree, transcendence -/ +@[expose] public section + noncomputable section open Function Set Subalgebra MvPolynomial Algebra diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean b/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean index d834d49f806412..47386ea422feb6 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Fin.Tuple.Reflection -import Mathlib.RingTheory.Algebraic.MvPolynomial -import Mathlib.RingTheory.AlgebraicIndependent.Basic +module + +public import Mathlib.Data.Fin.Tuple.Reflection +public import Mathlib.RingTheory.Algebraic.MvPolynomial +public import Mathlib.RingTheory.AlgebraicIndependent.Basic /-! # Algebraic Independence @@ -21,6 +23,8 @@ transcendence -/ +@[expose] public section + noncomputable section open Function Set Subalgebra MvPolynomial Algebra diff --git a/Mathlib/RingTheory/Artinian/Algebra.lean b/Mathlib/RingTheory/Artinian/Algebra.lean index fb308d37ee3898..1d214158a37fd7 100644 --- a/Mathlib/RingTheory/Artinian/Algebra.lean +++ b/Mathlib/RingTheory/Artinian/Algebra.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Michal Staromiejski. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michal Staromiejski -/ -import Mathlib.RingTheory.Artinian.Module -import Mathlib.RingTheory.IntegralClosure.Algebra.Defs -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +module + +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.RingTheory.IntegralClosure.Algebra.Defs +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic /-! # Algebras over Artinian rings @@ -13,6 +15,8 @@ import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic In this file we collect results about algebras over Artinian rings. -/ +@[expose] public section + namespace IsArtinianRing variable {R A : Type*} diff --git a/Mathlib/RingTheory/Artinian/Instances.lean b/Mathlib/RingTheory/Artinian/Instances.lean index b75ae29ad5d635..d6d4ab1ff816cf 100644 --- a/Mathlib/RingTheory/Artinian/Instances.lean +++ b/Mathlib/RingTheory/Artinian/Instances.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Divisibility.Prod -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.RingTheory.Artinian.Module +module + +public import Mathlib.Algebra.Divisibility.Prod +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.RingTheory.Artinian.Module /-! # Instances related to Artinian rings @@ -14,6 +16,8 @@ We show that every reduced Artinian ring and the polynomial ring over it are decomposition monoids, and every reduced Artinian ring is semisimple. -/ +@[expose] public section + namespace IsArtinianRing variable (R : Type*) [CommRing R] [IsArtinianRing R] [IsReduced R] diff --git a/Mathlib/RingTheory/Artinian/Module.lean b/Mathlib/RingTheory/Artinian/Module.lean index 815b6593fb9a65..da63f2519c3c53 100644 --- a/Mathlib/RingTheory/Artinian/Module.lean +++ b/Mathlib/RingTheory/Artinian/Module.lean @@ -3,17 +3,20 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Group.Units.Opposite -import Mathlib.Algebra.Regular.Opposite -import Mathlib.Data.SetLike.Fintype -import Mathlib.Order.Filter.EventuallyConst -import Mathlib.RingTheory.Ideal.Prod -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Jacobson.Semiprimary -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.RingTheory.Noetherian.Defs -import Mathlib.RingTheory.Spectrum.Maximal.Basic -import Mathlib.RingTheory.Spectrum.Prime.Basic +module + +public import Mathlib.Algebra.Group.Units.Opposite +public import Mathlib.Algebra.Regular.Opposite +public import Mathlib.Data.SetLike.Fintype +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.Order.Filter.EventuallyConst +public import Mathlib.RingTheory.Ideal.Prod +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Jacobson.Semiprimary +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.RingTheory.Noetherian.Defs +public import Mathlib.RingTheory.Spectrum.Maximal.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Basic /-! # Artinian rings and modules @@ -59,6 +62,8 @@ Artinian, artinian, Artinian ring, Artinian module, artinian ring, artinian modu -/ +@[expose] public section + open Set Filter Pointwise /-- `IsArtinian R M` is the proposition that `M` is an Artinian `R`-module, @@ -440,6 +445,12 @@ theorem IsArtinianRing.of_finite (R S) [Ring R] [Ring S] [Module R S] [IsScalarT [IsArtinianRing R] [Module.Finite R S] : IsArtinianRing S := isArtinian_of_tower R isArtinian_of_fg_of_artinian' +instance (n R) [Fintype n] [DecidableEq n] [Ring R] [IsNoetherianRing R] : + IsNoetherianRing (Matrix n n R) := .of_finite R _ + +instance (n R) [Fintype n] [DecidableEq n] [Ring R] [IsArtinianRing R] : + IsArtinianRing (Matrix n n R) := .of_finite R _ + /-- In a module over an Artinian ring, the submodule generated by finitely many vectors is Artinian. -/ theorem isArtinian_span_of_finite (R) {M} [Ring R] [AddCommGroup M] [Module R M] [IsArtinianRing R] diff --git a/Mathlib/RingTheory/Artinian/Ring.lean b/Mathlib/RingTheory/Artinian/Ring.lean index 16ab080138896d..7553b1c73cb62b 100644 --- a/Mathlib/RingTheory/Artinian/Ring.lean +++ b/Mathlib/RingTheory/Artinian/Ring.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Junyan Xu, Jujian Zhang -/ -import Mathlib.Algebra.Field.Equiv -import Mathlib.RingTheory.Artinian.Module -import Mathlib.RingTheory.Localization.Defs -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +module + +public import Mathlib.Algebra.Field.Equiv +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic /-! # Artinian rings @@ -42,6 +44,8 @@ Artinian, artinian, Artinian ring, artinian ring -/ +@[expose] public section + open Set Submodule IsArtinian namespace IsArtinianRing diff --git a/Mathlib/RingTheory/Bezout.lean b/Mathlib/RingTheory/Bezout.lean index 7165d84edf0bea..05c83518e705cf 100644 --- a/Mathlib/RingTheory/Bezout.lean +++ b/Mathlib/RingTheory/Bezout.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.RingTheory.PrincipalIdealDomain /-! @@ -18,6 +20,8 @@ Notable examples include principal ideal rings, valuation rings, and the ring of -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Bialgebra/Basic.lean b/Mathlib/RingTheory/Bialgebra/Basic.lean index 0bc811d24f1b34..64adc4d671e58a 100644 --- a/Mathlib/RingTheory/Bialgebra/Basic.lean +++ b/Mathlib/RingTheory/Bialgebra/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Ali Ramsey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ali Ramsey, Kevin Buzzard -/ -import Mathlib.RingTheory.Coalgebra.Basic -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.RingTheory.Coalgebra.Basic +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Bialgebras @@ -43,6 +45,8 @@ that satisfy the coalgebra axioms to define a bialgebra structure on `A`. bialgebra -/ +@[expose] public section + universe u v w open Function @@ -166,6 +170,8 @@ namespace Bialgebra variable {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] +@[simp] lemma counitAlgHom_self : counitAlgHom R R = .id R R := rfl + /-- If `R` is a commutative semiring and `A` is an `R`-algebra, then `Bialgebra.ofAlgHom` consumes the counit and comultiplication as algebra homomorphisms that satisfy the coalgebra axioms to define diff --git a/Mathlib/RingTheory/Bialgebra/Equiv.lean b/Mathlib/RingTheory/Bialgebra/Equiv.lean index ec0dcb03606255..fc30dd95d867a0 100644 --- a/Mathlib/RingTheory/Bialgebra/Equiv.lean +++ b/Mathlib/RingTheory/Bialgebra/Equiv.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RingTheory.Coalgebra.Equiv -import Mathlib.RingTheory.Bialgebra.Hom +module + +public import Mathlib.RingTheory.Coalgebra.Equiv +public import Mathlib.RingTheory.Bialgebra.Hom /-! # Isomorphisms of `R`-bialgebras @@ -21,6 +23,8 @@ This file defines bundled isomorphisms of `R`-bialgebras. We simply mimic the ea * `A ≃ₐc[R] B` : `R`-bialgebra equivalence from `A` to `B`. -/ +@[expose] public section + universe u v w u₁ variable {R : Type u} {A : Type v} {B : Type w} {C : Type u₁} diff --git a/Mathlib/RingTheory/Bialgebra/GroupLike.lean b/Mathlib/RingTheory/Bialgebra/GroupLike.lean new file mode 100644 index 00000000000000..16f36b51f847d7 --- /dev/null +++ b/Mathlib/RingTheory/Bialgebra/GroupLike.lean @@ -0,0 +1,91 @@ +/- +Copyright (c) 2025 Yaël Dillies, Michał Mrugała. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Yaël Dillies, Michał Mrugała +-/ +module + +public import Mathlib.RingTheory.Bialgebra.Basic +public import Mathlib.RingTheory.Coalgebra.GroupLike + +/-! +# Group-like elements in a bialgebra + +This file proves that group-like elements in a bialgebra form a monoid. +-/ + +@[expose] public section + +open Coalgebra Bialgebra + +variable {R A : Type*} + +section Semiring +variable [CommSemiring R] [Semiring A] [Bialgebra R A] {a b : A} + +/-- In a bialgebra, `1` is a group-like element. -/ +lemma IsGroupLikeElem.one : IsGroupLikeElem R (1 : A) where + counit_eq_one := counit_one + comul_eq_tmul_self := comul_one + +/-- Group-like elements in a bialgebra are stable under multiplication. -/ +lemma IsGroupLikeElem.mul (ha : IsGroupLikeElem R a) (hb : IsGroupLikeElem R b) : + IsGroupLikeElem R (a * b) where + counit_eq_one := by simp [ha, hb] + comul_eq_tmul_self := by simp [ha, hb] + +variable (R A) in +/-- The group-like elements form a submonoid. -/ +def groupLikeSubmonoid : Submonoid A where + carrier := {a | IsGroupLikeElem R a} + one_mem' := .one + mul_mem' := .mul + +/-- Group-like elements in a bialgebra are stable under power. -/ +lemma IsGroupLikeElem.pow {n : ℕ} (ha : IsGroupLikeElem R a) : IsGroupLikeElem R (a ^ n) := + (groupLikeSubmonoid R A).pow_mem ha _ + +/-- Group-like elements in a bialgebra are stable under inverses, when they exist. -/ +lemma IsGroupLikeElem.of_mul_eq_one (hab : a * b = 1) (hba : b * a = 1) (ha : IsGroupLikeElem R a) : + IsGroupLikeElem R b where + counit_eq_one := + left_inv_eq_right_inv (a := counit a) (by simp [← counit_mul, hba]) (by simp [ha]) + comul_eq_tmul_self := left_inv_eq_right_inv (a := comul a) (by simp [← comul_mul, hba]) + (by simp [ha, hab, Algebra.TensorProduct.one_def]) + +/-- Group-like elements in a bialgebra are stable under inverses, when they exist. -/ +lemma isGroupLikeElem_iff_of_mul_eq_one (hab : a * b = 1) (hba : b * a = 1) : + IsGroupLikeElem R a ↔ IsGroupLikeElem R b := ⟨.of_mul_eq_one hab hba, .of_mul_eq_one hba hab⟩ + +@[simp] lemma isGroupLikeElem_unitsInv {u : Aˣ} : + IsGroupLikeElem R u⁻¹.val ↔ IsGroupLikeElem R u.val := + isGroupLikeElem_iff_of_mul_eq_one (by simp) (by simp) + +alias ⟨IsGroupLikeElem.of_unitsInv, IsGroupLikeElem.unitsInv⟩ := isGroupLikeElem_unitsInv + +namespace GroupLike + +instance : One (GroupLike R A) where one := ⟨1, .one⟩ +instance : Mul (GroupLike R A) where mul a b := ⟨a * b, a.2.mul b.2⟩ +instance : Pow (GroupLike R A) ℕ where pow a n := ⟨a ^ n, a.2.pow⟩ + +@[simp] lemma val_one : (1 : GroupLike R A) = (1 : A) := rfl +@[simp] lemma val_mul (a b : GroupLike R A) : ↑(a * b) = (a * b : A) := rfl +@[simp] lemma val_pow (a : GroupLike R A) (n : ℕ) : ↑(a ^ n) = (a ^ n : A) := rfl + +instance : Monoid (GroupLike R A) := val_injective.monoid val val_one val_mul val_pow + +variable (R A) in +/-- `GroupLike.val` as a monoid hom. -/ +@[simps] def valMonoidHom : GroupLike R A →* A where + toFun := val + map_one' := val_one + map_mul' := val_mul + +end GroupLike +end Semiring + +variable [CommSemiring R] [CommSemiring A] [Bialgebra R A] {a b : A} + +instance GroupLike.instCommMonoid : CommMonoid (GroupLike R A) := + val_injective.commMonoid val val_one val_mul val_pow diff --git a/Mathlib/RingTheory/Bialgebra/Hom.lean b/Mathlib/RingTheory/Bialgebra/Hom.lean index 19e68030ece035..a41ff61be2ce51 100644 --- a/Mathlib/RingTheory/Bialgebra/Hom.lean +++ b/Mathlib/RingTheory/Bialgebra/Hom.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov, Amelia Livingston -/ -import Mathlib.RingTheory.Coalgebra.Hom -import Mathlib.RingTheory.Bialgebra.Basic +module + +public import Mathlib.RingTheory.Coalgebra.Hom +public import Mathlib.RingTheory.Bialgebra.Basic /-! # Homomorphisms of `R`-bialgebras @@ -24,6 +26,8 @@ This file defines bundled homomorphisms of `R`-bialgebras. We simply mimic -/ +@[expose] public section + open TensorProduct Bialgebra Coalgebra Function universe u v w @@ -330,6 +334,8 @@ theorem counitBialgHom_apply (x : A) : theorem counitBialgHom_toCoalgHom : counitBialgHom R A = Coalgebra.counitCoalgHom R A := rfl +@[simp] lemma counitBialgHom_self : counitBialgHom R R = .id R R := rfl + instance subsingleton_to_ring : Subsingleton (A →ₐc[R] R) := ⟨fun _ _ => BialgHom.coe_coalgHom_injective (Subsingleton.elim _ _)⟩ diff --git a/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean b/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean index 122f230a1ef978..208267c0b86e1d 100644 --- a/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean +++ b/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Yaël Dillies, Michał Mrugała -/ -import Mathlib.RingTheory.Bialgebra.Hom -import Mathlib.RingTheory.Coalgebra.MonoidAlgebra +module + +public import Mathlib.RingTheory.Bialgebra.Hom +public import Mathlib.RingTheory.Coalgebra.MonoidAlgebra /-! # The bialgebra structure on monoid algebras @@ -22,6 +24,8 @@ coalgebra structure. `A[T;T⁻¹]` when `A` is an `R`-bialgebra. -/ +@[expose] public section + noncomputable section open Bialgebra diff --git a/Mathlib/RingTheory/Bialgebra/TensorProduct.lean b/Mathlib/RingTheory/Bialgebra/TensorProduct.lean index 1fb7112d53bd0c..f84cbf5f18a87a 100644 --- a/Mathlib/RingTheory/Bialgebra/TensorProduct.lean +++ b/Mathlib/RingTheory/Bialgebra/TensorProduct.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Andrew Yang -/ -import Mathlib.RingTheory.Bialgebra.Equiv -import Mathlib.RingTheory.Coalgebra.TensorProduct -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.RingTheory.Bialgebra.Equiv +public import Mathlib.RingTheory.Coalgebra.TensorProduct +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Tensor products of bialgebras @@ -16,6 +18,8 @@ instance on a tensor product of bialgebras, and the tensor product of two `Bialg -/ +@[expose] public section + open scoped TensorProduct namespace Bialgebra.TensorProduct @@ -45,6 +49,17 @@ noncomputable instance _root_.TensorProduct.instBialgebra : Bialgebra S (A ⊗[R simp_all only [AlgHom.toLinearMap_apply] <;> simp only [map_one, map_mul] +lemma counitAlgHom_def : + counitAlgHom (R := S) (A := A ⊗[R] B) = + (Algebra.TensorProduct.rid _ _ _).toAlgHom.comp (Algebra.TensorProduct.map + (Bialgebra.counitAlgHom S A) (Bialgebra.counitAlgHom R B)) := rfl + +lemma comulAlgHom_def : + comulAlgHom (R := S) (A := A ⊗[R] B) = + (Algebra.TensorProduct.tensorTensorTensorComm R S R S A A B B).toAlgHom.comp + (Algebra.TensorProduct.map (Bialgebra.comulAlgHom S A) + (Bialgebra.comulAlgHom R B)) := rfl + variable {R S A B C D} variable [Semiring C] [Semiring D] [Bialgebra S C] diff --git a/Mathlib/RingTheory/Binomial.lean b/Mathlib/RingTheory/Binomial.lean index 72e010d200acab..b3354518361bde 100644 --- a/Mathlib/RingTheory/Binomial.lean +++ b/Mathlib/RingTheory/Binomial.lean @@ -3,16 +3,18 @@ Copyright (c) 2023 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Algebra.Group.Torsion -import Mathlib.Algebra.Module.Rat -import Mathlib.Algebra.Polynomial.Smeval -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.Data.NNRat.Order -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.RingTheory.Polynomial.Pochhammer -import Mathlib.Tactic.Field -import Mathlib.Tactic.Module +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Algebra.Group.Torsion +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Algebra.Polynomial.Smeval +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.Data.NNRat.Order +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.RingTheory.Polynomial.Pochhammer +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.Module /-! # Binomial rings @@ -63,6 +65,8 @@ Further results in Elliot's paper: -/ +@[expose] public section + open Function Polynomial /-- A binomial ring is a ring for which ascending Pochhammer evaluations are uniquely divisible by diff --git a/Mathlib/RingTheory/ChainOfDivisors.lean b/Mathlib/RingTheory/ChainOfDivisors.lean index bce41f7fb584e5..a032f08ca00acf 100644 --- a/Mathlib/RingTheory/ChainOfDivisors.lean +++ b/Mathlib/RingTheory/ChainOfDivisors.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Paul Lezeau -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Algebra.IsPrimePow -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity -import Mathlib.Order.Atoms -import Mathlib.Order.Hom.Bounded +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Algebra.IsPrimePow +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity +public import Mathlib.Order.Atoms +public import Mathlib.Order.Hom.Bounded /-! # Chains of divisors @@ -35,6 +37,8 @@ and the set of factors of `a`. -/ +@[expose] public section + assert_not_exists Field variable {M : Type*} [CancelCommMonoidWithZero M] diff --git a/Mathlib/RingTheory/ClassGroup.lean b/Mathlib/RingTheory/ClassGroup.lean index 0b5ca13922d893..39b01a267aea68 100644 --- a/Mathlib/RingTheory/ClassGroup.lean +++ b/Mathlib/RingTheory/ClassGroup.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.DedekindDomain.Ideal.Basic +module + +public import Mathlib.RingTheory.DedekindDomain.Ideal.Basic /-! # The ideal class group @@ -27,6 +29,8 @@ The definition of `ClassGroup R` involves `FractionRing R`. However, the API sho identical no matter the choice of field of fractions for `R`. -/ +@[expose] public section + variable {R K : Type*} [CommRing R] [Field K] [Algebra R K] [IsFractionRing R K] diff --git a/Mathlib/RingTheory/Coalgebra/Basic.lean b/Mathlib/RingTheory/Coalgebra/Basic.lean index 0e2beeab1b6a8d..3b8f83c02b6555 100644 --- a/Mathlib/RingTheory/Coalgebra/Basic.lean +++ b/Mathlib/RingTheory/Coalgebra/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Ali Ramsey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ali Ramsey, Eric Wieser -/ -import Mathlib.LinearAlgebra.TensorProduct.Finiteness -import Mathlib.LinearAlgebra.TensorProduct.Associator +module + +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.LinearAlgebra.TensorProduct.Associator /-! # Coalgebras @@ -20,6 +22,8 @@ In this file we define `Coalgebra`, and provide instances for: * -/ +@[expose] public section + universe u v w open scoped TensorProduct diff --git a/Mathlib/RingTheory/Coalgebra/Convolution.lean b/Mathlib/RingTheory/Coalgebra/Convolution.lean index 25ca4cf9de28ba..56d36c65fc85be 100644 --- a/Mathlib/RingTheory/Coalgebra/Convolution.lean +++ b/Mathlib/RingTheory/Coalgebra/Convolution.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Yaël Dillies, Michał Mrugała, Yunzhou Xie. All rights rese Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Michał Mrugała, Yunzhou Xie -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Coalgebra.Hom -import Mathlib.RingTheory.Coalgebra.TensorProduct -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Coalgebra.Hom +public import Mathlib.RingTheory.Coalgebra.TensorProduct +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Convolution product on linear maps from a coalgebra to an algebra @@ -32,6 +34,8 @@ group instance on `Module.End R A` with multiplication defined as composition. As a result, the convolution product is scoped to `ConvolutionProduct`. -/ +@[expose] public section + suppress_compilation open Coalgebra TensorProduct diff --git a/Mathlib/RingTheory/Coalgebra/Equiv.lean b/Mathlib/RingTheory/Coalgebra/Equiv.lean index 4c0183f65d4b9e..b832f15b6c0d2c 100644 --- a/Mathlib/RingTheory/Coalgebra/Equiv.lean +++ b/Mathlib/RingTheory/Coalgebra/Equiv.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RingTheory.Coalgebra.Hom +module + +public import Mathlib.RingTheory.Coalgebra.Hom /-! # Isomorphisms of `R`-coalgebras @@ -20,6 +22,8 @@ This file defines bundled isomorphisms of `R`-coalgebras. We simply mimic the ea * `A ≃ₗc[R] B` : `R`-coalgebra equivalence from `A` to `B`. -/ +@[expose] public section + universe u v w variable {R A B C : Type*} diff --git a/Mathlib/RingTheory/Coalgebra/GroupLike.lean b/Mathlib/RingTheory/Coalgebra/GroupLike.lean new file mode 100644 index 00000000000000..c5358307231e33 --- /dev/null +++ b/Mathlib/RingTheory/Coalgebra/GroupLike.lean @@ -0,0 +1,157 @@ +/- +Copyright (c) 2025 Yaël Dillies, Michał Mrugała. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Yaël Dillies, Michał Mrugała +-/ +module + +public import Mathlib.RingTheory.Coalgebra.Equiv +public import Mathlib.RingTheory.Flat.Domain + +/-! +# Group-like elements in a coalgebra + +This file defines group-like elements in a coalgebra, i.e. elements `a` such that `ε a = 1` and +`Δ a = a ⊗ₜ a`. + +## Main declarations + +* `IsGroupLikeElem`: Predicate for an element in a coalgebra to be group-like. +* `linearIndepOn_isGroupLikeElem`: Group-like elements over a domain are linearly independent. +-/ + +@[expose] public section + +open Coalgebra Function TensorProduct + +variable {F R A B : Type*} + +section CommSemiring +variable [CommSemiring R] [AddCommMonoid A] [AddCommMonoid B] [Module R A] [Coalgebra R A] + [Module R B] [Coalgebra R B] {a b : A} + +variable (R) in +/-- A group-like element in a coalgebra is an element `a` such that `ε(a) = 1` and `Δ(a) = a ⊗ₜ a`, +where `ε` and `Δ` are the counit and comultiplication respectively. -/ +@[mk_iff] +structure IsGroupLikeElem (a : A) : Prop where + /-- A group-like element `a` satisfies `ε(a) = 1`. -/ + counit_eq_one : counit (R := R) a = 1 + /-- A group-like element `a` satisfies `Δ(a) = a ⊗ₜ a`. -/ + comul_eq_tmul_self : comul a = a ⊗ₜ[R] a + +attribute [simp] IsGroupLikeElem.counit_eq_one IsGroupLikeElem.comul_eq_tmul_self + +@[simp] lemma isGroupLikeElem_self {r : R} : IsGroupLikeElem R r ↔ r = 1 := by + simp +contextual [isGroupLikeElem_iff] + +lemma IsGroupLikeElem.ne_zero [Nontrivial R] (ha : IsGroupLikeElem R a) : a ≠ 0 := by + rintro rfl; simpa using ha.counit_eq_one + +/-- A coalgebra homomorphism sends group-like elements to group-like elements. -/ +lemma IsGroupLikeElem.map [FunLike F A B] [CoalgHomClass F R A B] (f : F) + (ha : IsGroupLikeElem R a) : IsGroupLikeElem R (f a) where + counit_eq_one := by rw [CoalgHomClass.counit_comp_apply, ha.counit_eq_one] + comul_eq_tmul_self := by rw [← CoalgHomClass.map_comp_comul_apply, ha.comul_eq_tmul_self]; simp + +/-- A coalgebra isomorphism preserves group-like elements. -/ +@[simp] lemma isGroupLikeElem_map_equiv [EquivLike F A B] [CoalgEquivClass F R A B] (f : F) : + IsGroupLikeElem R (f a) ↔ IsGroupLikeElem R a where + mp ha := (CoalgEquivClass.toCoalgEquiv f).symm_apply_apply a ▸ ha.map _ + mpr := .map f + +variable (R A) in +/-- The type of group-like elements in a coalgebra. -/ +@[ext] +structure GroupLike where + /-- The underlying element of a group-like element. -/ + val : A + isGroupLikeElem_val : IsGroupLikeElem R val + +namespace GroupLike + +attribute [simp] isGroupLikeElem_val + +attribute [coe] val + +instance instCoeOut : CoeOut (GroupLike R A) A where coe := val + +lemma val_injective : Injective (val : GroupLike R A → A) := by rintro ⟨a, ha⟩; congr! + +@[simp, norm_cast] lemma val_inj {a b : GroupLike R A} : a.val = b.val ↔ a = b := + val_injective.eq_iff + +/-- Identity equivalence between `GroupLike R A` and `{a : A // IsGroupLikeElem R a}`. -/ +def valEquiv : GroupLike R A ≃ Subtype (IsGroupLikeElem R : A → Prop) where + toFun a := ⟨a.1, a.2⟩ + invFun a := ⟨a.1, a.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +end GroupLike +end CommSemiring + +section CommRing +variable [CommRing R] [IsDomain R] [AddCommGroup A] [Module R A] [Coalgebra R A] + [NoZeroSMulDivisors R A] + +open Submodule in +/-- Group-like elements over a domain are linearly independent. -/ +lemma linearIndepOn_isGroupLikeElem : LinearIndepOn R id {a : A | IsGroupLikeElem R a} := by + classical + -- We show that any finset `s` of group-like elements is linearly independent. + rw [linearIndepOn_iff_linearIndepOn_finset] + rintro s hs + -- For this, we do induction on `s`. + induction s using Finset.cons_induction with + -- The case `s = ∅` is trivial. + | empty => simp + -- Let's deal with the `s ∪ {a}` case. + | cons a s has ih => + simp only [Finset.cons_eq_insert, Finset.coe_insert, Set.subset_def, Set.mem_insert_iff, + Finset.mem_coe, Set.mem_setOf_eq, forall_eq_or_imp] at hs + obtain ⟨ha, hs⟩ := hs + specialize ih hs + -- Assume that there is some `c : A → R` and `d : R` such that `∑ x ∈ s, c x • x = d • a`. + -- We want to prove `d = 0` and `∀ x ∈ s, c x = 0`. + rw [Finset.coe_cons] + refine ih.id_insert' ?_ + simp only [mem_span_finset, forall_exists_index, and_imp] + rintro d c - hc + -- `x ⊗ y` over `x, y ∈ s` are linearly independent since `s` is linearly independent and + -- `R` is a domain. + replace ih := ih.tmul_of_isDomain ih + simp_rw [← Finset.coe_product, linearIndepOn_finset_iffₛ, id] at ih + -- Tensoring the equality `∑ x ∈ s, c x • x = d • a` with itself, we get by linear independence + -- that `c x ^ 2 = d * c x` and `c x * c y = 0` for `x ≠ y`. + have key := calc + ∑ x ∈ s, ∑ y ∈ s, (if x = y then d * c x else 0) • x ⊗ₜ[R] y + _ = d • ∑ x ∈ s, c x • x ⊗ₜ[R] x := by simp [Finset.smul_sum, mul_smul] + _ = d • comul (d • a) := by rw [← hc]; simp +contextual [(hs _ _).comul_eq_tmul_self] + _ = (d • a) ⊗ₜ (d • a) := by simp [ha.comul_eq_tmul_self, smul_tmul, tmul_smul, -neg_smul] + _ = ∑ x ∈ s, ∑ y ∈ s, (c x * c y) • x ⊗ₜ[R] y := by + simp_rw [← hc, sum_tmul, smul_tmul, Finset.smul_sum, tmul_sum, tmul_smul, mul_smul] + simp_rw [← Finset.sum_product'] at key + apply ih at key + -- Therefore, `c x = 0` for all `x ∈ s`. + replace key x (hx : x ∈ s) : c x = 0 := by + -- Otherwise, we deduce from `key` that `c y = 0` for any `y ≠ x` with `y ∈ s`. + by_contra! hcx + have hcy (y) (hys : y ∈ s) (hyx : y ≠ x) : c y = 0 := by + simpa [*] using (key (y, x) (by simp [*])).symm + -- Then substitute this into `hc` to get `c x • x = d • a`. + rw [Finset.sum_eq_single x (by simp +contextual [hcy]) (by simp [hx])] at hc + -- But `key` also says that `c x = d`. + have hcxa : d = c x := mul_left_injective₀ hcx (by simpa using (key (x, x) (by simp [*]))) + -- So `x = a`... + obtain rfl : x = a := by rwa [hcxa, smul_right_inj hcx] at hc + -- ... which contradicts `x ∈ s` and `a ∉ s`. + contradiction + -- We are now done, since `d • a = ∑ x ∈ s, c x • x = 0` + simp_all [ha.ne_zero, eq_comm] + +/-- Group-like elements over a domain are linearly independent. -/ +lemma linearIndep_groupLikeVal : LinearIndependent R (GroupLike.val (R := R) (A := A)) := by + simpa using (linearIndependent_equiv GroupLike.valEquiv).2 linearIndepOn_isGroupLikeElem + +end CommRing diff --git a/Mathlib/RingTheory/Coalgebra/Hom.lean b/Mathlib/RingTheory/Coalgebra/Hom.lean index fb9bcd36d0653a..145b6dfb8d8dbc 100644 --- a/Mathlib/RingTheory/Coalgebra/Hom.lean +++ b/Mathlib/RingTheory/Coalgebra/Hom.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yury Kudryashov, Amelia Livingston -/ -import Mathlib.RingTheory.Coalgebra.Basic +module + +public import Mathlib.RingTheory.Coalgebra.Basic /-! # Homomorphisms of `R`-coalgebras @@ -23,6 +25,8 @@ This file defines bundled homomorphisms of `R`-coalgebras. We largely mimic -/ +@[expose] public section + open TensorProduct Coalgebra universe u v w diff --git a/Mathlib/RingTheory/Coalgebra/MonoidAlgebra.lean b/Mathlib/RingTheory/Coalgebra/MonoidAlgebra.lean index 28b6167249f25f..7eefcf55afb403 100644 --- a/Mathlib/RingTheory/Coalgebra/MonoidAlgebra.lean +++ b/Mathlib/RingTheory/Coalgebra/MonoidAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.Algebra.Polynomial.Laurent -import Mathlib.RingTheory.Coalgebra.Basic +module + +public import Mathlib.Algebra.Polynomial.Laurent +public import Mathlib.RingTheory.Coalgebra.Basic /-! # The coalgebra structure on monoid algebras @@ -21,6 +23,8 @@ corresponding structure on its coefficients, defined in `Mathlib/RingTheory/Coal `A[T;T⁻¹]` when `A` is an `R`-coalgebra. -/ +@[expose] public section + noncomputable section open Coalgebra diff --git a/Mathlib/RingTheory/Coalgebra/MulOpposite.lean b/Mathlib/RingTheory/Coalgebra/MulOpposite.lean index 2357ecc7dc709e..4e78ef678a409a 100644 --- a/Mathlib/RingTheory/Coalgebra/MulOpposite.lean +++ b/Mathlib/RingTheory/Coalgebra/MulOpposite.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.RingTheory.Coalgebra.Basic +module + +public import Mathlib.RingTheory.Coalgebra.Basic /-! # MulOpposite of coalgebras @@ -12,6 +14,8 @@ Suppose `R` is a commutative semiring, and `A` is an `R`-coalgebra, then `Aᵐᵒᵖ` is an `R`-coalgebra, where we define the comultiplication and counit maps naturally. -/ +@[expose] public section + namespace MulOpposite open scoped TensorProduct diff --git a/Mathlib/RingTheory/Coalgebra/TensorProduct.lean b/Mathlib/RingTheory/Coalgebra/TensorProduct.lean index ae682f159be2a2..a4fddcec69ec55 100644 --- a/Mathlib/RingTheory/Coalgebra/TensorProduct.lean +++ b/Mathlib/RingTheory/Coalgebra/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Andrew Yang -/ -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Coalgebra.Equiv +module + +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Coalgebra.Equiv /-! # Tensor products of coalgebras @@ -22,6 +24,8 @@ the base change `S ⊗[R] B` as an `S`-coalgebra. -/ +@[expose] public section + open TensorProduct variable {R S A B : Type*} [CommSemiring R] [CommSemiring S] [AddCommMonoid A] [AddCommMonoid B] diff --git a/Mathlib/RingTheory/Complex.lean b/Mathlib/RingTheory/Complex.lean index 797e0b8b66e9e5..b13dd985e4690c 100644 --- a/Mathlib/RingTheory/Complex.lean +++ b/Mathlib/RingTheory/Complex.lean @@ -3,12 +3,16 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.LinearAlgebra.Complex.Module -import Mathlib.RingTheory.Norm.Defs -import Mathlib.RingTheory.Trace.Defs +module + +public import Mathlib.LinearAlgebra.Complex.Module +public import Mathlib.RingTheory.Norm.Defs +public import Mathlib.RingTheory.Trace.Defs /-! # Lemmas about `Algebra.trace` and `Algebra.norm` on `ℂ` -/ +@[expose] public section + open Complex diff --git a/Mathlib/RingTheory/Conductor.lean b/Mathlib/RingTheory/Conductor.lean index 0a217979deb612..44946af9f19b71 100644 --- a/Mathlib/RingTheory/Conductor.lean +++ b/Mathlib/RingTheory/Conductor.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Paul Lezeau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Lezeau, Xavier Roblot, Andrew Yang -/ +module -import Mathlib.RingTheory.Localization.Submodule -import Mathlib.RingTheory.PowerBasis +public import Mathlib.RingTheory.Localization.Submodule +public import Mathlib.RingTheory.PowerBasis /-! # The conductor ideal @@ -15,6 +16,8 @@ This file defines the conductor ideal of an element `x` of `R`-algebra `S`. This -/ +@[expose] public section + variable (R : Type*) {S : Type*} [CommRing R] [CommRing S] [Algebra R S] open Ideal Polynomial DoubleQuot UniqueFactorizationMonoid Algebra RingHom diff --git a/Mathlib/RingTheory/Congruence/Basic.lean b/Mathlib/RingTheory/Congruence/Basic.lean index 5fcbac43eead89..0da7aec5a116bf 100644 --- a/Mathlib/RingTheory/Congruence/Basic.lean +++ b/Mathlib/RingTheory/Congruence/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Ring.Action.Basic -import Mathlib.GroupTheory.Congruence.Basic -import Mathlib.RingTheory.Congruence.Defs +module + +public import Mathlib.Algebra.Ring.Action.Basic +public import Mathlib.GroupTheory.Congruence.Basic +public import Mathlib.RingTheory.Congruence.Defs /-! # Congruence relations on rings @@ -27,6 +29,8 @@ Most of the time you likely want to use the `Ideal.Quotient` API that is built o * Copy across more API from `Con` and `AddCon` in `GroupTheory/Congruence.lean`. -/ +@[expose] public section + variable {α β R : Type*} namespace RingCon diff --git a/Mathlib/RingTheory/Congruence/BigOperators.lean b/Mathlib/RingTheory/Congruence/BigOperators.lean index 52d8c1aaa155f9..dbb69a2b44b2c9 100644 --- a/Mathlib/RingTheory/Congruence/BigOperators.lean +++ b/Mathlib/RingTheory/Congruence/BigOperators.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.GroupTheory.Congruence.BigOperators -import Mathlib.RingTheory.Congruence.Defs +module + +public import Mathlib.GroupTheory.Congruence.BigOperators +public import Mathlib.RingTheory.Congruence.Defs /-! # Interactions between `∑, ∏` and `RingCon` -/ +@[expose] public section + namespace RingCon /-- Congruence relation of a ring preserves finite sum indexed by a list. -/ diff --git a/Mathlib/RingTheory/Congruence/Defs.lean b/Mathlib/RingTheory/Congruence/Defs.lean index 5d9d4a905dfeba..72ab66c80d8e4e 100644 --- a/Mathlib/RingTheory/Congruence/Defs.lean +++ b/Mathlib/RingTheory/Congruence/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.GroupTheory.Congruence.Defs -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.GroupTheory.Congruence.Defs +public import Mathlib.Tactic.FastInstance /-! # Congruence relations on rings @@ -28,6 +30,8 @@ Most of the time you likely want to use the `Ideal.Quotient` API that is built o * Copy across more API from `Con` and `AddCon` in `GroupTheory/Congruence.lean`. -/ +@[expose] public section + /-- A congruence relation on a type with an addition and multiplication is an equivalence relation which preserves both. -/ diff --git a/Mathlib/RingTheory/Congruence/Opposite.lean b/Mathlib/RingTheory/Congruence/Opposite.lean index 71b6c466f5081c..584f92d58f5f15 100644 --- a/Mathlib/RingTheory/Congruence/Opposite.lean +++ b/Mathlib/RingTheory/Congruence/Opposite.lean @@ -3,9 +3,10 @@ Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ +module -import Mathlib.RingTheory.Congruence.Basic -import Mathlib.GroupTheory.Congruence.Opposite +public import Mathlib.RingTheory.Congruence.Basic +public import Mathlib.GroupTheory.Congruence.Opposite /-! # Congruences on the opposite ring @@ -15,6 +16,8 @@ the opposite ring `Rᵐᵒᵖ`. -/ +@[expose] public section + variable {R : Type*} [Add R] [Mul R] namespace RingCon diff --git a/Mathlib/RingTheory/Coprime/Basic.lean b/Mathlib/RingTheory/Coprime/Basic.lean index 48877dcd60d885..c566bf3de7e172 100644 --- a/Mathlib/RingTheory/Coprime/Basic.lean +++ b/Mathlib/RingTheory/Coprime/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Ken Lee, Chris Hughes -/ -import Mathlib.Algebra.Group.Action.Units -import Mathlib.Algebra.Group.Nat.Units -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Logic.Basic -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Group.Action.Units +public import Mathlib.Algebra.Group.Nat.Units +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Logic.Basic +public import Mathlib.Tactic.Ring /-! # Coprime elements of a ring or monoid @@ -26,6 +28,8 @@ This file also contains lemmas about `IsRelPrime` parallel to `IsCoprime`. See also `RingTheory.Coprime.Lemmas` for further development of coprime elements. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Coprime/Ideal.lean b/Mathlib/RingTheory/Coprime/Ideal.lean index 86b3c0efbd6368..1297623323ae23 100644 --- a/Mathlib/RingTheory/Coprime/Ideal.lean +++ b/Mathlib/RingTheory/Coprime/Ideal.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Pierre-Alexandre Bazin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Pierre-Alexandre Bazin -/ -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.Ideal.Operations +module + +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.Ideal.Operations /-! # An additional lemma about coprime ideals @@ -14,6 +16,8 @@ This lemma generalises `exists_sum_eq_one_iff_pairwise_coprime` to the case of n It is on a separate file due to import requirements. -/ +@[expose] public section + namespace Ideal diff --git a/Mathlib/RingTheory/Coprime/Lemmas.lean b/Mathlib/RingTheory/Coprime/Lemmas.lean index fe6bcbab9e12a0..98962881418fbc 100644 --- a/Mathlib/RingTheory/Coprime/Lemmas.lean +++ b/Mathlib/RingTheory/Coprime/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Ken Lee, Chris Hughes -/ -import Mathlib.Algebra.BigOperators.Ring.Finset -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Int.GCD -import Mathlib.RingTheory.Coprime.Basic +module + +public import Mathlib.Algebra.BigOperators.Ring.Finset +public import Mathlib.Data.Fintype.Basic +public import Mathlib.Data.Int.GCD +public import Mathlib.RingTheory.Coprime.Basic /-! # Additional lemmas about elements of a ring satisfying `IsCoprime` @@ -20,6 +22,8 @@ lemmas about `Pow` since these are easiest to prove via `Finset.prod`. -/ +@[expose] public section + universe u v open scoped Function -- required for scoped `on` notation @@ -55,6 +59,9 @@ theorem Nat.Coprime.cast {R : Type*} [CommRing R] {a b : ℕ} (h : Nat.Coprime a IsCoprime (a : R) (b : R) := mod_cast h.isCoprime.intCast +theorem Rat.isCoprime_num_den (x : ℚ) : IsCoprime x.num x.den := + x.reduced.cast.of_isCoprime_of_dvd_left Int.dvd_natAbs_self + theorem ne_zero_or_ne_zero_of_nat_coprime {A : Type u} [CommRing A] [Nontrivial A] {a b : ℕ} (h : Nat.Coprime a b) : (a : A) ≠ 0 ∨ (b : A) ≠ 0 := IsCoprime.ne_zero_or_ne_zero (R := A) <| by diff --git a/Mathlib/RingTheory/CotangentLocalizationAway.lean b/Mathlib/RingTheory/CotangentLocalizationAway.lean index e2faa5d2c76962..3f19f025e45f0f 100644 --- a/Mathlib/RingTheory/CotangentLocalizationAway.lean +++ b/Mathlib/RingTheory/CotangentLocalizationAway.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Extension.Cotangent.LocalizationAway +module + +public import Mathlib.RingTheory.Extension.Cotangent.LocalizationAway deprecated_module (since := "2025-05-11") diff --git a/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean b/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean index 16bf9a83896023..fe2d713499baf0 100644 --- a/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean +++ b/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Algebra.Order.Ring.IsNonarchimedean -import Mathlib.Data.Int.WithZero -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas -import Mathlib.RingTheory.Valuation.ExtendToLocalization -import Mathlib.Topology.Algebra.Valued.ValuedField -import Mathlib.Topology.Algebra.Valued.WithVal +module + +public import Mathlib.Algebra.Order.Ring.IsNonarchimedean +public import Mathlib.Data.Int.WithZero +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +public import Mathlib.RingTheory.Valuation.ExtendToLocalization +public import Mathlib.Topology.Algebra.Valued.ValuedField +public import Mathlib.Topology.Algebra.Valued.WithVal /-! # Adic valuations on Dedekind domains @@ -58,6 +60,8 @@ We are only interested in Dedekind domains with Krull dimension 1. dedekind domain, dedekind ring, adic valuation -/ +@[expose] public section + noncomputable section open WithZero Multiplicative IsDedekindDomain @@ -131,12 +135,10 @@ theorem intValuation.map_add_le_max' (x y : R) : classical by_cases hx : x = 0 · rw [hx, zero_add] - conv_rhs => rw [intValuationDef, if_pos rfl] - rw [max_eq_right (WithZero.zero_le (v.intValuationDef y))] + order · by_cases hy : y = 0 · rw [hy, add_zero] - conv_rhs => rw [max_comm, intValuationDef, if_pos rfl] - rw [max_eq_right (WithZero.zero_le (v.intValuationDef x))] + order · by_cases hxy : x + y = 0 · rw [intValuationDef, if_pos hxy]; exact zero_le' · rw [v.intValuationDef_if_neg hxy, v.intValuationDef_if_neg hx, v.intValuationDef_if_neg hy, @@ -278,6 +280,13 @@ theorem intValuation_singleton {r : R} (hr : r ≠ 0) (hv : v.asIdeal = Ideal.sp rw [v.intValuation_if_neg hr, ← hv, Associates.count_self, Int.ofNat_one] exact v.associates_irreducible +@[simp] +theorem intValuation_eq_one_iff {v : HeightOneSpectrum R} {x : R} : + v.intValuation x = 1 ↔ x ∉ v.asIdeal := by + refine ⟨fun h ↦ by simp [← (intValuation_lt_one_iff_mem _ _).not, h], fun h ↦ ?_⟩ + exact le_antisymm (v.intValuation_le_one x) <| by + simp [← not_lt, (v.intValuation_lt_one_iff_mem _).not, h] + /-! ### Adic valuations on the field of fractions `K` -/ variable (K) in @@ -325,6 +334,24 @@ theorem valuation_lt_one_iff_mem (r : R) : v.valuation K r < 1 ↔ r ∈ v.asIdeal := by rw [valuation_of_algebraMap]; exact v.intValuation_lt_one_iff_mem r +variable (K) in +open scoped algebraMap in +/-- The `v` adic valuation of `a / b ∈ K` is `≤ 1` if and only if `b ∉ v`, provided that `a` and +`b` are coprime at `v`. -/ +theorem valuation_div_le_one_iff (a : R) {b : R} (hb : b ≠ 0) + (h : b ∈ v.asIdeal → a ∉ v.asIdeal) : + v.valuation K (a / b) ≤ 1 ↔ b ∉ v.asIdeal := by + refine ⟨fun hv ↦ ?_, fun hb ↦ by + simp [valuation_of_algebraMap, intValuation_eq_one_iff.2 hb, intValuation_le_one]⟩ + contrapose! hv + have ha₀ : a ≠ 0 := fun _ ↦ by simp_all + have hva : v.valuation K a ≠ 0 := (Valuation.ne_zero_iff _).2 (by simp [ha₀]) + have hvb : v.valuation K b ≠ 0 := (Valuation.ne_zero_iff _).2 (by simp [hb]) + rw [← WithZero.log_lt_log one_ne_zero ((Valuation.ne_zero_iff _).2 (by simp [ha₀, hb])), + map_div₀, WithZero.log_div hva hvb, WithZero.log_one, Int.sub_pos, + WithZero.log_lt_log hvb hva] + simpa [valuation_of_algebraMap, intValuation_eq_one_iff.2 <| h hv, intValuation_lt_one_iff_mem] + variable (K) /-- There exists `π ∈ K` with `v`-adic valuation `WithZero.exp (-1)`. -/ @@ -628,3 +655,18 @@ theorem adicAbv_coe_eq_one_iff {b : NNReal} (hb : 1 < b) (r : R) : end AbsoluteValue end IsDedekindDomain.HeightOneSpectrum + +namespace Rat + +open IsDedekindDomain.HeightOneSpectrum + +variable {R : Type*} [CommRing R] [IsDedekindDomain R] [Algebra R ℚ] [IsFractionRing R ℚ] + +theorem valuation_le_one_iff_den {𝔭 : HeightOneSpectrum R} {x : ℚ} : + 𝔭.valuation ℚ x ≤ 1 ↔ ↑x.den ∉ 𝔭.asIdeal := by + have : CharZero R := ⟨.of_comp (f := algebraMap R ℚ) (by simpa using Nat.cast_injective)⟩ + have : (x.den : R) ≠ 0 := by simp + simp [x.num_div_den, ← 𝔭.valuation_div_le_one_iff ℚ x.num this + (Ideal.IsPrime.notMem_of_isCoprime_of_mem (mod_cast x.isCoprime_num_den.symm.intCast))] + +end Rat diff --git a/Mathlib/RingTheory/DedekindDomain/Basic.lean b/Mathlib/RingTheory/DedekindDomain/Basic.lean index 010c338ccfbc8b..39aa04108bb3b9 100644 --- a/Mathlib/RingTheory/DedekindDomain/Basic.lean +++ b/Mathlib/RingTheory/DedekindDomain/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenji Nakagawa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenji Nakagawa, Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.RingTheory.Ideal.GoingUp -import Mathlib.RingTheory.Polynomial.RationalRoot +module + +public import Mathlib.RingTheory.Ideal.GoingUp +public import Mathlib.RingTheory.Polynomial.RationalRoot /-! # Dedekind rings and domains @@ -43,6 +45,8 @@ to add a `(h : ¬ IsField A)` assumption whenever this is explicitly needed. dedekind domain, dedekind ring -/ +@[expose] public section + variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] diff --git a/Mathlib/RingTheory/DedekindDomain/Different.lean b/Mathlib/RingTheory/DedekindDomain/Different.lean index c4f36bc5fc98e6..f9833336c48927 100644 --- a/Mathlib/RingTheory/DedekindDomain/Different.lean +++ b/Mathlib/RingTheory/DedekindDomain/Different.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.NumberTheory.RamificationInertia.Unramified -import Mathlib.RingTheory.Conductor -import Mathlib.RingTheory.FractionalIdeal.Extended -import Mathlib.RingTheory.Trace.Quotient +module + +public import Mathlib.NumberTheory.RamificationInertia.Unramified +public import Mathlib.RingTheory.Conductor +public import Mathlib.RingTheory.FractionalIdeal.Extended +public import Mathlib.RingTheory.Trace.Quotient /-! # The different ideal @@ -31,6 +33,8 @@ import Mathlib.RingTheory.Trace.Quotient - Show properties of the different ideal -/ +@[expose] public section + open Module universe u diff --git a/Mathlib/RingTheory/DedekindDomain/Dvr.lean b/Mathlib/RingTheory/DedekindDomain/Dvr.lean index dcf21bfb39ab6a..f19d0d7800abbf 100644 --- a/Mathlib/RingTheory/DedekindDomain/Dvr.lean +++ b/Mathlib/RingTheory/DedekindDomain/Dvr.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenji Nakagawa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenji Nakagawa, Anne Baanen, Filippo A. E. Nuccio, Yongle Hu -/ -import Mathlib.RingTheory.DiscreteValuationRing.TFAE -import Mathlib.RingTheory.LocalProperties.IntegrallyClosed +module + +public import Mathlib.RingTheory.DiscreteValuationRing.TFAE +public import Mathlib.RingTheory.LocalProperties.IntegrallyClosed /-! # Dedekind domains @@ -42,6 +44,8 @@ to add a `(h : ¬ IsField A)` assumption whenever this is explicitly needed. dedekind domain, dedekind ring -/ +@[expose] public section + variable (A : Type*) [CommRing A] [IsDomain A] diff --git a/Mathlib/RingTheory/DedekindDomain/Factorization.lean b/Mathlib/RingTheory/DedekindDomain/Factorization.lean index e0ac5a6b43c434..c91b84ce120da0 100644 --- a/Mathlib/RingTheory/DedekindDomain/Factorization.lean +++ b/Mathlib/RingTheory/DedekindDomain/Factorization.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.NumberTheory.RamificationInertia.Basic -import Mathlib.Order.Filter.Cofinite +module + +public import Mathlib.NumberTheory.RamificationInertia.Basic +public import Mathlib.Order.Filter.Cofinite /-! # Factorization of ideals and fractional ideals of Dedekind domains @@ -48,6 +50,8 @@ Since we are only interested in the factorization of nonzero fractional ideals, dedekind domain, fractional ideal, ideal, factorization -/ +@[expose] public section + noncomputable section open scoped nonZeroDivisors @@ -400,10 +404,7 @@ theorem count_pow (n : ℕ) (I : FractionalIdeal R⁰ K) : | succ n h => classical rw [pow_succ, count_mul'] by_cases hI : I = 0 - · have h_neg : ¬(I ^ n ≠ 0 ∧ I ≠ 0) := by - rw [not_and', not_not, ne_eq] - intro h - exact absurd hI h + · have h_neg : ¬(I ^ n ≠ 0 ∧ I ≠ 0) := by order rw [if_neg h_neg, hI, count_zero, mul_zero] · rw [if_pos (And.intro (pow_ne_zero n hI) hI), h, Nat.cast_add, Nat.cast_one] @@ -715,6 +716,8 @@ lemma divMod_zero_of_not_le {a b c : FractionalIdeal R⁰ K} (hac : ¬ a ≤ c) c.divMod b a = 0 := by simp [divMod, hac] +set_option maxHeartbeats 212000 in +-- changed for new compiler /-- Let `I J I' J'` be nonzero fractional ideals in a Dedekind domain with `J ≤ I` and `J' ≤ I'`. If `I/J = I'/J'` in the group of fractional ideals (i.e. `I * J' = I' * J`), then `I/J ≃ I'/J'` as quotient `R`-modules. -/ diff --git a/Mathlib/RingTheory/DedekindDomain/FiniteAdeleRing.lean b/Mathlib/RingTheory/DedekindDomain/FiniteAdeleRing.lean index cb792a3e26f924..896c0763f05f5e 100644 --- a/Mathlib/RingTheory/DedekindDomain/FiniteAdeleRing.lean +++ b/Mathlib/RingTheory/DedekindDomain/FiniteAdeleRing.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.RingTheory.DedekindDomain.AdicValuation -import Mathlib.RingTheory.DedekindDomain.Factorization -import Mathlib.Topology.Algebra.RestrictedProduct.TopologicalSpace +module + +public import Mathlib.RingTheory.DedekindDomain.AdicValuation +public import Mathlib.RingTheory.DedekindDomain.Factorization +public import Mathlib.Topology.Algebra.RestrictedProduct.TopologicalSpace /-! # The finite adèle ring of a Dedekind domain @@ -26,6 +28,8 @@ field, its finite adèle ring is just defined to be the trivial ring. finite adèle ring, dedekind domain -/ +@[expose] public section + variable (R : Type*) [CommRing R] [IsDedekindDomain R] {K : Type*} [Field K] [Algebra R K] [IsFractionRing R K] diff --git a/Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean b/Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean index 93f5fe4fd449e5..47cfbdcd862079 100644 --- a/Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean +++ b/Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenji Nakagawa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenji Nakagawa, Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.Algebra.Subalgebra.Pointwise -import Mathlib.RingTheory.DedekindDomain.Basic -import Mathlib.RingTheory.FractionalIdeal.Inverse -import Mathlib.RingTheory.Spectrum.Prime.Basic +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Pointwise +public import Mathlib.RingTheory.DedekindDomain.Basic +public import Mathlib.RingTheory.FractionalIdeal.Inverse +public import Mathlib.RingTheory.Spectrum.Prime.Basic /-! # Dedekind domains and invertible ideals @@ -47,6 +49,8 @@ to add a `(h : ¬ IsField A)` assumption whenever this is explicitly needed. dedekind domain, dedekind ring -/ +@[expose] public section + variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial diff --git a/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean b/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean index 3c060b9c0f3692..917df359ed22f1 100644 --- a/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean +++ b/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kenji Nakagawa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenji Nakagawa, Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.Algebra.Squarefree.Basic -import Mathlib.RingTheory.ChainOfDivisors -import Mathlib.RingTheory.DedekindDomain.Ideal.Basic -import Mathlib.RingTheory.Spectrum.Maximal.Localization -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso +module + +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.Algebra.Squarefree.Basic +public import Mathlib.RingTheory.ChainOfDivisors +public import Mathlib.RingTheory.DedekindDomain.Ideal.Basic +public import Mathlib.RingTheory.Spectrum.Maximal.Localization +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.OrderIso /-! # Dedekind domains and ideals @@ -37,6 +39,8 @@ to add a `(h : ¬ IsField A)` assumption whenever this is explicitly needed. dedekind domain, dedekind ring -/ +@[expose] public section + variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial @@ -187,6 +191,11 @@ lemma FractionalIdeal.inv_le_comm {I J : FractionalIdeal A⁰ K} (hI : I ≠ 0) I⁻¹ ≤ J ↔ J⁻¹ ≤ I := by simpa using le_inv_comm (A := A) (K := K) (inv_ne_zero hI) (inv_ne_zero hJ) +@[simp] +theorem FractionalIdeal.inv_le_inv_iff {I J : FractionalIdeal A⁰ K} (hI : I ≠ 0) (hJ : J ≠ 0) : + I⁻¹ ≤ J⁻¹ ↔ J ≤ I := by + rw [le_inv_comm (inv_ne_zero hI) hJ, inv_inv] + open FractionalIdeal diff --git a/Mathlib/RingTheory/DedekindDomain/Instances.lean b/Mathlib/RingTheory/DedekindDomain/Instances.lean index 681b3877b2a7ea..a9f2c7c0656419 100644 --- a/Mathlib/RingTheory/DedekindDomain/Instances.lean +++ b/Mathlib/RingTheory/DedekindDomain/Instances.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.RingTheory.DedekindDomain.PID -import Mathlib.FieldTheory.Separable -import Mathlib.RingTheory.RingHom.Finite +module + +public import Mathlib.RingTheory.DedekindDomain.PID +public import Mathlib.FieldTheory.Separable +public import Mathlib.RingTheory.RingHom.Finite /-! # Instances for Dedekind domains @@ -26,6 +28,8 @@ special case of *the* localization at a prime ideal is useful in working with De -/ +@[expose] public section + open nonZeroDivisors IsLocalization Algebra IsFractionRing IsScalarTower attribute [local instance] FractionRing.liftAlgebra diff --git a/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean b/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean index 153e0e6c865d2d..bc2e8cd940fe7b 100644 --- a/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean +++ b/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kenji Nakagawa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenji Nakagawa, Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.LinearAlgebra.BilinearForm.DualLattice -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.RingTheory.DedekindDomain.Basic -import Mathlib.RingTheory.Trace.Basic +module + +public import Mathlib.LinearAlgebra.BilinearForm.DualLattice +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.RingTheory.DedekindDomain.Basic +public import Mathlib.RingTheory.Trace.Basic /-! # Integral closure of Dedekind domains @@ -33,6 +35,8 @@ to add a `(h : ¬IsField A)` assumption whenever this is explicitly needed. dedekind domain, dedekind ring -/ +@[expose] public section + open Algebra Module open scoped nonZeroDivisors Polynomial diff --git a/Mathlib/RingTheory/DedekindDomain/LinearDisjoint.lean b/Mathlib/RingTheory/DedekindDomain/LinearDisjoint.lean index 9be02822e284b7..2fce5d78475c47 100644 --- a/Mathlib/RingTheory/DedekindDomain/LinearDisjoint.lean +++ b/Mathlib/RingTheory/DedekindDomain/LinearDisjoint.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.FieldTheory.LinearDisjoint -import Mathlib.RingTheory.DedekindDomain.Different +module + +public import Mathlib.FieldTheory.LinearDisjoint +public import Mathlib.RingTheory.DedekindDomain.Different /-! # Disjoint extensions with coprime different ideals @@ -14,7 +16,7 @@ subrings such that `Frac R₁ ⊔ Frac R₂ = Frac B`, `Frac R₁` and `Frac R over `Frac A`, and that `𝓓(R₁/A)` and `𝓓(R₂/A)` are coprime where `𝓓` denotes the different ideal and `Frac R` denotes the fraction field of a domain `R`. -# Main results and definitions +## Main results and definitions * `FractionalIdeal.differentIdeal_eq_map_differentIdeal`: `𝓓(B/R₁) = 𝓓(R₂/A)` * `FractionalIdeal.differentIdeal_eq_differentIdeal_mul_differentIdeal_of_isCoprime`: @@ -26,6 +28,8 @@ and `Frac R` denotes the fraction field of a domain `R`. -/ +@[expose] public section + open FractionalIdeal nonZeroDivisors IntermediateField Algebra Module Submodule variable (A B : Type*) {K L : Type*} [CommRing A] [Field K] [Algebra A K] [IsFractionRing A K] diff --git a/Mathlib/RingTheory/DedekindDomain/PID.lean b/Mathlib/RingTheory/DedekindDomain/PID.lean index c484efeebeb226..7bf1d152d93118 100644 --- a/Mathlib/RingTheory/DedekindDomain/PID.lean +++ b/Mathlib/RingTheory/DedekindDomain/PID.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kenny Lau -/ -import Mathlib.RingTheory.DedekindDomain.Dvr -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas -import Mathlib.RingTheory.PrincipalIdealDomainOfPrime +module + +public import Mathlib.RingTheory.DedekindDomain.Dvr +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +public import Mathlib.RingTheory.PrincipalIdealDomainOfPrime /-! # Criteria under which a Dedekind domain is a PID @@ -23,6 +25,8 @@ principal. that is a unique factorisation domain, is also a principal ideal domain. -/ +@[expose] public section + variable {R : Type*} [CommRing R] diff --git a/Mathlib/RingTheory/DedekindDomain/SInteger.lean b/Mathlib/RingTheory/DedekindDomain/SInteger.lean index 006742af2d6f20..49e3eb3a80843b 100644 --- a/Mathlib/RingTheory/DedekindDomain/SInteger.lean +++ b/Mathlib/RingTheory/DedekindDomain/SInteger.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.RingTheory.DedekindDomain.AdicValuation +module + +public import Mathlib.RingTheory.DedekindDomain.AdicValuation /-! # `S`-integers and `S`-units of fraction fields of Dedekind domains @@ -40,6 +42,8 @@ This file defines the subalgebra of `S`-integers of `K` and the subgroup of `S`- S integer, S-integer, S unit, S-unit -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean b/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean index 9d8ccfa0225be5..6812a19fd0a5a9 100644 --- a/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean +++ b/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.Algebra.Group.Equiv.TypeTags -import Mathlib.Data.ZMod.QuotientGroup -import Mathlib.RingTheory.DedekindDomain.AdicValuation -import Mathlib.Algebra.Group.Int.TypeTags +module + +public import Mathlib.Algebra.Group.Equiv.TypeTags +public import Mathlib.Data.ZMod.QuotientGroup +public import Mathlib.RingTheory.DedekindDomain.AdicValuation +public import Mathlib.Algebra.Group.Int.TypeTags /-! # Selmer groups of fraction fields of Dedekind domains @@ -61,6 +63,8 @@ https://doc.sagemath.org/html/en/reference/number_fields/sage/rings/number_field class group, selmer group, unit group -/ +@[expose] public section + set_option quotPrecheck false local notation K "/" n => Kˣ ⧸ (powMonoidHom n : Kˣ →* Kˣ).range diff --git a/Mathlib/RingTheory/Derivation/Basic.lean b/Mathlib/RingTheory/Derivation/Basic.lean index 7b77440e4c0e06..2623eda4f33f7b 100644 --- a/Mathlib/RingTheory/Derivation/Basic.lean +++ b/Mathlib/RingTheory/Derivation/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri, Andrew Yang -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative /-! # Derivations @@ -31,6 +33,8 @@ and `RingTheory.Derivation.ToSquareZero` for -/ +@[expose] public section + open Algebra /-- `D : Derivation R A M` is an `R`-linear map from `A` to `M` that satisfies the `leibniz` @@ -263,7 +267,7 @@ variable (f : M →ₗ[A] N) (e : M ≃ₗ[A] N) /-- We can push forward derivations using linear maps, i.e., the composition of a derivation with a linear map is a derivation. Furthermore, this operation is linear on the spaces of derivations. -/ -def _root_.LinearMap.compDer : Derivation R A M →ₗ[R] Derivation R A N where +def _root_.LinearMap.compDer : Derivation R A M →ₗ[A] Derivation R A N where toFun D := { toLinearMap := (f : M →ₗ[R] N).comp (D : A →ₗ[R] M) map_one_eq_zero' := by simp only [LinearMap.comp_apply, coeFn_coe, map_one_eq_zero, map_zero] @@ -271,7 +275,7 @@ def _root_.LinearMap.compDer : Derivation R A M →ₗ[R] Derivation R A N where simp only [coeFn_coe, LinearMap.comp_apply, LinearMap.map_add, leibniz, LinearMap.coe_restrictScalars, LinearMap.map_smul] } map_add' D₁ D₂ := by ext; exact LinearMap.map_add _ _ _ - map_smul' r D := by dsimp; ext; exact LinearMap.map_smul (f : M →ₗ[R] N) _ _ + map_smul' r D := by ext; dsimp; simp only [_root_.map_smul] @[simp] theorem coe_to_linearMap_comp : (f.compDer D : A →ₗ[R] N) = (f : M →ₗ[R] N).comp (D : A →ₗ[R] M) := @@ -283,13 +287,13 @@ theorem coe_comp : (f.compDer D : A → N) = (f : M →ₗ[R] N).comp (D : A → /-- The composition of a derivation with a linear map as a bilinear map -/ @[simps] -def llcomp : (M →ₗ[A] N) →ₗ[A] Derivation R A M →ₗ[R] Derivation R A N where +def llcomp : (M →ₗ[A] N) →ₗ[A] Derivation R A M →ₗ[A] Derivation R A N where toFun f := f.compDer map_add' f₁ f₂ := by ext; rfl map_smul' r D := by ext; rfl /-- Pushing a derivation forward through a linear equivalence is an equivalence. -/ -def _root_.LinearEquiv.compDer : Derivation R A M ≃ₗ[R] Derivation R A N := +def _root_.LinearEquiv.compDer : Derivation R A M ≃ₗ[A] Derivation R A N := { e.toLinearMap.compDer with invFun := e.symm.toLinearMap.compDer left_inv := fun D => by ext a; exact e.symm_apply_apply (D a) diff --git a/Mathlib/RingTheory/Derivation/DifferentialRing.lean b/Mathlib/RingTheory/Derivation/DifferentialRing.lean index b15cee6cc4045c..2a400909721192 100644 --- a/Mathlib/RingTheory/Derivation/DifferentialRing.lean +++ b/Mathlib/RingTheory/Derivation/DifferentialRing.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ -import Mathlib.RingTheory.Derivation.Basic +module + +public import Mathlib.RingTheory.Derivation.Basic /-! # Differential and Algebras @@ -12,6 +14,8 @@ This file defines derivations from a commutative ring to itself as a typeclass, use the x′ notation for the derivative of x. -/ +@[expose] public section + /-- A derivation from a ring to itself, as a typeclass. -/ @[ext] class Differential (R : Type*) [CommRing R] where @@ -29,7 +33,7 @@ A delaborator for the x′ notation. This is required because it's not direct fu so the default delaborator doesn't work. -/ @[app_delab DFunLike.coe] -def delabDeriv : Delab := do +meta def delabDeriv : Delab := do let e ← getExpr guard <| e.isAppOfArity' ``DFunLike.coe 6 guard <| (e.getArg!' 4).isAppOf' ``Differential.deriv diff --git a/Mathlib/RingTheory/Derivation/Lie.lean b/Mathlib/RingTheory/Derivation/Lie.lean index a07f1db5d5cbb5..b9f9d7b6c8a8f0 100644 --- a/Mathlib/RingTheory/Derivation/Lie.lean +++ b/Mathlib/RingTheory/Derivation/Lie.lean @@ -3,16 +3,22 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri, Andrew Yang -/ -import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.RingTheory.Derivation.Basic +module + +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.RingTheory.Derivation.Basic /-! -# Results +# Lie Algebra Structure on Derivations + +## Main statements - `Derivation.instLieAlgebra`: The `R`-derivations from `A` to `A` form a Lie algebra over `R`. -/ +@[expose] public section + namespace Derivation @@ -22,7 +28,7 @@ variable {D1 D2 : Derivation R A A} (a : A) section LieStructures -/-! # Lie structures -/ +/-! ### Lie structures -/ /-- The commutator of derivations is again a derivation. -/ diff --git a/Mathlib/RingTheory/Derivation/MapCoeffs.lean b/Mathlib/RingTheory/Derivation/MapCoeffs.lean index e7cca78558f1ea..44f7f08599a2fa 100644 --- a/Mathlib/RingTheory/Derivation/MapCoeffs.lean +++ b/Mathlib/RingTheory/Derivation/MapCoeffs.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Daniel Weber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Daniel Weber -/ -import Mathlib.RingTheory.Derivation.DifferentialRing -import Mathlib.Algebra.Polynomial.Module.Basic -import Mathlib.Algebra.Polynomial.Derivation -import Mathlib.FieldTheory.Separable +module + +public import Mathlib.RingTheory.Derivation.DifferentialRing +public import Mathlib.Algebra.Polynomial.Module.Basic +public import Mathlib.Algebra.Polynomial.Derivation +public import Mathlib.FieldTheory.Separable /-! # Coefficient-wise derivation on polynomials @@ -17,6 +19,8 @@ show this forms a derivation, and prove `apply_eval_eq`, which shows that for a are generalizations of that for algebras. We also have a special case for `DifferentialAlgebra`s. -/ +@[expose] public section + noncomputable section open Polynomial Module diff --git a/Mathlib/RingTheory/Derivation/ToSquareZero.lean b/Mathlib/RingTheory/Derivation/ToSquareZero.lean index 32f556817b9161..2a2e70bb030657 100644 --- a/Mathlib/RingTheory/Derivation/ToSquareZero.lean +++ b/Mathlib/RingTheory/Derivation/ToSquareZero.lean @@ -3,17 +3,23 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri, Andrew Yang -/ -import Mathlib.RingTheory.Derivation.Basic -import Mathlib.RingTheory.Ideal.Quotient.Operations +module + +public import Mathlib.RingTheory.Derivation.Basic +public import Mathlib.RingTheory.Ideal.Quotient.Operations /-! -# Results +# Derivations into Square-Zero Ideals + +## Main statements - `derivationToSquareZeroOfLift`: The `R`-derivations from `A` into a square-zero ideal `I` of `B` corresponds to the lifts `A →ₐ[R] B` of the map `A →ₐ[R] B ⧸ I`. -/ +@[expose] public section + section ToSquareZero diff --git a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean index fcb17a4f12afaf..53c8fabd41d53d 100644 --- a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean +++ b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.LocalRing.RingHom.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.Basic -import Mathlib.RingTheory.Valuation.PrimeMultiplicity -import Mathlib.RingTheory.Valuation.ValuationRing +module + +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.LocalRing.RingHom.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.Basic +public import Mathlib.RingTheory.Valuation.PrimeMultiplicity +public import Mathlib.RingTheory.Valuation.ValuationRing /-! # Discrete valuation rings @@ -44,6 +46,8 @@ We do not hence define `Uniformizer` at all, because we can use `Irreducible` in discrete valuation ring -/ +@[expose] public section + universe u open Ideal IsLocalRing @@ -132,9 +136,7 @@ theorem iff_pid_with_one_nonzero_prime (R : Type u) [CommRing R] [IsDomain R] : refine { not_a_field' := ?_ } rcases Punique with ⟨P, ⟨hP1, hP2⟩, _⟩ have hPM : P ≤ maximalIdeal R := le_maximalIdeal hP2.1 - intro h - rw [h, le_bot_iff] at hPM - exact hP1 hPM + order theorem associated_of_irreducible {a b : R} (ha : Irreducible a) (hb : Irreducible b) : Associated a b := by diff --git a/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean b/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean index c6ad1ffc1af667..d63a124a5b5db9 100644 --- a/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean +++ b/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.DedekindDomain.Basic -import Mathlib.RingTheory.DiscreteValuationRing.Basic -import Mathlib.RingTheory.Finiteness.Ideal -import Mathlib.RingTheory.Ideal.Cotangent +module + +public import Mathlib.RingTheory.DedekindDomain.Basic +public import Mathlib.RingTheory.DiscreteValuationRing.Basic +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Ideal.Cotangent /-! @@ -25,6 +27,8 @@ Noetherian local domain that is not a field `(R, m, k)`: Also see `tfae_of_isNoetherianRing_of_isLocalRing_of_isDomain` for a version without `¬ IsField R`. -/ +@[expose] public section + variable (R : Type*) [CommRing R] @@ -183,8 +187,8 @@ theorem tfae_of_isNoetherianRing_of_isLocalRing_of_isDomain intro H constructor intro I J - by_cases hI : I = ⊥; · subst hI; left; exact bot_le - by_cases hJ : J = ⊥; · subst hJ; right; exact bot_le + by_cases hI : I = ⊥; · order + by_cases hJ : J = ⊥; · order obtain ⟨n, rfl⟩ := H I hI obtain ⟨m, rfl⟩ := H J hJ exact (le_total m n).imp Ideal.pow_le_pow_right Ideal.pow_le_pow_right diff --git a/Mathlib/RingTheory/Discriminant.lean b/Mathlib/RingTheory/Discriminant.lean index 557388d58c15dd..1d77cea7f72962 100644 --- a/Mathlib/RingTheory/Discriminant.lean +++ b/Mathlib/RingTheory/Discriminant.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite -import Mathlib.RingTheory.Norm.Transitivity -import Mathlib.RingTheory.Trace.Basic +module + +public import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite +public import Mathlib.RingTheory.Norm.Transitivity +public import Mathlib.RingTheory.Trace.Basic /-! # Discriminant of a family of vectors @@ -45,6 +47,8 @@ Our definition works for any `A`-algebra `B`, but note that if `B` is not free a then `trace A B = 0` by definition, so `discr A b = 0` for any `b`. -/ +@[expose] public section + universe u v w z diff --git a/Mathlib/RingTheory/DividedPowers/Basic.lean b/Mathlib/RingTheory/DividedPowers/Basic.lean index f9d29fb31e8fc1..e6249a8923ce42 100644 --- a/Mathlib/RingTheory/DividedPowers/Basic.lean +++ b/Mathlib/RingTheory/DividedPowers/Basic.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Antoine Chambert-Loir & María-Inés de Frutos—Fernández. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María-Inés de Frutos—Fernández -/ +module -import Mathlib.RingTheory.PowerSeries.Basic -import Mathlib.Combinatorics.Enumerative.Bell -import Mathlib.Data.Nat.Choose.Multinomial -import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.Combinatorics.Enumerative.Bell +public import Mathlib.Data.Nat.Choose.Multinomial +public import Mathlib.RingTheory.Ideal.Maps /-! # Divided powers @@ -63,6 +64,8 @@ modules*][Roby-1963] -/ +@[expose] public section + open Finset Nat Ideal section DividedPowersDefinition diff --git a/Mathlib/RingTheory/DividedPowers/DPMorphism.lean b/Mathlib/RingTheory/DividedPowers/DPMorphism.lean index 01854db0940f1d..5b44e1cbf6aadb 100644 --- a/Mathlib/RingTheory/DividedPowers/DPMorphism.lean +++ b/Mathlib/RingTheory/DividedPowers/DPMorphism.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.RingTheory.DividedPowers.Basic +module + +public import Mathlib.RingTheory.DividedPowers.Basic /-! # Divided power morphisms @@ -49,6 +51,8 @@ modules*][Roby-1963] * [N. Roby, *Les algèbres à puissances dividées*][Roby-1965] -/ +@[expose] public section + open Ideal Set SetLike namespace DividedPowers diff --git a/Mathlib/RingTheory/DividedPowers/Padic.lean b/Mathlib/RingTheory/DividedPowers/Padic.lean index 6b34104645d0be..2326cc56c10ba5 100644 --- a/Mathlib/RingTheory/DividedPowers/Padic.lean +++ b/Mathlib/RingTheory/DividedPowers/Padic.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ +module -import Mathlib.NumberTheory.Padics.PadicIntegers -import Mathlib.RingTheory.DividedPowers.RatAlgebra +public import Mathlib.NumberTheory.Padics.PadicIntegers +public import Mathlib.RingTheory.DividedPowers.RatAlgebra /-! # Divided powers on ℤ_[p] @@ -23,6 +24,8 @@ TODO: If `K` is a `p`-adic local field with ring of integers `R` and uniformizer -/ +@[expose] public section + namespace PadicInt open DividedPowers DividedPowers.OfInvertibleFactorial Nat Ring diff --git a/Mathlib/RingTheory/DividedPowers/RatAlgebra.lean b/Mathlib/RingTheory/DividedPowers/RatAlgebra.lean index 127ffa636c46a6..076e680e8434b5 100644 --- a/Mathlib/RingTheory/DividedPowers/RatAlgebra.lean +++ b/Mathlib/RingTheory/DividedPowers/RatAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.Data.Nat.Factorial.NatCast -import Mathlib.RingTheory.DividedPowers.Basic +module + +public import Mathlib.Data.Nat.Factorial.NatCast +public import Mathlib.RingTheory.DividedPowers.Basic /-! # Examples of divided power structures @@ -46,6 +48,8 @@ modules*][Roby-1963] -/ +@[expose] public section + open Nat Ring namespace DividedPowers diff --git a/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean b/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean index 80f5ed53d382b6..22e2fa854118e3 100644 --- a/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean +++ b/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ +module -import Mathlib.RingTheory.DividedPowers.DPMorphism -import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.DividedPowers.DPMorphism +public import Mathlib.RingTheory.Ideal.Quotient.Operations /-! # Sub-divided power-ideals @@ -69,6 +70,8 @@ lattice. * [N. Roby, *Les algèbres à puissances dividées*][Roby-1965] -/ +@[expose] public section + open Subtype namespace DividedPowers diff --git a/Mathlib/RingTheory/DualNumber.lean b/Mathlib/RingTheory/DualNumber.lean index c3ca40b9247e4e..5ffb83a9a4884d 100644 --- a/Mathlib/RingTheory/DualNumber.lean +++ b/Mathlib/RingTheory/DualNumber.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Algebra.DualNumber -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.Algebra.DualNumber +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.RingTheory.Nilpotent.Defs /-! # Algebraic properties of dual numbers @@ -19,6 +21,8 @@ import Mathlib.RingTheory.Nilpotent.Defs -/ +@[expose] public section + namespace TrivSqZeroExt variable {R M : Type*} diff --git a/Mathlib/RingTheory/EisensteinCriterion.lean b/Mathlib/RingTheory/EisensteinCriterion.lean index 76de8e802694b2..976d9fb3e38c8f 100644 --- a/Mathlib/RingTheory/EisensteinCriterion.lean +++ b/Mathlib/RingTheory/EisensteinCriterion.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Data.Nat.Cast.WithTop -import Mathlib.RingTheory.Ideal.Quotient.Basic -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.Prime +module + +public import Mathlib.Data.Nat.Cast.WithTop +public import Mathlib.RingTheory.Ideal.Quotient.Basic +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.Prime deprecated_module "Auto-generated deprecation" (since := "2025-04-11") diff --git a/Mathlib/RingTheory/EssentialFiniteness.lean b/Mathlib/RingTheory/EssentialFiniteness.lean index 96eb5b04f8b0f1..d08f3c159a6a45 100644 --- a/Mathlib/RingTheory/EssentialFiniteness.lean +++ b/Mathlib/RingTheory/EssentialFiniteness.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Localization.Defs -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Essentially of finite type algebras @@ -18,6 +20,8 @@ import Mathlib.RingTheory.TensorProduct.Basic -/ +@[expose] public section + open scoped TensorProduct namespace Algebra diff --git a/Mathlib/RingTheory/Etale/Basic.lean b/Mathlib/RingTheory/Etale/Basic.lean index 03082075ac775a..219931c9250bb5 100644 --- a/Mathlib/RingTheory/Etale/Basic.lean +++ b/Mathlib/RingTheory/Etale/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.Quotient.Nilpotent -import Mathlib.RingTheory.Smooth.Basic -import Mathlib.RingTheory.Unramified.Basic +module + +public import Mathlib.RingTheory.Ideal.Quotient.Nilpotent +public import Mathlib.RingTheory.Smooth.Basic +public import Mathlib.RingTheory.Unramified.Basic /-! @@ -25,6 +27,8 @@ localization at an element. -/ +@[expose] public section + open scoped TensorProduct universe u v @@ -108,14 +112,29 @@ end OfEquiv section Comp +variable [Algebra A B] [IsScalarTower R A B] + variable (R A B) in -theorem comp [Algebra A B] [IsScalarTower R A B] [FormallyEtale R A] [FormallyEtale A B] : +theorem comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_formallyUnramified_and_formallySmooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ +lemma Algebra.FormallyEtale.of_restrictScalars [FormallyUnramified R A] [FormallyEtale R B] : + FormallyEtale A B := + have := FormallyUnramified.of_restrictScalars R A B + have := FormallySmooth.of_restrictScalars R A B + .of_formallyUnramified_and_formallySmooth + end Comp +lemma Algebra.FormallyEtale.iff_of_surjective + {R S : Type u} [CommRing R] [CommRing S] + [Algebra R S] (h : Function.Surjective (algebraMap R S)) : + Algebra.FormallyEtale R S ↔ IsIdempotentElem (RingHom.ker (algebraMap R S)) := by + rw [FormallyEtale.iff_formallyUnramified_and_formallySmooth, ← FormallySmooth.iff_of_surjective h, + and_iff_right (FormallyUnramified.of_surjective (Algebra.ofId R S) h)] + section BaseChange open scoped TensorProduct diff --git a/Mathlib/RingTheory/Etale/Field.lean b/Mathlib/RingTheory/Etale/Field.lean index f743675d98cb7c..ae032e8f633ff1 100644 --- a/Mathlib/RingTheory/Etale/Field.lean +++ b/Mathlib/RingTheory/Etale/Field.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Etale.Pi -import Mathlib.RingTheory.Unramified.Field +module + +public import Mathlib.RingTheory.Etale.Pi +public import Mathlib.RingTheory.Unramified.Field /-! # Étale algebras over fields @@ -29,6 +31,8 @@ Let `K` be a field, `A` be a `K`-algebra and `L` be a field extension of `K`. -/ +@[expose] public section + universe u diff --git a/Mathlib/RingTheory/Etale/Kaehler.lean b/Mathlib/RingTheory/Etale/Kaehler.lean index 6a28f288ba2e55..e2390f876d41b2 100644 --- a/Mathlib/RingTheory/Etale/Kaehler.lean +++ b/Mathlib/RingTheory/Etale/Kaehler.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Etale.Basic -import Mathlib.RingTheory.Kaehler.JacobiZariski -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Smooth.Kaehler -import Mathlib.RingTheory.Flat.Localization +module + +public import Mathlib.RingTheory.Etale.Basic +public import Mathlib.RingTheory.Kaehler.JacobiZariski +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Smooth.Kaehler +public import Mathlib.RingTheory.Flat.Localization /-! # The differential module and étale algebras @@ -19,6 +21,8 @@ import Mathlib.RingTheory.Flat.Localization The canonical isomorphism `T ⊗[S] H¹(L_{S⁄R}) ≃ₗ[T] H¹(L_{T⁄R})` for `T` a localization of `S`. -/ +@[expose] public section + universe u variable (R S T : Type*) [CommRing R] [CommRing S] [CommRing T] diff --git a/Mathlib/RingTheory/Etale/Pi.lean b/Mathlib/RingTheory/Etale/Pi.lean index 6c7da76f81c584..1bb59702e9e219 100644 --- a/Mathlib/RingTheory/Etale/Pi.lean +++ b/Mathlib/RingTheory/Etale/Pi.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Smooth.Pi -import Mathlib.RingTheory.Unramified.Pi -import Mathlib.RingTheory.Etale.Basic +module + +public import Mathlib.RingTheory.Smooth.Pi +public import Mathlib.RingTheory.Unramified.Pi +public import Mathlib.RingTheory.Etale.Basic /-! @@ -18,6 +20,8 @@ import Mathlib.RingTheory.Etale.Basic -/ +@[expose] public section + namespace Algebra.FormallyEtale variable {R : Type*} {I : Type*} (A : I → Type*) diff --git a/Mathlib/RingTheory/EuclideanDomain.lean b/Mathlib/RingTheory/EuclideanDomain.lean index 2e2ef97176d946..5fe934c3377798 100644 --- a/Mathlib/RingTheory/EuclideanDomain.lean +++ b/Mathlib/RingTheory/EuclideanDomain.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Chris Hughes -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.RingTheory.Ideal.Basic +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Lemmas about Euclidean domains @@ -20,6 +22,8 @@ probably be reproved in more generality and this file perhaps removed? euclidean domain -/ +@[expose] public section + section diff --git a/Mathlib/RingTheory/Extension.lean b/Mathlib/RingTheory/Extension.lean index 53d7ce6cfe8c25..e75aa2427c8378 100644 --- a/Mathlib/RingTheory/Extension.lean +++ b/Mathlib/RingTheory/Extension.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Extension.Basic +module + +public import Mathlib.RingTheory.Extension.Basic deprecated_module (since := "2025-05-11") diff --git a/Mathlib/RingTheory/Extension/Basic.lean b/Mathlib/RingTheory/Extension/Basic.lean index adc8c08763fef6..3764a2debf0f00 100644 --- a/Mathlib/RingTheory/Extension/Basic.lean +++ b/Mathlib/RingTheory/Extension/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.Ideal.Cotangent -import Mathlib.RingTheory.Localization.Defs +module + +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.Ideal.Cotangent +public import Mathlib.RingTheory.Localization.Defs /-! @@ -30,6 +32,8 @@ surjection `P →ₐ[R] R`. -/ +@[expose] public section + universe w u v open TensorProduct MvPolynomial diff --git a/Mathlib/RingTheory/Extension/Cotangent/Basic.lean b/Mathlib/RingTheory/Extension/Cotangent/Basic.lean index 5dd3f8489032f0..0c73b3d4814f30 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/Basic.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Kaehler.Polynomial -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.RingTheory.Extension.Presentation.Basic +module + +public import Mathlib.RingTheory.Kaehler.Polynomial +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.RingTheory.Extension.Presentation.Basic /-! @@ -35,6 +37,8 @@ apply them to infinitesimal smooth (or versal) extensions later. -/ +@[expose] public section + open KaehlerDifferential Module MvPolynomial TensorProduct namespace Algebra diff --git a/Mathlib/RingTheory/Extension/Cotangent/Free.lean b/Mathlib/RingTheory/Extension/Cotangent/Free.lean index 8678b8c1090779..60458af5f615a5 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/Free.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/Free.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.LinearAlgebra.Basis.Exact -import Mathlib.RingTheory.Extension.Cotangent.Basic -import Mathlib.RingTheory.Extension.Presentation.Submersive +module + +public import Mathlib.LinearAlgebra.Basis.Exact +public import Mathlib.RingTheory.Extension.Cotangent.Basic +public import Mathlib.RingTheory.Extension.Presentation.Submersive /-! # Computation of Jacobian of presentations from basis of Cotangent @@ -24,6 +26,8 @@ smooth algebras (TODO @chrisflav). `I/I² → S ⊗[R] (Ω[R[Xᵢ]⁄R]) = ⊕ᵢ S → ⊕ⱼ S` is bijective, `P` is submersive. -/ +@[expose] public section + universe t₂ t₁ u v open KaehlerDifferential MvPolynomial diff --git a/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean b/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean index 6df80705d7f5c2..0fa637990ab62b 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Extension.Presentation.Basic -import Mathlib.RingTheory.Smooth.StandardSmoothCotangent -import Mathlib.RingTheory.Kaehler.JacobiZariski +module + +public import Mathlib.RingTheory.Extension.Presentation.Basic +public import Mathlib.RingTheory.Smooth.StandardSmoothCotangent +public import Mathlib.RingTheory.Kaehler.JacobiZariski /-! # Cotangent and localization away @@ -30,6 +32,8 @@ and the splitting from the Jacobi Zariski sequence. - `Algebra.Generators.cotangentCompLocalizationAwayEquiv`: `J/J² ≃ₗ[T] T ⊗[S] (I/I²) × K/K²`. -/ +@[expose] public section + open TensorProduct MvPolynomial namespace Algebra.Generators diff --git a/Mathlib/RingTheory/Extension/Generators.lean b/Mathlib/RingTheory/Extension/Generators.lean index 877aae4d8d1b2b..6db9696e4ac557 100644 --- a/Mathlib/RingTheory/Extension/Generators.lean +++ b/Mathlib/RingTheory/Extension/Generators.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.Cotangent -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.MvPolynomial.Tower -import Mathlib.RingTheory.TensorProduct.Basic -import Mathlib.RingTheory.Extension.Basic +module + +public import Mathlib.RingTheory.Ideal.Cotangent +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.MvPolynomial.Tower +public import Mathlib.RingTheory.TensorProduct.Basic +public import Mathlib.RingTheory.Extension.Basic /-! @@ -44,6 +46,8 @@ unification hints. -/ +@[expose] public section + universe w u v open TensorProduct MvPolynomial diff --git a/Mathlib/RingTheory/Extension/Presentation/Basic.lean b/Mathlib/RingTheory/Extension/Presentation/Basic.lean index 43591ed2239415..d6ab64c4d00acc 100644 --- a/Mathlib/RingTheory/Extension/Presentation/Basic.lean +++ b/Mathlib/RingTheory/Extension/Presentation/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jung Tao Cheng, Christian Merten, Andrew Yang -/ -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.FinitePresentation -import Mathlib.RingTheory.Extension.Generators -import Mathlib.RingTheory.MvPolynomial.Localization -import Mathlib.RingTheory.TensorProduct.MvPolynomial +module + +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.FinitePresentation +public import Mathlib.RingTheory.Extension.Generators +public import Mathlib.RingTheory.MvPolynomial.Localization +public import Mathlib.RingTheory.TensorProduct.MvPolynomial /-! @@ -40,6 +42,8 @@ in June 2024. -/ +@[expose] public section + universe t w u v open TensorProduct MvPolynomial diff --git a/Mathlib/RingTheory/Extension/Presentation/Core.lean b/Mathlib/RingTheory/Extension/Presentation/Core.lean index c4ab09fe138dc5..09dce7249815e4 100644 --- a/Mathlib/RingTheory/Extension/Presentation/Core.lean +++ b/Mathlib/RingTheory/Extension/Presentation/Core.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Extension.Presentation.Basic +module + +public import Mathlib.RingTheory.Extension.Presentation.Basic /-! # Presentations on subrings @@ -20,6 +22,8 @@ this API can be used to remove Noetherian hypothesis in certain cases. -/ +@[expose] public section + open TensorProduct variable {R S ι σ : Type*} [CommRing R] [CommRing S] [Algebra R S] diff --git a/Mathlib/RingTheory/Extension/Presentation/Submersive.lean b/Mathlib/RingTheory/Extension/Presentation/Submersive.lean index 644e31023bfd24..8ada2c991b8dfd 100644 --- a/Mathlib/RingTheory/Extension/Presentation/Submersive.lean +++ b/Mathlib/RingTheory/Extension/Presentation/Submersive.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jung Tao Cheng, Christian Merten, Andrew Yang -/ -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.LinearAlgebra.Determinant -import Mathlib.RingTheory.Extension.Presentation.Basic +module + +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.RingTheory.Extension.Presentation.Basic /-! # Submersive presentations @@ -45,6 +47,8 @@ in June 2024. -/ +@[expose] public section + universe t t' w w' u v open TensorProduct Module MvPolynomial @@ -389,7 +393,7 @@ end BaseChange /-- Given a pre-submersive presentation `P` and equivalences `ι' ≃ ι` and `σ' ≃ σ`, this is the induced pre-submersive presentation with variables indexed -by `ι` and relations indexed by `κ -/ +by `ι` and relations indexed by `κ`. -/ @[simps toPresentation, simps -isSimp map] noncomputable def reindex (P : PreSubmersivePresentation R S ι σ) {ι' σ' : Type*} (e : ι' ≃ ι) (f : σ' ≃ σ) : diff --git a/Mathlib/RingTheory/FilteredAlgebra/Basic.lean b/Mathlib/RingTheory/FilteredAlgebra/Basic.lean index 91db488246ec37..4c89861581be3b 100644 --- a/Mathlib/RingTheory/FilteredAlgebra/Basic.lean +++ b/Mathlib/RingTheory/FilteredAlgebra/Basic.lean @@ -3,18 +3,20 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ -import Mathlib.Algebra.Module.Defs -import Mathlib.Algebra.GradedMonoid -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.GradedMulAction -import Mathlib.Algebra.Order.Ring.Unbundled.Basic -import Mathlib.Algebra.Ring.Int.Defs +module + +public import Mathlib.Algebra.Module.Defs +public import Mathlib.Algebra.GradedMonoid +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.GradedMulAction +public import Mathlib.Algebra.Order.Ring.Unbundled.Basic +public import Mathlib.Algebra.Ring.Int.Defs /-! # The filtration on abelian groups and rings In this file, we define the concept of filtration for abelian groups, rings, and modules. -# Main definitions +## Main definitions * `IsFiltration` : For a family of subsets `σ` of `A`, an increasing series of `F` in `σ` is a filtration if there is another series `F_lt` in `σ` equal to the @@ -31,6 +33,8 @@ In this file, we define the concept of filtration for abelian groups, rings, and -/ +@[expose] public section + section GeneralFiltration variable {ι A σ : Type*} [Preorder ι] [SetLike σ A] diff --git a/Mathlib/RingTheory/Filtration.lean b/Mathlib/RingTheory/Filtration.lean index fbf01e433d1b5f..df153d3d02977f 100644 --- a/Mathlib/RingTheory/Filtration.lean +++ b/Mathlib/RingTheory/Filtration.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Polynomial.Module.Basic -import Mathlib.RingTheory.Finiteness.Nakayama -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.ReesAlgebra +module + +public import Mathlib.Algebra.Polynomial.Module.Basic +public import Mathlib.RingTheory.Finiteness.Nakayama +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.ReesAlgebra /-! @@ -36,6 +38,8 @@ This file contains the definitions and basic results around (stable) `I`-filtrat -/ +@[expose] public section + variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) open Polynomial diff --git a/Mathlib/RingTheory/FiniteLength.lean b/Mathlib/RingTheory/FiniteLength.lean index dd64b63874e952..1ad112ff102672 100644 --- a/Mathlib/RingTheory/FiniteLength.lean +++ b/Mathlib/RingTheory/FiniteLength.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.RingTheory.Artinian.Module +module + +public import Mathlib.RingTheory.Artinian.Module /-! # Modules of finite length @@ -19,6 +21,8 @@ We do not make `IsFiniteLength` a class, instead we use `[IsNoetherian R M] [IsA Finite length, Composition series -/ +@[expose] public section + variable (R : Type*) [Ring R] /-- A module of finite length is either trivial or a simple extension of a module known diff --git a/Mathlib/RingTheory/FinitePresentation.lean b/Mathlib/RingTheory/FinitePresentation.lean index fa6892e0e4b051..898e783dbc07b3 100644 --- a/Mathlib/RingTheory/FinitePresentation.lean +++ b/Mathlib/RingTheory/FinitePresentation.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Data.Finite.Sum -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Finiteness.Ideal -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.MvPolynomial.Tower +module + +public import Mathlib.Data.Finite.Sum +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.MvPolynomial.Tower /-! # Finiteness conditions in commutative algebra @@ -25,6 +27,8 @@ In this file we define several notions of finiteness that are common in commutat -/ +@[expose] public section + open Function (Surjective) open Polynomial diff --git a/Mathlib/RingTheory/FiniteStability.lean b/Mathlib/RingTheory/FiniteStability.lean index e6c01b482e9efa..82d73766dfe611 100644 --- a/Mathlib/RingTheory/FiniteStability.lean +++ b/Mathlib/RingTheory/FiniteStability.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.FinitePresentation -import Mathlib.RingTheory.TensorProduct.MvPolynomial +module + +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.FinitePresentation +public import Mathlib.RingTheory.TensorProduct.MvPolynomial /-! @@ -16,6 +18,8 @@ stable under base change. -/ +@[expose] public section + open scoped TensorProduct universe w₁ w₂ w₃ diff --git a/Mathlib/RingTheory/FiniteType.lean b/Mathlib/RingTheory/FiniteType.lean index 1c7a959d7ffb91..87c56916b2786f 100644 --- a/Mathlib/RingTheory/FiniteType.lean +++ b/Mathlib/RingTheory/FiniteType.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.FreeAlgebra -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Adjoin.Tower -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Noetherian.Orzech +module + +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Adjoin.Tower +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Noetherian.Orzech /-! # Finiteness conditions in commutative algebra @@ -21,6 +23,8 @@ In this file we define a notion of finiteness that is common in commutative alge -/ +@[expose] public section + open Function (Surjective) open Polynomial diff --git a/Mathlib/RingTheory/Finiteness/Basic.lean b/Mathlib/RingTheory/Finiteness/Basic.lean index b9bc7a358c8f78..cbccd42d4631e5 100644 --- a/Mathlib/RingTheory/Finiteness/Basic.lean +++ b/Mathlib/RingTheory/Finiteness/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Order.Nonneg.Module -import Mathlib.LinearAlgebra.Pi -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.RingTheory.Finiteness.Defs +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Order.Nonneg.Module +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.RingTheory.Finiteness.Defs /-! # Basic results on finitely generated (sub)modules @@ -16,6 +18,8 @@ This file contains the basic results on `Submodule.FG` and `Module.Finite` that further imports. -/ +@[expose] public section + assert_not_exists Module.Basis Ideal.radical Matrix Subalgebra open Function (Surjective) diff --git a/Mathlib/RingTheory/Finiteness/Bilinear.lean b/Mathlib/RingTheory/Finiteness/Bilinear.lean index f639e81aa6f3bf..2a33553e8a1cc8 100644 --- a/Mathlib/RingTheory/Finiteness/Bilinear.lean +++ b/Mathlib/RingTheory/Finiteness/Bilinear.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.Algebra.Module.Submodule.Bilinear +module + +public import Mathlib.RingTheory.Finiteness.Defs +public import Mathlib.Algebra.Module.Submodule.Bilinear /-! # Finitely generated submodules and bilinear maps -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/Finiteness/Cardinality.lean b/Mathlib/RingTheory/Finiteness/Cardinality.lean index e3daea1aacf94c..a97a315cef6e90 100644 --- a/Mathlib/RingTheory/Finiteness/Cardinality.lean +++ b/Mathlib/RingTheory/Finiteness/Cardinality.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Module.Congruence.Defs -import Mathlib.LinearAlgebra.Basis.Cardinality -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.LinearAlgebra.StdBasis -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Algebra.Module.Congruence.Defs +public import Mathlib.LinearAlgebra.Basis.Cardinality +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.LinearAlgebra.StdBasis +public import Mathlib.RingTheory.Finiteness.Basic /-! # Finite modules and types with finitely many elements @@ -17,6 +19,8 @@ This file relates `Module.Finite` and `_root_.Finite`. -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/Finiteness/Defs.lean b/Mathlib/RingTheory/Finiteness/Defs.lean index 67f7a674eb1bf8..152024a75f0bcd 100644 --- a/Mathlib/RingTheory/Finiteness/Defs.lean +++ b/Mathlib/RingTheory/Finiteness/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Algebra.Hom -import Mathlib.Data.Set.Finite.Lemmas -import Mathlib.Data.Finsupp.Defs -import Mathlib.GroupTheory.Finiteness -import Mathlib.RingTheory.Ideal.Span -import Mathlib.Tactic.Algebraize +module + +public import Mathlib.Algebra.Algebra.Hom +public import Mathlib.Data.Set.Finite.Lemmas +public import Mathlib.Data.Finsupp.Defs +public import Mathlib.GroupTheory.Finiteness +public import Mathlib.RingTheory.Ideal.Span +public import Mathlib.Tactic.Algebraize /-! # Finiteness conditions in commutative algebra @@ -25,6 +27,8 @@ In this file we define a notion of finiteness that is common in commutative alge -/ +@[expose] public section + assert_not_exists Module.Basis Ideal.radical Matrix Subalgebra open Function (Surjective) diff --git a/Mathlib/RingTheory/Finiteness/Finsupp.lean b/Mathlib/RingTheory/Finiteness/Finsupp.lean index 255ecd52a01049..8e6b0fc480f96f 100644 --- a/Mathlib/RingTheory/Finiteness/Finsupp.lean +++ b/Mathlib/RingTheory/Finiteness/Finsupp.lean @@ -3,17 +3,21 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.FreeAbelianGroup.Finsupp -import Mathlib.Algebra.MonoidAlgebra.Module -import Mathlib.LinearAlgebra.Finsupp.LinearCombination -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Algebra.FreeAbelianGroup.Finsupp +public import Mathlib.Algebra.MonoidAlgebra.Module +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Finiteness.Basic /-! # Finiteness of (sub)modules and finitely supported functions -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/Finiteness/Ideal.lean b/Mathlib/RingTheory/Finiteness/Ideal.lean index 840632d4e78e8b..a241c0639559d0 100644 --- a/Mathlib/RingTheory/Finiteness/Ideal.lean +++ b/Mathlib/RingTheory/Finiteness/Ideal.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Group.Pointwise.Finset.Scalar -import Mathlib.RingTheory.Finiteness.Finsupp -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Scalar +public import Mathlib.RingTheory.Finiteness.Finsupp +public import Mathlib.RingTheory.Ideal.Maps /-! # Finitely generated ideals @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Ideal.Maps Lemmas about finiteness of ideal operations. -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/Finiteness/Lattice.lean b/Mathlib/RingTheory/Finiteness/Lattice.lean index 7cbb4d78a5b864..1c4c5724b1a664 100644 --- a/Mathlib/RingTheory/Finiteness/Lattice.lean +++ b/Mathlib/RingTheory/Finiteness/Lattice.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Data.Fintype.Lattice -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Data.Fintype.Lattice +public import Mathlib.RingTheory.Finiteness.Basic /-! # Finite suprema of finite modules -/ +@[expose] public section + namespace Submodule open Module diff --git a/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean b/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean index 59a25c08d5ad32..39fb07bd56b47d 100644 --- a/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean +++ b/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.RingTheory.AdjoinRoot +module + +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.RingTheory.AdjoinRoot /-! # Finitely presented algebras and finitely presented modules @@ -24,6 +26,8 @@ finitely presented as a module. - [Grothendieck, EGA IV₁ 1.4.7][ega-iv-1] -/ +@[expose] public section + universe u variable (R : Type u) (S : Type*) [CommRing R] [CommRing S] [Algebra R S] diff --git a/Mathlib/RingTheory/Finiteness/Nakayama.lean b/Mathlib/RingTheory/Finiteness/Nakayama.lean index a247742c192c70..5f5163769795dd 100644 --- a/Mathlib/RingTheory/Finiteness/Nakayama.lean +++ b/Mathlib/RingTheory/Finiteness/Nakayama.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.Finiteness.Defs -import Mathlib.RingTheory.Ideal.Operations +module + +public import Mathlib.RingTheory.Finiteness.Defs +public import Mathlib.RingTheory.Ideal.Operations /-! # Nakayama's lemma @@ -17,6 +19,8 @@ import Mathlib.RingTheory.Ideal.Operations -/ +@[expose] public section + namespace Submodule /-- **Nakayama's Lemma**. Atiyah-Macdonald 2.5, Eisenbud 4.7, Matsumura 2.2. -/ diff --git a/Mathlib/RingTheory/Finiteness/Nilpotent.lean b/Mathlib/RingTheory/Finiteness/Nilpotent.lean index fe625fe1b20e88..f2867177eae0c4 100644 --- a/Mathlib/RingTheory/Finiteness/Nilpotent.lean +++ b/Mathlib/RingTheory/Finiteness/Nilpotent.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Nilpotent.Lemmas +module + +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Nilpotent.Lemmas /-! # Nilpotent maps on finite modules -/ +@[expose] public section + variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] theorem Module.End.isNilpotent_iff_of_finite [Module.Finite R M] {f : End R M} : diff --git a/Mathlib/RingTheory/Finiteness/Prod.lean b/Mathlib/RingTheory/Finiteness/Prod.lean index ede2bbb27b2cc4..2ccd45f140cb3f 100644 --- a/Mathlib/RingTheory/Finiteness/Prod.lean +++ b/Mathlib/RingTheory/Finiteness/Prod.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.LinearAlgebra.Prod -import Mathlib.RingTheory.Finiteness.Defs +module + +public import Mathlib.LinearAlgebra.Prod +public import Mathlib.RingTheory.Finiteness.Defs /-! # Finitely generated product (sub)modules -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/Finiteness/Projective.lean b/Mathlib/RingTheory/Finiteness/Projective.lean index 76bf92470cd3a6..656784294344d4 100644 --- a/Mathlib/RingTheory/Finiteness/Projective.lean +++ b/Mathlib/RingTheory/Finiteness/Projective.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Module.Projective -import Mathlib.RingTheory.Finiteness.Cardinality +module + +public import Mathlib.Algebra.Module.Projective +public import Mathlib.RingTheory.Finiteness.Cardinality /-! # Finite and projective modules -/ +@[expose] public section + open Function (Surjective) namespace Module diff --git a/Mathlib/RingTheory/Finiteness/Quotient.lean b/Mathlib/RingTheory/Finiteness/Quotient.lean index a01082aeb9277f..fbcf9676a97e17 100644 --- a/Mathlib/RingTheory/Finiteness/Quotient.lean +++ b/Mathlib/RingTheory/Finiteness/Quotient.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Yongle Hu -/ -import Mathlib.Algebra.Group.Subgroup.Actions -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Ideal.Pointwise -import Mathlib.RingTheory.Ideal.Over +module + +public import Mathlib.Algebra.Group.Subgroup.Actions +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Ideal.Pointwise +public import Mathlib.RingTheory.Ideal.Over /-! # Finiteness of quotient modules -/ +@[expose] public section + variable {A B : Type*} [CommRing A] [CommRing B] [Algebra A B] variable (P : Ideal B) (p : Ideal A) [P.LiesOver p] diff --git a/Mathlib/RingTheory/Finiteness/Small.lean b/Mathlib/RingTheory/Finiteness/Small.lean index 27e65da9deb6b2..8eb94ed98924af 100644 --- a/Mathlib/RingTheory/Finiteness/Small.lean +++ b/Mathlib/RingTheory/Finiteness/Small.lean @@ -3,18 +3,22 @@ Copyright (c) 2025 Antoine Chambert-Loir, María-Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, Maria-Inés de Frutos-Fernandez -/ -import Mathlib.LinearAlgebra.Finsupp.LinearCombination -import Mathlib.RingTheory.FiniteType -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.LinearAlgebra.Basis.Cardinality -import Mathlib.LinearAlgebra.StdBasis -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.MvPolynomial.Basic -import Mathlib.Data.DFinsupp.Small +module + +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination +public import Mathlib.RingTheory.FiniteType +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.LinearAlgebra.Basis.Cardinality +public import Mathlib.LinearAlgebra.StdBasis +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.MvPolynomial.Basic +public import Mathlib.Data.DFinsupp.Small /-! # Smallness properties of modules and algebras -/ +@[expose] public section + universe u namespace Submodule diff --git a/Mathlib/RingTheory/Finiteness/Subalgebra.lean b/Mathlib/RingTheory/Finiteness/Subalgebra.lean index 8fc5c7eaef08d7..533dd19f031f90 100644 --- a/Mathlib/RingTheory/Finiteness/Subalgebra.lean +++ b/Mathlib/RingTheory/Finiteness/Subalgebra.lean @@ -3,14 +3,18 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Finiteness.Bilinear +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Finiteness.Bilinear /-! # Subalgebras that are finitely generated as submodules -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/Fintype.lean b/Mathlib/RingTheory/Fintype.lean index 7dffac7e14bb9e..8a0c9cfe5050c2 100644 --- a/Mathlib/RingTheory/Fintype.lean +++ b/Mathlib/RingTheory/Fintype.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.ZMod.Basic -import Mathlib.Tactic.NormNum +module + +public import Mathlib.Data.ZMod.Basic +public import Mathlib.Tactic.NormNum /-! # Some facts about finite rings -/ +@[expose] public section + open Finset ZMod diff --git a/Mathlib/RingTheory/Flat/Basic.lean b/Mathlib/RingTheory/Flat/Basic.lean index 188232ed84897c..f2bd1a8bc920a2 100644 --- a/Mathlib/RingTheory/Flat/Basic.lean +++ b/Mathlib/RingTheory/Flat/Basic.lean @@ -3,12 +3,15 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Jujian Zhang, Yongle Hu -/ -import Mathlib.Algebra.Colimit.TensorProduct -import Mathlib.Algebra.Module.Projective -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.Finiteness.Small -import Mathlib.RingTheory.IsTensorProduct -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.Algebra.Colimit.TensorProduct +public import Mathlib.Algebra.Module.Projective +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.Finiteness.Small +public import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.RingTheory.TensorProduct.Finite +public import Mathlib.RingTheory.Adjoin.FGBaseChange /-! # Flat modules @@ -57,6 +60,8 @@ the current `Module.Flat` to `Module.MonoFlat`. -/ +@[expose] public section + assert_not_exists AddCircle universe v' u v w @@ -582,3 +587,22 @@ theorem IsSMulRegular.of_flat {x : R} (reg : IsSMulRegular R x) : reg.of_flat_of_isBaseChange (IsBaseChange.linearMap R S) end IsSMulRegular + +/-- Let `R` be a commutative semiring, let `C` be a commutative `R`-algebra, and let `A` be an + `R`-algebra. If `C ⊗[R] B` is reduced for all finitely generated subalgebras `B` of `A`, then + `C ⊗[R] A` is also reduced. -/ +theorem IsReduced.tensorProduct_of_flat_of_forall_fg {R C A : Type*} + [CommSemiring R] [CommSemiring C] [Semiring A] [Algebra R A] [Algebra R C] [Module.Flat R C] + (h : ∀ B : Subalgebra R A, B.FG → IsReduced (C ⊗[R] B)) : + IsReduced (C ⊗[R] A) := by + by_contra h_contra + obtain ⟨x, hx⟩ := exists_isNilpotent_of_not_isReduced h_contra + obtain ⟨D, hD⟩ := exists_fg_and_mem_baseChange x + have h_inj : Function.Injective + (Algebra.TensorProduct.map (AlgHom.id C C ) D.val) := + Module.Flat.lTensor_preserves_injective_linearMap _ Subtype.val_injective + obtain ⟨z, rfl⟩ := hD.2 + have h_notReduced : ¬IsReduced (C ⊗[R] D) := by + simp_rw [isReduced_iff, not_forall] + exact ⟨z, (IsNilpotent.map_iff h_inj).mp hx.right, (by simpa [·] using hx.1)⟩ + tauto diff --git a/Mathlib/RingTheory/Flat/CategoryTheory.lean b/Mathlib/RingTheory/Flat/CategoryTheory.lean index c29e5a8192d973..e59ebf3e4d4971 100644 --- a/Mathlib/RingTheory/Flat/CategoryTheory.lean +++ b/Mathlib/RingTheory/Flat/CategoryTheory.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.RingTheory.Flat.Basic -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +module + +public import Mathlib.RingTheory.Flat.Basic +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic /-! # Tensoring with a flat module is an exact functor @@ -28,6 +30,8 @@ In this file we prove that tensoring with a flat module is an exact functor. -/ +@[expose] public section + universe u open CategoryTheory MonoidalCategory ShortComplex.ShortExact diff --git a/Mathlib/RingTheory/Flat/Domain.lean b/Mathlib/RingTheory/Flat/Domain.lean index a1d52d9d70b099..bcc6e11d2d8f08 100644 --- a/Mathlib/RingTheory/Flat/Domain.lean +++ b/Mathlib/RingTheory/Flat/Domain.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.RingTheory.Flat.Localization +module + +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.RingTheory.Flat.Localization /-! # Flat modules in domains @@ -13,6 +15,8 @@ We show that the tensor product of two injective linear maps is injective if the and the ring is an integral domain. -/ +@[expose] public section + universe u variable {R M N : Type*} [CommRing R] [IsDomain R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/RingTheory/Flat/Equalizer.lean b/Mathlib/RingTheory/Flat/Equalizer.lean index 3618d01cce05a7..f9dd75fbb40b1a 100644 --- a/Mathlib/RingTheory/Flat/Equalizer.lean +++ b/Mathlib/RingTheory/Flat/Equalizer.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Flat.Basic +module + +public import Mathlib.RingTheory.Flat.Basic /-! # Base change along flat modules preserves equalizers @@ -13,6 +15,8 @@ preserves kernels and equalizers. -/ +@[expose] public section + universe t u noncomputable section diff --git a/Mathlib/RingTheory/Flat/EquationalCriterion.lean b/Mathlib/RingTheory/Flat/EquationalCriterion.lean index a75291da4523cc..68147fd04d0fac 100644 --- a/Mathlib/RingTheory/Flat/EquationalCriterion.lean +++ b/Mathlib/RingTheory/Flat/EquationalCriterion.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Mitchell Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mitchell Lee, Junyan Xu -/ -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.LinearAlgebra.TensorProduct.Vanishing -import Mathlib.RingTheory.Flat.Tensor +module + +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.LinearAlgebra.TensorProduct.Vanishing +public import Mathlib.RingTheory.Flat.Tensor /-! # The equational criterion for flatness @@ -52,6 +54,8 @@ every finitely presented flat module is projective (`Module.Flat.projective_of_f -/ +@[expose] public section + variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] open LinearMap TensorProduct Finsupp diff --git a/Mathlib/RingTheory/Flat/FaithfullyFlat/Algebra.lean b/Mathlib/RingTheory/Flat/FaithfullyFlat/Algebra.lean index d3a9f0dcde9d8c..5fbf820d090dfc 100644 --- a/Mathlib/RingTheory/Flat/FaithfullyFlat/Algebra.lean +++ b/Mathlib/RingTheory/Flat/FaithfullyFlat/Algebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Christian Merten, Yi Song, Sihan Su. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Yi Song, Sihan Su -/ -import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic -import Mathlib.RingTheory.Ideal.Over -import Mathlib.RingTheory.LocalRing.RingHom.Basic -import Mathlib.RingTheory.Spectrum.Prime.RingHom -import Mathlib.RingTheory.TensorProduct.Quotient +module + +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic +public import Mathlib.RingTheory.Ideal.Over +public import Mathlib.RingTheory.LocalRing.RingHom.Basic +public import Mathlib.RingTheory.Spectrum.Prime.RingHom +public import Mathlib.RingTheory.TensorProduct.Quotient /-! # Properties of faithfully flat algebras @@ -36,6 +38,8 @@ Conversely, let `B` be a flat `A`-algebra: -/ +@[expose] public section + universe u v variable {A B : Type*} [CommRing A] [CommRing B] [Algebra A B] diff --git a/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean b/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean index da3352b59240b1..7e76d734a7c213 100644 --- a/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean +++ b/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Judith Ludwig, Florent Schaffhauser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Judith Ludwig, Florent Schaffhauser, Yunzhou Xie, Jujian Zhang -/ -import Mathlib.LinearAlgebra.TensorProduct.Quotient -import Mathlib.RingTheory.Flat.Stability +module + +public import Mathlib.LinearAlgebra.TensorProduct.Quotient +public import Mathlib.RingTheory.Flat.Stability /-! # Faithfully flat modules @@ -43,6 +45,8 @@ A module `M` over a commutative ring `R` is *faithfully flat* if it is flat and -/ +@[expose] public section + universe u v open TensorProduct DirectSum diff --git a/Mathlib/RingTheory/Flat/FaithfullyFlat/Descent.lean b/Mathlib/RingTheory/Flat/FaithfullyFlat/Descent.lean index bd106fcc24cd7b..f18708b12975e3 100644 --- a/Mathlib/RingTheory/Flat/FaithfullyFlat/Descent.lean +++ b/Mathlib/RingTheory/Flat/FaithfullyFlat/Descent.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.RingHom.FaithfullyFlat -import Mathlib.RingTheory.RingHom.Injective -import Mathlib.RingTheory.RingHom.Surjective +module + +public import Mathlib.RingTheory.RingHom.FaithfullyFlat +public import Mathlib.RingTheory.RingHom.Injective +public import Mathlib.RingTheory.RingHom.Surjective /-! # Properties satisfying faithfully flat descent for rings @@ -17,6 +19,8 @@ We show the following properties of ring homomorphisms descend under faithfully - bijective -/ +@[expose] public section + open TensorProduct section diff --git a/Mathlib/RingTheory/Flat/Localization.lean b/Mathlib/RingTheory/Flat/Localization.lean index 51e8941e157ad7..5d9459d0383868 100644 --- a/Mathlib/RingTheory/Flat/Localization.lean +++ b/Mathlib/RingTheory/Flat/Localization.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.RingTheory.Flat.Stability -import Mathlib.RingTheory.LocalProperties.Exactness +module + +public import Mathlib.RingTheory.Flat.Stability +public import Mathlib.RingTheory.LocalProperties.Exactness /-! # Flatness and localization @@ -22,6 +24,8 @@ In this file we show that localizations are flat, and flatness is a local proper over `Localization.Away s`, then `M` is flat over `R`. -/ +@[expose] public section + open IsLocalizedModule LocalizedModule LinearMap TensorProduct variable {R : Type*} (S : Type*) [CommSemiring R] [CommSemiring S] [Algebra R S] diff --git a/Mathlib/RingTheory/Flat/Stability.lean b/Mathlib/RingTheory/Flat/Stability.lean index e0d835cfafb32a..9f95ca51ae6388 100644 --- a/Mathlib/RingTheory/Flat/Stability.lean +++ b/Mathlib/RingTheory/Flat/Stability.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Flat.Basic -import Mathlib.RingTheory.IsTensorProduct -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.Algebra.Module.LocalizedModule.Basic +module + +public import Mathlib.RingTheory.Flat.Basic +public import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.Algebra.Module.LocalizedModule.Basic /-! # Flatness is stable under composition and base change @@ -25,6 +27,8 @@ We show that flatness is stable under composition and base change. for the localization of `R` at `S`. -/ +@[expose] public section + universe u v w t open Function (Injective Surjective) diff --git a/Mathlib/RingTheory/Flat/Tensor.lean b/Mathlib/RingTheory/Flat/Tensor.lean index e632f93f20bb79..07e22220549624 100644 --- a/Mathlib/RingTheory/Flat/Tensor.lean +++ b/Mathlib/RingTheory/Flat/Tensor.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Jujian Zhang -/ -import Mathlib.Algebra.Module.CharacterModule -import Mathlib.RingTheory.Flat.Basic +module + +public import Mathlib.Algebra.Module.CharacterModule +public import Mathlib.RingTheory.Flat.Basic /-! # Flat modules @@ -24,6 +26,8 @@ See . tensor product of the inclusion `I → R` and the identity `M → M` is injective. -/ +@[expose] public section + universe u v namespace Module.Flat diff --git a/Mathlib/RingTheory/Flat/TorsionFree.lean b/Mathlib/RingTheory/Flat/TorsionFree.lean index effb50280bf927..9e0822103f9df1 100644 --- a/Mathlib/RingTheory/Flat/TorsionFree.lean +++ b/Mathlib/RingTheory/Flat/TorsionFree.lean @@ -3,12 +3,13 @@ Copyright (c) 2025 Matthew Jasper. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matthew Jasper, Kevin Buzzard -/ +module -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.RingTheory.DedekindDomain.Dvr -import Mathlib.RingTheory.Flat.Localization -import Mathlib.RingTheory.Flat.Tensor -import Mathlib.RingTheory.Ideal.IsPrincipal +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.RingTheory.DedekindDomain.Dvr +public import Mathlib.RingTheory.Flat.Localization +public import Mathlib.RingTheory.Flat.Tensor +public import Mathlib.RingTheory.Ideal.IsPrincipal /-! # Relationships between flatness and torsionfreeness. @@ -26,6 +27,8 @@ domains and valuation rings. the complement of any maximal ideal is a valuation ring then `Torsion R M = ⊥` iff `M` is a flat `R`-module. -/ + +@[expose] public section -- TODO: Add definition and properties of Prüfer domains. -- TODO: Use `IsTorsionFree`. diff --git a/Mathlib/RingTheory/FractionalIdeal/Basic.lean b/Mathlib/RingTheory/FractionalIdeal/Basic.lean index c9b3a4f6c4813b..d32fdcbf6508b1 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Basic.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.RingTheory.Localization.Integer -import Mathlib.RingTheory.Localization.Submodule +module + +public import Mathlib.RingTheory.Localization.Integer +public import Mathlib.RingTheory.Localization.Submodule /-! # Fractional ideals @@ -53,6 +55,8 @@ making the localization a field. fractional ideal, fractional ideals, invertible ideal -/ +@[expose] public section + open IsLocalization Pointwise nonZeroDivisors diff --git a/Mathlib/RingTheory/FractionalIdeal/Extended.lean b/Mathlib/RingTheory/FractionalIdeal/Extended.lean index 0d364d51a13204..663fef631f0990 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Extended.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Extended.lean @@ -1,17 +1,18 @@ /- Copyright (c) 2024 James Sundstrom. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: James Sundstrom +Authors: James Sundstrom, Xavier Roblot -/ -import Mathlib.RingTheory.Algebraic.Integral -import Mathlib.RingTheory.FractionalIdeal.Basic +module + +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas /-! # Extension of fractional ideals This file defines the extension of a fractional ideal along a ring homomorphism. -## Main definition +## Main definitions * `FractionalIdeal.extended`: Let `A` and `B` be commutative rings with respective localizations `IsLocalization M K` and `IsLocalization N L`. Let `f : A →+* B` be a ring homomorphism with @@ -23,14 +24,17 @@ This file defines the extension of a fractional ideal along a ring homomorphism. ## Main results -* `extended_add` says that extension commutes with addition. -* `extended_mul` says that extension commutes with multiplication. +* `FractionalIdeal.extendedHomₐ_injective`: the map `FractionalIdeal.extendedHomₐ` is injective. +* `Ideal.map_algebraMap_injective`: For `A ⊆ B` an extension of Dedekind domains, the map that + sends an ideal `I` of `A` to `I·B` is injective. ## Tags fractional ideal, fractional ideals, extended, extension -/ +@[expose] public section + open IsLocalization FractionalIdeal Submodule namespace FractionalIdeal @@ -180,9 +184,9 @@ section Algebra open scoped nonZeroDivisors -variable {A K : Type*} (L B : Type*) [CommRing A] [CommRing B] [IsDomain B] - [Algebra A B] [NoZeroSMulDivisors A B] [Field K] [Field L] [Algebra A K] [Algebra B L] - [IsFractionRing A K] [IsFractionRing B L] +variable {A K : Type*} (L B : Type*) [CommRing A] [CommRing B] [IsDomain B] [Algebra A B] + [NoZeroSMulDivisors A B] [Field K] [Field L] [Algebra A K] [Algebra B L] [IsFractionRing A K] + [IsFractionRing B L] {I : FractionalIdeal A⁰ K} /-- The ring homomorphisme that extends a fractional ideal of `A` to a fractional ideal of `B` for @@ -209,6 +213,47 @@ theorem coe_extendedHomₐ_eq_span (I : FractionalIdeal A⁰ K) : IsLocalization.algebraMap_eq_map_map_submonoid A⁰ B K L] rfl +theorem le_one_of_extendedHomₐ_le_one [IsIntegrallyClosed A] [IsIntegrallyClosed B] + (hI : extendedHomₐ L B I ≤ 1) : I ≤ 1 := by + contrapose! hI + rw [SetLike.not_le_iff_exists] at hI ⊢ + obtain ⟨x, hx₁, hx₂⟩ := hI + refine ⟨algebraMap K L x, ?_, ?_⟩ + · simpa [← FractionalIdeal.mem_coe, IsLocalization.algebraMap_eq_map_map_submonoid A⁰ B K L] + using subset_span <| Set.mem_image_of_mem _ hx₁ + · contrapose! hx₂ + rw [mem_one_iff, ← IsIntegrallyClosed.isIntegral_iff] at hx₂ ⊢ + exact IsIntegral.tower_bot_of_field <| isIntegral_trans _ hx₂ + +theorem extendedHomₐ_le_one_iff [IsIntegrallyClosed A] [IsIntegrallyClosed B] : + extendedHomₐ L B I ≤ 1 ↔ I ≤ 1 := + ⟨fun h ↦ le_one_of_extendedHomₐ_le_one L B h, fun a ↦ extended_le_one_of_le_one L _ I a⟩ + +section IsDedekindDomain + +variable [IsDedekindDomain A] [IsDedekindDomain B] + +theorem one_le_extendedHomₐ_iff (hI : I ≠ 0) : 1 ≤ extendedHomₐ L B I ↔ 1 ≤ I := by + rw [← inv_le_inv_iff ((extendedHomₐ_eq_zero_iff _ _).not.mpr hI) (by simp), inv_one, ← map_inv₀, + extendedHomₐ_le_one_iff, inv_le_comm hI (by simp), inv_one] + +theorem extendedHomₐ_eq_one_iff (hI : I ≠ 0) : extendedHomₐ L B I = 1 ↔ I = 1 := by + rw [le_antisymm_iff, extendedHomₐ_le_one_iff, one_le_extendedHomₐ_iff _ _ hI, ← le_antisymm_iff] + +variable (A K) in +theorem extendedHomₐ_injective : + Function.Injective (fun I : FractionalIdeal A⁰ K ↦ extendedHomₐ L B I) := by + intro I J h + dsimp only at h + by_cases hI : I = 0 + · rwa [hI, map_zero, eq_comm, extendedHomₐ_eq_zero_iff L B, eq_comm, ← hI] at h + by_cases hJ : J = 0 + · rwa [hJ, map_zero, extendedHomₐ_eq_zero_iff L B, ← hJ] at h + rwa [← mul_inv_eq_one₀ ((extendedHomₐ_eq_zero_iff _ _).not.mpr hJ), ← map_inv₀, ← map_mul, + extendedHomₐ_eq_one_iff _ _ (mul_ne_zero hI (inv_ne_zero hJ)), mul_inv_eq_one₀ hJ] at h + +end IsDedekindDomain + end Algebra end FractionalIdeal diff --git a/Mathlib/RingTheory/FractionalIdeal/Inverse.lean b/Mathlib/RingTheory/FractionalIdeal/Inverse.lean index 2c1de5135ce816..7666bbaeea6a09 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Inverse.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Inverse.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kenji Nakagawa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenji Nakagawa, Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.RingTheory.FractionalIdeal.Operations +module + +public import Mathlib.RingTheory.FractionalIdeal.Operations /-! # Inverse operator for fractional ideals @@ -28,6 +30,8 @@ The theorem that all nonzero fractional ideals are invertible in a Dedekind doma fractional ideal, invertible ideal -/ +@[expose] public section + assert_not_exists IsDedekindDomain variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] diff --git a/Mathlib/RingTheory/FractionalIdeal/Norm.lean b/Mathlib/RingTheory/FractionalIdeal/Norm.lean index 459b6b1af1092b..9b5d647d11812f 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Norm.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Norm.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.RingTheory.FractionalIdeal.Basic -import Mathlib.RingTheory.Ideal.Norm.AbsNorm -import Mathlib.RingTheory.Localization.NormTrace +module + +public import Mathlib.RingTheory.FractionalIdeal.Basic +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm +public import Mathlib.RingTheory.Localization.NormTrace /-! @@ -27,6 +29,8 @@ ideal of `R` and `I.den` an element of `R⁰` such that `I.den • I = I.num`. norm of its generator -/ +@[expose] public section + open Module open scoped Pointwise nonZeroDivisors diff --git a/Mathlib/RingTheory/FractionalIdeal/Operations.lean b/Mathlib/RingTheory/FractionalIdeal/Operations.lean index 945b9ca2bd07bd..f3c5bf24eeac07 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Operations.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Operations.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.RingTheory.FractionalIdeal.Basic -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic -import Mathlib.RingTheory.LocalRing.Basic -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.Tactic.Field +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.RingTheory.FractionalIdeal.Basic +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +public import Mathlib.RingTheory.LocalRing.Basic +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.Tactic.Field /-! # More operations on fractional ideals @@ -34,6 +36,8 @@ Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fracti fractional ideal, fractional ideals, invertible ideal -/ +@[expose] public section + open IsLocalization Pointwise nonZeroDivisors diff --git a/Mathlib/RingTheory/FreeCommRing.lean b/Mathlib/RingTheory/FreeCommRing.lean index 04fa70a352f26b..f5d8010dfbfd88 100644 --- a/Mathlib/RingTheory/FreeCommRing.lean +++ b/Mathlib/RingTheory/FreeCommRing.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Johan Commelin -/ -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Logic.Equiv.Functor -import Mathlib.RingTheory.FreeRing +module + +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Logic.Equiv.Functor +public import Mathlib.RingTheory.FreeRing /-! # Free commutative rings @@ -45,6 +47,8 @@ of monomials in this free commutative ring. free commutative ring, free ring -/ +@[expose] public section + assert_not_exists Cardinal noncomputable section diff --git a/Mathlib/RingTheory/FreeRing.lean b/Mathlib/RingTheory/FreeRing.lean index 602cbab488db0f..4be157f05c5d3a 100644 --- a/Mathlib/RingTheory/FreeRing.lean +++ b/Mathlib/RingTheory/FreeRing.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Johan Commelin -/ -import Mathlib.Algebra.FreeMonoid.Basic -import Mathlib.GroupTheory.FreeAbelianGroup +module + +public import Mathlib.Algebra.FreeMonoid.Basic +public import Mathlib.GroupTheory.FreeAbelianGroup /-! # Free rings @@ -27,6 +29,8 @@ free ring -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Frobenius.lean b/Mathlib/RingTheory/Frobenius.lean index 337ecbc201926c..5c7c884db01a41 100644 --- a/Mathlib/RingTheory/Frobenius.lean +++ b/Mathlib/RingTheory/Frobenius.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.RingTheory.Invariant.Basic -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots -import Mathlib.RingTheory.Unramified.Locus +module + +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.RingTheory.Invariant.Basic +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +public import Mathlib.RingTheory.Unramified.Locus /-! # Frobenius elements @@ -43,6 +45,8 @@ Let `G` be a finite group acting on a ring `S`, and `R` is the fixed subring of - `IsArithFrobAt.exists_of_isInvariant`: Frobenius element exists. -/ +@[expose] public section + variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] /-- `φ : S →ₐ[R] S` is an (arithmetic) Frobenius at `Q` if diff --git a/Mathlib/RingTheory/Generators.lean b/Mathlib/RingTheory/Generators.lean index f15da9c90abff3..74df71968641a5 100644 --- a/Mathlib/RingTheory/Generators.lean +++ b/Mathlib/RingTheory/Generators.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Extension.Generators +module + +public import Mathlib.RingTheory.Extension.Generators deprecated_module (since := "2025-05-11") diff --git a/Mathlib/RingTheory/GradedAlgebra/Basic.lean b/Mathlib/RingTheory/GradedAlgebra/Basic.lean index 2df3e67dc2ebbc..ce323849c82f87 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Basic.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Kevin Buzzard, Jujian Zhang, Fangming Li -/ -import Mathlib.Algebra.DirectSum.Algebra -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.Algebra.DirectSum.Internal -import Mathlib.Algebra.DirectSum.Ring +module + +public import Mathlib.Algebra.DirectSum.Algebra +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.Algebra.DirectSum.Internal +public import Mathlib.Algebra.DirectSum.Ring /-! # Internally-graded rings and algebras @@ -39,6 +41,8 @@ represented with `𝒜 : ι → Submodule ℕ A` and `𝒜 : ι → Submodule graded algebra, graded ring, graded semiring, decomposition -/ +@[expose] public section + open DirectSum diff --git a/Mathlib/RingTheory/GradedAlgebra/FiniteType.lean b/Mathlib/RingTheory/GradedAlgebra/FiniteType.lean index 2eaa57e3816576..cac9330c885677 100644 --- a/Mathlib/RingTheory/GradedAlgebra/FiniteType.lean +++ b/Mathlib/RingTheory/GradedAlgebra/FiniteType.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Harald Carlens, Andrew Yang, Jujian Zhang -/ -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! @@ -15,6 +17,8 @@ generated by homogeneous elements of positive degree. -/ +@[expose] public section + variable {S σ ι : Type*} [DecidableEq ι] [AddCommMonoid ι] variable [CommRing S] [SetLike σ S] [AddSubgroupClass σ S] variable (𝒜 : ι → σ) [GradedRing 𝒜] diff --git a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean index c7d6d603ffd3dc..a5a97714b7dc02 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean @@ -3,12 +3,14 @@ Copyright (c) 2021 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Eric Wieser -/ -import Mathlib.LinearAlgebra.Finsupp.SumProd -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Submodule +module + +public import Mathlib.LinearAlgebra.Finsupp.SumProd +public import Mathlib.RingTheory.GradedAlgebra.Basic +public import Mathlib.RingTheory.Ideal.Basic +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Submodule /-! # Homogeneous ideals of a graded algebra @@ -41,6 +43,8 @@ to `Ideal.IsHomogeneous.iff_exists` as quickly as possible. graded algebra, homogeneous -/ +@[expose] public section + open SetLike DirectSum Set @@ -551,6 +555,8 @@ end GaloisConnection section IrrelevantIdeal +namespace HomogeneousIdeal + variable [Semiring A] variable [DecidableEq ι] variable [AddCommMonoid ι] [PartialOrder ι] [CanonicallyOrderedAdd ι] @@ -563,21 +569,63 @@ refers to `⨁_{i>0} 𝒜ᵢ`, or equivalently `{a | a₀ = 0}`. This definition construction where `ι` is always `ℕ` so the irrelevant ideal is simply elements with `0` as 0-th coordinate. -/ -def HomogeneousIdeal.irrelevant : HomogeneousIdeal 𝒜 := +def irrelevant : HomogeneousIdeal 𝒜 := ⟨RingHom.ker (GradedRing.projZeroRingHom 𝒜), fun i r (hr : (decompose 𝒜 r 0 : A) = 0) => by change (decompose 𝒜 (decompose 𝒜 r _ : A) 0 : A) = 0 by_cases h : i = 0 · rw [h, hr, decompose_zero, zero_apply, ZeroMemClass.coe_zero] · rw [decompose_of_mem_ne 𝒜 (SetLike.coe_mem _) h]⟩ +local notation 𝒜"₊" => irrelevant 𝒜 + @[simp] -theorem HomogeneousIdeal.mem_irrelevant_iff (a : A) : - a ∈ HomogeneousIdeal.irrelevant 𝒜 ↔ proj 𝒜 0 a = 0 := +theorem mem_irrelevant_iff (a : A) : + a ∈ 𝒜₊ ↔ proj 𝒜 0 a = 0 := Iff.rfl @[simp] -theorem HomogeneousIdeal.toIdeal_irrelevant : - (HomogeneousIdeal.irrelevant 𝒜).toIdeal = RingHom.ker (GradedRing.projZeroRingHom 𝒜) := +theorem toIdeal_irrelevant : + 𝒜₊.toIdeal = RingHom.ker (GradedRing.projZeroRingHom 𝒜) := rfl +lemma mem_irrelevant_of_mem {x : A} {i : ι} (hi : 0 < i) (hx : x ∈ 𝒜 i) : x ∈ 𝒜₊ := by + rw [mem_irrelevant_iff, GradedRing.proj_apply, DirectSum.decompose_of_mem _ hx, + DirectSum.of_eq_of_ne _ _ _ (by aesop), ZeroMemClass.coe_zero] + +/-- `irrelevant 𝒜 = ⨁_{i>0} 𝒜ᵢ` -/ +lemma irrelevant_eq_iSup : 𝒜₊.toAddSubmonoid = ⨆ i > 0, .ofClass (𝒜 i) := by + refine le_antisymm (fun x hx ↦ ?_) <| iSup₂_le fun i hi x hx ↦ mem_irrelevant_of_mem _ hi hx + classical rw [← DirectSum.sum_support_decompose 𝒜 x] + refine sum_mem fun j hj ↦ ?_ + by_cases hj₀ : j = 0 + · classical exact (DFinsupp.mem_support_iff.mp hj <| hj₀ ▸ (by simpa using hx)).elim + · exact AddSubmonoid.mem_iSup_of_mem j <| AddSubmonoid.mem_iSup_of_mem (pos_of_ne_zero hj₀) <| + Subtype.prop _ + +open AddSubmonoid Set in +lemma irrelevant_eq_closure : 𝒜₊.toAddSubmonoid = .closure (⋃ i > 0, 𝒜 i) := by + rw [irrelevant_eq_iSup] + exact le_antisymm (iSup_le fun i ↦ iSup_le fun hi _ hx ↦ subset_closure <| mem_biUnion hi hx) <| + closure_le.mpr <| iUnion_subset fun i ↦ iUnion_subset fun hi ↦ le_biSup (ofClass <| 𝒜 ·) hi + +open AddSubmonoid Set in +lemma irrelevant_eq_span : 𝒜₊.toIdeal = .span (⋃ i > 0, 𝒜 i) := + le_antisymm ((irrelevant_eq_closure 𝒜).trans_le <| closure_le.mpr Ideal.subset_span) <| + Ideal.span_le.mpr <| iUnion_subset fun _ ↦ iUnion_subset fun hi _ hx ↦ + mem_irrelevant_of_mem _ hi hx + +lemma toAddSubmonoid_irrelevant_le {P : AddSubmonoid A} : + 𝒜₊.toAddSubmonoid ≤ P ↔ ∀ i > 0, .ofClass (𝒜 i) ≤ P := by + rw [irrelevant_eq_iSup, iSup₂_le_iff] + +lemma toIdeal_irrelevant_le {I : Ideal A} : + 𝒜₊.toIdeal ≤ I ↔ ∀ i > 0, .ofClass (𝒜 i) ≤ I.toAddSubmonoid := + toAddSubmonoid_irrelevant_le _ + +lemma irrelevant_le {P : HomogeneousIdeal 𝒜} : + 𝒜₊ ≤ P ↔ ∀ i > 0, .ofClass (𝒜 i) ≤ P.toAddSubmonoid := + toIdeal_irrelevant_le _ + +end HomogeneousIdeal + end IrrelevantIdeal diff --git a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Submodule.lean b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Submodule.lean index c05c0bf76871d7..7c674ae2f1ccb7 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Submodule.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Submodule.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Eric Wieser -/ -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.Algebra.GradedMulAction +module + +public import Mathlib.RingTheory.GradedAlgebra.Basic +public import Mathlib.Algebra.GradedMulAction /-! # Homogeneous submodules of a graded module @@ -33,6 +35,8 @@ synthesization order. graded algebra, homogeneous -/ +@[expose] public section + open SetLike DirectSum Pointwise Set variable {ιA ιM σA σM A M : Type*} diff --git a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean index 10e8aba328c21a..ddb81a926586b2 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Fangming Li -/ -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.RingTheory.GradedAlgebra.Basic /-! # Homogeneous subsemirings of a graded semiring @@ -16,6 +18,8 @@ This file defines homogeneous subsemirings of a graded semiring, as well as oper * `HomogeneousSubsemiring 𝒜`: The type of subsemirings which satisfy `SetLike.IsHomogeneous`. -/ +@[expose] public section + open DirectSum Set SetLike variable {ι σ A : Type*} [AddMonoid ι] [Semiring A] diff --git a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean index def7c8510fc48e..07c6b29153f2fb 100644 --- a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean +++ b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Eric Wieser -/ -import Mathlib.Algebra.Group.Submonoid.Finsupp -import Mathlib.Order.Filter.AtTopBot.Defs -import Mathlib.RingTheory.Adjoin.Basic -import Mathlib.RingTheory.GradedAlgebra.FiniteType -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.Away.Basic +module + +public import Mathlib.Algebra.Group.Submonoid.Finsupp +public import Mathlib.Order.Filter.AtTopBot.Defs +public import Mathlib.RingTheory.Adjoin.Basic +public import Mathlib.RingTheory.GradedAlgebra.FiniteType +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.Away.Basic /-! # Homogeneous Localization @@ -69,6 +71,8 @@ circumvent this, we quotient `NumDenSameDeg 𝒜 x` by the kernel of `c ↦ c.nu -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/GradedAlgebra/Noetherian.lean b/Mathlib/RingTheory/GradedAlgebra/Noetherian.lean index 84c30d7a18a4d6..be3f9ccc68974d 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Noetherian.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Noetherian.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Fangming Li. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fangming Li -/ -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.RingTheory.Noetherian.Basic +module + +public import Mathlib.RingTheory.GradedAlgebra.Basic +public import Mathlib.RingTheory.Noetherian.Basic /-! # The properties of a graded Noetherian ring. @@ -13,6 +15,8 @@ This file proves that the 0-th grade of a Noetherian ring is also a Noetherian ring. -/ +@[expose] public section + variable {ι A σ : Type*} variable [Ring A] [IsNoetherianRing A] variable [DecidableEq ι] [AddCommMonoid ι] [PartialOrder ι] [CanonicallyOrderedAdd ι] diff --git a/Mathlib/RingTheory/GradedAlgebra/Radical.lean b/Mathlib/RingTheory/GradedAlgebra/Radical.lean index b788baa317434f..232c6d525d37cc 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Radical.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Radical.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Eric Wieser -/ -import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal +module + +public import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal /-! @@ -33,6 +35,8 @@ fails for a non-cancellative set see `Counterexamples/HomogeneousPrimeNotPrime.l homogeneous, radical -/ +@[expose] public section + open GradedRing DirectSum SetLike Finset diff --git a/Mathlib/RingTheory/Grassmannian.lean b/Mathlib/RingTheory/Grassmannian.lean index 3dcf30833cec40..e3893a21e02345 100644 --- a/Mathlib/RingTheory/Grassmannian.lean +++ b/Mathlib/RingTheory/Grassmannian.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ +module -import Mathlib.RingTheory.Spectrum.Prime.FreeLocus +public import Mathlib.RingTheory.Spectrum.Prime.FreeLocus /-! # Grassmannians @@ -48,6 +49,8 @@ to `G(n - k, V; F)` and also to `G(k, V →ₗ[F] F; F)`, where `n` is the dimen - Representability of `Module.Grassmannian.functor R M k`. -/ +@[expose] public section + universe u v w namespace Module diff --git a/Mathlib/RingTheory/HahnSeries/Addition.lean b/Mathlib/RingTheory/HahnSeries/Addition.lean index 569c689708539b..945ed470c298b1 100644 --- a/Mathlib/RingTheory/HahnSeries/Addition.lean +++ b/Mathlib/RingTheory/HahnSeries/Addition.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Algebra.Group.Pi.Lemmas -import Mathlib.Algebra.Group.Support -import Mathlib.Algebra.Module.Basic -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.Data.Finsupp.SMul -import Mathlib.RingTheory.HahnSeries.Basic -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Group.Pi.Lemmas +public import Mathlib.Algebra.Group.Support +public import Mathlib.Algebra.Module.Basic +public import Mathlib.Algebra.Module.LinearMap.Defs +public import Mathlib.Data.Finsupp.SMul +public import Mathlib.RingTheory.HahnSeries.Basic +public import Mathlib.Tactic.FastInstance /-! # Additive properties of Hahn series @@ -26,6 +28,8 @@ coefficients in `R`, whose supports are partially well-ordered. With further str - [J. van der Hoeven, *Operators on Generalized Power Series*][van_der_hoeven] -/ +@[expose] public section + open Finset Function diff --git a/Mathlib/RingTheory/HahnSeries/Basic.lean b/Mathlib/RingTheory/HahnSeries/Basic.lean index be59722cf0fe5f..99c93c31e863c8 100644 --- a/Mathlib/RingTheory/HahnSeries/Basic.lean +++ b/Mathlib/RingTheory/HahnSeries/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.Notation.Support -import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop -import Mathlib.Data.Finsupp.Defs -import Mathlib.Order.WellFoundedSet +module + +public import Mathlib.Algebra.Notation.Support +public import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop +public import Mathlib.Data.Finsupp.Defs +public import Mathlib.Order.WellFoundedSet /-! # Hahn Series @@ -34,6 +36,8 @@ in the file `Mathlib/RingTheory/LaurentSeries.lean`. - [J. van der Hoeven, *Operators on Generalized Power Series*][van_der_hoeven] -/ +@[expose] public section + open Finset Function diff --git a/Mathlib/RingTheory/HahnSeries/HEval.lean b/Mathlib/RingTheory/HahnSeries/HEval.lean index 5bc806e28c9bf4..53def30f6b9b08 100644 --- a/Mathlib/RingTheory/HahnSeries/HEval.lean +++ b/Mathlib/RingTheory/HahnSeries/HEval.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.RingTheory.HahnSeries.Summable -import Mathlib.RingTheory.PowerSeries.Basic +module + +public import Mathlib.RingTheory.HahnSeries.Summable +public import Mathlib.RingTheory.PowerSeries.Basic /-! # Evaluation of power series in Hahn Series @@ -25,6 +27,8 @@ given by substitution of the generating variable to an element of strictly posit -/ +@[expose] public section + open Finset Function noncomputable section diff --git a/Mathlib/RingTheory/HahnSeries/HahnEmbedding.lean b/Mathlib/RingTheory/HahnSeries/HahnEmbedding.lean index 4e539a55c62894..d50052da3226a9 100644 --- a/Mathlib/RingTheory/HahnSeries/HahnEmbedding.lean +++ b/Mathlib/RingTheory/HahnSeries/HahnEmbedding.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.Order.Module.HahnEmbedding -import Mathlib.Algebra.Module.LinearMap.Rat -import Mathlib.Algebra.Field.Rat -import Mathlib.Analysis.RCLike.Basic -import Mathlib.Data.Real.Embedding -import Mathlib.GroupTheory.DivisibleHull +module + +public import Mathlib.Algebra.Order.Module.HahnEmbedding +public import Mathlib.Algebra.Module.LinearMap.Rat +public import Mathlib.Algebra.Field.Rat +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.Data.Real.Embedding +public import Mathlib.GroupTheory.DivisibleHull /-! @@ -24,6 +26,8 @@ Archimedean classes of the group. The theorem is stated as `hahnEmbedding_isOrde -/ +@[expose] public section + open ArchimedeanClass variable (M : Type*) [AddCommGroup M] [LinearOrder M] [IsOrderedAddMonoid M] diff --git a/Mathlib/RingTheory/HahnSeries/Lex.lean b/Mathlib/RingTheory/HahnSeries/Lex.lean index 25487dae7aabe1..9869091a873650 100644 --- a/Mathlib/RingTheory/HahnSeries/Lex.lean +++ b/Mathlib/RingTheory/HahnSeries/Lex.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Weiyi Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Weiyi Wang -/ -import Mathlib.Algebra.Order.Archimedean.Class -import Mathlib.Order.Hom.Lex -import Mathlib.Order.PiLex -import Mathlib.RingTheory.HahnSeries.Addition +module + +public import Mathlib.Algebra.Order.Archimedean.Class +public import Mathlib.Order.Hom.Lex +public import Mathlib.Order.PiLex +public import Mathlib.RingTheory.HahnSeries.Addition /-! @@ -23,6 +25,8 @@ it is an ordered group when `R` is. -/ +@[expose] public section + namespace HahnSeries variable {Γ R : Type*} [LinearOrder Γ] diff --git a/Mathlib/RingTheory/HahnSeries/Multiplication.lean b/Mathlib/RingTheory/HahnSeries/Multiplication.lean index 2a6d6f86c27de7..885be34d672e40 100644 --- a/Mathlib/RingTheory/HahnSeries/Multiplication.lean +++ b/Mathlib/RingTheory/HahnSeries/Multiplication.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, Scott Carnahan -/ -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.GroupWithZero.Regular -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Data.Finset.MulAntidiagonal -import Mathlib.Data.Finset.SMulAntidiagonal -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.RingTheory.HahnSeries.Addition +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.GroupWithZero.Regular +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Data.Finset.MulAntidiagonal +public import Mathlib.Data.Finset.SMulAntidiagonal +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.RingTheory.HahnSeries.Addition /-! # Multiplicative properties of Hahn series @@ -45,6 +47,8 @@ The following may be useful for composing vertex operators, but they seem to tak - [J. van der Hoeven, *Operators on Generalized Power Series*][van_der_hoeven] -/ +@[expose] public section + open Finset Function Pointwise noncomputable section diff --git a/Mathlib/RingTheory/HahnSeries/PowerSeries.lean b/Mathlib/RingTheory/HahnSeries/PowerSeries.lean index 9f179d605b2944..f2a4bb83f6f71f 100644 --- a/Mathlib/RingTheory/HahnSeries/PowerSeries.lean +++ b/Mathlib/RingTheory/HahnSeries/PowerSeries.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.RingTheory.HahnSeries.Multiplication -import Mathlib.RingTheory.PowerSeries.Basic -import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors -import Mathlib.Data.Finsupp.PWO +module + +public import Mathlib.RingTheory.HahnSeries.Multiplication +public import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors +public import Mathlib.Data.Finsupp.PWO /-! # Comparison between Hahn series and power series @@ -32,6 +34,8 @@ we get the more familiar semiring of formal power series with coefficients in `R - [J. van der Hoeven, *Operators on Generalized Power Series*][van_der_hoeven] -/ +@[expose] public section + open Finset Function Pointwise Polynomial diff --git a/Mathlib/RingTheory/HahnSeries/Summable.lean b/Mathlib/RingTheory/HahnSeries/Summable.lean index da4790e71dff91..b39ccb0e3f0dcc 100644 --- a/Mathlib/RingTheory/HahnSeries/Summable.lean +++ b/Mathlib/RingTheory/HahnSeries/Summable.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.Ring.Action.Rat -import Mathlib.RingTheory.HahnSeries.Multiplication -import Mathlib.Data.Rat.Cast.Lemmas +module + +public import Mathlib.Algebra.Ring.Action.Rat +public import Mathlib.RingTheory.HahnSeries.Multiplication +public import Mathlib.Data.Rat.Cast.Lemmas /-! # Summable families of Hahn Series @@ -42,6 +44,8 @@ commutative domain. - [J. van der Hoeven, *Operators on Generalized Power Series*][van_der_hoeven] -/ +@[expose] public section + open Finset Function diff --git a/Mathlib/RingTheory/HahnSeries/Valuation.lean b/Mathlib/RingTheory/HahnSeries/Valuation.lean index 63eff5021771e3..905bcf9b13636c 100644 --- a/Mathlib/RingTheory/HahnSeries/Valuation.lean +++ b/Mathlib/RingTheory/HahnSeries/Valuation.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.RingTheory.HahnSeries.Multiplication -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.RingTheory.HahnSeries.Multiplication +public import Mathlib.RingTheory.Valuation.Basic /-! # Valuations on Hahn Series rings @@ -23,6 +25,8 @@ admits an additive valuation given by `orderTop`. - [J. van der Hoeven, *Operators on Generalized Power Series*][van_der_hoeven] -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/Henselian.lean b/Mathlib/RingTheory/Henselian.lean index 076591a5100934..3e16dbd7d1b2b9 100644 --- a/Mathlib/RingTheory/Henselian.lean +++ b/Mathlib/RingTheory/Henselian.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Polynomial.Taylor -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.AdicCompletion.Basic +module + +public import Mathlib.Algebra.Polynomial.Taylor +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.AdicCompletion.Basic /-! # Henselian rings @@ -52,6 +54,8 @@ https://gist.github.com/jcommelin/47d94e4af092641017a97f7f02bf9598 -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/HopfAlgebra/Basic.lean b/Mathlib/RingTheory/HopfAlgebra/Basic.lean index 63e1c4a3b70b96..6db42519faeb91 100644 --- a/Mathlib/RingTheory/HopfAlgebra/Basic.lean +++ b/Mathlib/RingTheory/HopfAlgebra/Basic.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Ali Ramsey. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ali Ramsey -/ -import Mathlib.RingTheory.Bialgebra.Basic +module + +public import Mathlib.RingTheory.Bialgebra.Basic /-! # Hopf algebras @@ -12,7 +14,7 @@ In this file we define `HopfAlgebra`, and provide instances for: * Commutative semirings: `CommSemiring.toHopfAlgebra` -# Main definitions +## Main definitions * `HopfAlgebra R A` : the Hopf algebra structure on an `R`-bialgebra `A`. * `HopfAlgebra.antipode` : The `R`-linear map `A →ₗ[R] A`. @@ -40,6 +42,8 @@ so we could deduce the facts here from an equivalence `HopfAlgCat R ≌ Hopf (Mo -/ +@[expose] public section + open Bialgebra universe u v w diff --git a/Mathlib/RingTheory/HopfAlgebra/GroupLike.lean b/Mathlib/RingTheory/HopfAlgebra/GroupLike.lean new file mode 100644 index 00000000000000..7463d9f0a04889 --- /dev/null +++ b/Mathlib/RingTheory/HopfAlgebra/GroupLike.lean @@ -0,0 +1,74 @@ +/- +Copyright (c) 2025 Yaël Dillies, Michał Mrugała. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Yaël Dillies, Michał Mrugała +-/ +module + +public import Mathlib.RingTheory.HopfAlgebra.Basic +public import Mathlib.RingTheory.Bialgebra.GroupLike + +/-! +# Group-like elements in a Hopf algebra + +This file proves that group-like elements in a Hopf algebra form a group. +-/ + +@[expose] public section + +open HopfAlgebra + +variable {R A : Type*} + +section Semiring +variable [CommSemiring R] [Semiring A] [HopfAlgebra R A] {a b : A} + +@[simp] lemma IsGroupLikeElem.antipode_mul_cancel (ha : IsGroupLikeElem R a) : + antipode R a * a = 1 := by + simpa [ha, -mul_antipode_lTensor_comul_apply] using mul_antipode_rTensor_comul_apply (R := R) a + +@[simp] lemma IsGroupLikeElem.mul_antipode_cancel (ha : IsGroupLikeElem R a) : + a * antipode R a = 1 := by + simpa [ha, -mul_antipode_lTensor_comul_apply] using mul_antipode_lTensor_comul_apply (R := R) a + +variable (R) in +/-- Turn a group-like element `a` into a unit with inverse its antipode. -/ +@[simps] +def GroupLike.toUnits : GroupLike R A →* Aˣ where + toFun a := { + val := a + inv := antipode R a + val_inv := a.2.mul_antipode_cancel + inv_val := a.2.antipode_mul_cancel + } + map_one' := by ext; rfl + map_mul' a b := by ext; rfl + +lemma IsGroupLikeElem.isUnit (ha : IsGroupLikeElem R a) : IsUnit a := + (GroupLike.toUnits R ⟨a, ha⟩).isUnit + +@[simp] protected lemma IsGroupLikeElem.antipode (ha : IsGroupLikeElem R a) : + IsGroupLikeElem R (antipode R a) := + ha.of_mul_eq_one ha.mul_antipode_cancel ha.antipode_mul_cancel + +@[simp] lemma IsGroupLikeElem.antipode_antipode (ha : IsGroupLikeElem R a) : + antipode R (antipode R a) = a := + left_inv_eq_right_inv ha.antipode.antipode_mul_cancel ha.antipode_mul_cancel + +namespace GroupLike + +instance : Inv (GroupLike R A) where inv a := ⟨antipode R a, a.2.antipode⟩ + +@[simp] lemma val_inv (a : GroupLike R A) : ↑(a⁻¹) = (antipode R a : A) := rfl + +instance : Group (GroupLike R A) where + inv_mul_cancel a := by ext; simp + +end GroupLike +end Semiring + +variable [CommSemiring R] [CommSemiring A] [HopfAlgebra R A] {a b : A} + +instance GroupLike.instCommGroup : CommGroup (GroupLike R A) where + __ := instCommMonoid + __ := instGroup diff --git a/Mathlib/RingTheory/HopfAlgebra/MonoidAlgebra.lean b/Mathlib/RingTheory/HopfAlgebra/MonoidAlgebra.lean index da52ce3eba23cb..747f755e06a8de 100644 --- a/Mathlib/RingTheory/HopfAlgebra/MonoidAlgebra.lean +++ b/Mathlib/RingTheory/HopfAlgebra/MonoidAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston -/ -import Mathlib.RingTheory.Bialgebra.MonoidAlgebra -import Mathlib.RingTheory.HopfAlgebra.Basic +module + +public import Mathlib.RingTheory.Bialgebra.MonoidAlgebra +public import Mathlib.RingTheory.HopfAlgebra.Basic /-! # The Hopf algebra structure on group algebras @@ -22,6 +24,8 @@ results about the `R`-Hopf algebra instance on `A[G]`, building upon results in is a group scheme. -/ +@[expose] public section + noncomputable section open HopfAlgebra diff --git a/Mathlib/RingTheory/HopfAlgebra/TensorProduct.lean b/Mathlib/RingTheory/HopfAlgebra/TensorProduct.lean index 879e4365354778..62706afae60a13 100644 --- a/Mathlib/RingTheory/HopfAlgebra/TensorProduct.lean +++ b/Mathlib/RingTheory/HopfAlgebra/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Amelia Livingston. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Amelia Livingston, Andrew Yang -/ -import Mathlib.RingTheory.HopfAlgebra.Basic -import Mathlib.RingTheory.Bialgebra.TensorProduct +module + +public import Mathlib.RingTheory.HopfAlgebra.Basic +public import Mathlib.RingTheory.Bialgebra.TensorProduct /-! # Tensor products of Hopf algebras @@ -13,6 +15,8 @@ We define the Hopf algebra instance on the tensor product of two Hopf algebras. -/ +@[expose] public section + open Coalgebra TensorProduct HopfAlgebra /-- Upgrade a bialgebra to a Hopf algebra by specifying the antipode as an algebra map with diff --git a/Mathlib/RingTheory/HopkinsLevitzki.lean b/Mathlib/RingTheory/HopkinsLevitzki.lean index cce4470ab8bf10..8910e293ba1fe9 100644 --- a/Mathlib/RingTheory/HopkinsLevitzki.lean +++ b/Mathlib/RingTheory/HopkinsLevitzki.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.RingTheory.FiniteLength -import Mathlib.RingTheory.Noetherian.Nilpotent -import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.RingTheory.KrullDimension.Zero +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.RingTheory.FiniteLength +public import Mathlib.RingTheory.Noetherian.Nilpotent +public import Mathlib.RingTheory.Spectrum.Prime.Noetherian +public import Mathlib.RingTheory.KrullDimension.Zero /-! ## The Hopkins–Levitzki theorem @@ -30,6 +32,8 @@ import Mathlib.RingTheory.KrullDimension.Zero * [F. Lorenz, *Algebra: Volume II: Fields with Structure, Algebras and Advanced Topics*][Lorenz2008] -/ +@[expose] public section + universe u variable (R₀ R : Type*) (M : Type u) [Ring R₀] [Ring R] [Module R₀ R] diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime.lean index 6e427e7ea779eb..9ba0257a95ffb3 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime.lean @@ -3,8 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ +module -import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-04-20") diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean index 8591bbc0f856e5..75055ca9fb16cd 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Exact -import Mathlib.LinearAlgebra.Span.Basic -import Mathlib.RingTheory.Ideal.IsPrimary -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Noetherian.Defs +module + +public import Mathlib.Algebra.Exact +public import Mathlib.LinearAlgebra.Span.Basic +public import Mathlib.RingTheory.Ideal.IsPrimary +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Noetherian.Defs /-! @@ -32,6 +34,8 @@ Generalize this to a non-commutative setting once there are annihilator for non- -/ +@[expose] public section + variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M] diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Finiteness.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Finiteness.lean index c924fb7b410ee0..41e94f37486768 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Finiteness.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Finiteness.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Jinzhao Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jinzhao Pan -/ -import Mathlib.Order.RelSeries -import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Noetherian.Basic -import Mathlib.RingTheory.Spectrum.Prime.Defs -import Mathlib.RingTheory.Spectrum.Maximal.Basic +module + +public import Mathlib.Order.RelSeries +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Noetherian.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Defs +public import Mathlib.RingTheory.Spectrum.Maximal.Basic /-! @@ -38,6 +40,8 @@ associated primes. -/ +@[expose] public section + universe u v variable {A : Type u} [CommRing A] {M : Type v} [AddCommGroup M] [Module A M] diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean index cc90cf3526b222..4bb6b5c52e4334 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ -import Mathlib.Algebra.Module.LocalizedModule.Basic -import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic -import Mathlib.RingTheory.Localization.AtPrime.Basic +module + +public import Mathlib.Algebra.Module.LocalizedModule.Basic +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic +public import Mathlib.RingTheory.Localization.AtPrime.Basic /-! @@ -13,7 +15,7 @@ import Mathlib.RingTheory.Localization.AtPrime.Basic This file mainly proves the relation between `Ass(S⁻¹M)` and `Ass(M)` -# Main Results +## Main Results * `associatedPrimes.mem_associatePrimes_of_comap_mem_associatePrimes_isLocalizedModule` : for an `R` module `M`, if `p` is a prime ideal of `S⁻¹R` and `p ∩ R ∈ Ass(M)` then @@ -26,6 +28,8 @@ TODO: deduce from the above that every minimal element in support is in `Ass(M)` -/ +@[expose] public section + variable {R : Type*} [CommRing R] (S : Submonoid R) (R' : Type*) [CommRing R'] [Algebra R R'] [IsLocalization S R'] diff --git a/Mathlib/RingTheory/Ideal/Basic.lean b/Mathlib/RingTheory/Ideal/Basic.lean index 4d3c9fc6abe069..28ec4cc92c1693 100644 --- a/Mathlib/RingTheory/Ideal/Basic.lean +++ b/Mathlib/RingTheory/Ideal/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Field.IsField -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.LinearAlgebra.Finsupp.LinearCombination -import Mathlib.RingTheory.Ideal.Maximal -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.LinearAlgebra.Finsupp.LinearCombination +public import Mathlib.RingTheory.Ideal.Maximal +public import Mathlib.Tactic.FinCases /-! @@ -27,6 +29,8 @@ Note that over commutative rings, left ideals and two-sided ideals are equivalen Support right ideals, and two-sided ideals over non-commutative rings. -/ +@[expose] public section + variable {ι α β F : Type*} diff --git a/Mathlib/RingTheory/Ideal/Basis.lean b/Mathlib/RingTheory/Ideal/Basis.lean index 343862cc28594b..1b4d72f90a4e7d 100644 --- a/Mathlib/RingTheory/Ideal/Basis.lean +++ b/Mathlib/RingTheory/Ideal/Basis.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.LinearAlgebra.Basis.Defs -import Mathlib.LinearAlgebra.Basis.Submodule -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.LinearAlgebra.Basis.Defs +public import Mathlib.LinearAlgebra.Basis.Submodule +public import Mathlib.RingTheory.Ideal.Span /-! # The basis of ideals @@ -14,6 +16,8 @@ import Mathlib.RingTheory.Ideal.Span Some results involving `Ideal` and `Basis`. -/ +@[expose] public section + open Module namespace Ideal diff --git a/Mathlib/RingTheory/Ideal/BigOperators.lean b/Mathlib/RingTheory/Ideal/BigOperators.lean index 0b543fa41a0f70..d9f2374f2cd364 100644 --- a/Mathlib/RingTheory/Ideal/BigOperators.lean +++ b/Mathlib/RingTheory/Ideal/BigOperators.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Module.Submodule.Basic -import Mathlib.RingTheory.Ideal.Defs +module + +public import Mathlib.Algebra.Module.Submodule.Basic +public import Mathlib.RingTheory.Ideal.Defs /-! @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Ideal.Defs This contains some results on the big operators `∑` and `∏` interacting with the `Ideal` type. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Ideal/Colon.lean b/Mathlib/RingTheory/Ideal/Colon.lean index 725c7ccc6949e3..70f8bee9410a30 100644 --- a/Mathlib/RingTheory/Ideal/Colon.lean +++ b/Mathlib/RingTheory/Ideal/Colon.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Ring.Action.Pointwise.Set -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.Algebra.Ring.Action.Pointwise.Set +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.RingTheory.Ideal.Maps /-! # The colon ideal @@ -15,6 +17,8 @@ The normal notation for this would be `N : P` which has already been taken by ty -/ +@[expose] public section + namespace Submodule open Pointwise diff --git a/Mathlib/RingTheory/Ideal/Cotangent.lean b/Mathlib/RingTheory/Ideal/Cotangent.lean index fe310603722e40..be2e1e357e6136 100644 --- a/Mathlib/RingTheory/Ideal/Cotangent.lean +++ b/Mathlib/RingTheory/Ideal/Cotangent.lean @@ -3,15 +3,17 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.Algebra.Ring.Idempotent -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.RingTheory.Filtration -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.Nakayama +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.Algebra.Ring.Idempotent +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.RingTheory.Filtration +public import Mathlib.RingTheory.Ideal.Operations +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.Nakayama /-! # The module `I ⧸ I ^ 2` @@ -24,6 +26,8 @@ Additional support is also given to the cotangent space `m ⧸ m ^ 2` of a local -/ +@[expose] public section + namespace Ideal diff --git a/Mathlib/RingTheory/Ideal/Defs.lean b/Mathlib/RingTheory/Ideal/Defs.lean index 824becd80daee5..08374aeeb7e412 100644 --- a/Mathlib/RingTheory/Ideal/Defs.lean +++ b/Mathlib/RingTheory/Ideal/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Module.Submodule.Defs -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Module.Submodule.Defs +public import Mathlib.Tactic.Abel /-! @@ -22,6 +24,8 @@ Note that over commutative rings, left ideals and two-sided ideals are equivalen Support right ideals, and two-sided ideals over non-commutative rings. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Ideal/GoingDown.lean b/Mathlib/RingTheory/Ideal/GoingDown.lean index 46c9627b96d203..8843f05b2881f3 100644 --- a/Mathlib/RingTheory/Ideal/GoingDown.lean +++ b/Mathlib/RingTheory/Ideal/GoingDown.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Christian Merten, Yi Song, Sihan Su. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Yi Song, Sihan Su -/ -import Mathlib.RingTheory.Ideal.GoingUp -import Mathlib.RingTheory.Flat.FaithfullyFlat.Algebra -import Mathlib.RingTheory.Flat.Localization -import Mathlib.RingTheory.Spectrum.Prime.Topology +module + +public import Mathlib.RingTheory.Ideal.GoingUp +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Algebra +public import Mathlib.RingTheory.Flat.Localization +public import Mathlib.RingTheory.Spectrum.Prime.Topology /-! # Going down @@ -27,6 +29,8 @@ of `S` lying above `q`, there exists a prime `P ≤ Q` of `S` lying above `p`. -/ +@[expose] public section + /-- An `R`-algebra `S` satisfies `Algebra.HasGoingDown R S` if for every pair of prime ideals `p ≤ q` of `R` with `Q` a prime of `S` lying above `q`, there exists a diff --git a/Mathlib/RingTheory/Ideal/GoingUp.lean b/Mathlib/RingTheory/Ideal/GoingUp.lean index 68917e430b559a..fddf52c9a00cbf 100644 --- a/Mathlib/RingTheory/Ideal/GoingUp.lean +++ b/Mathlib/RingTheory/Ideal/GoingUp.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Yongle Hu -/ -import Mathlib.RingTheory.Ideal.Over -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.Integral +module + +public import Mathlib.RingTheory.Ideal.Over +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.Integral /-! # Ideals over/under ideals in integral extensions @@ -21,6 +23,8 @@ Once mathlib has more material on the localization at a prime ideal, the results can be proven using more general going-up/going-down theory. -/ +@[expose] public section + open Polynomial Submodule open scoped Pointwise diff --git a/Mathlib/RingTheory/Ideal/Height.lean b/Mathlib/RingTheory/Ideal/Height.lean index a1ea7dde58faf0..8b30e3d575535b 100644 --- a/Mathlib/RingTheory/Ideal/Height.lean +++ b/Mathlib/RingTheory/Ideal/Height.lean @@ -3,15 +3,17 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wanyi He, Jiedong Jiang, Jingting Wang, Andrew Yang, Shouxin Zhang -/ -import Mathlib.Algebra.Module.SpanRank -import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.RingTheory.Ideal.MinimalPrime.Localization +module + +public import Mathlib.Algebra.Module.SpanRank +public import Mathlib.RingTheory.Spectrum.Prime.Noetherian +public import Mathlib.RingTheory.Ideal.MinimalPrime.Localization /-! # The Height of an Ideal In this file, we define the height of a prime ideal and the height of an ideal. -# Main definitions +## Main definitions * `Ideal.primeHeight` : The height of a prime ideal $\mathfrak{p}$. We define it as the supremum of the lengths of strictly decreasing chains of prime ideals below it. This definition is implemented @@ -22,6 +24,8 @@ In this file, we define the height of a prime ideal and the height of an ideal. -/ +@[expose] public section + variable {R : Type*} [CommRing R] (I : Ideal R) open Ideal diff --git a/Mathlib/RingTheory/Ideal/IdempotentFG.lean b/Mathlib/RingTheory/Ideal/IdempotentFG.lean index 707f70ab3dad0a..cbf49df6b846d1 100644 --- a/Mathlib/RingTheory/Ideal/IdempotentFG.lean +++ b/Mathlib/RingTheory/Ideal/IdempotentFG.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ -import Mathlib.Algebra.Ring.Idempotent -import Mathlib.Order.Basic -import Mathlib.RingTheory.Finiteness.Nakayama +module + +public import Mathlib.Algebra.Ring.Idempotent +public import Mathlib.Order.Basic +public import Mathlib.RingTheory.Finiteness.Nakayama /-! ## Lemmas on idempotent finitely generated ideals -/ +@[expose] public section + namespace Ideal diff --git a/Mathlib/RingTheory/Ideal/Int.lean b/Mathlib/RingTheory/Ideal/Int.lean index 68c6dd09e499dc..57148ef871f3b4 100644 --- a/Mathlib/RingTheory/Ideal/Int.lean +++ b/Mathlib/RingTheory/Ideal/Int.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.Algebra.Field.ZMod -import Mathlib.RingTheory.Ideal.Norm.AbsNorm +module + +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm /-! # Ideal of `ℤ` @@ -29,6 +31,8 @@ In particular, for `I` an ideal of a ring `R` extending `ℤ`, we prove several -/ +@[expose] public section + instance Int.ideal_span_isMaximal_of_prime (p : ℕ) [Fact (Nat.Prime p)] : (Ideal.span {(p : ℤ)}).IsMaximal := Ideal.Quotient.maximal_of_isField _ <| diff --git a/Mathlib/RingTheory/Ideal/IsPrimary.lean b/Mathlib/RingTheory/Ideal/IsPrimary.lean index b5a1fdc06cc624..8a923861827f04 100644 --- a/Mathlib/RingTheory/Ideal/IsPrimary.lean +++ b/Mathlib/RingTheory/Ideal/IsPrimary.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yakov Pechersky -/ -import Mathlib.RingTheory.IsPrimary -import Mathlib.RingTheory.Ideal.Operations +module + +public import Mathlib.RingTheory.IsPrimary +public import Mathlib.RingTheory.Ideal.Operations /-! # Primary ideals @@ -21,6 +23,8 @@ Uses a specialized phrasing of `Submodule.IsPrimary` to have better API-piercing -/ +@[expose] public section + namespace Ideal variable {R : Type*} [CommSemiring R] diff --git a/Mathlib/RingTheory/Ideal/IsPrincipal.lean b/Mathlib/RingTheory/Ideal/IsPrincipal.lean index 7b92ce59f99184..6efd443055280b 100644 --- a/Mathlib/RingTheory/Ideal/IsPrincipal.lean +++ b/Mathlib/RingTheory/Ideal/IsPrincipal.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Principal Ideals @@ -24,6 +26,8 @@ This file deals with the set of principal ideals of a `CommRing R`. `Associates R⁰` and the submonoid of non-zero-divisors principal ideals of `R`. -/ +@[expose] public section + variable {R : Type*} [CommRing R] namespace Ideal diff --git a/Mathlib/RingTheory/Ideal/IsPrincipalPowQuotient.lean b/Mathlib/RingTheory/Ideal/IsPrincipalPowQuotient.lean index 1273a5b855b2aa..6240683dbc6b06 100644 --- a/Mathlib/RingTheory/Ideal/IsPrincipalPowQuotient.lean +++ b/Mathlib/RingTheory/Ideal/IsPrincipalPowQuotient.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.RingTheory.Ideal.Quotient.Defs +module + +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.RingTheory.Ideal.Operations +public import Mathlib.RingTheory.Ideal.Quotient.Defs /-! # Quotients of powers of principal ideals @@ -26,6 +28,8 @@ formed as ring equivs. -/ +@[expose] public section + namespace Ideal diff --git a/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean b/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean index d7d4063e36edf9..cd9f0fead4e767 100644 --- a/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean +++ b/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Wanyi He, Jiedong Jiang, Christian Merten, Jingting Wang, Andrew Yang, Shouxin Zhang -/ -import Mathlib.RingTheory.HopkinsLevitzki -import Mathlib.RingTheory.Ideal.Height -import Mathlib.RingTheory.Localization.Submodule -import Mathlib.RingTheory.Nakayama +module + +public import Mathlib.RingTheory.HopkinsLevitzki +public import Mathlib.RingTheory.Ideal.Height +public import Mathlib.RingTheory.Localization.Submodule +public import Mathlib.RingTheory.Nakayama /-! # Krull's Height Theorem @@ -37,6 +39,8 @@ In this file, we prove **Krull's principal ideal theorem** (also known as by no more than `n` elements. -/ +@[expose] public section + variable {R : Type*} [CommRing R] [IsNoetherianRing R] lemma IsLocalRing.quotient_artinian_of_mem_minimalPrimes_of_isLocalRing diff --git a/Mathlib/RingTheory/Ideal/Lattice.lean b/Mathlib/RingTheory/Ideal/Lattice.lean index 79af6931ebc7ca..6473136cf6808f 100644 --- a/Mathlib/RingTheory/Ideal/Lattice.lean +++ b/Mathlib/RingTheory/Ideal/Lattice.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.RingTheory.Ideal.Defs -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.RingTheory.Ideal.Defs +public import Mathlib.Tactic.Ring /-! # The lattice of ideals in a ring @@ -17,6 +19,8 @@ Some basic results on lattice operations on ideals: `⊥`, `⊤`, `⊔`, `⊓`. Support right ideals, and two-sided ideals over non-commutative rings. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Ideal/Maps.lean b/Mathlib/RingTheory/Ideal/Maps.lean index 8aa6f966457fda..78970c80eed3de 100644 --- a/Mathlib/RingTheory/Ideal/Maps.lean +++ b/Mathlib/RingTheory/Ideal/Maps.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Data.DFinsupp.Module -import Mathlib.RingTheory.Ideal.Operations +module + +public import Mathlib.Data.DFinsupp.Module +public import Mathlib.RingTheory.Ideal.Operations /-! # Maps on modules and ideals @@ -13,6 +15,8 @@ Main definitions include `Ideal.map`, `Ideal.comap`, `RingHom.ker`, `Module.anni and `Submodule.annihilator`. -/ +@[expose] public section + assert_not_exists Module.Basis -- See `RingTheory.Ideal.Basis` Submodule.hasQuotient -- See `RingTheory.Ideal.Quotient.Operations` diff --git a/Mathlib/RingTheory/Ideal/Maximal.lean b/Mathlib/RingTheory/Ideal/Maximal.lean index 3139aae5cd1d87..4bfde73bb934a8 100644 --- a/Mathlib/RingTheory/Ideal/Maximal.lean +++ b/Mathlib/RingTheory/Ideal/Maximal.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.Ideal.Prime -import Mathlib.RingTheory.Ideal.Span +module + +public import Mathlib.RingTheory.Ideal.Prime +public import Mathlib.RingTheory.Ideal.Span /-! @@ -23,6 +25,8 @@ Note that over commutative rings, left ideals and two-sided ideals are equivalen Support right ideals, and two-sided ideals over non-commutative rings. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean b/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean index c6b227a0effd69..2113e8aad68909 100644 --- a/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean +++ b/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.IsPrimary -import Mathlib.Order.Minimal +module + +public import Mathlib.RingTheory.Ideal.IsPrimary +public import Mathlib.Order.Minimal /-! @@ -25,6 +27,8 @@ Further results that need the theory of localizations can be found in -/ +@[expose] public section + assert_not_exists Localization -- See `RingTheory/Ideal/Minimal/Localization.lean` section diff --git a/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean b/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean index bc5c0c85172fc9..6de8a4f4342318 100644 --- a/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean +++ b/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.MinimalPrime.Basic -import Mathlib.RingTheory.Localization.AtPrime.Basic +module + +public import Mathlib.RingTheory.Ideal.MinimalPrime.Basic +public import Mathlib.RingTheory.Localization.AtPrime.Basic /-! @@ -29,6 +31,8 @@ of localizations. the resulting ring only has a single prime ideal. -/ +@[expose] public section + section diff --git a/Mathlib/RingTheory/Ideal/NatInt.lean b/Mathlib/RingTheory/Ideal/NatInt.lean index 759f5d68a6aa5d..d54627178a05c7 100644 --- a/Mathlib/RingTheory/Ideal/NatInt.lean +++ b/Mathlib/RingTheory/Ideal/NatInt.lean @@ -3,13 +3,15 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.Data.Nat.Prime.Int -import Mathlib.RingTheory.Int.Basic -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.KrullDimension.Basic -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.KrullDimension.Basic +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Prime ideals in ℕ and ℤ @@ -22,6 +24,8 @@ import Mathlib.RingTheory.PrincipalIdealDomain * `Ideal.isPrime_int_iff` : the prime ideals in ℤ are ⟨0⟩ and ⟨p⟩ (for prime `p`). -/ +@[expose] public section + /-- The natural numbers form a local semiring. -/ instance : IsLocalRing ℕ where isUnit_or_isUnit_of_add_one {a b} hab := by diff --git a/Mathlib/RingTheory/Ideal/Nonunits.lean b/Mathlib/RingTheory/Ideal/Nonunits.lean index 0387a81319fd06..7002d2ee321e94 100644 --- a/Mathlib/RingTheory/Ideal/Nonunits.lean +++ b/Mathlib/RingTheory/Ideal/Nonunits.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.Ideal.Maximal +module + +public import Mathlib.RingTheory.Ideal.Maximal /-! # The set of non-invertible elements of a monoid @@ -17,6 +19,8 @@ import Mathlib.RingTheory.Ideal.Maximal * `exists_max_ideal_of_mem_nonunits`: every element of `nonunits` is contained in a maximal ideal -/ +@[expose] public section + variable {F α β : Type*} {a b : α} diff --git a/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean b/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean index 34c3769a53fba1..5037780bc41cc9 100644 --- a/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean +++ b/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean @@ -3,15 +3,17 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best -/ -import Mathlib.Algebra.CharP.Quotient -import Mathlib.LinearAlgebra.FreeModule.Determinant -import Mathlib.LinearAlgebra.FreeModule.Finite.CardQuotient -import Mathlib.LinearAlgebra.FreeModule.IdealQuotient -import Mathlib.RingTheory.DedekindDomain.Dvr -import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas -import Mathlib.RingTheory.Ideal.Basis -import Mathlib.RingTheory.Norm.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative +module + +public import Mathlib.Algebra.CharP.Quotient +public import Mathlib.LinearAlgebra.FreeModule.Determinant +public import Mathlib.LinearAlgebra.FreeModule.Finite.CardQuotient +public import Mathlib.LinearAlgebra.FreeModule.IdealQuotient +public import Mathlib.RingTheory.DedekindDomain.Dvr +public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas +public import Mathlib.RingTheory.Ideal.Basis +public import Mathlib.RingTheory.Norm.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative /-! @@ -37,6 +39,8 @@ the quotient `R ⧸ I` (setting it to 0 if the cardinality is infinite). norm of its generator -/ +@[expose] public section + open Module open scoped nonZeroDivisors diff --git a/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean b/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean index d637089ee36811..1349ee5eb1858c 100644 --- a/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean +++ b/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Alex J. Best -/ -import Mathlib.Algebra.GroupWithZero.Torsion -import Mathlib.NumberTheory.RamificationInertia.Galois -import Mathlib.RingTheory.DedekindDomain.Factorization -import Mathlib.RingTheory.DedekindDomain.Instances -import Mathlib.RingTheory.Ideal.Int -import Mathlib.RingTheory.NormalClosure +module + +public import Mathlib.Algebra.GroupWithZero.Torsion +public import Mathlib.NumberTheory.RamificationInertia.Galois +public import Mathlib.RingTheory.DedekindDomain.Factorization +public import Mathlib.RingTheory.DedekindDomain.Instances +public import Mathlib.RingTheory.Ideal.Int +public import Mathlib.RingTheory.NormalClosure /-! @@ -31,6 +33,8 @@ spanned by the norms of elements in `I`. -/ +@[expose] public section + open scoped nonZeroDivisors section SpanNorm diff --git a/Mathlib/RingTheory/Ideal/Oka.lean b/Mathlib/RingTheory/Ideal/Oka.lean index 5f64b5415c187b..970809a6ad5ce7 100644 --- a/Mathlib/RingTheory/Ideal/Oka.lean +++ b/Mathlib/RingTheory/Ideal/Oka.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Anthony Fernandes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anthony Fernandes, Marc Robin -/ -import Mathlib.RingTheory.Ideal.Colon +module + +public import Mathlib.RingTheory.Ideal.Colon /-! # Oka predicates @@ -23,6 +25,8 @@ This file introduces the notion of Oka predicates and standard results about the - [lam_reyes_2009]: *Oka and Ako ideal families in commutative rings*, 2009 -/ +@[expose] public section + namespace Ideal variable {R : Type*} [CommSemiring R] diff --git a/Mathlib/RingTheory/Ideal/Operations.lean b/Mathlib/RingTheory/Ideal/Operations.lean index adcc30afb46ab3..2ca31f766ae614 100644 --- a/Mathlib/RingTheory/Ideal/Operations.lean +++ b/Mathlib/RingTheory/Ideal/Operations.lean @@ -3,18 +3,23 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Data.Fintype.Lattice -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Nilpotent.Defs -import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +module + +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Data.Fintype.Lattice +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.Ideal.Basic +public import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +public import Mathlib.Tactic.Order /-! # More operations on modules and ideals -/ +@[expose] public section + assert_not_exists Module.Basis -- See `RingTheory.Ideal.Basis` Submodule.hasQuotient -- See `RingTheory.Ideal.Quotient.Operations` @@ -1015,6 +1020,11 @@ theorem IsPrime.inf_le' {s : Finset ι} {f : ι → Ideal R} {P : Ideal R} (hp : s.inf f ≤ P ↔ ∃ i ∈ s, f i ≤ P := ⟨fun h ↦ hp.prod_le.1 <| prod_le_inf.trans h, fun ⟨_, his, hip⟩ ↦ (Finset.inf_le his).trans hip⟩ +theorem IsPrime.notMem_of_isCoprime_of_mem {I : Ideal R} [I.IsPrime] {x y : R} (h : IsCoprime x y) + (hx : x ∈ I) : y ∉ I := fun hy ↦ + have ⟨a, b, e⟩ := h + Ideal.IsPrime.one_notMem ‹_› (e ▸ I.add_mem (I.mul_mem_left a hx) (I.mul_mem_left b hy)) + theorem subset_union {R : Type u} [Ring R] {I J K : Ideal R} : (I : Set R) ⊆ J ∪ K ↔ I ≤ J ∨ I ≤ K := AddSubgroupClass.subset_union @@ -1104,11 +1114,8 @@ theorem subset_union_prime' {R : Type u} [CommRing R] {s : Finset ι} {f : ι by_cases HI : (I : Set R) ⊆ f a ∪ f b ∪ ⋃ j ∈ (↑t : Set ι), f j · specialize ih hp.2 hn HI rcases ih with (ih | ih | ⟨k, hkt, ih⟩) - · left - exact ih - · right - left - exact ih + · order + · order · right right exact ⟨k, Finset.mem_insert_of_mem hkt, ih⟩ diff --git a/Mathlib/RingTheory/Ideal/Over.lean b/Mathlib/RingTheory/Ideal/Over.lean index 05bb8aa5d71328..bcf985faf73e2a 100644 --- a/Mathlib/RingTheory/Ideal/Over.lean +++ b/Mathlib/RingTheory/Ideal/Over.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Yongle Hu -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Group.Subgroup.Actions -import Mathlib.RingTheory.Ideal.Pointwise -import Mathlib.RingTheory.Ideal.Quotient.Operations +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Group.Subgroup.Actions +public import Mathlib.RingTheory.Ideal.Pointwise +public import Mathlib.RingTheory.Ideal.Quotient.Operations /-! # Ideals over/under ideals @@ -17,6 +19,8 @@ Let `f : R →+* S` be a ring homomorphism (typically a ring extension), `I` an This is expressed here by writing `I = J.comap f`. -/ +@[expose] public section + -- for going-up results about integral extensions, see `Mathlib/RingTheory/Ideal/GoingUp.lean` assert_not_exists Algebra.IsIntegral diff --git a/Mathlib/RingTheory/Ideal/Pointwise.lean b/Mathlib/RingTheory/Ideal/Pointwise.lean index 4e815414df9186..d6377bea1809d2 100644 --- a/Mathlib/RingTheory/Ideal/Pointwise.lean +++ b/Mathlib/RingTheory/Ideal/Pointwise.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.Ring.Action.End -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.Algebra.Ring.Action.End +public import Mathlib.RingTheory.Ideal.Maps /-! # Pointwise instances on `Ideal`s @@ -20,6 +22,8 @@ Where possible, try to keep them in sync. -/ +@[expose] public section + open Set diff --git a/Mathlib/RingTheory/Ideal/Prime.lean b/Mathlib/RingTheory/Ideal/Prime.lean index e6c51bed6e5442..2fbdb5807b7794 100644 --- a/Mathlib/RingTheory/Ideal/Prime.lean +++ b/Mathlib/RingTheory/Ideal/Prime.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.Ideal.Lattice +module + +public import Mathlib.RingTheory.Ideal.Lattice /-! @@ -16,6 +18,8 @@ This file contains the definition of `Ideal.IsPrime` for prime ideals. Support right ideals, and two-sided ideals over non-commutative rings. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Ideal/Prod.lean b/Mathlib/RingTheory/Ideal/Prod.lean index 846edf42978bbc..65b50d461b5e33 100644 --- a/Mathlib/RingTheory/Ideal/Prod.lean +++ b/Mathlib/RingTheory/Ideal/Prod.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.RingTheory.Ideal.Maps /-! # Ideals in product rings @@ -14,6 +16,8 @@ product `I × J`, viewed as an ideal of `R × S`. In `ideal_prod_eq` we show tha `p × S` or `R × p`, where `p` is a prime ideal. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Ideal/Quotient/Basic.lean b/Mathlib/RingTheory/Ideal/Quotient/Basic.lean index 224ac94933ddcb..1e260c9974119a 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Basic.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro, Anne Baanen -/ -import Mathlib.GroupTheory.QuotientGroup.Finite -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.RingTheory.Congruence.Basic -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.Tactic.FinCases +module + +public import Mathlib.GroupTheory.QuotientGroup.Finite +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.RingTheory.Congruence.Basic +public import Mathlib.RingTheory.Ideal.Basic +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.Tactic.FinCases /-! # Ideal quotients @@ -24,20 +26,16 @@ See `Algebra.RingQuot` for quotients of semirings. -/ - -universe u v w - -namespace Ideal +@[expose] public section open Set -variable {R : Type u} [Ring R] (I J : Ideal R) {a b : R} -variable {S : Type v} +variable {ι ι' R S : Type*} [Ring R] (I J : Ideal R) {a b : R} -namespace Quotient +namespace Ideal.Quotient @[simp] -lemma mk_span_range {ι : Type*} (f : ι → R) [(span (range f)).IsTwoSided] (i : ι) : +lemma mk_span_range (f : ι → R) [(span (range f)).IsTwoSided] (i : ι) : mk (span (.range f)) (f i) = 0 := by rw [Ideal.Quotient.eq_zero_iff_mem] exact Ideal.subset_span ⟨i, rfl⟩ @@ -174,8 +172,6 @@ end Quotient section Pi -variable (ι : Type v) - /-- `R^n/I^n` is a `R/I`-module. -/ instance modulePi [I.IsTwoSided] : Module (R ⧸ I) ((ι → R) ⧸ pi fun _ ↦ I) where smul c m := @@ -192,6 +188,7 @@ instance modulePi [I.IsTwoSided] : Module (R ⧸ I) ((ι → R) ⧸ pi fun _ ↦ add_smul := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; exact congr_arg _ (add_smul _ _ _) zero_smul := by rintro ⟨a⟩; exact congr_arg _ (zero_smul _ _) +variable (ι) in /-- `R^n/I^n` is isomorphic to `(R/I)^n` as an `R/I`-module. -/ noncomputable def piQuotEquiv [I.IsTwoSided] : ((ι → R) ⧸ pi fun _ ↦ I) ≃ₗ[R ⧸ I] ι → (R ⧸ I) where toFun x := Quotient.liftOn' x (fun f i ↦ Ideal.Quotient.mk I (f i)) fun _ _ hab ↦ @@ -206,7 +203,7 @@ noncomputable def piQuotEquiv [I.IsTwoSided] : ((ι → R) ⧸ pi fun _ ↦ I) /-- If `f : R^n → R^m` is an `R`-linear map and `I ⊆ R` is an ideal, then the image of `I^n` is contained in `I^m`. -/ -theorem map_pi [I.IsTwoSided] {ι : Type*} [Finite ι] {ι' : Type w} (x : ι → R) (hi : ∀ i, x i ∈ I) +theorem map_pi [I.IsTwoSided] [Finite ι] (x : ι → R) (hi : ∀ i, x i ∈ I) (f : (ι → R) →ₗ[R] ι' → R) (i : ι') : f x i ∈ I := by classical cases nonempty_fintype ι @@ -221,8 +218,13 @@ open scoped Pointwise in lemma univ_eq_iUnion_image_add : (Set.univ (α := R)) = ⋃ x : R ⧸ I, x.out +ᵥ (I : Set R) := QuotientAddGroup.univ_eq_iUnion_vadd I.toAddSubgroup -variable {I} in -lemma _root_.Finite.of_finite_quot_finite_ideal [hI : Finite I] [h : Finite (R ⧸ I)] : Finite R := - @Finite.of_finite_quot_finite_addSubgroup _ _ _ hI h - end Ideal + +lemma finite_iff_ideal_quotient (I : Ideal R) : Finite R ↔ Finite I ∧ Finite (R ⧸ I) := + finite_iff_addSubgroup_quotient I.toAddSubgroup + +lemma Finite.of_ideal_quotient (I : Ideal R) [Finite I] [Finite (R ⧸ I)] : Finite R := by + rw [finite_iff_ideal_quotient]; constructor <;> assumption + +@[deprecated (since := "2025-11-11")] +alias Finite.of_finite_quot_finite_ideal := Finite.of_ideal_quotient diff --git a/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean b/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean index 03a8e0c97f93ab..b4a2e38f61f6d5 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.LinearAlgebra.TensorProduct.Pi -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.Ideal.Quotient.Operations +module + +public import Mathlib.LinearAlgebra.TensorProduct.Pi +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.Ideal.Quotient.Operations /-! # Module version of Chinese remainder theorem -/ +@[expose] public section + open Function variable {R : Type*} [CommRing R] {ι : Type*} diff --git a/Mathlib/RingTheory/Ideal/Quotient/Defs.lean b/Mathlib/RingTheory/Ideal/Quotient/Defs.lean index 9c73dc56118f1f..eb1e9887446bc5 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Defs.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro, Anne Baanen -/ -import Mathlib.LinearAlgebra.Quotient.Defs -import Mathlib.RingTheory.Congruence.Defs -import Mathlib.RingTheory.Ideal.Defs +module + +public import Mathlib.LinearAlgebra.Quotient.Defs +public import Mathlib.RingTheory.Congruence.Defs +public import Mathlib.RingTheory.Ideal.Defs /-! # Ideal quotients @@ -24,6 +26,8 @@ See `Algebra.RingQuot` for quotients of non-commutative rings. - `Ideal.quotEquivOfEq`: quotienting by equal ideals gives isomorphic rings -/ +@[expose] public section + universe u v w @@ -215,4 +219,7 @@ theorem quotEquivOfEq_mk (h : I = J) (x : R) : theorem quotEquivOfEq_symm (h : I = J) : (Ideal.quotEquivOfEq h).symm = Ideal.quotEquivOfEq h.symm := by ext; rfl +theorem quotEquivOfEq_eq_factor (h : I = J) (x : R ⧸ I) : + Ideal.quotEquivOfEq h x = Ideal.Quotient.factor (h ▸ le_refl I) x := rfl + end Ideal diff --git a/Mathlib/RingTheory/Ideal/Quotient/Index.lean b/Mathlib/RingTheory/Ideal/Quotient/Index.lean index 80252dbe4b85bd..617ba87bd1082b 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Index.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Index.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.Data.Finsupp.Fintype -import Mathlib.GroupTheory.Index -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.LinearAlgebra.TensorProduct.Quotient -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.RingTheory.Finiteness.Cardinality -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.Data.Finsupp.Fintype +public import Mathlib.GroupTheory.Index +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.LinearAlgebra.TensorProduct.Quotient +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.RingTheory.Finiteness.Cardinality +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.TensorProduct.Finite /-! # Indices of ideals @@ -26,6 +28,8 @@ import Mathlib.RingTheory.TensorProduct.Finite -/ +@[expose] public section + variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] variable (I : Ideal R) {N : Submodule R M} diff --git a/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean b/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean index 97da0bc7c6b9c4..bb2f50a0b67d04 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Nilpotent.Lemmas +module + +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Nilpotent.Lemmas /-! # Nilpotent elements in quotient rings -/ +@[expose] public section + theorem Ideal.isRadical_iff_quotient_reduced {R : Type*} [CommRing R] (I : Ideal R) : I.IsRadical ↔ IsReduced (R ⧸ I) := by conv_lhs => rw [← @Ideal.mk_ker R _ I] diff --git a/Mathlib/RingTheory/Ideal/Quotient/Noetherian.lean b/Mathlib/RingTheory/Ideal/Quotient/Noetherian.lean index 2f2f268de19984..3fd031021adc3c 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Noetherian.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Noetherian.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Noetherian.Basic +module + +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Noetherian.Basic /-! # Noetherian quotient rings and quotient modules -/ +@[expose] public section + instance Ideal.Quotient.isNoetherianRing {R : Type*} [CommRing R] [IsNoetherianRing R] (I : Ideal R) : IsNoetherianRing (R ⧸ I) := isNoetherianRing_iff.mpr <| isNoetherian_of_tower R <| inferInstance diff --git a/Mathlib/RingTheory/Ideal/Quotient/Operations.lean b/Mathlib/RingTheory/Ideal/Quotient/Operations.lean index b3667d7d12759f..c8e4c11d40a76b 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Operations.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Operations.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Patrick Massot -/ -import Mathlib.Algebra.Algebra.Subalgebra.Operations -import Mathlib.Algebra.Ring.Fin -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Ideal.Quotient.Basic +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Operations +public import Mathlib.Algebra.Ring.Fin +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Ideal.Quotient.Basic /-! # More operations on modules and ideals related to quotients @@ -25,6 +27,8 @@ import Mathlib.RingTheory.Ideal.Quotient.Basic `ZMod`). -/ +@[expose] public section + universe u v w namespace RingHom @@ -427,6 +431,10 @@ lemma Quotient.factorₐ_apply_mk (x : A) : lemma Quotient.factorₐ_comp_mk : (Ideal.Quotient.factorₐ R₁ hIJ).comp (Ideal.Quotient.mkₐ R₁ I) = Ideal.Quotient.mkₐ R₁ J := rfl +@[simp] +theorem Quotient.factorₐ_apply (x : A ⧸ I) : + Quotient.factorₐ R₁ hIJ x = Quotient.factor hIJ x := rfl + @[simp] lemma Quotient.factorₐ_comp {K : Ideal A} [K.IsTwoSided] (hJK : J ≤ K) : (Ideal.Quotient.factorₐ R₁ hJK).comp (Ideal.Quotient.factorₐ R₁ hIJ) = @@ -686,6 +694,16 @@ theorem quotientEquivAlgOfEq_mk {I J : Ideal A} [I.IsTwoSided] [J.IsTwoSided] (h quotientEquivAlgOfEq R₁ h (Ideal.Quotient.mk I x) = Ideal.Quotient.mk J x := rfl +@[simp] +theorem quotientEquivAlgOfEq_coe_eq_factorₐ + {I J : Ideal A} [I.IsTwoSided] [J.IsTwoSided] (h : I = J) : + (quotientEquivAlgOfEq R₁ h : A ⧸ I →ₐ[R₁] A ⧸ J) = Quotient.factorₐ R₁ (le_of_eq h) := rfl + +@[simp] +theorem quotientEquivAlgOfEq_coe_eq_factor + {I J : Ideal A} [I.IsTwoSided] [J.IsTwoSided] (h : I = J) : + (quotientEquivAlgOfEq R₁ h : A ⧸ I →+* A ⧸ J) = Quotient.factor (le_of_eq h) := rfl + @[simp] theorem quotientEquivAlgOfEq_symm {I J : Ideal A} [I.IsTwoSided] [J.IsTwoSided] (h : I = J) : (quotientEquivAlgOfEq R₁ h).symm = quotientEquivAlgOfEq R₁ h.symm := by diff --git a/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean b/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean index 84f176032582cd..58ea7a4559b072 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan, Jiedong Jiang -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.Algebra.Algebra.Operations -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.RingTheory.Ideal.Operations +public import Mathlib.RingTheory.Ideal.Maps /-! # The quotient map from `R ⧸ I ^ m` to `R ⧸ I ^ n` where `m ≥ n` @@ -25,6 +27,8 @@ to `R ⧸ I ^ n` induced by the natural inclusion `I ^ n → I ^ m`. ## Main results -/ +@[expose] public section + /- Since `Mathlib/LinearAlgebra/Quotient/Basic.lean` and `Mathlib/RingTheory/Ideal/Quotient/Defs.lean` do not import each other, and the first file that imports both of them is `Mathlib/RingTheory/Ideal/Quotient/Operations.lean`, which has already diff --git a/Mathlib/RingTheory/Ideal/Span.lean b/Mathlib/RingTheory/Ideal/Span.lean index eb603da425a266..20df4587d0282b 100644 --- a/Mathlib/RingTheory/Ideal/Span.lean +++ b/Mathlib/RingTheory/Ideal/Span.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.Ring.Idempotent -import Mathlib.Algebra.Ring.Regular -import Mathlib.LinearAlgebra.Span.Basic -import Mathlib.RingTheory.Ideal.Lattice +module + +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.Ring.Idempotent +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.LinearAlgebra.Span.Basic +public import Mathlib.RingTheory.Ideal.Lattice /-! # Ideals generated by a set of elements @@ -19,6 +21,8 @@ This file defines `Ideal.span s` as the ideal generated by the subset `s` of the Support right ideals, and two-sided ideals over non-commutative rings. -/ +@[expose] public section + universe u variable {α : Type u} diff --git a/Mathlib/RingTheory/Idempotents.lean b/Mathlib/RingTheory/Idempotents.lean index 8a0bcc126a1f78..b51e4b4936bd4e 100644 --- a/Mathlib/RingTheory/Idempotents.lean +++ b/Mathlib/RingTheory/Idempotents.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Nilpotent.Defs /-! @@ -36,6 +38,8 @@ In this file we provide various results regarding idempotent elements in rings. a ring isomorphism `R ≃ ∏ R ⧸ ⟨1 - eᵢ⟩`. -/ +@[expose] public section + section Semiring variable {R S : Type*} [Semiring R] [Semiring S] (f : R →+* S) @@ -526,7 +530,7 @@ def NonUnitalSubsemiring.corner [NonUnitalSemiring R] : NonUnitalSubsemiring R w add_mem' := by rintro _ _ ⟨a, rfl⟩ ⟨b, rfl⟩; exact ⟨a + b, by simp_rw [mul_add, add_mul]⟩ zero_mem' := ⟨0, by simp_rw [mul_zero, zero_mul]⟩ -/-- The corner associated to an element `e` in a ring without ` +/-- The corner associated to an element `e` in a ring without 1 is the subring without 1 of all elements of the form `e * r * e`. -/ def NonUnitalRing.corner [NonUnitalRing R] : NonUnitalSubring R where __ := NonUnitalSubsemiring.corner e diff --git a/Mathlib/RingTheory/Int/Basic.lean b/Mathlib/RingTheory/Int/Basic.lean index 1ec97b72bac391..11677efe7a7d25 100644 --- a/Mathlib/RingTheory/Int/Basic.lean +++ b/Mathlib/RingTheory/Int/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Algebra.GCDMonoid.Nat -import Mathlib.Data.Nat.Prime.Int -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Algebra.GCDMonoid.Nat +public import Mathlib.Data.Nat.Prime.Int +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Divisibility over ℤ @@ -27,6 +29,8 @@ cases of ℤ being examples of structures in ring theory. prime, irreducible, integers, normalization monoid, gcd monoid, greatest common divisor -/ +@[expose] public section + namespace Int diff --git a/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean b/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean index 3b8983033ba7d4..ff7150bdb83f71 100644 --- a/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap -import Mathlib.RingTheory.IntegralClosure.Algebra.Defs -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap +public import Mathlib.RingTheory.IntegralClosure.Algebra.Defs +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic /-! # Integral closure of a subring. @@ -19,6 +21,8 @@ Let `R` be a `CommRing` and let `A` be an R-algebra. * `integralClosure R A` : the integral closure of `R` in an `R`-algebra `A`. -/ +@[expose] public section + open Polynomial Submodule diff --git a/Mathlib/RingTheory/IntegralClosure/Algebra/Defs.lean b/Mathlib/RingTheory/IntegralClosure/Algebra/Defs.lean index b9d16d6f48e5f6..870be403bbeeec 100644 --- a/Mathlib/RingTheory/IntegralClosure/Algebra/Defs.lean +++ b/Mathlib/RingTheory/IntegralClosure/Algebra/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs +module + +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs /-! # Integral algebras @@ -16,6 +18,8 @@ Let `R` be a `CommRing` and let `A` be an R-algebra. over the base ring. -/ +@[expose] public section + open Polynomial Submodule diff --git a/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean b/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean index 10d6d6ce221a2c..8105f2816f0df2 100644 --- a/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean +++ b/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Andrew Yang, Patrick Lutz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.DedekindDomain.IntegralClosure -import Mathlib.RingTheory.RingHom.Finite -import Mathlib.RingTheory.Localization.LocalizationLocalization -import Mathlib.RingTheory.Localization.NormTrace -import Mathlib.RingTheory.Norm.Transitivity +module + +public import Mathlib.RingTheory.DedekindDomain.IntegralClosure +public import Mathlib.RingTheory.RingHom.Finite +public import Mathlib.RingTheory.Localization.LocalizationLocalization +public import Mathlib.RingTheory.Localization.NormTrace +public import Mathlib.RingTheory.Norm.Transitivity /-! # Restriction of various maps between fields to integrally closed subrings. @@ -24,6 +26,8 @@ defined to be the restriction of the trace map of `Frac(B)/Frac(A)`. defined to be the restriction of the norm map of `Frac(B)/Frac(A)`. -/ + +@[expose] public section open nonZeroDivisors variable (A K L L₂ L₃ B B₂ B₃ : Type*) diff --git a/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean b/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean index 996731e2899d16..3de9162d2952d1 100644 --- a/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean +++ b/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Localization.Integral -import Mathlib.RingTheory.Localization.LocalizationLocalization +module + +public import Mathlib.RingTheory.Localization.Integral +public import Mathlib.RingTheory.Localization.LocalizationLocalization /-! # Integrally closed rings @@ -51,6 +53,8 @@ but we could also consider a version of `NormalDomain` that only requires the lo `IsIntegrallyClosed` (even for Noetherian rings?). -/ +@[expose] public section + open scoped nonZeroDivisors Polynomial diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean index 3e8e66d776fe92..d7d9e9519802df 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs -import Mathlib.Algebra.Polynomial.Expand -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Finiteness.Subalgebra -import Mathlib.RingTheory.Polynomial.Tower +module + +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs +public import Mathlib.Algebra.Polynomial.Expand +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Finiteness.Subalgebra +public import Mathlib.RingTheory.Polynomial.Tower /-! # Properties of integral elements. @@ -15,6 +17,8 @@ import Mathlib.RingTheory.Polynomial.Tower We prove basic properties of integral elements in a ring extension. -/ +@[expose] public section + open Polynomial Submodule section Ring diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegral/Defs.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegral/Defs.lean index eae0e386ac19de..66988894a6c922 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegral/Defs.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegral/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Polynomial.Degree.Definitions -import Mathlib.Algebra.Polynomial.Eval.Defs -import Mathlib.Tactic.Algebraize +module + +public import Mathlib.Algebra.Polynomial.Degree.Definitions +public import Mathlib.Algebra.Polynomial.Eval.Defs +public import Mathlib.Tactic.Algebraize /-! # Integral closure of a subring. @@ -23,6 +25,8 @@ Let `R` be a `CommRing` and let `A` be an R-algebra. coefficients in `R`. -/ +@[expose] public section + open Polynomial section Ring diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean index dfcab4a9fe534f..4c82349095a77f 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.IntegralClosure.Algebra.Basic -import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Defs -import Mathlib.RingTheory.Polynomial.IntegralNormalization -import Mathlib.RingTheory.Polynomial.ScaleRoots -import Mathlib.RingTheory.TensorProduct.MvPolynomial +module + +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.IntegralClosure.Algebra.Basic +public import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Defs +public import Mathlib.RingTheory.Polynomial.IntegralNormalization +public import Mathlib.RingTheory.Polynomial.ScaleRoots +public import Mathlib.RingTheory.TensorProduct.MvPolynomial /-! # # Integral closure as a characteristic predicate @@ -18,6 +20,8 @@ We prove basic properties of `IsIntegralClosure`. -/ +@[expose] public section + open Polynomial Submodule section inv diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Defs.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Defs.lean index 50467f58cba3f5..213bb1549f3617 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Defs.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs +module + +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Defs /-! # Integral closure as a characteristic predicate @@ -17,6 +19,8 @@ Let `R` be a `CommRing` and let `A` be an R-algebra. (the image of) `A`. -/ +@[expose] public section + /-- `IsIntegralClosure A R B` is the characteristic predicate stating `A` is the integral closure of `R` in `B`, i.e. that an element of `B` is integral over `R` iff it is an element of (the image of) `A`. diff --git a/Mathlib/RingTheory/IntegralDomain.lean b/Mathlib/RingTheory/IntegralDomain.lean index 23a54621d2c5a4..cf532d54589965 100644 --- a/Mathlib/RingTheory/IntegralDomain.lean +++ b/Mathlib/RingTheory/IntegralDomain.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Chris Hughes -/ -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Data.Fintype.Inv -import Mathlib.GroupTheory.SpecificGroups.Cyclic -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Data.Fintype.Inv +public import Mathlib.GroupTheory.SpecificGroups.Cyclic +public import Mathlib.Tactic.FieldSimp /-! # Integral domains @@ -28,6 +30,8 @@ is in `Mathlib/RingTheory/LittleWedderburn.lean`. integral domain, finite integral domain, finite field -/ +@[expose] public section + section open Finset Polynomial Function diff --git a/Mathlib/RingTheory/Invariant.lean b/Mathlib/RingTheory/Invariant.lean index 85156879145008..da69e4cea4ae4c 100644 --- a/Mathlib/RingTheory/Invariant.lean +++ b/Mathlib/RingTheory/Invariant.lean @@ -3,6 +3,8 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.RingTheory.Invariant.Basic +module + +public import Mathlib.RingTheory.Invariant.Basic deprecated_module (since := "2025-05-24") diff --git a/Mathlib/RingTheory/Invariant/Basic.lean b/Mathlib/RingTheory/Invariant/Basic.lean index 263fd0bdd957eb..4695463f5accb2 100644 --- a/Mathlib/RingTheory/Invariant/Basic.lean +++ b/Mathlib/RingTheory/Invariant/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.RingTheory.Invariant.Defs -import Mathlib.RingTheory.IntegralClosure.IntegralRestrict +module + +public import Mathlib.RingTheory.Invariant.Defs +public import Mathlib.RingTheory.IntegralClosure.IntegralRestrict /-! # Invariant Extensions of Rings @@ -36,6 +38,8 @@ If `Q` is a prime ideal of `B` lying over a prime ideal `P` of `A`, then an automorphism of `B/Q`. -/ +@[expose] public section + open scoped Pointwise section Galois diff --git a/Mathlib/RingTheory/Invariant/Defs.lean b/Mathlib/RingTheory/Invariant/Defs.lean index 69a29dbdb7161d..d1c22b8888fb98 100644 --- a/Mathlib/RingTheory/Invariant/Defs.lean +++ b/Mathlib/RingTheory/Invariant/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Algebra.Algebra.Defs +module + +public import Mathlib.Algebra.Algebra.Defs /-! # Invariant Extensions of Rings @@ -16,6 +18,8 @@ of some finite Galois extension of number fields, and `A := 𝓞K` and `B := integers. -/ +@[expose] public section + namespace Algebra variable (A B G : Type*) [CommSemiring A] [Semiring B] [Algebra A B] diff --git a/Mathlib/RingTheory/Invariant/Profinite.lean b/Mathlib/RingTheory/Invariant/Profinite.lean index 0e832e15178a5c..1a510fadec7cf7 100644 --- a/Mathlib/RingTheory/Invariant/Profinite.lean +++ b/Mathlib/RingTheory/Invariant/Profinite.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Invariant.Basic -import Mathlib.Topology.Algebra.ClopenNhdofOne -import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Limits -import Mathlib.CategoryTheory.CofilteredSystem +module + +public import Mathlib.RingTheory.Invariant.Basic +public import Mathlib.Topology.Algebra.ClopenNhdofOne +public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Limits +public import Mathlib.CategoryTheory.CofilteredSystem /-! # Invariant Extensions of Rings @@ -27,6 +29,8 @@ Let `G` be a profinite group acting continuously on a -/ +@[expose] public section + open scoped Pointwise section ProfiniteGrp diff --git a/Mathlib/RingTheory/IsAdjoinRoot.lean b/Mathlib/RingTheory/IsAdjoinRoot.lean index 4f6f8225470b10..9870f6f05d4707 100644 --- a/Mathlib/RingTheory/IsAdjoinRoot.lean +++ b/Mathlib/RingTheory/IsAdjoinRoot.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed -import Mathlib.RingTheory.PowerBasis +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed +public import Mathlib.RingTheory.PowerBasis /-! # A predicate on adjoining roots of polynomial @@ -56,6 +58,8 @@ Using `IsAdjoinRoot` to map out of `S`: `f`, if `f` is irreducible and monic, and `R` is a GCD domain -/ +@[expose] public section + open Module Polynomial noncomputable section diff --git a/Mathlib/RingTheory/IsPrimary.lean b/Mathlib/RingTheory/IsPrimary.lean index 15790229a6481f..f987724710cbf7 100644 --- a/Mathlib/RingTheory/IsPrimary.lean +++ b/Mathlib/RingTheory/IsPrimary.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Ideal.Operations +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Ideal.Operations /-! # Primary submodules @@ -31,6 +33,8 @@ to define the nilpotency of `r : R`. -/ +@[expose] public section + open Pointwise namespace Submodule diff --git a/Mathlib/RingTheory/IsTensorProduct.lean b/Mathlib/RingTheory/IsTensorProduct.lean index 58cfbbe4883a8d..0c2b29e245b90a 100644 --- a/Mathlib/RingTheory/IsTensorProduct.lean +++ b/Mathlib/RingTheory/IsTensorProduct.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.RingTheory.TensorProduct.Maps /-! # The characteristic predicate of tensor product @@ -28,6 +30,8 @@ import Mathlib.RingTheory.TensorProduct.Maps -/ +@[expose] public section + universe u v₁ v₂ v₃ v₄ diff --git a/Mathlib/RingTheory/Jacobson/Artinian.lean b/Mathlib/RingTheory/Jacobson/Artinian.lean index 5ef1957cdebaef..41dfa470a5c1dc 100644 --- a/Mathlib/RingTheory/Jacobson/Artinian.lean +++ b/Mathlib/RingTheory/Jacobson/Artinian.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu, Andrew Yang -/ -import Mathlib.RingTheory.HopkinsLevitzki -import Mathlib.RingTheory.Jacobson.Ring +module + +public import Mathlib.RingTheory.HopkinsLevitzki +public import Mathlib.RingTheory.Jacobson.Ring /-! # Artinian rings over Jacobson rings @@ -15,6 +17,8 @@ then `A` is finite over `R` if and only if `A` is an Artinian ring. -/ +@[expose] public section + variable (R A : Type*) [CommRing R] [CommRing A] [Algebra R A] [Algebra.FiniteType R A] attribute [local instance] IsArtinianRing.fieldOfSubtypeIsMaximal in diff --git a/Mathlib/RingTheory/Jacobson/Ideal.lean b/Mathlib/RingTheory/Jacobson/Ideal.lean index d48b90a4f1b910..20262e2b803cab 100644 --- a/Mathlib/RingTheory/Jacobson/Ideal.lean +++ b/Mathlib/RingTheory/Jacobson/Ideal.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Devon Tuma, Wojciech Nawrocki -/ -import Mathlib.RingTheory.Ideal.IsPrimary -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.TwoSidedIdeal.Operations -import Mathlib.RingTheory.Jacobson.Radical +module + +public import Mathlib.RingTheory.Ideal.IsPrimary +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.TwoSidedIdeal.Operations +public import Mathlib.RingTheory.Jacobson.Radical /-! # Jacobson radical @@ -45,6 +47,8 @@ Jacobson, Jacobson radical, Local Ideal -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Jacobson/Polynomial.lean b/Mathlib/RingTheory/Jacobson/Polynomial.lean index c102d0db7133bd..ba57b2110b17b9 100644 --- a/Mathlib/RingTheory/Jacobson/Polynomial.lean +++ b/Mathlib/RingTheory/Jacobson/Polynomial.lean @@ -3,13 +3,17 @@ Copyright (c) 2020 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma -/ -import Mathlib.RingTheory.Jacobson.Ideal -import Mathlib.RingTheory.Polynomial.Quotient +module + +public import Mathlib.RingTheory.Jacobson.Ideal +public import Mathlib.RingTheory.Polynomial.Quotient /-! # Jacobson radical of polynomial ring -/ +@[expose] public section + namespace Ideal section Polynomial diff --git a/Mathlib/RingTheory/Jacobson/Radical.lean b/Mathlib/RingTheory/Jacobson/Radical.lean index 6a9521407eaf5f..c0b2454d61dac2 100644 --- a/Mathlib/RingTheory/Jacobson/Radical.lean +++ b/Mathlib/RingTheory/Jacobson/Radical.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Ideal.Quotient.Defs +module + +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Ideal.Quotient.Defs /-! # Jacobson radical of modules and rings @@ -24,6 +26,8 @@ it is in fact a two-sided ideal, and equals the intersection of all maximal righ * [F. Lorenz, *Algebra: Volume II: Fields with Structure, Algebras and Advanced Topics*][Lorenz2008] -/ +@[expose] public section + assert_not_exists Cardinal namespace Module diff --git a/Mathlib/RingTheory/Jacobson/Ring.lean b/Mathlib/RingTheory/Jacobson/Ring.lean index 653764522902a8..b997280e97d45c 100644 --- a/Mathlib/RingTheory/Jacobson/Ring.lean +++ b/Mathlib/RingTheory/Jacobson/Ring.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma -/ -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.Ideal.GoingUp -import Mathlib.RingTheory.Jacobson.Polynomial -import Mathlib.RingTheory.Artinian.Module +module + +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.Ideal.GoingUp +public import Mathlib.RingTheory.Jacobson.Polynomial +public import Mathlib.RingTheory.Artinian.Module /-! # Jacobson Rings @@ -37,6 +39,8 @@ Let `R` be a commutative ring. Jacobson rings are defined using the first of the Jacobson, Jacobson Ring -/ +@[expose] public section + universe u open Polynomial diff --git a/Mathlib/RingTheory/Jacobson/Semiprimary.lean b/Mathlib/RingTheory/Jacobson/Semiprimary.lean index 178a97f436f9e3..48f3a5cc2adc4b 100644 --- a/Mathlib/RingTheory/Jacobson/Semiprimary.lean +++ b/Mathlib/RingTheory/Jacobson/Semiprimary.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.RingTheory.Jacobson.Radical -import Mathlib.RingTheory.Nilpotent.Defs -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.RingTheory.Jacobson.Radical +public import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Semiprimary rings @@ -16,6 +18,8 @@ import Mathlib.RingTheory.SimpleModule.Basic `Ring.jacobson R` is nilpotent and `R ⧸ Ring.jacobson R` is semisimple. -/ +@[expose] public section + variable (R R₂ M M₂ : Type*) [Ring R] [Ring R₂] variable [AddCommGroup M] [Module R M] [AddCommGroup M₂] [Module R₂ M₂] variable {τ₁₂ : R →+* R₂} [RingHomSurjective τ₁₂] diff --git a/Mathlib/RingTheory/Kaehler/Basic.lean b/Mathlib/RingTheory/Kaehler/Basic.lean index c456a28a258783..7fcf6f30a09f36 100644 --- a/Mathlib/RingTheory/Kaehler/Basic.lean +++ b/Mathlib/RingTheory/Kaehler/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Nicolò Cavalleri. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nicolò Cavalleri, Andrew Yang -/ -import Mathlib.RingTheory.Derivation.ToSquareZero -import Mathlib.RingTheory.Ideal.Cotangent -import Mathlib.RingTheory.IsTensorProduct -import Mathlib.RingTheory.EssentialFiniteness -import Mathlib.Algebra.Exact -import Mathlib.LinearAlgebra.TensorProduct.RightExactness +module + +public import Mathlib.RingTheory.Derivation.ToSquareZero +public import Mathlib.RingTheory.Ideal.Cotangent +public import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.RingTheory.EssentialFiniteness +public import Mathlib.Algebra.Exact +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness /-! # The module of Kähler differentials @@ -44,6 +46,8 @@ import Mathlib.LinearAlgebra.TensorProduct.RightExactness - Define the `IsKaehlerDifferential` predicate. -/ +@[expose] public section + suppress_compilation noncomputable section KaehlerDifferential @@ -366,7 +370,7 @@ local instance instR : Module R (KaehlerDifferential.ideal R S).cotangentIdeal : /-- Derivations into `Ω[S⁄R]` is equivalent to derivations into `(KaehlerDifferential.ideal R S).cotangentIdeal`. -/ noncomputable def KaehlerDifferential.endEquivDerivation' : - Derivation R S Ω[S⁄R] ≃ₗ[R] Derivation R S (ideal R S).cotangentIdeal := + Derivation R S Ω[S⁄R] ≃ₗ[S] Derivation R S (ideal R S).cotangentIdeal := LinearEquiv.compDer ((KaehlerDifferential.ideal R S).cotangentEquivIdeal.restrictScalars S) /-- (Implementation) An `Equiv` version of `KaehlerDifferential.End_equiv_aux`. diff --git a/Mathlib/RingTheory/Kaehler/CotangentComplex.lean b/Mathlib/RingTheory/Kaehler/CotangentComplex.lean index e0d842ff89ff12..ca0e61b4130fcd 100644 --- a/Mathlib/RingTheory/Kaehler/CotangentComplex.lean +++ b/Mathlib/RingTheory/Kaehler/CotangentComplex.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Extension.Cotangent.Basic +module + +public import Mathlib.RingTheory.Extension.Cotangent.Basic deprecated_module (since := "2025-05-11") diff --git a/Mathlib/RingTheory/Kaehler/JacobiZariski.lean b/Mathlib/RingTheory/Kaehler/JacobiZariski.lean index 67ca3eb933e8ca..447e5fa614b04d 100644 --- a/Mathlib/RingTheory/Kaehler/JacobiZariski.lean +++ b/Mathlib/RingTheory/Kaehler/JacobiZariski.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Extension.Cotangent.Basic -import Mathlib.RingTheory.Extension.Generators -import Mathlib.Algebra.Module.SnakeLemma +module + +public import Mathlib.RingTheory.Extension.Cotangent.Basic +public import Mathlib.RingTheory.Extension.Generators +public import Mathlib.Algebra.Module.SnakeLemma /-! @@ -27,6 +29,8 @@ and the exactness lemmas are - `KaehlerDifferential.map_surjective` -/ +@[expose] public section + open KaehlerDifferential Module MvPolynomial TensorProduct namespace Algebra diff --git a/Mathlib/RingTheory/Kaehler/Polynomial.lean b/Mathlib/RingTheory/Kaehler/Polynomial.lean index e8e4a0d9402aba..03f9d153f0b42e 100644 --- a/Mathlib/RingTheory/Kaehler/Polynomial.lean +++ b/Mathlib/RingTheory/Kaehler/Polynomial.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Kaehler.Basic -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.Algebra.Polynomial.Derivation +module + +public import Mathlib.RingTheory.Kaehler.Basic +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.Algebra.Polynomial.Derivation /-! # The Kähler differential module of polynomial algebras -/ +@[expose] public section + open Algebra Module open scoped TensorProduct diff --git a/Mathlib/RingTheory/Kaehler/TensorProduct.lean b/Mathlib/RingTheory/Kaehler/TensorProduct.lean index 7388b4b56496d3..65fb52a8fa152b 100644 --- a/Mathlib/RingTheory/Kaehler/TensorProduct.lean +++ b/Mathlib/RingTheory/Kaehler/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Kaehler.Basic -import Mathlib.RingTheory.Localization.BaseChange +module + +public import Mathlib.RingTheory.Kaehler.Basic +public import Mathlib.RingTheory.Localization.BaseChange /-! # Kähler differential module under base change @@ -16,6 +18,8 @@ import Mathlib.RingTheory.Localization.BaseChange -/ +@[expose] public section + variable (R S A B : Type*) [CommRing R] [CommRing S] [Algebra R S] [CommRing A] [CommRing B] variable [Algebra R A] [Algebra R B] variable [Algebra A B] [Algebra S B] [IsScalarTower R A B] [IsScalarTower R S B] diff --git a/Mathlib/RingTheory/KrullDimension/Basic.lean b/Mathlib/RingTheory/KrullDimension/Basic.lean index d7c5a555a3512a..ee713efb69b5d0 100644 --- a/Mathlib/RingTheory/KrullDimension/Basic.lean +++ b/Mathlib/RingTheory/KrullDimension/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fangming Li, Jujian Zhang -/ -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Order.KrullDimension -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.Ideal.MinimalPrime.Basic -import Mathlib.RingTheory.Jacobson.Radical -import Mathlib.RingTheory.Spectrum.Prime.Basic +module + +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.Order.KrullDimension +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Ideal.MinimalPrime.Basic +public import Mathlib.RingTheory.Jacobson.Radical +public import Mathlib.RingTheory.Spectrum.Prime.Basic /-! # Krull dimensions of (commutative) rings @@ -19,6 +21,8 @@ of its prime spectrum. Unfolding this definition, it is the length of the longes prime ideals ordered by strict inclusion. -/ +@[expose] public section + open Order /-- diff --git a/Mathlib/RingTheory/KrullDimension/Field.lean b/Mathlib/RingTheory/KrullDimension/Field.lean index bc8ebdf09a3873..0fefdc14079a26 100644 --- a/Mathlib/RingTheory/KrullDimension/Field.lean +++ b/Mathlib/RingTheory/KrullDimension/Field.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fangming Li, Jujian Zhang -/ -import Mathlib.RingTheory.KrullDimension.Basic +module + +public import Mathlib.RingTheory.KrullDimension.Basic /-! # The Krull dimension of a field @@ -11,6 +13,8 @@ import Mathlib.RingTheory.KrullDimension.Basic This file proves that the Krull dimension of a field is zero. -/ +@[expose] public section + open Order @[simp] diff --git a/Mathlib/RingTheory/KrullDimension/LocalRing.lean b/Mathlib/RingTheory/KrullDimension/LocalRing.lean index f11c4cda4175ad..c64f6667b913b6 100644 --- a/Mathlib/RingTheory/KrullDimension/LocalRing.lean +++ b/Mathlib/RingTheory/KrullDimension/LocalRing.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jingting Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jingting Wang -/ -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.KrullDimension.Field -import Mathlib.RingTheory.KrullDimension.Zero +module + +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.KrullDimension.Field +public import Mathlib.RingTheory.KrullDimension.Zero /-! # The Krull dimension of a local ring @@ -13,6 +15,8 @@ import Mathlib.RingTheory.KrullDimension.Zero In this file, we proved some results about the Krull dimension of a local ring. -/ +@[expose] public section + lemma ringKrullDim_eq_one_iff_of_isLocalRing_isDomain {R : Type*} [CommRing R] [IsLocalRing R] [IsDomain R] : ringKrullDim R = 1 ↔ ¬ IsField R ∧ ∀ (x : R), x ≠ 0 → IsLocalRing.maximalIdeal R ≤ Ideal.radical (Ideal.span {x}) := by diff --git a/Mathlib/RingTheory/KrullDimension/Module.lean b/Mathlib/RingTheory/KrullDimension/Module.lean index c707e15add1476..05d9a5966d06e9 100644 --- a/Mathlib/RingTheory/KrullDimension/Module.lean +++ b/Mathlib/RingTheory/KrullDimension/Module.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ -import Mathlib.RingTheory.KrullDimension.NonZeroDivisors -import Mathlib.RingTheory.Spectrum.Prime.Module +module + +public import Mathlib.RingTheory.KrullDimension.NonZeroDivisors +public import Mathlib.RingTheory.Spectrum.Prime.Module /-! @@ -16,6 +18,8 @@ the krull dimension of its support. It is equal to the krull dimension of `R / A -/ +@[expose] public section + variable (R : Type*) [CommRing R] variable (M : Type*) [AddCommGroup M] [Module R M] (N : Type*) [AddCommGroup N] [Module R N] diff --git a/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean b/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean index 0c5b888745b353..22158de9422b0f 100644 --- a/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean +++ b/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.MinimalPrime.Localization -import Mathlib.RingTheory.KrullDimension.Basic -import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors -import Mathlib.RingTheory.PowerSeries.Basic -import Mathlib.RingTheory.Spectrum.Prime.RingHom +module + +public import Mathlib.RingTheory.Ideal.MinimalPrime.Localization +public import Mathlib.RingTheory.KrullDimension.Basic +public import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors +public import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.RingTheory.Spectrum.Prime.RingHom /-! @@ -20,6 +22,8 @@ import Mathlib.RingTheory.Spectrum.Prime.RingHom - `ringKrullDim_add_enatCard_le_ringKrullDim_mvPolynomial`: `dim R + #σ ≤ dim R[σ]`. -/ +@[expose] public section + open scoped nonZeroDivisors variable {R S : Type*} [CommRing R] [CommRing S] diff --git a/Mathlib/RingTheory/KrullDimension/PID.lean b/Mathlib/RingTheory/KrullDimension/PID.lean index 4be8248d1f73f0..f27f06f6ac2f49 100644 --- a/Mathlib/RingTheory/KrullDimension/PID.lean +++ b/Mathlib/RingTheory/KrullDimension/PID.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jingting Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jingting Wang -/ -import Mathlib.RingTheory.Ideal.Height -import Mathlib.RingTheory.KrullDimension.Zero -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.RingTheory.Ideal.Height +public import Mathlib.RingTheory.KrullDimension.Zero +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # The Krull dimension of a principal ideal domain @@ -13,6 +15,8 @@ import Mathlib.RingTheory.PrincipalIdealDomain In this file, we proved some results about the dimension of a principal ideal domain. -/ +@[expose] public section + instance IsPrincipalIdealRing.krullDimLE_one (R : Type*) [CommRing R] [IsPrincipalIdealRing R] : Ring.KrullDimLE 1 R := by refine Ring.krullDimLE_one_iff.2 fun I hI ↦ or_iff_not_imp_left.2 fun hI' ↦ ?_ diff --git a/Mathlib/RingTheory/KrullDimension/Polynomial.lean b/Mathlib/RingTheory/KrullDimension/Polynomial.lean index 82d798591b487a..b09193f366544f 100644 --- a/Mathlib/RingTheory/KrullDimension/Polynomial.lean +++ b/Mathlib/RingTheory/KrullDimension/Polynomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jingting Wang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jingting Wang -/ -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.RingTheory.KrullDimension.PID -import Mathlib.RingTheory.LocalRing.ResidueField.Fiber +module + +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.RingTheory.KrullDimension.PID +public import Mathlib.RingTheory.LocalRing.ResidueField.Fiber /-! # Krull dimension of polynomial ring @@ -18,6 +20,8 @@ This file proves properties of the krull dimension of the polynomial ring over a `R` is less than `2 * (ringKrullDim R) + 1`. -/ +@[expose] public section + theorem Polynomial.ringKrullDim_le {R : Type*} [CommRing R] : ringKrullDim (Polynomial R) ≤ 2 * (ringKrullDim R) + 1 := by rw [ringKrullDim, ringKrullDim] diff --git a/Mathlib/RingTheory/KrullDimension/Regular.lean b/Mathlib/RingTheory/KrullDimension/Regular.lean index 2487b38ccd9ba7..090de0930c7ef9 100644 --- a/Mathlib/RingTheory/KrullDimension/Regular.lean +++ b/Mathlib/RingTheory/KrullDimension/Regular.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan, Yongle Hu -/ -import Mathlib.RingTheory.Flat.TorsionFree -import Mathlib.RingTheory.KrullDimension.Module -import Mathlib.RingTheory.Regular.RegularSequence -import Mathlib.RingTheory.Spectrum.Prime.LTSeries +module + +public import Mathlib.RingTheory.Flat.TorsionFree +public import Mathlib.RingTheory.KrullDimension.Module +public import Mathlib.RingTheory.Regular.RegularSequence +public import Mathlib.RingTheory.Spectrum.Prime.LTSeries /-! @@ -19,6 +21,8 @@ import Mathlib.RingTheory.Spectrum.Prime.LTSeries `dim M/(r₁, …, rₙ)M + n = dim M`. -/ +@[expose] public section + namespace Module variable {R : Type*} [CommRing R] [IsNoetherianRing R] diff --git a/Mathlib/RingTheory/KrullDimension/Zero.lean b/Mathlib/RingTheory/KrullDimension/Zero.lean index 9cfb4b66464cdf..18575b6cecb444 100644 --- a/Mathlib/RingTheory/KrullDimension/Zero.lean +++ b/Mathlib/RingTheory/KrullDimension/Zero.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Jacobson.Ring -import Mathlib.RingTheory.Spectrum.Prime.Topology +module + +public import Mathlib.RingTheory.Jacobson.Ring +public import Mathlib.RingTheory.Spectrum.Prime.Topology /-! @@ -15,6 +17,8 @@ Basic definitions and lemmas are provided in `Mathlib/RingTheory/KrullDimension/ -/ +@[expose] public section + section CommSemiring variable {R : Type*} [CommSemiring R] [Ring.KrullDimLE 0 R] (I : Ideal R) diff --git a/Mathlib/RingTheory/Lasker.lean b/Mathlib/RingTheory/Lasker.lean index 55d8e72c78c6e8..a245c16560d289 100644 --- a/Mathlib/RingTheory/Lasker.lean +++ b/Mathlib/RingTheory/Lasker.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.Order.Irreducible -import Mathlib.RingTheory.Ideal.Colon -import Mathlib.RingTheory.Ideal.IsPrimary -import Mathlib.RingTheory.Noetherian.Defs +module + +public import Mathlib.Order.Irreducible +public import Mathlib.RingTheory.Ideal.Colon +public import Mathlib.RingTheory.Ideal.IsPrimary +public import Mathlib.RingTheory.Noetherian.Defs /-! # Lasker ring @@ -28,6 +30,8 @@ Also, one needs to prove that the radicals of minimal decompositions are indepen -/ +@[expose] public section + section IsLasker variable (R : Type*) [CommSemiring R] @@ -63,16 +67,8 @@ lemma isPrimary_decomposition_pairwise_ne_radical {I : Ideal R} classical refine ⟨(s.image (fun J ↦ {I ∈ s | I.radical = J.radical})).image fun t ↦ t.inf id, ?_, ?_, ?_⟩ - · rw [← hs] - refine le_antisymm ?_ ?_ <;> intro x hx - · simp only [Finset.inf_image, CompTriple.comp_eq, Submodule.mem_finsetInf, - Function.comp_apply, Finset.mem_filter, id_eq, and_imp] at hx ⊢ - intro J hJ - exact hx J hJ J hJ rfl - · simp only [Submodule.mem_finsetInf, id_eq, Finset.inf_image, CompTriple.comp_eq, - Function.comp_apply, Finset.mem_filter, and_imp] at hx ⊢ - intro J _ K hK _ - exact hx K hK + · ext + grind [Finset.inf_image, Submodule.mem_finsetInf] · simp only [Finset.mem_image, exists_exists_and_eq_and, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂] intro J hJ diff --git a/Mathlib/RingTheory/LaurentSeries.lean b/Mathlib/RingTheory/LaurentSeries.lean index 60143834bd2b65..dcbac3e4b80f86 100644 --- a/Mathlib/RingTheory/LaurentSeries.lean +++ b/Mathlib/RingTheory/LaurentSeries.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson, María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.Data.Int.Interval -import Mathlib.FieldTheory.RatFunc.AsPolynomial -import Mathlib.RingTheory.Binomial -import Mathlib.RingTheory.HahnSeries.PowerSeries -import Mathlib.RingTheory.HahnSeries.Summable -import Mathlib.RingTheory.PowerSeries.Inverse -import Mathlib.RingTheory.PowerSeries.Trunc -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.Topology.UniformSpace.DiscreteUniformity +module + +public import Mathlib.Data.Int.Interval +public import Mathlib.FieldTheory.RatFunc.AsPolynomial +public import Mathlib.RingTheory.Binomial +public import Mathlib.RingTheory.HahnSeries.PowerSeries +public import Mathlib.RingTheory.HahnSeries.Summable +public import Mathlib.RingTheory.PowerSeries.Inverse +public import Mathlib.RingTheory.PowerSeries.Trunc +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.Topology.UniformSpace.DiscreteUniformity /-! @@ -83,6 +85,8 @@ type with a zero. They are denoted `R⸨X⸩`. to `K⟦X⟧`. -/ + +@[expose] public section universe u open scoped PowerSeries @@ -380,12 +384,9 @@ theorem coe_X : ((X : RatFunc F) : F⸨X⸩) = single 1 1 := by theorem single_one_eq_pow {R : Type*} [Semiring R] (n : ℕ) : single (n : ℤ) (1 : R) = single (1 : ℤ) 1 ^ n := by - induction n with - | zero => simp - | succ n h_ind => - rw [← Int.ofNat_add_one_out, pow_succ', ← h_ind, HahnSeries.single_mul_single, one_mul, - add_comm] + simp +@[deprecated HahnSeries.inv_single (since := "2025-11-07")] theorem single_inv (d : ℤ) {α : F} (hα : α ≠ 0) : single (-d) (α⁻¹ : F) = (single (d : ℤ) (α : F))⁻¹ := by apply eq_inv_of_mul_eq_one_right @@ -396,7 +397,8 @@ theorem single_zpow (n : ℤ) : match n with | (n : ℕ) => apply single_one_eq_pow | -(n + 1 : ℕ) => - rw [← Nat.cast_one, ← inv_one, single_inv _ one_ne_zero, zpow_neg, ← Nat.cast_one, Nat.cast_one, + rw [← Nat.cast_one, ← inv_one, ← HahnSeries.inv_single, zpow_neg, + ← Nat.cast_one, Nat.cast_one, inv_inj, zpow_natCast, single_one_eq_pow, inv_one] theorem algebraMap_apply_div : diff --git a/Mathlib/RingTheory/Length.lean b/Mathlib/RingTheory/Length.lean index 89b13f3808b8d2..6b799444c79f4c 100644 --- a/Mathlib/RingTheory/Length.lean +++ b/Mathlib/RingTheory/Length.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Exact -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.Order.KrullDimension -import Mathlib.RingTheory.FiniteLength +module + +public import Mathlib.Algebra.Exact +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.Order.KrullDimension +public import Mathlib.RingTheory.FiniteLength /-! @@ -21,6 +23,8 @@ import Mathlib.RingTheory.FiniteLength -/ +@[expose] public section + variable (R M : Type*) [Ring R] [AddCommGroup M] [Module R M] /-- The length of a module, defined as the krull dimension of its submodule lattice. -/ diff --git a/Mathlib/RingTheory/LinearDisjoint.lean b/Mathlib/RingTheory/LinearDisjoint.lean index 443cc078926c9e..9e0d981776543d 100644 --- a/Mathlib/RingTheory/LinearDisjoint.lean +++ b/Mathlib/RingTheory/LinearDisjoint.lean @@ -3,18 +3,20 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Algebra.Subalgebra.MulOpposite -import Mathlib.Algebra.Algebra.Subalgebra.Rank -import Mathlib.Algebra.Polynomial.Basis -import Mathlib.LinearAlgebra.LinearDisjoint -import Mathlib.LinearAlgebra.TensorProduct.Subalgebra -import Mathlib.RingTheory.Adjoin.Dimension -import Mathlib.RingTheory.Algebraic.Basic -import Mathlib.RingTheory.IntegralClosure.Algebra.Defs -import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic -import Mathlib.RingTheory.Norm.Defs -import Mathlib.RingTheory.TensorProduct.Nontrivial -import Mathlib.RingTheory.Trace.Defs +module + +public import Mathlib.Algebra.Algebra.Subalgebra.MulOpposite +public import Mathlib.Algebra.Algebra.Subalgebra.Rank +public import Mathlib.Algebra.Polynomial.Basis +public import Mathlib.LinearAlgebra.LinearDisjoint +public import Mathlib.LinearAlgebra.TensorProduct.Subalgebra +public import Mathlib.RingTheory.Adjoin.Dimension +public import Mathlib.RingTheory.Algebraic.Basic +public import Mathlib.RingTheory.IntegralClosure.Algebra.Defs +public import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic +public import Mathlib.RingTheory.Norm.Defs +public import Mathlib.RingTheory.TensorProduct.Nontrivial +public import Mathlib.RingTheory.Trace.Defs /-! @@ -129,6 +131,8 @@ linearly disjoint, linearly independent, tensor product -/ +@[expose] public section + open Module open scoped TensorProduct diff --git a/Mathlib/RingTheory/LittleWedderburn.lean b/Mathlib/RingTheory/LittleWedderburn.lean index 387721620d7f37..f3375e4fea4a81 100644 --- a/Mathlib/RingTheory/LittleWedderburn.lean +++ b/Mathlib/RingTheory/LittleWedderburn.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Eric Rodriguez -/ -import Mathlib.Algebra.GroupWithZero.Action.Center -import Mathlib.GroupTheory.ClassEquation -import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval +module + +public import Mathlib.Algebra.GroupWithZero.Action.Center +public import Mathlib.GroupTheory.ClassEquation +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval /-! # Wedderburn's Little Theorem @@ -34,6 +36,8 @@ below proof is free, then the proof works nearly verbatim. -/ +@[expose] public section + open scoped Polynomial open Fintype diff --git a/Mathlib/RingTheory/LocalProperties/Basic.lean b/Mathlib/RingTheory/LocalProperties/Basic.lean index 14c8c18db4a623..98df94263c6e68 100644 --- a/Mathlib/RingTheory/LocalProperties/Basic.lean +++ b/Mathlib/RingTheory/LocalProperties/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Localization.Submodule -import Mathlib.RingTheory.LocalProperties.Submodule -import Mathlib.RingTheory.RingHomProperties +module + +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Localization.Submodule +public import Mathlib.RingTheory.LocalProperties.Submodule +public import Mathlib.RingTheory.RingHomProperties /-! # Local properties of commutative rings @@ -41,6 +43,8 @@ In this file, we define local properties in general. -/ +@[expose] public section + open scoped Pointwise universe u diff --git a/Mathlib/RingTheory/LocalProperties/Exactness.lean b/Mathlib/RingTheory/LocalProperties/Exactness.lean index 33065e4bd3736b..ef0bbbb225ccc0 100644 --- a/Mathlib/RingTheory/LocalProperties/Exactness.lean +++ b/Mathlib/RingTheory/LocalProperties/Exactness.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Sihan Su. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sihan Su, Yongle Hu, Yi Song -/ -import Mathlib.Algebra.Exact -import Mathlib.RingTheory.LocalProperties.Submodule -import Mathlib.RingTheory.Localization.Algebra -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.Algebra.Module.LocalizedModule.AtPrime -import Mathlib.Algebra.Module.LocalizedModule.Away +module + +public import Mathlib.Algebra.Exact +public import Mathlib.RingTheory.LocalProperties.Submodule +public import Mathlib.RingTheory.Localization.Algebra +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.Algebra.Module.LocalizedModule.AtPrime +public import Mathlib.Algebra.Module.LocalizedModule.Away /-! # Local properties about linear maps @@ -18,6 +20,8 @@ injectivity, surjectivity, bijectivity and exactness of linear maps are local pr More precisely, we show that these can be checked at maximal ideals and on standard covers. -/ +@[expose] public section + open Submodule LocalizedModule Ideal LinearMap section isLocalized_maximal diff --git a/Mathlib/RingTheory/LocalProperties/IntegrallyClosed.lean b/Mathlib/RingTheory/LocalProperties/IntegrallyClosed.lean index e084cc69370fcc..b51d2c0c65fb9e 100644 --- a/Mathlib/RingTheory/LocalProperties/IntegrallyClosed.lean +++ b/Mathlib/RingTheory/LocalProperties/IntegrallyClosed.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yongle Hu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongle Hu -/ -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Spectrum.Maximal.Localization +module + +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Spectrum.Maximal.Localization /-! # `IsIntegrallyClosed` is a local property @@ -18,6 +20,8 @@ In this file, we prove that `IsIntegrallyClosed` is a local property. if `Rₘ` is integral closed for any maximal ideal `m` of `R`. -/ +@[expose] public section + open scoped nonZeroDivisors open Localization Ideal IsLocalization diff --git a/Mathlib/RingTheory/LocalProperties/Projective.lean b/Mathlib/RingTheory/LocalProperties/Projective.lean index c02771f85b6c3e..cd84a35147b3ab 100644 --- a/Mathlib/RingTheory/LocalProperties/Projective.lean +++ b/Mathlib/RingTheory/LocalProperties/Projective.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, David Swinarski -/ -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.Algebra.Module.Projective -import Mathlib.LinearAlgebra.Dimension.Constructions -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.RingTheory.LocalProperties.Submodule +module + +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.Algebra.Module.Projective +public import Mathlib.LinearAlgebra.Dimension.Constructions +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.RingTheory.LocalProperties.Submodule /-! @@ -25,6 +27,8 @@ import Mathlib.RingTheory.LocalProperties.Submodule -/ +@[expose] public section + universe uM variable {R N N' : Type*} {M : Type uM} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] diff --git a/Mathlib/RingTheory/LocalProperties/Reduced.lean b/Mathlib/RingTheory/LocalProperties/Reduced.lean index be125e7a5e6ee2..5fded8504d6f08 100644 --- a/Mathlib/RingTheory/LocalProperties/Reduced.lean +++ b/Mathlib/RingTheory/LocalProperties/Reduced.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Nilpotent.Defs /-! # `IsReduced` is a local property @@ -20,6 +22,8 @@ Let `R` be a commutative ring, `M` be a submonoid of `R`. -/ +@[expose] public section + /-- `M⁻¹R` is reduced if `R` is reduced. -/ theorem isReduced_localizationPreserves : LocalizationPreserves fun R _ => IsReduced R := by introv R _ _ diff --git a/Mathlib/RingTheory/LocalProperties/Semilocal.lean b/Mathlib/RingTheory/LocalProperties/Semilocal.lean index e5c679ac8d3f2a..dcea00c88b88d2 100644 --- a/Mathlib/RingTheory/LocalProperties/Semilocal.lean +++ b/Mathlib/RingTheory/LocalProperties/Semilocal.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yiming Fu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yiming Fu -/ -import Mathlib.RingTheory.DedekindDomain.PID -import Mathlib.RingTheory.KrullDimension.PID +module + +public import Mathlib.RingTheory.DedekindDomain.PID +public import Mathlib.RingTheory.KrullDimension.PID /-! # Local properties for semilocal rings @@ -22,6 +24,8 @@ finitely many maximal ideals). integral domain `A` is a PID if its localization at every maximal ideal is a PID. -/ +@[expose] public section + section CommSemiring variable {R : Type*} [CommSemiring R] [Finite (MaximalSpectrum R)] diff --git a/Mathlib/RingTheory/LocalProperties/Submodule.lean b/Mathlib/RingTheory/LocalProperties/Submodule.lean index bdd55f1374a627..aa7ce543625272 100644 --- a/Mathlib/RingTheory/LocalProperties/Submodule.lean +++ b/Mathlib/RingTheory/LocalProperties/Submodule.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, David Swinarski -/ -import Mathlib.Algebra.Module.LocalizedModule.Submodule -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.Away.Basic +module + +public import Mathlib.Algebra.Module.LocalizedModule.Submodule +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.Away.Basic /-! # Local properties of modules and submodules @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Localization.Away.Basic In this file, we show that several conditions on submodules can be checked on stalks. -/ +@[expose] public section + open scoped nonZeroDivisors variable {R M M₁ : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/RingTheory/LocalRing/Basic.lean b/Mathlib/RingTheory/LocalRing/Basic.lean index 4230df2afea881..e5f63bbb1f1ecf 100644 --- a/Mathlib/RingTheory/LocalRing/Basic.lean +++ b/Mathlib/RingTheory/LocalRing/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.LocalRing.Defs -import Mathlib.RingTheory.Ideal.Nonunits +module + +public import Mathlib.RingTheory.LocalRing.Defs +public import Mathlib.RingTheory.Ideal.Nonunits /-! @@ -14,6 +16,8 @@ We prove basic properties of local rings. -/ +@[expose] public section + variable {R S : Type*} namespace IsLocalRing diff --git a/Mathlib/RingTheory/LocalRing/Defs.lean b/Mathlib/RingTheory/LocalRing/Defs.lean index ef1307a4b6747c..f3dc182208db41 100644 --- a/Mathlib/RingTheory/LocalRing/Defs.lean +++ b/Mathlib/RingTheory/LocalRing/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Algebra.Ring.Defs +module + +public import Mathlib.Algebra.Group.Units.Defs +public import Mathlib.Algebra.Ring.Defs /-! @@ -20,6 +22,8 @@ Define local rings as commutative rings having a unique maximal ideal. `IsLocalRing.of_unique_max_ideal` and `IsLocalRing.maximal_ideal_unique`. -/ + +@[expose] public section /-- A semiring is local if it is nontrivial and `a` or `b` is a unit whenever `a + b = 1`. Note that `IsLocalRing` is a predicate. -/ class IsLocalRing (R : Type*) [Semiring R] : Prop extends Nontrivial R where diff --git a/Mathlib/RingTheory/LocalRing/LocalSubring.lean b/Mathlib/RingTheory/LocalRing/LocalSubring.lean index e02776d437d0c1..7734a7df7d8955 100644 --- a/Mathlib/RingTheory/LocalRing/LocalSubring.lean +++ b/Mathlib/RingTheory/LocalRing/LocalSubring.lean @@ -3,19 +3,23 @@ Copyright (c) 2024 Andrew Yang, Yaël Dillies, Javier López-Contreras. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Yaël Dillies, Javier López-Contreras -/ -import Mathlib.Tactic.FieldSimp -import Mathlib.RingTheory.LocalRing.RingHom.Basic -import Mathlib.RingTheory.Localization.AtPrime.Basic +module + +public import Mathlib.Tactic.FieldSimp +public import Mathlib.RingTheory.LocalRing.RingHom.Basic +public import Mathlib.RingTheory.Localization.AtPrime.Basic /-! # Local subrings of fields -# Main result +## Main results - `LocalSubring` : The class of local subrings of a commutative ring. - `LocalSubring.ofPrime`: The localization of a subring as a `LocalSubring`. -/ +@[expose] public section + open IsLocalRing Set variable {R S : Type*} [CommRing R] [CommRing S] diff --git a/Mathlib/RingTheory/LocalRing/MaximalIdeal/Basic.lean b/Mathlib/RingTheory/LocalRing/MaximalIdeal/Basic.lean index 20721f960f0ddc..44aa0763bdef5e 100644 --- a/Mathlib/RingTheory/LocalRing/MaximalIdeal/Basic.lean +++ b/Mathlib/RingTheory/LocalRing/MaximalIdeal/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.Jacobson.Ideal -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Defs -import Mathlib.RingTheory.Spectrum.Maximal.Defs +module + +public import Mathlib.RingTheory.Jacobson.Ideal +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Defs +public import Mathlib.RingTheory.Spectrum.Maximal.Defs /-! @@ -15,6 +17,8 @@ We prove basic properties of the maximal ideal of a local ring. -/ +@[expose] public section + namespace IsLocalRing variable {R S K : Type*} diff --git a/Mathlib/RingTheory/LocalRing/MaximalIdeal/Defs.lean b/Mathlib/RingTheory/LocalRing/MaximalIdeal/Defs.lean index 07ffec4f04e26f..02c3f6eadec3d6 100644 --- a/Mathlib/RingTheory/LocalRing/MaximalIdeal/Defs.lean +++ b/Mathlib/RingTheory/LocalRing/MaximalIdeal/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.LocalRing.Basic +module + +public import Mathlib.RingTheory.LocalRing.Basic /-! @@ -18,6 +20,8 @@ We define the maximal ideal of a local ring as the ideal of all nonunits. -/ +@[expose] public section + namespace IsLocalRing variable (R : Type*) [CommSemiring R] [IsLocalRing R] diff --git a/Mathlib/RingTheory/LocalRing/Module.lean b/Mathlib/RingTheory/LocalRing/Module.lean index fe2c1385f9e348..36f7af644d23bc 100644 --- a/Mathlib/RingTheory/LocalRing/Module.lean +++ b/Mathlib/RingTheory/LocalRing/Module.lean @@ -3,17 +3,19 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Flat.EquationalCriterion -import Mathlib.RingTheory.Ideal.Quotient.ChineseRemainder -import Mathlib.RingTheory.LocalProperties.Exactness -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.Nakayama -import Mathlib.RingTheory.Support +module + +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Flat.EquationalCriterion +public import Mathlib.RingTheory.Ideal.Quotient.ChineseRemainder +public import Mathlib.RingTheory.LocalProperties.Exactness +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.Nakayama +public import Mathlib.RingTheory.Support /-! # Finite modules over local rings @@ -32,6 +34,8 @@ This file gathers various results about finite modules over a local ring `(R, `l` is a split injection if and only if `k ⊗ l` is a (split) injection. -/ +@[expose] public section + open Module universe u diff --git a/Mathlib/RingTheory/LocalRing/NonLocalRing.lean b/Mathlib/RingTheory/LocalRing/NonLocalRing.lean index a68ad3e578b45a..8d55042e878b5d 100644 --- a/Mathlib/RingTheory/LocalRing/NonLocalRing.lean +++ b/Mathlib/RingTheory/LocalRing/NonLocalRing.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Michal Staromiejski. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michal Staromiejski -/ -import Mathlib.Algebra.Ring.Pi -import Mathlib.Algebra.Ring.Prod -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.Spectrum.Maximal.Basic +module + +public import Mathlib.Algebra.Ring.Pi +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.Spectrum.Maximal.Basic /-! @@ -30,6 +32,8 @@ This file gathers some results about non-local rings. -/ +@[expose] public section + namespace IsLocalRing /-- If two non-units sum to 1 in a (semi)ring `R` then `R` is not local. -/ diff --git a/Mathlib/RingTheory/LocalRing/Quotient.lean b/Mathlib/RingTheory/LocalRing/Quotient.lean index 2c9c509fd36148..ad5f8ed50de815 100644 --- a/Mathlib/RingTheory/LocalRing/Quotient.lean +++ b/Mathlib/RingTheory/LocalRing/Quotient.lean @@ -3,16 +3,17 @@ Copyright (c) 2024 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Riccardo Brasca -/ - -import Mathlib.LinearAlgebra.Dimension.DivisionRing -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.RingTheory.Artinian.Ring -import Mathlib.RingTheory.Ideal.Over -import Mathlib.RingTheory.Ideal.Quotient.Index -import Mathlib.RingTheory.LocalRing.ResidueField.Defs -import Mathlib.RingTheory.LocalRing.RingHom.Basic -import Mathlib.RingTheory.Nakayama +module + +public import Mathlib.LinearAlgebra.Dimension.DivisionRing +public import Mathlib.LinearAlgebra.FreeModule.PID +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.RingTheory.Artinian.Ring +public import Mathlib.RingTheory.Ideal.Over +public import Mathlib.RingTheory.Ideal.Quotient.Index +public import Mathlib.RingTheory.LocalRing.ResidueField.Defs +public import Mathlib.RingTheory.LocalRing.RingHom.Basic +public import Mathlib.RingTheory.Nakayama /-! @@ -20,6 +21,8 @@ We gather results about the quotients of local rings. -/ +@[expose] public section + open Submodule FiniteDimensional Module variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] [IsLocalRing R] [Module.Finite R S] diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Basic.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Basic.lean index 3e4011017962c2..d50de9732a66ee 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Basic.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Ring.Action.End -import Mathlib.RingTheory.Finiteness.Cardinality -import Mathlib.RingTheory.LocalRing.ResidueField.Defs -import Mathlib.RingTheory.LocalRing.RingHom.Basic +module + +public import Mathlib.Algebra.Ring.Action.End +public import Mathlib.RingTheory.Finiteness.Cardinality +public import Mathlib.RingTheory.LocalRing.ResidueField.Defs +public import Mathlib.RingTheory.LocalRing.RingHom.Basic /-! @@ -16,6 +18,8 @@ We prove basic properties of the residue field of a local ring. -/ +@[expose] public section + variable {R S T : Type*} namespace IsLocalRing diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Defs.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Defs.lean index 96feec040ae8d0..97ec3689024df9 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Defs.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.RingTheory.Ideal.Quotient.Basic -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +module + +public import Mathlib.RingTheory.Ideal.Quotient.Basic +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic /-! @@ -16,6 +18,8 @@ import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic * `IsLocalRing.residue`: The quotient map from a local ring to its residue field. -/ +@[expose] public section + namespace IsLocalRing variable (R : Type*) [CommRing R] [IsLocalRing R] diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Fiber.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Fiber.lean index 7f95ccb5c1e0c2..b060f8d1873bb0 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Fiber.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Fiber.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Jingting Wang, Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jingting Wang, Junyan Xu -/ -import Mathlib.RingTheory.Spectrum.Prime.RingHom -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.TensorProduct.Quotient +module + +public import Mathlib.RingTheory.Spectrum.Prime.RingHom +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.TensorProduct.Quotient /-! # The fiber of a ring homomorphism at a prime ideal @@ -18,6 +20,8 @@ import Mathlib.RingTheory.TensorProduct.Quotient the prime spectrum of the tensor product of `S` and the residue field of `p`. -/ +@[expose] public section + open Algebra TensorProduct in /-- The `OrderIso` between fiber of a ring homomorphism `algebraMap R S : R →+* S` at a prime ideal `p : PrimeSpectrum R` and the prime spectrum of the tensor product of `S` and the residue field of diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean index ac98a38b6ab652..d1782b0808a4cd 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.FractionRing +module + +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.FractionRing /-! # The residue field of a prime ideal @@ -15,6 +17,8 @@ and provide an `IsFractionRing (R ⧸ I) I.ResidueField` instance. -/ +@[expose] public section + variable {R A} [CommRing R] [CommRing A] [Algebra R A] variable (I : Ideal R) [I.IsPrime] diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean index 84859cf20d0c81..b29b854e86ed93 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean @@ -3,11 +3,15 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.FieldTheory.Separable +module + +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.FieldTheory.Separable /-! # Instances on residue fields -/ +@[expose] public section + variable {R A B : Type*} [CommRing R] [CommRing A] [CommRing B] [Algebra R A] [Algebra A B] [Algebra R B] [IsScalarTower R A B] diff --git a/Mathlib/RingTheory/LocalRing/RingHom/Basic.lean b/Mathlib/RingTheory/LocalRing/RingHom/Basic.lean index 3b77ce726cf7cd..4ea3ab460d3cec 100644 --- a/Mathlib/RingTheory/LocalRing/RingHom/Basic.lean +++ b/Mathlib/RingTheory/LocalRing/RingHom/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ -import Mathlib.Algebra.Group.Units.Hom -import Mathlib.Data.ZMod.Basic -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.Algebra.Group.Units.Hom +public import Mathlib.Data.ZMod.Basic +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.Ideal.Maps /-! @@ -16,6 +18,8 @@ We prove basic properties of local rings homomorphisms. -/ +@[expose] public section + variable {R S T : Type*} section diff --git a/Mathlib/RingTheory/LocalRing/Subring.lean b/Mathlib/RingTheory/LocalRing/Subring.lean index 9e08329fed6991..71fa74728c3e55 100644 --- a/Mathlib/RingTheory/LocalRing/Subring.lean +++ b/Mathlib/RingTheory/LocalRing/Subring.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Michal Staromiejski. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michal Staromiejski -/ -import Mathlib.Algebra.Ring.Subsemiring.Basic -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.RingTheory.LocalRing.Defs +module + +public import Mathlib.Algebra.Ring.Subsemiring.Basic +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.RingTheory.LocalRing.Defs /-! # Subrings of local rings @@ -13,6 +15,8 @@ import Mathlib.RingTheory.LocalRing.Defs We prove basic properties of subrings of local rings. -/ +@[expose] public section + namespace IsLocalRing variable {R S} [Semiring R] [Semiring S] diff --git a/Mathlib/RingTheory/Localization/Algebra.lean b/Mathlib/RingTheory/Localization/Algebra.lean index 4a696b7607d080..0a237a4d305663 100644 --- a/Mathlib/RingTheory/Localization/Algebra.lean +++ b/Mathlib/RingTheory/Localization/Algebra.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Module.LocalizedModule.IsLocalization -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Localization.Basic -import Mathlib.RingTheory.Localization.Ideal -import Mathlib.RingTheory.PolynomialAlgebra +module + +public import Mathlib.Algebra.Module.LocalizedModule.IsLocalization +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.RingTheory.Localization.Ideal +public import Mathlib.RingTheory.PolynomialAlgebra /-! # Localization of algebra maps @@ -23,6 +25,8 @@ as the translation is currently tedious and can be unified easily after the loca -/ +@[expose] public section + variable {R S P : Type*} (Q : Type*) [CommSemiring R] [CommSemiring S] [CommSemiring P] [CommSemiring Q] {M : Submonoid R} {T : Submonoid P} diff --git a/Mathlib/RingTheory/Localization/AsSubring.lean b/Mathlib/RingTheory/Localization/AsSubring.lean index 858501d18c2f68..258a573b198546 100644 --- a/Mathlib/RingTheory/Localization/AsSubring.lean +++ b/Mathlib/RingTheory/Localization/AsSubring.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Junyan Xu -/ -import Mathlib.RingTheory.Localization.LocalizationLocalization -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.Algebra.Algebra.Subalgebra.Tower +module + +public import Mathlib.RingTheory.Localization.LocalizationLocalization +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.Algebra.Algebra.Subalgebra.Tower /-! @@ -17,6 +19,8 @@ as a subalgebra of the field `K` over `A`. -/ +@[expose] public section + namespace Localization diff --git a/Mathlib/RingTheory/Localization/AtPrime.lean b/Mathlib/RingTheory/Localization/AtPrime.lean index d5773a53e001d1..ef48389d9b664c 100644 --- a/Mathlib/RingTheory/Localization/AtPrime.lean +++ b/Mathlib/RingTheory/Localization/AtPrime.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Localization.AtPrime.Basic +module + +public import Mathlib.RingTheory.Localization.AtPrime.Basic deprecated_module (since := "2025-08-01") diff --git a/Mathlib/RingTheory/Localization/AtPrime/Basic.lean b/Mathlib/RingTheory/Localization/AtPrime/Basic.lean index e1ccc1f9c4f7a5..f1db5620ddb4cd 100644 --- a/Mathlib/RingTheory/Localization/AtPrime/Basic.lean +++ b/Mathlib/RingTheory/Localization/AtPrime/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.RingTheory.Ideal.Over -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.Localization.Basic -import Mathlib.RingTheory.Localization.Ideal -import Mathlib.RingTheory.Ideal.MinimalPrime.Basic +module + +public import Mathlib.RingTheory.Ideal.Over +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.RingTheory.Localization.Ideal +public import Mathlib.RingTheory.Ideal.MinimalPrime.Basic /-! # Localizations of commutative rings at the complement of a prime ideal @@ -32,6 +34,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] (S : Type*) [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] diff --git a/Mathlib/RingTheory/Localization/AtPrime/Extension.lean b/Mathlib/RingTheory/Localization/AtPrime/Extension.lean index 7e74c0140fcea8..7255f4da020629 100644 --- a/Mathlib/RingTheory/Localization/AtPrime/Extension.lean +++ b/Mathlib/RingTheory/Localization/AtPrime/Extension.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.RingTheory.DedekindDomain.Dvr +module + +public import Mathlib.RingTheory.DedekindDomain.Dvr /-! # Primes in an extension of localization at prime @@ -16,7 +18,7 @@ In this file, we study the relation between the (nonzero) prime ideals of `Sₚ` ideals of `S` above `p`. In particular, we prove that (under suitable conditions) they are in bijection. -# Main definitions and results +## Main definitions and results - `IsLocalization.AtPrime.mem_primesOver_of_isPrime`: The nonzero prime ideals of `Sₚ` are primes over the maximal ideal of `Rₚ`. @@ -26,6 +28,8 @@ bijection. -/ +@[expose] public section + open Algebra IsLocalRing Ideal Localization.AtPrime variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] (p : Ideal R) [p.IsPrime] diff --git a/Mathlib/RingTheory/Localization/Away/AdjoinRoot.lean b/Mathlib/RingTheory/Localization/Away/AdjoinRoot.lean index 87a5c14a868c04..8ae03982e7e121 100644 --- a/Mathlib/RingTheory/Localization/Away/AdjoinRoot.lean +++ b/Mathlib/RingTheory/Localization/Away/AdjoinRoot.lean @@ -3,14 +3,18 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.RingTheory.AdjoinRoot -import Mathlib.RingTheory.Localization.Away.Basic +module + +public import Mathlib.RingTheory.AdjoinRoot +public import Mathlib.RingTheory.Localization.Away.Basic /-! The `R`-`AlgEquiv` between the localization of `R` away from `r` and `R` with an inverse of `r` adjoined. -/ +@[expose] public section + open Polynomial AdjoinRoot Localization variable {R : Type*} [CommRing R] diff --git a/Mathlib/RingTheory/Localization/Away/Basic.lean b/Mathlib/RingTheory/Localization/Away/Basic.lean index c35c4fbd34e5ca..236d88c73a48be 100644 --- a/Mathlib/RingTheory/Localization/Away/Basic.lean +++ b/Mathlib/RingTheory/Localization/Away/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.GroupTheory.MonoidLocalization.Away -import Mathlib.Algebra.Algebra.Pi -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Localization.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity +module + +public import Mathlib.GroupTheory.MonoidLocalization.Away +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity /-! # Localizations away from an element @@ -28,6 +30,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + section CommSemiring diff --git a/Mathlib/RingTheory/Localization/Away/Lemmas.lean b/Mathlib/RingTheory/Localization/Away/Lemmas.lean index 5a4f868d8eadfa..70a7c32959e6a2 100644 --- a/Mathlib/RingTheory/Localization/Away/Lemmas.lean +++ b/Mathlib/RingTheory/Localization/Away/Lemmas.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.Localization.Submodule +module + +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.Localization.Submodule /-! # More lemmas on localization away @@ -13,6 +15,8 @@ This file contains lemmas on localization away from an element requiring more im -/ +@[expose] public section + variable {R : Type*} [CommRing R] namespace IsLocalization.Away diff --git a/Mathlib/RingTheory/Localization/BaseChange.lean b/Mathlib/RingTheory/Localization/BaseChange.lean index f3ce885aa6f8d9..6f74d364da7bad 100644 --- a/Mathlib/RingTheory/Localization/BaseChange.lean +++ b/Mathlib/RingTheory/Localization/BaseChange.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Jujian Zhang -/ -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.RingTheory.IsTensorProduct -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.Localization.Module +module + +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.Localization.Module /-! # Localized Module @@ -19,6 +21,8 @@ localize `M` by `S`. This gives us a `Localization S`-module. * `isLocalizedModule_iff_isBaseChange` : A localization of modules corresponds to a base change. -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] (S : Submonoid R) (A : Type*) [CommSemiring A] [Algebra R A] [IsLocalization S A] {M : Type*} [AddCommMonoid M] [Module R M] @@ -96,6 +100,21 @@ theorem tensorProduct_compatibleSMul : CompatibleSMul R A M₁ M₂ where simp_rw [algebraMap_smul, smul_tmul', ← smul_assoc, smul_tmul, ← smul_assoc, smul_mk'_self, algebraMap_smul, smul_tmul] +instance [Module (Localization S) M₁] [Module (Localization S) M₂] + [IsScalarTower R (Localization S) M₁] [IsScalarTower R (Localization S) M₂] : + CompatibleSMul R (Localization S) M₁ M₂ := + tensorProduct_compatibleSMul S .. + +instance (N N') [AddCommMonoid N] [Module R N] [AddCommMonoid N'] [Module R N'] (g : N →ₗ[R] N') + [IsLocalizedModule S f] [IsLocalizedModule S g] : + IsLocalizedModule S (TensorProduct.map f g) := by + let eM := IsLocalizedModule.linearEquiv S f (TensorProduct.mk R (Localization S) M 1) + let eN := IsLocalizedModule.linearEquiv S g (TensorProduct.mk R (Localization S) N 1) + convert IsLocalizedModule.of_linearEquiv S (TensorProduct.mk R (Localization S) (M ⊗[R] N) 1) <| + (AlgebraTensorModule.distribBaseChange R (Localization S) ..).restrictScalars R ≪≫ₗ + (congr eM eN ≪≫ₗ TensorProduct.equivOfCompatibleSMul ..).symm + ext; congrm(?_ ⊗ₜ ?_) <;> simp [LinearEquiv.eq_symm_apply, eM, eN] + /-- If `A` is a localization of `R`, tensoring two `A`-modules over `A` is the same as tensoring them over `R`. -/ noncomputable def moduleTensorEquiv : M₁ ⊗[A] M₂ ≃ₗ[A] M₁ ⊗[R] M₂ := diff --git a/Mathlib/RingTheory/Localization/Basic.lean b/Mathlib/RingTheory/Localization/Basic.lean index 2a0073809debbd..553ecae46f8182 100644 --- a/Mathlib/RingTheory/Localization/Basic.lean +++ b/Mathlib/RingTheory/Localization/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Field.IsField -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Data.Finite.Prod -import Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero -import Mathlib.RingTheory.Localization.Defs -import Mathlib.RingTheory.OreLocalization.Ring +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Field.IsField +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Data.Finite.Prod +public import Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.RingTheory.OreLocalization.Ring /-! # Localizations of commutative rings @@ -68,6 +70,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + assert_not_exists Ideal open Function @@ -122,16 +126,27 @@ protected lemma finite [Finite R] : Finite S := by simpa using IsLocalization.exists_mk'_eq M x exact .of_surjective _ this +section CompatibleSMul + +variable (N₁ N₂ : Type*) [AddCommMonoid N₁] [AddCommMonoid N₂] [Module R N₁] [Module R N₂] + variable (M S) in include M in -theorem linearMap_compatibleSMul (N₁ N₂) [AddCommMonoid N₁] [AddCommMonoid N₂] [Module R N₁] - [Module S N₁] [Module R N₂] [Module S N₂] [IsScalarTower R S N₁] [IsScalarTower R S N₂] : +theorem linearMap_compatibleSMul [Module S N₁] [Module S N₂] + [IsScalarTower R S N₁] [IsScalarTower R S N₂] : LinearMap.CompatibleSMul N₁ N₂ S R where map_smul f s s' := by obtain ⟨r, m, rfl⟩ := exists_mk'_eq M s rw [← (map_units S m).smul_left_cancel] simp_rw [algebraMap_smul, ← map_smul, ← smul_assoc, smul_mk'_self, algebraMap_smul, map_smul] +instance [Module (Localization M) N₁] [Module (Localization M) N₂] + [IsScalarTower R (Localization M) N₁] [IsScalarTower R (Localization M) N₂] : + LinearMap.CompatibleSMul N₁ N₂ (Localization M) R := + linearMap_compatibleSMul M .. + +end CompatibleSMul + variable {g : R →+* P} (hg : ∀ y : M, IsUnit (g y)) variable (M) in diff --git a/Mathlib/RingTheory/Localization/Cardinality.lean b/Mathlib/RingTheory/Localization/Cardinality.lean index 41bd47cd9c36a7..7741353b0f4564 100644 --- a/Mathlib/RingTheory/Localization/Cardinality.lean +++ b/Mathlib/RingTheory/Localization/Cardinality.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.GroupTheory.MonoidLocalization.Cardinality -import Mathlib.RingTheory.OreLocalization.Cardinality +module + +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.GroupTheory.MonoidLocalization.Cardinality +public import Mathlib.RingTheory.OreLocalization.Cardinality /-! # Cardinality of localizations @@ -23,6 +25,8 @@ submonoid, then your localization is trivial (see `IsLocalization.uniqueOfZeroMe -/ +@[expose] public section + open Cardinal nonZeroDivisors diff --git a/Mathlib/RingTheory/Localization/Defs.lean b/Mathlib/RingTheory/Localization/Defs.lean index ca350bdb0ba2ed..4957f82e4a38f2 100644 --- a/Mathlib/RingTheory/Localization/Defs.lean +++ b/Mathlib/RingTheory/Localization/Defs.lean @@ -3,14 +3,16 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.Algebra.BigOperators.Group.Finset.Defs -import Mathlib.Algebra.Regular.Basic -import Mathlib.Algebra.Ring.NonZeroDivisors -import Mathlib.Data.Fintype.Prod -import Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero -import Mathlib.RingTheory.OreLocalization.Ring -import Mathlib.Tactic.ApplyFun -import Mathlib.Tactic.Ring +module + +public import Mathlib.Algebra.BigOperators.Group.Finset.Defs +public import Mathlib.Algebra.Regular.Basic +public import Mathlib.Algebra.Ring.NonZeroDivisors +public import Mathlib.Data.Fintype.Prod +public import Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero +public import Mathlib.RingTheory.OreLocalization.Ring +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Tactic.Ring /-! # Localizations of commutative rings @@ -82,6 +84,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + assert_not_exists AlgHom Ideal open Function diff --git a/Mathlib/RingTheory/Localization/Finiteness.lean b/Mathlib/RingTheory/Localization/Finiteness.lean index 984d576665a5a2..efbcdce0678560 100644 --- a/Mathlib/RingTheory/Localization/Finiteness.lean +++ b/Mathlib/RingTheory/Localization/Finiteness.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Module.LocalizedModule.Int -import Mathlib.RingTheory.Localization.Algebra -import Mathlib.RingTheory.RingHom.Finite +module + +public import Mathlib.Algebra.Module.LocalizedModule.Int +public import Mathlib.RingTheory.Localization.Algebra +public import Mathlib.RingTheory.RingHom.Finite /-! @@ -25,6 +27,8 @@ In this file we establish behaviour of `Module.Finite` under localizations. -/ +@[expose] public section + universe u v w t namespace Module.Finite diff --git a/Mathlib/RingTheory/Localization/FractionRing.lean b/Mathlib/RingTheory/Localization/FractionRing.lean index 1f25f784ce4266..9d9f1b0300ca1d 100644 --- a/Mathlib/RingTheory/Localization/FractionRing.lean +++ b/Mathlib/RingTheory/Localization/FractionRing.lean @@ -3,13 +3,15 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.Algebra.Ring.Hom.InjSurj -import Mathlib.Algebra.Field.Equiv -import Mathlib.Algebra.Field.Subfield.Basic -import Mathlib.Algebra.Order.GroupWithZero.Submonoid -import Mathlib.Algebra.Order.Ring.Int -import Mathlib.RingTheory.Localization.Basic -import Mathlib.RingTheory.SimpleRing.Basic +module + +public import Mathlib.Algebra.Ring.Hom.InjSurj +public import Mathlib.Algebra.Field.Equiv +public import Mathlib.Algebra.Field.Subfield.Basic +public import Mathlib.Algebra.Order.GroupWithZero.Submonoid +public import Mathlib.Algebra.Order.Ring.Int +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.RingTheory.SimpleRing.Basic /-! # Fraction ring / fraction field Frac(R) as localization @@ -34,6 +36,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + assert_not_exists Ideal open nonZeroDivisors diff --git a/Mathlib/RingTheory/Localization/Free.lean b/Mathlib/RingTheory/Localization/Free.lean index 44fec9b0fe5332..8261fa4b13e092 100644 --- a/Mathlib/RingTheory/Localization/Free.lean +++ b/Mathlib/RingTheory/Localization/Free.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.RingTheory.Localization.Finiteness -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +module + +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.RingTheory.Localization.Finiteness +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition /-! # Free modules and localization @@ -23,6 +25,8 @@ import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -/ +@[expose] public section + variable {R M N N'} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] variable (S : Submonoid R) [AddCommGroup N'] [Module R N'] diff --git a/Mathlib/RingTheory/Localization/Ideal.lean b/Mathlib/RingTheory/Localization/Ideal.lean index fcb416477eee7a..4214b1c8e1dabd 100644 --- a/Mathlib/RingTheory/Localization/Ideal.lean +++ b/Mathlib/RingTheory/Localization/Ideal.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.GroupTheory.MonoidLocalization.Away -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Localization.Defs -import Mathlib.RingTheory.Spectrum.Prime.Defs -import Mathlib.Algebra.Algebra.Tower +module + +public import Mathlib.GroupTheory.MonoidLocalization.Away +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.RingTheory.Spectrum.Prime.Defs +public import Mathlib.Algebra.Algebra.Tower /-! # Ideals in localizations of commutative rings @@ -18,6 +20,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + namespace IsLocalization diff --git a/Mathlib/RingTheory/Localization/Integer.lean b/Mathlib/RingTheory/Localization/Integer.lean index 831e2565067269..ad2cbf8d4bb58e 100644 --- a/Mathlib/RingTheory/Localization/Integer.lean +++ b/Mathlib/RingTheory/Localization/Integer.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.Algebra.Group.Pointwise.Set.Scalar -import Mathlib.Algebra.Ring.Subsemiring.Basic -import Mathlib.RingTheory.Localization.Defs +module + +public import Mathlib.Algebra.Group.Pointwise.Set.Scalar +public import Mathlib.Algebra.Ring.Subsemiring.Basic +public import Mathlib.RingTheory.Localization.Defs /-! # Integer elements of a localization @@ -23,6 +25,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] diff --git a/Mathlib/RingTheory/Localization/Integral.lean b/Mathlib/RingTheory/Localization/Integral.lean index 2bf77bbf29bb97..6292f9fa106451 100644 --- a/Mathlib/RingTheory/Localization/Integral.lean +++ b/Mathlib/RingTheory/Localization/Integral.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.Polynomial.Lifts -import Mathlib.RingTheory.Algebraic.Integral -import Mathlib.RingTheory.IntegralClosure.Algebra.Basic -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Integer +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Algebra.Polynomial.Lifts +public import Mathlib.RingTheory.Algebraic.Integral +public import Mathlib.RingTheory.IntegralClosure.Algebra.Basic +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Integer /-! # Integral and algebraic elements of a fraction field @@ -22,6 +24,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S] variable [Algebra R S] @@ -57,7 +61,7 @@ alias coeffIntegerNormalization_of_not_mem_support := coeffIntegerNormalization_ theorem coeffIntegerNormalization_mem_support (p : S[X]) (i : ℕ) (h : coeffIntegerNormalization M p i ≠ 0) : i ∈ p.support := by contrapose h - rw [Ne, Classical.not_not, coeffIntegerNormalization, dif_neg h] + rw [coeffIntegerNormalization, dif_neg h] /-- `integerNormalization g` normalizes `g` to have integer coefficients by clearing the denominators -/ diff --git a/Mathlib/RingTheory/Localization/InvSubmonoid.lean b/Mathlib/RingTheory/Localization/InvSubmonoid.lean index ae86d17302eb6f..c6f2908a72881b 100644 --- a/Mathlib/RingTheory/Localization/InvSubmonoid.lean +++ b/Mathlib/RingTheory/Localization/InvSubmonoid.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.GroupTheory.Submonoid.Inverses -import Mathlib.RingTheory.FiniteType -import Mathlib.RingTheory.Localization.Defs +module + +public import Mathlib.GroupTheory.Submonoid.Inverses +public import Mathlib.RingTheory.FiniteType +public import Mathlib.RingTheory.Localization.Defs /-! # Submonoid of inverses @@ -24,6 +26,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S] variable [Algebra R S] diff --git a/Mathlib/RingTheory/Localization/LocalizationLocalization.lean b/Mathlib/RingTheory/Localization/LocalizationLocalization.lean index dd480dff6c5870..c62ec1f8515df5 100644 --- a/Mathlib/RingTheory/Localization/LocalizationLocalization.lean +++ b/Mathlib/RingTheory/Localization/LocalizationLocalization.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.Localization.Basic -import Mathlib.RingTheory.Localization.FractionRing +module + +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.RingTheory.Localization.FractionRing /-! # Localizations of localizations @@ -19,6 +21,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + open Function diff --git a/Mathlib/RingTheory/Localization/Module.lean b/Mathlib/RingTheory/Localization/Module.lean index ccdfce5ca79a2c..e1e53a83f110cf 100644 --- a/Mathlib/RingTheory/Localization/Module.lean +++ b/Mathlib/RingTheory/Localization/Module.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu, Anne Baanen -/ -import Mathlib.Algebra.Module.LocalizedModule.IsLocalization -import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Integer +module + +public import Mathlib.Algebra.Module.LocalizedModule.IsLocalization +public import Mathlib.LinearAlgebra.Basis.Basic +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Integer /-! # Modules / vector spaces over localizations / fraction fields @@ -24,6 +26,8 @@ This file contains some results about vector spaces over the field of fractions linear independent over `Frac(R)` -/ +@[expose] public section + open nonZeroDivisors diff --git a/Mathlib/RingTheory/Localization/NormTrace.lean b/Mathlib/RingTheory/Localization/NormTrace.lean index a341134b60cbb6..13d4442c9cce66 100644 --- a/Mathlib/RingTheory/Localization/NormTrace.lean +++ b/Mathlib/RingTheory/Localization/NormTrace.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Localization.Module -import Mathlib.RingTheory.Norm.Basic -import Mathlib.RingTheory.Discriminant +module + +public import Mathlib.RingTheory.Localization.Module +public import Mathlib.RingTheory.Norm.Basic +public import Mathlib.RingTheory.Discriminant /-! @@ -34,6 +36,8 @@ field norm, algebra norm, localization -/ +@[expose] public section + open Module open scoped nonZeroDivisors diff --git a/Mathlib/RingTheory/Localization/NumDen.lean b/Mathlib/RingTheory/Localization/NumDen.lean index 3c3260554d727d..d13f285d651e84 100644 --- a/Mathlib/RingTheory/Localization/NumDen.lean +++ b/Mathlib/RingTheory/Localization/NumDen.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Integer -import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid +module + +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Integer +public import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid /-! # Numerator and denominator in a localization @@ -19,6 +21,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + namespace IsFractionRing diff --git a/Mathlib/RingTheory/Localization/Pi.lean b/Mathlib/RingTheory/Localization/Pi.lean index 7bbe8e501c7be4..356dacc59775e1 100644 --- a/Mathlib/RingTheory/Localization/Pi.lean +++ b/Mathlib/RingTheory/Localization/Pi.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Madison Crim. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Madison Crim -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Algebra.BigOperators.Pi -import Mathlib.Algebra.Divisibility.Prod -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.RingTheory.Localization.Basic -import Mathlib.Algebra.Group.Pi.Units -import Mathlib.RingTheory.KrullDimension.Zero +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Algebra.BigOperators.Pi +public import Mathlib.Algebra.Divisibility.Prod +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.RingTheory.Localization.Basic +public import Mathlib.Algebra.Group.Pi.Units +public import Mathlib.RingTheory.KrullDimension.Zero /-! # Localizing a product of commutative rings @@ -29,6 +31,8 @@ See `Mathlib/RingTheory/Localization/Defs.lean` for a design overview. localization, commutative ring -/ +@[expose] public section + namespace IsLocalization variable {ι : Type*} (R S : ι → Type*) diff --git a/Mathlib/RingTheory/Localization/Submodule.lean b/Mathlib/RingTheory/Localization/Submodule.lean index 40ee0d6dd4a45c..6e4012dc0e1f30 100644 --- a/Mathlib/RingTheory/Localization/Submodule.lean +++ b/Mathlib/RingTheory/Localization/Submodule.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Ideal -import Mathlib.RingTheory.Noetherian.Defs -import Mathlib.RingTheory.EssentialFiniteness +module + +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Ideal +public import Mathlib.RingTheory.Noetherian.Defs +public import Mathlib.RingTheory.EssentialFiniteness /-! # Submodules in localizations of commutative rings @@ -20,6 +22,8 @@ localization, ring localization, commutative ring localization, characteristic p commutative ring, field of fractions -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] diff --git a/Mathlib/RingTheory/MatrixAlgebra.lean b/Mathlib/RingTheory/MatrixAlgebra.lean index e3b8780e1b671b..f66247af2debd4 100644 --- a/Mathlib/RingTheory/MatrixAlgebra.lean +++ b/Mathlib/RingTheory/MatrixAlgebra.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Eric Wieser -/ -import Mathlib.Algebra.Star.StarAlgHom -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.Composition -import Mathlib.LinearAlgebra.Matrix.Kronecker -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.Algebra.Star.StarAlgHom +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.Composition +public import Mathlib.LinearAlgebra.Matrix.Kronecker +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Algebra isomorphisms between tensor products and matrices @@ -20,6 +22,8 @@ import Mathlib.RingTheory.TensorProduct.Maps where the forward map is the (tensor-ified) Kronecker product. -/ +@[expose] public section + open TensorProduct Algebra.TensorProduct Matrix variable {l m n p : Type*} {R S A B M N : Type*} diff --git a/Mathlib/RingTheory/MatrixPolynomialAlgebra.lean b/Mathlib/RingTheory/MatrixPolynomialAlgebra.lean index eb13096bc88547..402355dd279199 100644 --- a/Mathlib/RingTheory/MatrixPolynomialAlgebra.lean +++ b/Mathlib/RingTheory/MatrixPolynomialAlgebra.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Data.Matrix.Basis -import Mathlib.Data.Matrix.Composition -import Mathlib.RingTheory.MatrixAlgebra -import Mathlib.RingTheory.PolynomialAlgebra +module + +public import Mathlib.Data.Matrix.Basis +public import Mathlib.Data.Matrix.Composition +public import Mathlib.RingTheory.MatrixAlgebra +public import Mathlib.RingTheory.PolynomialAlgebra /-! # Algebra isomorphism between matrices of polynomials and polynomials of matrices @@ -23,6 +25,8 @@ coeff (matPolyEquiv m) k i j = coeff (m i j) k We will use this algebra isomorphism to prove the Cayley-Hamilton theorem. -/ +@[expose] public section + universe u v w open Polynomial TensorProduct diff --git a/Mathlib/RingTheory/Morita/Basic.lean b/Mathlib/RingTheory/Morita/Basic.lean index a780af81b7546a..b53f4c59ecce2b 100644 --- a/Mathlib/RingTheory/Morita/Basic.lean +++ b/Mathlib/RingTheory/Morita/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Yunzhou Xie -/ -import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings -import Mathlib.CategoryTheory.Linear.LinearFunctor -import Mathlib.Algebra.Category.ModuleCat.Basic -import Mathlib.CategoryTheory.Adjunction.Limits +module + +public import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +public import Mathlib.CategoryTheory.Linear.LinearFunctor +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.CategoryTheory.Adjunction.Limits /-! # Morita equivalence @@ -15,7 +17,7 @@ Two `R`-algebras `A` and `B` are Morita equivalent if the categories of modules `B` are `R`-linearly equivalent. In this file, we prove that Morita equivalence is an equivalence relation and that isomorphic algebras are Morita equivalent. -# Main definitions +## Main definitions - `MoritaEquivalence R A B`: a structure containing an `R`-linear equivalence of categories between the module categories of `A` and `B`. @@ -40,6 +42,8 @@ Morita Equivalence, Category Theory, Noncommutative Ring, Module Theory -/ +@[expose] public section + universe u₀ u₁ u₂ u₃ open CategoryTheory diff --git a/Mathlib/RingTheory/Multiplicity.lean b/Mathlib/RingTheory/Multiplicity.lean index 74cdfe1e53c6e3..bfa176833d73e8 100644 --- a/Mathlib/RingTheory/Multiplicity.lean +++ b/Mathlib/RingTheory/Multiplicity.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Chris Hughes, Daniel Weber -/ -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Ring.Int.Defs -import Mathlib.Data.ENat.Basic -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Ring.Int.Defs +public import Mathlib.Data.ENat.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Multiplicity of a divisor @@ -25,6 +27,8 @@ several basic results on it. * `FiniteMultiplicity a b`: a predicate denoting that the multiplicity of `a` in `b` is finite. -/ +@[expose] public section + assert_not_exists Field variable {α β : Type*} diff --git a/Mathlib/RingTheory/MvPolynomial.lean b/Mathlib/RingTheory/MvPolynomial.lean index 08b047f638673d..bf4f00a040188a 100644 --- a/Mathlib/RingTheory/MvPolynomial.lean +++ b/Mathlib/RingTheory/MvPolynomial.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.LinearAlgebra.Dimension.Finite -import Mathlib.LinearAlgebra.Dimension.StrongRankCondition -import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition -import Mathlib.RingTheory.MvPolynomial.Basic +module + +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.LinearAlgebra.Dimension.Finite +public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition +public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition +public import Mathlib.RingTheory.MvPolynomial.Basic /-! # Multivariate polynomials over fields @@ -17,6 +19,8 @@ dimension of the space of multivariate polynomials over a field is equal to the finitely supported functions from the indexing set to `ℕ`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/MvPolynomial/Basic.lean b/Mathlib/RingTheory/MvPolynomial/Basic.lean index 5ba0d5f8ca684a..0d5921310af219 100644 --- a/Mathlib/RingTheory/MvPolynomial/Basic.lean +++ b/Mathlib/RingTheory/MvPolynomial/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.MvPolynomial.Degrees -import Mathlib.Data.DFinsupp.Small -import Mathlib.Data.Fintype.Pi -import Mathlib.LinearAlgebra.Finsupp.VectorSpace -import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.MvPolynomial.Degrees +public import Mathlib.Data.DFinsupp.Small +public import Mathlib.Data.Fintype.Pi +public import Mathlib.LinearAlgebra.Finsupp.VectorSpace +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic /-! # Multivariate polynomials over commutative rings @@ -35,6 +37,8 @@ that the monomials form a basis. Generalise to noncommutative (semi)rings -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/MvPolynomial/EulerIdentity.lean b/Mathlib/RingTheory/MvPolynomial/EulerIdentity.lean index 30c453aa65390a..26ef7b16e4bc6e 100644 --- a/Mathlib/RingTheory/MvPolynomial/EulerIdentity.lean +++ b/Mathlib/RingTheory/MvPolynomial/EulerIdentity.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.RingTheory.MvPolynomial.Homogeneous +module + +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.RingTheory.MvPolynomial.Homogeneous /-! # Euler's homogeneous identity @@ -18,6 +20,8 @@ import Mathlib.RingTheory.MvPolynomial.Homogeneous * `IsWeightedHomogeneous.sum_weight_X_mul_pderiv`: the weighted version of Euler's identity. -/ +@[expose] public section + namespace MvPolynomial open Finsupp diff --git a/Mathlib/RingTheory/MvPolynomial/FreeCommRing.lean b/Mathlib/RingTheory/MvPolynomial/FreeCommRing.lean index 211258d832b29e..fcc91272b0970f 100644 --- a/Mathlib/RingTheory/MvPolynomial/FreeCommRing.lean +++ b/Mathlib/RingTheory/MvPolynomial/FreeCommRing.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ +module -import Mathlib.RingTheory.FreeCommRing +public import Mathlib.RingTheory.FreeCommRing /-! @@ -23,6 +24,8 @@ formulas whose realization is a property of an `MvPolynomial` -/ +@[expose] public section + assert_not_exists Cardinal variable {ι κ R : Type*} diff --git a/Mathlib/RingTheory/MvPolynomial/Groebner.lean b/Mathlib/RingTheory/MvPolynomial/Groebner.lean index 044f5919ea71e2..fe246c4085c9ee 100644 --- a/Mathlib/RingTheory/MvPolynomial/Groebner.lean +++ b/Mathlib/RingTheory/MvPolynomial/Groebner.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Data.Finsupp.Lex -import Mathlib.Data.Finsupp.MonomialOrder -import Mathlib.Data.Finsupp.WellFounded -import Mathlib.Data.List.TFAE -import Mathlib.RingTheory.MvPolynomial.Homogeneous -import Mathlib.RingTheory.MvPolynomial.MonomialOrder +module + +public import Mathlib.Data.Finsupp.Lex +public import Mathlib.Data.Finsupp.MonomialOrder +public import Mathlib.Data.Finsupp.WellFounded +public import Mathlib.Data.List.TFAE +public import Mathlib.RingTheory.MvPolynomial.Homogeneous +public import Mathlib.RingTheory.MvPolynomial.MonomialOrder /-! # Division algorithm with respect to monomial orders @@ -44,6 +46,8 @@ The proof is done by induction, using two standard constructions -/ +@[expose] public section + namespace MonomialOrder open MvPolynomial diff --git a/Mathlib/RingTheory/MvPolynomial/Homogeneous.lean b/Mathlib/RingTheory/MvPolynomial/Homogeneous.lean index 109dc29f5b2e61..fa8792b005c8dc 100644 --- a/Mathlib/RingTheory/MvPolynomial/Homogeneous.lean +++ b/Mathlib/RingTheory/MvPolynomial/Homogeneous.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Eric Wieser -/ -import Mathlib.Algebra.DirectSum.Internal -import Mathlib.Algebra.GradedMonoid -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Algebra.MvPolynomial.Variables -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous -import Mathlib.SetTheory.Cardinal.Basic +module + +public import Mathlib.Algebra.DirectSum.Internal +public import Mathlib.Algebra.GradedMonoid +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Algebra.MvPolynomial.Variables +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous +public import Mathlib.SetTheory.Cardinal.Basic /-! # Homogeneous polynomials @@ -28,6 +30,8 @@ if all monomials occurring in `φ` have degree `n`. -/ +@[expose] public section + namespace MvPolynomial diff --git a/Mathlib/RingTheory/MvPolynomial/Ideal.lean b/Mathlib/RingTheory/MvPolynomial/Ideal.lean index de669fd310c465..20970f19b13bde 100644 --- a/Mathlib/RingTheory/MvPolynomial/Ideal.lean +++ b/Mathlib/RingTheory/MvPolynomial/Ideal.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Algebra.MonoidAlgebra.Ideal -import Mathlib.Algebra.MvPolynomial.Division +module + +public import Mathlib.Algebra.MonoidAlgebra.Ideal +public import Mathlib.Algebra.MvPolynomial.Division /-! # Lemmas about ideals of `MvPolynomial` @@ -17,6 +19,8 @@ Notably this contains results about monomial ideals. * `MvPolynomial.mem_ideal_span_X_image` -/ +@[expose] public section + variable {σ R : Type*} diff --git a/Mathlib/RingTheory/MvPolynomial/Localization.lean b/Mathlib/RingTheory/MvPolynomial/Localization.lean index b48d8320018bfd..1b032d2f852e46 100644 --- a/Mathlib/RingTheory/MvPolynomial/Localization.lean +++ b/Mathlib/RingTheory/MvPolynomial/Localization.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Module.LocalizedModule.IsLocalization -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.TensorProduct.MvPolynomial +module + +public import Mathlib.Algebra.Module.LocalizedModule.IsLocalization +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.TensorProduct.MvPolynomial /-! @@ -24,6 +26,8 @@ In this file we show some results connecting multivariate polynomial rings and l -/ +@[expose] public section + variable {σ R : Type*} [CommRing R] (M : Submonoid R) variable (S : Type*) [CommRing S] [Algebra R S] diff --git a/Mathlib/RingTheory/MvPolynomial/MonomialOrder.lean b/Mathlib/RingTheory/MvPolynomial/MonomialOrder.lean index 2b9c5dbd76e6f1..5a00c146513a6d 100644 --- a/Mathlib/RingTheory/MvPolynomial/MonomialOrder.lean +++ b/Mathlib/RingTheory/MvPolynomial/MonomialOrder.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.Data.Finsupp.Lex -import Mathlib.Data.Finsupp.MonomialOrder -import Mathlib.Data.Finsupp.WellFounded -import Mathlib.Data.List.TFAE -import Mathlib.RingTheory.MvPolynomial.Homogeneous -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.Data.Finsupp.Lex +public import Mathlib.Data.Finsupp.MonomialOrder +public import Mathlib.Data.Finsupp.WellFounded +public import Mathlib.Data.List.TFAE +public import Mathlib.RingTheory.MvPolynomial.Homogeneous +public import Mathlib.RingTheory.Nilpotent.Defs /-! # Degree and leading coefficient of polynomials with respect to a monomial order @@ -80,6 +82,8 @@ and a monomial order `m : MonomialOrder σ`. -/ +@[expose] public section + namespace MonomialOrder open MvPolynomial diff --git a/Mathlib/RingTheory/MvPolynomial/MonomialOrder/DegLex.lean b/Mathlib/RingTheory/MvPolynomial/MonomialOrder/DegLex.lean index 22baade1e5ae1a..a4262a91a5400b 100644 --- a/Mathlib/RingTheory/MvPolynomial/MonomialOrder/DegLex.lean +++ b/Mathlib/RingTheory/MvPolynomial/MonomialOrder/DegLex.lean @@ -3,11 +3,15 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ -import Mathlib.RingTheory.MvPolynomial.MonomialOrder -import Mathlib.Data.Finsupp.MonomialOrder.DegLex +module + +public import Mathlib.RingTheory.MvPolynomial.MonomialOrder +public import Mathlib.Data.Finsupp.MonomialOrder.DegLex /-! # Some lemmas about the degree lexicographic monomial order on multivariate polynomials -/ +@[expose] public section + namespace MvPolynomial open MonomialOrder Finsupp diff --git a/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean b/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean index 79283f22cd39d4..a35bf5769583c2 100644 --- a/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean +++ b/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Hanting Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hanting Zhang, Johan Commelin -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Combinatorics.Enumerative.Partition +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Combinatorics.Enumerative.Partition.Basic /-! # Symmetric Polynomials and Elementary Symmetric Polynomials @@ -53,6 +55,8 @@ As in other polynomial files, we typically use the notation: -/ +@[expose] public section + open Equiv (Perm) diff --git a/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean b/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean index 43926ee811294e..e0aac641976db0 100644 --- a/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean +++ b/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs -import Mathlib.RingTheory.MvPolynomial.Tower -import Mathlib.Data.Finsupp.Notation -import Mathlib.Data.Finsupp.WellFounded +module + +public import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs +public import Mathlib.RingTheory.MvPolynomial.Tower +public import Mathlib.Data.Finsupp.Notation +public import Mathlib.Data.Finsupp.WellFounded /-! # The Fundamental Theorem of Symmetric Polynomials @@ -50,6 +52,8 @@ injective whenever `n ≤ m`, and then transfer the results to any Fintype `σ`. -/ +@[expose] public section + variable {σ τ R : Type*} {n m k : ℕ} open AddMonoidAlgebra Finset diff --git a/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean b/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean index 63720f2db2f525..577fd53bf72c46 100644 --- a/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean +++ b/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Michael Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Lee -/ -import Mathlib.Algebra.Algebra.Subalgebra.Basic -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.MvPolynomial.Rename -import Mathlib.Data.Fintype.Basic -import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Basic +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.MvPolynomial.Rename +public import Mathlib.Data.Fintype.Basic +public import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs /-! # Newton's Identities @@ -39,6 +41,8 @@ terms). See [zeilberger1984] for the combinatorial proof of Newton's identities. -/ +@[expose] public section + open Equiv (Perm) open MvPolynomial diff --git a/Mathlib/RingTheory/MvPolynomial/Tower.lean b/Mathlib/RingTheory/MvPolynomial/Tower.lean index 624781773055a5..72c8644cb0473a 100644 --- a/Mathlib/RingTheory/MvPolynomial/Tower.lean +++ b/Mathlib/RingTheory/MvPolynomial/Tower.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Algebra.MvPolynomial.Eval +module + +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Algebra.MvPolynomial.Eval /-! # Algebra towers for multivariate polynomial @@ -18,6 +20,8 @@ When you update this file, you can also try to make a corresponding update in `RingTheory.Polynomial.Tower`. -/ +@[expose] public section + variable (R A B : Type*) {σ : Type*} diff --git a/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean b/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean index 045ac54e31b2d4..7750f4d3bbd3d0 100644 --- a/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean +++ b/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean @@ -3,13 +3,16 @@ Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Algebra.DirectSum.Decomposition -import Mathlib.Algebra.GradedMonoid -import Mathlib.Algebra.MvPolynomial.Basic -import Mathlib.Algebra.Order.Monoid.Canonical.Defs -import Mathlib.Data.Finsupp.Weight -import Mathlib.RingTheory.GradedAlgebra.Basic +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Algebra.DirectSum.Decomposition +public import Mathlib.Algebra.GradedMonoid +public import Mathlib.Algebra.MvPolynomial.Basic +public import Mathlib.Algebra.Order.Monoid.Canonical.Defs +public import Mathlib.Data.Finsupp.Weight +public import Mathlib.RingTheory.GradedAlgebra.Basic +public import Mathlib.Tactic.Order /-! # Weighted homogeneous polynomials @@ -43,6 +46,8 @@ occurring in `φ` have the same weighted degree `m`. components. -/ +@[expose] public section + noncomputable section @@ -528,8 +533,7 @@ theorem weightedDegree_eq_zero_iff [CanonicallyOrderedAdd M] · intro hx by_contra hx' exact absurd (hw _ _ (hx hx')) hx' - · intro hax _ - simp only [hax, zero_smul] + · order end OrderedAddCommMonoid diff --git a/Mathlib/RingTheory/MvPowerSeries/Basic.lean b/Mathlib/RingTheory/MvPowerSeries/Basic.lean index 3cc472c4d5019e..c219cc1ab2e13d 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Basic.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Basic.lean @@ -3,12 +3,13 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ +module -import Mathlib.Algebra.Order.Antidiag.Finsupp -import Mathlib.Data.Finsupp.Weight -import Mathlib.Tactic.Linarith -import Mathlib.LinearAlgebra.Pi -import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.Algebra.Order.Antidiag.Finsupp +public import Mathlib.Data.Finsupp.Weight +public import Mathlib.Tactic.Linarith +public import Mathlib.LinearAlgebra.Pi +public import Mathlib.Algebra.MvPolynomial.Eval /-! # Formal (multivariate) power series @@ -40,7 +41,7 @@ the coefficients of a `MvPowerSeries`, its constant coefficient - `MvPowerSeries.coeff_eq_zero_of_constantCoeff_nilpotent`: if the constant coefficient of a `MvPowerSeries` is nilpotent, then some coefficients of its powers are automatically zero -- `MvPowerSeries.map`: apply a `RingHom` to the coefficients of a `MvPowerSeries` (as a `RingHom) +- `MvPowerSeries.map`: apply a `RingHom` to the coefficients of a `MvPowerSeries` (as a `RingHom`). - `MvPowerSeries.X_pow_dvd_iff`, `MvPowerSeries.X_dvd_iff`: equivalent conditions for (a power of) an indeterminate to divide a `MvPowerSeries` @@ -73,6 +74,8 @@ it should not be hard to fill in the details. -/ +@[expose] public section + noncomputable section @@ -678,7 +681,7 @@ theorem coeff_pow [DecidableEq σ] (f : MvPowerSeries σ R) {n : ℕ} (d : σ rw [this, coeff_prod] rw [Finset.prod_const, card_range] -theorem monmial_pow (m : σ →₀ ℕ) (a : R) (n : ℕ) : +theorem monomial_pow (m : σ →₀ ℕ) (a : R) (n : ℕ) : (monomial m a) ^ n = monomial (n • m) (a ^ n) := by rw [Finset.pow_eq_prod_const, prod_monomial, ← Finset.nsmul_eq_sum_const, ← Finset.pow_eq_prod_const] diff --git a/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean b/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean index 48a680f345495c..3f4fcc5f7525da 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean @@ -3,15 +3,16 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ +module -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.MvPowerSeries.PiTopology -import Mathlib.RingTheory.MvPowerSeries.Trunc -import Mathlib.Topology.Algebra.Algebra -import Mathlib.Topology.Algebra.TopologicallyNilpotent -import Mathlib.Topology.Algebra.LinearTopology -import Mathlib.Topology.Algebra.UniformRing +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.MvPowerSeries.PiTopology +public import Mathlib.RingTheory.MvPowerSeries.Trunc +public import Mathlib.Topology.Algebra.Algebra +public import Mathlib.Topology.Algebra.TopologicallyNilpotent +public import Mathlib.Topology.Algebra.LinearTopology +public import Mathlib.Topology.Algebra.UniformRing /-! # Evaluation of multivariate power series @@ -41,6 +42,8 @@ Under `Continuous φ` and `HasEval a`, the following lemmas furnish the properti -/ +@[expose] public section + namespace MvPowerSeries open Topology diff --git a/Mathlib/RingTheory/MvPowerSeries/Inverse.lean b/Mathlib/RingTheory/MvPowerSeries/Inverse.lean index 26a3fabaa92971..c50c7d8a134e77 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Inverse.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Inverse.lean @@ -3,11 +3,12 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ +module -import Mathlib.Algebra.Group.Units.Basic -import Mathlib.RingTheory.MvPowerSeries.Basic -import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors -import Mathlib.RingTheory.LocalRing.Basic +public import Mathlib.Algebra.Group.Units.Basic +public import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors +public import Mathlib.RingTheory.LocalRing.Basic /-! # Formal (multivariate) power series - Inverses @@ -36,6 +37,8 @@ Instances are defined: -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean b/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean index d76906049ca0cb..1148d2f15b4878 100644 --- a/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean +++ b/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.RingTheory.MvPowerSeries.Basic -import Mathlib.Data.Finsupp.WellFounded +public import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.Data.Finsupp.WellFounded /-! LexOrder of multivariate power series @@ -16,6 +17,8 @@ the smallest exponent in the support. -/ +@[expose] public section + namespace MvPowerSeries variable {σ R : Type*} diff --git a/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean b/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean index ca26ad3848983d..42bd01b6e8a81e 100644 --- a/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean +++ b/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.Data.Finsupp.Interval -import Mathlib.RingTheory.Ideal.Quotient.Defs -import Mathlib.RingTheory.MvPowerSeries.PiTopology -import Mathlib.Topology.Algebra.LinearTopology -import Mathlib.RingTheory.TwoSidedIdeal.Operations +module + +public import Mathlib.Data.Finsupp.Interval +public import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.MvPowerSeries.PiTopology +public import Mathlib.Topology.Algebra.LinearTopology +public import Mathlib.RingTheory.TwoSidedIdeal.Operations /-! # Linear topology on the ring of multivariate power series @@ -37,6 +39,8 @@ To recover the ring case, it would remain to show that the isomorphism between -/ +@[expose] public section + namespace MvPowerSeries namespace LinearTopology diff --git a/Mathlib/RingTheory/MvPowerSeries/NoZeroDivisors.lean b/Mathlib/RingTheory/MvPowerSeries/NoZeroDivisors.lean index d5873315a0e8e5..9cc4086983e76d 100644 --- a/Mathlib/RingTheory/MvPowerSeries/NoZeroDivisors.lean +++ b/Mathlib/RingTheory/MvPowerSeries/NoZeroDivisors.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Data.Finsupp.WellFounded -import Mathlib.RingTheory.MvPowerSeries.LexOrder -import Mathlib.RingTheory.MvPowerSeries.Order +public import Mathlib.Data.Finsupp.WellFounded +public import Mathlib.RingTheory.MvPowerSeries.LexOrder +public import Mathlib.RingTheory.MvPowerSeries.Order /-! # ZeroDivisors in a MvPowerSeries ring @@ -34,6 +35,8 @@ The analogue of `Polynomial.notMem_nonZeroDivisors_iff` but not in general. See [Fields1971] -/ +@[expose] public section + noncomputable section open Finset (antidiagonal mem_antidiagonal) diff --git a/Mathlib/RingTheory/MvPowerSeries/Order.lean b/Mathlib/RingTheory/MvPowerSeries/Order.lean index 9219ce51c89bfa..917a26d2a70ca3 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Order.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Order.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos Fernandez. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ +module -import Mathlib.Data.ENat.Basic -import Mathlib.Data.Finsupp.Weight -import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.Data.ENat.Basic +public import Mathlib.Data.Finsupp.Weight +public import Mathlib.RingTheory.MvPowerSeries.Basic /-! # Order of multivariate power series @@ -114,6 +115,8 @@ TODO: Define a coercion to MvPolynomial. -/ +@[expose] public section + namespace MvPowerSeries noncomputable section diff --git a/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean b/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean index e8ac3891d1b8d3..7ba4b0826b3a6c 100644 --- a/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean +++ b/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean @@ -3,17 +3,19 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.RingTheory.MvPowerSeries.Basic -import Mathlib.RingTheory.MvPowerSeries.Order -import Mathlib.RingTheory.MvPowerSeries.Trunc -import Mathlib.RingTheory.Nilpotent.Defs -import Mathlib.Topology.Algebra.InfiniteSum.Constructions -import Mathlib.Topology.Algebra.Ring.Basic -import Mathlib.Topology.Instances.ENat -import Mathlib.Topology.UniformSpace.Pi -import Mathlib.Topology.Algebra.InfiniteSum.Ring -import Mathlib.Topology.Algebra.TopologicallyNilpotent -import Mathlib.Topology.Algebra.IsUniformGroup.Constructions +module + +public import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.RingTheory.MvPowerSeries.Order +public import Mathlib.RingTheory.MvPowerSeries.Trunc +public import Mathlib.RingTheory.Nilpotent.Defs +public import Mathlib.Topology.Algebra.InfiniteSum.Constructions +public import Mathlib.Topology.Algebra.Ring.Basic +public import Mathlib.Topology.Instances.ENat +public import Mathlib.Topology.UniformSpace.Pi +public import Mathlib.Topology.Algebra.InfiniteSum.Ring +public import Mathlib.Topology.Algebra.TopologicallyNilpotent +public import Mathlib.Topology.Algebra.IsUniformGroup.Constructions /-! # Product topology on multivariate power series @@ -77,6 +79,8 @@ But future contributors wishing to clean this up should feel free to give it a t -/ +@[expose] public section + namespace MvPowerSeries open Function Filter diff --git a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean index 9e944c5b2793bb..1005290f9e665c 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos Fernández -/ +module -import Mathlib.RingTheory.MvPowerSeries.Evaluation -import Mathlib.RingTheory.MvPowerSeries.LinearTopology -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.Topology.UniformSpace.DiscreteUniformity +public import Mathlib.RingTheory.MvPowerSeries.Evaluation +public import Mathlib.RingTheory.MvPowerSeries.LinearTopology +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.Topology.UniformSpace.DiscreteUniformity /-! # Substitutions in multivariate power series @@ -56,6 +57,8 @@ as it is discrete. the kernel of `algebraMap R S` is a nil ideal. -/ +@[expose] public section + namespace MvPowerSeries variable {σ : Type*} diff --git a/Mathlib/RingTheory/MvPowerSeries/Trunc.lean b/Mathlib/RingTheory/MvPowerSeries/Trunc.lean index 13980db387e1d2..eef96f0690cd73 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Trunc.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Trunc.lean @@ -3,10 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ +module -import Mathlib.RingTheory.MvPowerSeries.Basic -import Mathlib.Data.Finsupp.Interval -import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.Data.Finsupp.Interval +public import Mathlib.Algebra.MvPolynomial.Eval /-! @@ -49,6 +50,8 @@ import Mathlib.Algebra.MvPolynomial.Eval -/ +@[expose] public section + noncomputable section @@ -79,7 +82,7 @@ variable (R) in If `f : MvPowerSeries σ R` and `n : σ →₀ ℕ` is a (finitely-supported) function from `σ` to the naturals, then `trunc' R n f` is the multivariable power series obtained from `f` by keeping only the monomials $c\prod_i X_i^{a_i}$ where `a i ≤ n i` for all `i` -and $a i < n i` for some `i`. -/ +and `a i < n i` for some `i`. -/ def trunc : MvPowerSeries σ R →+ MvPolynomial σ R where toFun := truncFun n map_zero' := by diff --git a/Mathlib/RingTheory/Nakayama.lean b/Mathlib/RingTheory/Nakayama.lean index 72d95db28d93b0..4079c8d0325610 100644 --- a/Mathlib/RingTheory/Nakayama.lean +++ b/Mathlib/RingTheory/Nakayama.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Finiteness.Nakayama -import Mathlib.RingTheory.Jacobson.Ideal +module + +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Finiteness.Nakayama +public import Mathlib.RingTheory.Jacobson.Ideal /-! # Nakayama's lemma @@ -42,6 +44,8 @@ Note that a version of Statement (1) in Nakayama, Jacobson -/ +@[expose] public section + variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/RingTheory/Nilpotent/Basic.lean b/Mathlib/RingTheory/Nilpotent/Basic.lean index 9de3ec1d20adb8..20b4aac15a2779 100644 --- a/Mathlib/RingTheory/Nilpotent/Basic.lean +++ b/Mathlib/RingTheory/Nilpotent/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Algebra.GroupWithZero.Action.Defs -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.NoZeroSMulDivisors.Defs -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.Data.Nat.Lattice -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Algebra.GroupWithZero.Action.Defs +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.Algebra.NoZeroSMulDivisors.Defs +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.Data.Nat.Lattice +public import Mathlib.RingTheory.Nilpotent.Defs /-! # Nilpotent elements @@ -29,6 +31,8 @@ For the definition of `nilradical`, see `Mathlib/RingTheory/Nilpotent/Lemmas.lea -/ +@[expose] public section + universe u v open Function Set diff --git a/Mathlib/RingTheory/Nilpotent/Defs.lean b/Mathlib/RingTheory/Nilpotent/Defs.lean index 4d335741e1d85d..1dbc4e9b398dc8 100644 --- a/Mathlib/RingTheory/Nilpotent/Defs.lean +++ b/Mathlib/RingTheory/Nilpotent/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.Algebra.GroupWithZero.Hom -import Mathlib.Algebra.GroupWithZero.Units.Basic -import Mathlib.Algebra.Ring.Defs -import Mathlib.Data.Nat.Lattice +module + +public import Mathlib.Algebra.GroupWithZero.Hom +public import Mathlib.Algebra.GroupWithZero.Units.Basic +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.Data.Nat.Lattice /-! # Definition of nilpotent elements @@ -24,6 +26,8 @@ and `Mathlib/RingTheory/Nilpotent/Lemmas.lean`. -/ +@[expose] public section + universe u v open Function Set @@ -216,6 +220,10 @@ theorem isReduced_of_injective [MonoidWithZero R] [MonoidWithZero S] {F : Type*} rw [map_zero] exact (hx.map f).eq_zero +lemma exists_isNilpotent_of_not_isReduced {R : Type*} [Zero R] [Pow R ℕ] (h : ¬IsReduced R) : + ∃ x : R, x ≠ 0 ∧ IsNilpotent x := by + rw [isReduced_iff, not_forall] at h; tauto + instance (ι) (R : ι → Type*) [∀ i, Zero (R i)] [∀ i, Pow (R i) ℕ] [∀ i, IsReduced (R i)] : IsReduced (∀ i, R i) where eq_zero _ := fun ⟨n, hn⟩ ↦ funext fun i ↦ IsReduced.eq_zero _ ⟨n, congr_fun hn i⟩ diff --git a/Mathlib/RingTheory/Nilpotent/Exp.lean b/Mathlib/RingTheory/Nilpotent/Exp.lean index c32f39246f12e0..fb22a92fc94708 100644 --- a/Mathlib/RingTheory/Nilpotent/Exp.lean +++ b/Mathlib/RingTheory/Nilpotent/Exp.lean @@ -3,16 +3,18 @@ Copyright (c) 2025 Janos Wolosz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Janos Wolosz -/ -import Mathlib.Algebra.Algebra.Basic -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Algebra.BigOperators.GroupWithZero.Action -import Mathlib.Algebra.Module.BigOperators -import Mathlib.Algebra.Module.Rat -import Mathlib.Data.Nat.Cast.Field -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.RingTheory.TensorProduct.Maps -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Algebra.BigOperators.GroupWithZero.Action +public import Mathlib.Algebra.Module.BigOperators +public import Mathlib.Algebra.Module.Rat +public import Mathlib.Data.Nat.Cast.Field +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.RingTheory.TensorProduct.Maps +public import Mathlib.Tactic.FieldSimp /-! # Exponential map on algebras @@ -39,6 +41,8 @@ over a characteristic zero field. algebra, exponential map, nilpotent -/ +@[expose] public section + namespace IsNilpotent variable {A : Type*} [Ring A] [Module ℚ A] diff --git a/Mathlib/RingTheory/Nilpotent/GeometricallyReduced.lean b/Mathlib/RingTheory/Nilpotent/GeometricallyReduced.lean new file mode 100644 index 00000000000000..43b39a01294475 --- /dev/null +++ b/Mathlib/RingTheory/Nilpotent/GeometricallyReduced.lean @@ -0,0 +1,78 @@ +/- +Copyright (c) 2025 Dion Leijnse. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Dion Leijnse +-/ +module + +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.RingTheory.Flat.Basic + +/-! +# Geometrically reduced algebras + +In this file we introduce geometrically reduced algebras. +For a field `k`, we say that a `k`-algebra `A` is geometrically reduced (`IsGeometricallyReduced`) +if the tensor product `AlgebraicClosure k ⊗[k] A` is reduced. + +## Main results +- `IsGeometricallyReduced.of_forall_fg`: for a field `k` and a commutative `k`-algebra `A`, if all + finitely generated subalgebras `B` of `A` are geometrically reduced, then `A` is geometrically + reduced. + +## References +- See [https://stacks.math.columbia.edu/tag/05DS] for some theory of geometrically reduced algebras. + Note that their definition differs from the one here, we still need a proof that these are + equivalent (see TODO). + +## TODO +- Prove that if `A` is a geometrically reduced `k`-algebra, then for every field extension `K` of + `k` the `K`-algebra `K ⊗[k] A` is reduced. + +-/ + +@[expose] public section + +open TensorProduct + +noncomputable section + +namespace Algebra + +variable {k A : Type*} [Field k] [Ring A] [Algebra k A] + +/-- The `k`-algebra `A` is geometrically reduced iff its base change to `AlgebraicClosure k` is + reduced. -/ +@[mk_iff] +class IsGeometricallyReduced (k A : Type*) [Field k] [Ring A] [Algebra k A] : Prop where + isReduced_algebraicClosure_tensorProduct : IsReduced (AlgebraicClosure k ⊗[k] A) + +attribute [instance] IsGeometricallyReduced.isReduced_algebraicClosure_tensorProduct + +instance (k A K : Type*) [Field k] [Ring A] [Algebra k A] [Field K] [Algebra k K] + [Algebra.IsAlgebraic k K] [IsGeometricallyReduced k A] : IsReduced (K ⊗[k] A) := + isReduced_of_injective + (Algebra.TensorProduct.map ((IsAlgClosed.lift : K →ₐ[k] AlgebraicClosure k)) 1) + (Module.Flat.rTensor_preserves_injective_linearMap _ (RingHom.injective _)) + +lemma IsGeometricallyReduced.of_injective {B : Type*} [Ring B] [Algebra k B] (f : A →ₐ[k] B) + (hf : Function.Injective f) [IsGeometricallyReduced k B] : IsGeometricallyReduced k A := + ⟨isReduced_of_injective (Algebra.TensorProduct.map 1 f) + (Module.Flat.lTensor_preserves_injective_linearMap _ hf)⟩ + +variable (k) in +theorem isReduced_of_isGeometricallyReduced [IsGeometricallyReduced k A] : IsReduced A := + isReduced_of_injective + (Algebra.TensorProduct.includeRight : A →ₐ[k] (AlgebraicClosure k) ⊗[k] A) + (Algebra.TensorProduct.includeRight_injective <| FaithfulSMul.algebraMap_injective _ _) + +/-- If all finitely generated subalgebras of `A` are geometrically reduced, then `A` is + geometrically reduced. -/ +@[stacks 030T] +theorem IsGeometricallyReduced.of_forall_fg + (h : ∀ B : Subalgebra k A, B.FG → IsGeometricallyReduced k B) : + IsGeometricallyReduced k A := by + simp_rw [isGeometricallyReduced_iff] at h + exact ⟨IsReduced.tensorProduct_of_flat_of_forall_fg h⟩ + +end Algebra diff --git a/Mathlib/RingTheory/Nilpotent/Lemmas.lean b/Mathlib/RingTheory/Nilpotent/Lemmas.lean index 893f750556c120..b2e8589e7f3acd 100644 --- a/Mathlib/RingTheory/Nilpotent/Lemmas.lean +++ b/Mathlib/RingTheory/Nilpotent/Lemmas.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ -import Mathlib.LinearAlgebra.Matrix.ToLin -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Nilpotent.Defs +module + +public import Mathlib.LinearAlgebra.Matrix.ToLin +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Nilpotent.Defs /-! # Nilpotent elements @@ -14,6 +16,8 @@ import Mathlib.RingTheory.Nilpotent.Defs This file contains results about nilpotent elements that involve ring theory. -/ +@[expose] public section + assert_not_exists Cardinal universe u v diff --git a/Mathlib/RingTheory/NoetherNormalization.lean b/Mathlib/RingTheory/NoetherNormalization.lean index f8102a82c7208e..792bad87e0ce49 100644 --- a/Mathlib/RingTheory/NoetherNormalization.lean +++ b/Mathlib/RingTheory/NoetherNormalization.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Sihan Su. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Sihan Su, Wan Lin, Xiaoyang Su -/ -import Mathlib.Algebra.MvPolynomial.Monad -import Mathlib.Data.List.Indexes -import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Monad +public import Mathlib.Data.List.Indexes +public import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic /-! # Noether normalization lemma This file contains a proof by Nagata of the Noether normalization lemma. @@ -48,6 +50,8 @@ Composing `φ` and `g` we get the desired map since both `φ` and `g` are inject ## TODO * In the final theorems, consider setting `s` equal to the Krull dimension of `R`. -/ + +@[expose] public section open Polynomial MvPolynomial Ideal BigOperators Nat RingHom List variable {k : Type*} [Field k] {n : ℕ} (f : MvPolynomial (Fin (n + 1)) k) diff --git a/Mathlib/RingTheory/Noetherian/Basic.lean b/Mathlib/RingTheory/Noetherian/Basic.lean index 710c423cc1215f..176abaa4570a76 100644 --- a/Mathlib/RingTheory/Noetherian/Basic.lean +++ b/Mathlib/RingTheory/Noetherian/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ -import Mathlib.Algebra.Order.SuccPred.PartialSups -import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.RingTheory.Noetherian.Defs -import Mathlib.RingTheory.Finiteness.Cardinality -import Mathlib.RingTheory.Finiteness.Finsupp -import Mathlib.RingTheory.Ideal.Prod +module + +public import Mathlib.Algebra.Order.SuccPred.PartialSups +public import Mathlib.LinearAlgebra.Quotient.Basic +public import Mathlib.RingTheory.Noetherian.Defs +public import Mathlib.RingTheory.Finiteness.Cardinality +public import Mathlib.RingTheory.Finiteness.Finsupp +public import Mathlib.RingTheory.Ideal.Prod /-! # Noetherian rings and modules @@ -51,6 +53,8 @@ Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noe -/ +@[expose] public section + assert_not_exists Matrix open Set Pointwise diff --git a/Mathlib/RingTheory/Noetherian/Defs.lean b/Mathlib/RingTheory/Noetherian/Defs.lean index 9c834575bd84d2..a760abb1ed8606 100644 --- a/Mathlib/RingTheory/Noetherian/Defs.lean +++ b/Mathlib/RingTheory/Noetherian/Defs.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ -import Mathlib.Order.Filter.AtTopBot.Basic -import Mathlib.RingTheory.Finiteness.Basic +module + +public import Mathlib.Order.Filter.AtTopBot.Basic +public import Mathlib.RingTheory.Finiteness.Basic /-! # Noetherian rings and modules @@ -47,6 +49,8 @@ Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noe -/ +@[expose] public section + assert_not_exists Finsupp.linearCombination Matrix Pi.basis open Set Pointwise diff --git a/Mathlib/RingTheory/Noetherian/Filter.lean b/Mathlib/RingTheory/Noetherian/Filter.lean index 95540b392f9d39..5cd81e4a596f2b 100644 --- a/Mathlib/RingTheory/Noetherian/Filter.lean +++ b/Mathlib/RingTheory/Noetherian/Filter.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ -import Mathlib.Order.Filter.EventuallyConst -import Mathlib.RingTheory.Noetherian.Defs +module + +public import Mathlib.Order.Filter.EventuallyConst +public import Mathlib.RingTheory.Noetherian.Defs /-! # Noetherian modules and finiteness of chains @@ -27,6 +29,8 @@ Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noe -/ +@[expose] public section + open Set Filter Pointwise diff --git a/Mathlib/RingTheory/Noetherian/Nilpotent.lean b/Mathlib/RingTheory/Noetherian/Nilpotent.lean index 59b27c6afab0fb..aed77030b44bb4 100644 --- a/Mathlib/RingTheory/Noetherian/Nilpotent.lean +++ b/Mathlib/RingTheory/Noetherian/Nilpotent.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Finiteness.Ideal -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.RingTheory.Noetherian.Defs +module + +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.RingTheory.Noetherian.Defs /-! # Nilpotent ideals in Noetherian rings @@ -16,6 +18,8 @@ import Mathlib.RingTheory.Noetherian.Defs * `IsNoetherianRing.isNilpotent_nilradical` -/ +@[expose] public section + open IsNoetherian theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommSemiring R] [IsNoetherianRing R] : diff --git a/Mathlib/RingTheory/Noetherian/OfPrime.lean b/Mathlib/RingTheory/Noetherian/OfPrime.lean index ae33058650650d..88b9b4556bd9ba 100644 --- a/Mathlib/RingTheory/Noetherian/OfPrime.lean +++ b/Mathlib/RingTheory/Noetherian/OfPrime.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Anthony Fernandes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anthony Fernandes, Marc Robin -/ -import Mathlib.RingTheory.Ideal.Oka -import Mathlib.RingTheory.Noetherian.Defs -import Mathlib.RingTheory.Ideal.BigOperators +module + +public import Mathlib.RingTheory.Ideal.Oka +public import Mathlib.RingTheory.Noetherian.Defs +public import Mathlib.RingTheory.Ideal.BigOperators /-! # Noetherian rings and prime ideals @@ -20,6 +22,8 @@ import Mathlib.RingTheory.Ideal.BigOperators - [cohen1950]: *Commutative rings with restricted minimum condition*, I. S. Cohen, Theorem 2 -/ +@[expose] public section + variable {R : Type*} [CommRing R] namespace Ideal diff --git a/Mathlib/RingTheory/Noetherian/Orzech.lean b/Mathlib/RingTheory/Noetherian/Orzech.lean index e70d76bde5a579..ed2d8f1243cb19 100644 --- a/Mathlib/RingTheory/Noetherian/Orzech.lean +++ b/Mathlib/RingTheory/Noetherian/Orzech.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ -import Mathlib.Algebra.Module.Submodule.IterateMapComap -import Mathlib.Order.PartialSups -import Mathlib.RingTheory.Noetherian.Basic -import Mathlib.RingTheory.OrzechProperty +module + +public import Mathlib.Algebra.Module.Submodule.IterateMapComap +public import Mathlib.Order.PartialSups +public import Mathlib.RingTheory.Noetherian.Basic +public import Mathlib.RingTheory.OrzechProperty /-! # Noetherian rings have the Orzech property @@ -19,6 +21,8 @@ import Mathlib.RingTheory.OrzechProperty * `IsNoetherianRing.orzechProperty`: Any Noetherian ring satisfies the Orzech property. -/ +@[expose] public section + open Set Filter Pointwise diff --git a/Mathlib/RingTheory/Noetherian/UniqueFactorizationDomain.lean b/Mathlib/RingTheory/Noetherian/UniqueFactorizationDomain.lean index b4751612885123..5658814586d466 100644 --- a/Mathlib/RingTheory/Noetherian/UniqueFactorizationDomain.lean +++ b/Mathlib/RingTheory/Noetherian/UniqueFactorizationDomain.lean @@ -3,16 +3,20 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.RingTheory.Noetherian.Defs -import Mathlib.RingTheory.UniqueFactorizationDomain.Ideal +module + +public import Mathlib.RingTheory.Noetherian.Defs +public import Mathlib.RingTheory.UniqueFactorizationDomain.Ideal /-! # Noetherian domains have unique factorization ## Main results -# IsNoetherianRing.wfDvdMonoid +- IsNoetherianRing.wfDvdMonoid -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] [IsDomain R] -- see Note [lower instance priority] diff --git a/Mathlib/RingTheory/NonUnitalSubring/Basic.lean b/Mathlib/RingTheory/NonUnitalSubring/Basic.lean index ced145d84dbfa1..f9ae44ddc61270 100644 --- a/Mathlib/RingTheory/NonUnitalSubring/Basic.lean +++ b/Mathlib/RingTheory/NonUnitalSubring/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Group.Subgroup.Basic -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.GroupTheory.Subsemigroup.Center -import Mathlib.RingTheory.NonUnitalSubring.Defs -import Mathlib.RingTheory.NonUnitalSubsemiring.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Basic +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.GroupTheory.Subsemigroup.Center +public import Mathlib.RingTheory.NonUnitalSubring.Defs +public import Mathlib.RingTheory.NonUnitalSubsemiring.Basic /-! # `NonUnitalSubring`s @@ -63,6 +65,8 @@ Lattice inclusion (e.g. `≤` and `⊓`) is used rather than set notation (`⊆` non-unital subring -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/NonUnitalSubring/Defs.lean b/Mathlib/RingTheory/NonUnitalSubring/Defs.lean index 146a95997a7b25..d0c027e387cfaa 100644 --- a/Mathlib/RingTheory/NonUnitalSubring/Defs.lean +++ b/Mathlib/RingTheory/NonUnitalSubring/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Group.Subgroup.Defs -import Mathlib.RingTheory.NonUnitalSubsemiring.Defs -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Group.Subgroup.Defs +public import Mathlib.RingTheory.NonUnitalSubsemiring.Defs +public import Mathlib.Tactic.FastInstance /-! # `NonUnitalSubring`s @@ -35,6 +37,8 @@ Lattice inclusion (e.g. `≤` and `⊓`) is used rather than set notation (`⊆` non-unital subring -/ +@[expose] public section + assert_not_exists RelIso universe u v w diff --git a/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean b/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean index af52f4e8ef5902..d5715c7d5bafd3 100644 --- a/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean +++ b/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean @@ -3,19 +3,21 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Group.Submonoid.Membership -import Mathlib.Algebra.Group.Subsemigroup.Membership -import Mathlib.Algebra.Group.Subsemigroup.Operations -import Mathlib.Algebra.GroupWithZero.Center -import Mathlib.Algebra.Ring.Center -import Mathlib.Algebra.Ring.Centralizer -import Mathlib.Algebra.Ring.Opposite -import Mathlib.Algebra.Ring.Prod -import Mathlib.Algebra.Ring.Submonoid.Basic -import Mathlib.Data.Set.Finite.Range -import Mathlib.GroupTheory.Submonoid.Center -import Mathlib.GroupTheory.Subsemigroup.Centralizer -import Mathlib.RingTheory.NonUnitalSubsemiring.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.Membership +public import Mathlib.Algebra.Group.Subsemigroup.Membership +public import Mathlib.Algebra.Group.Subsemigroup.Operations +public import Mathlib.Algebra.GroupWithZero.Center +public import Mathlib.Algebra.Ring.Center +public import Mathlib.Algebra.Ring.Centralizer +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.Algebra.Ring.Prod +public import Mathlib.Algebra.Ring.Submonoid.Basic +public import Mathlib.Data.Set.Finite.Range +public import Mathlib.GroupTheory.Submonoid.Center +public import Mathlib.GroupTheory.Subsemigroup.Centralizer +public import Mathlib.RingTheory.NonUnitalSubsemiring.Defs /-! # Bundled non-unital subsemirings @@ -24,6 +26,8 @@ We define the `CompleteLattice` structure, and non-unital subsemiring `map`, `comap` and range (`srange`) of a `NonUnitalRingHom` etc. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean b/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean index 1f9e1d5d1da147..86c817615e3f01 100644 --- a/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean +++ b/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ -import Mathlib.Algebra.Ring.Hom.Defs -import Mathlib.Algebra.Ring.InjSurj -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Tactic.FastInstance +module + +public import Mathlib.Algebra.Ring.Hom.Defs +public import Mathlib.Algebra.Ring.InjSurj +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Tactic.FastInstance /-! # Bundled non-unital subsemirings @@ -15,6 +17,8 @@ We define bundled non-unital subsemirings and some standard constructions: `subtype` and `inclusion` ring homomorphisms. -/ +@[expose] public section + assert_not_exists RelIso universe u v w diff --git a/Mathlib/RingTheory/Norm/Basic.lean b/Mathlib/RingTheory/Norm/Basic.lean index 88ee6d99bf5ab0..bd739dd4171a8f 100644 --- a/Mathlib/RingTheory/Norm/Basic.lean +++ b/Mathlib/RingTheory/Norm/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Norm.Defs -import Mathlib.FieldTheory.PrimitiveElement -import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly -import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv +module + +public import Mathlib.RingTheory.Norm.Defs +public import Mathlib.FieldTheory.PrimitiveElement +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly +public import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv /-! # Norm for (finite) ring extensions @@ -35,6 +37,8 @@ See also `Algebra.trace`, which is defined similarly as the trace of -/ +@[expose] public section + universe u v w @@ -135,7 +139,7 @@ theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬Is contrapose! hx obtain ⟨s, ⟨b⟩⟩ := hx refine .of_mem_of_fg K⟮x⟯.toSubalgebra ?_ x ?_ - · exact (Submodule.fg_iff_finiteDimensional _).mpr (.of_fintype_basis b) + · exact (Submodule.fg_iff_finiteDimensional _).mpr (b.finiteDimensional_of_finite) · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x) theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L) diff --git a/Mathlib/RingTheory/Norm/Defs.lean b/Mathlib/RingTheory/Norm/Defs.lean index 31e1b7a810cf2f..103722df80cbc2 100644 --- a/Mathlib/RingTheory/Norm/Defs.lean +++ b/Mathlib/RingTheory/Norm/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.LinearAlgebra.Determinant +module + +public import Mathlib.LinearAlgebra.Determinant /-! # Norm for (finite) ring extensions @@ -32,6 +34,8 @@ See also `Algebra.trace`, which is defined similarly as the trace of -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Norm/Transitivity.lean b/Mathlib/RingTheory/Norm/Transitivity.lean index 6b23c239c0dbec..08a4ec7cd70371 100644 --- a/Mathlib/RingTheory/Norm/Transitivity.lean +++ b/Mathlib/RingTheory/Norm/Transitivity.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.LinearAlgebra.Matrix.Block -import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -import Mathlib.RingTheory.Norm.Defs -import Mathlib.RingTheory.PolynomialAlgebra -import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs -import Mathlib.FieldTheory.IntermediateField.Algebraic -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.RingTheory.Norm.Basic -import Mathlib.FieldTheory.Galois.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Block +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff +public import Mathlib.RingTheory.Norm.Defs +public import Mathlib.RingTheory.PolynomialAlgebra +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs +public import Mathlib.FieldTheory.IntermediateField.Algebraic +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.RingTheory.Norm.Basic +public import Mathlib.FieldTheory.Galois.Basic /-! # Transitivity of algebra norm @@ -26,6 +28,8 @@ about the roots of the minimal polynomial of `s` over `R`. -/ +@[expose] public section + variable {R S A n m : Type*} [CommRing R] [CommRing S] variable (M : Matrix m m S) [DecidableEq m] [DecidableEq n] (k : m) open Matrix Polynomial diff --git a/Mathlib/RingTheory/NormTrace.lean b/Mathlib/RingTheory/NormTrace.lean index 1509ea80b4e9c0..7e609555e40128 100644 --- a/Mathlib/RingTheory/NormTrace.lean +++ b/Mathlib/RingTheory/NormTrace.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Norm.Defs -import Mathlib.RingTheory.Trace.Defs +module + +public import Mathlib.RingTheory.Norm.Defs +public import Mathlib.RingTheory.Trace.Defs /-! # Relation between norms and traces -/ +@[expose] public section + open Module lemma Algebra.norm_one_add_smul {A B} [CommRing A] [CommRing B] [Algebra A B] diff --git a/Mathlib/RingTheory/NormalClosure.lean b/Mathlib/RingTheory/NormalClosure.lean index a9425c884e917d..d52561dececd17 100644 --- a/Mathlib/RingTheory/NormalClosure.lean +++ b/Mathlib/RingTheory/NormalClosure.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ -import Mathlib.RingTheory.DedekindDomain.IntegralClosure +module + +public import Mathlib.RingTheory.DedekindDomain.IntegralClosure /-! # Normal closure of an extension of domains @@ -15,7 +17,8 @@ Under the hood, `T` is defined as the `integralClosure` of `S` inside the `IntermediateField.normalClosure` of the extension `Frac S / Frac R` inside the `AlgebraicClosure` of `Frac S`. In particular, if `S` is a Dedekind domain, then `T` is also a Dedekind domain. -# Technical notes +## Technical notes + * Many instances are proved about the `IntermediateField.normalClosure` of the extension `Frac S / Frac R` inside the `AlgebraicClosure` of `Frac S`. However these are only needed for the construction of `T` and to prove some results about it. Therefore, these instances are local. @@ -25,6 +28,8 @@ does not cause timeouts in this file, it does slow down considerably its compila does trigger timeouts in applications. -/ +@[expose] public section + namespace Ring noncomputable section NormalClosure diff --git a/Mathlib/RingTheory/Nullstellensatz.lean b/Mathlib/RingTheory/Nullstellensatz.lean index 1b8d2d803545fa..45961c2d77f548 100644 --- a/Mathlib/RingTheory/Nullstellensatz.lean +++ b/Mathlib/RingTheory/Nullstellensatz.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma -/ -import Mathlib.RingTheory.Jacobson.Ring -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.RingTheory.Spectrum.Prime.Basic +module + +public import Mathlib.RingTheory.Jacobson.Ring +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Basic /-! # Nullstellensatz @@ -21,6 +23,8 @@ The machinery around `vanishingIdeal` and `zeroLocus` is also minimal, I only ad directly needed in this proof, since I'm not sure if they are the right approach. -/ +@[expose] public section + open Ideal noncomputable section diff --git a/Mathlib/RingTheory/OrderOfVanishing.lean b/Mathlib/RingTheory/OrderOfVanishing.lean index 701f71d42ebce0..58822c70050c46 100644 --- a/Mathlib/RingTheory/OrderOfVanishing.lean +++ b/Mathlib/RingTheory/OrderOfVanishing.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Raphael Douglas Giles. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Raphael Douglas Giles -/ -import Mathlib.RingTheory.KrullDimension.NonZeroDivisors -import Mathlib.RingTheory.Length -import Mathlib.RingTheory.HopkinsLevitzki +module + +public import Mathlib.RingTheory.KrullDimension.NonZeroDivisors +public import Mathlib.RingTheory.Length +public import Mathlib.RingTheory.HopkinsLevitzki /-! # Order of vanishing @@ -15,6 +17,8 @@ the ring by the ideal generated by that element. We also define the extension of field of fractions -/ +@[expose] public section + open LinearMap Pointwise IsLocalization Ideal WithZero variable {R : Type*} {M : Type*} [AddCommMonoid M] diff --git a/Mathlib/RingTheory/OreLocalization/Basic.lean b/Mathlib/RingTheory/OreLocalization/Basic.lean index a5d4f516488a4d..678c3b1a2ebe9f 100644 --- a/Mathlib/RingTheory/OreLocalization/Basic.lean +++ b/Mathlib/RingTheory/OreLocalization/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer, Kevin Klinge, Andrew Yang -/ -import Mathlib.Algebra.Group.Submonoid.DistribMulAction -import Mathlib.GroupTheory.OreLocalization.Basic -import Mathlib.Algebra.GroupWithZero.Defs +module + +public import Mathlib.Algebra.Group.Submonoid.DistribMulAction +public import Mathlib.GroupTheory.OreLocalization.Basic +public import Mathlib.Algebra.GroupWithZero.Defs /-! @@ -24,6 +26,8 @@ localization, Ore, non-commutative -/ +@[expose] public section + assert_not_exists RelIso universe u diff --git a/Mathlib/RingTheory/OreLocalization/Cardinality.lean b/Mathlib/RingTheory/OreLocalization/Cardinality.lean index c41a0992d1786c..e0ec19ddc028ed 100644 --- a/Mathlib/RingTheory/OreLocalization/Cardinality.lean +++ b/Mathlib/RingTheory/OreLocalization/Cardinality.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.GroupTheory.OreLocalization.Cardinality -import Mathlib.RingTheory.OreLocalization.Ring +module + +public import Mathlib.GroupTheory.OreLocalization.Cardinality +public import Mathlib.RingTheory.OreLocalization.Ring /-! # Cardinality of Ore localizations of rings @@ -12,6 +14,8 @@ import Mathlib.RingTheory.OreLocalization.Ring This file contains some results on cardinality of Ore localizations of rings. -/ +@[expose] public section + universe u open Cardinal diff --git a/Mathlib/RingTheory/OreLocalization/NonZeroDivisors.lean b/Mathlib/RingTheory/OreLocalization/NonZeroDivisors.lean index 2b82f6bb3c0fd7..22374c758ebf25 100644 --- a/Mathlib/RingTheory/OreLocalization/NonZeroDivisors.lean +++ b/Mathlib/RingTheory/OreLocalization/NonZeroDivisors.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Anatole Dedecker. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer, Kevin Klinge, Andrew Yang -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.RingTheory.OreLocalization.Basic +module + +public import Mathlib.Algebra.GroupWithZero.NonZeroDivisors +public import Mathlib.RingTheory.OreLocalization.Basic /-! # Ore Localization over nonZeroDivisors in monoids with zeros. -/ +@[expose] public section + open scoped nonZeroDivisors namespace OreLocalization diff --git a/Mathlib/RingTheory/OreLocalization/OreSet.lean b/Mathlib/RingTheory/OreLocalization/OreSet.lean index f720b6f1b88ebe..114ca745b1fe68 100644 --- a/Mathlib/RingTheory/OreLocalization/OreSet.lean +++ b/Mathlib/RingTheory/OreLocalization/OreSet.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer, Kevin Klinge -/ -import Mathlib.Algebra.Group.Submonoid.Defs -import Mathlib.Algebra.GroupWithZero.Basic -import Mathlib.Algebra.Ring.Regular -import Mathlib.GroupTheory.OreLocalization.OreSet +module + +public import Mathlib.Algebra.Group.Submonoid.Defs +public import Mathlib.Algebra.GroupWithZero.Basic +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.GroupTheory.OreLocalization.OreSet /-! @@ -20,6 +22,8 @@ This file contains results on left Ore sets for rings and monoids with zero. -/ +@[expose] public section + assert_not_exists RelIso namespace OreLocalization diff --git a/Mathlib/RingTheory/OreLocalization/Ring.lean b/Mathlib/RingTheory/OreLocalization/Ring.lean index 99cd17eecd062f..87b775f92eb372 100644 --- a/Mathlib/RingTheory/OreLocalization/Ring.lean +++ b/Mathlib/RingTheory/OreLocalization/Ring.lean @@ -3,10 +3,11 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob von Raumer, Kevin Klinge, Andrew Yang -/ +module -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Field.Defs -import Mathlib.RingTheory.OreLocalization.NonZeroDivisors +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Field.Defs +public import Mathlib.RingTheory.OreLocalization.NonZeroDivisors /-! @@ -17,6 +18,8 @@ The `Monoid` and `DistribMulAction` instances and additive versions are provided -/ +@[expose] public section + assert_not_exists Subgroup universe u diff --git a/Mathlib/RingTheory/OrzechProperty.lean b/Mathlib/RingTheory/OrzechProperty.lean index 9cd8c13f367a88..ecf4b8ffa5157c 100644 --- a/Mathlib/RingTheory/OrzechProperty.lean +++ b/Mathlib/RingTheory/OrzechProperty.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Module.TransferInstance -import Mathlib.RingTheory.Finiteness.Cardinality +module + +public import Mathlib.Algebra.Module.TransferInstance +public import Mathlib.RingTheory.Finiteness.Cardinality /-! @@ -42,6 +44,8 @@ free module, rank, Orzech property, (strong) rank condition, invariant basis num -/ +@[expose] public section + universe u v w open Function diff --git a/Mathlib/RingTheory/Perfection.lean b/Mathlib/RingTheory/Perfection.lean index 1fe7569f19f16e..ecfc093bb13d76 100644 --- a/Mathlib/RingTheory/Perfection.lean +++ b/Mathlib/RingTheory/Perfection.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.CharP.Frobenius -import Mathlib.Algebra.CharP.Pi -import Mathlib.Algebra.CharP.Quotient -import Mathlib.Algebra.CharP.Subring -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.FieldTheory.Perfect -import Mathlib.RingTheory.Valuation.Integers +module + +public import Mathlib.Algebra.CharP.Frobenius +public import Mathlib.Algebra.CharP.Pi +public import Mathlib.Algebra.CharP.Quotient +public import Mathlib.Algebra.CharP.Subring +public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal +public import Mathlib.FieldTheory.Perfect +public import Mathlib.RingTheory.Valuation.Integers /-! # Ring Perfection and Tilt @@ -23,6 +25,8 @@ Define the valuation on the tilt, and define a characteristic predicate for the -/ +@[expose] public section + universe u₁ u₂ u₃ u₄ diff --git a/Mathlib/RingTheory/Perfectoid/Untilt.lean b/Mathlib/RingTheory/Perfectoid/Untilt.lean index 033fe38c07ceb5..b43474171dc4f6 100644 --- a/Mathlib/RingTheory/Perfectoid/Untilt.lean +++ b/Mathlib/RingTheory/Perfectoid/Untilt.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang -/ +module -import Mathlib.NumberTheory.Basic -import Mathlib.RingTheory.AdicCompletion.Basic -import Mathlib.RingTheory.Perfection +public import Mathlib.NumberTheory.Basic +public import Mathlib.RingTheory.AdicCompletion.Basic +public import Mathlib.RingTheory.Perfection /-! # Untilt Function @@ -32,6 +33,8 @@ is not the untilt *functor*. Perfectoid, Tilting equivalence, Untilt -/ +@[expose] public section + open Perfection Ideal noncomputable section diff --git a/Mathlib/RingTheory/PiTensorProduct.lean b/Mathlib/RingTheory/PiTensorProduct.lean index 3f237c1991ded6..7c2b4e7077a5d2 100644 --- a/Mathlib/RingTheory/PiTensorProduct.lean +++ b/Mathlib/RingTheory/PiTensorProduct.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.LinearAlgebra.PiTensorProduct -import Mathlib.Algebra.Algebra.Bilinear -import Mathlib.Algebra.Algebra.Equiv -import Mathlib.Data.Finset.NoncommProd +public import Mathlib.LinearAlgebra.PiTensorProduct +public import Mathlib.Algebra.Algebra.Bilinear +public import Mathlib.Algebra.Algebra.Equiv +public import Mathlib.Data.Finset.NoncommProd /-! # Tensor product of `R`-algebras and rings @@ -18,6 +19,8 @@ with structure map defined by `r ↦ r • 1`. In particular if we take `R` to be `ℤ`, then this collapses into the tensor product of rings. -/ +@[expose] public section + open TensorProduct Function variable {ι R' R : Type*} {A : ι → Type*} diff --git a/Mathlib/RingTheory/PicardGroup.lean b/Mathlib/RingTheory/PicardGroup.lean index 2d2d01ea25de46..ea527b62a6c41b 100644 --- a/Mathlib/RingTheory/PicardGroup.lean +++ b/Mathlib/RingTheory/PicardGroup.lean @@ -3,17 +3,19 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.Algebra.Module.LocalizedModule.Submodule -import Mathlib.CategoryTheory.Monoidal.Skeleton -import Mathlib.LinearAlgebra.Contraction -import Mathlib.LinearAlgebra.TensorProduct.Finiteness -import Mathlib.LinearAlgebra.TensorProduct.RightExactness -import Mathlib.LinearAlgebra.TensorProduct.Submodule -import Mathlib.RingTheory.Flat.Localization -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.LocalRing.Module +module + +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.Algebra.Module.LocalizedModule.Submodule +public import Mathlib.CategoryTheory.Monoidal.Skeleton +public import Mathlib.LinearAlgebra.Contraction +public import Mathlib.LinearAlgebra.TensorProduct.Finiteness +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness +public import Mathlib.LinearAlgebra.TensorProduct.Submodule +public import Mathlib.RingTheory.Flat.Localization +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.LocalRing.Module /-! # The Picard group of a commutative ring @@ -58,6 +60,8 @@ Show: - Exhibit isomorphism with sheaf cohomology `H¹(Spec R, 𝓞ˣ)`. -/ +@[expose] public section + open TensorProduct universe u v @@ -357,6 +361,9 @@ theorem of_isLocalization (S : Submonoid R) [IsLocalization S A] Module.Invertible A N := .congr (IsLocalizedModule.isBaseChange S A f).equiv +instance (S : Submonoid R) : Module.Invertible (Localization S) (LocalizedModule S M) := + of_isLocalization S (LocalizedModule.mkLinearMap S M) + instance (L) [AddCommMonoid L] [Module R L] [Module A L] [IsScalarTower R A L] [Module.Invertible A L] : Module.Invertible A (L ⊗[R] M) := .congr (AlgebraTensorModule.cancelBaseChange R A A L M) @@ -509,6 +516,34 @@ end CommRing end PicardGroup +namespace Module.Invertible + +variable (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] [Module.Invertible R M] + +-- TODO: generalize to CommSemiring by generalizing `CommRing.Pic.instSubsingletonOfIsLocalRing` +theorem tensorProductComm_eq_refl : TensorProduct.comm R M M = .refl .. := by + let f (P : Ideal R) [P.IsMaximal] := LocalizedModule.mkLinearMap P.primeCompl M + let ff (P : Ideal R) [P.IsMaximal] := TensorProduct.map (f P) (f P) + refine LinearEquiv.toLinearMap_injective <| LinearMap.eq_of_localization_maximal _ ff _ ff _ _ + fun P _ ↦ .trans (b := (TensorProduct.comm ..).toLinearMap) ?_ ?_ + · apply IsLocalizedModule.linearMap_ext P.primeCompl (ff P) (ff P) + ext; dsimp + apply IsLocalizedModule.map_apply + let Rp := Localization P.primeCompl + have ⟨e⟩ := free_iff_linearEquiv.mp (inferInstance : Free Rp (LocalizedModule P.primeCompl M)) + have e := e.restrictScalars R + ext x y + refine (congr e e ≪≫ₗ equivOfCompatibleSMul Rp ..).injective ?_ + suffices e y ⊗ₜ[Rp] e x = e x ⊗ₜ e y by simpa [equivOfCompatibleSMul] + conv_lhs => rw [← mul_one (e y), ← smul_eq_mul, smul_tmul, smul_eq_mul, + mul_comm, ← smul_eq_mul, ← smul_tmul, smul_eq_mul, mul_one] + +variable {R M} in +theorem tmul_comm {m₁ m₂ : M} : m₁ ⊗ₜ[R] m₂ = m₂ ⊗ₜ m₁ := + DFunLike.congr_fun (tensorProductComm_eq_refl ..) (m₂ ⊗ₜ m₁) + +end Module.Invertible + namespace Submodule open Module Invertible diff --git a/Mathlib/RingTheory/Polynomial/Basic.lean b/Mathlib/RingTheory/Polynomial/Basic.lean index 2629a3734908c5..ca415b9593333e 100644 --- a/Mathlib/RingTheory/Polynomial/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Basic.lean @@ -3,12 +3,14 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.Algebra.Polynomial.BigOperators -import Mathlib.Algebra.Ring.GeomSum -import Mathlib.RingTheory.Noetherian.Basic +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.Algebra.Polynomial.BigOperators +public import Mathlib.Algebra.Ring.GeomSum +public import Mathlib.RingTheory.Noetherian.Basic /-! # Ring-theoretic supplement of Algebra.Polynomial. @@ -20,6 +22,8 @@ import Mathlib.RingTheory.Noetherian.Basic Hilbert basis theorem, that if a ring is Noetherian then so is its polynomial ring. -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Bernstein.lean b/Mathlib/RingTheory/Polynomial/Bernstein.lean index 4d04fdf7df7bbf..a544a8ab951081 100644 --- a/Mathlib/RingTheory/Polynomial/Bernstein.lean +++ b/Mathlib/RingTheory/Polynomial/Bernstein.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.MvPolynomial.PDeriv -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.Data.Nat.Choose.Sum -import Mathlib.LinearAlgebra.LinearIndependent.Lemmas -import Mathlib.RingTheory.Polynomial.Pochhammer +module + +public import Mathlib.Algebra.MvPolynomial.PDeriv +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +public import Mathlib.RingTheory.Polynomial.Pochhammer /-! # Bernstein polynomials @@ -33,6 +35,8 @@ approximations of a continuous function `f : C([0,1], ℝ)`, and shows that thes to `f`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/Polynomial/Chebyshev.lean b/Mathlib/RingTheory/Polynomial/Chebyshev.lean index 0d8d9820aeb0be..6b0f95c04d0adb 100644 --- a/Mathlib/RingTheory/Polynomial/Chebyshev.lean +++ b/Mathlib/RingTheory/Polynomial/Chebyshev.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Julian Kuelshammer, Heather Macbeth, Mitchell Lee -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Algebra.Ring.NegOnePow -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Algebra.Ring.NegOnePow +public import Mathlib.Tactic.LinearCombination /-! # Chebyshev polynomials @@ -56,6 +58,8 @@ and do not have `map (Int.castRingHom R)` interfering all the time. * Prove minimax properties of Chebyshev polynomials. -/ +@[expose] public section + namespace Polynomial.Chebyshev open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Content.lean b/Mathlib/RingTheory/Polynomial/Content.lean index 3a7f6683b6d185..c20a80f2c1900a 100644 --- a/Mathlib/RingTheory/Polynomial/Content.lean +++ b/Mathlib/RingTheory/Polynomial/Content.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.GCDMonoid.Finset -import Mathlib.Algebra.Polynomial.CancelLeads -import Mathlib.Algebra.Polynomial.EraseLead -import Mathlib.Algebra.Polynomial.FieldDivision +module + +public import Mathlib.Algebra.GCDMonoid.Finset +public import Mathlib.Algebra.Polynomial.CancelLeads +public import Mathlib.Algebra.Polynomial.EraseLead +public import Mathlib.Algebra.Polynomial.FieldDivision /-! # GCD structures on polynomials @@ -29,6 +31,8 @@ This has nothing to do with minimal polynomials of primitive elements in finite -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/ContentIdeal.lean b/Mathlib/RingTheory/Polynomial/ContentIdeal.lean index a6fdb0f4ebce56..b8a656afbe1c5b 100644 --- a/Mathlib/RingTheory/Polynomial/ContentIdeal.lean +++ b/Mathlib/RingTheory/Polynomial/ContentIdeal.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ +module -import Mathlib.Order.CompletePartialOrder -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.Order.CompletePartialOrder +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Polynomial.Content /-! # The content ideal of a polynomial @@ -39,6 +40,8 @@ Let `p : R[X]`. -/ +@[expose] public section + namespace Polynomial open Ideal diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean index 4676d3faeb51ec..cef0bdc907b6af 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.FieldTheory.RatFunc.AsPolynomial -import Mathlib.NumberTheory.ArithmeticFunction -import Mathlib.RingTheory.RootsOfUnity.Complex +module + +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.FieldTheory.RatFunc.AsPolynomial +public import Mathlib.NumberTheory.ArithmeticFunction +public import Mathlib.RingTheory.RootsOfUnity.Complex /-! # Cyclotomic polynomials. @@ -40,6 +42,8 @@ To get the standard cyclotomic polynomials, we use `unique_int_coeff_of_cycl`, w to get a polynomial with integer coefficients and then we map it to `R[X]`, for any ring `R`. -/ +@[expose] public section + open scoped Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean index f21c9b7c54cbac..723f84ae8c0110 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots -import Mathlib.Tactic.ByContra -import Mathlib.Topology.Algebra.Polynomial -import Mathlib.NumberTheory.Padics.PadicVal.Basic -import Mathlib.Analysis.Complex.Arg +module + +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots +public import Mathlib.Tactic.ByContra +public import Mathlib.Topology.Algebra.Polynomial +public import Mathlib.NumberTheory.Padics.PadicVal.Basic +public import Mathlib.Analysis.Complex.Arg /-! # Evaluating cyclotomic polynomials @@ -18,6 +20,8 @@ This file states some results about evaluating cyclotomic polynomials in various * `Polynomial.cyclotomic_pos` : `∀ x, 0 < eval x (cyclotomic n R)` if `2 < n`. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean index 48380c1c964065..48848400dcd640 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Algebra.Algebra.ZMod -import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots +module + +public import Mathlib.Algebra.Algebra.ZMod +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots /-! # Cyclotomic polynomials and `expand`. @@ -25,6 +27,8 @@ We gather results relating cyclotomic polynomials and `expand`. `cyclotomic (p ^ k * m) R = (cyclotomic m R) ^ (p ^ k - p ^ (k - 1))`. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Factorization.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Factorization.lean index 6e46d5b199f250..ab542c0bfaabdd 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Factorization.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Factorization.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.FieldTheory.Finite.GaloisField -import Mathlib.RingTheory.SimpleModule.Basic -import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots -import Mathlib.Algebra.CharP.CharAndCard +module + +public import Mathlib.FieldTheory.Finite.GaloisField +public import Mathlib.RingTheory.SimpleModule.Basic +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots +public import Mathlib.Algebra.CharP.CharAndCard /-! # Factorization of cyclotomic polynomials over finite fields @@ -22,6 +24,8 @@ field of characteristic `p`, where `p` and `n` are coprime. -/ +@[expose] public section + namespace Polynomial variable {K : Type*} [Field K] [Fintype K] {p f n : ℕ} {P : K[X]} diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean index 56703bcd29db04..1ce8cd29406cc9 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic -import Mathlib.RingTheory.RootsOfUnity.Minpoly +module + +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic +public import Mathlib.RingTheory.RootsOfUnity.Minpoly /-! # Roots of cyclotomic polynomials. @@ -30,6 +32,8 @@ To prove `Polynomial.cyclotomic.irreducible`, the irreducibility of `cyclotomic primitive root of unity `μ : K`, where `K` is a field of characteristic `0`. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/DegreeLT.lean b/Mathlib/RingTheory/Polynomial/DegreeLT.lean index 0a4ca91daf604c..61f9e1c5feb3d8 100644 --- a/Mathlib/RingTheory/Polynomial/DegreeLT.lean +++ b/Mathlib/RingTheory/Polynomial/DegreeLT.lean @@ -3,12 +3,13 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Kenny Lau -/ +module -import Mathlib.Algebra.Polynomial.Div -import Mathlib.Algebra.Polynomial.Taylor -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Matrix.Block -import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.Algebra.Polynomial.Taylor +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Matrix.Block +public import Mathlib.RingTheory.Polynomial.Basic /-! # Polynomials with degree strictly less than `n` @@ -34,6 +35,8 @@ This file contains the properties of the submodule of polynomials of degree less -/ +@[expose] public section + open Module namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Dickson.lean b/Mathlib/RingTheory/Polynomial/Dickson.lean index f7aed4487a72fc..ad1e6ab658618c 100644 --- a/Mathlib/RingTheory/Polynomial/Dickson.lean +++ b/Mathlib/RingTheory/Polynomial/Dickson.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Julian Kuelshammer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Julian Kuelshammer -/ -import Mathlib.Algebra.CharP.Algebra -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Algebra.CharP.Lemmas -import Mathlib.Algebra.EuclideanDomain.Field -import Mathlib.Algebra.Field.ZMod -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.RingTheory.Polynomial.Chebyshev +module + +public import Mathlib.Algebra.CharP.Algebra +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.CharP.Lemmas +public import Mathlib.Algebra.EuclideanDomain.Field +public import Mathlib.Algebra.Field.ZMod +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.RingTheory.Polynomial.Chebyshev /-! # Dickson polynomials @@ -47,6 +49,8 @@ When `a=0` they are just the family of monomials `X ^ n`. matrices of simple connected graphs which annihilate `dickson 2 1`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/Polynomial/Eisenstein/Basic.lean b/Mathlib/RingTheory/Polynomial/Eisenstein/Basic.lean index 63be0492a58553..99b6adbf2dc4d3 100644 --- a/Mathlib/RingTheory/Polynomial/Eisenstein/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Eisenstein/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.Polynomial.Eisenstein.Criterion -import Mathlib.RingTheory.Polynomial.ScaleRoots +module + +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.Polynomial.Eisenstein.Criterion +public import Mathlib.RingTheory.Polynomial.ScaleRoots /-! # Eisenstein polynomials @@ -27,6 +29,8 @@ useful since it is sometimes better behaved (for example it is stable under `Pol -/ +@[expose] public section + universe u v w z diff --git a/Mathlib/RingTheory/Polynomial/Eisenstein/Criterion.lean b/Mathlib/RingTheory/Polynomial/Eisenstein/Criterion.lean index 2df1e532bb71c3..ab85a217be5867 100644 --- a/Mathlib/RingTheory/Polynomial/Eisenstein/Criterion.lean +++ b/Mathlib/RingTheory/Polynomial/Eisenstein/Criterion.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Antoine Chambert-Loir -/ +module -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.Ideal.Quotient.Operations /-! # The Eisenstein criterion @@ -29,7 +30,7 @@ of application of this criterion. * `Polynomial.irreducible_of_eisenstein_criterion` : the classic Eisenstein criterion. It is the particular case where `q := X`. -# TODO +## TODO The case of a polynomial `q := X - a` is interesting, then the mod `P ^ 2` hypothesis can rephrased as saying @@ -52,6 +53,8 @@ There are two obstructions, though : -/ +@[expose] public section + namespace Polynomial open Ideal.Quotient Ideal RingHom diff --git a/Mathlib/RingTheory/Polynomial/Eisenstein/Distinguished.lean b/Mathlib/RingTheory/Polynomial/Eisenstein/Distinguished.lean index be2abb441c061d..fd1bf47df4a1a7 100644 --- a/Mathlib/RingTheory/Polynomial/Eisenstein/Distinguished.lean +++ b/Mathlib/RingTheory/Polynomial/Eisenstein/Distinguished.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan -/ +module -import Mathlib.RingTheory.Polynomial.Eisenstein.Basic -import Mathlib.RingTheory.PowerSeries.Order +public import Mathlib.RingTheory.Polynomial.Eisenstein.Basic +public import Mathlib.RingTheory.PowerSeries.Order /-! # Distinguished polynomial @@ -15,6 +16,8 @@ and develop the most basic lemmas about it. -/ +@[expose] public section + open scoped Polynomial open PowerSeries Ideal Quotient diff --git a/Mathlib/RingTheory/Polynomial/Eisenstein/Generalized.lean b/Mathlib/RingTheory/Polynomial/Eisenstein/Generalized.lean index 5763f4e75987ca..4155080ac10ee2 100644 --- a/Mathlib/RingTheory/Polynomial/Eisenstein/Generalized.lean +++ b/Mathlib/RingTheory/Polynomial/Eisenstein/Generalized.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.Ideal.Quotient.Defs +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.Ideal.Quotient.Defs deprecated_module "Auto-generated deprecation" (since := "2025-04-11") diff --git a/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean b/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean index 20ea4eaf7f12ea..0e5c8e152256b4 100644 --- a/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean +++ b/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ -import Mathlib.Data.Nat.Choose.Dvd -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.Norm.Transitivity -import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand +module + +public import Mathlib.Data.Nat.Choose.Dvd +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.Norm.Transitivity +public import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand /-! # Eisenstein polynomials @@ -22,6 +24,8 @@ In this file we gather more miscellaneous results about Eisenstein polynomials -/ +@[expose] public section + universe u v w z variable {R : Type u} @@ -66,10 +70,9 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] : Ideal.mem_span_singleton] intro h obtain ⟨k, hk⟩ := Int.natCast_dvd_natCast.1 h - rw [mul_assoc, mul_comm 1, mul_one] at hk - nth_rw 1 [← Nat.mul_one p] at hk - rw [mul_right_inj' hp.out.ne_zero] at hk - exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm) + have : 2 ≤ p := Nat.Prime.two_le hp.out + have : p < p^2 := by nlinarith + cases k <;> grind theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (n : ℕ) : ((cyclotomic (p ^ (n + 1)) ℤ).comp (X + 1)).IsEisensteinAt 𝓟 := by @@ -110,10 +113,9 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] ( Ideal.mem_span_singleton] intro h obtain ⟨k, hk⟩ := Int.natCast_dvd_natCast.1 h - rw [mul_assoc, mul_comm 1, mul_one] at hk - nth_rw 1 [← Nat.mul_one p] at hk - rw [mul_right_inj' hp.out.ne_zero] at hk - exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm) + have : 2 ≤ p := Nat.Prime.two_le hp.out + have : p < p^2 := by nlinarith + cases k <;> grind end Cyclotomic diff --git a/Mathlib/RingTheory/Polynomial/GaussLemma.lean b/Mathlib/RingTheory/Polynomial/GaussLemma.lean index 33e3d2b37538da..ddea91d048a3a8 100644 --- a/Mathlib/RingTheory/Polynomial/GaussLemma.lean +++ b/Mathlib/RingTheory/Polynomial/GaussLemma.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.FieldTheory.SplittingField.Construction -import Mathlib.RingTheory.Localization.Integral -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.Polynomial.Content +module + +public import Mathlib.FieldTheory.SplittingField.Construction +public import Mathlib.RingTheory.Localization.Integral +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.Polynomial.Content /-! # Gauss's Lemma @@ -35,6 +37,8 @@ Gauss's Lemma is one of a few results pertaining to irreducibility of primitive -/ +@[expose] public section + open scoped nonZeroDivisors Polynomial diff --git a/Mathlib/RingTheory/Polynomial/GaussNorm.lean b/Mathlib/RingTheory/Polynomial/GaussNorm.lean index 907e0c8764f2c5..d73640cbcc44f7 100644 --- a/Mathlib/RingTheory/Polynomial/GaussNorm.lean +++ b/Mathlib/RingTheory/Polynomial/GaussNorm.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ +module -import Mathlib.RingTheory.PowerSeries.GaussNorm +public import Mathlib.RingTheory.PowerSeries.GaussNorm /-! # Gauss norm for polynomials @@ -27,6 +28,8 @@ non-negative function with `v 0 = 0` and `c ≥ 0`. * `Polynomial.gaussNorm_eq_zero_iff`: if `v x = 0 ↔ x = 0` for all `x : R`, then the Gauss norm is zero if and only if the polynomial is zero. -/ + +@[expose] public section variable {R F : Type*} [Semiring R] [FunLike F R ℝ] (v : F) (c : ℝ) namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Hermite/Basic.lean b/Mathlib/RingTheory/Polynomial/Hermite/Basic.lean index e934fce0407db7..4ca226cf5a472a 100644 --- a/Mathlib/RingTheory/Polynomial/Hermite/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Hermite/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Luke Mantle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Luke Mantle -/ -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.Data.Nat.Factorial.DoubleFactorial +module + +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # Hermite polynomials @@ -34,6 +36,8 @@ This file defines `Polynomial.hermite n`, the `n`th probabilists' Hermite polyno -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Hermite/Gaussian.lean b/Mathlib/RingTheory/Polynomial/Hermite/Gaussian.lean index 1e4ff3fd3e5757..44b1d03faba783 100644 --- a/Mathlib/RingTheory/Polynomial/Hermite/Gaussian.lean +++ b/Mathlib/RingTheory/Polynomial/Hermite/Gaussian.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Luke Mantle. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Luke Mantle, Jake Levinson -/ -import Mathlib.RingTheory.Polynomial.Hermite.Basic -import Mathlib.Analysis.Calculus.Deriv.Add -import Mathlib.Analysis.Calculus.Deriv.Polynomial -import Mathlib.Analysis.SpecialFunctions.Exp -import Mathlib.Analysis.SpecialFunctions.ExpDeriv +module + +public import Mathlib.RingTheory.Polynomial.Hermite.Basic +public import Mathlib.Analysis.Calculus.Deriv.Add +public import Mathlib.Analysis.Calculus.Deriv.Polynomial +public import Mathlib.Analysis.SpecialFunctions.Exp +public import Mathlib.Analysis.SpecialFunctions.ExpDeriv /-! # Hermite polynomials and Gaussians @@ -27,6 +29,8 @@ polynomial factor occurring in the `n`th derivative of a Gaussian. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/Polynomial/HilbertPoly.lean b/Mathlib/RingTheory/Polynomial/HilbertPoly.lean index 1d357a6f5f7396..505fbe5539789a 100644 --- a/Mathlib/RingTheory/Polynomial/HilbertPoly.lean +++ b/Mathlib/RingTheory/Polynomial/HilbertPoly.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Fangming Li. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fangming Li, Jujian Zhang -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.Algebra.Polynomial.Roots -import Mathlib.Order.Interval.Set.Infinite -import Mathlib.RingTheory.Polynomial.Pochhammer -import Mathlib.RingTheory.PowerSeries.WellKnown -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.Algebra.Polynomial.Roots +public import Mathlib.Order.Interval.Set.Infinite +public import Mathlib.RingTheory.Polynomial.Pochhammer +public import Mathlib.RingTheory.PowerSeries.WellKnown +public import Mathlib.Tactic.FieldSimp /-! # Hilbert polynomials @@ -37,6 +39,8 @@ if `d! = 0` in `F`, then the polynomial `(X + 1)···(X + d)/d!` no longer work * Hilbert polynomials of finitely generated graded modules over Noetherian rings. -/ +@[expose] public section + open Nat PowerSeries variable (F : Type*) [Field F] diff --git a/Mathlib/RingTheory/Polynomial/Ideal.lean b/Mathlib/RingTheory/Polynomial/Ideal.lean index 569a891ce23fae..c385f265566a4f 100644 --- a/Mathlib/RingTheory/Polynomial/Ideal.lean +++ b/Mathlib/RingTheory/Polynomial/Ideal.lean @@ -3,14 +3,18 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.Algebra.Polynomial.RingDivision -import Mathlib.RingTheory.Adjoin.Polynomial -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.Algebra.Polynomial.RingDivision +public import Mathlib.RingTheory.Adjoin.Polynomial +public import Mathlib.RingTheory.Ideal.Maps /-! # Ideals in polynomial rings -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/IntegralNormalization.lean b/Mathlib/RingTheory/Polynomial/IntegralNormalization.lean index c0cd0ca18d8fbe..5a6ae8a8e986c8 100644 --- a/Mathlib/RingTheory/Polynomial/IntegralNormalization.lean +++ b/Mathlib/RingTheory/Polynomial/IntegralNormalization.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker, Andrew Yang, Yuyang Zhao -/ -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.RingTheory.Polynomial.ScaleRoots +module + +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.RingTheory.Polynomial.ScaleRoots /-! # Theory of monic polynomials @@ -12,6 +14,8 @@ import Mathlib.RingTheory.Polynomial.ScaleRoots We define `integralNormalization`, which relate arbitrary polynomials to monic ones. -/ +@[expose] public section + open Polynomial @@ -73,6 +77,21 @@ theorem integralNormalization_coeff_ne_natDegree {i : ℕ} (hi : i ≠ natDegree coeff (integralNormalization p) i = coeff p i * p.leadingCoeff ^ (p.natDegree - 1 - i) := integralNormalization_coeff_degree_ne (degree_ne_of_natDegree_ne hi.symm) +@[simp] +lemma degree_integralNormalization : p.integralNormalization.degree = p.degree := by + nontriviality R + by_cases hp : p = 0; · simp [hp] + rw [degree_eq_natDegree hp] + refine degree_eq_of_le_of_coeff_ne_zero ?_ (by simp [integralNormalization_coeff_natDegree, *]) + exact (Finset.sup_le fun i h => + WithBot.coe_le_coe.2 <| le_natDegree_of_mem_supp i <| support_integralNormalization_subset h) + +@[simp] +lemma natDegree_integralNormalization : p.integralNormalization.natDegree = p.natDegree := by + nontriviality R + by_cases hp : p = 0; · simp [hp] + exact natDegree_eq_of_degree_eq p.degree_integralNormalization + theorem monic_integralNormalization (hp : p ≠ 0) : Monic (integralNormalization p) := monic_of_degree_le p.natDegree (Finset.sup_le fun i h => @@ -157,6 +176,12 @@ theorem integralNormalization_aeval_eq_zero [Algebra S A] {f : S[X]} {z : A} (hz integralNormalization_eval₂_eq_zero_of_commute (algebraMap S A) hz (Algebra.commute_algebraMap_left _ _) (.map (.all _ _) _) inj +lemma integralNormalization_map (f : R →+* A) (p : R[X]) (H : f p.leadingCoeff ≠ 0) : + (p.map f).integralNormalization = p.integralNormalization.map f := by + ext i + simp [integralNormalization_coeff, degree_map_eq_of_leadingCoeff_ne_zero _ H, apply_ite f, + leadingCoeff_map_of_leadingCoeff_ne_zero _ H, natDegree_map_eq_iff.mpr (.inl H)] + end Semiring section IsCancelMulZero diff --git a/Mathlib/RingTheory/Polynomial/IrreducibleRing.lean b/Mathlib/RingTheory/Polynomial/IrreducibleRing.lean index c833c264d92f6a..7c4990330678bb 100644 --- a/Mathlib/RingTheory/Polynomial/IrreducibleRing.lean +++ b/Mathlib/RingTheory/Polynomial/IrreducibleRing.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.Algebra.Polynomial.Eval.Irreducible -import Mathlib.RingTheory.Polynomial.Nilpotent +module + +public import Mathlib.Algebra.Polynomial.Eval.Irreducible +public import Mathlib.RingTheory.Polynomial.Nilpotent /-! @@ -25,6 +27,8 @@ polynomial, irreducible ring, nilradical, prime ideal -/ +@[expose] public section + open Polynomial noncomputable section diff --git a/Mathlib/RingTheory/Polynomial/IsIntegral.lean b/Mathlib/RingTheory/Polynomial/IsIntegral.lean new file mode 100644 index 00000000000000..842caa21b55bfd --- /dev/null +++ b/Mathlib/RingTheory/Polynomial/IsIntegral.lean @@ -0,0 +1,65 @@ +/- +Copyright (c) 2025 Andrew Yang. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Andrew Yang +-/ +module + +public import Mathlib.Data.Multiset.Fintype +public import Mathlib.FieldTheory.SplittingField.Construction + +/-! # Results about coefficients of polynomials being integral -/ + +@[expose] public section + +namespace Polynomial + +variable {R S ι : Type*} [CommRing R] [CommRing S] [Algebra R S] + +lemma isIntegral_coeff_prod + (s : Finset ι) (p : ι → S[X]) (H : ∀ i ∈ s, ∀ j, IsIntegral R ((p i).coeff j)) (j : ℕ) : + IsIntegral R ((s.prod p).coeff j) := by + classical + induction s using Finset.induction generalizing j with + | empty => simp [coeff_one, apply_ite, isIntegral_zero, isIntegral_one] + | insert a s has IH => + rw [Finset.prod_insert has, coeff_mul] + exact IsIntegral.sum _ fun i hi ↦ .mul (H _ (by simp) _) (IH (fun _ _ ↦ H _ (by aesop)) _) + +lemma isIntegral_coeff_of_factors [IsDomain S] (p : S[X]) + (hpmon : IsIntegral R p.leadingCoeff) (hp : p.Factors) + (hpr : ∀ x ∈ p.roots, IsIntegral R x) (i : ℕ) : + IsIntegral R (p.coeff i) := by + classical + rw [hp.eq_prod_roots, Multiset.prod_eq_prod_coe, coeff_C_mul] + refine .mul hpmon (isIntegral_coeff_prod _ _ ?_ _) + rintro ⟨a, ⟨i, hi⟩⟩ - + obtain ⟨x, hx, rfl⟩ := Multiset.mem_map.mp (Multiset.count_pos.mp (i.zero_le.trans_lt hi)) + simp [coeff_X, coeff_C, IsIntegral.sub, apply_ite (IsIntegral R), + isIntegral_one, isIntegral_zero, hpr x hx] + +@[stacks 00H6 "(1)"] +lemma isIntegral_coeff_of_dvd [IsDomain S] (p : R[X]) (q : S[X]) (hp : p.Monic) + (hq : IsIntegral R q.leadingCoeff) + (H : q ∣ p.map (algebraMap R S)) (i : ℕ) : IsIntegral R (q.coeff i) := by + wlog hS : IsField S + · let L := FractionRing S + refine (isIntegral_algHom_iff (IsScalarTower.toAlgHom R S L) + (FaithfulSMul.algebraMap_injective _ _)).mp ?_ + rw [IsScalarTower.coe_toAlgHom', ← coeff_map] + refine this p (q.map (algebraMap _ L)) hp ?_ ?_ _ (Field.toIsField L) + · rw [leadingCoeff_map_of_injective (FaithfulSMul.algebraMap_injective _ _)] + exact .algebraMap hq + · rw [IsScalarTower.algebraMap_eq R S, ← Polynomial.map_map] + exact Polynomial.map_dvd _ H + letI := hS.toField + let L := (p.map (algebraMap R S)).SplittingField + refine (isIntegral_algHom_iff (IsScalarTower.toAlgHom R S L) (algebraMap S L).injective).mp ?_ + rw [IsScalarTower.coe_toAlgHom', ← coeff_map] + refine Polynomial.isIntegral_coeff_of_factors _ (by simpa using .algebraMap hq) ?_ ?_ i + · refine .of_dvd ?_ ((hp.map _).map _).ne_zero (Polynomial.map_dvd _ H) + exact SplittingField.splits (p.map (algebraMap R S)) + · intro x hx + exact ⟨p, hp, by simpa using aeval_eq_zero_of_dvd_aeval_eq_zero (a := x) H (by simp_all)⟩ + +end Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Nilpotent.lean b/Mathlib/RingTheory/Polynomial/Nilpotent.lean index 724a82777e2d40..134fc227a7fc54 100644 --- a/Mathlib/RingTheory/Polynomial/Nilpotent.lean +++ b/Mathlib/RingTheory/Polynomial/Nilpotent.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Emilie Uthaiwat, Oliver Nash -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Div -import Mathlib.Algebra.Polynomial.Identities -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.RingTheory.Nilpotent.Lemmas +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.Algebra.Polynomial.Identities +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.RingTheory.Nilpotent.Lemmas /-! # Nilpotency in polynomial rings. @@ -21,6 +23,8 @@ This file is a place for results related to nilpotency in (single-variable) poly -/ +@[expose] public section + namespace Polynomial variable {R : Type*} {r : R} diff --git a/Mathlib/RingTheory/Polynomial/Opposites.lean b/Mathlib/RingTheory/Polynomial/Opposites.lean index b90ec5cbc60e83..fd14e1dfcdd946 100644 --- a/Mathlib/RingTheory/Polynomial/Opposites.lean +++ b/Mathlib/RingTheory/Polynomial/Opposites.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.Algebra.Polynomial.Degree.Support -import Mathlib.Tactic.NoncommRing +module + +public import Mathlib.Algebra.Polynomial.Degree.Support +public import Mathlib.Tactic.NoncommRing /-! # Interactions between `R[X]` and `Rᵐᵒᵖ[X]` @@ -12,6 +14,8 @@ This file contains the basic API for "pushing through" the isomorphism `opRingEquiv : R[X]ᵐᵒᵖ ≃+* Rᵐᵒᵖ[X]`. It allows going back and forth between a polynomial ring over a semiring and the polynomial ring over the opposite semiring. -/ +@[expose] public section + open Polynomial @@ -81,7 +85,7 @@ theorem coeff_opRingEquiv (p : R[X]ᵐᵒᵖ) (n : ℕ) : @[simp] theorem support_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).support = (unop p).support := - Finsupp.support_mapRange_of_injective (map_zero _) _ op_injective + Finsupp.support_mapRange_of_injective (by simp) _ op_injective @[simp] theorem natDegree_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).natDegree = (unop p).natDegree := by diff --git a/Mathlib/RingTheory/Polynomial/Pochhammer.lean b/Mathlib/RingTheory/Polynomial/Pochhammer.lean index 2f31a78ae0a88f..88e6a3e604209f 100644 --- a/Mathlib/RingTheory/Polynomial/Pochhammer.lean +++ b/Mathlib/RingTheory/Polynomial/Pochhammer.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Algebra.Basic -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.Algebra.Polynomial.Eval.Algebra -import Mathlib.Tactic.Abel +module + +public import Mathlib.Algebra.Algebra.Basic +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.Algebra.Polynomial.Eval.Algebra +public import Mathlib.Tactic.Abel /-! # The Pochhammer polynomials @@ -33,6 +35,8 @@ There is lots more in this direction: * q-factorials, q-binomials, q-Pochhammer. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Polynomial/Quotient.lean b/Mathlib/RingTheory/Polynomial/Quotient.lean index 017f54e022bb8f..5651682e95aae0 100644 --- a/Mathlib/RingTheory/Polynomial/Quotient.lean +++ b/Mathlib/RingTheory/Polynomial/Quotient.lean @@ -3,19 +3,23 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, David Kurniadi Angdinata, Devon Tuma, Riccardo Brasca -/ -import Mathlib.Algebra.Field.Equiv -import Mathlib.Algebra.Polynomial.Div -import Mathlib.Algebra.Polynomial.Eval.SMul -import Mathlib.GroupTheory.GroupAction.Ring -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Polynomial.Basic -import Mathlib.RingTheory.Polynomial.Ideal -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.Field.Equiv +public import Mathlib.Algebra.Polynomial.Div +public import Mathlib.Algebra.Polynomial.Eval.SMul +public import Mathlib.GroupTheory.GroupAction.Ring +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.RingTheory.Polynomial.Ideal +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Quotients of polynomial rings -/ +@[expose] public section + open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Radical.lean b/Mathlib/RingTheory/Polynomial/Radical.lean index 1b2114bb6388af..0e8ee36507be93 100644 --- a/Mathlib/RingTheory/Polynomial/Radical.lean +++ b/Mathlib/RingTheory/Polynomial/Radical.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jineon Baek, Seewoo Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jineon Baek, Seewoo Lee -/ -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.RingTheory.Polynomial.Wronskian -import Mathlib.RingTheory.Radical -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative +module + +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.RingTheory.Polynomial.Wronskian +public import Mathlib.RingTheory.Radical +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative /-! # Radical of a polynomial @@ -15,6 +17,8 @@ This file proves some theorems on `radical` and `divRadical` of polynomials. See `RingTheory.Radical` for the definition of `radical` and `divRadical`. -/ +@[expose] public section + open Polynomial UniqueFactorizationMonoid UniqueFactorizationDomain EuclideanDomain variable {k : Type*} [Field k] [DecidableEq k] diff --git a/Mathlib/RingTheory/Polynomial/RationalRoot.lean b/Mathlib/RingTheory/Polynomial/RationalRoot.lean index 375fd4f327e949..34fa55724f5d58 100644 --- a/Mathlib/RingTheory/Polynomial/RationalRoot.lean +++ b/Mathlib/RingTheory/Polynomial/RationalRoot.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.Localization.NumDen -import Mathlib.RingTheory.Polynomial.ScaleRoots +module + +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.Localization.NumDen +public import Mathlib.RingTheory.Polynomial.ScaleRoots /-! # Rational root theorem and integral root theorem @@ -25,6 +27,8 @@ Finally, we use this to show unique factorization domains are integrally closed. * https://en.wikipedia.org/wiki/Rational_root_theorem -/ +@[expose] public section + open scoped Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean b/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean index 87435db7a7a48f..a79293b47f2154 100644 --- a/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Anne Baanen -/ +module -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.LinearAlgebra.Matrix.Determinant.Basic /-! # Resultant of two polynomials @@ -34,6 +35,8 @@ This file contains basic facts about resultant of two polynomials over commutati -/ +@[expose] public section + open Set namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/ScaleRoots.lean b/Mathlib/RingTheory/Polynomial/ScaleRoots.lean index 92d815e5304fa0..15defec7c4b983 100644 --- a/Mathlib/RingTheory/Polynomial/ScaleRoots.lean +++ b/Mathlib/RingTheory/Polynomial/ScaleRoots.lean @@ -3,10 +3,9 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen, Devon Tuma -/ -import Mathlib.Algebra.GroupWithZero.NonZeroDivisors -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.RingTheory.Coprime.Basic -import Mathlib.Tactic.AdaptationNote +module + +public import Mathlib.Algebra.Polynomial.Factors /-! # Scaling the roots of a polynomial @@ -15,6 +14,8 @@ This file defines `scaleRoots p s` for a polynomial `p` in one variable and a ri be the polynomial with root `r * s` for each root `r` of `p` and proves some basic results about it. -/ +@[expose] public section + variable {R S A K : Type*} @@ -78,8 +79,13 @@ theorem degree_scaleRoots (p : R[X]) {s : R} : degree (scaleRoots p s) = degree theorem natDegree_scaleRoots (p : R[X]) (s : R) : natDegree (scaleRoots p s) = natDegree p := by simp only [natDegree, degree_scaleRoots] +@[simp] +lemma leadingCoeff_scaleRoots (p : R[X]) (r : R) : + (p.scaleRoots r).leadingCoeff = p.leadingCoeff := by + rw [leadingCoeff, natDegree_scaleRoots, coeff_scaleRoots_natDegree] + theorem monic_scaleRoots_iff {p : R[X]} (s : R) : Monic (scaleRoots p s) ↔ Monic p := by - simp only [Monic, leadingCoeff, natDegree_scaleRoots, coeff_scaleRoots_natDegree] + simp only [Monic, leadingCoeff_scaleRoots] theorem map_scaleRoots (p : R[X]) (x : R) (f : R →+* S) (h : f p.leadingCoeff ≠ 0) : (p.scaleRoots x).map f = (p.map f).scaleRoots (f x) := by @@ -110,6 +116,11 @@ lemma scaleRoots_zero (p : R[X]) : lemma one_scaleRoots (r : R) : (1 : R[X]).scaleRoots r = 1 := by ext; simp +@[simp] +lemma X_add_C_scaleRoots (r s : R) : (X + C r).scaleRoots s = (X + C (r * s)) := by + nontriviality R + ext (_|_|i) <;> simp + end Semiring section CommSemiring @@ -143,6 +154,10 @@ theorem scaleRoots_eval₂_mul {p : S[X]} (f : S →+* R) (r : R) (s : S) : theorem scaleRoots_eval₂_eq_zero {p : S[X]} (f : S →+* R) {r : R} {s : S} (hr : eval₂ f r p = 0) : eval₂ f (f s * r) (scaleRoots p s) = 0 := by rw [scaleRoots_eval₂_mul, hr, mul_zero] +lemma scaleRoots_eval_mul (p : R[X]) (r s : R) : + eval (s * r) (p.scaleRoots s) = s ^ p.natDegree * eval r p := + scaleRoots_eval₂_mul _ _ _ + theorem scaleRoots_aeval_eq_zero [Algebra R A] {p : R[X]} {a : A} {r : R} (ha : aeval a p = 0) : aeval (algebraMap R A r * a) (scaleRoots p r) = 0 := by rw [aeval_def, scaleRoots_eval₂_mul_of_commute, ← aeval_def, ha, mul_zero] @@ -206,6 +221,24 @@ lemma mul_scaleRoots_of_noZeroDivisors (p q : R[X]) (r : R) [NoZeroDivisors R] : apply mul_scaleRoots' simp only [ne_eq, mul_eq_zero, leadingCoeff_eq_zero, hp, hq, or_self, not_false_eq_true] +lemma pow_scaleRoots' (p : R[X]) (r : R) (n : ℕ) + (hp : p.leadingCoeff ^ n ≠ 0) : + (p ^ n).scaleRoots r = p.scaleRoots r ^ n := by + induction n with + | zero => simp + | succ n IH => + rw [pow_succ, mul_scaleRoots', IH, pow_succ] + · refine mt (by simp +contextual [pow_succ]) hp + · rwa [leadingCoeff_pow' (mt (by simp +contextual [pow_succ]) hp), ← pow_succ] + +lemma pow_scaleRoots_of_isReduced [IsReduced R] (p : R[X]) (r : R) (n : ℕ) : + (p ^ n).scaleRoots r = p.scaleRoots r ^ n := by + by_cases hp : p = 0 + · simp [hp, zero_pow_eq, apply_ite (scaleRoots · r)] + by_cases hn : n = 0 + · simp [hn] + exact pow_scaleRoots' _ _ _ (by simp_all) + lemma add_scaleRoots_of_natDegree_eq (p q : R[X]) (r : R) (h : natDegree p = natDegree q) : r ^ (natDegree p - natDegree (p + q)) • (p + q).scaleRoots r = p.scaleRoots r + q.scaleRoots r := by @@ -252,8 +285,73 @@ lemma isCoprime_scaleRoots (p q : R[X]) (r : R) (hr : IsUnit r) (h : IsCoprime p simp only [s, smul_mul_assoc, ← mul_scaleRoots, smul_smul, mul_assoc, ← mul_pow, IsUnit.val_inv_mul, one_pow, mul_one, ← smul_add, one_smul, e, natDegree_one, one_scaleRoots, ← add_scaleRoots_of_natDegree_eq _ _ _ this, tsub_zero] + alias _root_.IsCoprime.scaleRoots := isCoprime_scaleRoots +lemma Factors.scaleRoots {p : R[X]} (hp : p.Factors) (r : R) : + (p.scaleRoots r).Factors := by + cases subsingleton_or_nontrivial R + · rwa [Subsingleton.elim (p.scaleRoots r) p] + obtain rfl | hp0 := eq_or_ne p 0 + · simp + obtain ⟨m, hm⟩ := factors_iff_exists_multiset'.mp hp + rw [hm, mul_scaleRoots', scaleRoots_C] + · clear hm + refine .mul (.C _) ?_ + induction m using Multiset.induction_on with + | empty => simp + | cons a s IH => + rw [Multiset.map_cons, Multiset.prod_cons, mul_scaleRoots', X_add_C_scaleRoots] + · exact .mul (.X_add_C _) IH + · simp only [leadingCoeff_X_add_C, one_mul, ne_eq, leadingCoeff_eq_zero] + exact (monic_multiset_prod_of_monic _ _ fun a _ ↦ monic_X_add_C _).ne_zero + · rw [(monic_multiset_prod_of_monic _ _ fun a _ ↦ monic_X_add_C _).leadingCoeff] + simpa + end CommSemiring +section Ring + +@[simp] +lemma X_sub_C_scaleRoots [Ring R] (r s : R) : + (X - C r).scaleRoots s = (X - C (r * s)) := by + nontriviality R + ext (_|_|i) <;> simp + +end Ring + +section CommRing + +variable [CommRing R] + +lemma rootMultiplicity_scaleRoots (p : R[X]) {r a : R} (hr : IsLeftRegular r) : + rootMultiplicity (r * a) (p.scaleRoots r) = rootMultiplicity a p := by + cases subsingleton_or_nontrivial R + · simp [Subsingleton.elim p 0] + obtain rfl | hp := eq_or_ne p 0 + · simp + obtain ⟨q, e, hq⟩ := exists_eq_pow_rootMultiplicity_mul_and_not_dvd p hp a + have hq0 : q ≠ 0 := by contrapose! hp; simp_all + conv_lhs => rw [e] + rw [mul_scaleRoots', pow_scaleRoots', X_sub_C_scaleRoots, mul_comm, mul_comm _ (q.scaleRoots r), + rootMultiplicity_mul_X_sub_C_pow (q.scaleRoots_ne_zero hq0 _)] + · rw [dvd_iff_isRoot, IsRoot.def] at hq + simp only [Nat.add_eq_right, rootMultiplicity_eq_zero_iff, IsRoot.def] + rw [mul_comm, scaleRoots_eval_mul, (hr.pow q.natDegree).mul_left_eq_zero_iff] + tauto + · simp + · rwa [leadingCoeff_pow' (by simp), leadingCoeff_X_sub_C, + one_pow, one_mul, ne_eq, leadingCoeff_eq_zero] + +lemma roots_scaleRoots [IsDomain R] (p : R[X]) {r : R} (hr : IsUnit r) : + (p.scaleRoots r).roots = p.roots.map (r * ·) := by + classical + ext a + have : Function.Bijective (α := R) (r * ·) := IsUnit.isUnit_iff_mulLeft_bijective.mp hr + obtain ⟨a, rfl⟩ := this.2 a + simp [Multiset.count_map_eq_count' _ p.roots this.1 a, + rootMultiplicity_scaleRoots _ hr.isRegular.left] + +end CommRing + end Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Selmer.lean b/Mathlib/RingTheory/Polynomial/Selmer.lean index a9f87f48140418..76dc6b43789ec2 100644 --- a/Mathlib/RingTheory/Polynomial/Selmer.lean +++ b/Mathlib/RingTheory/Polynomial/Selmer.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Thomas Browning. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning -/ -import Mathlib.Analysis.Complex.Polynomial.UnitTrinomial -import Mathlib.RingTheory.Polynomial.GaussLemma -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.Analysis.Complex.Polynomial.UnitTrinomial +public import Mathlib.RingTheory.Polynomial.GaussLemma +public import Mathlib.Tactic.LinearCombination /-! # Irreducibility of Selmer Polynomials @@ -19,6 +21,8 @@ This file proves irreducibility of the Selmer polynomials `X ^ n - X - 1`. TODO: Show that the Selmer polynomials have full Galois group. -/ +@[expose] public section + namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/SeparableDegree.lean b/Mathlib/RingTheory/Polynomial/SeparableDegree.lean index 45c865a7e96c4e..85c755c07fd0dc 100644 --- a/Mathlib/RingTheory/Polynomial/SeparableDegree.lean +++ b/Mathlib/RingTheory/Polynomial/SeparableDegree.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Jakob Scholbach. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jakob Scholbach -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.FieldTheory.Separable +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.FieldTheory.Separable /-! @@ -33,6 +35,8 @@ This file contains basics about the separable degree of a polynomial. separable degree, degree, polynomial -/ +@[expose] public section + noncomputable section namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/ShiftedLegendre.lean b/Mathlib/RingTheory/Polynomial/ShiftedLegendre.lean index 11972ea38471f3..83ad88c954cf85 100644 --- a/Mathlib/RingTheory/Polynomial/ShiftedLegendre.lean +++ b/Mathlib/RingTheory/Polynomial/ShiftedLegendre.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Junqi Liu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junqi Liu, Jinzhao Pan -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative /-! # shifted Legendre Polynomials @@ -26,6 +28,8 @@ polynomial in `ℤ[X]`. We prove some basic properties of the Legendre polynomia shifted Legendre polynomials, derivative -/ +@[expose] public section + open Nat BigOperators Finset namespace Polynomial diff --git a/Mathlib/RingTheory/Polynomial/SmallDegreeVieta.lean b/Mathlib/RingTheory/Polynomial/SmallDegreeVieta.lean index f19825a814fae7..65441fac4dc39f 100644 --- a/Mathlib/RingTheory/Polynomial/SmallDegreeVieta.lean +++ b/Mathlib/RingTheory/Polynomial/SmallDegreeVieta.lean @@ -3,14 +3,18 @@ Copyright (c) 2025 Qinchuan Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Qinchuan Zhang -/ -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.LinearCombination -import Mathlib.RingTheory.Polynomial.Vieta +module + +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.LinearCombination +public import Mathlib.RingTheory.Polynomial.Vieta /-! # Vieta's Formula for polynomial of small degrees. -/ +@[expose] public section + namespace Polynomial variable {R T S : Type*} diff --git a/Mathlib/RingTheory/Polynomial/Tower.lean b/Mathlib/RingTheory/Polynomial/Tower.lean index b8d94b30dc8c59..650ddaf615cebe 100644 --- a/Mathlib/RingTheory/Polynomial/Tower.lean +++ b/Mathlib/RingTheory/Polynomial/Tower.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yuyang Zhao -/ -import Mathlib.Algebra.Algebra.Tower -import Mathlib.Algebra.Polynomial.AlgebraMap +module + +public import Mathlib.Algebra.Algebra.Tower +public import Mathlib.Algebra.Polynomial.AlgebraMap /-! # Algebra towers for polynomial @@ -17,6 +19,8 @@ When you update this file, you can also try to make a corresponding update in `RingTheory.MvPolynomial.Tower`. -/ +@[expose] public section + open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean b/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean index 6ad478b7a9f0fa..6845b3e05ec018 100644 --- a/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean +++ b/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean @@ -3,11 +3,13 @@ Copyright (c) 2019 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.Polynomial.Basic -import Mathlib.RingTheory.Polynomial.Content -import Mathlib.RingTheory.UniqueFactorizationDomain.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.Finite -import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid +module + +public import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.RingTheory.Polynomial.Content +public import Mathlib.RingTheory.UniqueFactorizationDomain.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.Finite +public import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid /-! # Unique factorization for univariate and multivariate polynomials @@ -20,6 +22,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.GCDMonoid number of variables). -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/RingTheory/Polynomial/Vieta.lean b/Mathlib/RingTheory/Polynomial/Vieta.lean index 3b409d9bec96a4..c1946b74c815ef 100644 --- a/Mathlib/RingTheory/Polynomial/Vieta.lean +++ b/Mathlib/RingTheory/Polynomial/Vieta.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Hanting Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Hanting Zhang -/ -import Mathlib.Algebra.Polynomial.Splits -import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs +module + +public import Mathlib.Algebra.Polynomial.Splits +public import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs /-! # Vieta's Formula @@ -22,6 +24,8 @@ we derive `Polynomial.coeff_eq_esymm_roots_of_card`, the relationship between th the roots of `p` for a polynomial `p` that splits (i.e. having as many roots as its degree). -/ +@[expose] public section + open Finset Polynomial namespace Multiset diff --git a/Mathlib/RingTheory/Polynomial/Wronskian.lean b/Mathlib/RingTheory/Polynomial/Wronskian.lean index d5cc4959cda486..2d59bba59302fb 100644 --- a/Mathlib/RingTheory/Polynomial/Wronskian.lean +++ b/Mathlib/RingTheory/Polynomial/Wronskian.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Jineon Baek and Seewoo Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jineon Baek, Seewoo Lee -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Derivative -import Mathlib.LinearAlgebra.SesquilinearForm.Basic -import Mathlib.RingTheory.Coprime.Basic +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Derivative +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic +public import Mathlib.RingTheory.Coprime.Basic /-! # Wronskian of a pair of polynomial @@ -27,6 +29,8 @@ We also prove basic properties of it. - Define Wronskian for n-tuple of polynomials, not necessarily two. -/ +@[expose] public section + noncomputable section open scoped Polynomial @@ -101,8 +105,8 @@ theorem degree_wronskian_lt_add {a b : R[X]} (ha : a ≠ 0) (hb : b ≠ 0) : /-- `natDegree` version of the above theorem. -Note this would be false with just `(ha : a ≠ 0) (hb : b ≠ 0), -as when `a = b = 1` we have `(wronskian a b).natDegree = a.natDegree = b.natDegree = 0`. +Note this would be false with just `(ha : a ≠ 0)` and `(hb : b ≠ 0)`, +since when `a = b = 1` we have `(wronskian a b).natDegree = a.natDegree = b.natDegree = 0`. -/ theorem natDegree_wronskian_lt_add {a b : R[X]} (hw : wronskian a b ≠ 0) : (wronskian a b).natDegree < a.natDegree + b.natDegree := by diff --git a/Mathlib/RingTheory/PolynomialAlgebra.lean b/Mathlib/RingTheory/PolynomialAlgebra.lean index cd69b09056803b..d84da39a1cd54a 100644 --- a/Mathlib/RingTheory/PolynomialAlgebra.lean +++ b/Mathlib/RingTheory/PolynomialAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.RingTheory.IsTensorProduct +module + +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.RingTheory.IsTensorProduct /-! # Base change of polynomial algebras @@ -12,6 +14,8 @@ import Mathlib.RingTheory.IsTensorProduct Given `[CommSemiring R] [Semiring A] [Algebra R A]` we show `A[X] ≃ₐ[R] (A ⊗[R] R[X])`. -/ +@[expose] public section + -- This file should not become entangled with `RingTheory/MatrixAlgebra`. assert_not_exists Matrix diff --git a/Mathlib/RingTheory/PolynomialLaw/Basic.lean b/Mathlib/RingTheory/PolynomialLaw/Basic.lean index e7052b4e84af8d..ed23ab7468e9f1 100644 --- a/Mathlib/RingTheory/PolynomialLaw/Basic.lean +++ b/Mathlib/RingTheory/PolynomialLaw/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir & María-Inés de Frutos-Fernández. Al Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir & María-Inés de Frutos-Fernández -/ -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.TensorProduct.Associator +module + +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.TensorProduct.Associator /-! # Polynomial laws on modules @@ -42,6 +44,8 @@ Annales scientifiques de l’École Normale Supérieure 80 (3): 213‑348](Roby- -/ +@[expose] public section + universe u noncomputable section PolynomialLaw diff --git a/Mathlib/RingTheory/PowerBasis.lean b/Mathlib/RingTheory/PowerBasis.lean index e1b1db98850556..e1a1012e81a7b7 100644 --- a/Mathlib/RingTheory/PowerBasis.lean +++ b/Mathlib/RingTheory/PowerBasis.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.FieldTheory.Minpoly.Field -import Mathlib.LinearAlgebra.SModEq.Basic -import Mathlib.RingTheory.Ideal.BigOperators +module + +public import Mathlib.FieldTheory.Minpoly.Field +public import Mathlib.LinearAlgebra.SModEq.Basic +public import Mathlib.RingTheory.Ideal.BigOperators /-! # Power basis @@ -40,6 +42,8 @@ power basis, powerbasis -/ +@[expose] public section + open Finsupp Module Polynomial variable {R S T : Type*} [CommRing R] [Ring S] [Algebra R S] diff --git a/Mathlib/RingTheory/PowerSeries/Basic.lean b/Mathlib/RingTheory/PowerSeries/Basic.lean index 05ecefee1cfbc4..0c734df1cb8d80 100644 --- a/Mathlib/RingTheory/PowerSeries/Basic.lean +++ b/Mathlib/RingTheory/PowerSeries/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ -import Mathlib.Algebra.CharP.Defs -import Mathlib.Algebra.Polynomial.AlgebraMap -import Mathlib.Algebra.Polynomial.Basic -import Mathlib.RingTheory.MvPowerSeries.Basic -import Mathlib.Tactic.MoveAdd -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.RingTheory.Ideal.Basic +module + +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.Algebra.Polynomial.AlgebraMap +public import Mathlib.Algebra.Polynomial.Basic +public import Mathlib.RingTheory.MvPowerSeries.Basic +public import Mathlib.Tactic.MoveAdd +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.RingTheory.Ideal.Basic /-! # Formal power series (in one variable) @@ -46,6 +48,8 @@ Occasionally this leads to proofs that are uglier than expected. -/ +@[expose] public section + noncomputable section open Finset (antidiagonal mem_antidiagonal) @@ -647,8 +651,8 @@ theorem prod_monomial (f : ι → ℕ) (g : ι → R) (s : Finset ι) : simpa [monomial, Finsupp.single_finset_sum] using MvPowerSeries.prod_monomial (fun i ↦ Finsupp.single () (f i)) g s -theorem monmial_pow (m : ℕ) (a : R) (n : ℕ) : (monomial m a) ^ n = monomial (n * m) (a ^ n) := by - simpa [monomial] using MvPowerSeries.monmial_pow (Finsupp.single () m) a n +theorem monomial_pow (m : ℕ) (a : R) (n : ℕ) : (monomial m a) ^ n = monomial (n * m) (a ^ n) := by + simpa [monomial] using MvPowerSeries.monomial_pow (Finsupp.single () m) a n /-- The `n`-th coefficient of the `k`-th power of a power series. -/ lemma coeff_pow (k n : ℕ) (φ : R⟦X⟧) : diff --git a/Mathlib/RingTheory/PowerSeries/Binomial.lean b/Mathlib/RingTheory/PowerSeries/Binomial.lean index 9cfdaeabea4ee4..3e92eb09f1e21e 100644 --- a/Mathlib/RingTheory/PowerSeries/Binomial.lean +++ b/Mathlib/RingTheory/PowerSeries/Binomial.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Scott Carnahan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Carnahan -/ -import Mathlib.RingTheory.Binomial -import Mathlib.RingTheory.PowerSeries.WellKnown +module + +public import Mathlib.RingTheory.Binomial +public import Mathlib.RingTheory.PowerSeries.WellKnown /-! # Binomial Power Series @@ -27,6 +29,8 @@ commutative binomial ring `R`. -/ +@[expose] public section + open Finset BigOperators suppress_compilation diff --git a/Mathlib/RingTheory/PowerSeries/CoeffMulMem.lean b/Mathlib/RingTheory/PowerSeries/CoeffMulMem.lean index e4dceb9cf81516..bbdd8a027f97fe 100644 --- a/Mathlib/RingTheory/PowerSeries/CoeffMulMem.lean +++ b/Mathlib/RingTheory/PowerSeries/CoeffMulMem.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.PowerSeries.Basic +module + +public import Mathlib.RingTheory.Ideal.Operations +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.PowerSeries.Basic /-! @@ -33,6 +35,8 @@ import Mathlib.RingTheory.PowerSeries.Basic -/ +@[expose] public section + namespace PowerSeries variable {A : Type*} [Semiring A] {I J : Ideal A} {f g : A⟦X⟧} (n : ℕ) diff --git a/Mathlib/RingTheory/PowerSeries/Derivative.lean b/Mathlib/RingTheory/PowerSeries/Derivative.lean index cea3c99382f0a0..ebddd234691fad 100644 --- a/Mathlib/RingTheory/PowerSeries/Derivative.lean +++ b/Mathlib/RingTheory/PowerSeries/Derivative.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Richard M. Hill. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Richard M. Hill -/ -import Mathlib.RingTheory.PowerSeries.Trunc -import Mathlib.RingTheory.PowerSeries.Inverse -import Mathlib.RingTheory.Derivation.Basic +module + +public import Mathlib.RingTheory.PowerSeries.Trunc +public import Mathlib.RingTheory.PowerSeries.Inverse +public import Mathlib.RingTheory.Derivation.Basic /-! # Definitions @@ -24,6 +26,8 @@ $\exp ( \log (1+X)) = 1+X$ by differentiating twice. This is abbreviated `d⁄dX R`. -/ +@[expose] public section + namespace PowerSeries open Polynomial Derivation Nat diff --git a/Mathlib/RingTheory/PowerSeries/Evaluation.lean b/Mathlib/RingTheory/PowerSeries/Evaluation.lean index 2af1a2748b6cda..50e36c33b3834f 100644 --- a/Mathlib/RingTheory/PowerSeries/Evaluation.lean +++ b/Mathlib/RingTheory/PowerSeries/Evaluation.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ +module -import Mathlib.RingTheory.MvPowerSeries.Evaluation -import Mathlib.RingTheory.PowerSeries.PiTopology -import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.RingTheory.MvPowerSeries.Evaluation +public import Mathlib.RingTheory.PowerSeries.PiTopology +public import Mathlib.Algebra.MvPolynomial.Equiv /-! # Evaluation of power series @@ -42,6 +43,8 @@ the following lemmas furnish the properties of evaluation: We refer to the documentation of `MvPowerSeries.eval₂` for more details. -/ + +@[expose] public section namespace PowerSeries open WithPiTopology diff --git a/Mathlib/RingTheory/PowerSeries/GaussNorm.lean b/Mathlib/RingTheory/PowerSeries/GaussNorm.lean index 9a0c2802f325b8..02a7cea4d4d21b 100644 --- a/Mathlib/RingTheory/PowerSeries/GaussNorm.lean +++ b/Mathlib/RingTheory/PowerSeries/GaussNorm.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Fabrizio Barroero. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fabrizio Barroero -/ +module -import Mathlib.Data.Real.Archimedean -import Mathlib.RingTheory.PowerSeries.Order +public import Mathlib.Data.Real.Archimedean +public import Mathlib.RingTheory.PowerSeries.Order /-! # Gauss norm for power series @@ -28,6 +29,8 @@ In case `f` is a polynomial, `v` is a non-negative function with `v 0 = 0` and ` zero. -/ +@[expose] public section + namespace PowerSeries variable {R F : Type*} [Semiring R] [FunLike F R ℝ] (v : F) (c : ℝ) (f : R⟦X⟧) diff --git a/Mathlib/RingTheory/PowerSeries/Ideal.lean b/Mathlib/RingTheory/PowerSeries/Ideal.lean new file mode 100644 index 00000000000000..32e60a5a229f92 --- /dev/null +++ b/Mathlib/RingTheory/PowerSeries/Ideal.lean @@ -0,0 +1,200 @@ +/- +Copyright (c) 2025 Riccardo Brasca. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Riccardo Brasca, Anthony Fernandes, Marc Robin +-/ +module + +public import Mathlib.RingTheory.PowerSeries.Inverse +public import Mathlib.RingTheory.PowerSeries.Trunc +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Noetherian.OfPrime +public import Mathlib.Algebra.Module.SpanRank + +/-! +# Ideals in power series. + +We gather miscellaneous results about prime ideals in `R⟦X⟧`. More precisely, we prove that, given +a prime ideal `I` of `R⟦X⟧`, if the ideal generated by the constant coefficients of the `f ∈ I` is +generated by `n` elements, then `I` is generated by at most `n + 1` elements (actually it is +generated by `n` elements if `X ∉ I` and `n + 1` elements otherwise). This implies immediately that +`R⟦X⟧` is noetherian if `R` is. The proof of `eq_of_le_of_X_notMem_of_fg_of_isPrime` is inspired by +[zbMATH05171613]. + + +## Main results + +* `PowerSeries.eq_span_insert_X_of_X_mem_of_span_eq` : given an ideal `I` of `R⟦X⟧` such that + `X ∈ I`, if `I.map constantCoeff` is generated by `S : Set T`, then `I` is generated by + `insert X (C '' S)`. +* `PowerSeries.exist_eq_span_eq_ncard_of_X_notMem` : given a prime ideal `I` of `R⟦X⟧` such + that `X ∉ I`, if `I.map constantCoeff` is generated by a finite set `S : Set T`, then there exists + `T : Set R`, of the same cardinality as `S`, that generates `I`. +* `PowerSeries.fg_iff_of_isPrime` : a prime ideal `P` of `R⟦X⟧` is finitely generated if and only + if `P.map constantCoeff` is finitely generated. + + +## Implementation details + +There is a simpler proof of `IsNoetherianRing R → IsNoetherianRing R⟦X⟧`, similar to that for +polynomials. On the other hand our proof has the advantage of giving explicitly the number of +generators, and it will be used to prove that, for a domain `R`, we have +`IsPrincipalIdealRing R → UniqueFactorizationMonoid R⟦X⟧`. + +## TODO +Prove noetherianity of `MvPowerSeries` in finitely many variables. + +-/ + +@[expose] public section + +variable {R : Type*} + +open Ideal Set Finset + +namespace PowerSeries +variable [CommRing R] {I : Ideal R⟦X⟧} {S : Set R} + +section X_mem + +theorem map_constantCoeff_le_self_of_X_mem (hXI : X ∈ I) : + I.map (C.comp constantCoeff) ≤ I := by + suffices ∀ x ∈ I, C (constantCoeff x) ∈ I by simpa [Ideal.map_le_iff_le_comap] + intro f hf + rw [← sub_eq_iff_eq_add'.mpr f.eq_X_mul_shift_add_const] + exact sub_mem hf (I.mul_mem_right _ hXI) + +/-- Given an ideal `I` of `R⟦X⟧` such that `X ∈ I`, if `I.map constantCoeff` is generated by +`S : Set T`, then `I` is generated by `insert X (C '' S)`. -/ +theorem eq_span_insert_X_of_X_mem_of_span_eq (hXI : X ∈ I) (hSI : span S = I.map constantCoeff) : + I = span (insert X (C '' S)) := by + rw [Ideal.span_insert, ← Ideal.map_span, hSI, Ideal.map_map] + refine le_antisymm ?_ (by simp [Ideal.span_le, hXI, map_constantCoeff_le_self_of_X_mem]) + exact fun f hf ↦ mem_span_singleton_sup.mpr + ⟨_, _, mem_map_of_mem _ hf, f.eq_shift_mul_X_add_const.symm⟩ + +open Submodule in +theorem spanFinrank_le_spanFinrank_map_constantCoeff_add_one_of_X_mem (hI : X ∈ I) : + spanFinrank I ≤ spanFinrank (I.map constantCoeff) + 1 := by + by_cases hfg : I.FG + swap; · exact spanFinrank_of_not_fg hfg ▸ Nat.zero_le _ + replace hfg : (Ideal.map constantCoeff I).FG := by + have : RingHomSurjective (constantCoeff (R := R)) := ⟨constantCoeff_surj⟩ + exact map_eq_submodule_map constantCoeff I ▸ Submodule.FG.map _ hfg + nth_rw 1 [eq_span_insert_X_of_X_mem_of_span_eq hI (I.map constantCoeff).span_generators] + refine le_trans (spanFinrank_span_le_ncard_of_finite ?_) (le_trans (Set.ncard_insert_le _ _) ?_) + · simpa using Set.Finite.map _ (FG.finite_generators hfg) + · simp only [add_le_add_iff_right] + refine le_trans (Set.ncard_image_le (FG.finite_generators hfg)) ?_ + rw [FG.generators_ncard hfg] + +end X_mem + +section X_notMem + +variable (hXI : X ∉ I) [I.IsPrime] + +theorem eq_of_le_of_X_notMem_of_fg_of_isPrime {J : Ideal R⟦X⟧} (hJI : J ≤ I) (hXI : X ∉ I) + (hJ : J.FG) (h' : I.map constantCoeff ≤ J.map constantCoeff) : I = J := by + refine hJI.antisymm' ?_ + replace h' := h'.antisymm (Ideal.map_mono hJI) + obtain ⟨n, F, rfl⟩ := Submodule.fg_iff_exists_fin_generating_family.mp hJ + rw [submodule_span_eq, map_span, ← Set.range_comp] at h' + choose! T hT using fun g (hg : g ∈ I) ↦ + mem_span_range_iff_exists_fun.mp (h'.le (Ideal.mem_map_of_mem _ hg)) + dsimp at hT + intro g hg + let G : ℕ → R⟦X⟧ := + Nat.rec g fun _ G' ↦ mk fun p ↦ coeff (p + 1) G' - ∑ i, T G' i * coeff (p + 1) (F i) + have hG' (n : ℕ) (H : G n ∈ I) : G n - ∑ i, C (T (G n) i) * F i = X * G (n + 1) := by + simpa [hT _ H] using sub_const_eq_X_mul_shift (G n - ∑ i, C (T (G n) i) * F i) + have hG : ∀ n, G n ∈ I := Nat.rec hg fun n IH ↦ + (‹I.IsPrime›.mul_mem_iff_mem_or_mem.mp (hG' n IH ▸ I.sub_mem IH (I.sum_mem fun i _ ↦ + I.mul_mem_left _ (hJI (subset_span (Set.mem_range_self _)))))).resolve_left hXI + replace hG' := fun n ↦ hG' n (hG n) + let H (i : Fin n) : R⟦X⟧ := mk fun n ↦ T (G n) i + have h₁ (n : ℕ) : g - ∑ i, trunc n (H i) * F i = X ^ n * G n := by + induction n with + | zero => simp [G] + | succ n IH => + simp [trunc_succ, add_mul, sum_add_distrib, ← sub_sub, IH, pow_succ, mul_assoc, ← hG', + mul_sub, H, mul_sum, monomial_eq_C_mul_X_pow, mul_left_comm (C _)] + have h₂ : g = ∑ i, H i * F i := by + ext n; simpa [coeff_trunc, sub_eq_zero] using congr(($(h₁ (n + 1)).trunc (n + 1)).coeff n) + rw [h₂] + exact Ideal.sum_mem _ fun i _ ↦ Ideal.mul_mem_left _ _ (subset_span (Set.mem_range_self _)) + +/-- Given a prime ideal `I` of `R⟦X⟧` such that `X ∉ I`, if `I.map constantCoeff` is generated by a +finite set `S : Set T`, then there exists `T : Set R`, of the same cardinality as `S`, that +generates `I`. -/ +theorem exist_eq_span_eq_ncard_of_X_notMem (hI : X ∉ I) {S : Set R} + (hSI : span S = I.map constantCoeff) (hS : S.Finite) : + ∃ T, I = span T ∧ T.Finite ∧ T.ncard = S.ncard := by + have : SurjOn constantCoeff I S := by + intro r hr + simpa [mem_map_iff_of_surjective _ constantCoeff_surj, hSI] using subset_span hr + obtain ⟨T, hTI, hinj, hT⟩ := this.exists_subset_injOn_image_eq + refine ⟨T, eq_of_le_of_X_notMem_of_fg_of_isPrime (span_le.2 hTI) hI (Submodule.fg_def.2 + ⟨T, (hT ▸ hS).of_finite_image hinj, rfl⟩) ?_, Finite.of_injOn + (fun f hf ↦ hT ▸ Set.mem_image_of_mem _ hf) hinj hS, hT ▸ (ncard_image_of_injOn hinj).symm⟩ + rw [map_le_iff_le_comap] + intro f hf + rw [mem_comap, mem_map_iff_of_surjective _ constantCoeff_surj] + replace hf : constantCoeff f ∈ span S := hSI ▸ Ideal.mem_map_of_mem constantCoeff hf + refine Submodule.span_induction (fun s hs ↦ ?_) ⟨0, zero_mem _, by simp⟩ ?_ ?_ hf + · obtain ⟨t, htmem, ht⟩ := hT ▸ hs + exact ⟨t, subset_span htmem, ht⟩ + · intro r₁ r₂ hr₁ hr₂ ⟨s₁, hs₁mem, hs₁⟩ ⟨s₂, hs₂mem, hs₂⟩ + exact ⟨s₁ + s₂, Ideal.add_mem _ hs₁mem hs₂mem, by simp [hs₁, hs₂]⟩ + · intro r₁ r₂ hr₁ ⟨f, hfmem, hf⟩ + exact ⟨r₁ • f, Submodule.smul_of_tower_mem _ _ hfmem, by simp [hf]⟩ + +open Submodule in +theorem spanFinrank_eq_spanFinrank_map_constantCoeff_of_X_notMem_of_fg_of_isPrime (hI : X ∉ I) + (hfg : I.FG) : spanFinrank I = spanFinrank (I.map constantCoeff) := by + refine le_antisymm ?_ ?_ + swap; · exact Ideal.spanFinrank_map_le_of_fg constantCoeff hfg + have : RingHomSurjective (constantCoeff (R := R)) := ⟨constantCoeff_surj⟩ + obtain ⟨S, rfl, hS, hScard⟩ := exist_eq_span_eq_ncard_of_X_notMem hI + (I.map constantCoeff).span_generators + (FG.finite_generators <| map_eq_submodule_map constantCoeff I ▸ Submodule.FG.map _ hfg) + refine le_trans (spanFinrank_span_le_ncard_of_finite hS) ?_ + rw [hScard, FG.generators_ncard] + exact map_eq_submodule_map constantCoeff (Ideal.span S) ▸ Submodule.FG.map _ hfg + +end X_notMem + +variable {P : Ideal R⟦X⟧} [P.IsPrime] + +open Submodule in +theorem spanFinrank_le_spanFinrank_map_constantCoeff_add_one_of_isPrime : + spanFinrank P ≤ spanFinrank (P.map constantCoeff) + 1 := by + by_cases hfg : P.FG + swap; · exact spanFinrank_of_not_fg hfg ▸ Nat.zero_le _ + by_cases hP : X ∈ P + · exact spanFinrank_le_spanFinrank_map_constantCoeff_add_one_of_X_mem hP + · exact le_trans (spanFinrank_eq_spanFinrank_map_constantCoeff_of_X_notMem_of_fg_of_isPrime + hP hfg).le (Nat.le_succ _) + +/-- A prime ideal `P` of `R⟦X⟧` is finitely generated if and only if `P.map constantCoeff` is +finitely generated. -/ +lemma fg_iff_of_isPrime : P.FG ↔ (P.map constantCoeff).FG := by + constructor + · exact (FG.map · _) + · intro ⟨S, hS⟩ + by_cases hX : X ∈ P + · have H := eq_span_insert_X_of_X_mem_of_span_eq hX hS + have : (insert X <| (C (R := R)) '' S).Finite := + Finite.insert X <| Finite.image _ S.finite_toSet + lift insert X <| (C (R := R)) '' S to Finset R⟦X⟧ using this with T hT + exact ⟨T, hT ▸ H.symm⟩ + · obtain ⟨T, hT, hT₂, _⟩ := exist_eq_span_eq_ncard_of_X_notMem hX hS S.finite_toSet + lift T to Finset R⟦X⟧ using hT₂ + exact ⟨T, hT.symm⟩ + +/-- If `R` is noetherian then so is `R⟦X⟧`. -/ +instance [IsNoetherianRing R] : IsNoetherianRing R⟦X⟧ := + IsNoetherianRing.of_prime fun P _ ↦ + fg_iff_of_isPrime.2 <| (isNoetherianRing_iff_ideal_fg R).1 inferInstance (P.map constantCoeff) + +end PowerSeries diff --git a/Mathlib/RingTheory/PowerSeries/Inverse.lean b/Mathlib/RingTheory/PowerSeries/Inverse.lean index e95155cc24a72d..0b7a96c9733427 100644 --- a/Mathlib/RingTheory/PowerSeries/Inverse.lean +++ b/Mathlib/RingTheory/PowerSeries/Inverse.lean @@ -3,14 +3,15 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau, María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ +module -import Mathlib.Algebra.Polynomial.FieldDivision -import Mathlib.RingTheory.DiscreteValuationRing.Basic -import Mathlib.RingTheory.MvPowerSeries.Inverse -import Mathlib.RingTheory.PowerSeries.NoZeroDivisors -import Mathlib.RingTheory.LocalRing.ResidueField.Defs -import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity -import Mathlib.Data.ENat.Lattice +public import Mathlib.Algebra.Polynomial.FieldDivision +public import Mathlib.RingTheory.DiscreteValuationRing.Basic +public import Mathlib.RingTheory.MvPowerSeries.Inverse +public import Mathlib.RingTheory.PowerSeries.NoZeroDivisors +public import Mathlib.RingTheory.LocalRing.ResidueField.Defs +public import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicity +public import Mathlib.Data.ENat.Lattice /-! # Formal power series - Inverses @@ -27,6 +28,8 @@ field of `k⟦X⟧` and `k`, when `k` is a field. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/PowerSeries/NoZeroDivisors.lean b/Mathlib/RingTheory/PowerSeries/NoZeroDivisors.lean index b0271bab1048ed..a255e29b7f7120 100644 --- a/Mathlib/RingTheory/PowerSeries/NoZeroDivisors.lean +++ b/Mathlib/RingTheory/PowerSeries/NoZeroDivisors.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ -import Mathlib.RingTheory.PowerSeries.Order -import Mathlib.RingTheory.Ideal.Maps +module + +public import Mathlib.RingTheory.PowerSeries.Order +public import Mathlib.RingTheory.Ideal.Maps /-! # Power series over rings with no zero divisors @@ -20,6 +22,8 @@ If `R` has `NoZeroDivisors`, then so does `R⟦X⟧`. -/ +@[expose] public section + variable {R : Type*} diff --git a/Mathlib/RingTheory/PowerSeries/Order.lean b/Mathlib/RingTheory/PowerSeries/Order.lean index e742ebff95c47d..f29407fba9f9db 100644 --- a/Mathlib/RingTheory/PowerSeries/Order.lean +++ b/Mathlib/RingTheory/PowerSeries/Order.lean @@ -3,10 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ +module -import Mathlib.Algebra.CharP.Defs -import Mathlib.RingTheory.Multiplicity -import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.Algebra.CharP.Defs +public import Mathlib.RingTheory.Multiplicity +public import Mathlib.RingTheory.PowerSeries.Basic /-! # Formal power series (in one variable) - Order @@ -24,6 +25,8 @@ dividing out the largest power of X that divides `f`, that is its order. This is proving that `R⟦X⟧` is a normalization monoid, which is done in `PowerSeries.Inverse`. -/ + +@[expose] public section noncomputable section open Polynomial diff --git a/Mathlib/RingTheory/PowerSeries/PiTopology.lean b/Mathlib/RingTheory/PowerSeries/PiTopology.lean index e886920dc1602e..10fe65a71375c6 100644 --- a/Mathlib/RingTheory/PowerSeries/PiTopology.lean +++ b/Mathlib/RingTheory/PowerSeries/PiTopology.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández -/ -import Mathlib.RingTheory.MvPowerSeries.PiTopology -import Mathlib.RingTheory.PowerSeries.Basic -import Mathlib.RingTheory.PowerSeries.Order -import Mathlib.RingTheory.PowerSeries.Trunc -import Mathlib.LinearAlgebra.Finsupp.Pi -import Mathlib.Topology.Algebra.InfiniteSum.Ring +module + +public import Mathlib.RingTheory.MvPowerSeries.PiTopology +public import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.RingTheory.PowerSeries.Order +public import Mathlib.RingTheory.PowerSeries.Trunc +public import Mathlib.LinearAlgebra.Finsupp.Pi +public import Mathlib.Topology.Algebra.InfiniteSum.Ring /-! # Product topology on power series @@ -48,6 +50,8 @@ TODO: add the similar result for the series of homogeneous components. -/ +@[expose] public section + namespace PowerSeries diff --git a/Mathlib/RingTheory/PowerSeries/Restricted.lean b/Mathlib/RingTheory/PowerSeries/Restricted.lean index 9444b1f12468cc..f97db09cc66c6c 100644 --- a/Mathlib/RingTheory/PowerSeries/Restricted.lean +++ b/Mathlib/RingTheory/PowerSeries/Restricted.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 William Coram. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: William Coram -/ +module -import Mathlib.Analysis.Normed.Group.Ultra -import Mathlib.Analysis.RCLike.Basic -import Mathlib.RingTheory.PowerSeries.Basic -import Mathlib.Tactic.Bound +public import Mathlib.Analysis.Normed.Group.Ultra +public import Mathlib.Analysis.RCLike.Basic +public import Mathlib.RingTheory.PowerSeries.Basic +public import Mathlib.Tactic.Bound /-! # Restricted power series @@ -17,6 +18,8 @@ import Mathlib.Tactic.Bound -/ +@[expose] public section + namespace PowerSeries variable {R : Type*} [NormedRing R] (c : ℝ) diff --git a/Mathlib/RingTheory/PowerSeries/Substitution.lean b/Mathlib/RingTheory/PowerSeries/Substitution.lean index bce1546b4980b1..542d489891e63b 100644 --- a/Mathlib/RingTheory/PowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/PowerSeries/Substitution.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos Fernández. All Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos Fernández -/ +module -import Mathlib.RingTheory.MvPowerSeries.Substitution -import Mathlib.RingTheory.PowerSeries.Evaluation +public import Mathlib.RingTheory.MvPowerSeries.Substitution +public import Mathlib.RingTheory.PowerSeries.Evaluation /-! # Substitutions in power series @@ -20,6 +21,8 @@ do not immediately apply and a “primed” version is provided here. -/ +@[expose] public section + namespace PowerSeries variable diff --git a/Mathlib/RingTheory/PowerSeries/Trunc.lean b/Mathlib/RingTheory/PowerSeries/Trunc.lean index 0d1d14792ed6b7..c4b83b63367e4f 100644 --- a/Mathlib/RingTheory/PowerSeries/Trunc.lean +++ b/Mathlib/RingTheory/PowerSeries/Trunc.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ -import Mathlib.Algebra.Polynomial.Coeff -import Mathlib.Algebra.Polynomial.Degree.Lemmas -import Mathlib.RingTheory.PowerSeries.Basic +module + +public import Mathlib.Algebra.Polynomial.Coeff +public import Mathlib.Algebra.Polynomial.Degree.Lemmas +public import Mathlib.RingTheory.PowerSeries.Basic /-! @@ -17,6 +19,8 @@ and `0` otherwise. -/ +@[expose] public section + noncomputable section open Polynomial @@ -33,19 +37,29 @@ section Trunc variable [Semiring R] open Finset Nat -/-- The `n`th truncation of a formal power series to a polynomial -/ -def trunc (n : ℕ) (φ : R⟦X⟧) : R[X] := +private def trunc_aux (n : ℕ) (φ : R⟦X⟧) : R[X] := ∑ m ∈ Ico 0 n, Polynomial.monomial m (coeff m φ) +private theorem coeff_trunc_aux (m) (n) (φ : R⟦X⟧) : + (trunc_aux n φ).coeff m = if m < n then coeff m φ else 0 := by + simp [trunc_aux, Polynomial.coeff_monomial] + +/-- The `n`th truncation of a formal power series to a polynomial. -/ +def trunc (n : ℕ) : R⟦X⟧ →ₗ[R] R[X] where + toFun := trunc_aux n + map_add' φ ψ := Polynomial.ext fun m => by + simp only [coeff_trunc_aux, Polynomial.coeff_add] + split_ifs with H + · rfl + · rw [zero_add] + map_smul' t φ := by ext; simp [trunc_aux, Polynomial.coeff_monomial] + +lemma trunc_apply (n : ℕ) (φ : R⟦X⟧) : + trunc n φ = ∑ m ∈ Ico 0 n, Polynomial.monomial m (coeff m φ) := rfl + theorem coeff_trunc (m) (n) (φ : R⟦X⟧) : (trunc n φ).coeff m = if m < n then coeff m φ else 0 := by - simp [trunc, Polynomial.coeff_monomial] - -@[simp] -theorem trunc_zero (n) : trunc n (0 : R⟦X⟧) = 0 := - Polynomial.ext fun m => by - rw [coeff_trunc, LinearMap.map_zero, Polynomial.coeff_zero] - split_ifs <;> rfl + simp [trunc, coeff_trunc_aux] @[simp] theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 := @@ -58,17 +72,9 @@ theorem trunc_C (n) (a : R) : trunc (n + 1) (C a) = Polynomial.C a := rw [coeff_trunc, coeff_C, Polynomial.coeff_C] split_ifs with H <;> first | rfl | try simp_all -@[simp] -theorem trunc_add (n) (φ ψ : R⟦X⟧) : trunc n (φ + ψ) = trunc n φ + trunc n ψ := - Polynomial.ext fun m => by - simp only [coeff_trunc, Polynomial.coeff_add] - split_ifs with H - · rfl - · rw [zero_add] - theorem trunc_succ (f : R⟦X⟧) (n : ℕ) : trunc n.succ f = trunc n f + Polynomial.monomial n (coeff n f) := by - rw [trunc, Ico_zero_eq_range, sum_range_succ, trunc, Ico_zero_eq_range] + rw [trunc_apply, Ico_zero_eq_range, sum_range_succ, trunc_apply, Ico_zero_eq_range] theorem natDegree_trunc_lt (f : R⟦X⟧) (n) : (trunc (n + 1) f).natDegree < n + 1 := by rw [Nat.lt_succ_iff, natDegree_le_iff_coeff_eq_zero] @@ -151,6 +157,13 @@ lemma eq_X_pow_mul_shift_add_trunc (n : ℕ) (f : R⟦X⟧) : f = X ^ n * (mk fun i ↦ coeff (i + n) f) + (f.trunc n : R⟦X⟧) := by rw [← (commute_X_pow _ n).eq, ← eq_shift_mul_X_pow_add_trunc] +lemma monomial_eq_C_mul_X_pow (r : R) (n : ℕ) : monomial n r = C r * X ^ n := by + ext; simp [coeff_X_pow, coeff_monomial] + +@[simp] +lemma trunc_X_pow_self_mul (n : ℕ) (p : R⟦X⟧) : (X ^ n * p).trunc n = 0 := by + ext; simp +contextual [coeff_trunc, coeff_X_pow_mul'] + end Trunc section Trunc @@ -233,6 +246,17 @@ theorem coeff_mul_eq_coeff_trunc_mul_trunc {d n} (f g) (h : d < n) : end Trunc +section Ring + +variable [Ring R] + +@[simp] +lemma trunc_sub (n : ℕ) (φ ψ : R⟦X⟧) : trunc n (φ - ψ) = trunc n φ - trunc n ψ := by + ext i + simp + +end Ring + section Map variable {S : Type*} [Semiring R] [Semiring S] (f : R →+* S) diff --git a/Mathlib/RingTheory/PowerSeries/WeierstrassPreparation.lean b/Mathlib/RingTheory/PowerSeries/WeierstrassPreparation.lean index 5c2c989df0e0ed..abeb03a2b9d23c 100644 --- a/Mathlib/RingTheory/PowerSeries/WeierstrassPreparation.lean +++ b/Mathlib/RingTheory/PowerSeries/WeierstrassPreparation.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.Polynomial.Eisenstein.Distinguished -import Mathlib.RingTheory.PowerSeries.CoeffMulMem -import Mathlib.RingTheory.PowerSeries.Inverse -import Mathlib.RingTheory.PowerSeries.Trunc +module + +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.Polynomial.Eisenstein.Distinguished +public import Mathlib.RingTheory.PowerSeries.CoeffMulMem +public import Mathlib.RingTheory.PowerSeries.Inverse +public import Mathlib.RingTheory.PowerSeries.Trunc /-! @@ -87,6 +89,8 @@ such ring has only one maximal ideal, and hence it is a complete local ring. -/ +@[expose] public section + open scoped Polynomial namespace PowerSeries diff --git a/Mathlib/RingTheory/PowerSeries/WellKnown.lean b/Mathlib/RingTheory/PowerSeries/WellKnown.lean index 80147ffe221538..fb1e355f7963e8 100644 --- a/Mathlib/RingTheory/PowerSeries/WellKnown.lean +++ b/Mathlib/RingTheory/PowerSeries/WellKnown.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Algebra.Rat -import Mathlib.Data.Nat.Cast.Field -import Mathlib.RingTheory.PowerSeries.Basic +module + +public import Mathlib.Algebra.Algebra.Rat +public import Mathlib.Data.Nat.Cast.Field +public import Mathlib.RingTheory.PowerSeries.Basic /-! # Definition of well-known power series @@ -24,6 +26,8 @@ In this file we define the following power series: exponential functions. -/ +@[expose] public section + namespace PowerSeries diff --git a/Mathlib/RingTheory/Presentation.lean b/Mathlib/RingTheory/Presentation.lean index 899423053dea3b..5f34fa339e3cfd 100644 --- a/Mathlib/RingTheory/Presentation.lean +++ b/Mathlib/RingTheory/Presentation.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Extension.Presentation.Basic +module + +public import Mathlib.RingTheory.Extension.Presentation.Basic deprecated_module (since := "2025-05-11") diff --git a/Mathlib/RingTheory/Prime.lean b/Mathlib/RingTheory/Prime.lean index 26748fbbde3d52..2cf67e14cf83d3 100644 --- a/Mathlib/RingTheory/Prime.lean +++ b/Mathlib/RingTheory/Prime.lean @@ -3,17 +3,21 @@ Copyright (c) 2020 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Algebra.Order.Group.Unbundled.Abs -import Mathlib.Algebra.Prime.Defs -import Mathlib.Algebra.Ring.Units -import Mathlib.Algebra.BigOperators.Group.Finset.Basic +module + +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Algebra.Order.Group.Unbundled.Abs +public import Mathlib.Algebra.Prime.Defs +public import Mathlib.Algebra.Ring.Units +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic /-! # Prime elements in rings This file contains lemmas about prime elements of commutative rings. -/ +@[expose] public section + section CancelCommMonoidWithZero diff --git a/Mathlib/RingTheory/PrincipalIdealDomain.lean b/Mathlib/RingTheory/PrincipalIdealDomain.lean index b1fb5b83c01883..b99b0d7832fc3e 100644 --- a/Mathlib/RingTheory/PrincipalIdealDomain.lean +++ b/Mathlib/RingTheory/PrincipalIdealDomain.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Morenikeji Neri -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.EuclideanDomain.Field -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.RingTheory.Ideal.Prod -import Mathlib.RingTheory.Ideal.Nonunits -import Mathlib.RingTheory.Noetherian.UniqueFactorizationDomain +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.EuclideanDomain.Field +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.RingTheory.Ideal.Prod +public import Mathlib.RingTheory.Ideal.Nonunits +public import Mathlib.RingTheory.Noetherian.UniqueFactorizationDomain /-! # Principal ideal rings, principal ideal domains, and Bézout rings @@ -36,6 +38,8 @@ Theorems about PID's are in the `PrincipalIdealRing` namespace. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/PrincipalIdealDomainOfPrime.lean b/Mathlib/RingTheory/PrincipalIdealDomainOfPrime.lean index 3ccf12c9514cf1..ae6993605eee1f 100644 --- a/Mathlib/RingTheory/PrincipalIdealDomainOfPrime.lean +++ b/Mathlib/RingTheory/PrincipalIdealDomainOfPrime.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.RingTheory.Ideal.Oka -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.RingTheory.Ideal.Oka +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Principal ideal domains and prime ideals @@ -15,6 +17,8 @@ import Mathlib.RingTheory.PrincipalIdealDomain ring. -/ +@[expose] public section + variable {R : Type*} [CommSemiring R] namespace Ideal diff --git a/Mathlib/RingTheory/QuotSMulTop.lean b/Mathlib/RingTheory/QuotSMulTop.lean index 5b60e2a8e0aaa1..2e2ffa03a99999 100644 --- a/Mathlib/RingTheory/QuotSMulTop.lean +++ b/Mathlib/RingTheory/QuotSMulTop.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Brendan Murphy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Brendan Murphy -/ -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.TensorProduct.Quotient -import Mathlib.LinearAlgebra.TensorProduct.RightExactness +module + +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.TensorProduct.Quotient +public import Mathlib.LinearAlgebra.TensorProduct.RightExactness /-! # Reducing a module modulo an element of the ring @@ -21,6 +23,8 @@ of fiddling with simple tensors. module, commutative algebra -/ +@[expose] public section + open scoped Pointwise variable {R} [CommRing R] (r : R) (M : Type*) {M' M''} diff --git a/Mathlib/RingTheory/Radical.lean b/Mathlib/RingTheory/Radical.lean index d34f6e5bbcf56f..0b7a433b6b817e 100644 --- a/Mathlib/RingTheory/Radical.lean +++ b/Mathlib/RingTheory/Radical.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Jineon Baek, Seewoo Lee. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jineon Baek, Seewoo Lee, Bhavik Mehta, Arend Mellendijk -/ -import Mathlib.Algebra.EuclideanDomain.Basic -import Mathlib.Algebra.Order.Group.Finset -import Mathlib.RingTheory.Coprime.Lemmas -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors -import Mathlib.RingTheory.UniqueFactorizationDomain.Nat -import Mathlib.RingTheory.Nilpotent.Basic -import Mathlib.Data.Nat.PrimeFin -import Mathlib.Algebra.Squarefree.Basic +module + +public import Mathlib.Algebra.EuclideanDomain.Basic +public import Mathlib.Algebra.Order.Group.Finset +public import Mathlib.RingTheory.Coprime.Lemmas +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +public import Mathlib.RingTheory.UniqueFactorizationDomain.Nat +public import Mathlib.RingTheory.Nilpotent.Basic +public import Mathlib.Data.Nat.PrimeFin +public import Mathlib.Algebra.Squarefree.Basic /-! # Radical of an element of a unique factorization normalization monoid @@ -54,6 +56,8 @@ This is different from the radical of an ideal. `Ideal.radical (Ideal.span {a}) = Ideal.span {radical a}`. -/ +@[expose] public section + noncomputable section namespace UniqueFactorizationMonoid diff --git a/Mathlib/RingTheory/ReesAlgebra.lean b/Mathlib/RingTheory/ReesAlgebra.lean index bac6110bf8b1e3..416fd16cf2703e 100644 --- a/Mathlib/RingTheory/ReesAlgebra.lean +++ b/Mathlib/RingTheory/ReesAlgebra.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.BigOperators -import Mathlib.RingTheory.FiniteType +module + +public import Mathlib.RingTheory.Ideal.BigOperators +public import Mathlib.RingTheory.FiniteType /-! @@ -23,6 +25,8 @@ implies that the rees algebra over a Noetherian ring is still Noetherian. -/ +@[expose] public section + universe u v @@ -83,7 +87,7 @@ theorem monomial_mem_adjoin_monomial {I : Ideal R} {n : ℕ} {r : R} (hr : r ∈ rw [add_comm n 1, smul_eq_mul, ← monomial_mul_monomial] exact Subalgebra.mul_mem _ (Algebra.subset_adjoin (Set.mem_image_of_mem _ hr)) (hn hs) · intro x y hx hy - rw [monomial_add] + rw [map_add] exact Subalgebra.add_mem _ hx hy theorem adjoin_monomial_eq_reesAlgebra : diff --git a/Mathlib/RingTheory/Regular/Category.lean b/Mathlib/RingTheory/Regular/Category.lean index f97a8c3650e588..58af83ccc63c96 100644 --- a/Mathlib/RingTheory/Regular/Category.lean +++ b/Mathlib/RingTheory/Regular/Category.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jingting Wang, Wanyi He, Nailin Guan -/ -import Mathlib.Algebra.Homology.ShortComplex.ModuleCat -import Mathlib.RingTheory.QuotSMulTop +module + +public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +public import Mathlib.RingTheory.QuotSMulTop /-! # Categorical constructions for `IsSMulRegular` -/ +@[expose] public section + universe u v w variable {R : Type u} [CommRing R] (M : ModuleCat.{v} R) diff --git a/Mathlib/RingTheory/Regular/Depth.lean b/Mathlib/RingTheory/Regular/Depth.lean index bee3d072c3425e..aa9731936db71c 100644 --- a/Mathlib/RingTheory/Regular/Depth.lean +++ b/Mathlib/RingTheory/Regular/Depth.lean @@ -3,13 +3,15 @@ Copyright (c) 2025 Nailin Guan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nailin Guan, Yi Song -/ -import Mathlib.Algebra.Module.FinitePresentation -import Mathlib.LinearAlgebra.Dual.Lemmas -import Mathlib.RingTheory.Ideal.AssociatedPrime.Finiteness -import Mathlib.RingTheory.Ideal.AssociatedPrime.Localization -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.Regular.IsSMulRegular -import Mathlib.RingTheory.Support +module + +public import Mathlib.Algebra.Module.FinitePresentation +public import Mathlib.LinearAlgebra.Dual.Lemmas +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Finiteness +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Localization +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.Regular.IsSMulRegular +public import Mathlib.RingTheory.Support /-! @@ -19,13 +21,15 @@ Let `M` and `N` be `R`-modules. In this section we prove that `Hom(N,M)` is subs there exist `r : R`, such that `IsSMulRegular M r` and `r ∈ ann(N)`. This is the case if `Depth[I](M) = 0`. -# Main Results +## Main statements * `IsSMulRegular.subsingleton_linearMap_iff` : for `R` module `N M`, `Hom(N, M) = 0` iff there is a `M`-regular in `Module.annihilator R N`. -/ +@[expose] public section + open IsLocalRing LinearMap Module namespace IsSMulRegular diff --git a/Mathlib/RingTheory/Regular/Flat.lean b/Mathlib/RingTheory/Regular/Flat.lean index 2d5d2fa7c93b92..af67d2ded74427 100644 --- a/Mathlib/RingTheory/Regular/Flat.lean +++ b/Mathlib/RingTheory/Regular/Flat.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Yongle Hu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongle Hu, Nailin Guan -/ -import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic -import Mathlib.RingTheory.Flat.Localization -import Mathlib.RingTheory.Regular.RegularSequence +module + +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic +public import Mathlib.RingTheory.Flat.Localization +public import Mathlib.RingTheory.Regular.RegularSequence /-! # `RingTheory.Sequence.IsWeaklyRegular` is stable under flat base change @@ -17,6 +19,8 @@ import Mathlib.RingTheory.Regular.RegularSequence `N`-sequence. -/ +@[expose] public section + namespace RingTheory.Sequence open Module diff --git a/Mathlib/RingTheory/Regular/IsSMulRegular.lean b/Mathlib/RingTheory/Regular/IsSMulRegular.lean index 8057768526465e..a64e98983532d9 100644 --- a/Mathlib/RingTheory/Regular/IsSMulRegular.lean +++ b/Mathlib/RingTheory/Regular/IsSMulRegular.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Brendan Murphy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Brendan Murphy -/ -import Mathlib.Algebra.Module.Torsion.Basic -import Mathlib.RingTheory.Flat.Basic -import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic -import Mathlib.RingTheory.QuotSMulTop +module + +public import Mathlib.Algebra.Module.Torsion.Basic +public import Mathlib.RingTheory.Flat.Basic +public import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic +public import Mathlib.RingTheory.QuotSMulTop /-! # Lemmas about the `IsSMulRegular` Predicate @@ -24,6 +26,8 @@ it's supposed to import a minimal amount of the algebraic hierarchy. module, regular element, commutative algebra -/ +@[expose] public section + section Congr variable {R S M N} [Semiring R] [Semiring S] {σ : R →+* S} {σ' : S →+* R} diff --git a/Mathlib/RingTheory/Regular/RegularSequence.lean b/Mathlib/RingTheory/Regular/RegularSequence.lean index eec6fdcaceada0..60d975b2fdff36 100644 --- a/Mathlib/RingTheory/Regular/RegularSequence.lean +++ b/Mathlib/RingTheory/Regular/RegularSequence.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Brendan Murphy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Brendan Murphy -/ -import Mathlib.RingTheory.Artinian.Module -import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic -import Mathlib.RingTheory.Nakayama -import Mathlib.RingTheory.Regular.IsSMulRegular +module + +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.Nakayama +public import Mathlib.RingTheory.Regular.IsSMulRegular /-! # Regular sequences and weakly regular sequences @@ -23,6 +25,8 @@ TODO: Koszul regular sequences, H_1-regular sequences, quasi-regular sequences, module, regular element, regular sequence, commutative algebra -/ +@[expose] public section + universe u v open scoped Pointwise diff --git a/Mathlib/RingTheory/RingHom/Bijective.lean b/Mathlib/RingTheory/RingHom/Bijective.lean index d432ac63a971e6..0891422603ff6b 100644 --- a/Mathlib/RingTheory/RingHom/Bijective.lean +++ b/Mathlib/RingTheory/RingHom/Bijective.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.LocalProperties.Exactness +module + +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.LocalProperties.Exactness /-! # Meta properties of bijective ring homomorphisms @@ -17,6 +19,8 @@ We don't define a `RingHom.Bijective` predicate, but use `fun f ↦ Function.Bij the ring hom property. -/ +@[expose] public section + open TensorProduct variable {R S : Type*} [CommRing R] [CommRing S] diff --git a/Mathlib/RingTheory/RingHom/Etale.lean b/Mathlib/RingTheory/RingHom/Etale.lean index e4fe169fbaad6c..d1850983db333b 100644 --- a/Mathlib/RingTheory/RingHom/Etale.lean +++ b/Mathlib/RingTheory/RingHom/Etale.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.RingHom.Smooth -import Mathlib.RingTheory.RingHom.Unramified +module + +public import Mathlib.RingTheory.RingHom.Smooth +public import Mathlib.RingTheory.RingHom.Unramified /-! # Étale ring homomorphisms @@ -12,6 +14,8 @@ import Mathlib.RingTheory.RingHom.Unramified We show the meta properties of étale morphisms. -/ +@[expose] public section + universe u namespace RingHom diff --git a/Mathlib/RingTheory/RingHom/FaithfullyFlat.lean b/Mathlib/RingTheory/RingHom/FaithfullyFlat.lean index 6a778a0a331526..da8d951434f67c 100644 --- a/Mathlib/RingTheory/RingHom/FaithfullyFlat.lean +++ b/Mathlib/RingTheory/RingHom/FaithfullyFlat.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Joël Riou -/ -import Mathlib.RingTheory.RingHom.Flat +module + +public import Mathlib.RingTheory.RingHom.Flat /-! # Faithfully flat ring maps @@ -12,6 +14,8 @@ A ring map `f : R →+* S` is faithfully flat if `S` is faithfully flat as an `R the same as being flat and a surjection on prime spectra. -/ +@[expose] public section + namespace RingHom variable {R S : Type*} [CommRing R] [CommRing S] {f : R →+* S} diff --git a/Mathlib/RingTheory/RingHom/Finite.lean b/Mathlib/RingTheory/RingHom/Finite.lean index d0359cff5c6399..cf54b490cfb3cc 100644 --- a/Mathlib/RingTheory/RingHom/Finite.lean +++ b/Mathlib/RingTheory/RingHom/Finite.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Localization.Integer -import Mathlib.RingTheory.TensorProduct.Finite +module + +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Localization.Integer +public import Mathlib.RingTheory.TensorProduct.Finite /-! @@ -22,6 +24,8 @@ Let `R` be a commutative ring, `S` is an `R`-algebra, `M` be a submonoid of `R`. -/ +@[expose] public section + namespace RingHom diff --git a/Mathlib/RingTheory/RingHom/FinitePresentation.lean b/Mathlib/RingTheory/RingHom/FinitePresentation.lean index 78e595b7a3df33..4e5525628fcd68 100644 --- a/Mathlib/RingTheory/RingHom/FinitePresentation.lean +++ b/Mathlib/RingTheory/RingHom/FinitePresentation.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Localization.Finiteness -import Mathlib.RingTheory.RingHom.FiniteType -import Mathlib.RingTheory.Localization.Away.AdjoinRoot +module + +public import Mathlib.RingTheory.Localization.Finiteness +public import Mathlib.RingTheory.RingHom.FiniteType +public import Mathlib.RingTheory.Localization.Away.AdjoinRoot /-! @@ -15,6 +17,8 @@ The main result is `RingHom.finitePresentation_isLocal`. -/ +@[expose] public section + open scoped Pointwise TensorProduct namespace Algebra.FinitePresentation diff --git a/Mathlib/RingTheory/RingHom/FiniteType.lean b/Mathlib/RingTheory/RingHom/FiniteType.lean index ae9804dd53b0be..95781bfe42d72a 100644 --- a/Mathlib/RingTheory/RingHom/FiniteType.lean +++ b/Mathlib/RingTheory/RingHom/FiniteType.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.FiniteStability -import Mathlib.RingTheory.Localization.InvSubmonoid -import Mathlib.RingTheory.RingHom.Finite +module + +public import Mathlib.RingTheory.FiniteStability +public import Mathlib.RingTheory.Localization.InvSubmonoid +public import Mathlib.RingTheory.RingHom.Finite /-! @@ -23,6 +25,8 @@ Let `R` be a commutative ring, `S` is an `R`-algebra, `M` be a submonoid of `R`. -/ +@[expose] public section + section Algebra open scoped Pointwise TensorProduct diff --git a/Mathlib/RingTheory/RingHom/Flat.lean b/Mathlib/RingTheory/RingHom/Flat.lean index 28cada86f15861..517ba0a03b9a86 100644 --- a/Mathlib/RingTheory/RingHom/Flat.lean +++ b/Mathlib/RingTheory/RingHom/Flat.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.Flat.Localization -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Ideal.GoingDown +module + +public import Mathlib.RingTheory.Flat.Localization +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Ideal.GoingDown /-! # Flat ring homomorphisms @@ -14,6 +16,8 @@ In this file we define flat ring homomorphisms and show their meta properties. -/ +@[expose] public section + universe u v open TensorProduct diff --git a/Mathlib/RingTheory/RingHom/Injective.lean b/Mathlib/RingTheory/RingHom/Injective.lean index 07e8adfbcc28db..7975629adde771 100644 --- a/Mathlib/RingTheory/RingHom/Injective.lean +++ b/Mathlib/RingTheory/RingHom/Injective.lean @@ -3,10 +3,14 @@ Copyright (c) 2024 Andrew Yang, Qi Ge, Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Qi Ge, Christian Merten -/ -import Mathlib.RingTheory.RingHomProperties +module + +public import Mathlib.RingTheory.RingHomProperties /-! # Meta properties of injective ring homomorphisms -/ +@[expose] public section + lemma _root_.RingHom.injective_stableUnderComposition : RingHom.StableUnderComposition (fun f ↦ Function.Injective f) := by intro R S T _ _ _ f g hf hg diff --git a/Mathlib/RingTheory/RingHom/Integral.lean b/Mathlib/RingTheory/RingHom/Integral.lean index e7c90de55906f1..6acf44867d309c 100644 --- a/Mathlib/RingTheory/RingHom/Integral.lean +++ b/Mathlib/RingTheory/RingHom/Integral.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Localization.Integral +module + +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Localization.Integral /-! @@ -12,6 +14,8 @@ import Mathlib.RingTheory.Localization.Integral -/ +@[expose] public section + namespace RingHom diff --git a/Mathlib/RingTheory/RingHom/Locally.lean b/Mathlib/RingTheory/RingHom/Locally.lean index 7305d2efb025ac..125c30622511f8 100644 --- a/Mathlib/RingTheory/RingHom/Locally.lean +++ b/Mathlib/RingTheory/RingHom/Locally.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Localization.BaseChange -import Mathlib.RingTheory.Localization.Away.Lemmas +module + +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Localization.BaseChange +public import Mathlib.RingTheory.Localization.Away.Lemmas /-! # Target local closure of ring homomorphism properties @@ -40,6 +42,8 @@ composition, base change, etc., so is `Locally P`. -/ +@[expose] public section + universe u v open TensorProduct diff --git a/Mathlib/RingTheory/RingHom/OpenImmersion.lean b/Mathlib/RingTheory/RingHom/OpenImmersion.lean index 6e32b610e33235..45d7eb59fd15a1 100644 --- a/Mathlib/RingTheory/RingHom/OpenImmersion.lean +++ b/Mathlib/RingTheory/RingHom/OpenImmersion.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ +module -import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.LocalProperties.Basic /-! # Standard Open Immersion @@ -13,6 +14,8 @@ morphism is a localization map away from some element. We also define the equiva `Algebra.IsStandardOpenImmersion`. -/ +@[expose] public section + universe u namespace Algebra diff --git a/Mathlib/RingTheory/RingHom/Smooth.lean b/Mathlib/RingTheory/RingHom/Smooth.lean index a917deca77c38b..e015ec802a9061 100644 --- a/Mathlib/RingTheory/RingHom/Smooth.lean +++ b/Mathlib/RingTheory/RingHom/Smooth.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.RingHom.FinitePresentation -import Mathlib.RingTheory.Smooth.Locus +module + +public import Mathlib.RingTheory.RingHom.FinitePresentation +public import Mathlib.RingTheory.Smooth.Locus /-! # Smooth ring homomorphisms @@ -13,6 +15,8 @@ In this file we define smooth ring homomorphisms and show their meta properties. -/ +@[expose] public section + universe u variable {R S : Type*} [CommRing R] [CommRing S] diff --git a/Mathlib/RingTheory/RingHom/StandardSmooth.lean b/Mathlib/RingTheory/RingHom/StandardSmooth.lean index 67e6744e580f80..a727db63b13434 100644 --- a/Mathlib/RingTheory/RingHom/StandardSmooth.lean +++ b/Mathlib/RingTheory/RingHom/StandardSmooth.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.RingTheory.Smooth.StandardSmooth -import Mathlib.Tactic.Algebraize +module + +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.RingTheory.Smooth.StandardSmooth +public import Mathlib.Tactic.Algebraize /-! # Standard smooth ring homomorphisms @@ -27,6 +29,8 @@ This contribution was created as part of the AIM workshop "Formalizing algebraic in June 2024. -/ + +@[expose] public section universe t t' w w' u v variable (n m : ℕ) diff --git a/Mathlib/RingTheory/RingHom/Surjective.lean b/Mathlib/RingTheory/RingHom/Surjective.lean index d220134f6a6109..040f254aea335d 100644 --- a/Mathlib/RingTheory/RingHom/Surjective.lean +++ b/Mathlib/RingTheory/RingHom/Surjective.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalProperties.Basic +module + +public import Mathlib.RingTheory.LocalProperties.Basic /-! @@ -21,6 +23,8 @@ Let `R` be a commutative ring, `M` be a submonoid of `R`. -/ +@[expose] public section + namespace RingHom diff --git a/Mathlib/RingTheory/RingHom/Unramified.lean b/Mathlib/RingTheory/RingHom/Unramified.lean index 7e48c201c1c297..4e58b61312669d 100644 --- a/Mathlib/RingTheory/RingHom/Unramified.lean +++ b/Mathlib/RingTheory/RingHom/Unramified.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Unramified.Locus -import Mathlib.RingTheory.LocalProperties.Basic +module + +public import Mathlib.RingTheory.Unramified.Locus +public import Mathlib.RingTheory.LocalProperties.Basic /-! @@ -12,6 +14,8 @@ import Mathlib.RingTheory.LocalProperties.Basic -/ +@[expose] public section + namespace RingHom variable {R : Type*} {S : Type*} [CommRing R] [CommRing S] @@ -97,7 +101,7 @@ lemma propertyIsLocal : have H : Submonoid.powers r ≤ (Submonoid.powers (f r)).comap f := by rintro x ⟨n, rfl⟩; exact ⟨n, by simp⟩ have : IsScalarTower R R' S' := .of_algebraMap_eq' (IsLocalization.map_comp H).symm - exact Algebra.FormallyUnramified.of_comp R R' S' + exact Algebra.FormallyUnramified.of_restrictScalars R R' S' · exact ofLocalizationSpanTarget · exact ofLocalizationSpanTarget.ofLocalizationSpan (stableUnderComposition.stableUnderCompositionWithLocalizationAway diff --git a/Mathlib/RingTheory/RingHomProperties.lean b/Mathlib/RingTheory/RingHomProperties.lean index 1cbb88501e6d1b..06497cf1be4203 100644 --- a/Mathlib/RingTheory/RingHomProperties.lean +++ b/Mathlib/RingTheory/RingHomProperties.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.Algebra.Category.Ring.Constructions -import Mathlib.Algebra.Category.Ring.Colimits -import Mathlib.CategoryTheory.Iso -import Mathlib.CategoryTheory.MorphismProperty.Limits -import Mathlib.RingTheory.Localization.Away.Basic -import Mathlib.RingTheory.IsTensorProduct +module + +public import Mathlib.Algebra.Category.Ring.Constructions +public import Mathlib.Algebra.Category.Ring.Colimits +public import Mathlib.CategoryTheory.Iso +public import Mathlib.CategoryTheory.MorphismProperty.Limits +public import Mathlib.RingTheory.Localization.Away.Basic +public import Mathlib.RingTheory.IsTensorProduct /-! # Properties of ring homomorphisms @@ -24,6 +26,8 @@ The following meta-properties of predicates on ring homomorphisms are defined -/ +@[expose] public section + universe u diff --git a/Mathlib/RingTheory/RingInvo.lean b/Mathlib/RingTheory/RingInvo.lean index d645dd03c33d5d..91840656467cec 100644 --- a/Mathlib/RingTheory/RingInvo.lean +++ b/Mathlib/RingTheory/RingInvo.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow, Kenny Lau -/ -import Mathlib.Algebra.Ring.Equiv -import Mathlib.Algebra.Ring.Opposite +module + +public import Mathlib.Algebra.Ring.Equiv +public import Mathlib.Algebra.Ring.Opposite /-! # Ring involutions @@ -25,6 +27,8 @@ We provide a coercion to a function `R → Rᵐᵒᵖ`. Ring involution -/ +@[expose] public section + variable {F : Type*} (R : Type*) /-- A ring involution -/ diff --git a/Mathlib/RingTheory/RootsOfUnity/AlgebraicallyClosed.lean b/Mathlib/RingTheory/RootsOfUnity/AlgebraicallyClosed.lean index d9fe8ca5912457..dd8f688a95ef89 100644 --- a/Mathlib/RingTheory/RootsOfUnity/AlgebraicallyClosed.lean +++ b/Mathlib/RingTheory/RootsOfUnity/AlgebraicallyClosed.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity -import Mathlib.NumberTheory.Cyclotomic.Basic +module + +public import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity +public import Mathlib.NumberTheory.Cyclotomic.Basic /-! # Instances for HasEnoughRootsOfUnity @@ -14,6 +16,8 @@ and `n` is not divisible by the characteristic. In particular, when `F` has char this hold for all `n ≠ 0`. -/ +@[expose] public section + variable (F : Type*) [Field F] (n k : ℕ) [NeZero (n : F)] namespace IsSepClosed diff --git a/Mathlib/RingTheory/RootsOfUnity/Basic.lean b/Mathlib/RingTheory/RootsOfUnity/Basic.lean index 0e97c722855d14..e6a9ee49b87d10 100644 --- a/Mathlib/RingTheory/RootsOfUnity/Basic.lean +++ b/Mathlib/RingTheory/RootsOfUnity/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.CharP.Reduced -import Mathlib.RingTheory.IntegralDomain +module + +public import Mathlib.Algebra.CharP.Reduced +public import Mathlib.RingTheory.IntegralDomain -- TODO: remove Mathlib.Algebra.CharP.Reduced and move the last two lemmas to Lemmas /-! @@ -34,6 +36,8 @@ Note that `rootsOfUnity 0 M` is the top subgroup of `Mˣ` (as the condition `ζ^ satisfied for all units). -/ +@[expose] public section + noncomputable section open Polynomial diff --git a/Mathlib/RingTheory/RootsOfUnity/Complex.lean b/Mathlib/RingTheory/RootsOfUnity/Complex.lean index 932ecc497a1f47..9097a19cf39bfc 100644 --- a/Mathlib/RingTheory/RootsOfUnity/Complex.lean +++ b/Mathlib/RingTheory/RootsOfUnity/Complex.lean @@ -1,11 +1,14 @@ /- Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Johan Commelin +Authors: Johan Commelin, Snir Broshi -/ -import Mathlib.Analysis.SpecialFunctions.Complex.Log -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots -import Mathlib.Tactic.Rify +module + +public import Mathlib.Analysis.SpecialFunctions.Complex.Log +public import Mathlib.RingTheory.Int.Basic +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +public import Mathlib.Tactic.Rify /-! # Complex roots of unity @@ -22,6 +25,8 @@ are exactly the complex numbers `exp (2 * π * I * (i / n))` for `i ∈ Finset.r -/ +@[expose] public section + namespace Complex @@ -29,7 +34,7 @@ open Polynomial Real open scoped Nat Real -theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) : +theorem isPrimitiveRoot_exp_of_isCoprime (i : ℤ) (n : ℕ) (h0 : n ≠ 0) (hi : IsCoprime i n) : IsPrimitiveRoot (exp (2 * π * I * (i / n))) n := by rw [IsPrimitiveRoot.iff_def] simp only [← exp_nat_mul, exp_eq_one_iff] @@ -41,8 +46,40 @@ theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprim rintro l k hk field_simp at hk norm_cast at hk - have : n ∣ l * i := by rw [← Int.natCast_dvd_natCast, hk]; apply dvd_mul_right - exact hi.symm.dvd_of_dvd_mul_right this + exact Int.natCast_dvd_natCast.mp <| hi.symm.dvd_of_dvd_mul_right <| hk ▸ dvd_mul_right .. + +theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) : + IsPrimitiveRoot (exp (2 * π * I * (i / n))) n := + isPrimitiveRoot_exp_of_isCoprime _ _ h0 hi.isCoprime + +theorem isPrimitiveRoot_exp_rat (q : ℚ) : IsPrimitiveRoot (exp (2 * π * I * q)) q.den := by + convert isPrimitiveRoot_exp_of_isCoprime _ _ q.den_nz <| + Int.isCoprime_iff_nat_coprime.mpr q.reduced + nth_rw 1 [← Rat.num_div_den q] + simp + +theorem isPrimitiveRoot_exp_rat_of_even_num (q : ℚ) (h : Even q.num) : + IsPrimitiveRoot (exp (π * I * q)) q.den := by + have ⟨n, hn⟩ := even_iff_exists_two_nsmul _ |>.mp h + convert isPrimitiveRoot_exp_rat (n / q.den) using 1 + · nth_rw 1 [← q.num_div_den, hn, Int.nsmul_eq_mul] + push_cast + ring_nf + · rw [← Int.cast_natCast, ← Rat.divInt_eq_div, ← Rat.mk_eq_divInt (nz := by simp)] + apply Nat.Coprime.coprime_mul_left (k := 2) + convert q.reduced + grind + +theorem isPrimitiveRoot_exp_rat_of_odd_num (q : ℚ) (h : Odd q.num) : + IsPrimitiveRoot (exp (π * I * q)) (2 * q.den) := by + convert isPrimitiveRoot_exp_rat (q / 2) using 1 + · push_cast + ring_nf + · nth_rw 2 [← q.num_div_den] + rw [mul_comm, div_div, ← Int.cast_ofNat, ← Int.cast_natCast, ← Int.cast_mul, + ← Rat.divInt_eq_div, ← Nat.cast_ofNat (R := ℤ), ← Nat.cast_mul, + ← Rat.mk_eq_divInt (nz := by simp) + (c := Nat.Coprime.mul_right q.reduced h.natAbs.coprime_two_right)] theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 * π * I / n)) n := by simpa only [Nat.cast_one, one_div] using diff --git a/Mathlib/RingTheory/RootsOfUnity/CyclotomicUnits.lean b/Mathlib/RingTheory/RootsOfUnity/CyclotomicUnits.lean index dae846f2e92cdb..bd31bf0d7ac550 100644 --- a/Mathlib/RingTheory/RootsOfUnity/CyclotomicUnits.lean +++ b/Mathlib/RingTheory/RootsOfUnity/CyclotomicUnits.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best, Riccardo Brasca -/ -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +module + +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots /-! # Cyclotomic units. @@ -29,6 +31,8 @@ Often, `Associated a b` is everything one needs, and it is more convenient to us other version for completeness. -/ +@[expose] public section + open Polynomial Finset Nat variable {n i j p : ℕ} {A K : Type*} {ζ : A} diff --git a/Mathlib/RingTheory/RootsOfUnity/EnoughRootsOfUnity.lean b/Mathlib/RingTheory/RootsOfUnity/EnoughRootsOfUnity.lean index e989b06f602aa9..873e7f0f2e67a9 100644 --- a/Mathlib/RingTheory/RootsOfUnity/EnoughRootsOfUnity.lean +++ b/Mathlib/RingTheory/RootsOfUnity/EnoughRootsOfUnity.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +module + +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots /-! # Commutative monoids with enough roots of unity @@ -15,6 +17,8 @@ targets for homomorphisms from groups of exponent (dividing) `n`; for example, the homomorphisms can then be used to separate elements of the source group. -/ +@[expose] public section + /-- This is a type class recording that a commutative monoid `M` contains primitive `n`th roots of unity and such that the group of `n`th roots of unity is cyclic. diff --git a/Mathlib/RingTheory/RootsOfUnity/Lemmas.lean b/Mathlib/RingTheory/RootsOfUnity/Lemmas.lean index 8be8a8878fde7a..4d814c87e2da7a 100644 --- a/Mathlib/RingTheory/RootsOfUnity/Lemmas.lean +++ b/Mathlib/RingTheory/RootsOfUnity/Lemmas.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ -import Mathlib.FieldTheory.KummerExtension +module + +public import Mathlib.FieldTheory.KummerExtension /-! # More results on primitive roots of unity @@ -18,6 +20,8 @@ see `IsPrimitiveRoot.prod_one_sub_pow_eq_order` and its variant We use this to deduce that `n` is divisible by `(μ - 1)^k` in `ℤ[μ] ⊆ R` when `k < n`. -/ +@[expose] public section + variable {R : Type*} [CommRing R] [IsDomain R] namespace IsPrimitiveRoot diff --git a/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean b/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean index 0e2fa0822e878c..724ec18e2dd290 100644 --- a/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean +++ b/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca, Johan Commelin -/ -import Mathlib.Algebra.GCDMonoid.IntegrallyClosed -import Mathlib.FieldTheory.Finite.Basic -import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed -import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots -import Mathlib.RingTheory.UniqueFactorizationDomain.Nat +module + +public import Mathlib.Algebra.GCDMonoid.IntegrallyClosed +public import Mathlib.FieldTheory.Finite.Basic +public import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed +public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots +public import Mathlib.RingTheory.UniqueFactorizationDomain.Nat /-! # Minimal polynomial of roots of unity @@ -21,6 +23,8 @@ We gather several results about minimal polynomial of root of unity. -/ +@[expose] public section + open minpoly Polynomial diff --git a/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean b/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean index 1f45f902fa910c..930f23a205c08d 100644 --- a/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean +++ b/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Data.Nat.Factorization.LCM -import Mathlib.Algebra.Group.TypeTags.Finite -import Mathlib.RingTheory.RootsOfUnity.Basic +module + +public import Mathlib.Data.Nat.Factorization.LCM +public import Mathlib.Algebra.Group.TypeTags.Finite +public import Mathlib.RingTheory.RootsOfUnity.Basic /-! # Primitive roots of unity @@ -42,6 +44,8 @@ of the `Units`), but lemmas like `IsPrimitiveRoot.isUnit` and `IsPrimitiveRoot.coe_units_iff` should provide the necessary glue. -/ +@[expose] public section + noncomputable section open Polynomial Finset diff --git a/Mathlib/RingTheory/SimpleModule/Basic.lean b/Mathlib/RingTheory/SimpleModule/Basic.lean index 85deeb17a409c4..704716707b80d0 100644 --- a/Mathlib/RingTheory/SimpleModule/Basic.lean +++ b/Mathlib/RingTheory/SimpleModule/Basic.lean @@ -3,18 +3,20 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Algebra.DirectSum.Module -import Mathlib.Data.Finite.Card -import Mathlib.Data.Matrix.Mul -import Mathlib.LinearAlgebra.DFinsupp -import Mathlib.LinearAlgebra.Finsupp.Span -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.LinearAlgebra.Projection -import Mathlib.Order.Atoms.Finite -import Mathlib.Order.CompactlyGenerated.Intervals -import Mathlib.Order.JordanHolder -import Mathlib.RingTheory.Ideal.Colon -import Mathlib.RingTheory.Noetherian.Defs +module + +public import Mathlib.Algebra.DirectSum.Module +public import Mathlib.Data.Finite.Card +public import Mathlib.Data.Matrix.Mul +public import Mathlib.LinearAlgebra.DFinsupp +public import Mathlib.LinearAlgebra.Finsupp.Span +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.LinearAlgebra.Projection +public import Mathlib.Order.Atoms.Finite +public import Mathlib.Order.CompactlyGenerated.Intervals +public import Mathlib.Order.JordanHolder +public import Mathlib.RingTheory.Ideal.Colon +public import Mathlib.RingTheory.Noetherian.Defs /-! # Simple Modules @@ -49,6 +51,8 @@ import Mathlib.RingTheory.Noetherian.Defs -/ +@[expose] public section + variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M] @@ -68,6 +72,9 @@ instance (R) [DivisionRing R] : IsSimpleModule R R where /-- A ring is semisimple if it is semisimple as a module over itself. -/ abbrev IsSemisimpleRing := IsSemisimpleModule R R +instance (priority := low) [Subsingleton R] : IsSemisimpleRing R := + (isSemisimpleModule_iff R R).mpr Subsingleton.instComplementedLattice + variable {R S} in theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S where __ := (Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice @@ -229,6 +236,14 @@ theorem eq_bot_or_exists_simple_le (N : Submodule R M) [IsSemisimpleModule R N] variable [IsSemisimpleModule R M] +theorem exists_submodule_linearEquiv_quotient (N : Submodule R M) : + ∃ (P : Submodule R M), Nonempty (P ≃ₗ[R] M ⧸ N) := + have ⟨P, compl⟩ := exists_isCompl N; ⟨P, ⟨(N.quotientEquivOfIsCompl P compl).symm⟩⟩ + +theorem exists_quotient_linearEquiv_submodule (N : Submodule R M) : + ∃ (P : Submodule R M), Nonempty (N ≃ₗ[R] M ⧸ P) := + have ⟨P, compl⟩ := exists_isCompl N; ⟨P, ⟨(P.quotientEquivOfIsCompl N compl.symm).symm⟩⟩ + theorem extension_property {P} [AddCommGroup P] [Module R P] (f : N →ₗ[R] M) (hf : Function.Injective f) (g : N →ₗ[R] P) : ∃ h : M →ₗ[R] P, h ∘ₗ f = g := @@ -282,12 +297,12 @@ theorem of_injective (f : N →ₗ[R] M) (hf : Function.Injective f) : IsSemisim congr (Submodule.topEquiv.symm.trans <| Submodule.equivMapOfInjective f hf _) instance quotient : IsSemisimpleModule R (M ⧸ m) := - have ⟨P, compl⟩ := exists_isCompl m - .congr (m.quotientEquivOfIsCompl P compl) + have ⟨_, ⟨e⟩⟩ := exists_submodule_linearEquiv_quotient m + .congr e.symm instance (priority := low) [Module.Finite R M] : IsNoetherian R M where - noetherian m := have ⟨P, compl⟩ := exists_isCompl m - Module.Finite.iff_fg.mp (Module.Finite.equiv <| P.quotientEquivOfIsCompl m compl.symm) + noetherian m := have ⟨_, ⟨e⟩⟩ := exists_quotient_linearEquiv_submodule m + Module.Finite.iff_fg.mp (Module.Finite.equiv e.symm) -- does not work as an instance, not sure why protected theorem range (f : M →ₗ[R] N) : IsSemisimpleModule R (range f) := @@ -397,6 +412,13 @@ theorem IsSemisimpleModule.sup {p q : Submodule R M} exact isSemisimpleModule_biSup_of_isSemisimpleModule_submodule (by rintro (_ | _) _ <;> assumption) +variable (R M) in +theorem IsSemisimpleRing.exists_linearEquiv_ideal_of_isSimpleModule [IsSemisimpleRing R] + [h : IsSimpleModule R M] : ∃ I : Ideal R, Nonempty (M ≃ₗ[R] I) := + have ⟨J, _, ⟨e⟩⟩ := isSimpleModule_iff_quot_maximal.mp h + have ⟨I, ⟨e'⟩⟩ := IsSemisimpleModule.exists_submodule_linearEquiv_quotient J + ⟨I, ⟨e.trans e'.symm⟩⟩ + instance IsSemisimpleRing.isSemisimpleModule [IsSemisimpleRing R] : IsSemisimpleModule R M := have : IsSemisimpleModule R (M →₀ R) := isSemisimpleModule_of_isSemisimpleModule_submodule' (fun _ ↦ .congr (LinearMap.quotKerEquivRange _).symm) Finsupp.iSup_lsingle_range @@ -449,25 +471,6 @@ theorem IsSemisimpleRing.ideal_eq_span_idempotent [IsSemisimpleRing R] (I : Idea instance [IsSemisimpleRing R] : IsPrincipalIdealRing R where principal I := have ⟨e, _, he⟩ := IsSemisimpleRing.ideal_eq_span_idempotent I; ⟨e, he⟩ -variable (ι R) - -proof_wanted IsSemisimpleRing.mulOpposite [IsSemisimpleRing R] : IsSemisimpleRing Rᵐᵒᵖ - -proof_wanted IsSemisimpleRing.module_end [IsSemisimpleModule R M] [Module.Finite R M] : - IsSemisimpleRing (Module.End R M) - -proof_wanted IsSemisimpleRing.matrix [Fintype ι] [DecidableEq ι] [IsSemisimpleRing R] : - IsSemisimpleRing (Matrix ι ι R) - -universe u in -/-- The existence part of the Artin–Wedderburn theorem. -/ -proof_wanted isSemisimpleRing_iff_pi_matrix_divisionRing {R : Type u} [Ring R] : - IsSemisimpleRing R ↔ - ∃ (n : ℕ) (S : Fin n → Type u) (d : Fin n → ℕ) (_ : Π i, DivisionRing (S i)), - Nonempty (R ≃+* Π i, Matrix (Fin (d i)) (Fin (d i)) (S i)) - -variable {ι R} - namespace LinearMap theorem injective_or_eq_zero [IsSimpleModule R M] (f : M →ₗ[R] N) : @@ -522,6 +525,12 @@ noncomputable instance _root_.Module.End.instDivisionRing qsmul := _ qsmul_def := fun _ _ => rfl +instance (R) [DivisionRing R] [Module R M] [Nontrivial M] : IsSimpleModule (Module.End R M) M := + isSimpleModule_iff_toSpanSingleton_surjective.mpr <| .intro ‹_› fun v hv w ↦ + have ⟨f, eq⟩ := IsSemisimpleModule.extension_property _ + (ker_eq_bot.mp (ker_toSpanSingleton R M hv)) (toSpanSingleton R M w) + ⟨f, by simpa using congr($eq 1)⟩ + end LinearMap namespace JordanHolderModule diff --git a/Mathlib/RingTheory/SimpleModule/InjectiveProjective.lean b/Mathlib/RingTheory/SimpleModule/InjectiveProjective.lean index fc460e525d7887..99a59f2bfb9a40 100644 --- a/Mathlib/RingTheory/SimpleModule/InjectiveProjective.lean +++ b/Mathlib/RingTheory/SimpleModule/InjectiveProjective.lean @@ -3,15 +3,19 @@ Copyright (c) 2025 Sophie Morel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sophie Morel -/ -import Mathlib.RingTheory.SimpleModule.Basic -import Mathlib.Algebra.Module.Injective -import Mathlib.Algebra.Module.Projective +module + +public import Mathlib.RingTheory.SimpleModule.Basic +public import Mathlib.Algebra.Module.Injective +public import Mathlib.Algebra.Module.Projective /-! If `R` is a semisimple ring, then any `R`-module is both injective and projective. -/ +@[expose] public section + namespace Module variable (R : Type*) [Ring R] [IsSemisimpleRing R] (M : Type*) [AddCommGroup M] [Module R M] diff --git a/Mathlib/RingTheory/SimpleModule/IsAlgClosed.lean b/Mathlib/RingTheory/SimpleModule/IsAlgClosed.lean index f39a61bd12e442..2288d9288015b1 100644 --- a/Mathlib/RingTheory/SimpleModule/IsAlgClosed.lean +++ b/Mathlib/RingTheory/SimpleModule/IsAlgClosed.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.RingTheory.SimpleModule.WedderburnArtin +module + +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.RingTheory.SimpleModule.WedderburnArtin /-! # Wedderburn–Artin Theorem over an algebraically closed field -/ +@[expose] public section + variable (F R : Type*) [Field F] [IsAlgClosed F] [Ring R] [Algebra F R] /-- The **Wedderburn–Artin Theorem** over algebraically closed fields: a finite-dimensional diff --git a/Mathlib/RingTheory/SimpleModule/Isotypic.lean b/Mathlib/RingTheory/SimpleModule/Isotypic.lean index 86e27696af26f5..60752c74256058 100644 --- a/Mathlib/RingTheory/SimpleModule/Isotypic.lean +++ b/Mathlib/RingTheory/SimpleModule/Isotypic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.Order.CompleteSublattice -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.Order.CompleteSublattice +public import Mathlib.RingTheory.SimpleModule.Basic /-! # Isotypic modules and isotypic components @@ -40,6 +42,8 @@ isotypic component, fully invariant submodule -/ +@[expose] public section + universe u variable (R₀ R : Type*) (M : Type u) (N S : Type*) [CommSemiring R₀] @@ -71,7 +75,17 @@ theorem IsIsotypicOfType.of_isSimpleModule [IsSimpleModule R M] : IsIsotypicOfTy rw [isSimpleModule_iff_isAtom, isAtom_iff_eq_top] at hS exact ⟨.trans (.ofEq _ _ hS) Submodule.topEquiv⟩ -variable {R M N S} +variable {R} + +theorem IsIsotypic.of_self [IsSemisimpleRing R] (h : IsIsotypic R R) : IsIsotypic R M := + fun m _ m' _ ↦ + have ⟨_, ⟨e⟩⟩ := IsSemisimpleRing.exists_linearEquiv_ideal_of_isSimpleModule R m + have ⟨_, ⟨e'⟩⟩ := IsSemisimpleRing.exists_linearEquiv_ideal_of_isSimpleModule R m' + have := IsSimpleModule.congr e.symm + have := IsSimpleModule.congr e'.symm + ⟨e'.trans <| (h _ _).some.trans e.symm⟩ + +variable {M N S} theorem IsIsotypicOfType.of_linearEquiv_type (h : IsIsotypicOfType R M S) (e : S ≃ₗ[R] N) : IsIsotypicOfType R M N := fun m _ ↦ ⟨(h m).some.trans e⟩ diff --git a/Mathlib/RingTheory/SimpleModule/Rank.lean b/Mathlib/RingTheory/SimpleModule/Rank.lean index 848739b9176f5a..da7e14c0620084 100644 --- a/Mathlib/RingTheory/SimpleModule/Rank.lean +++ b/Mathlib/RingTheory/SimpleModule/Rank.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.RingTheory.SimpleModule.Basic +module + +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.RingTheory.SimpleModule.Basic /-! # A module over a division ring is simple iff it has rank one -/ +@[expose] public section + theorem isSimpleModule_iff_finrank_eq_one {R M} [DivisionRing R] [AddCommGroup M] [Module R M] : IsSimpleModule R M ↔ Module.finrank R M = 1 := ⟨fun h ↦ have := h.nontrivial; have ⟨v, hv⟩ := exists_ne (0 : M) diff --git a/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean b/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean index a6372d3f7740bb..36595e8b62f836 100644 --- a/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean +++ b/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean @@ -3,9 +3,13 @@ Copyright (c) 2025 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.RingTheory.FiniteLength -import Mathlib.RingTheory.SimpleModule.Isotypic -import Mathlib.RingTheory.SimpleRing.Congr +module + +public import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +public import Mathlib.RingTheory.FiniteLength +public import Mathlib.RingTheory.SimpleModule.Isotypic +public import Mathlib.RingTheory.SimpleRing.Congr +public import Mathlib.RingTheory.SimpleRing.Matrix /-! # Wedderburn–Artin Theorem @@ -37,6 +41,8 @@ import Mathlib.RingTheory.SimpleRing.Congr -/ +@[expose] public section + universe u variable (R₀ : Type*) {R : Type u} [CommSemiring R₀] [Ring R] [Algebra R₀ R] @@ -70,18 +76,18 @@ namespace IsSimpleRing variable (R) [IsSimpleRing R] [IsArtinianRing R] -theorem isIsotypic : IsIsotypic R R := - (isSimpleRing_isArtinianRing_iff.mp ⟨‹_›, ‹_›⟩).2.1 - instance (priority := low) : IsSemisimpleRing R := (isSimpleRing_isArtinianRing_iff.mp ⟨‹_›, ‹_›⟩).1 +theorem isIsotypic (M) [AddCommGroup M] [Module R M] : IsIsotypic R M := + (isSimpleRing_isArtinianRing_iff.mp ⟨‹_›, ‹_›⟩).2.1.of_self M + /-- The **Wedderburn–Artin Theorem**: an Artinian simple ring is isomorphic to a matrix ring over the opposite of the endomorphism ring of its simple module. -/ theorem exists_ringEquiv_matrix_end_mulOpposite : ∃ (n : ℕ) (_ : NeZero n) (I : Ideal R) (_ : IsSimpleModule R I), Nonempty (R ≃+* Matrix (Fin n) (Fin n) (Module.End R I)ᵐᵒᵖ) := by - have ⟨n, hn, S, hS, ⟨e⟩⟩ := (isIsotypic R).linearEquiv_fun + have ⟨n, hn, S, hS, ⟨e⟩⟩ := (isIsotypic R R).linearEquiv_fun refine ⟨n, hn, S, hS, ⟨.trans (.opOp R) <| .trans (.op ?_) (.symm .mopMatrix)⟩⟩ exact .trans (.moduleEndSelf R) <| .trans e.conjRingEquiv (endVecRingEquivMatrixEnd ..) @@ -98,7 +104,7 @@ to a matrix algebra over the opposite of the endomorphism algebra of its simple theorem exists_algEquiv_matrix_end_mulOpposite : ∃ (n : ℕ) (_ : NeZero n) (I : Ideal R) (_ : IsSimpleModule R I), Nonempty (R ≃ₐ[R₀] Matrix (Fin n) (Fin n) (Module.End R I)ᵐᵒᵖ) := by - have ⟨n, hn, S, hS, ⟨e⟩⟩ := (isIsotypic R).linearEquiv_fun + have ⟨n, hn, S, hS, ⟨e⟩⟩ := (isIsotypic R R).linearEquiv_fun refine ⟨n, hn, S, hS, ⟨.trans (.opOp R₀ R) <| .trans (.op ?_) (.symm .mopMatrix)⟩⟩ exact .trans (.moduleEndSelf R₀) <| .trans (e.algConj R₀) (endVecAlgEquivMatrixEnd ..) @@ -126,10 +132,11 @@ namespace IsSemisimpleModule open Module (End) -variable (R) (M : Type*) [AddCommGroup M] [Module R₀ M] [Module R M] [IsScalarTower R₀ R M] +universe v +variable (R) (M : Type v) [AddCommGroup M] [Module R₀ M] [Module R M] [IsScalarTower R₀ R M] [IsSemisimpleModule R M] [Module.Finite R M] -theorem exists_end_algEquiv : +theorem exists_end_algEquiv_pi_matrix_end : ∃ (n : ℕ) (S : Fin n → Submodule R M) (d : Fin n → ℕ), (∀ i, IsSimpleModule R (S i)) ∧ (∀ i, NeZero (d i)) ∧ Nonempty (End R M ≃ₐ[R₀] Π i, Matrix (Fin (d i)) (Fin (d i)) (End R (S i))) := by @@ -139,11 +146,33 @@ theorem exists_end_algEquiv : (.piCongrRight fun c ↦ ((e c).some.algConj R₀).trans (endVecAlgEquivMatrixEnd ..)) <| (.piCongrLeft' R₀ _ (Finite.equivFin _))⟩⟩ -theorem exists_end_ringEquiv : +theorem exists_end_ringEquiv_pi_matrix_end : ∃ (n : ℕ) (S : Fin n → Submodule R M) (d : Fin n → ℕ), (∀ i, IsSimpleModule R (S i)) ∧ (∀ i, NeZero (d i)) ∧ Nonempty (End R M ≃+* Π i, Matrix (Fin (d i)) (Fin (d i)) (End R (S i))) := - have ⟨n, S, d, hS, hd, ⟨e⟩⟩ := exists_end_algEquiv ℕ R M; ⟨n, S, d, hS, hd, ⟨e⟩⟩ + have ⟨n, S, d, hS, hd, ⟨e⟩⟩ := exists_end_algEquiv_pi_matrix_end ℕ R M; ⟨n, S, d, hS, hd, ⟨e⟩⟩ + +@[deprecated (since := "2025-11-16")] alias exists_end_algEquiv := exists_end_algEquiv_pi_matrix_end +@[deprecated (since := "2025-11-16")] +alias exists_end_ringEquiv := exists_end_ringEquiv_pi_matrix_end + +-- TODO: can also require D be in `Type u`, since every simple module is the quotient by an ideal. +theorem exists_end_algEquiv_pi_matrix_divisionRing : + ∃ (n : ℕ) (D : Fin n → Type v) (d : Fin n → ℕ) (_ : ∀ i, DivisionRing (D i)) + (_ : ∀ i, Algebra R₀ (D i)), (∀ i, NeZero (d i)) ∧ + Nonempty (End R M ≃ₐ[R₀] Π i, Matrix (Fin (d i)) (Fin (d i)) (D i)) := by + have ⟨n, S, d, _, hd, ⟨e⟩⟩ := exists_end_algEquiv_pi_matrix_end R₀ R M + classical exact ⟨n, _, d, inferInstance, inferInstance, hd, ⟨e⟩⟩ + +theorem exists_end_ringEquiv_pi_matrix_divisionRing : + ∃ (n : ℕ) (D : Fin n → Type v) (d : Fin n → ℕ) (_ : ∀ i, DivisionRing (D i)), + (∀ i, NeZero (d i)) ∧ Nonempty (End R M ≃+* Π i, Matrix (Fin (d i)) (Fin (d i)) (D i)) := + have ⟨n, D, d, _, _, hd, ⟨e⟩⟩ := exists_end_algEquiv_pi_matrix_divisionRing ℕ R M + ⟨n, D, d, _, hd, ⟨e⟩⟩ + +theorem _root_.IsSemisimpleRing.moduleEnd : IsSemisimpleRing (Module.End R M) := + have ⟨_, _, _, _, _, ⟨e⟩⟩ := exists_end_ringEquiv_pi_matrix_divisionRing R M + e.symm.isSemisimpleRing end IsSemisimpleModule @@ -157,7 +186,7 @@ theorem exists_algEquiv_pi_matrix_end_mulOpposite : ∃ (n : ℕ) (S : Fin n → Ideal R) (d : Fin n → ℕ), (∀ i, IsSimpleModule R (S i)) ∧ (∀ i, NeZero (d i)) ∧ Nonempty (R ≃ₐ[R₀] Π i, Matrix (Fin (d i)) (Fin (d i)) (Module.End R (S i))ᵐᵒᵖ) := - have ⟨n, S, d, hS, hd, ⟨e⟩⟩ := IsSemisimpleModule.exists_end_algEquiv R₀ R R + have ⟨n, S, d, hS, hd, ⟨e⟩⟩ := IsSemisimpleModule.exists_end_algEquiv_pi_matrix_end R₀ R R ⟨n, S, d, hS, hd, ⟨.trans (.opOp R₀ R) <| .trans (.op <| .trans (.moduleEndSelf R₀) e) <| .trans (.piMulOpposite _ _) (.piCongrRight fun _ ↦ .symm .mopMatrix)⟩⟩ @@ -200,4 +229,34 @@ theorem exists_ringEquiv_pi_matrix_divisionRing : have ⟨n, D, d, _, _, hd, ⟨e⟩⟩ := exists_algEquiv_pi_matrix_divisionRing ℕ R ⟨n, D, d, _, hd, ⟨e⟩⟩ +instance (n) [Fintype n] [DecidableEq n] : IsSemisimpleRing (Matrix n n R) := + (isEmpty_or_nonempty n).elim (fun _ ↦ inferInstance) fun _ ↦ + have ⟨_, _, _, _, _, ⟨e⟩⟩ := exists_ringEquiv_pi_matrix_divisionRing R + (e.mapMatrix (m := n).trans Matrix.piRingEquiv).symm.isSemisimpleRing + +instance [IsSemisimpleRing R] : IsSemisimpleRing Rᵐᵒᵖ := + have ⟨_, _, _, _, _, ⟨e⟩⟩ := exists_ringEquiv_pi_matrix_divisionRing R + ((e.op.trans (.piMulOpposite _)).trans (.piCongrRight fun _ ↦ .symm .mopMatrix)).symm + |>.isSemisimpleRing + end IsSemisimpleRing + +theorem isSemisimpleRing_mulOpposite_iff : IsSemisimpleRing Rᵐᵒᵖ ↔ IsSemisimpleRing R := + ⟨fun _ ↦ (RingEquiv.opOp R).symm.isSemisimpleRing, fun _ ↦ inferInstance⟩ + +/-- The existence part of the Artin–Wedderburn theorem. -/ +theorem isSemisimpleRing_iff_pi_matrix_divisionRing : IsSemisimpleRing R ↔ + ∃ (n : ℕ) (D : Fin n → Type u) (d : Fin n → ℕ) (_ : Π i, DivisionRing (D i)), + Nonempty (R ≃+* Π i, Matrix (Fin (d i)) (Fin (d i)) (D i)) where + mp _ := have ⟨n, D, d, _, _, e⟩ := IsSemisimpleRing.exists_ringEquiv_pi_matrix_divisionRing R + ⟨n, D, d, _, e⟩ + mpr := fun ⟨_, _, _, _, ⟨e⟩⟩ ↦ e.symm.isSemisimpleRing + +-- Need left-right symmetry of Jacobson radical +proof_wanted IsSemiprimaryRing.mulOpposite [IsSemiprimaryRing R] : IsSemiprimaryRing Rᵐᵒᵖ + +proof_wanted isSemiprimaryRing_mulOpposite_iff : IsSemiprimaryRing Rᵐᵒᵖ ↔ IsSemiprimaryRing R + +-- A left Artinian ring is right Noetherian iff it is right Artinian. To be left as an `example`. +proof_wanted IsArtinianRing.isNoetherianRing_iff_isArtinianRing_mulOpposite + [IsArtinianRing R] : IsNoetherianRing Rᵐᵒᵖ ↔ IsArtinianRing Rᵐᵒᵖ diff --git a/Mathlib/RingTheory/SimpleRing/Basic.lean b/Mathlib/RingTheory/SimpleRing/Basic.lean index fdefa59d502995..3f492f6d39859d 100644 --- a/Mathlib/RingTheory/SimpleRing/Basic.lean +++ b/Mathlib/RingTheory/SimpleRing/Basic.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.RingTheory.SimpleRing.Defs -import Mathlib.Algebra.Ring.Opposite -import Mathlib.RingTheory.TwoSidedIdeal.Kernel +public import Mathlib.RingTheory.SimpleRing.Defs +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.RingTheory.TwoSidedIdeal.Kernel /-! # Basic Properties of Simple rings @@ -22,6 +23,8 @@ A ring `R` is **simple** if it has only two two-sided ideals, namely `⊥` and ` -/ +@[expose] public section + assert_not_exists Finset variable (R : Type*) [NonUnitalNonAssocRing R] diff --git a/Mathlib/RingTheory/SimpleRing/Congr.lean b/Mathlib/RingTheory/SimpleRing/Congr.lean index e6d5be578c9763..15d6e01e6586db 100644 --- a/Mathlib/RingTheory/SimpleRing/Congr.lean +++ b/Mathlib/RingTheory/SimpleRing/Congr.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.RingTheory.SimpleRing.Basic -import Mathlib.RingTheory.TwoSidedIdeal.Operations +public import Mathlib.RingTheory.SimpleRing.Basic +public import Mathlib.RingTheory.TwoSidedIdeal.Operations /-! # Simpleness is preserved by ring isomorphism/surjective ring homomorphisms @@ -15,6 +16,8 @@ nontrivial, then `S` is also simple. If `R` is a simple (non-unital non-assoc) ring then any ring isomorphic to `R` is also simple. -/ +@[expose] public section + namespace IsSimpleRing lemma of_surjective {R S : Type*} [NonAssocRing R] [NonAssocRing S] [Nontrivial S] diff --git a/Mathlib/RingTheory/SimpleRing/Defs.lean b/Mathlib/RingTheory/SimpleRing/Defs.lean index f25b1418e9ce8a..3c59f506ee1970 100644 --- a/Mathlib/RingTheory/SimpleRing/Defs.lean +++ b/Mathlib/RingTheory/SimpleRing/Defs.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.RingTheory.TwoSidedIdeal.Lattice -import Mathlib.Order.Atoms +public import Mathlib.RingTheory.TwoSidedIdeal.Lattice +public import Mathlib.Order.Atoms /-! # Simple rings @@ -17,6 +18,8 @@ A ring `R` is **simple** if it has only two two-sided ideals, namely `⊥` and ` -/ +@[expose] public section + /-- A ring `R` is **simple** if it has only two two-sided ideals, namely `⊥` and `⊤`. diff --git a/Mathlib/RingTheory/SimpleRing/Field.lean b/Mathlib/RingTheory/SimpleRing/Field.lean index af9c899e2268b1..d24b6bd2ea471e 100644 --- a/Mathlib/RingTheory/SimpleRing/Field.lean +++ b/Mathlib/RingTheory/SimpleRing/Field.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.RingTheory.SimpleRing.Basic -import Mathlib.Algebra.Ring.Subring.Basic -import Mathlib.Algebra.Field.Equiv +public import Mathlib.RingTheory.SimpleRing.Basic +public import Mathlib.Algebra.Ring.Subring.Basic +public import Mathlib.Algebra.Field.Equiv /-! # Simple ring and fields @@ -17,6 +18,8 @@ import Mathlib.Algebra.Field.Equiv -/ +@[expose] public section + namespace IsSimpleRing open TwoSidedIdeal in diff --git a/Mathlib/RingTheory/SimpleRing/Matrix.lean b/Mathlib/RingTheory/SimpleRing/Matrix.lean index ca10a2b7673976..97b4d33f526f28 100644 --- a/Mathlib/RingTheory/SimpleRing/Matrix.lean +++ b/Mathlib/RingTheory/SimpleRing/Matrix.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ -import Mathlib.LinearAlgebra.Matrix.Ideal -import Mathlib.RingTheory.SimpleRing.Basic +module + +public import Mathlib.LinearAlgebra.Matrix.Ideal +public import Mathlib.RingTheory.SimpleRing.Basic /-! The matrix ring over a simple ring is simple -/ +@[expose] public section + namespace IsSimpleRing variable (ι A : Type*) [Ring A] [Fintype ι] [Nonempty ι] diff --git a/Mathlib/RingTheory/SimpleRing/Principal.lean b/Mathlib/RingTheory/SimpleRing/Principal.lean index 9acd0011089728..f24212d615a911 100644 --- a/Mathlib/RingTheory/SimpleRing/Principal.lean +++ b/Mathlib/RingTheory/SimpleRing/Principal.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ +module -import Mathlib.RingTheory.PrincipalIdealDomain -import Mathlib.RingTheory.SimpleRing.Field -import Mathlib.RingTheory.TwoSidedIdeal.Operations +public import Mathlib.RingTheory.PrincipalIdealDomain +public import Mathlib.RingTheory.SimpleRing.Field +public import Mathlib.RingTheory.TwoSidedIdeal.Operations /-! # A commutative simple ring is a principal ideal domain @@ -15,6 +16,8 @@ Indeed, it is a field. -/ +@[expose] public section + variable {R : Type*} [CommRing R] [IsSimpleRing R] instance : IsSimpleOrder (Ideal R) := TwoSidedIdeal.orderIsoIdeal.symm.isSimpleOrder diff --git a/Mathlib/RingTheory/Smooth/Basic.lean b/Mathlib/RingTheory/Smooth/Basic.lean index 856677aa0ed22c..d615a6abfc0545 100644 --- a/Mathlib/RingTheory/Smooth/Basic.lean +++ b/Mathlib/RingTheory/Smooth/Basic.lean @@ -3,10 +3,13 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.FiniteStability -import Mathlib.RingTheory.Ideal.Quotient.Nilpotent -import Mathlib.RingTheory.Localization.Away.AdjoinRoot -import Mathlib.RingTheory.Smooth.Kaehler +module + +public import Mathlib.RingTheory.FiniteStability +public import Mathlib.RingTheory.Ideal.Quotient.Nilpotent +public import Mathlib.RingTheory.Localization.Away.AdjoinRoot +public import Mathlib.RingTheory.Smooth.Kaehler +public import Mathlib.RingTheory.Unramified.Basic /-! @@ -43,6 +46,8 @@ Suppose `P` is a formally smooth `R` algebra that surjects onto `A` with kernel -/ +@[expose] public section + open scoped TensorProduct open Algebra.Extension KaehlerDifferential MvPolynomial @@ -381,6 +386,8 @@ open scoped Polynomial in instance polynomial (R : Type*) [CommRing R] : FormallySmooth R R[X] := .of_equiv (MvPolynomial.pUnitAlgEquiv.{_, 0} R) +instance : FormallySmooth R R := .of_equiv (MvPolynomial.isEmptyAlgEquiv R Empty) + end Polynomial section Comp @@ -397,8 +404,41 @@ theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := b apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ +lemma of_restrictScalars [FormallyUnramified R A] [FormallySmooth R B] : + FormallySmooth A B := by + refine iff_comp_surjective.mpr fun C _ _ I hI f ↦ ?_ + algebraize [(algebraMap A C).comp (algebraMap R A)] + obtain ⟨g, hg⟩ := Algebra.FormallySmooth.comp_surjective _ _ I hI (f.restrictScalars R) + suffices g.comp (IsScalarTower.toAlgHom R A B) = IsScalarTower.toAlgHom R A C from + ⟨{ __ := g, commutes' x := congr($this x) }, AlgHom.ext fun x ↦ congr($hg x)⟩ + apply Algebra.FormallyUnramified.comp_injective _ hI + rw [← AlgHom.comp_assoc, hg] + exact AlgHom.ext f.commutes + end Comp +section surjective + +variable {R : Type*} [CommRing R] +variable {P A : Type*} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] +variable (f : P →ₐ[R] A) + +lemma iff_of_surjective (h : Function.Surjective (algebraMap R A)) : + Algebra.FormallySmooth R A ↔ IsIdempotentElem (RingHom.ker (algebraMap R A)) := by + rw [Algebra.FormallySmooth.iff_split_surjection (Algebra.ofId R A) h] + constructor + · intro ⟨g, hg⟩ + let e : A ≃ₐ[R] R ⧸ RingHom.ker (algebraMap R A) ^ 2 := + .ofAlgHom _ _ (Ideal.Quotient.algHom_ext _ (by ext)) hg + rw [IsIdempotentElem, ← pow_two, ← Ideal.mk_ker (I := _ ^ 2), ← Ideal.Quotient.algebraMap_eq, + ← e.toAlgHom.comp_algebraMap, RingHom.ker_comp_of_injective _ (by exact e.injective)] + · intro H + let e := (Ideal.quotientEquivAlgOfEq _ ((pow_two _).trans H)).trans + (Ideal.quotientKerAlgEquivOfSurjective (f := Algebra.ofId R A) h) + exact ⟨e.symm.toAlgHom, AlgHom.ext <| h.forall.mpr fun x ↦ by simp⟩ + +end surjective + section BaseChange open scoped TensorProduct diff --git a/Mathlib/RingTheory/Smooth/Kaehler.lean b/Mathlib/RingTheory/Smooth/Kaehler.lean index 24ab3a6c853426..af118beec863ab 100644 --- a/Mathlib/RingTheory/Smooth/Kaehler.lean +++ b/Mathlib/RingTheory/Smooth/Kaehler.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Extension.Cotangent.Basic +module + +public import Mathlib.RingTheory.Extension.Cotangent.Basic /-! # Relation of smoothness and `Ω[S⁄R]` @@ -32,6 +34,8 @@ import Mathlib.RingTheory.Extension.Cotangent.Basic -/ +@[expose] public section + universe u open TensorProduct KaehlerDifferential diff --git a/Mathlib/RingTheory/Smooth/Local.lean b/Mathlib/RingTheory/Smooth/Local.lean index 03cd2b291a64d3..d5f6f022754272 100644 --- a/Mathlib/RingTheory/Smooth/Local.lean +++ b/Mathlib/RingTheory/Smooth/Local.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalRing.Module -import Mathlib.RingTheory.Smooth.Basic -import Mathlib.RingTheory.TensorProduct.Free +module + +public import Mathlib.RingTheory.LocalRing.Module +public import Mathlib.RingTheory.Smooth.Basic +public import Mathlib.RingTheory.TensorProduct.Free /-! # Formally smooth local algebras -/ +@[expose] public section + open TensorProduct IsLocalRing KaehlerDifferential /-- diff --git a/Mathlib/RingTheory/Smooth/Locus.lean b/Mathlib/RingTheory/Smooth/Locus.lean index 466c2e765ac0c6..218579c135ca28 100644 --- a/Mathlib/RingTheory/Smooth/Locus.lean +++ b/Mathlib/RingTheory/Smooth/Locus.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Etale.Kaehler -import Mathlib.RingTheory.Spectrum.Prime.FreeLocus -import Mathlib.RingTheory.Support +module + +public import Mathlib.RingTheory.Etale.Kaehler +public import Mathlib.RingTheory.Spectrum.Prime.FreeLocus +public import Mathlib.RingTheory.Support /-! # Smooth locus of an algebra @@ -22,6 +24,8 @@ Some of them are true for arbitrary algebras but the proof is substantially hard - `Algebra.isOpen_smoothLocus` : The smooth locus is open. -/ +@[expose] public section + universe u variable (R A : Type*) [CommRing R] [CommRing A] [Algebra R A] diff --git a/Mathlib/RingTheory/Smooth/Pi.lean b/Mathlib/RingTheory/Smooth/Pi.lean index 024c4c0cea23a8..f4f02d95996c62 100644 --- a/Mathlib/RingTheory/Smooth/Pi.lean +++ b/Mathlib/RingTheory/Smooth/Pi.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Idempotents -import Mathlib.RingTheory.Smooth.Basic +module + +public import Mathlib.RingTheory.Idempotents +public import Mathlib.RingTheory.Smooth.Basic /-! @@ -17,6 +19,8 @@ import Mathlib.RingTheory.Smooth.Basic -/ +@[expose] public section + namespace Algebra.FormallySmooth variable {R : Type*} {I : Type*} (A : I → Type*) diff --git a/Mathlib/RingTheory/Smooth/StandardSmooth.lean b/Mathlib/RingTheory/Smooth/StandardSmooth.lean index 31045901d19431..cdd1f1c5392960 100644 --- a/Mathlib/RingTheory/Smooth/StandardSmooth.lean +++ b/Mathlib/RingTheory/Smooth/StandardSmooth.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jung Tao Cheng, Christian Merten, Andrew Yang -/ -import Mathlib.RingTheory.Extension.Presentation.Submersive +module + +public import Mathlib.RingTheory.Extension.Presentation.Submersive /-! # Standard smooth algebras @@ -39,6 +41,8 @@ in June 2024. -/ +@[expose] public section + universe t t' w w' u v open TensorProduct Module MvPolynomial diff --git a/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean b/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean index 6c114147c4ab9d..ba92a9480f5d8a 100644 --- a/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean +++ b/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.LinearAlgebra.Basis.Exact -import Mathlib.RingTheory.Extension.Cotangent.Basic -import Mathlib.RingTheory.Smooth.StandardSmooth -import Mathlib.RingTheory.Smooth.Kaehler -import Mathlib.RingTheory.Etale.Basic +module + +public import Mathlib.LinearAlgebra.Basis.Exact +public import Mathlib.RingTheory.Extension.Cotangent.Basic +public import Mathlib.RingTheory.Smooth.StandardSmooth +public import Mathlib.RingTheory.Smooth.Kaehler +public import Mathlib.RingTheory.Etale.Basic /-! # Cotangent complex of a submersive presentation @@ -27,6 +29,8 @@ We also provide the corresponding instances for standard smooth algebras as coro We keep the notation `I = ker(R[X] → S)` in all docstrings of this file. -/ +@[expose] public section + namespace Algebra variable {R S ι σ : Type*} [CommRing R] [CommRing S] [Algebra R S] diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean b/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean index 8d3d1890f3386c..2d6b6a16a80779 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.RingTheory.Spectrum.Maximal.Defs -import Mathlib.RingTheory.Spectrum.Prime.Defs +module + +public import Mathlib.RingTheory.Spectrum.Maximal.Defs +public import Mathlib.RingTheory.Spectrum.Prime.Defs /-! # Maximal spectrum of a commutative (semi)ring @@ -12,6 +14,8 @@ import Mathlib.RingTheory.Spectrum.Prime.Defs Basic properties the maximal spectrum of a ring. -/ +@[expose] public section + noncomputable section variable (R S P : Type*) [CommSemiring R] [CommSemiring S] [CommSemiring P] diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Defs.lean b/Mathlib/RingTheory/Spectrum/Maximal/Defs.lean index c36f9c92e873e2..2cb491971a093e 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Defs.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.RingTheory.Ideal.Maximal +module + +public import Mathlib.RingTheory.Ideal.Maximal /-! # Maximal spectrum of a commutative (semi)ring @@ -17,6 +19,8 @@ It is naturally a subset of the prime spectrum endowed with the subspace topolog i.e., the set of all maximal ideals of `R`. -/ +@[expose] public section + /-- The maximal spectrum of a commutative (semi)ring `R` is the type of all maximal ideals of `R`. -/ @[ext] diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean b/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean index 3310c228983a73..673671a0409253 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.RingTheory.Localization.AsSubring -import Mathlib.RingTheory.Spectrum.Maximal.Basic -import Mathlib.RingTheory.Spectrum.Prime.RingHom +module + +public import Mathlib.RingTheory.Localization.AsSubring +public import Mathlib.RingTheory.Spectrum.Maximal.Basic +public import Mathlib.RingTheory.Spectrum.Prime.RingHom /-! # Maximal spectrum of a commutative (semi)ring @@ -13,6 +15,8 @@ import Mathlib.RingTheory.Spectrum.Prime.RingHom Localization results. -/ +@[expose] public section + noncomputable section variable (R S P : Type*) [CommSemiring R] [CommSemiring S] [CommSemiring P] diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Topology.lean b/Mathlib/RingTheory/Spectrum/Maximal/Topology.lean index 9846b9ba929036..5854088d94790d 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Topology.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Topology.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Kurniadi Angdinata -/ -import Mathlib.RingTheory.Spectrum.Maximal.Basic -import Mathlib.RingTheory.Spectrum.Prime.Topology +module + +public import Mathlib.RingTheory.Spectrum.Maximal.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Topology /-! # The Zariski topology on the maximal spectrum of a commutative (semi)ring @@ -15,6 +17,8 @@ The Zariski topology on the maximal spectrum is defined as the subspace topology natural inclusion into the prime spectrum to avoid API duplication for zero loci. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/Spectrum/Prime/Basic.lean b/Mathlib/RingTheory/Spectrum/Prime/Basic.lean index 249bf1f2a875c1..56de847b740146 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Basic.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Filippo A. E. Nuccio, Andrew Yang -/ -import Mathlib.RingTheory.Ideal.MinimalPrime.Basic -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.RingTheory.Noetherian.Basic -import Mathlib.RingTheory.Spectrum.Prime.Defs +module + +public import Mathlib.RingTheory.Ideal.MinimalPrime.Basic +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.RingTheory.Noetherian.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Defs /-! # Prime spectrum of a commutative (semi)ring @@ -39,6 +41,8 @@ and Chris Hughes (on an earlier repository). * [P. Samuel, *Algebraic Theory of Numbers*][samuel1967] -/ +@[expose] public section + -- A dividing line between this file and `Mathlib/RingTheory/Spectrum/Prime/Topology.lean` is -- that we should not depend on the Zariski topology here assert_not_exists TopologicalSpace diff --git a/Mathlib/RingTheory/Spectrum/Prime/Chevalley.lean b/Mathlib/RingTheory/Spectrum/Prime/Chevalley.lean index d2f2c58ab7bcf0..f5e39c2607aa43 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Chevalley.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Chevalley.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.GoingDown -import Mathlib.RingTheory.Spectrum.Prime.ChevalleyComplexity +module + +public import Mathlib.RingTheory.Ideal.GoingDown +public import Mathlib.RingTheory.Spectrum.Prime.ChevalleyComplexity /-! # Chevalley's theorem @@ -13,6 +15,8 @@ In this file we provide the usual (algebraic) version of Chevalley's theorem. For the proof see `Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean`. -/ +@[expose] public section + variable {R S : Type*} [CommRing R] [CommRing S] open Function Localization MvPolynomial Polynomial TensorProduct PrimeSpectrum Topology diff --git a/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean b/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean index c438cab24baba9..66dc125a7e249f 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Algebra.Order.SuccPred.WithBot -import Mathlib.Algebra.Polynomial.CoeffMem -import Mathlib.Data.DFinsupp.WellFounded -import Mathlib.RingTheory.Spectrum.Prime.ConstructibleSet -import Mathlib.RingTheory.Spectrum.Prime.Polynomial +module + +public import Mathlib.Algebra.Order.SuccPred.WithBot +public import Mathlib.Algebra.Polynomial.CoeffMem +public import Mathlib.Data.DFinsupp.WellFounded +public import Mathlib.RingTheory.Spectrum.Prime.ConstructibleSet +public import Mathlib.RingTheory.Spectrum.Prime.Polynomial /-! # Chevalley's theorem with complexity bound @@ -58,6 +60,8 @@ not give an explicit bound on the complexity. -/ +@[expose] public section + variable {R₀ R S M A : Type*} [CommRing R₀] [CommRing R] [Algebra R₀ R] [CommRing S] [Algebra R₀ S] variable [AddCommGroup M] [Module R M] [CommRing A] [Algebra R A] {n : ℕ} diff --git a/Mathlib/RingTheory/Spectrum/Prime/ConstructibleSet.lean b/Mathlib/RingTheory/Spectrum/Prime/ConstructibleSet.lean index ec21b652ef0e80..09259234c3c11e 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/ConstructibleSet.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/ConstructibleSet.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yaël Dillies, Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Andrew Yang -/ -import Mathlib.Order.SuccPred.WithBot -import Mathlib.RingTheory.Spectrum.Prime.Topology +module + +public import Mathlib.Order.SuccPred.WithBot +public import Mathlib.RingTheory.Spectrum.Prime.Topology /-! # Constructible sets in the prime spectrum @@ -13,6 +15,8 @@ This file provides tooling for manipulating constructible sets in the prime spec -/ +@[expose] public section + open Finset Topology open scoped Polynomial diff --git a/Mathlib/RingTheory/Spectrum/Prime/Defs.lean b/Mathlib/RingTheory/Spectrum/Prime/Defs.lean index f7323775114ae7..04f5f93f11f5bf 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Defs.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Filippo A. E. Nuccio, Andrew Yang -/ -import Mathlib.RingTheory.Ideal.Prime +module + +public import Mathlib.RingTheory.Ideal.Prime /-! # Prime spectrum of a commutative (semi)ring as a type @@ -21,6 +23,8 @@ which is constructed in `AlgebraicGeometry.StructureSheaf`.) i.e., the set of all prime ideals of `R`. -/ +@[expose] public section + /-- The prime spectrum of a commutative (semi)ring `R` is the type of all prime ideals of `R`. It is naturally endowed with a topology (the Zariski topology), diff --git a/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean b/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean index 4a8d8f5193e827..2676a7d0fe7612 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean @@ -3,16 +3,18 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Flat.Stability -import Mathlib.RingTheory.LocalProperties.Projective -import Mathlib.RingTheory.LocalRing.Module -import Mathlib.RingTheory.Localization.Free -import Mathlib.RingTheory.Localization.LocalizationLocalization -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.Topology.LocallyConstant.Basic -import Mathlib.RingTheory.TensorProduct.Free -import Mathlib.RingTheory.TensorProduct.IsBaseChangePi -import Mathlib.RingTheory.Support +module + +public import Mathlib.RingTheory.Flat.Stability +public import Mathlib.RingTheory.LocalProperties.Projective +public import Mathlib.RingTheory.LocalRing.Module +public import Mathlib.RingTheory.Localization.Free +public import Mathlib.RingTheory.Localization.LocalizationLocalization +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.Topology.LocallyConstant.Basic +public import Mathlib.RingTheory.TensorProduct.Free +public import Mathlib.RingTheory.TensorProduct.IsBaseChangePi +public import Mathlib.RingTheory.Support /-! @@ -32,6 +34,8 @@ Let `M` be a finitely presented `R`-module. -/ +@[expose] public section + universe uR uM variable (R : Type uR) (M : Type uM) [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/RingTheory/Spectrum/Prime/Homeomorph.lean b/Mathlib/RingTheory/Spectrum/Prime/Homeomorph.lean index d7cd15c759d891..21474a553ba60c 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Homeomorph.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Homeomorph.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Junyan Xu -/ -import Mathlib.FieldTheory.PurelyInseparable.Basic -import Mathlib.RingTheory.Flat.Basic -import Mathlib.RingTheory.Spectrum.Prime.Topology +module + +public import Mathlib.FieldTheory.PurelyInseparable.Basic +public import Mathlib.RingTheory.Flat.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Topology /-! # Purely inseparable extensions are universal homeomorphisms @@ -22,6 +24,8 @@ homeomorphism, i.e. it stays a homeomorphism after arbitrary base change. homeomorphism for a purely inseparable field extension `K` over `k`. -/ +@[expose] public section + open TensorProduct variable (k K R S : Type*) [Field k] [Field K] [Algebra k K] [CommRing R] [Algebra k R] [CommRing S] diff --git a/Mathlib/RingTheory/Spectrum/Prime/IsOpenComapC.lean b/Mathlib/RingTheory/Spectrum/Prime/IsOpenComapC.lean index ec694a8273fb3a..d90c8675e29f20 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/IsOpenComapC.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/IsOpenComapC.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Mathlib.RingTheory.Polynomial.Basic -import Mathlib.RingTheory.Spectrum.Prime.Topology +module + +public import Mathlib.RingTheory.Polynomial.Basic +public import Mathlib.RingTheory.Spectrum.Prime.Topology /-! The morphism `Spec R[x] --> Spec R` induced by the natural inclusion `R --> R[x]` is an open map. @@ -14,6 +16,8 @@ The main result is the first part of the statement of Lemma 00FB in the Stacks P https://stacks.math.columbia.edu/tag/00FB -/ +@[expose] public section + open Ideal Polynomial PrimeSpectrum Set diff --git a/Mathlib/RingTheory/Spectrum/Prime/Jacobson.lean b/Mathlib/RingTheory/Spectrum/Prime/Jacobson.lean index da5caf27f1e40a..7451288be91601 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Jacobson.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Jacobson.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Jacobson.Ring -import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.Topology.JacobsonSpace +module + +public import Mathlib.RingTheory.Jacobson.Ring +public import Mathlib.RingTheory.Spectrum.Prime.Noetherian +public import Mathlib.Topology.JacobsonSpace /-! # The prime spectrum of a Jacobson ring @@ -21,6 +23,8 @@ import Mathlib.Topology.JacobsonSpace (i.e. `x` is both a minimal prime and a maximal ideal) -/ +@[expose] public section + open Ideal variable {R : Type*} [CommRing R] diff --git a/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean b/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean index e8a080350780a9..73fbde4d894c6e 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Yongle Hu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yongle Hu -/ -import Mathlib.RingTheory.Ideal.KrullsHeightTheorem +module + +public import Mathlib.RingTheory.Ideal.KrullsHeightTheorem /-! # Lemmas about `LTSeries` in the prime spectrum @@ -16,6 +18,8 @@ import Mathlib.RingTheory.Ideal.KrullsHeightTheorem $x \in \mathfrak{q}_1$, $\mathfrak{p}_0 = \mathfrak{q}_0$ and $\mathfrak{p}_n = \mathfrak{q}_n$. -/ +@[expose] public section + variable {R : Type*} [CommRing R] [IsNoetherianRing R] local notation "𝔪" => IsLocalRing.maximalIdeal R diff --git a/Mathlib/RingTheory/Spectrum/Prime/Module.lean b/Mathlib/RingTheory/Spectrum/Prime/Module.lean index c30a87145159fa..f6666f0121a4da 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Module.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Module.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.RingTheory.Support +module + +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.RingTheory.Support /-! @@ -20,6 +22,8 @@ import Mathlib.RingTheory.Support -/ +@[expose] public section + variable {R A M : Type*} [CommRing R] [AddCommGroup M] [Module R M] [CommRing A] [Algebra R A] [Module A M] diff --git a/Mathlib/RingTheory/Spectrum/Prime/Noetherian.lean b/Mathlib/RingTheory/Spectrum/Prime/Noetherian.lean index f5aaba23cdef76..ae19fc00b2da9d 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Noetherian.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Noetherian.lean @@ -3,15 +3,19 @@ Copyright (c) 2020 Filippo A. E. Nuccio. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Filippo A. E. Nuccio, Andrew Yang -/ -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.RingTheory.Ideal.Quotient.Noetherian -import Mathlib.RingTheory.Artinian.Module -import Mathlib.Topology.NoetherianSpace +module + +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.RingTheory.Ideal.Quotient.Noetherian +public import Mathlib.RingTheory.Artinian.Module +public import Mathlib.Topology.NoetherianSpace /-! This file proves additional properties of the prime spectrum a ring is Noetherian. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/Spectrum/Prime/Polynomial.lean b/Mathlib/RingTheory/Spectrum/Prime/Polynomial.lean index 551eaaf16279cd..0519681c45ecab 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Polynomial.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Polynomial.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.LinearAlgebra.Charpoly.BaseChange -import Mathlib.LinearAlgebra.Eigenspace.Zero -import Mathlib.RingTheory.AdjoinRoot -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.RingTheory.TensorProduct.MvPolynomial +module + +public import Mathlib.LinearAlgebra.Charpoly.BaseChange +public import Mathlib.LinearAlgebra.Eigenspace.Zero +public import Mathlib.RingTheory.AdjoinRoot +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.RingTheory.TensorProduct.MvPolynomial /-! @@ -27,6 +29,8 @@ Also see `AlgebraicGeometry/AffineSpace` for the affine space over arbitrary sch -/ +@[expose] public section + open Polynomial TensorProduct PrimeSpectrum variable {R M A} [CommRing R] [AddCommGroup M] [Module R M] [CommRing A] [Algebra R A] diff --git a/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean b/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean index 53cfe080bcb885..dd81671aaded13 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Filippo A. E. Nuccio, Andrew Yang -/ -import Mathlib.RingTheory.Spectrum.Prime.Basic -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.RingTheory.Spectrum.Prime.Basic +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Functoriality of the prime spectrum @@ -19,6 +21,8 @@ In this file we define the induced map on prime spectra induced by a ring homomo -/ +@[expose] public section + universe u v variable (R : Type u) (S : Type v) diff --git a/Mathlib/RingTheory/Spectrum/Prime/TensorProduct.lean b/Mathlib/RingTheory/Spectrum/Prime/TensorProduct.lean index 1a6d5b7d6f2162..e8a392aaccb15a 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/TensorProduct.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/TensorProduct.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.RingTheory.SurjectiveOnStalks +module + +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.RingTheory.SurjectiveOnStalks /-! @@ -17,6 +19,8 @@ import Mathlib.RingTheory.SurjectiveOnStalks (where `Spec S × Spec T` is the Cartesian product with the product topology). -/ +@[expose] public section + variable (R S T : Type*) [CommRing R] [CommRing S] [Algebra R S] variable [CommRing T] [Algebra R T] diff --git a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean index a1f9d522a9f7b1..227cc020de8ad6 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean @@ -3,17 +3,19 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Order.Ring.Idempotent -import Mathlib.Order.Heyting.Hom -import Mathlib.RingTheory.Finiteness.Ideal -import Mathlib.RingTheory.Ideal.GoingUp -import Mathlib.RingTheory.Ideal.MinimalPrime.Localization -import Mathlib.RingTheory.KrullDimension.Basic -import Mathlib.RingTheory.Localization.Algebra -import Mathlib.RingTheory.Spectrum.Maximal.Localization -import Mathlib.Topology.Constructible -import Mathlib.Topology.KrullDimension -import Mathlib.Topology.Spectral.Basic +module + +public import Mathlib.Algebra.Order.Ring.Idempotent +public import Mathlib.Order.Heyting.Hom +public import Mathlib.RingTheory.Finiteness.Ideal +public import Mathlib.RingTheory.Ideal.GoingUp +public import Mathlib.RingTheory.Ideal.MinimalPrime.Localization +public import Mathlib.RingTheory.KrullDimension.Basic +public import Mathlib.RingTheory.Localization.Algebra +public import Mathlib.RingTheory.Spectrum.Maximal.Localization +public import Mathlib.Topology.Constructible +public import Mathlib.Topology.KrullDimension +public import Mathlib.Topology.Spectral.Basic /-! # The Zariski topology on the prime spectrum of a commutative (semi)ring @@ -102,6 +104,8 @@ In the prime spectrum of a commutative semiring: -/ +@[expose] public section + open Topology noncomputable section diff --git a/Mathlib/RingTheory/Support.lean b/Mathlib/RingTheory/Support.lean index 96c57a6acfa00a..c8d4ce6e8e2429 100644 --- a/Mathlib/RingTheory/Support.lean +++ b/Mathlib/RingTheory/Support.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.Colon -import Mathlib.RingTheory.Localization.Finiteness -import Mathlib.RingTheory.Nakayama -import Mathlib.RingTheory.QuotSMulTop -import Mathlib.RingTheory.Spectrum.Prime.Basic +module + +public import Mathlib.RingTheory.Ideal.Colon +public import Mathlib.RingTheory.Localization.Finiteness +public import Mathlib.RingTheory.Nakayama +public import Mathlib.RingTheory.QuotSMulTop +public import Mathlib.RingTheory.Spectrum.Prime.Basic /-! @@ -31,6 +33,8 @@ depending on the Zariski topology. `Supp_A (A ⊗ M) = f♯ ⁻¹ Supp M` where `f♯ : Spec A → Spec R`. (stacks#0BUR) -/ +@[expose] public section + -- Basic files in `RingTheory` should avoid depending on the Zariski topology -- See `Mathlib/RingTheory/Spectrum/Prime/Module.lean` assert_not_exists TopologicalSpace diff --git a/Mathlib/RingTheory/SurjectiveOnStalks.lean b/Mathlib/RingTheory/SurjectiveOnStalks.lean index fc0b399b5435d6..ca65a302d751f3 100644 --- a/Mathlib/RingTheory/SurjectiveOnStalks.lean +++ b/Mathlib/RingTheory/SurjectiveOnStalks.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Localization.AtPrime.Basic -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.RingTheory.Localization.AtPrime.Basic +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Ring Homomorphisms surjective on stalks @@ -18,6 +20,8 @@ that surjections and localizations satisfy this. -/ +@[expose] public section + variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S] variable {T : Type*} [CommRing T] variable {g : S →+* T} {f : R →+* S} diff --git a/Mathlib/RingTheory/TensorProduct/Basic.lean b/Mathlib/RingTheory/TensorProduct/Basic.lean index 58ca88a33f5d4b..ed8f054d46f003 100644 --- a/Mathlib/RingTheory/TensorProduct/Basic.lean +++ b/Mathlib/RingTheory/TensorProduct/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin -/ -import Mathlib.Algebra.Algebra.Operations -import Mathlib.Algebra.Star.TensorProduct -import Mathlib.LinearAlgebra.TensorProduct.Tower +module + +public import Mathlib.Algebra.Algebra.Operations +public import Mathlib.Algebra.Star.TensorProduct +public import Mathlib.LinearAlgebra.TensorProduct.Tower /-! # The tensor product of R-algebras @@ -26,6 +28,8 @@ multiplication is characterized by `(a₁ ⊗ₜ b₁) * (a₂ ⊗ₜ b₂) = (a -/ +@[expose] public section + assert_not_exists Equiv.Perm.cycleType open scoped TensorProduct diff --git a/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean b/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean index 5efa54517eb4ef..6ec71f735bd8c8 100644 --- a/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean +++ b/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Antoine Chambert-Loir and María-Inés de Frutos Fernández. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María-Inés de Frutos Fernández -/ +module -import Mathlib.LinearAlgebra.TensorProduct.DirectLimit -import Mathlib.LinearAlgebra.TensorProduct.Tower -import Mathlib.RingTheory.Adjoin.FG +public import Mathlib.LinearAlgebra.TensorProduct.DirectLimit +public import Mathlib.LinearAlgebra.TensorProduct.Tower +public import Mathlib.RingTheory.Adjoin.FG /-! # Tensor products and finitely generated submodules @@ -43,6 +44,8 @@ tensor products of finitely-generated modules. as a linear equivalence. -/ +@[expose] public section + open Submodule LinearMap section Semiring diff --git a/Mathlib/RingTheory/TensorProduct/Finite.lean b/Mathlib/RingTheory/TensorProduct/Finite.lean index 0e56d87c396438..e54d6b15320ec3 100644 --- a/Mathlib/RingTheory/TensorProduct/Finite.lean +++ b/Mathlib/RingTheory/TensorProduct/Finite.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin -/ -import Mathlib.LinearAlgebra.Isomorphisms -import Mathlib.RingTheory.Finiteness.Basic -import Mathlib.RingTheory.Finiteness.Bilinear -import Mathlib.RingTheory.Ideal.Quotient.Basic -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.LinearAlgebra.Isomorphisms +public import Mathlib.RingTheory.Finiteness.Basic +public import Mathlib.RingTheory.Finiteness.Bilinear +public import Mathlib.RingTheory.Ideal.Quotient.Basic +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Finiteness of the tensor product of (sub)modules @@ -17,6 +19,8 @@ is again finitely generated. -/ +@[expose] public section + open Function (Surjective) open Finsupp diff --git a/Mathlib/RingTheory/TensorProduct/Free.lean b/Mathlib/RingTheory/TensorProduct/Free.lean index 1e0c7147b36020..aed084c35b63fc 100644 --- a/Mathlib/RingTheory/TensorProduct/Free.lean +++ b/Mathlib/RingTheory/TensorProduct/Free.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin -/ -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.LinearAlgebra.Finsupp.Pi -import Mathlib.LinearAlgebra.FreeModule.Basic -import Mathlib.LinearAlgebra.Matrix.ToLin +module + +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.LinearAlgebra.Finsupp.Pi +public import Mathlib.LinearAlgebra.FreeModule.Basic +public import Mathlib.LinearAlgebra.Matrix.ToLin /-! # Results on bases of tensor products @@ -22,6 +24,8 @@ and deduce that `Module.Free` is stable under base change. -/ +@[expose] public section + assert_not_exists Cardinal open Module diff --git a/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean b/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean index 5ef9ffdf7eac1d..278ee0ee405be1 100644 --- a/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean +++ b/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.LinearAlgebra.TensorProduct.Pi -import Mathlib.LinearAlgebra.TensorProduct.Prod -import Mathlib.RingTheory.Localization.BaseChange +module + +public import Mathlib.LinearAlgebra.TensorProduct.Pi +public import Mathlib.LinearAlgebra.TensorProduct.Prod +public import Mathlib.RingTheory.Localization.BaseChange /-! # Base change commutes with finite products @@ -14,6 +16,8 @@ In particular, localization of modules commutes with finite products. We also show the binary product versions. -/ +@[expose] public section + variable {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S] namespace IsBaseChange diff --git a/Mathlib/RingTheory/TensorProduct/Maps.lean b/Mathlib/RingTheory/TensorProduct/Maps.lean index 37e06c5e005cc7..9f9606ff1204fc 100644 --- a/Mathlib/RingTheory/TensorProduct/Maps.lean +++ b/Mathlib/RingTheory/TensorProduct/Maps.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Johan Commelin -/ -import Mathlib.Algebra.Algebra.RestrictScalars -import Mathlib.Algebra.Algebra.Subalgebra.Lattice -import Mathlib.Algebra.Module.Rat -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.Algebra.Algebra.RestrictScalars +public import Mathlib.Algebra.Algebra.Subalgebra.Lattice +public import Mathlib.Algebra.Module.Rat +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Maps between tensor products of R-algebras @@ -28,6 +30,8 @@ This file provides results about maps between tensor products of `R`-algebras. -/ +@[expose] public section + assert_not_exists Equiv.Perm.cycleType open scoped TensorProduct @@ -790,3 +794,15 @@ theorem endTensorEndAlgHom_apply (f : End A M) (g : End R N) : rfl end Module + +/-- Given a subalgebra `C` of an `R`-algebra `A`, and an `R`-algebra `B`, the base change of `C` to +a subalgebra of `B ⊗[R] A` -/ +def Subalgebra.baseChange {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] + (B : Type*) [CommSemiring B] [Algebra R B] (C : Subalgebra R A) : Subalgebra B (B ⊗[R] A) := + AlgHom.range (Algebra.TensorProduct.map (AlgHom.id B B) C.val) + +variable {R A B : Type*} [CommSemiring R] [Semiring A] [CommSemiring B] [Algebra R A] [Algebra R B] +variable {C : Subalgebra R A} + +lemma Subalgebra.tmul_mem_baseChange {x : A} (hx : x ∈ C) (b : B) : b ⊗ₜ[R] x ∈ C.baseChange B := + ⟨(b ⊗ₜ[R] ⟨x, hx⟩), rfl⟩ diff --git a/Mathlib/RingTheory/TensorProduct/MonoidAlgebra.lean b/Mathlib/RingTheory/TensorProduct/MonoidAlgebra.lean new file mode 100644 index 00000000000000..5c91e3464f5b68 --- /dev/null +++ b/Mathlib/RingTheory/TensorProduct/MonoidAlgebra.lean @@ -0,0 +1,90 @@ +/- +Copyright (c) 2025 Michał Mrugała. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Michał Mrugała +-/ +module + +public import Mathlib.Algebra.MonoidAlgebra.Basic +public import Mathlib.RingTheory.IsTensorProduct + +/-! +# Monoid algebras commute with base change + +In this file we show that monoid algebras are stable under pushout. + +## TODO + +Additivise +-/ + +@[expose] public section + +noncomputable section + +open TensorProduct + +namespace MonoidAlgebra +variable {R M S A B : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S] [CommMonoid M] +variable [CommSemiring A] [Algebra R A] [CommSemiring B] [Algebra R B] + +variable (R A B) in +/-- The base change of `MonoidAlgebra B M` to an `R`-algebra `A` is isomorphic to +`MonoidAlgebra (A ⊗[R] B) M` as an `A`-algebra. -/ +noncomputable def tensorEquiv : A ⊗[R] MonoidAlgebra B M ≃ₐ[A] MonoidAlgebra (A ⊗[R] B) M := by + refine .ofAlgHom + (Algebra.TensorProduct.lift + ((IsScalarTower.toAlgHom A (A ⊗[R] B) _).comp Algebra.TensorProduct.includeLeft) + (mapRangeAlgHom _ Algebra.TensorProduct.includeRight) fun p n ↦ .all ..) + (MonoidAlgebra.liftNCAlgHom (Algebra.TensorProduct.map (.id _ _) singleOneAlgHom) + (Algebra.TensorProduct.includeRight.toMonoidHom.comp (of B M)) fun _ _ ↦ .all ..) ?_ ?_ + · apply AlgHom.toLinearMap_injective + ext + simp + · ext : 1 + · ext + apply AlgHom.toLinearMap_injective + ext + simp + +@[simp] +lemma tensorEquiv_tmul (a : A) (p : MonoidAlgebra B M) : + tensorEquiv R A B (a ⊗ₜ p) = a • mapRangeAlgHom M Algebra.TensorProduct.includeRight p := by + simp [tensorEquiv, Algebra.smul_def] + +@[simp] +lemma tensorEquiv_symm_single (m : M) (a : A) (b : B) : + (tensorEquiv R A B).symm (single m (a ⊗ₜ b)) = a ⊗ₜ single m b := by simp [tensorEquiv] + +variable (R A) in +/-- The base change of `MonoidAlgebra R M` to an `R`-algebra `A` is isomorphic to +`MonoidAlgebra A M` as an `A`-algebra. -/ +noncomputable def scalarTensorEquiv : A ⊗[R] MonoidAlgebra R M ≃ₐ[A] MonoidAlgebra A M := + (tensorEquiv ..).trans <| mapRangeAlgEquiv A M <| Algebra.TensorProduct.rid R A A + +@[simp] +lemma scalarTensorEquiv_tmul (a : A) (p : MonoidAlgebra R M) : + scalarTensorEquiv R A (a ⊗ₜ p) = a • mapRangeAlgHom M (Algebra.ofId ..) p := by + ext; simp [scalarTensorEquiv]; simp [Algebra.smul_def, Algebra.commutes] + +@[simp] +lemma scalarTensorEquiv_symm_single (m : M) (a : A) : + (scalarTensorEquiv R A).symm (single m a) = a ⊗ₜ single m 1 := by simp [scalarTensorEquiv] + +attribute [local instance] algebraMonoidAlgebra in +instance [Algebra S B] [Algebra A B] [Algebra R B] [IsScalarTower R A B] [IsScalarTower R S B] + [Algebra.IsPushout R S A B] : + Algebra.IsPushout R S (MonoidAlgebra A M) (MonoidAlgebra B M) where + out := .of_equiv ((tensorEquiv (M := M) R S A).trans <| + mapRangeAlgEquiv S M <| Algebra.IsPushout.equiv R S A B).toLinearEquiv fun x ↦ by + induction x using Finsupp.induction_linear <;> simp_all [Algebra.IsPushout.equiv_tmul] + +attribute [local instance] algebraMonoidAlgebra in +instance [Algebra S B] [Algebra A B] [Algebra R B] [IsScalarTower R A B] [IsScalarTower R S B] + [Algebra.IsPushout R A S B] : Algebra.IsPushout R (MonoidAlgebra A M) S (MonoidAlgebra B M) := + have : Algebra.IsPushout R S A B := .symm ‹_› + .symm inferInstance + +end MonoidAlgebra + +end diff --git a/Mathlib/RingTheory/TensorProduct/MvPolynomial.lean b/Mathlib/RingTheory/TensorProduct/MvPolynomial.lean index 0f01a14fa34a51..295f778be91807 100644 --- a/Mathlib/RingTheory/TensorProduct/MvPolynomial.lean +++ b/Mathlib/RingTheory/TensorProduct/MvPolynomial.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.LinearAlgebra.DirectSum.Finsupp -import Mathlib.Algebra.MvPolynomial.Eval -import Mathlib.RingTheory.TensorProduct.Basic -import Mathlib.Algebra.MvPolynomial.Equiv -import Mathlib.RingTheory.IsTensorProduct +public import Mathlib.LinearAlgebra.DirectSum.Finsupp +public import Mathlib.Algebra.MvPolynomial.Eval +public import Mathlib.RingTheory.TensorProduct.Basic +public import Mathlib.Algebra.MvPolynomial.Equiv +public import Mathlib.RingTheory.IsTensorProduct /-! @@ -38,6 +39,8 @@ Let `Semiring R`, `Algebra R S` and `Module R N`. are morphisms for the algebra structure by `MvPolynomial σ R`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/RingTheory/TensorProduct/Nontrivial.lean b/Mathlib/RingTheory/TensorProduct/Nontrivial.lean index c78b9bdcadd72e..6bb7b093deab83 100644 --- a/Mathlib/RingTheory/TensorProduct/Nontrivial.lean +++ b/Mathlib/RingTheory/TensorProduct/Nontrivial.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ -import Mathlib.LinearAlgebra.Basis.VectorSpace -import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic -import Mathlib.RingTheory.Localization.FractionRing +module + +public import Mathlib.LinearAlgebra.Basis.VectorSpace +public import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic +public import Mathlib.RingTheory.Localization.FractionRing /-! @@ -15,6 +17,8 @@ This file contains some more results on nontriviality of tensor product of algeb -/ +@[expose] public section + open TensorProduct namespace Algebra.TensorProduct diff --git a/Mathlib/RingTheory/TensorProduct/Pi.lean b/Mathlib/RingTheory/TensorProduct/Pi.lean index afca70b6271d02..dcf93f34afd778 100644 --- a/Mathlib/RingTheory/TensorProduct/Pi.lean +++ b/Mathlib/RingTheory/TensorProduct/Pi.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Christian Merten. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten -/ -import Mathlib.Algebra.Algebra.Pi -import Mathlib.LinearAlgebra.TensorProduct.Pi -import Mathlib.LinearAlgebra.TensorProduct.Prod -import Mathlib.RingTheory.TensorProduct.Maps +module + +public import Mathlib.Algebra.Algebra.Pi +public import Mathlib.LinearAlgebra.TensorProduct.Pi +public import Mathlib.LinearAlgebra.TensorProduct.Prod +public import Mathlib.RingTheory.TensorProduct.Maps /-! # Tensor product and products of algebras @@ -16,6 +18,8 @@ is a direct application of `Mathlib/LinearAlgebra/TensorProduct/Pi.lean` to the -/ +@[expose] public section + open TensorProduct namespace Algebra.TensorProduct diff --git a/Mathlib/RingTheory/TensorProduct/Quotient.lean b/Mathlib/RingTheory/TensorProduct/Quotient.lean index 55c10cf2bdbd48..36ede6bb50b364 100644 --- a/Mathlib/RingTheory/TensorProduct/Quotient.lean +++ b/Mathlib/RingTheory/TensorProduct/Quotient.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Christian Merten, Yi Song, Sihan Su. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Christian Merten, Yi Song, Sihan Su -/ -import Mathlib.LinearAlgebra.TensorProduct.Quotient -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.TensorProduct.Basic +module + +public import Mathlib.LinearAlgebra.TensorProduct.Quotient +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.TensorProduct.Basic /-! # Interaction between quotients and tensor products for algebras @@ -19,6 +21,8 @@ This file proves algebra analogs of the isomorphisms in `B ⧸ (I.map <| algebraMap A B) ≃ₐ[B] B ⊗[A] (A ⧸ I)` -/ +@[expose] public section + open TensorProduct namespace Algebra.TensorProduct diff --git a/Mathlib/RingTheory/Trace/Basic.lean b/Mathlib/RingTheory/Trace/Basic.lean index fb4577aee4d5d0..b6b513e33bbf20 100644 --- a/Mathlib/RingTheory/Trace/Basic.lean +++ b/Mathlib/RingTheory/Trace/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.FieldTheory.Galois.Basic -import Mathlib.FieldTheory.Minpoly.MinpolyDiv -import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure -import Mathlib.FieldTheory.PurelyInseparable.Basic -import Mathlib.LinearAlgebra.Determinant -import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly -import Mathlib.LinearAlgebra.Vandermonde -import Mathlib.RingTheory.Trace.Defs +module + +public import Mathlib.FieldTheory.Galois.Basic +public import Mathlib.FieldTheory.Minpoly.MinpolyDiv +public import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +public import Mathlib.FieldTheory.PurelyInseparable.Basic +public import Mathlib.LinearAlgebra.Determinant +public import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly +public import Mathlib.LinearAlgebra.Vandermonde +public import Mathlib.RingTheory.Trace.Defs /-! # Trace for (finite) ring extensions. @@ -44,6 +46,8 @@ the roots of the minimal polynomial of `s` over `R`. -/ +@[expose] public section + universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] @@ -100,7 +104,7 @@ theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) : contrapose! hx obtain ⟨s, ⟨b⟩⟩ := hx refine .of_mem_of_fg K⟮x⟯.toSubalgebra ?_ x ?_ - · exact (Submodule.fg_iff_finiteDimensional _).mpr (FiniteDimensional.of_fintype_basis b) + · exact (Submodule.fg_iff_finiteDimensional _).mpr (b.finiteDimensional_of_finite) · exact subset_adjoin K _ (Set.mem_singleton x) theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) : @@ -472,7 +476,7 @@ theorem det_traceMatrix_ne_zero' [Algebra.IsSeparable K L] : det (traceMatrix K theorem det_traceForm_ne_zero [Algebra.IsSeparable K L] [Fintype ι] [DecidableEq ι] (b : Basis ι K L) : det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by - haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b + haveI : FiniteDimensional K L := b.finiteDimensional_of_finite let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _ rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ← det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul] diff --git a/Mathlib/RingTheory/Trace/Defs.lean b/Mathlib/RingTheory/Trace/Defs.lean index 84138028af48d4..7e90ee02a8e124 100644 --- a/Mathlib/RingTheory/Trace/Defs.lean +++ b/Mathlib/RingTheory/Trace/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ -import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas -import Mathlib.LinearAlgebra.Matrix.BilinearForm -import Mathlib.LinearAlgebra.Trace +module + +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.Matrix.BilinearForm +public import Mathlib.LinearAlgebra.Trace /-! # Trace for (finite) ring extensions. @@ -41,6 +43,8 @@ For now, the definitions assume `S` is commutative, so the choice doesn't matter -/ +@[expose] public section + universe w diff --git a/Mathlib/RingTheory/Trace/Quotient.lean b/Mathlib/RingTheory/Trace/Quotient.lean index 1fc6eebf7bc58f..6e73f09af04bc9 100644 --- a/Mathlib/RingTheory/Trace/Quotient.lean +++ b/Mathlib/RingTheory/Trace/Quotient.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Riccardo Brasca -/ -import Mathlib.RingTheory.DedekindDomain.Dvr -import Mathlib.RingTheory.IntegralClosure.IntegralRestrict -import Mathlib.RingTheory.LocalRing.Quotient +module + +public import Mathlib.RingTheory.DedekindDomain.Dvr +public import Mathlib.RingTheory.IntegralClosure.IntegralRestrict +public import Mathlib.RingTheory.LocalRing.Quotient /-! @@ -19,6 +21,8 @@ quotients and localizations. -/ +@[expose] public section + variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] open IsLocalRing FiniteDimensional Submodule diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean b/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean index ede3bcce035fb8..379c991815f38f 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.Tactic.Abel -import Mathlib.Algebra.Ring.Opposite -import Mathlib.GroupTheory.GroupAction.SubMulAction -import Mathlib.RingTheory.Congruence.Opposite +public import Mathlib.Tactic.Abel +public import Mathlib.Algebra.Ring.Opposite +public import Mathlib.GroupTheory.GroupAction.SubMulAction +public import Mathlib.RingTheory.Congruence.Opposite /-! # Two Sided Ideals @@ -24,6 +25,8 @@ In this file, for any `Ring R`, we reinterpret `I : RingCon R` as a two-sided-id -/ +@[expose] public section + assert_not_exists LinearMap open MulOpposite diff --git a/Mathlib/RingTheory/TwoSidedIdeal/BigOperators.lean b/Mathlib/RingTheory/TwoSidedIdeal/BigOperators.lean index c7fcfd8697546d..1a44f3f9c2e4d0 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/BigOperators.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/BigOperators.lean @@ -3,15 +3,18 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.RingTheory.Congruence.BigOperators -import Mathlib.RingTheory.TwoSidedIdeal.Basic +public import Mathlib.RingTheory.Congruence.BigOperators +public import Mathlib.RingTheory.TwoSidedIdeal.Basic /-! # Interactions between `∑, ∏` and two-sided ideals -/ +@[expose] public section + namespace TwoSidedIdeal section sum diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Instances.lean b/Mathlib/RingTheory/TwoSidedIdeal/Instances.lean index 506bbdc3a6099d..5d5145f709310a 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Instances.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Instances.lean @@ -3,12 +3,16 @@ Copyright (c) 2024 euprunin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: euprunin -/ -import Mathlib.Algebra.Ring.Defs -import Mathlib.RingTheory.NonUnitalSubring.Defs -import Mathlib.RingTheory.TwoSidedIdeal.Basic +module + +public import Mathlib.Algebra.Ring.Defs +public import Mathlib.RingTheory.NonUnitalSubring.Defs +public import Mathlib.RingTheory.TwoSidedIdeal.Basic /-! # Additional instances for two-sided ideals. -/ + +@[expose] public section instance {R} [NonUnitalNonAssocRing R] : NonUnitalSubringClass (TwoSidedIdeal R) R where mul_mem _ hb := TwoSidedIdeal.mul_mem_left _ _ _ hb diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean b/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean index dc6cfbf95275d9..28adff84aadc70 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Jujian. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Jujian Zhang -/ +module -import Mathlib.RingTheory.TwoSidedIdeal.Basic -import Mathlib.RingTheory.TwoSidedIdeal.Lattice +public import Mathlib.RingTheory.TwoSidedIdeal.Basic +public import Mathlib.RingTheory.TwoSidedIdeal.Lattice /-! # Kernel of a ring homomorphism as a two-sided ideal @@ -16,6 +17,8 @@ We put this in a separate file so that we could import it in `SimpleRing/Basic.l importing any finiteness result. -/ +@[expose] public section + assert_not_exists Finset namespace TwoSidedIdeal diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean b/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean index d2f41fad09143c..baf39d6809aa73 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean @@ -3,13 +3,16 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang -/ +module -import Mathlib.RingTheory.TwoSidedIdeal.Basic +public import Mathlib.RingTheory.TwoSidedIdeal.Basic /-! # The complete lattice structure on two-sided ideals -/ +@[expose] public section + namespace TwoSidedIdeal variable (R : Type*) [NonUnitalNonAssocRing R] diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean b/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean index 6b29aaffa598eb..df0595b4084c39 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean @@ -3,13 +3,15 @@ Copyright (c) 2024 Jujian Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jujian Zhang, Jireh Loreaux, Yunzhou Xie -/ -import Mathlib.Algebra.Group.Subgroup.Map -import Mathlib.Algebra.Module.Opposite -import Mathlib.Algebra.Module.Submodule.Lattice -import Mathlib.RingTheory.Congruence.Opposite -import Mathlib.RingTheory.Ideal.Defs -import Mathlib.RingTheory.TwoSidedIdeal.Lattice -import Mathlib.Algebra.Group.Pointwise.Set.Basic +module + +public import Mathlib.Algebra.Group.Subgroup.Map +public import Mathlib.Algebra.Module.Opposite +public import Mathlib.Algebra.Module.Submodule.Lattice +public import Mathlib.RingTheory.Congruence.Opposite +public import Mathlib.RingTheory.Ideal.Defs +public import Mathlib.RingTheory.TwoSidedIdeal.Lattice +public import Mathlib.Algebra.Group.Pointwise.Set.Basic /-! # Operations on two-sided ideals @@ -39,6 +41,8 @@ This file defines operations on two-sided ideals of a ring `R`. ideal and `asIdeal : TwoSidedIdeal R → Ideal R` the inclusion map. -/ +@[expose] public section + namespace TwoSidedIdeal section NonUnitalNonAssocRing diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean index 5b27980cdc51ce..9ae6de8b9961d6 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Algebra.BigOperators.Associated -import Mathlib.Data.ENat.Basic -import Mathlib.RingTheory.UniqueFactorizationDomain.Defs +module + +public import Mathlib.Algebra.BigOperators.Associated +public import Mathlib.Data.ENat.Basic +public import Mathlib.RingTheory.UniqueFactorizationDomain.Defs /-! # Basic results un unique factorization monoids @@ -25,6 +27,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.Defs to get relatively prime elements. -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Defs.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Defs.lean index 7bbf24774a965a..3f80b6de9fa2ff 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Defs.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Defs.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Algebra.BigOperators.Group.Multiset.Basic -import Mathlib.Algebra.Group.Submonoid.BigOperators -import Mathlib.Algebra.GroupWithZero.Associated -import Mathlib.Algebra.GroupWithZero.Submonoid.Primal -import Mathlib.Order.WellFounded +module + +public import Mathlib.Algebra.BigOperators.Group.Multiset.Basic +public import Mathlib.Algebra.Group.Submonoid.BigOperators +public import Mathlib.Algebra.GroupWithZero.Associated +public import Mathlib.Algebra.GroupWithZero.Submonoid.Primal +public import Mathlib.Order.WellFounded /-! # Unique factorization @@ -19,6 +21,8 @@ import Mathlib.Order.WellFounded `Irreducible` is equivalent to `Prime` -/ +@[expose] public section + assert_not_exists Field Finsupp Ideal variable {α : Type*} diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean index b14775be03917f..c0b21d906cfa5f 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.RingTheory.UniqueFactorizationDomain.Basic -import Mathlib.Tactic.Ring +module + +public import Mathlib.RingTheory.UniqueFactorizationDomain.Basic +public import Mathlib.Tactic.Ring /-! # Set of factors @@ -18,6 +20,8 @@ import Mathlib.Tactic.Ring -/ +@[expose] public section + variable {α : Type*} local infixl:50 " ~ᵤ " => Associated diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean index ea8309c12177f3..20948f359d370b 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Finiteness of divisors @@ -13,6 +15,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors finitely many divisors. -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Finsupp.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Finsupp.lean index a901b3c83b1a34..950740acf4d4fb 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Finsupp.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Finsupp.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Data.Finsupp.Multiset -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.Data.Finsupp.Multiset +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Factors as finsupp @@ -13,6 +15,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors * `UniqueFactorizationMonoid.factorization`: the multiset of irreducible factors as a `Finsupp`. -/ +@[expose] public section + variable {α : Type*} local infixl:50 " ~ᵤ " => Associated diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean index 74940f8f2ed5fe..7970bd0488387f 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.RingTheory.UniqueFactorizationDomain.FactorSet -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.RingTheory.UniqueFactorizationDomain.FactorSet +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Building GCD out of unique factorization @@ -13,6 +15,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors * `UniqueFactorizationMonoid.toGCDMonoid`: choose a GCD monoid structure given unique factorization. -/ +@[expose] public section + variable {α : Type*} local infixl:50 " ~ᵤ " => Associated diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Ideal.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Ideal.lean index 76a9fb5c099410..8fbb413a0172a1 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Ideal.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Ideal.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.RingTheory.UniqueFactorizationDomain.Defs +module + +public import Mathlib.RingTheory.Ideal.Operations +public import Mathlib.RingTheory.UniqueFactorizationDomain.Defs /-! # Unique factorization and ascending chain condition on ideals @@ -15,6 +17,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.Defs chain condition on principal ideals. -/ +@[expose] public section + variable {α : Type*} open UniqueFactorizationMonoid in diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean index 4e9d7b8a38d34f..d62191643ab02d 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Multiplicative maps on unique factorization domains @@ -15,6 +17,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors primes `p`, and `f` is multiplicative on coprime elements, then `f` is multiplicative everywhere. -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean index fe334019d18215..9a691d3c1d644d 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.RingTheory.Multiplicity -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.RingTheory.Multiplicity +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Unique factorization and multiplicity @@ -16,6 +18,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors occurs in the `normalizedFactors`. -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Nat.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Nat.lean index 3f50d006bd20b6..06086e026574e4 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Nat.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Nat.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Data.ENat.Basic -import Mathlib.Data.Nat.Factors -import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors +module + +public import Mathlib.Data.ENat.Basic +public import Mathlib.Data.Nat.Factors +public import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors /-! # Unique factorization of natural numbers @@ -15,6 +17,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.NormalizedFactors * `Nat.instUniqueFactorizationMonoid`: the natural numbers have unique factorization -/ +@[expose] public section + assert_not_exists Field namespace Nat diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean index 9fe8562db0d2f4..01c07718e2db84 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker, Aaron Anderson -/ -import Mathlib.Algebra.GCDMonoid.Basic -import Mathlib.Data.Multiset.OrderedMonoid -import Mathlib.RingTheory.UniqueFactorizationDomain.Basic +module + +public import Mathlib.Algebra.GCDMonoid.Basic +public import Mathlib.Data.Multiset.OrderedMonoid +public import Mathlib.RingTheory.UniqueFactorizationDomain.Basic /-! # Unique factorization and normalization @@ -16,6 +18,8 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.Basic * `UniqueFactorizationMonoid.normalizationMonoid`: choose a way of normalizing the elements of a UFM -/ +@[expose] public section + assert_not_exists Field variable {α : Type*} diff --git a/Mathlib/RingTheory/Unramified/Basic.lean b/Mathlib/RingTheory/Unramified/Basic.lean index fcd64c07498aa3..fcef231ca095af 100644 --- a/Mathlib/RingTheory/Unramified/Basic.lean +++ b/Mathlib/RingTheory/Unramified/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.FiniteStability -import Mathlib.RingTheory.Ideal.Quotient.Nilpotent -import Mathlib.RingTheory.Kaehler.Basic -import Mathlib.RingTheory.Localization.Away.AdjoinRoot -import Mathlib.Algebra.Algebra.Shrink +module + +public import Mathlib.RingTheory.FiniteStability +public import Mathlib.RingTheory.Ideal.Quotient.Nilpotent +public import Mathlib.RingTheory.Kaehler.Basic +public import Mathlib.RingTheory.Localization.Away.AdjoinRoot +public import Mathlib.Algebra.Algebra.Shrink /-! @@ -31,6 +33,8 @@ localization at an element. -/ +@[expose] public section + open scoped TensorProduct universe w u v @@ -220,7 +224,7 @@ theorem comp [FormallyUnramified R A] [FormallyUnramified A B] : congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) -theorem of_comp [FormallyUnramified R B] : FormallyUnramified A B := by +theorem of_restrictScalars [FormallyUnramified R B] : FormallyUnramified A B := by rw [iff_comp_injective] intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra @@ -230,6 +234,8 @@ theorem of_comp [FormallyUnramified R B] : FormallyUnramified A B := by intro x exact AlgHom.congr_fun e' x +@[deprecated (since := "2025-10-24")] alias of_comp := of_restrictScalars + end Comp section of_surjective @@ -308,7 +314,7 @@ The intended use is for copying proofs between `Formally{Unramified, Smooth, Eta without the need to change anything (including removing redundant arguments). -/ @[nolint unusedArguments] theorem localization_base [FormallyUnramified R Sₘ] : FormallyUnramified Rₘ Sₘ := - FormallyUnramified.of_comp R Rₘ Sₘ + FormallyUnramified.of_restrictScalars R Rₘ Sₘ theorem localization_map [FormallyUnramified R S] : FormallyUnramified Rₘ Sₘ := by diff --git a/Mathlib/RingTheory/Unramified/Field.lean b/Mathlib/RingTheory/Unramified/Field.lean index f2507196d7a717..f8291b8ddb0765 100644 --- a/Mathlib/RingTheory/Unramified/Field.lean +++ b/Mathlib/RingTheory/Unramified/Field.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.FieldTheory.PurelyInseparable.Basic -import Mathlib.RingTheory.Artinian.Ring -import Mathlib.RingTheory.LocalProperties.Basic -import Mathlib.Algebra.Polynomial.Taylor -import Mathlib.RingTheory.Unramified.Finite +module + +public import Mathlib.FieldTheory.PurelyInseparable.Basic +public import Mathlib.RingTheory.Artinian.Ring +public import Mathlib.RingTheory.LocalProperties.Basic +public import Mathlib.Algebra.Polynomial.Taylor +public import Mathlib.RingTheory.Unramified.Finite /-! # Unramified algebras over fields @@ -29,6 +31,8 @@ Let `K` be a field, `A` be a `K`-algebra and `L` be a field extension of `K`. -/ +@[expose] public section + open Algebra Module Polynomial open scoped TensorProduct @@ -197,7 +201,7 @@ theorem range_eq_top_of_isPurelyInseparable theorem isSeparable : Algebra.IsSeparable K L := by have := finite_of_free (R := K) (S := L) rw [← separableClosure.eq_top_iff] - have := of_comp K (separableClosure K L) L + have := of_restrictScalars K (separableClosure K L) L have := EssFiniteType.of_comp K (separableClosure K L) L ext change _ ↔ _ ∈ (⊤ : Subring _) diff --git a/Mathlib/RingTheory/Unramified/Finite.lean b/Mathlib/RingTheory/Unramified/Finite.lean index 0f58c3c3393938..106cd2bec82bf1 100644 --- a/Mathlib/RingTheory/Unramified/Finite.lean +++ b/Mathlib/RingTheory/Unramified/Finite.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Ideal.IdempotentFG -import Mathlib.RingTheory.Unramified.Basic -import Mathlib.RingTheory.Flat.Stability +module + +public import Mathlib.RingTheory.Ideal.IdempotentFG +public import Mathlib.RingTheory.Unramified.Basic +public import Mathlib.RingTheory.Flat.Stability /-! # Various results about unramified algebras @@ -30,6 +32,8 @@ of formally unramified algebras which are essentially of finite type. -/ +@[expose] public section + open Algebra Module open scoped TensorProduct diff --git a/Mathlib/RingTheory/Unramified/LocalRing.lean b/Mathlib/RingTheory/Unramified/LocalRing.lean index 0a62708c26b3b3..d6231b23522309 100644 --- a/Mathlib/RingTheory/Unramified/LocalRing.lean +++ b/Mathlib/RingTheory/Unramified/LocalRing.lean @@ -3,10 +3,12 @@ Copyright (c) 2025 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.LocalRing.Module -import Mathlib.RingTheory.LocalRing.ResidueField.Ideal -import Mathlib.RingTheory.Unramified.Field -import Mathlib.RingTheory.Unramified.Locus +module + +public import Mathlib.RingTheory.LocalRing.Module +public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal +public import Mathlib.RingTheory.Unramified.Field +public import Mathlib.RingTheory.Unramified.Locus /-! # Unramified algebras over local rings @@ -20,6 +22,8 @@ import Mathlib.RingTheory.Unramified.Locus Then `A` is unramified at `p` if and only if `κ(q)/κ(p)` is separable, and `pS_q = qS_q`. -/ +@[expose] public section + open IsLocalRing namespace Algebra @@ -34,7 +38,7 @@ instance : FormallyUnramified S (ResidueField S) := .quotient _ instance [FormallyUnramified R S] : FormallyUnramified (ResidueField R) (ResidueField S) := have : FormallyUnramified R (ResidueField S) := .comp _ S _ - .of_comp R _ _ + .of_restrictScalars R _ _ variable [EssFiniteType R S] @@ -56,7 +60,7 @@ lemma FormallyUnramified.isField_quotient_map_maximalIdeal [FormallyUnramified R have hmR : mR ≤ maximalIdeal S := ((local_hom_TFAE (algebraMap R S)).out 0 2 rfl rfl).mp ‹_› letI : Algebra (ResidueField R) (S ⧸ mR) := inferInstanceAs (Algebra (R ⧸ _) _) have : IsScalarTower R (ResidueField R) (S ⧸ mR) := inferInstanceAs (IsScalarTower R (R ⧸ _) _) - have : FormallyUnramified (ResidueField R) (S ⧸ mR) := .of_comp R _ _ + have : FormallyUnramified (ResidueField R) (S ⧸ mR) := .of_restrictScalars R _ _ have : EssFiniteType (ResidueField R) (S ⧸ mR) := .of_comp R _ _ have : Module.Finite (ResidueField R) (S ⧸ mR) := FormallyUnramified.finite_of_free _ _ have : IsReduced (S ⧸ mR) := FormallyUnramified.isReduced_of_field (ResidueField R) (S ⧸ mR) @@ -131,7 +135,7 @@ lemma isUnramifiedAt_iff_map_eq [EssFiniteType R S] Localization.isLocalHom_localRingHom _ _ _ Ideal.LiesOver.over have : EssFiniteType (Localization.AtPrime p) (Localization.AtPrime q) := .of_comp R _ _ trans Algebra.FormallyUnramified (Localization.AtPrime p) (Localization.AtPrime q) - · exact ⟨fun _ ↦ .of_comp R _ _, + · exact ⟨fun _ ↦ .of_restrictScalars R _ _, fun _ ↦ Algebra.FormallyUnramified.comp _ (Localization.AtPrime p) _⟩ rw [FormallyUnramified.iff_map_maximalIdeal_eq] congr! diff --git a/Mathlib/RingTheory/Unramified/Locus.lean b/Mathlib/RingTheory/Unramified/Locus.lean index 0e86e025d41d90..6e25f9e81e634e 100644 --- a/Mathlib/RingTheory/Unramified/Locus.lean +++ b/Mathlib/RingTheory/Unramified/Locus.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Spectrum.Prime.Topology -import Mathlib.RingTheory.Etale.Kaehler -import Mathlib.RingTheory.Support +module + +public import Mathlib.RingTheory.Spectrum.Prime.Topology +public import Mathlib.RingTheory.Etale.Kaehler +public import Mathlib.RingTheory.Support /-! # Unramified locus of an algebra @@ -20,6 +22,8 @@ import Mathlib.RingTheory.Support If `A` is (essentially) of finite type over `R`, then the unramified locus is open. -/ +@[expose] public section + universe u namespace Algebra @@ -48,13 +52,13 @@ lemma IsUnramifiedAt.comp (p : Ideal A) (P : Ideal B) [P.LiesOver p] [p.IsPrime] [P.IsPrime] [IsUnramifiedAt R p] [IsUnramifiedAt A P] : IsUnramifiedAt R P := by have : FormallyUnramified (Localization.AtPrime p) (Localization.AtPrime P) := - .of_comp A _ _ + .of_restrictScalars A _ _ exact FormallyUnramified.comp R (Localization.AtPrime p) _ variable (R) in lemma IsUnramifiedAt.of_restrictScalars (P : Ideal B) [P.IsPrime] [IsUnramifiedAt R P] : IsUnramifiedAt A P := - FormallyUnramified.of_comp R _ _ + FormallyUnramified.of_restrictScalars R _ _ end diff --git a/Mathlib/RingTheory/Unramified/Pi.lean b/Mathlib/RingTheory/Unramified/Pi.lean index 08bef4152fea63..b7395c9451e75e 100644 --- a/Mathlib/RingTheory/Unramified/Pi.lean +++ b/Mathlib/RingTheory/Unramified/Pi.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ -import Mathlib.RingTheory.Unramified.Basic +module + +public import Mathlib.RingTheory.Unramified.Basic /-! @@ -16,6 +18,8 @@ import Mathlib.RingTheory.Unramified.Basic -/ +@[expose] public section + namespace Algebra.FormallyUnramified variable {R : Type*} {I : Type*} [Finite I] (f : I → Type*) diff --git a/Mathlib/RingTheory/Valuation/AlgebraInstances.lean b/Mathlib/RingTheory/Valuation/AlgebraInstances.lean index 0f76fe15e064f3..89fa6e5fbcd456 100644 --- a/Mathlib/RingTheory/Valuation/AlgebraInstances.lean +++ b/Mathlib/RingTheory/Valuation/AlgebraInstances.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic -import Mathlib.RingTheory.Valuation.ValuationSubring +module + +public import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic +public import Mathlib.RingTheory.Valuation.ValuationSubring /-! # Algebra instances @@ -12,16 +14,18 @@ import Mathlib.RingTheory.Valuation.ValuationSubring This file contains several `Algebra` and `IsScalarTower` instances related to extensions of a field with a valuation, as well as their unit balls. -# Main Definitions +## Main definitions * `ValuationSubring.algebra` : Given an algebra between two field extensions `L` and `E` of a field `K` with a valuation, create an algebra between their two rings of integers. -# Main Results +## Main statements * `integralClosure_algebraMap_injective` : the unit ball of a field `K` with respect to a valuation injects into its integral closure in a field extension `L` of `K`. -/ +@[expose] public section + open Function Valuation open scoped WithZero diff --git a/Mathlib/RingTheory/Valuation/Archimedean.lean b/Mathlib/RingTheory/Valuation/Archimedean.lean index e5c04bdb399bd8..55e16b2e79ed60 100644 --- a/Mathlib/RingTheory/Valuation/Archimedean.lean +++ b/Mathlib/RingTheory/Valuation/Archimedean.lean @@ -3,14 +3,18 @@ Copyright (c) 2024 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.GroupTheory.ArchimedeanDensely -import Mathlib.RingTheory.Valuation.ValuationRing +module + +public import Mathlib.GroupTheory.ArchimedeanDensely +public import Mathlib.RingTheory.Valuation.ValuationRing /-! # Ring of integers under a given valuation in an multiplicatively archimedean codomain -/ +@[expose] public section + section Field variable {F Γ₀ O : Type*} [Field F] [LinearOrderedCommGroupWithZero Γ₀] diff --git a/Mathlib/RingTheory/Valuation/Basic.lean b/Mathlib/RingTheory/Valuation/Basic.lean index 643b6f8b82ca05..49cc783501673e 100644 --- a/Mathlib/RingTheory/Valuation/Basic.lean +++ b/Mathlib/RingTheory/Valuation/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Johan Commelin, Patrick Massot -/ -import Mathlib.Algebra.GroupWithZero.Submonoid.Instances -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.Algebra.Order.Ring.Basic -import Mathlib.RingTheory.Ideal.Maps -import Mathlib.Tactic.TFAE +module + +public import Mathlib.Algebra.GroupWithZero.Submonoid.Instances +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.Algebra.Order.Ring.Basic +public import Mathlib.RingTheory.Ideal.Maps +public import Mathlib.Tactic.TFAE /-! @@ -58,6 +60,8 @@ If ever someone extends `Valuation`, we should fully comply to the `DFunLike` by boilerplate lemmas to `ValuationClass`. -/ +@[expose] public section + open Function Ideal noncomputable section diff --git a/Mathlib/RingTheory/Valuation/Discrete/Basic.lean b/Mathlib/RingTheory/Valuation/Discrete/Basic.lean index d79418eae82452..0c09c0fc95282a 100644 --- a/Mathlib/RingTheory/Valuation/Discrete/Basic.lean +++ b/Mathlib/RingTheory/Valuation/Discrete/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.Algebra.GroupWithZero.Range -import Mathlib.Algebra.Order.Group.Cyclic -import Mathlib.RingTheory.DedekindDomain.AdicValuation -import Mathlib.RingTheory.DiscreteValuationRing.Basic -import Mathlib.RingTheory.PrincipalIdealDomainOfPrime +module + +public import Mathlib.Algebra.GroupWithZero.Range +public import Mathlib.Algebra.Order.Group.Cyclic +public import Mathlib.RingTheory.DedekindDomain.AdicValuation +public import Mathlib.RingTheory.DiscreteValuationRing.Basic +public import Mathlib.RingTheory.PrincipalIdealDomainOfPrime /-! # Discrete Valuations @@ -15,7 +17,7 @@ import Mathlib.RingTheory.PrincipalIdealDomainOfPrime Given a linearly ordered commutative group with zero `Γ`, a valuation `v : A → Γ` on a ring `A` is *discrete*, if there is an element `γ : Γˣ` that is `< 1` and generated the range of `v`, implemented as `MonoidWithZeroHom.valueGroup v`. When `Γ := ℤₘ₀` (defined in -`Multiplicative.termℤₘ₀`), `γ` = ofAdd (-1)` and the condition of being discrete is +`Multiplicative.termℤₘ₀`), `γ = ofAdd (-1)` and the condition of being discrete is equivalent to asking that `ofAdd (-1 : ℤ)` belongs to the image, in turn equivalent to asking that `1 : ℤ` belongs to the image of the corresponding *additive* valuation. @@ -58,6 +60,8 @@ discrete, we use the name `IsRankOneDiscrete` to refer to discrete valuations in ) -/ +@[expose] public section + namespace Valuation open LinearOrderedCommGroup MonoidWithZeroHom Set Subgroup diff --git a/Mathlib/RingTheory/Valuation/DiscreteValuativeRel.lean b/Mathlib/RingTheory/Valuation/DiscreteValuativeRel.lean index 7b42a9159c684c..3f43da9a212ed2 100644 --- a/Mathlib/RingTheory/Valuation/DiscreteValuativeRel.lean +++ b/Mathlib/RingTheory/Valuation/DiscreteValuativeRel.lean @@ -3,10 +3,11 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ +module -import Mathlib.Algebra.GroupWithZero.Range -import Mathlib.GroupTheory.ArchimedeanDensely -import Mathlib.RingTheory.Valuation.RankOne +public import Mathlib.Algebra.GroupWithZero.Range +public import Mathlib.GroupTheory.ArchimedeanDensely +public import Mathlib.RingTheory.Valuation.RankOne /-! @@ -18,6 +19,8 @@ In the rank-one case, this is equivalent to the value group being isomorphic to -/ +@[expose] public section + namespace ValuativeRel variable {R : Type*} [CommRing R] [ValuativeRel R] diff --git a/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean b/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean index ccba55b7316145..904eae8ec5c268 100644 --- a/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean +++ b/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.RingTheory.Localization.Defs -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.RingTheory.Valuation.Basic /-! @@ -16,6 +18,8 @@ extended to the localization `S⁻¹A`. -/ +@[expose] public section + variable {A : Type*} [CommRing A] {Γ : Type*} [LinearOrderedCommGroupWithZero Γ] (v : Valuation A Γ) {S : Submonoid A} (hS : S ≤ v.supp.primeCompl) (B : Type*) [CommRing B] diff --git a/Mathlib/RingTheory/Valuation/Extension.lean b/Mathlib/RingTheory/Valuation/Extension.lean index 09784e12a214ac..dbab215835ed05 100644 --- a/Mathlib/RingTheory/Valuation/Extension.lean +++ b/Mathlib/RingTheory/Valuation/Extension.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang, Bichang Lei, María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.RingTheory.Valuation.ValuationSubring +module + +public import Mathlib.RingTheory.Valuation.ValuationSubring /-! # Extension of Valuations @@ -44,6 +46,8 @@ without first determining the normalizations once and for all. Valuation, Extension of Valuations -/ + +@[expose] public section namespace Valuation variable {R A ΓR ΓA : Type*} [CommRing R] [Ring A] diff --git a/Mathlib/RingTheory/Valuation/Integers.lean b/Mathlib/RingTheory/Valuation/Integers.lean index b4874f4916e096..df4d463e8913ff 100644 --- a/Mathlib/RingTheory/Valuation/Integers.lean +++ b/Mathlib/RingTheory/Valuation/Integers.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.RingTheory.Valuation.Basic /-! # Ring of integers under a given valuation @@ -13,6 +15,8 @@ The elements with valuation less than or equal to 1. TODO: Define characteristic predicate. -/ +@[expose] public section + open Set universe u v w diff --git a/Mathlib/RingTheory/Valuation/Integral.lean b/Mathlib/RingTheory/Valuation/Integral.lean index 3d61bc481d0627..84a5284aba736b 100644 --- a/Mathlib/RingTheory/Valuation/Integral.lean +++ b/Mathlib/RingTheory/Valuation/Integral.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Yakov Pechersky -/ -import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed -import Mathlib.RingTheory.Valuation.ValuationRing +module + +public import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed +public import Mathlib.RingTheory.Valuation.ValuationRing /-! # Integral elements over the ring of integers of a valuation @@ -12,6 +14,8 @@ import Mathlib.RingTheory.Valuation.ValuationRing The ring of integers is integrally closed inside the original ring. -/ +@[expose] public section + universe u v w diff --git a/Mathlib/RingTheory/Valuation/IntegrallyClosed.lean b/Mathlib/RingTheory/Valuation/IntegrallyClosed.lean index e69c6f400786b6..a8ba4e2e4f2e91 100644 --- a/Mathlib/RingTheory/Valuation/IntegrallyClosed.lean +++ b/Mathlib/RingTheory/Valuation/IntegrallyClosed.lean @@ -1,3 +1,5 @@ -import Mathlib.RingTheory.Valuation.Integral +module + +public import Mathlib.RingTheory.Valuation.Integral deprecated_module (since := "2025-09-07") diff --git a/Mathlib/RingTheory/Valuation/LocalSubring.lean b/Mathlib/RingTheory/Valuation/LocalSubring.lean index e5c5b3c554f44c..be22ed8615d044 100644 --- a/Mathlib/RingTheory/Valuation/LocalSubring.lean +++ b/Mathlib/RingTheory/Valuation/LocalSubring.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Andrew Yang, Yaël Dillies, Javier López-Contreras. All righ Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang, Yaël Dillies, Javier López-Contreras -/ -import Mathlib.RingTheory.Ideal.GoingUp -import Mathlib.RingTheory.LocalRing.LocalSubring -import Mathlib.RingTheory.Polynomial.Ideal -import Mathlib.RingTheory.Valuation.ValuationSubring +module + +public import Mathlib.RingTheory.Ideal.GoingUp +public import Mathlib.RingTheory.LocalRing.LocalSubring +public import Mathlib.RingTheory.Polynomial.Ideal +public import Mathlib.RingTheory.Valuation.ValuationSubring /-! @@ -17,6 +19,8 @@ Note that the order on local subrings is not merely inclusion but domination. -/ +@[expose] public section + open IsLocalRing variable {R S K : Type*} [CommRing R] [CommRing S] [Field K] diff --git a/Mathlib/RingTheory/Valuation/Minpoly.lean b/Mathlib/RingTheory/Valuation/Minpoly.lean index 0056c13669d755..99e93f3ce8ffc0 100644 --- a/Mathlib/RingTheory/Valuation/Minpoly.lean +++ b/Mathlib/RingTheory/Valuation/Minpoly.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio -/ -import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic +public import Mathlib.RingTheory.Valuation.Basic /-! # Minimal polynomials. @@ -13,7 +15,8 @@ We prove some results about valuations of zero coefficients of minimal polynomia Let `K` be a field with a valuation `v` and let `L` be a field extension of `K`. -# Main Results +## Main statements + * `coeff_zero_minpoly` : for `x ∈ K` the valuation of the zeroth coefficient of the minimal polynomial of `algebraMap K L x` over `K` is equal to the valuation of `x`. * `pow_coeff_zero_ne_zero_of_unit` : for any unit `x : Lˣ`, we prove that a certain power of the @@ -21,6 +24,8 @@ Let `K` be a field with a valuation `v` and let `L` be a field extension of `K`. is helpful for defining the valuation on `L` inducing `v`. -/ +@[expose] public section + open Module minpoly Polynomial variable {K : Type*} [Field K] {Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] diff --git a/Mathlib/RingTheory/Valuation/PrimeMultiplicity.lean b/Mathlib/RingTheory/Valuation/PrimeMultiplicity.lean index 835372b91040ea..24b07c6462f452 100644 --- a/Mathlib/RingTheory/Valuation/PrimeMultiplicity.lean +++ b/Mathlib/RingTheory/Valuation/PrimeMultiplicity.lean @@ -3,13 +3,17 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Chris Hughes -/ -import Mathlib.RingTheory.Multiplicity -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.RingTheory.Multiplicity +public import Mathlib.RingTheory.Valuation.Basic /-! # `multiplicity` of a prime in an integral domain as an additive valuation -/ +@[expose] public section + variable {R : Type*} [CommRing R] [IsDomain R] {p : R} /-- `multiplicity` of a prime in an integral domain as an additive valuation to `ℕ∞`. -/ diff --git a/Mathlib/RingTheory/Valuation/Quotient.lean b/Mathlib/RingTheory/Valuation/Quotient.lean index 7110a822e7edb1..5c4364f0e8abd4 100644 --- a/Mathlib/RingTheory/Valuation/Quotient.lean +++ b/Mathlib/RingTheory/Valuation/Quotient.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard, Johan Commelin, Patrick Massot -/ -import Mathlib.RingTheory.Ideal.Quotient.Operations -import Mathlib.RingTheory.Valuation.Basic +module + +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.RingTheory.Valuation.Basic /-! # The valuation on a quotient ring @@ -15,6 +17,8 @@ on `R / J` = `Ideal.Quotient J` is `onQuot v h`. -/ +@[expose] public section + namespace Valuation diff --git a/Mathlib/RingTheory/Valuation/RamificationGroup.lean b/Mathlib/RingTheory/Valuation/RamificationGroup.lean index 1e1be09cf8c9a9..526324963c84ef 100644 --- a/Mathlib/RingTheory/Valuation/RamificationGroup.lean +++ b/Mathlib/RingTheory/Valuation/RamificationGroup.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Michail Karatarakis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michail Karatarakis -/ -import Mathlib.RingTheory.LocalRing.ResidueField.Basic -import Mathlib.RingTheory.Valuation.ValuationSubring +module + +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.Valuation.ValuationSubring /-! # Ramification groups @@ -14,6 +16,8 @@ The decomposition subgroup and inertia subgroups. TODO: Define higher ramification groups in lower numbering -/ +@[expose] public section + namespace ValuationSubring diff --git a/Mathlib/RingTheory/Valuation/RankOne.lean b/Mathlib/RingTheory/Valuation/RankOne.lean index 531139bc596089..e8b1493d0ab85c 100644 --- a/Mathlib/RingTheory/Valuation/RankOne.lean +++ b/Mathlib/RingTheory/Valuation/RankOne.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: María Inés de Frutos-Fernández -/ -import Mathlib.Algebra.Order.Group.Units -import Mathlib.Algebra.Order.GroupWithZero.WithZero -import Mathlib.Analysis.SpecialFunctions.Pow.Real -import Mathlib.Data.Real.Embedding -import Mathlib.RingTheory.Valuation.ValuativeRel.Basic +module + +public import Mathlib.Algebra.Order.Group.Units +public import Mathlib.Algebra.Order.GroupWithZero.WithZero +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Data.Real.Embedding +public import Mathlib.RingTheory.Valuation.ValuativeRel.Basic /-! # Rank one valuations @@ -23,6 +25,8 @@ We define rank one valuations. valuation, rank one -/ +@[expose] public section + noncomputable section open Function Multiplicative diff --git a/Mathlib/RingTheory/Valuation/ValExtension.lean b/Mathlib/RingTheory/Valuation/ValExtension.lean index 7c7a8d5756001f..1615346a57eeb2 100644 --- a/Mathlib/RingTheory/Valuation/ValExtension.lean +++ b/Mathlib/RingTheory/Valuation/ValExtension.lean @@ -3,6 +3,8 @@ Copyright (c) 2024 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang, Bichang Lei -/ -import Mathlib.RingTheory.Valuation.Extension +module + +public import Mathlib.RingTheory.Valuation.Extension deprecated_module (since := "2025-05-06") diff --git a/Mathlib/RingTheory/Valuation/ValuationRing.lean b/Mathlib/RingTheory/Valuation/ValuationRing.lean index c20fb4137e0e1b..1bdec0e7552f29 100644 --- a/Mathlib/RingTheory/Valuation/ValuationRing.lean +++ b/Mathlib/RingTheory/Valuation/ValuationRing.lean @@ -3,13 +3,15 @@ Copyright (c) 2022 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Mathlib.RingTheory.Bezout -import Mathlib.RingTheory.LocalRing.Basic -import Mathlib.RingTheory.Localization.FractionRing -import Mathlib.RingTheory.Localization.Integer -import Mathlib.RingTheory.Valuation.Integers -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.FieldSimp +module + +public import Mathlib.RingTheory.Bezout +public import Mathlib.RingTheory.LocalRing.Basic +public import Mathlib.RingTheory.Localization.FractionRing +public import Mathlib.RingTheory.Localization.Integer +public import Mathlib.RingTheory.Valuation.Integers +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.FieldSimp /-! # Valuation Rings @@ -42,6 +44,8 @@ The `ValuationRing` class is kept to be in sync with the literature. -/ +@[expose] public section + assert_not_exists IsDiscreteValuationRing universe u v w @@ -175,7 +179,6 @@ instance commGroupWithZero : simp only [one_smul] apply (mul_inv_cancel₀ _).symm contrapose ha - simp only [Classical.not_not] at ha ⊢ rw [ha] rfl } diff --git a/Mathlib/RingTheory/Valuation/ValuationSubring.lean b/Mathlib/RingTheory/Valuation/ValuationSubring.lean index 008e57a3a75483..95558d3f2400d2 100644 --- a/Mathlib/RingTheory/Valuation/ValuationSubring.lean +++ b/Mathlib/RingTheory/Valuation/ValuationSubring.lean @@ -3,12 +3,14 @@ Copyright (c) 2022 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz, Junyan Xu, Jack McKoen -/ -import Mathlib.RingTheory.Valuation.ValuationRing -import Mathlib.RingTheory.Localization.AsSubring -import Mathlib.Algebra.Algebra.Subalgebra.Tower -import Mathlib.Algebra.Ring.Subring.Pointwise -import Mathlib.Algebra.Ring.Action.Field -import Mathlib.RingTheory.LocalRing.ResidueField.Basic +module + +public import Mathlib.RingTheory.Valuation.ValuationRing +public import Mathlib.RingTheory.Localization.AsSubring +public import Mathlib.Algebra.Algebra.Subalgebra.Tower +public import Mathlib.Algebra.Ring.Subring.Pointwise +public import Mathlib.Algebra.Ring.Action.Field +public import Mathlib.RingTheory.LocalRing.ResidueField.Basic /-! @@ -20,6 +22,8 @@ The order structure on `ValuationSubring K`. -/ +@[expose] public section + universe u @@ -91,7 +95,6 @@ theorem mem_top (x : K) : x ∈ (⊤ : ValuationSubring K) := theorem le_top : A ≤ ⊤ := fun _a _ha => mem_top _ instance : OrderTop (ValuationSubring K) where - top := ⊤ le_top := le_top instance : Inhabited (ValuationSubring K) := diff --git a/Mathlib/RingTheory/Valuation/ValuativeRel.lean b/Mathlib/RingTheory/Valuation/ValuativeRel.lean index 3ac79cb41ecd6b..ab7f1ad8939f2a 100644 --- a/Mathlib/RingTheory/Valuation/ValuativeRel.lean +++ b/Mathlib/RingTheory/Valuation/ValuativeRel.lean @@ -3,6 +3,8 @@ Copyright (c) 2025 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Liu, Adam Topaz -/ -import Mathlib.RingTheory.Valuation.ValuativeRel.Basic +module + +public import Mathlib.RingTheory.Valuation.ValuativeRel.Basic deprecated_module (since := "2025-08-14") diff --git a/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean b/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean index e93254d741b543..4973dadcc34157 100644 --- a/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean +++ b/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Liu, Adam Topaz -/ -import Mathlib.RingTheory.Valuation.Basic -import Mathlib.Data.NNReal.Defs -import Mathlib.Topology.Defs.Filter +module + +public import Mathlib.RingTheory.Valuation.Basic +public import Mathlib.Data.NNReal.Defs +public import Mathlib.Topology.Defs.Filter /-! @@ -58,6 +60,8 @@ Once such a refactor happens, `ValuativeRel` could be renamed to `Valued`. -/ +@[expose] public section + noncomputable section /-- The class `[ValuativeRel R]` class introduces an operator `x ≤ᵥ y : Prop` for `x y : R` @@ -68,17 +72,19 @@ of valuations. -/ @[ext] class ValuativeRel (R : Type*) [CommRing R] where /-- The relation operator arising from `ValuativeRel`. -/ - rel : R → R → Prop - rel_total (x y) : rel x y ∨ rel y x - rel_trans {z y x} : rel x y → rel y z → rel x z - rel_add {x y z} : rel x z → rel y z → rel (x + y) z - rel_mul_right {x y} (z) : rel x y → rel (x * z) (y * z) - rel_mul_cancel {x y z} : ¬ rel z 0 → rel (x * z) (y * z) → rel x y - not_rel_one_zero : ¬ rel 1 0 + Rel : R → R → Prop + rel_total (x y) : Rel x y ∨ Rel y x + rel_trans {z y x} : Rel x y → Rel y z → Rel x z + rel_add {x y z} : Rel x z → Rel y z → Rel (x + y) z + rel_mul_right {x y} (z) : Rel x y → Rel (x * z) (y * z) + rel_mul_cancel {x y z} : ¬ Rel z 0 → Rel (x * z) (y * z) → Rel x y + not_rel_one_zero : ¬ Rel 1 0 -@[inherit_doc] infix:50 " ≤ᵥ " => ValuativeRel.rel +@[inherit_doc] infix:50 " ≤ᵥ " => ValuativeRel.Rel -macro_rules | `($a ≤ᵥ $b) => `(binrel% ValuativeRel.rel $a $b) +macro_rules | `($a ≤ᵥ $b) => `(binrel% ValuativeRel.Rel $a $b) + +attribute [gcongr] ValuativeRel.rel_mul_right namespace Valuation @@ -102,11 +108,11 @@ namespace ValuativeRel variable {R : Type*} [CommRing R] [ValuativeRel R] /-- The strict version of the valuative relation. -/ -def srel (x y : R) : Prop := ¬ y ≤ᵥ x +def SRel (x y : R) : Prop := ¬ y ≤ᵥ x -@[inherit_doc] infix:50 " <ᵥ " => ValuativeRel.srel +@[inherit_doc] infix:50 " <ᵥ " => ValuativeRel.SRel -macro_rules | `($a <ᵥ $b) => `(binrel% ValuativeRel.srel $a $b) +macro_rules | `($a <ᵥ $b) => `(binrel% ValuativeRel.SRel $a $b) lemma srel_iff (x y : R) : x <ᵥ y ↔ ¬ y ≤ᵥ x := Iff.rfl @@ -120,9 +126,9 @@ lemma rel_refl (x : R) : x ≤ᵥ x := by lemma rel_rfl {x : R} : x ≤ᵥ x := rel_refl x -protected alias rel.refl := rel_refl +protected alias Rel.refl := rel_refl -protected alias rel.rfl := rel_rfl +protected alias Rel.rfl := rel_rfl @[simp] theorem zero_rel (x : R) : 0 ≤ᵥ x := by @@ -132,24 +138,28 @@ theorem zero_rel (x : R) : 0 ≤ᵥ x := by lemma zero_srel_one : (0 : R) <ᵥ 1 := not_rel_one_zero -lemma rel_mul_left {x y : R} (z) : x ≤ᵥ y → (z * x) ≤ᵥ (z * y) := by +@[gcongr] +lemma rel_mul_left {x y : R} (z) : x ≤ᵥ y → z * x ≤ᵥ z * y := by rw [mul_comm z x, mul_comm z y] apply rel_mul_right -instance : Trans (rel (R := R)) (rel (R := R)) (rel (R := R)) where +instance : Trans (Rel (R := R)) (Rel (R := R)) (Rel (R := R)) where trans h1 h2 := rel_trans h1 h2 -protected alias rel.trans := rel_trans +protected alias Rel.trans := rel_trans lemma rel_trans' {x y z : R} (h1 : y ≤ᵥ z) (h2 : x ≤ᵥ y) : x ≤ᵥ z := h2.trans h1 protected alias rel.trans' := rel_trans' -lemma rel_mul {x x' y y' : R} (h1 : x ≤ᵥ y) (h2 : x' ≤ᵥ y') : (x * x') ≤ᵥ y * y' := by +@[gcongr] +lemma mul_rel_mul {x x' y y' : R} (h1 : x ≤ᵥ y) (h2 : x' ≤ᵥ y') : x * x' ≤ᵥ y * y' := by calc x * x' ≤ᵥ x * y' := rel_mul_left _ h2 _ ≤ᵥ y * y' := rel_mul_right _ h1 +@[deprecated (since := "2025-11-04")] alias rel_mul := mul_rel_mul + theorem rel_add_cases (x y : R) : x + y ≤ᵥ x ∨ x + y ≤ᵥ y := (rel_total y x).imp (fun h => rel_add .rfl h) (fun h => rel_add h .rfl) @@ -196,14 +206,14 @@ def valueSetoid : Setoid (R × posSubmonoid R) where trans := by rintro ⟨r, u⟩ ⟨s, v⟩ ⟨t, w⟩ ⟨h1, h2⟩ ⟨h3, h4⟩ constructor - · have := rel_mul h1 (rel_refl ↑w) + · have := mul_rel_mul h1 (rel_refl ↑w) rw [mul_right_comm s] at this - have := rel_trans this (rel_mul h3 (rel_refl _)) + have := rel_trans this (mul_rel_mul h3 (rel_refl _)) rw [mul_right_comm r, mul_right_comm t] at this simpa using this - · have := rel_mul h4 (rel_refl ↑u) + · have := mul_rel_mul h4 (rel_refl ↑u) rw [mul_right_comm s] at this - have := rel_trans this (rel_mul h2 (rel_refl _)) + have := rel_trans this (mul_rel_mul h2 (rel_refl _)) rw [mul_right_comm t, mul_right_comm r] at this simpa using this } @@ -316,10 +326,10 @@ instance : Mul (ValueGroupWithZero R) where apply ValueGroupWithZero.sound · rw [Submonoid.coe_mul, Submonoid.coe_mul, mul_mul_mul_comm x, mul_mul_mul_comm y] - exact rel_mul h₁ h₃ + exact mul_rel_mul h₁ h₃ · rw [Submonoid.coe_mul, Submonoid.coe_mul, mul_mul_mul_comm x, mul_mul_mul_comm y] - exact rel_mul h₂ h₄ + exact mul_rel_mul h₂ h₄ @[simp] theorem ValueGroupWithZero.mk_mul_mk (a b : R) (c d : posSubmonoid R) : @@ -395,17 +405,17 @@ instance : LE (ValueGroupWithZero R) where apply rel_mul_cancel hz calc y * u * s * z _ = y * s * (z * u) := by ring - _ ≤ᵥ x * t * (w * v) := rel_mul h₂ h₃ + _ ≤ᵥ x * t * (w * v) := by gcongr _ = x * v * (t * w) := by ring - _ ≤ᵥ z * s * (t * w) := rel_mul_right (t * w) h + _ ≤ᵥ z * s * (t * w) := by gcongr _ = w * t * s * z := by ring · apply rel_mul_cancel t.prop apply rel_mul_cancel hw calc x * v * t * w _ = x * t * (w * v) := by ring - _ ≤ᵥ y * s * (z * u) := rel_mul h₁ h₄ + _ ≤ᵥ y * s * (z * u) := by gcongr _ = y * u * (s * z) := by ring - _ ≤ᵥ w * t * (s * z) := rel_mul_right (s * z) h + _ ≤ᵥ w * t * (s * z) := by gcongr _ = z * s * t * w := by ring @[simp] @@ -538,7 +548,7 @@ def ofValuation {S Γ : Type*} [CommRing S] [LinearOrderedCommGroupWithZero Γ] (v : Valuation S Γ) : ValuativeRel S where - rel x y := v x ≤ v y + Rel x y := v x ≤ v y rel_total x y := le_total (v x) (v y) rel_trans := le_trans rel_add hab hbc := (map_add_le_max v _ _).trans (sup_le hab hbc) @@ -568,26 +578,47 @@ lemma isEquiv {Γ₁ Γ₂ : Type*} intro x y simp_rw [← Valuation.Compatible.rel_iff_le] -lemma _root_.Valuation.Compatible.srel_iff_lt {Γ₀ : Type*} - [LinearOrderedCommMonoidWithZero Γ₀] {v : Valuation R Γ₀} [v.Compatible] {x y : R} : - x <ᵥ y ↔ v x < v y := by - simp [lt_iff_not_ge, ← Valuation.Compatible.rel_iff_le, srel_iff] +end ValuativeRel + +namespace Valuation + +open ValuativeRel + +variable {R : Type*} [CommRing R] [ValuativeRel R] +variable {Γ₀ : Type*} [LinearOrderedCommMonoidWithZero Γ₀] (v : Valuation R Γ₀) [v.Compatible] +variable {x y : R} + +lemma rel_iff_le : x ≤ᵥ y ↔ v x ≤ v y := + Compatible.rel_iff_le _ _ + +lemma srel_iff_lt : x <ᵥ y ↔ v x < v y := by + simp [lt_iff_not_ge, ← Compatible.rel_iff_le, srel_iff] + +@[deprecated (since := "2025-10-09")] +alias Compatible.srel_iff_lt := srel_iff_lt + +lemma rel_one_iff : x ≤ᵥ 1 ↔ v x ≤ 1 := by simp [v.rel_iff_le] +lemma srel_one_iff : x <ᵥ 1 ↔ v x < 1 := by simp [v.srel_iff_lt] +lemma one_rel_iff : 1 ≤ᵥ x ↔ 1 ≤ v x := by simp [v.rel_iff_le] +lemma one_srel_iff : 1 <ᵥ x ↔ 1 < v x := by simp [v.srel_iff_lt] @[simp] -lemma _root_.Valuation.apply_posSubmonoid_ne_zero {Γ : Type*} [LinearOrderedCommMonoidWithZero Γ] - (v : Valuation R Γ) [v.Compatible] (x : posSubmonoid R) : - v (x : R) ≠ 0 := by +lemma apply_posSubmonoid_ne_zero (x : posSubmonoid R) : v (x : R) ≠ 0 := by simp [(isEquiv v (valuation R)).ne_zero, valuation_posSubmonoid_ne_zero] @[deprecated (since := "2025-08-06")] -alias valuation_posSubmonoid_ne_zero_of_compatible := _root_.Valuation.apply_posSubmonoid_ne_zero +alias _root_.ValuativeRel.valuation_posSubmonoid_ne_zero_of_compatible := apply_posSubmonoid_ne_zero @[simp] -lemma _root_.Valuation.apply_posSubmonoid_pos {Γ : Type*} [LinearOrderedCommMonoidWithZero Γ] - (v : Valuation R Γ) [v.Compatible] (x : posSubmonoid R) : - 0 < v x := +lemma apply_posSubmonoid_pos (x : posSubmonoid R) : 0 < v x := zero_lt_iff.mpr <| v.apply_posSubmonoid_ne_zero x +end Valuation + +namespace ValuativeRel + +variable {R : Type*} [CommRing R] [ValuativeRel R] + variable (R) in /-- An alias for endowing a ring with a preorder defined as the valuative relation. -/ def WithPreorder := R @@ -600,11 +631,13 @@ instance : Preorder (WithPreorder R) where le (x y : R) := x ≤ᵥ y le_refl _ := rel_refl _ le_trans _ _ _ := rel_trans + lt (x y : R) := x <ᵥ y + lt_iff_le_not_ge (x y : R) := by have := rel_total x y; aesop /-- The valuative relation on `WithPreorder R` arising from the valuative relation on `R`. This is defined as the preorder itself. -/ instance : ValuativeRel (WithPreorder R) where - rel := (· ≤ ·) + Rel := (· ≤ ·) rel_total := rel_total (R := R) rel_trans := rel_trans (R := R) rel_add := rel_add (R := R) @@ -642,6 +675,114 @@ instance : (supp R).IsPrime := by rw [supp_eq_valuation_supp] infer_instance +section CommRing + +variable {R : Type*} [CommRing R] [ValuativeRel R] {a b c d : R} + +lemma srel_of_srel_of_rel (hab : a <ᵥ b) (hbc : b ≤ᵥ c) : a <ᵥ c := + lt_of_lt_of_le (α := WithPreorder R) hab hbc + +alias SRel.trans_rel := srel_of_srel_of_rel + +lemma srel_of_rel_of_srel (hab : a ≤ᵥ b) (hbc : b <ᵥ c) : a <ᵥ c := + lt_of_le_of_lt (α := WithPreorder R) hab hbc + +alias Rel.trans_srel := srel_of_rel_of_srel + +lemma SRel.rel (hab : a <ᵥ b) : a ≤ᵥ b := + le_of_lt (α := WithPreorder R) hab + +lemma SRel.trans (hab : a <ᵥ b) (hbc : b <ᵥ c) : a <ᵥ c := + hab.trans_rel hbc.rel + +lemma rel_mul_right_iff (hc : 0 <ᵥ c) : a * c ≤ᵥ b * c ↔ a ≤ᵥ b := + ⟨rel_mul_cancel hc, rel_mul_right _⟩ + +lemma rel_mul_left_iff (hc : 0 <ᵥ c) : c * a ≤ᵥ c * b ↔ a ≤ᵥ b := by + simp [mul_comm c, rel_mul_right_iff hc] + +lemma srel_mul_right_iff (hc : 0 <ᵥ c) : a * c <ᵥ b * c ↔ a <ᵥ b := + (rel_mul_right_iff hc).not + +@[gcongr] alias ⟨_, srel_mul_right⟩ := srel_mul_right_iff + +lemma srel_mul_left_iff (hc : 0 <ᵥ c) : c * a <ᵥ c * b ↔ a <ᵥ b := + (rel_mul_left_iff hc).not + +@[gcongr] alias ⟨_, srel_mul_left⟩ := srel_mul_left_iff + +lemma mul_srel_mul_of_srel_of_rel (hab : a <ᵥ b) (hcd : c ≤ᵥ d) (hd : 0 <ᵥ d) : + a * c <ᵥ b * d := + (rel_mul_left _ hcd).trans_srel (srel_mul_right hd hab) + +lemma mul_srel_mul_of_rel_of_srel (hab : a ≤ᵥ b) (hcd : c <ᵥ d) (ha : 0 <ᵥ a) : + a * c <ᵥ b * d := + (srel_mul_left ha hcd).trans_rel (rel_mul_right _ hab) + +lemma mul_srel_mul (hab : a <ᵥ b) (hcd : c <ᵥ d) : a * c <ᵥ b * d := + (rel_mul_left _ hcd.rel).trans_srel (srel_mul_right ((zero_rel c).trans_srel hcd) hab) + +lemma pow_rel_pow (hab : a ≤ᵥ b) (n : ℕ) : a ^ n ≤ᵥ b ^ n := by + induction n with + | zero => simp + | succ _ hn => simp [pow_succ, mul_rel_mul hn hab] + +lemma pow_srel_pow (hab : a <ᵥ b) {n : ℕ} (hn : n ≠ 0) : a ^ n <ᵥ b ^ n := by + obtain (rfl | n) := n + · aesop + clear hn + induction n with + | zero => aesop + | succ _ _ => simp_all [pow_succ, mul_srel_mul] + +lemma pow_rel_pow_of_rel_one (ha : a ≤ᵥ 1) {n m : ℕ} (hnm : n ≤ m) : a ^ m ≤ᵥ a ^ n := by + obtain ⟨m, rfl⟩ := exists_add_of_le hnm + simpa [pow_add] using rel_mul_left (a ^ n) (pow_rel_pow ha m) + +lemma pow_rel_pow_of_one_rel (ha : 1 ≤ᵥ a) {n m : ℕ} (hnm : n ≤ m) : a ^ n ≤ᵥ a ^ m := by + obtain ⟨m, rfl⟩ := exists_add_of_le hnm + simpa [pow_add] using rel_mul_left (a ^ n) (pow_rel_pow ha m) + +end CommRing + +section Field + +variable {K : Type*} [Field K] [ValuativeRel K] {a b c x : K} + +@[simp] +lemma rel_zero_iff : a ≤ᵥ 0 ↔ a = 0 := by + rw [← supp_def, Ideal.eq_bot_of_prime (supp K), Ideal.mem_bot] + +@[simp] +lemma zero_srel_iff : 0 <ᵥ a ↔ a ≠ 0 := by + simp [SRel] + +lemma rel_div_iff (hc : c ≠ 0) : a ≤ᵥ b / c ↔ a * c ≤ᵥ b := by + rw [← rel_mul_right_iff (c := c) (by simpa), div_mul_cancel₀ _ (by aesop)] + +lemma div_rel_iff (hc : c ≠ 0) : a / c ≤ᵥ b ↔ a ≤ᵥ b * c := by + rw [← rel_mul_right_iff (c := c) (by simpa), div_mul_cancel₀ _ (by aesop)] + +lemma one_rel_div_iff (hb : b ≠ 0) : 1 ≤ᵥ a / b ↔ b ≤ᵥ a := by + simp [rel_div_iff hb] + +lemma div_rel_one_iff (hb : b ≠ 0) : a / b ≤ᵥ 1 ↔ a ≤ᵥ b := by + simp [div_rel_iff hb] + +lemma one_rel_inv (hx : x ≠ 0) : 1 ≤ᵥ x⁻¹ ↔ x ≤ᵥ 1 := by + simpa using one_rel_div_iff (a := 1) hx + +lemma inv_rel_one (hx : x ≠ 0) : x⁻¹ ≤ᵥ 1 ↔ 1 ≤ᵥ x := by + simpa using div_rel_one_iff (a := 1) hx + +lemma inv_srel_one (hx : x ≠ 0) : x⁻¹ <ᵥ 1 ↔ 1 <ᵥ x := + (one_rel_inv hx).not + +lemma one_srel_inv (hx : x ≠ 0) : x⁻¹ <ᵥ 1 ↔ 1 <ᵥ x := + (one_rel_inv hx).not + +end Field + open NNReal in variable (R) in /-- An auxiliary structure used to define `IsRankLeOne`. -/ structure RankLeOneStruct where @@ -842,6 +983,14 @@ lemma mapValueGroupWithZero_valuation (a : A) : mapValueGroupWithZero A B (valuation _ a) = valuation _ (algebraMap _ _ a) := by simp [valuation] +lemma mapValueGroupWithZero_strictMono : StrictMono (mapValueGroupWithZero A B) := + ValueGroupWithZero.embed_strictMono _ + +variable (B) in +lemma _root_.ValuativeRel.IsRankLeOne.of_valuativeExtension [IsRankLeOne B] : IsRankLeOne A := by + obtain ⟨⟨f, hf⟩⟩ := IsRankLeOne.nonempty (R := B) + exact ⟨⟨f.comp (mapValueGroupWithZero _ _), hf.comp mapValueGroupWithZero_strictMono⟩⟩ + end ValuativeExtension namespace ValuativeRel diff --git a/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean b/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean index 896a05958ba579..a1562b46e8b0c8 100644 --- a/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean +++ b/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ +module -import Mathlib.RingTheory.Valuation.ValuativeRel.Basic +public import Mathlib.RingTheory.Valuation.ValuativeRel.Basic /-! @@ -20,6 +21,8 @@ A trivial valuative relation is equivalent to the value group being isomorphic t -/ +@[expose] public section + namespace ValuativeRel variable {R Γ : Type} [CommRing R] [DecidableEq R] [IsDomain R] @@ -32,7 +35,7 @@ open WithZero The domain condition is necessary so that the relation is closed when multiplying. -/ def trivialRel : ValuativeRel R where - rel x y := if y = 0 then x = 0 else True + Rel x y := if y = 0 then x = 0 else True rel_total _ _ := by split_ifs <;> simp_all rel_trans _ _ := by split_ifs; simp_all rel_add _ _ := by split_ifs; simp_all diff --git a/Mathlib/RingTheory/WittVector/Basic.lean b/Mathlib/RingTheory/WittVector/Basic.lean index 10039b4ecc3bc9..d427017f9131aa 100644 --- a/Mathlib/RingTheory/WittVector/Basic.lean +++ b/Mathlib/RingTheory/WittVector/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.MvPolynomial.Counit -import Mathlib.Algebra.MvPolynomial.Invertible -import Mathlib.RingTheory.WittVector.Defs +module + +public import Mathlib.Algebra.MvPolynomial.Counit +public import Mathlib.Algebra.MvPolynomial.Invertible +public import Mathlib.RingTheory.WittVector.Defs /-! # Witt vectors @@ -44,6 +46,8 @@ in this file. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/Compare.lean b/Mathlib/RingTheory/WittVector/Compare.lean index c99776913713c3..05104abe353024 100644 --- a/Mathlib/RingTheory/WittVector/Compare.lean +++ b/Mathlib/RingTheory/WittVector/Compare.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.RingTheory.WittVector.Truncated -import Mathlib.RingTheory.WittVector.Identities -import Mathlib.NumberTheory.Padics.RingHoms +module + +public import Mathlib.RingTheory.WittVector.Truncated +public import Mathlib.RingTheory.WittVector.Identities +public import Mathlib.NumberTheory.Padics.RingHoms /-! @@ -27,6 +29,8 @@ of the inverse limit of `ZMod (p^n)`. * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/Complete.lean b/Mathlib/RingTheory/WittVector/Complete.lean index d16e4a2b221ba7..79e991e4a3f712 100644 --- a/Mathlib/RingTheory/WittVector/Complete.lean +++ b/Mathlib/RingTheory/WittVector/Complete.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang -/ -import Mathlib.RingTheory.WittVector.Domain -import Mathlib.RingTheory.WittVector.Truncated -import Mathlib.RingTheory.AdicCompletion.Basic +module + +public import Mathlib.RingTheory.WittVector.Domain +public import Mathlib.RingTheory.WittVector.Truncated +public import Mathlib.RingTheory.AdicCompletion.Basic /-! # The ring of Witt vectors is p-torsion free and p-adically complete @@ -24,6 +26,8 @@ when `k` is a perfect ring of characteristic `p`. Define the map `𝕎 k / p ≃+* k`. -/ +@[expose] public section + namespace WittVector variable {p : ℕ} [hp : Fact (Nat.Prime p)] {k : Type*} [CommRing k] diff --git a/Mathlib/RingTheory/WittVector/Defs.lean b/Mathlib/RingTheory/WittVector/Defs.lean index b185ee61d434a8..8a475614bf098f 100644 --- a/Mathlib/RingTheory/WittVector/Defs.lean +++ b/Mathlib/RingTheory/WittVector/Defs.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.RingTheory.WittVector.StructurePolynomial +module + +public import Mathlib.RingTheory.WittVector.StructurePolynomial /-! # Witt vectors @@ -35,6 +37,8 @@ We use notation `𝕎 R`, entered `\bbW`, for the Witt vectors over `R`. * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/DiscreteValuationRing.lean b/Mathlib/RingTheory/WittVector/DiscreteValuationRing.lean index 6e03e278cd77dd..950d98a39f6ae8 100644 --- a/Mathlib/RingTheory/WittVector/DiscreteValuationRing.lean +++ b/Mathlib/RingTheory/WittVector/DiscreteValuationRing.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Heather Macbeth, Johan Commelin -/ -import Mathlib.RingTheory.WittVector.Domain -import Mathlib.RingTheory.WittVector.MulCoeff -import Mathlib.RingTheory.DiscreteValuationRing.Basic -import Mathlib.Tactic.LinearCombination +module + +public import Mathlib.RingTheory.WittVector.Domain +public import Mathlib.RingTheory.WittVector.MulCoeff +public import Mathlib.RingTheory.DiscreteValuationRing.Basic +public import Mathlib.Tactic.LinearCombination /-! @@ -25,6 +27,8 @@ When `k` is also a field, this `b` can be chosen to be a unit of `𝕎 k`. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/Domain.lean b/Mathlib/RingTheory/WittVector/Domain.lean index ce2d17555dd2c6..8b2095f0f1923d 100644 --- a/Mathlib/RingTheory/WittVector/Domain.lean +++ b/Mathlib/RingTheory/WittVector/Domain.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.RingTheory.WittVector.Identities +module + +public import Mathlib.RingTheory.WittVector.Identities /-! @@ -31,6 +33,8 @@ the 0th component of which must be nonzero. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/Frobenius.lean b/Mathlib/RingTheory/WittVector/Frobenius.lean index eaedd5a4cfcfbb..6f02615027d3d1 100644 --- a/Mathlib/RingTheory/WittVector/Frobenius.lean +++ b/Mathlib/RingTheory/WittVector/Frobenius.lean @@ -3,11 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.Algebra.Algebra.ZMod -import Mathlib.Data.Nat.Multiplicity -import Mathlib.FieldTheory.Perfect -import Mathlib.RingTheory.WittVector.Basic -import Mathlib.RingTheory.WittVector.IsPoly +module + +public import Mathlib.Algebra.Algebra.ZMod +public import Mathlib.Data.Nat.Multiplicity +public import Mathlib.FieldTheory.Perfect +public import Mathlib.RingTheory.WittVector.Basic +public import Mathlib.RingTheory.WittVector.IsPoly /-! ## The Frobenius operator @@ -45,6 +47,8 @@ and bundle it into `WittVector.frobenius`. * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + namespace WittVector diff --git a/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean b/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean index f5c114af87e670..587d947bab4a39 100644 --- a/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean +++ b/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Heather Macbeth -/ -import Mathlib.Data.Nat.Cast.WithTop -import Mathlib.FieldTheory.IsAlgClosed.Basic -import Mathlib.RingTheory.WittVector.DiscreteValuationRing +module + +public import Mathlib.Data.Nat.Cast.WithTop +public import Mathlib.FieldTheory.IsAlgClosed.Basic +public import Mathlib.RingTheory.WittVector.DiscreteValuationRing /-! # Solving equations about the Frobenius map on the field of fractions of `𝕎 k` @@ -35,6 +37,8 @@ The result is a dependency for the proof of `WittVector.isocrystal_classificatio the classification of one-dimensional isocrystals over an algebraically closed field. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/Identities.lean b/Mathlib/RingTheory/WittVector/Identities.lean index f9f2bf7378b469..fead83e4032c3c 100644 --- a/Mathlib/RingTheory/WittVector/Identities.lean +++ b/Mathlib/RingTheory/WittVector/Identities.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.WittVector.Frobenius -import Mathlib.RingTheory.WittVector.Verschiebung -import Mathlib.RingTheory.WittVector.MulP +module + +public import Mathlib.RingTheory.WittVector.Frobenius +public import Mathlib.RingTheory.WittVector.Verschiebung +public import Mathlib.RingTheory.WittVector.MulP /-! ## Identities between operations on the ring of Witt vectors @@ -25,6 +27,8 @@ In this file we derive common identities between the Frobenius and Verschiebung * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + namespace WittVector diff --git a/Mathlib/RingTheory/WittVector/InitTail.lean b/Mathlib/RingTheory/WittVector/InitTail.lean index f53ca4bc3ddb67..5bebe4948273c6 100644 --- a/Mathlib/RingTheory/WittVector/InitTail.lean +++ b/Mathlib/RingTheory/WittVector/InitTail.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin, Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.RingTheory.WittVector.Basic -import Mathlib.RingTheory.WittVector.IsPoly +module + +public import Mathlib.RingTheory.WittVector.Basic +public import Mathlib.RingTheory.WittVector.IsPoly /-! @@ -33,6 +35,8 @@ and shows how that polynomial interacts with `MvPolynomial.bind₁`. -/ +@[expose] public section + variable {p : ℕ} (n : ℕ) {R : Type*} [CommRing R] diff --git a/Mathlib/RingTheory/WittVector/IsPoly.lean b/Mathlib/RingTheory/WittVector/IsPoly.lean index b5aadc246594d4..7ece8ed820402f 100644 --- a/Mathlib/RingTheory/WittVector/IsPoly.lean +++ b/Mathlib/RingTheory/WittVector/IsPoly.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.MvPolynomial.Funext -import Mathlib.Algebra.Ring.ULift -import Mathlib.RingTheory.WittVector.Basic +module + +public import Mathlib.Algebra.MvPolynomial.Funext +public import Mathlib.Algebra.Ring.ULift +public import Mathlib.RingTheory.WittVector.Basic /-! # The `IsPoly` predicate @@ -88,6 +90,8 @@ Proofs of identities between polynomial functions will often follow the pattern * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + namespace WittVector universe u @@ -408,7 +412,7 @@ so it is easier (and prettier) to put it in a tactic script. -/ syntax (name := ghostCalc) "ghost_calc" (ppSpace colGt term:max)* : tactic -private def runIntro (ref : Syntax) (n : Name) : TacticM FVarId := do +private meta def runIntro (ref : Syntax) (n : Name) : TacticM FVarId := do let fvarId ← liftMetaTacticAux fun g => do let (fv, g') ← g.intro n return (fv, [g']) @@ -416,7 +420,7 @@ private def runIntro (ref : Syntax) (n : Name) : TacticM FVarId := do Elab.Term.addLocalVarInfo ref (mkFVar fvarId) return fvarId -private def getLocalOrIntro (t : Term) : TacticM FVarId := do +private meta def getLocalOrIntro (t : Term) : TacticM FVarId := do match t with | `(_) => runIntro t `_ | `($id:ident) => getFVarId id <|> runIntro id id.getId diff --git a/Mathlib/RingTheory/WittVector/Isocrystal.lean b/Mathlib/RingTheory/WittVector/Isocrystal.lean index c5841d2c7fe6c7..dbc4a3196aa536 100644 --- a/Mathlib/RingTheory/WittVector/Isocrystal.lean +++ b/Mathlib/RingTheory/WittVector/Isocrystal.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.RingTheory.WittVector.FrobeniusFractionField +module + +public import Mathlib.RingTheory.WittVector.FrobeniusFractionField /-! @@ -50,6 +52,8 @@ This file introduces notation in the scope `Isocrystal`. -/ +@[expose] public section + noncomputable section open Module diff --git a/Mathlib/RingTheory/WittVector/MulCoeff.lean b/Mathlib/RingTheory/WittVector/MulCoeff.lean index 585193e575189a..c9e68a8b840b1d 100644 --- a/Mathlib/RingTheory/WittVector/MulCoeff.lean +++ b/Mathlib/RingTheory/WittVector/MulCoeff.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Heather Macbeth -/ -import Mathlib.Algebra.MvPolynomial.Supported -import Mathlib.RingTheory.WittVector.Truncated +module + +public import Mathlib.Algebra.MvPolynomial.Supported +public import Mathlib.RingTheory.WittVector.Truncated /-! # Leading terms of Witt vector multiplication @@ -25,6 +27,8 @@ that needs to happen in characteristic 0. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/RingTheory/WittVector/MulP.lean b/Mathlib/RingTheory/WittVector/MulP.lean index 478eabf80b10f0..8f60f4eaeb1a14 100644 --- a/Mathlib/RingTheory/WittVector/MulP.lean +++ b/Mathlib/RingTheory/WittVector/MulP.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.WittVector.IsPoly +module + +public import Mathlib.RingTheory.WittVector.IsPoly /-! ## Multiplication by `n` in the ring of Witt vectors @@ -23,6 +25,8 @@ and Verschiebung is equal to multiplication by `p`. * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + namespace WittVector diff --git a/Mathlib/RingTheory/WittVector/StructurePolynomial.lean b/Mathlib/RingTheory/WittVector/StructurePolynomial.lean index cd1204c44b6f56..e39a81568b3040 100644 --- a/Mathlib/RingTheory/WittVector/StructurePolynomial.lean +++ b/Mathlib/RingTheory/WittVector/StructurePolynomial.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.FieldTheory.Finite.Polynomial -import Mathlib.NumberTheory.Basic -import Mathlib.RingTheory.WittVector.WittPolynomial +module + +public import Mathlib.FieldTheory.Finite.Polynomial +public import Mathlib.NumberTheory.Basic +public import Mathlib.RingTheory.WittVector.WittPolynomial /-! # Witt structure polynomials @@ -83,6 +85,8 @@ dvd_sub_pow_of_dvd_sub {R : Type*} [CommRing R] {p : ℕ} {a b : R} : * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + open MvPolynomial Set diff --git a/Mathlib/RingTheory/WittVector/Teichmuller.lean b/Mathlib/RingTheory/WittVector/Teichmuller.lean index d90c9006aefbaf..580588e88e33f0 100644 --- a/Mathlib/RingTheory/WittVector/Teichmuller.lean +++ b/Mathlib/RingTheory/WittVector/Teichmuller.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.WittVector.Basic +module + +public import Mathlib.RingTheory.WittVector.Basic /-! # Teichmüller lifts @@ -25,6 +27,8 @@ This file defines `WittVector.teichmuller`, a monoid hom `R →* 𝕎 R`, which * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + namespace WittVector diff --git a/Mathlib/RingTheory/WittVector/TeichmullerSeries.lean b/Mathlib/RingTheory/WittVector/TeichmullerSeries.lean index 2ccebe06f7dc76..c2384c6b50755e 100644 --- a/Mathlib/RingTheory/WittVector/TeichmullerSeries.lean +++ b/Mathlib/RingTheory/WittVector/TeichmullerSeries.lean @@ -3,9 +3,10 @@ Copyright (c) 2025 Jiedong Jiang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jiedong Jiang -/ +module -import Mathlib.RingTheory.WittVector.Complete -import Mathlib.RingTheory.WittVector.Teichmuller +public import Mathlib.RingTheory.WittVector.Complete +public import Mathlib.RingTheory.WittVector.Teichmuller /-! # Teichmuller Series @@ -28,6 +29,8 @@ then they are equal. Show that the Teichmuller series is unique. -/ +@[expose] public section + open Ideal Quotient namespace WittVector diff --git a/Mathlib/RingTheory/WittVector/Truncated.lean b/Mathlib/RingTheory/WittVector/Truncated.lean index 6ac8d178932a34..bd6d8b6cdfb91c 100644 --- a/Mathlib/RingTheory/WittVector/Truncated.lean +++ b/Mathlib/RingTheory/WittVector/Truncated.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.RingTheory.WittVector.InitTail +module + +public import Mathlib.RingTheory.WittVector.InitTail /-! @@ -34,6 +36,8 @@ The ring of Witt vectors is the projective limit of all the rings of truncated W * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + open Function (Injective Surjective) diff --git a/Mathlib/RingTheory/WittVector/Verschiebung.lean b/Mathlib/RingTheory/WittVector/Verschiebung.lean index 77f0738a28b7c4..7cd46cd4950ffc 100644 --- a/Mathlib/RingTheory/WittVector/Verschiebung.lean +++ b/Mathlib/RingTheory/WittVector/Verschiebung.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ -import Mathlib.RingTheory.WittVector.Basic -import Mathlib.RingTheory.WittVector.IsPoly +module + +public import Mathlib.RingTheory.WittVector.Basic +public import Mathlib.RingTheory.WittVector.IsPoly /-! ## The Verschiebung operator @@ -16,6 +18,8 @@ import Mathlib.RingTheory.WittVector.IsPoly * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + namespace WittVector diff --git a/Mathlib/RingTheory/WittVector/WittPolynomial.lean b/Mathlib/RingTheory/WittVector/WittPolynomial.lean index 51799840807e42..689bf498630fa1 100644 --- a/Mathlib/RingTheory/WittVector/WittPolynomial.lean +++ b/Mathlib/RingTheory/WittVector/WittPolynomial.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Robert Y. Lewis -/ -import Mathlib.Algebra.CharP.Invertible -import Mathlib.Algebra.MvPolynomial.Variables -import Mathlib.Algebra.MvPolynomial.CommRing -import Mathlib.Algebra.MvPolynomial.Expand -import Mathlib.Algebra.Order.Ring.Rat -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.ZMod.Basic +module + +public import Mathlib.Algebra.CharP.Invertible +public import Mathlib.Algebra.MvPolynomial.Variables +public import Mathlib.Algebra.MvPolynomial.CommRing +public import Mathlib.Algebra.MvPolynomial.Expand +public import Mathlib.Algebra.Order.Ring.Rat +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.ZMod.Basic /-! # Witt polynomials @@ -56,6 +58,8 @@ In this file we use the following notation * [Commelin and Lewis, *Formalizing the Ring of Witt Vectors*][CL21] -/ +@[expose] public section + open MvPolynomial diff --git a/Mathlib/RingTheory/ZMod.lean b/Mathlib/RingTheory/ZMod.lean index 05fe8d62529611..53dd6f85d6aec0 100644 --- a/Mathlib/RingTheory/ZMod.lean +++ b/Mathlib/RingTheory/ZMod.lean @@ -3,11 +3,13 @@ Copyright (c) 2022 Alex J. Best. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex J. Best -/ -import Mathlib.Algebra.Squarefree.Basic -import Mathlib.Algebra.EuclideanDomain.Int -import Mathlib.Data.ZMod.Basic -import Mathlib.RingTheory.Nilpotent.Lemmas -import Mathlib.RingTheory.PrincipalIdealDomain +module + +public import Mathlib.Algebra.Squarefree.Basic +public import Mathlib.Algebra.EuclideanDomain.Int +public import Mathlib.Data.ZMod.Basic +public import Mathlib.RingTheory.Nilpotent.Lemmas +public import Mathlib.RingTheory.PrincipalIdealDomain /-! # Ring-theoretic facts about `ZMod n` @@ -21,6 +23,8 @@ We collect a few facts about `ZMod n` that need some ring theory to be proved/st * `isReduced_zmod`: `ZMod n` is reduced for all squarefree `n`. -/ +@[expose] public section + /-- The ring homomorphism `ℤ → ZMod n` has kernel generated by `n`. -/ theorem ZMod.ker_intCastRingHom (n : ℕ) : RingHom.ker (Int.castRingHom (ZMod n)) = Ideal.span ({(n : ℤ)} : Set ℤ) := by diff --git a/Mathlib/RingTheory/ZMod/Torsion.lean b/Mathlib/RingTheory/ZMod/Torsion.lean index c8973be5dd9df8..55bfd47c8f3df3 100644 --- a/Mathlib/RingTheory/ZMod/Torsion.lean +++ b/Mathlib/RingTheory/ZMod/Torsion.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Yakov Pechersky. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yakov Pechersky -/ -import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity +public import Mathlib.FieldTheory.Finite.Basic /-! # Torsion group of `ZMod p` for prime `p` @@ -13,6 +15,8 @@ This file shows that the `ZMod p` has `p - 1` roots-of-unity. -/ +@[expose] public section + namespace ZMod lemma rootsOfUnity_eq_top {p : ℕ} [Fact p.Prime] : diff --git a/Mathlib/RingTheory/ZMod/UnitsCyclic.lean b/Mathlib/RingTheory/ZMod/UnitsCyclic.lean index 29360cb0e6f8c2..8df89fbde1a402 100644 --- a/Mathlib/RingTheory/ZMod/UnitsCyclic.lean +++ b/Mathlib/RingTheory/ZMod/UnitsCyclic.lean @@ -3,11 +3,13 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, Junyan Xu -/ -import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Analysis.Normed.Ring.Lemmas -import Mathlib.Data.Nat.Choose.Dvd -import Mathlib.Data.ZMod.Units -import Mathlib.FieldTheory.Finite.Basic +module + +public import Mathlib.Algebra.Order.Star.Basic +public import Mathlib.Analysis.Normed.Ring.Lemmas +public import Mathlib.Data.Nat.Choose.Dvd +public import Mathlib.Data.ZMod.Units +public import Mathlib.FieldTheory.Finite.Basic /-! # Cyclicity of the units of `ZMod n` @@ -47,6 +49,8 @@ The proofs mostly follow [Ireland and Rosen, -/ +@[expose] public section + open scoped Nat namespace ZMod diff --git a/Mathlib/SetTheory/Cardinal/Aleph.lean b/Mathlib/SetTheory/Cardinal/Aleph.lean index 1453b167b5db3a..5b8c4fd6c0282d 100644 --- a/Mathlib/SetTheory/Cardinal/Aleph.lean +++ b/Mathlib/SetTheory/Cardinal/Aleph.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Cardinal.ToNat -import Mathlib.SetTheory.Cardinal.ENat -import Mathlib.SetTheory.Ordinal.Enum +module + +public import Mathlib.SetTheory.Cardinal.ToNat +public import Mathlib.SetTheory.Cardinal.ENat +public import Mathlib.SetTheory.Ordinal.Enum /-! # Omega, aleph, and beth functions @@ -37,6 +39,8 @@ The following notations are scoped to the `Cardinal` namespace. `Mathlib/SetTheory/Cardinal/Continuum.lean`. -/ +@[expose] public section + assert_not_exists Field Finsupp Module Cardinal.mul_eq_self noncomputable section diff --git a/Mathlib/SetTheory/Cardinal/Arithmetic.lean b/Mathlib/SetTheory/Cardinal/Arithmetic.lean index 59ddf70210a283..57bc5cb223befc 100644 --- a/Mathlib/SetTheory/Cardinal/Arithmetic.lean +++ b/Mathlib/SetTheory/Cardinal/Arithmetic.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Floris van Doorn -/ -import Mathlib.SetTheory.Cardinal.Aleph +module + +public import Mathlib.SetTheory.Cardinal.Aleph /-! # Cardinal arithmetic @@ -23,6 +25,8 @@ ordinal numbers. This is done within this file. cardinal arithmetic (for infinite cardinals) -/ +@[expose] public section + assert_not_exists Module Finsupp Ordinal.log noncomputable section @@ -590,10 +594,9 @@ variable [Infinite α] {α β'} theorem mk_perm_eq_self_power : #(Equiv.Perm α) = #α ^ #α := ((mk_equiv_le_embedding α α).trans (mk_embedding_le_arrow α α)).antisymm <| by suffices Nonempty ((α → Bool) ↪ Equiv.Perm (α × Bool)) by - obtain ⟨e⟩ : Nonempty (α ≃ α × Bool) := by - erw [← Cardinal.eq, mk_prod, lift_uzero, mk_bool, - lift_natCast, mul_two, add_eq_self (aleph0_le_mk α)] - erw [← le_def, mk_arrow, lift_uzero, mk_bool, lift_natCast 2] at this + obtain ⟨e⟩ : Nonempty (α ≃ α × Bool) := by simp [← Cardinal.eq, mul_two] + simp only [← le_def, mk_pi, mk_fintype, Fintype.card_bool, Nat.cast_ofNat, + prod_const, lift_ofNat, lift_uzero] at this rwa [← power_def, power_self_eq (aleph0_le_mk α), e.permCongr.cardinal_eq] refine ⟨⟨fun f ↦ Involutive.toPerm (fun x ↦ ⟨x.1, xor (f x.1) x.2⟩) fun x ↦ ?_, fun f g h ↦ ?_⟩⟩ · simp_rw [← Bool.xor_assoc, Bool.xor_self, Bool.false_xor] diff --git a/Mathlib/SetTheory/Cardinal/Basic.lean b/Mathlib/SetTheory/Cardinal/Basic.lean index bea0590eb5c94f..9d7cc73024824d 100644 --- a/Mathlib/SetTheory/Cardinal/Basic.lean +++ b/Mathlib/SetTheory/Cardinal/Basic.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Data.Countable.Small -import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Fintype.Powerset -import Mathlib.Data.Nat.Cast.Order.Basic -import Mathlib.Data.Set.Countable -import Mathlib.Logic.Small.Set -import Mathlib.Logic.UnivLE -import Mathlib.SetTheory.Cardinal.Order +module + +public import Mathlib.Data.Countable.Small +public import Mathlib.Data.Fintype.BigOperators +public import Mathlib.Data.Fintype.Powerset +public import Mathlib.Data.Nat.Cast.Order.Basic +public import Mathlib.Data.Set.Countable +public import Mathlib.Logic.Small.Set +public import Mathlib.Logic.UnivLE +public import Mathlib.SetTheory.Cardinal.Order /-! # Basic results on cardinal numbers @@ -32,6 +34,8 @@ cardinal number, cardinal arithmetic, cardinal exponentiation, aleph, Cantor's theorem, König's theorem, Konig's theorem -/ +@[expose] public section + assert_not_exists Field open List (Vector) diff --git a/Mathlib/SetTheory/Cardinal/Cofinality.lean b/Mathlib/SetTheory/Cardinal/Cofinality.lean index f4d9776ee7d63c..86a86508acba76 100644 --- a/Mathlib/SetTheory/Cardinal/Cofinality.lean +++ b/Mathlib/SetTheory/Cardinal/Cofinality.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.SetTheory.Ordinal.FixedPoint +module + +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.SetTheory.Ordinal.FixedPoint /-! # Cofinality @@ -28,6 +30,8 @@ This file contains the definition of cofinality of an order and an ordinal numbe If `c` is a cardinal number, its cofinality is `c.ord.cof`. -/ +@[expose] public section + noncomputable section open Function Cardinal Set Order diff --git a/Mathlib/SetTheory/Cardinal/Continuum.lean b/Mathlib/SetTheory/Cardinal/Continuum.lean index 82e98ce2089bee..48469e5cf7bd6a 100644 --- a/Mathlib/SetTheory/Cardinal/Continuum.lean +++ b/Mathlib/SetTheory/Cardinal/Continuum.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.SetTheory.Cardinal.Arithmetic +module + +public import Mathlib.SetTheory.Cardinal.Arithmetic /-! # Cardinality of continuum @@ -16,6 +18,8 @@ We also prove some `simp` lemmas about cardinal arithmetic involving `𝔠`. - `𝔠` : notation for `Cardinal.continuum` in scope `Cardinal`. -/ +@[expose] public section + namespace Cardinal diff --git a/Mathlib/SetTheory/Cardinal/CountableCover.lean b/Mathlib/SetTheory/Cardinal/CountableCover.lean index 750e83b0f60a29..0c74209ca22c21 100644 --- a/Mathlib/SetTheory/Cardinal/CountableCover.lean +++ b/Mathlib/SetTheory/Cardinal/CountableCover.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.Order.Filter.Finite -import Mathlib.Order.Filter.Map +module + +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.Order.Filter.Finite +public import Mathlib.Order.Filter.Map /-! # Cardinality of a set with a countable cover @@ -17,6 +19,8 @@ cardinality `≤ a`. Then `t` itself has cardinality at most `a`. This is proved Versions are also given when `t = univ`, and with `= a` instead of `≤ a`. -/ +@[expose] public section + open Set Order Filter open scoped Cardinal diff --git a/Mathlib/SetTheory/Cardinal/Defs.lean b/Mathlib/SetTheory/Cardinal/Defs.lean index 1eec7c1abf1d07..d192b5ad747c23 100644 --- a/Mathlib/SetTheory/Cardinal/Defs.lean +++ b/Mathlib/SetTheory/Cardinal/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Data.ULift -import Mathlib.Util.Delaborators -import Mathlib.Util.AssertExists +module + +public import Mathlib.Data.ULift +public import Mathlib.Util.Delaborators +public import Mathlib.Util.AssertExists /-! # Cardinal Numbers @@ -47,6 +49,8 @@ cardinal number, cardinal arithmetic, cardinal exponentiation, aleph, Cantor's theorem, König's theorem, Konig's theorem -/ +@[expose] public section + assert_not_exists Monoid open List Function Set diff --git a/Mathlib/SetTheory/Cardinal/Divisibility.lean b/Mathlib/SetTheory/Cardinal/Divisibility.lean index d8f6542b050db6..993fb2a850a11d 100644 --- a/Mathlib/SetTheory/Cardinal/Divisibility.lean +++ b/Mathlib/SetTheory/Cardinal/Divisibility.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Rodriguez -/ -import Mathlib.Algebra.IsPrimePow -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.Tactic.WLOG +module + +public import Mathlib.Algebra.IsPrimePow +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.Tactic.WLOG /-! # Cardinal Divisibility @@ -28,6 +30,8 @@ Note furthermore that no infinite cardinal is irreducible -/ +@[expose] public section + namespace Cardinal diff --git a/Mathlib/SetTheory/Cardinal/ENat.lean b/Mathlib/SetTheory/Cardinal/ENat.lean index 3ce4a1bf422263..829365531b0d0f 100644 --- a/Mathlib/SetTheory/Cardinal/ENat.lean +++ b/Mathlib/SetTheory/Cardinal/ENat.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Algebra.Order.Hom.Ring -import Mathlib.Data.ENat.Basic -import Mathlib.SetTheory.Cardinal.Basic +module + +public import Mathlib.Algebra.Order.Hom.Ring +public import Mathlib.Data.ENat.Basic +public import Mathlib.SetTheory.Cardinal.Basic /-! # Conversion between `Cardinal` and `ℕ∞` @@ -28,6 +30,8 @@ Since it is not registered as a coercion, the argument about delaboration does n set theory, cardinals, extended natural numbers -/ +@[expose] public section + assert_not_exists Field open Function Set diff --git a/Mathlib/SetTheory/Cardinal/Embedding.lean b/Mathlib/SetTheory/Cardinal/Embedding.lean index 0727b0cc44a030..255f6427422b9a 100644 --- a/Mathlib/SetTheory/Cardinal/Embedding.lean +++ b/Mathlib/SetTheory/Cardinal/Embedding.lean @@ -3,11 +3,12 @@ Copyright (c) 2025 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ +module -import Mathlib.Data.ENat.Lattice -import Mathlib.Data.Fin.Tuple.Embedding -import Mathlib.Data.Finite.Card -import Mathlib.Data.Set.Card +public import Mathlib.Data.ENat.Lattice +public import Mathlib.Data.Fin.Tuple.Embedding +public import Mathlib.Data.Finite.Card +public import Mathlib.Data.Set.Card /-! # Existence of embeddings from finite types @@ -32,6 +33,8 @@ Let `s : Set α` be a finite set. map from `Fin (m + n) ↪ α` to `Fin m ↪ α` is surjective. -/ +@[expose] public section + open Set Fin Function Function.Embedding namespace Fin.Embedding diff --git a/Mathlib/SetTheory/Cardinal/Finite.lean b/Mathlib/SetTheory/Cardinal/Finite.lean index 1bc50e3df12f99..c7cb51e56a589a 100644 --- a/Mathlib/SetTheory/Cardinal/Finite.lean +++ b/Mathlib/SetTheory/Cardinal/Finite.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.Data.ENat.Pow -import Mathlib.Data.ULift -import Mathlib.Data.ZMod.Defs -import Mathlib.SetTheory.Cardinal.ToNat -import Mathlib.SetTheory.Cardinal.ENat +module + +public import Mathlib.Data.ENat.Pow +public import Mathlib.Data.ULift +public import Mathlib.Data.ZMod.Defs +public import Mathlib.SetTheory.Cardinal.ToNat +public import Mathlib.SetTheory.Cardinal.ENat /-! # Finite Cardinality Functions @@ -20,6 +22,8 @@ import Mathlib.SetTheory.Cardinal.ENat If `α` is infinite, `ENat.card α = ⊤`. -/ +@[expose] public section + assert_not_exists Field open Cardinal Function diff --git a/Mathlib/SetTheory/Cardinal/Finsupp.lean b/Mathlib/SetTheory/Cardinal/Finsupp.lean index 58272d0bd6da62..c8d9f1f62cd489 100644 --- a/Mathlib/SetTheory/Cardinal/Finsupp.lean +++ b/Mathlib/SetTheory/Cardinal/Finsupp.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios, Junyan Xu -/ -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.Data.Finsupp.Basic -import Mathlib.Data.Finsupp.Multiset +module + +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.Data.Finsupp.Basic +public import Mathlib.Data.Finsupp.Multiset /-! # Results on the cardinality of finitely supported functions and multisets. -/ +@[expose] public section + universe u v namespace Cardinal diff --git a/Mathlib/SetTheory/Cardinal/Free.lean b/Mathlib/SetTheory/Cardinal/Free.lean index efc12ebda4791b..5f796c07235a48 100644 --- a/Mathlib/SetTheory/Cardinal/Free.lean +++ b/Mathlib/SetTheory/Cardinal/Free.lean @@ -3,14 +3,16 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Daniel Weber -/ -import Mathlib.Algebra.FreeAbelianGroup.Finsupp -import Mathlib.Algebra.Ring.TransferInstance -import Mathlib.Data.Finsupp.Fintype -import Mathlib.Data.ZMod.Defs -import Mathlib.GroupTheory.FreeGroup.Reduce -import Mathlib.RingTheory.FreeCommRing -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.SetTheory.Cardinal.Finsupp +module + +public import Mathlib.Algebra.FreeAbelianGroup.Finsupp +public import Mathlib.Algebra.Ring.TransferInstance +public import Mathlib.Data.Finsupp.Fintype +public import Mathlib.Data.ZMod.Defs +public import Mathlib.GroupTheory.FreeGroup.Reduce +public import Mathlib.RingTheory.FreeCommRing +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.SetTheory.Cardinal.Finsupp /-! # Cardinalities of free constructions @@ -22,6 +24,8 @@ Combined with the ring `Fin n` for the finite cases, this lets us show that ther any cardinality. -/ +@[expose] public section + universe u variable (α : Type u) diff --git a/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean b/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean index 2477ab3fbcc6bf..fa3b18f0a9a420 100644 --- a/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean +++ b/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ -import Mathlib.SetTheory.Cardinal.Regular +module + +public import Mathlib.SetTheory.Cardinal.Regular /-! # The property of being of cardinality less than a cardinal @@ -14,6 +16,8 @@ Given `X : Type u` and `κ : Cardinal.{v}`, we introduce a predicate -/ +@[expose] public section + universe w v u u' /-- The property that the cardinal of a type `X : Type u` is less than `κ : Cardinal.{v}`. -/ diff --git a/Mathlib/SetTheory/Cardinal/NatCount.lean b/Mathlib/SetTheory/Cardinal/NatCount.lean index d6291e34f8d22c..941e1a3edf3dec 100644 --- a/Mathlib/SetTheory/Cardinal/NatCount.lean +++ b/Mathlib/SetTheory/Cardinal/NatCount.lean @@ -3,9 +3,10 @@ Copyright (c) 2021 Vladimir Goryachev. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vladimir Goryachev -/ +module -import Mathlib.Data.Nat.Count -import Mathlib.Data.Set.Card +public import Mathlib.Data.Nat.Count +public import Mathlib.Data.Set.Card /-! # Counting on ℕ @@ -13,6 +14,8 @@ import Mathlib.Data.Set.Card This file provides lemmas about the relation of `Nat.count` with cardinality functions. -/ +@[expose] public section + namespace Nat open Nat Count diff --git a/Mathlib/SetTheory/Cardinal/Order.lean b/Mathlib/SetTheory/Cardinal/Order.lean index 8db04e9e831134..c87b05e9276312 100644 --- a/Mathlib/SetTheory/Cardinal/Order.lean +++ b/Mathlib/SetTheory/Cardinal/Order.lean @@ -3,14 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Order.GroupWithZero.Canonical -import Mathlib.Algebra.Order.Ring.Canonical -import Mathlib.Data.Fintype.Option -import Mathlib.Order.InitialSeg -import Mathlib.Order.Nat -import Mathlib.Order.SuccPred.CompleteLinearOrder -import Mathlib.SetTheory.Cardinal.Defs -import Mathlib.SetTheory.Cardinal.SchroederBernstein +module + +public import Mathlib.Algebra.Order.GroupWithZero.Canonical +public import Mathlib.Algebra.Order.Ring.Canonical +public import Mathlib.Data.Fintype.Option +public import Mathlib.Order.InitialSeg +public import Mathlib.Order.Nat +public import Mathlib.Order.SuccPred.CompleteLinearOrder +public import Mathlib.SetTheory.Cardinal.Defs +public import Mathlib.SetTheory.Cardinal.SchroederBernstein /-! # Order on cardinal numbers @@ -57,6 +59,8 @@ cardinal number, cardinal arithmetic, cardinal exponentiation, aleph, Cantor's theorem, König's theorem, Konig's theorem -/ +@[expose] public section + assert_not_exists Field open List Function Order Set @@ -79,7 +83,6 @@ instance : LE Cardinal.{u} := propext ⟨fun ⟨e⟩ => ⟨e.congr e₁ e₂⟩, fun ⟨e⟩ => ⟨e.congr e₁.symm e₂.symm⟩⟩⟩ instance partialOrder : PartialOrder Cardinal.{u} where - le := (· ≤ ·) le_refl := by rintro ⟨α⟩ exact ⟨Embedding.refl _⟩ diff --git a/Mathlib/SetTheory/Cardinal/Ordinal.lean b/Mathlib/SetTheory/Cardinal/Ordinal.lean index eb4687b29f817d..464d696b2267be 100644 --- a/Mathlib/SetTheory/Cardinal/Ordinal.lean +++ b/Mathlib/SetTheory/Cardinal/Ordinal.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.SetTheory.Ordinal.Principal +module + +public import Mathlib.SetTheory.Cardinal.Arithmetic +public import Mathlib.SetTheory.Ordinal.Principal /-! # Ordinal arithmetic with cardinals @@ -12,6 +14,8 @@ import Mathlib.SetTheory.Ordinal.Principal This file collects results about the cardinality of different ordinal operations. -/ +@[expose] public section + universe u v open Cardinal Ordinal Set diff --git a/Mathlib/SetTheory/Cardinal/Pigeonhole.lean b/Mathlib/SetTheory/Cardinal/Pigeonhole.lean index 77b583e0d5804c..feaadff7189e9b 100644 --- a/Mathlib/SetTheory/Cardinal/Pigeonhole.lean +++ b/Mathlib/SetTheory/Cardinal/Pigeonhole.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn -/ -import Mathlib.Data.Set.Finite.Lattice -import Mathlib.SetTheory.Cardinal.Regular +module + +public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.SetTheory.Cardinal.Regular /-! # Infinite pigeonhole principle @@ -16,6 +18,8 @@ This file proves variants of the infinite pigeonhole principle. Generalize universes of results. -/ +@[expose] public section + open Order Ordinal Set universe u diff --git a/Mathlib/SetTheory/Cardinal/Regular.lean b/Mathlib/SetTheory/Cardinal/Regular.lean index bbe916cfba6e7d..c31db347f13324 100644 --- a/Mathlib/SetTheory/Cardinal/Regular.lean +++ b/Mathlib/SetTheory/Cardinal/Regular.lean @@ -3,8 +3,10 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Cardinal.Cofinality -import Mathlib.SetTheory.Ordinal.FixedPoint +module + +public import Mathlib.SetTheory.Cardinal.Cofinality +public import Mathlib.SetTheory.Ordinal.FixedPoint /-! # Regular cardinals @@ -25,6 +27,8 @@ This file defines regular and inaccessible cardinals. * Define singular cardinals. -/ +@[expose] public section + universe u v open Function Cardinal Set Order Ordinal diff --git a/Mathlib/SetTheory/Cardinal/SchroederBernstein.lean b/Mathlib/SetTheory/Cardinal/SchroederBernstein.lean index 5fc2594d5fabe6..f75bacc3cf89d3 100644 --- a/Mathlib/SetTheory/Cardinal/SchroederBernstein.lean +++ b/Mathlib/SetTheory/Cardinal/SchroederBernstein.lean @@ -3,9 +3,11 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ -import Mathlib.Data.Set.Piecewise -import Mathlib.Order.FixedPoints -import Mathlib.Order.Zorn +module + +public import Mathlib.Data.Set.Piecewise +public import Mathlib.Order.FixedPoints +public import Mathlib.Order.Zorn /-! # Schröder-Bernstein theorem, well-ordering of cardinals @@ -25,6 +27,8 @@ Cardinals are naturally ordered by `α ≤ β ↔ ∃ f : a → β, Injective f` Cardinals are defined and further developed in the folder `SetTheory.Cardinal`. -/ +@[expose] public section + open Set Function diff --git a/Mathlib/SetTheory/Cardinal/Subfield.lean b/Mathlib/SetTheory/Cardinal/Subfield.lean index 1321265bb6ef69..07001d7491d112 100644 --- a/Mathlib/SetTheory/Cardinal/Subfield.lean +++ b/Mathlib/SetTheory/Cardinal/Subfield.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Algebra.Field.Subfield.Basic -import Mathlib.Data.W.Cardinal -import Mathlib.Tactic.FinCases +module + +public import Mathlib.Algebra.Field.Subfield.Basic +public import Mathlib.Data.W.Cardinal +public import Mathlib.Tactic.FinCases /-! # Cardinality of the division ring generated by a set @@ -19,6 +21,8 @@ explicit universal objects. -/ +@[expose] public section + universe u variable {α : Type u} (s : Set α) diff --git a/Mathlib/SetTheory/Cardinal/ToNat.lean b/Mathlib/SetTheory/Cardinal/ToNat.lean index d0bd010cfc2362..ba1755e048a552 100644 --- a/Mathlib/SetTheory/Cardinal/ToNat.lean +++ b/Mathlib/SetTheory/Cardinal/ToNat.lean @@ -3,7 +3,9 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ -import Mathlib.SetTheory.Cardinal.ENat +module + +public import Mathlib.SetTheory.Cardinal.ENat /-! # Projection from cardinal numbers to natural numbers @@ -13,6 +15,8 @@ sending all infinite cardinals to zero. We also prove basic lemmas about this definition. -/ +@[expose] public section + assert_not_exists Field universe u v diff --git a/Mathlib/SetTheory/Cardinal/UnivLE.lean b/Mathlib/SetTheory/Cardinal/UnivLE.lean index 9804af015f6161..619b7c8d2c5c32 100644 --- a/Mathlib/SetTheory/Cardinal/UnivLE.lean +++ b/Mathlib/SetTheory/Cardinal/UnivLE.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Junyan Xu -/ -import Mathlib.Logic.UnivLE -import Mathlib.SetTheory.Ordinal.Basic +module + +public import Mathlib.Logic.UnivLE +public import Mathlib.SetTheory.Ordinal.Basic /-! # UnivLE and cardinals -/ +@[expose] public section + noncomputable section universe u v diff --git a/Mathlib/SetTheory/Descriptive/Tree.lean b/Mathlib/SetTheory/Descriptive/Tree.lean index d920840ad3861a..a4993baea05c0d 100644 --- a/Mathlib/SetTheory/Descriptive/Tree.lean +++ b/Mathlib/SetTheory/Descriptive/Tree.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Sven Manthe. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sven Manthe -/ -import Mathlib.Order.CompleteLattice.SetLike +module + +public import Mathlib.Order.CompleteLattice.SetLike /-! # Trees in the sense of descriptive set theory @@ -16,6 +18,8 @@ sequences that are stable under taking prefixes. * `tree A`: a (possibly infinite) tree of depth at most `ω` with nodes in `A` -/ +@[expose] public section + namespace Descriptive /-- A tree is a set of finite sequences, implemented as `List A`, that is stable under diff --git a/Mathlib/SetTheory/Game/Basic.lean b/Mathlib/SetTheory/Game/Basic.lean index f15ea8fbe98fad..3994f51e23e9c9 100644 --- a/Mathlib/SetTheory/Game/Basic.lean +++ b/Mathlib/SetTheory/Game/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Kim Morrison, Apurva Nakade, Yuyang Zhao -/ -import Mathlib.Algebra.Order.Monoid.Defs -import Mathlib.SetTheory.PGame.Algebra -import Mathlib.Tactic.Abel -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Monoid.Defs +public import Mathlib.SetTheory.PGame.Algebra +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Basic` in the CGT repo " @@ -25,6 +27,8 @@ imply `x * z ≈ y * z`. Hence, multiplication is not a well-defined operation o the abelian group structure on games allows us to simplify many proofs for pre-games. -/ +@[expose] public section + -- Porting note: many definitions here are noncomputable as the compiler does not support PGame.rec noncomputable section diff --git a/Mathlib/SetTheory/Game/Birthday.lean b/Mathlib/SetTheory/Game/Birthday.lean index fa02df4e58a27b..e346d616a7c4de 100644 --- a/Mathlib/SetTheory/Game/Birthday.lean +++ b/Mathlib/SetTheory/Game/Birthday.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Algebra.Order.Group.OrderIso -import Mathlib.SetTheory.Game.Ordinal -import Mathlib.SetTheory.Ordinal.NaturalOps -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Group.OrderIso +public import Mathlib.SetTheory.Game.Ordinal +public import Mathlib.SetTheory.Ordinal.NaturalOps +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Birthday` in the CGT repo " @@ -24,16 +26,18 @@ The birthday of a pre-game can be understood as representing the depth of its ga other hand, the birthday of a game more closely matches Conway's original description. The lemma `SetTheory.Game.birthday_eq_pGameBirthday` links both definitions together. -# Main declarations +## Main declarations - `SetTheory.PGame.birthday`: The birthday of a pre-game. - `SetTheory.Game.birthday`: The birthday of a game. -# Todo +## Todo - Characterize the birthdays of other basic arithmetical operations. -/ +@[expose] public section + universe u open Ordinal diff --git a/Mathlib/SetTheory/Game/Domineering.lean b/Mathlib/SetTheory/Game/Domineering.lean index a7c3e9d02ce2c2..411e0f4bf16eaf 100644 --- a/Mathlib/SetTheory/Game/Domineering.lean +++ b/Mathlib/SetTheory/Game/Domineering.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.SetTheory.Game.State -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.SetTheory.Game.State +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Specific.Domineering` in the CGT repo " @@ -24,6 +26,8 @@ Specifically to domineering, we need the fact that disjoint parts of the chessboard give sums of games. -/ +@[expose] public section + namespace SetTheory namespace PGame diff --git a/Mathlib/SetTheory/Game/Impartial.lean b/Mathlib/SetTheory/Game/Impartial.lean index 0fc3302d9a60b4..a4a307af70b220 100644 --- a/Mathlib/SetTheory/Game/Impartial.lean +++ b/Mathlib/SetTheory/Game/Impartial.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson -/ -import Mathlib.SetTheory.Game.Basic -import Mathlib.Tactic.NthRewrite -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.SetTheory.Game.Basic +public import Mathlib.Tactic.NthRewrite +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Impartial.Basic` in the CGT repo " @@ -20,6 +22,8 @@ no matter what moves are played. This allows for games such as poker-nim to be c impartial. -/ +@[expose] public section + universe u diff --git a/Mathlib/SetTheory/Game/Nim.lean b/Mathlib/SetTheory/Game/Nim.lean index 1646249724b54d..2779cd0a227659 100644 --- a/Mathlib/SetTheory/Game/Nim.lean +++ b/Mathlib/SetTheory/Game/Nim.lean @@ -3,10 +3,12 @@ Copyright (c) 2020 Fox Thomson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Fox Thomson, Markus Himmel -/ -import Mathlib.SetTheory.Game.Birthday -import Mathlib.SetTheory.Game.Impartial -import Mathlib.SetTheory.Nimber.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.SetTheory.Game.Birthday +public import Mathlib.SetTheory.Game.Impartial +public import Mathlib.SetTheory.Nimber.Basic +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Specific.Nim` in the CGT repo " @@ -33,6 +35,8 @@ moves. We expose `toLeftMovesNim` and `toRightMovesNim` to conveniently convert `o` into a left or right move of `nim o`, and vice versa. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/SetTheory/Game/Ordinal.lean b/Mathlib/SetTheory/Game/Ordinal.lean index 18fe4693dfc6fd..50956d99dd1e76 100644 --- a/Mathlib/SetTheory/Game/Ordinal.lean +++ b/Mathlib/SetTheory/Game/Ordinal.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Game.Basic -import Mathlib.SetTheory.Ordinal.NaturalOps -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.SetTheory.Game.Basic +public import Mathlib.SetTheory.Ordinal.NaturalOps +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Ordinal` in the CGT repo " @@ -19,12 +21,14 @@ game whose left set consists of all previous ordinals. The map to surreals is defined in `Ordinal.toSurreal`. -# Main declarations +## Main declarations - `Ordinal.toPGame`: The canonical map between ordinals and pre-games. - `Ordinal.toPGameEmbedding`: The order embedding version of the previous map. -/ +@[expose] public section + universe u diff --git a/Mathlib/SetTheory/Game/Short.lean b/Mathlib/SetTheory/Game/Short.lean index a401b975ace871..6136c5a9a9af45 100644 --- a/Mathlib/SetTheory/Game/Short.lean +++ b/Mathlib/SetTheory/Game/Short.lean @@ -3,11 +3,12 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ +module -import Mathlib.Data.Fintype.Basic -import Mathlib.SetTheory.Cardinal.Regular -import Mathlib.SetTheory.Game.Birthday -import Mathlib.Tactic.Linter.DeprecatedModule +public import Mathlib.Data.Fintype.Basic +public import Mathlib.SetTheory.Cardinal.Regular +public import Mathlib.SetTheory.Game.Birthday +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.Short` in the CGT repo " @@ -24,6 +25,8 @@ short games, although unfortunately in practice `decide` doesn't seem to be able prove anything using these instances. -/ +@[expose] public section + -- Porting note: The local instances `moveLeftShort'` and `fintypeLeft` (and resp. `Right`) -- trigger this error. set_option synthInstance.checkSynthOrder false diff --git a/Mathlib/SetTheory/Game/State.lean b/Mathlib/SetTheory/Game/State.lean index 78408c5f9c95df..90446140c0111c 100644 --- a/Mathlib/SetTheory/Game/State.lean +++ b/Mathlib/SetTheory/Game/State.lean @@ -3,8 +3,10 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.SetTheory.Game.Short -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.SetTheory.Game.Short +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.ConcreteGame` in the CGT repo " @@ -26,6 +28,8 @@ relying on general well-foundedness seems to be poisonous to computation? See `SetTheory/Game/Domineering` for an example using this construction. -/ +@[expose] public section + universe u namespace SetTheory diff --git a/Mathlib/SetTheory/Lists.lean b/Mathlib/SetTheory/Lists.lean index 4b750cfa74a699..b841d4b460f0e2 100644 --- a/Mathlib/SetTheory/Lists.lean +++ b/Mathlib/SetTheory/Lists.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Order.Group.Nat -import Mathlib.Algebra.Order.Monoid.NatCast -import Mathlib.Algebra.Ring.Nat -import Mathlib.Data.Sigma.Basic +module + +public import Mathlib.Algebra.Order.Group.Nat +public import Mathlib.Algebra.Order.Monoid.NatCast +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Data.Sigma.Basic /-! # A computable model of ZFA without infinity @@ -41,6 +43,8 @@ This calls for a two-step definition of ZFA lists: equivalence. -/ +@[expose] public section + variable {α : Type*} diff --git a/Mathlib/SetTheory/Nimber/Basic.lean b/Mathlib/SetTheory/Nimber/Basic.lean index 853cf7b0082ba9..64fd4550bfb45c 100644 --- a/Mathlib/SetTheory/Nimber/Basic.lean +++ b/Mathlib/SetTheory/Nimber/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Data.Nat.Bitwise -import Mathlib.SetTheory.Ordinal.Family -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Data.Nat.Bitwise +public import Mathlib.SetTheory.Ordinal.Family +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Nimber.Basic` in the CGT repo " @@ -41,6 +43,8 @@ isomorphisms `Ordinal.toNimber` and `Nimber.toOrdinal` allow us to cast between needed. -/ +@[expose] public section + universe u v open Function Order diff --git a/Mathlib/SetTheory/Nimber/Field.lean b/Mathlib/SetTheory/Nimber/Field.lean index 54e44ae43bd066..118c1a6a623d78 100644 --- a/Mathlib/SetTheory/Nimber/Field.lean +++ b/Mathlib/SetTheory/Nimber/Field.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Algebra.CharP.Two -import Mathlib.SetTheory.Nimber.Basic -import Mathlib.Tactic.Abel -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.CharP.Two +public import Mathlib.SetTheory.Nimber.Basic +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Nimber.Field` in the CGT repo " @@ -29,6 +31,8 @@ uses mutual induction and mimics the definition for the surreal inverse. This de - Show the nimbers are algebraically closed. -/ +@[expose] public section + universe u v open Function Order diff --git a/Mathlib/SetTheory/Ordinal/Arithmetic.lean b/Mathlib/SetTheory/Ordinal/Arithmetic.lean index db2c50f3e35385..de5305fb9921f6 100644 --- a/Mathlib/SetTheory/Ordinal/Arithmetic.lean +++ b/Mathlib/SetTheory/Ordinal/Arithmetic.lean @@ -3,10 +3,12 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.Algebra.GroupWithZero.Divisibility -import Mathlib.Data.Nat.SuccPred -import Mathlib.Order.SuccPred.InitialSeg -import Mathlib.SetTheory.Ordinal.Basic +module + +public import Mathlib.Algebra.GroupWithZero.Divisibility +public import Mathlib.Data.Nat.SuccPred +public import Mathlib.Order.SuccPred.InitialSeg +public import Mathlib.SetTheory.Ordinal.Basic /-! # Ordinal arithmetic @@ -45,6 +47,8 @@ Some properties of the operations are also used to discuss general tools on ordi Various other basic arithmetic results are given in `Principal.lean` instead. -/ +@[expose] public section + assert_not_exists Field Module noncomputable section diff --git a/Mathlib/SetTheory/Ordinal/Basic.lean b/Mathlib/SetTheory/Ordinal/Basic.lean index 8c84551738f832..45b46278ff2f67 100644 --- a/Mathlib/SetTheory/Ordinal/Basic.lean +++ b/Mathlib/SetTheory/Ordinal/Basic.lean @@ -3,11 +3,13 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn -/ -import Mathlib.Algebra.Order.SuccPred -import Mathlib.Data.Sum.Order -import Mathlib.Order.IsNormal -import Mathlib.SetTheory.Cardinal.Basic -import Mathlib.Tactic.PPWithUniv +module + +public import Mathlib.Algebra.Order.SuccPred +public import Mathlib.Data.Sum.Order +public import Mathlib.Order.IsNormal +public import Mathlib.SetTheory.Cardinal.Basic +public import Mathlib.Tactic.PPWithUniv /-! # Ordinals @@ -55,6 +57,8 @@ for the empty set by convention. * `ω` is a notation for the first infinite ordinal in the scope `Ordinal`. -/ +@[expose] public section + assert_not_exists Module Field noncomputable section diff --git a/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean b/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean index 87490f9e76fbb8..314e721f83a054 100644 --- a/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean +++ b/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Violeta Hernández Palacios -/ -import Mathlib.Data.Finsupp.AList -import Mathlib.SetTheory.Ordinal.Exponential -import Mathlib.SetTheory.Ordinal.Family +module + +public import Mathlib.Data.Finsupp.AList +public import Mathlib.SetTheory.Ordinal.Exponential +public import Mathlib.SetTheory.Ordinal.Family /-! # Cantor Normal Form @@ -14,7 +16,7 @@ The Cantor normal form of an ordinal is generally defined as its base `ω` expan non-zero exponents in decreasing order. Here, we more generally define a base `b` expansion `Ordinal.CNF` in this manner, which is well-behaved for any `b ≥ 2`. -# Implementation notes +## Implementation notes We implement `Ordinal.CNF` as an association list, where keys are exponents and values are coefficients. This is because this structure intrinsically reflects two key properties of the Cantor @@ -23,11 +25,13 @@ normal form: - It is ordered. - It has finitely many entries. -# Todo +## Todo - Prove the basic results relating the CNF to the arithmetic operations on ordinals. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/SetTheory/Ordinal/Enum.lean b/Mathlib/SetTheory/Ordinal/Enum.lean index 8885ccb1e49086..f4f2da92bb70b3 100644 --- a/Mathlib/SetTheory/Ordinal/Enum.lean +++ b/Mathlib/SetTheory/Ordinal/Enum.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.Family +module + +public import Mathlib.SetTheory.Ordinal.Family /-! # Enumerating sets of ordinals by ordinals @@ -18,6 +20,8 @@ We define this correspondence as `enumOrd`, and use it to then define an order i This can be thought of as an ordinal analog of `Nat.nth`. -/ +@[expose] public section + universe u open Order Set diff --git a/Mathlib/SetTheory/Ordinal/Exponential.lean b/Mathlib/SetTheory/Ordinal/Exponential.lean index 3181ec75f55b72..bb225947674ef2 100644 --- a/Mathlib/SetTheory/Ordinal/Exponential.lean +++ b/Mathlib/SetTheory/Ordinal/Exponential.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.Family +module + +public import Mathlib.SetTheory.Ordinal.Family /-! # Ordinal exponential @@ -12,6 +14,8 @@ related by the lemma `Ordinal.opow_le_iff_le_log : b ^ c ≤ x ↔ c ≤ log b x `b`, `c`. -/ +@[expose] public section + noncomputable section open Function Set Equiv Order diff --git a/Mathlib/SetTheory/Ordinal/Family.lean b/Mathlib/SetTheory/Ordinal/Family.lean index 83b856abc2e016..9993fb211e2166 100644 --- a/Mathlib/SetTheory/Ordinal/Family.lean +++ b/Mathlib/SetTheory/Ordinal/Family.lean @@ -3,7 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.Arithmetic +module + +public import Mathlib.SetTheory.Ordinal.Arithmetic /-! # Arithmetic on families of ordinals @@ -18,6 +20,8 @@ import Mathlib.SetTheory.Ordinal.Arithmetic Various other basic arithmetic results are given in `Principal.lean` instead. -/ +@[expose] public section + assert_not_exists Field Module noncomputable section diff --git a/Mathlib/SetTheory/Ordinal/FixedPoint.lean b/Mathlib/SetTheory/Ordinal/FixedPoint.lean index e94d6696d62abb..0f7a175d2fec20 100644 --- a/Mathlib/SetTheory/Ordinal/FixedPoint.lean +++ b/Mathlib/SetTheory/Ordinal/FixedPoint.lean @@ -3,9 +3,11 @@ Copyright (c) 2018 Violeta Hernández Palacios, Mario Carneiro. All rights reser Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios, Mario Carneiro -/ -import Mathlib.Logic.Small.List -import Mathlib.SetTheory.Ordinal.Enum -import Mathlib.SetTheory.Ordinal.Exponential +module + +public import Mathlib.Logic.Small.List +public import Mathlib.SetTheory.Ordinal.Enum +public import Mathlib.SetTheory.Ordinal.Exponential /-! # Fixed points of normal functions @@ -26,6 +28,8 @@ Moreover, we prove some lemmas about the fixed points of specific normal functio * `deriv_mul_eq_opow_omega0_mul`: a characterization of the derivative of multiplication. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/SetTheory/Ordinal/FixedPointApproximants.lean b/Mathlib/SetTheory/Ordinal/FixedPointApproximants.lean index 006f40b1a46b99..f1e44c7d1119e5 100644 --- a/Mathlib/SetTheory/Ordinal/FixedPointApproximants.lean +++ b/Mathlib/SetTheory/Ordinal/FixedPointApproximants.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Ira Fesefeldt. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Ira Fesefeldt -/ -import Mathlib.SetTheory.Ordinal.Arithmetic +module + +public import Mathlib.SetTheory.Ordinal.Arithmetic /-! # Ordinal Approximants for the Fixed points on complete lattices @@ -37,6 +39,8 @@ ordinals from mathlib. It still allows an approximation scheme indexed over the fixed point, complete lattice, monotone function, ordinals, approximation -/ +@[expose] public section + namespace Cardinal universe u diff --git a/Mathlib/SetTheory/Ordinal/NaturalOps.lean b/Mathlib/SetTheory/Ordinal/NaturalOps.lean index 4a61c0364177e2..31b1bed88c7849 100644 --- a/Mathlib/SetTheory/Ordinal/NaturalOps.lean +++ b/Mathlib/SetTheory/Ordinal/NaturalOps.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.Family -import Mathlib.Tactic.Abel -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.SetTheory.Ordinal.Family +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.NatOrdinal` in the CGT repo " @@ -44,6 +46,8 @@ between both types, we attempt to prove and state most results on `Ordinal`. form. -/ +@[expose] public section + universe u v open Function Order Set diff --git a/Mathlib/SetTheory/Ordinal/Notation.lean b/Mathlib/SetTheory/Ordinal/Notation.lean index 803f3f5bbd282c..1cf777f8ee626e 100644 --- a/Mathlib/SetTheory/Ordinal/Notation.lean +++ b/Mathlib/SetTheory/Ordinal/Notation.lean @@ -3,11 +3,13 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Algebra.Ring.Divisibility.Basic -import Mathlib.Data.Ordering.Lemmas -import Mathlib.Data.PNat.Basic -import Mathlib.SetTheory.Ordinal.Principal -import Mathlib.Tactic.NormNum +module + +public import Mathlib.Algebra.Ring.Divisibility.Basic +public import Mathlib.Data.Ordering.Lemmas +public import Mathlib.Data.PNat.Basic +public import Mathlib.SetTheory.Ordinal.Principal +public import Mathlib.Tactic.NormNum /-! # Ordinal notation @@ -24,6 +26,8 @@ Various operations (addition, subtraction, multiplication, exponentiation) are defined on `ONote` and `NONote`. -/ +@[expose] public section + open Ordinal Order diff --git a/Mathlib/SetTheory/Ordinal/Principal.lean b/Mathlib/SetTheory/Ordinal/Principal.lean index e2656043f8858c..e5c67495ec955b 100644 --- a/Mathlib/SetTheory/Ordinal/Principal.lean +++ b/Mathlib/SetTheory/Ordinal/Principal.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.FixedPoint +module + +public import Mathlib.SetTheory.Ordinal.FixedPoint /-! # Principal ordinals @@ -26,6 +28,8 @@ We define principal or indecomposable ordinals, and we prove the standard proper of `fun x ↦ ω ^ x`. -/ +@[expose] public section + universe u open Order diff --git a/Mathlib/SetTheory/Ordinal/Rank.lean b/Mathlib/SetTheory/Ordinal/Rank.lean index 6cfa867715e9b4..cba2406e83081f 100644 --- a/Mathlib/SetTheory/Ordinal/Rank.lean +++ b/Mathlib/SetTheory/Ordinal/Rank.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ -import Mathlib.SetTheory.Ordinal.Family +module + +public import Mathlib.SetTheory.Ordinal.Family /-! # Rank in a well-founded relation @@ -12,6 +14,8 @@ For `r` a well-founded relation, `IsWellFounded.rank r a` is recursively defined ordinal greater than the ranks of all elements below `a`. -/ +@[expose] public section + universe u variable {α : Type u} {a b : α} diff --git a/Mathlib/SetTheory/Ordinal/Topology.lean b/Mathlib/SetTheory/Ordinal/Topology.lean index 4300a1b960a7a9..01cfe1776d7e27 100644 --- a/Mathlib/SetTheory/Ordinal/Topology.lean +++ b/Mathlib/SetTheory/Ordinal/Topology.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.Enum -import Mathlib.Tactic.TFAE -import Mathlib.Topology.Order.IsNormal -import Mathlib.Topology.Order.Monotone +module + +public import Mathlib.SetTheory.Ordinal.Enum +public import Mathlib.Tactic.TFAE +public import Mathlib.Topology.Order.IsNormal +public import Mathlib.Topology.Order.Monotone /-! ### Topology of ordinals @@ -23,6 +25,8 @@ We prove some miscellaneous results involving the order topology of ordinals. normal iff the set is closed. -/ +@[expose] public section + noncomputable section diff --git a/Mathlib/SetTheory/Ordinal/Veblen.lean b/Mathlib/SetTheory/Ordinal/Veblen.lean index 3052879e53fbd4..a35f41dc067900 100644 --- a/Mathlib/SetTheory/Ordinal/Veblen.lean +++ b/Mathlib/SetTheory/Ordinal/Veblen.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.Ordinal.FixedPoint +module + +public import Mathlib.SetTheory.Ordinal.FixedPoint /-! # Veblen hierarchy @@ -37,6 +39,8 @@ The following notation is scoped to the `Ordinal` namespace. * [Larry W. Miller, Normal functions and constructive ordinal notations][Miller_1976] -/ +@[expose] public section + noncomputable section open Order Set diff --git a/Mathlib/SetTheory/PGame/Algebra.lean b/Mathlib/SetTheory/PGame/Algebra.lean index 090653cc63a854..72ad72568c7868 100644 --- a/Mathlib/SetTheory/PGame/Algebra.lean +++ b/Mathlib/SetTheory/PGame/Algebra.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Kim Morrison, Yuyang Zhao -/ -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.SetTheory.PGame.Order -import Mathlib.Data.Nat.Cast.Defs -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.ZeroLEOne +public import Mathlib.SetTheory.PGame.Order +public import Mathlib.Data.Nat.Cast.Defs +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.IGame` in the CGT repo " @@ -32,6 +34,8 @@ equivalence relations at the level of pregames, the notion of a `Relabelling` of `x + (y + z)` and `(x + y) + z`. -/ +@[expose] public section + namespace SetTheory.PGame open Function Relation diff --git a/Mathlib/SetTheory/PGame/Basic.lean b/Mathlib/SetTheory/PGame/Basic.lean index 121ac31f2267c8..4413f2bca5cd02 100644 --- a/Mathlib/SetTheory/PGame/Basic.lean +++ b/Mathlib/SetTheory/PGame/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Kim Morrison, Yuyang Zhao -/ -import Mathlib.Logic.Equiv.Defs -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Logic.Equiv.Defs +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.IGame` in the CGT repo " @@ -67,6 +69,8 @@ An interested reader may like to formalise some of the material from * [André Joyal, *Remarques sur la théorie des jeux à deux personnes*][joyal1977] -/ +@[expose] public section + namespace SetTheory open Function Relation diff --git a/Mathlib/SetTheory/PGame/Order.lean b/Mathlib/SetTheory/PGame/Order.lean index c747bfdb6e9bed..a1f80c5a079663 100644 --- a/Mathlib/SetTheory/PGame/Order.lean +++ b/Mathlib/SetTheory/PGame/Order.lean @@ -3,10 +3,12 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Kim Morrison, Yuyang Zhao -/ -import Mathlib.Logic.Small.Defs -import Mathlib.Order.GameAdd -import Mathlib.SetTheory.PGame.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Logic.Small.Defs +public import Mathlib.Order.GameAdd +public import Mathlib.SetTheory.PGame.Basic +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Game.IGame` in the CGT repo " @@ -33,6 +35,8 @@ Later, games will be defined as the quotient by the `≈` relation; that is to s `Antisymmetrization` of `SetTheory.PGame`. -/ +@[expose] public section + namespace SetTheory.PGame open Function Relation diff --git a/Mathlib/SetTheory/Surreal/Basic.lean b/Mathlib/SetTheory/Surreal/Basic.lean index c89188658bf6f7..e135367c27cd6c 100644 --- a/Mathlib/SetTheory/Surreal/Basic.lean +++ b/Mathlib/SetTheory/Surreal/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison -/ -import Mathlib.Algebra.Order.Hom.Monoid -import Mathlib.SetTheory.Game.Ordinal -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Order.Hom.Monoid +public import Mathlib.SetTheory.Game.Ordinal +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Surreal.Basic` in the CGT repo " @@ -51,6 +53,8 @@ One can also map all the ordinals into the surreals! -/ +@[expose] public section + universe u @@ -349,8 +353,6 @@ instance addCommGroup : AddCommGroup Surreal where zsmul := zsmulRec instance partialOrder : PartialOrder Surreal where - le := (· ≤ ·) - lt := (· < ·) le_refl := by rintro ⟨_⟩; apply @le_rfl PGame le_trans := by rintro ⟨_⟩ ⟨_⟩ ⟨_⟩; apply @le_trans PGame lt_iff_le_not_ge := by rintro ⟨_, ox⟩ ⟨_, oy⟩; apply @lt_iff_le_not_ge PGame diff --git a/Mathlib/SetTheory/Surreal/Dyadic.lean b/Mathlib/SetTheory/Surreal/Dyadic.lean index c2352675a58686..843a8f98d86046 100644 --- a/Mathlib/SetTheory/Surreal/Dyadic.lean +++ b/Mathlib/SetTheory/Surreal/Dyadic.lean @@ -3,15 +3,17 @@ Copyright (c) 2021 Apurva Nakade. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Apurva Nakade -/ -import Mathlib.Algebra.Algebra.Defs -import Mathlib.Algebra.Order.Group.Basic -import Mathlib.Algebra.Ring.Regular -import Mathlib.GroupTheory.MonoidLocalization.Away -import Mathlib.RingTheory.Localization.Defs -import Mathlib.SetTheory.Game.Birthday -import Mathlib.SetTheory.Surreal.Multiplication -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Algebra.Algebra.Defs +public import Mathlib.Algebra.Order.Group.Basic +public import Mathlib.Algebra.Ring.Regular +public import Mathlib.GroupTheory.MonoidLocalization.Away +public import Mathlib.RingTheory.Localization.Defs +public import Mathlib.SetTheory.Game.Birthday +public import Mathlib.SetTheory.Surreal.Multiplication +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Surreal.Dyadic` in the CGT repo " @@ -33,6 +35,8 @@ extend this to an embedding of dyadic rationals into `Surreal` and use Cauchy se rational numbers to construct an ordered field embedding of ℝ into `Surreal`. -/ +@[expose] public section + universe u diff --git a/Mathlib/SetTheory/Surreal/Multiplication.lean b/Mathlib/SetTheory/Surreal/Multiplication.lean index 04510a6ce8707a..ae3ce1c80e7257 100644 --- a/Mathlib/SetTheory/Surreal/Multiplication.lean +++ b/Mathlib/SetTheory/Surreal/Multiplication.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Theodore Hwa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison, Violeta Hernández Palacios, Junyan Xu, Theodore Hwa -/ -import Mathlib.Logic.Hydra -import Mathlib.SetTheory.Surreal.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Mathlib.Logic.Hydra +public import Mathlib.SetTheory.Surreal.Basic +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "This module is now at `CombinatorialGames.Surreal.Multiplication` in the CGT repo " @@ -67,6 +69,8 @@ The whole proof features a clear separation into lemmas of different roles: -/ +@[expose] public section + universe u open SetTheory Game PGame WellFounded diff --git a/Mathlib/SetTheory/ZFC/Basic.lean b/Mathlib/SetTheory/ZFC/Basic.lean index fbb16ac34080e5..a473cbfe66c38d 100644 --- a/Mathlib/SetTheory/ZFC/Basic.lean +++ b/Mathlib/SetTheory/ZFC/Basic.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Fin.VecNotation -import Mathlib.Data.SetLike.Basic -import Mathlib.Logic.Small.Basic -import Mathlib.SetTheory.ZFC.PSet +module + +public import Mathlib.Data.Fin.VecNotation +public import Mathlib.Data.SetLike.Basic +public import Mathlib.Logic.Small.Basic +public import Mathlib.SetTheory.ZFC.PSet /-! # A model of ZFC @@ -35,6 +37,8 @@ To avoid confusion between the Lean `Set` and the ZFC `Set`, docstrings in this respectively as "`Set`" and "ZFC set". -/ +@[expose] public section + universe u diff --git a/Mathlib/SetTheory/ZFC/Class.lean b/Mathlib/SetTheory/ZFC/Class.lean index 1ce2aa9acd4902..a3a1bf5a17fd5c 100644 --- a/Mathlib/SetTheory/ZFC/Class.lean +++ b/Mathlib/SetTheory/ZFC/Class.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.SetTheory.ZFC.Ordinal +module + +public import Mathlib.SetTheory.ZFC.Ordinal /-! # ZFC classes @@ -20,6 +22,8 @@ definitionally equal to ours. * `ZFSet.isOrdinal_notMem_univ`: The Burali-Forti paradox. Ordinals form a proper class. -/ +@[expose] public section + universe u diff --git a/Mathlib/SetTheory/ZFC/Ordinal.lean b/Mathlib/SetTheory/ZFC/Ordinal.lean index b38e513f203629..0de593d3a8c4c1 100644 --- a/Mathlib/SetTheory/ZFC/Ordinal.lean +++ b/Mathlib/SetTheory/ZFC/Ordinal.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.Order.GameAdd -import Mathlib.Order.RelIso.Set -import Mathlib.SetTheory.ZFC.Basic +module + +public import Mathlib.Order.GameAdd +public import Mathlib.Order.RelIso.Set +public import Mathlib.SetTheory.ZFC.Basic /-! # Von Neumann ordinals @@ -24,6 +26,8 @@ under `∈`. - Build correspondences between these set notions and those of the standard `Ordinal` type. -/ +@[expose] public section + universe u variable {x y z w : ZFSet.{u}} diff --git a/Mathlib/SetTheory/ZFC/PSet.lean b/Mathlib/SetTheory/ZFC/PSet.lean index a2fddae4a2b31c..eefcd23941b732 100644 --- a/Mathlib/SetTheory/ZFC/PSet.lean +++ b/Mathlib/SetTheory/ZFC/PSet.lean @@ -3,7 +3,9 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Data.Set.Lattice +module + +public import Mathlib.Data.Set.Lattice /-! # Pre-sets @@ -24,6 +26,8 @@ quotient of pre-sets by extensional equality. * `PSet.omega`: The von Neumann ordinal `ω` as a `PSet`. -/ +@[expose] public section + universe u v diff --git a/Mathlib/SetTheory/ZFC/Rank.lean b/Mathlib/SetTheory/ZFC/Rank.lean index 4ac34fdc9bc2d4..1e3b7465207a38 100644 --- a/Mathlib/SetTheory/ZFC/Rank.lean +++ b/Mathlib/SetTheory/ZFC/Rank.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Dexin Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dexin Zhang -/ -import Mathlib.Logic.UnivLE -import Mathlib.SetTheory.Ordinal.Rank -import Mathlib.SetTheory.ZFC.Basic +module + +public import Mathlib.Logic.UnivLE +public import Mathlib.SetTheory.Ordinal.Rank +public import Mathlib.SetTheory.ZFC.Basic /-! # Ordinal ranks of PSet and ZFSet @@ -20,6 +22,8 @@ same as the indexing types. * `ZFSet.rank`: Ordinal rank of a ZFC set. -/ +@[expose] public section + universe u v open Ordinal Order diff --git a/Mathlib/SetTheory/ZFC/VonNeumann.lean b/Mathlib/SetTheory/ZFC/VonNeumann.lean index 01ce4707be9735..9ed8dc1efac199 100644 --- a/Mathlib/SetTheory/ZFC/VonNeumann.lean +++ b/Mathlib/SetTheory/ZFC/VonNeumann.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Violeta Hernández Palacios. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Violeta Hernández Palacios -/ -import Mathlib.SetTheory.ZFC.Class -import Mathlib.SetTheory.ZFC.Ordinal -import Mathlib.SetTheory.ZFC.Rank +module + +public import Mathlib.SetTheory.ZFC.Class +public import Mathlib.SetTheory.ZFC.Ordinal +public import Mathlib.SetTheory.ZFC.Rank /-! # Von Neumann hierarchy @@ -19,6 +21,8 @@ that `⋃ o, V_ o = univ`. - `V_ o` is notation for `vonNeumann o`. It is scoped in the `ZFSet` namespace. -/ +@[expose] public section + universe u open Order diff --git a/Mathlib/Std/Data/HashMap.lean b/Mathlib/Std/Data/HashMap.lean index dc2872910a9d30..e32ef19a95b1e9 100644 --- a/Mathlib/Std/Data/HashMap.lean +++ b/Mathlib/Std/Data/HashMap.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Std.Data.HashMap.AdditionalOperations -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public import Std.Data.HashMap.AdditionalOperations +public import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module (since := "2025-08-18") @@ -14,6 +16,8 @@ deprecated_module (since := "2025-08-18") This is now reimplemented in the Lean standard library. -/ +@[expose] public section + namespace Std.HashMap variable {α β γ : Type _} [BEq α] [Hashable α] diff --git a/Mathlib/Tactic.lean b/Mathlib/Tactic.lean index 9c3a3b3f42c4e0..8ac71bd90b2fdf 100644 --- a/Mathlib/Tactic.lean +++ b/Mathlib/Tactic.lean @@ -1,309 +1,316 @@ -import Mathlib.Tactic.Abel -import Mathlib.Tactic.AdaptationNote -import Mathlib.Tactic.Algebraize -import Mathlib.Tactic.ApplyAt -import Mathlib.Tactic.ApplyCongr -import Mathlib.Tactic.ApplyFun -import Mathlib.Tactic.ApplyWith -import Mathlib.Tactic.ArithMult -import Mathlib.Tactic.ArithMult.Init -import Mathlib.Tactic.Attr.Core -import Mathlib.Tactic.Attr.Register -import Mathlib.Tactic.Basic -import Mathlib.Tactic.Bound -import Mathlib.Tactic.Bound.Attribute -import Mathlib.Tactic.Bound.Init -import Mathlib.Tactic.ByCases -import Mathlib.Tactic.ByContra -import Mathlib.Tactic.CC -import Mathlib.Tactic.CC.Addition -import Mathlib.Tactic.CC.Datatypes -import Mathlib.Tactic.CC.Lemmas -import Mathlib.Tactic.CC.MkProof -import Mathlib.Tactic.CancelDenoms -import Mathlib.Tactic.CancelDenoms.Core -import Mathlib.Tactic.Cases -import Mathlib.Tactic.CasesM -import Mathlib.Tactic.CategoryTheory.BicategoricalComp -import Mathlib.Tactic.CategoryTheory.Bicategory.Basic -import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes -import Mathlib.Tactic.CategoryTheory.Bicategory.Normalize -import Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence -import Mathlib.Tactic.CategoryTheory.BicategoryCoherence -import Mathlib.Tactic.CategoryTheory.CheckCompositions -import Mathlib.Tactic.CategoryTheory.Coherence -import Mathlib.Tactic.CategoryTheory.Coherence.Basic -import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes -import Mathlib.Tactic.CategoryTheory.Coherence.Normalize -import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence -import Mathlib.Tactic.CategoryTheory.Elementwise -import Mathlib.Tactic.CategoryTheory.IsoReassoc -import Mathlib.Tactic.CategoryTheory.Monoidal.Basic -import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes -import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize -import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence -import Mathlib.Tactic.CategoryTheory.MonoidalComp -import Mathlib.Tactic.CategoryTheory.Reassoc -import Mathlib.Tactic.CategoryTheory.Slice -import Mathlib.Tactic.CategoryTheory.ToApp -import Mathlib.Tactic.Change -import Mathlib.Tactic.Check -import Mathlib.Tactic.Choose -import Mathlib.Tactic.Clean -import Mathlib.Tactic.ClearExcept -import Mathlib.Tactic.ClearExclamation -import Mathlib.Tactic.Clear_ -import Mathlib.Tactic.Coe -import Mathlib.Tactic.Common -import Mathlib.Tactic.ComputeDegree -import Mathlib.Tactic.CongrExclamation -import Mathlib.Tactic.CongrM -import Mathlib.Tactic.Constructor -import Mathlib.Tactic.Continuity -import Mathlib.Tactic.Continuity.Init -import Mathlib.Tactic.ContinuousFunctionalCalculus -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Conv -import Mathlib.Tactic.Convert -import Mathlib.Tactic.Core -import Mathlib.Tactic.DeclarationNames -import Mathlib.Tactic.DefEqTransformations -import Mathlib.Tactic.DepRewrite -import Mathlib.Tactic.DeprecateTo -import Mathlib.Tactic.DeriveCountable -import Mathlib.Tactic.DeriveEncodable -import Mathlib.Tactic.DeriveFintype -import Mathlib.Tactic.DeriveTraversable -import Mathlib.Tactic.ENatToNat -import Mathlib.Tactic.Eqns -import Mathlib.Tactic.ErwQuestion -import Mathlib.Tactic.Eval -import Mathlib.Tactic.ExistsI -import Mathlib.Tactic.Explode -import Mathlib.Tactic.Explode.Datatypes -import Mathlib.Tactic.Explode.Pretty -import Mathlib.Tactic.ExtendDoc -import Mathlib.Tactic.ExtractGoal -import Mathlib.Tactic.ExtractLets -import Mathlib.Tactic.FBinop -import Mathlib.Tactic.FailIfNoProgress -import Mathlib.Tactic.FastInstance -import Mathlib.Tactic.Field -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.FieldSimp.Attr -import Mathlib.Tactic.FieldSimp.Discharger -import Mathlib.Tactic.FieldSimp.Lemmas -import Mathlib.Tactic.FinCases -import Mathlib.Tactic.Find -import Mathlib.Tactic.FindSyntax -import Mathlib.Tactic.Finiteness -import Mathlib.Tactic.Finiteness.Attr -import Mathlib.Tactic.FunProp -import Mathlib.Tactic.FunProp.Attr -import Mathlib.Tactic.FunProp.ContDiff -import Mathlib.Tactic.FunProp.Core -import Mathlib.Tactic.FunProp.Decl -import Mathlib.Tactic.FunProp.Differentiable -import Mathlib.Tactic.FunProp.Elab -import Mathlib.Tactic.FunProp.FunctionData -import Mathlib.Tactic.FunProp.Mor -import Mathlib.Tactic.FunProp.Theorems -import Mathlib.Tactic.FunProp.ToBatteries -import Mathlib.Tactic.FunProp.Types -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.GCongr.Core -import Mathlib.Tactic.GCongr.CoreAttrs -import Mathlib.Tactic.GCongr.ForwardAttr -import Mathlib.Tactic.GRewrite -import Mathlib.Tactic.GRewrite.Core -import Mathlib.Tactic.GRewrite.Elab -import Mathlib.Tactic.Generalize -import Mathlib.Tactic.GeneralizeProofs -import Mathlib.Tactic.Group -import Mathlib.Tactic.GuardGoalNums -import Mathlib.Tactic.GuardHypNums -import Mathlib.Tactic.Have -import Mathlib.Tactic.HaveI -import Mathlib.Tactic.HigherOrder -import Mathlib.Tactic.Hint -import Mathlib.Tactic.ITauto -import Mathlib.Tactic.InferParam -import Mathlib.Tactic.Inhabit -import Mathlib.Tactic.IntervalCases -import Mathlib.Tactic.IrreducibleDef -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.Lift -import Mathlib.Tactic.LiftLets -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Linarith.Datatypes -import Mathlib.Tactic.Linarith.Frontend -import Mathlib.Tactic.Linarith.Lemmas -import Mathlib.Tactic.Linarith.Oracle.FourierMotzkin -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Gauss -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.SimplexAlgorithm -import Mathlib.Tactic.Linarith.Parsing -import Mathlib.Tactic.Linarith.Preprocessing -import Mathlib.Tactic.Linarith.Verification -import Mathlib.Tactic.LinearCombination -import Mathlib.Tactic.LinearCombination' -import Mathlib.Tactic.LinearCombination.Lemmas -import Mathlib.Tactic.Linter -import Mathlib.Tactic.Linter.CommandRanges -import Mathlib.Tactic.Linter.CommandStart -import Mathlib.Tactic.Linter.DeprecatedModule -import Mathlib.Tactic.Linter.DeprecatedSyntaxLinter -import Mathlib.Tactic.Linter.DirectoryDependency -import Mathlib.Tactic.Linter.DocPrime -import Mathlib.Tactic.Linter.DocString -import Mathlib.Tactic.Linter.FindDeprecations -import Mathlib.Tactic.Linter.FlexibleLinter -import Mathlib.Tactic.Linter.GlobalAttributeIn -import Mathlib.Tactic.Linter.HashCommandLinter -import Mathlib.Tactic.Linter.HaveLetLinter -import Mathlib.Tactic.Linter.Header -import Mathlib.Tactic.Linter.Lint -import Mathlib.Tactic.Linter.MinImports -import Mathlib.Tactic.Linter.Multigoal -import Mathlib.Tactic.Linter.OldObtain -import Mathlib.Tactic.Linter.PPRoundtrip -import Mathlib.Tactic.Linter.Style -import Mathlib.Tactic.Linter.TextBased -import Mathlib.Tactic.Linter.UnusedTactic -import Mathlib.Tactic.Linter.UnusedTacticExtension -import Mathlib.Tactic.Linter.UpstreamableDecl -import Mathlib.Tactic.Measurability -import Mathlib.Tactic.Measurability.Init -import Mathlib.Tactic.MinImports -import Mathlib.Tactic.MkIffOfInductiveProp -import Mathlib.Tactic.ModCases -import Mathlib.Tactic.Module -import Mathlib.Tactic.Monotonicity -import Mathlib.Tactic.Monotonicity.Attr -import Mathlib.Tactic.Monotonicity.Basic -import Mathlib.Tactic.Monotonicity.Lemmas -import Mathlib.Tactic.MoveAdd -import Mathlib.Tactic.NoncommRing -import Mathlib.Tactic.Nontriviality -import Mathlib.Tactic.Nontriviality.Core -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.NormNum.Abs -import Mathlib.Tactic.NormNum.Basic -import Mathlib.Tactic.NormNum.BigOperators -import Mathlib.Tactic.NormNum.Core -import Mathlib.Tactic.NormNum.DivMod -import Mathlib.Tactic.NormNum.Eq -import Mathlib.Tactic.NormNum.GCD -import Mathlib.Tactic.NormNum.Ineq -import Mathlib.Tactic.NormNum.Inv -import Mathlib.Tactic.NormNum.Irrational -import Mathlib.Tactic.NormNum.IsCoprime -import Mathlib.Tactic.NormNum.LegendreSymbol -import Mathlib.Tactic.NormNum.ModEq -import Mathlib.Tactic.NormNum.NatFactorial -import Mathlib.Tactic.NormNum.NatFib -import Mathlib.Tactic.NormNum.NatLog -import Mathlib.Tactic.NormNum.NatSqrt -import Mathlib.Tactic.NormNum.OfScientific -import Mathlib.Tactic.NormNum.Ordinal -import Mathlib.Tactic.NormNum.Parity -import Mathlib.Tactic.NormNum.Pow -import Mathlib.Tactic.NormNum.PowMod -import Mathlib.Tactic.NormNum.Prime -import Mathlib.Tactic.NormNum.RealSqrt -import Mathlib.Tactic.NormNum.Result -import Mathlib.Tactic.NthRewrite -import Mathlib.Tactic.Observe -import Mathlib.Tactic.OfNat -import Mathlib.Tactic.Order -import Mathlib.Tactic.Order.CollectFacts -import Mathlib.Tactic.Order.Graph.Basic -import Mathlib.Tactic.Order.Graph.Tarjan -import Mathlib.Tactic.Order.Preprocessing -import Mathlib.Tactic.PNatToNat -import Mathlib.Tactic.PPWithUniv -import Mathlib.Tactic.Peel -import Mathlib.Tactic.Polyrith -import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Positivity.Basic -import Mathlib.Tactic.Positivity.Core -import Mathlib.Tactic.Positivity.Finset -import Mathlib.Tactic.ProdAssoc -import Mathlib.Tactic.Propose -import Mathlib.Tactic.ProxyType -import Mathlib.Tactic.Push -import Mathlib.Tactic.Push.Attr -import Mathlib.Tactic.Qify -import Mathlib.Tactic.RSuffices -import Mathlib.Tactic.Recall -import Mathlib.Tactic.Recover -import Mathlib.Tactic.ReduceModChar -import Mathlib.Tactic.ReduceModChar.Ext -import Mathlib.Tactic.Relation.Rfl -import Mathlib.Tactic.Relation.Symm -import Mathlib.Tactic.Rename -import Mathlib.Tactic.RenameBVar -import Mathlib.Tactic.Replace -import Mathlib.Tactic.RewriteSearch -import Mathlib.Tactic.Rify -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Ring.Basic -import Mathlib.Tactic.Ring.Compare -import Mathlib.Tactic.Ring.NamePolyVars -import Mathlib.Tactic.Ring.PNat -import Mathlib.Tactic.Ring.RingNF -import Mathlib.Tactic.Sat.FromLRAT -import Mathlib.Tactic.Says -import Mathlib.Tactic.ScopedNS -import Mathlib.Tactic.Set -import Mathlib.Tactic.SetLike -import Mathlib.Tactic.SimpIntro -import Mathlib.Tactic.SimpRw -import Mathlib.Tactic.Simproc.Divisors -import Mathlib.Tactic.Simproc.ExistsAndEq -import Mathlib.Tactic.Simproc.Factors -import Mathlib.Tactic.Simproc.FinsetInterval -import Mathlib.Tactic.Simps.Basic -import Mathlib.Tactic.Simps.NotationClass -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.Spread -import Mathlib.Tactic.StacksAttribute -import Mathlib.Tactic.Subsingleton -import Mathlib.Tactic.Substs -import Mathlib.Tactic.SuccessIfFailWithMsg -import Mathlib.Tactic.SudoSetOption -import Mathlib.Tactic.SuppressCompilation -import Mathlib.Tactic.SwapVar -import Mathlib.Tactic.TFAE -import Mathlib.Tactic.TacticAnalysis -import Mathlib.Tactic.TacticAnalysis.Declarations -import Mathlib.Tactic.Tauto -import Mathlib.Tactic.TautoSet -import Mathlib.Tactic.TermCongr -import Mathlib.Tactic.ToAdditive -import Mathlib.Tactic.ToAdditive.Frontend -import Mathlib.Tactic.ToAdditive.GuessName -import Mathlib.Tactic.ToExpr -import Mathlib.Tactic.ToLevel -import Mathlib.Tactic.Trace -import Mathlib.Tactic.TryThis -import Mathlib.Tactic.TypeCheck -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.UnsetOption -import Mathlib.Tactic.Use -import Mathlib.Tactic.Variable -import Mathlib.Tactic.WLOG -import Mathlib.Tactic.Widget.Calc -import Mathlib.Tactic.Widget.CommDiag -import Mathlib.Tactic.Widget.CongrM -import Mathlib.Tactic.Widget.Conv -import Mathlib.Tactic.Widget.GCongr -import Mathlib.Tactic.Widget.InteractiveUnfold -import Mathlib.Tactic.Widget.LibraryRewrite -import Mathlib.Tactic.Widget.SelectInsertParamsClass -import Mathlib.Tactic.Widget.SelectPanelUtils -import Mathlib.Tactic.Widget.StringDiagram -import Mathlib.Tactic.WithoutCDot -import Mathlib.Tactic.Zify +module + +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.AdaptationNote +public import Mathlib.Tactic.Algebraize +public import Mathlib.Tactic.ApplyAt +public import Mathlib.Tactic.ApplyCongr +public import Mathlib.Tactic.ApplyFun +public import Mathlib.Tactic.ApplyWith +public import Mathlib.Tactic.ArithMult +public import Mathlib.Tactic.ArithMult.Init +public import Mathlib.Tactic.Attr.Core +public import Mathlib.Tactic.Attr.Register +public import Mathlib.Tactic.Basic +public import Mathlib.Tactic.Bound +public import Mathlib.Tactic.Bound.Attribute +public import Mathlib.Tactic.Bound.Init +public import Mathlib.Tactic.ByCases +public import Mathlib.Tactic.ByContra +public import Mathlib.Tactic.CC +public import Mathlib.Tactic.CC.Addition +public import Mathlib.Tactic.CC.Datatypes +public import Mathlib.Tactic.CC.Lemmas +public import Mathlib.Tactic.CC.MkProof +public import Mathlib.Tactic.CancelDenoms +public import Mathlib.Tactic.CancelDenoms.Core +public import Mathlib.Tactic.Cases +public import Mathlib.Tactic.CasesM +public import Mathlib.Tactic.CategoryTheory.BicategoricalComp +public import Mathlib.Tactic.CategoryTheory.Bicategory.Basic +public import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes +public import Mathlib.Tactic.CategoryTheory.Bicategory.Normalize +public import Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence +public import Mathlib.Tactic.CategoryTheory.BicategoryCoherence +public import Mathlib.Tactic.CategoryTheory.CheckCompositions +public import Mathlib.Tactic.CategoryTheory.Coherence +public import Mathlib.Tactic.CategoryTheory.Coherence.Basic +public import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes +public import Mathlib.Tactic.CategoryTheory.Coherence.Normalize +public import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence +public import Mathlib.Tactic.CategoryTheory.Elementwise +public import Mathlib.Tactic.CategoryTheory.IsoReassoc +public import Mathlib.Tactic.CategoryTheory.Monoidal.Basic +public import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +public import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize +public import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence +public import Mathlib.Tactic.CategoryTheory.MonoidalComp +public import Mathlib.Tactic.CategoryTheory.Reassoc +public import Mathlib.Tactic.CategoryTheory.Slice +public import Mathlib.Tactic.CategoryTheory.ToApp +public import Mathlib.Tactic.Change +public import Mathlib.Tactic.Check +public import Mathlib.Tactic.Choose +public import Mathlib.Tactic.Clean +public import Mathlib.Tactic.ClearExcept +public import Mathlib.Tactic.ClearExclamation +public import Mathlib.Tactic.Clear_ +public import Mathlib.Tactic.Coe +public import Mathlib.Tactic.Common +public import Mathlib.Tactic.ComputeDegree +public import Mathlib.Tactic.CongrExclamation +public import Mathlib.Tactic.CongrM +public import Mathlib.Tactic.Constructor +public import Mathlib.Tactic.Continuity +public import Mathlib.Tactic.Continuity.Init +public import Mathlib.Tactic.ContinuousFunctionalCalculus +public import Mathlib.Tactic.Contrapose +public import Mathlib.Tactic.Conv +public import Mathlib.Tactic.Convert +public import Mathlib.Tactic.Core +public import Mathlib.Tactic.DeclarationNames +public import Mathlib.Tactic.DefEqTransformations +public import Mathlib.Tactic.DepRewrite +public import Mathlib.Tactic.DeprecateTo +public import Mathlib.Tactic.DeriveCountable +public import Mathlib.Tactic.DeriveEncodable +public import Mathlib.Tactic.DeriveFintype +public import Mathlib.Tactic.DeriveTraversable +public import Mathlib.Tactic.ENatToNat +public import Mathlib.Tactic.Eqns +public import Mathlib.Tactic.ErwQuestion +public import Mathlib.Tactic.Eval +public import Mathlib.Tactic.ExistsI +public import Mathlib.Tactic.Explode +public import Mathlib.Tactic.Explode.Datatypes +public import Mathlib.Tactic.Explode.Pretty +public import Mathlib.Tactic.ExtendDoc +public import Mathlib.Tactic.ExtractGoal +public import Mathlib.Tactic.ExtractLets +public import Mathlib.Tactic.FBinop +public import Mathlib.Tactic.FailIfNoProgress +public import Mathlib.Tactic.FastInstance +public import Mathlib.Tactic.Field +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.FieldSimp.Attr +public import Mathlib.Tactic.FieldSimp.Discharger +public import Mathlib.Tactic.FieldSimp.Lemmas +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.Find +public import Mathlib.Tactic.FindSyntax +public import Mathlib.Tactic.Finiteness +public import Mathlib.Tactic.Finiteness.Attr +public import Mathlib.Tactic.FunProp +public import Mathlib.Tactic.FunProp.Attr +public import Mathlib.Tactic.FunProp.ContDiff +public import Mathlib.Tactic.FunProp.Core +public import Mathlib.Tactic.FunProp.Decl +public import Mathlib.Tactic.FunProp.Differentiable +public import Mathlib.Tactic.FunProp.Elab +public import Mathlib.Tactic.FunProp.FunctionData +public import Mathlib.Tactic.FunProp.Mor +public import Mathlib.Tactic.FunProp.Theorems +public import Mathlib.Tactic.FunProp.ToBatteries +public import Mathlib.Tactic.FunProp.Types +public import Mathlib.Tactic.GCongr +public import Mathlib.Tactic.GCongr.Core +public import Mathlib.Tactic.GCongr.CoreAttrs +public import Mathlib.Tactic.GCongr.ForwardAttr +public import Mathlib.Tactic.GRewrite +public import Mathlib.Tactic.GRewrite.Core +public import Mathlib.Tactic.GRewrite.Elab +public import Mathlib.Tactic.Generalize +public import Mathlib.Tactic.GeneralizeProofs +public import Mathlib.Tactic.Group +public import Mathlib.Tactic.GuardGoalNums +public import Mathlib.Tactic.GuardHypNums +public import Mathlib.Tactic.Have +public import Mathlib.Tactic.HaveI +public import Mathlib.Tactic.HigherOrder +public import Mathlib.Tactic.Hint +public import Mathlib.Tactic.ITauto +public import Mathlib.Tactic.InferParam +public import Mathlib.Tactic.Inhabit +public import Mathlib.Tactic.IntervalCases +public import Mathlib.Tactic.IrreducibleDef +public import Mathlib.Tactic.Lemma +public import Mathlib.Tactic.Lift +public import Mathlib.Tactic.LiftLets +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Linarith.Datatypes +public import Mathlib.Tactic.Linarith.Frontend +public import Mathlib.Tactic.Linarith.Lemmas +public import Mathlib.Tactic.Linarith.Oracle.FourierMotzkin +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Gauss +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector +public import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.SimplexAlgorithm +public import Mathlib.Tactic.Linarith.Parsing +public import Mathlib.Tactic.Linarith.Preprocessing +public import Mathlib.Tactic.Linarith.Verification +public import Mathlib.Tactic.LinearCombination +public import Mathlib.Tactic.LinearCombination' +public import Mathlib.Tactic.LinearCombination.Lemmas +public import Mathlib.Tactic.Linter +public import Mathlib.Tactic.Linter.CommandRanges +public import Mathlib.Tactic.Linter.CommandStart +public import Mathlib.Tactic.Linter.DeprecatedModule +public import Mathlib.Tactic.Linter.DeprecatedSyntaxLinter +public import Mathlib.Tactic.Linter.DirectoryDependency +public import Mathlib.Tactic.Linter.DocPrime +public import Mathlib.Tactic.Linter.DocString +public import Mathlib.Tactic.Linter.FindDeprecations +public import Mathlib.Tactic.Linter.FlexibleLinter +public import Mathlib.Tactic.Linter.GlobalAttributeIn +public import Mathlib.Tactic.Linter.HashCommandLinter +public import Mathlib.Tactic.Linter.HaveLetLinter +public import Mathlib.Tactic.Linter.Header +public import Mathlib.Tactic.Linter.Lint +public import Mathlib.Tactic.Linter.MinImports +public import Mathlib.Tactic.Linter.Multigoal +public import Mathlib.Tactic.Linter.OldObtain +public import Mathlib.Tactic.Linter.PPRoundtrip +public import Mathlib.Tactic.Linter.Style +public import Mathlib.Tactic.Linter.TextBased +public import Mathlib.Tactic.Linter.UnusedTactic +public import Mathlib.Tactic.Linter.UnusedTacticExtension +public import Mathlib.Tactic.Linter.UpstreamableDecl +public import Mathlib.Tactic.Linter.ValidatePRTitle +public import Mathlib.Tactic.Measurability +public import Mathlib.Tactic.Measurability.Init +public import Mathlib.Tactic.MinImports +public import Mathlib.Tactic.MkIffOfInductiveProp +public import Mathlib.Tactic.ModCases +public import Mathlib.Tactic.Module +public import Mathlib.Tactic.Monotonicity +public import Mathlib.Tactic.Monotonicity.Attr +public import Mathlib.Tactic.Monotonicity.Basic +public import Mathlib.Tactic.Monotonicity.Lemmas +public import Mathlib.Tactic.MoveAdd +public import Mathlib.Tactic.NoncommRing +public import Mathlib.Tactic.Nontriviality +public import Mathlib.Tactic.Nontriviality.Core +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.NormNum.Abs +public import Mathlib.Tactic.NormNum.Basic +public import Mathlib.Tactic.NormNum.BigOperators +public import Mathlib.Tactic.NormNum.Core +public import Mathlib.Tactic.NormNum.DivMod +public import Mathlib.Tactic.NormNum.Eq +public import Mathlib.Tactic.NormNum.GCD +public import Mathlib.Tactic.NormNum.Ineq +public import Mathlib.Tactic.NormNum.Inv +public import Mathlib.Tactic.NormNum.Irrational +public import Mathlib.Tactic.NormNum.IsCoprime +public import Mathlib.Tactic.NormNum.LegendreSymbol +public import Mathlib.Tactic.NormNum.ModEq +public import Mathlib.Tactic.NormNum.NatFactorial +public import Mathlib.Tactic.NormNum.NatFib +public import Mathlib.Tactic.NormNum.NatLog +public import Mathlib.Tactic.NormNum.NatSqrt +public import Mathlib.Tactic.NormNum.OfScientific +public import Mathlib.Tactic.NormNum.Ordinal +public import Mathlib.Tactic.NormNum.Parity +public import Mathlib.Tactic.NormNum.Pow +public import Mathlib.Tactic.NormNum.PowMod +public import Mathlib.Tactic.NormNum.Prime +public import Mathlib.Tactic.NormNum.RealSqrt +public import Mathlib.Tactic.NormNum.Result +public import Mathlib.Tactic.NthRewrite +public import Mathlib.Tactic.Observe +public import Mathlib.Tactic.OfNat +public import Mathlib.Tactic.Order +public import Mathlib.Tactic.Order.CollectFacts +public import Mathlib.Tactic.Order.Graph.Basic +public import Mathlib.Tactic.Order.Graph.Tarjan +public import Mathlib.Tactic.Order.Preprocessing +public import Mathlib.Tactic.Order.ToInt +public import Mathlib.Tactic.PNatToNat +public import Mathlib.Tactic.PPWithUniv +public import Mathlib.Tactic.Peel +public import Mathlib.Tactic.Polyrith +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Positivity.Basic +public import Mathlib.Tactic.Positivity.Core +public import Mathlib.Tactic.Positivity.Finset +public import Mathlib.Tactic.ProdAssoc +public import Mathlib.Tactic.Propose +public import Mathlib.Tactic.ProxyType +public import Mathlib.Tactic.Push +public import Mathlib.Tactic.Push.Attr +public import Mathlib.Tactic.Qify +public import Mathlib.Tactic.RSuffices +public import Mathlib.Tactic.Recall +public import Mathlib.Tactic.Recover +public import Mathlib.Tactic.ReduceModChar +public import Mathlib.Tactic.ReduceModChar.Ext +public import Mathlib.Tactic.Relation.Rfl +public import Mathlib.Tactic.Relation.Symm +public import Mathlib.Tactic.Rename +public import Mathlib.Tactic.RenameBVar +public import Mathlib.Tactic.Replace +public import Mathlib.Tactic.RewriteSearch +public import Mathlib.Tactic.Rify +public import Mathlib.Tactic.Ring +public import Mathlib.Tactic.Ring.Basic +public import Mathlib.Tactic.Ring.Compare +public import Mathlib.Tactic.Ring.NamePolyVars +public import Mathlib.Tactic.Ring.PNat +public import Mathlib.Tactic.Ring.RingNF +public import Mathlib.Tactic.Sat.FromLRAT +public import Mathlib.Tactic.Says +public import Mathlib.Tactic.ScopedNS +public import Mathlib.Tactic.Set +public import Mathlib.Tactic.SetLike +public import Mathlib.Tactic.SimpIntro +public import Mathlib.Tactic.SimpRw +public import Mathlib.Tactic.Simproc.Divisors +public import Mathlib.Tactic.Simproc.ExistsAndEq +public import Mathlib.Tactic.Simproc.Factors +public import Mathlib.Tactic.Simproc.FinsetInterval +public import Mathlib.Tactic.Simps.Basic +public import Mathlib.Tactic.Simps.NotationClass +public import Mathlib.Tactic.SplitIfs +public import Mathlib.Tactic.Spread +public import Mathlib.Tactic.StacksAttribute +public import Mathlib.Tactic.Subsingleton +public import Mathlib.Tactic.Substs +public import Mathlib.Tactic.SuccessIfFailWithMsg +public import Mathlib.Tactic.SudoSetOption +public import Mathlib.Tactic.SuppressCompilation +public import Mathlib.Tactic.SwapVar +public import Mathlib.Tactic.TFAE +public import Mathlib.Tactic.TacticAnalysis +public import Mathlib.Tactic.TacticAnalysis.Declarations +public import Mathlib.Tactic.Tauto +public import Mathlib.Tactic.TautoSet +public import Mathlib.Tactic.TermCongr +public import Mathlib.Tactic.ToAdditive +public import Mathlib.Tactic.ToDual +public import Mathlib.Tactic.ToExpr +public import Mathlib.Tactic.ToLevel +public import Mathlib.Tactic.Trace +public import Mathlib.Tactic.Translate.Core +public import Mathlib.Tactic.Translate.GuessName +public import Mathlib.Tactic.Translate.ToAdditive +public import Mathlib.Tactic.Translate.ToDual +public import Mathlib.Tactic.TryThis +public import Mathlib.Tactic.TypeCheck +public import Mathlib.Tactic.TypeStar +public import Mathlib.Tactic.UnsetOption +public import Mathlib.Tactic.Use +public import Mathlib.Tactic.Variable +public import Mathlib.Tactic.WLOG +public import Mathlib.Tactic.Widget.Calc +public import Mathlib.Tactic.Widget.CommDiag +public import Mathlib.Tactic.Widget.CongrM +public import Mathlib.Tactic.Widget.Conv +public import Mathlib.Tactic.Widget.GCongr +public import Mathlib.Tactic.Widget.InteractiveUnfold +public import Mathlib.Tactic.Widget.LibraryRewrite +public import Mathlib.Tactic.Widget.SelectInsertParamsClass +public import Mathlib.Tactic.Widget.SelectPanelUtils +public import Mathlib.Tactic.Widget.StringDiagram +public import Mathlib.Tactic.WithoutCDot +public import Mathlib.Tactic.Zify diff --git a/Mathlib/Tactic/Abel.lean b/Mathlib/Tactic/Abel.lean index 29ff497ea83d01..0d796818081efd 100644 --- a/Mathlib/Tactic/Abel.lean +++ b/Mathlib/Tactic/Abel.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison -/ -import Mathlib.Tactic.NormNum.Basic -import Mathlib.Tactic.TryThis -import Mathlib.Util.AtLocation -import Mathlib.Util.AtomM.Recurse +module + +public meta import Mathlib.Tactic.NormNum.Basic +public meta import Mathlib.Tactic.TryThis +public meta import Mathlib.Util.AtLocation +public meta import Mathlib.Util.AtomM.Recurse /-! # The `abel` tactic @@ -15,6 +17,8 @@ Evaluate expressions in the language of additive, commutative monoids and groups -/ +public meta section + -- TODO: assert_not_exists NonUnitalNonAssociativeSemiring assert_not_exists IsOrderedMonoid TopologicalSpace PseudoMetricSpace @@ -123,9 +127,9 @@ def iapp (n : Name) (xs : Array Expr) : M Expr := do return c.app (if c.isGroup then addG n else n) c.inst xs /-- A type synonym used by `abel` to represent `n • x + a` in an additive commutative monoid. -/ -def term {α} [AddCommMonoid α] (n : ℕ) (x a : α) : α := n • x + a +@[expose] def term {α} [AddCommMonoid α] (n : ℕ) (x a : α) : α := n • x + a /-- A type synonym used by `abel` to represent `n • x + a` in an additive commutative group. -/ -def termg {α} [AddCommGroup α] (n : ℤ) (x a : α) : α := n • x + a +@[expose] def termg {α} [AddCommGroup α] (n : ℤ) (x a : α) : α := n • x + a /-- Evaluate a term with coefficient `n`, atom `x` and successor terms `a`. -/ def mkTerm (n x a : Expr) : M Expr := iapp ``term #[n, x, a] @@ -238,9 +242,9 @@ def evalNeg : NormalExpr → M (NormalExpr × Expr) (← read).app ``term_neg (← read).inst #[n.1, x.2, a, n'.expr, a', ← n'.getProof, h₂]) /-- A synonym for `•`, used internally in `abel`. -/ -def smul {α} [AddCommMonoid α] (n : ℕ) (x : α) : α := n • x +@[expose] def smul {α} [AddCommMonoid α] (n : ℕ) (x : α) : α := n • x /-- A synonym for `•`, used internally in `abel`. -/ -def smulg {α} [AddCommGroup α] (n : ℤ) (x : α) : α := n • x +@[expose] def smulg {α} [AddCommGroup α] (n : ℤ) (x : α) : α := n • x theorem zero_smul {α} [AddCommMonoid α] (c) : smul c (0 : α) = 0 := by simp [smul, nsmul_zero] @@ -441,9 +445,9 @@ elab (name := abel1) "abel1" tk:"!"? : tactic => withMainContext do @[tactic_alt abel] macro (name := abel1!) "abel1!" : tactic => `(tactic| abel1 !) -theorem term_eq {α : Type*} [AddCommMonoid α] (n : ℕ) (x a : α) : term n x a = n • x + a := rfl +theorem term_eq {α : Type*} [AddCommMonoid α] (n : ℕ) (x a : α) : term n x a = n • x + a := (rfl) /-- A type synonym used by `abel` to represent `n • x + a` in an additive commutative group. -/ -theorem termg_eq {α : Type*} [AddCommGroup α] (n : ℤ) (x a : α) : termg n x a = n • x + a := rfl +theorem termg_eq {α : Type*} [AddCommGroup α] (n : ℤ) (x a : α) : termg n x a = n • x + a := (rfl) /-- True if this represents an atomic expression. -/ def NormalExpr.isAtom : NormalExpr → Bool @@ -544,4 +548,4 @@ end Mathlib.Tactic.Abel We register `abel` with the `hint` tactic. -/ -register_hint abel +register_hint 1000 abel diff --git a/Mathlib/Tactic/AdaptationNote.lean b/Mathlib/Tactic/AdaptationNote.lean index 76c6b0df66e792..e12da06a3b85a1 100644 --- a/Mathlib/Tactic/AdaptationNote.lean +++ b/Mathlib/Tactic/AdaptationNote.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Init -import Lean.Meta.Tactic.TryThis +module + +public import Mathlib.Init +public meta import Lean.Meta.Tactic.TryThis /-! # Adaptation notes @@ -15,6 +17,8 @@ has been changed to accommodate a change in Lean core. They typically require further action/maintenance to be taken in the future. -/ +public meta section + open Lean initialize registerTraceClass `adaptationNote diff --git a/Mathlib/Tactic/Algebraize.lean b/Mathlib/Tactic/Algebraize.lean index e860cd4db7d7c6..75820814228fea 100644 --- a/Mathlib/Tactic/Algebraize.lean +++ b/Mathlib/Tactic/Algebraize.lean @@ -3,8 +3,9 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Nick Kuhn, Arend Mellendijk, Christian Merten, Calle Sönne, Adam Topaz -/ +module -import Mathlib.Algebra.Algebra.Tower +public meta import Mathlib.Algebra.Algebra.Tower /-! @@ -71,6 +72,8 @@ To avoid searching through the local context and adding corresponding `Algebra` `algebraize_only` which only adds `Algebra` and `IsScalarTower` instances. -/ +public meta section + open Lean Elab Tactic Term Meta namespace Lean.Attr diff --git a/Mathlib/Tactic/ApplyAt.lean b/Mathlib/Tactic/ApplyAt.lean index c7f3b02ef297dc..5665587cc1ba00 100644 --- a/Mathlib/Tactic/ApplyAt.lean +++ b/Mathlib/Tactic/ApplyAt.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ -import Lean.Elab.Tactic.ElabTerm -import Mathlib.Lean.Meta.Basic +module + +public meta import Lean.Elab.Tactic.ElabTerm +public meta import Mathlib.Lean.Meta.Basic /-! # Apply at @@ -12,6 +14,8 @@ import Mathlib.Lean.Meta.Basic A tactic for applying functions at hypotheses. -/ +public meta section + open Lean Meta Elab Tactic Term namespace Mathlib.Tactic diff --git a/Mathlib/Tactic/ApplyCongr.lean b/Mathlib/Tactic/ApplyCongr.lean index fa9ab51db58edc..aca51f4378011a 100644 --- a/Mathlib/Tactic/ApplyCongr.lean +++ b/Mathlib/Tactic/ApplyCongr.lean @@ -3,8 +3,9 @@ Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lucas Allen, Kim Morrison -/ +module -import Mathlib.Tactic.Conv +public meta import Mathlib.Tactic.Conv /-! ## Introduce the `apply_congr` conv mode tactic. @@ -15,6 +16,8 @@ are not of the optimal shape. An example, described in the doc-string is rewriting inside the operand of a `Finset.sum`. -/ +public meta section + open Lean Expr Parser.Tactic Elab Command Elab.Tactic Meta Conv /-- diff --git a/Mathlib/Tactic/ApplyFun.lean b/Mathlib/Tactic/ApplyFun.lean index 728a8131cb44bf..ce759a78287a2a 100644 --- a/Mathlib/Tactic/ApplyFun.lean +++ b/Mathlib/Tactic/ApplyFun.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Keeley Hoek, Patrick Massot, Kim Morrison -/ -import Mathlib.Lean.Expr.Basic -import Mathlib.Order.Monotone.Basic -import Mathlib.Order.Hom.Basic +module + +public meta import Mathlib.Lean.Expr.Basic +public meta import Mathlib.Order.Monotone.Basic +public meta import Mathlib.Order.Hom.Basic /-! # The `apply_fun` tactic. @@ -17,6 +19,8 @@ Apply a function to an equality or inequality in either a local hypothesis or th Using the `mono` tactic, we can attempt to automatically discharge `Monotone f` goals. -/ +public meta section + namespace Mathlib.Tactic open Lean Parser Elab Tactic Meta @@ -31,7 +35,7 @@ def applyFunHyp (f : Term) (using? : Option Term) (h : FVarId) (g : MVarId) : | (``Eq, #[_, lhs, rhs]) => do let (eq', gs) ← withCollectingNewGoalsFrom (parentTag := ← g.getTag) (tagSuffix := `apply_fun) <| - withoutRecover <| runTermElab <| do + withoutRecover <| runTermElab do let f ← Term.elabTerm f none let lhs' ← Term.elabAppArgs f #[] #[.expr lhs] none false false let rhs' ← Term.elabAppArgs f #[] #[.expr rhs] none false false diff --git a/Mathlib/Tactic/ApplyWith.lean b/Mathlib/Tactic/ApplyWith.lean index c4ddb7097accc6..da8ef287ec695c 100644 --- a/Mathlib/Tactic/ApplyWith.lean +++ b/Mathlib/Tactic/ApplyWith.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Init -import Lean.Elab.Eval -import Lean.Elab.Tactic.ElabTerm +module + +public import Mathlib.Init +public meta import Lean.Elab.Eval +public meta import Lean.Elab.Tactic.ElabTerm /-! # The `applyWith` tactic @@ -13,6 +15,8 @@ The `applyWith` tactic is like `apply`, but allows passing a custom configuratio `apply` operation. -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Tactic Term diff --git a/Mathlib/Tactic/ArithMult.lean b/Mathlib/Tactic/ArithMult.lean index c2e5f0530ec2df..3b8b421fb51040 100644 --- a/Mathlib/Tactic/ArithMult.lean +++ b/Mathlib/Tactic/ArithMult.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Arend Mellendijk. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ +module -import Mathlib.Tactic.Basic -import Mathlib.Tactic.ArithMult.Init +public meta import Mathlib.Tactic.Basic +public meta import Mathlib.Tactic.ArithMult.Init /-! # Multiplicativity @@ -14,6 +15,8 @@ We define the arith_mult tactic using aesop -/ +public meta section + namespace ArithmeticFunction /-- diff --git a/Mathlib/Tactic/ArithMult/Init.lean b/Mathlib/Tactic/ArithMult/Init.lean index 40a20040c7bdc1..5ee1bf5b41e21f 100644 --- a/Mathlib/Tactic/ArithMult/Init.lean +++ b/Mathlib/Tactic/ArithMult/Init.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Arend Mellendijk. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ +module -import Mathlib.Init -import Aesop +public import Mathlib.Init +public meta import Aesop /-! # arith_mult Rule Set @@ -15,4 +16,6 @@ This module defines the `IsMultiplicative` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ +public meta section + declare_aesop_rule_sets [IsMultiplicative] diff --git a/Mathlib/Tactic/Attr/Core.lean b/Mathlib/Tactic/Attr/Core.lean index 6ff6bce6b64884..7acae3f4294b8d 100644 --- a/Mathlib/Tactic/Attr/Core.lean +++ b/Mathlib/Tactic/Attr/Core.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Tactic.Attr.Register +module + +public meta import Mathlib.Tactic.Attr.Register /-! # Simp tags for core lemmas @@ -13,6 +15,8 @@ declare all `simp` attributes used in `Mathlib` in `Mathlib/Tactic/Attr/Register from the core library and the `Batteries` library with these attributes in this file. -/ +public meta section + attribute [simp] id_map' attribute [functor_norm, monad_norm] seq_assoc pure_seq pure_bind bind_assoc bind_pure map_pure attribute [monad_norm] seq_eq_bind_map diff --git a/Mathlib/Tactic/Attr/Register.lean b/Mathlib/Tactic/Attr/Register.lean index e3651d8091c29a..ad1348e2b911ff 100644 --- a/Mathlib/Tactic/Attr/Register.lean +++ b/Mathlib/Tactic/Attr/Register.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Init -import Lean.Meta.Tactic.Simp.SimpTheorems -import Lean.Meta.Tactic.Simp.RegisterCommand -import Lean.LabelAttribute +module + +public import Mathlib.Init +public meta import Lean.Meta.Tactic.Simp.SimpTheorems +public meta import Lean.Meta.Tactic.Simp.RegisterCommand +public meta import Lean.LabelAttribute /-! # Attributes used in `Mathlib` @@ -18,6 +20,8 @@ of them in one file for two reasons: - this way it is easy to see which simp sets contain a given lemma. -/ +public meta section + /-- Simp set for `functor_norm` -/ register_simp_attr functor_norm diff --git a/Mathlib/Tactic/Basic.lean b/Mathlib/Tactic/Basic.lean index 8e243dc23504f4..d336e9cc1a784d 100644 --- a/Mathlib/Tactic/Basic.lean +++ b/Mathlib/Tactic/Basic.lean @@ -3,13 +3,15 @@ Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kyle Miller -/ -import Lean -import Mathlib.Tactic.PPWithUniv -import Mathlib.Tactic.ExtendDoc -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.TypeStar -import Mathlib.Tactic.Linter.OldObtain -import Mathlib.Tactic.Simproc.ExistsAndEq +module + +public meta import Lean +public meta import Mathlib.Tactic.PPWithUniv +public meta import Mathlib.Tactic.ExtendDoc +public meta import Mathlib.Tactic.Lemma +public meta import Mathlib.Tactic.TypeStar +public meta import Mathlib.Tactic.Linter.OldObtain +public meta import Mathlib.Tactic.Simproc.ExistsAndEq /-! # Basic tactics and utilities for tactic writing @@ -23,6 +25,8 @@ and explicitly name the non-dependent hypotheses, context). -/ +public meta section + namespace Mathlib.Tactic open Lean Parser.Tactic Elab Command Elab.Tactic Meta @@ -155,7 +159,7 @@ def withResetServerInfo {α : Type} (t : TacticM α) : end Mathlib.Tactic /-- A mathlib library note: the note's content should be contained in its doc-string. -/ -def LibraryNote := Unit +@[expose] def LibraryNote := Unit open Lean in /-- `library_note2 «my note» /-- documentation -/` creates a library note named `my note` diff --git a/Mathlib/Tactic/Bound.lean b/Mathlib/Tactic/Bound.lean index 60b0bc685682d2..1af6f0e34005f2 100644 --- a/Mathlib/Tactic/Bound.lean +++ b/Mathlib/Tactic/Bound.lean @@ -3,12 +3,13 @@ Copyright (c) 2024 Geoffrey Irving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Geoffrey Irving -/ +module -import Aesop -import Mathlib.Tactic.Bound.Attribute -import Mathlib.Tactic.Lemma -import Mathlib.Tactic.Linarith.Frontend -import Mathlib.Tactic.NormNum.Core +public meta import Aesop +public meta import Mathlib.Tactic.Bound.Attribute +public meta import Mathlib.Tactic.Lemma +public meta import Mathlib.Tactic.Linarith.Frontend +public meta import Mathlib.Tactic.NormNum.Core /-! ## The `bound` tactic @@ -86,6 +87,8 @@ Currently the two types of guessing rules are We close numerical goals with `norm_num` and `linarith`. -/ +public meta section + open Lean Elab Meta Term Mathlib.Tactic Syntax open Lean.Elab.Tactic (liftMetaTactic liftMetaTactic' TacticM getMainGoal) @@ -254,4 +257,4 @@ macro_rules We register `bound` with the `hint` tactic. -/ -register_hint bound +register_hint 70 bound diff --git a/Mathlib/Tactic/Bound/Attribute.lean b/Mathlib/Tactic/Bound/Attribute.lean index fcda67073f97ad..5bd83e5f9a2713 100644 --- a/Mathlib/Tactic/Bound/Attribute.lean +++ b/Mathlib/Tactic/Bound/Attribute.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Geoffrey Irving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Geoffrey Irving -/ -import Mathlib.Tactic.Bound.Init -import Qq -import Aesop +module + +public meta import Mathlib.Tactic.Bound.Init +public meta import Qq +public meta import Aesop /-! # The `bound` attribute @@ -15,6 +17,8 @@ converting it to either `norm apply` or `safe apply `. The classifica on the number and types of the lemma's hypotheses. -/ +public meta section + open Lean (MetaM) open Qq diff --git a/Mathlib/Tactic/Bound/Init.lean b/Mathlib/Tactic/Bound/Init.lean index 5ca4a86975928f..b875f955d659b4 100644 --- a/Mathlib/Tactic/Bound/Init.lean +++ b/Mathlib/Tactic/Bound/Init.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Geoffrey Irving. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Geoffrey Irving -/ +module -import Mathlib.Init -import Aesop.Frontend.Command +public import Mathlib.Init +public meta import Aesop.Frontend.Command /-! # Bound Rule Set @@ -15,4 +16,6 @@ This module defines the `Bound` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ +public meta section + declare_aesop_rule_sets [Bound] diff --git a/Mathlib/Tactic/ByCases.lean b/Mathlib/Tactic/ByCases.lean index 6b2ebb51237671..75fd3d9a0b2875 100644 --- a/Mathlib/Tactic/ByCases.lean +++ b/Mathlib/Tactic/ByCases.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Jovan Gerbscheid. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jovan Gerbscheid -/ -import Mathlib.Tactic.Push -import Batteries.Tactic.PermuteGoals +module + +public meta import Mathlib.Tactic.Push +public meta import Batteries.Tactic.PermuteGoals /-! # The `by_cases!` tactic @@ -13,6 +15,8 @@ The `by_cases!` tactic is a variant of the `by_cases` tactic that also calls `pu on the generated hypothesis that is a negation. -/ +public meta section + /-- `by_cases! h : p` runs the `by_cases h : p` tactic, followed by `try push_neg at h` in the second subgoal. For example, diff --git a/Mathlib/Tactic/ByContra.lean b/Mathlib/Tactic/ByContra.lean index c04034caa40f4e..16f921a856a2a2 100644 --- a/Mathlib/Tactic/ByContra.lean +++ b/Mathlib/Tactic/ByContra.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kevin Buzzard -/ -import Batteries.Tactic.Init -import Mathlib.Tactic.Push +module + +public meta import Batteries.Tactic.Init +public meta import Mathlib.Tactic.Push /-! # The `by_contra` tactic @@ -12,6 +14,8 @@ import Mathlib.Tactic.Push The `by_contra!` tactic is a variant of the `by_contra` tactic, for proofs of contradiction. -/ +public meta section + open Lean Lean.Parser Parser.Tactic Elab Command Elab.Tactic Meta /-- diff --git a/Mathlib/Tactic/CC.lean b/Mathlib/Tactic/CC.lean index 4183ce0d9dda7a..ad9956ea3afbd5 100644 --- a/Mathlib/Tactic/CC.lean +++ b/Mathlib/Tactic/CC.lean @@ -3,7 +3,9 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Miyahara Kō -/ -import Mathlib.Tactic.CC.Addition +module + +public meta import Mathlib.Tactic.CC.Addition /-! # Congruence closure @@ -49,6 +51,8 @@ derives `a = b` from `Nat.succ a = Nat.succ b`, and `Nat.succ a != Nat.zero` for (de Moura, Selsam IJCAR 2016). -/ +public meta section + universe u open Lean Meta Elab Tactic Std diff --git a/Mathlib/Tactic/CC/Addition.lean b/Mathlib/Tactic/CC/Addition.lean index 0d9b38f8d28448..e05900c15cc066 100644 --- a/Mathlib/Tactic/CC/Addition.lean +++ b/Mathlib/Tactic/CC/Addition.lean @@ -3,13 +3,17 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Miyahara Kō -/ -import Mathlib.Data.Option.Defs -import Mathlib.Tactic.CC.MkProof +module + +public meta import Mathlib.Data.Option.Defs +public meta import Mathlib.Tactic.CC.MkProof /-! # Process when an new equation is added to a congruence closure -/ +public meta section + universe u open Lean Meta Elab Tactic Std MessageData diff --git a/Mathlib/Tactic/CC/Datatypes.lean b/Mathlib/Tactic/CC/Datatypes.lean index 1495978c61d66d..a292a88cda35f5 100644 --- a/Mathlib/Tactic/CC/Datatypes.lean +++ b/Mathlib/Tactic/CC/Datatypes.lean @@ -3,10 +3,12 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Miyahara Kō -/ -import Batteries.Classes.Order -import Mathlib.Lean.Meta.Basic -import Mathlib.Lean.Meta.CongrTheorems -import Mathlib.Data.Ordering.Basic +module + +public meta import Batteries.Classes.Order +public meta import Mathlib.Lean.Meta.Basic +public meta import Mathlib.Lean.Meta.CongrTheorems +public meta import Mathlib.Data.Ordering.Basic /-! # Datatypes for `cc` @@ -19,6 +21,8 @@ We split them into their own file. This file is ported from C++ code, so many declarations lack documents. -/ +public meta section + universe u open Lean Meta Elab Tactic diff --git a/Mathlib/Tactic/CC/Lemmas.lean b/Mathlib/Tactic/CC/Lemmas.lean index a40559b28441f8..300571b8f7f7c2 100644 --- a/Mathlib/Tactic/CC/Lemmas.lean +++ b/Mathlib/Tactic/CC/Lemmas.lean @@ -3,11 +3,14 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ +module -import Mathlib.Init +public import Mathlib.Init /-! Lemmas use by the congruence closure module -/ +public meta section + namespace Mathlib.Tactic.CC theorem iff_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ↔ b) = b := diff --git a/Mathlib/Tactic/CC/MkProof.lean b/Mathlib/Tactic/CC/MkProof.lean index 70d8c8881bf43d..8442a512a5e746 100644 --- a/Mathlib/Tactic/CC/MkProof.lean +++ b/Mathlib/Tactic/CC/MkProof.lean @@ -3,15 +3,19 @@ Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Miyahara Kō -/ -import Mathlib.Tactic.CC.Datatypes -import Mathlib.Tactic.CC.Lemmas -import Mathlib.Tactic.Relation.Rfl -import Mathlib.Tactic.Relation.Symm +module + +public meta import Mathlib.Tactic.CC.Datatypes +public meta import Mathlib.Tactic.CC.Lemmas +public meta import Mathlib.Tactic.Relation.Rfl +public meta import Mathlib.Tactic.Relation.Symm /-! # Make proofs from a congruence closure -/ +public meta section + open Lean Meta Elab Tactic Std namespace Mathlib.Tactic.CC diff --git a/Mathlib/Tactic/CancelDenoms.lean b/Mathlib/Tactic/CancelDenoms.lean index a6da4ed45a5587..31a8a82de48b87 100644 --- a/Mathlib/Tactic/CancelDenoms.lean +++ b/Mathlib/Tactic/CancelDenoms.lean @@ -1,2 +1,4 @@ -import Mathlib.Tactic.CancelDenoms.Core -import Mathlib.Tactic.NormNum.Ineq +module + +public meta import Mathlib.Tactic.CancelDenoms.Core +public meta import Mathlib.Tactic.NormNum.Ineq diff --git a/Mathlib/Tactic/CancelDenoms/Core.lean b/Mathlib/Tactic/CancelDenoms/Core.lean index 8d103d557f6949..6b3db15aa2aeca 100644 --- a/Mathlib/Tactic/CancelDenoms/Core.lean +++ b/Mathlib/Tactic/CancelDenoms/Core.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Algebra.Field.Basic -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Data.Tree.Basic -import Mathlib.Logic.Basic -import Mathlib.Tactic.NormNum.Core -import Mathlib.Util.SynthesizeUsing -import Mathlib.Util.Qq +module + +public meta import Mathlib.Algebra.Field.Basic +public meta import Mathlib.Algebra.Order.Ring.Defs +public meta import Mathlib.Data.Tree.Basic +public meta import Mathlib.Logic.Basic +public meta import Mathlib.Tactic.NormNum.Core +public meta import Mathlib.Util.SynthesizeUsing +public meta import Mathlib.Util.Qq /-! # A tactic for canceling numeric denominators @@ -28,6 +30,8 @@ There are likely some rough edges to it. Improving this tactic would be a good project for someone interested in learning tactic programming. -/ +public meta section + open Lean Parser Tactic Mathlib Meta NormNum Qq initialize registerTraceClass `CancelDenoms diff --git a/Mathlib/Tactic/Cases.lean b/Mathlib/Tactic/Cases.lean index e7033a08c5cc74..4cc8d1b2d958fc 100644 --- a/Mathlib/Tactic/Cases.lean +++ b/Mathlib/Tactic/Cases.lean @@ -3,11 +3,14 @@ Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Lean.Elab.Tactic.Induction -import Batteries.Tactic.OpenPrivate -import Batteries.Data.List.Basic -import Batteries.Lean.Expr -import Mathlib.Init +module + +public meta import Lean.Elab.Tactic.Induction +public meta import Batteries.Tactic.OpenPrivate +public meta import Batteries.Data.List.Basic +public meta import Batteries.Lean.Expr +public meta import Mathlib.Init +import all Lean.Elab.Tactic.Induction /-! # Backward compatible implementation of lean 3 `cases` tactic @@ -35,6 +38,8 @@ example (h : p ∨ q) : q ∨ p := by Prefer `cases` or `rcases` when possible, because these tactics promote structured proofs. -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Elab.Tactic @@ -68,7 +73,6 @@ def ElimApp.evalNames (elimInfo : ElimInfo) (alts : Array ElimApp.Alt) (withArg subgoals := subgoals.push g pure subgoals -open private getElimNameInfo generalizeTargets generalizeVars from Lean.Elab.Tactic.Induction /-- The `induction'` tactic is similar to the `induction` tactic in Lean 4 core, but with slightly different syntax (such as, no requirement to name the constructors). diff --git a/Mathlib/Tactic/CasesM.lean b/Mathlib/Tactic/CasesM.lean index cbd7fc43fd2e4f..4759fe8ca41569 100644 --- a/Mathlib/Tactic/CasesM.lean +++ b/Mathlib/Tactic/CasesM.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Mathlib.Init -import Lean.Elab.Tactic.Conv.Pattern +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Conv.Pattern /-! # `casesm`, `cases_type`, `constructorm` tactics @@ -12,6 +14,8 @@ import Lean.Elab.Tactic.Conv.Pattern These tactics implement repeated `cases` / `constructor` on anything satisfying a predicate. -/ +public meta section + namespace Lean.MVarId /-- diff --git a/Mathlib/Tactic/CategoryTheory/BicategoricalComp.lean b/Mathlib/Tactic/CategoryTheory/BicategoricalComp.lean index a43d5c5ea901b9..63fafcc81bbb49 100644 --- a/Mathlib/Tactic/CategoryTheory/BicategoricalComp.lean +++ b/Mathlib/Tactic/CategoryTheory/BicategoricalComp.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Basic +module + +public import Mathlib.CategoryTheory.Bicategory.Basic /-! # Bicategorical composition `⊗≫` (composition up to associators) @@ -13,6 +15,8 @@ which automatically inserts associators and unitors as needed to make the target of `f` match the source of `g`. -/ +@[expose] public section + universe w v u open CategoryTheory Bicategory diff --git a/Mathlib/Tactic/CategoryTheory/Bicategory/Basic.lean b/Mathlib/Tactic/CategoryTheory/Bicategory/Basic.lean index c5c2b1211b67f9..16721dca792912 100644 --- a/Mathlib/Tactic/CategoryTheory/Bicategory/Basic.lean +++ b/Mathlib/Tactic/CategoryTheory/Bicategory/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Basic -import Mathlib.Tactic.CategoryTheory.Bicategory.Normalize -import Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Basic +public meta import Mathlib.Tactic.CategoryTheory.Bicategory.Normalize +public meta import Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence /-! # `bicategory` tactic @@ -22,6 +24,8 @@ implementation. -/ +public meta section + open Lean Meta Elab Tactic open CategoryTheory Mathlib.Tactic.BicategoryLike diff --git a/Mathlib/Tactic/CategoryTheory/Bicategory/Datatypes.lean b/Mathlib/Tactic/CategoryTheory/Bicategory/Datatypes.lean index 612f243911df1b..ba2969d571dfbd 100644 --- a/Mathlib/Tactic/CategoryTheory/Bicategory/Datatypes.lean +++ b/Mathlib/Tactic/CategoryTheory/Bicategory/Datatypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes -import Mathlib.Tactic.CategoryTheory.BicategoricalComp +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes +public meta import Mathlib.Tactic.CategoryTheory.BicategoricalComp /-! # Expressions for bicategories @@ -15,6 +17,8 @@ widgets. -/ +public meta section + open Lean Meta Elab Qq open CategoryTheory Mathlib.Tactic.BicategoryLike Bicategory diff --git a/Mathlib/Tactic/CategoryTheory/Bicategory/Normalize.lean b/Mathlib/Tactic/CategoryTheory/Bicategory/Normalize.lean index 3e5b649bce64a3..ddaaa93a025bf6 100644 --- a/Mathlib/Tactic/CategoryTheory/Bicategory/Normalize.lean +++ b/Mathlib/Tactic/CategoryTheory/Bicategory/Normalize.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Normalize -import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Normalize +public meta import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes /-! # Normalization of 2-morphisms in bicategories @@ -14,6 +16,8 @@ This file provides the implementation of the normalization given in -/ +public meta section + open Lean Meta Elab Qq open CategoryTheory Mathlib.Tactic.BicategoryLike Bicategory diff --git a/Mathlib/Tactic/CategoryTheory/Bicategory/PureCoherence.lean b/Mathlib/Tactic/CategoryTheory/Bicategory/PureCoherence.lean index b7d5b211a04788..5e79c4b2a8e803 100644 --- a/Mathlib/Tactic/CategoryTheory/Bicategory/PureCoherence.lean +++ b/Mathlib/Tactic/CategoryTheory/Bicategory/PureCoherence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence -import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence +public meta import Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes /-! # Coherence tactic for bicategories @@ -16,6 +18,8 @@ are equal. -/ +public meta section + open Lean Meta Elab Qq open CategoryTheory Mathlib.Tactic.BicategoryLike Bicategory diff --git a/Mathlib/Tactic/CategoryTheory/BicategoryCoherence.lean b/Mathlib/Tactic/CategoryTheory/BicategoryCoherence.lean index a19b539a551fb4..bbba77a8a17f39 100644 --- a/Mathlib/Tactic/CategoryTheory/BicategoryCoherence.lean +++ b/Mathlib/Tactic/CategoryTheory/BicategoryCoherence.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.CategoryTheory.Bicategory.Coherence -import Mathlib.Tactic.CategoryTheory.BicategoricalComp +module + +public meta import Mathlib.CategoryTheory.Bicategory.Coherence +public meta import Mathlib.Tactic.CategoryTheory.BicategoricalComp /-! # A `coherence` tactic for bicategories @@ -19,6 +21,8 @@ tactic is given in `Mathlib/Tactic/CategoryTheory/Coherence.lean` at the same ti tactic for monoidal categories. -/ +public meta section + noncomputable section universe w v u diff --git a/Mathlib/Tactic/CategoryTheory/CheckCompositions.lean b/Mathlib/Tactic/CategoryTheory/CheckCompositions.lean index bbcd4cddd36002..511fc415d06a60 100644 --- a/Mathlib/Tactic/CategoryTheory/CheckCompositions.lean +++ b/Mathlib/Tactic/CategoryTheory/CheckCompositions.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Category.Basic +module + +public meta import Mathlib.CategoryTheory.Category.Basic /-! The `check_compositions` tactic, @@ -16,6 +18,8 @@ although typically `simp` should reduce rather than increase the reported discre `check_compositions` may be useful in diagnosing uses of `erw` in the category theory library. -/ +public meta section + namespace Mathlib.Tactic.CheckCompositions open CategoryTheory diff --git a/Mathlib/Tactic/CategoryTheory/Coherence.lean b/Mathlib/Tactic/CategoryTheory/Coherence.lean index b50af54fa42f90..48da57eb5d938d 100644 --- a/Mathlib/Tactic/CategoryTheory/Coherence.lean +++ b/Mathlib/Tactic/CategoryTheory/Coherence.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Yuma Mizuno, Oleksandr Manzyuk -/ -import Mathlib.CategoryTheory.Monoidal.Free.Coherence -import Mathlib.Lean.Meta -import Mathlib.Tactic.CategoryTheory.BicategoryCoherence -import Mathlib.Tactic.CategoryTheory.MonoidalComp +module + +public meta import Mathlib.CategoryTheory.Monoidal.Free.Coherence +public meta import Mathlib.Lean.Meta +public meta import Mathlib.Tactic.CategoryTheory.BicategoryCoherence +public meta import Mathlib.Tactic.CategoryTheory.MonoidalComp /-! # A `coherence` tactic for monoidal categories @@ -23,6 +25,8 @@ are equal. -/ +public meta section + universe v u open CategoryTheory FreeMonoidalCategory diff --git a/Mathlib/Tactic/CategoryTheory/Coherence/Basic.lean b/Mathlib/Tactic/CategoryTheory/Coherence/Basic.lean index d2fcba2a85939e..b6473663dd4cda 100644 --- a/Mathlib/Tactic/CategoryTheory/Coherence/Basic.lean +++ b/Mathlib/Tactic/CategoryTheory/Coherence/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Normalize -import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence -import Mathlib.CategoryTheory.Category.Basic +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Normalize +public meta import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence +public meta import Mathlib.CategoryTheory.Category.Basic /-! # The Core function for `monoidal` and `bicategory` tactics @@ -21,6 +23,8 @@ It closes the goal at non-structural parts with `rfl` and the goal at structural -/ +public meta section + open Lean Meta Elab open CategoryTheory Mathlib.Tactic.BicategoryLike diff --git a/Mathlib/Tactic/CategoryTheory/Coherence/Datatypes.lean b/Mathlib/Tactic/CategoryTheory/Coherence/Datatypes.lean index fd8ae0077f8915..5cda3bcba3bb5f 100644 --- a/Mathlib/Tactic/CategoryTheory/Coherence/Datatypes.lean +++ b/Mathlib/Tactic/CategoryTheory/Coherence/Datatypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Lean.Meta.Basic -import Mathlib.Init +module + +public meta import Lean.Meta.Basic +public import Mathlib.Init /-! # Datatypes for bicategory like structures @@ -34,6 +36,8 @@ composition `η ≫ θ` of 2-morphisms `η` and `θ` in the monad `m`. -/ +public meta section + open Lean Meta namespace Mathlib.Tactic diff --git a/Mathlib/Tactic/CategoryTheory/Coherence/Normalize.lean b/Mathlib/Tactic/CategoryTheory/Coherence/Normalize.lean index e8cc1f74df951d..2e08f1b772e9bd 100644 --- a/Mathlib/Tactic/CategoryTheory/Coherence/Normalize.lean +++ b/Mathlib/Tactic/CategoryTheory/Coherence/Normalize.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Lean.Meta.AppBuilder -import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes +module + +public meta import Lean.Meta.AppBuilder +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes /-! # Normalization of 2-morphisms in bicategories @@ -58,6 +60,8 @@ and `pf` is a proof that `e = e'`. -/ +public meta section + open Lean Meta namespace Mathlib.Tactic.BicategoryLike diff --git a/Mathlib/Tactic/CategoryTheory/Coherence/PureCoherence.lean b/Mathlib/Tactic/CategoryTheory/Coherence/PureCoherence.lean index b5894a43e0fb26..f5cc3791f24ea0 100644 --- a/Mathlib/Tactic/CategoryTheory/Coherence/PureCoherence.lean +++ b/Mathlib/Tactic/CategoryTheory/Coherence/PureCoherence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Lean.Meta.Tactic.Apply -import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes +module + +public meta import Lean.Meta.Tactic.Apply +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes /-! # Coherence tactic @@ -25,6 +27,8 @@ The actual tactics that users will use are given in -/ +public meta section + open Lean Meta namespace Mathlib.Tactic diff --git a/Mathlib/Tactic/CategoryTheory/Elementwise.lean b/Mathlib/Tactic/CategoryTheory/Elementwise.lean index 15b0d5b0563b95..d6476ed50813ec 100644 --- a/Mathlib/Tactic/CategoryTheory/Elementwise.lean +++ b/Mathlib/Tactic/CategoryTheory/Elementwise.lean @@ -3,10 +3,11 @@ Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Kyle Miller -/ +module -import Mathlib.CategoryTheory.ConcreteCategory.Basic -import Mathlib.Util.AddRelatedDecl -import Batteries.Tactic.Lint +public meta import Mathlib.CategoryTheory.ConcreteCategory.Basic +public meta import Mathlib.Util.AddRelatedDecl +public meta import Batteries.Tactic.Lint /-! # Tools to reformulate category-theoretic lemmas in concrete categories @@ -24,7 +25,7 @@ For more details, see the documentation attached to the `syntax` declaration. - The `@[elementwise]` attribute. -- The ``elementwise_of% h` term elaborator. +- The `elementwise_of% h` term elaborator. ## Implementation @@ -32,6 +33,8 @@ This closely follows the implementation of the `@[reassoc]` attribute, due to Si reimplemented by Kim Morrison in Lean 4. -/ +public meta section + open Lean Meta Elab Tactic open Mathlib.Tactic @@ -82,11 +85,11 @@ for the first universe parameter to `HasForget`. The `simpSides` option controls whether to simplify both sides of the equality, for simpNF purposes. -/ -def elementwiseExpr (src : Name) (type pf : Expr) (simpSides := true) : +def elementwiseExpr (src : Name) (pf : Expr) (simpSides := true) : MetaM (Expr × Option (Level × Level)) := do - let type := (← instantiateMVars type).cleanupAnnotations + let type := (← instantiateMVars (← inferType pf)).cleanupAnnotations forallTelescope type fun fvars type' => do - mkHomElementwise type' (← mkExpectedTypeHint (mkAppN pf fvars) type') fun eqPf instConcr? => do + mkHomElementwise type' (mkAppN pf fvars) fun eqPf instConcr? => do -- First simplify using elementwise-specific lemmas let mut eqPf' ← simpType (simpOnlyNames elementwiseThms (config := { decide := false })) eqPf if (← inferType eqPf') == .const ``True [] then @@ -213,8 +216,8 @@ initialize registerBuiltinAttribute { | `(attr| elementwise $[nosimp%$nosimp?]? $[(attr := $stx?,*)]?) => MetaM.run' do if (kind != AttributeKind.global) then throwError "`elementwise` can only be used as a global attribute" - addRelatedDecl src "_apply" ref stx? fun type value levels => do - let (newValue, level?) ← elementwiseExpr src type value (simpSides := nosimp?.isNone) + addRelatedDecl src "_apply" ref stx? fun value levels => do + let (newValue, level?) ← elementwiseExpr src value (simpSides := nosimp?.isNone) let newLevels ← if let some (levelW, levelUF) := level? then do let w := mkUnusedName levels `w let uF := mkUnusedName levels `uF @@ -252,7 +255,7 @@ normal form. `elementwise_of%` does not do this. -/ elab "elementwise_of% " t:term : term => do let e ← Term.elabTerm t none - let (pf, _) ← elementwiseExpr .anonymous (← inferType e) e (simpSides := false) + let (pf, _) ← elementwiseExpr .anonymous e (simpSides := false) return pf -- TODO: elementwise tactic diff --git a/Mathlib/Tactic/CategoryTheory/IsoReassoc.lean b/Mathlib/Tactic/CategoryTheory/IsoReassoc.lean index 20bd843efeba4f..23ffc92a0a8366 100644 --- a/Mathlib/Tactic/CategoryTheory/IsoReassoc.lean +++ b/Mathlib/Tactic/CategoryTheory/IsoReassoc.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Robin Carlier. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robin Carlier -/ -import Mathlib.CategoryTheory.Iso +module + +public meta import Mathlib.CategoryTheory.Iso /-! # Extension of `reassoc` to isomorphisms. @@ -20,6 +22,8 @@ This is useful for generating lemmas which the simplifier can use even on expres that are already right associated. -/ +public meta section + open Lean Meta Elab Tactic open Mathlib.Tactic diff --git a/Mathlib/Tactic/CategoryTheory/Monoidal/Basic.lean b/Mathlib/Tactic/CategoryTheory/Monoidal/Basic.lean index 15de5b9574ea68..e0015cc981f997 100644 --- a/Mathlib/Tactic/CategoryTheory/Monoidal/Basic.lean +++ b/Mathlib/Tactic/CategoryTheory/Monoidal/Basic.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Basic -import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize -import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Basic +public meta import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize +public meta import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence /-! # `monoidal` tactic @@ -22,6 +24,8 @@ implementation. -/ +public meta section + open Lean Meta Elab Tactic open CategoryTheory Mathlib.Tactic.BicategoryLike diff --git a/Mathlib/Tactic/CategoryTheory/Monoidal/Datatypes.lean b/Mathlib/Tactic/CategoryTheory/Monoidal/Datatypes.lean index b3639324ac9e24..31b7df8ef95268 100644 --- a/Mathlib/Tactic/CategoryTheory/Monoidal/Datatypes.lean +++ b/Mathlib/Tactic/CategoryTheory/Monoidal/Datatypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes -import Mathlib.Tactic.CategoryTheory.MonoidalComp +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Datatypes +public meta import Mathlib.Tactic.CategoryTheory.MonoidalComp /-! # Expressions for monoidal categories @@ -15,6 +17,8 @@ widgets. -/ +public meta section + open Lean Meta Elab Qq open CategoryTheory Mathlib.Tactic.BicategoryLike MonoidalCategory diff --git a/Mathlib/Tactic/CategoryTheory/Monoidal/Normalize.lean b/Mathlib/Tactic/CategoryTheory/Monoidal/Normalize.lean index e99cdb8bb70b83..0b450ab1b714f7 100644 --- a/Mathlib/Tactic/CategoryTheory/Monoidal/Normalize.lean +++ b/Mathlib/Tactic/CategoryTheory/Monoidal/Normalize.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.Normalize -import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.Normalize +public meta import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes /-! # Normalization of morphisms in monoidal categories @@ -14,6 +16,8 @@ This file provides the implementation of the normalization given in -/ +public meta section + open Lean Meta Elab Qq open CategoryTheory Mathlib.Tactic.BicategoryLike MonoidalCategory diff --git a/Mathlib/Tactic/CategoryTheory/Monoidal/PureCoherence.lean b/Mathlib/Tactic/CategoryTheory/Monoidal/PureCoherence.lean index 0e07bf8959f440..7173ce461112bf 100644 --- a/Mathlib/Tactic/CategoryTheory/Monoidal/PureCoherence.lean +++ b/Mathlib/Tactic/CategoryTheory/Monoidal/PureCoherence.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Yuma Mizuno. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuma Mizuno -/ -import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence -import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +module + +public meta import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence +public meta import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes /-! # Coherence tactic for monoidal categories @@ -16,6 +18,8 @@ are equal. -/ +public meta section + open Lean Meta Elab Qq open CategoryTheory Mathlib.Tactic.BicategoryLike MonoidalCategory diff --git a/Mathlib/Tactic/CategoryTheory/MonoidalComp.lean b/Mathlib/Tactic/CategoryTheory/MonoidalComp.lean index aba9930212efd3..6d6657e9d21170 100644 --- a/Mathlib/Tactic/CategoryTheory/MonoidalComp.lean +++ b/Mathlib/Tactic/CategoryTheory/MonoidalComp.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Yuma Mizuno, Oleksandr Manzyuk -/ -import Mathlib.CategoryTheory.Monoidal.Category +module + +public import Mathlib.CategoryTheory.Monoidal.Category /-! # Monoidal composition `⊗≫` (composition up to associators) @@ -30,6 +32,8 @@ are completed as `𝟙 (V₁ ⊗ V₂ ⊗ V₃ ⊗ V₄ ⊗ V₅)` and `𝟙 (V -/ +@[expose] public section + universe v u open CategoryTheory MonoidalCategory diff --git a/Mathlib/Tactic/CategoryTheory/Reassoc.lean b/Mathlib/Tactic/CategoryTheory/Reassoc.lean index 785069a10e92d0..ec05b3a4d02caf 100644 --- a/Mathlib/Tactic/CategoryTheory/Reassoc.lean +++ b/Mathlib/Tactic/CategoryTheory/Reassoc.lean @@ -3,10 +3,13 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Robin Carlier -/ -import Mathlib.CategoryTheory.Functor.Basic -import Mathlib.Lean.Meta.Simp -import Mathlib.Tactic.Simps.Basic -import Mathlib.Util.AddRelatedDecl +module + +public import Mathlib.CategoryTheory.Functor.Basic +public meta import Mathlib.CategoryTheory.Functor.Basic +public meta import Mathlib.Lean.Meta.Simp +public meta import Mathlib.Tactic.Simps.Basic +public meta import Mathlib.Util.AddRelatedDecl /-! # The `reassoc` attribute @@ -27,6 +30,8 @@ The `Mathlib.Tactic.CategoryTheory.IsoReassoc` extends `@[reassoc]` and `reassoc to support creating isomorphism reassociation lemmas. -/ +public meta section + open Lean Meta Elab Tactic open Mathlib.Tactic @@ -102,14 +107,12 @@ def registerReassocExpr (f : Expr → MetaM (Expr × Array MVarId)) : IO Unit := reassocImplRef.modify (·.push f) /-- -Reassociates the morphisms in `type?` using the registered handlers, +Reassociates the morphisms in the type of `pf` using the registered handlers, using `reassocExprHom` as the default. -If `type?` is not given, it is assumed to be the type of `pf`. Returns the proof of the lemma along with instance metavariables that need synthesis. -/ -def reassocExpr (pf : Expr) (type? : Option Expr) : MetaM (Expr × Array MVarId) := do - let pf ← if let some type := type? then mkExpectedTypeHint pf type else pure pf +def reassocExpr (pf : Expr) : MetaM (Expr × Array MVarId) := do forallTelescopeReducing (← inferType pf) fun xs _ => do let pf := mkAppN pf xs let handlers ← reassocImplRef.get @@ -120,8 +123,8 @@ def reassocExpr (pf : Expr) (type? : Option Expr) : MetaM (Expr × Array MVarId) /-- Version of `reassocExpr` for the `TermElabM` monad. Handles instance metavariables automatically. -/ -def reassocExpr' (pf : Expr) (type? : Option Expr) : TermElabM Expr := do - let (e, insts) ← reassocExpr pf type? +def reassocExpr' (pf : Expr) : TermElabM Expr := do + let (e, insts) ← reassocExpr pf for inst in insts do inst.withContext do unless ← Term.synthesizeInstMVarCore inst do @@ -136,9 +139,9 @@ initialize registerBuiltinAttribute { | `(attr| reassoc $[(attr := $stx?,*)]?) => MetaM.run' do if (kind != AttributeKind.global) then throwError "`reassoc` can only be used as a global attribute" - addRelatedDecl src "_assoc" ref stx? fun type value levels => do + addRelatedDecl src "_assoc" ref stx? fun value levels => do Term.TermElabM.run' <| Term.withSynthesize do - let pf ← reassocExpr' value type + let pf ← reassocExpr' value pure (pf, levels) | _ => throwUnsupportedSyntax } @@ -152,6 +155,6 @@ This also works for equations between isomorphisms, provided that -/ elab "reassoc_of% " t:term : term => do let e ← Term.withSynthesizeLight <| Term.elabTerm t none - reassocExpr' e none + reassocExpr' e end CategoryTheory diff --git a/Mathlib/Tactic/CategoryTheory/Slice.lean b/Mathlib/Tactic/CategoryTheory/Slice.lean index 9049b9e98c8936..501089a3887937 100644 --- a/Mathlib/Tactic/CategoryTheory/Slice.lean +++ b/Mathlib/Tactic/CategoryTheory/Slice.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.CategoryTheory.Category.Basic -import Mathlib.Tactic.Conv +module + +public meta import Mathlib.CategoryTheory.Category.Basic +public meta import Mathlib.Tactic.Conv /-! # The `slice` tactic @@ -14,6 +16,8 @@ of `Category.comp`. -/ +public meta section + open CategoryTheory open Lean Parser.Tactic Elab Command Elab.Tactic Meta diff --git a/Mathlib/Tactic/CategoryTheory/ToApp.lean b/Mathlib/Tactic/CategoryTheory/ToApp.lean index 571d897a8b83f5..b2afd804493b7d 100644 --- a/Mathlib/Tactic/CategoryTheory/ToApp.lean +++ b/Mathlib/Tactic/CategoryTheory/ToApp.lean @@ -3,8 +3,11 @@ Copyright (c) 2024 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ -import Mathlib.CategoryTheory.Category.Cat -import Mathlib.Util.AddRelatedDecl +module + +public import Mathlib.CategoryTheory.Category.Cat +public meta import Mathlib.CategoryTheory.Category.Cat +public meta import Mathlib.Util.AddRelatedDecl /-! # The `to_app` attribute @@ -25,6 +28,8 @@ in `Cat` which contain components of 2-morphisms. There is also a term elaborator `to_app_of% t` for use within proofs. -/ +public meta section + open Lean Meta Elab Tactic open Mathlib.Tactic @@ -122,9 +127,8 @@ initialize registerBuiltinAttribute { | `(attr| to_app $[(attr := $stx?,*)]?) => MetaM.run' do if (kind != AttributeKind.global) then throwError "`to_app` can only be used as a global attribute" - addRelatedDecl src "_app" ref stx? fun type value levels => do + addRelatedDecl src "_app" ref stx? fun value levels => do let levelMVars ← levels.mapM fun _ => mkFreshLevelMVar - let value ← mkExpectedTypeHint value type let value := value.instantiateLevelParams levels levelMVars let newValue ← toAppExpr (← toCatExpr value) let r := (← getMCtx).levelMVarToParam (fun _ => false) (fun _ => false) newValue diff --git a/Mathlib/Tactic/Change.lean b/Mathlib/Tactic/Change.lean index 235826d756da20..f00a3581dd86ce 100644 --- a/Mathlib/Tactic/Change.lean +++ b/Mathlib/Tactic/Change.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Init -import Lean.Elab.Tactic.ElabTerm -import Lean.Meta.Tactic.TryThis +public import Mathlib.Init +public meta import Lean.Elab.Tactic.ElabTerm +public meta import Lean.Meta.Tactic.TryThis /-! # Tactic `change? term` @@ -19,6 +20,8 @@ in the suggestion. This is helpful after tactics like `dsimp`, which can then be deleted. -/ +public meta section + /-- `change? term` unifies `term` with the current goal, then suggests explicit `change` syntax that uses the resulting unified term. diff --git a/Mathlib/Tactic/Check.lean b/Mathlib/Tactic/Check.lean index f2014e89708619..6c435d12d8c8c2 100644 --- a/Mathlib/Tactic/Check.lean +++ b/Mathlib/Tactic/Check.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Init -import Lean.Elab.Tactic.Basic -import Lean.PrettyPrinter -import Lean.Elab.SyntheticMVars +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Basic +public meta import Lean.PrettyPrinter +public meta import Lean.Elab.SyntheticMVars /-! # `#check` tactic @@ -17,6 +19,8 @@ since it elaborates `t` in a more tolerant way and so it can be possible to get For example, `#check` allows metavariables. -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Tactic diff --git a/Mathlib/Tactic/Choose.lean b/Mathlib/Tactic/Choose.lean index 65541c3783eec1..07c678043c72bb 100644 --- a/Mathlib/Tactic/Choose.lean +++ b/Mathlib/Tactic/Choose.lean @@ -3,9 +3,10 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Floris van Doorn, Mario Carneiro, Reid Barton, Johan Commelin -/ +module -import Mathlib.Util.Tactic -import Mathlib.Logic.Function.Basic +public meta import Mathlib.Util.Tactic +public meta import Mathlib.Logic.Function.Basic /-! # `choose` tactic @@ -15,6 +16,8 @@ Performs Skolemization, that is, given `h : ∀ a:α, ∃ b:β, p a b |- G` prod TODO: switch to `rcases` syntax: `choose ⟨i, j, h₁ -⟩ := expr`. -/ +public meta section + open Lean Meta Elab Tactic namespace Mathlib.Tactic.Choose diff --git a/Mathlib/Tactic/Clean.lean b/Mathlib/Tactic/Clean.lean index 3e7eb9d2684ad3..965cb20b621328 100644 --- a/Mathlib/Tactic/Clean.lean +++ b/Mathlib/Tactic/Clean.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Michail Karatarakis, Kyle Miller -/ -import Mathlib.Init -import Lean.Elab.SyntheticMVars +module + +public import Mathlib.Init +public meta import Lean.Elab.SyntheticMVars /-! # `clean%` term elaborator @@ -12,6 +14,8 @@ import Lean.Elab.SyntheticMVars Remove identity functions from a term. -/ +public meta section + open Lean Meta Elab namespace Lean.Expr diff --git a/Mathlib/Tactic/ClearExcept.lean b/Mathlib/Tactic/ClearExcept.lean index 47a882d444c05e..6879f0873a38d0 100644 --- a/Mathlib/Tactic/ClearExcept.lean +++ b/Mathlib/Tactic/ClearExcept.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Joshua Clune. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joshua Clune -/ -import Mathlib.Init -import Lean.Elab.Tactic.ElabTerm +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.ElabTerm /-! # The `clear*` tactic @@ -13,6 +15,8 @@ This file provides a variant of the `clear` tactic, which clears all hypotheses besides a provided list. -/ +public meta section + open Lean.Meta namespace Lean.Elab.Tactic diff --git a/Mathlib/Tactic/ClearExclamation.lean b/Mathlib/Tactic/ClearExclamation.lean index 5935d32048c321..77ebcd50bc995f 100644 --- a/Mathlib/Tactic/ClearExclamation.lean +++ b/Mathlib/Tactic/ClearExclamation.lean @@ -3,11 +3,15 @@ Copyright (c) 2022 Joshua Clune. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joshua Clune -/ -import Mathlib.Init -import Lean.Elab.Tactic.ElabTerm +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.ElabTerm /-! # `clear!` tactic -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab.Tactic diff --git a/Mathlib/Tactic/Clear_.lean b/Mathlib/Tactic/Clear_.lean index 0e2d325b31be1a..0b1fcb28a9b4c3 100644 --- a/Mathlib/Tactic/Clear_.lean +++ b/Mathlib/Tactic/Clear_.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Joshua Clune. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joshua Clune -/ -import Mathlib.Init -import Lean.Meta.Tactic.Clear -import Lean.Elab.Tactic.Basic +module + +public import Mathlib.Init +public meta import Lean.Meta.Tactic.Clear +public meta import Lean.Elab.Tactic.Basic /-! # `clear_` tactic -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab.Tactic diff --git a/Mathlib/Tactic/Coe.lean b/Mathlib/Tactic/Coe.lean index ce4de64cb81eba..3e72af974733de 100644 --- a/Mathlib/Tactic/Coe.lean +++ b/Mathlib/Tactic/Coe.lean @@ -3,8 +3,10 @@ Copyright (c) 2021 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ -import Mathlib.Init -import Lean.Elab.ElabRules +module + +public import Mathlib.Init +public meta import Lean.Elab.ElabRules /-! # Additional coercion notation @@ -18,6 +20,8 @@ Defines notation for coercions. 6. `(↥)` is equivalent to the eta-reduction of `(↥ ·)` -/ +public meta section + open Lean Meta namespace Lean.Elab.Term.CoeImpl diff --git a/Mathlib/Tactic/Common.lean b/Mathlib/Tactic/Common.lean index de768cbb586675..f62900d964089a 100644 --- a/Mathlib/Tactic/Common.lean +++ b/Mathlib/Tactic/Common.lean @@ -5,117 +5,119 @@ Authors: Kim Morrison -/ -- First import Aesop, Qq, and Plausible -import Aesop -import Qq -import Plausible +module + +public meta import Aesop +public meta import Qq +public meta import Plausible -- Tools for analysing imports, like `#find_home`, `#minimize_imports`, ... -import ImportGraph.Imports +public meta import ImportGraph.Imports -- Import common Batteries tactics and commands -import Batteries.Tactic.Basic -import Batteries.Tactic.Case -import Batteries.Tactic.HelpCmd -import Batteries.Tactic.Alias -import Batteries.Tactic.GeneralizeProofs +public meta import Batteries.Tactic.Basic +public meta import Batteries.Tactic.Case +public meta import Batteries.Tactic.HelpCmd +public meta import Batteries.Tactic.Alias +public meta import Batteries.Tactic.GeneralizeProofs -- Import syntax for leansearch -import LeanSearchClient +public meta import LeanSearchClient -- Import Mathlib-specific linters. -import Mathlib.Tactic.Linter.Lint +public meta import Mathlib.Tactic.Linter.Lint -- Now import all tactics defined in Mathlib that do not require theory files. -import Mathlib.Tactic.ApplyCongr +public meta import Mathlib.Tactic.ApplyCongr -- ApplyFun imports `Mathlib/Order/Monotone/Basic.lean` -- import Mathlib.Tactic.ApplyFun -import Mathlib.Tactic.ApplyAt -import Mathlib.Tactic.ApplyWith -import Mathlib.Tactic.Basic -import Mathlib.Tactic.ByCases -import Mathlib.Tactic.ByContra -import Mathlib.Tactic.CasesM -import Mathlib.Tactic.Check -import Mathlib.Tactic.Choose -import Mathlib.Tactic.ClearExclamation -import Mathlib.Tactic.ClearExcept -import Mathlib.Tactic.Clear_ -import Mathlib.Tactic.Coe -import Mathlib.Tactic.CongrExclamation -import Mathlib.Tactic.CongrM -import Mathlib.Tactic.Constructor -import Mathlib.Tactic.Contrapose -import Mathlib.Tactic.Conv -import Mathlib.Tactic.Convert -import Mathlib.Tactic.DefEqTransformations -import Mathlib.Tactic.DeprecateTo -import Mathlib.Tactic.ErwQuestion -import Mathlib.Tactic.Eqns -import Mathlib.Tactic.ExistsI -import Mathlib.Tactic.ExtractGoal -import Mathlib.Tactic.FailIfNoProgress -import Mathlib.Tactic.Find -import Mathlib.Tactic.FunProp -import Mathlib.Tactic.GCongr -import Mathlib.Tactic.GRewrite -import Mathlib.Tactic.GuardGoalNums -import Mathlib.Tactic.GuardHypNums -import Mathlib.Tactic.HigherOrder -import Mathlib.Tactic.Hint -import Mathlib.Tactic.InferParam -import Mathlib.Tactic.Inhabit -import Mathlib.Tactic.IrreducibleDef -import Mathlib.Tactic.Lift -import Mathlib.Tactic.Linter -import Mathlib.Tactic.MkIffOfInductiveProp +public meta import Mathlib.Tactic.ApplyAt +public meta import Mathlib.Tactic.ApplyWith +public meta import Mathlib.Tactic.Basic +public meta import Mathlib.Tactic.ByCases +public meta import Mathlib.Tactic.ByContra +public meta import Mathlib.Tactic.CasesM +public meta import Mathlib.Tactic.Check +public meta import Mathlib.Tactic.Choose +public meta import Mathlib.Tactic.ClearExclamation +public meta import Mathlib.Tactic.ClearExcept +public meta import Mathlib.Tactic.Clear_ +public meta import Mathlib.Tactic.Coe +public meta import Mathlib.Tactic.CongrExclamation +public meta import Mathlib.Tactic.CongrM +public meta import Mathlib.Tactic.Constructor +public meta import Mathlib.Tactic.Contrapose +public meta import Mathlib.Tactic.Conv +public meta import Mathlib.Tactic.Convert +public meta import Mathlib.Tactic.DefEqTransformations +public meta import Mathlib.Tactic.DeprecateTo +public meta import Mathlib.Tactic.ErwQuestion +public meta import Mathlib.Tactic.Eqns +public meta import Mathlib.Tactic.ExistsI +public meta import Mathlib.Tactic.ExtractGoal +public meta import Mathlib.Tactic.FailIfNoProgress +public meta import Mathlib.Tactic.Find +public meta import Mathlib.Tactic.FunProp +public meta import Mathlib.Tactic.GCongr +public meta import Mathlib.Tactic.GRewrite +public meta import Mathlib.Tactic.GuardGoalNums +public meta import Mathlib.Tactic.GuardHypNums +public meta import Mathlib.Tactic.HigherOrder +public meta import Mathlib.Tactic.Hint +public meta import Mathlib.Tactic.InferParam +public meta import Mathlib.Tactic.Inhabit +public meta import Mathlib.Tactic.IrreducibleDef +public meta import Mathlib.Tactic.Lift +public meta import Mathlib.Tactic.Linter +public meta import Mathlib.Tactic.MkIffOfInductiveProp -- NormNum imports `Algebra.Order.Invertible`, `Data.Int.Basic`, `Data.Nat.Cast.Commute` -- import Mathlib.Tactic.NormNum.Basic -import Mathlib.Tactic.NthRewrite -import Mathlib.Tactic.Observe -import Mathlib.Tactic.OfNat +public meta import Mathlib.Tactic.NthRewrite +public meta import Mathlib.Tactic.Observe +public meta import Mathlib.Tactic.OfNat -- `positivity` imports `Data.Nat.Factorial.Basic`, but hopefully this can be rearranged. -- import Mathlib.Tactic.Positivity -import Mathlib.Tactic.Propose -import Mathlib.Tactic.Push -import Mathlib.Tactic.RSuffices -import Mathlib.Tactic.Recover -import Mathlib.Tactic.Relation.Rfl -import Mathlib.Tactic.Rename -import Mathlib.Tactic.RenameBVar -import Mathlib.Tactic.Says -import Mathlib.Tactic.ScopedNS -import Mathlib.Tactic.Set -import Mathlib.Tactic.SimpIntro -import Mathlib.Tactic.SimpRw -import Mathlib.Tactic.Simps.Basic -import Mathlib.Tactic.SplitIfs -import Mathlib.Tactic.Spread -import Mathlib.Tactic.Subsingleton -import Mathlib.Tactic.Substs -import Mathlib.Tactic.SuccessIfFailWithMsg -import Mathlib.Tactic.SudoSetOption -import Mathlib.Tactic.SwapVar -import Mathlib.Tactic.Tauto -import Mathlib.Tactic.TermCongr +public meta import Mathlib.Tactic.Propose +public meta import Mathlib.Tactic.Push +public meta import Mathlib.Tactic.RSuffices +public meta import Mathlib.Tactic.Recover +public meta import Mathlib.Tactic.Relation.Rfl +public meta import Mathlib.Tactic.Rename +public meta import Mathlib.Tactic.RenameBVar +public meta import Mathlib.Tactic.Says +public meta import Mathlib.Tactic.ScopedNS +public meta import Mathlib.Tactic.Set +public meta import Mathlib.Tactic.SimpIntro +public meta import Mathlib.Tactic.SimpRw +public meta import Mathlib.Tactic.Simps.Basic +public meta import Mathlib.Tactic.SplitIfs +public meta import Mathlib.Tactic.Spread +public meta import Mathlib.Tactic.Subsingleton +public meta import Mathlib.Tactic.Substs +public meta import Mathlib.Tactic.SuccessIfFailWithMsg +public meta import Mathlib.Tactic.SudoSetOption +public meta import Mathlib.Tactic.SwapVar +public meta import Mathlib.Tactic.Tauto +public meta import Mathlib.Tactic.TermCongr -- TFAE imports `Mathlib/Data/List/TFAE.lean` and thence `Mathlib/Data/List/Basic.lean`. -- import Mathlib.Tactic.TFAE -import Mathlib.Tactic.ToExpr -import Mathlib.Tactic.ToLevel -import Mathlib.Tactic.Trace -import Mathlib.Tactic.TypeCheck -import Mathlib.Tactic.UnsetOption -import Mathlib.Tactic.Use -import Mathlib.Tactic.Variable -import Mathlib.Tactic.Widget.Calc -import Mathlib.Tactic.Widget.CongrM -import Mathlib.Tactic.Widget.Conv -import Mathlib.Tactic.Widget.LibraryRewrite -import Mathlib.Tactic.WLOG -import Mathlib.Util.AssertExists -import Mathlib.Util.CountHeartbeats -import Mathlib.Util.PrintSorries -import Mathlib.Util.TransImports -import Mathlib.Util.WhatsNew +public meta import Mathlib.Tactic.ToExpr +public meta import Mathlib.Tactic.ToLevel +public meta import Mathlib.Tactic.Trace +public meta import Mathlib.Tactic.TypeCheck +public meta import Mathlib.Tactic.UnsetOption +public meta import Mathlib.Tactic.Use +public meta import Mathlib.Tactic.Variable +public meta import Mathlib.Tactic.Widget.Calc +public meta import Mathlib.Tactic.Widget.CongrM +public meta import Mathlib.Tactic.Widget.Conv +public meta import Mathlib.Tactic.Widget.LibraryRewrite +public meta import Mathlib.Tactic.WLOG +public meta import Mathlib.Util.AssertExists +public meta import Mathlib.Util.CountHeartbeats +public meta import Mathlib.Util.PrintSorries +public meta import Mathlib.Util.TransImports +public meta import Mathlib.Util.WhatsNew /-! This file imports all tactics which do not have significant theory imports, @@ -129,22 +131,26 @@ We also import theory-free linters, commands, and utilities which are useful to import hierarchy. -/ +public meta section + /-! # Register tactics with `hint`. Tactics with larger priority run first. -/ section Hint -register_hint (priority := 200) grind -register_hint (priority := 1000) trivial -register_hint (priority := 500) tauto -register_hint (priority := 1000) split -register_hint (priority := 1000) intro -register_hint (priority := 80) aesop -register_hint (priority := 800) simp_all? -register_hint (priority := 600) exact? -register_hint (priority := 1000) decide -register_hint (priority := 200) omega -register_hint (priority := 200) fun_prop +register_hint 200 grind +register_hint 1000 trivial +register_hint 500 tauto +register_hint 1000 split +register_hint 1000 intro +register_hint 80 aesop +register_hint 800 simp_all? +register_hint 600 exact? +register_hint 1000 decide +register_hint 200 omega +register_hint 200 fun_prop end Hint + +-- example : True := by canonical +suggestions diff --git a/Mathlib/Tactic/ComputeDegree.lean b/Mathlib/Tactic/ComputeDegree.lean index 4ea27271d73913..6635435e9b0d99 100644 --- a/Mathlib/Tactic/ComputeDegree.lean +++ b/Mathlib/Tactic/ComputeDegree.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Algebra.Polynomial.Degree.Lemmas +public meta import Mathlib.Algebra.Polynomial.Degree.Lemmas /-! @@ -78,6 +79,8 @@ The leaves of the process are * `fvar`s `f`, to which we tautologically assign degree `natDegree f`. -/ +public meta section + open Polynomial namespace Mathlib.Tactic.ComputeDegree @@ -525,4 +528,4 @@ end Mathlib.Tactic.ComputeDegree /-! We register `compute_degree` with the `hint` tactic. -/ -register_hint compute_degree +register_hint 1000 compute_degree diff --git a/Mathlib/Tactic/CongrExclamation.lean b/Mathlib/Tactic/CongrExclamation.lean index 33edb85735a037..dc6f1bc56a9068 100644 --- a/Mathlib/Tactic/CongrExclamation.lean +++ b/Mathlib/Tactic/CongrExclamation.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Lean.Elab.Tactic.Config -import Lean.Elab.Tactic.RCases -import Lean.Meta.Tactic.Assumption -import Lean.Meta.Tactic.Rfl -import Mathlib.Lean.Meta.CongrTheorems -import Mathlib.Logic.Basic +module + +public meta import Lean.Elab.Tactic.Config +public meta import Lean.Elab.Tactic.RCases +public meta import Lean.Meta.Tactic.Assumption +public meta import Lean.Meta.Tactic.Rfl +public meta import Mathlib.Lean.Meta.CongrTheorems +public meta import Mathlib.Logic.Basic /-! # The `congr!` tactic @@ -21,6 +23,8 @@ The `congr!` tactic is used by the `convert` and `convert_to` tactics. See the syntax docstring for more details. -/ +public meta section + universe u v open Lean Meta Elab Tactic @@ -31,7 +35,7 @@ initialize registerTraceClass `congr!.synthesize /-- The configuration for the `congr!` tactic. -/ structure Congr!.Config where /-- If `closePre := true`, then try to close goals before applying congruence lemmas - using tactics such as `rfl` and `assumption. These tactics are applied with the + using tactics such as `rfl` and `assumption`. These tactics are applied with the transparency level specified by `preTransparency`, which is `.reducible` by default. -/ closePre : Bool := true /-- If `closePost := true`, then try to close goals that remain after no more congruence diff --git a/Mathlib/Tactic/CongrM.lean b/Mathlib/Tactic/CongrM.lean index a7b10d7be58244..be307eac5250ce 100644 --- a/Mathlib/Tactic/CongrM.lean +++ b/Mathlib/Tactic/CongrM.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Moritz Doll, Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll, Gabriel Ebner, Damiano Testa, Kyle Miller -/ -import Mathlib.Tactic.TermCongr -import Mathlib.Tactic.WithoutCDot +module + +public meta import Mathlib.Tactic.TermCongr +public meta import Mathlib.Tactic.WithoutCDot /-! # The `congrm` tactic @@ -15,6 +17,8 @@ Roughly, `congrm e` is `refine congr(e')`, where `e'` is `e` with every `?m` pla replaced by `$(?m)`. -/ +public meta section + namespace Mathlib.Tactic open Lean Parser Elab Tactic Meta diff --git a/Mathlib/Tactic/Constructor.lean b/Mathlib/Tactic/Constructor.lean index 64adccae545b70..b404e8a2e7fc36 100644 --- a/Mathlib/Tactic/Constructor.lean +++ b/Mathlib/Tactic/Constructor.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Newell Jensen -/ -import Mathlib.Init -import Lean.Elab.SyntheticMVars -import Lean.Meta.Tactic.Constructor +module + +public import Mathlib.Init +public meta import Lean.Elab.SyntheticMVars +public meta import Lean.Meta.Tactic.Constructor /-! # The `fconstructor` and `econstructor` tactics @@ -16,6 +18,8 @@ except that - `econstructor` adds only non-dependent premises as new goals. -/ +public meta section + open Lean Elab Tactic /-- diff --git a/Mathlib/Tactic/Continuity.lean b/Mathlib/Tactic/Continuity.lean index e09088eb4ab362..40bd5ea1158f68 100644 --- a/Mathlib/Tactic/Continuity.lean +++ b/Mathlib/Tactic/Continuity.lean @@ -3,14 +3,17 @@ Copyright (c) 2023 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ +module -import Mathlib.Tactic.Continuity.Init +public meta import Mathlib.Tactic.Continuity.Init /-! # Continuity We define the `continuity` tactic using `aesop`. -/ +public meta section + attribute [aesop (rule_sets := [Continuous]) unfold norm] Function.comp /-- diff --git a/Mathlib/Tactic/Continuity/Init.lean b/Mathlib/Tactic/Continuity/Init.lean index e8ff04a4ed8524..69a5a1d5c38d06 100644 --- a/Mathlib/Tactic/Continuity/Init.lean +++ b/Mathlib/Tactic/Continuity/Init.lean @@ -3,9 +3,10 @@ Copyright (c) 2023 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ +module -import Mathlib.Init -import Aesop +public import Mathlib.Init +public meta import Aesop /-! # Continuity Rule Set @@ -15,4 +16,6 @@ This module defines the `Continuous` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ +public meta section + declare_aesop_rule_sets [Continuous] diff --git a/Mathlib/Tactic/ContinuousFunctionalCalculus.lean b/Mathlib/Tactic/ContinuousFunctionalCalculus.lean index 9eca49727383cf..94bfc9c23f2728 100644 --- a/Mathlib/Tactic/ContinuousFunctionalCalculus.lean +++ b/Mathlib/Tactic/ContinuousFunctionalCalculus.lean @@ -3,10 +3,11 @@ Copyright (c) 2024 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Tactic.Core -import Mathlib.Tactic.FunProp -import Aesop +public meta import Mathlib.Tactic.Core +public meta import Mathlib.Tactic.FunProp +public meta import Aesop /-! @@ -15,6 +16,8 @@ import Aesop At the moment, these tactics are just wrappers, but potentially they could be more sophisticated. -/ +public meta section + declare_aesop_rule_sets [CStarAlgebra] /-- A tactic used to automatically discharge goals relating to the continuous functional calculus, diff --git a/Mathlib/Tactic/Contrapose.lean b/Mathlib/Tactic/Contrapose.lean index e52a9915dfc1a7..fa317c5b66131e 100644 --- a/Mathlib/Tactic/Contrapose.lean +++ b/Mathlib/Tactic/Contrapose.lean @@ -3,40 +3,89 @@ Copyright (c) 2022 Jireh Loreaux. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jireh Loreaux -/ +module -import Mathlib.Tactic.Push +public meta import Mathlib.Tactic.Push /-! # Contrapose The `contrapose` tactic transforms the goal into its contrapositive when that goal is an -implication. +implication or an iff. It also avoids creating a double negation if there already is a negation. -* `contrapose` turns a goal `P → Q` into `¬ Q → ¬ P` -* `contrapose!` turns a goal `P → Q` into `¬ Q → ¬ P` and pushes negations inside `P` and `Q` - using `push_neg` -* `contrapose h` first reverts the local assumption `h`, and then uses `contrapose` and `intro h` -* `contrapose! h` first reverts the local assumption `h`, and then uses `contrapose!` and `intro h` +* `contrapose` turns a goal `P → Q` into `¬ Q → ¬ P` and a goal `P ↔ Q` into `¬ P ↔ ¬ Q` +* `contrapose!` runs `contrapose` and then pushes negations inside `P` and `Q` using `push_neg` +* `contrapose h` first reverts the local assumption `h`, and then uses `contrapose` and `intro h` +* `contrapose! h` first reverts the local assumption `h`, and then uses `contrapose!` and `intro h` * `contrapose h with new_h` uses the name `new_h` for the introduced hypothesis -/ + +public meta section namespace Mathlib.Tactic.Contrapose -lemma mtr {p q : Prop} : (¬ q → ¬ p) → (p → q) := fun h hp ↦ by_contra (fun h' ↦ h h' hp) +/-- An option to turn off the feature that `contrapose` negates both sides of `↔` goals. +This may be useful for teaching. -/ +register_option contrapose.negate_iff : Bool := { + defValue := true + descr := "contrapose a goal `a ↔ b` into the goal `¬ a ↔ ¬ b`" +} + +-- `contrapose₃`, `contrapose₄` and `contrapose_iff₄` don't depend on any axioms. +lemma contrapose₁ {p q : Prop} : (¬ q → ¬ p) → (p → q) := fun h hp ↦ by_contra fun h' ↦ h h' hp +lemma contrapose₂ {p q : Prop} : (¬ q → p) → (¬ p → q) := fun h hp ↦ by_contra fun h' ↦ hp (h h') +lemma contrapose₃ {p q : Prop} : (q → ¬ p) → (p → ¬ q) := Imp.swap.mp +lemma contrapose₄ {p q : Prop} : (q → p) → (¬ p → ¬ q) := mt + +lemma contrapose_iff₁ {p q : Prop} : (¬ p ↔ ¬ q) → (p ↔ q) := not_iff_not.mp +lemma contrapose_iff₂ {p q : Prop} : (p ↔ ¬ q) → (¬ p ↔ q) := (iff_not_comm.trans Iff.comm).mp +lemma contrapose_iff₃ {p q : Prop} : (¬ p ↔ q) → (p ↔ ¬ q) := (not_iff_comm.trans Iff.comm).mp +lemma contrapose_iff₄ {p q : Prop} : (p ↔ q) → (¬ p ↔ ¬ q) := fun ⟨h₁, h₂⟩ ↦ ⟨mt h₂, mt h₁⟩ /-- Transforms the goal into its contrapositive. -* `contrapose` turns a goal `P → Q` into `¬ Q → ¬ P` -* `contrapose h` first reverts the local assumption `h`, and then uses `contrapose` and `intro h` +* `contrapose` turns a goal `P → Q` into `¬ Q → ¬ P` and it turns a goal `P ↔ Q` into `¬ P ↔ ¬ Q` +* `contrapose h` first reverts the local assumption `h`, and then uses `contrapose` and `intro h` * `contrapose h with new_h` uses the name `new_h` for the introduced hypothesis -/ syntax (name := contrapose) "contrapose" (ppSpace colGt ident (" with " ident)?)? : tactic macro_rules - | `(tactic| contrapose) => `(tactic| (refine mtr ?_)) | `(tactic| contrapose $e) => `(tactic| (revert $e:ident; contrapose; intro $e:ident)) | `(tactic| contrapose $e with $e') => `(tactic| (revert $e:ident; contrapose; intro $e':ident)) +open Lean Meta Elab.Tactic + +elab_rules : tactic +| `(tactic| contrapose) => liftMetaTactic fun g => withReducible do + let target ← g.getType' + match target with + | mkApp2 (.const ``Iff _) p q => + if ← contrapose.negate_iff.getM then + -- we use reducible `whnf`, so that `a ≠ b` is recognized as a negation + match (← whnf p).not?, (← whnf q).not? with + | none, none => g.apply (mkApp2 (.const ``contrapose_iff₁ []) p q) + | some p, none => g.apply (mkApp2 (.const ``contrapose_iff₂ []) p q) + | none, some q => g.apply (mkApp2 (.const ``contrapose_iff₃ []) p q) + | some p, some q => g.apply (mkApp2 (.const ``contrapose_iff₄ []) p q) + else + throwTacticEx `contrapose g "contraposing `↔` relations has been disabled.\n\ + To enable it, use `set_option contrapose.negate_iff true`." + | .forallE _ p q _ => + if q.hasLooseBVars then + throwTacticEx `contrapose g m!"the goal `{target}` is a dependent arrow" + unless ← Meta.isProp p do + throwTacticEx `contrapose g m!"hypothesis `{p}` is not a proposition" + unless ← Meta.isProp q do + throwTacticEx `contrapose g m!"conclusion `{q}` is not a proposition" + match (← whnf p).not?, (← whnf q).not? with + | none, none => g.apply (mkApp2 (.const ``contrapose₁ []) p q) + | some p, none => g.apply (mkApp2 (.const ``contrapose₂ []) p q) + | none, some q => g.apply (mkApp2 (.const ``contrapose₃ []) p q) + | some p, some q => g.apply (mkApp2 (.const ``contrapose₄ []) p q) + | _ => + throwTacticEx `contrapose g m!"the goal `{target}` is not of the form `_ → _` or `_ ↔ _`" + /-- -Transforms the goal into its contrapositive and uses pushes negations inside `P` and `Q`. +Transforms the goal into its contrapositive and pushes negations in the result. Usage matches `contrapose` -/ syntax (name := contrapose!) "contrapose!" (ppSpace colGt ident (" with " ident)?)? : tactic diff --git a/Mathlib/Tactic/Conv.lean b/Mathlib/Tactic/Conv.lean index c3936735e30323..2fa6d5285ed7d3 100644 --- a/Mathlib/Tactic/Conv.lean +++ b/Mathlib/Tactic/Conv.lean @@ -3,14 +3,18 @@ Copyright (c) 2021 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ -import Mathlib.Init -import Lean.Elab.Tactic.Conv.Basic -import Lean.Elab.Command +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Conv.Basic +public meta import Lean.Elab.Command /-! Additional `conv` tactics. -/ +public meta section + namespace Mathlib.Tactic.Conv open Lean Parser.Tactic Parser.Tactic.Conv Elab.Tactic Meta diff --git a/Mathlib/Tactic/Convert.lean b/Mathlib/Tactic/Convert.lean index 17baa946a72000..670e2c07b002eb 100644 --- a/Mathlib/Tactic/Convert.lean +++ b/Mathlib/Tactic/Convert.lean @@ -3,12 +3,16 @@ Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Kyle Miller -/ -import Mathlib.Tactic.CongrExclamation +module + +public meta import Mathlib.Tactic.CongrExclamation /-! # The `convert` tactic. -/ +public meta section + open Lean Meta Elab Tactic /-- diff --git a/Mathlib/Tactic/Core.lean b/Mathlib/Tactic/Core.lean index 1bd83fc8763b0e..ab80da40ee170e 100644 --- a/Mathlib/Tactic/Core.lean +++ b/Mathlib/Tactic/Core.lean @@ -3,18 +3,22 @@ Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Aurélien Saue, Mario Carneiro -/ -import Lean.Elab.PreDefinition.Basic -import Lean.Elab.Tactic.ElabTerm -import Lean.Meta.Tactic.Intro -import Mathlib.Lean.Expr.Basic -import Batteries.Tactic.OpenPrivate -import Batteries.Lean.Expr +module + +public meta import Lean.Elab.PreDefinition.Basic +public meta import Lean.Elab.Tactic.ElabTerm +public meta import Lean.Meta.Tactic.Intro +public meta import Mathlib.Lean.Expr.Basic +public meta import Batteries.Tactic.OpenPrivate +public meta import Batteries.Lean.Expr /-! # Generally useful tactics. -/ +public meta section + open Lean.Elab.Tactic namespace Lean diff --git a/Mathlib/Tactic/DeclarationNames.lean b/Mathlib/Tactic/DeclarationNames.lean index 1a966d8c3b88e1..c56a717c73ecd5 100644 --- a/Mathlib/Tactic/DeclarationNames.lean +++ b/Mathlib/Tactic/DeclarationNames.lean @@ -3,17 +3,20 @@ Copyright (c) 2024 Moritz Firsching. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Moritz Firsching -/ +module -import Lean.DeclarationRange -import Lean.ResolveName +public meta import Lean.DeclarationRange +public meta import Lean.ResolveName -- Import this linter explicitly to ensure that -- this file has a valid copyright header and module docstring. -import Mathlib.Tactic.Linter.Header +public meta import Mathlib.Tactic.Linter.Header /-! This file contains functions that are used by multiple linters. -/ +public meta section + open Lean Parser Elab Command Meta namespace Mathlib.Linter diff --git a/Mathlib/Tactic/DefEqTransformations.lean b/Mathlib/Tactic/DefEqTransformations.lean index 2732a0805089b1..dae80be2891e60 100644 --- a/Mathlib/Tactic/DefEqTransformations.lean +++ b/Mathlib/Tactic/DefEqTransformations.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Tactic.Basic +module + +public meta import Mathlib.Tactic.Basic /-! # Tactics that transform types into definitionally equal types @@ -13,6 +15,8 @@ change hypotheses and the goal to things that are definitionally equal. It then provides a number of tactics that transform local hypotheses and/or the target. -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Elab.Tactic diff --git a/Mathlib/Tactic/DepRewrite.lean b/Mathlib/Tactic/DepRewrite.lean index 6750b10877319b..0c687f5c53da7d 100644 --- a/Mathlib/Tactic/DepRewrite.lean +++ b/Mathlib/Tactic/DepRewrite.lean @@ -3,13 +3,17 @@ Copyright (c) 2025 Aaron Liu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Liu, Wojciech Nawrocki -/ -import Lean.Elab.Tactic.Simp -import Lean.Elab.Tactic.Conv.Basic -import Lean.Elab.Tactic.Rewrite -import Mathlib.Init +module + +public meta import Lean.Elab.Tactic.Simp +public meta import Lean.Elab.Tactic.Conv.Basic +public meta import Lean.Elab.Tactic.Rewrite +public import Mathlib.Init /-! ## Dependent rewrite tactic -/ +public meta section + namespace Mathlib.Tactic.DepRewrite open Lean Meta diff --git a/Mathlib/Tactic/DeprecateTo.lean b/Mathlib/Tactic/DeprecateTo.lean index ea36642c3bcc31..83847f2a80d403 100644 --- a/Mathlib/Tactic/DeprecateTo.lean +++ b/Mathlib/Tactic/DeprecateTo.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Batteries.Tactic.Alias -import Lean.Meta.Tactic.TryThis -import Mathlib.Lean.Expr.Basic -import Mathlib.Tactic.Lemma -import Std.Time.Format +module + +public meta import Batteries.Tactic.Alias +public meta import Lean.Meta.Tactic.TryThis +public meta import Mathlib.Lean.Expr.Basic +public meta import Mathlib.Tactic.Lemma +public meta import Std.Time.Format /-! # `deprecate to` -- a deprecation tool @@ -38,6 +40,8 @@ TODO: * preserve formatting of existing command? -/ +public meta section + namespace Mathlib.Tactic.DeprecateTo open Lean Elab Term Command @@ -50,7 +54,7 @@ def mkDeprecationStx (id : TSyntax `ident) (n : Name) (dat : Option String := no | none => do return s!"{(← Std.Time.ZonedDateTime.now).toPlainDate}" | some s => return s - let nd := mkNode `str #[mkAtom ("\"" ++ dat.trimRight ++ "\"")] + let nd := mkNode `str #[mkAtom ("\"" ++ dat.trimAsciiEnd ++ "\"")] `(command| @[deprecated (since := $nd)] alias $(mkIdent n) := $id) /-- Returns the array of names that are in `new` but not in `old`. -/ diff --git a/Mathlib/Tactic/DeriveCountable.lean b/Mathlib/Tactic/DeriveCountable.lean index bcba939388d028..80dc7e6033dbaf 100644 --- a/Mathlib/Tactic/DeriveCountable.lean +++ b/Mathlib/Tactic/DeriveCountable.lean @@ -3,12 +3,14 @@ Copyright (c) 2024 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Lean.Meta.Transform -import Lean.Meta.Inductive -import Lean.Elab.Deriving.Basic -import Lean.Elab.Deriving.Util -import Mathlib.Data.Countable.Defs -import Mathlib.Data.Nat.Pairing +module + +public meta import Lean.Meta.Transform +public meta import Lean.Meta.Inductive +public meta import Lean.Elab.Deriving.Basic +public meta import Lean.Elab.Deriving.Util +public meta import Mathlib.Data.Countable.Defs +public meta import Mathlib.Data.Nat.Pairing /-! # `Countable` deriving handler @@ -16,6 +18,8 @@ import Mathlib.Data.Nat.Pairing Adds a deriving handler for the `Countable` class. -/ +public meta section + namespace Mathlib.Deriving.Countable open Lean Parser.Term Elab Deriving Meta diff --git a/Mathlib/Tactic/DeriveEncodable.lean b/Mathlib/Tactic/DeriveEncodable.lean index 9a0a50239c196c..2d417f07dc1a52 100644 --- a/Mathlib/Tactic/DeriveEncodable.lean +++ b/Mathlib/Tactic/DeriveEncodable.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Lean.Meta.Transform -import Lean.Meta.Inductive -import Lean.Elab.Deriving.Basic -import Lean.Elab.Deriving.Util +module + +public meta import Lean.Meta.Transform +public meta import Lean.Meta.Inductive +public meta import Lean.Elab.Deriving.Basic +public meta import Lean.Elab.Deriving.Util import Mathlib.Logic.Encodable.Basic import Mathlib.Data.Nat.Pairing @@ -19,6 +21,8 @@ The resulting `Encodable` instance should be considered to be opaque. The specific encoding used is an implementation detail. -/ +public section + namespace Mathlib.Deriving.Encodable open Lean Parser.Term Elab Deriving Meta @@ -126,7 +130,9 @@ private def S_equiv : S ≃ ℕ where · have := Nat.unpair_lt (by omega : 1 ≤ n' + 1) omega -instance : Encodable S := Encodable.ofEquiv ℕ S_equiv +private instance : Encodable S := Encodable.ofEquiv ℕ S_equiv + +public meta section /-! ### Implementation @@ -363,4 +369,6 @@ initialize registerDerivingHandler ``Encodable mkEncodableInstance registerTraceClass `Mathlib.Deriving.Encodable +end + end Mathlib.Deriving.Encodable diff --git a/Mathlib/Tactic/DeriveFintype.lean b/Mathlib/Tactic/DeriveFintype.lean index a860ad5572e54e..ffd9e74250fcf2 100644 --- a/Mathlib/Tactic/DeriveFintype.lean +++ b/Mathlib/Tactic/DeriveFintype.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Tactic.ProxyType -import Mathlib.Data.Fintype.Basic -import Mathlib.Data.Fintype.Sigma -import Mathlib.Data.Fintype.Sum +module + +public meta import Mathlib.Tactic.ProxyType +public meta import Mathlib.Data.Fintype.Basic +public meta import Mathlib.Data.Fintype.Sigma +public meta import Mathlib.Data.Fintype.Sum /-! # The `Fintype` derive handler @@ -68,6 +70,8 @@ and instead it opts to construct the underlying `Finset` as a disjoint union of for each individual constructor's proxy type. -/ +public meta section + namespace Mathlib.Deriving.Fintype open Lean Elab Lean.Parser.Term open Meta Command diff --git a/Mathlib/Tactic/DeriveTraversable.lean b/Mathlib/Tactic/DeriveTraversable.lean index aac915e093abc4..947224b7fb12ca 100644 --- a/Mathlib/Tactic/DeriveTraversable.lean +++ b/Mathlib/Tactic/DeriveTraversable.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Mathlib.Control.Traversable.Lemmas -import Lean.Elab.Match -import Lean.Elab.Deriving.Basic -import Lean.Elab.PreDefinition.Main +module + +public meta import Mathlib.Control.Traversable.Lemmas +public meta import Lean.Elab.Match +public meta import Lean.Elab.Deriving.Basic +public meta import Lean.Elab.PreDefinition.Main /-! # Deriving handler for `Traversable` instances @@ -16,6 +18,8 @@ This module gives deriving handlers for `Functor`, `LawfulFunctor`, `Traversable example `deriving LawfulTraversable` all by itself gives all four. -/ +public meta section + namespace Mathlib.Deriving.Traversable open Lean Meta Elab Term Command Tactic Match List Monad Functor diff --git a/Mathlib/Tactic/ENatToNat.lean b/Mathlib/Tactic/ENatToNat.lean index 00d2fd045a51a8..626427573211b6 100644 --- a/Mathlib/Tactic/ENatToNat.lean +++ b/Mathlib/Tactic/ENatToNat.lean @@ -3,7 +3,9 @@ Copyright (c) 2025 Vasilii Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasilii Nesterov -/ -import Mathlib.Data.ENat.Basic +module + +public meta import Mathlib.Data.ENat.Basic /-! # `enat_to_nat` @@ -20,6 +22,8 @@ The implementation follows these steps: -/ +public meta section + namespace Mathlib.Tactic.ENatToNat attribute [enat_to_nat_top] OfNat.ofNat_ne_zero ne_eq not_false_eq_true diff --git a/Mathlib/Tactic/Eqns.lean b/Mathlib/Tactic/Eqns.lean index f5282e45d83114..c3818eeba945b4 100644 --- a/Mathlib/Tactic/Eqns.lean +++ b/Mathlib/Tactic/Eqns.lean @@ -3,11 +3,13 @@ Copyright (c) 2023 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ -import Mathlib.Init -import Lean.Meta.Eqns -import Batteries.Lean.NameMapAttribute -import Lean.Elab.Exception -import Lean.Elab.InfoTree.Main +module + +public import Mathlib.Init +public meta import Lean.Meta.Eqns +public meta import Batteries.Lean.NameMapAttribute +public meta import Lean.Elab.Exception +public meta import Lean.Elab.InfoTree.Main /-! # The `@[eqns]` attribute @@ -29,6 +31,8 @@ theorem transpose_const {m n} (c : ℕ) : rw [transpose] ``` -/ + +public meta section open Lean Elab syntax (name := eqns) "eqns" (ppSpace ident)* : attr diff --git a/Mathlib/Tactic/ErwQuestion.lean b/Mathlib/Tactic/ErwQuestion.lean index 76caf31748e88f..337b95a702aebf 100644 --- a/Mathlib/Tactic/ErwQuestion.lean +++ b/Mathlib/Tactic/ErwQuestion.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init -import Lean.Elab.Tactic.Rewrite +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Rewrite /-! # The `erw?` tactic @@ -14,6 +16,8 @@ and then attempts to identify any subexpression which would block the use of `rw It does so by identifying subexpressions which are defeq, but not at reducible transparency. -/ +public meta section + open Lean Parser.Tactic Elab Tactic Meta namespace Mathlib.Tactic.Erw? diff --git a/Mathlib/Tactic/Eval.lean b/Mathlib/Tactic/Eval.lean index e8611d5425ea13..062afd26c1ba90 100644 --- a/Mathlib/Tactic/Eval.lean +++ b/Mathlib/Tactic/Eval.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ +module -import Mathlib.Init -import Qq.Macro +public import Mathlib.Init +public meta import Qq.Macro /-! # The `eval%` term elaborator @@ -14,6 +15,8 @@ This file provides the `eval% x` term elaborator, which evaluates the constant ` in the interpreter, and interpolates it into the expression. -/ +public meta section + open Qq Lean Elab Term diff --git a/Mathlib/Tactic/ExistsI.lean b/Mathlib/Tactic/ExistsI.lean index 636ee485e54b79..a5caa3b957bdfc 100644 --- a/Mathlib/Tactic/ExistsI.lean +++ b/Mathlib/Tactic/ExistsI.lean @@ -3,14 +3,17 @@ Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Gabriel Ebner, Moritz Doll -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # The `existsi` tactic This file defines the `existsi` tactic: its purpose is to instantiate existential quantifiers. Internally, it applies the `refine` tactic. -/ +public meta section + namespace Mathlib.Tactic /-- diff --git a/Mathlib/Tactic/Explode.lean b/Mathlib/Tactic/Explode.lean index a9677acd6ddc90..3d174838772593 100644 --- a/Mathlib/Tactic/Explode.lean +++ b/Mathlib/Tactic/Explode.lean @@ -3,10 +3,12 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Evgenia Karunus, Kyle Miller -/ -import Lean.Elab.Command -import Lean.PrettyPrinter -import Mathlib.Tactic.Explode.Datatypes -import Mathlib.Tactic.Explode.Pretty +module + +public meta import Lean.Elab.Command +public meta import Lean.PrettyPrinter +public meta import Mathlib.Tactic.Explode.Datatypes +public meta import Mathlib.Tactic.Explode.Pretty /-! # Explode command @@ -15,6 +17,8 @@ This file contains the main code behind the `#explode` command. If you have a theorem with a name `hi`, `#explode hi` will display a Fitch table. -/ +public meta section + open Lean namespace Mathlib.Explode diff --git a/Mathlib/Tactic/Explode/Datatypes.lean b/Mathlib/Tactic/Explode/Datatypes.lean index 174cd3101b14c3..43a59a2765cb02 100644 --- a/Mathlib/Tactic/Explode/Datatypes.lean +++ b/Mathlib/Tactic/Explode/Datatypes.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Evgenia Karunus, Kyle Miller -/ -import Mathlib.Init -import Lean.Util.Trace +module + +public import Mathlib.Init +public meta import Lean.Util.Trace /-! # Explode command: datatypes @@ -12,6 +14,8 @@ import Lean.Util.Trace This file contains datatypes used by the `#explode` command and their associated methods. -/ +public meta section + open Lean namespace Mathlib.Explode diff --git a/Mathlib/Tactic/Explode/Pretty.lean b/Mathlib/Tactic/Explode/Pretty.lean index 79d34b772d0ec8..fee4056f3271d8 100644 --- a/Mathlib/Tactic/Explode/Pretty.lean +++ b/Mathlib/Tactic/Explode/Pretty.lean @@ -3,8 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Evgenia Karunus, Kyle Miller -/ -import Lean.Meta.Basic -import Mathlib.Tactic.Explode.Datatypes +module + +public meta import Lean.Meta.Basic +public meta import Mathlib.Tactic.Explode.Datatypes /-! # Explode command: pretty @@ -12,6 +14,8 @@ import Mathlib.Tactic.Explode.Datatypes This file contains UI code to render the Fitch table. -/ +public meta section + open Lean namespace Mathlib.Explode diff --git a/Mathlib/Tactic/ExtendDoc.lean b/Mathlib/Tactic/ExtendDoc.lean index 91e13060b53547..0395d2d4510bbd 100644 --- a/Mathlib/Tactic/ExtendDoc.lean +++ b/Mathlib/Tactic/ExtendDoc.lean @@ -3,10 +3,11 @@ Copyright (c) 2023 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Init -import Lean.Elab.ElabRules -import Lean.DocString +public import Mathlib.Init +public meta import Lean.Elab.ElabRules +public meta import Lean.DocString /-! # `extend_doc` command @@ -24,6 +25,8 @@ does what is probably clear: it extends the doc-string of `decl` by adding the s At least one of `before` and `after` must appear, but either one of them is optional. -/ +public meta section + namespace Mathlib.Tactic.ExtendDocs /-- `extend_docs before after ` extends the diff --git a/Mathlib/Tactic/ExtractGoal.lean b/Mathlib/Tactic/ExtractGoal.lean index 205b4b89f86a89..bd226cf2056e48 100644 --- a/Mathlib/Tactic/ExtractGoal.lean +++ b/Mathlib/Tactic/ExtractGoal.lean @@ -3,12 +3,14 @@ Copyright (c) 2017 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Kyle Miller, Damiano Testa -/ -import Lean.Elab.Term -import Lean.Elab.Tactic.ElabTerm -import Lean.Meta.Tactic.Cleanup -import Lean.PrettyPrinter -import Batteries.Lean.Meta.Inaccessible -import Mathlib.Tactic.MinImports +module + +public meta import Lean.Elab.Term +public meta import Lean.Elab.Tactic.ElabTerm +public meta import Lean.Meta.Tactic.Cleanup +public meta import Lean.PrettyPrinter +public meta import Batteries.Lean.Meta.Inaccessible +public meta import Mathlib.Tactic.MinImports /-! # `extract_goal`: Format the current goal as a stand-alone example @@ -98,6 +100,8 @@ example : (X : Nat[X]) = X := by ``` -/ +public meta section + namespace Mathlib.Tactic.ExtractGoal open Lean Elab Tactic Meta diff --git a/Mathlib/Tactic/ExtractLets.lean b/Mathlib/Tactic/ExtractLets.lean index 472759c348e525..8f19df9cc18e19 100644 --- a/Mathlib/Tactic/ExtractLets.lean +++ b/Mathlib/Tactic/ExtractLets.lean @@ -3,10 +3,12 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Lean.Expr.Basic -import Mathlib.Tactic.Basic -import Batteries.Tactic.Lint.Misc -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public meta import Mathlib.Lean.Expr.Basic +public meta import Mathlib.Tactic.Basic +public meta import Batteries.Tactic.Lint.Misc +public meta import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "The extract_let tactic was moved to Lean core; \ you can probably just remove this import" (since := "2025-05-02") diff --git a/Mathlib/Tactic/FBinop.lean b/Mathlib/Tactic/FBinop.lean index c48fd51aa4257c..71c00317642c93 100644 --- a/Mathlib/Tactic/FBinop.lean +++ b/Mathlib/Tactic/FBinop.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Lean.Elab.App -import Lean.Elab.BuiltinNotation -import Mathlib.Tactic.ToExpr +module + +public meta import Lean.Elab.App +public meta import Lean.Elab.BuiltinNotation +public meta import Mathlib.Tactic.ToExpr /-! # Elaborator for functorial binary operators @@ -27,6 +29,8 @@ with `S _`, which can help certain elaboration problems proceed (like for `{a,b, The main goal is to support generic set product notation and have it elaborate in a convenient way. -/ +public meta section + namespace FBinopElab open Lean Elab Term Meta diff --git a/Mathlib/Tactic/FailIfNoProgress.lean b/Mathlib/Tactic/FailIfNoProgress.lean index 00a6545c4d97cb..c23445db681b70 100644 --- a/Mathlib/Tactic/FailIfNoProgress.lean +++ b/Mathlib/Tactic/FailIfNoProgress.lean @@ -3,9 +3,11 @@ Copyright (c) 2023 Thomas Murrills. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Murrills -/ -import Mathlib.Init -import Lean.Elab.Tactic.Basic -import Lean.Meta.Tactic.Util +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Basic +public meta import Lean.Meta.Tactic.Util /-! # Fail if no progress @@ -28,6 +30,8 @@ having any effect, e.g. `repeat (fail_if_no_progress simp <;> ring_nf)`. -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Tactic diff --git a/Mathlib/Tactic/FastInstance.lean b/Mathlib/Tactic/FastInstance.lean index 8143432b89885b..555c8ec782f923 100644 --- a/Mathlib/Tactic/FastInstance.lean +++ b/Mathlib/Tactic/FastInstance.lean @@ -3,14 +3,17 @@ Copyright (c) 2024 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser, Kyle Miller -/ +module -import Lean.Elab.SyntheticMVars -import Lean -import Mathlib.Init +public meta import Lean.Elab.SyntheticMVars +public meta import Lean +public import Mathlib.Init /-! # The `fast_instance%` term elaborator -/ +public meta section + namespace Mathlib.Elab.FastInstance open Lean Meta Elab Term diff --git a/Mathlib/Tactic/Field.lean b/Mathlib/Tactic/Field.lean index 323223c0eed4fb..385e8715320bc4 100644 --- a/Mathlib/Tactic/Field.lean +++ b/Mathlib/Tactic/Field.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Tactic.FieldSimp -import Mathlib.Tactic.Ring.Basic +module + +public meta import Mathlib.Tactic.FieldSimp +public meta import Mathlib.Tactic.Ring.Basic /-! # A tactic for proving algebraic goals in a field @@ -14,6 +16,8 @@ This file contains the `field` tactic, a finishing tactic which roughly consists -/ +public meta section + open Lean Meta Qq namespace Mathlib.Tactic.FieldSimp @@ -77,4 +81,4 @@ elab (name := field) "field" d:(ppSpace discharger)? args:(ppSpace simpArgs)? : end Mathlib.Tactic.FieldSimp /-! We register `field` with the `hint` tactic. -/ -register_hint field +register_hint 850 field diff --git a/Mathlib/Tactic/FieldSimp.lean b/Mathlib/Tactic/FieldSimp.lean index e8979242ba6c56..fd5e00db23accf 100644 --- a/Mathlib/Tactic/FieldSimp.lean +++ b/Mathlib/Tactic/FieldSimp.lean @@ -3,13 +3,15 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, David Renshaw, Heather Macbeth, Arend Mellendijk, Michael Rothgang -/ -import Mathlib.Data.Ineq -import Mathlib.Tactic.FieldSimp.Attr -import Mathlib.Tactic.FieldSimp.Discharger -import Mathlib.Tactic.FieldSimp.Lemmas -import Mathlib.Util.AtLocation -import Mathlib.Util.AtomM.Recurse -import Mathlib.Util.SynthesizeUsing +module + +public meta import Mathlib.Data.Ineq +public meta import Mathlib.Tactic.FieldSimp.Attr +public meta import Mathlib.Tactic.FieldSimp.Discharger +public meta import Mathlib.Tactic.FieldSimp.Lemmas +public meta import Mathlib.Util.AtLocation +public meta import Mathlib.Util.AtomM.Recurse +public meta import Mathlib.Util.SynthesizeUsing /-! # `field_simp` tactic @@ -17,6 +19,8 @@ import Mathlib.Util.SynthesizeUsing Tactic to clear denominators in algebraic expressions. -/ +public meta section + open Lean Meta Qq namespace Mathlib.Tactic.FieldSimp @@ -255,7 +259,7 @@ namespace DenomCondition /-- Given a field-simp-normal-form expression `L` (a product of powers of atoms), a proof (according to the value of `DenomCondition`) of that expression's nonzeroness, strict positivity, etc. -/ -def proof {iM : Q(GroupWithZero $M)} (L : qNF M) : DenomCondition iM → Type +@[expose] def proof {iM : Q(GroupWithZero $M)} (L : qNF M) : DenomCondition iM → Type | .none => Unit | .nonzero => Q(NF.eval $(qNF.toNF L) ≠ 0) | .positive _ _ _ _ => Q(0 < NF.eval $(qNF.toNF L)) @@ -787,4 +791,4 @@ attribute [field, inherit_doc FieldSimp.proc] fieldEq fieldLe fieldLt /-! We register `field_simp` with the `hint` tactic. -/ -register_hint field_simp +register_hint 1000 field_simp diff --git a/Mathlib/Tactic/FieldSimp/Attr.lean b/Mathlib/Tactic/FieldSimp/Attr.lean index a8a2369a6c7e02..8532a9a85c93f0 100644 --- a/Mathlib/Tactic/FieldSimp/Attr.lean +++ b/Mathlib/Tactic/FieldSimp/Attr.lean @@ -3,10 +3,14 @@ Copyright (c) 2025 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! # Attribute grouping the `field_simp` simprocs -/ +public meta section + open Lean Meta /-- Initialize the attribute `field` grouping the simprocs associated to the field_simp tactic. -/ diff --git a/Mathlib/Tactic/FieldSimp/Discharger.lean b/Mathlib/Tactic/FieldSimp/Discharger.lean index 2fc8ed6f6dc841..4d806e295b455c 100644 --- a/Mathlib/Tactic/FieldSimp/Discharger.lean +++ b/Mathlib/Tactic/FieldSimp/Discharger.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, David Renshaw -/ +module -import Mathlib.Tactic.Positivity.Core -import Mathlib.Util.DischargerAsTactic +public meta import Mathlib.Tactic.Positivity.Core +public meta import Mathlib.Util.DischargerAsTactic +import all Lean.Meta.Tactic.Simp.Rewrite /-! # Discharger for `field_simp` tactic @@ -35,6 +37,8 @@ fundamentally difficult. -/ +public meta section + namespace Mathlib.Tactic.FieldSimp open Lean Elab.Tactic Parser.Tactic Lean.Meta @@ -46,8 +50,6 @@ private def dischargerTraceMessage {ε : Type*} (prop : Expr) : | .error _ | .ok none => return m!"{crossEmoji} discharge {prop}" | .ok (some _) => return m!"{checkEmoji} discharge {prop}" -open private Simp.dischargeUsingAssumption? from Lean.Meta.Tactic.Simp.Rewrite - /-- Discharge strategy for the `field_simp` tactic. -/ partial def discharge (prop : Expr) : SimpM (Option Expr) := withTraceNode `Tactic.field_simp (dischargerTraceMessage prop) do diff --git a/Mathlib/Tactic/FieldSimp/Lemmas.lean b/Mathlib/Tactic/FieldSimp/Lemmas.lean index f5da7a6b2d6e87..0694dbe28c4f77 100644 --- a/Mathlib/Tactic/FieldSimp/Lemmas.lean +++ b/Mathlib/Tactic/FieldSimp/Lemmas.lean @@ -3,18 +3,25 @@ Copyright (c) 2025 Michael Rothgang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth, Arend Mellendijk, Michael Rothgang -/ -import Mathlib.Algebra.BigOperators.Group.List.Basic -import Mathlib.Algebra.Field.Power -import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic -import Mathlib.Util.Qq +module + +public import Mathlib.Algebra.BigOperators.Group.List.Basic +public import Mathlib.Algebra.Field.Power +public import Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic +public import Mathlib.Util.Qq +meta import Mathlib.Algebra.Group.Nat.Even +meta import Mathlib.Algebra.Group.Int.Even /-! # Lemmas for the field_simp tactic -/ +public section + open List namespace Mathlib.Tactic.FieldSimp +@[expose] public section section zpow' @@ -218,7 +225,7 @@ theorem cons_pos [GroupWithZero M] [PartialOrder M] [PosMulStrictMono M] [PosMul theorem atom_eq_eval [GroupWithZero M] (x : M) : x = NF.eval [(1, x)] := by simp [eval] variable (M) in -theorem one_eq_eval [GroupWithZero M] : (1:M) = NF.eval (M := M) [] := rfl +theorem one_eq_eval [GroupWithZero M] : (1:M) = NF.eval (M := M) [] := (rfl) theorem mul_eq_eval₁ [CommGroupWithZero M] (a₁ : ℤ × M) {a₂ : ℤ × M} {l₁ l₂ l : NF M} (h : l₁.eval * (a₂ ::ᵣ l₂).eval = l.eval) : @@ -365,10 +372,11 @@ theorem eval_cons_eq_eval_of_eq_of_eq [CommGroupWithZero M] (r : ℤ) (x : M) {t rw [← h', eval_cons, eval_cons, h] end NF +end /-! ### Negations of algebraic operations -/ -section Sign +@[expose] public meta section Sign open Lean Qq variable {v : Level} {M : Q(Type v)} diff --git a/Mathlib/Tactic/FinCases.lean b/Mathlib/Tactic/FinCases.lean index 0fb313ef81e297..951e0c8b429cbd 100644 --- a/Mathlib/Tactic/FinCases.lean +++ b/Mathlib/Tactic/FinCases.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Hanting Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Hanting Zhang -/ -import Mathlib.Tactic.Core -import Mathlib.Lean.Expr.Basic -import Mathlib.Data.Fintype.Basic +module + +public meta import Mathlib.Tactic.Core +public meta import Mathlib.Lean.Expr.Basic +public meta import Mathlib.Data.Fintype.Basic /-! # The `fin_cases` tactic. @@ -17,6 +19,8 @@ or a hypothesis of the form `h : A`, where `[Fintype A]` is available, separate cases for each possible value. -/ +public meta section + open Lean.Meta namespace Lean.Elab.Tactic diff --git a/Mathlib/Tactic/Find.lean b/Mathlib/Tactic/Find.lean index 7f443d23561213..8fe1bb83a04297 100644 --- a/Mathlib/Tactic/Find.lean +++ b/Mathlib/Tactic/Find.lean @@ -3,10 +3,12 @@ Copyright (c) 2021 Sebastian Ullrich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Ullrich -/ -import Mathlib.Init -import Batteries.Util.Cache -import Lean.HeadIndex -import Lean.Elab.Command +module + +public import Mathlib.Init +public meta import Batteries.Util.Cache +public meta import Lean.HeadIndex +public meta import Lean.Elab.Command /-! # The `#find` command and tactic. @@ -23,6 +25,8 @@ or the `find` tactic which looks for lemmas which are `apply`able against the cu -/ +public meta section + open Lean Std open Lean.Meta open Lean.Elab diff --git a/Mathlib/Tactic/FindSyntax.lean b/Mathlib/Tactic/FindSyntax.lean index 9af6b6ee07bcac..b33d603af02c47 100644 --- a/Mathlib/Tactic/FindSyntax.lean +++ b/Mathlib/Tactic/FindSyntax.lean @@ -3,9 +3,10 @@ Copyright (c) 2024 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Lean.Elab.Command -import Mathlib.Init +public meta import Lean.Elab.Command +public import Mathlib.Init /-! # The `#find_syntax` command @@ -17,6 +18,8 @@ It also makes a very crude effort at regenerating what the syntax looks like, by `Expr`ession tree of the corresponding parser. -/ +public meta section + namespace Mathlib.FindSyntax open Lean Elab Command @@ -81,7 +84,8 @@ elab "#find_syntax " id:str d:(&" approx")? : command => do -- then we include an entry into the final message. if 2 ≤ (nm.toString.splitOn id.getString).length || 2 ≤ (rem.splitOn id.getString).length then let mod := (← findModuleOf? nm).getD (← getMainModule) - match_results := match_results.insert mod <| (match_results.getD mod #[]).push (nm, rem.trim) + match_results := match_results.insert mod <| (match_results.getD mod #[]).push + (nm, rem.trimAscii.copy) -- We sort the messages to produce a more stable output. let sorted_results := match_results.toArray.qsort (·.1.lt ·.1) let sorted_results := sorted_results.map fun (mod, msgs) => (mod, msgs.qsort (·.1.lt ·.1)) diff --git a/Mathlib/Tactic/Finiteness.lean b/Mathlib/Tactic/Finiteness.lean index 6de02f1520eb7f..3c61963f8db645 100644 --- a/Mathlib/Tactic/Finiteness.lean +++ b/Mathlib/Tactic/Finiteness.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ -import Mathlib.Tactic.Positivity.Core +module + +public meta import Mathlib.Tactic.Positivity.Core /-! # Finiteness tactic @@ -37,6 +39,8 @@ Improve `finiteness` to also deal with other situations, such as balls in proper a locally finite measure. -/ +public meta section + open Aesop.BuiltinRules in attribute [aesop (rule_sets := [finiteness]) safe -50] assumption intros @@ -71,4 +75,4 @@ macro (name := finiteness_nonterminal) "finiteness_nonterminal" c:Aesop.tactic_c /-! We register `finiteness` with the `hint` tactic. -/ -register_hint finiteness +register_hint 1000 finiteness diff --git a/Mathlib/Tactic/Finiteness/Attr.lean b/Mathlib/Tactic/Finiteness/Attr.lean index 5c1f8f9027c22e..05d227c7bda6c7 100644 --- a/Mathlib/Tactic/Finiteness/Attr.lean +++ b/Mathlib/Tactic/Finiteness/Attr.lean @@ -3,9 +3,13 @@ Copyright (c) 2024 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Aesop -import Mathlib.Init +module + +public meta import Aesop +public import Mathlib.Init /-! # Finiteness tactic attribute -/ +public meta section + declare_aesop_rule_sets [finiteness] diff --git a/Mathlib/Tactic/FunProp.lean b/Mathlib/Tactic/FunProp.lean index 36f0fd3c2ffcb0..5366ebf758945d 100644 --- a/Mathlib/Tactic/FunProp.lean +++ b/Mathlib/Tactic/FunProp.lean @@ -3,15 +3,17 @@ Copyright (c) 2024 Tomas Skrivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomas Skrivan -/ -import Mathlib.Tactic.FunProp.Attr -import Mathlib.Tactic.FunProp.Core -import Mathlib.Tactic.FunProp.Decl -import Mathlib.Tactic.FunProp.Elab -import Mathlib.Tactic.FunProp.FunctionData -import Mathlib.Tactic.FunProp.Mor -import Mathlib.Tactic.FunProp.Theorems -import Mathlib.Tactic.FunProp.ToBatteries -import Mathlib.Tactic.FunProp.Types +module + +public meta import Mathlib.Tactic.FunProp.Attr +public meta import Mathlib.Tactic.FunProp.Core +public meta import Mathlib.Tactic.FunProp.Decl +public meta import Mathlib.Tactic.FunProp.Elab +public meta import Mathlib.Tactic.FunProp.FunctionData +public meta import Mathlib.Tactic.FunProp.Mor +public meta import Mathlib.Tactic.FunProp.Theorems +public meta import Mathlib.Tactic.FunProp.ToBatteries +public meta import Mathlib.Tactic.FunProp.Types /-! # Tactic `fun_prop` for proving function properties like `Continuous f`, `Differentiable ℝ f`, ... @@ -342,3 +344,5 @@ There are four types of theorems that are used a bit differently. is used together with `aesop` to discharge the `2 ≤ ∞` subgoal. -/ + +public meta section diff --git a/Mathlib/Tactic/FunProp/Attr.lean b/Mathlib/Tactic/FunProp/Attr.lean index 5566c0f9691790..e913fb00a00e2c 100644 --- a/Mathlib/Tactic/FunProp/Attr.lean +++ b/Mathlib/Tactic/FunProp/Attr.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Tactic.FunProp.Decl -import Mathlib.Tactic.FunProp.Theorems +module + +public meta import Mathlib.Tactic.FunProp.Decl +public meta import Mathlib.Tactic.FunProp.Theorems /-! ## `funProp` attribute -/ +public meta section + namespace Mathlib open Lean Meta diff --git a/Mathlib/Tactic/FunProp/ContDiff.lean b/Mathlib/Tactic/FunProp/ContDiff.lean index de919ec8d4bcb0..eaacd82259c5e7 100644 --- a/Mathlib/Tactic/FunProp/ContDiff.lean +++ b/Mathlib/Tactic/FunProp/ContDiff.lean @@ -3,11 +3,13 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.Tactic.FunProp -import Mathlib.Tactic.FunProp.Differentiable +module + +public meta import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas +public meta import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public meta import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public meta import Mathlib.Tactic.FunProp +public meta import Mathlib.Tactic.FunProp.Differentiable deprecated_module "fun_prop knows about ContDiff(At/On) directly; no need to import this file any more" diff --git a/Mathlib/Tactic/FunProp/Core.lean b/Mathlib/Tactic/FunProp/Core.lean index 2f6b51916ba666..4fc317e513653d 100644 --- a/Mathlib/Tactic/FunProp/Core.lean +++ b/Mathlib/Tactic/FunProp/Core.lean @@ -3,16 +3,20 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Tactic.FunProp.Theorems -import Mathlib.Tactic.FunProp.ToBatteries -import Mathlib.Tactic.FunProp.Types -import Mathlib.Lean.Expr.Basic -import Batteries.Tactic.Exact +module + +public meta import Mathlib.Tactic.FunProp.Theorems +public meta import Mathlib.Tactic.FunProp.ToBatteries +public meta import Mathlib.Tactic.FunProp.Types +public meta import Mathlib.Lean.Expr.Basic +public meta import Batteries.Tactic.Exact /-! # Tactic `fun_prop` for proving function properties like `Continuous f`, `Differentiable ℝ f`, ... -/ +public meta section + namespace Mathlib open Lean Meta Qq @@ -53,7 +57,7 @@ def synthesizeArgs (thmId : Origin) (xs : Array Expr) if (← isClass? type).isSome then if (← synthesizeInstance thmId x type) then continue - else if (← isFunProp type.getForallBody) then + else if (← isFunPropGoal type) then -- try function property if let some ⟨proof⟩ ← funProp type then if (← isDefEq x proof) then diff --git a/Mathlib/Tactic/FunProp/Decl.lean b/Mathlib/Tactic/FunProp/Decl.lean index df109057451c05..ce86bbd3ae7c1c 100644 --- a/Mathlib/Tactic/FunProp/Decl.lean +++ b/Mathlib/Tactic/FunProp/Decl.lean @@ -3,12 +3,16 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! ## `funProp` environment extension that stores all registered function properties -/ +public meta section + namespace Mathlib open Lean Meta diff --git a/Mathlib/Tactic/FunProp/Differentiable.lean b/Mathlib/Tactic/FunProp/Differentiable.lean index 3c26d41a901047..951e0a86ad8a3a 100644 --- a/Mathlib/Tactic/FunProp/Differentiable.lean +++ b/Mathlib/Tactic/FunProp/Differentiable.lean @@ -3,16 +3,18 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Analysis.Calculus.FDeriv.Basic -import Mathlib.Analysis.Calculus.FDeriv.Comp -import Mathlib.Analysis.Calculus.FDeriv.Prod -import Mathlib.Analysis.Calculus.FDeriv.Pi -import Mathlib.Analysis.Calculus.FDeriv.Add -import Mathlib.Analysis.Calculus.FDeriv.Mul -import Mathlib.Analysis.Calculus.Deriv.Inv -import Mathlib.Analysis.SpecialFunctions.ExpDeriv -import Mathlib.Analysis.SpecialFunctions.Log.Deriv -import Mathlib.Tactic.FunProp +module + +public meta import Mathlib.Analysis.Calculus.FDeriv.Basic +public meta import Mathlib.Analysis.Calculus.FDeriv.Comp +public meta import Mathlib.Analysis.Calculus.FDeriv.Prod +public meta import Mathlib.Analysis.Calculus.FDeriv.Pi +public meta import Mathlib.Analysis.Calculus.FDeriv.Add +public meta import Mathlib.Analysis.Calculus.FDeriv.Mul +public meta import Mathlib.Analysis.Calculus.Deriv.Inv +public meta import Mathlib.Analysis.SpecialFunctions.ExpDeriv +public meta import Mathlib.Analysis.SpecialFunctions.Log.Deriv +public meta import Mathlib.Tactic.FunProp deprecated_module "fun_prop knows about Differentiable(At/On) directly; no need to import this file any more" diff --git a/Mathlib/Tactic/FunProp/Elab.lean b/Mathlib/Tactic/FunProp/Elab.lean index 8111fd1dd42e23..4122ba69968315 100644 --- a/Mathlib/Tactic/FunProp/Elab.lean +++ b/Mathlib/Tactic/FunProp/Elab.lean @@ -3,12 +3,16 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Tactic.FunProp.Core +module + +public meta import Mathlib.Tactic.FunProp.Core /-! ## `funProp` tactic syntax -/ +public meta section + namespace Mathlib open Lean Meta Elab Tactic diff --git a/Mathlib/Tactic/FunProp/FunctionData.lean b/Mathlib/Tactic/FunProp/FunctionData.lean index 65116b33cbeaf6..8336233aa2765b 100644 --- a/Mathlib/Tactic/FunProp/FunctionData.lean +++ b/Mathlib/Tactic/FunProp/FunctionData.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Qq +module -import Mathlib.Tactic.FunProp.Mor -import Mathlib.Tactic.FunProp.ToBatteries +public meta import Qq + +public meta import Mathlib.Tactic.FunProp.Mor +public meta import Mathlib.Tactic.FunProp.ToBatteries /-! ## `funProp` data structure holding information about a function @@ -14,6 +16,8 @@ import Mathlib.Tactic.FunProp.ToBatteries `FunctionData` holds data about function in the form `fun x => f x₁ ... xₙ`. -/ +public meta section + namespace Mathlib open Lean Meta diff --git a/Mathlib/Tactic/FunProp/Mor.lean b/Mathlib/Tactic/FunProp/Mor.lean index 9ad1c190458ec4..3e691f6a23860c 100644 --- a/Mathlib/Tactic/FunProp/Mor.lean +++ b/Mathlib/Tactic/FunProp/Mor.lean @@ -3,7 +3,10 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Init +module + +public import Mathlib.Init +public meta import Lean.Meta.CoeAttr /-! ## `funProp` Meta programming functions like in Lean.Expr.* but for working with bundled morphisms. @@ -20,6 +23,8 @@ expression changes. For example in: the head of expression is considered to be `f` and not `coe`. -/ +public meta section + namespace Mathlib open Lean Meta diff --git a/Mathlib/Tactic/FunProp/Theorems.lean b/Mathlib/Tactic/FunProp/Theorems.lean index 58d4ee710e220d..ae34e587dbb38c 100644 --- a/Mathlib/Tactic/FunProp/Theorems.lean +++ b/Mathlib/Tactic/FunProp/Theorems.lean @@ -3,16 +3,20 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Tactic.FunProp.Decl -import Mathlib.Tactic.FunProp.Types -import Mathlib.Tactic.FunProp.FunctionData -import Mathlib.Lean.Meta.RefinedDiscrTree.Initialize -import Mathlib.Lean.Meta.RefinedDiscrTree.Lookup +module + +public meta import Mathlib.Tactic.FunProp.Decl +public meta import Mathlib.Tactic.FunProp.Types +public meta import Mathlib.Tactic.FunProp.FunctionData +public meta import Mathlib.Lean.Meta.RefinedDiscrTree.Initialize +public meta import Mathlib.Lean.Meta.RefinedDiscrTree.Lookup /-! ## `fun_prop` environment extensions storing theorems for `fun_prop` -/ +public meta section + namespace Mathlib open Lean Meta open Std (TreeMap) @@ -284,7 +288,7 @@ Examples: theorem Continuous_add (hf : Continuous f) (hg : Continuous g) : Continuous (fun x => (f x) + (g x)) ``` -- mor - the head of function body has to be ``DFunLike.code +- mor - the head of function body has to be `DFunLike.coe` ``` theorem ContDiff.clm_apply {f : E → F →L[𝕜] G} {g : E → F} (hf : ContDiff 𝕜 n f) (hg : ContDiff 𝕜 n g) : diff --git a/Mathlib/Tactic/FunProp/ToBatteries.lean b/Mathlib/Tactic/FunProp/ToBatteries.lean index 6181cb3e51cd4b..fc3efee6079016 100644 --- a/Mathlib/Tactic/FunProp/ToBatteries.lean +++ b/Mathlib/Tactic/FunProp/ToBatteries.lean @@ -3,12 +3,16 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Init +module + +public import Mathlib.Init /-! ## `funProp` missing function from standard library -/ +public meta section + namespace Mathlib open Lean Meta diff --git a/Mathlib/Tactic/FunProp/Types.lean b/Mathlib/Tactic/FunProp/Types.lean index 454928eeda4808..a5d1bd36706ee2 100644 --- a/Mathlib/Tactic/FunProp/Types.lean +++ b/Mathlib/Tactic/FunProp/Types.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Tomáš Skřivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomáš Skřivan -/ -import Mathlib.Tactic.FunProp.FunctionData -import Mathlib.Lean.Meta.RefinedDiscrTree.Basic +module + +public meta import Mathlib.Tactic.FunProp.FunctionData +public meta import Mathlib.Lean.Meta.RefinedDiscrTree.Basic /-! ## `funProp` @@ -12,6 +14,8 @@ import Mathlib.Lean.Meta.RefinedDiscrTree.Basic this file defines environment extension for `funProp` -/ +public meta section + namespace Mathlib open Lean Meta diff --git a/Mathlib/Tactic/GCongr.lean b/Mathlib/Tactic/GCongr.lean index 4615c6ac1c0069..35081d49d3a100 100644 --- a/Mathlib/Tactic/GCongr.lean +++ b/Mathlib/Tactic/GCongr.lean @@ -3,16 +3,20 @@ Copyright (c) 2023 Mario Carneiro, Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Heather Macbeth -/ -import Mathlib.Tactic.GCongr.CoreAttrs -import Mathlib.Tactic.Hint +module + +public meta import Mathlib.Tactic.GCongr.CoreAttrs +public meta import Mathlib.Tactic.Hint /-! # Setup for the `gcongr` tactic The core implementation of the `gcongr` ("generalized congruence") tactic is in the file `Tactic.GCongr.Core`. -/ +public meta section + /-! We register `gcongr` with the `hint` tactic. -/ -register_hint gcongr +register_hint 1000 gcongr diff --git a/Mathlib/Tactic/GCongr/Core.lean b/Mathlib/Tactic/GCongr/Core.lean index 8c60fc6368e16e..817e6bbb18aba3 100644 --- a/Mathlib/Tactic/GCongr/Core.lean +++ b/Mathlib/Tactic/GCongr/Core.lean @@ -3,12 +3,14 @@ Copyright (c) 2023 Mario Carneiro, Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Heather Macbeth, Jovan Gerbscheid -/ -import Lean -import Batteries.Lean.Except -import Batteries.Tactic.Exact -import Mathlib.Lean.Elab.Term -import Mathlib.Tactic.GCongr.ForwardAttr -import Mathlib.Order.Defs.Unbundled +module + +public meta import Lean +public meta import Batteries.Lean.Except +public meta import Batteries.Tactic.Exact +public meta import Mathlib.Tactic.GCongr.ForwardAttr +public meta import Mathlib.Order.Defs.Unbundled +import all Lean.Meta.Tactic.Apply /-! # The `gcongr` ("generalized congruence") tactic @@ -121,8 +123,21 @@ example {a b x c d : ℝ} (h1 : a ≤ b) (h2 : c ≤ d) : rel [h1, h2] ``` The `rel` tactic is finishing-only: it fails if any main or side goals are not resolved. + +## Implementation notes + +### Patterns + +When you provide a pattern, such as in `gcongr x ^ 2 * ?_ + 5`, this is elaborated with a metadata +annotation at each `?_` hole. This is then unified with the LHS of the relation in the goal. +As a result, the pattern becomes the same as the LHS, but with mdata annotations that +indicate where the original `?_` holes were. The LHS is then replaced with this expression so that +`gcongr` can tell based on the LHS how far to continue recursively. We also keep track of when +then LHS and RHS swap around, so that we know where to look for the metadata annotation. -/ +public meta section + namespace Mathlib.Tactic.GCongr open Lean Meta @@ -145,9 +160,9 @@ structure GCongrLemma where declName : Name /-- `mainSubgoals` are the subgoals on which `gcongr` will be recursively called. They store - the index of the hypothesis - - the index of the arguments in the conclusion - - the number of parameters in the hypothesis -/ - mainSubgoals : Array (Nat × Nat × Nat) + - the number of parameters in the hypothesis + - whether it is contravariant (i.e. switches the order of the two arguments) -/ + mainSubgoals : Array (Nat × Nat × Bool) /-- The number of arguments that `declName` takes when applying it. -/ numHyps : Nat /-- The given priority of the lemma, for example as `@[gcongr high]`. -/ @@ -196,7 +211,8 @@ def getCongrAppFnArgs (e : Expr) : Option (Name × Array Expr) := some (`_Implies, #[d, b]) | e => e.withApp fun f args => f.constName?.map (·, args) -/-- If `e` is of the form `r a b`, return `(r, a, b)`. -/ +/-- If `e` is of the form `r a b`, return `(r, a, b)`. +Note: we assume that `e` does not have an `Expr.mdata` annotation. -/ def getRel (e : Expr) : Option (Name × Expr × Expr) := match e with | .app (.app rel lhs) rhs => rel.getAppFn.constName?.map (·, lhs, rhs) @@ -207,6 +223,13 @@ def getRel (e : Expr) : Option (Name × Expr × Expr) := none | _ => none +/-- If `e` is of the form `r a b`, replace either `a` or `b` with `e`. -/ +def updateRel (r e : Expr) (isLhs : Bool) : Expr := + match r with + | .forallE _ d b _ => if isLhs then r.updateForallE! e b else r.updateForallE! d e + | .app (.app rel lhs) rhs => if isLhs then mkApp2 rel e rhs else mkApp2 rel lhs e + | _ => r + /-- Construct the `GCongrLemma` data from a given lemma. -/ def makeGCongrLemma (declName : Name) (declTy : Expr) (numHyps prio : Nat) : MetaM GCongrLemma := do withDefault <| forallBoundedTelescope declTy numHyps fun xs targetTy => withReducible do @@ -220,23 +243,20 @@ def makeGCongrLemma (declName : Name) (declTy : Expr) (numHyps prio : Nat) : Met let some (head', rhsArgs) := getCongrAppFnArgs rhs | fail "RHS is not suitable for congruence" unless head == head' && lhsArgs.size == rhsArgs.size do fail "LHS and RHS do not have the same head function and arity" - let mut numVarying := 0 let mut pairs := #[] -- iterate through each pair of corresponding (LHS/RHS) inputs to the head function `head` in -- the conclusion of the lemma - for i in [:lhsArgs.size] do - let e1 := lhsArgs[i]! - let e2 := rhsArgs[i]! + for e1 in lhsArgs, e2 in rhsArgs do -- we call such a pair a "varying argument" pair if the LHS/RHS inputs are not defeq -- (and not proofs) let isEq ← isDefEq e1 e2 <||> (isProof e1 <&&> isProof e2) if !isEq then -- verify that the "varying argument" pairs are free variables (after eta-reduction) - let .fvar e1 := e1.eta | fail "Not all arguments are free variables" - let .fvar e2 := e2.eta | fail "Not all arguments are free variables" + let .fvar e1 := e1.eta | fail "Not all varying arguments are free variables" + let .fvar e2 := e2.eta | fail "Not all varying arguments are free variables" -- add such a pair to the `pairs` array - pairs := pairs.push (i, e1, e2) - numVarying := numVarying + 1 + pairs := pairs.push (e1, e2) + let numVarying := pairs.size if numVarying = 0 then fail "LHS and RHS are the same" let mut mainSubgoals := #[] @@ -248,27 +268,26 @@ def makeGCongrLemma (declName : Name) (declTy : Expr) (numHyps prio : Nat) : Met -- `lhs₁ _ ... _ ≈ rhs₁ _ ... _` (for a possibly different relation `≈` than the relation -- `rel` above) let hypTy ← whnf hypTy + let findPair (lhs rhs : FVarId) : Option Bool := + pairs.findSome? fun pair => + if (lhs, rhs) == pair then false else if (rhs, lhs) == pair then true else none if let some (_, lhs₁, rhs₁) := getRel hypTy then if let .fvar lhs₁ := lhs₁.getAppFn then if let .fvar rhs₁ := rhs₁.getAppFn then -- check whether `(lhs₁, rhs₁)` is in some order one of the "varying argument" pairs from -- the conclusion to the lemma - if let some j := pairs.find? fun (_, e1, e2) => - lhs₁ == e1 && rhs₁ == e2 || lhs₁ == e2 && rhs₁ == e1 - then + if let some isContra := findPair lhs₁ rhs₁ then -- if yes, record the index of this antecedent as a "main subgoal", together with the -- index of the "varying argument" pair it corresponds to - return mainSubgoals.push (i, j.1, args.size) + return mainSubgoals.push (i, args.size, isContra) else -- now check whether `hypTy` is of the form `rhs₁ _ ... _`, -- and whether the last hypothesis is of the form `lhs₁ _ ... _`. if let .fvar rhs₁ := hypTy.getAppFn then if let some lastFVar := args.back? then if let .fvar lhs₁ := (← inferType lastFVar).getAppFn then - if let some j := pairs.find? fun (_, e1, e2) => - lhs₁ == e1 && rhs₁ == e2 || lhs₁ == e2 && rhs₁ == e1 - then - return mainSubgoals.push (i, j.1, args.size - 1) + if let some isContra := findPair lhs₁ rhs₁ then + return mainSubgoals.push (i, args.size - 1, isContra) return mainSubgoals i := i + 1 -- store all the information from this parse of the lemma's structure in a `GCongrLemma` @@ -358,7 +377,7 @@ open Elab Tactic /-- Attempt to resolve an (implicitly) relational goal by one of a provided list of hypotheses, either with such a hypothesis directly or by a limited palette of relational forward-reasoning from these hypotheses. -/ -def _root_.Lean.MVarId.gcongrForward (hs : Array Expr) (g : MVarId) : MetaM Unit := +def _root_.Lean.MVarId.gcongrForward (hs : Array Expr) (g : MVarId) : MetaM Bool := withReducible do let s ← saveState withTraceNode `Meta.gcongr (fun _ => return m!"gcongr_forward: ⊢ {← g.getType}") do @@ -369,16 +388,16 @@ def _root_.Lean.MVarId.gcongrForward (hs : Array Expr) (g : MVarId) : MetaM Unit tacs.firstM fun (n, tac) => withTraceNode `Meta.gcongr (return m!"{·.emoji} trying {n} on {h} : {← inferType h}") do tac.eval h g - return + return true catch _ => s.restore - throwError "gcongr_forward failed" + return false /-- This is used as the default main-goal discharger, consisting of running `Lean.MVarId.gcongrForward` (trying a term together with limited forward-reasoning on that term) on each nontrivial hypothesis. -/ -def gcongrForwardDischarger (goal : MVarId) : MetaM Unit := Elab.Term.TermElabM.run' do +def gcongrForwardDischarger (goal : MVarId) : MetaM Bool := Elab.Term.TermElabM.run' do let mut hs := #[] -- collect the nontrivial hypotheses for h in ← getLCtx do @@ -387,16 +406,28 @@ def gcongrForwardDischarger (goal : MVarId) : MetaM Unit := Elab.Term.TermElabM. -- run `Lean.MVarId.gcongrForward` on each one goal.gcongrForward hs -/-- Determine whether `template` contains a `?_`. -This guides the `gcongr` tactic when it is given a template. -/ -def containsHole (template : Expr) : MetaM Bool := do - let mctx ← getMCtx - let hasMVar := template.findMVar? fun mvarId => - if let some mdecl := mctx.findDecl? mvarId then - mdecl.kind matches .syntheticOpaque - else - false - return hasMVar.isSome +/-- Annotate `e` with a `gcongrHole` mdata annotation. -/ +def mkHoleAnnotation (e : Expr) : Expr := + mkAnnotation `gcongrHole e + +/-- Check whether `e` has a `gcongrHole` mdata annotation. -/ +def hasHoleAnnotation (e : Expr) : Bool := + annotation? `gcongrHole e |>.isSome + +/-- Determine whether `e` contains a `gcongrHole` mdata annotation in any subexpression. +This tells `gcongr` whether to continue applying `gcongr` lemmas. -/ +def containsHoleAnnotation (e : Expr) : Bool := + (e.find? hasHoleAnnotation).isSome + +/-- (Internal for `gcongr`) +Elaborates to an expression satisfying `hasHoleAnnotation`. -/ +scoped syntax (name := gcongrHoleExpand) "gcongrHole%" term : term + +@[term_elab gcongrHoleExpand, inherit_doc gcongrHoleExpand] +def elabCHoleExpand : Term.TermElab := fun stx expectedType? => do + match stx with + | `(gcongrHole% $e) => return mkHoleAnnotation (← Term.elabTerm e expectedType?) + | _ => throwUnsupportedSyntax section Trans @@ -419,14 +450,13 @@ For example, the relation `a ≡ b [ZMOD n]` has an instance of `IsTrans`, so a def relImpRelLemma (arity : Nat) : List GCongrLemma := if arity < 2 then [] else [{ declName := ``rel_imp_rel - mainSubgoals := #[(7, arity - 2, 0), (8, arity - 1, 0)] + mainSubgoals := #[(7, 0, true), (8, 0, false)] numHyps := 9 key := default, prio := default, numVarying := default }] end Trans -open private isDefEqApply throwApplyError reorderGoals from Lean.Meta.Tactic.Apply in /-- `Lean.MVarId.applyWithArity` is a copy of `Lean.MVarId.apply`, where the arity of the applied function is given explicitly instead of being inferred. @@ -469,135 +499,104 @@ look up any relevant `@[gcongr]` lemmas, try to apply them, recursively run the is a user-provided template, first check that the template asks us to descend this far into the match. -/ partial def _root_.Lean.MVarId.gcongr - (g : MVarId) (template : Option Expr) (names : List (TSyntax ``binderIdent)) + (g : MVarId) (mdataLhs? : Option Bool) (names : List (TSyntax ``binderIdent)) (depth : Nat := 1000000) - (grewriteHole : Option MVarId := none) - (mainGoalDischarger : MVarId → MetaM Unit := gcongrForwardDischarger) + (mainGoalDischarger : MVarId → MetaM Bool := gcongrForwardDischarger) (sideGoalDischarger : MVarId → MetaM Unit := gcongrDischarger) : MetaM (Bool × List (TSyntax ``binderIdent) × Array MVarId) := g.withContext do withTraceNode `Meta.gcongr (fun _ => return m!"gcongr: ⊢ {← g.getType}") do - match template with - | none => - -- A. If there is no template, try to resolve the goal by the provided tactic - -- `mainGoalDischarger`, and continue on if this fails. - try - (withReducible g.applyRfl) <|> mainGoalDischarger g + if mdataLhs?.isNone then + -- A. If there is no pattern annotation, try to resolve the goal by reflexivity, or + -- by the provided tactic `mainGoalDischarger`, and continue on if this fails. + let success ← try withReducible g.applyRfl; pure true catch _ => mainGoalDischarger g + if success then return (true, names, #[]) - catch _ => pure () - | some tpl => - -- B. If there is a template: - -- (i) if the template is `?_` (or `?_ x1 x2`, created by entering binders) + -- If we have reached the depth limit, return the unsolved goal + let depth + 1 := depth | return (false, names, #[g]) -- we know that there is no mdata to remove + -- Check that the goal is of the form `rel (lhsHead _ ... _) (rhsHead _ ... _)` + let rel ← withReducible g.getType' + let some (relName, lhs, rhs) := getRel rel | throwTacticEx `gcongr g m!"{rel} is not a relation" + -- If there is a pattern annotation + if let some mdataLhs := mdataLhs? then + let mdataExpr := if mdataLhs then lhs else rhs + -- if the annotation is at the head of the annotated expression, -- then try to resolve the goal by the provided tactic `mainGoalDischarger`; -- if this fails, stop and report the existing goal. - if let .mvar mvarId := tpl.getAppFn then - if let some hole := grewriteHole then - if hole == mvarId then mainGoalDischarger g; return (true, names, #[]) + if hasHoleAnnotation mdataExpr then + if ← mainGoalDischarger g then + return (true, names, #[]) else - if let .syntheticOpaque ← mvarId.getKind then - try mainGoalDischarger g; return (true, names, #[]) - catch _ => return (false, names, #[g]) - -- B. If the template doesn't contain any `?_`, and the goal wasn't closed by `rfl`, + -- clear the mdata from the goal + let g ← g.replaceTargetDefEq (updateRel rel mdataExpr.mdataExpr! mdataLhs) + return (false, names, #[g]) + -- If there are no annotations at all, we close the goal with `rfl`. Otherwise, -- we report that the provided pattern doesn't apply. - let hasHole ← match grewriteHole with - | none => containsHole tpl - | some hole => pure (tpl.findMVar? (· == hole)).isSome - unless hasHole do + unless containsHoleAnnotation mdataExpr do try withDefault g.applyRfl; return (true, names, #[]) catch _ => throwTacticEx `gcongr g m!"\ subgoal {← withReducible g.getType'} is not allowed by the provided pattern \ and is not closed by `rfl`" - -- (ii) if the template is *not* `?_` then continue on. - match depth with - | 0 => try mainGoalDischarger g; return (true, names, #[]) catch _ => return (false, names, #[g]) - | depth + 1 => - -- Check that the goal is of the form `rel (lhsHead _ ... _) (rhsHead _ ... _)` - let rel ← withReducible g.getType' - let some (relName, lhs, rhs) := getRel rel | throwTacticEx `gcongr g m!"{rel} is not a relation" - let some (lhsHead, lhsArgs) := getCongrAppFnArgs lhs - | if template.isNone then return (false, names, #[g]) - throwTacticEx `gcongr g m!"the head of {lhs} is not a constant" - let some (rhsHead, rhsArgs) := getCongrAppFnArgs rhs - | if template.isNone then return (false, names, #[g]) - throwTacticEx `gcongr g m!"the head of {rhs} is not a constant" - -- B. If there is a template, check that it is of the form `tplHead _ ... _` and that - -- `tplHead = lhsHead = rhsHead` - let tplArgs ← if let some tpl := template then - let some (tplHead, tplArgs) := getCongrAppFnArgs tpl - | throwTacticEx `gcongr g m!"the head of {tpl} is not a constant" - if grewriteHole.isNone then - unless tplHead == lhsHead && tplArgs.size == lhsArgs.size do - throwError "expected {tplHead}, got {lhsHead}\n{lhs}" - unless tplHead == rhsHead && tplArgs.size == rhsArgs.size do - throwError "expected {tplHead}, got {rhsHead}\n{rhs}" - pure <| tplArgs.map some - -- A. If there is no template, check that `lhs` and `rhs` have the same shape - else - unless lhsHead == rhsHead && lhsArgs.size == rhsArgs.size do - -- (if not, stop and report the existing goal) - return (false, names, #[g]) - pure <| Array.replicate lhsArgs.size none + -- If there are more annotations, then continue on. + + let lhs ← if relName == `_Implies then whnfR lhs else pure lhs + let rhs ← if relName == `_Implies then whnfR rhs else pure rhs + let some (lhsHead, lhsArgs) := getCongrAppFnArgs lhs | + if mdataLhs?.isNone then return (false, names, #[g]) + throwTacticEx `gcongr g m!"the head of {lhs} is not a constant" + let some (rhsHead, rhsArgs) := getCongrAppFnArgs rhs | + if mdataLhs?.isNone then return (false, names, #[g]) + throwTacticEx `gcongr g m!"the head of {rhs} is not a constant" + unless lhsHead == rhsHead && lhsArgs.size == rhsArgs.size do + if mdataLhs?.isNone then return (false, names, #[g]) + throwTacticEx `gcongr g m!"{lhs} and {rhs} are not of the same shape" let s ← saveState -- Look up the `@[gcongr]` lemmas whose conclusion has the same relation and head function as -- the goal - let key := { relName, head := lhsHead, arity := tplArgs.size } + let key := { relName, head := lhsHead, arity := lhsArgs.size } let mut lemmas := (gcongrExt.getState (← getEnv)).getD key [] if relName == `_Implies then - lemmas := lemmas ++ relImpRelLemma tplArgs.size + lemmas := lemmas ++ relImpRelLemma lhsArgs.size for lem in lemmas do let gs ← try -- Try `apply`-ing such a lemma to the goal. let const ← mkConstWithFreshMVarLevels lem.declName - Except.ok <$> withReducible - (g.applyWithArity const lem.numHyps { synthAssignedInstances := false }) - catch e => pure (Except.error e) - match gs with - | .error _ => - -- If the `apply` fails, go on to try to apply the next matching lemma. + withReducible (g.applyWithArity const lem.numHyps { synthAssignedInstances := false }) + catch _ => s.restore - | .ok gs => - let some e ← getExprMVarAssignment? g | panic! "unassigned?" - let args := e.getAppArgs - let mut subgoals := #[] - let mut names := names - -- If the `apply` succeeds, iterate over `(i, j)` belonging to the lemma's `mainSubgoal` - -- list: here `i` is an index in the lemma's array of antecedents, and `j` is an index in - -- the array of arguments to the head function in the conclusion of the lemma (this should - -- be the same as the head function of the LHS and RHS of our goal), such that the `i`-th - -- antecedent to the lemma is a relation between the LHS and RHS `j`-th inputs to the head - -- function in the goal. - for (i, j, numHyps) in lem.mainSubgoals do - -- We anticipate that such a "main" subgoal should not have been solved by the `apply` by - -- unification ... - let some (.mvar mvarId) := args[i]? | panic! "what kind of lemma is this?" - -- Introduce all variables and hypotheses in this subgoal. - let (names2, _vs, mvarId) ← mvarId.introsWithBinderIdents names (maxIntros? := numHyps) - -- B. If there is a template, look up the part of the template corresponding to the `j`-th - -- input to the head function - let tpl ← tplArgs[j]!.mapM fun e => do - let (_vs, _, e) ← lambdaMetaTelescope e - pure e - -- Recurse: call ourself (`Lean.MVarId.gcongr`) on the subgoal with (if available) the - -- appropriate template - let (_, names2, subgoals2) ← mvarId.gcongr tpl names2 depth grewriteHole mainGoalDischarger - sideGoalDischarger - (names, subgoals) := (names2, subgoals ++ subgoals2) - let mut out := #[] - -- Also try the discharger on any "side" (i.e., non-"main") goals which were not resolved - -- by the `apply`. - for g in gs do - if !(← g.isAssigned) && !subgoals.contains g then - let s ← saveState - try - let (_, g') ← g.intros - sideGoalDischarger g' - catch _ => - s.restore - out := out.push g - -- Return all unresolved subgoals, "main" or "side" - return (true, names, out ++ subgoals) + continue + let some e ← getExprMVarAssignment? g | panic! "unassigned?" + let args := e.getAppArgs + let mut subgoals := #[] + let mut names := names + -- If the `apply` succeeds, iterate over the lemma's `mainSubgoals` list. + for (i, numHyps, isContra) in lem.mainSubgoals do + -- We anticipate that such a "main" subgoal should not have been solved by the `apply` by + -- unification ... + let some (.mvar mvarId) := args[i]? | panic! "what kind of lemma is this?" + -- Introduce all variables and hypotheses in this subgoal. + let (names2, _vs, mvarId) ← mvarId.introsWithBinderIdents names (maxIntros? := numHyps) + -- Recurse: call ourself (`Lean.MVarId.gcongr`) on the subgoal with (if available) the + -- appropriate template + let mdataLhs?' := mdataLhs?.map (· != isContra) + let (_, names2, subgoals2) ← mvarId.gcongr mdataLhs?' names2 depth mainGoalDischarger + sideGoalDischarger + (names, subgoals) := (names2, subgoals ++ subgoals2) + let mut out := #[] + -- Also try the discharger on any "side" (i.e., non-"main") goals which were not resolved + -- by the `apply`. + for g in gs do + if !(← g.isAssigned) && !subgoals.contains g then + let s ← saveState + try + sideGoalDischarger (← g.intros).2 + catch _ => + s.restore + out := out.push g + -- Return all unresolved subgoals, "main" or "side" + return (true, names, out ++ subgoals) -- A. If there is no template, and there was no `@[gcongr]` lemma which matched the goal, -- report this goal back. - if template.isNone then + if mdataLhs?.isNone then return (false, names, #[g]) -- B. If there is a template, and there was no `@[gcongr]` lemma which matched the template, -- fail. @@ -657,21 +656,30 @@ elab "gcongr" template:(ppSpace colGt term)? withArg:((" with" (ppSpace colGt binderIdent)+)?) : tactic => do let g ← getMainGoal g.withContext do - let some (_rel, lhs, _rhs) := getRel (← withReducible g.getType') + let type ← withReducible g.getType' + let some (_rel, lhs, _rhs) := getRel type | throwError "gcongr failed, not a relation" -- Get the names from the `with x y z` list let names := (withArg.raw[1].getArgs.map TSyntax.mk).toList -- Time to actually run the core tactic `Lean.MVarId.gcongr`! - let (progress, _, unsolvedGoalStates) ← match template with - | none => g.gcongr none names - | some e => match e.raw.isNatLit? with - | some depth => g.gcongr none names (depth := depth) - | none => - -- Elaborate the template (e.g. `x * ?_ + _`) - let template ← Term.elabPattern e (← inferType lhs) - unless ← containsHole template do - throwError "invalid template {template}, it doesn't contain any `?_`" - g.gcongr template names + let (progress, _, unsolvedGoalStates) ← do + let some e := template | g.gcongr none names + if let some depth := e.raw.isNatLit? then + g.gcongr none names (depth := depth) + else + -- Elaborate the template (e.g. `x * ?_ + _`) + -- First, we replace occurrences of `?_` with `gcongrHole% ?_` + let e ← e.raw.replaceM fun stx => + if stx.isOfKind ``Parser.Term.syntheticHole then `(gcongrHole% _%$stx) else pure none + let patt ← withTheReader Term.Context ({ · with + ignoreTCFailures := true, errToSorry := false }) <| Term.elabTerm e (← inferType lhs) + unless containsHoleAnnotation patt do + throwError "invalid pattern {patt}, it doesn't contain any `?_`" + unless ← withReducible <| isDefEq patt lhs do + throwError "invalid pattern {patt}, it does not match with {lhs}" + let patt ← instantiateMVars patt + let g ← g.replaceTargetDefEq (updateRel type patt true) + g.gcongr true names if progress then replaceMainGoal unsolvedGoalStates.toList else diff --git a/Mathlib/Tactic/GCongr/CoreAttrs.lean b/Mathlib/Tactic/GCongr/CoreAttrs.lean index c3248997128612..5a8b58f04da3cd 100644 --- a/Mathlib/Tactic/GCongr/CoreAttrs.lean +++ b/Mathlib/Tactic/GCongr/CoreAttrs.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ -import Mathlib.Tactic.GCongr.Core +module + +public meta import Mathlib.Tactic.GCongr.Core /-! # gcongr attributes for lemmas up in the import chain @@ -12,6 +14,8 @@ In this file we add `gcongr` attribute to lemmas in `Lean.Init`. We may add lemmas from other files imported by `Mathlib/Tactic/GCongr/Core` later. -/ +public meta section + namespace Mathlib.Tactic.GCongr variable {a b c : Prop} diff --git a/Mathlib/Tactic/GCongr/ForwardAttr.lean b/Mathlib/Tactic/GCongr/ForwardAttr.lean index b2223676bf279e..2bf4ba220629b1 100644 --- a/Mathlib/Tactic/GCongr/ForwardAttr.lean +++ b/Mathlib/Tactic/GCongr/ForwardAttr.lean @@ -3,13 +3,17 @@ Copyright (c) 2023 Mario Carneiro, Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Heather Macbeth -/ -import Mathlib.Init -import Batteries.Tactic.Basic +module + +public import Mathlib.Init +public meta import Batteries.Tactic.Basic /-! # Environment extension for the forward-reasoning part of the `gcongr` tactic -/ +public meta section + open Lean Meta Elab Tactic namespace Mathlib.Tactic.GCongr @@ -43,7 +47,8 @@ initialize registerBuiltinAttribute { add := fun declName stx kind => match stx with | `(attr| gcongr_forward) => do unless kind == AttributeKind.global do - throwError "invalid attribute 'gcongr_forward', must be global" + throwAttrMustBeGlobal `gcongr_forward kind + ensureAttrDeclIsMeta `gcongr_forward declName kind let env ← getEnv unless (env.getModuleIdxFor? declName).isNone do throwError "invalid attribute 'gcongr_forward', declaration is in an imported module" diff --git a/Mathlib/Tactic/GRewrite.lean b/Mathlib/Tactic/GRewrite.lean index 905e5f13f4acab..f6718134a23201 100644 --- a/Mathlib/Tactic/GRewrite.lean +++ b/Mathlib/Tactic/GRewrite.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Sebastian Zimmer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Zimmer, Mario Carneiro, Heather Macbeth, Jovan Gerbscheid -/ -import Mathlib.Tactic.GRewrite.Elab +module + +public meta import Mathlib.Tactic.GRewrite.Elab /-! @@ -13,3 +15,5 @@ The `grw`/`grewrite` tactic is a generalization of the `rewrite` tactic that wor other than equality. The core implementation of `grewrite` is in the file `Tactic.GRewrite.Core` -/ + +public meta section diff --git a/Mathlib/Tactic/GRewrite/Core.lean b/Mathlib/Tactic/GRewrite/Core.lean index 59031b8e36d2e3..aa5c81145664ff 100644 --- a/Mathlib/Tactic/GRewrite/Core.lean +++ b/Mathlib/Tactic/GRewrite/Core.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Sebastian Zimmer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Zimmer, Mario Carneiro, Heather Macbeth, Jovan Gerbscheid -/ -import Mathlib.Tactic.GCongr.Core +module + +public meta import Mathlib.Tactic.GCongr.Core /-! @@ -24,16 +26,18 @@ With the current implementation, we can instead use `nth_grw`. -/ +public meta section + open Lean Meta namespace Mathlib.Tactic /-- Given a proof of `a ~ b`, close a goal of the form `a ~' b` or `b ~' a` for some possibly different relation `~'`. -/ -def GRewrite.dischargeMain (hrel : Expr) (goal : MVarId) : MetaM Unit := do - try - goal.gcongrForward #[hrel] - catch _ => +def GRewrite.dischargeMain (hrel : Expr) (goal : MVarId) : MetaM Bool := do + if ← goal.gcongrForward #[hrel] then + return true + else throwTacticEx `grewrite goal m!"could not discharge {← goal.getType} using {← inferType hrel}" /-- The result returned by `Lean.MVarId.grewrite`. -/ @@ -78,6 +82,9 @@ def _root_.Lean.MVarId.grewrite (goal : MVarId) (e : Expr) (hrel : Expr) pure none let (newMVars, binderInfos, hrelType) ← withReducible <| forallMetaTelescopeReducing hrelType maxMVars? + /- We don't reduce `hrelType` because if it is `a > b`, turning it into `b < a` would + reverse the direction of the rewrite. However, we do need to clear metadata annotations. -/ + let hrelType := hrelType.cleanupAnnotations -- If we can use the normal `rewrite` tactic, we default to using that. if (hrelType.isAppOfArity ``Iff 2 || hrelType.isAppOfArity ``Eq 3) && config.useRewrite then @@ -116,12 +123,11 @@ def _root_.Lean.MVarId.grewrite (goal : MVarId) (e : Expr) (hrel : Expr) are rewritten, or specify what the rewritten expression should be and use 'gcongr'." let eNew ← if rhs.hasBinderNameHint then eNew.resolveBinderNameHint else pure eNew -- construct the implication proof using `gcongr` - let hole ← mkFreshExprMVar default - let template := eAbst.instantiate1 hole let mkImp (e₁ e₂ : Expr) : Expr := .forallE `_a e₁ e₂ .default - let imp := if forwardImp then mkImp e eNew else mkImp eNew e + let eNew' := eAbst.instantiate1 (GCongr.mkHoleAnnotation rhs) + let imp := if forwardImp then mkImp e eNew' else mkImp eNew' e let gcongrGoal ← mkFreshExprMVar imp - let (_, _, sideGoals) ← gcongrGoal.mvarId!.gcongr template [] (grewriteHole := hole.mvarId!) + let (_, _, sideGoals) ← gcongrGoal.mvarId!.gcongr (!forwardImp) [] (mainGoalDischarger := GRewrite.dischargeMain hrel) -- post-process the metavariables postprocessAppMVars `grewrite goal newMVars binderInfos diff --git a/Mathlib/Tactic/GRewrite/Elab.lean b/Mathlib/Tactic/GRewrite/Elab.lean index 9abbaced15377d..1e8b85648dad2b 100644 --- a/Mathlib/Tactic/GRewrite/Elab.lean +++ b/Mathlib/Tactic/GRewrite/Elab.lean @@ -3,7 +3,9 @@ Copyright (c) 2023 Sebastian Zimmer. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Zimmer, Mario Carneiro, Heather Macbeth, Jovan Gerbscheid -/ -import Mathlib.Tactic.GRewrite.Core +module + +public meta import Mathlib.Tactic.GRewrite.Core /-! @@ -18,6 +20,8 @@ This file defines the tactics that use the backend defined in `Mathlib.Tactic.GR -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Parser Tactic diff --git a/Mathlib/Tactic/Generalize.lean b/Mathlib/Tactic/Generalize.lean index 20250ad5f6e41b..5025786cdde8ab 100644 --- a/Mathlib/Tactic/Generalize.lean +++ b/Mathlib/Tactic/Generalize.lean @@ -3,10 +3,12 @@ Copyright (c) 2024 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Mathlib.Init -import Lean.Elab.Binders -import Lean.Elab.Tactic.ElabTerm -import Lean.Meta.Tactic.Generalize +module + +public import Mathlib.Init +public meta import Lean.Elab.Binders +public meta import Lean.Elab.Tactic.ElabTerm +public meta import Lean.Meta.Tactic.Generalize /-! # Backwards compatibility shim for `generalize`. @@ -21,6 +23,8 @@ This file can be removed once all uses of the compatibility shim have been remov This would also allow removing this file. -/ +public meta section + open Lean Elab Tactic Meta in /-- Backwards compatibility shim for `generalize`. -/ elab "generalize'" h:ident " : " t:term:51 " = " x:ident : tactic => do diff --git a/Mathlib/Tactic/GeneralizeProofs.lean b/Mathlib/Tactic/GeneralizeProofs.lean index fcbd588eab3ae5..a0d0430dc92403 100644 --- a/Mathlib/Tactic/GeneralizeProofs.lean +++ b/Mathlib/Tactic/GeneralizeProofs.lean @@ -1,4 +1,6 @@ -import Mathlib.Tactic.Linter.DeprecatedModule -import Batteries.Tactic.GeneralizeProofs +module + +public meta import Mathlib.Tactic.Linter.DeprecatedModule +public meta import Batteries.Tactic.GeneralizeProofs deprecated_module (since := "2025-11-09") diff --git a/Mathlib/Tactic/Group.lean b/Mathlib/Tactic/Group.lean index 76e7481f916228..81b51981565f04 100644 --- a/Mathlib/Tactic/Group.lean +++ b/Mathlib/Tactic/Group.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Thomas Browning, Patrick Massot -/ -import Mathlib.Tactic.Ring -import Mathlib.Tactic.FailIfNoProgress -import Mathlib.Algebra.Group.Commutator +module + +public meta import Mathlib.Tactic.Ring +public meta import Mathlib.Tactic.FailIfNoProgress +public meta import Mathlib.Algebra.Group.Commutator /-! # `group` tactic @@ -22,6 +24,8 @@ some `ring` invocations. group_theory -/ +public meta section + namespace Mathlib.Tactic.Group open Lean @@ -92,4 +96,4 @@ end Mathlib.Tactic.Group We register `group` with the `hint` tactic. -/ -register_hint group +register_hint 900 group diff --git a/Mathlib/Tactic/GuardGoalNums.lean b/Mathlib/Tactic/GuardGoalNums.lean index 27531fd64874f0..f74462e5f33356 100644 --- a/Mathlib/Tactic/GuardGoalNums.lean +++ b/Mathlib/Tactic/GuardGoalNums.lean @@ -3,8 +3,10 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Init -import Lean.Elab.Tactic.Basic +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Basic /-! @@ -12,6 +14,8 @@ A tactic stub file for the `guard_goal_nums` tactic. -/ +public meta section + open Lean Meta Elab Tactic /-- `guard_goal_nums n` succeeds if there are exactly `n` goals and fails otherwise. -/ diff --git a/Mathlib/Tactic/GuardHypNums.lean b/Mathlib/Tactic/GuardHypNums.lean index ad3202937bbcab..4ee6fd0061948e 100644 --- a/Mathlib/Tactic/GuardHypNums.lean +++ b/Mathlib/Tactic/GuardHypNums.lean @@ -3,13 +3,17 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Init -import Lean.Elab.Tactic.Basic +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Basic /-! A tactic stub file for the `guard_hyp_nums` tactic. -/ +public meta section + open Lean Meta Elab Tactic /-- diff --git a/Mathlib/Tactic/Have.lean b/Mathlib/Tactic/Have.lean index c8240ce05b77f8..fadbc0047f861d 100644 --- a/Mathlib/Tactic/Have.lean +++ b/Mathlib/Tactic/Have.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Arthur Paulino. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Edward Ayers, Mario Carneiro -/ -import Mathlib.Init -import Lean.Elab.Binders -import Lean.Elab.SyntheticMVars -import Lean.Meta.Tactic.Assert +module + +public import Mathlib.Init +public meta import Lean.Elab.Binders +public meta import Lean.Elab.SyntheticMVars +public meta import Lean.Meta.Tactic.Assert /-! # Extending `have`, `let` and `suffices` @@ -18,6 +20,8 @@ As a style choice, this should not be used in mathlib; but is provided for downs preferred the old style. -/ +public meta section + namespace Mathlib.Tactic open Lean Elab.Tactic Meta Parser Term Syntax.MonadTraverser diff --git a/Mathlib/Tactic/HaveI.lean b/Mathlib/Tactic/HaveI.lean index d738aa0aa8f95f..98086c5d6d37a9 100644 --- a/Mathlib/Tactic/HaveI.lean +++ b/Mathlib/Tactic/HaveI.lean @@ -3,8 +3,9 @@ Copyright (c) 2023 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ +module -import Mathlib.Init +public import Mathlib.Init /-! # Variants of `haveI`/`letI` for use in do-notation. @@ -16,6 +17,8 @@ This is necessary because the do-notation has a hardcoded list of keywords which as term-mode and do-elem syntax (like for example `let` or `have`). -/ +public meta section + namespace Mathlib.Tactic.HaveI local syntax "haveIDummy" letDecl : term diff --git a/Mathlib/Tactic/HigherOrder.lean b/Mathlib/Tactic/HigherOrder.lean index d85f1e947aa659..25208803d7cad5 100644 --- a/Mathlib/Tactic/HigherOrder.lean +++ b/Mathlib/Tactic/HigherOrder.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ -import Lean.Meta.Tactic.Apply -import Lean.Meta.Tactic.Assumption -import Lean.Meta.MatchUtil -import Lean.Meta.Tactic.Intro -import Lean.Elab.DeclarationRange -import Mathlib.Tactic.Attr.Register +module + +public meta import Lean.Meta.Tactic.Apply +public meta import Lean.Meta.Tactic.Assumption +public meta import Lean.Meta.MatchUtil +public meta import Lean.Meta.Tactic.Intro +public meta import Lean.Elab.DeclarationRange +public meta import Mathlib.Tactic.Attr.Register /-! # HigherOrder attribute @@ -18,6 +20,8 @@ This file defines the `@[higher_order]` attribute that applies to lemmas of the higher-order functions. -/ +public meta section + open Lean Name Meta Elab Expr Term namespace Lean.Parser.Attr @@ -73,7 +77,7 @@ def higherOrderGetParam (thm : Name) (stx : Syntax) : AttrM Name := do updatePrefix sname.getId thm.getPrefix else thm.appendAfter "\'" - MetaM.run' <| TermElabM.run' <| do + MetaM.run' <| TermElabM.run' do let lvl := (← getConstInfo thm).levelParams let typ ← instantiateMVars (← inferType <| .const thm (lvl.map mkLevelParam)) let hot ← mkHigherOrderType typ diff --git a/Mathlib/Tactic/Hint.lean b/Mathlib/Tactic/Hint.lean index f1c9577aa27f0c..efd7fc8277e881 100644 --- a/Mathlib/Tactic/Hint.lean +++ b/Mathlib/Tactic/Hint.lean @@ -3,24 +3,28 @@ Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ -import Lean.Meta.Tactic.TryThis -import Batteries.Linter.UnreachableTactic -import Batteries.Control.Nondet.Basic -import Mathlib.Init -import Mathlib.Lean.Elab.InfoTree -import Mathlib.Tactic.Basic +module + +public meta import Lean.Meta.Tactic.TryThis +public meta import Batteries.Linter.UnreachableTactic +public meta import Batteries.Control.Nondet.Basic +public import Mathlib.Init +public meta import Mathlib.Lean.Elab.InfoTree +public meta import Mathlib.Tactic.Basic /-! # The `hint` tactic. The `hint` tactic tries the kitchen sink: -it runs every tactic registered via the `register_hint tac` command +it runs every tactic registered via the `register_hint tac` command on the current goal, and reports which ones succeed. ## Future work It would be nice to run the tactics in parallel. -/ +public meta section + open Lean Elab Tactic open Lean.Meta.Tactic.TryThis @@ -45,22 +49,16 @@ def getHints : CoreM (List (Nat × TSyntax `tactic)) := open Lean.Elab.Command in /-- -Register a tactic for use with the `hint` tactic, e.g. `register_hint simp_all`. -An optional priority can be provided with `register_hint (priority := n) tac`. -Tactics with larger priorities run before those with smaller priorities. The default -priority is `1000`. +Register a tactic for use with the `hint` tactic, e.g. `register_hint 1000 simp_all`. +The numeric argument specifies the priority: tactics with larger priorities run before +those with smaller priorities. The priority must be provided explicitly. -/ elab (name := registerHintStx) - "register_hint" p:("(" "priority" ":=" num ")")? tac:tactic : command => + "register_hint" prio:num tac:tactic : command => liftTermElabM do - -- remove comments - let prio := match p with - | some stx => - match stx.raw[3]?.bind Syntax.isNatLit? with - | some n => n - | none => 1000 - | none => 1000 let tac : TSyntax `tactic := ⟨tac.raw.copyHeadTailInfoFrom .missing⟩ + let some prio := prio.raw.isNatLit? + | throwError "expected a numeric literal for priority" addHint prio tac initialize @@ -126,7 +124,7 @@ def hint (stx : Syntax) : TacticM Unit := withMainContext do | none => admitGoal (← getMainGoal) /-- -The `hint` tactic tries every tactic registered using `register_hint tac`, +The `hint` tactic tries every tactic registered using `register_hint tac`, and reports any that succeed. -/ syntax (name := hintStx) "hint" : tactic diff --git a/Mathlib/Tactic/ITauto.lean b/Mathlib/Tactic/ITauto.lean index c76855dd47bf9f..7a5c5adc63786d 100644 --- a/Mathlib/Tactic/ITauto.lean +++ b/Mathlib/Tactic/ITauto.lean @@ -3,11 +3,13 @@ Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ -import Batteries.Tactic.Exact -import Batteries.Tactic.Init -import Mathlib.Logic.Basic -import Mathlib.Util.AtomM -import Qq +module + +public meta import Batteries.Tactic.Exact +public meta import Batteries.Tactic.Init +public meta import Mathlib.Logic.Basic +public meta import Mathlib.Util.AtomM +public meta import Qq /-! @@ -79,6 +81,8 @@ grammar if it matters.) propositional logic, intuitionistic logic, decision procedure -/ +public meta section + open Std (TreeMap TreeSet) @@ -99,22 +103,22 @@ inductive IProp : Type | and' : AndKind → IProp → IProp → IProp -- p ∧ q, p ↔ q, p = q | or : IProp → IProp → IProp -- p ∨ q | imp : IProp → IProp → IProp -- p → q - deriving Lean.ToExpr, DecidableEq + deriving Lean.ToExpr /-- Constructor for `p ∧ q`. -/ -@[match_pattern] def IProp.and : IProp → IProp → IProp := .and' .and +@[match_pattern, expose] def IProp.and : IProp → IProp → IProp := .and' .and /-- Constructor for `p ↔ q`. -/ -@[match_pattern] def IProp.iff : IProp → IProp → IProp := .and' .iff +@[match_pattern, expose] def IProp.iff : IProp → IProp → IProp := .and' .iff /-- Constructor for `p = q`. -/ -@[match_pattern] def IProp.eq : IProp → IProp → IProp := .and' .eq +@[match_pattern, expose] def IProp.eq : IProp → IProp → IProp := .and' .eq /-- Constructor for `¬ p`. -/ -@[match_pattern] def IProp.not (a : IProp) : IProp := a.imp .false +@[match_pattern, expose] def IProp.not (a : IProp) : IProp := a.imp .false /-- Constructor for `xor p q`. -/ -@[match_pattern] def IProp.xor (a b : IProp) : IProp := (a.and b.not).or (b.and a.not) +@[match_pattern, expose] def IProp.xor (a b : IProp) : IProp := (a.and b.not).or (b.and a.not) instance : Inhabited IProp := ⟨IProp.true⟩ diff --git a/Mathlib/Tactic/InferParam.lean b/Mathlib/Tactic/InferParam.lean index 61823d34ed51af..54162cb300b14d 100644 --- a/Mathlib/Tactic/InferParam.lean +++ b/Mathlib/Tactic/InferParam.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Mario Carneiro -/ -import Mathlib.Init -import Lean.Elab.Tactic.Basic -import Lean.Meta.Tactic.Replace +module + +public import Mathlib.Init +public meta import Lean.Elab.Tactic.Basic +public meta import Lean.Meta.Tactic.Replace /-! # Infer an optional parameter @@ -14,6 +16,8 @@ In this file we define a tactic `infer_param` that closes a goal with default va this default value. -/ +public meta section + namespace Mathlib.Tactic open Lean Elab Tactic Meta diff --git a/Mathlib/Tactic/Inhabit.lean b/Mathlib/Tactic/Inhabit.lean index 0ed8909be666c2..6d42cf25e170e7 100644 --- a/Mathlib/Tactic/Inhabit.lean +++ b/Mathlib/Tactic/Inhabit.lean @@ -3,14 +3,18 @@ Copyright (c) 2022 Joshua Clune. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joshua Clune -/ -import Lean.Elab.Tactic.ElabTerm -import Mathlib.Tactic.TypeStar +module + +public meta import Lean.Elab.Tactic.ElabTerm +public meta import Mathlib.Tactic.TypeStar /-! Defines the `inhabit α` tactic, which tries to construct an `Inhabited α` instance, constructively or otherwise. -/ +public meta section + open Lean.Meta namespace Lean.Elab.Tactic diff --git a/Mathlib/Tactic/IntervalCases.lean b/Mathlib/Tactic/IntervalCases.lean index 3a465c511eba91..0f28750e6ea4ac 100644 --- a/Mathlib/Tactic/IntervalCases.lean +++ b/Mathlib/Tactic/IntervalCases.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Mario Carneiro -/ -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.FinCases -import Mathlib.Control.Basic +module + +public meta import Mathlib.Tactic.NormNum +public meta import Mathlib.Tactic.FinCases +public meta import Mathlib.Control.Basic /-! # Case bash on variables in finite intervals @@ -23,6 +25,8 @@ where the hypotheses should be of the form `hl : a ≤ n` and `hu : n < b`. In t `interval_cases` calls `fin_cases` on the resulting hypothesis `h : n ∈ Set.Ico a b`. -/ +public meta section + namespace Mathlib.Tactic open Lean Meta Elab Term Qq Int diff --git a/Mathlib/Tactic/IrreducibleDef.lean b/Mathlib/Tactic/IrreducibleDef.lean index 01c2f25bb25d8c..e4c40b1e1a0c43 100644 --- a/Mathlib/Tactic/IrreducibleDef.lean +++ b/Mathlib/Tactic/IrreducibleDef.lean @@ -3,9 +3,11 @@ Copyright (c) 2021 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ -import Mathlib.Data.Subtype -import Mathlib.Tactic.Eqns -import Mathlib.Util.TermReduce +module + +public meta import Mathlib.Data.Subtype +public meta import Mathlib.Tactic.Eqns +public meta import Mathlib.Util.TermReduce /-! # Irreducible definitions @@ -28,6 +30,8 @@ example : frobnicate a 0 = a := by -/ +public meta section + namespace Lean.Elab.Command open Term Meta diff --git a/Mathlib/Tactic/Lemma.lean b/Mathlib/Tactic/Lemma.lean index 10d49cd8d8a8f2..5e6408ae33a548 100644 --- a/Mathlib/Tactic/Lemma.lean +++ b/Mathlib/Tactic/Lemma.lean @@ -3,13 +3,17 @@ Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kyle Miller -/ -import Mathlib.Init -import Lean.Parser.Command +module + +public import Mathlib.Init +public meta import Lean.Parser.Command /-! # Support for `lemma` as a synonym for `theorem`. -/ +public meta section + open Lean -- higher priority to override the one in Batteries diff --git a/Mathlib/Tactic/Lift.lean b/Mathlib/Tactic/Lift.lean index ef7e37717938bc..13c0444fb6602c 100644 --- a/Mathlib/Tactic/Lift.lean +++ b/Mathlib/Tactic/Lift.lean @@ -3,9 +3,11 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn -/ -import Mathlib.Tactic.Basic -import Batteries.Lean.Expr -import Batteries.Lean.Meta.UnusedNames +module + +public meta import Mathlib.Tactic.Basic +public meta import Batteries.Lean.Expr +public meta import Batteries.Lean.Meta.UnusedNames /-! # lift tactic @@ -18,6 +20,8 @@ under a specified condition. lift, tactic -/ +public meta section + /-- A class specifying that you can lift elements from `α` to `β` assuming `cond` is true. Used by the tactic `lift`. -/ class CanLift (α β : Sort*) (coe : outParam <| β → α) (cond : outParam <| α → Prop) : Prop where diff --git a/Mathlib/Tactic/LiftLets.lean b/Mathlib/Tactic/LiftLets.lean index 622a72ecd765ba..690f3d6b925f12 100644 --- a/Mathlib/Tactic/LiftLets.lean +++ b/Mathlib/Tactic/LiftLets.lean @@ -3,8 +3,10 @@ Copyright (c) 2023 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller -/ -import Mathlib.Tactic.Basic -import Mathlib.Tactic.Linter.DeprecatedModule +module + +public meta import Mathlib.Tactic.Basic +public meta import Mathlib.Tactic.Linter.DeprecatedModule deprecated_module "The lift_lets tactic was moved to Lean core; \ you can probably just remove this import" (since := "2025-05-02") diff --git a/Mathlib/Tactic/Linarith.lean b/Mathlib/Tactic/Linarith.lean index 2f22414ea5b408..1d0ef07c07b7a7 100644 --- a/Mathlib/Tactic/Linarith.lean +++ b/Mathlib/Tactic/Linarith.lean @@ -3,12 +3,16 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Tactic.Linarith.Frontend -import Mathlib.Tactic.NormNum -import Mathlib.Tactic.Hint +module + +public meta import Mathlib.Tactic.Linarith.Frontend +public meta import Mathlib.Tactic.NormNum +public meta import Mathlib.Tactic.Hint /-! We register `linarith` with the `hint` tactic. -/ -register_hint (priority := 100) linarith +public meta section + +register_hint 100 linarith diff --git a/Mathlib/Tactic/Linarith/Datatypes.lean b/Mathlib/Tactic/Linarith/Datatypes.lean index 31bc178b446e87..42d715867ee455 100644 --- a/Mathlib/Tactic/Linarith/Datatypes.lean +++ b/Mathlib/Tactic/Linarith/Datatypes.lean @@ -3,9 +3,11 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Tactic.Linarith.Lemmas -import Mathlib.Tactic.NormNum.Basic -import Mathlib.Util.SynthesizeUsing +module + +public meta import Mathlib.Tactic.Linarith.Lemmas +public meta import Mathlib.Tactic.NormNum.Basic +public meta import Mathlib.Util.SynthesizeUsing /-! # Datatypes for `linarith` @@ -16,6 +18,8 @@ We split them into their own file. This file also contains a few convenient auxiliary functions. -/ +public meta section + open Lean Elab Tactic Meta Qq initialize registerTraceClass `linarith @@ -207,7 +211,7 @@ splits. The first component, an `MVarId`, is the goal corresponding to this bran given as a metavariable. The `List Expr` component is the list of hypotheses for `linarith` in this branch. -/ -def Branch : Type := MVarId × List Expr +@[expose] def Branch : Type := MVarId × List Expr /-- Some preprocessors perform branching case splits. diff --git a/Mathlib/Tactic/Linarith/Frontend.lean b/Mathlib/Tactic/Linarith/Frontend.lean index f4dd69fe394b68..ed00ebcde5f4b1 100644 --- a/Mathlib/Tactic/Linarith/Frontend.lean +++ b/Mathlib/Tactic/Linarith/Frontend.lean @@ -3,12 +3,14 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Control.Basic -import Mathlib.Tactic.Linarith.Verification -import Mathlib.Tactic.Linarith.Preprocessing -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm -import Mathlib.Tactic.Ring.Basic -import Mathlib.Util.ElabWithoutMVars +module + +public meta import Mathlib.Control.Basic +public meta import Mathlib.Tactic.Linarith.Verification +public meta import Mathlib.Tactic.Linarith.Preprocessing +public meta import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm +public meta import Mathlib.Tactic.Ring.Basic +public meta import Mathlib.Util.ElabWithoutMVars /-! # `linarith`: solving linear arithmetic goals @@ -131,6 +133,8 @@ The components of `linarith` are spread between a number of files for the sake o linarith, nlinarith, lra, nra, Fourier-Motzkin, linear arithmetic, linear programming -/ +public meta section + open Lean Elab Parser Tactic Meta open Batteries diff --git a/Mathlib/Tactic/Linarith/Lemmas.lean b/Mathlib/Tactic/Linarith/Lemmas.lean index ac764ecc7d690d..0898ad3c35ded4 100644 --- a/Mathlib/Tactic/Linarith/Lemmas.lean +++ b/Mathlib/Tactic/Linarith/Lemmas.lean @@ -3,13 +3,15 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Batteries.Tactic.Lint.Basic -import Mathlib.Algebra.Order.Monoid.Unbundled.Basic -import Mathlib.Algebra.Order.Ring.Defs -import Mathlib.Algebra.Order.ZeroLEOne -import Mathlib.Data.Nat.Cast.Order.Ring -import Mathlib.Data.Int.Order.Basic -import Mathlib.Data.Ineq +module + +public meta import Batteries.Tactic.Lint.Basic +public meta import Mathlib.Algebra.Order.Monoid.Unbundled.Basic +public meta import Mathlib.Algebra.Order.Ring.Defs +public meta import Mathlib.Algebra.Order.ZeroLEOne +public meta import Mathlib.Data.Nat.Cast.Order.Ring +public meta import Mathlib.Data.Int.Order.Basic +public meta import Mathlib.Data.Ineq /-! # Lemmas for `linarith`. @@ -19,6 +21,8 @@ Those in the `Linarith` namespace should stay here. Those outside the `Linarith` namespace may be deleted as they are ported to mathlib4. -/ +public meta section + namespace Mathlib.Tactic.Linarith universe u diff --git a/Mathlib/Tactic/Linarith/Oracle/FourierMotzkin.lean b/Mathlib/Tactic/Linarith/Oracle/FourierMotzkin.lean index b8166acf98094f..9c49c5cfe02d34 100644 --- a/Mathlib/Tactic/Linarith/Oracle/FourierMotzkin.lean +++ b/Mathlib/Tactic/Linarith/Oracle/FourierMotzkin.lean @@ -3,8 +3,10 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Batteries.Lean.HashMap -import Mathlib.Tactic.Linarith.Datatypes +module + +public meta import Batteries.Lean.HashMap +public meta import Mathlib.Tactic.Linarith.Datatypes /-! # The Fourier-Motzkin elimination procedure @@ -29,6 +31,8 @@ We recursively eliminate all variables from the system. If we derive an empty cl we conclude that the original system was unsatisfiable. -/ +public meta section + open Batteries open Std (format ToFormat TreeSet) @@ -138,7 +142,7 @@ structure PComp : Type where effective : TreeSet ℕ Ord.compare /-- The variables which have been *implicitly eliminated*. These are variables that appear in the historical set, - do not appear in `c` itself, and are not in `effective. -/ + do not appear in `c` itself, and are not in `effective`. -/ implicit : TreeSet ℕ Ord.compare /-- The union of all variables appearing in those original assumptions which appear in the `history` set. -/ diff --git a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm.lean b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm.lean index bc06ccdd841e80..23e71049504ff4 100644 --- a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm.lean +++ b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm.lean @@ -3,8 +3,10 @@ Copyright (c) 2024 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ -import Mathlib.Tactic.Linarith.Datatypes -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector +module + +public meta import Mathlib.Tactic.Linarith.Datatypes +public meta import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector /-! # The oracle based on Simplex Algorithm @@ -14,6 +16,8 @@ The algorithm's entry point is the function `Linarith.SimplexAlgorithm.findPosit See the file `PositiveVector.lean` for details of how the procedure works. -/ +public meta section + namespace Mathlib.Tactic.Linarith.SimplexAlgorithm /-- Preprocess the goal to pass it to `Linarith.SimplexAlgorithm.findPositiveVector`. -/ diff --git a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Datatypes.lean b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Datatypes.lean index ceb91b57ac76c6..e8bb2a3616e231 100644 --- a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Datatypes.lean +++ b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Datatypes.lean @@ -3,13 +3,17 @@ Copyright (c) 2024 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ -import Mathlib.Init -import Std.Data.HashMap.Basic +module + +public import Mathlib.Init +public meta import Std.Data.HashMap.Basic /-! # Datatypes for the Simplex Algorithm implementation -/ +public meta section + namespace Mathlib.Tactic.Linarith.SimplexAlgorithm /-- diff --git a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Gauss.lean b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Gauss.lean index b4303c0c827c52..2f08fb6f8d3e61 100644 --- a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Gauss.lean +++ b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/Gauss.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes +module + +public meta import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes /-! # Gaussian Elimination algorithm @@ -12,6 +14,8 @@ The first step of `Linarith.SimplexAlgorithm.findPositiveVector` is finding init solution which is done by standard Gaussian Elimination algorithm implemented in this file. -/ +public meta section + namespace Mathlib.Tactic.Linarith.SimplexAlgorithm.Gauss /-- The monad for the Gaussian Elimination algorithm. -/ diff --git a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/PositiveVector.lean b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/PositiveVector.lean index 87ef1c80a1f84a..2276cd41233085 100644 --- a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/PositiveVector.lean +++ b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/PositiveVector.lean @@ -3,9 +3,11 @@ Copyright (c) 2024 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ -import Lean.Meta.Basic -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.SimplexAlgorithm -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Gauss +module + +public meta import Lean.Meta.Basic +public meta import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.SimplexAlgorithm +public meta import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Gauss /-! # `linarith` certificate search as an LP problem @@ -17,7 +19,7 @@ the `strictIndexes` are positive and `A v = 0`. The function `findPositiveVector` solves this problem. -# Algorithm sketch +## Algorithm sketch 1. We translate the problem stated above to some Linear Programming problem. See `stateLP` for details. Let us denote the corresponding matrix `B`. @@ -33,6 +35,8 @@ The function `findPositiveVector` solves this problem. -/ +public meta section + namespace Mathlib.Tactic.Linarith.SimplexAlgorithm variable {matType : Nat → Nat → Type} [UsableInSimplexAlgorithm matType] diff --git a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/SimplexAlgorithm.lean b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/SimplexAlgorithm.lean index 810dabd5434a90..b37fb1cf810408 100644 --- a/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/SimplexAlgorithm.lean +++ b/Mathlib/Tactic/Linarith/Oracle/SimplexAlgorithm/SimplexAlgorithm.lean @@ -3,7 +3,9 @@ Copyright (c) 2024 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ -import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes +module + +public meta import Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.Datatypes /-! # Simplex Algorithm @@ -12,6 +14,8 @@ To obtain required vector in `Linarith.SimplexAlgorithm.findPositiveVector` we r Algorithm. We use Bland's rule for pivoting, which guarantees that the algorithm terminates. -/ +public meta section + namespace Mathlib.Tactic.Linarith.SimplexAlgorithm /-- An exception in the `SimplexAlgorithmM` monad. -/ diff --git a/Mathlib/Tactic/Linarith/Parsing.lean b/Mathlib/Tactic/Linarith/Parsing.lean index 999a5064b6ebe2..1222345695ff41 100644 --- a/Mathlib/Tactic/Linarith/Parsing.lean +++ b/Mathlib/Tactic/Linarith/Parsing.lean @@ -3,7 +3,9 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Tactic.Linarith.Datatypes +module + +public meta import Mathlib.Tactic.Linarith.Datatypes /-! # Parsing input expressions into linear form @@ -27,6 +29,8 @@ This is ultimately converted into a `Linexp` in the obvious way. `linearFormsAndMaxVar` is the main entry point into this file. Everything else is contained. -/ +public meta section + open Std (TreeMap) namespace Std.TreeMap diff --git a/Mathlib/Tactic/Linarith/Preprocessing.lean b/Mathlib/Tactic/Linarith/Preprocessing.lean index 8d5492a7888320..8779d7d16f8fb8 100644 --- a/Mathlib/Tactic/Linarith/Preprocessing.lean +++ b/Mathlib/Tactic/Linarith/Preprocessing.lean @@ -3,12 +3,14 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ -import Mathlib.Control.Basic -import Mathlib.Lean.Meta.Tactic.Rewrite -import Mathlib.Tactic.CancelDenoms.Core -import Mathlib.Tactic.Linarith.Datatypes -import Mathlib.Tactic.Zify -import Mathlib.Util.AtomM +module + +public meta import Mathlib.Control.Basic +public meta import Mathlib.Lean.Meta.Tactic.Rewrite +public meta import Mathlib.Tactic.CancelDenoms.Core +public meta import Mathlib.Tactic.Linarith.Datatypes +public meta import Mathlib.Tactic.Zify +public meta import Mathlib.Util.AtomM /-! # Linarith preprocessing @@ -26,6 +28,8 @@ preprocessing steps by adding them to the `LinarithConfig` object. `Linarith.def is the main list, and generally none of these should be skipped unless you know what you're doing. -/ +public meta section + namespace Mathlib.Tactic.Linarith /-! ### Preprocessing -/ @@ -100,7 +104,7 @@ open Zify `isNatProp tp` is true iff `tp` is an inequality or equality between natural numbers or the negation thereof. -/ -partial def isNatProp (e : Expr) : MetaM Bool := succeeds <| do +partial def isNatProp (e : Expr) : MetaM Bool := succeeds do let (_, _, .const ``Nat [], _, _) ← e.ineqOrNotIneq? | failure /-- If `e` is of the form `((n : ℕ) : C)`, `isNatCoe e` returns `⟨n, C⟩`. -/ @@ -162,7 +166,7 @@ def natToInt : GlobalBranchingPreprocessor where pure h else pure h - withNewMCtxDepth <| AtomM.run .reducible <| do + withNewMCtxDepth <| AtomM.run .reducible do let nonnegs ← l.foldlM (init := ∅) fun (es : TreeSet (Nat × Nat) lexOrd.compare) h => do try let (_, _, a, b) ← (← inferType h).ineq? diff --git a/Mathlib/Tactic/Linarith/Verification.lean b/Mathlib/Tactic/Linarith/Verification.lean index 99fd07db0eea5b..3dc8e904c617fe 100644 --- a/Mathlib/Tactic/Linarith/Verification.lean +++ b/Mathlib/Tactic/Linarith/Verification.lean @@ -3,9 +3,10 @@ Copyright (c) 2020 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis -/ +module -import Mathlib.Tactic.Linarith.Parsing -import Mathlib.Util.Qq +public meta import Mathlib.Tactic.Linarith.Parsing +public meta import Mathlib.Util.Qq /-! # Deriving a proof of false @@ -19,6 +20,8 @@ This file implements the reconstruction. The public facing declaration in this file is `proveFalseByLinarith`. -/ +public meta section + open Lean Elab Tactic Meta namespace Qq diff --git a/Mathlib/Tactic/LinearCombination'.lean b/Mathlib/Tactic/LinearCombination'.lean index 0e780eeb01b222..9581ecfc01a1cf 100644 --- a/Mathlib/Tactic/LinearCombination'.lean +++ b/Mathlib/Tactic/LinearCombination'.lean @@ -3,7 +3,9 @@ Copyright (c) 2022 Abby J. Goldberg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Abby J. Goldberg, Mario Carneiro -/ -import Mathlib.Tactic.Ring +module + +public meta import Mathlib.Tactic.Ring /-! # linear_combination' Tactic @@ -35,6 +37,8 @@ implementation, but this version is provided for backward-compatibility. -/ +public meta section + namespace Mathlib.Tactic.LinearCombination' open Lean open Elab Meta Term diff --git a/Mathlib/Tactic/LinearCombination.lean b/Mathlib/Tactic/LinearCombination.lean index dcf59bbc269d72..2cd48e2eca6e17 100644 --- a/Mathlib/Tactic/LinearCombination.lean +++ b/Mathlib/Tactic/LinearCombination.lean @@ -3,10 +3,12 @@ Copyright (c) 2022 Abby J. Goldberg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Abby J. Goldberg, Mario Carneiro, Heather Macbeth -/ -import Mathlib.Tactic.LinearCombination.Lemmas -import Mathlib.Tactic.Positivity.Core -import Mathlib.Tactic.Ring -import Mathlib.Tactic.Ring.Compare +module + +public meta import Mathlib.Tactic.LinearCombination.Lemmas +public meta import Mathlib.Tactic.Positivity.Core +public meta import Mathlib.Tactic.Ring +public meta import Mathlib.Tactic.Ring.Compare /-! # linear_combination Tactic @@ -35,6 +37,8 @@ Lastly, calls a normalization tactic on this target. -/ +public meta section + namespace Mathlib.Tactic.LinearCombination open Lean open Elab Meta Term Ineq diff --git a/Mathlib/Tactic/LinearCombination/Lemmas.lean b/Mathlib/Tactic/LinearCombination/Lemmas.lean index 18c244400fb4d3..592f6411733496 100644 --- a/Mathlib/Tactic/LinearCombination/Lemmas.lean +++ b/Mathlib/Tactic/LinearCombination/Lemmas.lean @@ -3,9 +3,11 @@ Copyright (c) 2022 Abby J. Goldberg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Abby J. Goldberg, Mario Carneiro, Heather Macbeth -/ -import Mathlib.Algebra.Field.Defs -import Mathlib.Algebra.Order.Module.Defs -import Mathlib.Data.Ineq +module + +public meta import Mathlib.Algebra.Field.Defs +public meta import Mathlib.Algebra.Order.Module.Defs +public meta import Mathlib.Data.Ineq /-! # Lemmas for the linear_combination tactic @@ -13,6 +15,8 @@ import Mathlib.Data.Ineq These should not be used directly in user code. -/ +public meta section + open Lean namespace Mathlib.Tactic.LinearCombination diff --git a/Mathlib/Tactic/Linter.lean b/Mathlib/Tactic/Linter.lean index b1f0e187dc95e6..419862edf050aa 100644 --- a/Mathlib/Tactic/Linter.lean +++ b/Mathlib/Tactic/Linter.lean @@ -7,9 +7,10 @@ This file is ignored by `shake`: * it is in `ignoreAll`, meaning that all its imports are considered necessary; * it is in `ignoreImport`, meaning that where it is imported, it is considered necessary. -/ +module -import Mathlib.Tactic.Linter.DeprecatedModule -import Mathlib.Tactic.Linter.HaveLetLinter -import Mathlib.Tactic.Linter.MinImports -import Mathlib.Tactic.Linter.PPRoundtrip -import Mathlib.Tactic.Linter.UpstreamableDecl +public meta import Mathlib.Tactic.Linter.DeprecatedModule +public meta import Mathlib.Tactic.Linter.HaveLetLinter +public meta import Mathlib.Tactic.Linter.MinImports +public meta import Mathlib.Tactic.Linter.PPRoundtrip +public meta import Mathlib.Tactic.Linter.UpstreamableDecl diff --git a/Mathlib/Tactic/Linter/CommandRanges.lean b/Mathlib/Tactic/Linter/CommandRanges.lean index 68dc45b3f33b62..095ab3db25d6df 100644 --- a/Mathlib/Tactic/Linter/CommandRanges.lean +++ b/Mathlib/Tactic/Linter/CommandRanges.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Init -- `import Lean.Elab.Command` is enough +public import Mathlib.Init -- `import Lean.Elab.Command` is enough /-! # The "commandRanges" linter @@ -19,6 +20,8 @@ This linter is strictly tied to the `#clear_deprecations` command in `Mathlib/Tactic/Linter/FindDeprecations.lean`. -/ +public meta section + open Lean Elab Linter namespace Mathlib.Linter diff --git a/Mathlib/Tactic/Linter/CommandStart.lean b/Mathlib/Tactic/Linter/CommandStart.lean index bbd2a933fda669..7eefc3a2900be4 100644 --- a/Mathlib/Tactic/Linter/CommandStart.lean +++ b/Mathlib/Tactic/Linter/CommandStart.lean @@ -3,8 +3,9 @@ Copyright (c) 2025 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ +module -import Mathlib.Tactic.Linter.Header +public meta import Mathlib.Tactic.Linter.Header /-! # The `commandStart` linter @@ -14,6 +15,8 @@ The `commandStart` linter emits a warning if * or the "hypotheses segment" of a declaration does not coincide with its pretty-printed version. -/ +public meta section + open Lean Elab Command Linter namespace Mathlib.Linter @@ -139,7 +142,7 @@ flagging some line-breaking changes. -/ partial def parallelScanAux (as : Array FormatError) (L M : String) : Array FormatError := - if M.trim.isEmpty then as else + if M.trimAscii.isEmpty then as else -- We try as hard as possible to scan the strings one character at a time. -- However, single line comments introduced with `--` pretty-print differently than `/--`. -- So, we first look ahead for `/--`: the linter will later ignore doc-strings, so it does not @@ -150,44 +153,46 @@ def parallelScanAux (as : Array FormatError) (L M : String) : Array FormatError -- doc-strings). In this case, we drop everything until the following line break in the -- original syntax, and for the same amount of characters in the pretty-printed one, since the -- pretty-printer *erases* the line break at the end of a single line comment. - if L.take 3 == "/--" && M.take 3 == "/--" then - parallelScanAux as (L.drop 3) (M.drop 3) else - if L.take 2 == "--" then + if L.take 3 == "/--".toSlice && M.take 3 == "/--".toSlice then + parallelScanAux as (L.drop 3).copy (M.drop 3).copy else + if L.take 2 == "--".toSlice then let newL := L.dropWhile (· != '\n') - let diff := L.length - newL.length + let diff := L.length - newL.copy.length -- Assumption: if `L` contains an embedded inline comment, so does `M` -- (modulo additional whitespace). -- This holds because we call this function with `M` being a pretty-printed version of `L`. -- If the pretty-printer changes in the future, this code may need to be adjusted. let newM := M.dropWhile (· != '-') |>.drop diff - parallelScanAux as newL.trimLeft newM.trimLeft else - if L.take 2 == "-/" then - let newL := L.drop 2 |>.trimLeft - let newM := M.drop 2 |>.trimLeft - parallelScanAux as newL newM else + parallelScanAux as newL.trimAsciiStart.copy newM.trimAsciiStart.copy else + if L.take 2 == "-/".toSlice then + let newL := L.drop 2 |>.trimAsciiStart + let newM := M.drop 2 |>.trimAsciiStart + parallelScanAux as newL.copy newM.copy else let ls := L.drop 1 let ms := M.drop 1 match L.front, M.front with | ' ', m => if m.isWhitespace then - parallelScanAux as ls ms.trimLeft + parallelScanAux as ls.copy ms.trimAsciiStart.copy else - parallelScanAux (pushFormatError as (mkFormatError L M "extra space")) ls M + parallelScanAux (pushFormatError as (mkFormatError L M "extra space")) ls.copy M | '\n', m => if m.isWhitespace then - parallelScanAux as ls.trimLeft ms.trimLeft + parallelScanAux as ls.trimAsciiStart.copy ms.trimAsciiStart.copy else - parallelScanAux (pushFormatError as (mkFormatError L M "remove line break")) ls.trimLeft M + parallelScanAux + (pushFormatError as (mkFormatError L M "remove line break")) ls.trimAsciiStart.copy M | l, m => -- `l` is not whitespace if l == m then - parallelScanAux as ls ms + parallelScanAux as ls.copy ms.copy else if m.isWhitespace then - parallelScanAux (pushFormatError as (mkFormatError L M "missing space")) L ms.trimLeft + parallelScanAux + (pushFormatError as (mkFormatError L M "missing space")) L ms.trimAsciiStart.copy else -- If this code is reached, then `L` and `M` differ by something other than whitespace. -- This should not happen in practice. - pushFormatError as (mkFormatError ls ms "Oh no! (Unreachable?)") + pushFormatError as (mkFormatError ls.copy ms.copy "Oh no! (Unreachable?)") @[inherit_doc parallelScanAux] def parallelScan (src fmt : String) : Array FormatError := @@ -287,10 +292,10 @@ to avoid cutting into "words". *Note*. `start` is the number of characters *from the right* where our focus is! -/ def mkWindow (orig : String) (start ctx : Nat) : String := - let head := orig.dropRight (start + 1) -- `orig`, up to one character before the discrepancy - let middle := orig.takeRight (start + 1) - let headCtx := head.takeRightWhile (!·.isWhitespace) - let tail := middle.drop ctx |>.takeWhile (!·.isWhitespace) + let head := orig.dropEnd (start + 1) -- `orig`, up to one character before the discrepancy + let middle := orig.takeEnd (start + 1) + let headCtx := head.takeEndWhile (fun (c : Char) => !c.isWhitespace) + let tail := middle.drop ctx |>.takeWhile (fun (c : Char) => !c.isWhitespace) s!"{headCtx}{middle.take ctx}{tail}" @[inherit_doc Mathlib.Linter.linter.style.commandStart] diff --git a/Mathlib/Tactic/Linter/DeprecatedModule.lean b/Mathlib/Tactic/Linter/DeprecatedModule.lean index d0093928225eda..8240c2432e11fa 100644 --- a/Mathlib/Tactic/Linter/DeprecatedModule.lean +++ b/Mathlib/Tactic/Linter/DeprecatedModule.lean @@ -3,8 +3,10 @@ Copyright (c) 2025 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa -/ -import Std.Time.Format -import Mathlib.Init +module + +public meta import Std.Time.Format +public import Mathlib.Init /-! # The `deprecated.module` linter @@ -25,6 +27,8 @@ This triggers the `deprecated.module` linter to notify every file with `import A to instead import the *direct imports* of `A`, that is `B, ..., Z`. -/ +public meta section + open Lean Elab Command Linter namespace Mathlib.Linter @@ -112,7 +116,7 @@ namespace DeprecatedModule /-- `IsLaterCommand` is an `IO.Ref` that starts out being `false`. -As soon as a (non-import) command in a file is processed, the `deprecated.module` linter` +As soon as a (non-import) command in a file is processed, the `deprecated.module` linter sets it to `true`. If it is `false`, then the `deprecated.module` linter will check for deprecated modules. diff --git a/Mathlib/Tactic/Linter/DeprecatedSyntaxLinter.lean b/Mathlib/Tactic/Linter/DeprecatedSyntaxLinter.lean index f521c155d143ff..0cbcb54e362c3b 100644 --- a/Mathlib/Tactic/Linter/DeprecatedSyntaxLinter.lean +++ b/Mathlib/Tactic/Linter/DeprecatedSyntaxLinter.lean @@ -3,11 +3,12 @@ Copyright (c) 2024 Damiano Testa. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Jeremy Tan, Adomas Baliuka -/ +module -import Lean.Elab.Command +public meta import Lean.Elab.Command -- Import this linter explicitly to ensure that -- this file has a valid copyright header and module docstring. -import Mathlib.Tactic.Linter.Header +public meta import Mathlib.Tactic.Linter.Header /-! # Linter against deprecated syntax @@ -34,6 +35,8 @@ This linter is an incentive to discourage uses of such deprecated syntax, withou It is not inherently limited to tactics. -/ +public meta section + open Lean Elab Linter namespace Mathlib.Linter.Style @@ -107,7 +110,7 @@ where `