Skip to content

Commit b5b6ff3

Browse files
committed
examples
1 parent 55eedb0 commit b5b6ff3

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Minimathlib/Set.lean

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,38 @@ def subset (s t : Set X) : Prop := ∀ x, x ∈ s → x ∈ t
7171

7272
infixl: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+
74106
macro "ode_to_grind" : tactic =>
75107
`(tactic| (
76108
try unfold Set.compl

0 commit comments

Comments
 (0)