File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,6 +71,38 @@ def subset (s t : Set X) : Prop := ∀ x, x ∈ s → x ∈ t
7171
7272infixl :50 " ⊆ " => subset
7373
74+ namespace Examples
75+
76+ private def evens : Set Nat := λ n => n % 2 == 0
77+
78+ example : 2 ∈ evens := by rfl
79+ example : 42 ∈ evens := by rfl
80+
81+ private def div_by_fours : Set Nat := fun n => n % 4 == 0
82+
83+ private theorem all_numbers_div_by_four_div_by_two : div_by_fours ⊆ evens := by
84+ unfold div_by_fours evens
85+ have h3: 4 = 2 * 2 := by trivial
86+ rw [h3]
87+ unfold subset
88+ intro m nd4
89+ simp
90+ sorry
91+
92+ end Examples
93+
94+ -- -- Examples using subset and membership notation
95+ -- example : (fun n => n % 2 = 0) ⊆ (fun n => n < 100 ∨ n % 2 = 0) := by
96+ -- intro x hx; right; exact hx
97+
98+ -- example : 42 ∈ (fun n : Nat => n % 2 = 0) := by norm_num
99+
100+ -- example : ∅ ⊆ (fun n : Nat => n > 0) := by
101+ -- intro x hx; exact False.elim hx
102+
103+ -- example : (fun n : Nat => n < 5) ⊆ (fun n => n < 10) := by
104+ -- intro x hx; omega
105+
74106macro "ode_to_grind" : tactic =>
75107 `(tactic| (
76108 try unfold Set.compl
You can’t perform that action at this time.
0 commit comments