Skip to content

Commit 34daaaa

Browse files
committed
Lint to mathlib standards
1 parent 5f64737 commit 34daaaa

File tree

9 files changed

+28
-92
lines changed

9 files changed

+28
-92
lines changed

LeanCamCombi.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import LeanCamCombi.Mathlib.Combinatorics.SimpleGraph.Density
1313
import LeanCamCombi.Mathlib.Probability.Combinatorics.BinomialRandomGraph.Defs
1414
import LeanCamCombi.Mathlib.Probability.Distributions.Bernoulli
1515
import LeanCamCombi.Mathlib.Probability.HasLaw
16-
import LeanCamCombi.Mathlib.Probability.ProbabilityMassFunction.Constructions
1716
import LeanCamCombi.PlainCombi.LittlewoodOfford
1817
import LeanCamCombi.PlainCombi.OrderShatter
1918
import LeanCamCombi.PlainCombi.ProbLYM

LeanCamCombi/ExtrProbCombi/BollobasContainment.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ open scoped MeasureTheory ENNReal NNReal SimpleGraph Topology unitInterval
2020

2121
namespace SimpleGraph
2222
variable {V W Ω : Type*} [Fintype W] {G : ℕ → Ω → SimpleGraph V} (H : SimpleGraph W)
23-
[Fintype H.edgeSet] [∀ n ω, DecidableRel (G n ω).Adj] [MeasurableSpace Ω] (μ : Measure Ω)
24-
[IsProbabilityMeasure μ] {p : ℕ → I} (hG : ∀ n, IsBinomialRandom (G n) (p n) μ)
23+
[Fintype H.edgeSet] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {p : ℕ → I}
24+
(hG : ∀ n, IsBinomialRandom (G n) (p n) μ)
2525

2626
/-- **Bollobás' Graph Containment Lemma**, zero statement -/
2727
lemma zero_statement

LeanCamCombi/GraphTheory/ExampleSheet1.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Show that if $$G$$ is acyclic and $$|G| ≥ 1$$, then $$e(G) ≤ n − 1$$.
7676
-/
7777

7878
-- Note: The statement is true without `nonempty α` due to nat subtraction.
79-
lemma q5 [Fintype α] [DecidableEq α] (G : SimpleGraph α) [DecidableRel G.Adj] (hG : G.IsAcyclic) :
79+
lemma q5 [Fintype α] (G : SimpleGraph α) [DecidableRel G.Adj] (hG : G.IsAcyclic) :
8080
G.edgeFinset.card ≤ card α - 1 := by
8181
cases isEmpty_or_nonempty α
8282
· simp
@@ -153,7 +153,7 @@ Show that the possible clique numbers for a regular graph on $$n$$ vertices are
153153
$$1, 2, \dots, n/2$$ and $$n$$.
154154
-/
155155

156-
lemma q10 [Fintype α] [DecidableEq α] (n : ℕ) :
156+
lemma q10 [Fintype α] (n : ℕ) :
157157
(∃ (G : SimpleGraph α) (_ : DecidableRel G.Adj) (k : _),
158158
G.IsRegularOfDegree k ∧ cliqueNum G = n) ↔
159159
n ≤ card α / 2 ∨ n = card α :=

