Can I forgive someone who has not directly hurt me? For example, I am a teacher and one of my students was deliberately hurt by another student. Can I forgive the one who acted badly to a student whom I admire for his honesty and perseverance?
You describe a situation which some philosophers call secondary forgiveness. In other words, you have been hurt indirectly rather than directly by a person’s injustice toward someone who is important to you. Whenever an injustice occurs which hurts you, then you are free to forgive. This can occur even when you do not know the victim(s) but experience hurt nonetheless. An example of this tertiary forgiveness is this: the leader of your country enters into what you consider to be an unjust war with another country. You can forgive the leader if that is your choice to do so.