Skip to content

Commit f11df4d

Browse files
authored
fixes after bump to v4.22.0 (google-deepmind#1141)
1 parent 952798f commit f11df4d

File tree

11 files changed

+54
-39
lines changed

11 files changed

+54
-39
lines changed

FormalConjectures/ErdosProblems/730.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,16 @@ There are examples where $(n, m) ∈ S$ with $m ≠ n + 1$.
5858
(Found by AlphaProof, although it was implicit already in [A129515])
5959
-/
6060
@[category research solved, AMS 11]
61-
theorem erdos_730.variants.delta_ne_one : ∃ (n m : ℕ) (h : (n, m) ∈ S), m ≠ n + 1 := by
61+
theorem erdos_730.variants.delta_ne_one : ∃ (n m : ℕ), (n, m) ∈ S m ≠ n + 1 := by
6262
dsimp [S]
6363
use 10003
6464
use 10005
65-
simp_all
66-
norm_num [ Finset.ext_iff,Nat.choose_eq_zero_iff]
67-
simp_rw[Nat.choose_eq_descFactorial_div_factorial]
65+
norm_num [Finset.ext_iff, Nat.choose_eq_zero_iff]
66+
simp_rw [Nat.choose_eq_descFactorial_div_factorial]
6867
intro p hp
6968
constructor
7069
all_goals exact fun h' => or_self_iff.1 (hp.dvd_mul.1 (
71-
h'.trans (by refine' of_decide_eq_true (by constructor:_ = ↑_))))
70+
h'.trans (by refine' of_decide_eq_true (by constructor : _ = ↑_))))
7271

7372

7473
end Erdos730

