Skip to content

Commit 554ad49

Browse files
committed
fix
1 parent ad83ed5 commit 554ad49

37 files changed

Lines changed: 163 additions & 96 deletions

Foundation/FirstOrder/Arithmetic/Definability/Definable.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ lemma not (h : Γ.alt-[m].Definable P) :
403403
lemma impDelta (hp : 𝚫-[m].Definable P) (hq : 𝚫-[m].Definable Q) :
404404
𝚫-[m].Definable fun x ↦ P x → Q x := (hp.notDelta.or hq).of_iff (by intro x; simp [imp_iff_not_or])
405405

406+
set_option backward.isDefEq.respectTransparency false in
406407
lemma imp (h₁ : Γ.alt-[m].Definable P) (h₂ : Γ-[m].Definable Q) :
407408
Γ-[m].Definable (fun v ↦ P v → Q v) := by
408409
match Γ with

Foundation/FirstOrder/Arithmetic/Exponential/Exp.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ lemma exp_even (a : V) : Exp.exp (2 * a) = (Exp.exp a)^2 :=
775775
@[simp] lemma exp_monotone_le {a b : V} : Exp.exp a ≤ Exp.exp b ↔ a ≤ b :=
776776
Iff.symm <| Exponential.monotone_le_iff (exponential_exp a) (exponential_exp b)
777777

778+
set_option backward.isDefEq.respectTransparency false in
778779
lemma nat_cast_exp (n : ℕ) : (Exp.exp n : ℕ) = Exp.exp (n : V) := by
779780
induction' n with n ih
780781
· simp

Foundation/FirstOrder/Arithmetic/IOpen/Basic.lean

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ section IOpen
1616

1717
variable [V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻]
1818

19-
instance : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻)
19+
instance : V ⊧ₘ* 𝗣𝗔⁻ :=
20+
have : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 := inferInstance
21+
models_of_subtheory this
2022

21-
instance : V ⊧ₘ* InductionScheme ℒₒᵣ Semiformula.Open := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻)
23+
instance : V ⊧ₘ* InductionScheme ℒₒᵣ Semiformula.Open :=
24+
have : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 := inferInstance
25+
models_of_subtheory this
2226

2327
@[elab_as_elim]
2428
lemma succ_induction {P : V → Prop}
@@ -768,7 +772,8 @@ end IOpen
768772
lemma polynomial_induction [V ⊧ₘ* 𝗣𝗔⁻] (Γ m) [V ⊧ₘ* 𝗜𝗡𝗗 Γ m]
769773
{P : V → Prop} (hP : Γ-[m]-Predicate P)
770774
(zero : P 0) (even : ∀ x > 0, P x → P (2 * x)) (odd : ∀ x, P x → P (2 * x + 1)) : ∀ x, P x := by
771-
haveI : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
775+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
776+
have : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 := models_of_subtheory this
772777
intro x; induction x using InductionOnHierarchy.order_induction
773778
· exact Γ
774779
· exact m

Foundation/FirstOrder/Arithmetic/R0/Basic.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ lemma bold_sigma_one_completeness' {n} {σ : Semisentence ℒₒᵣ n} (hσ : Hi
136136
simpa [Empty.eq_elim] using bold_sigma_one_completeness (M := M) (φ := σ) hσ (f := Empty.elim) (e := e) h
137137

138138
instance consistent : Entailment.Consistent 𝗥₀ :=
139-
Sound.consistent_of_satisfiable ⟨_, inferInstanceAs (ℕ ⊧ₘ* 𝗥₀)⟩
139+
let : ℕ ⊧ₘ* 𝗥₀ := inferInstance
140+
Sound.consistent_of_satisfiable ⟨_, this⟩
140141

141142
end model
142143

Foundation/FirstOrder/Arithmetic/Schemata.lean

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ lemma ISigma_subset_mono {s₁ s₂} (h : s₁ ≤ s₂) : 𝗜𝚺 s₁ ⊆
6666
lemma ISigma_weakerThan_of_le {s₁ s₂} (h : s₁ ≤ s₂) : 𝗜𝚺 s₁ ⪯ 𝗜𝚺 s₂ :=
6767
Entailment.WeakerThan.ofSubset (ISigma_subset_mono h)
6868

69-
instance : 𝗘𝗤 ⪯ 𝗜𝗡𝗗 Γ n := Entailment.WeakerThan.trans (inferInstanceAs (𝗘𝗤 ⪯ 𝗣𝗔⁻)) inferInstance
69+
instance : 𝗘𝗤 ⪯ 𝗜𝗡𝗗 Γ n :=
70+
have : 𝗘𝗤 ⪯ 𝗣𝗔⁻ := inferInstance
71+
Entailment.WeakerThan.trans this inferInstance
7072

71-
instance : 𝗘𝗤 ⪯ 𝗜𝗢𝗽𝗲𝗻 := Entailment.WeakerThan.trans (inferInstanceAs (𝗘𝗤 ⪯ 𝗣𝗔⁻)) inferInstance
73+
instance : 𝗘𝗤 ⪯ 𝗜𝗢𝗽𝗲𝗻 :=
74+
have : 𝗘𝗤 ⪯ 𝗣𝗔⁻ := inferInstance
75+
Entailment.WeakerThan.trans this inferInstance
7276

7377
instance : 𝗜𝗢𝗽𝗲𝗻 ⪯ 𝗜𝗡𝗗 Γ n :=
7478
Entailment.WeakerThan.ofSubset <| Set.union_subset_union_right _ <| InductionScheme_subset Arithmetic.Hierarchy.of_open
@@ -126,11 +130,14 @@ section
126130

127131
variable (Γ : Polarity) (m : ℕ) [V ⊧ₘ* 𝗜𝗡𝗗 Γ m]
128132

129-
instance : V ⊧ₘ* InductionScheme ℒₒᵣ (Hierarchy Γ m) := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
133+
instance : V ⊧ₘ* InductionScheme ℒₒᵣ (Hierarchy Γ m) :=
134+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
135+
models_of_subtheory this
130136

131137
lemma succ_induction {P : V → Prop} (hP : Γ-[m].DefinablePred P)
132138
(zero : P 0) (succ : ∀ x, P x → P (x + 1)) : ∀ x, P x :=
133-
haveI : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
139+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
140+
have : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory this
134141
InductionScheme.succ_induction (P := P) (C := Hierarchy Γ m) (by
135142
rcases hP with ⟨φ, hp⟩
136143
haveI : Inhabited V := Classical.inhabited_of_nonempty'
@@ -140,7 +147,8 @@ lemma succ_induction {P : V → Prop} (hP : Γ-[m].DefinablePred P)
140147

141148
lemma order_induction {P : V → Prop} (hP : Γ-[m].DefinablePred P)
142149
(ind : ∀ x, (∀ y < x, P y) → P x) : ∀ x, P x := by
143-
haveI : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
150+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
151+
have : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory this
144152
suffices ∀ x, ∀ y < x, P y by
145153
intro x; exact this (x + 1) x (by simp only [lt_add_iff_pos_right, lt_one_iff_eq_zero])
146154
intro x; induction x using succ_induction
@@ -158,7 +166,8 @@ lemma order_induction {P : V → Prop} (hP : Γ-[m].DefinablePred P)
158166

159167
private lemma neg_succ_induction {P : V → Prop} (hP : Γ-[m].DefinablePred P)
160168
(nzero : ¬P 0) (nsucc : ∀ x, ¬P x → ¬P (x + 1)) : ∀ x, ¬P x := by
161-
haveI : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
169+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
170+
have : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory this
162171
by_contra A
163172
have : ∃ x, P x := by simpa using A
164173
rcases this with ⟨a, ha⟩
@@ -202,12 +211,14 @@ instance models_InductionScheme_alt : V ⊧ₘ* InductionScheme ℒₒᵣ (Arith
202211
(by intro x; simp [←Matrix.fun_eq_vec_one, Semiformula.eval_rewriteMap]))
203212

204213
instance models_alt : V ⊧ₘ* 𝗜𝗡𝗗 Γ.alt m := by
205-
haveI : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
214+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
215+
have : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory this
206216
simp only [InductionOnHierarchy, ModelsTheory.add_iff]; constructor <;> infer_instance
207217

208218
lemma least_number {P : V → Prop} (hP : Γ-[m].DefinablePred P)
209219
{x} (h : P x) : ∃ y, P y ∧ ∀ z < y, ¬P z := by
210-
haveI : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗡𝗗 Γ m)
220+
have : V ⊧ₘ* 𝗜𝗡𝗗 Γ m := inferInstance
221+
have : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory this
211222
by_contra A
212223
have A : ∀ z, P z → ∃ w < z, P w := by simpa using A
213224
have : ∀ z, ∀ w < z, ¬P w := by
@@ -338,13 +349,17 @@ lemma ISigma0.least_number [V ⊧ₘ* 𝗜𝚺₀] {P : V → Prop} (hP : 𝚺
338349
(ind : ∀ x, (∀ y < x, P y) → P x) : ∀ x, P x :=
339350
InductionOnHierarchy.order_induction_sigma Γ 1 hP ind
340351

341-
instance [V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻] : V ⊧ₘ* 𝗣𝗔⁻ := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻)
352+
instance [V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻] : V ⊧ₘ* 𝗣𝗔⁻ :=
353+
have : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 := inferInstance
354+
models_of_subtheory this
342355

343-
instance [V ⊧ₘ* 𝗜𝚺₀] : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 := models_of_subtheory <| inferInstanceAs (V ⊧ₘ* 𝗜𝚺₀)
356+
instance [V ⊧ₘ* 𝗜𝚺₀] : V ⊧ₘ* 𝗜𝗢𝗽𝗲𝗻 :=
357+
have : V ⊧ₘ* 𝗜𝚺₀ := inferInstance
358+
models_of_subtheory this
344359

345360
instance [V ⊧ₘ* 𝗜𝚺₁] : V ⊧ₘ* 𝗜𝚺₀ := inferInstance
346361

347-
def mod_ISigma_of_le {n₁ n₂} (h : n₁ ≤ n₂) [V ⊧ₘ* 𝗜𝚺 n₂] : V ⊧ₘ* 𝗜𝚺 n₁ :=
362+
abbrev mod_ISigma_of_le {n₁ n₂} (h : n₁ ≤ n₂) [V ⊧ₘ* 𝗜𝚺 n₂] : V ⊧ₘ* 𝗜𝚺 n₁ :=
348363
ModelsTheory.of_ss inferInstance (ISigma_subset_mono h)
349364

350365
end models
@@ -381,15 +396,19 @@ instance : Entailment.Consistent 𝗣𝗔 := 𝗣𝗔.consistent_of_sound (Eq
381396
instance : 𝗣𝗔 ⪯ 𝗧𝗔 := inferInstance
382397

383398
instance (T : ArithmeticTheory) [𝗣𝗔⁻ ⪯ T] : 𝗥₀ ⪯ T :=
384-
Entailment.WeakerThan.trans (inferInstanceAs (𝗥₀ ⪯ 𝗣𝗔⁻)) inferInstance
399+
have : 𝗥₀ ⪯ 𝗣𝗔⁻ := inferInstance
400+
Entailment.WeakerThan.trans this inferInstance
385401

386402
instance (T : ArithmeticTheory) [𝗜𝚺₀ ⪯ T] : 𝗣𝗔⁻ ⪯ T :=
387-
Entailment.WeakerThan.trans (inferInstanceAs (𝗣𝗔⁻ ⪯ 𝗜𝚺₀)) inferInstance
403+
have : 𝗣𝗔⁻ ⪯ 𝗜𝚺₀ := inferInstance
404+
Entailment.WeakerThan.trans this inferInstance
388405

389406
instance (T : ArithmeticTheory) [𝗜𝚺₁ ⪯ T] : 𝗣𝗔⁻ ⪯ T :=
390-
Entailment.WeakerThan.trans (inferInstanceAs (𝗣𝗔⁻ ⪯ 𝗜𝚺₁)) inferInstance
407+
have : 𝗣𝗔⁻ ⪯ 𝗜𝚺₁ := inferInstance
408+
Entailment.WeakerThan.trans this inferInstance
391409

392410
instance (T : ArithmeticTheory) [𝗣𝗔 ⪯ T] : 𝗣𝗔⁻ ⪯ T :=
393-
Entailment.WeakerThan.trans (inferInstanceAs (𝗣𝗔⁻ ⪯ 𝗣𝗔)) inferInstance
411+
have : 𝗣𝗔⁻ ⪯ 𝗣𝗔 := inferInstance
412+
Entailment.WeakerThan.trans this inferInstance
394413

395414
end LO.FirstOrder.Arithmetic

Foundation/FirstOrder/Basic/Calculus.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ def unprovable_univCl_iff {φ : SyntacticFormula L} :
640640
(𝓢 : Theory L) ⊬ φ.univCl ↔ 𝓢 ⊬ φ := provable_univCl_iff.not
641641

642642
instance (𝓢 𝓣 : Schema L) [𝓢 ⪯ 𝓣] : 𝓢.toTheory ⪯ 𝓣.toTheory :=
643-
fun _ b ↦ coe_provable_iff_provable_coe.mpr <| (inferInstanceAs (𝓢 ⪯ 𝓣)).pbl (coe_provable_iff_provable_coe.mp b)⟩
643+
let le : 𝓢 ⪯ 𝓣 := inferInstance
644+
fun _ b ↦ coe_provable_iff_provable_coe.mpr <| le.pbl (coe_provable_iff_provable_coe.mp b)⟩
644645

645646
@[simp] lemma coe_consistent_iff :
646647
Consistent (𝓢 : Theory L) ↔ Consistent 𝓢 := calc

Foundation/FirstOrder/Basic/Eq.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ lemma elementaryEquiv : QuotEq L M ≡ₑ[L] M := ⟨models_iff⟩
225225

226226
variable {L M}
227227

228+
set_option backward.isDefEq.respectTransparency false in
228229
lemma rel_eq (a b : QuotEq L M) : (@Semiformula.Operator.Eq.eq L _).val (M := QuotEq L M) ![a, b] ↔ a = b := by
229230
induction' a using Quotient.ind with a
230231
induction' b using Quotient.ind with b

Foundation/FirstOrder/Basic/Semantics/Elementary.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ lemma modelsTheory [h : M₁ ≡ₑ[L] M₂] {T : Theory L} :
220220

221221
variable (M₁ M₂)
222222

223-
lemma modelsTheory' [M₁ ≡ₑ[L] M₂] (T : Theory L) [M₂ ⊧ₘ* T] :
224-
M₁ ⊧ₘ* T := modelsTheory.mpr (inferInstanceAs (M₂ ⊧ₘ* T))
223+
lemma modelsTheory' [M₁ ≡ₑ[L] M₂] (T : Theory L) [h : M₂ ⊧ₘ* T] :
224+
M₁ ⊧ₘ* T := modelsTheory.mpr h
225225

226226
variable {M₁ M₂}
227227

Foundation/FirstOrder/Basic/Soundness.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ theorem smallSound! : T ⊢ σ → T ⊨ σ := sound!
8282

8383
instance (T : Theory L) : Sound T (Semantics.models (Struc.{v, u} L) T) := ⟨sound!⟩
8484

85-
lemma models_of_subtheory {T U : Theory L} [U ⪯ T] {M : Type*} [Structure L M] [Nonempty M] (hM : M ⊧ₘ* T) : M ⊧ₘ* U :=
85+
lemma models_of_subtheory {T U : Theory L} [le : U ⪯ T] {M : Type*} [Structure L M] [Nonempty M] (hM : M ⊧ₘ* T) : M ⊧ₘ* U :=
8686
fun {φ} hp ↦ by
87-
have : T ⊢ φ := (inferInstanceAs (U ⪯ T)).pbl (Entailment.by_axm _ hp)
87+
have : T ⊢ φ := le.pbl (Entailment.by_axm _ hp)
8888
exact sound! this hM ⟩
8989

9090
lemma consistent_of_satisfiable (h : Semantics.Satisfiable (Struc.{v, u} L) T) : Entailment.Consistent T :=

Foundation/FirstOrder/Bootstrapping/DerivabilityCondition/PeanoMinus.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ variable (T : ArithmeticTheory) [Theory.Δ₁ T] [𝗣𝗔⁻ ⪯ T]
3636

3737
open Entailment Entailment.FiniteContext Semiformula
3838

39-
instance : 𝗘𝗤 ⪯ T := WeakerThan.trans inferInstance (inferInstanceAs (𝗣𝗔⁻ ⪯ T))
39+
instance : 𝗘𝗤 ⪯ T :=
40+
have : 𝗣𝗔⁻ ⪯ T := inferInstance
41+
WeakerThan.trans inferInstance this
4042

4143
lemma term_add_assoc (t₁ t₂ t₃ : Term V ℒₒᵣ) :
4244
T.internalize V ⊢ t₁ + (t₂ + t₃) ≐ (t₁ + t₂) + t₃ := by

0 commit comments

Comments
 (0)