LeanCamCombi/Mathlib/Combinatorics/Additive/ApproximateSubgroup.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ lemma pi {ι : Type*} {G : ι → Type*} [Fintype ι] [∀ i, Group (G i)] {A :
2525

2626
end IsApproximateSubgroup
2727

28+
set_option linter.flexible false in
2829
open Finset in
2930
open scoped RightActions in
3031
@[to_additive]

LeanCamCombi/Mathlib/Combinatorics/SimpleGraph/Density.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Rename `edgeDensity` to `edgeDensityBtw`
88
-/
99

1010
open Finset
11-
open scoped Classical
1211

1312
namespace SimpleGraph
1413
variable {α : Type*} [Fintype α] (G : SimpleGraph α) [Fintype G.edgeSet]
@@ -18,8 +17,9 @@ variable {α : Type*} [Fintype α] (G : SimpleGraph α) [Fintype G.edgeSet]
1817
In other words, it is half of its average degree. -/
1918
def edgeDensity' : ℚ≥0 := #G.edgeFinset / Fintype.card α
2019

20+
open scoped Classical in
2121
/-- The maximum edge density of a subgraph of a graph. -/
2222
noncomputable def maxEdgeSubdensity : ℚ≥0 :=
23-
Finset.univ.sup' Finset.univ_nonempty fun G' : G.Subgraph ↦ G'.coe.edgeDensity'
23+
univ.sup' univ_nonempty fun G' : G.Subgraph ↦ G'.coe.edgeDensity'
2424

2525
end SimpleGraph

LeanCamCombi/Mathlib/Probability/Combinatorics/BinomialRandomGraph/Defs.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ lemma measurable_adj : Measurable (Adj : SimpleGraph V → V → V → Prop) :=
5050
lemma measurable_edgeSet : Measurable (edgeSet : SimpleGraph V → Set (Sym2 V)) :=
5151
measurable_set_iff.2 <| by rintro ⟨u, v⟩; simp only [mem_edgeSet]; fun_prop
5252

53+
set_option linter.flexible false in
5354
@[simp, fun_prop]
5455
lemma measurable_fromEdgeSet : Measurable (fromEdgeSet : Set (Sym2 V) → SimpleGraph V) := by
5556
simp [measurable_iff_adj]; fun_prop

LeanCamCombi/Mathlib/Probability/ProbabilityMassFunction/Constructions.lean

Lines changed: 0 additions & 46 deletions
This file was deleted.

LeanCamCombi/PlainCombi/VanDenBergKesten.lean

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ as probabilistic events, the size of the certificator `𝒜 □ ℬ` corresponds
2525
* D. Reimer, *Proof of the Van den Berg–Kesten Conjecture*
2626
-/
2727

28-
open scoped Classical FinsetFamily
28+
open scoped FinsetFamily
2929

3030
variable {α : Type*}
3131

@@ -34,8 +34,8 @@ section BooleanAlgebra
3434
variable [BooleanAlgebra α] (s t u : Finset α) {a : α}
3535

3636
noncomputable def certificator : Finset α :=
37-
{a ∈ s ∩ t |
38-
∃ x y, IsCompl x y ∧ (∀ ⦃b⦄, a ⊓ x = b ⊓ x → b ∈ s) ∧ ∀ ⦃b⦄, a ⊓ y = b ⊓ y → b ∈ t}
37+
open scoped Classical in
38+
{a ∈ s ∩ t | ∃ x y, IsCompl x y ∧ (∀ ⦃b⦄, a ⊓ x = b ⊓ x → b ∈ s) ∧ ∀ ⦃b⦄, a ⊓ y = b ⊓ y → b ∈ t}
3939

4040
scoped[FinsetFamily] infixl:70 " □ " => Finset.certificator
4141

@@ -44,12 +44,15 @@ variable {s t u}
4444
@[simp] lemma mem_certificator :
4545
a ∈ s □ t ↔
4646
∃ x y, IsCompl x y ∧ (∀ ⦃b⦄, a ⊓ x = b ⊓ x → b ∈ s) ∧ ∀ ⦃b⦄, a ⊓ y = b ⊓ y → b ∈ t := by
47+
classical
4748
rw [certificator, mem_filter, and_iff_right_of_imp]
4849
rintro ⟨u, v, _, hu, hv⟩
4950
exact mem_inter.2 ⟨hu rfl, hv rfl⟩
5051

51-
lemma certificator_subset_inter : s □ t ⊆ s ∩ t := filter_subset _ _
52+
lemma certificator_subset_inter [DecidableEq α] : s □ t ⊆ s ∩ t := by
53+
unfold certificator; convert filter_subset ..
5254

55+
open scoped Classical in
5356
lemma certificator_subset_disjSups : s □ t ⊆ s ○ t := by
5457
simp_rw [subset_iff, mem_certificator, mem_disjSups]
5558
rintro x ⟨u, v, huv, hu, hv⟩
@@ -62,22 +65,23 @@ variable (s t u)
6265
lemma certificator_comm : s □ t = t □ s := by
6366
ext s; rw [mem_certificator, exists_comm]; simp [isCompl_comm, and_comm]
6467

65-
lemma IsUpperSet.certificator_eq_inter (hs : IsUpperSet (s : Set α)) (ht : IsLowerSet (t : Set α)) :
66-
s □ t = s ∩ t := by
68+
lemma IsUpperSet.certificator_eq_inter [DecidableEq α] (hs : IsUpperSet (s : Set α))
69+
(ht : IsLowerSet (t : Set α)) : s □ t = s ∩ t := by
6770
refine
6871
certificator_subset_inter.antisymm fun a ha ↦ mem_certificator.2 ⟨a, aᶜ, isCompl_compl, ?_⟩
6972
rw [mem_inter] at ha
7073
simp only [@eq_comm _ ⊥, ← sdiff_eq, inf_idem, right_eq_inf, _root_.sdiff_self, sdiff_eq_bot_iff]
7174
exact ⟨fun b hab ↦ hs hab ha.1, fun b hab ↦ ht hab ha.2
7275

73-
lemma IsLowerSet.certificator_eq_inter (hs : IsLowerSet (s : Set α)) (ht : IsUpperSet (t : Set α)) :
74-
s □ t = s ∩ t := by
76+
lemma IsLowerSet.certificator_eq_inter [DecidableEq α] (hs : IsLowerSet (s : Set α))
77+
(ht : IsUpperSet (t : Set α)) : s □ t = s ∩ t := by
7578
refine certificator_subset_inter.antisymm fun a ha ↦
7679
mem_certificator.2 ⟨aᶜ, a, isCompl_compl.symm, ?_⟩
7780
rw [mem_inter] at ha
7881
simp only [@eq_comm _ ⊥, ← sdiff_eq, inf_idem, right_eq_inf, _root_.sdiff_self, sdiff_eq_bot_iff]
7982
exact ⟨fun b hab ↦ hs hab ha.1, fun b hab ↦ ht hab ha.2
8083

84+
open scoped Classical in
8185
lemma IsUpperSet.certificator_eq_disjSups (hs : IsUpperSet (s : Set α))
8286
(ht : IsUpperSet (t : Set α)) : s □ t = s ○ t := by
8387
refine certificator_subset_disjSups.antisymm fun a ha ↦ mem_certificator.2 ?_

lakefile.toml

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,15 @@ keywords = ["math", "combinatorics", "additive-combinatorics", "probabilitistic-
33
defaultTargets = ["LeanCamCombi"]
44

55
[leanOptions]
6-
autoImplicit = false # Prevent typos to be interpreted as new free variables
6+
# Pretty-prints `fun a ↦ b`
7+
pp.unicode.fun = true
8+
# Don't assume a typo is a new variable
9+
autoImplicit = false
710
relaxedAutoImplicit = false
8-
pp.unicode.fun = true # Pretty-print lambdas as `fun a ↦ b`
9-
pp.proofs.withType = false # Elide the types of proofs in terms
10-
weak.linter.docPrime = false
11-
weak.linter.hashCommand = true
12-
weak.linter.oldObtain = true
13-
weak.linter.refine = true
14-
weak.linter.style.cdot = true
15-
weak.linter.style.dollarSyntax = true
16-
weak.linter.style.header = true
17-
weak.linter.style.lambdaSyntax = true
18-
weak.linter.style.longLine = true
19-
weak.linter.style.longFile = 1500
20-
weak.linter.style.missingEnd = true
21-
weak.linter.style.multiGoal = true
22-
weak.linter.style.setOption = true
23-
24-
[moreServerOptions]
25-
linter.docPrime = false
26-
linter.hashCommand = true
27-
linter.oldObtain = true
28-
weak.linter.refine = true
29-
linter.style.cdot = true
30-
linter.style.dollarSyntax = true
31-
linter.style.header = true
32-
linter.style.lambdaSyntax = true
33-
linter.style.longLine = true
34-
linter.style.longFile = 1500
35-
linter.style.missingEnd = true
36-
linter.style.multiGoal = true
37-
linter.style.setOption = true
11+
# Enable all mathlib linters: automatically matches what mathlib uses.
12+
weak.linter.mathlibStandardSet = true
13+
# Switch off warnings generated by `sorry`
14+
warn.sorry = false
3815

3916
[[require]]
4017
name = "mathlib"

0 commit comments

Comments
 (0)