Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
f9e689b
prove thms
vihdzp May 22, 2026
49d3ce8
golf
vihdzp May 22, 2026
5032702
chore(LongestPole): private an import to reduce the rebuild pole (#39…
b-mehta May 22, 2026
33390a7
refactor(RingTheory/Ideal/Height): make `Ideal.primeHeight` private (…
Thmoas-Guan May 22, 2026
de290dd
chore(Topology): remove repeated `grind` from `DenselyOrdered.subsing…
chenson2018 May 22, 2026
c94e7c7
feat(LinearAlgebra/Matrix/SpecialLinearGroup): Add action on R^n (#39…
Whysoserioushah May 22, 2026
b115fc3
feat(EuclideanDomain.Basic): RingEquiv.euclideanDomain (#38723)
xgenereux May 22, 2026
860f946
feat(Tactic): add syntax for `convert!`, `convert_to!`, `ac_change!` …
Vierkantor May 22, 2026
5d0f6d6
feat(RingTheory): convolution product on bialgebra homs (#39281)
YaelDillies May 22, 2026
d8de6b6
feat(Combinatorics/SimpleGraph/Coloring/VertexColoring): `chromaticNu…
SnirBroshi May 23, 2026
9dd2956
feat(NumberTheory/NumberField/Completion/FinitePlace): add multiplici…
MichaelStollBayreuth May 23, 2026
30f4950
feat(Algebra/ContinuedFractions): generalize determinant formula to G…
emlis42 May 23, 2026
50622aa
feat(Tactic): automatically replace convert with convert! (#39721)
Vierkantor May 23, 2026
889ec7b
feat(PresentedGroup): free-product of presentations is isomorphic to…
j-mayoral May 23, 2026
3459947
chore: `IsBotZeroClass (Fin n)` (#39058)
vihdzp May 23, 2026
ec2d568
feat(AlgebraicTopology/SimplicialSet): more API for PairingCore (#39462)
joelriou May 23, 2026
60de57e
feat(AlgebraicTopology): nonsingular simplicial sets (#39463)
joelriou May 23, 2026
ad74f63
feat: `IsBotOneClass (Associates M)` (#39059)
vihdzp May 23, 2026
58faa91
feat(RingTheory/LocalProperties): `Module.FinitePresentation` is a lo…
mbkybky May 23, 2026
9a0ec55
refactor(Algebra/GeometricallyReduced): refactor `Algebra.IsGeometric…
Thmoas-Guan May 23, 2026
504fc86
feat: add congruence lemmas for (d)finsupp big operators (#39422)
eric-wieser May 23, 2026
e449c72
feat(RingTheory): cocommutative bialgebra structure on SymmetricAlgeb…
hawkrobe May 23, 2026
9eb40b4
feat(LinearAlgebra/Matrix/Charpoly/Eigs): generalize to `CommRing`s (…
SnirBroshi May 23, 2026
95a4c73
chore(GroupTheory/QuotientGroup/Basic): remove transitive import (#39…
qawbecrdtey May 23, 2026
7f2af3f
feat(AlgebraicGeometry/Birational/RationalMap): add `RationalMap.repr…
justus-springer May 23, 2026
a79dd59
feat: integral of a continuous bilinear map applied to independent ra…
EtienneC30 May 23, 2026
5e77d5c
chore(CategoryTheory/Limits): some API for binary (co)products (#39594)
chrisflav May 23, 2026
04f69b5
chore: cleanup Integral file (#39652)
sgouezel May 23, 2026
8e3a342
doc(CategoryTheory): fix typo (#39737)
NoahW314 May 23, 2026
0dd5c91
chore(LinearAlgebra/Ray): remove a defeq abuse (#39477)
wwylele May 23, 2026
36c492b
fix(RingTheory): correct misnamed theorem (#39741)
vlad902 May 23, 2026
2715441
refactor(GroupTheory/Torsion): make primaryComponent total (#39484)
rosborn May 23, 2026
65cede5
feat(CategoryTheory/Sites): a cover preserving functor that preserves…
chrisflav May 23, 2026
a6d7083
doc(Order/Cofinal): update module docstring (#39756)
vihdzp May 23, 2026
878dc46
feat(NumberTheory/GaussSum): add shift and conjugation lemmas (#39459)
yuanyi-350 May 23, 2026
9dc3933
chore(scripts): update nolints.json (#39761)
mathlib-nolints[bot] May 24, 2026
f50b40f
perf: shortcut instances for `Semiring` (#39719)
JovanGerb May 24, 2026
200c31b
chore: use `skip` instead of `-failIfUnchanged` in the default tactic…
gasparattila May 24, 2026
88330eb
feat(LinearAlgebra/Projectivization/Action): add instance of SL(n, F)…
Whysoserioushah May 24, 2026
383a355
chore(SetTheory/Cardinality/Cofinality/Club): use `namespace` (#39641)
vihdzp May 24, 2026
07c26b0
chore(Data/Set/Card): make `s.ncard` the simpNF of `Fintype.card s` (…
SnirBroshi May 24, 2026
f440260
feat(Combinatorics/SimpleGraph/Hasse): Hasse diagram is triangle-free…
ertwro May 24, 2026
9de16f2
feat(Combinatorics/SimpleGraph/Sum): add homomorphism, embedding and …
IvanRenison May 24, 2026
7ea6142
feat(Algebra/Category/Ring): `Under.pushout` preserves finite limits …
chrisflav May 24, 2026
11a4a72
chore(Analysis/InnerProductSpace/JointEigenspace): Remove duplicated …
JonBannon May 24, 2026
3b08ecb
chore(CategoryTheory/Limits): generalise universes in instances for r…
chrisflav May 25, 2026
713f616
feat(NumberTheory/ModularForms): Sturm bound for level-1 modular form…
CBirkbeck May 25, 2026
33cfe14
chore: semilinearize LinearMap.submodule[Co]map (#39726)
ADedecker May 25, 2026
8b24269
feat: cofinal subset of regular cardinal is isomorphic to it (#38362)
vihdzp May 25, 2026
a729f9f
feat(ModuleCat): some lemmas for `Ext` in `ModuleCat` (#38466)
Thmoas-Guan May 25, 2026
e96b5ef
feat(Module/Projective): direct sum of projective modules is projecti…
vlad902 May 25, 2026
327a72b
feat(Topology/Algebra/Module): call `eta_expand` in the default tacti…
gasparattila May 25, 2026
773df06
feat: missing nnratCast lemmas for RCLike (#39620)
eric-wieser May 25, 2026
ff7e349
perf(WithVal): avoid Equiv.ring (#39562)
eric-wieser May 25, 2026
526b330
chore: move test files and recapitalise file names (part 2) (#39681)
joneugster May 25, 2026
fc6ef31
perf: fast_instance% in Mathlib.Order.Basic (#39795)
kbuzzard May 25, 2026
a66f298
chore: move test files and recapitalise file names (part 3) (#39682)
joneugster May 25, 2026
66bbabf
feat(GroupTheory/Commutator/Basic): `⁅H₁, H₂⁆` is a normal subgroup o…
SnirBroshi May 25, 2026
8174933
feat: elements of Dedekind domain approximate elements of valuation r…
matthewjasper May 25, 2026
8bfad47
feat(Projectivization/Independence): add lemma about independence (#3…
Whysoserioushah May 25, 2026
b002f16
feat: LinearMap.HasFiniteRange and the associated relation (#39468)
ADedecker May 25, 2026
fbeb4b7
chore(RingTheory/TensorProduct/Basic): some API for `includeLeft` and…
themathqueen May 25, 2026
e3e1200
chore(RingTheory/Smooth/StandardSmoothCotangent): fix typo in instanc…
justus-springer May 25, 2026
193ce4e
doc(RingTheory/Extension/Generators): fix docstring variable name mis…
justus-springer May 25, 2026
268c902
fix: decls with a non-consecutive duplicate namespace (#39794)
SnirBroshi May 25, 2026
50eb44c
feat(Analysis/Calculus): define absolutely monotone functions (#38026)
mrdouglasny May 25, 2026
00f723f
refactor(Analysis): golf `Mathlib/Analysis/Complex/ValueDistribution/…
yuanyi-350 May 25, 2026
ed3a8df
feat: add `ofScientific` lemmas for `Complex`/`RCLike`/`Quaternion` (…
eric-wieser May 25, 2026
fe605ea
feat(Logic/Function/Basic) : lemmas about composition of and in `onFu…
Hagb May 25, 2026
9c18560
feat(Order/WellFoundedSet): minimal element of a nonempty set exists…
Hagb May 25, 2026
afd4bc9
feat(Topology): codiscreteWithin = ⊥ iff IsDiscrete (#39828)
wwylele May 25, 2026
d698adf
feat(Order/Filter/AtTopBot/Finset): relate atTop on Finset with Finse…
b-mehta May 25, 2026
2a51a80
feat(Combinatorics/SimpleGraph/Walk/Paths): a trail which isn't a pat…
SnirBroshi May 25, 2026
02aac9c
feat: order type is monotone (#39803)
vihdzp May 25, 2026
91e0d5b
feat(Geometry/Convex/Cone): Minor additions to pointed cones (#37464)
martinwintermath May 25, 2026
072be06
chore(RingTheory/Smooth/Basic): fix namespace of `mvPolynomial` insta…
justus-springer May 25, 2026
6302f63
chore: rename manifold delaborators to match the naming convention (#…
grunweg May 25, 2026
efd0084
feat(Data/Finset): add InjOn variants of image_{subset,eq}_image_iff …
b-mehta May 25, 2026
c94e5d4
feat(Combinatorics/Enumerative/Composition): add lemma about products…
Paul-Lez May 25, 2026
0a24ddb
chore(Mathlib/Tactic): stop norm_num importing the Bochner integral (…
b-mehta May 25, 2026
c8f2807
feat(Sheaves/EtaleSpace): new file (#39630)
urkud May 25, 2026
65ff5a9
chore(Data/Finset/Slice): remove unnecessary import (#39352)
qawbecrdtey May 25, 2026
5e7c199
chore(CategoryTheory/Limits/Lattice): Fintype.elems -> Finset.univ (#…
Timeroot May 25, 2026
f4740be
chore: deprecate `Ordinal.cof_succ` → `Ordinal.cof_add_one` (#39852)
vihdzp May 25, 2026
ac047eb
feat(Analysis): calculus log 3 and log 5 (#39640)
yuanyi-350 May 25, 2026
350e6d8
feat(Data/Finset/Card): add card_{pair,triple}_eq_iff (#39840)
b-mehta May 25, 2026
75adafc
chore: rename `Order.cof_eq` → `Order.exists_cof_eq` (#39851)
vihdzp May 25, 2026
7dc11aa
feat(Probability/Independence/InfinitePi): rearrangement of infinite …
jvanwinden May 26, 2026
fa11b52
feat(Probability): convolution of Poisson distributions (#34435)
huaizhangchu May 26, 2026
8e466e8
feat(MeasureTheory): add Resolvent (Stieltjes/Cauchy) Transform (#37…
DavidLedvinka May 26, 2026
6be90de
feat(Covering/Vitali): add `exists_disjoint_subfamily_covering_enlarg…
lua-vr May 26, 2026
01a171f
feat: if an L^p space is complete, so is its target space unless the …
sgouezel May 26, 2026
5aba5b4
feat: another version of dominated convergence for `AEMeasurable` fun…
mathlib-splicebot[bot] May 26, 2026
2ef3e88
feat: the sigma-algebra generated by a stochastic process is the coar…
mathlib-splicebot[bot] May 26, 2026
8f8944e
feat: another independence monotonicity lemma (#39748)
EtienneC30 May 26, 2026
7ba9e81
chore(CategoryTheory/Functor): more API for dense functors (#39845)
chrisflav May 26, 2026
f9900a3
feat: add an alias for the forward direction of `indepFun_iff_map_pro…
EtienneC30 May 26, 2026
3174841
chore: drop completeness from the definition of conditional expectati…
sgouezel May 26, 2026
df0b402
feat: the natural filtration of a process is the filtration generated…
EtienneC30 May 26, 2026
2df375a
chore(Analysis/Normed/Group): deprecate duplicate `ofReal_norm_eq_eno…
lua-vr May 26, 2026
da0c6e2
chore: update Mathlib dependencies 2026-05-26 (#39866)
mathlib-update-dependencies[bot] May 26, 2026
a52b53f
chore: rename delaborators to match naming convention (#39822)
grunweg May 26, 2026
ea088ce
feat: a lemma about the symmetric difference of unions (#38536)
CoolRmal May 26, 2026
ef85408
feat(MeasureTheory): the integral of a vector-valued function against…
CoolRmal May 26, 2026
6ed0026
chore(CategoryTheory/Limits): fix name of `HasColimit.isoOfEquivalenc…
chrisflav May 26, 2026
388f44f
feat(RingTheory/Smooth/Basic): add `Generators.mvPolynomial` (#39708)
justus-springer May 26, 2026
c5ea003
chore: bump toolchain to v4.30.0 (#39879)
Garmelon May 26, 2026
c437b65
feat: `unrestricted` character set in unicode linter (#39796)
thorimur May 26, 2026
0e116b2
chore: move test files and capitalise file names (part 4) (#39683)
joneugster May 26, 2026
93231e1
chore: update Mathlib dependencies 2026-05-26 (#39885)
mathlib-update-dependencies[bot] May 26, 2026
f1a41b1
ci(build_template): produce decls.txt + imports.json artifact via mat…
adomani May 26, 2026
5719ef2
feat(Order/Filter/Finite): any filter on a finite type is principal (…
b-mehta May 26, 2026
ddf19b2
feat(GroupTheory/Nilpotent): `Normal` instance for `Sylow` when `IsNi…
SnirBroshi May 27, 2026
4b57c17
fix: check the right 'Parser' namespace in the defsWithUnderscore lin…
grunweg May 27, 2026
1407e6c
feat(Algebra/Adjoin): CoeDep instances for Algebra.adjoin on singleto…
xgenereux May 27, 2026
e745713
feat: overlapping instances linter (#38126)
JovanGerb May 27, 2026
3bf07d8
feat(LinearAlgebra/AffineSpace): shifting a subspace towards a point …
wwylele May 27, 2026
1d51971
feat(MvPowerSeries): some lemmas about `subst` of infinite sum (#38449)
WenrongZou May 27, 2026
9921235
feat(AlgebraicGeometry/Birational): dominant rational maps (#39317)
justus-springer May 27, 2026
d554e81
feat(LinearAlgebra/Trace): trace-zero idempotent endomorphism over Ch…
kim-em May 27, 2026
6fbf326
chore(RingTheory/Bialgebra/Hom): `toCoalgHom` as prefix for `simps` (…
themathqueen May 27, 2026
baddb59
chore(Topology/UniformSpace): rename `uniformContinuous_iff` to `unif…
plp127 May 27, 2026
1d292e2
feat(Projectivization/Colinear): Define colinearity for points in pro…
Whysoserioushah May 27, 2026
1c552fe
feat(GroupTheory/Torsion): the torsion subgroup is preserved by isomo…
tb65536 May 27, 2026
eb6999e
feat(RingTheory/LocalRing/ResidueField/Fiber): `IsLiesOverAlgebra` in…
tb65536 May 27, 2026
fa08db7
refactor(NumberTheory): golf `Mathlib/NumberTheory/SmoothNumbers` (#3…
yuanyi-350 May 27, 2026
3b514fe
feat: if a sigma-algebra is independent from itself then all sets in …
mathlib-splicebot[bot] May 27, 2026
a2e2b4e
feat: when the indicator is independent from a random variable (#39749)
EtienneC30 May 27, 2026
81b7d85
feat(Polynomial): add a variant `toMvPolynomial_inj` (#39931)
WenrongZou May 27, 2026
5fc1f4a
chore(Analysis/SpecialFunctions/Gaussian/PoissonSummation): use `fun_…
yuanyi-350 May 27, 2026
4e35335
refactor(Analysis): golf `Mathlib/Analysis/PSeries` (#39902)
yuanyi-350 May 27, 2026
bcab563
doc(1000.yaml): add Stewart and Apollonius theorems (#39933)
manuelcandales May 27, 2026
cc92837
feat(PowerSeries): rename a power series as multivariate power series…
WenrongZou May 27, 2026
f409310
refactor(GroupTheory/*): additivize `AddAut` (#39884)
tb65536 May 27, 2026
8134355
chore: add missing gcongr attribute (#39932)
sgouezel May 27, 2026
8d95dbc
feat(AlgebraicGeometry/Restrict): a few more restriction lemmas (#39442)
justus-springer May 27, 2026
33c530f
feat: add ``Nat.gcd_right_comm`` and `Int.gcd_right_comm` (#39937)
riccardobrasca May 27, 2026
d4830ba
chore(Data/Finsupp/Defs): remove redundant instances (#39938)
JovanGerb May 27, 2026
4b5956c
chore: deprecate duplicate theorems on `ENat` (#39854)
vihdzp May 27, 2026
7cee6a2
refactor(Analysis): golf `Mathlib/Analysis/Convex/Birkhoff` (#39893)
yuanyi-350 May 27, 2026
3c3bbad
chore: deprecate three lemmas about `Order.succ` on ordinals (#39859)
vihdzp May 27, 2026
d6340e9
doc(SetTheory/Cardinal/Aleph): fix typo (#39860)
vihdzp May 27, 2026
d0a8597
Update Mathlib/SetTheory/Cardinal/Regular.lean
vihdzp May 28, 2026
7ac1ea6
Merge branch 'prealeph' of https://github.com/vihdzp/mathlib4 into pr…
vihdzp May 29, 2026
da04ff8
ofNat
vihdzp May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/get-mathlib-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
# Default pinned commit used by workflows unless they explicitly override.
# Update this ref as needed to pick up changes to mathlib-ci scripts
# This is also updated automatically by .github/workflows/update_dependencies.yml
default: 78f34ded6a5f5aa11ea5b7c3120fe5d8422db1da
default: aafe3df227b81f681afa3978f9eab0e2bbcd0582
path:
description: Checkout destination path.
required: false
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/build_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -733,17 +733,36 @@ jobs:
run: |
lake exe graph

- name: Checkout local actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.workflow_sha }}
fetch-depth: 1
sparse-checkout: .github/actions
path: workflow-actions

- name: Get mathlib-ci
uses: ./workflow-actions/.github/actions/get-mathlib-ci

- name: dump declarations and transitive-import counts
run: |
lake env lean --run "${CI_SCRIPTS_DIR}/pr_summary/dumpReasonableDecls.lean" \
--out decls.txt --imports-out imports.json Mathlib

- name: upload the import graph
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: import-graph
path: import_graph.dot
## the default is 90, but we build often, so unless there's a reason
## to care about old copies in the future, just say 7 days for now
retention-days: 7
path: |
import_graph.dot
decls.txt
imports.json
## Master pushes: 90 days, so later PRs forked from these commits
## can consume the dumps from the artifact. Other branches: 7 days.
retention-days: ${{ github.ref == 'refs/heads/master' && '90' || '7' }}

- name: clean up the import graph file
run: rm import_graph.dot
run: rm -f import_graph.dot decls.txt imports.json

- name: check all scripts build successfully
run: |
Expand Down
2 changes: 1 addition & 1 deletion Archive/Examples/Eisenstein.lean
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ example : Irreducible (X ^ 4 - 10 * X ^ 2 + 1 : ℤ[X]) := by
CharP.ker_intAlgebraMap_eq_span 3, span_singleton_pow, mem_span_singleton]
norm_num
rw [hfq, ← modByMonicHom_apply, map_add]
convert zero_add _
convert! zero_add _
· rw [← LinearMap.mem_ker, mem_ker_modByMonic hq_monic]
rw [pow_two, ← sub_mul]
apply dvd_mul_left
Expand Down
2 changes: 1 addition & 1 deletion Archive/Imo/Imo1959Q2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ theorem sqrt_two_mul_sub_one_le_one : sqrt (2 * x - 1) ≤ 1 ↔ x ≤ 1 := by
theorem isGood_iff_eq_sqrt_two (hx : x ∈ Icc (1 / 2) 1) : IsGood x A ↔ A = sqrt 2 := by
have : sqrt (2 * x - 1) ≤ 1 := sqrt_two_mul_sub_one_le_one.2 hx.2
simp only [isGood_iff, hx.1, abs_sub_comm _ (1 : ℝ), abs_of_nonneg (sub_nonneg.2 this), and_true]
suffices 2 = A * sqrt 2 ↔ A = sqrt 2 by convert this using 2; ring
suffices 2 = A * sqrt 2 ↔ A = sqrt 2 by convert! this using 2; ring
rw [← div_eq_iff, div_sqrt, eq_comm]
positivity

Expand Down
4 changes: 2 additions & 2 deletions Archive/Imo/Imo1982Q3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ end Imo1982Q3
theorem imo1982_q3a (hx : Antitone x) (h0 : x 0 = 1) (hp : ∀ k, 0 < x k) :
∃ n : ℕ, 3.999 ≤ ∑ k ∈ range n, (x k) ^ 2 / x (k + 1) := by
use 4000
convert Imo1982Q3.ineq (Nat.succ_ne_zero 3998) hx h0 hp
convert! Imo1982Q3.ineq (Nat.succ_ne_zero 3998) hx h0 hp
norm_num

/-- Part b of the problem is solved by `x k = (1 / 2) ^ k`. -/
Expand All @@ -88,6 +88,6 @@ theorem imo1982_q3b : ∃ x : ℕ → ℝ, Antitone x ∧ x 0 = 1 ∧ (∀ k, 0
simp_rw [← pow_mul, pow_succ, ← div_eq_mul_inv, div_div_eq_mul_div, mul_comm, mul_div_assoc,
← mul_sum, div_eq_mul_inv, this, ← two_add_two_eq_four, ← mul_two,
mul_lt_mul_iff_of_pos_left two_pos]
convert NNReal.coe_lt_coe.2 <| geom_sum_lt (inv_ne_zero two_ne_zero) two_inv_lt_one n
convert! NNReal.coe_lt_coe.2 <| geom_sum_lt (inv_ne_zero two_ne_zero) two_inv_lt_one n
· simp
· norm_num
2 changes: 1 addition & 1 deletion Archive/Imo/Imo1994Q1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ theorem imo1994_q1 (n : ℕ) (m : ℕ) (A : Finset ℕ) (hm : #A = m + 1)
-- `i ↦ m-i`
-- We reindex the sum by fin (m+1)
have : ∑ x ∈ A, x = ∑ i : Fin (m + 1), a i := by
convert sum_image fun x _ y _ => a.eq_iff_eq.1
convert! sum_image fun x _ y _ => a.eq_iff_eq.1
rw [← coe_inj]; simp [a]
rw [this]; clear this
-- The main proof is a simple calculation by rearranging one of the two sums
Expand Down
2 changes: 1 addition & 1 deletion Archive/Imo/Imo1998Q2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ end
theorem clear_denominators {a b k : ℕ} (ha : 0 < a) (hb : 0 < b) :
(b - 1 : ℚ) / (2 * b) ≤ k / a ↔ ((b : ℕ) - 1) * a ≤ k * (2 * b) := by
rw [div_le_div_iff₀]
on_goal 1 => convert Nat.cast_le (α := ℚ)
on_goal 1 => convert! Nat.cast_le (α := ℚ)
all_goals simp [ha, hb]

end
Expand Down
4 changes: 2 additions & 2 deletions Archive/Imo/Imo2001Q5.lean
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ lemma x_pos : 0 < s.x := by
have col := s.ABC_eq; rw [h, mul_zero] at col
replace col : Collinear ℝ {s.A, s.B, s.C} := by
apply collinear_of_sin_eq_zero; rw [col, Real.sin_zero]
apply s.not_collinear_BAC; convert col using 1; grind
apply s.not_collinear_BAC; convert! col using 1; grind

lemma Q_ne_A : s.Q ≠ s.A := by
by_contra h; have := s.ABQ_eq
Expand All @@ -127,7 +127,7 @@ lemma x_lt_pi_div_three : s.x < π / 3 := by
have col : ∠ s.A s.C s.B = 0 := by linarith [s.ACB_eq, angle_nonneg s.A s.C s.B]
replace col : Collinear ℝ {s.A, s.C, s.B} := by
apply collinear_of_sin_eq_zero; rw [col, Real.sin_zero]
apply s.not_collinear_BAC; convert col using 1; grind
apply s.not_collinear_BAC; convert! col using 1; grind

lemma APB_eq : ∠ s.A s.P s.B = 5 * π / 6 - 2 * s.x := by
have := angle_add_angle_add_angle_eq_pi s.P s.A_ne_B
Expand Down
4 changes: 2 additions & 2 deletions Archive/Imo/Imo2006Q3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ theorem subst_proof₁ (x y z s : ℝ) (hxyz : x + y + z = 0) :
· rw [div_mul_eq_mul_div, le_div_iff₀' zero_lt_32]
exact subst_wlog h' hxyz
rcases (mul_nonneg_of_three x y z).resolve_left h' with h | h
· convert this y z x _ h using 2 <;> linarith
· convert this z x y _ h using 2 <;> linarith
· convert! this y z x _ h using 2 <;> linarith
· convert! this z x y _ h using 2 <;> linarith

theorem proof₁ {a b c : ℝ} :
|a * b * (a ^ 2 - b ^ 2) + b * c * (b ^ 2 - c ^ 2) + c * a * (c ^ 2 - a ^ 2)| ≤
Expand Down
4 changes: 2 additions & 2 deletions Archive/Imo/Imo2006Q5.lean
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ theorem Polynomial.isPeriodicPt_eval_two {P : Polynomial ℤ} {t : ℤ}
have Hdvd : C.Chain (· ∣ ·) := by
rw [Cycle.chain_map, periodicOrbit_chain' _ ht]
intro n
convert sub_dvd_eval_sub ((fun x => P.eval x)^[n + 1] t) ((fun x => P.eval x)^[n] t) P <;>
convert! sub_dvd_eval_sub ((fun x => P.eval x)^[n + 1] t) ((fun x => P.eval x)^[n] t) P <;>
rw [Function.iterate_succ_apply']
-- Any two entries in C have the same absolute value.
have Habs :
Expand Down Expand Up @@ -112,7 +112,7 @@ theorem Polynomial.isPeriodicPt_eval_two {P : Polynomial ℤ} {t : ℤ}
-- They must have opposite sign, so that P^{k + 1}(t) - P^k(t) = P^{k + 2}(t) - P^{k + 1}(t).
rcases Int.natAbs_eq_natAbs_iff.1 (Habs n n.succ) with hn' | hn'
· apply (hn _).elim
convert hn' <;> simp only [Function.iterate_succ_apply']
convert! hn' <;> simp only [Function.iterate_succ_apply']
-- We deduce P^{k + 2}(t) = P^k(t) and hence P(P(t)) = t.
· rw [neg_sub, sub_right_inj] at hn'
simp only [Function.iterate_succ_apply'] at hn'
Expand Down
2 changes: 1 addition & 1 deletion Archive/Imo/Imo2008Q2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ theorem imo2008_q2a (x y z : ℝ) (h : x * y * z = 1) (hx : x ≠ 1) (hy : y ≠
have hmn_ne_zero : m + n ≠ 0 := by contrapose hz; field_simp; linarith
have hc_sub_sub : c - (c - m - n) = m + n := by abel
rw [ge_iff_le, ← sub_nonneg]
convert sq_nonneg ((c * (m ^ 2 + n ^ 2 + m * n) - m * (m + n) ^ 2) / (m * n * (m + n)))
convert! sq_nonneg ((c * (m ^ 2 + n ^ 2 + m * n) - m * (m + n) ^ 2) / (m * n * (m + n)))
simp [field, hc_sub_sub]; ring

def rationalSolutions :=
Expand Down
36 changes: 18 additions & 18 deletions Archive/Imo/Imo2010Q5.lean
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ lemma push {B : Fin 6 → ℕ} {i : Fin 6} (rB : Reachable B) (hi : i < 5) :
Reachable (B - single i (B i) + single (i + 1) (2 * B i)) := by
obtain hc | hc := (B i).eq_zero_or_pos
· rwa [hc, mul_zero, single_zero, single_zero, add_zero, tsub_zero]
· convert (rB.move1 hi hc).push hi using 1
· convert! (rB.move1 hi hc).push hi using 1
ext k; simp only [add_apply, sub_apply]
rcases eq_or_ne k i with rfl | hk
· simp_rw [single_eq_same, tsub_self, single_succ]
Expand All @@ -92,29 +92,29 @@ termination_by B i
/-- `(0, 0, 5, 11, 0, 0)` is reachable. -/
lemma five_eleven : Reachable (single 2 5 + single 3 11) := by
have R : Reachable (single 1 3 + single 2 1 + single 3 1 + single 4 1 + single 5 1) := by
convert base.push (show 0 < 5 by decide) using 1; decide
convert! base.push (show 0 < 5 by decide) using 1; decide
replace R : Reachable (single 2 7 + single 3 1 + single 4 1 + single 5 1) := by
convert R.push (show 1 < 5 by decide) using 1; decide
convert! R.push (show 1 < 5 by decide) using 1; decide
replace R : Reachable (single 2 7 + single 4 3 + single 5 1) := by
convert R.push (show 3 < 5 by decide) using 1; decide
convert! R.push (show 3 < 5 by decide) using 1; decide
replace R : Reachable (single 2 7 + single 5 7) := by
convert R.push (show 4 < 5 by decide) using 1; decide
convert! R.push (show 4 < 5 by decide) using 1; decide
replace R : Reachable (single 2 6 + single 3 2 + single 5 7) := by
convert R.move1 (show 2 < 5 by decide) (by decide) using 1; decide
convert! R.move1 (show 2 < 5 by decide) (by decide) using 1; decide
replace R : Reachable (single 2 6 + single 3 1 + single 4 2 + single 5 7) := by
convert R.move1 (show 3 < 5 by decide) (by decide) using 1; decide
convert! R.move1 (show 3 < 5 by decide) (by decide) using 1; decide
replace R : Reachable (single 2 6 + single 3 1 + single 5 11) := by
convert R.push (show 4 < 5 by decide) using 1; decide
convert! R.push (show 4 < 5 by decide) using 1; decide
replace R : Reachable (single 2 6 + single 4 11) := by
convert R.move2 (show 3 < 4 by decide) (by decide) using 1; decide
convert R.move2 (show 2 < 4 by decide) (by decide) using 1; decide
convert! R.move2 (show 3 < 4 by decide) (by decide) using 1; decide
convert! R.move2 (show 2 < 4 by decide) (by decide) using 1; decide

/-- Decrement $B_i$ and double $B_{i+1}$, assuming $B_{i+2} = 0$, by doing `push, move2`. -/
lemma double {B : Fin 6 → ℕ} {i : Fin 6}
(rB : Reachable B) (hi : i < 4) (pB : 0 < B i) (zB : B (i + 2) = 0) :
Reachable (B + single (i + 1) (B (i + 1)) - single i 1) := by
convert (rB.push (show i + 1 < 5 by grind)).move2 hi (by
rw [add_apply, sub_apply, single_succ]; grind)
convert!
(rB.push (show i + 1 < 5 by grind)).move2 hi (by rw [add_apply, sub_apply, single_succ]; grind)
ext k; simp only [comp_apply, add_apply, sub_apply]
have (j : Fin 6) : j + 1 + 1 = j + 2 := by grind
rcases eq_or_ne k i with rfl | hk
Expand All @@ -132,7 +132,7 @@ lemma doubles {B : Fin 6 → ℕ} {i : Fin 6} (rB : Reachable B) (hi : i < 4) (z
Reachable (update (B - single i (B i)) (i + 1) (B (i + 1) * 2 ^ B i)) := by
obtain hc | hc := (B i).eq_zero_or_pos
· rwa [hc, single_zero, tsub_zero, pow_zero, mul_one, update_eq_self]
· convert (rB.double hi hc zB).doubles hi (by
· convert! (rB.double hi hc zB).doubles hi (by
rw [sub_apply, add_apply, single_eq_of_ne (by simp), zB, zero_add, zero_tsub]) using 1
ext k
simp_rw [sub_apply, add_apply, single_eq_same, single_succ, single_succ', add_zero, tsub_zero,
Expand All @@ -149,9 +149,9 @@ termination_by B i
lemma exp {B : Fin 6 → ℕ} {i : Fin 6}
(rB : Reachable B) (hi : i < 4) (pB : 0 < B i) (zB : B (i + 1) = 0) (zB' : B (i + 2) = 0) :
Reachable (B - single i (B i) + single (i + 1) (2 ^ B i)) := by
convert (rB.move1 (show i < 5 by grind) pB).doubles hi (by
convert! (rB.move1 (show i < 5 by grind) pB).doubles hi (by
rw [add_apply, sub_apply, zB', single_eq_of_ne (by simp), tsub_zero,
single_eq_of_ne (by simp), zero_add]) using 1
single_eq_of_ne (by simp), zero_add]) using 1
simp_rw [add_apply, sub_apply, single_eq_same, single_succ, single_succ', zB, zero_tsub, zero_add,
add_zero, ← pow_succ', Nat.sub_add_cancel pB]
ext k; simp only [add_apply, sub_apply]
Expand All @@ -167,7 +167,7 @@ lemma exp_mid {k n : ℕ} (h : Reachable (single 2 (k + 1) + single 3 n)) (hn :
Reachable (single 2 k + single 3 (2 ^ n)) := by
have md := h.exp (show 3 < 4 by decide) (by simp [hn])
(by simp [add_apply, single_eq_of_ne]) (by simp [add_apply, single_eq_of_ne])
convert md.move2 (show 2 < 4 by decide) (by
convert! md.move2 (show 2 < 4 by decide) (by
simp only [add_apply, sub_apply, single_eq_same]
iterate 3 rw [single_eq_of_ne (by decide)]
simp) using 1
Expand All @@ -192,7 +192,7 @@ lemma reduce {m n : ℕ} (h : Reachable (single 3 n)) (hmn : m ≤ n) : Reachabl
| base => exact h
| succ k _ ih =>
apply ih
convert h.move2 (show 3 < 4 by decide) k.succ_pos
convert! h.move2 (show 3 < 4 by decide) k.succ_pos
ext i; simp only [sub_apply, comp_apply]
rcases eq_or_ne i 3 with rfl | i3
· rw [swap_apply_of_ne_of_ne (by decide) (by decide)]
Expand Down Expand Up @@ -231,7 +231,7 @@ theorem result : Reachable (single 5 (2010 ^ 2010 ^ 2010)) := by
-- See https://github.com/leanprover/lean4/issues/11713
set m : ℕ := 2010
have hm : m = 2010 := by rfl
convert ((quarter_target hm).push (show 3 < 5 by decide)).push (show 4 < 5 by decide)
convert! ((quarter_target hm).push (show 3 < 5 by decide)).push (show 4 < 5 by decide)
simp only [single_eq_same, tsub_self, Fin.reduceAdd, zero_add, single_inj]
rw [← mul_assoc, show 2 * 2 = 4 by rfl, mul_comm, Nat.div_mul_cancel]
trans 2010 ^ 2
Expand Down
4 changes: 2 additions & 2 deletions Archive/Imo/Imo2015Q6.lean
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ lemma sum_telescope {m n : ℕ} (hm : N ≤ m) (hn : m < n) :

include ht in
lemma le_sum_pool : ∑ i ∈ range b, (i : ℤ) ≤ ∑ x ∈ pool a t, x := by
convert sum_range_le_sum fun x mx ↦ (mem_Icc.mp ((pool_subset_Icc ha) mx)).1
convert! sum_range_le_sum fun x mx ↦ (mem_Icc.mp ((pool_subset_Icc ha) mx)).1
· rw [hbN _ ht]
· rw [zero_add]

include ht in
lemma sum_pool_le : ∑ x ∈ pool a t, x ≤ ∑ i ∈ range (b - 1), (2014 - i : ℤ) := by
have zmp := zero_mem_pool ha hbN ht
rw [← insert_erase zmp, sum_insert (notMem_erase _ _), zero_add]
convert sum_le_sum_range fun x mx ↦ ?_
convert! sum_le_sum_range fun x mx ↦ ?_
· rw [card_erase_of_mem zmp, hbN _ ht]
· exact (mem_Icc.mp ((pool_subset_Icc ha) (mem_erase.mp mx).2)).2

Expand Down
4 changes: 2 additions & 2 deletions Archive/Imo/Imo2019Q2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ theorem sbtw_A_B₁_C : Sbtw ℝ cfg.A cfg.B₁ cfg.C :=

theorem sbtw_A_A₁_A₂ : Sbtw ℝ cfg.A cfg.A₁ cfg.A₂ := by
refine Sphere.sbtw_secondInter cfg.A_mem_circumsphere ?_
convert cfg.sbtw_B_A₁_C.dist_lt_max_dist _
convert! cfg.sbtw_B_A₁_C.dist_lt_max_dist _
change _ = max (dist (cfg.triangleABC.points 1) _) (dist (cfg.triangleABC.points 2) _)
simp_rw [circumsphere_center, circumsphere_radius, dist_circumcenter_eq_circumradius, max_self]

Expand Down Expand Up @@ -375,7 +375,7 @@ variable [Module.Oriented ℝ V (Fin 2)]
theorem two_zsmul_oangle_QPA₂_eq_two_zsmul_oangle_BAA₂ :
(2 : ℤ) • ∡ cfg.Q cfg.P cfg.A₂ = (2 : ℤ) • ∡ cfg.B cfg.A cfg.A₂ := by
refine two_zsmul_oangle_of_parallel cfg.QP_parallel_BA ?_
convert AffineSubspace.Parallel.refl (k := ℝ) (P := Pt) _ using 1
convert! AffineSubspace.Parallel.refl (k := ℝ) (P := Pt) _ using 1
rw [cfg.collinear_PAA₁A₂.affineSpan_eq_of_ne (Set.mem_insert_of_mem _
(Set.mem_insert_of_mem _ (Set.mem_insert_of_mem _ (Set.mem_singleton _))))
(Set.mem_insert_of_mem _ (Set.mem_insert _ _)) cfg.A₂_ne_A,
Expand Down
14 changes: 7 additions & 7 deletions Archive/Imo/Imo2024Q1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ lemma condition_sub_two_mul_int_iff {α : ℝ} (m : ℤ) : Condition (α - 2 * m
simp_rw [← Finset.sum_sub_distrib, mul_sub]
norm_cast
simp_rw [Int.floor_sub_intCast, sub_sub_cancel_left]
convert condition_two_mul_int (-m) n hn
convert! condition_two_mul_int (-m) n hn
norm_cast
rw [Int.floor_intCast]
simp
Expand All @@ -76,9 +76,9 @@ lemma mem_Ico_one_of_mem_Ioo (h : α ∈ Set.Ioo 0 2) : α ∈ Set.Ico 1 2 := by
apply hr.ne'
suffices ⌈α⁻¹⌉₊ = (1 : ℤ) from mod_cast this
apply Int.eq_one_of_dvd_one (Int.zero_le_ofNat _)
convert hc ⌈α⁻¹⌉₊ (zero_lt_one.trans hr)
convert! hc ⌈α⁻¹⌉₊ (zero_lt_one.trans hr)
rw [← Finset.add_sum_Ico_eq_sum_Icc hr.le]
convert (add_zero _).symm
convert! (add_zero _).symm
· rw [Int.floor_eq_iff]
constructor
· rw [Int.cast_one]
Expand Down Expand Up @@ -129,7 +129,7 @@ lemma mem_Ico_n_of_mem_Ioo (h : α ∈ Set.Ioo 0 2) {n : ℕ} (hn : 0 < n) :
by_contra
rw [show ⌊(k + 1 : ℕ) * α⌋ = 2 * k by lia] at hc
have hc' : ((k + 1 : ℕ) : ℤ) ∣ ((k + 1 : ℕ) : ℤ) * ((k + 1 : ℕ) : ℤ) - 1 := by
convert hc using 1
convert! hc using 1
push_cast
ring
rw [dvd_sub_right (dvd_mul_right _ _), ← isUnit_iff_dvd_one, Int.isUnit_iff] at hc'
Expand All @@ -140,7 +140,7 @@ lemma mem_Ico_n_of_mem_Ioo (h : α ∈ Set.Ioo 0 2) {n : ℕ} (hn : 0 < n) :
ring
· rw [Int.floor_eq_iff] at hk'
rw [div_le_iff₀ (by norm_cast; lia), mul_comm α]
convert hk'.1
convert! hk'.1
push_cast
ring

Expand All @@ -153,7 +153,7 @@ lemma not_condition_of_mem_Ioo {α : ℝ} (h : α ∈ Set.Ioo 0 2) : ¬Condition
have hna := (hc.mem_Ico_n_of_mem_Ioo h hn).1
rcases h with ⟨-, h2⟩
have hna' : 2 - (n : ℝ)⁻¹ ≤ α := by
convert hna using 1
convert! hna using 1
field
rw [sub_eq_add_neg, ← le_sub_iff_add_le', neg_le, neg_sub] at hna'
rw [le_inv_comm₀ (by linarith) (mod_cast hn), ← not_lt] at hna'
Expand All @@ -167,7 +167,7 @@ lemma condition_iff_of_mem_Ico {α : ℝ} (h : α ∈ Set.Ico 0 2) : Condition
| inl h => exact h
| inr ho => exact False.elim (not_condition_of_mem_Ioo ho hc)
· rintro rfl
convert condition_two_mul_int 0
convert! condition_two_mul_int 0
norm_num

recall Imo2024Q1.Condition (α : ℝ) := (∀ n : ℕ, 0 < n → (n : ℤ) ∣ ∑ i ∈ Finset.Icc 1 n, ⌊i * α⌋)
Expand Down
8 changes: 4 additions & 4 deletions Archive/Imo/Imo2024Q2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ lemma dvd_pow_iff_of_dvd_sub {a b d n : ℕ} {z : ℤ} (ha : a.Coprime d)
d ∣ a ^ n + b ↔ (((ZMod.unitOfCoprime _ ha) ^ z : (ZMod d)ˣ) : ZMod d) + b = 0 := by
rcases hd with ⟨k, hk⟩
rw [← ZMod.natCast_eq_zero_iff]
convert Iff.rfl
convert! Iff.rfl
push_cast
congr
suffices (((ZMod.unitOfCoprime _ ha) ^ z : (ZMod d)ˣ) : ZMod d) =
(((ZMod.unitOfCoprime _ ha) ^ (n : ℤ) : (ZMod d)ˣ) : ZMod d) by
convert this
convert! this
rw [sub_eq_iff_eq_add] at hk
rw [hk, zpow_add, zpow_mul]
norm_cast
Expand Down Expand Up @@ -139,11 +139,11 @@ lemma ab_add_one_dvd_a_pow_large_n_add_b : a * b + 1 ∣ a ^ h.large_n + b := by
norm_cast
simp only [mul_inv_cancel, Units.val_one, ZMod.coe_unitOfCoprime]
norm_cast
convert ZMod.natCast_self (a * b + 1) using 2
convert! ZMod.natCast_self (a * b + 1) using 2
exact add_comm _ _

lemma ab_add_one_dvd_b_pow_large_n_add_a : a * b + 1 ∣ b ^ h.large_n + a := by
convert h.symm.ab_add_one_dvd_a_pow_large_n_add_b using 1
convert! h.symm.ab_add_one_dvd_a_pow_large_n_add_b using 1
· rw [mul_comm]
· rw [h.symm_large_n]

Expand Down
Loading
Loading