Skip to content

refactor: extract shared definitions into HuangzhongLaw72.Shared#3

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1780493470-refactor-shared-utilities
Open

refactor: extract shared definitions into HuangzhongLaw72.Shared#3
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1780493470-refactor-shared-utilities

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Eliminates ~100 lines of duplicated code between HuangzhongLaw72.lean and HuangzhongLaw72_core.lean by extracting 13 shared definitions/theorems into a new HuangzhongLaw72/Shared.lean module.

What moved to Shared.lean:

  • doubleFactOdd + properties (_succ, _pos, _odd, _ge_pow3, _strictMono, _cast_pos)
  • pow3_cast_pos, piE_term, piE_term_norm_le
  • piE_series_summable, piE_norm_summable
  • geom_tail_summable, piE_tail_summable, piE_tail_norm_summable
  • partialSum_piE_real, piE_limit, piE_limit_eq_tsum

Structural change: HuangzhongLaw72_core.leanHuangzhongLaw72/Core.lean (fits module hierarchy). Both consumer files now import HuangzhongLaw72.Shared and retain only their unique content:

  • Main file: theorem chain 4.1–4.5 (SunYi, huangzhong, category-theory framework)
  • Core file: truncation_6_approx (6-term error bound)

Proofs adapted to Mathlib4 v4.30 API changes (Summable.sum_add_tsum_nat_add, Summable.tsum_le_tsum, div_le_div_of_nonneg_left). Full lake build passes.

Link to Devin session: https://app.devin.ai/sessions/7d7bee1bfe334766b67ff4802561f331
Requested by: @jackyfan01

Extract 13 duplicated definitions and theorems from HuangzhongLaw72.lean
and HuangzhongLaw72_core.lean into a new shared module:
- doubleFactOdd (definition + succ/pos/odd/ge_pow3/strictMono)
- piE_term, piE_term_norm_le, piE_series_summable
- piE_norm_summable, piE_tail_summable, piE_tail_norm_summable
- geom_tail_summable, partialSum_piE_real, piE_limit

Rename HuangzhongLaw72_core.lean -> HuangzhongLaw72/Core.lean to fit
the module hierarchy. Both files now import from Shared instead of
re-declaring the same code.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant