Skip to content

Commit 679503c

Browse files
author
Will Bradley
committed
Complete 2.4 #5(c)
1 parent 6613452 commit 679503c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

LogicFormalization/Chapter2/Section4/Homework.lean

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ end a
108108

109109
section b
110110

111-
/-- Represents polynomials with coefficients from `ℕ`.-/
111+
/-- Represents polynomials with coefficients from `ℕ`. -/
112112
inductive Poly
113113
| const: ℕ → Poly
114114
| var
@@ -127,8 +127,7 @@ lemma eval_mono: ∀ {p: Poly}, Monotone p.eval
127127
| .const _ => fun _ _ _ => Nat.le_refl _
128128
| .var => fun _ _ => id
129129
| .add _ _ => Monotone.add eval_mono eval_mono
130-
| .mul _
131-
_ => Monotone.mul' eval_mono eval_mono
130+
| .mul _ _ => Monotone.mul' eval_mono eval_mono
132131

133132
/-- Degree of a polynomial -/
134133
def deg: Poly → ℕ
@@ -263,9 +262,17 @@ theorem not_exists_nat_rig_term₂ : ¬∃ (t: Term .Rig) (x: Var) (hx: AreVarsF
263262
end b
264263

265264
open Structure in
266-
/-- 2.4 #5 (c). The only substructure of `𝒩` is `𝒩` itself. -/
267-
theorem 𝒩.substructures: ∀ {M: Set ℕ} [Nonempty M] {ℳ: Structure .Rig M},
268-
ℳ ⊆ 𝒩 ↔ HEq ℳ 𝒩 :=
269-
sorry
270265

266+
/-- 2.4 #5 (c). The only substructure of `𝒩` is `𝒩` itself. -/
267+
theorem 𝒩.substructures {M: Set ℕ} [Nonempty M] {ℳ: Structure .Rig M}:
268+
(Structure.IsSubstructure ℳ 𝒩) → M = Set.univ
269+
| ⟨h₁, _⟩ => Set.eq_univ_of_forall (all_mem_M h₁)
270+
where all_mem_M
271+
(h: ∀ (F : Language.Rig.ϝ) (a : Fin (arity F) → ↑M), (𝒩.interpFun F fun x => ↑(a x)) ∈ M):
272+
(n: ℕ) → n ∈ M
273+
| 0 => h .zero ![]
274+
| k + 1 =>
275+
h .add ![⟨k, all_mem_M h k⟩, ⟨1, h .one ![]⟩]
276+
277+
-- TODO: maybe show other way too? Should be trivial though
271278
end Problem5

0 commit comments

Comments
 (0)