FormalConjectures/ErdosProblems/74.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ theorem SimpleGraph.subgraphEdgeDistsToBipartite_bddAbove (G : SimpleGraph V) (n
8585
have := h_fin.fintype
8686
have := Fintype.ofFinite ↑A.coe.edgeSet
8787
convert (A.coe).card_edgeFinset_le_card_choose_two
88-
· rw [← Set.ncard_coe_Finset A.coe.edgeFinset, coe_edgeFinset A.coe, ← Subgraph.image_coe_edgeSet_coe A]
88+
· rw [← Set.ncard_coe_finset A.coe.edgeFinset, coe_edgeFinset A.coe, ← Subgraph.image_coe_edgeSet_coe A]
8989
exact (Set.ncard_image_iff (Set.toFinite A.coe.edgeSet)).mpr <|
9090
Function.Injective.injOn <| Sym2.map.injective Subtype.coe_injective
9191
· rw [Set.ncard_eq_toFinset_card _ h_fin, Set.Finite.card_toFinset]

FormalConjectures/ForMathlib/Computability/TuringMachine/BusyBeavers.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def HaltsAfter (s : Cfg Γ Λ) (n : ℕ) : Prop :=
169169

170170
lemma haltsAfter_zero_iff (s : Cfg Γ Λ) :
171171
HaltsAfter M s 0 ↔ step M s = none := by
172-
rw [HaltsAfter, multiStep, Function.iterate_one, Option.some_bind]
172+
rw [HaltsAfter, multiStep, Function.iterate_one, Option.bind_some]
173173

174174
lemma isHalting_iff_exists_haltsAt : IsHalting M ↔ ∃ n, M.HaltsAfter (init []) n :=
175175
fun _ ↦ eval_dom_iff.mpr IsHalting.halts, fun H ↦ ⟨eval_dom_iff.mp H⟩⟩

FormalConjectures/ForMathlib/Computability/TuringMachine/PostTuringMachine.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ theorem eval_dom_iff {σ : Type*} {f : σ → Option σ} {s : σ} :
6666
refine ⟨fun ⟨n, hn⟩ ↦ ?_, fun H ↦ ?_⟩
6767
· induction n generalizing s with
6868
| zero =>
69-
rw [zero_add, Function.iterate_one, Option.some_bind] at hn
69+
rw [zero_add, Function.iterate_one, Option.bind_some] at hn
7070
simpa [Part.dom_iff_mem] using ⟨s, dom_of_apply_eq_none hn⟩
7171
| succ n ih =>
7272
obtain ha | ⟨a', ha'⟩ := (f s).eq_none_or_eq_some
7373
· simpa [Part.dom_iff_mem] using ⟨s, dom_of_apply_eq_none ha⟩
74-
· simp_rw [Function.iterate_succ, Function.comp_apply, Option.some_bind] at hn ih
75-
simp_rw [ha', Option.some_bind] at hn
74+
· simp_rw [Function.iterate_succ, Function.comp_apply, Option.bind_some] at hn ih
75+
simp_rw [ha', Option.bind_some] at hn
7676
have ih := @ih a' ⟨n, hn⟩ hn
7777
rwa [Turing.eval_eq_eval ha']
7878
· let C (s) : Prop := (Turing.eval f s).Dom → ∃ n, (Option.bind · f)^[n+1] s = none
@@ -83,7 +83,7 @@ theorem eval_dom_iff {σ : Type*} {f : σ → Option σ} {s : σ} :
8383
simp [ha]
8484
· obtain ⟨n, hn⟩ := h a' ha' (by rwa [←Turing.eval_eq_eval ha'])
8585
use n + 1
86-
simp only [Function.iterate_succ, Function.comp_apply, Option.some_bind] at hn
86+
simp only [Function.iterate_succ, Function.comp_apply, Option.bind_some] at hn
8787
simp [ha', hn]
8888

8989
end Turing
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/-
2+
Copyright 2025 The Formal Conjectures Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-/
16+
17+
import Mathlib.Data.Finset.Empty
18+
19+
@[simp]
20+
theorem Finset.univ_finset_of_isEmpty {α : Type*} [h : IsEmpty α] :
21+
(Set.univ : Set (Finset α)) = {∅} := by
22+
ext S
23+
rw [Set.mem_singleton_iff, eq_true (Set.mem_univ S), true_iff]
24+
ext a
25+
exact IsEmpty.elim h a

FormalConjectures/ForMathlib/Data/Nat/Factorization/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ theorem prod_primeFactors_factorization_apply (n : ℕ) {p : ℕ} (hp : p.Prime)
2424
rw [factorization_prod fun _ _ _ ↦ by simp_all, Finset.sum_congr rfl fun x hx ↦ by
2525
rw [factorization_pow, (mem_primeFactors.1 hx).1.factorization]]
2626
by_cases hpn : p ∣ n <;> simp [Finsupp.single_apply, hp, hpn]
27-
· exact fun _ ↦ by simp_all [hf₀]
27+
· exact fun _ ↦ by simp_all
2828
· simp [hf _ _ hpn]
2929

3030
end Nat

FormalConjectures/ForMathlib/Data/Real/Constants.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
-/
1616

17-
import Mathlib.MeasureTheory.Integral.Bochner
17+
import Mathlib.MeasureTheory.Integral.Bochner.Basic
1818
import Mathlib.MeasureTheory.Measure.Haar.OfBasis
1919

2020
/-! # Standard real valued constants

FormalConjectures/ForMathlib/Data/Set/Triplewise.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ theorem triplewise_of_encard_lt (r : α → α → α → Prop)
5454
contrapose! h
5555
obtain ⟨x, hx, y, hy, z, hz, hxy, hyz, hxz, _⟩ := h
5656
trans encard {x, y, z}
57-
· norm_num [encard_insert_of_not_mem, *]
57+
· norm_num [encard_insert_of_notMem, *]
5858
· exact encard_le_encard_of_injOn (by simp [MapsTo, hx, hy, hz]) (injOn_id _)
5959

6060
@[simp]
6161
theorem triplewise_empty (r : α → α → α → Prop) :
6262
Set.Triplewise ∅ r :=
63-
(not_mem_empty · · |>.elim)
63+
(notMem_empty · · |>.elim)
6464

6565
@[simp]
6666
theorem triplewise_singleton (r : α → α → α → Prop) :

FormalConjectures/Util/ForMathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import FormalConjectures.ForMathlib.Combinatorics.SimpleGraph.GraphConjectures.I
3434
import FormalConjectures.ForMathlib.Combinatorics.SimpleGraph.Balanced
3535
import FormalConjectures.ForMathlib.Computability.TuringMachine.BusyBeavers
3636
import FormalConjectures.ForMathlib.Computability.TuringMachine.PostTuringMachine
37+
import FormalConjectures.ForMathlib.Data.Finset.Empty
3738
import FormalConjectures.ForMathlib.Data.Finset.OrdConnected
3839
import FormalConjectures.ForMathlib.Data.Nat.Factorization.Basic
3940
import FormalConjectures.ForMathlib.Data.Nat.Full

FormalConjectures/Wikipedia/Conway99Graph.lean

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ open SimpleGraph
3030

3131
variable {V : Type} {G : SimpleGraph V}
3232

33-
3433
@[category undergraduate, AMS 5]
3534
lemma completeGraphIsClique (s : Finset V) : (⊤ : SimpleGraph V).IsClique s :=
3635
Pairwise.set_pairwise (fun _ _ a ↦ a) _
@@ -40,7 +39,7 @@ variable [Fintype V]
4039
@[category undergraduate, AMS 5]
4140
lemma completeGraph_cliqueSet :
4241
(⊤ : SimpleGraph V).cliqueSet (Fintype.card V) = {Set.univ.toFinset} := by
43-
simp only [SimpleGraph.cliqueSet, SimpleGraph.isNClique_iff ⊤, completeGraphIsClique, true_and,
42+
simp only [cliqueSet, isNClique_iff ⊤, completeGraphIsClique, true_and,
4443
Set.toFinset_univ]
4544
exact (Set.Sized.univ_mem_iff fun ⦃x⦄ a ↦ a).mp rfl
4645

@@ -71,9 +70,9 @@ The triangle is an example with 3 vertices satisfying the condition.
7170
theorem triangle_locallyLinear_and_nonEdgesAreDiagonals : (completeGraph (Fin 3)).LocallyLinear ∧
7271
NonEdgesAreDiagonals (completeGraph (Fin 3)) := by
7372
constructor
74-
· simp [SimpleGraph.LocallyLinear]
73+
· simp [LocallyLinear]
7574
constructor
76-
· simp only [SimpleGraph.EdgeDisjointTriangles, Set.Pairwise]
75+
· simp only [EdgeDisjointTriangles, Set.Pairwise]
7776
intro x hx y hy hxy
7877
have := @completeGraph_cliqueSet (Fin 3) _
7978
rw [Fintype.card_fin] at this
@@ -101,15 +100,14 @@ theorem conway9_nonEdgesAreDiagonals : NonEdgesAreDiagonals Conway9 := by
101100
exact Fintype.ofFinite ↑(Conway9.neighborSet i)
102101
have : ∀ i j, ((Conway9.neighborFinset i) ∩ Conway9.neighborFinset j).card =
103102
(Conway9.neighborSet i ∩ Conway9.neighborSet j).ncard := by
104-
simp only [SimpleGraph.neighborFinset]
103+
simp only [neighborFinset]
105104
intros
106105
rw [← Set.toFinset_inter, Set.ncard_eq_toFinset_card']
107106
simp only [← this]
108107
intro x y
109108
have ⟨x1, x2⟩ := x
110109
have ⟨y1, y2⟩ := y
111-
simp only [Conway9, SimpleGraph.completeGraph_eq_top,
112-
SimpleGraph.boxProd_adj, SimpleGraph.top_adj, SimpleGraph.neighborFinset_boxProd]
110+
simp only [Conway9, completeGraph_eq_top, boxProd_adj, top_adj, neighborFinset_boxProd]
113111
fin_cases x1 <;> fin_cases x2 <;> fin_cases y1 <;> fin_cases y2 <;> decide
114112

115113
@[category API, AMS 5]
@@ -121,9 +119,9 @@ lemma completeGraph_boxProd_completeGraph_cliqueSet :
121119

122120
@[category test, AMS 5]
123121
theorem conway9_locallyLinear : Conway9.LocallyLinear := by
124-
dsimp [SimpleGraph.LocallyLinear]
122+
dsimp [LocallyLinear]
125123
constructor
126-
· simp only [SimpleGraph.EdgeDisjointTriangles, Set.Pairwise]
124+
· simp only [EdgeDisjointTriangles, Set.Pairwise]
127125
intro x hx y hy hxy
128126
simp only [Conway9, completeGraph_boxProd_completeGraph_cliqueSet] at hx hy
129127
rcases hx with hx | hx <;>
@@ -142,15 +140,15 @@ theorem conway9_locallyLinear : Conway9.LocallyLinear := by
142140
intro h
143141
use {(x1, x2), (y1, y2), (x1 + x1 + y1 + y1, x2 + x2 + y2 + y2)}
144142
simp only [Finset.mem_insert, Prod.mk.injEq, true_or, or_true, and_true]
145-
simp only [Conway9, SimpleGraph.completeGraph_eq_top, SimpleGraph.boxProd_adj,
146-
SimpleGraph.top_adj, ne_eq] at h ⊢
143+
simp only [Conway9, completeGraph_eq_top, boxProd_adj, top_adj, ne_eq] at h ⊢
147144
constructor
148-
· dsimp [SimpleGraph.IsClique, ]
145+
· dsimp [IsClique]
149146
fin_cases x1 <;> fin_cases x2 <;> fin_cases y1 <;> fin_cases y2 <;>
150147
simp only [Fin.reduceFinMk, not_true_eq_false, Fin.reduceEq, or_true, Fin.reduceAdd,
151-
Finset.coe_insert, Finset.coe_singleton, SimpleGraph.isClique_insert,
152-
Set.pairwise_singleton, Set.mem_singleton_iff, ne_eq, SimpleGraph.boxProd_adj,
153-
SimpleGraph.top_adj, forall_eq, Prod.mk.injEq, and_false, imp_self, Set.mem_insert_iff,forall_eq_or_imp, or_false, and_true, not_false_eq_true] at h ⊢
148+
Finset.coe_insert, Finset.coe_singleton, isClique_insert,
149+
Set.pairwise_singleton, Set.mem_singleton_iff, ne_eq, boxProd_adj,
150+
top_adj, forall_eq, Prod.mk.injEq, and_false, imp_self, Set.mem_insert_iff,
151+
forall_eq_or_imp, or_false, and_true, not_false_eq_true] at h ⊢
154152
· fin_cases x1 <;> fin_cases x2 <;> fin_cases y1 <;> fin_cases y2 <;>
155153
simp only [not_true_eq_false, or_self, and_true] at h <;>
156154
decide

0 commit comments

Comments
 (0)