statement
stringlengths
1
2.88k
proof
stringlengths
0
13.9k
type
stringclasses
10 values
symbolic_name
stringlengths
1
131
library
stringclasses
417 values
filename
stringlengths
17
80
imports
listlengths
0
16
deps
listlengths
0
64
docstring
stringlengths
0
10.2k
source_url
stringclasses
1 value
commit
stringclasses
1 value
combine {p q : Prop} : psum unit (p → q) → psum unit p → psum unit q
| (psum.inr f) (psum.inr x) := psum.inr (f x) | _ _ := psum.inl ()
def
slim_check.combine
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
applicative combinator proof carrying test results
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
and_counter_example {p q : Prop} : test_result p → test_result q → test_result (p ∧ q)
| (failure Hce xs n) _ := failure (λ h, Hce h.1) xs n | _ (failure Hce xs n) := failure (λ h, Hce h.2) xs n | (success xs) (success ys) := success $ combine (combine (psum.inr and.intro) xs) ys | (gave_up n) (gave_up m) := gave_up $ n + m | (gave_up n) _ := gave_up n | _ (gave_up n) := gave_up n
def
slim_check.and_counter_example
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Combine the test result for properties `p` and `q` to create a test for their conjunction.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
or_counter_example {p q : Prop} : test_result p → test_result q → test_result (p ∨ q)
| (failure Hce xs n) (failure Hce' ys n') := failure (λ h, or_iff_not_and_not.1 h ⟨Hce, Hce'⟩) (xs ++ ys) (n + n') | (success xs) _ := success $ combine (psum.inr or.inl) xs | _ (success ys) := success $ combine (psum.inr or.inr) ys | (gave_up n) (gave_up m) := gave_up $ n + m | (gave_up n) _ := gave_up n | _ (gave_u...
def
slim_check.or_counter_example
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Combine the test result for properties `p` and `q` to create a test for their disjunction
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
convert_counter_example {p q : Prop} (h : q → p) : test_result p → opt_param (psum unit (p → q)) (psum.inl ()) → test_result q
| (failure Hce xs n) _ := failure (mt h Hce) xs n | (success Hp) Hpq := success (combine Hpq Hp) | (gave_up n) _ := gave_up n
def
slim_check.convert_counter_example
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
If `q → p`, then `¬ p → ¬ q` which means that testing `p` can allow us to find counter-examples to `q`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
convert_counter_example' {p q : Prop} (h : p ↔ q) (r : test_result p) : test_result q
convert_counter_example h.2 r (psum.inr h.1)
def
slim_check.convert_counter_example'
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Test `q` by testing `p` and proving the equivalence between the two.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_to_counter_example (x : string) {p q : Prop} (h : q → p) : test_result p → opt_param (psum unit (p → q)) (psum.inl ()) → test_result q
| (failure Hce xs n) _ := failure (mt h Hce) (x :: xs) n | r hpq := convert_counter_example h r hpq
def
slim_check.add_to_counter_example
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
When we assign a value to a universally quantified variable, we record that value using this function so that our counter-examples can be informative.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_var_to_counter_example {γ : Type v} [has_repr γ] (var : string) (x : γ) {p q : Prop} (h : q → p) : test_result p → opt_param (psum unit (p → q)) (psum.inl ()) → test_result q
@add_to_counter_example (var ++ " := " ++ repr x) _ _ h
def
slim_check.add_var_to_counter_example
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Add some formatting to the information recorded by `add_to_counter_example`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
named_binder (n : string) (p : Prop) : Prop
p
def
slim_check.named_binder
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Gadget used to introspect the name of bound variables. It is used with the `testable` typeclass so that `testable (named_binder "x" (∀ x, p x))` can use the variable name of `x` in error messages displayed to the user. If we find that instantiating the above quantifier with 3 falsifies it, we can print: ``` =========...
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_failure {p} : test_result p → bool
| (test_result.failure _ _ _) := tt | _ := ff
def
slim_check.is_failure
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Is the given test result a failure?
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
and_testable (p q : Prop) [testable p] [testable q] : testable (p ∧ q)
⟨ λ cfg min, do xp ← testable.run p cfg min, xq ← testable.run q cfg min, pure $ and_counter_example xp xq ⟩
instance
slim_check.and_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
or_testable (p q : Prop) [testable p] [testable q] : testable (p ∨ q)
⟨ λ cfg min, do xp ← testable.run p cfg min, match xp with | success (psum.inl h) := pure $ success (psum.inl h) | success (psum.inr h) := pure $ success (psum.inr $ or.inl h) | _ := do xq ← testable.run q cfg min, pure $ or_counter_example xp xq end ⟩
instance
slim_check.or_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
iff_testable (p q : Prop) [testable ((p ∧ q) ∨ (¬ p ∧ ¬ q))] : testable (p ↔ q)
⟨ λ cfg min, do xp ← testable.run ((p ∧ q) ∨ (¬ p ∧ ¬ q)) cfg min, return $ convert_counter_example' (by tauto!) xp ⟩
instance
slim_check.iff_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
dec_guard_testable (p : Prop) [printable_prop p] [decidable p] (β : p → Prop) [∀ h, testable (β h)] : testable (named_binder var $ Π h, β h)
⟨ λ cfg min, do if h : p then match print_prop p with | none := (λ r, convert_counter_example ($ h) r (psum.inr $ λ q _, q)) <$> testable.run (β h) cfg min | some str := (λ r, add_to_counter_example (sformat!"guard: {str}") ($ h) r (psum.inr $ λ q _, q)) <$> testable.run (β h) ...
instance
slim_check.dec_guard_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
use_has_to_string (α : Type*)
α
def
slim_check.use_has_to_string
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Type tag that replaces a type's `has_repr` instance with its `has_to_string` instance.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
use_has_to_string.inhabited [I : inhabited α] : inhabited (use_has_to_string α)
I
instance
slim_check.use_has_to_string.inhabited
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
use_has_to_string.mk {α} (x : α) : use_has_to_string α
x
def
slim_check.use_has_to_string.mk
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Add the type tag `use_has_to_string` to an expression's type.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
all_types_testable [testable (f ℤ)] : testable (named_binder var $ Π x, f x)
⟨ λ cfg min, do r ← testable.run (f ℤ) cfg min, return $ add_var_to_counter_example var (use_has_to_string.mk "ℤ") ($ ℤ) r ⟩
instance
slim_check.all_types_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
trace_if_giveup {p α β} [has_repr α] (tracing_enabled : bool) (var : string) (val : α) : test_result p → thunk β → β
| (test_result.gave_up _) := if tracing_enabled then trace (sformat!" {var} := {repr val}") else ($ ()) | _ := ($ ())
def
slim_check.trace_if_giveup
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Trace the value of sampled variables if the sample is discarded.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
test_forall_in_list [∀ x, testable (β x)] [has_repr α] : Π xs : list α, testable (named_binder var $ ∀ x, named_binder var' $ x ∈ xs → β x)
| [] := ⟨ λ tracing min, return $ success $ psum.inr (by { introv x h, cases h} ) ⟩ | (x :: xs) := ⟨ λ cfg min, do r ← testable.run (β x) cfg min, trace_if_giveup cfg.trace_discarded var x r $ match r with | failure _ _ _ := return $ add_var_to_counter_example var x ...
instance
slim_check.test_forall_in_list
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "not_and_of_not_right" ]
testable instance for a property iterating over the element of a list
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
combine_testable (p : Prop) (t : list $ testable p) (h : 0 < t.length) : testable p
⟨ λ cfg min, have 0 < length (map (λ t, @testable.run _ t cfg min) t), by { rw [length_map], apply h }, gen.one_of (list.map (λ t, @testable.run _ t cfg min) t) this ⟩
def
slim_check.combine_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Test proposition `p` by randomly selecting one of the provided testable instances.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
format_failure (s : string) (xs : list string) (n : ℕ) : string
let counter_ex := string.intercalate "\n" xs in sformat!" =================== {s} {counter_ex} ({n} shrinks) ------------------- "
def
slim_check.format_failure
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Format the counter-examples found in a test failure.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
format_failure' (s : string) {p} : test_result p → string
| (success a) := "" | (gave_up a) := "" | (test_result.failure _ xs n) := format_failure s xs n
def
slim_check.format_failure'
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Format the counter-examples found in a test failure.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_shrinks {p} (n : ℕ) : test_result p → test_result p
| r@(success a) := r | r@(gave_up a) := r | (test_result.failure h vs n') := test_result.failure h vs $ n + n'
def
slim_check.add_shrinks
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Increase the number of shrinking steps in a test result.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
minimize_aux [sampleable_ext α] [∀ x, testable (β x)] (cfg : slim_check_cfg) (var : string) : proxy_repr α → ℕ → option_t gen (Σ x, test_result (β (interp α x)))
well_founded.fix has_well_founded.wf $ λ x f_rec n, do if cfg.trace_shrink_candidates then return $ trace sformat! "candidates for {var} :=\n{repr (sampleable_ext.shrink x).to_list}\n" () else pure (), ⟨y,r,⟨h₁⟩⟩ ← (sampleable_ext.shrink x).mfirst (λ ⟨a,h⟩, do ⟨r⟩ ← monad_lift (uliftable.up $ test...
def
slim_check.minimize_aux
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "uliftable.up" ]
Shrink a counter-example `x` by using `shrink x`, picking the first candidate that falsifies a property and recursively shrinking that one. The process is guaranteed to terminate because `shrink x` produces a proof that all the values it produces are smaller (according to `sizeof`) than `x`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
minimize [sampleable_ext α] [∀ x, testable (β x)] (cfg : slim_check_cfg) (var : string) (x : proxy_repr α) (r : test_result (β (interp α x))) : gen (Σ x, test_result (β (interp α x)))
do if cfg.trace_shrink then return $ trace (sformat!"{var} := {repr x}" ++ format_failure' "Shrink counter-example:" r) () else pure (), x' ← option_t.run $ minimize_aux α _ cfg var x 0, pure $ x'.get_or_else ⟨x, r⟩
def
slim_check.minimize
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Once a property fails to hold on an example, look for smaller counter-examples to show the user.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
exists_testable (p : Prop) [testable (named_binder var (∀ x, named_binder var' $ β x → p))] : testable (named_binder var' (named_binder var (∃ x, β x) → p))
⟨ λ cfg min, do x ← testable.run (named_binder var (∀ x, named_binder var' $ β x → p)) cfg min, pure $ convert_counter_example' exists_imp_distrib.symm x ⟩
instance
slim_check.exists_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
var_testable [sampleable_ext α] [∀ x, testable (β x)] : testable (named_binder var $ Π x : α, β x)
⟨ λ cfg min, do uliftable.adapt_down (sampleable_ext.sample α) $ λ x, do r ← testable.run (β (sampleable_ext.interp α x)) cfg ff, uliftable.adapt_down (if is_failure r ∧ min then minimize _ _ cfg var x r else if cfg.trace_success ...
instance
slim_check.var_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "uliftable.adapt_down" ]
Test a universal property by creating a sample of the right type and instantiating the bound variable with it
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prop_var_testable (β : Prop → Prop) [I : ∀ b : bool, testable (β b)] : testable (named_binder var $ Π p : Prop, β p)
⟨λ cfg min, do convert_counter_example (λ h (b : bool), h b) <$> @testable.run (named_binder var $ Π b : bool, β b) _ cfg min⟩
instance
slim_check.prop_var_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Test a universal property about propositions
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
unused_var_testable (β) [inhabited α] [testable β] : testable (named_binder var $ Π x : α, β)
⟨ λ cfg min, do r ← testable.run β cfg min, pure $ convert_counter_example ($ default) r (psum.inr $ λ x _, x) ⟩
instance
slim_check.unused_var_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
subtype_var_testable {p : α → Prop} [∀ x, printable_prop (p x)] [∀ x, testable (β x)] [I : sampleable_ext (subtype p)] : testable (named_binder var $ Π x : α, named_binder var' $ p x → β x)
⟨ λ cfg min, do let test (x : subtype p) : testable (β x) := ⟨ λ cfg min, do r ← testable.run (β x.val) cfg min, match print_prop (p x) with | none := pure r | some str := pure $ add_to_counter_example sformat!"guard: {str} (by construction)" ...
instance
slim_check.subtype_var_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "slim_check.var_testable" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
decidable_testable (p : Prop) [printable_prop p] [decidable p] : testable p
⟨ λ cfg min, return $ if h : p then success (psum.inr h) else match print_prop p with | none := failure h [] 0 | some str := failure h [sformat!"issue: {str} does not hold"] 0 end ⟩
instance
slim_check.decidable_testable
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eq.printable_prop {α} [has_repr α] (x y : α) : printable_prop (x = y)
⟨ some sformat!"{repr x} = {repr y}" ⟩
instance
slim_check.eq.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ne.printable_prop {α} [has_repr α] (x y : α) : printable_prop (x ≠ y)
⟨ some sformat!"{repr x} ≠ {repr y}" ⟩
instance
slim_check.ne.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le.printable_prop {α} [has_le α] [has_repr α] (x y : α) : printable_prop (x ≤ y)
⟨ some sformat!"{repr x} ≤ {repr y}" ⟩
instance
slim_check.le.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt.printable_prop {α} [has_lt α] [has_repr α] (x y : α) : printable_prop (x < y)
⟨ some sformat!"{repr x} < {repr y}" ⟩
instance
slim_check.lt.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
perm.printable_prop {α} [has_repr α] (xs ys : list α) : printable_prop (xs ~ ys)
⟨ some sformat!"{repr xs} ~ {repr ys}" ⟩
instance
slim_check.perm.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
and.printable_prop (x y : Prop) [printable_prop x] [printable_prop y] : printable_prop (x ∧ y)
⟨ do x' ← print_prop x, y' ← print_prop y, some sformat!"({x'} ∧ {y'})" ⟩
instance
slim_check.and.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
or.printable_prop (x y : Prop) [printable_prop x] [printable_prop y] : printable_prop (x ∨ y)
⟨ do x' ← print_prop x, y' ← print_prop y, some sformat!"({x'} ∨ {y'})" ⟩
instance
slim_check.or.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
iff.printable_prop (x y : Prop) [printable_prop x] [printable_prop y] : printable_prop (x ↔ y)
⟨ do x' ← print_prop x, y' ← print_prop y, some sformat!"({x'} ↔ {y'})" ⟩
instance
slim_check.iff.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
imp.printable_prop (x y : Prop) [printable_prop x] [printable_prop y] : printable_prop (x → y)
⟨ do x' ← print_prop x, y' ← print_prop y, some sformat!"({x'} → {y'})" ⟩
instance
slim_check.imp.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
not.printable_prop (x : Prop) [printable_prop x] : printable_prop (¬ x)
⟨ do x' ← print_prop x, some sformat!"¬ {x'}" ⟩
instance
slim_check.not.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
true.printable_prop : printable_prop true
⟨ some "true" ⟩
instance
slim_check.true.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
false.printable_prop : printable_prop false
⟨ some "false" ⟩
instance
slim_check.false.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
bool.printable_prop (b : bool) : printable_prop b
⟨ some $ if b then "true" else "false" ⟩
instance
slim_check.bool.printable_prop
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
retry (cmd : rand (test_result p)) : ℕ → rand (test_result p)
| 0 := return $ gave_up 1 | (succ n) := do r ← cmd, match r with | success hp := return $ success hp | (failure Hce xs n) := return (failure Hce xs n) | (gave_up _) := retry n end
def
slim_check.retry
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "rand" ]
Execute `cmd` and repeat every time the result is `gave_up` (at most `n` times).
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
give_up (x : ℕ) : test_result p → test_result p
| (success (psum.inl ())) := gave_up x | (success (psum.inr p)) := success (psum.inr p) | (gave_up n) := gave_up (n+x) | (failure Hce xs n) := failure Hce xs n
def
slim_check.give_up
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Count the number of times the test procedure gave up.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
testable.run_suite_aux (cfg : slim_check_cfg) : test_result p → ℕ → rand (test_result p)
| r 0 := return r | r (succ n) := do let size := (cfg.num_inst - n - 1) * cfg.max_size / cfg.num_inst, when cfg.trace_success $ return $ trace sformat!"[slim_check: sample]" (), x ← retry ( (testable.run p cfg tt).run ⟨ size ⟩) 10, match x with | (success (psum.inl ())) := testable.run_suite_aux r n | (s...
def
slim_check.testable.run_suite_aux
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "rand" ]
Try `n` times to find a counter-example for `p`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
testable.run_suite (cfg : slim_check_cfg := {}) : rand (test_result p)
testable.run_suite_aux p cfg (success $ psum.inl ()) cfg.num_inst
def
slim_check.testable.run_suite
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "rand" ]
Try to find a counter-example of `p`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
testable.check' (cfg : slim_check_cfg := {}) : io (test_result p)
match cfg.random_seed with | some seed := io.run_rand_with seed (testable.run_suite p cfg) | none := io.run_rand (testable.run_suite p cfg) end
def
slim_check.testable.check'
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "io.run_rand", "io.run_rand_with" ]
Run a test suite for `p` in `io`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_existential_decorations : expr → expr
| e@`(@Exists %%α %%(lam n bi d b)) := let n := to_string n in const ``named_binder [] (`(n) : expr) e | e := e
def
slim_check.tactic.add_existential_decorations
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
`add_existential_decorations p` adds `a `named_binder` annotation at the root of `p` if `p` is an existential quantification.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_decorations : expr → expr | e
e.replace $ λ e _, match e with | (pi n bi d b) := let n := to_string n in some $ const ``named_binder [] (`(n) : expr) (pi n bi (add_existential_decorations d) (add_decorations b)) | e := none end
def
slim_check.tactic.add_decorations
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
Traverse the syntax of a proposition to find universal quantifiers and existential quantifiers and add `named_binder` annotations next to them.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
decorations_of (p : Prop)
Prop
def
slim_check.tactic.decorations_of
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
`decorations_of p` is used as a hint to `mk_decorations` to specify that the goal should be satisfied with a proposition equivalent to `p` with added annotations.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
mk_decorations : tactic unit
do `(tactic.decorations_of %%p) ← target, exact $ add_decorations p
def
slim_check.tactic.mk_decorations
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[]
In a goal of the shape `⊢ tactic.decorations_of p`, `mk_decoration` examines the syntax of `p` and add `named_binder` around universal quantifications and existential quantifications to improve error messages. This tool can be used in the declaration of a function as follows: ```lean def foo (p : Prop) (p' : tactic.d...
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
testable.check (p : Prop) (cfg : slim_check_cfg := {}) (p' : tactic.decorations_of p . tactic.mk_decorations) [testable p'] : io punit
do x ← match cfg.random_seed with | some seed := io.run_rand_with seed (testable.run_suite p' cfg) | none := io.run_rand (testable.run_suite p' cfg) end, match x with | (success _) := when (¬ cfg.quiet) $ io.put_str_ln "Success" | (gave_up n) := io.fail sformat!"Gave up {repr n} times" | (failure _ xs n) :=...
def
slim_check.testable.check
testing.slim_check
src/testing/slim_check/testable.lean
[ "testing.slim_check.sampleable" ]
[ "io.run_rand", "io.run_rand_with" ]
Run a test suite for `p` and return true or false: should we believe that `p` holds?
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
alexandroff (X : Type*)
option X
def
alexandroff
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[]
The Alexandroff extension of an arbitrary topological space `X`
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
infty : alexandroff X
none
def
alexandroff.infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
The point at infinity
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
infinite [infinite X] : infinite (alexandroff X)
option.infinite
instance
alexandroff.infinite
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "infinite" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
coe_injective : function.injective (coe : X → alexandroff X)
option.some_injective X
lemma
alexandroff.coe_injective
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "option.some_injective" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
coe_eq_coe {x y : X} : (x : alexandroff X) = y ↔ x = y
coe_injective.eq_iff
lemma
alexandroff.coe_eq_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
coe_ne_infty (x : X) : (x : alexandroff X) ≠ ∞
lemma
alexandroff.coe_ne_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
infty_ne_coe (x : X) : ∞ ≠ (x : alexandroff X)
lemma
alexandroff.infty_ne_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
rec (C : alexandroff X → Sort*) (h₁ : C ∞) (h₂ : Π x : X, C x) : Π (z : alexandroff X), C z
option.rec h₁ h₂
def
alexandroff.rec
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
Recursor for `alexandroff` using the preferred forms `∞` and `↑x`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_compl_range_coe_infty : is_compl (range (coe : X → alexandroff X)) {∞}
is_compl_range_some_none X
lemma
alexandroff.is_compl_range_coe_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_compl" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
range_coe_union_infty : (range (coe : X → alexandroff X) ∪ {∞}) = univ
range_some_union_none X
lemma
alexandroff.range_coe_union_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
range_coe_inter_infty : (range (coe : X → alexandroff X) ∩ {∞}) = ∅
range_some_inter_none X
lemma
alexandroff.range_coe_inter_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
compl_range_coe : (range (coe : X → alexandroff X))ᶜ = {∞}
compl_range_some X
lemma
alexandroff.compl_range_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
compl_infty : ({∞}ᶜ : set (alexandroff X)) = range (coe : X → alexandroff X)
(@is_compl_range_coe_infty X).symm.compl_eq
lemma
alexandroff.compl_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
compl_image_coe (s : set X) : (coe '' s : set (alexandroff X))ᶜ = coe '' sᶜ ∪ {∞}
by rw [coe_injective.compl_image_eq, compl_range_coe]
lemma
alexandroff.compl_image_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ne_infty_iff_exists {x : alexandroff X} : x ≠ ∞ ↔ ∃ (y : X), (y : alexandroff X) = x
by induction x using alexandroff.rec; simp
lemma
alexandroff.ne_infty_iff_exists
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "alexandroff.rec" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
can_lift : can_lift (alexandroff X) X coe (λ x, x ≠ ∞)
with_top.can_lift
instance
alexandroff.can_lift
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "can_lift", "with_top.can_lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
not_mem_range_coe_iff {x : alexandroff X} : x ∉ range (coe : X → alexandroff X) ↔ x = ∞
by rw [← mem_compl_iff, compl_range_coe, mem_singleton_iff]
lemma
alexandroff.not_mem_range_coe_iff
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
infty_not_mem_range_coe : ∞ ∉ range (coe : X → alexandroff X)
not_mem_range_coe_iff.2 rfl
lemma
alexandroff.infty_not_mem_range_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
infty_not_mem_image_coe {s : set X} : ∞ ∉ (coe : X → alexandroff X) '' s
not_mem_subset (image_subset_range _ _) infty_not_mem_range_coe
lemma
alexandroff.infty_not_mem_image_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
coe_preimage_infty : (coe : X → alexandroff X) ⁻¹' {∞} = ∅
by { ext, simp }
lemma
alexandroff.coe_preimage_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_def : is_open s ↔ (∞ ∈ s → is_compact (coe ⁻¹' s : set X)ᶜ) ∧ is_open (coe ⁻¹' s : set X)
iff.rfl
lemma
alexandroff.is_open_def
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "is_compact", "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_iff_of_mem' (h : ∞ ∈ s) : is_open s ↔ is_compact (coe ⁻¹' s : set X)ᶜ ∧ is_open (coe ⁻¹' s : set X)
by simp [is_open_def, h]
lemma
alexandroff.is_open_iff_of_mem'
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "is_compact", "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_iff_of_mem (h : ∞ ∈ s) : is_open s ↔ is_closed (coe ⁻¹' s : set X)ᶜ ∧ is_compact (coe ⁻¹' s : set X)ᶜ
by simp only [is_open_iff_of_mem' h, is_closed_compl_iff, and.comm]
lemma
alexandroff.is_open_iff_of_mem
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "is_closed", "is_closed_compl_iff", "is_compact", "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_iff_of_not_mem (h : ∞ ∉ s) : is_open s ↔ is_open (coe ⁻¹' s : set X)
by simp [is_open_def, h]
lemma
alexandroff.is_open_iff_of_not_mem
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_closed_iff_of_mem (h : ∞ ∈ s) : is_closed s ↔ is_closed (coe ⁻¹' s : set X)
have ∞ ∉ sᶜ, from λ H, H h, by rw [← is_open_compl_iff, is_open_iff_of_not_mem this, ← is_open_compl_iff, preimage_compl]
lemma
alexandroff.is_closed_iff_of_mem
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "is_closed", "is_open_compl_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_closed_iff_of_not_mem (h : ∞ ∉ s) : is_closed s ↔ is_closed (coe ⁻¹' s : set X) ∧ is_compact (coe ⁻¹' s : set X)
by rw [← is_open_compl_iff, is_open_iff_of_mem (mem_compl h), ← preimage_compl, compl_compl]
lemma
alexandroff.is_closed_iff_of_not_mem
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "compl_compl", "is_closed", "is_compact", "is_open_compl_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_image_coe {s : set X} : is_open (coe '' s : set (alexandroff X)) ↔ is_open s
by rw [is_open_iff_of_not_mem infty_not_mem_image_coe, preimage_image_eq _ coe_injective]
lemma
alexandroff.is_open_image_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_compl_image_coe {s : set X} : is_open (coe '' s : set (alexandroff X))ᶜ ↔ is_closed s ∧ is_compact s
begin rw [is_open_iff_of_mem, ← preimage_compl, compl_compl, preimage_image_eq _ coe_injective], exact infty_not_mem_image_coe end
lemma
alexandroff.is_open_compl_image_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "compl_compl", "is_closed", "is_compact", "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_closed_image_coe {s : set X} : is_closed (coe '' s : set (alexandroff X)) ↔ is_closed s ∧ is_compact s
by rw [← is_open_compl_iff, is_open_compl_image_coe]
lemma
alexandroff.is_closed_image_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_closed", "is_compact", "is_open_compl_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
opens_of_compl (s : set X) (h₁ : is_closed s) (h₂ : is_compact s) : topological_space.opens (alexandroff X)
⟨(coe '' s)ᶜ, is_open_compl_image_coe.2 ⟨h₁, h₂⟩⟩
def
alexandroff.opens_of_compl
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_closed", "is_compact", "topological_space.opens" ]
An open set in `alexandroff X` constructed from a closed compact set in `X`
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
infty_mem_opens_of_compl {s : set X} (h₁ : is_closed s) (h₂ : is_compact s) : ∞ ∈ opens_of_compl s h₁ h₂
mem_compl infty_not_mem_image_coe
lemma
alexandroff.infty_mem_opens_of_compl
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "is_closed", "is_compact" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
continuous_coe : continuous (coe : X → alexandroff X)
continuous_def.mpr (λ s hs, hs.right)
lemma
alexandroff.continuous_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "continuous" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_map_coe : is_open_map (coe : X → alexandroff X)
λ s, is_open_image_coe.2
lemma
alexandroff.is_open_map_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_open_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
open_embedding_coe : open_embedding (coe : X → alexandroff X)
open_embedding_of_continuous_injective_open continuous_coe coe_injective is_open_map_coe
lemma
alexandroff.open_embedding_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "open_embedding", "open_embedding_of_continuous_injective_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_open_range_coe : is_open (range (coe : X → alexandroff X))
open_embedding_coe.open_range
lemma
alexandroff.is_open_range_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_closed_infty : is_closed ({∞} : set (alexandroff X))
by { rw [← compl_range_coe, is_closed_compl_iff], exact is_open_range_coe }
lemma
alexandroff.is_closed_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_closed", "is_closed_compl_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_coe_eq (x : X) : 𝓝 ↑x = map (coe : X → alexandroff X) (𝓝 x)
(open_embedding_coe.map_nhds_eq x).symm
lemma
alexandroff.nhds_coe_eq
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_within_coe_image (s : set X) (x : X) : 𝓝[coe '' s] (x : alexandroff X) = map coe (𝓝[s] x)
(open_embedding_coe.to_embedding.map_nhds_within_eq _ _).symm
lemma
alexandroff.nhds_within_coe_image
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_within_coe (s : set (alexandroff X)) (x : X) : 𝓝[s] ↑x = map coe (𝓝[coe ⁻¹' s] x)
(open_embedding_coe.map_nhds_within_preimage_eq _ _).symm
lemma
alexandroff.nhds_within_coe
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
comap_coe_nhds (x : X) : comap (coe : X → alexandroff X) (𝓝 x) = 𝓝 x
(open_embedding_coe.to_inducing.nhds_eq_comap x).symm
lemma
alexandroff.comap_coe_nhds
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_within_compl_coe_ne_bot (x : X) [h : ne_bot (𝓝[≠] x)] : ne_bot (𝓝[≠] (x : alexandroff X))
by simpa [nhds_within_coe, preimage, coe_eq_coe] using h.map coe
instance
alexandroff.nhds_within_compl_coe_ne_bot
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff" ]
If `x` is not an isolated point of `X`, then `x : alexandroff X` is not an isolated point of `alexandroff X`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_within_compl_infty_eq : 𝓝[≠] (∞ : alexandroff X) = map coe (coclosed_compact X)
begin refine (nhds_within_basis_open ∞ _).ext (has_basis_coclosed_compact.map _) _ _, { rintro s ⟨hs, hso⟩, refine ⟨_, (is_open_iff_of_mem hs).mp hso, _⟩, simp }, { rintro s ⟨h₁, h₂⟩, refine ⟨_, ⟨mem_compl infty_not_mem_image_coe, is_open_compl_image_coe.2 ⟨h₁, h₂⟩⟩, _⟩, simp [compl_image_coe, ← d...
lemma
alexandroff.nhds_within_compl_infty_eq
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "nhds_within_basis_open" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_within_compl_infty_ne_bot [noncompact_space X] : ne_bot (𝓝[≠] (∞ : alexandroff X))
by { rw nhds_within_compl_infty_eq, apply_instance }
instance
alexandroff.nhds_within_compl_infty_ne_bot
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "noncompact_space" ]
If `X` is a non-compact space, then `∞` is not an isolated point of `alexandroff X`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_within_compl_ne_bot [∀ x : X, ne_bot (𝓝[≠] x)] [noncompact_space X] (x : alexandroff X) : ne_bot (𝓝[≠] x)
alexandroff.rec _ alexandroff.nhds_within_compl_infty_ne_bot (λ y, alexandroff.nhds_within_compl_coe_ne_bot y) x
instance
alexandroff.nhds_within_compl_ne_bot
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "alexandroff.nhds_within_compl_coe_ne_bot", "alexandroff.nhds_within_compl_infty_ne_bot", "alexandroff.rec", "noncompact_space" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nhds_infty_eq : 𝓝 (∞ : alexandroff X) = map coe (coclosed_compact X) ⊔ pure ∞
by rw [← nhds_within_compl_infty_eq, nhds_within_compl_singleton_sup_pure]
lemma
alexandroff.nhds_infty_eq
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "nhds_within_compl_singleton_sup_pure" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
has_basis_nhds_infty : (𝓝 (∞ : alexandroff X)).has_basis (λ s : set X, is_closed s ∧ is_compact s) (λ s, coe '' sᶜ ∪ {∞})
begin rw nhds_infty_eq, exact (has_basis_coclosed_compact.map _).sup_pure _ end
lemma
alexandroff.has_basis_nhds_infty
topology
src/topology/alexandroff.lean
[ "data.fintype.option", "topology.separation", "topology.sets.opens" ]
[ "alexandroff", "is_closed", "is_compact" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83