I want to consider embedding a relation to another type, and I defined:
definition inc_rel where
"inc_rel i R ≡ {p. (∃ r1 r2. (r1,r2) ∈ R ∧ p = (i r1, i r2))}"
inc_rel is supposed to embed R via an injection i.
I want as an effect:
theorem rtrancl_inj:
assumes "inj_on i (Domain R ∪ Range R)"
shows " inc_rel i (R⇧*) = (inc_rel i R)⇧*" using assms
However, nitpick tells me that is wrong.
Nitpicking goal:
inj_on i (Domain R ∪ Range R) ⟹
inc_rel i (R⇧*) = (inc_rel i R)⇧*
Nitpick found a quasi genuine counterexample
for card 'b = 3 and card 'a = 2:
Free variables:
R = {}
i = (λx. _)(a⇩1 := b⇩1, a⇩2 := b⇩2)
Try again with "user_axioms" set to "true" to
confirm that the counterexample is genuine
But it then seems that it does not conceive my definition of inc_rel correctly. I expect the both (inc_rel I R)^*
and inc_rel i R^*
are empty, given that R is empty.
What is wrong here?
Nitpick is telling you that it is not sure if the counter example is correct: found a quasi genuine counterexample
Quickchecks claims to have found a counterexample:
Testing conjecture with Quickcheck-exhaustive...
Quickcheck found a counterexample:
i = (λx. undefined)(a⇩1 := a⇩1, a⇩2 := a⇩1)
R = {}
Evaluated terms:
inc_rel i (R⇧*) = {(a⇩1, a⇩1), (a⇩1, a⇩1)}
(inc_rel i R)⇧* = {(a⇩1, a⇩1), (a⇩2, a⇩2)}
but it looks wrong too
Again I think both relations should be empty.
I see, that is helpful to know that counter-example finders can be wrong...
BTW are you aware of anything that considers the image of relations under functions?
Ahhhhh
you do not want the reflexive transitive closure
only the transitive closure, right?
I just find it annoying to prove the image of a tree relation is a tree...
I want both, actually.
So actually, the counter example is not wrong, your theorem does not mean what you think it means
lemma ‹rtrancl {} = (λx. (x,x)) ` UNIV›
by auto
I wonder why it is defined like this... Let me check the definition.
Yiming Xu said:
BTW are you aware of anything that considers the image of relations under functions?
you mean about f `` R
?
Yiming Xu said:
I wonder why it is defined like this... Let me check the definition.
reflexive transitive closure
it must be _reflexive_
Not only making the ones that is already in the relation reflexive, I see.
that why there is also the transitive closure (^+
in Isabelle)
So is there anything consider the image of transitive closure?
Fair enough if nothing exists yet...
Thankfully I just convinced that my usage of it in my theorems is not wrong. I was panic for a moment.
Yiming Xu said:
So is there anything consider the image of transitive closure?
term ‹Image ((rtrancl A) :: ('a × 'a) set)›
?
or are you talking about something else?
I mean the image under a function.
Here I actually only care about injective functions.
Can you write it down formally? I do not know what that is.
definition im_rel where
"im_rel i R ≡ {p. (∃ r1 r2. (r1,r2) ∈ R ∧ p = (i r1, i r2))}"
term ‹(range (λx. (f x,f x))) O R›
I know the (λx. (f x,f x))
has a name, but it is escaping me right now
Thanks! That is helpful to know. I will bug people around.
Last updated: Mar 09 2025 at 12:28 UTC